import type { EditorMergeField, EditorTokenSyntax } from "./EditorProps"; import type { OptionProp } from "../Select/SelectProps"; export declare const DEFAULT_TOKEN_SYNTAX: EditorTokenSyntax; export declare const CHIP_CLASS = "pxl-token"; export declare const fieldToken: (path: string, syntax?: EditorTokenSyntax) => string; export declare function fieldOptions(fields: EditorMergeField[], syntax?: EditorTokenSyntax): OptionProp[]; export declare function extractTokens(html: string, syntax?: EditorTokenSyntax): string[]; export declare function unknownTokens(html: string, fields: EditorMergeField[], syntax?: EditorTokenSyntax): string[]; /** Replaces every whitespace-insensitive occurrence of `selectedText` outside tags and tokens. */ export declare function makeDynamic(html: string, selectedText: string, path: string, syntax?: EditorTokenSyntax): { html: string; count: number; }; export declare function countOccurrences(html: string, selectedText: string, syntax?: EditorTokenSyntax): number; export type ChipContext = { /** Merge fields used to resolve a path to its chip label and hover sample. */ fields: EditorMergeField[]; /** Token delimiters the chips serialize back to. */ syntax: EditorTokenSyntax; /** Maps a field label to the chip's accessible name. */ chipLabel: (label: string) => string; }; export declare function chipHtml(path: string, { fields, syntax, chipLabel }: ChipContext): string; /** Raw `${path}` tokens in text nodes become non-editable chip spans; tags are left alone. */ export declare function chipify(html: string, context: ChipContext): string; /** Inverse of `chipify`: every chip span collapses back to its raw token. */ export declare function serializeChips(html: string, syntax?: EditorTokenSyntax): string; /** The chip a Backspace (backward) or Delete (forward) at a collapsed caret would eat, if any. */ export declare function adjacentChip(range: Range, direction: "backward" | "forward"): HTMLElement | null;