refactor: move vfile DataMap augmentation to @quartz-community/types

This commit is contained in:
saberzero1
2026-04-03 15:41:11 +02:00
parent b7885ce779
commit 0c50cca1f6
2 changed files with 2 additions and 52 deletions

View File

@@ -1,8 +1,5 @@
import { StaticResources } from "../util/resources"
import { FilePath, FullSlug, SimpleSlug } from "../util/path"
import { BuildCtx } from "../util/ctx"
import { Root as HtmlRoot } from "hast"
import { Element } from "hast"
export function getStaticResourcesFromPlugins(ctx: BuildCtx) {
const staticResources: StaticResources = {
@@ -51,50 +48,3 @@ export * from "./types"
export * from "./config"
export * as PageTypes from "./pageTypes"
export * as PluginLoader from "./loader"
declare module "vfile" {
// inserted in processors.ts
interface DataMap {
slug: FullSlug
filePath: FilePath
relativePath: FilePath
// from description transformer
description: string
text: string
// from crawl-links transformer
links: SimpleSlug[]
// from table-of-contents transformer
toc: { depth: number; text: string; slug: string }[]
collapseToc: boolean
// from obsidian-flavored-markdown transformer
blocks: Record<string, Element>
htmlAst: HtmlRoot
hasMermaidDiagram: boolean | undefined
// from frontmatter transformer (e.g. note-properties)
frontmatter: { [key: string]: unknown } & {
title: string
} & Partial<{
tags: string[]
aliases: string[]
modified: string
created: string
published: string
description: string
socialDescription: string
publish: boolean | string
draft: boolean | string
lang: string
enableToc: string
cssclasses: string[]
socialImage: string
comments: boolean | string
}>
// from created-modified-date transformer
dates: {
created: Date
modified: Date
published: Date
}
defaultDateType?: "created" | "modified" | "published"
}
}