@quartz-community/types 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -218,8 +218,8 @@ interface PageFrameProps {
218
218
  left: QuartzComponent[];
219
219
  /** Right sidebar components */
220
220
  right: QuartzComponent[];
221
- /** Footer component */
222
- footer: QuartzComponent;
221
+ /** Footer components */
222
+ footer: QuartzComponent[];
223
223
  }
224
224
  /**
225
225
  * A PageFrame defines the inner HTML structure of a page inside the
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Root as HtmlRoot } from \"hast\";\nimport type { Root as MdRoot } from \"mdast\";\nimport type { Data, VFile } from \"vfile\";\nimport type { PluggableList } from \"unified\";\n\n// ============================================================================\n// Path Types - Branded string types for type-safe file paths\n// ============================================================================\n\nexport type FilePath = string & { _brand: \"FilePath\" };\nexport type FullSlug = string & { _brand: \"FullSlug\" };\nexport type SimpleSlug = string & { _brand: \"SimpleSlug\" };\n\nexport function joinSegments(...segments: string[]): FilePath {\n return segments\n .filter((segment) => segment.length > 0)\n .join(\"/\")\n .replace(/\\/+/g, \"/\") as FilePath;\n}\n\n// ============================================================================\n// Resource Types - CSS/JS resources that plugins can inject\n// ============================================================================\n\nexport type JSResource =\n | {\n loadTime: \"beforeDOMReady\" | \"afterDOMReady\";\n moduleType?: \"module\";\n spaPreserve?: boolean;\n src: string;\n contentType: \"external\";\n }\n | {\n loadTime: \"beforeDOMReady\" | \"afterDOMReady\";\n moduleType?: \"module\";\n spaPreserve?: boolean;\n script: string;\n contentType: \"inline\";\n };\n\nexport type CSSResource = {\n content: string;\n inline?: boolean;\n spaPreserve?: boolean;\n};\n\nexport interface StaticResources {\n css: CSSResource[];\n js: JSResource[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalHead: any[];\n}\n\n// ============================================================================\n// Config Types - Quartz configuration\n// ============================================================================\n\n/**\n * Flat configuration object that components receive as `cfg` prop.\n * This matches Quartz's `GlobalConfiguration` — the resolved config\n * passed to components at render time (i.e. `ctx.cfg.configuration`).\n */\nexport interface GlobalConfiguration {\n pageTitle?: string;\n pageTitleSuffix?: string;\n enableSPA?: boolean;\n enablePopovers?: boolean;\n analytics?: unknown;\n ignorePatterns?: string[];\n defaultDateType?: string;\n baseUrl?: string;\n theme?: unknown;\n locale?: string;\n}\n\n/**\n * Full Quartz config with nested `configuration` property.\n * This is what `BuildCtx.cfg` holds — used in plugin hooks\n * (transformers, filters, emitters), NOT in component props.\n */\nexport interface QuartzConfig {\n configuration: GlobalConfiguration;\n plugins?: unknown;\n externalPlugins?: unknown;\n}\n\n// ============================================================================\n// Context Types - Build context passed to plugin hooks\n// ============================================================================\n\nexport interface Argv {\n directory: string;\n verbose: boolean;\n output: string;\n serve: boolean;\n watch: boolean;\n port: number;\n wsPort: number;\n remoteDevHost?: string;\n concurrency?: number;\n}\n\nexport interface BuildCtx {\n buildId: string;\n argv: Argv;\n cfg: QuartzConfig;\n allSlugs: FullSlug[];\n allFiles: FilePath[];\n incremental: boolean;\n}\n\n// ============================================================================\n// VFile Types - Content data types\n// ============================================================================\n\nexport type QuartzPluginData = Data;\nexport type MarkdownContent = [MdRoot, VFile];\nexport type ProcessedContent = [HtmlRoot, VFile];\n\n// ============================================================================\n// Core Component Types - The contract between Quartz and plugins\n// ============================================================================\n\nexport type QuartzComponentProps = {\n ctx: unknown;\n externalResources: StaticResources;\n fileData: QuartzPluginData & Record<string, unknown>;\n cfg: GlobalConfiguration;\n children: unknown;\n tree: unknown;\n allFiles: (QuartzPluginData & Record<string, unknown>)[];\n displayClass?: \"mobile-only\" | \"desktop-only\";\n [key: string]: unknown;\n};\n\nexport type QuartzComponent = ((props: QuartzComponentProps) => unknown) & {\n css?: string | string[] | undefined;\n beforeDOMLoaded?: string | string[] | undefined;\n afterDOMLoaded?: string | string[] | undefined;\n};\n\nexport type QuartzComponentConstructor<\n Options extends object | undefined = undefined,\n> = (opts?: Options) => QuartzComponent;\n\nexport type StringResource = string | string[];\n\n// ============================================================================\n// Plugin Types - What Quartz expects from plugins\n// ============================================================================\n\ntype OptionType = object | undefined;\ntype ExternalResourcesFn = (\n ctx: BuildCtx,\n) => Partial<StaticResources> | undefined;\n\nexport type { ExternalResourcesFn };\n\nexport interface PluginTypes {\n transformers: QuartzTransformerPluginInstance[];\n filters: QuartzFilterPluginInstance[];\n emitters: QuartzEmitterPluginInstance[];\n pageTypes: QuartzPageTypePluginInstance[];\n}\n\nexport type QuartzTransformerPlugin<Options extends OptionType = undefined> = (\n opts?: Options,\n) => QuartzTransformerPluginInstance;\n\nexport type QuartzTransformerPluginInstance = {\n name: string;\n textTransform?: (ctx: BuildCtx, src: string) => string;\n markdownPlugins?: (ctx: BuildCtx) => PluggableList;\n htmlPlugins?: (ctx: BuildCtx) => PluggableList;\n externalResources?: ExternalResourcesFn;\n};\n\nexport type QuartzFilterPlugin<Options extends OptionType = undefined> = (\n opts?: Options,\n) => QuartzFilterPluginInstance;\n\nexport type QuartzFilterPluginInstance = {\n name: string;\n shouldPublish(ctx: BuildCtx, content: ProcessedContent): boolean;\n};\n\nexport type ChangeEvent = {\n type: \"add\" | \"change\" | \"delete\";\n path: FilePath;\n file?: VFile;\n};\n\nexport type QuartzEmitterPlugin<Options extends OptionType = undefined> = (\n opts?: Options,\n) => QuartzEmitterPluginInstance;\n\nexport type QuartzEmitterPluginInstance = {\n name: string;\n emit: (\n ctx: BuildCtx,\n content: ProcessedContent[],\n resources: StaticResources,\n ) => Promise<FilePath[]> | AsyncGenerator<FilePath>;\n partialEmit?: (\n ctx: BuildCtx,\n content: ProcessedContent[],\n resources: StaticResources,\n changeEvents: ChangeEvent[],\n ) => Promise<FilePath[]> | AsyncGenerator<FilePath> | null;\n getQuartzComponents?: (ctx: BuildCtx) => QuartzComponent[];\n externalResources?: ExternalResourcesFn;\n};\n\n// ============================================================================\n// PageType Plugin Types - Declarative page rendering plugins\n// ============================================================================\n\n/**\n * Matcher function: determines if a source file belongs to a page type.\n * Returns true if the page type should own this file.\n */\nexport type PageMatcher = (args: {\n slug: FullSlug;\n fileData: QuartzPluginData & Record<string, unknown>;\n cfg: GlobalConfiguration;\n}) => boolean;\n\n/**\n * Virtual page descriptor for page types that generate pages\n * from aggregated data (e.g., tag indexes, folder listings).\n */\nexport interface VirtualPage {\n slug: FullSlug;\n title: string;\n data: Partial<QuartzPluginData> & Record<string, unknown>;\n}\n\n/**\n * Generator function: produces virtual pages from all processed content.\n * Used by page types that don't match source files but instead create\n * synthetic pages (e.g., one page per tag, one page per folder).\n */\nexport type PageGenerator = (args: {\n content: ProcessedContent[];\n cfg: GlobalConfiguration;\n ctx: BuildCtx;\n}) => VirtualPage[];\n\n/** A function that mutates a HAST tree at render time, when allFiles is available. */\nexport type TreeTransform = (\n root: HtmlRoot,\n slug: FullSlug,\n componentData: QuartzComponentProps,\n) => void;\n\n/**\n * A PageType plugin definition.\n *\n * PageTypes are a declarative abstraction over page-rendering emitters.\n * Each PageType declares which files it owns (via `match`), optionally\n * generates virtual pages (via `generate`), and provides a body component\n * and layout reference for rendering.\n */\nexport type QuartzPageTypePlugin<Options extends OptionType = undefined> = (\n opts?: Options,\n) => QuartzPageTypePluginInstance;\n\nexport type QuartzPageTypePluginInstance = {\n name: string;\n /** Higher priority wins when multiple page types match the same file. Default: 0. */\n priority?: number;\n /** File extensions this page type handles (e.g. [\".canvas\"]). Files with these extensions are excluded from the default asset emitter and processed by generate() instead. */\n fileExtensions?: string[];\n /** Determines which source files this page type owns. */\n match: PageMatcher;\n /** Produces virtual pages from aggregated content data. */\n generate?: PageGenerator;\n /** Layout key — references a key in `layout.byPageType`. */\n layout: string;\n /** Optional page frame name (e.g. \"default\", \"full-width\", \"canvas\"). Defaults to \"default\". */\n frame?: string;\n /** The body component constructor for this page type. */\n body: QuartzComponentConstructor;\n /** Optional render-time HAST tree transforms (e.g. resolving inline codeblocks). */\n treeTransforms?: (ctx: BuildCtx) => TreeTransform[];\n};\n\n// ============================================================================\n// PageFrame Types — Custom page layout frames\n// ============================================================================\n\n/**\n * Props passed to a PageFrame's render function.\n * Contains the resolved layout components and the shared component data.\n */\nexport interface PageFrameProps {\n /** Component data shared across all components on the page */\n componentData: QuartzComponentProps;\n /** The Head component (rendered in <head>) — NOT used by frames, included for completeness */\n head: QuartzComponent;\n /** Header slot components (rendered inside <header>) */\n header: QuartzComponent[];\n /** Components rendered before the page body */\n beforeBody: QuartzComponent[];\n /** The page body component (Content) */\n pageBody: QuartzComponent;\n /** Components rendered after the page body */\n afterBody: QuartzComponent[];\n /** Left sidebar components */\n left: QuartzComponent[];\n /** Right sidebar components */\n right: QuartzComponent[];\n /** Footer component */\n footer: QuartzComponent;\n}\n\n/**\n * A PageFrame defines the inner HTML structure of a page inside the\n * `<div id=\"quartz-root\">` shell. Different frames can produce completely\n * different layouts (e.g. with/without sidebars, horizontal scroll, etc.)\n * while the outer shell (html, head, body, quartz-root) remains stable\n * for SPA navigation.\n *\n * The `render` function returns `unknown` to avoid coupling to a specific\n * JSX runtime (Preact, React, etc.). Quartz core casts this to JSX.Element.\n */\nexport interface PageFrame {\n /** Unique name for this frame (e.g. \"default\", \"full-width\", \"canvas\") */\n name: string;\n /** Render the inner page structure. Returns a JSX tree to be placed inside Body > #quartz-body. */\n render: (props: PageFrameProps) => unknown;\n /** Optional CSS string to include when this frame is active */\n css?: string;\n}\n\nexport type HTMLAttributes = Record<\n string,\n string | number | boolean | undefined\n>;\n\nexport type EventHandler = (event: Event) => void;\n\nexport type CleanupFunction = () => void;\n\nexport type ClassValue =\n | string\n | number\n | boolean\n | undefined\n | null\n | ClassValue[];\n\n// ============================================================================\n// Content Index Types - Data shape for contentIndex.json\n// ============================================================================\n\nexport type ContentDetails = {\n slug: FullSlug;\n filePath: FilePath;\n title: string;\n links: string[];\n tags: string[];\n content: string;\n richContent?: string;\n date?: Date;\n description?: string;\n};\n\nexport type ContentIndex = Record<FullSlug, ContentDetails>;\n\n// ============================================================================\n// Sort & Theme Types\n// ============================================================================\n\nexport type SortFn = (f1: QuartzPluginData, f2: QuartzPluginData) => number;\n\nexport type ThemeKey = \"lightMode\" | \"darkMode\";\n\nexport type ValidDateType = \"created\" | \"modified\" | \"published\";\n\n// ============================================================================\n// VFile DataMap Augmentation — canonical vfile shape for Quartz\n// ============================================================================\n\ndeclare module \"vfile\" {\n interface DataMap {\n slug: FullSlug;\n filePath: FilePath;\n relativePath: FilePath;\n description: string;\n text: string;\n links: SimpleSlug[];\n toc: { depth: number; text: string; slug: string }[];\n collapseToc: boolean;\n blocks: Record<string, import(\"hast\").Element>;\n htmlAst: import(\"hast\").Root;\n hasMermaidDiagram: boolean | undefined;\n frontmatter: { [key: string]: unknown } & {\n title: string;\n } & Partial<{\n tags: string[];\n aliases: string[];\n modified: string;\n created: string;\n published: string;\n description: string;\n socialDescription: string;\n publish: boolean | string;\n draft: boolean | string;\n lang: string;\n enableToc: string;\n cssclasses: string[];\n socialImage: string;\n comments: boolean | string;\n }>;\n dates: {\n created: Date;\n modified: Date;\n published: Date;\n };\n defaultDateType?: ValidDateType;\n }\n}\n"],"mappings":";AAaO,SAAS,gBAAgB,UAA8B;AAC5D,SAAO,SACJ,OAAO,CAAC,YAAY,QAAQ,SAAS,CAAC,EACtC,KAAK,GAAG,EACR,QAAQ,QAAQ,GAAG;AACxB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Root as HtmlRoot } from \"hast\";\nimport type { Root as MdRoot } from \"mdast\";\nimport type { Data, VFile } from \"vfile\";\nimport type { PluggableList } from \"unified\";\n\n// ============================================================================\n// Path Types - Branded string types for type-safe file paths\n// ============================================================================\n\nexport type FilePath = string & { _brand: \"FilePath\" };\nexport type FullSlug = string & { _brand: \"FullSlug\" };\nexport type SimpleSlug = string & { _brand: \"SimpleSlug\" };\n\nexport function joinSegments(...segments: string[]): FilePath {\n return segments\n .filter((segment) => segment.length > 0)\n .join(\"/\")\n .replace(/\\/+/g, \"/\") as FilePath;\n}\n\n// ============================================================================\n// Resource Types - CSS/JS resources that plugins can inject\n// ============================================================================\n\nexport type JSResource =\n | {\n loadTime: \"beforeDOMReady\" | \"afterDOMReady\";\n moduleType?: \"module\";\n spaPreserve?: boolean;\n src: string;\n contentType: \"external\";\n }\n | {\n loadTime: \"beforeDOMReady\" | \"afterDOMReady\";\n moduleType?: \"module\";\n spaPreserve?: boolean;\n script: string;\n contentType: \"inline\";\n };\n\nexport type CSSResource = {\n content: string;\n inline?: boolean;\n spaPreserve?: boolean;\n};\n\nexport interface StaticResources {\n css: CSSResource[];\n js: JSResource[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalHead: any[];\n}\n\n// ============================================================================\n// Config Types - Quartz configuration\n// ============================================================================\n\n/**\n * Flat configuration object that components receive as `cfg` prop.\n * This matches Quartz's `GlobalConfiguration` — the resolved config\n * passed to components at render time (i.e. `ctx.cfg.configuration`).\n */\nexport interface GlobalConfiguration {\n pageTitle?: string;\n pageTitleSuffix?: string;\n enableSPA?: boolean;\n enablePopovers?: boolean;\n analytics?: unknown;\n ignorePatterns?: string[];\n defaultDateType?: string;\n baseUrl?: string;\n theme?: unknown;\n locale?: string;\n}\n\n/**\n * Full Quartz config with nested `configuration` property.\n * This is what `BuildCtx.cfg` holds — used in plugin hooks\n * (transformers, filters, emitters), NOT in component props.\n */\nexport interface QuartzConfig {\n configuration: GlobalConfiguration;\n plugins?: unknown;\n externalPlugins?: unknown;\n}\n\n// ============================================================================\n// Context Types - Build context passed to plugin hooks\n// ============================================================================\n\nexport interface Argv {\n directory: string;\n verbose: boolean;\n output: string;\n serve: boolean;\n watch: boolean;\n port: number;\n wsPort: number;\n remoteDevHost?: string;\n concurrency?: number;\n}\n\nexport interface BuildCtx {\n buildId: string;\n argv: Argv;\n cfg: QuartzConfig;\n allSlugs: FullSlug[];\n allFiles: FilePath[];\n incremental: boolean;\n}\n\n// ============================================================================\n// VFile Types - Content data types\n// ============================================================================\n\nexport type QuartzPluginData = Data;\nexport type MarkdownContent = [MdRoot, VFile];\nexport type ProcessedContent = [HtmlRoot, VFile];\n\n// ============================================================================\n// Core Component Types - The contract between Quartz and plugins\n// ============================================================================\n\nexport type QuartzComponentProps = {\n ctx: unknown;\n externalResources: StaticResources;\n fileData: QuartzPluginData & Record<string, unknown>;\n cfg: GlobalConfiguration;\n children: unknown;\n tree: unknown;\n allFiles: (QuartzPluginData & Record<string, unknown>)[];\n displayClass?: \"mobile-only\" | \"desktop-only\";\n [key: string]: unknown;\n};\n\nexport type QuartzComponent = ((props: QuartzComponentProps) => unknown) & {\n css?: string | string[] | undefined;\n beforeDOMLoaded?: string | string[] | undefined;\n afterDOMLoaded?: string | string[] | undefined;\n};\n\nexport type QuartzComponentConstructor<\n Options extends object | undefined = undefined,\n> = (opts?: Options) => QuartzComponent;\n\nexport type StringResource = string | string[];\n\n// ============================================================================\n// Plugin Types - What Quartz expects from plugins\n// ============================================================================\n\ntype OptionType = object | undefined;\ntype ExternalResourcesFn = (\n ctx: BuildCtx,\n) => Partial<StaticResources> | undefined;\n\nexport type { ExternalResourcesFn };\n\nexport interface PluginTypes {\n transformers: QuartzTransformerPluginInstance[];\n filters: QuartzFilterPluginInstance[];\n emitters: QuartzEmitterPluginInstance[];\n pageTypes: QuartzPageTypePluginInstance[];\n}\n\nexport type QuartzTransformerPlugin<Options extends OptionType = undefined> = (\n opts?: Options,\n) => QuartzTransformerPluginInstance;\n\nexport type QuartzTransformerPluginInstance = {\n name: string;\n textTransform?: (ctx: BuildCtx, src: string) => string;\n markdownPlugins?: (ctx: BuildCtx) => PluggableList;\n htmlPlugins?: (ctx: BuildCtx) => PluggableList;\n externalResources?: ExternalResourcesFn;\n};\n\nexport type QuartzFilterPlugin<Options extends OptionType = undefined> = (\n opts?: Options,\n) => QuartzFilterPluginInstance;\n\nexport type QuartzFilterPluginInstance = {\n name: string;\n shouldPublish(ctx: BuildCtx, content: ProcessedContent): boolean;\n};\n\nexport type ChangeEvent = {\n type: \"add\" | \"change\" | \"delete\";\n path: FilePath;\n file?: VFile;\n};\n\nexport type QuartzEmitterPlugin<Options extends OptionType = undefined> = (\n opts?: Options,\n) => QuartzEmitterPluginInstance;\n\nexport type QuartzEmitterPluginInstance = {\n name: string;\n emit: (\n ctx: BuildCtx,\n content: ProcessedContent[],\n resources: StaticResources,\n ) => Promise<FilePath[]> | AsyncGenerator<FilePath>;\n partialEmit?: (\n ctx: BuildCtx,\n content: ProcessedContent[],\n resources: StaticResources,\n changeEvents: ChangeEvent[],\n ) => Promise<FilePath[]> | AsyncGenerator<FilePath> | null;\n getQuartzComponents?: (ctx: BuildCtx) => QuartzComponent[];\n externalResources?: ExternalResourcesFn;\n};\n\n// ============================================================================\n// PageType Plugin Types - Declarative page rendering plugins\n// ============================================================================\n\n/**\n * Matcher function: determines if a source file belongs to a page type.\n * Returns true if the page type should own this file.\n */\nexport type PageMatcher = (args: {\n slug: FullSlug;\n fileData: QuartzPluginData & Record<string, unknown>;\n cfg: GlobalConfiguration;\n}) => boolean;\n\n/**\n * Virtual page descriptor for page types that generate pages\n * from aggregated data (e.g., tag indexes, folder listings).\n */\nexport interface VirtualPage {\n slug: FullSlug;\n title: string;\n data: Partial<QuartzPluginData> & Record<string, unknown>;\n}\n\n/**\n * Generator function: produces virtual pages from all processed content.\n * Used by page types that don't match source files but instead create\n * synthetic pages (e.g., one page per tag, one page per folder).\n */\nexport type PageGenerator = (args: {\n content: ProcessedContent[];\n cfg: GlobalConfiguration;\n ctx: BuildCtx;\n}) => VirtualPage[];\n\n/** A function that mutates a HAST tree at render time, when allFiles is available. */\nexport type TreeTransform = (\n root: HtmlRoot,\n slug: FullSlug,\n componentData: QuartzComponentProps,\n) => void;\n\n/**\n * A PageType plugin definition.\n *\n * PageTypes are a declarative abstraction over page-rendering emitters.\n * Each PageType declares which files it owns (via `match`), optionally\n * generates virtual pages (via `generate`), and provides a body component\n * and layout reference for rendering.\n */\nexport type QuartzPageTypePlugin<Options extends OptionType = undefined> = (\n opts?: Options,\n) => QuartzPageTypePluginInstance;\n\nexport type QuartzPageTypePluginInstance = {\n name: string;\n /** Higher priority wins when multiple page types match the same file. Default: 0. */\n priority?: number;\n /** File extensions this page type handles (e.g. [\".canvas\"]). Files with these extensions are excluded from the default asset emitter and processed by generate() instead. */\n fileExtensions?: string[];\n /** Determines which source files this page type owns. */\n match: PageMatcher;\n /** Produces virtual pages from aggregated content data. */\n generate?: PageGenerator;\n /** Layout key — references a key in `layout.byPageType`. */\n layout: string;\n /** Optional page frame name (e.g. \"default\", \"full-width\", \"canvas\"). Defaults to \"default\". */\n frame?: string;\n /** The body component constructor for this page type. */\n body: QuartzComponentConstructor;\n /** Optional render-time HAST tree transforms (e.g. resolving inline codeblocks). */\n treeTransforms?: (ctx: BuildCtx) => TreeTransform[];\n};\n\n// ============================================================================\n// PageFrame Types — Custom page layout frames\n// ============================================================================\n\n/**\n * Props passed to a PageFrame's render function.\n * Contains the resolved layout components and the shared component data.\n */\nexport interface PageFrameProps {\n /** Component data shared across all components on the page */\n componentData: QuartzComponentProps;\n /** The Head component (rendered in <head>) — NOT used by frames, included for completeness */\n head: QuartzComponent;\n /** Header slot components (rendered inside <header>) */\n header: QuartzComponent[];\n /** Components rendered before the page body */\n beforeBody: QuartzComponent[];\n /** The page body component (Content) */\n pageBody: QuartzComponent;\n /** Components rendered after the page body */\n afterBody: QuartzComponent[];\n /** Left sidebar components */\n left: QuartzComponent[];\n /** Right sidebar components */\n right: QuartzComponent[];\n /** Footer components */\n footer: QuartzComponent[];\n}\n\n/**\n * A PageFrame defines the inner HTML structure of a page inside the\n * `<div id=\"quartz-root\">` shell. Different frames can produce completely\n * different layouts (e.g. with/without sidebars, horizontal scroll, etc.)\n * while the outer shell (html, head, body, quartz-root) remains stable\n * for SPA navigation.\n *\n * The `render` function returns `unknown` to avoid coupling to a specific\n * JSX runtime (Preact, React, etc.). Quartz core casts this to JSX.Element.\n */\nexport interface PageFrame {\n /** Unique name for this frame (e.g. \"default\", \"full-width\", \"canvas\") */\n name: string;\n /** Render the inner page structure. Returns a JSX tree to be placed inside Body > #quartz-body. */\n render: (props: PageFrameProps) => unknown;\n /** Optional CSS string to include when this frame is active */\n css?: string;\n}\n\nexport type HTMLAttributes = Record<\n string,\n string | number | boolean | undefined\n>;\n\nexport type EventHandler = (event: Event) => void;\n\nexport type CleanupFunction = () => void;\n\nexport type ClassValue =\n | string\n | number\n | boolean\n | undefined\n | null\n | ClassValue[];\n\n// ============================================================================\n// Content Index Types - Data shape for contentIndex.json\n// ============================================================================\n\nexport type ContentDetails = {\n slug: FullSlug;\n filePath: FilePath;\n title: string;\n links: string[];\n tags: string[];\n content: string;\n richContent?: string;\n date?: Date;\n description?: string;\n};\n\nexport type ContentIndex = Record<FullSlug, ContentDetails>;\n\n// ============================================================================\n// Sort & Theme Types\n// ============================================================================\n\nexport type SortFn = (f1: QuartzPluginData, f2: QuartzPluginData) => number;\n\nexport type ThemeKey = \"lightMode\" | \"darkMode\";\n\nexport type ValidDateType = \"created\" | \"modified\" | \"published\";\n\n// ============================================================================\n// VFile DataMap Augmentation — canonical vfile shape for Quartz\n// ============================================================================\n\ndeclare module \"vfile\" {\n interface DataMap {\n slug: FullSlug;\n filePath: FilePath;\n relativePath: FilePath;\n description: string;\n text: string;\n links: SimpleSlug[];\n toc: { depth: number; text: string; slug: string }[];\n collapseToc: boolean;\n blocks: Record<string, import(\"hast\").Element>;\n htmlAst: import(\"hast\").Root;\n hasMermaidDiagram: boolean | undefined;\n frontmatter: { [key: string]: unknown } & {\n title: string;\n } & Partial<{\n tags: string[];\n aliases: string[];\n modified: string;\n created: string;\n published: string;\n description: string;\n socialDescription: string;\n publish: boolean | string;\n draft: boolean | string;\n lang: string;\n enableToc: string;\n cssclasses: string[];\n socialImage: string;\n comments: boolean | string;\n }>;\n dates: {\n created: Date;\n modified: Date;\n published: Date;\n };\n defaultDateType?: ValidDateType;\n }\n}\n"],"mappings":";AAaO,SAAS,gBAAgB,UAA8B;AAC5D,SAAO,SACJ,OAAO,CAAC,YAAY,QAAQ,SAAS,CAAC,EACtC,KAAK,GAAG,EACR,QAAQ,QAAQ,GAAG;AACxB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quartz-community/types",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Type definitions for Quartz community plugins",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,7 +40,8 @@
40
40
  "build": "tsup",
41
41
  "dev": "tsup --watch",
42
42
  "typecheck": "tsc --noEmit",
43
- "prepublishOnly": "npm run build"
43
+ "prepublishOnly": "npm run build",
44
+ "release": "npm run build && changeset publish"
44
45
  },
45
46
  "dependencies": {
46
47
  "unified": "^11.0.5",
@@ -54,7 +55,8 @@
54
55
  "@types/hast": "^3.0.4",
55
56
  "@types/mdast": "^4.0.4",
56
57
  "tsup": "^8.5.0",
57
- "typescript": "^5.9.3"
58
+ "typescript": "^5.9.3",
59
+ "@changesets/cli": "^2.29.2"
58
60
  },
59
61
  "peerDependencies": {
60
62
  "unified": "^11.0.5",
package/src/index.ts CHANGED
@@ -310,8 +310,8 @@ export interface PageFrameProps {
310
310
  left: QuartzComponent[];
311
311
  /** Right sidebar components */
312
312
  right: QuartzComponent[];
313
- /** Footer component */
314
- footer: QuartzComponent;
313
+ /** Footer components */
314
+ footer: QuartzComponent[];
315
315
  }
316
316
 
317
317
  /**