Jacky Zhao
2023-06-07 dde36fa5589a362b60b7b72eb7793a3f133e159c
quartz/plugins/types.ts
@@ -1,6 +1,8 @@
import { PluggableList } from "unified"
import { StaticResources } from "../resources"
import { ProcessedContent } from "./vfile"
import { GlobalConfiguration } from "../cfg"
import { QuartzComponent } from "../components/types"
export abstract class QuartzTransformerPlugin {
  abstract name: string
@@ -15,20 +17,16 @@
}
export interface EmitOptions {
  // meta
  title: string
  description: string
  slug: string
  ext: `.${string}`
  // rendering related
  content: string
}
export type EmitCallback = (data: EmitOptions) => Promise<void>
export type EmitCallback = (data: EmitOptions) => Promise<string>
export abstract class QuartzEmitterPlugin {
  abstract name: string
  abstract emit(content: ProcessedContent[], emitCallback: EmitCallback): Promise<string[]>
  abstract emit(cfg: GlobalConfiguration, content: ProcessedContent[], resources: StaticResources, emitCallback: EmitCallback): Promise<string[]>
  abstract getQuartzComponents(): QuartzComponent<any>[]
}
export interface PluginTypes {