import type { Editor } from "@tiptap/core"; import type { ResolvedStyle, StyleCheckReport, StyleChoiceGroup, StyleChoiceResult, StyleResolver, StyleSwatch } from "@pixerate/editor/tools"; type MaybeGetter = T | (() => T); export interface SvelteStyle { /** The resolved house style for the domain, or `null` before the first resolve (or without a resolver) (reactive). */ readonly style: ResolvedStyle | null; /** Why the last resolve failed (e.g. an unknown domain), or `null` (reactive). */ readonly error: string | null; } export interface SvelteStyleFindings extends SvelteStyle { /** The last check report for `state`, or `null` before the first check (or without a resolver) (reactive). */ readonly report: StyleCheckReport | null; } /** * Svelte 5 rune: the house style for one domain (`chart`, `tokens`, ...), merged across the * resolver's layers; re-resolves when a style store or the token source changes. Call it during * component initialisation; pass getters to react to changes. Parity with React's `useStyle`. */ export declare function useStyle(styles: MaybeGetter, domain: MaybeGetter): SvelteStyle; /** * Svelte 5 rune: runs the domain's house-style checks against `subject`, the domain's state (e.g. a chart spec), * whenever the value a getter returns changes by reference, the domain or resolver changes, or * the resolver notifies. Results of older runs that settle late are ignored. Feed `report` to * ``. Call it during component initialisation. Parity with React's `useStyleFindings`. */ export declare function useStyleFindings(styles: MaybeGetter, domain: MaybeGetter, subject: MaybeGetter, scope?: MaybeGetter): SvelteStyleFindings; export interface SvelteStyleChoices { /** The one-of-a-kind groups (a look, a theme) with the chosen skill and every option, or `null` before the first read (reactive). */ readonly groups: StyleChoiceGroup[] | null; /** Why the last read or choice failed, or `null` (reactive). */ readonly error: string | null; /** Chooses a skill of its group (see `StyleResolver.choose`); resolves to what changed, or rejects with the reason. */ choose(name: string, options?: { layer?: string; }): Promise; } /** * Svelte 5 rune: the house-style choices for a picker, each one-of-a-kind group with the skill * that applies and its options, in `scope` when given. Re-reads when the resolver notifies. * Call it during component initialisation. Parity with React's `useStyleChoices`. */ export declare function useStyleChoices(styles: MaybeGetter, scope?: MaybeGetter): SvelteStyleChoices; export interface SvelteStyleSwatches { /** The house colours, in picker order (feed `ColorPicker`'s `swatches` or `ChartEditor`'s) (reactive). */ readonly colors: string[]; /** The same colours with what each is for (`primary`, `palette 2`, ...) (reactive). */ readonly swatches: StyleSwatch[]; /** The house fonts (reactive). */ readonly fonts: string[]; /** Why the last resolve failed, or `null` (reactive). */ readonly error: string | null; } /** * Svelte 5 rune: the colours and fonts the house style offers for one domain, for pickers. The * agent's `get_style` returns the same list. Parity with React's `useStyleSwatches`. */ export declare function useStyleSwatches(styles: MaybeGetter, domain: MaybeGetter, scope?: MaybeGetter): SvelteStyleSwatches; /** * Svelte 5 rune: the document house-style findings for a TipTap editor (`rich-text` domain), * re-checked after every edit. Feed `report` to ``. Call it during component * initialisation. Parity with React's `useRichTextStyleFindings`. */ export declare function useRichTextStyleFindings(styles: MaybeGetter, editor: MaybeGetter, scope?: MaybeGetter): SvelteStyleFindings; export {};