UNPKG

@udecode/plate-heading

Version:

Headings plugin for Plate

24 lines (20 loc) 765 B
import { PluginConfig, SlatePlugin } from '@udecode/plate-common'; import { Path } from 'slate'; type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6; type HeadingConfig = PluginConfig<'heading', { /** Heading levels supported from 1 to `levels` */ levels?: HeadingLevel | HeadingLevel[]; }>; /** Enables support for headings with configurable levels (from 1 to 6). */ declare const BaseHeadingPlugin: SlatePlugin<PluginConfig<"heading", { /** Heading levels supported from 1 to `levels` */ levels?: HeadingLevel | HeadingLevel[]; }, {}, {}>>; interface Heading { id: string; depth: number; path: Path; title: string; type: string; } export { BaseHeadingPlugin as B, type Heading as H, type HeadingLevel as a, type HeadingConfig as b };