import { RulerUnit, GuideSet } from '@devslab/editor-ruler'; export { RulerChange, RulerChangePhase, RulerMetrics, RulerUnit } from '@devslab/editor-ruler'; /** * Options merged into FroalaEditor.DEFAULTS. Configure per editor instance via * `new FroalaEditor(el, { rulerEnabled: true, rulerUnit: 'cm' })`. */ interface FroalaRulerOptions { rulerEnabled?: boolean; /** * Whether the horizontal ruler starts visible with the editor. Default * true. Unlike `rulerEnabled: false` (which disables the plugin entirely), * `rulerVisible: false` keeps the plugin — and its toolbar commands — * alive, just hidden until the user toggles it on. */ rulerVisible?: boolean; rulerUnit?: RulerUnit; /** Show the vertical ruler strip on init. Default false. */ rulerVertical?: boolean; /** * Reserve the vertical ruler's 23px column from the start (like CSS * `scrollbar-gutter: stable`), so toggling the vertical ruler never * reflows the content — hidden means an empty gutter, not reclaimed * width. Default false: the strip only takes space while visible. */ rulerVerticalGutter?: boolean; /** Enable guide lines (drag down from the ruler strip). Default true. */ rulerGuides?: boolean; } /** * The plugin API exposed as `editor.ruler` on a Froala instance. * `_init` is Froala's own lifecycle hook — the editor calls it, you don't. */ interface FroalaRulerApi { _init(): void; refresh(): void; show(): void; hide(): void; toggle(): void; isVisible(): boolean; setUnit(unit: RulerUnit): void; getUnit(): RulerUnit; toggleVRuler(): void; isVRulerVisible(): boolean; setGuidesLocked(locked: boolean): void; isGuidesLocked(): boolean; clearGuides(): void; getGuides(): GuideSet; destroy(): void; } /** UI strings for the toolbar commands. Registered once per FroalaEditor constructor. */ interface RulerStrings { ruler: string; toggleRuler: string; rulerUnit: string; showHide: string; verticalRuler: string; lockGuides: string; clearGuides: string; cm: string; in: string; px: string; } interface DefineRulerPluginOptions { /** Language for toolbar strings ('ko', 'en', …). Default: `` → browser language → 'en'. */ language?: string; /** Override any built-in string. */ strings?: Partial; } /** * Registers the ruler plugin on the FroalaEditor constructor. Call once, before * creating editor instances: * * ```ts * import FroalaEditor from 'froala-editor'; * import { defineRulerPlugin } from '@devslab/editor-ruler-froala'; * * defineRulerPlugin(FroalaEditor); * new FroalaEditor('#editor', { rulerEnabled: true }); * ``` * * If you set `pluginsEnabled` explicitly, include `'ruler'` in the list. * * Also registers a `'toggleRuler'` toolbar command with a ruler icon — add it to * `toolbarButtons` to let users show/hide the ruler. */ declare function defineRulerPlugin(FroalaEditor: any, defineOptions?: DefineRulerPluginOptions): void; export { type DefineRulerPluginOptions, type FroalaRulerApi, type FroalaRulerOptions, type RulerStrings, defineRulerPlugin };