import { FontDescriptor } from '../types';

/** "Poppins, sans-serif" -> "Poppins"; "'Times New Roman', serif" -> "Times New Roman" */
export declare function primaryToken(family: string): string;
/**
 * Registers each catalog font with the browser without downloading it. A
 * FontFace added to document.fonts but never `.load()`-ed behaves like a CSS
 * `@font-face` rule: the UA fetches it lazily the first time rendered text
 * (local edit, paste, undo, or a remote Yjs update) matches the family — which
 * is why no document-scanning extension is needed.
 *
 * Merges into the existing catalog and never clears it, so a second editor
 * mounting without a `fonts` prop can't wipe fonts other editors on the same
 * page still need. The CSS face name is derived from the family stack, not the
 * cosmetic `name`, so the registered face actually matches styled content.
 */
export declare function registerFonts(fonts: FontDescriptor[]): void;
export declare function getRegisteredFonts(): FontDescriptor[];
/**
 * Forces a download and resolves once the face is ready. Used by the picker
 * click so applying a font doesn't flash the fallback. `document.fonts.load`
 * deduplicates internally, so no custom promise cache is needed.
 */
export declare function ensureLoaded(family: string): Promise<unknown>;
