Merge branch 'master' into master

This commit is contained in:
Dušan Roštár 2018-12-18 11:15:31 +01:00 committed by GitHub
commit dbfb1aa047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1469 changed files with 53530 additions and 12453 deletions

431
.github/CODEOWNERS vendored

File diff suppressed because it is too large Load Diff

View File

@ -169,8 +169,14 @@ If a package was never on DefinitelyTyped, it does not need to be added to `notN
#### Lint
To lint a package, just add a `tslint.json` to that package containing `{ "extends": "dtslint/dt.json" }`. All new packages must be linted.
If a `tslint.json` turns rules off, this is because that hasn't been fixed yet. For example:
All new packages must be linted. To lint a package, add a `tslint.json` to that package containing
```js
{
"extends": "dtslint/dt.json"
}
```
This should be the only content in a finished project's `tslint.json` file. If a `tslint.json` turns rules off, this is because that hasn't been fixed yet. For example:
```js
{

View File

@ -642,6 +642,12 @@
"sourceRepoURL": "https://github.com/jdalrymple/node-gitlab",
"asOfVersion": "2.0.0"
},
{
"libraryName": "Google Cloud Storage",
"typingsPackageName": "google-cloud__storage",
"sourceRepoURL": "https://github.com/googleapis/nodejs-storage",
"asOfVersion": "2.3.0"
},
{
"libraryName": "graphene-pk11",
"typingsPackageName": "graphene-pk11",

View File

@ -22,6 +22,6 @@
},
"devDependencies": {
"dtslint": "github:Microsoft/dtslint#production",
"types-publisher": "Microsoft/types-publisher#production"
"types-publisher": "github:Microsoft/types-publisher#production"
}
}

View File

@ -0,0 +1,29 @@
import * as accept from 'accept';
accept.charsets("iso-8859-5, unicode-1-1;q=0.8"); // charset === "iso-8859-5"
accept.charset("iso-8859-5, unicode-1-1;q=0.8", ["unicode-1-1"]); // charset === "unicode-1-1"
accept.encoding("gzip, deflate, sdch"); // encoding === "gzip"
accept.encoding("gzip, deflate, sdch", ["deflate", "identity"]);
const encodings = accept.encodings("compress;q=0.5, gzip;q=1.0"); // encodings === ["gzip", "compress", "identity"]
encodings.lastIndexOf('');
accept.language("en;q=0.7, en-GB;q=0.8");
accept.language("en;q=0.7, en-GB;q=0.8", ["en-gb"]); // language === "en-GB"
const languages = accept.languages("da, en;q=0.7, en-GB;q=0.8"); // languages === ["da", "en-GB", "en"]
languages.lastIndexOf('');
const mediaTypes = accept.mediaTypes("text/plain, application/json;q=0.5, text/html, */*;q=0.1");
// mediaTypes === ["text/plain", "text/html", "application/json", "*/*"]
mediaTypes.lastIndexOf('');
const headers = {
accept: 'text/plain, application/json;q=0.5, text/html, */*;q=0.1',
'accept-language': 'da, en;q=0.7, en-GB;q=0.8'
};
const all = accept.parseAll(headers);
all.charsets.length;
all.encodings.length;
all.languages.length;
all.mediaTypes.length;

21
types/accept/index.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
// Type definitions for accept 3.1
// Project: https://github.com/hapijs/accept#readme
// Definitions by: feinoujc <https://github.com/feinoujc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
export function charset(charsetHeader?: string, preferences?: string[]): string;
export function charsets(charsetHeader?: string): string[];
export function encoding(encodingHeader?: string, preferences?: string[]): string;
export function encodings(encodingHeader?: string): string[];
export function language(languageHeader?: string, preferences?: string[]): string;
export function languages(languageHeader?: string): string[];
export function mediaTypes(mediaTypeHeader?: string): string[];
export function parseAll(
headers: Record<string, string | string[] | undefined>
): {
charsets: string[];
encodings: string[];
languages: string[];
mediaTypes: string[];
};

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"accept-tests.ts"
]
}

1
types/accept/tslint.json Normal file
View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -1223,7 +1223,7 @@ declare namespace AceAjax {
/**
* Returns `true` if the current `textInput` is in focus.
**/
isFocused(): void;
isFocused(): boolean;
/**
* Blurs the current `textInput`.

View File

@ -0,0 +1,17 @@
import activeWin = require('active-win');
// $ExpectType Promise<Result>
activeWin();
// $ExpectType Result
activeWin.sync();
let win = {
title: 'Unicorns - Google Search',
id: 5762,
owner: {
name: 'Google Chrome',
processId: 310,
},
};
win = activeWin.sync();

30
types/active-win/index.d.ts vendored Normal file
View File

@ -0,0 +1,30 @@
// Type definitions for active-win 4.0
// Project: https://github.com/sindresorhus/active-win#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = activeWin;
declare function activeWin(): Promise<activeWin.Result>;
declare namespace activeWin {
function sync(): Result;
interface Result {
title: string;
id: number;
bounds?: {
x: number;
y: number;
width: number;
height: number;
};
owner: {
name: string;
processId: number;
bundleId?: number;
path?: string;
};
memoryUsage?: number;
}
}

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"active-win-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -0,0 +1,4 @@
import allPropertyNames = require('all-property-names');
// $ExpectType Set<string>
allPropertyNames(Symbol.prototype);

9
types/all-property-names/index.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
// Type definitions for all-property-names 1.0
// Project: https://github.com/sindresorhus/all-property-names#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
export = allPropertyNames;
declare function allPropertyNames(input: object): Set<string>;

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"all-property-names-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -54,7 +54,7 @@ declare namespace AltJS {
export type Source = {[name:string]: () => SourceModel<any>};
export interface SourceModel<S> {
local(state:any, ...args: any[]):any;
local?(state:any, ...args: any[]):any;
remote(state:any, ...args: any[]):Promise<S>;
shouldFetch?(fetchFn:(...args:Array<any>) => boolean):void;
loading?:(args:any) => void;

View File

@ -136,7 +136,16 @@ export interface ChannelWrapper extends EventEmitter {
* Setup functions should, ideally, not throw errors, but if they do then the ChannelWrapper will emit an 'error' event.
* @param func
*/
addSetup(func: SetupFunc): Promise<void>;
addSetup(func: SetupFunc): Promise<void>;
/**
* Remove a setup function added with `addSetup`. If there is currently a
* connection, `teardown(channel, [cb])` will be run immediately, and the
* returned Promise will not resolve until it completes.
* @param func
* @param [tearDown]
*/
removeSetup(func: SetupFunc, tearDown?: SetupFunc): Promise<void>;
/**
* @see amqplib

View File

@ -74,6 +74,7 @@
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
"whitespace": false,
"no-angle-bracket-type-assertion": false
}
}

View File

@ -74,6 +74,7 @@
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
"whitespace": false,
"no-angle-bracket-type-assertion": false
}
}

View File

@ -153,6 +153,10 @@ declare module 'angular' {
defaultFontSet(name: string): IIconProvider;
}
interface IInkRippleProvider {
disableInkRipple(): void;
}
type IMedia = (media: string) => boolean;
interface ISidenavObject {

View File

@ -74,6 +74,7 @@
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
"whitespace": false,
"no-angle-bracket-type-assertion": false
}
}

View File

@ -74,6 +74,7 @@
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
"whitespace": false,
"no-angle-bracket-type-assertion": false
}
}

View File

@ -94,8 +94,6 @@ function JQuery() {
}
function bind() {
interface I1 { kind: 'I1'; }
// $ExpectType JQuery<HTMLElement>
$('p').bind('myEvent', 'myData', function(event) {
// TODO: $ExpectType HTMLElement
@ -104,14 +102,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('p').bind('myEvent', 'myData', function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
});
// $ExpectType JQuery<HTMLElement>
$('p').bind('myEvent', function(event) {
// TODO: $ExpectType HTMLElement
@ -120,14 +110,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('p').bind('myEvent', function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
});
// $ExpectType JQuery<HTMLElement>
$('p').bind('myEvent', false);
@ -139,12 +121,6 @@ function JQuery() {
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
},
myEvent3(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
}
});
@ -164,27 +140,15 @@ function JQuery() {
}
function off() {
function defaultContext_defaultData(this: HTMLElement, event: JQueryEventObject) { }
function defaultData(this: HTMLElement, event: JQueryEventObject) { }
function defaultContext_customData(this: HTMLElement, event: JQueryEventObject) { }
function customContext_defaultData(this: I1, event: JQueryEventObject) { }
function customContext_customData(this: I1, event: JQueryEventObject) { }
interface I1 { kind: 'I1'; }
function customData(this: HTMLElement, event: JQueryEventObject) { }
// $ExpectType JQuery<HTMLElement>
$('table').off('myEvent', 'td', defaultContext_defaultData);
$('table').off('myEvent', 'td', defaultData);
// $ExpectType JQuery<HTMLElement>
$('table').off('myEvent', 'td', defaultContext_customData);
// $ExpectType JQuery<HTMLElement>
$('table').off('myEvent', 'td', customContext_defaultData);
// $ExpectType JQuery<HTMLElement>
$('table').off('myEvent', 'td', customContext_customData);
$('table').off('myEvent', 'td', customData);
// $ExpectType JQuery<HTMLElement>
$('table').off('myEvent', 'td', false);
@ -193,16 +157,10 @@ function JQuery() {
$('table').off('myEvent', 'td');
// $ExpectType JQuery<HTMLElement>
$('table').off('myEvent', defaultContext_defaultData);
$('table').off('myEvent', defaultData);
// $ExpectType JQuery<HTMLElement>
$('table').off('myEvent', defaultContext_customData);
// $ExpectType JQuery<HTMLElement>
$('table').off('myEvent', customContext_defaultData);
// $ExpectType JQuery<HTMLElement>
$('table').off('myEvent', customContext_customData);
$('table').off('myEvent', customData);
// $ExpectType JQuery<HTMLElement>
$('table').off('myEvent', false);
@ -213,19 +171,15 @@ function JQuery() {
// $ExpectType JQuery<HTMLElement>
$('table').off({
myEvent1: false,
defaultContext_defaultData,
defaultContext_customData,
customContext_defaultData,
customContext_customData
defaultData,
customData
}, 'td');
// $ExpectType JQuery<HTMLElement>
$('table').off({
myEvent1: false,
defaultContext_defaultData,
defaultContext_customData,
customContext_defaultData,
customContext_customData
defaultData,
customData
});
// $ExpectType JQuery<HTMLElement>
@ -236,8 +190,6 @@ function JQuery() {
}
function on() {
interface I1 { kind: 'I1'; }
// $ExpectType JQuery<HTMLElement>
$('table').on('myEvent', 'td', 'myData', function(event) {
// TODO: $ExpectType HTMLElement
@ -246,14 +198,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').on('myEvent', 'td', 'myData', function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').on('myEvent', null, 'myData', function(event) {
// TODO: $ExpectType HTMLElement
@ -262,14 +206,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').on('myEvent', null, 'myData', function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').on('myEvent', 'td', function(event) {
// TODO: $ExpectType HTMLElement
@ -278,14 +214,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').on('myEvent', 'td', function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').on('myEvent', 'td', false);
@ -297,14 +225,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').on('myEvent', 3, function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, number>
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').on('myEvent', function(event) {
// TODO: $ExpectType HTMLElement
@ -313,14 +233,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').on('myEvent', function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').on('myEvent', false);
@ -332,12 +244,6 @@ function JQuery() {
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
},
myEvent3(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
}
}, 'td', 'myData');
@ -349,12 +255,6 @@ function JQuery() {
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
},
myEvent3(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
}
}, null, 'myData');
@ -366,12 +266,6 @@ function JQuery() {
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
},
myEvent3(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
}
}, 'td');
@ -383,12 +277,6 @@ function JQuery() {
this;
// TODO: $ExpectType Event<HTMLElement, number>
event;
},
myEvent3(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, number>
event;
}
}, 3);
@ -400,19 +288,11 @@ function JQuery() {
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
},
myEvent3(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
}
});
}
function one() {
interface I1 { kind: 'I1'; }
// $ExpectType JQuery<HTMLElement>
$('table').one('myEvent', 'td', 'myData', function(event) {
// TODO: $ExpectType HTMLElement
@ -421,14 +301,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').one('myEvent', 'td', 'myData', function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').one('myEvent', null, 'myData', function(event) {
// TODO: $ExpectType HTMLElement
@ -437,14 +309,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').one('myEvent', null, 'myData', function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').one('myEvent', 'td', function(event) {
// TODO: $ExpectType HTMLElement
@ -453,14 +317,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').one('myEvent', 'td', function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').one('myEvent', 'td', false);
@ -472,14 +328,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').one('myEvent', 3, function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, number>
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').one('myEvent', function(event) {
// TODO: $ExpectType HTMLElement
@ -488,14 +336,6 @@ function JQuery() {
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').one('myEvent', function(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
});
// $ExpectType JQuery<HTMLElement>
$('table').one('myEvent', false);
@ -507,12 +347,6 @@ function JQuery() {
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
},
myEvent3(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
}
}, 'td', 'myData');
@ -524,12 +358,6 @@ function JQuery() {
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
},
myEvent3(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, string>
event;
}
}, null, 'myData');
@ -541,12 +369,6 @@ function JQuery() {
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
},
myEvent3(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
}
}, 'td');
@ -558,12 +380,6 @@ function JQuery() {
this;
// TODO: $ExpectType Event<HTMLElement, number>
event;
},
myEvent3(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, number>
event;
}
}, 3);
@ -575,12 +391,6 @@ function JQuery() {
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
},
myEvent3(this: I1, event) {
// $ExpectType I1
this;
// TODO: $ExpectType Event<HTMLElement, null>
event;
}
});
}

View File

@ -74,6 +74,7 @@
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
"whitespace": false,
"no-angle-bracket-type-assertion": false
}
}

View File

@ -1,8 +1,45 @@
// Type definitions for ansicolors
// Project: https://github.com/thlorenz/ansicolors
// Definitions by: rogierschouten <https://github.com/rogierschouten>
// Definitions by: Benjamin Arthur Lupton <https://github.com/balupton>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var colors: { [index: string]: (s: string) => string; };
export = colors;
interface Colors extends String {
(value: string): string
white: this
black: this
blue: this
cyan: this
green: this
magenta: this
red: this
yellow: this
brightBlack: this
brightRed: this
brightGreen: this
brightYellow: this
brightBlue: this
brightMagenta: this
brightCyan: this
brightWhite: this
bgBlack: this
bgRed: this
bgGreen: this
bgYellow: this
bgBlue: this
bgMagenta: this
bgCyan: this
bgWhite: this
bgBrightBlack: this
bgBrightRed: this
bgBrightGreen: this
bgBrightYellow: this
bgBrightBlue: this
bgBrightMagenta: this
bgBrightCyan: this
bgBrightWhite: this
open: this
close: this
colors: this
}
declare const colors: Colors
export default colors

View File

@ -47,7 +47,8 @@ appInsights = {
startTrackEvent(name: string) { return null; },
stopTrackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; },
trackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; },
trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number) { return null; },
trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean,
resultCode: number, properties?: { [name: string]: string }, measurements?: { [name: string]: number }) { return null; },
trackException(exception: Error, handledAt?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, severityLevel?: AI.SeverityLevel) { return null; },
trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { [name: string]: string; }) { return null; },
trackTrace(message: string, properties?: { [name: string]: string; }, severityLevel?: AI.SeverityLevel) { return null; },
@ -86,7 +87,7 @@ appInsights.trackTrace("message", null);
appInsights.trackTrace("message", { a: '1', b: '2' }, AI.SeverityLevel.Error);
// trackDependency
appInsights.trackDependency("id", "POST", "http://example.com/test/abc", "/test/abc", null, true, null);
appInsights.trackDependency("id", "POST", "http://example.com/test/abc", "/test/abc", null, true, null, {prop1: 'abc'}, {meas1: 4.5});
// flush
appInsights.flush();

View File

@ -670,14 +670,16 @@ declare module Microsoft.ApplicationInsights {
context: ITelemetryContext;
queue: Array<() => void>;
/**
* Starts timing how long the user views a page or other item. Call this when the page opens.
* This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes.
* Starts the timer for tracking a page load time. Use this instead of `trackPageView` if you want to control when the page view timer starts and stops,
* but don't want to calculate the duration yourself. This method doesn't send any telemetry. Call `stopTrackPage` to log the end of the page view
* and send the event.
* @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title.
*/
startTrackPage(name?: string): any;
/**
* Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes.
* @param name The string you used as the name in startTrackPage. Defaults to the document title.
* Stops the timer that was started by calling `startTrackPage` and sends the pageview load time telemetry with the specified properties and measurements.
* The duration of the page view will be the time between calling `startTrackPage` and `stopTrackPage`.
* @param name The string you used as the name in `startTrackPage`. Defaults to the document title.
* @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
* @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.
* @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.
@ -689,7 +691,7 @@ declare module Microsoft.ApplicationInsights {
measurements?: { [name: string]: number }): any;
/**
* Logs that a page or other item was viewed.
* @param name The string you used as the name in startTrackPage. Defaults to the document title.
* @param name The string you used as the name in `startTrackPage`. Defaults to the document title.
* @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location.
* @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty.
* @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty.
@ -701,13 +703,13 @@ declare module Microsoft.ApplicationInsights {
properties?: { [name: string]: string },
measurements?: { [name: string]: number }, duration?: number): any;
/**
* Start timing an extended event. Call {@link stopTrackEvent} to log the event when it ends.
* Start timing an extended event. Call `stopTrackEvent` to log the event when it ends.
* @param name A string that identifies this event uniquely within the document.
*/
startTrackEvent(name: string): any;
/**
* Log an extended event that you started timing with {@link startTrackEvent}.
* @param name The string you used to identify this event in startTrackEvent.
* Log an extended event that you started timing with `startTrackEvent`.
* @param name The string you used to identify this event in `startTrackEvent`.
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
*/
@ -734,8 +736,11 @@ declare module Microsoft.ApplicationInsights {
* @param totalTime total request time
* @param success indicates if the request was sessessful
* @param resultCode response code returned by the dependency request
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
*/
trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number): any;
trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number,
properties?: { [name: string]: string }, measurements?: { [name: string]: number }): any;
/**
* Log an exception you have caught.
* @param exception An Error from a catch clause, or the string error message.

View File

@ -5,6 +5,7 @@ assert(true, "it's working");
assert.ok(true, "inner functions work as well");
assert.throws(() => {});
assert.throws(() => {}, /Regex test/);
assert.throws(() => {}, () => {}, "works wonderfully");
assert['fail'](true, true, "works like a charm");

View File

@ -1,6 +1,7 @@
// Type definitions for commonjs-assert 1.4
// Project: https://github.com/browserify/commonjs-assert
// Definitions by: Nico Gallinal <https://github.com/nicoabie>
// Linus Unnebäck <https://github.com/LinusU>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function assert(value: any, message?: string): void;
@ -23,10 +24,10 @@ declare namespace assert {
function notStrictEqual(actual: any, expected: any, message?: string): void;
function throws(block: () => void, message?: string): void;
function throws(block: () => void, error: () => void | ((err: any) => boolean) | RegExp, message?: string): void;
function throws(block: () => void, error: (() => void) | ((err: any) => boolean) | RegExp, message?: string): void;
function doesNotThrow(block: () => void, message?: string): void;
function doesNotThrow(block: () => void, error: () => void | ((err: any) => boolean) | RegExp, message?: string): void;
function doesNotThrow(block: () => void, error: (() => void) | ((err: any) => boolean) | RegExp, message?: string): void;
function ifError(value: any): void;

View File

@ -0,0 +1,42 @@
import Tree from "@atlaskit/tree";
import * as React from "react";
import { render } from "react-dom";
declare const container: Element;
render(
<Tree
tree={{
rootId: 1,
items: {
1: {
id: 1,
children: []
},
"string-id": {
id: "string-id",
children: [1, "another"],
hasChildren: true,
isExpanded: false,
isChildrenLoading: false,
data: {
myVar: "this can be anything"
}
}
}
}}
renderItem={() => <div />}
onExpand={() => {}}
onCollapse={() => {}}
onDragStart={() => {}}
onDragEnd={() => {}}
offsetPerLevel={20}
isDragEnabled
isNestingEnabled
/>,
container
);
// Check that default props work too.
render(<Tree renderItem={() => <div />} />, container);

153
types/atlaskit__tree/index.d.ts vendored Normal file
View File

@ -0,0 +1,153 @@
// Type definitions for @atlaskit/tree 4.1
// Project: https://bitbucket.org/atlassian/atlaskit-mk-2/
// Definitions by: Ben James <https://github.com/benhjames>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
import { Component, ReactNode } from "react";
import {
DraggingStyle,
DraggableProvidedDragHandleProps,
DraggableStateSnapshot,
NotDraggingStyle
} from "react-beautiful-dnd";
export type ItemId = any;
export type Path = number[];
export interface TreeData {
rootId: ItemId;
items: { [key: string]: TreeItem; [key: number]: TreeItem };
}
export type TreeItemData = any;
export interface TreeItem {
id: ItemId;
children: ItemId[];
hasChildren?: boolean;
isExpanded?: boolean;
isChildrenLoading?: boolean;
data?: TreeItemData;
}
export interface TreeSourcePosition {
parentId: ItemId;
index: number;
}
export interface TreeDestinationPosition {
parentId: ItemId;
index?: number;
}
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
interface TreeDraggingStyle extends Omit<DraggingStyle, "transition"> {
paddingLeft: number;
transition: "none" | string;
}
type TreeDraggableStyle = NotDraggingStyle | TreeDraggingStyle;
interface TreeDraggableProps {
// Props that can be spread onto the element directly
// inline style
style?: TreeDraggableStyle;
// used for shared global styles
"data-react-beautiful-dnd-draggable": string;
}
interface TreeDraggableProvided {
draggableProps: TreeDraggableProps;
// will be null if the draggable is disabled
dragHandleProps?: DraggableProvidedDragHandleProps;
// The following props will be removed once we move to react 16
innerRef: (element?: HTMLElement) => void;
}
export interface RenderItemParams {
item: TreeItem;
depth: number;
onExpand: (itemId: ItemId) => void;
onCollapse: (itemId: ItemId) => void;
provided: TreeDraggableProvided;
snapshot: DraggableStateSnapshot;
}
interface TreeItemMutation {
id?: ItemId;
children?: ItemId[];
hasChildren?: boolean;
isExpanded?: boolean;
isChildrenLoading?: boolean;
data?: TreeItemData;
}
export function mutateTree(
tree: TreeData,
itemId: ItemId,
mutation: TreeItemMutation
): TreeData;
export function moveItemOnTree(
tree: TreeData,
from: TreeSourcePosition,
to: TreeDestinationPosition
): TreeData;
interface TreeProps {
/** The tree data structure. */
tree: TreeData;
/** Function that will be called when a parent item needs to be expanded. */
onExpand: (itemId: ItemId, path: Path) => void;
/** Function that will be called when a parent item needs to be collapsed. */
onCollapse: (itemId: ItemId, path: Path) => void;
/** Function that will be called when the user starts dragging. */
onDragStart: (itemId: ItemId) => void;
/** Function that will be called when the user finishes dragging. */
onDragEnd: (
sourcePosition: TreeSourcePosition,
destinationPosition: TreeDestinationPosition | undefined
) => void;
/** Function that will be called to render a single item. */
renderItem: (itemProps: RenderItemParams) => ReactNode;
/** Number of pixel is used to scaffold the tree by the consumer. */
offsetPerLevel: number;
/** Boolean to turn on drag&drop re-ordering on the tree */
isDragEnabled: boolean;
/** Boolean to turn on hovering while dragging */
isNestingEnabled: boolean;
}
interface FlattenedItem {
item: TreeItem;
path: Path;
}
type FlattenedTree = FlattenedItem[];
interface TreeState {
/** The flattened tree data structure transformed from props.tree */
flattenedTree: FlattenedTree;
// Id of the currently dragged item
draggedItemId: ItemId;
}
declare class Tree extends Component<TreeProps, TreeState> {
static defaultProps: {
tree: { children: [] };
onExpand: () => void;
onCollapse: () => void;
onDragStart: () => void;
onDragEnd: () => void;
renderItem: () => void;
offsetPerLevel: 35;
isDragEnabled: false;
isNestingEnabled: false;
};
}
export default Tree;

View File

@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"paths": {
"@atlaskit/tree": ["atlaskit__tree"]
}
},
"files": ["index.d.ts", "atlaskit__tree-tests.tsx"]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -4,10 +4,14 @@ import * as t from "@babel/types";
// Examples from: https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md
const MyVisitor: Visitor = {
Identifier: {
enter() {
enter(path) {
// $ExpectType NodePath<Identifier>
path;
console.log("Entered!");
},
exit() {
exit(path) {
// $ExpectType NodePath<Identifier>
path;
console.log("Exited!");
}
}
@ -109,3 +113,40 @@ const BindingKindTest: Visitor = {
kind === 'anythingElse';
},
};
interface SomeVisitorState { someState: string; }
const VisitorStateTest: Visitor<SomeVisitorState> = {
enter(path, state) {
// $ExpectType SomeVisitorState
state;
// $ExpectType SomeVisitorState
this;
},
exit(path, state) {
// $ExpectType SomeVisitorState
state;
// $ExpectType SomeVisitorState
this;
},
Identifier(path, state) {
// $ExpectType SomeVisitorState
state;
// $ExpectType SomeVisitorState
this;
},
FunctionDeclaration: {
enter(path, state) {
// $ExpectType SomeVisitorState
state;
// $ExpectType SomeVisitorState
this;
},
exit(path, state) {
// $ExpectType SomeVisitorState
state;
// $ExpectType SomeVisitorState
this;
}
}
};

View File

@ -143,17 +143,17 @@ export class Binding {
constantViolations: NodePath[];
}
export type Visitor<S = Node> = VisitNodeObject<Node> & {
[P in Node["type"]]?: VisitNode<S, Extract<Node, { type: P; }>>;
export type Visitor<S = {}> = VisitNodeObject<S, Node> & {
[Type in Node["type"]]?: VisitNode<S, Extract<Node, { type: Type; }>>;
};
export type VisitNode<T, P> = VisitNodeFunction<T, P> | VisitNodeObject<T>;
export type VisitNode<S, P> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
export type VisitNodeFunction<T, P> = (this: T, path: NodePath<P>, state: any) => void;
export type VisitNodeFunction<S, P> = (this: S, path: NodePath<P>, state: S) => void;
export interface VisitNodeObject<T> {
enter?(path: NodePath<T>, state: any): void;
exit?(path: NodePath<T>, state: any): void;
export interface VisitNodeObject<S, P> {
enter?: VisitNodeFunction<S, P>;
exit?: VisitNodeFunction<S, P>;
}
export class NodePath<T = Node> {

View File

@ -92,7 +92,7 @@ declare namespace Backbone {
}
interface EventsHash {
[selector: string]: string | {(eventObject: JQueryEventObject): void};
[selector: string]: string | {(eventObject: JQuery.TriggeredEvent): void};
}
export const Events: Events;

File diff suppressed because it is too large Load Diff

4758
types/baidu-app/index.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"dom",
"esnext"
],
"strictFunctionTypes": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"baidu-app-tests.ts"
]
}

View File

@ -0,0 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"no-console": false,
"semicolon": true
}
}

View File

@ -0,0 +1,24 @@
import b64 = require('base64-async');
import * as fs from 'fs';
const buffer: Buffer = fs.readFileSync('somehugefile.jpg');
const b64String = 'aGkgbXVt...';
b64.encode(buffer).then(b64String => {
b64String; // $ExpectType string
});
b64.encode(buffer, { chunkSize: 10 }).then(b64String => {
b64String; // $ExpectType string
});
b64.decode(b64String).then(buffer => {
buffer; // $ExpectType Buffer
});
b64.decode(b64String, { chunkSize: 10 }).then(buffer => {
buffer; // $ExpectType Buffer
});
b64(buffer); // $ExpectType Promise<string>
b64(buffer, { chunkSize: 10 }); // $ExpectType Promise<string>
b64(b64String); // $ExpectType Promise<Buffer>
b64(b64String, { chunkSize: 10 }); // $ExpectType Promise<Buffer>

20
types/base64-async/index.d.ts vendored Normal file
View File

@ -0,0 +1,20 @@
// Type definitions for base64-async 2.1
// Project: https://github.com/lukechilds/base64-async
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
export = base64Async;
declare function base64Async(input: Buffer, options?: base64Async.Options): Promise<string>;
declare function base64Async(input: string, options?: base64Async.Options): Promise<Buffer>;
declare namespace base64Async {
function encode(input: Buffer, options?: Options): Promise<string>;
function decode(input: string, options?: Options): Promise<Buffer>;
interface Options {
chunkSize?: number;
}
}

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"base64-async-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -0,0 +1,4 @@
import batteryLevel = require('battery-level');
// $ExpectType Promise<number>
batteryLevel();

8
types/battery-level/index.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
// Type definitions for battery-level 3.0
// Project: https://github.com/gillstrom/battery-level#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = batteryLevel;
declare function batteryLevel(): Promise<number>;

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"battery-level-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -6,7 +6,6 @@ const result: Database.RunResult = { changes: 1, lastInsertRowid: 1 };
const options: Database.Options = { fileMustExist: true, memory: true, readonly: true };
const registrationOptions: Database.RegistrationOptions = {
deterministic: true,
name: '',
safeIntegers: true,
varargs: true
};
@ -15,26 +14,49 @@ let db = Database('.');
db = new Database('.', { memory: true });
db.exec('CREATE TABLE test (id INTEGER PRIMARY KEY NOT NULL, name TEXT NOT NULL);');
db.exec('INSERT INTO test(name) VALUES("name");');
db.pragma('data_version', true);
db.pragma('data_version', { simple: true });
db.checkpoint();
db.checkpoint('main');
db.register(() => { });
db.register({ name: 'noop', deterministic: true, varargs: true }, () => { });
db.function('noop', () => { });
db.function('noop', { deterministic: true, varargs: true }, () => { });
db.aggregate('add', {
start: 0,
step: (t, n) => t + n,
deterministic: true,
varargs: true
});
db.aggregate('getAverage', {
start: () => [],
step: (array, nextValue) => {
array.push(nextValue);
},
result: array => array.reduce((t: any, v: any) => t + v) / array.length,
});
db.aggregate('addAll', {
start: 0,
step: (total, nextValue) => total + nextValue,
inverse: (total, droppedValue) => total - droppedValue,
result: total => Math.round(total),
});
db.defaultSafeIntegers();
db.defaultSafeIntegers(true);
const stmt = db.prepare('SELECT * FROM test WHERE name == ?;');
stmt.get(['name']);
stmt.all({ name: 'name' });
stmt.each('name', (row: { name: string }) => { });
stmt.each((row: { name: string }) => { });
for (const row of stmt.iterate('name')) {
}
stmt.pluck();
stmt.pluck(true);
stmt.expand();
stmt.expand(true);
stmt.bind('name');
stmt.safeIntegers();
stmt.safeIntegers(true);
const trans = db.transaction(['INSERT INTO test(name) VALUES(?);']);
trans.run('name');
trans.bind('name');
trans.run();
const trans = db.transaction((param) => stmt.all(param));
trans('name');
trans.default('name');
trans.deferred('name');
trans.immediate('name');
trans.exclusive('name');

View File

@ -3,35 +3,32 @@
// Definitions by: Ben Davies <https://github.com/Morfent>
// Mathew Rumsey <https://github.com/matrumz>
// Santiago Aguilar <https://github.com/sant123>
// Alessandro Vergani <https://github.com/loghorn>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import Integer = require("integer");
declare class Statement {
interface Statement {
database: Database;
source: string;
returnsData: boolean;
constructor(db: Database, sources: string[]);
reader: boolean;
run(...params: any[]): Database.RunResult;
get(...params: any[]): any;
all(...params: any[]): any[];
each(params: any, cb: (row: any) => void): void;
each(cb: (row: any) => void): void;
each(...params: any[]): void;
iterate(...params: any[]): IterableIterator<any>;
pluck(toggleState?: boolean): this;
expand(toggleState?: boolean): this;
bind(...params: any[]): this;
safeIntegers(toggleState?: boolean): this;
}
declare class Transaction {
database: Database;
source: string;
constructor(db: Database, sources: string[]);
run(...params: any[]): Database.RunResult;
bind(...params: any[]): this;
safeIntegers(toggleState?: boolean): this;
interface Transaction {
(...params: any[]): any;
default(...params: any[]): any;
deferred(...params: any[]): any;
immediate(...params: any[]): any;
exclusive(...params: any[]): any;
}
interface Database {
@ -42,15 +39,14 @@ interface Database {
inTransaction: boolean;
prepare(source: string): Statement;
transaction(sources: string[]): Transaction;
transaction(fn: (...params: any[]) => any): Transaction;
exec(source: string): this;
pragma(source: string, simplify?: boolean): any;
pragma(source: string, options?: Database.PragmaOptions): any;
checkpoint(databaseName?: string): this;
register(cb: (...params: any[]) => any): this;
register(
options: Database.RegistrationOptions,
cb: (...params: any[]) => any
): this;
function(name: string, cb: (...params: any[]) => any): this;
function(name: string, options: Database.RegistrationOptions, cb: (...params: any[]) => any): this;
aggregate(name: string, options: Database.AggregateOptions): this;
loadExtension(path: string): this;
close(): this;
defaultSafeIntegers(toggleState?: boolean): this;
}
@ -81,14 +77,25 @@ declare namespace Database {
memory?: boolean;
readonly?: boolean;
fileMustExist?: boolean;
timeout?: number;
}
interface PragmaOptions {
simple?: boolean;
}
interface RegistrationOptions {
name?: string;
varargs?: boolean;
deterministic?: boolean;
safeIntegers?: boolean;
}
interface AggregateOptions extends RegistrationOptions {
start?: any;
step: (total: any, next: any) => any;
inverse?: (total: any, dropped: any) => any;
result?: (total: any) => any;
}
}
declare const Database: DatabaseConstructor;

View File

@ -1,6 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": [
"es6"
],
@ -20,4 +21,4 @@
"index.d.ts",
"better-sqlite3-tests.ts"
]
}
}

View File

@ -0,0 +1,6 @@
import binVersion = require('bin-version');
// $ExpectType Promise<string>
binVersion('curl');
// $ExpectType Promise<string>
binVersion('openssl', { args: ['version'] });

14
types/bin-version/index.d.ts vendored Normal file
View File

@ -0,0 +1,14 @@
// Type definitions for bin-version 3.0
// Project: https://github.com/sindresorhus/bin-version#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = binVersion;
declare function binVersion(binary: string, options?: binVersion.Options): Promise<string>;
declare namespace binVersion {
interface Options {
args?: string[];
}
}

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"bin-version-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -93,3 +93,28 @@ const parser5 = new Parser()
length: '4',
formatter: (arr) => { }
});
const parser6 = new Parser()
.nest("nested", {
type: new Parser()
.array("points", {
type: new Parser()
.uint8("x")
.uint8("y"),
length: 2
})
})
.choice("optional", {
tag: "nested.points[0].x",
choices: {
1: new Parser()
.uint8("number")
}
});
const result = parser6.parse(Buffer.from([0x01, 0x02, 0x03, 0x04, 0x05]));
// See the inferred static types on the IntelliSense.
result.nested.points[0].x;
result.nested.points[1].y;
result.optional.number;

View File

@ -1,88 +1,117 @@
// Type definitions for binary-parser 1.3
// Project: https://github.com/keichi/binary-parser
// Definitions by: Benjamin Riggs <https://github.com/riggs>, Dolan Miu <https://github.com/dolanmiu>
// Definitions by: Benjamin Riggs <https://github.com/riggs>,
// Dolan Miu <https://github.com/dolanmiu>,
// Yu Shimura <https://github.com/yuhr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
/// <reference types="node" />
export interface Parser {
parse(buffer: Buffer, callback?: (err?: Error, result?: any) => void): Parser.Parsed;
export interface Parser<O extends object | undefined = undefined> {
parse(buffer: Buffer, callback?: (err?: Error, result?: any) => void): Parser.Parsed<O>;
create(constructorFunction: ObjectConstructor): Parser;
int8(name: string, options?: Parser.Options): Parser;
uint8(name: string, options?: Parser.Options): Parser;
int8<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
uint8<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
int16(name: string, options?: Parser.Options): Parser;
uint16(name: string, options?: Parser.Options): Parser;
int16le(name: string, options?: Parser.Options): Parser;
int16be(name: string, options?: Parser.Options): Parser;
uint16le(name: string, options?: Parser.Options): Parser;
uint16be(name: string, options?: Parser.Options): Parser;
int16<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
uint16<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
int16le<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
int16be<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
uint16le<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
uint16be<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
int32(name: string, options?: Parser.Options): Parser;
uint32(name: string, options?: Parser.Options): Parser;
int32le(name: string, options?: Parser.Options): Parser;
int32be(name: string, options?: Parser.Options): Parser;
uint32le(name: string, options?: Parser.Options): Parser;
uint32be(name: string, options?: Parser.Options): Parser;
int32<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
uint32<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
int32le<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
int32be<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
uint32le<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
uint32be<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit1(name: string, options?: Parser.Options): Parser;
bit2(name: string, options?: Parser.Options): Parser;
bit3(name: string, options?: Parser.Options): Parser;
bit4(name: string, options?: Parser.Options): Parser;
bit5(name: string, options?: Parser.Options): Parser;
bit6(name: string, options?: Parser.Options): Parser;
bit7(name: string, options?: Parser.Options): Parser;
bit8(name: string, options?: Parser.Options): Parser;
bit9(name: string, options?: Parser.Options): Parser;
bit10(name: string, options?: Parser.Options): Parser;
bit11(name: string, options?: Parser.Options): Parser;
bit12(name: string, options?: Parser.Options): Parser;
bit13(name: string, options?: Parser.Options): Parser;
bit14(name: string, options?: Parser.Options): Parser;
bit15(name: string, options?: Parser.Options): Parser;
bit16(name: string, options?: Parser.Options): Parser;
bit17(name: string, options?: Parser.Options): Parser;
bit18(name: string, options?: Parser.Options): Parser;
bit19(name: string, options?: Parser.Options): Parser;
bit20(name: string, options?: Parser.Options): Parser;
bit21(name: string, options?: Parser.Options): Parser;
bit22(name: string, options?: Parser.Options): Parser;
bit23(name: string, options?: Parser.Options): Parser;
bit24(name: string, options?: Parser.Options): Parser;
bit25(name: string, options?: Parser.Options): Parser;
bit26(name: string, options?: Parser.Options): Parser;
bit27(name: string, options?: Parser.Options): Parser;
bit28(name: string, options?: Parser.Options): Parser;
bit29(name: string, options?: Parser.Options): Parser;
bit30(name: string, options?: Parser.Options): Parser;
bit31(name: string, options?: Parser.Options): Parser;
bit32(name: string, options?: Parser.Options): Parser;
bit1<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit2<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit3<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit4<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit5<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit6<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit7<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit8<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit9<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit10<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit11<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit12<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit13<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit14<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit15<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit16<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit17<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit18<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit19<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit20<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit21<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit22<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit23<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit24<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit25<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit26<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit27<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit28<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit29<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit30<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit31<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
bit32<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
float(name: string, options?: Parser.Options): Parser;
floatle(name: string, options?: Parser.Options): Parser;
floatbe(name: string, options?: Parser.Options): Parser;
float<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
floatle<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
floatbe<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
double(name: string, options?: Parser.Options): Parser;
doublele(name: string, options?: Parser.Options): Parser;
doublebe(name: string, options?: Parser.Options): Parser;
double<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
doublele<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
doublebe<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
string(name: string, options?: Parser.StringOptions): Parser;
string<N extends string>(name: N, options?: Parser.StringOptions): Parser.Next<O, N, string>;
buffer(name: string, options: Parser.BufferOptions): Parser;
buffer<N extends string>(name: N, options: Parser.BufferOptions): Parser.Next<O, N, Buffer>;
array(name: string, options: Parser.ArrayOptions): Parser;
array<N extends string, Q extends Parser.ArrayOptions>(name: N, options: Q): Parser.Next<O, N,
Q extends { type: infer T }
? T extends Parser<infer O>
? O extends undefined ? Array<{}> : O[]
: T extends string
? number[]
: never
: never
>;
choice(name: string, options: Parser.ChoiceOptions): Parser;
choice<N extends string, Q extends Parser.ChoiceOptions>(name: N, options: Q): Parser.Next<O, N,
Q extends {
choices: infer C
}
? C extends {
[key in keyof C]: infer T
}
? T extends Parser<infer O>
? O extends undefined ? {} : O
: T extends string ? any : never
: never
: never
>;
nest(name: string, options: Parser.NestOptions): Parser;
nest<N extends string, Q extends Parser.NestOptions>(name: N, options: Q): Parser.Next<O, N,
Q extends { type: infer T }
? T extends Parser<infer O>
? O extends undefined ? {} : O
: never
: never
>;
skip(length: number): Parser;
skip(length: number): Parser<O>;
endianess(endianess: Parser.Endianness): Parser; /* [sic] */
endianess(endianess: Parser.Endianness): Parser<O>; /* [sic] */
namely(alias: string): Parser;
namely(alias: string): Parser<O>;
compile(): void;
@ -96,10 +125,8 @@ export interface ParserConstructor {
export const Parser: ParserConstructor;
export namespace Parser {
type Data = number | string | Array<number | Parsed> | Parsed | Buffer;
interface Parsed {
[name: string]: Data;
}
type Data = number | string | Array<number | Parser<any>> | Parser<any> | Buffer;
type Parsed<O extends object | undefined> = O extends undefined ? {} : O;
interface Options {
formatter?: ((value: Data) => any);
@ -108,7 +135,7 @@ export namespace Parser {
interface StringOptions extends Options {
encoding?: string;
length?: number | string | ((this: Parsed) => number);
length?: number | string | ((this: Parser<any>) => number);
zeroTerminated?: boolean;
greedy?: boolean;
stripNull?: boolean;
@ -116,32 +143,34 @@ export namespace Parser {
interface BufferOptions extends Options {
clone?: boolean;
length?: number | string | ((this: Parsed) => number);
length?: number | string | ((this: Parser<any>) => number);
readUntil?: string | ((item: number, buffer: Buffer) => boolean);
}
interface ArrayOptions extends Options {
type: string | Parser;
length?: number | string | ((this: Parsed) => number);
lengthInBytes?: number | string | ((this: Parsed) => number);
type: string | Parser<any>;
length?: number | string | ((this: Parser<any>) => number);
lengthInBytes?: number | string | ((this: Parser<any>) => number);
readUntil?: string | ((item: number, buffer: Buffer) => boolean);
}
interface ChoiceOptions extends Options {
tag: string | ((this: Parsed) => number);
choices: { [item: number]: Parser | string };
defaultChoice?: Parser | string;
tag: string | ((this: Parser<any>) => number);
choices: { [item: number]: Parser<any> | string };
defaultChoice?: Parser<any> | string;
}
interface NestOptions extends Options {
type: Parser | string;
type: Parser<any>;
}
type Endianness =
'little' |
'big';
interface Context {
[name: string]: Parsed;
}
type Valid<O extends object | undefined, P extends object> =
O extends undefined ? P : O & P;
type Next<O extends object | undefined, N extends string, T extends any> =
Parser<Valid<O, { [name in N]: T }>>;
}

View File

@ -17,7 +17,7 @@ export const wordlists: {
spanish: string[];
};
export function entropyToMnemonic(entropyHex: string, wordlist?: string[]): string;
export function entropyToMnemonic(entropyHex: Buffer | string, wordlist?: string[]): string;
export function generateMnemonic(strength?: number, rng?: (size: number) => Buffer, wordlist?: string[]): string;

View File

@ -1,10 +1,8 @@
'use strict';
import xor = require('bitwise-xor');
"use strict";
let b: Buffer;
import xor = require("bitwise-xor");
var b: Buffer;
b = xor("a", "b");
b = xor(new Buffer("a"), new Buffer("b"));
b = xor('a', 'b');
b = xor(new Buffer('a'), new Buffer('b'));

View File

@ -1,15 +1,14 @@
// Type definitions for bitwise-xor 0.0.0
// Type definitions for bitwise-xor 0.0
// Project: https://github.com/czzarr/node-bitwise-xor
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
// BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
/**
* Bitwise XOR between two Buffers or Strings, returns a Buffer
*/
declare function xor(b1: Buffer, b2: Buffer): Buffer;
declare function xor(s1: string, s2: string): Buffer;
declare function xor(a: Buffer | string, b: Buffer | string): Buffer;
export = xor;

View File

@ -6,7 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
@ -20,4 +20,4 @@
"index.d.ts",
"bitwise-xor-tests.ts"
]
}
}

View File

@ -1,79 +1,3 @@
{
"extends": "dtslint/dt.json",
"rules": {
"adjacent-overload-signatures": false,
"array-type": false,
"arrow-return-shorthand": false,
"ban-types": false,
"callable-types": false,
"comment-format": false,
"dt-header": false,
"eofline": false,
"export-just-namespace": false,
"import-spacing": false,
"interface-name": false,
"interface-over-type-literal": false,
"jsdoc-format": false,
"max-line-length": false,
"member-access": false,
"new-parens": false,
"no-any-union": false,
"no-boolean-literal-compare": false,
"no-conditional-assignment": false,
"no-consecutive-blank-lines": false,
"no-construct": false,
"no-declare-current-package": false,
"no-duplicate-imports": false,
"no-duplicate-variable": false,
"no-empty-interface": false,
"no-for-in-array": false,
"no-inferrable-types": false,
"no-internal-module": false,
"no-irregular-whitespace": false,
"no-mergeable-namespace": false,
"no-misused-new": false,
"no-namespace": false,
"no-object-literal-type-assertion": false,
"no-padding": false,
"no-redundant-jsdoc": false,
"no-redundant-jsdoc-2": false,
"no-redundant-undefined": false,
"no-reference-import": false,
"no-relative-import-in-test": false,
"no-self-import": false,
"no-single-declare-module": false,
"no-string-throw": false,
"no-unnecessary-callback-wrapper": false,
"no-unnecessary-class": false,
"no-unnecessary-generics": false,
"no-unnecessary-qualifier": false,
"no-unnecessary-type-assertion": false,
"no-useless-files": false,
"no-var-keyword": false,
"no-var-requires": false,
"no-void-expression": false,
"no-trailing-whitespace": false,
"object-literal-key-quotes": false,
"object-literal-shorthand": false,
"one-line": false,
"one-variable-per-declaration": false,
"only-arrow-functions": false,
"prefer-conditional-expression": false,
"prefer-const": false,
"prefer-declare-function": false,
"prefer-for-of": false,
"prefer-method-signature": false,
"prefer-template": false,
"radix": false,
"semicolon": false,
"space-before-function-paren": false,
"space-within-parens": false,
"strict-export-declare-modifiers": false,
"trim-file": false,
"triple-equals": false,
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
}
"extends": "dtslint/dt.json"
}

View File

@ -35,7 +35,8 @@
* THE SOFTWARE.
*/
type CatchFilter<E> = (new (...args: any[]) => E) | ((error: E) => boolean) | (object & E);
type Constructor<E> = new (...args: any[]) => E;
type CatchFilter<E> = ((error: E) => boolean) | (object & E);
type IterableItem<R> = R extends Iterable<infer U> ? U : never;
type IterableOrNever<R> = Extract<R, Iterable<any>>;
type Resolvable<R> = R | PromiseLike<R>;
@ -85,69 +86,74 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
*
* Alias `.caught();` for compatibility with earlier ECMAScript version.
*/
catch<E1, E2, E3, E4, E5>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
filter3: CatchFilter<E3>,
filter4: CatchFilter<E4>,
filter5: CatchFilter<E5>,
onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable<R>,
): Bluebird<R>;
catch<U, E1, E2, E3, E4, E5>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
filter3: CatchFilter<E3>,
filter4: CatchFilter<E4>,
filter5: CatchFilter<E5>,
filter1: Constructor<E1>,
filter2: Constructor<E2>,
filter3: Constructor<E3>,
filter4: Constructor<E4>,
filter5: Constructor<E5>,
onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable<U>,
): Bluebird<U | R>;
catch<E1, E2, E3, E4>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
filter3: CatchFilter<E3>,
filter4: CatchFilter<E4>,
onReject: (error: E1 | E2 | E3 | E4) => Resolvable<R>,
): Bluebird<R>;
catch<U, E1, E2, E3, E4, E5>(
filter1: Constructor<E1> | CatchFilter<E1>,
filter2: Constructor<E2> | CatchFilter<E2>,
filter3: Constructor<E3> | CatchFilter<E3>,
filter4: Constructor<E4> | CatchFilter<E4>,
filter5: Constructor<E5> | CatchFilter<E5>,
onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable<U>,
): Bluebird<U | R>;
catch<U, E1, E2, E3, E4>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
filter3: CatchFilter<E3>,
filter4: CatchFilter<E4>,
filter1: Constructor<E1>,
filter2: Constructor<E2>,
filter3: Constructor<E3>,
filter4: Constructor<E4>,
onReject: (error: E1 | E2 | E3 | E4) => Resolvable<U>,
): Bluebird<U | R>;
catch<U, E1, E2, E3, E4>(
filter1: Constructor<E1> | CatchFilter<E1>,
filter2: Constructor<E2> | CatchFilter<E2>,
filter3: Constructor<E3> | CatchFilter<E3>,
filter4: Constructor<E4> | CatchFilter<E4>,
onReject: (error: E1 | E2 | E3 | E4) => Resolvable<U>,
): Bluebird<U | R>;
catch<E1, E2, E3>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
filter3: CatchFilter<E3>,
onReject: (error: E1 | E2 | E3) => Resolvable<R>,
): Bluebird<R>;
catch<U, E1, E2, E3>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
filter3: CatchFilter<E3>,
filter1: Constructor<E1>,
filter2: Constructor<E2>,
filter3: Constructor<E3>,
onReject: (error: E1 | E2 | E3) => Resolvable<U>,
): Bluebird<U | R>;
catch<U, E1, E2, E3>(
filter1: Constructor<E1> | CatchFilter<E1>,
filter2: Constructor<E2> | CatchFilter<E2>,
filter3: Constructor<E3> | CatchFilter<E3>,
onReject: (error: E1 | E2 | E3) => Resolvable<U>,
): Bluebird<U | R>;
catch<E1, E2>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
onReject: (error: E1 | E2) => Resolvable<R>,
): Bluebird<R>;
catch<U, E1, E2>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
filter1: Constructor<E1>,
filter2: Constructor<E2>,
onReject: (error: E1 | E2) => Resolvable<U>,
): Bluebird<U | R>;
catch<U, E1, E2>(
filter1: Constructor<E1> | CatchFilter<E1>,
filter2: Constructor<E2> | CatchFilter<E2>,
onReject: (error: E1 | E2) => Resolvable<U>,
): Bluebird<U | R>;
catch<E1>(
filter1: CatchFilter<E1>,
onReject: (error: E1) => Resolvable<R>,
): Bluebird<R>;
catch<U, E1>(
filter1: CatchFilter<E1>,
filter1: Constructor<E1>,
onReject: (error: E1) => Resolvable<U>,
): Bluebird<U | R>;
catch<U, E1>(
// tslint:disable-next-line:unified-signatures
filter1: Constructor<E1> | CatchFilter<E1>,
onReject: (error: E1) => Resolvable<U>,
): Bluebird<U | R>;
@ -201,33 +207,64 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
tapCatch(onReject: (error?: any) => Resolvable<any>): Bluebird<R>;
tapCatch<E1, E2, E3, E4, E5>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
filter3: CatchFilter<E3>,
filter4: CatchFilter<E4>,
filter5: CatchFilter<E5>,
filter1: Constructor<E1>,
filter2: Constructor<E2>,
filter3: Constructor<E3>,
filter4: Constructor<E4>,
filter5: Constructor<E5>,
onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable<any>,
): Bluebird<R>;
tapCatch<E1, E2, E3, E4, E5>(
filter1: Constructor<E1> | CatchFilter<E1>,
filter2: Constructor<E2> | CatchFilter<E2>,
filter3: Constructor<E3> | CatchFilter<E3>,
filter4: Constructor<E4> | CatchFilter<E4>,
filter5: Constructor<E5> | CatchFilter<E5>,
onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable<any>,
): Bluebird<R>;
tapCatch<E1, E2, E3, E4>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
filter3: CatchFilter<E3>,
filter4: CatchFilter<E4>,
filter1: Constructor<E1>,
filter2: Constructor<E2>,
filter3: Constructor<E3>,
filter4: Constructor<E4>,
onReject: (error: E1 | E2 | E3 | E4) => Resolvable<any>,
): Bluebird<R>;
tapCatch<E1, E2, E3, E4>(
filter1: Constructor<E1> | CatchFilter<E1>,
filter2: Constructor<E2> | CatchFilter<E2>,
filter3: Constructor<E3> | CatchFilter<E3>,
filter4: Constructor<E4> | CatchFilter<E4>,
onReject: (error: E1 | E2 | E3 | E4) => Resolvable<any>,
): Bluebird<R>;
tapCatch<E1, E2, E3>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
filter3: CatchFilter<E3>,
filter1: Constructor<E1>,
filter2: Constructor<E2>,
filter3: Constructor<E3>,
onReject: (error: E1 | E2 | E3) => Resolvable<any>,
): Bluebird<R>;
tapCatch<E1, E2, E3>(
filter1: Constructor<E1> | CatchFilter<E1>,
filter2: Constructor<E2> | CatchFilter<E2>,
filter3: Constructor<E3> | CatchFilter<E3>,
onReject: (error: E1 | E2 | E3) => Resolvable<any>,
): Bluebird<R>;
tapCatch<E1, E2>(
filter1: CatchFilter<E1>,
filter2: CatchFilter<E2>,
filter1: Constructor<E1>,
filter2: Constructor<E2>,
onReject: (error: E1 | E2) => Resolvable<any>,
): Bluebird<R>;
tapCatch<E1, E2>(
filter1: Constructor<E1> | CatchFilter<E1>,
filter2: Constructor<E2> | CatchFilter<E2>,
onReject: (error: E1 | E2) => Resolvable<any>,
): Bluebird<R>;
tapCatch<E1>(
filter1: CatchFilter<E1>,
filter1: Constructor<E1>,
onReject: (error: E1) => Resolvable<any>,
): Bluebird<R>;
tapCatch<E1>(
// tslint:disable-next-line:unified-signatures
filter1: Constructor<E1> | CatchFilter<E1>,
onReject: (error: E1) => Resolvable<any>,
): Bluebird<R>;
@ -376,33 +413,64 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
// No need to be specific about Error types in these overrides, since there's no handler function
catchReturn<U>(
filter1: CatchFilter<Error>,
filter2: CatchFilter<Error>,
filter3: CatchFilter<Error>,
filter4: CatchFilter<Error>,
filter5: CatchFilter<Error>,
filter1: Constructor<Error>,
filter2: Constructor<Error>,
filter3: Constructor<Error>,
filter4: Constructor<Error>,
filter5: Constructor<Error>,
value: U,
): Bluebird<R | U>;
catchReturn<U>(
filter1: CatchFilter<Error>,
filter2: CatchFilter<Error>,
filter3: CatchFilter<Error>,
filter4: CatchFilter<Error>,
filter1: Constructor<Error> | CatchFilter<Error>,
filter2: Constructor<Error> | CatchFilter<Error>,
filter3: Constructor<Error> | CatchFilter<Error>,
filter4: Constructor<Error> | CatchFilter<Error>,
filter5: Constructor<Error> | CatchFilter<Error>,
value: U,
): Bluebird<R | U>;
catchReturn<U>(
filter1: CatchFilter<Error>,
filter2: CatchFilter<Error>,
filter3: CatchFilter<Error>,
filter1: Constructor<Error>,
filter2: Constructor<Error>,
filter3: Constructor<Error>,
filter4: Constructor<Error>,
value: U,
): Bluebird<R | U>;
catchReturn<U>(
filter1: CatchFilter<Error>,
filter2: CatchFilter<Error>,
filter1: Constructor<Error> | CatchFilter<Error>,
filter2: Constructor<Error> | CatchFilter<Error>,
filter3: Constructor<Error> | CatchFilter<Error>,
filter4: Constructor<Error> | CatchFilter<Error>,
value: U,
): Bluebird<R | U>;
catchReturn<U>(
filter1: CatchFilter<Error>,
filter1: Constructor<Error>,
filter2: Constructor<Error>,
filter3: Constructor<Error>,
value: U,
): Bluebird<R | U>;
catchReturn<U>(
filter1: Constructor<Error> | CatchFilter<Error>,
filter2: Constructor<Error> | CatchFilter<Error>,
filter3: Constructor<Error> | CatchFilter<Error>,
value: U,
): Bluebird<R | U>;
catchReturn<U>(
filter1: Constructor<Error>,
filter2: Constructor<Error>,
value: U,
): Bluebird<R | U>;
catchReturn<U>(
filter1: Constructor<Error> | CatchFilter<Error>,
filter2: Constructor<Error> | CatchFilter<Error>,
value: U,
): Bluebird<R | U>;
catchReturn<U>(
filter1: Constructor<Error>,
value: U,
): Bluebird<R | U>;
catchReturn<U>(
// tslint:disable-next-line:unified-signatures
filter1: Constructor<Error> | CatchFilter<Error>,
value: U,
): Bluebird<R | U>;
@ -420,33 +488,64 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
// No need to be specific about Error types in these overrides, since there's no handler function
catchThrow(
filter1: CatchFilter<Error>,
filter2: CatchFilter<Error>,
filter3: CatchFilter<Error>,
filter4: CatchFilter<Error>,
filter5: CatchFilter<Error>,
filter1: Constructor<Error>,
filter2: Constructor<Error>,
filter3: Constructor<Error>,
filter4: Constructor<Error>,
filter5: Constructor<Error>,
reason: Error,
): Bluebird<R>;
catchThrow(
filter1: CatchFilter<Error>,
filter2: CatchFilter<Error>,
filter3: CatchFilter<Error>,
filter4: CatchFilter<Error>,
filter1: Constructor<Error> | CatchFilter<Error>,
filter2: Constructor<Error> | CatchFilter<Error>,
filter3: Constructor<Error> | CatchFilter<Error>,
filter4: Constructor<Error> | CatchFilter<Error>,
filter5: Constructor<Error> | CatchFilter<Error>,
reason: Error,
): Bluebird<R>;
catchThrow(
filter1: CatchFilter<Error>,
filter2: CatchFilter<Error>,
filter3: CatchFilter<Error>,
filter1: Constructor<Error>,
filter2: Constructor<Error>,
filter3: Constructor<Error>,
filter4: Constructor<Error>,
reason: Error,
): Bluebird<R>;
catchThrow(
filter1: CatchFilter<Error>,
filter2: CatchFilter<Error>,
filter1: Constructor<Error> | CatchFilter<Error>,
filter2: Constructor<Error> | CatchFilter<Error>,
filter3: Constructor<Error> | CatchFilter<Error>,
filter4: Constructor<Error> | CatchFilter<Error>,
reason: Error,
): Bluebird<R>;
catchThrow(
filter1: CatchFilter<Error>,
filter1: Constructor<Error>,
filter2: Constructor<Error>,
filter3: Constructor<Error>,
reason: Error,
): Bluebird<R>;
catchThrow(
filter1: Constructor<Error> | CatchFilter<Error>,
filter2: Constructor<Error> | CatchFilter<Error>,
filter3: Constructor<Error> | CatchFilter<Error>,
reason: Error,
): Bluebird<R>;
catchThrow(
filter1: Constructor<Error>,
filter2: Constructor<Error>,
reason: Error,
): Bluebird<R>;
catchThrow(
filter1: Constructor<Error> | CatchFilter<Error>,
filter2: Constructor<Error> | CatchFilter<Error>,
reason: Error,
): Bluebird<R>;
catchThrow(
filter1: Constructor<Error>,
reason: Error,
): Bluebird<R>;
catchThrow(
// tslint:disable-next-line:unified-signatures
filter1: Constructor<Error> | CatchFilter<Error>,
reason: Error,
): Bluebird<R>;

View File

@ -42,7 +42,7 @@ $(() => {
$('#ex7').slider();
$('#ex7-enabled').click(function(this: HTMLInputElement) {
$<HTMLInputElement>('#ex7-enabled').click(function() {
if (this.checked) {
// With JQuery
$('#ex7').slider('enable');

View File

@ -1,3 +1,6 @@
{
"extends": "dtslint/dt.json"
"extends": "dtslint/dt.json",
"rules": {
"no-angle-bracket-type-assertion": false
}
}

View File

@ -322,7 +322,7 @@ export interface TooltipOption {
// Events
// --------------------------------------------------------------------------------------
export interface CarouselEventHandler<TElement> extends JQuery.Event<TElement, undefined> {
export interface CarouselEventHandler<TElement> extends JQuery.TriggeredEvent<TElement, undefined> {
/**
* The direction in which the carousel is sliding.
*/
@ -339,6 +339,10 @@ export interface CarouselEventHandler<TElement> extends JQuery.Event<TElement, u
to: number;
}
export interface TapEventHandler<TElement> extends JQuery.TriggeredEvent<TElement, undefined> {
relatedTarget: HTMLElement;
}
export type AlertEvent = "close.bs.alert" | "closed.bs.alert";
export type CarouselEvent = "slide.bs.carousel" | "slid.bs.carousel";
export type CollapseEvent = "show.bs.collapse" | "shown.bs.collapse" | "hide.bs.collapse" | "hidden.bs.collapse";
@ -383,9 +387,10 @@ declare global {
tooltip(options?: TooltipOption): this;
on(events: CarouselEvent, handler: JQuery.EventHandlerBase<TElement, CarouselEventHandler<TElement>>): this;
on(events: TapEvent, handler: JQuery.EventHandlerBase<TElement, TapEventHandler<TElement>>): this;
on(events:
AlertEvent | CollapseEvent | DropdownEvent | ModalEvent |
PopoverEvent | ScrollspyEvent | TapEvent | TooltipEvent,
PopoverEvent | ScrollspyEvent | TooltipEvent,
handler: JQuery.EventHandler<TElement>): this;
}
}

View File

@ -1,4 +1,4 @@
// Type definitions for bull 3.4
// Type definitions for bull 3.5
// Project: https://github.com/OptimalBits/bull
// Definitions by: Bruno Grieder <https://github.com/bgrieder>
// Cameron Crothers <https://github.com/JProgrammer>
@ -17,7 +17,6 @@
// TypeScript Version: 2.8
import * as Redis from "ioredis";
import * as Promise from "bluebird";
/**
* This is the Queue constructor.

View File

@ -0,0 +1,7 @@
import cachedPathRelative = require("cached-path-relative");
function browserifyTest() {
const file = "file.txt";
const m1: string = cachedPathRelative("./", file).replace(/\\/g, '/');
return m1;
}

13
types/cached-path-relative/index.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
// Type definitions for cached-path-relative 1.0
// Project: https://github.com/ashaffer/cached-path-relative
// Definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Memoize the results of the path.relative function. path.relative can be an expensive operation
* if it happens a lot, and its results shouldn't change for the same arguments.
* Use it just like your normal path.relative, but it's memoized.
*/
declare function cachedPathRelative(from: string, to: string): string;
export = cachedPathRelative;

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"cached-path-relative-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -0,0 +1,48 @@
import {
agents, features, feature, Agent, Feature, PackedFeature, StatsByAgentID, SupportStatusByVersion, SupportStatus
} from "caniuse-lite";
const chrome: Agent | undefined = agents.chrome;
if (chrome !== undefined) {
const browser: string = chrome.browser;
const prefix: string = chrome.prefix;
const prefixExceptions: any = chrome.prefix_exceptions;
const usageGlobal: { [version: string]: number | undefined } = chrome.usage_global;
const releaseDate: { [version: string]: number | undefined } = chrome.release_date;
const versions: Array<string | null> = chrome.versions;
consume(browser, prefix, prefixExceptions, usageGlobal, releaseDate, versions);
}
const unpackedFeatures = Object.keys(features).map((id: string) => {
const packed: PackedFeature = features[id];
const unpacked: Feature = feature(packed);
const status: string = unpacked.status;
const title: string = unpacked.title;
const stats: StatsByAgentID = unpacked.stats;
Object.keys(stats).forEach((agentID: string) => {
const byVersion: SupportStatusByVersion = stats[agentID];
Object.keys(byVersion).forEach(version => {
const supportStatus: SupportStatus = byVersion[version];
consume(supportStatus);
});
const supportStatusByVersion: SupportStatusByVersion = stats[agentID];
const agent: Agent = agents[agentID]!;
return {
feature: unpacked,
agent,
versions: Object.keys(supportStatusByVersion).map(version => {
return {
version,
releaseDate: agent.release_date[version],
[`feature_${id}`]: supportStatusByVersion[version]
};
})
};
});
});
function consume(...anything: any[]): void {
// ...
}

159
types/caniuse-lite/index.d.ts vendored Normal file
View File

@ -0,0 +1,159 @@
// Type definitions for caniuse-lite 1.0
// Project: https://github.com/ben-eb/caniuse-lite#readme
// Definitions by: Michael Utech <https://github.com/mutech>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/**
* Information about user agents (browsers, platforms) indexed by their ID.
*/
export const agents: AgentsByID;
/**
* Features index by their ID. The feature ID is a human readable identifier. The
* associated value is a packed version of information about the feature that
* can be unpacked using the function `feature(packed)`
*/
export const features: { [featureID: string]: PackedFeature; };
/**
* @param packedFeature a packed feature obtained from `features[key]` for some valid key.
* @return the unpacked information as `Feature`.
*/
export function feature(packedFeature: PackedFeature): Feature;
/**
* @param packedRegion a packed version of regional usage data by agent OD.
* @return the unpacked usage data indexed by agent ID and then version.
*/
export function region(packedRegion: PackedRegion): { [agentID: string]: UsageByVersion };
/**
* Agents indexed by their ID. .
*/
export type AgentsByID = Readonly<{ [id: string]: Readonly<Agent> | undefined }>;
/**
* Feature support status by version indexed by agent ID.
*/
export type StatsByAgentID = Readonly<{ [agentID: string]: SupportStatusByVersion }>;
/**
* Feature support status indexed by an agent's versions.
*/
export type SupportStatusByVersion = Readonly<{ [version: string]: SupportStatus }>;
/**
* Usage (percentage/market share) indexed by an agent's versions.
*/
export type UsageByVersion = Readonly<{ [version: string]: number | undefined }>;
/**
* The standardization status of a feature:
* * ls - WHATWG living standard
* * rec - W3C recommendation
* * pr - W3C proposed recommendation
* * cr - W3C candidate recommendation
* * wd - W3C working draft
* * other - Non-W3C, but reputable
* * unoff - Unofficial
*/
export type FeatureStatus = "ls" | "rec" | "pr" | "cr" | "wd" | "other" | "unoff" | string;
/**
* Encoded support status:
* * `n` - not supported
* * `p` - not supported, polyfill available
* * `u` - unknown
* * `a x` - partially supported, vendor prefix
* * `a` - partially supported
* * `y x` - fully supported, vendor prefix
* * `y` - fully supported
*
* The support status can additionally have one or more footnote references as `#<n>`, f.e.
* `a x #1 #3`.
*/
export type SupportStatus = 'n' | 'p' | 'u' | "a x" | 'a' | "y x" | 'y' | string;
/**
* Provides information about the Agent.
*/
export interface Agent {
/**
* Global agent usage by version
*/
usage_global: UsageByVersion;
/**
* The agents vendor prefix
*/
prefix: string;
/**
* Version matrix. See [caniuse](https://caniuse.com)
*/
versions: [ // Tuple of 70 version slots:
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null,
string|null, string|null, string|null, string|null, string|null ];
/**
* The agent's name
*/
browser: string;
/**
* Release dates as seconds since epoch by version.
*/
release_date: { [version: string]: number | undefined };
/**
* Exceptions to vendor prefix use.
*/
prefix_exceptions?: { [version: string]: string | undefined };
}
/**
* Specifies a feature and its support status in all known agent versions.
*/
export interface Feature {
/**
* Specification status of the feature.
*/
status: FeatureStatus;
/**
* Descriptive title of the feature.
*/
title: string;
/**
* Agent support matrix for this feature.
*/
stats: StatsByAgentID;
}
/**
* A space optimized version of Feature that can be unpacked using `feature(PackedFeature)`.
*/
export interface PackedFeature {
[encodedKey: string]: any;
}
/**
* A space optimized version of Region that can be unpacked using `region(PackedFeature)`.
*/
export interface PackedRegion {
[encodedKey: string]: any;
}

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"caniuse-lite-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -0,0 +1,12 @@
import * as cfn from "cfn-response";
import { CloudFormationCustomResourceEvent, Context } from "aws-lambda";
declare const event: CloudFormationCustomResourceEvent;
declare const context: Context;
// $ExpectType void
cfn.send(event, context, cfn.SUCCESS, { sample: 123 }, "abc");
// $ExpectType void
cfn.send(event, context, "SUCCESS");
// $ExpectError
cfn.send(event, context, "", {});

19
types/cfn-response/index.d.ts vendored Normal file
View File

@ -0,0 +1,19 @@
// Type definitions for cfn-response 1.0
// Project: https://github.com/LukeMizuhashi/cfn-response
// Definitions by: Ivo Murrell <https://github.com/ivoisbelongtous>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { CloudFormationCustomResourceEvent, Context } from "aws-lambda";
export type ResponseStatus = "SUCCESS" | "FAILED";
export const SUCCESS: ResponseStatus;
export const FAILED: ResponseStatus;
export function send(
event: CloudFormationCustomResourceEvent,
context: Context,
responseStatus: ResponseStatus,
responseData?: object,
physicalResourceId?: string
): void;

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"cfn-response-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -0,0 +1,32 @@
import { expect, use } from 'chai';
import chaiAlmost = require('chai-almost');
// Normally, call use(chaiAlmost(...)) only once, this is just to check that TypeScript correctly handles both.
use(chaiAlmost(0.01)); // custom tolerance 0.01
use(chaiAlmost()); // default tolerance 1e-6 (= 0.000001)
expect(1.0000001).to.almost.equal(1);
expect(1.0000001).to.be.almost(1);
expect(1.0000001).almost.equals(1);
expect(1.0001).to.not.almost.equal(1);
expect(1.0001).to.not.be.almost(1);
expect(1.0001).not.almost.equals(1);
// Note the "not" in the following.
// Use deep equality checks to compare values inside of arrays and objects.
expect([1]).to.not.be.almost([1]);
const arrA = [1, [{ num: 2, name: "Douglas" }, 3]];
const arrB = [1.0000001, [{ num: 1.9999999, name: "Douglas" }, 2.9999996]];
expect(arrA).to.deep.almost.equal(arrB);
expect(arrA).to.be.deep.almost(arrB);
expect(arrA).deep.almost.equals(arrB);
expect(arrA).to.almost.eql(arrB);
expect(arrA).to.be.almost.eql(arrB);
expect(arrA).almost.eqls(arrB);
expect(1.001).to.be.almost(1, 0.01);
expect(1.001).to.not.be.almost(1, 0.0001);
expect([42]).to.be.deep.almost([42.3145], 0.5);

33
types/chai-almost/index.d.ts vendored Normal file
View File

@ -0,0 +1,33 @@
// Type definitions for chai-almost 1.0
// Project: https://github.com/nmuldavin/chai-almost#readme
// Definitions by: Lennard Schulz <https://github.com/kclnn>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="chai" />
declare global {
namespace Chai {
interface Assertion {
almost: ChaiAlmost.Almost;
}
interface Deep {
almost: ChaiAlmost.DeepAlmost;
}
namespace ChaiAlmost {
interface DeepAlmost {
(value: any, toleranceOverride?: number): Assertion;
equal: Equal;
equals: Equal;
eq: Equal;
}
interface Almost extends DeepAlmost {
eql: Equal;
eqls: Equal;
}
}
}
}
declare function chaiAlmost(tolerance?: number): ((chai: any, utils: any) => void);
export = chaiAlmost;

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"chai-almost-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -0,0 +1,21 @@
import * as chalkAnimation from 'chalk-animation';
const rainbow: chalkAnimation.Animation = chalkAnimation.rainbow('Lorem ipsum dolor sit amet');
chalkAnimation.rainbow('Lorem ipsum dolor sit amet', 2);
chalkAnimation.pulse('Lorem ipsum dolor sit amet');
chalkAnimation.pulse('Lorem ipsum dolor sit amet', 2);
chalkAnimation.glitch('Lorem ipsum dolor sit amet');
chalkAnimation.glitch('Lorem ipsum dolor sit amet', 2);
chalkAnimation.radar('Lorem ipsum dolor sit amet');
chalkAnimation.radar('Lorem ipsum dolor sit amet', 2);
chalkAnimation.neon('Lorem ipsum dolor sit amet');
chalkAnimation.neon('Lorem ipsum dolor sit amet', 2);
chalkAnimation.karaoke('Lorem ipsum dolor sit amet');
chalkAnimation.karaoke('Lorem ipsum dolor sit amet', 2);
rainbow.stop();
rainbow.start();
rainbow.replace('.');
rainbow.render();
// $ExpectType string
rainbow.frame();

21
types/chalk-animation/index.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
// Type definitions for chalk-animation 1.6
// Project: https://github.com/bokub/chalk-animation
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export const rainbow: AnimationFn;
export const pulse: AnimationFn;
export const glitch: AnimationFn;
export const radar: AnimationFn;
export const neon: AnimationFn;
export const karaoke: AnimationFn;
export type AnimationFn = (text: string, speed?: number) => Animation;
export interface Animation {
start(): void;
stop(): void;
replace(text: string): void;
render(): void;
frame(): string;
}

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"chalk-animation-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@ -9,7 +9,9 @@ const plugin = {
}
};
const chart: Chart = new Chart(new CanvasRenderingContext2D(), {
const ctx = new CanvasRenderingContext2D();
const chart: Chart = new Chart(ctx, {
type: "bar",
plugins: [plugin, plugin],
data: {
@ -17,6 +19,8 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), {
datasets: [
{
backgroundColor: "#000000",
hoverBackgroundColor: ctx.createLinearGradient(0, 0, 0, 100),
hoverBorderColor: ctx.createLinearGradient(0, 0, 0, 100),
borderWidth: 1,
label: "test",
data: [1, null, 3]

View File

@ -554,8 +554,8 @@ declare namespace Chart {
borderSkipped?: PositionType;
data?: Array<number | null | undefined> | ChartPoint[];
fill?: boolean | number | string;
hoverBackgroundColor?: string | string[];
hoverBorderColor?: string | string[];
hoverBackgroundColor?: ChartColor | ChartColor[];
hoverBorderColor?: ChartColor | ChartColor[];
hoverBorderWidth?: number | number[];
label?: string;
lineTension?: number;

View File

@ -1,92 +1,89 @@
import { Break, BreakClip } from "./cast.framework.messages";
export = cast.framework.breaks;
export as namespace breaks
export class BreakSeekData {
constructor(seekFrom: number, seekTo: number, breaks: Break[]);
declare namespace cast.framework.breaks {
class BreakSeekData {
constructor(seekFrom: number, seekTo: number, breaks: Break[]);
/**
* List of breaks
*/
breaks: Break[];
/**
* List of breaks
*/
breaks: Break[];
/**
* Current playback time
*/
seekFrom: number;
/**
* Current playback time
*/
seekFrom: number;
/**
* The time to seek to
*/
seekTo: number;
}
/** Provide context information for break clip load interceptor. */
class BreakClipLoadInterceptorContext {
constructor(brk: Break);
/**
* The container break for the break clip
*/
break: Break;
}
/** Interface to manage breaks */
interface BreakManager {
/**
* Get current media break by id.
*/
getBreakById(id: string): Break;
/**
* Get current media break clip by id
*/
getBreakClipById(id: string): BreakClip;
/** Get current media break clips. */
getBreakClips(): BreakClip[];
/** Get current media breaks. */
getBreaks(): Break[];
/** Returns true if watched breaks should be played. */
getPlayWatchedBreak(): boolean;
/**
* Provide an interceptor to allow developer to insert more break clips or modify current break clip before a break is started.
* If interceptor is null it will reset the interceptor to default one.
* By default VAST fetching and parsing logic in default interceptor.
* So if customized interceptor is set by developer;
* the VAST logic will be overridden and developers should implement their own VAST fetching and parsing logic in the provided interceptor.
*/
setBreakClipLoadInterceptor(
interceptor: (
breakClip: BreakClip,
breakClipLoaderContext?: BreakClipLoadInterceptorContext
) => void
): void;
/**
* Provide an interceptor for developer to specify what breaks they want to play after seek.
*/
setBreakSeekInterceptor(
seekInterceptor: (breakSeekData: BreakSeekData) => void
): void;
/**
* Set a flag to control if the watched client stitching break should be played.
*/
setPlayWatchedBreak(playWatchedBreak: boolean): void;
/**
* Provide an interceptor to modify VAST tracking URL before it is being sent to server.
* The input of the interceptor is a string of the tracking URL.
* The interceptor can either return a modified string of URL or a Promise of modified string of URL.
* The interceptor can also return null if you want to send the tracking URL by your own code instead of by CAF.
*/
setVastTrackingInterceptor(
interceptor?: (trackingUrl: string) => void
): void;
}
/**
* The time to seek to
*/
seekTo: number;
}
/** Provide context information for break clip load interceptor. */
export class BreakClipLoadInterceptorContext {
constructor(brk: Break);
/**
* The container break for the break clip
*/
break: Break;
}
/** Interface to manage breaks */
export interface BreakManager {
/**
* Get current media break by id.
*/
getBreakById(id: string): Break;
/**
* Get current media break clip by id
*/
getBreakClipById(id: string): BreakClip;
/** Get current media break clips. */
getBreakClips(): BreakClip[];
/** Get current media breaks. */
getBreaks(): Break[];
/** Returns true if watched breaks should be played. */
getPlayWatchedBreak(): boolean;
/**
* Provide an interceptor to allow developer to insert more break clips or modify current break clip before a break is started.
* If interceptor is null it will reset the interceptor to default one.
* By default VAST fetching and parsing logic in default interceptor.
* So if customized interceptor is set by developer;
* the VAST logic will be overridden and developers should implement their own VAST fetching and parsing logic in the provided interceptor.
*/
setBreakClipLoadInterceptor(
interceptor: (
breakClip: BreakClip,
breakClipLoaderContext?: BreakClipLoadInterceptorContext
) => void
): void;
/**
* Provide an interceptor for developer to specify what breaks they want to play after seek.
*/
setBreakSeekInterceptor(
seekInterceptor: (breakSeekData: BreakSeekData) => void
): void;
/**
* Set a flag to control if the watched client stitching break should be played.
*/
setPlayWatchedBreak(playWatchedBreak: boolean): void;
/**
* Provide an interceptor to modify VAST tracking URL before it is being sent to server.
* The input of the interceptor is a string of the tracking URL.
* The interceptor can either return a modified string of URL or a Promise of modified string of URL.
* The interceptor can also return null if you want to send the tracking URL by your own code instead of by CAF.
*/
setVastTrackingInterceptor(
interceptor?: (trackingUrl: string) => void
): void;
}

File diff suppressed because it is too large Load Diff

View File

@ -4,423 +4,421 @@ import {
Track,
MediaStatus
} from "./cast.framework.messages";
export = cast.framework.events;
declare namespace cast.framework.events {
type EventType =
| "ALL"
| "ABORT"
| "CAN_PLAY"
| "CAN_PLAY_THROUGH"
| "DURATION_CHANGE"
| "EMPTIED"
| "ENDED"
| "LOADED_DATA"
| "LOADED_METADATA"
| "LOAD_START"
| "PAUSE"
| "PLAY"
| "PLAYING"
| "PROGRESS"
| "RATE_CHANGE"
| "SEEKED"
| "SEEKING"
| "STALLED"
| "TIME_UPDATE"
| "SUSPEND"
| "WAITING"
| "BITRATE_CHANGED"
| "BREAK_STARTED"
| "BREAK_ENDED"
| "BREAK_CLIP_LOADING"
| "BREAK_CLIP_STARTED"
| "BREAK_CLIP_ENDED"
| "BUFFERING"
| "CACHE_LOADED"
| "CACHE_HIT"
| "CACHE_INSERTED"
| "CLIP_STARTED"
| "CLIP_ENDED"
| "EMSG"
| "ERROR"
| "ID3"
| "MEDIA_STATUS"
| "MEDIA_FINISHED"
| "PLAYER_PRELOADING"
| "PLAYER_PRELOADING_CANCELLED"
| "PLAYER_LOAD_COMPLETE"
| "PLAYER_LOADING"
| "SEGMENT_DOWNLOADED"
| "REQUEST_SEEK"
| "REQUEST_LOAD"
| "REQUEST_STOP"
| "REQUEST_PAUSE"
| "REQUEST_PLAY"
| "REQUEST_PLAY_AGAIN"
| "REQUEST_PLAYBACK_RATE_CHANGE"
| "REQUEST_SKIP_AD"
| "REQUEST_VOLUME_CHANGE"
| "REQUEST_EDIT_TRACKS_INFO"
| "REQUEST_EDIT_AUDIO_TRACKS"
| "REQUEST_SET_CREDENTIALS"
| "REQUEST_LOAD_BY_ENTITY"
| "REQUEST_USER_ACTION"
| "REQUEST_DISPLAY_STATUS"
| "REQUEST_CUSTOM_COMMAND"
| "REQUEST_FOCUS_STATE"
| "REQUEST_QUEUE_LOAD"
| "REQUEST_QUEUE_INSERT"
| "REQUEST_QUEUE_UPDATE"
| "REQUEST_QUEUE_REMOVE"
| "REQUEST_QUEUE_REORDER"
| "REQUEST_QUEUE_GET_ITEM_RANGE"
| "REQUEST_QUEUE_GET_ITEMS"
| "REQUEST_QUEUE_GET_ITEM_IDS"
| "REQUEST_PRECACHE";
export as namespace events
export type EventType =
| "ALL"
| "ABORT"
| "CAN_PLAY"
| "CAN_PLAY_THROUGH"
| "DURATION_CHANGE"
| "EMPTIED"
| "ENDED"
| "LOADED_DATA"
| "LOADED_METADATA"
| "LOAD_START"
| "PAUSE"
| "PLAY"
| "PLAYING"
| "PROGRESS"
| "RATE_CHANGE"
| "SEEKED"
| "SEEKING"
| "STALLED"
| "TIME_UPDATE"
| "SUSPEND"
| "WAITING"
| "BITRATE_CHANGED"
| "BREAK_STARTED"
| "BREAK_ENDED"
| "BREAK_CLIP_LOADING"
| "BREAK_CLIP_STARTED"
| "BREAK_CLIP_ENDED"
| "BUFFERING"
| "CACHE_LOADED"
| "CACHE_HIT"
| "CACHE_INSERTED"
| "CLIP_STARTED"
| "CLIP_ENDED"
| "EMSG"
| "ERROR"
| "ID3"
| "MEDIA_STATUS"
| "MEDIA_FINISHED"
| "PLAYER_PRELOADING"
| "PLAYER_PRELOADING_CANCELLED"
| "PLAYER_LOAD_COMPLETE"
| "PLAYER_LOADING"
| "SEGMENT_DOWNLOADED"
| "REQUEST_SEEK"
| "REQUEST_LOAD"
| "REQUEST_STOP"
| "REQUEST_PAUSE"
| "REQUEST_PLAY"
| "REQUEST_PLAY_AGAIN"
| "REQUEST_PLAYBACK_RATE_CHANGE"
| "REQUEST_SKIP_AD"
| "REQUEST_VOLUME_CHANGE"
| "REQUEST_EDIT_TRACKS_INFO"
| "REQUEST_EDIT_AUDIO_TRACKS"
| "REQUEST_SET_CREDENTIALS"
| "REQUEST_LOAD_BY_ENTITY"
| "REQUEST_USER_ACTION"
| "REQUEST_DISPLAY_STATUS"
| "REQUEST_CUSTOM_COMMAND"
| "REQUEST_FOCUS_STATE"
| "REQUEST_QUEUE_LOAD"
| "REQUEST_QUEUE_INSERT"
| "REQUEST_QUEUE_UPDATE"
| "REQUEST_QUEUE_REMOVE"
| "REQUEST_QUEUE_REORDER"
| "REQUEST_QUEUE_GET_ITEM_RANGE"
| "REQUEST_QUEUE_GET_ITEMS"
| "REQUEST_QUEUE_GET_ITEM_IDS"
| "REQUEST_PRECACHE";
type DetailedErrorCode =
| "MEDIA_UNKNOWN"
| "MEDIA_ABORTED"
| "MEDIA_DECODE"
| "MEDIA_NETWORK"
| "MEDIA_SRC_NOT_SUPPORTED"
| "SOURCE_BUFFER_FAILURE"
| "MEDIAKEYS_UNKNOWN"
| "MEDIAKEYS_NETWORK"
| "MEDIAKEYS_UNSUPPORTED"
| "MEDIAKEYS_WEBCRYPTO"
| "NETWORK_UNKNOWN"
| "SEGMENT_NETWORK"
| "HLS_NETWORK_MASTER_PLAYLIST"
| "HLS_NETWORK_PLAYLIST"
| "HLS_NETWORK_NO_KEY_RESPONSE"
| "HLS_NETWORK_KEY_LOAD"
| "HLS_NETWORK_INVALID_SEGMENT"
| "HLS_SEGMENT_PARSING"
| "DASH_NETWORK"
| "DASH_NO_INIT"
| "SMOOTH_NETWORK"
| "SMOOTH_NO_MEDIA_DATA"
| "MANIFEST_UNKNOWN"
| "HLS_MANIFEST_MASTER"
| "HLS_MANIFEST_PLAYLIST"
| "DASH_MANIFEST_UNKNOWN"
| "DASH_MANIFEST_NO_PERIODS"
| "DASH_MANIFEST_NO_MIMETYPE"
| "DASH_INVALID_SEGMENT_INFO"
| "SMOOTH_MANIFEST"
| "SEGMENT_UNKNOWN"
| "TEXT_UNKNOWN"
| "APP"
| "BREAK_CLIP_LOADING_ERROR"
| "BREAK_SEEK_INTERCEPTOR_ERROR"
| "IMAGE_ERROR"
| "LOAD_INTERRUPTED"
| "GENERIC";
export type DetailedErrorCode =
| "MEDIA_UNKNOWN"
| "MEDIA_ABORTED"
| "MEDIA_DECODE"
| "MEDIA_NETWORK"
| "MEDIA_SRC_NOT_SUPPORTED"
| "SOURCE_BUFFER_FAILURE"
| "MEDIAKEYS_UNKNOWN"
| "MEDIAKEYS_NETWORK"
| "MEDIAKEYS_UNSUPPORTED"
| "MEDIAKEYS_WEBCRYPTO"
| "NETWORK_UNKNOWN"
| "SEGMENT_NETWORK"
| "HLS_NETWORK_MASTER_PLAYLIST"
| "HLS_NETWORK_PLAYLIST"
| "HLS_NETWORK_NO_KEY_RESPONSE"
| "HLS_NETWORK_KEY_LOAD"
| "HLS_NETWORK_INVALID_SEGMENT"
| "HLS_SEGMENT_PARSING"
| "DASH_NETWORK"
| "DASH_NO_INIT"
| "SMOOTH_NETWORK"
| "SMOOTH_NO_MEDIA_DATA"
| "MANIFEST_UNKNOWN"
| "HLS_MANIFEST_MASTER"
| "HLS_MANIFEST_PLAYLIST"
| "DASH_MANIFEST_UNKNOWN"
| "DASH_MANIFEST_NO_PERIODS"
| "DASH_MANIFEST_NO_MIMETYPE"
| "DASH_INVALID_SEGMENT_INFO"
| "SMOOTH_MANIFEST"
| "SEGMENT_UNKNOWN"
| "TEXT_UNKNOWN"
| "APP"
| "BREAK_CLIP_LOADING_ERROR"
| "BREAK_SEEK_INTERCEPTOR_ERROR"
| "IMAGE_ERROR"
| "LOAD_INTERRUPTED"
| "GENERIC";
type EndedReason =
| "END_OF_STREAM"
| "ERROR"
| "STOPPED"
| "INTERRUPTED"
| "SKIPPED"
| "BREAK_SWITCH";
export type EndedReason =
| "END_OF_STREAM"
| "ERROR"
| "STOPPED"
| "INTERRUPTED"
| "SKIPPED"
| "BREAK_SWITCH";
/**
* Event data for @see{@link EventType.SEGMENT_DOWNLOADED} event.
*/
export class SegmentDownloadedEvent extends Event {
constructor(downloadTime?: number, size?: number);
/**
* Event data for @see{@link EventType.SEGMENT_DOWNLOADED} event.
* The time it took to download the segment; in milliseconds.
*/
class SegmentDownloadedEvent extends Event {
constructor(downloadTime?: number, size?: number);
/**
* The time it took to download the segment; in milliseconds.
*/
downloadTime?: number;
/**
* The number of bytes in the segment.
*/
size?: number;
}
downloadTime?: number;
/**
* Event data for all events that represent requests made to the receiver.
* The number of bytes in the segment.
*/
class RequestEvent extends Event {
constructor(
type: EventType,
requestData?: RequestData,
senderId?: string
);
/**
* The data that was sent with the request.
*/
requestData?: RequestData;
/**
* The sender id the request came from.
*/
senderId?: string;
}
/**
* Event data superclass for all events dispatched by @see{@link PlayerManager}
*/
class Event {
constructor(type: EventType);
/**
* Type of the event.
*/
type: EventType;
}
/**
* Event data for @see{@link EventType.MEDIA_STATUS} event.
*/
class MediaStatusEvent extends Event {
constructor(type: EventType, mediaStatus?: MediaStatus);
/**
* The media status that was sent.
*/
mediaStatus?: MediaStatus;
}
/**
* Event data for pause events forwarded from the MediaElement.
*/
class MediaPauseEvent extends Event {
constructor(currentMediaTime?: number, ended?: boolean);
/**
* Indicate if the media ended (indicates the pause was fired due to stream reached the end).
*/
ended?: boolean;
}
/**
* Event data for @see{@link EventType.MEDIA_FINISHED} event.
*/
class MediaFinishedEvent extends Event {
constructor(currentMediaTime?: number, endedReason?: EndedReason);
/**
* The time when the media finished (in seconds). For an item in a queue; this value represents the time in the currently playing queue item ( where 0 means the queue item has just started).
*/
currentTime?: number;
/**
* The reason the media finished.
*/
endedReason?: EndedReason;
}
/**
* Event data for all events forwarded from the MediaElement.
*/
class MediaElementEvent extends Event {
constructor(type: EventType, currentMediaTime?: number);
/**
* The time in the currently playing clip when the event was fired (in seconds). Undefined if playback has not started yet.
*/
currentMediaTime?: number;
}
/**
* Event data for all events pertaining to processing a load / preload request. made to the player.
*/
class LoadEvent extends Event {
constructor(type: EventType, media?: MediaInformation);
/**
* Information about the media being loaded.
*/
media: MediaInformation;
}
/**
* Event data for @see{@link EventType.INBAND_TRACK_ADDED} event.
*/
class InbandTrackAddedEvent {
constructor(track: Track);
/**
* Added track.
*/
track: Track;
}
/** Event data for @see{@link EventType.ID3} event. */
class Id3Event extends Event {
constructor(segmentData: Uint8Array);
/**
* The segment data.
*/
segmentData: Uint8Array;
}
/**
* Event data for @see{@link EventType.EMSG} event.
*/
class EmsgEvent extends Event {
constructor(emsgData: any);
/**
* The time that the event ends (in presentation time). Undefined if using legacy Dash support.
*/
endTime: any;
/**
* The duration of the event (in units of timescale). Undefined if using legacy Dash support.
*/
eventDuration: any;
/**
* A field identifying this instance of the message. Undefined if using legacy Dash support.
*/
id: any;
/**
* Body of the message. Undefined if using legacy Dash support.
*/
messageData: any;
/**
* The offset that the event starts; relative to the start of the segment this is contained in (in units of timescale). Undefined if using legacy Dash support.
*/
presentationTimeDelta: any;
/**
* Identifies the message scheme. Undefined if using legacy Dash support.
*/
schemeIdUri: any;
/**
* The segment data. This is only defined if using legacy Dash support.
*/
segmentData: any;
/**
* The time that the event starts (in presentation time). Undefined if using legacy Dash support.
*/
startTime: any;
/**
* Provides the timescale; in ticks per second. Undefined if using legacy Dash support.
*/
timescale: any;
/**
* Specifies the value for the event. Undefined if using legacy Dash support.
*/
value: any;
}
/**
* Event data for @see{@link EventType.CLIP_ENDED} event.
*/
class ClipEndedEvent extends Event {
constructor(currentMediaTime: number, endedReason?: EndedReason);
/**
* The time in media (in seconds) when clip ended.
*/
currentMediaTime: number;
/**
* The reason the clip ended.
*/
endedReason?: EndedReason;
}
/**
* Event data for @see{@link EventType.CACHE_LOADED} event.
*/
class CacheLoadedEvent extends Event {
constructor(media?: MediaInformation);
/**
* Information about the media being cached.
*/
media: MediaInformation;
}
class CacheItemEvent extends Event {
constructor(type: EventType, url: string);
/**
* The URL of data fetched from cache
*/
url: string;
}
class BufferingEvent extends Event {
constructor(isBuffering: boolean);
/**
* True if the player is entering a buffering state.
*/
isBuffering: boolean;
}
class BreaksEvent extends Event {
constructor(
type: EventType,
currentMediaTime?: number,
index?: number,
total?: number,
whenSkippable?: number,
endedReason?: EndedReason,
breakClipId?: string,
breakId?: string
);
/**
* The break's id. Refer to Break.id
*/
breakId?: string;
/**
* The break clip's id. Refer to BreakClip.id
*/
breakClipId?: string;
/**
* The time in the currently playing media when the break event occurred.
*/
currentMediaTime?: number;
/**
* The reason the break clip ended.
*/
endedReason?: EndedReason;
/**
* Index of break clip; which starts from 1.
*/
index: number;
/**
* Total number of break clips.
*/
total: number;
/**
* When to skip current break clip in sec; after break clip begins to play.
*/
whenSkippable?: number;
}
/**
* Event data for @see {@link EventType.BITRATE_CHANGED} event.
*/
class BitrateChangedEvent {
constructor(totalBitrate?: number);
/** The bitrate of the media (audio and video) in bits per second. */
totalBitrate: number;
}
class ErrorEvent extends Event {
constructor(detailedErrorCode: DetailedErrorCode, error?: any);
detailedErrorCode: DetailedErrorCode;
error?: any;
}
size?: number;
}
/**
* Event data for all events that represent requests made to the receiver.
*/
export class RequestEvent extends Event {
constructor(
type: EventType,
requestData?: RequestData,
senderId?: string
);
/**
* The data that was sent with the request.
*/
requestData?: RequestData;
/**
* The sender id the request came from.
*/
senderId?: string;
}
/**
* Event data superexport class for all events dispatched by @see{@link PlayerManager}
*/
export class Event {
constructor(type: EventType);
/**
* Type of the event.
*/
type: EventType;
}
/**
* Event data for @see{@link EventType.MEDIA_STATUS} event.
*/
export class MediaStatusEvent extends Event {
constructor(type: EventType, mediaStatus?: MediaStatus);
/**
* The media status that was sent.
*/
mediaStatus?: MediaStatus;
}
/**
* Event data for pause events forwarded from the MediaElement.
*/
export class MediaPauseEvent extends Event {
constructor(currentMediaTime?: number, ended?: boolean);
/**
* Indicate if the media ended (indicates the pause was fired due to stream reached the end).
*/
ended?: boolean;
}
/**
* Event data for @see{@link EventType.MEDIA_FINISHED} event.
*/
export class MediaFinishedEvent extends Event {
constructor(currentMediaTime?: number, endedReason?: EndedReason);
/**
* The time when the media finished (in seconds). For an item in a queue; this value represents the time in the currently playing queue item ( where 0 means the queue item has just started).
*/
currentTime?: number;
/**
* The reason the media finished.
*/
endedReason?: EndedReason;
}
/**
* Event data for all events forwarded from the MediaElement.
*/
export class MediaElementEvent extends Event {
constructor(type: EventType, currentMediaTime?: number);
/**
* The time in the currently playing clip when the event was fired (in seconds). Undefined if playback has not started yet.
*/
currentMediaTime?: number;
}
/**
* Event data for all events pertaining to processing a load / preload request. made to the player.
*/
export class LoadEvent extends Event {
constructor(type: EventType, media?: MediaInformation);
/**
* Information about the media being loaded.
*/
media: MediaInformation;
}
/**
* Event data for @see{@link EventType.INBAND_TRACK_ADDED} event.
*/
export class InbandTrackAddedEvent {
constructor(track: Track);
/**
* Added track.
*/
track: Track;
}
/** Event data for @see{@link EventType.ID3} event. */
export class Id3Event extends Event {
constructor(segmentData: Uint8Array);
/**
* The segment data.
*/
segmentData: Uint8Array;
}
/**
* Event data for @see{@link EventType.EMSG} event.
*/
export class EmsgEvent extends Event {
constructor(emsgData: any);
/**
* The time that the event ends (in presentation time). Undefined if using legacy Dash support.
*/
endTime: any;
/**
* The duration of the event (in units of timescale). Undefined if using legacy Dash support.
*/
eventDuration: any;
/**
* A field identifying this instance of the message. Undefined if using legacy Dash support.
*/
id: any;
/**
* Body of the message. Undefined if using legacy Dash support.
*/
messageData: any;
/**
* The offset that the event starts; relative to the start of the segment this is contained in (in units of timescale). Undefined if using legacy Dash support.
*/
presentationTimeDelta: any;
/**
* Identifies the message scheme. Undefined if using legacy Dash support.
*/
schemeIdUri: any;
/**
* The segment data. This is only defined if using legacy Dash support.
*/
segmentData: any;
/**
* The time that the event starts (in presentation time). Undefined if using legacy Dash support.
*/
startTime: any;
/**
* Provides the timescale; in ticks per second. Undefined if using legacy Dash support.
*/
timescale: any;
/**
* Specifies the value for the event. Undefined if using legacy Dash support.
*/
value: any;
}
/**
* Event data for @see{@link EventType.CLIP_ENDED} event.
*/
export class ClipEndedEvent extends Event {
constructor(currentMediaTime: number, endedReason?: EndedReason);
/**
* The time in media (in seconds) when clip ended.
*/
currentMediaTime: number;
/**
* The reason the clip ended.
*/
endedReason?: EndedReason;
}
/**
* Event data for @see{@link EventType.CACHE_LOADED} event.
*/
export class CacheLoadedEvent extends Event {
constructor(media?: MediaInformation);
/**
* Information about the media being cached.
*/
media: MediaInformation;
}
export class CacheItemEvent extends Event {
constructor(type: EventType, url: string);
/**
* The URL of data fetched from cache
*/
url: string;
}
export class BufferingEvent extends Event {
constructor(isBuffering: boolean);
/**
* True if the player is entering a buffering state.
*/
isBuffering: boolean;
}
export class BreaksEvent extends Event {
constructor(
type: EventType,
currentMediaTime?: number,
index?: number,
total?: number,
whenSkippable?: number,
endedReason?: EndedReason,
breakClipId?: string,
breakId?: string
);
/**
* The break's id. Refer to Break.id
*/
breakId?: string;
/**
* The break clip's id. Refer to BreakClip.id
*/
breakClipId?: string;
/**
* The time in the currently playing media when the break event occurred.
*/
currentMediaTime?: number;
/**
* The reason the break clip ended.
*/
endedReason?: EndedReason;
/**
* Index of break clip; which starts from 1.
*/
index: number;
/**
* Total number of break clips.
*/
total: number;
/**
* When to skip current break clip in sec; after break clip begins to play.
*/
whenSkippable?: number;
}
/**
* Event data for @see {@link EventType.BITRATE_CHANGED} event.
*/
export class BitrateChangedEvent {
constructor(totalBitrate?: number);
/** The bitrate of the media (audio and video) in bits per second. */
totalBitrate: number;
}
export class ErrorEvent extends Event {
constructor(detailedErrorCode: DetailedErrorCode, error?: any);
detailedErrorCode: DetailedErrorCode;
error?: any;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,198 +1,196 @@
import { EventType } from "./cast.framework.events";
export = cast.framework.system;
declare namespace cast.framework.system {
type EventType =
// Fired when the system is ready.
| "READY"
// Fired when the application is terminated
| "SHUTDOWN"
// Fired when a new sender has connected.
| "SENDER_CONNECTED"
// Fired when a sender has disconnected.
| "SENDER_DISCONNECTED"
// Fired when there is a system error.
| "ERROR"
// Fired when the system volume has changed.
| "SYSTEM_VOLUME_CHANGED"
// Fired when the visibility of the application has changed
// (for example after a HDMI Input change or when the TV is turned
// off/on and the cast device is externally powered).
// Note that this API has the same effect as the webkitvisibilitychange event raised
// by your document, we provided it as CastReceiverManager API for convenience and
// to avoid a dependency on a webkit-prefixed event.
| "VISIBILITY_CHANGED"
// Fired when the standby state of the TV has changed.
// This event is related to the visibility chnaged event, as if the TV is in standby
// the visibility will be false, the visibility is more granular
// (as it also detects that the TV has selected a different channel)
// but it is not reliably detected in all TVs,
// standby can be used in those cases as most TVs implement it.
| "STANDBY_CHANGED"
| "MAX_VIDEO_RESOLUTION_CHANGED"
| "FEEDBACK_STARTED";
export as namespace system
export type EventType =
// Fired when the system is ready.
| "READY"
// Fired when the application is terminated
| "SHUTDOWN"
// Fired when a new sender has connected.
| "SENDER_CONNECTED"
// Fired when a sender has disconnected.
| "SENDER_DISCONNECTED"
// Fired when there is a system error.
| "ERROR"
// Fired when the system volume has changed.
| "SYSTEM_VOLUME_CHANGED"
// Fired when the visibility of the application has changed
// (for example after a HDMI Input change or when the TV is turned
// off/on and the cast device is externally powered).
// Note that this API has the same effect as the webkitvisibilitychange event raised
// by your document, we provided it as CastReceiverManager API for convenience and
// to avoid a dependency on a webkit-prefixed event.
| "VISIBILITY_CHANGED"
// Fired when the standby state of the TV has changed.
// This event is related to the visibility chnaged event, as if the TV is in standby
// the visibility will be false, the visibility is more granular
// (as it also detects that the TV has selected a different channel)
// but it is not reliably detected in all TVs,
// standby can be used in those cases as most TVs implement it.
| "STANDBY_CHANGED"
| "MAX_VIDEO_RESOLUTION_CHANGED"
| "FEEDBACK_STARTED";
type SystemState =
| "NOT_STARTED"
| "STARTING_IN_BACKGROUND"
| "STARTING"
| "READY"
| "STOPPING_IN_BACKGROUND"
| "STOPPING";
export type SystemState =
| "NOT_STARTED"
| "STARTING_IN_BACKGROUND"
| "STARTING"
| "READY"
| "STOPPING_IN_BACKGROUND"
| "STOPPING";
type StandbyState = "STANDBY" | "NOT_STANDBY" | "UNKNOWN";
export type StandbyState = "STANDBY" | "NOT_STANDBY" | "UNKNOWN";
type DisconnectReason = "REQUESTED_BY_SENDER" | "ERROR" | "UNKNOWN";
export type DisconnectReason = "REQUESTED_BY_SENDER" | "ERROR" | "UNKNOWN";
/**
* Event dispatched by @see{@link CastReceiverManager} when the visibility of the application changes (HDMI input change; TV is turned off).
*/
export class VisibilityChangedEvent {
constructor(isVisible: boolean);
/**
* Event dispatched by @see{@link CastReceiverManager} when the visibility of the application changes (HDMI input change; TV is turned off).
* Whether the Cast device is the active input or not.
*/
class VisibilityChangedEvent {
constructor(isVisible: boolean);
/**
* Whether the Cast device is the active input or not.
*/
isVisible: boolean;
}
/**
* Represents the system volume data.
*/
interface SystemVolumeData {
/**
* The level (from 0.0 to 1.0) of the system volume
*/
level: number;
/**
* Whether the system volume is muted or not.
*/
muted: boolean;
}
/**
* Event dispatched by @see{CastReceiverManager} when the system volume changes.
*/
class SystemVolumeChangedEvent extends Event {
constructor(volume: SystemVolumeData);
/**
* The system volume data
*/
data: SystemVolumeData;
}
/**
* Event dispatched by @see{@link CastReceiverManager} when the TV enters/leaves the standby state.
*/
class StandbyChangedEvent {
constructor(isStandby: boolean);
isStandby: boolean;
}
/**
* Whether the TV is in standby or not.
*/
interface ShutdownEvent extends Event {
[key: string]: any;
}
/**
* Event dispatched by @see{@link CastReceiverManager} when a sender is disconnected.
*/
class SenderDisconnectedEvent extends Event {
constructor(senderId: string, userAgent: string);
/**
* The ID of the sender connected.
*/
senderId: string;
/**
* The user agent of the sender.
*/
userAgent: string;
/**
* The reason the sender was disconnected.
*/
reason?: DisconnectReason;
}
/**
* Event dispatched by @see{@link CastReceiverManager} when a sender is connected.
*/
class SenderConnectedEvent extends Event {
constructor(senderId: string, userAgent: string);
/**
* The ID of the sender connected.
*/
senderId: string;
/**
* The user agent of the sender.
*/
userAgent: string;
}
/**
* Represents the data of a connected sender device.
*/
interface Sender {
/**
* The sender Id.
*/
id: string;
/**
* Indicate the sender supports large messages (>64KB)
*/
largeMessageSupported?: boolean;
/**
* The userAgent of the sender.
*/
userAgent?: string;
}
/**
* Event dispatched by CastReceiverManager when the system is ready.
*/
class ReadyEvent {
constructor(applicationData: ApplicationData);
/**
* The application data
*/
data: ApplicationData;
}
/**
* Event dispatched by @see{@link CastReceiverManager} when the system needs to update the restriction on maximum video resolution.
*/
class MaxVideoResolutionChangedEvent extends Event {
constructor(height: number);
/**
* Maximum video resolution requested by the system. The value of 0 means there is no restriction.
*/
height: number;
}
/** Event dispatched by @see{@link CastReceiverManager} when the systems starts to create feedback report. */
interface FeedbackStartedEvent extends Event {
[key: string]: any;
}
/** Event dispatched by @see{@link CastReceiverContext} which contains system information. */
class Event {
constructor(type: EventType, data?: any);
type: EventType;
data?: any;
}
/** Represents the data of the launched application. */
interface ApplicationData {
id(): string;
launchingSenderId(): string;
name(): string;
namespaces(): string[];
sessionId(): number;
}
isVisible: boolean;
}
/**
* Represents the system volume data.
*/
export interface SystemVolumeData {
/**
* The level (from 0.0 to 1.0) of the system volume
*/
level: number;
/**
* Whether the system volume is muted or not.
*/
muted: boolean;
}
/**
* Event dispatched by @see{CastReceiverManager} when the system volume changes.
*/
export class SystemVolumeChangedEvent extends Event {
constructor(volume: SystemVolumeData);
/**
* The system volume data
*/
data: SystemVolumeData;
}
/**
* Event dispatched by @see{@link CastReceiverManager} when the TV enters/leaves the standby state.
*/
export class StandbyChangedEvent {
constructor(isStandby: boolean);
isStandby: boolean;
}
/**
* Whether the TV is in standby or not.
*/
export interface ShutdownEvent extends Event {
[key: string]: any;
}
/**
* Event dispatched by @see{@link CastReceiverManager} when a sender is disconnected.
*/
export class SenderDisconnectedEvent extends Event {
constructor(senderId: string, userAgent: string);
/**
* The ID of the sender connected.
*/
senderId: string;
/**
* The user agent of the sender.
*/
userAgent: string;
/**
* The reason the sender was disconnected.
*/
reason?: DisconnectReason;
}
/**
* Event dispatched by @see{@link CastReceiverManager} when a sender is connected.
*/
export class SenderConnectedEvent extends Event {
constructor(senderId: string, userAgent: string);
/**
* The ID of the sender connected.
*/
senderId: string;
/**
* The user agent of the sender.
*/
userAgent: string;
}
/**
* Represents the data of a connected sender device.
*/
export interface Sender {
/**
* The sender Id.
*/
id: string;
/**
* Indicate the sender supports large messages (>64KB)
*/
largeMessageSupported?: boolean;
/**
* The userAgent of the sender.
*/
userAgent?: string;
}
/**
* Event dispatched by CastReceiverManager when the system is ready.
*/
export class ReadyEvent {
constructor(applicationData: ApplicationData);
/**
* The application data
*/
data: ApplicationData;
}
/**
* Event dispatched by @see{@link CastReceiverManager} when the system needs to update the restriction on maximum video resolution.
*/
export class MaxVideoResolutionChangedEvent extends Event {
constructor(height: number);
/**
* Maximum video resolution requested by the system. The value of 0 means there is no restriction.
*/
height: number;
}
/** Event dispatched by @see{@link CastReceiverManager} when the systems starts to create feedback report. */
export interface FeedbackStartedEvent extends Event {
[key: string]: any;
}
/** Event dispatched by @see{@link CastReceiverContext} which contains system information. */
export class Event {
constructor(type: EventType, data?: any);
type: EventType;
data?: any;
}
/** Represents the data of the launched application. */
export interface ApplicationData {
id(): string;
launchingSenderId(): string;
name(): string;
namespaces(): string[];
sessionId(): number;
}

View File

@ -1,197 +1,193 @@
import { PlayerDataEventType } from "./cast.framework.ui";
import { MediaMetadata } from "./cast.framework.messages";
import { PlayerDataChangedEventHandler } from "./index";
export = cast.framework.ui;
export as namespace ui
export type ContentType = "video" | "audio" | "image";
declare namespace cast.framework.ui {
type ContentType = "video" | "audio" | "image";
export type State =
| "launching"
| "idle"
| "loading"
| "buffering"
| "paused"
| "playing";
type State =
| "launching"
| "idle"
| "loading"
| "buffering"
| "paused"
| "playing";
export type PlayerDataEventType =
| "ANY_CHANGE"
| "STATE_CHANGED"
| "IS_SEEKING_CHANGED"
| "DURATION_CHANGED"
| "CURRENT_TIME_CHANGED"
| "METADATA_CHANGED"
| "TITLE_CHANGED"
| "SUBTITLE_CHANGED"
| "THUMBNAIL_URL_CHANGED"
| "NEXT_TITLE_CHANGED"
| "NEXT_SUBTITLE_CHANGED"
| "NEXT_THUMBNAIL_URL_CHANGED"
| "PRELOADING_NEXT_CHANGED"
| "CONTENT_TYPE_CHANGED"
| "IS_LIVE_CHANGED"
| "BREAK_PERCENTAGE_POSITIONS_CHANGED"
| "IS_PLAYING_BREAK_CHANGED"
| "IS_BREAK_SKIPPABLE_CHANGED"
| "WHEN_SKIPPABLE_CHANGED"
| "NUMBER_BREAK_CLIPS_CHANGED"
| "CURRENT_BREAK_CLIP_NUMBER_CHANGED"
| "DISPLAY_STATUS_CHANGED";
type PlayerDataEventType =
| "ANY_CHANGE"
| "STATE_CHANGED"
| "IS_SEEKING_CHANGED"
| "DURATION_CHANGED"
| "CURRENT_TIME_CHANGED"
| "METADATA_CHANGED"
| "TITLE_CHANGED"
| "SUBTITLE_CHANGED"
| "THUMBNAIL_URL_CHANGED"
| "NEXT_TITLE_CHANGED"
| "NEXT_SUBTITLE_CHANGED"
| "NEXT_THUMBNAIL_URL_CHANGED"
| "PRELOADING_NEXT_CHANGED"
| "CONTENT_TYPE_CHANGED"
| "IS_LIVE_CHANGED"
| "BREAK_PERCENTAGE_POSITIONS_CHANGED"
| "IS_PLAYING_BREAK_CHANGED"
| "IS_BREAK_SKIPPABLE_CHANGED"
| "WHEN_SKIPPABLE_CHANGED"
| "NUMBER_BREAK_CLIPS_CHANGED"
| "CURRENT_BREAK_CLIP_NUMBER_CHANGED"
| "DISPLAY_STATUS_CHANGED";
/**
* Player data changed event. Provides the changed field (type); and new value.
*/
export class PlayerDataChangedEvent {
constructor(type: PlayerDataEventType, field: string, value: any);
/**
* Player data changed event. Provides the changed field (type); and new value.
* The field name that was changed.
*/
class PlayerDataChangedEvent {
constructor(type: PlayerDataEventType, field: string, value: any);
field: string;
/**
* The field name that was changed.
*/
field: string;
type: PlayerDataEventType;
type: PlayerDataEventType;
/**
* The new field value.
*/
value: any;
}
/**
* Player data binder. Bind a player data object to the player state.
* The player data will be updated to reflect correctly the current player state without firing any change event.
* The new field value.
*/
class PlayerDataBinder {
constructor(playerData: PlayerData);
/**
* Add listener to player data changes.
*/
addEventListener: (
type: PlayerDataEventType,
listener: PlayerDataChangedEventHandler
) => void;
/**
* Remove listener to player data changes.
*/
removeEventListener: (
type: PlayerDataEventType,
listener: PlayerDataChangedEventHandler
) => void;
}
/**
* Player data. Provide the player media and break state.
*/
interface PlayerData {
/**
* Array of breaks positions in percentage.
*/
breakPercentagePositions: number[];
/**
* Content Type.
*/
contentType: ContentType;
/**
* The number of the current playing break clip in the break.
*/
currentBreakClipNumber: number;
/**
* Media current position in seconds; or break current position if playing break.
*/
currentTime: number;
/**
* Whether the player metadata (ie: title; currentTime) should be displayed.
* This will be true if at least one field in the metadata should be displayed.
* In some cases; displayStatus will be true; but parts of the metadata should be hidden
* (ie: the media title while media is seeking).
* In these cases; additional css can be applied to hide those elements.
* For cases where the media is audio-only; this will almost always be true.
* In cases where the media is video; this will be true when:
* (1) the video is loading; buffering; or seeking
* (2) a play request was made in the last five seconds while media is already playing;
* (3) there is a request made to show the status in the last five seconds; or
* (4) the media was paused in the last five seconds.
*/
displayStatus: boolean;
/**
* Media duration in seconds; Or break duration if playing break.
*/
duration: number;
/**
* Indicate break clip can be skipped.
*/
isBreakSkippable: boolean;
/**
* Indicate if the content is a live stream.
*/
isLive: boolean;
/**
* Indicate that the receiver is playing a break.
*/
isPlayingBreak: boolean;
/**
* Indicate the player is seeking (can be either during playing or pausing).
*/
isSeeking: boolean;
/**
* Media metadata.
*/
metadata: MediaMetadata;
/**
* Next Item subtitle.
*/
nextSubtitle: string;
/**
* Next Item thumbnail url.
*/
nextThumbnailUrl: string;
/**
* Next Item title.
*/
nextTitle: string;
/**
* Number of break clips in current break.
*/
numberBreakClips: number;
/**
* Flag to show/hide next item metadata.
*/
preloadingNext: boolean;
/**
* Current player state.
*/
state: State;
/**
* Content thumbnail url.
*/
thumbnailUrl: string;
/**
* Content title.
*/
title: string;
/**
* Provide the time a break is skipable - relative to current playback time. Undefined if not skippable.
*/
whenSkippable?: number;
}
value: any;
}
/**
* Player data binder. Bind a player data object to the player state.
* The player data will be updated to reflect correctly the current player state without firing any change event.
*/
export class PlayerDataBinder {
constructor(playerData: PlayerData);
/**
* Add listener to player data changes.
*/
addEventListener: (
type: PlayerDataEventType,
listener: PlayerDataChangedEventHandler
) => void;
/**
* Remove listener to player data changes.
*/
removeEventListener: (
type: PlayerDataEventType,
listener: PlayerDataChangedEventHandler
) => void;
}
/**
* Player data. Provide the player media and break state.
*/
export interface PlayerData {
/**
* Array of breaks positions in percentage.
*/
breakPercentagePositions: number[];
/**
* Content Type.
*/
contentType: ContentType;
/**
* The number of the current playing break clip in the break.
*/
currentBreakClipNumber: number;
/**
* Media current position in seconds; or break current position if playing break.
*/
currentTime: number;
/**
* Whether the player metadata (ie: title; currentTime) should be displayed.
* This will be true if at least one field in the metadata should be displayed.
* In some cases; displayStatus will be true; but parts of the metadata should be hidden
* (ie: the media title while media is seeking).
* In these cases; additional css can be applied to hide those elements.
* For cases where the media is audio-only; this will almost always be true.
* In cases where the media is video; this will be true when:
* (1) the video is loading; buffering; or seeking
* (2) a play request was made in the last five seconds while media is already playing;
* (3) there is a request made to show the status in the last five seconds; or
* (4) the media was paused in the last five seconds.
*/
displayStatus: boolean;
/**
* Media duration in seconds; Or break duration if playing break.
*/
duration: number;
/**
* Indicate break clip can be skipped.
*/
isBreakSkippable: boolean;
/**
* Indicate if the content is a live stream.
*/
isLive: boolean;
/**
* Indicate that the receiver is playing a break.
*/
isPlayingBreak: boolean;
/**
* Indicate the player is seeking (can be either during playing or pausing).
*/
isSeeking: boolean;
/**
* Media metadata.
*/
metadata: MediaMetadata;
/**
* Next Item subtitle.
*/
nextSubtitle: string;
/**
* Next Item thumbnail url.
*/
nextThumbnailUrl: string;
/**
* Next Item title.
*/
nextTitle: string;
/**
* Number of break clips in current break.
*/
numberBreakClips: number;
/**
* Flag to show/hide next item metadata.
*/
preloadingNext: boolean;
/**
* Current player state.
*/
state: State;
/**
* Content thumbnail url.
*/
thumbnailUrl: string;
/**
* Content title.
*/
title: string;
/**
* Provide the time a break is skipable - relative to current playback time. Undefined if not skippable.
*/
whenSkippable?: number;
}

View File

@ -1,64 +1,60 @@
import {
PlayerData,
PlayerDataBinder
} from "chromecast-caf-receiver/cast.framework.ui";
import {
ReadyEvent,
ApplicationData
} from "chromecast-caf-receiver/cast.framework.system";
import {
RequestEvent,
Event,
BreaksEvent
} from "chromecast-caf-receiver/cast.framework.events";
import {
QueueBase,
TextTracksManager,
QueueManager,
PlayerManager
} from "chromecast-caf-receiver/cast.framework";
import {
BreakSeekData,
BreakClipLoadInterceptorContext,
BreakManager
} from "chromecast-caf-receiver/cast.framework.breaks";
import {
Break,
BreakClip,
LoadRequestData,
Track,
MediaMetadata
} from "chromecast-caf-receiver/cast.framework.messages";
import { MediaMetadata } from "chromecast-caf-receiver/cast.framework.messages";
const breaksEvent = new BreaksEvent('BREAK_STARTED');
breaksEvent.breakId = 'some-break-id';
breaksEvent.breakClipId = 'some-break-clip-id';
// The following test showcases how you can import individual types directly from the namespace:
const track = new Track(1, "TEXT");
const breakClip = new BreakClip("id");
const adBreak = new Break("id", ["id"], 1);
const rEvent = new RequestEvent("BITRATE_CHANGED", { requestId: 2 });
const pManager = new PlayerManager();
pManager.addEventListener("STALLED", () => { });
const ttManager = new TextTracksManager();
const qManager = new QueueManager();
const qBase = new QueueBase();
const mediaMetadata = new MediaMetadata("GENERIC");
mediaMetadata.metadataType = "TV_SHOW";
// The following tests showcase how you can globally access 'cast' types using
// the nested namespace style. This is the preferred method as it
// conforms exactly to the CAF documentation.
// tslint:disable-next-line
const breaksEvent = new cast.framework.events.BreaksEvent("BREAK_STARTED");
breaksEvent.breakId = "some-break-id";
breaksEvent.breakClipId = "some-break-clip-id";
// tslint:disable-next-line
const track = new cast.framework.messages.Track(1, "TEXT");
// tslint:disable-next-line
const breakClip = new cast.framework.messages.BreakClip("id");
// tslint:disable-next-line
const adBreak = new cast.framework.messages.Break("id", ["id"], 1);
// tslint:disable-next-line
const rEvent = new cast.framework.events.RequestEvent("BITRATE_CHANGED", {
requestId: 2
});
// tslint:disable-next-line
const pManager = new cast.framework.PlayerManager();
pManager.addEventListener("STALLED", () => {});
// tslint:disable-next-line
const ttManager = new cast.framework.TextTracksManager();
// tslint:disable-next-line
const qManager = new cast.framework.QueueManager();
// tslint:disable-next-line
const qBase = new cast.framework.QueueBase();
const items = qBase.fetchItems(1, 3, 4);
const breakSeekData = new BreakSeekData(0, 100, []);
const breakClipLoadContext = new BreakClipLoadInterceptorContext(adBreak);
const breakManager: BreakManager = {
// tslint:disable-next-line
const breakSeekData = new cast.framework.breaks.BreakSeekData(0, 100, []);
// tslint:disable-next-line
const breakClipLoadContext = new cast.framework.breaks.BreakClipLoadInterceptorContext(
adBreak
);
// tslint:disable-next-line
const breakManager: cast.framework.breaks.BreakManager = {
getBreakById: () => adBreak,
getBreakClipById: () => breakClip,
getBreakClips: () => [breakClip],
getBreaks: () => [adBreak],
getPlayWatchedBreak: () => true,
setBreakClipLoadInterceptor: () => { },
setBreakSeekInterceptor: () => { },
setPlayWatchedBreak: () => { },
setVastTrackingInterceptor: () => { }
setBreakClipLoadInterceptor: () => {},
setBreakSeekInterceptor: () => {},
setPlayWatchedBreak: () => {},
setVastTrackingInterceptor: () => {}
};
const lrd: LoadRequestData = {
// tslint:disable-next-line
const lrd: cast.framework.messages.LoadRequestData = {
requestId: 1,
activeTrackIds: [1, 2],
media: {
@ -75,7 +71,8 @@ const lrd: LoadRequestData = {
queueData: {}
};
const appData: ApplicationData = {
// tslint:disable-next-line
const appData: cast.framework.system.ApplicationData = {
id: () => "id",
launchingSenderId: () => "launch-id",
name: () => "name",
@ -83,9 +80,11 @@ const appData: ApplicationData = {
sessionId: () => 1
};
const readyEvent = new ReadyEvent(appData);
// tslint:disable-next-line
const readyEvent = new cast.framework.system.ReadyEvent(appData);
const data = readyEvent.data;
const pData: PlayerData = {
// tslint:disable-next-line
const pData: cast.framework.ui.PlayerData = {
breakPercentagePositions: [1],
contentType: "video",
currentBreakClipNumber: 2,
@ -96,7 +95,8 @@ const pData: PlayerData = {
isLive: true,
isPlayingBreak: false,
isSeeking: true,
metadata: new MediaMetadata("GENERIC"),
// tslint:disable-next-line
metadata: new cast.framework.messages.MediaMetadata("GENERIC"),
nextSubtitle: "sub",
nextThumbnailUrl: "url",
nextTitle: "title",
@ -107,5 +107,6 @@ const pData: PlayerData = {
title: "title",
whenSkippable: 321
};
const binder = new PlayerDataBinder(pData);
binder.addEventListener("ANY_CHANGE", e => { });
// tslint:disable-next-line
const binder = new cast.framework.ui.PlayerDataBinder(pData);
binder.addEventListener("ANY_CHANGE", e => {});

View File

@ -11,14 +11,18 @@
/// <reference path="./cast.framework.system.d.ts" />
/// <reference path="./cast.framework.ui.d.ts" />
import * as framework from "./cast.framework";
import { PlayerDataChangedEvent } from './cast.framework.ui';
import { NetworkRequestInfo } from './cast.framework';
import { Event } from './cast.framework.events';
export as namespace cast;
export type EventHandler = (event: Event) => void;
export type PlayerDataChangedEventHandler = (
event: PlayerDataChangedEvent
) => void;
export type RequestHandler = (request: NetworkRequestInfo) => void;
export type BinaryHandler = (data: Uint8Array) => Uint8Array;
export { framework };
declare global {
type EventHandler = (event: Event) => void;
type PlayerDataChangedEventHandler = (
event: PlayerDataChangedEvent
) => void;
type RequestHandler = (request: framework.NetworkRequestInfo) => void;
type BinaryHandler = (data: Uint8Array) => Uint8Array;
}

View File

@ -369,6 +369,7 @@ function test_dom_walker() {
node = walker.lastForward();
node = walker.next();
node = walker.previous();
isSomething = walker.guard(node, true);
walker.reset();
isSomething = CKEDITOR.dom.walker.blockBoundary({ div: 1 })(node);
@ -485,7 +486,7 @@ function test_dialog() {
{
id: 'tab-basic',
label: 'Basic Settings',
elements: [] as any[]
elements: [] as any []
},
{
id: 'tab-adv',

Some files were not shown because too many files have changed in this diff Show More