import { IServiceID } from "../../../types/kernel.js"; import "../../../types/index.js"; import { TocHeadingTag, TocItem, TocJumpOptions, TocPluginOptions } from "../types.js"; import EventEmitter from "eventemitter3"; import { LexicalEditor } from "lexical"; interface ITocService { getActiveKey(): null | string; getFlatItems(): TocItem[]; getItems(): TocItem[]; jumpTo(key: string, options?: TocJumpOptions): boolean; refresh(): TocItem[]; setActiveKey(key: null | string): void; setDepthRange(options: TocPluginOptions): void; subscribe(listener: () => void): () => void; } declare const ITocService: IServiceID; type TocServiceEvents = { change: () => void; }; declare class TocService extends EventEmitter implements ITocService { private activeKey; private editor; private items; private maxDepth; private minDepth; bindEditor(editor: LexicalEditor): void; getActiveKey(): null | string; getFlatItems(): TocItem[]; getItems(): TocItem[]; jumpTo(key: string, options?: TocJumpOptions): boolean; refresh(): TocItem[]; setActiveKey(key: null | string): void; setDepthRange(options: TocPluginOptions): void; subscribe(listener: () => void): () => void; private updateItems; } export { ITocService, type TocJumpOptions, type TocPluginOptions, TocService };