mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 15:05:42 -05:00
Added QuartzParserPlugin typing
This commit is contained in:
parent
169a570ed5
commit
c3f1695595
@ -10,6 +10,7 @@ export interface PluginTypes {
|
|||||||
transformers: QuartzTransformerPluginInstance[]
|
transformers: QuartzTransformerPluginInstance[]
|
||||||
filters: QuartzFilterPluginInstance[]
|
filters: QuartzFilterPluginInstance[]
|
||||||
emitters: QuartzEmitterPluginInstance[]
|
emitters: QuartzEmitterPluginInstance[]
|
||||||
|
parsers: QuartzParserPluginInstance[]
|
||||||
}
|
}
|
||||||
|
|
||||||
type OptionType = object | undefined
|
type OptionType = object | undefined
|
||||||
@ -45,3 +46,14 @@ export type QuartzEmitterPluginInstance = {
|
|||||||
resources: StaticResources,
|
resources: StaticResources,
|
||||||
): Promise<DepGraph<FilePath>>
|
): Promise<DepGraph<FilePath>>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type QuartzParserPlugin<Options extends OptionType = undefined> = (
|
||||||
|
opts?: Options,
|
||||||
|
) => QuartzParserPluginInstance
|
||||||
|
export type QuartzParserPluginInstance = {
|
||||||
|
name: string
|
||||||
|
textTransform: (ctx: BuildCtx, src: string | Buffer) => string | Buffer
|
||||||
|
markdownPlugins: (ctx: BuildCtx) => PluggableList
|
||||||
|
htmlPlugins: (ctx: BuildCtx) => PluggableList
|
||||||
|
externalResources: (ctx: BuildCtx) => Partial<StaticResources>
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user