import { Constructor } from '../util/mixin.ts'; import { GroupsAPI, StackItem } from './groups.ts'; import { MacroManagementAPI } from './macro-management.ts'; /** * \@currentlabel: * the id of the element to link to, * and the label to display in a \ref{} */ export interface CurrentLabel { id: string; label?: unknown; } declare module "./groups.ts" { interface StackItem { currentlabel: CurrentLabel; } } export declare function References>(Base: TBase): (abstract new (...args: any[]) => { _labels: Map; _refs: Map; reset(): void; _newGroup(parent: StackItem | undefined, copyAttrs: boolean): StackItem; createFragment(...args: unknown[]): unknown; createAnchor(id: string): unknown; createReference(label?: CurrentLabel): unknown; fillReference(ref: unknown, label: CurrentLabel): void; currentLabel(): CurrentLabel; /** * Make counter c the one referred to by the next \label, i.e. set `\@currentlabel`. * * `\@currentlabel` is local, the counter is global; * we need to store the id of the element to link to as well as the formatted counter value (\p@c\thec). * * @param c the counter * @param id the id of an existing element to link to; if not given, a new anchor is created * @return the newly created anchor, or undefined if an id was given */ 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: import('../options.ts').Options; _uid: number; get options(): import('../options.ts').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; }) & TBase; export type ReferencesAPI = InstanceType>;