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

4
package-lock.json generated
View File

@@ -1835,7 +1835,7 @@
},
"node_modules/@quartz-community/types": {
"version": "0.2.1",
"resolved": "git+ssh://git@github.com/quartz-community/types.git#b1dc9ac610c253d0673d1c8c9a695cd4c5aac0ae",
"resolved": "git+ssh://git@github.com/quartz-community/types.git#d413569b02ff0cd9a7e8d74dee125d20a5e5ec72",
"dev": true,
"license": "MIT",
"engines": {
@@ -1857,7 +1857,7 @@
},
"node_modules/@quartz-community/utils": {
"version": "0.1.0",
"resolved": "git+ssh://git@github.com/quartz-community/utils.git#8b6e32ba07b62500dce10f0c79ca43bb7d7e55bc",
"resolved": "git+ssh://git@github.com/quartz-community/utils.git#20b1ac1844ea477b4e32f206a515a5be8d01c56e",
"dev": true,
"license": "MIT",
"dependencies": {

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"
}
}