keroosha.cybergulag.today/quartz/components/types.ts

28 lines
838 B
TypeScript
Raw Permalink Normal View History

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