forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webfontloader.d.ts
60 lines (56 loc) · 1.88 KB
/
webfontloader.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Type definitions for typekit-webfontloader 1.6.4
// Project: https://github.com/typekit/webfontloader
// Definitions by: doskallemaskin <https://github.com/doskallemaskin/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module WebFont {
export function load(config:WebFont.Config):void;
export interface Config {
/** Setting this to false will disable html classes (defaults to true) */
classes?:boolean;
/** Settings this to false will disable callbacks/events (defaults to true) */
events?:boolean;
/** Time (in ms) until the fontinactive callback will be triggered (defaults to 5000) */
timeout?:number;
/** This event is triggered when all fonts have been requested. */
loading?():void;
/** This event is triggered when the fonts have rendered. */
active?():void;
/** This event is triggered when the browser does not support linked fonts or if none of the fonts could be loaded. */
inactive?():void;
/** This event is triggered once for each font that's loaded. */
fontloading?(familyName:string, fvd:string):void;
/** This event is triggered once for each font that renders. */
fontactive?(familyName:string, fvd:string):void;
/** This event is triggered if the font can't be loaded. */
fontinactive?(familyName:string, fvd:string):void;
/** Child window or iframes to manage fonts for */
context?:Array<string>;
custom?:Custom;
google?:Google;
typekit?:Typekit;
fontdeck?:Fontdeck;
monotype?:Monotype;
}
export interface Google {
families:Array<string>;
text?: string;
}
export interface Typekit {
id?:Array<string>;
}
export interface Custom {
families?:Array<string>;
urls?:Array<string>;
testStrings?:{[fontFamily:string]:string};
}
export interface Fontdeck {
id?:string;
}
export interface Monotype {
projectId?:string;
version?:number;
}
}
declare module "webfontloader" {
export = WebFont;
}