/** An inclusive codepoint range, as written in a `unicode-range`. */ export interface CodepointRange { readonly first: number; readonly last: number; } /** One `@font-face` a built deck carries, without its payload. */ export interface FontFaceInfo { /** Family name the block declares. */ family: string; /** fontsource subset slug (`latin`, `cyrillic-ext`, …). */ subset: string; /** Absolute path of the woff2 the block inlines. */ file: string; /** * The range the block declares. The browser consults the face for these * codepoints and no others, so a face's real coverage is its cmap * intersected with this. */ ranges: readonly CodepointRange[]; } /** * Parse a `unicode-range` value: comma-separated `U+XXXX`, `U+XXXX-YYYY` and * wildcard `U+XX??` forms. An unparseable token is dropped rather than guessed * at — a range that claims too little only costs a subset that was going to be * included anyway. */ export declare function parseUnicodeRange(value: string): CodepointRange[]; /** Whether a codepoint falls inside any of the ranges. */ export declare function rangesContain( ranges: readonly CodepointRange[], codepoint: number, ): boolean; /** The two stylesheets a deck's fonts contribute. */ export interface FontCss { /** `@font-face` blocks with woff2 data URLs — self-contained, offline. */ faces: string; /** `:root` family tokens, empty unless the deck configured its own. */ tokens: string; } /** * Build a deck's font CSS: the subsets its text needs, in the families it * asked for. * * The result is a function of the deck, so it is not cached as a whole; the * file reads and base64 behind it are. `zerp serve` rebuilds the document per * request and therefore re-selects per request, which is what keeps live * reload honest when a slide gains a character in a new script. (A change to * package.json needs a server restart — serve watches slides/.) */ export declare function fontCss(rootDir: string, codepoints: ReadonlySet): Promise;