import type { Highlighter, AnimationOptions, CSSString, HTMLString, HighlighterOptions, Highlights, SelectableTextViewFonts, SelectableTextViewOptions, GoogleFontFamily } from "./types";
export declare function escapeHtmlAttribute(value: string): string;
/**
* Serializes a value for interpolation into the injected `` is a raw-text
* element, so its content is never entity-decoded and an `&` would be sent
* to the network as those five literal characters. What actually needs escaping
* is the backslash and the quote; newlines are invalid inside a CSS string, and
* `<` is neutralized so a value can never close the style element.
*/
export declare function escapeCssString(value: string): string;
/**
* A highlighter name becomes both a CSS class (`.name { … }`) and a selector
* handed to `querySelectorAll`/`closest` inside the WebView. An invalid
* identifier — a leading digit, a space, a quote — either throws a DOMException
* from a bare event listener or silently degrades into a selector that matches
* nothing, so names are validated once, up front, instead of failing at
* whichever call site happens to run first.
*/
export declare function isValidHighlighterName(name: string): boolean;
export declare function fontsToHeadMarkup(fonts: SelectableTextViewFonts | undefined): string;
export declare function fontsToCSS(fonts: SelectableTextViewFonts | undefined): string;
export declare function buildGoogleFontFamilyParam(options: GoogleFontFamily): string;
export declare function mergeFonts(...fonts: Array): SelectableTextViewFonts;
type GoogleFontsSingleOptions = {
family: string;
weights?: string;
italic?: boolean;
display?: "auto" | "block" | "swap" | "fallback" | "optional";
};
type GoogleFontsMultipleOptions = {
families: GoogleFontFamily[];
display?: "auto" | "block" | "swap" | "fallback" | "optional";
};
export declare function googleFonts(options: GoogleFontsSingleOptions | GoogleFontsMultipleOptions): SelectableTextViewFonts;
export declare function generatePromiseId(): string;
export declare function uniqueByName(list: Highlighter[]): Highlighter[];
export declare function toCssLength(value: number | string | undefined, fallback: string): string;
/**
* The page-side half of the custom-message bridge: `window.SelectableText`.
*
* It is emitted in `` because it has to exist before `content` runs. The
* module's own script sits after the content in ``, so a script in the
* content sending a message while the page is still being parsed would find
* nothing there. It posts under a single bridge type of its own, which is what
* keeps consumer messages from ever being read as the module's.
*/
export declare function customBridgeScript(): string;
/**
* State class carried by a highlight while its entrance animation plays. The
* WebView runtime adds it when a highlight is created or restored and drops it
* as soon as that animation ends or is interrupted.
*/
export declare const ENTERING_CLASS = "mnst-entering";
export declare function animationToCSS(animation?: AnimationOptions): string;
export declare function highlightersToCSS(list: Highlighter[]): string;
export declare const htmlContent: ({ hl, h, c, css, f, ho, p, o, }: {
hl: Highlighter[] | undefined;
h: Highlights | undefined;
c: HTMLString | undefined;
css: CSSString | undefined;
f: SelectableTextViewFonts | undefined;
ho: HighlighterOptions | undefined;
p: string;
o: SelectableTextViewOptions | undefined;
}) => string;
export {};
//# sourceMappingURL=utils.d.ts.map