Jacky Zhao
2023-06-01 42d3a7de1711bbd40a2b6857e3bf7ff17685f5d9
quartz/plugins/types.ts
@@ -1,6 +1,7 @@
import { PluggableList } from "unified"
import { StaticResources } from "../resources"
import { ProcessedContent } from "./vfile"
import { GlobalConfiguration } from "../cfg"
export abstract class QuartzTransformerPlugin {
  abstract name: string
@@ -15,20 +16,15 @@
}
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[]>
}
export interface PluginTypes {