import { default as Stack } from '../util/stack.ts'; import { Constructor } from '../util/mixin.ts'; import { Core } from './core.ts'; /** * The group-local state, one item per group level. Groups itself doesn't know its contents: * each mixin with group-local state adds its own slice by module augmentation, e.g. * * declare module "./groups.ts" { * interface StackItem { lengths: Map } * } * * and initializes it by overriding _newGroup(). */ export interface StackItem { } export declare function Groups>(Base: TBase): (abstract new (...args: any[]) => { _stack: Stack; _groups: Stack; reset(): void; /** * Create the stack item for a new group. Mixins with group-local state override this, * call super, and initialize their slice of the item. * * @param parent the enclosing group's item, undefined for the outermost group * @param copyAttrs whether the new group inherits the attributes of the parent */ _newGroup(parent: StackItem | undefined, copyAttrs: boolean): StackItem; 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; }) & TBase; export type GroupsAPI = InstanceType>;