-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { FontLoader, Font, CustomFamilies, ParsedFont } from './types'; | ||
export declare class CustomLoader implements FontLoader { | ||
private readonly fonts_; | ||
private readonly uris_; | ||
constructor(config: CustomFamilies); | ||
/** | ||
* Returns parsed uris strings | ||
*/ | ||
getUris(): string[]; | ||
/** | ||
* Return all font's that should be loaded | ||
*/ | ||
getFonts(): Font[]; | ||
/** | ||
* Returns font object array | ||
*/ | ||
getParsedFonts(): ParsedFont[]; | ||
/** | ||
* Parsing config to separate string and object families | ||
* @param families | ||
* @private | ||
*/ | ||
private parseFamilyConfig_; | ||
} | ||
//# sourceMappingURL=CustomLoader.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { FontsLoaderConfig } from './types'; | ||
/** | ||
* Main function that loads all the fonts to <link /> tag | ||
* @param fontsLoaderConfig | ||
*/ | ||
export declare const FontsLoader: (fontsLoaderConfig: FontsLoaderConfig) => Promise<void>; | ||
//# sourceMappingURL=FontLoader.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import type { FontLoader, FontFamilies, Font, ParsedFont } from './types'; | ||
export declare class GoogleFontApi { | ||
private apiUrl_; | ||
private fonts_; | ||
private version_; | ||
/** | ||
* @param fonts | ||
* @param version | ||
*/ | ||
constructor(fonts: string[], version?: 1 | 2); | ||
/** | ||
* Builds font googleapis url from given fonts in constructor | ||
* @return string | ||
*/ | ||
buildUri(): string; | ||
} | ||
export declare class GoogleLoader implements FontLoader { | ||
private fonts_; | ||
private uri_; | ||
constructor(fonts: FontFamilies); | ||
/** | ||
* Returns google uri to get all the fonts | ||
*/ | ||
getUris(): string[]; | ||
/** | ||
* Return all google font's that should be loaded | ||
*/ | ||
getFonts(): Font[]; | ||
/** | ||
* Returns ParsedFont array for native font loading | ||
*/ | ||
getParsedFonts(): Promise<ParsedFont[]>; | ||
/** | ||
* Generates google font api url from given array of fonts | ||
*/ | ||
private generateUri_; | ||
} | ||
//# sourceMappingURL=GoogleLoader.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { ParsedFont } from '../types'; | ||
export declare class CssParser { | ||
private css_; | ||
private rules_; | ||
constructor(fontFaceResponseText: string); | ||
/** | ||
* Returns ParsedFont array of parsed CSS | ||
*/ | ||
getParsedFonts(): ParsedFont[]; | ||
/** | ||
* Parses CSS into array of ParsedFont object | ||
*/ | ||
parseCSS(): void; | ||
/** | ||
* Parsing css block | ||
* @param css | ||
* @private | ||
*/ | ||
private parseCSSBlock_; | ||
/** | ||
* Removes all empty lines from CSS | ||
* @param css | ||
* @private | ||
*/ | ||
private removeNewLines_; | ||
} | ||
//# sourceMappingURL=CSSParser.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { FontsLoaderConfig } from '../types'; | ||
export declare enum FontEvents { | ||
LOADING = "loading", | ||
ACTIVE = "active", | ||
INACTIVE = "inactive", | ||
FONT_LOADING = "fontloading", | ||
FONT_ACTIVE = "fontactive", | ||
FONT_INACTIVE = "fontinactive" | ||
} | ||
export declare class EventBus { | ||
private namespace_; | ||
private classSeparator_; | ||
private event_; | ||
private config_; | ||
private htmlElement_; | ||
constructor(config: FontsLoaderConfig); | ||
private handleLoading_; | ||
private handleActive_; | ||
private handleInactive_; | ||
private handleFontLoading_; | ||
private handleFontActive_; | ||
private handleFontInactive_; | ||
private addClassToHtml_; | ||
private removeClassFromHtml_; | ||
private sanitizeClassName_; | ||
} | ||
//# sourceMappingURL=EventBus.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** Source: https://github.com/typekit/webfontloader/blob/master/src/modules/google/fontapiparser.js */ | ||
import type { Font } from '../types'; | ||
export declare class FontParser { | ||
private fontFamilies; | ||
private parsedFonts; | ||
private fontTestStrings; | ||
private INT_FONTS; | ||
private WEIGHTS; | ||
private STYLES; | ||
private VARIATION_MATCH; | ||
constructor(fontFamilies: string[]); | ||
parse(): void; | ||
private generateFontVariationDescription; | ||
private normalizeStyle; | ||
private normalizeWeight; | ||
private parseVariations; | ||
parseSubsets<T extends string = string>(subsets: T): T[]; | ||
getFonts(): Font[]; | ||
getFontTestStrings(): Record<string, string>; | ||
} | ||
//# sourceMappingURL=FontParser.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { Font, LoadingMethod } from '../types'; | ||
export declare class FontWatcher { | ||
private font_; | ||
private load_; | ||
constructor(font: Font, load: LoadingMethod); | ||
private loading_; | ||
getFont(): Font; | ||
watch(): boolean; | ||
} | ||
//# sourceMappingURL=FontWatcher.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { Font, LoadingMethod } from '../types'; | ||
export declare class Watcher { | ||
private fontWatchers_; | ||
private loadedFonts_; | ||
private watched_; | ||
add(font: Font, load: LoadingMethod): void; | ||
fontLoaded(fontName: string): void; | ||
watchFonts(): void; | ||
} | ||
//# sourceMappingURL=Watcher.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.