mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #4957 from doskallemaskin/master
webfontloader definitions added
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/// <reference path="webfontloader" />
|
||||
import webfontloader = require("webfontloader");
|
||||
|
||||
var config: webfontloader.Config = {
|
||||
classes: false,
|
||||
events: false,
|
||||
loading: function() {},
|
||||
active: function() {},
|
||||
inactive: function() {},
|
||||
fontloading: function(familyName:string, fvd:string) {},
|
||||
fontactive: function(familyName:string, fvd:string) {},
|
||||
fontinactive: function(familyName:string, fvd:string) {},
|
||||
google: {
|
||||
families: ['Droid Sans', 'Droid Serif:bold'],
|
||||
text: 'abcdedfghijklmopqrstuvwxyz!'
|
||||
},
|
||||
custom: {
|
||||
families: ['My Font', 'My Other Font:n4,i4,n7'],
|
||||
urls: ['/fonts.css']
|
||||
},
|
||||
fontdeck: {
|
||||
id: 'xxxx'
|
||||
},
|
||||
monotype: {
|
||||
projectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
||||
version: 12345
|
||||
},
|
||||
timeout: 2000
|
||||
}
|
||||
webfontloader.load(config);
|
||||
@@ -0,0 +1 @@
|
||||
--noImplicitAny --module commonjs --target es5
|
||||
Vendored
+60
@@ -0,0 +1,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;
|
||||
}
|
||||
Reference in New Issue
Block a user