/** * The toolbar item contract — the editor analogue of the renderer's * `MarkdownComponents` map. A toolbar is just an array of these; design * systems re-skin the *rendering* (see `@sigx/lynx-daisyui`'s * `EditorToolbar`) while the items stay shared, and P3 plugins contribute * additional items through the same shape. */ import type { SelectionState } from '@sigx/lynx-richtext'; import type { MarkdownEditorController } from '../MarkdownEditor.js'; /** What an item's `run` receives — the editor's imperative surface. */ export interface ToolbarContext { controller: MarkdownEditorController; } export interface ToolbarItem { /** Stable identifier (also the default `key`). */ id: string; /** * Short text rendering (`B`, `H1`, …). The neutral toolbar renders this * (falling back to `id` when omitted); skins may render `icon` instead. * Optional so icon-only items/skins don't need a dummy label. */ label?: string; /** Optional icon hint for skins (e.g. an icon-set name). Never required. */ icon?: string; /** Items with the same group render adjacent (skins may add separators). */ group?: string; /** Highlighted state, derived from the last selection event. */ isActive?(sel: SelectionState | null): boolean; run(ctx: ToolbarContext): void; } /** The neutral default item set: every command the controller exposes. */ export declare const defaultToolbarItems: ToolbarItem[];