roadmap/quartz/components/types.ts

22 lines
695 B
TypeScript
Raw Normal View History

2023-06-08 05:27:32 +00:00
import { ComponentType, JSX } from "preact"
import { StaticResources } from "../resources"
import { QuartzPluginData } from "../plugins/vfile"
import { GlobalConfiguration } from "../cfg"
2023-06-10 06:06:02 +00:00
import { Node } from "hast"
2023-06-03 19:07:19 +00:00
2023-06-08 05:27:32 +00:00
export type QuartzComponentProps = {
externalResources: StaticResources
fileData: QuartzPluginData
cfg: GlobalConfiguration
children: QuartzComponent[] | JSX.Element[]
2023-06-10 06:06:02 +00:00
tree: Node<QuartzPluginData>
2023-06-08 05:27:32 +00:00
}
export type QuartzComponent = ComponentType<QuartzComponentProps> & {
2023-06-03 19:07:19 +00:00
css?: string,
beforeDOMLoaded?: string,
afterDOMLoaded?: string,
}
2023-06-12 06:46:38 +00:00
export type QuartzComponentConstructor<Options extends object | undefined = undefined> = (opts: Options) => QuartzComponent