/** * Factory for graph-based diagram modules. * @module diagrams/graph/module */ export type GraphModuleSpec = { kind: string; title: string; starts?: string[]; keywords: [string, import("./parse.mjs").ElementKind][]; implicit?: (token: string) => { id: string; label: string; keyword: string; } | null; detect?: (lines: import("../../core/source.mjs").SourceLine[]) => number; rules?: import("../../syntax/reader.mjs").Rule[]; finish?: (model: import("../../model/graph.mjs").GraphModel, ctx: import("./parse.mjs").GraphContext) => void; layout?: import("./layout.mjs").GraphLayoutOptions; }; /** * @typedef {object} GraphModuleSpec * @property {string} kind * @property {string} title * @property {string[]} [starts] * @property {[string, import("./parse.mjs").ElementKind][]} keywords * @property {(token: string) => { id: string, label: string, keyword: string } | null} [implicit] * @property {(lines: import("../../core/source.mjs").SourceLine[]) => number} [detect] * @property {import("../../syntax/reader.mjs").Rule[]} [rules] * @property {(model: import("../../model/graph.mjs").GraphModel, ctx: import("./parse.mjs").GraphContext) => void} [finish] * @property {import("./layout.mjs").GraphLayoutOptions} [layout] */ /** * @param {GraphModuleSpec} spec */ export declare function graphModule(spec: GraphModuleSpec): Readonly<{ kind: string; title: string; starts: string[]; detect: (lines: import("../../core/source.mjs").SourceLine[]) => number; parse: (lines: import("./parse.mjs").SourceLine[], module: import("../../core/registry.mjs").ModuleContext) => import("../../model/graph.mjs").GraphModel; layout: (model: any, ctx: import("../../core/registry.mjs").ModuleContext) => Promise; draw: (model: any, canvas: import("../../draw/canvas.mjs").Canvas) => void; }>;