2023-06-07 22:27:32 -07:00
|
|
|
import { ComponentType, JSX } from "preact"
|
2023-08-16 22:09:11 -07:00
|
|
|
import { StaticResources } from "../util/resources"
|
2023-06-07 22:27:32 -07:00
|
|
|
import { QuartzPluginData } from "../plugins/vfile"
|
|
|
|
import { GlobalConfiguration } from "../cfg"
|
2023-06-09 23:06:02 -07:00
|
|
|
import { Node } from "hast"
|
2024-02-22 20:51:07 -05:00
|
|
|
import { BuildCtx } from "../util/ctx"
|
2023-06-03 15:07:19 -04:00
|
|
|
|
2023-06-07 22:27:32 -07:00
|
|
|
export type QuartzComponentProps = {
|
2024-02-22 20:51:07 -05:00
|
|
|
ctx: BuildCtx
|
2023-06-07 22:27:32 -07:00
|
|
|
externalResources: StaticResources
|
|
|
|
fileData: QuartzPluginData
|
|
|
|
cfg: GlobalConfiguration
|
2023-07-02 13:08:29 -07:00
|
|
|
children: (QuartzComponent | JSX.Element)[]
|
2023-12-18 09:48:40 -08:00
|
|
|
tree: Node
|
2023-06-19 20:37:45 -07:00
|
|
|
allFiles: QuartzPluginData[]
|
2023-07-22 17:27:41 -07:00
|
|
|
displayClass?: "mobile-only" | "desktop-only"
|
2023-07-04 16:48:36 -07:00
|
|
|
} & JSX.IntrinsicAttributes & {
|
2023-07-22 17:27:41 -07:00
|
|
|
[key: string]: any
|
|
|
|
}
|
2023-06-07 22:27:32 -07:00
|
|
|
|
|
|
|
export type QuartzComponent = ComponentType<QuartzComponentProps> & {
|
2023-07-22 17:27:41 -07:00
|
|
|
css?: string
|
|
|
|
beforeDOMLoaded?: string
|
|
|
|
afterDOMLoaded?: string
|
2023-06-03 15:07:19 -04:00
|
|
|
}
|
2023-06-11 23:26:43 -07:00
|
|
|
|
2023-07-22 17:27:41 -07:00
|
|
|
export type QuartzComponentConstructor<Options extends object | undefined = undefined> = (
|
|
|
|
opts: Options,
|
|
|
|
) => QuartzComponent
|