import type { IDisposableLike } from '@breadstone/mosaik-elements'; import type { IFont } from '../Types/IFont'; import type { IFontProvider, IFontProviderOptions, IFontProviderRequest, IFontProviderResponse } from '../Types/IFontProvider'; /** * Options for the Google Fonts provider. * * @public */ export interface IGoogleFontProviderOptions extends IFontProviderOptions { /** * The Google Fonts API key. */ apiKey: string; /** * Sort order for the fonts. * @default 'alpha' */ sort?: 'alpha' | 'date' | 'popularity' | 'style' | 'trending'; /** * Filter fonts by subset. */ subset?: string; } /** * Google Fonts provider that fetches fonts from the Google Fonts API. * * @public */ export declare class GoogleFontProvider implements IFontProvider { private readonly _options; private _cachedFonts; private _cachePromise; private readonly _loadedFonts; /** * Creates a new instance of GoogleFontProvider. * * @param options - The provider options. */ constructor(options: IGoogleFontProviderOptions); /** * @inheritdoc */ get name(): string; /** * @inheritdoc */ get displayName(): string; /** * @inheritdoc */ fetchFonts(request: IFontProviderRequest): Promise; /** * @inheritdoc */ loadFont(font: IFont): IDisposableLike; /** * @inheritdoc */ isAvailable(): Promise; /** * Fetches all fonts from the Google Fonts API. * * @param signal - The abort signal. * @returns A promise that resolves to all fonts. */ private fetchAllFonts; /** * Performs the actual API fetch. * * @param signal - The abort signal. * @returns A promise that resolves to the fonts. */ private doFetchFonts; /** * Maps a Google Fonts API item to an IFont. * * @param item - The API item. * @returns The mapped font. */ private mapToFont; /** * Maps a Google Fonts category to our FontCategory type. * * @param category - The Google Fonts category. * @returns The mapped category. */ private mapCategory; } /** * Creates a Google Fonts provider instance. * * @param options - The provider options. * @returns A new GoogleFontProvider instance. * @public */ export declare function createGoogleFontProvider(options: IGoogleFontProviderOptions): IFontProvider; //# sourceMappingURL=GoogleFontProvider.d.ts.map