import type { WorkerModule } from 'troika-worker-utils'; import type { FontParser, ResolvedFont } from './FontParser.js'; import type { UnicodeFontResolverClient } from './libs/unicode-font-resolver-client.factory.js'; export type FontStyle = 'normal' | 'italic'; export type FontWeight = 'normal' | 'bold' | number; export type FontUnicodeRange = readonly [start: number, end?: number]; export interface UserFont { readonly src: string; readonly label?: string; readonly unicodeRange?: readonly FontUnicodeRange[]; readonly lang?: RegExp; } export interface FontResolverOptions { readonly lang?: string; readonly fonts?: UserFont | readonly UserFont[]; readonly style?: FontStyle; readonly weight?: FontWeight; readonly unicodeFontsURL?: string; readonly unicodeFontsDebug?: boolean; } export interface FontResolverResult { readonly chars: Uint8Array; readonly fonts: ResolvedFont[]; } export type FontResolverCallback = (result: FontResolverResult) => void; export type FontResolver = (text: string, callback: FontResolverCallback, options?: FontResolverOptions) => void; export type FontResolverWorkerModule = WorkerModule<[ text: string, callback: FontResolverCallback, options?: FontResolverOptions ], void, FontResolver>; /** Factory for the FontResolver function. */ export declare function createFontResolver(fontParser: FontParser, unicodeFontResolverClient: UnicodeFontResolverClient): FontResolver; export declare const fontResolverWorkerModule: FontResolverWorkerModule;