type FontFaceSpec = {
    weight: string;
    style?: "normal" | "italic";
};
type CanonicalFontSpec = {
    packageName: string;
    faces: FontFaceSpec[];
};
/**
 * Family names that resolve to a host-OS font (or a CSS generic that the
 * browser substitutes with a host-OS font). Exported so plan-time validators
 * can reject them as primary families in distributed renders.
 *
 * Lower-cased — call `normalizeFamilyName` on declared values before lookup.
 */
export declare const GENERIC_FAMILIES: ReadonlySet<string>;
/**
 * Parse a single `font-family` value (e.g. `"Inter", -apple-system,
 * sans-serif`) into a list of unquoted family names in declaration order.
 * Whitespace and surrounding `"…"` / `'…'` quotes are stripped; case is
 * preserved. Pass each name through `normalizeFamilyName` for case-
 * insensitive comparisons.
 *
 * Only top-level commas split: a `var(--x, fallback)` expression stays one
 * token, as does a comma inside a quoted family name.
 */
export declare function parseFontFamilyValue(value: string): string[];
/**
 * Import/generated HTML often uses host UI stacks such as
 * `-apple-system, BlinkMacSystemFont, sans-serif` as a primary family. That is
 * fine on the author's machine but not in distributed render workers, where
 * host fonts differ by OS. Promote a bundled deterministic family to the
 * primary slot while preserving the original stack as fallbacks.
 */
export declare function normalizeSystemFontPrimaryFamilies(html: string, deterministicPrimary?: string): string;
/** Surfaces font-family is declared on in served HTML. */
export type FontFamilySurface = "font-family" | "data-font-family";
export type FontFamilyDeclaration = {
    surface: FontFamilySurface;
    declaration: string;
    families: string[];
};
/**
 * Collect simple CSS custom-property font aliases from style blocks and inline
 * styles. CSS cascade is richer than this map, but for compiler-generated
 * imports the common shape is `--font: Inter, sans-serif` paired with
 * `font-family: var(--font)`.
 */
export declare function collectFontFamilyCustomProperties(html: string): Map<string, string>;
export declare function resolveFontFamilyDeclarationFamilies(declaration: string, customProperties: ReadonlyMap<string, string>): string[];
/**
 * Iterate every font-family declaration in a compiled HTML document. Yields
 * each declaration's surface (CSS property vs HTML attribute), raw value,
 * and the parsed family list. Used by both the @font-face injector and the
 * plan-time validator so they read the same surface area.
 */
export declare function iterateFontFamilyDeclarations(html: string): Generator<FontFamilyDeclaration, void, void>;
declare const CANONICAL_FONTS: Record<string, CanonicalFontSpec>;
export declare const FONT_ALIASES: Record<string, keyof typeof CANONICAL_FONTS>;
export { FONT_ALIAS_KEYS } from "@hyperframes/core/fonts/aliases";
export declare function fontFormatHint(src: string): "collection" | "woff2";
/**
 * Typed codes let distributed workflow adapters distinguish deterministic
 * resolution failures from temporary upstream unavailability.
 */
export declare const FONT_FETCH_FAILED = "FONT_FETCH_FAILED";
export declare const FONT_FETCH_UNAVAILABLE = "FONT_FETCH_UNAVAILABLE";
export type FontFetchErrorCode = typeof FONT_FETCH_FAILED | typeof FONT_FETCH_UNAVAILABLE;
/**
 * Typed error thrown by {@link injectDeterministicFontFaces} when
 * `failClosedFontFetch === true` and deterministic font resolution fails.
 * The default (swallow + warn) preserves the in-process behavior.
 */
export declare class FontFetchError extends Error {
    readonly code: FontFetchErrorCode;
    readonly familyName: string;
    readonly url: string;
    readonly cause?: unknown;
    constructor(familyName: string, url: string, message: string, cause?: unknown, code?: FontFetchErrorCode);
}
/**
 * Retryable font-fetch failure. Distributed adapters map this code to an
 * unavailable response so the workflow can retry the plan activity.
 */
export declare class FontFetchUnavailableError extends FontFetchError {
    constructor(familyName: string, url: string, message: string, cause?: unknown);
}
export interface FontFetchRetryPolicy {
    /** Total fetch attempts for one CSS or woff2 URL. Default: 2. */
    maxAttempts: number;
    /** Timeout for each individual fetch attempt. Default: 8 seconds. */
    attemptTimeoutMs: number;
    /** Shared wall-clock budget for all Google Fonts requests in one compile. Default: 20 seconds. */
    maxElapsedMs: number;
    /** Initial full-jitter backoff ceiling. Default: 250 ms. */
    baseDelayMs: number;
}
/**
 * Options for {@link injectDeterministicFontFaces}.
 */
export interface InjectDeterministicFontFacesOptions {
    /**
     * When `true`, exhausted transient fetch failures throw
     * {@link FontFetchUnavailableError} with code `FONT_FETCH_UNAVAILABLE`;
     * deterministic resolution failures retain `FONT_FETCH_FAILED`.
     *
     * Default `false`: failed fetches are silently swallowed; the composition
     * falls back to system fonts via `warnUnresolvedFonts`. This preserves the
     * in-process behavior.
     *
     * Distributed callers pass `true` so font availability is part of the
     * planDir's content-addressed hash and failures surface as typed errors.
     */
    failClosedFontFetch?: boolean;
    /**
     * Injectable `fetch` implementation. Defaults to the global `fetch`.
     * Tests pass a stub to simulate fetch failures without going over the
     * network.
     */
    fetchImpl?: typeof fetch;
    /** Caller cancellation propagated through fetch attempts and retry waits. */
    abortSignal?: AbortSignal;
    /**
     * Optional retry tuning. Defaults are deliberately bounded for composition
     * planning; tests may lower delays and timeouts without replacing timers.
     */
    fontFetchRetryPolicy?: Partial<FontFetchRetryPolicy>;
    /**
     * When `true` (default for local renders), fonts that aren't resolved by
     * the bundled alias map or Google Fonts are located on the local filesystem,
     * compressed to woff2, and embedded as data URIs. Set to `false` for
     * distributed/Lambda renders where the host filesystem is not guaranteed
     * to contain the same fonts as the authoring machine.
     */
    allowSystemFontCapture?: boolean;
}
export declare function injectDeterministicFontFaces(html: string, options?: InjectDeterministicFontFacesOptions): Promise<string>;
//# sourceMappingURL=deterministicFonts.d.ts.map