import type { Editor } from "@tiptap/core"; import { type CreateStyleFromSelectionOptions, type ParagraphStylesSnapshot, type StyleDefinition, type StyleRegistry } from "@pixerate/editor"; export type { ParagraphStylesSnapshot, StyleDefinition } from "@pixerate/editor"; export interface SvelteParagraphStyles { /** Snapshot: gallery, styles, character styles, current style id, version. */ readonly current: ParagraphStylesSnapshot; readonly registry: StyleRegistry | null; /** The style of the block at the selection. */ readonly currentStyle: StyleDefinition | null; /** Applies a paragraph style to the selected blocks. */ apply(id: string): boolean; /** Resets the selected blocks to Normal. */ clear(): boolean; /** Updates a style (default: the current one) to the formatting at the selection. */ updateFromSelection(id?: string): boolean; /** Creates (and applies) a style from the formatting at the selection; returns its id. */ createFromSelection(name: string, options?: CreateStyleFromSelectionOptions): string | null; /** Applies a character style to the selection. */ applyCharacterStyle(id: string): boolean; destroy(): void; } /** * Reactive paragraph styles for Svelte 5 (the counterpart of React's * `useParagraphStyles`): the gallery, all styles and the style at the * selection, with commands. `current` is replaced only when the styles or * the current style change. Call `destroy()` when done (or create it inside * a component's `$effect`). */ export declare function createParagraphStyles(editor: Editor | null | undefined): SvelteParagraphStyles;