Merge pull request #6030 from couven92/master

Updated Google Chrome JavaScript API documentation
This commit is contained in:
Masahiro Wakame
2015-10-13 01:45:39 +09:00
26 changed files with 7761 additions and 2053 deletions
+60 -60
View File
@@ -1,61 +1,61 @@
/// <reference path="angular-gettext.d.ts" />
module angular_gettext_tests {
// Configuring angular-gettext
// https://angular-gettext.rocketeer.be/dev-guide/configure/
//Setting the language
angular.module('myApp').run(function (gettextCatalog: angular.gettext.gettextCatalog) {
gettextCatalog.setCurrentLanguage('nl');
});
//Highlighting untranslated strings
angular.module('myApp').run(function (gettextCatalog: angular.gettext.gettextCatalog) {
gettextCatalog.debug = true;
});
// Marking strings in JavaScript code as translatable.
// https://angular-gettext.rocketeer.be/dev-guide/annotate-js/
angular.module("myApp").controller("helloController", function (gettext: angular.gettext.gettextFunction) {
var myString = gettext("Hello");
});
//Translating directly in JavaScript.
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
var translated: string = gettextCatalog.getString("Hello");
});
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
var myString2: string = gettextCatalog.getPlural(3, "Bird", "Birds");
});
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
var translated: string = gettextCatalog.getString("Hello {{name}}", { name: "Ruben" });
});
// Setting strings manually
// https://angular-gettext.rocketeer.be/dev-guide/manual-setstrings/
angular.module("myApp").run(function (gettextCatalog: angular.gettext.gettextCatalog) {
// Load the strings automatically during initialization.
gettextCatalog.setStrings("nl", {
"Hello": "Hallo",
"One boat": ["Een boot", "{{$count}} boats"]
});
});
interface helloControllerScope extends ng.IScope {
switchLanguage: (lang: string) => void;
}
// Lazy-loading languages
// https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/
angular.module("myApp").controller("helloController", function ($scope: helloControllerScope, gettextCatalog: angular.gettext.gettextCatalog) {
$scope.switchLanguage = function (lang: string) {
gettextCatalog.setCurrentLanguage(lang);
gettextCatalog.loadRemote("/languages/" + lang + ".json");
};
});
/// <reference path="angular-gettext.d.ts" />
module angular_gettext_tests {
// Configuring angular-gettext
// https://angular-gettext.rocketeer.be/dev-guide/configure/
//Setting the language
angular.module('myApp').run(function (gettextCatalog: angular.gettext.gettextCatalog) {
gettextCatalog.setCurrentLanguage('nl');
});
//Highlighting untranslated strings
angular.module('myApp').run(function (gettextCatalog: angular.gettext.gettextCatalog) {
gettextCatalog.debug = true;
});
// Marking strings in JavaScript code as translatable.
// https://angular-gettext.rocketeer.be/dev-guide/annotate-js/
angular.module("myApp").controller("helloController", function (gettext: angular.gettext.gettextFunction) {
var myString = gettext("Hello");
});
//Translating directly in JavaScript.
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
var translated: string = gettextCatalog.getString("Hello");
});
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
var myString2: string = gettextCatalog.getPlural(3, "Bird", "Birds");
});
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
var translated: string = gettextCatalog.getString("Hello {{name}}", { name: "Ruben" });
});
// Setting strings manually
// https://angular-gettext.rocketeer.be/dev-guide/manual-setstrings/
angular.module("myApp").run(function (gettextCatalog: angular.gettext.gettextCatalog) {
// Load the strings automatically during initialization.
gettextCatalog.setStrings("nl", {
"Hello": "Hallo",
"One boat": ["Een boot", "{{$count}} boats"]
});
});
interface helloControllerScope extends ng.IScope {
switchLanguage: (lang: string) => void;
}
// Lazy-loading languages
// https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/
angular.module("myApp").controller("helloController", function ($scope: helloControllerScope, gettextCatalog: angular.gettext.gettextCatalog) {
$scope.switchLanguage = function (lang: string) {
gettextCatalog.setCurrentLanguage(lang);
gettextCatalog.loadRemote("/languages/" + lang + ".json");
};
});
}
+73 -73
View File
@@ -1,73 +1,73 @@
// Type definitions for angular-gettext v2.1.0
// Project: https://angular-gettext.rocketeer.be/
// Definitions by: Ákos Lukács <https://github.com/AkosLukacs>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.gettext {
interface gettextCatalog {
//////////////
/// Fields ///
//////////////
/** (default: false): Whether or not to prefix untranslated strings with [MISSING]: or a custom prefix. */
debug: boolean;
/** (default: [MISSING]:): Custom prefix for untranslated strings. */
debugPrefix: string;
/** (default: false): Whether or not to wrap all processed text with markers.Example output: [Welcome] */
showTranslatedMarkers: boolean;
/** (default: [): Custom prefix to mark strings that have been run through angular-gettext. */
translatedMarkerPrefix: string;
/** (default: ]): Custom suffix to mark strings that have been run through angular-gettext. */
translatedMarkerSuffix: string;
/** An object of loaded translation strings.Shouldn't be used directly. */
strings: {};
/** The default language, in which you're application is written. This defaults to English and it's generally a bad idea to use anything else: if your language has different pluralization rules you'll end up with incorrect translations. Deprecated
* @deprecreated
*/
baseLanguage: string;
///////////////
/// Methods ///
///////////////
/** Sets the current language and makes sure that all translations get updated correctly. */
setCurrentLanguage(lang: string): void;
/** Returns the current language. */
getCurrentLanguage(): string;
/** Processes an object of string definitions. More details https://angular-gettext.rocketeer.be/dev-guide/manual-setstrings/
* @param language A language code.
* @param strings A dictionary of strings. The format of this dictionary is:
* - Keys: Singular English strings (as defined in the source files)
* - Values: Either a single string for signular-only strings or an array of plural forms.
*/
setStrings(language: string, strings: { [key: string]: string|string[] }): void;
/** Get the correct pluralized (but untranslated) string for the value of n. */
getStringForm(string: string, n: number): string;
/** Translate a string with the given context. Uses Angular.JS interpolation, so something like this will do what you expect:
* var hello = gettextCatalog.getString("Hello {{name}}!", { name: "Ruben" });
* // var hello will be "Hallo Ruben!" in Dutch.
* The context parameter is optional: pass null (or don't pass anything) if you're not using it: this skips interpolation and is a lot faster.
*/
getString(string: string, context?: any): string;
/** Translate a plural string with the given context. */
getPlural(n: number, string: string, stringPlural: string, context?: any): string;
/** Load a set of translation strings from a given URL.This should be a JSON catalog generated with grunt-angular-gettext. More details https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ */
loadRemote(url: string): ng.IHttpPromise<any>;
}
/** If you have text that should be translated in your JavaScript code, wrap it with a call to a function named gettext. This module provides an injectable function to do so */
interface gettextFunction {
(dummyString: string): string;
}
}
// Type definitions for angular-gettext v2.1.0
// Project: https://angular-gettext.rocketeer.be/
// Definitions by: Ákos Lukács <https://github.com/AkosLukacs>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.gettext {
interface gettextCatalog {
//////////////
/// Fields ///
//////////////
/** (default: false): Whether or not to prefix untranslated strings with [MISSING]: or a custom prefix. */
debug: boolean;
/** (default: [MISSING]:): Custom prefix for untranslated strings. */
debugPrefix: string;
/** (default: false): Whether or not to wrap all processed text with markers.Example output: [Welcome] */
showTranslatedMarkers: boolean;
/** (default: [): Custom prefix to mark strings that have been run through angular-gettext. */
translatedMarkerPrefix: string;
/** (default: ]): Custom suffix to mark strings that have been run through angular-gettext. */
translatedMarkerSuffix: string;
/** An object of loaded translation strings.Shouldn't be used directly. */
strings: {};
/** The default language, in which you're application is written. This defaults to English and it's generally a bad idea to use anything else: if your language has different pluralization rules you'll end up with incorrect translations. Deprecated
* @deprecreated
*/
baseLanguage: string;
///////////////
/// Methods ///
///////////////
/** Sets the current language and makes sure that all translations get updated correctly. */
setCurrentLanguage(lang: string): void;
/** Returns the current language. */
getCurrentLanguage(): string;
/** Processes an object of string definitions. More details https://angular-gettext.rocketeer.be/dev-guide/manual-setstrings/
* @param language A language code.
* @param strings A dictionary of strings. The format of this dictionary is:
* - Keys: Singular English strings (as defined in the source files)
* - Values: Either a single string for signular-only strings or an array of plural forms.
*/
setStrings(language: string, strings: { [key: string]: string|string[] }): void;
/** Get the correct pluralized (but untranslated) string for the value of n. */
getStringForm(string: string, n: number): string;
/** Translate a string with the given context. Uses Angular.JS interpolation, so something like this will do what you expect:
* var hello = gettextCatalog.getString("Hello {{name}}!", { name: "Ruben" });
* // var hello will be "Hallo Ruben!" in Dutch.
* The context parameter is optional: pass null (or don't pass anything) if you're not using it: this skips interpolation and is a lot faster.
*/
getString(string: string, context?: any): string;
/** Translate a plural string with the given context. */
getPlural(n: number, string: string, stringPlural: string, context?: any): string;
/** Load a set of translation strings from a given URL.This should be a JSON catalog generated with grunt-angular-gettext. More details https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ */
loadRemote(url: string): ng.IHttpPromise<any>;
}
/** If you have text that should be translated in your JavaScript code, wrap it with a call to a function named gettext. This module provides an injectable function to do so */
interface gettextFunction {
(dummyString: string): string;
}
}
+165 -165
View File
@@ -1,165 +1,165 @@
// Type definitions for Async 1.4.2
// Project: https://github.com/caolan/async
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Arseniy Maximov <https://github.com/kern0>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Dictionary<T> { [key: string]: T; }
interface ErrorCallback { (err?: Error): void; }
interface AsyncResultCallback<T> { (err: Error, result: T): void; }
interface AsyncResultArrayCallback<T> { (err: Error, results: T[]): void; }
interface AsyncResultObjectCallback<T> { (err: Error, results: Dictionary<T>): void; }
interface AsyncFunction<T> { (callback: (err: Error, result?: T) => void): void; }
interface AsyncIterator<T> { (item: T, callback: ErrorCallback): void; }
interface AsyncForEachOfIterator<T> { (item: T, key: number, callback: ErrorCallback): void; }
interface AsyncResultIterator<T, R> { (item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncMemoIterator<T, R> { (memo: R, item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncBooleanIterator<T> { (item: T, callback: (truthValue: boolean) => void): void; }
interface AsyncWorker<T> { (task: T, callback: ErrorCallback): void; }
interface AsyncVoidFunction { (callback: ErrorCallback): void; }
interface AsyncQueue<T> {
length(): number;
started: boolean;
running(): number;
idle(): boolean;
concurrency: number;
push(task: T, callback?: ErrorCallback): void;
push(task: T[], callback?: ErrorCallback): void;
unshift(task: T, callback?: ErrorCallback): void;
unshift(task: T[], callback?: ErrorCallback): void;
saturated: () => any;
empty: () => any;
drain: () => any;
paused: boolean;
pause(): void
resume(): void;
kill(): void;
}
interface AsyncPriorityQueue<T> {
length(): number;
concurrency: number;
started: boolean;
paused: boolean;
push(task: T, priority: number, callback?: AsyncResultArrayCallback<T>): void;
push(task: T[], priority: number, callback?: AsyncResultArrayCallback<T>): void;
saturated: () => any;
empty: () => any;
drain: () => any;
running(): number;
idle(): boolean;
pause(): void;
resume(): void;
kill(): void;
}
interface AsyncCargo {
length(): number;
payload: number;
push(task: any, callback? : Function): void;
push(task: any[], callback? : Function): void;
saturated(): void;
empty(): void;
drain(): void;
idle(): boolean;
pause(): void;
resume(): void;
kill(): void;
}
interface Async {
// Collections
each<T>(arr: T[], iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
eachSeries<T>(arr: T[], iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
eachLimit<T>(arr: T[], limit: number, iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
forEachOf(obj: any, iterator: (item: any, key: [string|number], callback?: ErrorCallback) => void, callback: ErrorCallback): void;
forEachOf<T>(obj: T[], iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
forEachOfSeries(obj: any, iterator: (item: any, key: [string|number], callback?: ErrorCallback) => void, callback: ErrorCallback): void;
forEachOfSeries<T>(obj: T[], iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
forEachOfLimit(obj: any, limit: number, iterator: (item: any, key: [string|number], callback?: ErrorCallback) => void, callback: ErrorCallback): void;
forEachOfLimit<T>(obj: T[], limit: number, iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
map<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
mapSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
mapLimit<T, R>(arr: T[], limit: number, iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
filter<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
select<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
filterSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
selectSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
filterLimit<T>(arr: T[], limit: number, iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
selectLimit<T>(arr: T[], limit: number, iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
reject<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
rejectSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
rejectLimit<T>(arr: T[], limit: number, iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
reduce<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
inject<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
foldl<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
reduceRight<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
foldr<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
detect<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: T) => void): any;
detectSeries<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: T) => void): any;
detectLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: (result: T) => void): any;
sortBy<T, V>(arr: T[], iterator: AsyncResultIterator<T, V>, callback?: AsyncResultArrayCallback<T>): any;
some<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
someLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
any<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
every<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
everyLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
all<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
concat<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): any;
concatSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): any;
// Control Flow
series<T>(tasks: AsyncFunction<T>[], callback?: AsyncResultArrayCallback<T>): void;
series<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallel<T>(tasks: Array<AsyncFunction<T>>, callback?: AsyncResultArrayCallback<T>): void;
parallel<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallelLimit<T>(tasks: Array<AsyncFunction<T>>, limit: number, callback?: AsyncResultArrayCallback<T>): void;
parallelLimit<T>(tasks: Dictionary<AsyncFunction<T>>, limit: number, callback?: AsyncResultObjectCallback<T>): void;
whilst(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
until(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
during(test: (testCallback : (error: Error, truth: boolean) => void) => void, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doDuring(fn: AsyncVoidFunction, test: (testCallback: (error: Error, truth: boolean) => void) => void, callback: (err: any) => void): void;
forever(next: (errCallback : (err: Error) => void) => void, errBack: (err: Error) => void) : void;
waterfall(tasks: Function[], callback?: (err: Error, result: any) => void): void;
compose(...fns: Function[]): void;
seq(...fns: Function[]): void;
applyEach(fns: Function[], argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
applyEachSeries(fns: Function[], argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
queue<T>(worker: AsyncWorker<T>, concurrency?: number): AsyncQueue<T>;
priorityQueue<T>(worker: AsyncWorker<T>, concurrency: number): AsyncPriorityQueue<T>;
cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo;
auto(tasks: any, callback?: (error: Error, results: any) => void): void;
retry<T>(opts: number, task: (callback : AsyncResultCallback<T>, results: any) => void, callback: (error: Error, results: any) => void): void;
retry<T>(opts: { times: number, interval: number }, task: (callback: AsyncResultCallback<T>, results : any) => void, callback: (error: Error, results: any) => void): void;
iterator(tasks: Function[]): Function;
apply(fn: Function, ...arguments: any[]): AsyncFunction<any>;
nextTick(callback: Function): void;
setImmediate(callback: Function): void;
times<T> (n: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
timesSeries<T>(n: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
timesLimit<T>(n: number, limit: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
// Utils
memoize(fn: Function, hasher?: Function): Function;
unmemoize(fn: Function): Function;
ensureAsync(fn: (... argsAndCallback: any[]) => void): Function;
constant(...values: any[]): Function;
asyncify(fn: Function): Function;
wrapSync(fn: Function): Function;
log(fn: Function, ...arguments: any[]): void;
dir(fn: Function, ...arguments: any[]): void;
noConflict(): Async;
}
declare var async: Async;
declare module "async" {
export = async;
}
// Type definitions for Async 1.4.2
// Project: https://github.com/caolan/async
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Arseniy Maximov <https://github.com/kern0>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Dictionary<T> { [key: string]: T; }
interface ErrorCallback { (err?: Error): void; }
interface AsyncResultCallback<T> { (err: Error, result: T): void; }
interface AsyncResultArrayCallback<T> { (err: Error, results: T[]): void; }
interface AsyncResultObjectCallback<T> { (err: Error, results: Dictionary<T>): void; }
interface AsyncFunction<T> { (callback: (err: Error, result?: T) => void): void; }
interface AsyncIterator<T> { (item: T, callback: ErrorCallback): void; }
interface AsyncForEachOfIterator<T> { (item: T, key: number, callback: ErrorCallback): void; }
interface AsyncResultIterator<T, R> { (item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncMemoIterator<T, R> { (memo: R, item: T, callback: AsyncResultCallback<R>): void; }
interface AsyncBooleanIterator<T> { (item: T, callback: (truthValue: boolean) => void): void; }
interface AsyncWorker<T> { (task: T, callback: ErrorCallback): void; }
interface AsyncVoidFunction { (callback: ErrorCallback): void; }
interface AsyncQueue<T> {
length(): number;
started: boolean;
running(): number;
idle(): boolean;
concurrency: number;
push(task: T, callback?: ErrorCallback): void;
push(task: T[], callback?: ErrorCallback): void;
unshift(task: T, callback?: ErrorCallback): void;
unshift(task: T[], callback?: ErrorCallback): void;
saturated: () => any;
empty: () => any;
drain: () => any;
paused: boolean;
pause(): void
resume(): void;
kill(): void;
}
interface AsyncPriorityQueue<T> {
length(): number;
concurrency: number;
started: boolean;
paused: boolean;
push(task: T, priority: number, callback?: AsyncResultArrayCallback<T>): void;
push(task: T[], priority: number, callback?: AsyncResultArrayCallback<T>): void;
saturated: () => any;
empty: () => any;
drain: () => any;
running(): number;
idle(): boolean;
pause(): void;
resume(): void;
kill(): void;
}
interface AsyncCargo {
length(): number;
payload: number;
push(task: any, callback? : Function): void;
push(task: any[], callback? : Function): void;
saturated(): void;
empty(): void;
drain(): void;
idle(): boolean;
pause(): void;
resume(): void;
kill(): void;
}
interface Async {
// Collections
each<T>(arr: T[], iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
eachSeries<T>(arr: T[], iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
eachLimit<T>(arr: T[], limit: number, iterator: AsyncIterator<T>, callback?: ErrorCallback): void;
forEachOf(obj: any, iterator: (item: any, key: [string|number], callback?: ErrorCallback) => void, callback: ErrorCallback): void;
forEachOf<T>(obj: T[], iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
forEachOfSeries(obj: any, iterator: (item: any, key: [string|number], callback?: ErrorCallback) => void, callback: ErrorCallback): void;
forEachOfSeries<T>(obj: T[], iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
forEachOfLimit(obj: any, limit: number, iterator: (item: any, key: [string|number], callback?: ErrorCallback) => void, callback: ErrorCallback): void;
forEachOfLimit<T>(obj: T[], limit: number, iterator: AsyncForEachOfIterator<T>, callback?: ErrorCallback): void;
map<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
mapSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
mapLimit<T, R>(arr: T[], limit: number, iterator: AsyncResultIterator<T, R>, callback?: AsyncResultArrayCallback<R>): any;
filter<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
select<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
filterSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
selectSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
filterLimit<T>(arr: T[], limit: number, iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
selectLimit<T>(arr: T[], limit: number, iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
reject<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
rejectSeries<T>(arr: T[], iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
rejectLimit<T>(arr: T[], limit: number, iterator: AsyncResultIterator<T, boolean>, callback?: (results: T[]) => any): any;
reduce<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
inject<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
foldl<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback?: AsyncResultCallback<R>): any;
reduceRight<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
foldr<T, R>(arr: T[], memo: R, iterator: AsyncMemoIterator<T, R>, callback: AsyncResultCallback<R>): any;
detect<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: T) => void): any;
detectSeries<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: T) => void): any;
detectLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: (result: T) => void): any;
sortBy<T, V>(arr: T[], iterator: AsyncResultIterator<T, V>, callback?: AsyncResultArrayCallback<T>): any;
some<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
someLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
any<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => void): any;
every<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
everyLimit<T>(arr: T[], limit: number, iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
all<T>(arr: T[], iterator: AsyncBooleanIterator<T>, callback?: (result: boolean) => any): any;
concat<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): any;
concatSeries<T, R>(arr: T[], iterator: AsyncResultIterator<T, R[]>, callback?: AsyncResultArrayCallback<R>): any;
// Control Flow
series<T>(tasks: AsyncFunction<T>[], callback?: AsyncResultArrayCallback<T>): void;
series<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallel<T>(tasks: Array<AsyncFunction<T>>, callback?: AsyncResultArrayCallback<T>): void;
parallel<T>(tasks: Dictionary<AsyncFunction<T>>, callback?: AsyncResultObjectCallback<T>): void;
parallelLimit<T>(tasks: Array<AsyncFunction<T>>, limit: number, callback?: AsyncResultArrayCallback<T>): void;
parallelLimit<T>(tasks: Dictionary<AsyncFunction<T>>, limit: number, callback?: AsyncResultObjectCallback<T>): void;
whilst(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
until(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void;
during(test: (testCallback : (error: Error, truth: boolean) => void) => void, fn: AsyncVoidFunction, callback: (err: any) => void): void;
doDuring(fn: AsyncVoidFunction, test: (testCallback: (error: Error, truth: boolean) => void) => void, callback: (err: any) => void): void;
forever(next: (errCallback : (err: Error) => void) => void, errBack: (err: Error) => void) : void;
waterfall(tasks: Function[], callback?: (err: Error, result: any) => void): void;
compose(...fns: Function[]): void;
seq(...fns: Function[]): void;
applyEach(fns: Function[], argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
applyEachSeries(fns: Function[], argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional.
queue<T>(worker: AsyncWorker<T>, concurrency?: number): AsyncQueue<T>;
priorityQueue<T>(worker: AsyncWorker<T>, concurrency: number): AsyncPriorityQueue<T>;
cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo;
auto(tasks: any, callback?: (error: Error, results: any) => void): void;
retry<T>(opts: number, task: (callback : AsyncResultCallback<T>, results: any) => void, callback: (error: Error, results: any) => void): void;
retry<T>(opts: { times: number, interval: number }, task: (callback: AsyncResultCallback<T>, results : any) => void, callback: (error: Error, results: any) => void): void;
iterator(tasks: Function[]): Function;
apply(fn: Function, ...arguments: any[]): AsyncFunction<any>;
nextTick(callback: Function): void;
setImmediate(callback: Function): void;
times<T> (n: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
timesSeries<T>(n: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
timesLimit<T>(n: number, limit: number, iterator: AsyncResultIterator<number, T>, callback: AsyncResultArrayCallback<T>): void;
// Utils
memoize(fn: Function, hasher?: Function): Function;
unmemoize(fn: Function): Function;
ensureAsync(fn: (... argsAndCallback: any[]) => void): Function;
constant(...values: any[]): Function;
asyncify(fn: Function): Function;
wrapSync(fn: Function): Function;
log(fn: Function, ...arguments: any[]): void;
dir(fn: Function, ...arguments: any[]): void;
noConflict(): Async;
}
declare var async: Async;
declare module "async" {
export = async;
}
+26 -26
View File
@@ -1,27 +1,27 @@
/// <reference path="better-curry.d.ts" />
import bc = require('better-curry');
bc.flatten([1,2,3,[1,2],['a']]) === [];
bc.MAX_OPTIMIZED = 5;
function fn(...args: number[]): number[] {
return [].concat([1]);
}
function fn2(arg1: string, arg2: any): number {
return parseInt(arg1 + String(arg2)) + 1;
}
bc.predefine(fn, [1,2])() === [];
bc.predefine(fn, [1,2]).__length === 3;
var f = bc.wrap(fn2, {}, 10, true);
f('1', 2) === 3;
var delegate = bc.delegate({}, 'ok');
delegate.access('ok') === delegate;
delegate.getter('getter').setter('setter') === delegate;
delegate.all(['1','2']);
delegate.revoke('adsf').access('asdf');
/// <reference path="better-curry.d.ts" />
import bc = require('better-curry');
bc.flatten([1,2,3,[1,2],['a']]) === [];
bc.MAX_OPTIMIZED = 5;
function fn(...args: number[]): number[] {
return [].concat([1]);
}
function fn2(arg1: string, arg2: any): number {
return parseInt(arg1 + String(arg2)) + 1;
}
bc.predefine(fn, [1,2])() === [];
bc.predefine(fn, [1,2]).__length === 3;
var f = bc.wrap(fn2, {}, 10, true);
f('1', 2) === 3;
var delegate = bc.delegate({}, 'ok');
delegate.access('ok') === delegate;
delegate.getter('getter').setter('setter') === delegate;
delegate.all(['1','2']);
delegate.revoke('adsf').access('asdf');
BetterCurry.wrap(fn2, {}, -1, false).__length === 10;
+49 -49
View File
@@ -1,50 +1,50 @@
// Type definitions for better-curry
// Project: https://github.com/pocesar/js-bettercurry
// Definitions by: Paulo Cesar <https://github.com/pocesar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare var BetterCurry: BetterCurryModule.BetterCurry;
declare module BetterCurryModule {
export interface DelegateOptions {
as?: string;
len?: number;
args?: any[];
name?: string;
}
export class Delegate<T> {
proto: T;
target: string;
methods: any[];
getters: any[];
setters: any[];
all: (skip?: string[]) => void;
method: (name: string|DelegateOptions) => Delegate<T>;
getter: (name: string|DelegateOptions) => Delegate<T>;
setter: (name: string|DelegateOptions) => Delegate<T>;
access: (name: string|DelegateOptions) => Delegate<T>;
revoke: (name: string) => Delegate<T>;
constructor(proto: T, target: string);
}
export interface OriginalFunctionReminder<T> extends Function {
__length: number;
}
export interface BetterCurry {
predefine: <T extends Function>(fn: T, args: any[], context?: Object, len?: number, checkArguments?: boolean) => OriginalFunctionReminder<T>;
wrap: <T extends Function>(fn: T, context?: Object, len?: number, checkArguments?: boolean) => OriginalFunctionReminder<T>;
flatten: (...args: Array<Array<any>|any>) => any[];
delegate: <T>(proto: T, target: string) => Delegate<T>;
MAX_OPTIMIZED: number;
}
}
declare module 'better-curry' {
var bc: BetterCurryModule.BetterCurry;
export = bc;
// Type definitions for better-curry
// Project: https://github.com/pocesar/js-bettercurry
// Definitions by: Paulo Cesar <https://github.com/pocesar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare var BetterCurry: BetterCurryModule.BetterCurry;
declare module BetterCurryModule {
export interface DelegateOptions {
as?: string;
len?: number;
args?: any[];
name?: string;
}
export class Delegate<T> {
proto: T;
target: string;
methods: any[];
getters: any[];
setters: any[];
all: (skip?: string[]) => void;
method: (name: string|DelegateOptions) => Delegate<T>;
getter: (name: string|DelegateOptions) => Delegate<T>;
setter: (name: string|DelegateOptions) => Delegate<T>;
access: (name: string|DelegateOptions) => Delegate<T>;
revoke: (name: string) => Delegate<T>;
constructor(proto: T, target: string);
}
export interface OriginalFunctionReminder<T> extends Function {
__length: number;
}
export interface BetterCurry {
predefine: <T extends Function>(fn: T, args: any[], context?: Object, len?: number, checkArguments?: boolean) => OriginalFunctionReminder<T>;
wrap: <T extends Function>(fn: T, context?: Object, len?: number, checkArguments?: boolean) => OriginalFunctionReminder<T>;
flatten: (...args: Array<Array<any>|any>) => any[];
delegate: <T>(proto: T, target: string) => Delegate<T>;
MAX_OPTIMIZED: number;
}
}
declare module 'better-curry' {
var bc: BetterCurryModule.BetterCurry;
export = bc;
}
+9 -9
View File
@@ -1,9 +1,9 @@
/// <reference path="./bowser.d.ts" />
import Bowser = require('bowser');
Bowser.msedge === true;
Bowser.test(['msie']) === true;
Bowser.a === Bowser.c;
Bowser.osversion > 10;
Bowser.osversion === '10.1A';
/// <reference path="./bowser.d.ts" />
import Bowser = require('bowser');
Bowser.msedge === true;
Bowser.test(['msie']) === true;
Bowser.a === Bowser.c;
Bowser.osversion > 10;
Bowser.osversion === '10.1A';
+54 -54
View File
@@ -1,54 +1,54 @@
// Type definitions for Bowser 1.x
// Project: https://github.com/ded/bowser
// Definitions by: Paulo Cesar <https://github.com/pocesar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'bowser' {
var def: BowserModule.IBowser;
export = def;
}
declare module BowserModule {
export interface IBowserUA {
msie: boolean;
chrome: boolean;
webkit: boolean;
phantom: boolean;
opera: boolean;
safari: boolean;
android: boolean;
ios: boolean;
webos: boolean;
msedge: boolean;
seamonkey: boolean;
firefox: boolean;
yandexbrowser: boolean;
blackberry: boolean;
tablet: boolean;
mobile: boolean;
silk: boolean;
bada: boolean;
tizen: boolean;
windowsphone: boolean;
firefoxos: boolean;
gecko: boolean;
sailfish: boolean;
chromeBook: boolean;
/** Grade A browser */
a: boolean;
/** Grade C browser */
c: boolean;
/** Grade X browser */
x: boolean;
name: string;
version: string|number;
osversion: string|number;
}
export interface IBowser extends IBowserUA {
test(browserList: string[]): boolean;
_detect(ua: string): IBowser;
}
}
// Type definitions for Bowser 1.x
// Project: https://github.com/ded/bowser
// Definitions by: Paulo Cesar <https://github.com/pocesar>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'bowser' {
var def: BowserModule.IBowser;
export = def;
}
declare module BowserModule {
export interface IBowserUA {
msie: boolean;
chrome: boolean;
webkit: boolean;
phantom: boolean;
opera: boolean;
safari: boolean;
android: boolean;
ios: boolean;
webos: boolean;
msedge: boolean;
seamonkey: boolean;
firefox: boolean;
yandexbrowser: boolean;
blackberry: boolean;
tablet: boolean;
mobile: boolean;
silk: boolean;
bada: boolean;
tizen: boolean;
windowsphone: boolean;
firefoxos: boolean;
gecko: boolean;
sailfish: boolean;
chromeBook: boolean;
/** Grade A browser */
a: boolean;
/** Grade C browser */
c: boolean;
/** Grade X browser */
x: boolean;
name: string;
version: string|number;
osversion: string|number;
}
export interface IBowser extends IBowserUA {
test(browserList: string[]): boolean;
_detect(ua: string): IBowser;
}
}
+1 -1
View File
@@ -305,4 +305,4 @@ declare module "chai" {
interface Object {
should: Chai.Assertion;
}
}
+388 -388
View File
@@ -1,388 +1,388 @@
// Type definitions for chai 3.2.0
// Project: http://chaijs.com/
// Definitions by: Jed Mao <https://github.com/jedmao/>,
// Bart van der Schoor <https://github.com/Bartvds>,
// Andrew Brown <https://github.com/AGBrown>,
// Olivier Chevet <https://github.com/olivr70>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// <reference path="../assertion-error/assertion-error.d.ts"/>
declare module Chai {
interface ChaiStatic {
expect: ExpectStatic;
should(): Should;
/**
* Provides a way to extend the internals of Chai
*/
use(fn: (chai: any, utils: any) => void): any;
assert: AssertStatic;
config: Config;
AssertionError: AssertionError;
}
export interface ExpectStatic extends AssertionStatic {
fail(actual?: any, expected?: any, message?: string, operator?: string): void;
}
export interface AssertStatic extends Assert {
}
export interface AssertionStatic {
(target: any, message?: string): Assertion;
}
interface ShouldAssertion {
equal(value1: any, value2: any, message?: string): void;
Throw: ShouldThrow;
throw: ShouldThrow;
exist(value: any, message?: string): void;
}
interface Should extends ShouldAssertion {
not: ShouldAssertion;
fail(actual: any, expected: any, message?: string, operator?: string): void;
}
interface ShouldThrow {
(actual: Function): void;
(actual: Function, expected: string|RegExp, message?: string): void;
(actual: Function, constructor: Error|Function, expected?: string|RegExp, message?: string): void;
}
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
not: Assertion;
deep: Deep;
any: KeyFilter;
all: KeyFilter;
a: TypeComparison;
an: TypeComparison;
include: Include;
includes: Include;
contain: Include;
contains: Include;
ok: Assertion;
true: Assertion;
false: Assertion;
null: Assertion;
undefined: Assertion;
NaN: Assertion;
exist: Assertion;
empty: Assertion;
arguments: Assertion;
Arguments: Assertion;
equal: Equal;
equals: Equal;
eq: Equal;
eql: Equal;
eqls: Equal;
property: Property;
ownProperty: OwnProperty;
haveOwnProperty: OwnProperty;
ownPropertyDescriptor: OwnPropertyDescriptor;
haveOwnPropertyDescriptor: OwnPropertyDescriptor;
length: Length;
lengthOf: Length;
match: Match;
matches: Match;
string(string: string, message?: string): Assertion;
keys: Keys;
key(string: string): Assertion;
throw: Throw;
throws: Throw;
Throw: Throw;
respondTo: RespondTo;
respondsTo: RespondTo;
itself: Assertion;
satisfy: Satisfy;
satisfies: Satisfy;
closeTo(expected: number, delta: number, message?: string): Assertion;
members: Members;
increase: PropertyChange;
increases: PropertyChange;
decrease: PropertyChange;
decreases: PropertyChange;
change: PropertyChange;
changes: PropertyChange;
extensible: Assertion;
sealed: Assertion;
frozen: Assertion;
}
interface LanguageChains {
to: Assertion;
be: Assertion;
been: Assertion;
is: Assertion;
that: Assertion;
which: Assertion;
and: Assertion;
has: Assertion;
have: Assertion;
with: Assertion;
at: Assertion;
of: Assertion;
same: Assertion;
}
interface NumericComparison {
above: NumberComparer;
gt: NumberComparer;
greaterThan: NumberComparer;
least: NumberComparer;
gte: NumberComparer;
below: NumberComparer;
lt: NumberComparer;
lessThan: NumberComparer;
most: NumberComparer;
lte: NumberComparer;
within(start: number, finish: number, message?: string): Assertion;
}
interface NumberComparer {
(value: number, message?: string): Assertion;
}
interface TypeComparison {
(type: string, message?: string): Assertion;
instanceof: InstanceOf;
instanceOf: InstanceOf;
}
interface InstanceOf {
(constructor: Object, message?: string): Assertion;
}
interface Deep {
equal: Equal;
include: Include;
property: Property;
members: Members;
}
interface KeyFilter {
keys: Keys;
}
interface Equal {
(value: any, message?: string): Assertion;
}
interface Property {
(name: string, value?: any, message?: string): Assertion;
}
interface OwnProperty {
(name: string, message?: string): Assertion;
}
interface OwnPropertyDescriptor {
(name: string, descriptor: PropertyDescriptor, message?: string): Assertion;
(name: string, message?: string): Assertion;
}
interface Length extends LanguageChains, NumericComparison {
(length: number, message?: string): Assertion;
}
interface Include {
(value: Object, message?: string): Assertion;
(value: string, message?: string): Assertion;
(value: number, message?: string): Assertion;
keys: Keys;
members: Members;
any: KeyFilter;
all: KeyFilter;
}
interface Match {
(regexp: RegExp|string, message?: string): Assertion;
}
interface Keys {
(...keys: string[]): Assertion;
(keys: any[]): Assertion;
(keys: Object): Assertion;
}
interface Throw {
(): Assertion;
(expected: string, message?: string): Assertion;
(expected: RegExp, message?: string): Assertion;
(constructor: Error, expected?: string, message?: string): Assertion;
(constructor: Error, expected?: RegExp, message?: string): Assertion;
(constructor: Function, expected?: string, message?: string): Assertion;
(constructor: Function, expected?: RegExp, message?: string): Assertion;
}
interface RespondTo {
(method: string, message?: string): Assertion;
}
interface Satisfy {
(matcher: Function, message?: string): Assertion;
}
interface Members {
(set: any[], message?: string): Assertion;
}
interface PropertyChange {
(object: Object, prop: string, msg?: string): Assertion;
}
export interface Assert {
/**
* @param expression Expression to test for truthiness.
* @param message Message to display on error.
*/
(expression: any, message?: string): void;
fail(actual?: any, expected?: any, msg?: string, operator?: string): void;
ok(val: any, msg?: string): void;
isOk(val: any, msg?: string): void;
notOk(val: any, msg?: string): void;
isNotOk(val: any, msg?: string): void;
equal(act: any, exp: any, msg?: string): void;
notEqual(act: any, exp: any, msg?: string): void;
strictEqual(act: any, exp: any, msg?: string): void;
notStrictEqual(act: any, exp: any, msg?: string): void;
deepEqual(act: any, exp: any, msg?: string): void;
notDeepEqual(act: any, exp: any, msg?: string): void;
isTrue(val: any, msg?: string): void;
isFalse(val: any, msg?: string): void;
isNull(val: any, msg?: string): void;
isNotNull(val: any, msg?: string): void;
isUndefined(val: any, msg?: string): void;
isDefined(val: any, msg?: string): void;
isNaN(val: any, msg?: string): void;
isNotNaN(val: any, msg?: string): void;
isAbove(val: number, abv: number, msg?: string): void;
isBelow(val: number, blw: number, msg?: string): void;
isFunction(val: any, msg?: string): void;
isNotFunction(val: any, msg?: string): void;
isObject(val: any, msg?: string): void;
isNotObject(val: any, msg?: string): void;
isArray(val: any, msg?: string): void;
isNotArray(val: any, msg?: string): void;
isString(val: any, msg?: string): void;
isNotString(val: any, msg?: string): void;
isNumber(val: any, msg?: string): void;
isNotNumber(val: any, msg?: string): void;
isBoolean(val: any, msg?: string): void;
isNotBoolean(val: any, msg?: string): void;
typeOf(val: any, type: string, msg?: string): void;
notTypeOf(val: any, type: string, msg?: string): void;
instanceOf(val: any, type: Function, msg?: string): void;
notInstanceOf(val: any, type: Function, msg?: string): void;
include(exp: string, inc: any, msg?: string): void;
include(exp: any[], inc: any, msg?: string): void;
notInclude(exp: string, inc: any, msg?: string): void;
notInclude(exp: any[], inc: any, msg?: string): void;
match(exp: any, re: RegExp, msg?: string): void;
notMatch(exp: any, re: RegExp, msg?: string): void;
property(obj: Object, prop: string, msg?: string): void;
notProperty(obj: Object, prop: string, msg?: string): void;
deepProperty(obj: Object, prop: string, msg?: string): void;
notDeepProperty(obj: Object, prop: string, msg?: string): void;
propertyVal(obj: Object, prop: string, val: any, msg?: string): void;
propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void;
deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
lengthOf(exp: any, len: number, msg?: string): void;
//alias frenzy
throw(fn: Function, msg?: string): void;
throw(fn: Function, regExp: RegExp): void;
throw(fn: Function, errType: Function, msg?: string): void;
throw(fn: Function, errType: Function, regExp: RegExp): void;
throws(fn: Function, msg?: string): void;
throws(fn: Function, regExp: RegExp): void;
throws(fn: Function, errType: Function, msg?: string): void;
throws(fn: Function, errType: Function, regExp: RegExp): void;
Throw(fn: Function, msg?: string): void;
Throw(fn: Function, regExp: RegExp): void;
Throw(fn: Function, errType: Function, msg?: string): void;
Throw(fn: Function, errType: Function, regExp: RegExp): void;
doesNotThrow(fn: Function, msg?: string): void;
doesNotThrow(fn: Function, regExp: RegExp): void;
doesNotThrow(fn: Function, errType: Function, msg?: string): void;
doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void;
operator(val: any, operator: string, val2: any, msg?: string): void;
closeTo(act: number, exp: number, delta: number, msg?: string): void;
sameMembers(set1: any[], set2: any[], msg?: string): void;
sameDeepMembers(set1: any[], set2: any[], msg?: string): void;
includeMembers(superset: any[], subset: any[], msg?: string): void;
ifError(val: any, msg?: string): void;
isExtensible(obj: {}, msg?: string): void;
extensible(obj: {}, msg?: string): void;
isNotExtensible(obj: {}, msg?: string): void;
notExtensible(obj: {}, msg?: string): void;
isSealed(obj: {}, msg?: string): void;
sealed(obj: {}, msg?: string): void;
isNotSealed(obj: {}, msg?: string): void;
notSealed(obj: {}, msg?: string): void;
isFrozen(obj: Object, msg?: string): void;
frozen(obj: Object, msg?: string): void;
isNotFrozen(obj: Object, msg?: string): void;
notFrozen(obj: Object, msg?: string): void;
}
export interface Config {
includeStack: boolean;
}
export class AssertionError {
constructor(message: string, _props?: any, ssf?: Function);
name: string;
message: string;
showDiff: boolean;
stack: string;
}
}
declare var chai: Chai.ChaiStatic;
declare module "chai" {
export = chai;
}
interface Object {
should: Chai.Assertion;
}
// Type definitions for chai 3.2.0
// Project: http://chaijs.com/
// Definitions by: Jed Mao <https://github.com/jedmao/>,
// Bart van der Schoor <https://github.com/Bartvds>,
// Andrew Brown <https://github.com/AGBrown>,
// Olivier Chevet <https://github.com/olivr70>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// <reference path="../assertion-error/assertion-error.d.ts"/>
declare module Chai {
interface ChaiStatic {
expect: ExpectStatic;
should(): Should;
/**
* Provides a way to extend the internals of Chai
*/
use(fn: (chai: any, utils: any) => void): any;
assert: AssertStatic;
config: Config;
AssertionError: AssertionError;
}
export interface ExpectStatic extends AssertionStatic {
fail(actual?: any, expected?: any, message?: string, operator?: string): void;
}
export interface AssertStatic extends Assert {
}
export interface AssertionStatic {
(target: any, message?: string): Assertion;
}
interface ShouldAssertion {
equal(value1: any, value2: any, message?: string): void;
Throw: ShouldThrow;
throw: ShouldThrow;
exist(value: any, message?: string): void;
}
interface Should extends ShouldAssertion {
not: ShouldAssertion;
fail(actual: any, expected: any, message?: string, operator?: string): void;
}
interface ShouldThrow {
(actual: Function): void;
(actual: Function, expected: string|RegExp, message?: string): void;
(actual: Function, constructor: Error|Function, expected?: string|RegExp, message?: string): void;
}
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
not: Assertion;
deep: Deep;
any: KeyFilter;
all: KeyFilter;
a: TypeComparison;
an: TypeComparison;
include: Include;
includes: Include;
contain: Include;
contains: Include;
ok: Assertion;
true: Assertion;
false: Assertion;
null: Assertion;
undefined: Assertion;
NaN: Assertion;
exist: Assertion;
empty: Assertion;
arguments: Assertion;
Arguments: Assertion;
equal: Equal;
equals: Equal;
eq: Equal;
eql: Equal;
eqls: Equal;
property: Property;
ownProperty: OwnProperty;
haveOwnProperty: OwnProperty;
ownPropertyDescriptor: OwnPropertyDescriptor;
haveOwnPropertyDescriptor: OwnPropertyDescriptor;
length: Length;
lengthOf: Length;
match: Match;
matches: Match;
string(string: string, message?: string): Assertion;
keys: Keys;
key(string: string): Assertion;
throw: Throw;
throws: Throw;
Throw: Throw;
respondTo: RespondTo;
respondsTo: RespondTo;
itself: Assertion;
satisfy: Satisfy;
satisfies: Satisfy;
closeTo(expected: number, delta: number, message?: string): Assertion;
members: Members;
increase: PropertyChange;
increases: PropertyChange;
decrease: PropertyChange;
decreases: PropertyChange;
change: PropertyChange;
changes: PropertyChange;
extensible: Assertion;
sealed: Assertion;
frozen: Assertion;
}
interface LanguageChains {
to: Assertion;
be: Assertion;
been: Assertion;
is: Assertion;
that: Assertion;
which: Assertion;
and: Assertion;
has: Assertion;
have: Assertion;
with: Assertion;
at: Assertion;
of: Assertion;
same: Assertion;
}
interface NumericComparison {
above: NumberComparer;
gt: NumberComparer;
greaterThan: NumberComparer;
least: NumberComparer;
gte: NumberComparer;
below: NumberComparer;
lt: NumberComparer;
lessThan: NumberComparer;
most: NumberComparer;
lte: NumberComparer;
within(start: number, finish: number, message?: string): Assertion;
}
interface NumberComparer {
(value: number, message?: string): Assertion;
}
interface TypeComparison {
(type: string, message?: string): Assertion;
instanceof: InstanceOf;
instanceOf: InstanceOf;
}
interface InstanceOf {
(constructor: Object, message?: string): Assertion;
}
interface Deep {
equal: Equal;
include: Include;
property: Property;
members: Members;
}
interface KeyFilter {
keys: Keys;
}
interface Equal {
(value: any, message?: string): Assertion;
}
interface Property {
(name: string, value?: any, message?: string): Assertion;
}
interface OwnProperty {
(name: string, message?: string): Assertion;
}
interface OwnPropertyDescriptor {
(name: string, descriptor: PropertyDescriptor, message?: string): Assertion;
(name: string, message?: string): Assertion;
}
interface Length extends LanguageChains, NumericComparison {
(length: number, message?: string): Assertion;
}
interface Include {
(value: Object, message?: string): Assertion;
(value: string, message?: string): Assertion;
(value: number, message?: string): Assertion;
keys: Keys;
members: Members;
any: KeyFilter;
all: KeyFilter;
}
interface Match {
(regexp: RegExp|string, message?: string): Assertion;
}
interface Keys {
(...keys: string[]): Assertion;
(keys: any[]): Assertion;
(keys: Object): Assertion;
}
interface Throw {
(): Assertion;
(expected: string, message?: string): Assertion;
(expected: RegExp, message?: string): Assertion;
(constructor: Error, expected?: string, message?: string): Assertion;
(constructor: Error, expected?: RegExp, message?: string): Assertion;
(constructor: Function, expected?: string, message?: string): Assertion;
(constructor: Function, expected?: RegExp, message?: string): Assertion;
}
interface RespondTo {
(method: string, message?: string): Assertion;
}
interface Satisfy {
(matcher: Function, message?: string): Assertion;
}
interface Members {
(set: any[], message?: string): Assertion;
}
interface PropertyChange {
(object: Object, prop: string, msg?: string): Assertion;
}
export interface Assert {
/**
* @param expression Expression to test for truthiness.
* @param message Message to display on error.
*/
(expression: any, message?: string): void;
fail(actual?: any, expected?: any, msg?: string, operator?: string): void;
ok(val: any, msg?: string): void;
isOk(val: any, msg?: string): void;
notOk(val: any, msg?: string): void;
isNotOk(val: any, msg?: string): void;
equal(act: any, exp: any, msg?: string): void;
notEqual(act: any, exp: any, msg?: string): void;
strictEqual(act: any, exp: any, msg?: string): void;
notStrictEqual(act: any, exp: any, msg?: string): void;
deepEqual(act: any, exp: any, msg?: string): void;
notDeepEqual(act: any, exp: any, msg?: string): void;
isTrue(val: any, msg?: string): void;
isFalse(val: any, msg?: string): void;
isNull(val: any, msg?: string): void;
isNotNull(val: any, msg?: string): void;
isUndefined(val: any, msg?: string): void;
isDefined(val: any, msg?: string): void;
isNaN(val: any, msg?: string): void;
isNotNaN(val: any, msg?: string): void;
isAbove(val: number, abv: number, msg?: string): void;
isBelow(val: number, blw: number, msg?: string): void;
isFunction(val: any, msg?: string): void;
isNotFunction(val: any, msg?: string): void;
isObject(val: any, msg?: string): void;
isNotObject(val: any, msg?: string): void;
isArray(val: any, msg?: string): void;
isNotArray(val: any, msg?: string): void;
isString(val: any, msg?: string): void;
isNotString(val: any, msg?: string): void;
isNumber(val: any, msg?: string): void;
isNotNumber(val: any, msg?: string): void;
isBoolean(val: any, msg?: string): void;
isNotBoolean(val: any, msg?: string): void;
typeOf(val: any, type: string, msg?: string): void;
notTypeOf(val: any, type: string, msg?: string): void;
instanceOf(val: any, type: Function, msg?: string): void;
notInstanceOf(val: any, type: Function, msg?: string): void;
include(exp: string, inc: any, msg?: string): void;
include(exp: any[], inc: any, msg?: string): void;
notInclude(exp: string, inc: any, msg?: string): void;
notInclude(exp: any[], inc: any, msg?: string): void;
match(exp: any, re: RegExp, msg?: string): void;
notMatch(exp: any, re: RegExp, msg?: string): void;
property(obj: Object, prop: string, msg?: string): void;
notProperty(obj: Object, prop: string, msg?: string): void;
deepProperty(obj: Object, prop: string, msg?: string): void;
notDeepProperty(obj: Object, prop: string, msg?: string): void;
propertyVal(obj: Object, prop: string, val: any, msg?: string): void;
propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void;
deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
lengthOf(exp: any, len: number, msg?: string): void;
//alias frenzy
throw(fn: Function, msg?: string): void;
throw(fn: Function, regExp: RegExp): void;
throw(fn: Function, errType: Function, msg?: string): void;
throw(fn: Function, errType: Function, regExp: RegExp): void;
throws(fn: Function, msg?: string): void;
throws(fn: Function, regExp: RegExp): void;
throws(fn: Function, errType: Function, msg?: string): void;
throws(fn: Function, errType: Function, regExp: RegExp): void;
Throw(fn: Function, msg?: string): void;
Throw(fn: Function, regExp: RegExp): void;
Throw(fn: Function, errType: Function, msg?: string): void;
Throw(fn: Function, errType: Function, regExp: RegExp): void;
doesNotThrow(fn: Function, msg?: string): void;
doesNotThrow(fn: Function, regExp: RegExp): void;
doesNotThrow(fn: Function, errType: Function, msg?: string): void;
doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void;
operator(val: any, operator: string, val2: any, msg?: string): void;
closeTo(act: number, exp: number, delta: number, msg?: string): void;
sameMembers(set1: any[], set2: any[], msg?: string): void;
sameDeepMembers(set1: any[], set2: any[], msg?: string): void;
includeMembers(superset: any[], subset: any[], msg?: string): void;
ifError(val: any, msg?: string): void;
isExtensible(obj: {}, msg?: string): void;
extensible(obj: {}, msg?: string): void;
isNotExtensible(obj: {}, msg?: string): void;
notExtensible(obj: {}, msg?: string): void;
isSealed(obj: {}, msg?: string): void;
sealed(obj: {}, msg?: string): void;
isNotSealed(obj: {}, msg?: string): void;
notSealed(obj: {}, msg?: string): void;
isFrozen(obj: Object, msg?: string): void;
frozen(obj: Object, msg?: string): void;
isNotFrozen(obj: Object, msg?: string): void;
notFrozen(obj: Object, msg?: string): void;
}
export interface Config {
includeStack: boolean;
}
export class AssertionError {
constructor(message: string, _props?: any, ssf?: Function);
name: string;
message: string;
showDiff: boolean;
stack: string;
}
}
declare var chai: Chai.ChaiStatic;
declare module "chai" {
export = chai;
}
interface Object {
should: Chai.Assertion;
}
+6113 -405
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -48,9 +48,9 @@ interface Globalization {
date: Date,
onSuccess: (date: { value: string; }) => void,
onError: (error: GlobalizationError) => void,
options?: {
options?: {
formatLength?: string; // "short" | "medium" | "long" | "full"
selector?: string; // "date" | "time" | "date and time"
selector?: string; // "date" | "time" | "date and time"
}): void;
/**
* Parses a date formatted as a string, according to the client's user preferences
+1 -1
View File
@@ -35,7 +35,7 @@ interface RequestsDialogParams {
message: string;
action_type?: string; // "send" | "askfor" | "turn"
object_id?: string;
filters: string /* "app_users" | "app_non_users" */ | {
filters: string /* "app_users" | "app_non_users" */ | {
name: string;
user_ids: string[];
};
+20 -20
View File
@@ -1,20 +1,20 @@
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="gridstack.d.ts" />
// Type definitions for Gridstack
// Project: http://troolee.github.io/gridstack.js/
// Definitions by: Pascal Senn <https://github.com/PascalSenn/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
var options = <IGridstackOptions> {
float: true
};
var gridstack:GridStack = $(document).gridstack(options);
gridstack.add_widget("test", 1, 2, 3, 4, true);
gridstack.batch_update();
gridstack.cell_height();;
gridstack.cell_height(2);
gridstack.cell_width();
gridstack.get_cell_from_pixel(<MousePosition>{ left:20, top: 20 });
/// <reference path="../jquery/jquery.d.ts"/>
/// <reference path="gridstack.d.ts" />
// Type definitions for Gridstack
// Project: http://troolee.github.io/gridstack.js/
// Definitions by: Pascal Senn <https://github.com/PascalSenn/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
var options = <IGridstackOptions> {
float: true
};
var gridstack:GridStack = $(document).gridstack(options);
gridstack.add_widget("test", 1, 2, 3, 4, true);
gridstack.batch_update();
gridstack.cell_height();;
gridstack.cell_height(2);
gridstack.cell_width();
gridstack.get_cell_from_pixel(<MousePosition>{ left:20, top: 20 });
+241 -241
View File
@@ -1,241 +1,241 @@
// Type definitions for Gridstack
// Project: http://troolee.github.io/gridstack.js/
// Definitions by: Pascal Senn <https://github.com/PascalSenn/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface JQuery {
gridstack (options: IGridstackOptions):GridStack
}
interface GridStack {
/**
* Creates new widget and returns it.
*
* Widget will be always placed even if result height is more than actual grid height. You need to use will_it_fit method before calling add_widget for additional check.
*
* @param {string} el widget to add
* @param {number} x widget position x
* @param {number} y widget position y
* @param {number} width widget dimension width
* @param {number} height widget dimension height
* @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position
*/
add_widget(el: string, x: number, y: number, width: number, height: number, auto_position: boolean): JQuery
/**
* Initializes batch updates. You will see no changes until commit method is called.
*/
batch_update():void
/**
* Gets current cell height.
*/
cell_height():number
/**
* Update current cell height. This method rebuilds an internal CSS style sheet. Note: You can expect performance issues if call this method too often.
* @param {number} val the cell height
*/
cell_height(val:number):void
/**
* Gets current cell width.
*/
cell_width():number
/**
* Finishes batch updates. Updates DOM nodes. You must call it after batch_update.
*/
commit():void
/**
* Destroys a grid instance.
*/
destroy(): void
/*
* Disables widgets moving/resizing.
*/
disable(): void
/*
* Enables widgets moving/resizing.
*/
enable(): void
/*
* Get the position of the cell under a pixel on screen.
* @param {MousePosition} position the position of the pixel to resolve in absolute coordinates, as an object with top and leftproperties
*/
get_cell_from_pixel(position: MousePosition): CellPosition,
/*
* Checks if specified area is empty.
* @param {number} x the position x.
* @param {number} y the position y.
* @param {number} width the width of to check
* @param {number} height the height of to check
*/
is_area_empty(x: number, y: number, width: number, height: number): void
/*
* Locks/unlocks widget.
* @param {HTMLElement} el widget to modify.
* @param {boolean} val if true widget will be locked.
*/
locked(el: HTMLElement, val: boolean): void
/*
* Set the minWidth for a widget.
* @param {HTMLElement} el widget to modify.
* @param {number} val A numeric value of the number of columns
*/
min_width(el: HTMLElement, val: number): void
/*
* Set the minHeight for a widget.
* @param {HTMLElement} el widget to modify.
* @param {number} val A numeric value of the number of rows
*/
min_height(el: HTMLElement, val: number): void
/*
* Enables/Disables moving.
* @param {HTMLElement} el widget to modify.
* @param {number} val if true widget will be draggable.
*/
movable(el: HTMLElement, val: boolean): void
/**
* Changes widget position
* @param {HTMLElement} el widget to modify
* @param {number} x new position x. If value is null or undefined it will be ignored.
* @param {number} y new position y. If value is null or undefined it will be ignored.
*
*/
move(el: HTMLElement, x: number, y: number): void
/**
* Removes widget from the grid.
* @param {HTMLElement} el widget to modify
* @param {boolean} detach_node if false DOM node won't be removed from the tree (Optional. Default true).
*/
remove_widget(el: HTMLElement, detach_node?: boolean): void
/**
* Removes all widgets from the grid.
*/
remove_all(): void
/**
* Changes widget size
* @param {HTMLElement} el widget to modify
* @param {number} width new dimensions width. If value is null or undefined it will be ignored.
* @param {number} height new dimensions height. If value is null or undefined it will be ignored.
*/
resize(el: HTMLElement, width: number, height: number): void
/**
* Enables/Disables resizing.
* @param {HTMLElement} el widget to modify
* @param {boolean} val if true widget will be resizable.
*/
resizable(el: HTMLElement, val: boolean): void
/**
* Toggle the grid static state. Also toggle the grid-stack-static class.
* @param {boolean} static_value if true the grid become static.
*/
set_static(static_value: boolean): void
/**
* Updates widget position/size.
* @param {HTMLElement} el widget to modify
* @param {number} x new position x. If value is null or undefined it will be ignored.
* @param {number} y new position y. If value is null or undefined it will be ignored.
* @param {number} width new dimensions width. If value is null or undefined it will be ignored.
* @param {number} height new dimensions height. If value is null or undefined it will be ignored.
*/
update(el: HTMLElement, x: number, y: number, width: number, height: number): void
/**
* Returns true if the height of the grid will be less the vertical constraint. Always returns true if grid doesn't have height constraint.
* @param {number} x new position x. If value is null or undefined it will be ignored.
* @param {number} y new position y. If value is null or undefined it will be ignored.
* @param {number} width new dimensions width. If value is null or undefined it will be ignored.
* @param {number} height new dimensions height. If value is null or undefined it will be ignored.
* @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position
*/
will_it_fit(x: number, y: number, width: number, height: number, auto_position:boolean):boolean
}
/**
* Defines the coordiantes of a object
*/
interface MousePosition {
top: number,
left:number,
}
/**
* Defines the position of a cell inside the grid
*/
interface CellPosition {
x: number,
y:number
}
declare module GridStackUI {
interface Utils {
/**
* Sorts array of nodes
*@param nodes array to sort
*@param dir 1 for asc, -1 for desc (optional)
*@param width width of the grid. If undefined the width will be calculated automatically (optional).
**/
sort(nodes: HTMLElement[], dir: number, width: number): void
}
}
/**
* Gridstack Options
* Defines the options for a Gridstack
*/
interface IGridstackOptions {
/**
* if true the resizing handles are shown even if the user is not hovering over the widget (default: false)
*/
always_show_resize_handle: boolean;
/**
* turns animation on (default: true)
*/
animate: boolean;
/**
* if false gridstack will not initialize existing items (default: true)
*/
auto: boolean;
/**
* one cell height (default: 60)
*/
cell_height: number;
/**
* allows to override jQuery UI draggable options. (default: { handle: '.grid-stack-item-content', scroll: true, appendTo: 'body' })
*/
draggable: {};
/**
* draggable handle selector (default: '.grid-stack-item-content')
*/
handle: string;
/**
* maximum rows amount.Default is 0 which means no maximum rows
*/
height: number;
/**
* enable floating widgets (default: false) See example
*/
float: boolean;
/**
* widget class (default: 'grid-stack-item')
*/
item_class: string;
/**
* minimal width.If window width is less, grid will be shown in one - column mode (default: 768)
*/
min_width: number;
/**
* class for placeholder (default: 'grid-stack-placeholder')
*/
placeholder_class: string;
/**
* allows to override jQuery UI resizable options. (default: { autoHide: true, handles: 'se' })
*/
resizable: {};
/**
* makes grid static (default false).If true widgets are not movable/ resizable.You don't even need jQueryUI draggable/resizable. A CSS class grid-stack-static is also added to the container.
*/
static_grid: boolean;
/**
* vertical gap size (default: 20)
*/
vertical_margin: number;
/**
* amount of columns (default: 12)
*/
width: number;
}
// Type definitions for Gridstack
// Project: http://troolee.github.io/gridstack.js/
// Definitions by: Pascal Senn <https://github.com/PascalSenn/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface JQuery {
gridstack (options: IGridstackOptions):GridStack
}
interface GridStack {
/**
* Creates new widget and returns it.
*
* Widget will be always placed even if result height is more than actual grid height. You need to use will_it_fit method before calling add_widget for additional check.
*
* @param {string} el widget to add
* @param {number} x widget position x
* @param {number} y widget position y
* @param {number} width widget dimension width
* @param {number} height widget dimension height
* @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position
*/
add_widget(el: string, x: number, y: number, width: number, height: number, auto_position: boolean): JQuery
/**
* Initializes batch updates. You will see no changes until commit method is called.
*/
batch_update():void
/**
* Gets current cell height.
*/
cell_height():number
/**
* Update current cell height. This method rebuilds an internal CSS style sheet. Note: You can expect performance issues if call this method too often.
* @param {number} val the cell height
*/
cell_height(val:number):void
/**
* Gets current cell width.
*/
cell_width():number
/**
* Finishes batch updates. Updates DOM nodes. You must call it after batch_update.
*/
commit():void
/**
* Destroys a grid instance.
*/
destroy(): void
/*
* Disables widgets moving/resizing.
*/
disable(): void
/*
* Enables widgets moving/resizing.
*/
enable(): void
/*
* Get the position of the cell under a pixel on screen.
* @param {MousePosition} position the position of the pixel to resolve in absolute coordinates, as an object with top and leftproperties
*/
get_cell_from_pixel(position: MousePosition): CellPosition,
/*
* Checks if specified area is empty.
* @param {number} x the position x.
* @param {number} y the position y.
* @param {number} width the width of to check
* @param {number} height the height of to check
*/
is_area_empty(x: number, y: number, width: number, height: number): void
/*
* Locks/unlocks widget.
* @param {HTMLElement} el widget to modify.
* @param {boolean} val if true widget will be locked.
*/
locked(el: HTMLElement, val: boolean): void
/*
* Set the minWidth for a widget.
* @param {HTMLElement} el widget to modify.
* @param {number} val A numeric value of the number of columns
*/
min_width(el: HTMLElement, val: number): void
/*
* Set the minHeight for a widget.
* @param {HTMLElement} el widget to modify.
* @param {number} val A numeric value of the number of rows
*/
min_height(el: HTMLElement, val: number): void
/*
* Enables/Disables moving.
* @param {HTMLElement} el widget to modify.
* @param {number} val if true widget will be draggable.
*/
movable(el: HTMLElement, val: boolean): void
/**
* Changes widget position
* @param {HTMLElement} el widget to modify
* @param {number} x new position x. If value is null or undefined it will be ignored.
* @param {number} y new position y. If value is null or undefined it will be ignored.
*
*/
move(el: HTMLElement, x: number, y: number): void
/**
* Removes widget from the grid.
* @param {HTMLElement} el widget to modify
* @param {boolean} detach_node if false DOM node won't be removed from the tree (Optional. Default true).
*/
remove_widget(el: HTMLElement, detach_node?: boolean): void
/**
* Removes all widgets from the grid.
*/
remove_all(): void
/**
* Changes widget size
* @param {HTMLElement} el widget to modify
* @param {number} width new dimensions width. If value is null or undefined it will be ignored.
* @param {number} height new dimensions height. If value is null or undefined it will be ignored.
*/
resize(el: HTMLElement, width: number, height: number): void
/**
* Enables/Disables resizing.
* @param {HTMLElement} el widget to modify
* @param {boolean} val if true widget will be resizable.
*/
resizable(el: HTMLElement, val: boolean): void
/**
* Toggle the grid static state. Also toggle the grid-stack-static class.
* @param {boolean} static_value if true the grid become static.
*/
set_static(static_value: boolean): void
/**
* Updates widget position/size.
* @param {HTMLElement} el widget to modify
* @param {number} x new position x. If value is null or undefined it will be ignored.
* @param {number} y new position y. If value is null or undefined it will be ignored.
* @param {number} width new dimensions width. If value is null or undefined it will be ignored.
* @param {number} height new dimensions height. If value is null or undefined it will be ignored.
*/
update(el: HTMLElement, x: number, y: number, width: number, height: number): void
/**
* Returns true if the height of the grid will be less the vertical constraint. Always returns true if grid doesn't have height constraint.
* @param {number} x new position x. If value is null or undefined it will be ignored.
* @param {number} y new position y. If value is null or undefined it will be ignored.
* @param {number} width new dimensions width. If value is null or undefined it will be ignored.
* @param {number} height new dimensions height. If value is null or undefined it will be ignored.
* @param {boolean} auto_position if true then x, y parameters will be ignored and widget will be places on the first available position
*/
will_it_fit(x: number, y: number, width: number, height: number, auto_position:boolean):boolean
}
/**
* Defines the coordiantes of a object
*/
interface MousePosition {
top: number,
left:number,
}
/**
* Defines the position of a cell inside the grid
*/
interface CellPosition {
x: number,
y:number
}
declare module GridStackUI {
interface Utils {
/**
* Sorts array of nodes
*@param nodes array to sort
*@param dir 1 for asc, -1 for desc (optional)
*@param width width of the grid. If undefined the width will be calculated automatically (optional).
**/
sort(nodes: HTMLElement[], dir: number, width: number): void
}
}
/**
* Gridstack Options
* Defines the options for a Gridstack
*/
interface IGridstackOptions {
/**
* if true the resizing handles are shown even if the user is not hovering over the widget (default: false)
*/
always_show_resize_handle: boolean;
/**
* turns animation on (default: true)
*/
animate: boolean;
/**
* if false gridstack will not initialize existing items (default: true)
*/
auto: boolean;
/**
* one cell height (default: 60)
*/
cell_height: number;
/**
* allows to override jQuery UI draggable options. (default: { handle: '.grid-stack-item-content', scroll: true, appendTo: 'body' })
*/
draggable: {};
/**
* draggable handle selector (default: '.grid-stack-item-content')
*/
handle: string;
/**
* maximum rows amount.Default is 0 which means no maximum rows
*/
height: number;
/**
* enable floating widgets (default: false) See example
*/
float: boolean;
/**
* widget class (default: 'grid-stack-item')
*/
item_class: string;
/**
* minimal width.If window width is less, grid will be shown in one - column mode (default: 768)
*/
min_width: number;
/**
* class for placeholder (default: 'grid-stack-placeholder')
*/
placeholder_class: string;
/**
* allows to override jQuery UI resizable options. (default: { autoHide: true, handles: 'se' })
*/
resizable: {};
/**
* makes grid static (default false).If true widgets are not movable/ resizable.You don't even need jQueryUI draggable/resizable. A CSS class grid-stack-static is also added to the container.
*/
static_grid: boolean;
/**
* vertical gap size (default: 20)
*/
vertical_margin: number;
/**
* amount of columns (default: 12)
*/
width: number;
}
+1 -1
View File
@@ -1 +1 @@
--noImplicitAny --module commonjs --target es5 --experimentalDecorators
--noImplicitAny --module commonjs --target es5 --experimentalDecorators
+29 -29
View File
@@ -20,35 +20,35 @@ declare module "nodemailer-smtp-transport" {
export interface SmtpOptions {
/**
* Fills in certain SMTP configurations options (e.g. 'host', 'port', and 'secure') for
* well-known services. Possible values:
* - '1und1'
* - 'AOL'
* - 'DebugMail.io'
* - 'DynectEmail'
* - 'FastMail'
* - 'GandiMail'
* - 'Gmail'
* - 'Godaddy'
* - 'GodaddyAsia'
* - 'GodaddyEurope'
* - 'hot.ee'
* - 'Hotmail'
* - 'iCloud'
* - 'mail.ee'
* - 'Mail.ru'
* - 'Mailgun'
* - 'Mailjet'
* - 'Mandrill'
* - 'Naver'
* - 'Postmark'
* - 'QQ'
* - 'QQex'
* - 'SendCloud'
* - 'SendGrid'
* - 'SES'
* - 'Sparkpost'
* - 'Yahoo'
* - 'Yandex'
* well-known services. Possible values:
* - '1und1'
* - 'AOL'
* - 'DebugMail.io'
* - 'DynectEmail'
* - 'FastMail'
* - 'GandiMail'
* - 'Gmail'
* - 'Godaddy'
* - 'GodaddyAsia'
* - 'GodaddyEurope'
* - 'hot.ee'
* - 'Hotmail'
* - 'iCloud'
* - 'mail.ee'
* - 'Mail.ru'
* - 'Mailgun'
* - 'Mailjet'
* - 'Mandrill'
* - 'Naver'
* - 'Postmark'
* - 'QQ'
* - 'QQex'
* - 'SendCloud'
* - 'SendGrid'
* - 'SES'
* - 'Sparkpost'
* - 'Yahoo'
* - 'Yandex'
* - 'Zoho'
*/
service?: string;
+176 -176
View File
@@ -1,176 +1,176 @@
// Type definitions for nouislider v8.0.2
// Project: https://github.com/leongersen/noUiSlider
// Definitions by: Patrick Davies <https://github.com/bleuarg>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../wnumb/wnumb.d.ts"/>
declare module noUiSlider {
/**
* To create a slider, call noUiSlider.create() with an element and your options.
*/
function create(target: HTMLElement, options: Options): void;
interface Options {
/**
* The start option sets the number of handles and their start positions, relative to range.
*/
start: number | number[] | number[][];
/**
* The connect setting can be used to control the bar between the handles,
* or the edges of the slider. Use "lower" to connect to the lower side,
* or "upper" to connect to the upper side. Setting true sets the bar between the handles.
*/
range: Object;
/**
* noUiSlider offers several ways to handle user interaction.
* The range can be set to drag, and handles can move to taps.
* All these effects are optional, and can be enable by adding their keyword to the behaviour option.
* This option accepts a "-" separated list of "drag", "tap", "fixed", "snap" or "none".
*/
connect?: string | boolean;
/**
* When using two handles, the minimum distance between the handles can be set using the margin option.
* The margin value is relative to the value set in 'range'.
* This option is only available on standard linear sliders.
*/
margin?: number;
/**
* The limit option is the oposite of the margin option,
* limiting the maximum distance between two handles.
* As with the margin option, the limit option can only be used on linear sliders.
*/
limit?: number;
/**
* By default, the slider slides fluently.
* In order to make the handles jump between intervals, you can use this option.
* The step option is relative to the values provided to range.
*/
step?: number;
/**
* The orientation setting can be used to set the slider to "vertical" or "horizontal".
* Set dimensions! Vertical sliders don't assume a default height, so you'll need to set one.
* You can use any unit you want, including % or px.
*/
orientation?: string;
/**
* By default the sliders are top-to-bottom and left-to-right,
* but you can change this using the direction option,
* which decides where the upper side of the slider is.
*/
direction?: string;
/**
* Set the animate option to false to prevent the slider from animating to a new value with when calling .val().
*/
animate?: boolean;
/**
* All values on the slider are part of a range. The range has a minimum and maximum value.
*/
behaviour?: string;
/**
* To format the slider output, noUiSlider offers a format option.
* Simply specify to and from functions to encode and decode the values.
* See manual formatting to the right for usage information.
* By default, noUiSlider will format output with 2 decimals.
*/
format?: Object | ((...args:any[]) => any);
/**
* Allows you to generate points along the slider.
*/
pips?: PipsOptions;
}
interface PipsOptions {
/**
* The 'range' mode uses the slider range to determine where the pips should be. A pip is generated for every percentage specified.
*
* The 'steps', like 'range', uses the slider range. In steps mode, a pip is generated for every step.
* The 'filter' option can be used to filter the generated pips from the 'steps' options'
* The filter function must return 0 (no value), 1 (large value) or 2 (small value).
*
* In 'positions' mode, pips are generated at percentage-based positions on the slider.
* Optionally, the stepped option can be set to true to match the pips to the slider steps.
*
* The 'count' mode can be used to generate a fixed number of pips. As with positions mode, the stepped option can be used.
*
* The 'values' mode is similar to positions, but it accepts values instead of percentages. The stepped option can be used for this mode.
*
*/
mode: string; // "range" | "steps" | "positions" | "count" | "values"
/**
* Range Mode: percentage for range mode
* Step Mode: step number for steps
* Positions Mode: percentage-based positions on the slider
* Count Mode: positions between pips
*/
density?: number;
/**
* Step Mode: The filter option can be used to filter the generated pips.
* The filter function must return 0 (no value), 1 (large value) or 2 (small value).
*/
filter?: (...args: any[]) => PipFilterResult;
/**
* format for step mode
* see noUiSlider format
*/
format?: Object;
/**
*
* values for positions and values mode
* number pips for count mode
*/
values?: number | number[];
/**
* stepped option for positions, values and count mode
*/
stepped?: boolean;
}
const enum PipFilterResult {
NoValue,
LargeValue,
SmallValue,
}
interface Callback {
/**
* Array for both one-handle and two-handle sliders. It contains the current slider values,
* with formatting applied.
*/
(values: any[], handle: number, unencoded: number): void
}
interface noUiSlider {
/**
* Bind event to the slider.
*/
on(eventName: string, callback: Callback): void;
/**
* Unbind event to the slider.
*/
off(eventName: string): void;
/**
* Destroy's the slider.
*/
destroy(): void;
/**
* To get the current slider value. For one-handle sliders, calling .get() will return the value.
* For two-handle sliders, an array[value, value] will be returned.
*/
get(): number | number[];
/**
* noUiSlider will keep your values within the slider range, which saves you a bunch of validation.
* If you have configured the slider to use one handle, you can change the current value by passing
* a number to the .set() method. If you have two handles, pass an array. One-handled sliders
* will also accept arrays. Within an array, you can set one position to null
* if you want to leave a handle unchanged.
*/
set(value: number | number[]): void;
}
interface Instance extends HTMLElement {
noUiSlider: noUiSlider
}
}
// Type definitions for nouislider v8.0.2
// Project: https://github.com/leongersen/noUiSlider
// Definitions by: Patrick Davies <https://github.com/bleuarg>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../wnumb/wnumb.d.ts"/>
declare module noUiSlider {
/**
* To create a slider, call noUiSlider.create() with an element and your options.
*/
function create(target: HTMLElement, options: Options): void;
interface Options {
/**
* The start option sets the number of handles and their start positions, relative to range.
*/
start: number | number[] | number[][];
/**
* The connect setting can be used to control the bar between the handles,
* or the edges of the slider. Use "lower" to connect to the lower side,
* or "upper" to connect to the upper side. Setting true sets the bar between the handles.
*/
range: Object;
/**
* noUiSlider offers several ways to handle user interaction.
* The range can be set to drag, and handles can move to taps.
* All these effects are optional, and can be enable by adding their keyword to the behaviour option.
* This option accepts a "-" separated list of "drag", "tap", "fixed", "snap" or "none".
*/
connect?: string | boolean;
/**
* When using two handles, the minimum distance between the handles can be set using the margin option.
* The margin value is relative to the value set in 'range'.
* This option is only available on standard linear sliders.
*/
margin?: number;
/**
* The limit option is the oposite of the margin option,
* limiting the maximum distance between two handles.
* As with the margin option, the limit option can only be used on linear sliders.
*/
limit?: number;
/**
* By default, the slider slides fluently.
* In order to make the handles jump between intervals, you can use this option.
* The step option is relative to the values provided to range.
*/
step?: number;
/**
* The orientation setting can be used to set the slider to "vertical" or "horizontal".
* Set dimensions! Vertical sliders don't assume a default height, so you'll need to set one.
* You can use any unit you want, including % or px.
*/
orientation?: string;
/**
* By default the sliders are top-to-bottom and left-to-right,
* but you can change this using the direction option,
* which decides where the upper side of the slider is.
*/
direction?: string;
/**
* Set the animate option to false to prevent the slider from animating to a new value with when calling .val().
*/
animate?: boolean;
/**
* All values on the slider are part of a range. The range has a minimum and maximum value.
*/
behaviour?: string;
/**
* To format the slider output, noUiSlider offers a format option.
* Simply specify to and from functions to encode and decode the values.
* See manual formatting to the right for usage information.
* By default, noUiSlider will format output with 2 decimals.
*/
format?: Object | ((...args:any[]) => any);
/**
* Allows you to generate points along the slider.
*/
pips?: PipsOptions;
}
interface PipsOptions {
/**
* The 'range' mode uses the slider range to determine where the pips should be. A pip is generated for every percentage specified.
*
* The 'steps', like 'range', uses the slider range. In steps mode, a pip is generated for every step.
* The 'filter' option can be used to filter the generated pips from the 'steps' options'
* The filter function must return 0 (no value), 1 (large value) or 2 (small value).
*
* In 'positions' mode, pips are generated at percentage-based positions on the slider.
* Optionally, the stepped option can be set to true to match the pips to the slider steps.
*
* The 'count' mode can be used to generate a fixed number of pips. As with positions mode, the stepped option can be used.
*
* The 'values' mode is similar to positions, but it accepts values instead of percentages. The stepped option can be used for this mode.
*
*/
mode: string; // "range" | "steps" | "positions" | "count" | "values"
/**
* Range Mode: percentage for range mode
* Step Mode: step number for steps
* Positions Mode: percentage-based positions on the slider
* Count Mode: positions between pips
*/
density?: number;
/**
* Step Mode: The filter option can be used to filter the generated pips.
* The filter function must return 0 (no value), 1 (large value) or 2 (small value).
*/
filter?: (...args: any[]) => PipFilterResult;
/**
* format for step mode
* see noUiSlider format
*/
format?: Object;
/**
*
* values for positions and values mode
* number pips for count mode
*/
values?: number | number[];
/**
* stepped option for positions, values and count mode
*/
stepped?: boolean;
}
const enum PipFilterResult {
NoValue,
LargeValue,
SmallValue,
}
interface Callback {
/**
* Array for both one-handle and two-handle sliders. It contains the current slider values,
* with formatting applied.
*/
(values: any[], handle: number, unencoded: number): void
}
interface noUiSlider {
/**
* Bind event to the slider.
*/
on(eventName: string, callback: Callback): void;
/**
* Unbind event to the slider.
*/
off(eventName: string): void;
/**
* Destroy's the slider.
*/
destroy(): void;
/**
* To get the current slider value. For one-handle sliders, calling .get() will return the value.
* For two-handle sliders, an array[value, value] will be returned.
*/
get(): number | number[];
/**
* noUiSlider will keep your values within the slider range, which saves you a bunch of validation.
* If you have configured the slider to use one handle, you can change the current value by passing
* a number to the .set() method. If you have two handles, pass an array. One-handled sliders
* will also accept arrays. Within an array, you can set one position to null
* if you want to leave a handle unchanged.
*/
set(value: number | number[]): void;
}
interface Instance extends HTMLElement {
noUiSlider: noUiSlider
}
}
+17 -17
View File
@@ -1,18 +1,18 @@
/// <reference path="satnav.d.ts" />
Satnav({})
.navigate({
path: 'product/{required}/?{optional}',
directions: (params) => {
// Logic for product route
console.log(params.required);
console.log(params.hasOwnProperty('optional'));
}
})
.otherwise('/product/1')
.change(function (hash, params, old) {
// Logic for any change
console.log(hash);
console.log(params);
console.log(old);
})
/// <reference path="satnav.d.ts" />
Satnav({})
.navigate({
path: 'product/{required}/?{optional}',
directions: (params) => {
// Logic for product route
console.log(params.required);
console.log(params.hasOwnProperty('optional'));
}
})
.otherwise('/product/1')
.change(function (hash, params, old) {
// Logic for any change
console.log(hash);
console.log(params);
console.log(old);
})
.go(); //Resolve current route
+27 -27
View File
@@ -1,28 +1,28 @@
// Type definitions for satnav
// Project: https://github.com/f5io/satnav-js
// Definitions by: Christian Holm Diget <https://github.com/DotNetNerd>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare type Callback = () => void;
interface ISatnavOptions {
html5?: boolean,
force?: boolean,
poll?: number,
matchAll?: boolean
}
interface INavigationOptions {
path?: string,
directions?: (params : any) => any,
title?: string | Callback
}
interface ISatnav {
navigate(navigationOptions: INavigationOptions): ISatnav;
otherwise(route: string): ISatnav;
change(onChange: (hash: string, params: any, old: any) => any): ISatnav;
go(): ISatnav;
}
// Type definitions for satnav
// Project: https://github.com/f5io/satnav-js
// Definitions by: Christian Holm Diget <https://github.com/DotNetNerd>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare type Callback = () => void;
interface ISatnavOptions {
html5?: boolean,
force?: boolean,
poll?: number,
matchAll?: boolean
}
interface INavigationOptions {
path?: string,
directions?: (params : any) => any,
title?: string | Callback
}
interface ISatnav {
navigate(navigationOptions: INavigationOptions): ISatnav;
otherwise(route: string): ISatnav;
change(onChange: (hash: string, params: any, old: any) => any): ISatnav;
go(): ISatnav;
}
declare function Satnav(options?: ISatnavOptions): ISatnav;
View File
Vendored Executable → Regular
View File
Executable → Regular
+5 -5
View File
@@ -1,5 +1,5 @@
/// <reference path="simplebar.d.ts"/>
/// <reference path="../jquery/jquery.d.ts"/>
var simplebar = $.fn.simplebar.noConflict();
$.fn.simplebar = simplebar;
/// <reference path="simplebar.d.ts"/>
/// <reference path="../jquery/jquery.d.ts"/>
var simplebar = $.fn.simplebar.noConflict();
$.fn.simplebar = simplebar;
Vendored Executable → Regular
+37 -37
View File
@@ -1,37 +1,37 @@
// Type definitions for simplebar.js 1.1.7
// Project: https://github.com/Grsmto/simplebar
// Definitions by: Gregor Woiwode <https://github.com/gregonnet>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface SimplebarOptions {
autoHide?: boolean;
wrapContent?: boolean;
}
interface JQuery {
/**
* Enables simplebar on calling element.
*/
simplebar: {
/**
* Define if scrollbar should be faded out automatically
*
* @param indicator if scrollbar should be faded out automatically.
*/
(options?: SimplebarOptions): JQuery;
};
}
interface JQueryStatic {
/**
* Enables simplebar on calling element.
*/
simplebar: {
/**
* Define if scrollbar should be faded out automatically
*
* @param indicator if scrollbar should be faded out automatically.
*/
(options?: SimplebarOptions): JQuery;
};
}
// Type definitions for simplebar.js 1.1.7
// Project: https://github.com/Grsmto/simplebar
// Definitions by: Gregor Woiwode <https://github.com/gregonnet>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface SimplebarOptions {
autoHide?: boolean;
wrapContent?: boolean;
}
interface JQuery {
/**
* Enables simplebar on calling element.
*/
simplebar: {
/**
* Define if scrollbar should be faded out automatically
*
* @param indicator if scrollbar should be faded out automatically.
*/
(options?: SimplebarOptions): JQuery;
};
}
interface JQueryStatic {
/**
* Enables simplebar on calling element.
*/
simplebar: {
/**
* Define if scrollbar should be faded out automatically
*
* @param indicator if scrollbar should be faded out automatically.
*/
(options?: SimplebarOptions): JQuery;
};
}
+252 -252
View File
@@ -1,252 +1,252 @@
// Type definitions for SIPml5
// Project: http://sipml5.org/
// Definitions by: A. Groenenboom <https://github.com/chookies>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare namespace SIPml {
class Event {
public description: string;
public type: string;
public getContent(): Object;
public getContentString(): string;
public getContentType(): Object;
public getSipResponseCode(): number;
}
class EventTarget<EventSubscriptionType extends string, EventType extends Event> {
public addEventListener(type: EventSubscriptionType, listener: (e: EventType) => void): void;
public removeEventListener(type: EventSubscriptionType): void;
}
class Session extends EventTarget<Session.EventSubscriptionType, Session.Event> {
public accept(configuration?: Session.Configuration): number;
public getId(): number;
public getRemoteFriendlyName(): string;
public getRemoteUri(): string;
public reject(configuration?: Session.Configuration): number;
public setConfiguration(configuration?: Session.Configuration): void;
}
export namespace Session {
/**
* Should be
*
* "*" |
* "connecting" |
* "connected" |
* "terminating" |
* "terminated" |
* "i_ao_request" |
* "media_added" |
* "media_removed" |
* "i_request" |
* "o_request" |
* "cancelled_request" |
* "sent_request" |
* "transport_error" |
* "global_error" |
* "message_error" |
* "webrtc_error" |
*/
type EventSubscriptionType = string;
interface Configuration {
audio_remote?: HTMLElement;
bandwidth?: { audio: number; video: number; };
events_listener?: {
events: EventSubscriptionType | EventSubscriptionType[];
listener: (e: Session.Event) => void
};
expires?: number;
from?: string;
sip_caps?: Object[];
sip_headers?: Object[];
video_local?: HTMLElement;
video_remote?: HTMLElement;
video_size?: {
minWidth?: number;
maxWidth?: number;
minHeight?: number;
maxHeight?: number;
};
}
class Call extends Session implements EventTarget<Call.EventSubscriptionType, Session.Event> {
public acceptTransfer(configuration?: Session.Configuration): number;
public call(to: string, configuration?: Session.Configuration): number;
public dtmf(): number;
public hangup(configuration?: Session.Configuration): number;
public hold(configuration?: Session.Configuration): number;
public info(): number;
public rejectTransfer(): number;
public resume(): number;
public transfer(): number;
}
namespace Call {
/**
* Should be
*
* Session.EventSubscriptionType |
* "m_early_media" |
* "m_local_hold_ok" |
* "m_local_hold_nok" |
* "m_local_resume_ok" |
* "m_local_resume_nok" |
* "m_remote_hold" |
* "m_remote_resume" |
* "m_stream_video_local_added" |
* "m_stream_video_local_removed" |
* "m_stream_video_remote_added" |
* "m_stream_video_remote_removed" |
* "m_stream_audio_local_added" |
* "m_stream_audio_local_removed" |
* "m_stream_audio_remote_added" |
* "m_stream_audio_remote_removed" |
* "i_ect_new_call" |
* "o_ect_trying" |
* "o_ect_accepted" |
* "o_ect_completed" |
* "i_ect_completed" |
* "o_ect_failed" |
* "i_ect_failed" |
* "o_ect_notify" |
* "i_ect_notify" |
* "i_ect_requested " |
* "m_bfcp_info" |
* "i_info" |
*/
type EventSubscriptionType = Session.EventSubscriptionType;
}
class Event extends SIPml.Event {
public session: Session;
public getTransferDestinationFriendlyName(): string;
}
class Message extends Session {
public send(to: string, content?: any, contentType?: string, configuration?: Session.Configuration): number;
}
class Publish extends Session {
public publish(content?: any, contentType?: string, configuration?: Session.Configuration): number;
public unpublish(configuration?: Session.Configuration): void;
}
class Registration extends Session {
public register(configuration?: Session.Configuration): void;
public unregister(configuration?: Session.Configuration): void;
}
class Subscribe extends Session implements EventTarget<Subscribe.EventSubscriptionType, Session.Event> {
public subscribe(to: string, configuration?: Session.Configuration): number;
public unsubscribe(configuration?: Session.Configuration): number;
}
namespace Subscribe {
/**
* Should be
*
* Session.EventSubscriptionType | "i_notify"
*/
type EventSubscriptionType = Session.EventSubscriptionType;
}
}
class Stack extends EventTarget<Stack.EventSubscriptionType, Stack.Event> {
public constructor(configuration?: Stack.Configuration);
public setConfiguration(configuration: Stack.Configuration): number;
public newSession(type: string, configuration?: Session.Configuration): any;
public start(): number;
public stop(timeout?: number): number;
}
export namespace Stack {
/**
* Should be
*
* "*" |
* "starting" |
* "started" |
* "stopping" |
* "stopped" |
* "failed_to_start" |
* "failed_to_stop" |
* "i_new_call" |
* "i_new_message" |
* "m_permission_requested" |
* "m_permission_accepted" |
* "m_permission_refused";
*/
type EventSubscriptionType = string;
interface Configuration {
bandwidth?: { audio: number; video: number; };
display_name?: string;
enable_click2call?: boolean;
enable_early_ims?: boolean;
enable_media_stream_cache?: boolean;
enable_rtcweb_breaker?: boolean;
events_listener?: {
events: EventSubscriptionType | EventSubscriptionType[];
listener: (e: Stack.Event) => void
};
ice_servers?: Object[];
impi?: string;
impu?: string;
outbound_proxy_url?: string;
password?: string;
realm?: string;
sip_headers?: Object[];
video_size?: {
minWidth?: number;
maxWidth?: number;
minHeight?: number;
maxHeight?: number;
};
websocket_proxy_url?: string;
}
class Event extends SIPml.Event {
public description: string;
public newSession: Session;
public type: string;
}
}
function getNavigatorFriendlyName(): string;
function getNavigatorVersion(): string;
function getSystemFriendlyName(): string;
function getWebRtc4AllVersion(): string;
function haveMediaStream(): boolean;
function init(readyCallback?: (e:any) => any, errorCallback?: (e:any) => any): boolean;
function isInitialized(): boolean;
function isNavigatorOutdated(): boolean;
function isReady(): boolean;
function isScreenShareSupported(): boolean;
function isWebRtcPluginOutdated(): boolean;
function isWebRtc4AllSupported(): boolean;
function isWebRtcSupported(): boolean;
function isWebSocketSupported(): boolean;
function setDebugLevel(level: string): void;
function setWebRtcType(type: string): boolean;
}
// Type definitions for SIPml5
// Project: http://sipml5.org/
// Definitions by: A. Groenenboom <https://github.com/chookies>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare namespace SIPml {
class Event {
public description: string;
public type: string;
public getContent(): Object;
public getContentString(): string;
public getContentType(): Object;
public getSipResponseCode(): number;
}
class EventTarget<EventSubscriptionType extends string, EventType extends Event> {
public addEventListener(type: EventSubscriptionType, listener: (e: EventType) => void): void;
public removeEventListener(type: EventSubscriptionType): void;
}
class Session extends EventTarget<Session.EventSubscriptionType, Session.Event> {
public accept(configuration?: Session.Configuration): number;
public getId(): number;
public getRemoteFriendlyName(): string;
public getRemoteUri(): string;
public reject(configuration?: Session.Configuration): number;
public setConfiguration(configuration?: Session.Configuration): void;
}
export namespace Session {
/**
* Should be
*
* "*" |
* "connecting" |
* "connected" |
* "terminating" |
* "terminated" |
* "i_ao_request" |
* "media_added" |
* "media_removed" |
* "i_request" |
* "o_request" |
* "cancelled_request" |
* "sent_request" |
* "transport_error" |
* "global_error" |
* "message_error" |
* "webrtc_error" |
*/
type EventSubscriptionType = string;
interface Configuration {
audio_remote?: HTMLElement;
bandwidth?: { audio: number; video: number; };
events_listener?: {
events: EventSubscriptionType | EventSubscriptionType[];
listener: (e: Session.Event) => void
};
expires?: number;
from?: string;
sip_caps?: Object[];
sip_headers?: Object[];
video_local?: HTMLElement;
video_remote?: HTMLElement;
video_size?: {
minWidth?: number;
maxWidth?: number;
minHeight?: number;
maxHeight?: number;
};
}
class Call extends Session implements EventTarget<Call.EventSubscriptionType, Session.Event> {
public acceptTransfer(configuration?: Session.Configuration): number;
public call(to: string, configuration?: Session.Configuration): number;
public dtmf(): number;
public hangup(configuration?: Session.Configuration): number;
public hold(configuration?: Session.Configuration): number;
public info(): number;
public rejectTransfer(): number;
public resume(): number;
public transfer(): number;
}
namespace Call {
/**
* Should be
*
* Session.EventSubscriptionType |
* "m_early_media" |
* "m_local_hold_ok" |
* "m_local_hold_nok" |
* "m_local_resume_ok" |
* "m_local_resume_nok" |
* "m_remote_hold" |
* "m_remote_resume" |
* "m_stream_video_local_added" |
* "m_stream_video_local_removed" |
* "m_stream_video_remote_added" |
* "m_stream_video_remote_removed" |
* "m_stream_audio_local_added" |
* "m_stream_audio_local_removed" |
* "m_stream_audio_remote_added" |
* "m_stream_audio_remote_removed" |
* "i_ect_new_call" |
* "o_ect_trying" |
* "o_ect_accepted" |
* "o_ect_completed" |
* "i_ect_completed" |
* "o_ect_failed" |
* "i_ect_failed" |
* "o_ect_notify" |
* "i_ect_notify" |
* "i_ect_requested " |
* "m_bfcp_info" |
* "i_info" |
*/
type EventSubscriptionType = Session.EventSubscriptionType;
}
class Event extends SIPml.Event {
public session: Session;
public getTransferDestinationFriendlyName(): string;
}
class Message extends Session {
public send(to: string, content?: any, contentType?: string, configuration?: Session.Configuration): number;
}
class Publish extends Session {
public publish(content?: any, contentType?: string, configuration?: Session.Configuration): number;
public unpublish(configuration?: Session.Configuration): void;
}
class Registration extends Session {
public register(configuration?: Session.Configuration): void;
public unregister(configuration?: Session.Configuration): void;
}
class Subscribe extends Session implements EventTarget<Subscribe.EventSubscriptionType, Session.Event> {
public subscribe(to: string, configuration?: Session.Configuration): number;
public unsubscribe(configuration?: Session.Configuration): number;
}
namespace Subscribe {
/**
* Should be
*
* Session.EventSubscriptionType | "i_notify"
*/
type EventSubscriptionType = Session.EventSubscriptionType;
}
}
class Stack extends EventTarget<Stack.EventSubscriptionType, Stack.Event> {
public constructor(configuration?: Stack.Configuration);
public setConfiguration(configuration: Stack.Configuration): number;
public newSession(type: string, configuration?: Session.Configuration): any;
public start(): number;
public stop(timeout?: number): number;
}
export namespace Stack {
/**
* Should be
*
* "*" |
* "starting" |
* "started" |
* "stopping" |
* "stopped" |
* "failed_to_start" |
* "failed_to_stop" |
* "i_new_call" |
* "i_new_message" |
* "m_permission_requested" |
* "m_permission_accepted" |
* "m_permission_refused";
*/
type EventSubscriptionType = string;
interface Configuration {
bandwidth?: { audio: number; video: number; };
display_name?: string;
enable_click2call?: boolean;
enable_early_ims?: boolean;
enable_media_stream_cache?: boolean;
enable_rtcweb_breaker?: boolean;
events_listener?: {
events: EventSubscriptionType | EventSubscriptionType[];
listener: (e: Stack.Event) => void
};
ice_servers?: Object[];
impi?: string;
impu?: string;
outbound_proxy_url?: string;
password?: string;
realm?: string;
sip_headers?: Object[];
video_size?: {
minWidth?: number;
maxWidth?: number;
minHeight?: number;
maxHeight?: number;
};
websocket_proxy_url?: string;
}
class Event extends SIPml.Event {
public description: string;
public newSession: Session;
public type: string;
}
}
function getNavigatorFriendlyName(): string;
function getNavigatorVersion(): string;
function getSystemFriendlyName(): string;
function getWebRtc4AllVersion(): string;
function haveMediaStream(): boolean;
function init(readyCallback?: (e:any) => any, errorCallback?: (e:any) => any): boolean;
function isInitialized(): boolean;
function isNavigatorOutdated(): boolean;
function isReady(): boolean;
function isScreenShareSupported(): boolean;
function isWebRtcPluginOutdated(): boolean;
function isWebRtc4AllSupported(): boolean;
function isWebRtcSupported(): boolean;
function isWebSocketSupported(): boolean;
function setDebugLevel(level: string): void;
function setWebRtcType(type: string): boolean;
}
+13 -13
View File
@@ -702,25 +702,25 @@ specs[9] = {
{
"name": "people",
"values": [
{
{
"label": "Washington", "born": -7506057600000, "died": -5366196000000,
"enter": -5701424400000, "leave": -5453884800000
"enter": -5701424400000, "leave": -5453884800000
},
{
{
"label": "Adams", "born": -7389766800000, "died": -4528285200000,
"enter": -5453884800000, "leave": -5327740800000
"enter": -5453884800000, "leave": -5327740800000
},
{
{
"label": "Jefferson", "born": -7154586000000, "died": -4528285200000,
"enter": -5327740800000, "leave": -5075280000000
"enter": -5327740800000, "leave": -5075280000000
},
{
{
"label": "Madison", "born": -6904544400000, "died": -4213184400000,
"enter": -5075280000000, "leave": -4822819200000
"enter": -5075280000000, "leave": -4822819200000
},
{
{
"label": "Monroe", "born": -6679904400000, "died": -4370518800000,
"enter": -4822819200000, "leave": -4570358400000
"enter": -4822819200000, "leave": -4570358400000
}
]
},
@@ -945,9 +945,9 @@ specs[11] = {
}
],
"axes": [
{
{
"type": "y", "scale": "y", "ticks": 4, "orient": "right",
"grid": true, "layer": "back"
"grid": true, "layer": "back"
}
],
"marks": [
@@ -1839,7 +1839,7 @@ specs[20] = {
}
],
"axes": [
{
{
"type": "y", "scale": "y", "ticks": 3, "tickSize": 0,
"orient": "right", "grid": true,
"properties": {
+2 -2
View File
@@ -207,8 +207,8 @@ declare namespace Vega {
* in some cases strict padding is not possible; for example, if the axis
* labels are much larger than the data rectangle.
*/
padding?: number | string | {
top: number; left: number; right: number; bottom: number
padding?: number | string | {
top: number; left: number; right: number; bottom: number
}; // string is "auto" or "strict"
/**
* Definitions of data to visualize.