import type { GoogleFontFamily } from "@excalidraw/common"; import { ExcalidrawFontFace } from "./ExcalidrawFontFace"; import type { ExcalidrawFontFaceDescriptor } from "./Fonts"; export declare const DEFAULT_GOOGLE_FONT_WEIGHT = 400; /** * Font id format: `google:@`; no suffix means 400. * Returns `null` if the id is not a Google font id. */ export declare const parseGoogleFontId: (fontId: unknown) => { family: string; weight: number; } | null; export declare const formatGoogleFontId: (family: string, weight?: number) => GoogleFontFamily; type GoogleFontCssSources = (family: string) => readonly string[]; /** * Host-provided CSS2 base URLs per family, tried in order. The `family` and * `display` params are set by the fork. `undefined` restores the default. */ export declare const setGoogleFontCssSources: (sources: GoogleFontCssSources | undefined) => void; /** * Marks a source as failed for the session. * Returns `true` if the family has another source left to try. */ export declare const markGoogleFontSourceFailed: (family: string, source: string) => boolean; export declare const resetGoogleFontSourceFailures: () => void; export declare const getGoogleFontCssUrl: (family: string, weight?: number, source?: string) => URL; /** * `base` is the CSS URL; relative srcs (e.g. from a relay) resolve against it. */ export declare const parseGoogleFontFaceCss: (css: string, base?: string | URL) => ExcalidrawFontFaceDescriptor[]; /** * Loads the faces of a Google font id, trying the CSS sources in order. * A source that fails with a network error, 5xx or 429 is skipped for the * rest of the session; other errors only make this family try the next source. */ export declare const loadGoogleFontFaces: (fontId: GoogleFontFamily) => Promise<{ fontFaces: ExcalidrawFontFace[]; source: string; }>; export {};