import { Core } from './core.ts'; import { Options } from '../options.ts'; import { Length, Vector } from '../types.ts'; import { ElementKind } from './elements.ts'; export { Elements, isElementKind, type ElementKind } from './elements.ts'; declare const Generator_base: (abstract new (...args: any[]) => { documentClass?: { name: string; options: import('../options.ts').PackageOpts; } | undefined; _title?: unknown; _author?: unknown; _date?: unknown; documentTitle: string; reset(): void; plainText(node: unknown): string; setTitle(title: unknown): void; _options: Options; _uid: number; get options(): Options; nextId(): number; round(num: number): number; _errorFn: (e: string) => never; setErrorFn(fn: (msg: string) => never): void; error(e: string): never; _rangeFn: () => import('./core.ts').SourceRange; setRangeFn(fn: () => import('./core.ts').SourceRange): void; offset(): number; }) & (abstract new (...args: any[]) => { marginPars: import('./floats.ts').MarginPar[]; reset(): void; createMarginParRef(id: number): unknown; marginpar(content: unknown): unknown; _options: Options; _uid: number; get options(): Options; nextId(): number; round(num: number): number; _errorFn: (e: string) => never; setErrorFn(fn: (msg: string) => never): void; error(e: string): never; _rangeFn: () => import('./core.ts').SourceRange; setRangeFn(fn: () => import('./core.ts').SourceRange): void; offset(): number; }) & (abstract new (...args: any[]) => { reset(): void; begin(envId: string): void; end(id: string, endId: string): unknown[] | undefined; _stack: import('../util/stack.ts').default; _groups: import('../util/stack.ts').default; _newGroup(parent: import('./groups.ts').StackItem | undefined, copyAttrs: boolean): import('./groups.ts').StackItem; enterGroup(copyAttrs?: boolean): void; exitGroup(): void; startBalanced(): void; endBalanced(): number; isBalanced(): boolean; _options: Options; _uid: number; get options(): Options; nextId(): number; round(num: number): number; _errorFn: (e: string) => never; setErrorFn(fn: (msg: string) => never): void; error(e: string): never; _rangeFn: () => import('./core.ts').SourceRange; setRangeFn(fn: () => import('./core.ts').SourceRange): void; offset(): number; _manager: import('../macro-manager.ts').MacroManager; get macroManager(): import('../macro-manager.ts').MacroManager; createText(text: string | String): unknown; addAttributes(node: unknown): unknown; hasMacro(name: string): boolean; macro(name: string, args?: unknown[]): any[]; newcommand(name: string, func: import('../macros.ts').MacroFn): void; }) & (abstract new (...args: any[]) => { _labels: Map; _refs: Map; reset(): void; _newGroup(parent: import('./groups.ts').StackItem | undefined, copyAttrs: boolean): import('./groups.ts').StackItem; createFragment(...args: unknown[]): unknown; createAnchor(id: string): unknown; createReference(label?: import('./references.ts').CurrentLabel): unknown; fillReference(ref: unknown, label: import('./references.ts').CurrentLabel): void; currentLabel(): import('./references.ts').CurrentLabel; refCounter(c: string, id?: string): unknown; setLabel(label: string): void; ref(label: string): unknown; logUndefinedRefs(): void; _stack: import('../util/stack.ts').default; _groups: import('../util/stack.ts').default; enterGroup(copyAttrs?: boolean): void; exitGroup(): void; startBalanced(): void; endBalanced(): number; isBalanced(): boolean; _options: Options; _uid: number; get options(): Options; nextId(): number; round(num: number): number; _errorFn: (e: string) => never; setErrorFn(fn: (msg: string) => never): void; error(e: string): never; _rangeFn: () => import('./core.ts').SourceRange; setRangeFn(fn: () => import('./core.ts').SourceRange): void; offset(): number; _manager: import('../macro-manager.ts').MacroManager; get macroManager(): import('../macro-manager.ts').MacroManager; createText(text: string | String): unknown; addAttributes(node: unknown): unknown; hasMacro(name: string): boolean; macro(name: string, args?: unknown[]): any[]; newcommand(name: string, func: import('../macros.ts').MacroFn): void; }) & (abstract new (...args: any[]) => { reset(): void; readonly sp: " "; readonly brsp: "\u200B "; readonly nbsp: "\u00A0"; readonly visp: "\u2423"; readonly zwnj: "\u200C"; readonly shy: "\u00AD"; readonly thinsp: "\u2009"; character(c: string): string; textquote(q: string): string | undefined; hyphen(): string; ligature(l: string): string; hasDiacritic(d: string): boolean; diacritic(d: string, c?: string): string; controlSymbol(c: string): string; hasSymbol(name: string): boolean; symbol(name: string): string; _continue: number | false; _newGroup: ((parent: import('./groups.ts').StackItem | undefined, copyAttrs: boolean) => import('./groups.ts').StackItem) & ((parent: import('./groups.ts').StackItem | undefined, copyAttrs: boolean) => import('./groups.ts').StackItem); continue(): void; break(): void; setAlignment(align: import('./attributes.ts').Alignment): void; alignment(): import('./attributes.ts').Alignment; setFontFamily(family: string): void; setFontWeight(weight: string): void; setFontShape(shape: string): void; setFontSize(size: string): void; setTextDecoration(decoration: string): void; _setAttribute(attr: keyof import('./attributes.ts').TextAttributes, value: string): void; _inlineAttributes(): string; _activeAttributeValue(attr: keyof import('./attributes.ts').TextAttributes): string | undefined; _stack: import('../util/stack.ts').default; _groups: import('../util/stack.ts').default; enterGroup(copyAttrs?: boolean): void; exitGroup(): void; startBalanced(): void; endBalanced(): number; isBalanced(): boolean; _options: Options; _uid: number; get options(): Options; nextId(): number; round(num: number): number; _errorFn: (e: string) => never; setErrorFn(fn: (msg: string) => never): void; error(e: string): never; _rangeFn: () => import('./core.ts').SourceRange; setRangeFn(fn: () => import('./core.ts').SourceRange): void; offset(): number; }) & (abstract new (...args: any[]) => { _continue: number | false; reset(): void; _newGroup(parent: import('./groups.ts').StackItem | undefined, copyAttrs: boolean): import('./groups.ts').StackItem; continue(): void; break(): void; setAlignment(align: import('./attributes.ts').Alignment): void; alignment(): import('./attributes.ts').Alignment; setFontFamily(family: string): void; setFontWeight(weight: string): void; setFontShape(shape: string): void; setFontSize(size: string): void; setTextDecoration(decoration: string): void; _setAttribute(attr: keyof import('./attributes.ts').TextAttributes, value: string): void; _inlineAttributes(): string; _activeAttributeValue(attr: keyof import('./attributes.ts').TextAttributes): string | undefined; _stack: import('../util/stack.ts').default; _groups: import('../util/stack.ts').default; enterGroup(copyAttrs?: boolean): void; exitGroup(): void; startBalanced(): void; endBalanced(): number; isBalanced(): boolean; _options: Options; _uid: number; get options(): Options; nextId(): number; round(num: number): number; _errorFn: (e: string) => never; setErrorFn(fn: (msg: string) => never): void; error(e: string): never; _rangeFn: () => import('./core.ts').SourceRange; setRangeFn(fn: () => import('./core.ts').SourceRange): void; offset(): number; }) & (abstract new (...args: any[]) => { reset(): void; _newGroup(parent: import('./groups.ts').StackItem | undefined, copyAttrs: boolean): import('./groups.ts').StackItem; _writableLengths(): Map; newLength(l: string): void; hasLength(l: string): boolean; setLength(id: string, length: Length): void; length(l: string): Length; _stack: import('../util/stack.ts').default; _groups: import('../util/stack.ts').default; enterGroup(copyAttrs?: boolean): void; exitGroup(): void; startBalanced(): void; endBalanced(): number; isBalanced(): boolean; _options: Options; _uid: number; get options(): Options; nextId(): number; round(num: number): number; _errorFn: (e: string) => never; setErrorFn(fn: (msg: string) => never): void; error(e: string): never; _rangeFn: () => import('./core.ts').SourceRange; setRangeFn(fn: () => import('./core.ts').SourceRange): void; offset(): number; }) & (abstract new (...args: any[]) => { _counters: Map; _resets: Map; reset(): void; newCounter(c: string, parent?: string): void; _theCounter(name: string): string | undefined; hasMacro(name: string): boolean; macro(name: string, args?: unknown[]): any[]; hasCounter(c: string): boolean; counter(c: string): number; setCounter(c: string, v: number): void; stepCounter(c: string): void; addToReset(c: string, parent: string): void; _clearCounter(c: string): void; alph(num: number): string; Alph(num: number): string; arabic(num: number): string; roman(num: number): string; Roman(num: number): string; _roman(num: number, lookup: [string, number][]): string; fnsymbol(num: number): string[]; _doubleSymbol(name: string): string[]; _manager: import('../macro-manager.ts').MacroManager; get macroManager(): import('../macro-manager.ts').MacroManager; createText(text: string | String): unknown; addAttributes(node: unknown): unknown; newcommand(name: string, func: import('../macros.ts').MacroFn): void; _options: Options; _uid: number; get options(): Options; nextId(): number; round(num: number): number; _errorFn: (e: string) => never; setErrorFn(fn: (msg: string) => never): void; error(e: string): never; _rangeFn: () => import('./core.ts').SourceRange; setRangeFn(fn: () => import('./core.ts').SourceRange): void; offset(): number; }) & (abstract new (...args: any[]) => { _stack: import('../util/stack.ts').default; _groups: import('../util/stack.ts').default; reset(): void; _newGroup(parent: import('./groups.ts').StackItem | undefined, copyAttrs: boolean): import('./groups.ts').StackItem; enterGroup(copyAttrs?: boolean): void; exitGroup(): void; startBalanced(): void; endBalanced(): number; isBalanced(): boolean; _options: Options; _uid: number; get options(): Options; nextId(): number; round(num: number): number; _errorFn: (e: string) => never; setErrorFn(fn: (msg: string) => never): void; error(e: string): never; _rangeFn: () => import('./core.ts').SourceRange; setRangeFn(fn: () => import('./core.ts').SourceRange): void; offset(): number; }) & (abstract new (...args: any[]) => { _manager: import('../macro-manager.ts').MacroManager; reset(): void; get macroManager(): import('../macro-manager.ts').MacroManager; createText(text: string | String): unknown; addAttributes(node: unknown): unknown; hasMacro(name: string): boolean; macro(name: string, args?: unknown[]): any[]; newcommand(name: string, func: import('../macros.ts').MacroFn): void; _options: Options; _uid: number; get options(): Options; nextId(): number; round(num: number): number; _errorFn: (e: string) => never; setErrorFn(fn: (msg: string) => never): void; error(e: string): never; _rangeFn: () => import('./core.ts').SourceRange; setRangeFn(fn: () => import('./core.ts').SourceRange): void; offset(): number; }) & typeof Core; /** * The generator: the contract between the parser (and the macros) and any concrete generator, * like HtmlGenerator, or a future TextGenerator or MarkdownGenerator. * * It is composed of the Core and the format-independent mixins, each handling one part of the * document state; a mixin may depend on the ones before it (e.g. Lengths needs Groups). * * Everything that depends on the output format is declared abstract here and has * to be implemented by a concrete generator. * * Generator options: * - CustomMacros * * @typeParam TNode the type of the output nodes, e.g. DOM `Node` for HTML */ export declare abstract class Generator extends Generator_base { constructor(options: Options); reset(): void; /** * Create an element of the given kind. * * @param kind the generic kind of element * @param children the content of the element * @param classes additional (space separated) classes of the element; * TODO: right now kind of HTML specific */ abstract create(kind: ElementKind, children?: TNode | TNode[] | null, classes?: string): TNode; abstract setId(node: TNode, id: string): void; abstract createText(t: string | String): TNode | undefined; abstract createVerbatim(t: string, ...rest: unknown[]): TNode | undefined; abstract createFragment(...args: (TNode | TNode[])[]): TNode | undefined; abstract createImage(width: number, height: number, url: string): TNode; abstract createPicture(size: Vector, content: any, offset?: Vector): TNode; abstract createLink(url?: string, children?: TNode | TNode[] | null): TNode; abstract createMulticols(cols: number): TNode; abstract createDocument(fs: unknown): void; abstract createVSpaceSkip(skip: "smallskip" | "medskip" | "bigskip"): TNode; abstract createVSpaceSkipInline(skip: "smallskip" | "medskip" | "bigskip"): TNode; abstract createVSpace(length: Length): TNode; abstract createVSpaceInline(length: Length): TNode; abstract createBreakSpace(length: Length): TNode; abstract createHSpace(length: Length): TNode; abstract parseMath(math: string, display: boolean): TNode; abstract theLength(id: string): TNode; }