Merge branch 'master' into mh/fix-jest-types

This commit is contained in:
Martin Hochel
2018-06-11 23:16:53 +02:00
committed by GitHub
228 changed files with 23027 additions and 2725 deletions
+3
View File
@@ -49,3 +49,6 @@ npm-debug.log
# yarn
yarn.lock
# pnpm
shrinkwrap.yaml
+1 -7
View File
@@ -124,7 +124,7 @@
"libraryName": "axe-core",
"typingsPackageName": "axe-core",
"sourceRepoURL": "https://github.com/dequelabs/axe-core",
"asOfVersion": "2.0.7"
"asOfVersion": "3.0.3"
},
{
"libraryName": "axios",
@@ -1008,12 +1008,6 @@
"sourceRepoURL": "https://github.com/blakeembrey/param-case",
"asOfVersion": "1.1.2"
},
{
"libraryName": "parse5",
"typingsPackageName": "parse5",
"sourceRepoURL": "https://github.com/inikulin/parse5",
"asOfVersion": "3.0.0"
},
{
"libraryName": "pascal-case",
"typingsPackageName": "pascal-case",
@@ -0,0 +1,31 @@
import { Result, RunOptions, Spec } from "axe-core";
import { AxeBuilder, AxeAnalysis } from "axe-webdriverjs";
import { WebDriver } from "selenium-webdriver";
const inTest = async (webDriver: WebDriver) => {
const builderCalled: AxeBuilder = AxeBuilder(webDriver);
const builderNewed: AxeBuilder = new AxeBuilder(webDriver);
const runOptions: RunOptions = {};
const spec: Spec = {};
const analysis: AxeAnalysis = await AxeBuilder(webDriver)
.include("include")
.exclude("exclude")
.options(runOptions)
.withRules("rule")
.withRules(["rule", "rule"])
.withTags("tag")
.withTags(["tag", "tag"])
.disableRules("rule")
.disableRules(["rule", "rule"])
.configure(spec)
.analyze((internalResults: AxeAnalysis) => {});
const inapplicable: Result[] = analysis.inapplicable;
const incomplete: Result[] = analysis.incomplete;
const passes: Result[] = analysis.passes;
const timestamp: string = analysis.timestamp;
const url: string = analysis.url;
const violations: Result[] = analysis.violations;
};
+83
View File
@@ -0,0 +1,83 @@
// Type definitions for axe-webdriverjs 2.0
// Project: https://github.com/dequelabs/axe-webdriverjs#readme
// Definitions by: My Self <https://github.com/JoshuaKGoldberg>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { Result, RunOptions, Spec } from "axe-core";
import { WebDriver } from "selenium-webdriver";
export interface AxeAnalysis {
inapplicable: Result[];
incomplete: Result[];
passes: Result[];
timestamp: string;
url: string;
violations: Result[];
}
export interface AxeBuilder {
/**
* Includes a selector in analysis.
*
* @param selector CSS selector of the element to include.
*/
include(selector: string): this;
/**
* Excludes a selector from analysis.
*
* @param selector CSS selector of the element to exclude.
*/
exclude(selector: string): this;
/**
* Options to directly pass to `axe.run`.
*
* @param options aXe options object.
* @remarks Will override any other configured options, including calls to `withRules` and `withTags`.
* @see https://github.com/dequelabs/axe-core/issues/937
*/
options(options: RunOptions): this;
/**
* Limits analysis to only the specified rules.
*
* @param rules Array of rule IDs, or a single rule ID as a string.
* @remarks Cannot be used with `withTags`.
*/
withRules(rules: string | string[]): this;
/**
* Limist analysis to only the specified tags.
*
* @param rules Array of tags, or a single tag as a string.
* @remarks Cannot be used with `withRules`.
*/
withTags(tags: string | string[]): this;
/**
* Set the list of rules to skip when running an analysis
*
* @param rules Array of rule IDs, or a single rule ID as a string.
*/
disableRules(rules: string | string[]): this;
/**
* Configures aXe before running analyze.
*
* @param config aXe Configuration spec to use in analysis.
*/
configure(config: Spec): this;
/**
* Perform analysis and retrieve results.
* @param callback Function to execute when analysis completes.
*/
analyze(callback: (results: AxeAnalysis) => void): Promise<AxeAnalysis>;
}
export const AxeBuilder: {
(driver: WebDriver): AxeBuilder;
new (driver: WebDriver): AxeBuilder;
};
+6
View File
@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"axe-core": "^3.0.3"
}
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"axe-webdriverjs-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
@@ -1,3 +1,4 @@
import * as JQuery from 'jquery';
import * as Marionette from 'backbone.marionette';
import * as Backbone from 'backbone';
@@ -9,6 +10,10 @@ class DestroyWarn extends Marionette.Behavior {
message: 'you are destroying!'
};
ui = {
destroy: '.foo'
};
// behaviors have events that are bound to the views DOM
events = {
'click @ui.destroy': 'warnBeforeDestroy'
@@ -258,12 +263,18 @@ function RegionTests() {
});
}
function BehaviorTest() {
const b = new DestroyWarn();
const uiHandle: JQuery = b.getUI('destroy');
}
function ViewTests() {
const v = new MyView(new MyModel());
const isDestroyed: boolean = v.isDestroyed();
const isRendered: boolean = v.isRendered();
const isAttached: boolean = v.isAttached();
const vv: Marionette.View<Backbone.Model> = v.delegateEntityEvents();
const uiHandle: JQuery = v.getUI('destroy');
}
function CollectionViewTests() {
+10
View File
@@ -1143,6 +1143,11 @@ export class View<TModel extends Backbone.Model> extends Backbone.View<TModel> i
* throughout the view with the ui attribute.
*/
ui: any;
/**
* Get handle on UI element defined in ui hash
*/
getUI(ui: string): JQuery;
}
export interface CollectionViewOptions<
@@ -1561,6 +1566,11 @@ export class Behavior extends Object {
*/
ui: any;
/**
* Get handle on UI element defined in ui hash
*/
getUI(ui: string): JQuery;
/**
* Any triggers you define on the Behavior will be triggered in response to the appropriate event on the view.
*/
+263 -1
View File
@@ -46,7 +46,7 @@ Bleno.on('stateChange', (state: string) => {
});
const characteristic = new EchoCharacteristic();
Bleno.on('advertisingStart', (error: string) => {
Bleno.on('advertisingStart', (error?: Error | null) => {
if (!error) {
Bleno.setServices(
[new Bleno.PrimaryService({uuid: 'ec00', characteristics: [ characteristic ] })],
@@ -54,3 +54,265 @@ Bleno.on('advertisingStart', (error: string) => {
);
}
});
const SERVICE_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3863';
const CONTROL_CHAR_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3864';
const STATUS_CHAR_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3866';
class StatusCharacteristic extends Bleno.Characteristic {
constructor() {
super({
uuid: 'STATUS_CHAR_UUID',
properties: ['read'],
descriptors: [
new Bleno.Descriptor({
uuid: '2901',
value: Buffer.from('Status'),
}),
],
});
}
onReadRequest(
offset: number,
callback: (result: number, data?: Buffer) => void
) {
try {
const data = Buffer.from('status ok');
callback(Bleno.Characteristic.RESULT_SUCCESS, data.slice(offset));
} catch (error) {
callback(Bleno.Characteristic.RESULT_UNLIKELY_ERROR);
}
}
}
class ControlCharacteristic extends Bleno.Characteristic {
private readonly callback: (data: Buffer) => void;
constructor(onWriteRequestCb: (data: Buffer) => void) {
super({
uuid: CONTROL_CHAR_UUID,
properties: ['write'],
descriptors: [
new Bleno.Descriptor({
uuid: '2901',
value: Buffer.from('test characteristic'),
}),
],
});
this.callback = onWriteRequestCb;
}
onWriteRequest(
data: Buffer,
offset: number,
withoutResponse: any,
callback: (result: number) => void
): void {
if (offset > 0) {
this.callback(data.slice(offset));
} else {
this.callback(data);
}
callback(this.RESULT_SUCCESS);
}
}
export class BluetoothController {
private isAdvertising: boolean;
constructor() {
this.isAdvertising = false;
this.setup();
}
toString(): string {
return '<Control>';
}
dispose(callback: () => void) {
if (this.isAdvertising) {
Bleno.stopAdvertising(callback);
} else {
callback();
}
}
private setup() {
Bleno.on('stateChange', (state: string) => {
console.log('bluetooth', `stateChange: ${state}, address = ${Bleno.address}`);
if (state === 'poweredOn') {
Bleno.startAdvertising('device', [SERVICE_UUID]);
} else {
Bleno.stopAdvertising();
}
});
Bleno.on('accept', (clientAddress: string) => {
console.log('bluetooth', `accept, client: ${clientAddress}`);
Bleno.updateRssi();
});
Bleno.on('disconnect', (clientAddress: string) => {
console.log('bluetooth', `disconnect, client: ${clientAddress}`);
});
Bleno.on('rssiUpdate', (rssi: number) => {
console.log('bluetooth', `rssiUpdate: ${rssi}`);
});
Bleno.on('mtuChange', (mtu: number) => {
console.log('bluetooth', `mtuChange: ${mtu}`);
});
Bleno.on('advertisingStart', (error?: Error | null) => {
console.log('bluetooth', `advertisingStart: ${error ? error : 'success'}`);
if (!error) {
this.isAdvertising = true;
Bleno.setServices([
new Bleno.PrimaryService({
uuid: SERVICE_UUID,
characteristics: [
new ControlCharacteristic((data) => {
this.onWriteRequest(data);
}),
new StatusCharacteristic(),
],
}),
]);
}
});
Bleno.on('advertisingStop', () => {
this.isAdvertising = false;
console.log('bluetooth', 'advertisingStop');
});
Bleno.on('servicesSet', (error?: Error | null) => {
console.log('bluetooth', `servicesSet: ${error ? error : 'success'}`);
});
}
private onWriteRequest(data: Buffer) {
console.log(data.toString('hex'));
}
}
///////////////////////////////////////////////////////////////////////////////
// code from bleno's README
//
const bleno = Bleno;
function test1() {
const name = 'name';
const serviceUuids = ['fffffffffffffffffffffffffffffff0'];
bleno.startAdvertising(name);
bleno.startAdvertising(name, serviceUuids);
bleno.startAdvertising(name, serviceUuids, (error) => {});
}
function test2() {
const uuid = 'e2c56db5dffb48d2b060d0f5a71096e0';
const major = 0; // 0x0000 - 0xffff
const minor = 0; // 0x0000 - 0xffff
const measuredPower = -59; // -128 - 127
bleno.startAdvertisingIBeacon(uuid, major, minor, measuredPower);
bleno.startAdvertisingIBeacon(uuid, major, minor, measuredPower, (error) => {});
}
function test3() {
const scanData = new Buffer(''); // maximum 31 bytes
const advertisementData = new Buffer(''); // maximum 31 bytes
bleno.startAdvertisingWithEIRData(advertisementData);
bleno.startAdvertisingWithEIRData(advertisementData, (error) => {});
bleno.startAdvertisingWithEIRData(advertisementData, scanData, (error) => {});
}
function test4() {
bleno.stopAdvertising();
bleno.stopAdvertising(() => {});
}
function test5() {
const service = new bleno.PrimaryService({uuid: '0000'});
const services = [
service
];
bleno.setServices(services);
bleno.setServices(services, (error) => {});
}
function test6() {
bleno.disconnect(); // Linux only
}
function test7() {
bleno.updateRssi(); // not available in OS X 10.9
bleno.updateRssi((error, rssi) => {}); // not available in OS X 10.9
}
function test8() {
const PrimaryService = bleno.PrimaryService;
const primaryService = new PrimaryService({
uuid: 'fffffffffffffffffffffffffffffff0', // or 'fff0' for 16-bit
characteristics: [
// see Characteristic for data type
]
});
}
function test9() {
const Characteristic = bleno.Characteristic;
const characteristic = new Characteristic({
uuid: 'fffffffffffffffffffffffffffffff1', // or 'fff1' for 16-bit
properties: ['read'], // can be a combination of 'read', 'write', 'writeWithoutResponse', 'notify', 'indicate'
secure: ['notify'], // enable security for properties, can be a combination of 'read', 'write', 'writeWithoutResponse', 'notify', 'indicate'
value: null, // optional static value, must be of type Buffer - for read only characteristics
descriptors: [
// see Descriptor for data type
new bleno.Descriptor({uuid: '0000'})
],
onReadRequest: null, // optional read request handler, function(offset, callback) { ... }
onWriteRequest: null, // optional write request handler, function(data, offset, withoutResponse, callback) { ...}
onSubscribe: null, // optional notify/indicate subscribe handler, function(maxValueSize, updateValueCallback) { ...}
onUnsubscribe: null, // optional notify/indicate unsubscribe handler, function() { ...}
onNotify: null, // optional notify sent handler, function() { ...}
onIndicate: null // optional indicate confirmation received handler, function() { ...}
});
}
function test10() {
bleno.Characteristic.RESULT_SUCCESS;
bleno.Characteristic.RESULT_INVALID_OFFSET;
bleno.Characteristic.RESULT_INVALID_ATTRIBUTE_LENGTH;
bleno.Characteristic.RESULT_UNLIKELY_ERROR;
}
function test11() {
const Descriptor = bleno.Descriptor;
const descriptor = new Descriptor({
uuid: '2901',
value: 'value' // static value, must be of type Buffer or string if set
});
}
function test12() {
bleno.on('stateChange', (state: string) => {});
bleno.on('advertisingStart', (error?: Error | null) => {});
bleno.on('advertisingStartError', (error: Error) => {});
bleno.on('advertisingStop', () => {});
bleno.on('servicesSet', (error?: Error | null) => {});
bleno.on('servicesSetError', (error: Error) => {});
bleno.on('accept', (clientAddress) => {}); // not available on OS X 10.9
bleno.on('disconnect', (clientAddress) => {}); // Linux only
bleno.on('rssiUpdate', (rssi) => {}); // not available on OS X 10.9
}
+102 -81
View File
@@ -3,126 +3,147 @@
// Definitions by: Manuel Francisco Naranjo <naranjo.manuel@gmail.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export class Characteristic {
uuid: any;
properties: any;
secure: any;
value: any;
descriptors: any;
/// <reference types="node" />
constructor(options: any);
type State = 'poweredOn' | 'poweredOff' | 'unauthorized' | 'unsupported' | 'unknown' | 'resetting';
type Property = 'read' | 'write' | 'indicate' | 'notify' | 'writeWithoutResponse';
interface CharacteristicOptions {
uuid: string;
properties?: ReadonlyArray<Property> | null;
secure?: ReadonlyArray<Property> | null;
value?: Buffer | null;
descriptors?: ReadonlyArray<Descriptor> | null;
onIndicate?: (() => void) | null;
onNotify?: (() => void) | null;
onReadRequest?: ((
offset: number,
callback: (result: number, data?: Buffer) => void
) => void) | null;
onSubscribe?: ((maxValueSize: number, updateValueCallback: any) => void) | null;
onUnsubscribe?: (() => void) | null;
onWriteRequest?: ((
data: Buffer,
offset: number,
withoutResponse: boolean,
callback: (result: number) => void
) => void) | null;
}
declare class Characteristic {
uuid: string;
properties: ReadonlyArray<Property>;
secure: ReadonlyArray<Property>;
value: Buffer | null;
descriptors: ReadonlyArray<Descriptor>;
constructor(options: CharacteristicOptions);
onIndicate(): void;
onNotify(): void;
onReadRequest(offset: any, callback: any): void;
onReadRequest(offset: number, callback: (result: number, data?: Buffer) => void): void;
onSubscribe(maxValueSize: any, updateValueCallback: any): void;
onSubscribe(maxValueSize: number, updateValueCallback: any): void;
onUnsubscribe(): void;
onWriteRequest(data: any, offset: any, withoutResponse: any, callback: any): void;
onWriteRequest(data: Buffer, offset: number, withoutResponse: boolean, callback: (result: number) => void): void;
toString(): any;
toString(): string;
static RESULT_ATTR_NOT_LONG: number;
readonly RESULT_ATTR_NOT_LONG: number;
static RESULT_INVALID_ATTRIBUTE_LENGTH: number;
readonly RESULT_INVALID_ATTRIBUTE_LENGTH: number;
static RESULT_INVALID_OFFSET: number;
readonly RESULT_INVALID_OFFSET: number;
static RESULT_SUCCESS: number;
readonly RESULT_SUCCESS: number;
static RESULT_UNLIKELY_ERROR: number;
readonly RESULT_UNLIKELY_ERROR: number;
static readonly RESULT_ATTR_NOT_LONG: number;
static readonly RESULT_INVALID_ATTRIBUTE_LENGTH: number;
static readonly RESULT_INVALID_OFFSET: number;
static readonly RESULT_SUCCESS: number;
static readonly RESULT_UNLIKELY_ERROR: number;
}
export class Descriptor {
uuid: any;
value: any;
constructor(options: any);
toString(): any;
interface DescriptorOptions {
uuid: string;
value?: Buffer | string | null;
}
export class PrimaryService {
uuid: any;
characteristics: any;
declare class Descriptor {
uuid: string;
value: Buffer;
constructor(options: any);
constructor(options: DescriptorOptions);
toString(): any;
toString(): string;
}
export const address: string;
interface PrimaryServiceOptions {
uuid: string;
characteristics?: ReadonlyArray<Characteristic> | null;
}
export const domain: any;
declare class PrimaryService {
uuid: string;
characteristics: ReadonlyArray<Characteristic>;
export const mtu: number;
constructor(options: PrimaryServiceOptions);
export const platform: string;
toString(): string;
}
export const rssi: number;
interface Bleno extends NodeJS.EventEmitter {
readonly Characteristic: typeof Characteristic;
readonly Descriptor: typeof Descriptor;
readonly PrimaryService: typeof PrimaryService;
export const state: string;
readonly address: string;
export function addListener(type: any, listener: any): any;
readonly mtu: number;
export function disconnect(): void;
readonly platform: string;
export function emit(type: any, ...args: any[]): any;
readonly rssi: number;
export function eventNames(): any;
readonly state: State;
export function getMaxListeners(): any;
disconnect(): void;
export function listenerCount(type: any): any;
setServices(services: ReadonlyArray<PrimaryService>, callback?: (arg: Error | undefined | null) => void): void;
export function listeners(type: any): any;
startAdvertising(name: string, serviceUuids?: ReadonlyArray<string>, callback?: (arg: Error | undefined | null) => void): void;
export function on(type: any, listener: any): any;
startAdvertisingIBeacon(uuid: string, major: number, minor: number, measuredPower: number, callback?: (arg: Error | undefined | null) => void): void;
export function onAccept(clientAddress: any): void;
startAdvertisingWithEIRData(advertisementData: Buffer, callback?: (arg: Error | undefined | null) => void): void;
startAdvertisingWithEIRData(advertisementData: Buffer, scanData: Buffer, callback?: (arg: Error | undefined | null) => void): void;
export function onAddressChange(address: any): void;
stopAdvertising(callback?: () => void): void;
export function onAdvertisingStart(error: any): void;
updateRssi(callback?: (err: null, rssi: number) => void): void;
export function onAdvertisingStop(): void;
on(event: 'stateChange', cb: (state: State) => void): this;
on(event: 'accept', cb: (address: string) => void): this;
on(event: 'mtuChange', cb: (mtu: number) => void): this;
on(event: 'disconnect', cb: (clientAddress: string) => void): this;
on(event: 'advertisingStart', cb: (err?: Error | null) => void): this;
on(event: 'advertisingStartError', cb: (err: Error) => void): this;
on(event: 'advertisingStop', cb: () => void): this;
on(event: 'servicesSet', cb: (err?: Error | null) => void): this;
on(event: 'servicesSetError', cb: (err: Error) => void): this;
on(event: 'rssiUpdate', cb: (rssi: number) => void): this;
}
export function onDisconnect(clientAddress: any): void;
export function onMtuChange(mtu: any): void;
export function onPlatform(platform: any): void;
export function onRssiUpdate(rssi: any): void;
export function onServicesSet(error: any): void;
export function onStateChange(state: any): void;
export function once(type: any, listener: any): any;
export function prependListener(type: any, listener: any): any;
export function prependOnceListener(type: any, listener: any): any;
export function removeAllListeners(type: any, ...args: any[]): any;
export function removeListener(type: any, listener: any): any;
export function setMaxListeners(n: any): any;
export function setServices(services: any, callback: any): void;
export function startAdvertising(name: any, serviceUuids: any, callback: any): void;
export function startAdvertisingIBeacon(uuid: any, major: any, minor: any, measuredPower: any, callback: any): void;
export function startAdvertisingWithEIRData(advertisementData: any, scanData: any, callback: any): void;
export function stopAdvertising(callback: any): void;
export function updateRssi(callback: any): void;
declare const bleno: Bleno;
export = bleno;
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"dt-header": false
"dt-header": false,
"unified-signatures": false
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ import Queue = require("bull");
const videoQueue = new Queue('video transcoding', 'redis://127.0.0.1:6379');
const audioQueue = new Queue('audio transcoding', {redis: {port: 6379, host: '127.0.0.1'}}); // Specify Redis connection using object
const imageQueue = new Queue('image transcoding');
const imageQueue: Queue.Queue<{ image: string }> = new Queue('image transcoding');
videoQueue.process((job, done) => {
// job.data contains the custom data passed when the job was created
+34 -33
View File
@@ -6,6 +6,7 @@
// Weeco <https://github.com/weeco>
// Gabriel Terwesten <https://github.com/blaugold>
// Oleg Repin <https://github.com/iamolegga>
// David Koblas <https://github.com/koblas>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -87,13 +88,13 @@ declare namespace Bull {
type JobId = number | string;
interface Job {
interface Job<T = any> {
id: JobId;
/**
* The custom data passed when the job was created
*/
data: any;
data: T;
/**
* How many attempts where made to run this job
@@ -258,7 +259,7 @@ declare namespace Bull {
next: number;
}
interface Queue {
interface Queue<T = any> {
/**
* Returns a promise that resolves when Redis is connected and the queue is ready to accept jobs.
* This replaces the `ready` event emitted on Queue in previous verisons.
@@ -276,7 +277,7 @@ declare namespace Bull {
* Errors will be passed as a second argument to the "failed" event;
* results, as a second argument to the "completed" event.
*/
process(callback: (job: Job, done: DoneCallback) => void): void;
process(callback: (job: Job<T>, done: DoneCallback) => void): void;
/**
* Defines a processing function for the jobs placed into a given Queue.
@@ -294,7 +295,7 @@ declare namespace Bull {
* If the promise is rejected, the error will be passed as a second argument to the "failed" event.
* If it is resolved, its value will be the "completed" event's second argument.
*/
process(callback: ((job: Job) => void) | string): Promise<any>;
process(callback: ((job: Job<T>) => void) | string): Promise<any>;
/**
* Defines a processing function for the jobs placed into a given Queue.
@@ -314,7 +315,7 @@ declare namespace Bull {
*
* @param concurrency Bull will then call you handler in parallel respecting this max number.
*/
process(concurrency: number, callback: ((job: Job) => void) | string): Promise<any>;
process(concurrency: number, callback: ((job: Job<T>) => void) | string): Promise<any>;
/**
* Defines a processing function for the jobs placed into a given Queue.
@@ -329,7 +330,7 @@ declare namespace Bull {
*
* @param concurrency Bull will then call you handler in parallel respecting this max number.
*/
process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void;
process(concurrency: number, callback: (job: Job<T>, done: DoneCallback) => void): void;
/**
* Defines a named processing function for the jobs placed into a given Queue.
@@ -350,7 +351,7 @@ declare namespace Bull {
* @param name Bull will only call the handler if the job name matches
*/
// tslint:disable-next-line:unified-signatures
process(name: string, callback: ((job: Job) => void) | string): Promise<any>;
process(name: string, callback: ((job: Job<T>) => void) | string): Promise<any>;
/**
* Defines a processing function for the jobs placed into a given Queue.
@@ -366,7 +367,7 @@ declare namespace Bull {
* @param name Bull will only call the handler if the job name matches
*/
// tslint:disable-next-line:unified-signatures
process(name: string, callback: (job: Job, done: DoneCallback) => void): void;
process(name: string, callback: (job: Job<T>, done: DoneCallback) => void): void;
/**
* Defines a named processing function for the jobs placed into a given Queue.
@@ -387,7 +388,7 @@ declare namespace Bull {
* @param name Bull will only call the handler if the job name matches
* @param concurrency Bull will then call you handler in parallel respecting this max number.
*/
process(name: string, concurrency: number, callback: ((job: Job) => void) | string): Promise<any>;
process(name: string, concurrency: number, callback: ((job: Job<T>) => void) | string): Promise<any>;
/**
* Defines a processing function for the jobs placed into a given Queue.
@@ -403,21 +404,21 @@ declare namespace Bull {
* @param name Bull will only call the handler if the job name matches
* @param concurrency Bull will then call you handler in parallel respecting this max number.
*/
process(name: string, concurrency: number, callback: (job: Job, done: DoneCallback) => void): void;
process(name: string, concurrency: number, callback: (job: Job<T>, done: DoneCallback) => void): void;
/**
* Creates a new job and adds it to the queue.
* If the queue is empty the job will be executed directly,
* otherwise it will be placed in the queue and executed as soon as possible.
*/
add(data: any, opts?: JobOptions): Promise<Job>;
add(data: T, opts?: JobOptions): Promise<Job<T>>;
/**
* Creates a new named job and adds it to the queue.
* If the queue is empty the job will be executed directly,
* otherwise it will be placed in the queue and executed as soon as possible.
*/
add(name: string, data: any, opts?: JobOptions): Promise<Job>;
add(name: string, data: T, opts?: JobOptions): Promise<Job<T>>;
/**
* Returns a promise that resolves when the queue is paused.
@@ -466,32 +467,32 @@ declare namespace Bull {
* Returns a promise that will return the job instance associated with the jobId parameter.
* If the specified job cannot be located, the promise callback parameter will be set to null.
*/
getJob(jobId: JobId): Promise<Job>;
getJob(jobId: JobId): Promise<Job<T>>;
/**
* Returns a promise that will return an array with the waiting jobs between start and end.
*/
getWaiting(start?: number, end?: number): Promise<Job[]>;
getWaiting(start?: number, end?: number): Promise<Array<Job<T>>>;
/**
* Returns a promise that will return an array with the active jobs between start and end.
*/
getActive(start?: number, end?: number): Promise<Job[]>;
getActive(start?: number, end?: number): Promise<Array<Job<T>>>;
/**
* Returns a promise that will return an array with the delayed jobs between start and end.
*/
getDelayed(start?: number, end?: number): Promise<Job[]>;
getDelayed(start?: number, end?: number): Promise<Array<Job<T>>>;
/**
* Returns a promise that will return an array with the completed jobs between start and end.
*/
getCompleted(start?: number, end?: number): Promise<Job[]>;
getCompleted(start?: number, end?: number): Promise<Array<Job<T>>>;
/**
* Returns a promise that will return an array with the failed jobs between start and end.
*/
getFailed(start?: number, end?: number): Promise<Job[]>;
getFailed(start?: number, end?: number): Promise<Array<Job<T>>>;
/**
* Returns JobInformation of repeatable jobs (ordered descending). Provide a start and/or an end
@@ -502,7 +503,7 @@ declare namespace Bull {
/**
* ???
*/
nextRepeatableJob(name: string, data: any, opts: JobOptions): Promise<Job>;
nextRepeatableJob(name: string, data: any, opts: JobOptions): Promise<Job<T>>;
/**
* Removes a given repeatable job. The RepeatOptions and JobId needs to be the same as the ones
@@ -565,7 +566,7 @@ declare namespace Bull {
* @param status Status of the job to clean. Values are completed, wait, active, delayed, and failed. Defaults to completed.
* @param limit Maximum amount of jobs to clean per call. If not provided will clean all matching jobs.
*/
clean(grace: number, status?: JobStatus, limit?: number): Promise<Job[]>;
clean(grace: number, status?: JobStatus, limit?: number): Promise<Array<Job<T>>>;
/**
* Listens to queue events
@@ -580,28 +581,28 @@ declare namespace Bull {
/**
* A job has started. You can use `jobPromise.cancel()` to abort it
*/
on(event: 'active', callback: ActiveEventCallback): this;
on(event: 'active', callback: ActiveEventCallback<T>): this;
/**
* A job has been marked as stalled.
* This is useful for debugging job workers that crash or pause the event loop.
*/
on(event: 'stalled', callback: StalledEventCallback): this;
on(event: 'stalled', callback: StalledEventCallback<T>): this;
/**
* A job's progress was updated
*/
on(event: 'progress', callback: ProgressEventCallback): this;
on(event: 'progress', callback: ProgressEventCallback<T>): this;
/**
* A job successfully completed with a `result`
*/
on(event: 'completed', callback: CompletedEventCallback): this;
on(event: 'completed', callback: CompletedEventCallback<T>): this;
/**
* A job failed with `err` as the reason
*/
on(event: 'failed', callback: FailedEventCallback): this;
on(event: 'failed', callback: FailedEventCallback<T>): this;
/**
* The queue has been paused
@@ -619,7 +620,7 @@ declare namespace Bull {
*
* @see Queue#clean() for details
*/
on(event: 'cleaned', callback: CleanedEventCallback): this;
on(event: 'cleaned', callback: CleanedEventCallback<T>): this;
}
type EventCallback = () => void;
@@ -633,17 +634,17 @@ declare namespace Bull {
cancel(): void;
}
type ActiveEventCallback = (job: Job, jobPromise?: JobPromise) => void;
type ActiveEventCallback<T = any> = (job: Job<T>, jobPromise?: JobPromise) => void;
type StalledEventCallback = (job: Job) => void;
type StalledEventCallback<T = any> = (job: Job<T>) => void;
type ProgressEventCallback = (job: Job, progress: any) => void;
type ProgressEventCallback<T = any> = (job: Job<T>, progress: any) => void;
type CompletedEventCallback = (job: Job, result: any) => void;
type CompletedEventCallback<T = any> = (job: Job<T>, result: any) => void;
type FailedEventCallback = (job: Job, error: Error) => void;
type FailedEventCallback<T = any> = (job: Job<T>, error: Error) => void;
type CleanedEventCallback = (jobs: Job[], status: JobStatus) => void;
type CleanedEventCallback<T = any> = (jobs: Array<Job<T>>, status: JobStatus) => void;
}
export = Bull;
+1
View File
@@ -514,6 +514,7 @@ declare namespace Chart {
ticks?: TickOptions;
gridLines?: GridLineOptions;
barThickness?: number;
maxBarThickness?: number;
scaleLabel?: ScaleTitleOptions;
offset?: boolean;
beforeUpdate?(scale?: any): void;
+1 -1
View File
@@ -247,7 +247,7 @@ new Chartist.Pie('.ct-chart', {
value: 70,
name: 'Series 3',
className: 'my-custom-class-three',
meta: 'Meta Three'
meta: { description: 'Meta Three' }
}]
});
+2 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for Chartist v0.9.81
// Project: https://github.com/gionkunz/chartist-js
// Definitions by: Matt Gibbs <https://github.com/mtgibbs>, Simon Pfeifer <https://github.com/psimonski>, Cassey Lottman <https://github.com/clottman>, Anastasiia Antonova <https://github.com/affilnost>
// Definitions by: Matt Gibbs <https://github.com/mtgibbs>, Simon Pfeifer <https://github.com/psimonski>, Cassey Lottman <https://github.com/clottman>, Anastasiia Antonova <https://github.com/affilnost>, Sunny Juneja <https://github.com/sunnyrjuneja>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace Chartist {
@@ -101,7 +101,7 @@ declare namespace Chartist {
value?: number;
data?: Array<number>;
className?: string;
meta?: string; // I assume this could probably be a number as well?
meta?: any;
}
interface IChartistBase<T extends IChartOptions> {
+5781
View File
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,3 @@
import runtime = chrome.app.runtime;
import cwindow = chrome.app.window;
@@ -44,7 +42,7 @@ var visibleEverywhere: boolean = chrome.app.window.canSetVisibleOnAllWorkspaces(
function test_fileSystem(): void {
var accepts: chrome.fileSystem.AcceptOptions[] = [
{mimeTypes: ["text/*"], extensions: ['js', 'css', 'txt', 'html', 'xml', 'tsv', 'csv', 'rtf']}
{ mimeTypes: ["text/*"], extensions: ['js', 'css', 'txt', 'html', 'xml', 'tsv', 'csv', 'rtf'] }
];
var chooseOption: chrome.fileSystem.ChooseEntryOptions = {
type: "openFile",
@@ -58,13 +56,13 @@ function test_fileSystem(): void {
var retainedId = chrome.fileSystem.retainEntry(entry);
chrome.fileSystem.isRestorable(retainedId, (isRestorable: boolean) => {
if(isRestorable){
if (isRestorable) {
chrome.fileSystem.restoreEntry(retainedId, (restoredEntry: Entry) => { });
}
});
chrome.fileSystem.getWritableEntry(entry, (writableEntry: Entry) => {});
chrome.fileSystem.isWritableEntry(entry, (isWritable: boolean) => {});
chrome.fileSystem.getWritableEntry(entry, (writableEntry: Entry) => { });
chrome.fileSystem.isWritableEntry(entry, (isWritable: boolean) => { });
});
}
@@ -325,3 +323,6 @@ function testSystemNetwork() {
}
});
}
import webview = chrome.webview;
let element: webview.HTMLWebViewElement;
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es2017",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"test/index.ts"
]
}
+79
View File
@@ -0,0 +1,79 @@
{
"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
}
}
-1503
View File
File diff suppressed because it is too large Load Diff
-109
View File
@@ -1,109 +0,0 @@
/// <reference path="chrome-app.d.ts" />
// Project: http://developer.chrome.com/apps/
// Definitions by: Nikolai Ommundsen <https://github.com/niikoo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
//
// WebView ref: https://chromium.googlesource.com/chromium/src/+/64.0.3274.2/chrome/common/extensions/api/webview_tag.json
//
///////////////////
// <webview> Tag
///////////////////
/**
* Use the <code>webview</code> tag to actively load live content from the web over the network and embed it in your Chrome App. Your app can control the appearance of the <code>webview</code> and interact with the web content, initiate navigations in an embedded web page, react to error events that happen within it, and more (see <a href=\"#usage\">Usage</a>).
*/
declare namespace chrome.webviewTag {
/** Options that determine what data should be cleared by `clearData`. */
export interface ClearDataOptions {
/** Clear data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript <code>Date</code> object). If absent, defaults to <code>0</code> (which would remove all browsing data). */
since: number;
}
export interface WindowEvent extends chrome.events.Event<() => void> {}
export interface ConsoleEvent extends Event {
/**
* @description The severity level of the log message. Ranges from 0 to 4.
* @type {number}
* @memberof ConsoleEvent
*/
level: number,
/**
* @description The logged message contents.
* @type {string}
* @memberof ConsoleEvent
*/
message: string,
/**
* @description The line number of the message source.
* @type {number}
* @memberof ConsoleEvent
*/
line: number,
/**
* @description A string identifying the resource which logged the message.
* @type {string}
* @memberof ConsoleEvent
*/
sourceId: string
}
/** Description of a declarative rule for handling events. */
export interface Rule {
/** Optional priority of this rule. Defaults to 100. */
priority?: number;
/** List of conditions that can trigger the actions. */
conditions: any[];
/** Optional. Optional identifier that allows referencing this rule. */
id?: string;
/** List of actions that are triggered if one of the condtions is fulfilled. */
actions: any[];
/**
* @description Tags can be used to annotate rules and perform operations on sets of rules.¨
* @since Chrome 28
* @type {string[]}
* @memberof Rule
*/
tags?: string[];
}
/**
* @description Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
* @export
* @interface InjectDetails
*/
export interface InjectDetails {
/**
* @description JavaScript or CSS code to inject.<br><br><b>Warning:</b><br>Be careful using the <code>code</code> parameter. Incorrect use of it may open your app to <a href=\"https://en.wikipedia.org/wiki/Cross-site_scripting\">cross site scripting</a> attacks.
* @type {string}
* @memberof InjectDetails
*/
code?: string,
/**
* @description JavaScript or CSS file to inject.
* @type {string}
* @memberof InjectDetails
*/
file?: string
}
export interface WebViewElementEventMap extends ElementEventMap {
'message': ConsoleEvent
}
/**
* @description
* @export
* @interface HTMLWebViewElement
* @extends {Element}
*/
export interface HTMLWebViewElement extends Element {
executeScript?: (details: InjectDetails, callback?: (result: any) => void) => void,
src: string,
contentWindow: Window
addEventListener<K extends keyof WebViewElementEventMap>(type: K, listener: (this: HTMLWebViewElement, ev: WebViewElementEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
}
+140 -138
View File
@@ -135,7 +135,7 @@ declare namespace chrome.alarms {
name: string;
}
export interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => void> {}
export interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => void> { }
/**
* Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.
@@ -195,7 +195,9 @@ declare namespace chrome.alarms {
export var onAlarm: AlarmEvent;
}
////////////////////
// Browser
////////////////////
/**
* Use the chrome.browser API to interact with the Chrome browser associated with
* the current application and Chrome profile.
@@ -282,19 +284,19 @@ declare namespace chrome.bookmarks {
childIds: string[];
}
export interface BookmarkRemovedEvent extends chrome.events.Event<(id: string, removeInfo: BookmarkRemoveInfo) => void> {}
export interface BookmarkRemovedEvent extends chrome.events.Event<(id: string, removeInfo: BookmarkRemoveInfo) => void> { }
export interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> {}
export interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> { }
export interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: BookmarkMoveInfo) => void> {}
export interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: BookmarkMoveInfo) => void> { }
export interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> {}
export interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> { }
export interface BookmarkChangedEvent extends chrome.events.Event<(id: string, changeInfo: BookmarkChangeInfo) => void> {}
export interface BookmarkChangedEvent extends chrome.events.Event<(id: string, changeInfo: BookmarkChangeInfo) => void> { }
export interface BookmarkCreatedEvent extends chrome.events.Event<(id: string, bookmark: BookmarkTreeNode) => void> {}
export interface BookmarkCreatedEvent extends chrome.events.Event<(id: string, bookmark: BookmarkTreeNode) => void> { }
export interface BookmarkChildrenReordered extends chrome.events.Event<(id: string, reorderInfo: BookmarkReorderInfo) => void> {}
export interface BookmarkChildrenReordered extends chrome.events.Event<(id: string, reorderInfo: BookmarkReorderInfo) => void> { }
export interface BookmarkSearchQuery {
query?: string;
@@ -480,7 +482,7 @@ declare namespace chrome.browserAction {
popup: string;
}
export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> { }
/**
* Since Chrome 22.
@@ -737,7 +739,7 @@ declare namespace chrome.commands {
shortcut?: string;
}
export interface CommandEvent extends chrome.events.Event<(command: string) => void> {}
export interface CommandEvent extends chrome.events.Event<(command: string) => void> { }
/**
* Returns all the registered extension commands for this extension and their shortcut (if active).
@@ -1062,7 +1064,7 @@ declare namespace chrome.contextMenus {
type?: string;
}
export interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> {}
export interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> { }
/**
* Since Chrome 38.
@@ -1223,7 +1225,7 @@ declare namespace chrome.cookies {
cause: string;
}
export interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> {}
export interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> { }
/**
* Lists all existing cookie stores.
@@ -1327,9 +1329,9 @@ declare module chrome {
faviconUrl?: string;
}
export interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> {}
export interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> { }
export interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {}
export interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> { }
/**
* Attaches debugger to the given target.
@@ -1374,7 +1376,7 @@ declare module chrome {
export var onEvent: DebuggerEventEvent;
}
export {_debugger as debugger}
export { _debugger as debugger }
}
////////////////////
// Declarative Content
@@ -1443,14 +1445,14 @@ declare namespace chrome.declarativeContent {
/** Matches the state of a web page by various criteria. */
export class PageStateMatcher {
constructor(options: PageStateMatcherProperties);
constructor (options: PageStateMatcherProperties);
}
/** Declarative event action that shows the extension's page action while the corresponding conditions are met. */
export class ShowPageAction {}
export class ShowPageAction { }
/** Provides the Declarative Event API consisting of addRules, removeRules, and getRules. */
export interface PageChangedEvent extends chrome.events.Event<() => void> {}
export interface PageChangedEvent extends chrome.events.Event<() => void> { }
export var onPageChanged: PageChangedEvent;
}
@@ -1559,7 +1561,7 @@ declare namespace chrome.declarativeWebRequest {
filter: RequestCookie;
}
export interface RequestedEvent extends chrome.events.Event<Function> {}
export interface RequestedEvent extends chrome.events.Event<Function> { }
export var onRequest: RequestedEvent;
}
@@ -1660,9 +1662,9 @@ declare namespace chrome.devtools.inspectedWindow {
value: string;
}
export interface ResourceAddedEvent extends chrome.events.Event<(resource: Resource) => void> {}
export interface ResourceAddedEvent extends chrome.events.Event<(resource: Resource) => void> { }
export interface ResourceContentCommittedEvent extends chrome.events.Event<(resource: Resource, content: string) => void> {}
export interface ResourceContentCommittedEvent extends chrome.events.Event<(resource: Resource, content: string) => void> { }
/** The ID of the tab being inspected. This ID may be used with chrome.tabs.* API. */
export var tabId: number;
@@ -1734,9 +1736,9 @@ declare namespace chrome.devtools.network {
getContent(callback: (content: string, encoding: string) => void): void;
}
export interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> {}
export interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> { }
export interface NavigatedEvent extends chrome.events.Event<(url: string) => void> {}
export interface NavigatedEvent extends chrome.events.Event<(url: string) => void> { }
/**
* Returns HAR log that contains all known network requests.
@@ -1761,11 +1763,11 @@ declare namespace chrome.devtools.network {
* Availability: Since Chrome 18.
*/
declare namespace chrome.devtools.panels {
export interface PanelShownEvent extends chrome.events.Event<(window: Window) => void> {}
export interface PanelShownEvent extends chrome.events.Event<(window: Window) => void> { }
export interface PanelHiddenEvent extends chrome.events.Event<() => void> {}
export interface PanelHiddenEvent extends chrome.events.Event<() => void> { }
export interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> {}
export interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> { }
/** Represents a panel created by extension. */
export interface ExtensionPanel {
@@ -1784,7 +1786,7 @@ declare namespace chrome.devtools.panels {
onSearch: PanelSearchEvent;
}
export interface ButtonClickedEvent extends chrome.events.Event<() => void> {}
export interface ButtonClickedEvent extends chrome.events.Event<() => void> { }
/** A button created by the extension. */
export interface Button {
@@ -1799,7 +1801,7 @@ declare namespace chrome.devtools.panels {
onClicked: ButtonClickedEvent;
}
export interface SelectionChangedEvent extends chrome.events.Event<() => void> {}
export interface SelectionChangedEvent extends chrome.events.Event<() => void> { }
/** Represents the Elements panel. */
export interface ElementsPanel {
@@ -1834,9 +1836,9 @@ declare namespace chrome.devtools.panels {
onSelectionChanged: SelectionChangedEvent;
}
export interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {}
export interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> { }
export interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> {}
export interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> { }
/** A sidebar created by the extension. */
export interface ExtensionSidebarPane {
@@ -2152,13 +2154,13 @@ declare namespace chrome.downloads {
conflictAction?: string;
}
export interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: DownloadDelta) => void> {}
export interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: DownloadDelta) => void> { }
export interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: DownloadItem) => void> {}
export interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: DownloadItem) => void> { }
export interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> {}
export interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> { }
export interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void> {}
export interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void> { }
/**
* Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page.
@@ -2507,7 +2509,7 @@ declare namespace chrome.extension {
message: string;
}
export interface OnRequestEvent extends chrome.events.Event<((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void) | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)> {}
export interface OnRequestEvent extends chrome.events.Event<((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void) | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)> { }
/**
* Since Chrome 7.
@@ -2618,7 +2620,7 @@ declare namespace chrome.fileBrowserHandler {
entries: any[];
}
export interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void> {}
export interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void> { }
/**
* Prompts user to select file path under which file should be saved. When the file is selected, file access permission required to use the file (read, write and create) are granted to the caller. The file will not actually get created during the function call, so function caller must ensure its existence before using it. The function has to be invoked with a user gesture.
@@ -2864,33 +2866,33 @@ declare namespace chrome.fileSystemProvider {
operationRequestId: number;
}
export interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> {}
export interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> { }
export interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {}
export interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> { }
export interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {}
export interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> { }
export interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { }
export interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> {}
export interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> { }
/**
* Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string.
@@ -3051,13 +3053,13 @@ declare namespace chrome.fontSettings {
fontId: string;
}
export interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
export interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> { }
export interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
export interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> { }
export interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
export interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> { }
export interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> {}
export interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> { }
/**
* Sets the default font size.
@@ -3199,11 +3201,11 @@ declare namespace chrome.gcm {
detail: Object;
}
export interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> {}
export interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> { }
export interface MessageDeletionEvent extends chrome.events.Event<() => void> {}
export interface MessageDeletionEvent extends chrome.events.Event<() => void> { }
export interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> {}
export interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> { }
/** The maximum size (in bytes) of all key/value pairs in a message. */
export var MAX_MESSAGE_SIZE: number;
@@ -3311,9 +3313,9 @@ declare namespace chrome.history {
urls?: string[];
}
export interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> {}
export interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> { }
export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {}
export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> { }
/**
* Searches the history for the last visit time of each page matching the query.
@@ -3473,7 +3475,7 @@ declare namespace chrome.identity {
interactive?: boolean;
}
export interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> {}
export interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> { }
/**
* Retrieves a list of AccountInfo objects describing the accounts present on the profile.
@@ -3540,7 +3542,7 @@ declare namespace chrome.identity {
* @since Chrome 6.
*/
declare namespace chrome.idle {
export interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> {}
export interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> { }
/**
* Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise.
@@ -3829,25 +3831,25 @@ declare namespace chrome.input.ime {
anchor: number;
}
export interface BlurEvent extends chrome.events.Event<(contextID: number) => void> {}
export interface BlurEvent extends chrome.events.Event<(contextID: number) => void> { }
export interface CandidateClickedEvent extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void> {}
export interface CandidateClickedEvent extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void> { }
export interface KeyEventEvent extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent) => void> {}
export interface KeyEventEvent extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent) => void> { }
export interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> {}
export interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> { }
export interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> {}
export interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> { }
export interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> {}
export interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> { }
export interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> {}
export interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> { }
export interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> {}
export interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> { }
export interface SurroundingTextChangedEvent extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void> {}
export interface SurroundingTextChangedEvent extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void> { }
export interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> {}
export interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> { }
/**
* Adds the provided menu items to the language menu when this IME is active.
@@ -4079,13 +4081,13 @@ declare namespace chrome.management {
showConfirmDialog?: boolean;
}
export interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
export interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { }
export interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> {}
export interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> { }
export interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
export interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { }
export interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {}
export interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { }
/**
* Enables or disables an app or extension.
@@ -4232,7 +4234,7 @@ declare namespace chrome.networking.config {
Security?: string;
}
export interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> {}
export interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> { }
/**
* Allows an extension to define network filters for the networks it can handle. A call to this function will remove all filters previously installed by the extension before setting the new list.
@@ -4337,15 +4339,15 @@ declare namespace chrome.notifications {
requireInteraction?: boolean;
}
export interface NotificationClosedEvent extends chrome.events.Event<(notificationId: string, byUser: boolean) => void> {}
export interface NotificationClosedEvent extends chrome.events.Event<(notificationId: string, byUser: boolean) => void> { }
export interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> {}
export interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> { }
export interface NotificationButtonClickedEvent extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void> {}
export interface NotificationButtonClickedEvent extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void> { }
export interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> {}
export interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> { }
export interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> {}
export interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> { }
/** The notification closed, either by the system or by user action. */
export var onClosed: NotificationClosedEvent;
@@ -4445,13 +4447,13 @@ declare namespace chrome.omnibox {
description: string;
}
export interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> {}
export interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> { }
export interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> {}
export interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> { }
export interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> {}
export interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> { }
export interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> {}
export interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> { }
/**
* Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.
@@ -4478,7 +4480,7 @@ declare namespace chrome.omnibox {
* @since Chrome 5.
*/
declare namespace chrome.pageAction {
export interface PageActionClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
export interface PageActionClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> { }
export interface TitleDetails {
/** The id of the tab for which you want to modify the page action. */
@@ -4787,13 +4789,13 @@ declare namespace chrome.printerProvider {
document: Blob;
}
export interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> {}
export interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> { }
export interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> {}
export interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> { }
export interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> {}
export interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> { }
export interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> {}
export interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> { }
/** Event fired when print manager requests printers provided by extensions. */
export var onGetPrintersRequested: PrinterRequestedEvent;
@@ -4930,7 +4932,7 @@ declare namespace chrome.proxy {
fatal: boolean;
}
export interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> {}
export interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> { }
export var settings: chrome.types.ChromeSetting;
/** Notifies about proxy errors. */
@@ -5060,21 +5062,21 @@ declare namespace chrome.runtime {
version: string;
}
export interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> {}
export interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> { }
export interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> {}
export interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> { }
export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> {}
export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> { }
export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> {}
export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { }
export interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> {}
export interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> { }
export interface RuntimeEvent extends chrome.events.Event<() => void> {}
export interface RuntimeEvent extends chrome.events.Event<() => void> { }
export interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> {}
export interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> { }
export interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> {}
export interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> { }
export interface ManifestIcons {
[size: number]: string;
@@ -5462,7 +5464,7 @@ declare namespace chrome.scriptBadge {
popup: string;
}
export interface ScriptBadgeClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
export interface ScriptBadgeClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> { }
export function getPopup(details: GetPopupDetails, callback: Function): void;
export function getAttention(details: AttentionDetails): void;
@@ -5510,7 +5512,7 @@ declare namespace chrome.sessions {
sessions: Session[];
}
export interface SessionChangedEvent extends chrome.events.Event<() => void> {}
export interface SessionChangedEvent extends chrome.events.Event<() => void> { }
/** The maximum number of sessions.Session that will be included in a requested list. */
export var MAX_SESSION_RESULTS: number;
@@ -5646,7 +5648,7 @@ declare namespace chrome.storage {
MAX_WRITE_OPERATIONS_PER_MINUTE: number;
}
export interface StorageChangedEvent extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: string) => void> {}
export interface StorageChangedEvent extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: string) => void> { }
/** Items in the local storage area are local to each machine. */
export var local: LocalStorageArea;
@@ -5820,9 +5822,9 @@ declare namespace chrome.system.storage {
availableCapacity: number;
}
export interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> {}
export interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> { }
export interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> {}
export interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> { }
/** Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects. */
export function getInfo(callback: (info: StorageUnitInfo[]) => void): void;
@@ -5876,7 +5878,7 @@ declare namespace chrome.tabCapture {
videoConstraints?: MediaStreamConstraints;
}
export interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> {}
export interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> { }
/**
* Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension.
@@ -6364,27 +6366,27 @@ declare namespace chrome.tabs {
zoomSettings: ZoomSettings;
}
export interface TabHighlightedEvent extends chrome.events.Event<(highlightInfo: HighlightInfo) => void> {}
export interface TabHighlightedEvent extends chrome.events.Event<(highlightInfo: HighlightInfo) => void> { }
export interface TabRemovedEvent extends chrome.events.Event<(tabId: number, removeInfo: TabRemoveInfo) => void> {}
export interface TabRemovedEvent extends chrome.events.Event<(tabId: number, removeInfo: TabRemoveInfo) => void> { }
export interface TabUpdatedEvent extends chrome.events.Event<(tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void> {}
export interface TabUpdatedEvent extends chrome.events.Event<(tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void> { }
export interface TabAttachedEvent extends chrome.events.Event<(tabId: number, attachInfo: TabAttachInfo) => void> {}
export interface TabAttachedEvent extends chrome.events.Event<(tabId: number, attachInfo: TabAttachInfo) => void> { }
export interface TabMovedEvent extends chrome.events.Event<(tabId: number, moveInfo: TabMoveInfo) => void> {}
export interface TabMovedEvent extends chrome.events.Event<(tabId: number, moveInfo: TabMoveInfo) => void> { }
export interface TabDetachedEvent extends chrome.events.Event<(tabId: number, detachInfo: TabDetachInfo) => void> {}
export interface TabDetachedEvent extends chrome.events.Event<(tabId: number, detachInfo: TabDetachInfo) => void> { }
export interface TabCreatedEvent extends chrome.events.Event<(tab: Tab) => void> {}
export interface TabCreatedEvent extends chrome.events.Event<(tab: Tab) => void> { }
export interface TabActivatedEvent extends chrome.events.Event<(activeInfo: TabActiveInfo) => void> {}
export interface TabActivatedEvent extends chrome.events.Event<(activeInfo: TabActiveInfo) => void> { }
export interface TabReplacedEvent extends chrome.events.Event<(addedTabId: number, removedTabId: number) => void> {}
export interface TabReplacedEvent extends chrome.events.Event<(addedTabId: number, removedTabId: number) => void> { }
export interface TabSelectedEvent extends chrome.events.Event<(tabId: number, selectInfo: TabWindowInfo) => void> {}
export interface TabSelectedEvent extends chrome.events.Event<(tabId: number, selectInfo: TabWindowInfo) => void> { }
export interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> {}
export interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> { }
/**
* Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.
@@ -6872,7 +6874,7 @@ declare namespace chrome.ttsEngine {
pitch?: number;
}
export interface TtsEngineSpeakEvent extends chrome.events.Event<(utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void> {}
export interface TtsEngineSpeakEvent extends chrome.events.Event<(utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void> { }
/** Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object. */
export var onSpeak: TtsEngineSpeakEvent;
@@ -6956,7 +6958,7 @@ declare namespace chrome.types {
incognitoSpecific?: boolean;
}
export interface ChromeSettingChangedEvent extends chrome.events.Event<DetailsCallback> {}
export interface ChromeSettingChangedEvent extends chrome.events.Event<DetailsCallback> { }
/** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */
export interface ChromeSetting {
@@ -7013,15 +7015,15 @@ declare namespace chrome.vpnProvider {
dnsServer: string[];
}
export interface VpnPlatformMessageEvent extends chrome.events.Event<(id: string, message: string, error: string) => void> {}
export interface VpnPlatformMessageEvent extends chrome.events.Event<(id: string, message: string, error: string) => void> { }
export interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> {}
export interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> { }
export interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> {}
export interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> { }
export interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> {}
export interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> { }
export interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> {}
export interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> { }
/**
* Creates a new VPN configuration that persists across multiple login sessions of the user.
@@ -7219,17 +7221,17 @@ declare namespace chrome.webNavigation {
addListener(callback: (details: T) => void, filters?: WebNavigationEventFilter): void;
}
export interface WebNavigationFramedEvent extends WebNavigationEvent<WebNavigationFramedCallbackDetails> {}
export interface WebNavigationFramedEvent extends WebNavigationEvent<WebNavigationFramedCallbackDetails> { }
export interface WebNavigationFramedErrorEvent extends WebNavigationEvent<WebNavigationFramedErrorCallbackDetails> {}
export interface WebNavigationFramedErrorEvent extends WebNavigationEvent<WebNavigationFramedErrorCallbackDetails> { }
export interface WebNavigationSourceEvent extends WebNavigationEvent<WebNavigationSourceCallbackDetails> {}
export interface WebNavigationSourceEvent extends WebNavigationEvent<WebNavigationSourceCallbackDetails> { }
export interface WebNavigationParentedEvent extends WebNavigationEvent<WebNavigationParentedCallbackDetails> {}
export interface WebNavigationParentedEvent extends WebNavigationEvent<WebNavigationParentedCallbackDetails> { }
export interface WebNavigationTransitionalEvent extends WebNavigationEvent<WebNavigationTransitionCallbackDetails> {}
export interface WebNavigationTransitionalEvent extends WebNavigationEvent<WebNavigationTransitionCallbackDetails> { }
export interface WebNavigationReplacementEvent extends WebNavigationEvent<WebNavigationReplacementCallbackDetails> {}
export interface WebNavigationReplacementEvent extends WebNavigationEvent<WebNavigationReplacementCallbackDetails> { }
/**
* Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID.
@@ -7463,17 +7465,17 @@ declare namespace chrome.webRequest {
addListener(callback: (details: T) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
}
export interface WebResponseHeadersEvent extends _WebResponseHeadersEvent<WebResponseHeadersDetails> {}
export interface WebResponseHeadersEvent extends _WebResponseHeadersEvent<WebResponseHeadersDetails> { }
export interface WebResponseCacheEvent extends _WebResponseHeadersEvent<WebResponseCacheDetails> {}
export interface WebResponseCacheEvent extends _WebResponseHeadersEvent<WebResponseCacheDetails> { }
export interface WebRedirectionResponseEvent extends _WebResponseHeadersEvent<WebRedirectionResponseDetails> {}
export interface WebRedirectionResponseEvent extends _WebResponseHeadersEvent<WebRedirectionResponseDetails> { }
export interface WebAuthenticationChallengeEvent extends chrome.events.Event<(details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void> {
addListener(callback: (details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void;
}
export interface WebResponseErrorEvent extends _WebResponseHeadersEvent<WebResponseErrorDetails> {}
export interface WebResponseErrorEvent extends _WebResponseHeadersEvent<WebResponseErrorDetails> { }
/**
* The maximum number of times that handlerBehaviorChanged can be called per 10 minute sustained interval. handlerBehaviorChanged is an expensive function call that shouldn't be called often.
@@ -7588,9 +7590,9 @@ declare namespace chrome.webstore {
*/
export function install(failureCallback?: (error: string, errorCode?: string) => void): void;
export interface InstallationStageEvent extends chrome.events.Event<(stage: string) => void> {}
export interface InstallationStageEvent extends chrome.events.Event<(stage: string) => void> { }
export interface DownloadProgressEvent extends chrome.events.Event<(percentDownloaded: number) => void> {}
export interface DownloadProgressEvent extends chrome.events.Event<(percentDownloaded: number) => void> { }
/**
* Fired when an inline installation enters a new InstallStage. In order to receive notifications about this event, listeners must be registered before the inline installation begins.
@@ -7753,9 +7755,9 @@ declare namespace chrome.windows {
windowTypes: string[];
}
export interface WindowIdEvent extends chrome.events.Event<(windowId: number, filters?: WindowEventFilter) => void> {}
export interface WindowIdEvent extends chrome.events.Event<(windowId: number, filters?: WindowEventFilter) => void> { }
export interface WindowReferenceEvent extends chrome.events.Event<(window: Window, filters?: WindowEventFilter) => void> {}
export interface WindowReferenceEvent extends chrome.events.Event<(window: Window, filters?: WindowEventFilter) => void> { }
/**
* The windowId value that represents the current window.
-4
View File
@@ -1,4 +0,0 @@
import webview = chrome.webviewTag;
let element: webview.HTMLWebViewElement;
+1 -5
View File
@@ -19,11 +19,7 @@
},
"files": [
"index.d.ts",
"chrome-app.d.ts",
"chrome-webview.d.ts",
"chrome-cast/index.d.ts",
"test/index.ts",
"test/chrome-app.ts",
"test/chrome-webview.ts"
"test/index.ts"
]
}
@@ -0,0 +1,92 @@
import { Break, BreakClip } from "./cast.framework.messages";
export = cast.framework.breaks;
declare namespace cast.framework.breaks {
class BreakSeekData {
constructor(seekFrom: number, seekTo: number, breaks: Break[]);
/**
* List of breaks
*/
breaks: Break[];
/**
* 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;
}
}
+783
View File
@@ -0,0 +1,783 @@
import { EventType } from "./cast.framework.events";
import {
PlayerState,
PlayStringId,
ErrorType,
ErrorReason,
IdleReason,
MessageType,
Track,
TextTrackStyle,
QueueItem,
LoadRequestData,
QueueData,
Break,
LiveSeekableRange,
MediaInformation,
ErrorData,
RequestData
} from "./cast.framework.messages";
import { BreakManager } from "./cast.framework.breaks";
import { EventHandler, RequestHandler, BinaryHandler } from "./index";
import {
EventType as SystemEventType,
ApplicationData,
Sender,
StandbyState,
SystemState
} from "./cast.framework.system";
export = cast.framework;
type HTMLMediaElement = any;
declare namespace cast.framework {
type LoggerLevel =
| "DEBUG"
| "VERBOSE"
| "INFO"
| "WARNING"
| "ERROR"
| "NONE";
type ContentProtection = "NONE" | "CLEARKEY" | "PLAYREADY" | "WIDEVINE";
/**
* Manages text tracks.
*/
class TextTracksManager {
constructor(params?: any);
/**
* Adds text tracks to the list.
*/
addTracks(tracks: Track[]): void;
/**
* Creates a text track.
*/
createTrack(): Track;
/**
* Gets all active text ids.
*/
getActiveIds(): number[];
/**
* Gets all active text tracks.
*/
getActiveTracks(): Track[];
/**
* Returns the current text track style.
*/
getTextTracksStyle(): TextTrackStyle;
/**
* Gets text track by id.
*/
getTrackById(id: number): Track;
/**
* Returns all text tracks.
*/
getTracks(): Track[];
/**
* Gets text tracks by language.
*/
getTracksByLanguage(language: string): Track[];
/**
* Sets text tracks to be active by id.
*/
setActiveByIds(newIds: number[]): void;
/**
* Sets text tracks to be active by language.
*/
setActiveByLanguage(language: string): void;
/**
* Sets text track style.
*/
setTextTrackStyle(style: TextTrackStyle): void;
}
/**
* QueueManager exposes several queue manipulation APIs to developers.
*/
class QueueManager {
constructor(params?: any);
/**
* Returns the current queue item.
*/
getCurrentItem(): QueueItem;
/**
* Returns the index of the current queue item.
*/
getCurrentItemIndex(): number;
/**
* Returns the queue items.
*/
getItems(): QueueItem[];
/**
* Inserts items into the queue.
*/
insertItems(items: QueueItem[], insertBefore?: number): void;
/**
* Removes items from the queue.
*/
removeItems(itemIds: number[]): void;
/**
* Sets whether to limit the number of queue items to be reported in Media Status (default is true).
*/
setQueueStatusLimit(limitQueueItemsInStatus: boolean): void;
/**
* Updates existing queue items by matching itemId.
*/
updateItems(items: QueueItem[]): void;
}
/**
* Base implementation of a queue.
*/
class QueueBase {
/**
* Fetches a window of items using the specified item id as reference; called by the receiver MediaManager when it needs more queue items;
* often as a request from senders. If only one of nextCount and prevCount is non-zero; fetchItems should only return items after or before
* the reference item; if both nextCount and prevCount are non-zero; a window of items including the reference item should be returned.
*/
fetchItems(
itemId: number,
nextCount: number,
prevCount: number
): QueueItem[] | Promise<QueueItem[]>;
/**
* Initializes the queue with the requestData. This is called when a new LOAD request comes in to the receiver.
* If this returns or resolves to null; our default queueing implementation will create a queue based on queueData.items or the single media
* in the load request data.
*/
initialize(
requestData: LoadRequestData
): QueueData | Promise<QueueData>;
/**
* Returns next items after the reference item; often the end of the current queue; called by the receiver MediaManager.
*/
nextItems(itemId?: number): QueueItem[] | Promise<QueueItem[]>;
/**
* Sets the current item with the itemId; called by the receiver MediaManager when it changes the current playing item.
*/
onCurrentItemIdChanged(itemId: number): void;
/**
* A callback for informing the following items have been inserted into the receiver queue in this session.
* A cloud based implementation can optionally choose to update its queue based on the new information.
*/
onItemsInserted(items: QueueItem[], insertBefore?: number): void;
/**
* A callback for informing the following items have been removed from the receiver queue in this session.
* A cloud based implementation can optionally choose to update its queue based on the new information.
*/
onItemsRemoved(itemIds: number[]): void;
/**
* Returns previous items before the reference item; often at the beginning of the queue; called by the receiver MediaManager.
*/
prevItems(itemId?: number): QueueItem[] | Promise<QueueItem[]>;
/**
* Shuffles the queue and returns new queue items. Returns null if the operation is not supported.
*/
shuffle(): QueueItem[] | Promise<QueueItem[]>;
}
/**
* Controls and monitors media playback.
*/
class PlayerManager {
constructor(params?: any);
/**
* Adds an event listener for player event.
*/
addEventListener: (
eventType: EventType | EventType[],
eventListener: EventHandler
) => void;
/**
* Sends a media status message to all senders (broadcast). Applications use this to send a custom state change.
*/
broadcastStatus(
includeMedia?: boolean,
requestId?: number,
customData?: any,
includeQueueItems?: boolean
): void;
getAudioTracksManager(): AudioTracksManager;
/**
* Returns current time in sec in currently-playing break clip.
*/
getBreakClipCurrentTimeSec(): number;
/**
* Returns duration in sec of currently-playing break clip.
*/
getBreakClipDurationSec(): number;
/**
* Obtain the breaks (Ads) manager.
*/
getBreakManager(): BreakManager;
/**
* Returns list of breaks.
*/
getBreaks(): Break[];
/**
* Gets current time in sec of current media.
*/
getCurrentTimeSec(): number;
/**
* Gets duration in sec of currently playing media.
*/
getDurationSec(): number;
/**
* Returns live seekable range with start and end time in seconds. The values are media time based.
*/
getLiveSeekableRange(): LiveSeekableRange;
/**
* Gets media information of current media.
*/
getMediaInformation(): MediaInformation;
/**
* Returns playback configuration.
*/
getPlaybackConfig(): PlaybackConfig;
/**
* Returns current playback rate.
*/
getPlaybackRate(): number;
/**
* Gets player state.
*/
getPlayerState(): PlayerState;
/**
* Get the preferred playback rate. (Can be used on shutdown event to save latest preferred playback rate to a persistent storage;
* so it can be used in next session in the cast options).
*/
getPreferredPlaybackRate(): number;
/**
* Get the preferred text track language.
*/
getPreferredTextLanguage(): string;
/**
* Obtain QueueManager API.
*/
getQueueManager(): QueueManager;
getTextTracksManager(): TextTracksManager;
/**
* Loads media.
*/
load(loadRequest: LoadRequestData): Promise<void>;
/**
* Pauses currently playing media.
*/
pause(): void;
/**
* Plays currently paused media.
*/
play(): void;
/**
* Requests a text string to be played back locally on the receiver device.
*/
playString(stringId: PlayStringId, args?: string[]): Promise<ErrorData>;
/**
* Request Google Assistant to refresh the credentials. Only works if the original credentials came from the assistant.
*/
refreshCredentials(): Promise<void>;
/**
* Removes the event listener added for given player event. If event listener is not added; it will be ignored.
*/
removeEventListener(
eventType: EventType | EventType[],
eventListener: EventHandler
): void;
/**
* Seeks in current media.
*/
seek(seekTime: number): void;
/**
* Sends an error to a specific sender
*/
sendError(
senderId: string,
requestId: number,
type: ErrorType,
reason?: ErrorReason,
customData?: any
): void;
/**
* Send local media request.
*/
sendLocalMediaRequest(request: RequestData): void;
/**
* Sends a media status message to a specific sender.
*/
sendStatus(
senderId: string,
requestId: number,
includeMedia?: boolean,
customData?: any,
includeQueueItems?: boolean
): void;
/**
* Sets the IDLE reason. This allows applications that want to force the IDLE state to indicate the reason that made the player going to IDLE state
* (a custom error; for example). The idle reason will be sent in the next status message. NOTE: Most applications do not need to set this value;
* it is only needed if they want to make the player go to IDLE in special circumstances and the default idleReason does not reflect their intended
* behavior.
*/
setIdleReason(idleReason: IdleReason): void;
/**
* Sets MediaElement to use. If Promise of MediaElement is set; media begins playback after Promise is resolved.
*/
setMediaElement(mediaElement: HTMLMediaElement): void;
/**
* Sets media information.
*/
setMediaInformation(
mediaInformation: MediaInformation,
opt_broadcast?: boolean
): void;
/**
* Sets a handler to return or modify PlaybackConfig; for a specific load request. The handler paramaters are the load request data
* and default playback config for the receiver (provided in the context options). The handler should returns a modified playback config;
* or null to prevent the media from playing. The return value can be a promise to allow waiting for data from the server.
*/
setMediaPlaybackInfoHandler(
handler: (
loadRequestData: LoadRequestData,
playbackConfig: PlaybackConfig
) => void
): void;
/**
* Sets a handler to return the media url for a load request. This handler can be used to avoid having the media content url published as part
* of the media status. By default the media contentId is used as the content url.
*/
setMediaUrlResolver(
resolver: (loadRequestData: LoadRequestData) => void
): void;
/**
* Provide an interceptor of incoming and outgoing messages.
* The interceptor can update the request data; and return updated data; a promise of
* updated data if need to get more data from the server; or null if the request should not be handled.
* Note that if load message interceptor is provided; and no interceptor is provided for preload -
* the load interceptor will be called for preload messages.
*/
setMessageInterceptor(
type: MessageType,
interceptor: (requestData: RequestData) => Promise<any>
): void;
/**
* Sets playback configuration on the PlayerManager.
*/
setPlaybackConfig(playbackConfig: PlaybackConfig): void;
/**
* Set the preferred playback rate for follow up load or media items. The preferred playback rate will be updated automatically to the latest
* playback rate that was provided by a load request or explicit set of playback rate.
*/
setPreferredPlaybackRate(preferredPlaybackRate: number): void;
/**
* Set the preferred text track language. The preferred text track language will be updated automatically to the latest enabled language
* by a load request or explicit change to text tracks. (Should be called only in idle state; and Will only apply to next loaded media).
*/
setPreferredTextLanguage(preferredTextLanguage: string): void;
/**
* Stops currently playing media.
*/
stop(): void;
}
/**
* Configuration to customize playback behavior.
*/
class PlaybackConfig {
/**
* Duration of buffered media in seconds to start buffering.
*/
autoPauseDuration?: number;
/**
* Duration of buffered media in seconds to start/resume playback after auto-paused due to buffering.
*/
autoResumeDuration?: number;
/**
* Minimum number of buffered segments to start/resume playback.
*/
autoResumeNumberOfSegments?: number;
/**
* A function to customize request to get a caption segment.
*/
captionsRequestHandler?: RequestHandler;
/**
* Initial bandwidth in bits in per second.
*/
initialBandwidth?: number;
/**
* Custom license data.
*/
licenseCustomData?: string;
/**
* Handler to process license data. The handler is passed the license data; and returns the modified license data.
*/
licenseHandler?: BinaryHandler;
/**
* A function to customize request to get a license.
*/
licenseRequestHandler?: RequestHandler;
/**
* Url for acquiring the license.
*/
licenseUrl?: string;
/**
* Handler to process manifest data. The handler is passed the manifest; and returns the modified manifest.
*/
manifestHandler?: (manifest: string) => string;
/**
* A function to customize request to get a manifest.
*/
manifestRequestHandler?: RequestHandler;
/**
* Preferred protection system to use for decrypting content.
*/
protectionSystem: ContentProtection;
/**
* Handler to process segment data. The handler is passed the segment data; and returns the modified segment data.
*/
segmentHandler?: BinaryHandler;
/**
* A function to customize request information to get a media segment.
*/
segmentRequestHandler?: RequestHandler;
/**
* Maximum number of times to retry a network request for a segment.
*/
segmentRequestRetryLimit?: number;
}
/**
* HTTP(s) Request/Response information.
*/
class NetworkRequestInfo {
/**
* The content of the request. Can be used to modify license request body.
*/
content: Uint8Array;
/**
* An object containing properties that you would like to send in the header.
*/
headers: any;
/**
* The URL requested.
*/
url: string;
/**
* Indicates whether CORS Access-Control requests should be made using credentials such as cookies or authorization headers.
*/
withCredentials: boolean;
}
/** Cast receiver context options. All options are optionals. */
class CastReceiverOptions {
/**
* Optional map of custom messages namespaces to initialize and their types.
* Custom messages namespaces need to be initiated before the application started;
* so it is best to provide the namespaces in the receiver options.
* (The default type of a message bus is JSON; if not provided here).
*/
customNamespaces?: any;
/**
* Sender id used for local requests. Default value is 'local'.
*/
localSenderId?: string;
/**
* Maximum time in seconds before closing an idle sender connection.
* Setting this value enables a heartbeat message to keep the connection alive.
* Used to detect unresponsive senders faster than typical TCP timeouts.
* The minimum value is 5 seconds; there is no upper bound enforced but practically it's minutes before platform TCP timeouts come into play.
* Default value is 10 seconds.
*/
maxInactivity?: number;
/**
* Optional media element to play content with. Default behavior is to use the first found media element in the page.
*/
mediaElement?: HTMLMediaElement;
/**
* Optional playback configuration.
*/
playbackConfig?: PlaybackConfig;
/**
* If this is true; the watched client stitching break will also be played.
*/
playWatchedBreak?: boolean;
/**
* Preferred value for player playback rate. It is used if playback rate value is not provided in the load request.
*/
preferredPlaybackRate?: number;
/**
* Preferred text track language. It is used if no active track is provided in the load request.
*/
preferredTextLanguage?: string;
/**
* Optional queue implementation.
*/
queue?: QueueBase;
/**
* Text that represents the application status.
* It should meet internationalization rules as may be displayed by the sender application.
*/
statusText?: string;
/**
* A bitmask of media commands supported by the application.
* LOAD; PLAY; STOP; GET_STATUS must always be supported.
* If this value is not provided; then PAUSE; SEEK; STREAM_VOLUME; STREAM_MUTE are assumed to be supported too.
*/
supportedCommands?: number;
/**
* Indicate that MPL should be used for DASH content.
*/
useLegacyDashSupport?: boolean;
/**
* An integer used as an internal version number.
* This number is used only to distinguish between receiver releases and higher numbers do not necessarily have to represent newer releases.
*/
versionCode?: number;
}
/** Manages loading of underlying libraries and initializes underlying cast receiver SDK. */
class CastReceiverContext {
/** Returns the CastReceiverContext singleton instance. */
static getInstance(): CastReceiverContext;
constructor(params: any);
/**
* Sets message listener on custom message channel.
*/
addCustomMessageListener(
namespace: string,
listener: EventHandler
): void;
/**
* Add listener to cast system events.
*/
addEventListener(
type: SystemEventType | SystemEventType[],
handler: EventHandler
): void;
/**
* Checks if the given media params of video or audio streams are supported by the platform.
*/
canDisplayType(
mimeType: string,
codecs?: string,
width?: number,
height?: number,
framerate?: number
): boolean;
/**
* Provides application information once the system is ready; otherwise it will be null.
*/
getApplicationData(): ApplicationData;
/**
* Provides device capabilities information once the system is ready; otherwise it will be null.
* If an empty object is returned; the device does not expose any capabilities information.
*/
getDeviceCapabilities(): any;
/**
* Get Player instance that can control and monitor media playback.
*/
getPlayerManager(): PlayerManager;
/**
* Get a sender by sender id
*/
getSender(senderId: string): Sender;
/**
* Gets a list of currently-connected senders.
*/
getSenders(): Sender[];
/**
* Reports if the cast application's HDMI input is in standby.
*/
getStandbyState(): StandbyState;
/**
* Provides application information about the system state.
*/
getSystemState(): SystemState;
/**
* Reports if the cast application is the HDMI active input.
*/
getVisibilityState(): any;
/**
* When the application calls start; the system will send the ready event to indicate
* that the application information is ready and the application can send messages as soon as there is one sender connected.
*/
isSystemReady(): boolean;
/**
* Start loading player js. This can be used to start loading the players js code in early stage of starting the receiver before calling start.
* This function is a no-op if players were already loaded (start was called).
*/
loadPlayerLibraries(useLegacyDashSupport?: boolean): void;
/**
* Remove a message listener on custom message channel.
*/
removeCustomMessageListener(
namespace: string,
listener: EventHandler
): void;
/**
* Remove listener to cast system events.
*/
removeEventListener(type: EventType, handler: EventHandler): void;
/**
* Sends a message to a specific sender.
*/
sendCustomMessage(
namespace: string,
senderId: string,
message: any
): void;
/**
* This function should be called in response to the feedbackstarted event if the application
* add debug state information to log in the feedback report.
* It takes in a parameter ‘message’ that is a string that represents the debug information that the application wants to log.
*/
sendFeedbackMessage(feedbackMessage: string): void;
/**
* Sets the application state. The application should call this when its state changes.
* If undefined or set to an empty string; the value of the Application Name established during application
* registration is used for the application state by default.
*/
setApplicationState(statusText: string): void;
/**
* Sets the receiver inactivity timeout.
* It is recommended to set the maximum inactivity value when calling Start and not changing it.
* This API is just provided for development/debugging purposes.
*/
setInactivityTimeout(maxInactivity: number): void;
/**
* Sets the log verbosity level.
*/
setLoggerLevel(level: LoggerLevel): void;
/**
* Initializes system manager and media manager; so that receiver app can receive requests from senders.
*/
start(options?: CastReceiverOptions): CastReceiverContext;
/**
* Shutdown receiver application.
*/
stop(): void;
}
/** Manages audio tracks. */
class AudioTracksManager {
constructor(params: any);
getActiveId(): number;
getActiveTrack(): Track;
getTrackById(id: number): Track;
getTracks(): Track[];
getTracksByLanguage(language: string): Track[];
setActiveById(id: number): void;
setActiveByLanguage(language: string): void;
}
}
+420
View File
@@ -0,0 +1,420 @@
import {
RequestData,
MediaInformation,
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";
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";
/**
* Event data for @see{@link EventType.SEGMENT_DOWNLOADED} event.
*/
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;
}
/**
* Event data for all events that represent requests made to the receiver.
*/
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
);
/**
* 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;
}
}
File diff suppressed because it is too large Load Diff
+198
View File
@@ -0,0 +1,198 @@
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";
type SystemState =
| "NOT_STARTED"
| "STARTING_IN_BACKGROUND"
| "STARTING"
| "READY"
| "STOPPING_IN_BACKGROUND"
| "STOPPING";
type StandbyState = "STANDBY" | "NOT_STANDBY" | "UNKNOWN";
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).
*/
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;
}
}
+197
View File
@@ -0,0 +1,197 @@
import { PlayerDataEventType } from "./cast.framework.ui";
import { MediaMetadata } from "./cast.framework.messages";
import { PlayerDataChangedEventHandler } from "./index";
export = cast.framework.ui;
declare namespace cast.framework.ui {
type ContentType = "video" | "audio" | "image";
type State =
| "launching"
| "idle"
| "loading"
| "buffering"
| "paused"
| "playing";
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.
*/
class PlayerDataChangedEvent {
constructor(type: PlayerDataEventType, field: string, value: any);
/**
* The field name that was changed.
*/
field: string;
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.
*/
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;
}
}
@@ -0,0 +1,106 @@
import {
PlayerData,
PlayerDataBinder
} from "chromecast-caf-receiver/cast.framework.ui";
import {
ReadyEvent,
ApplicationData
} from "chromecast-caf-receiver/cast.framework.system";
import {
RequestEvent,
Event
} 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";
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 items = qBase.fetchItems(1, 3, 4);
const breakSeekData = new BreakSeekData(0, 100, []);
const breakClipLoadContext = new BreakClipLoadInterceptorContext(adBreak);
const breakManager: BreakManager = {
getBreakById: () => adBreak,
getBreakClipById: () => breakClip,
getBreakClips: () => [breakClip],
getBreaks: () => [adBreak],
getPlayWatchedBreak: () => true,
setBreakClipLoadInterceptor: () => {},
setBreakSeekInterceptor: () => {},
setPlayWatchedBreak: () => {},
setVastTrackingInterceptor: () => {}
};
const lrd: LoadRequestData = {
requestId: 1,
activeTrackIds: [1, 2],
media: {
tracks: [],
textTrackStyle: {},
streamType: "BUFFERED",
metadata: { metadataType: "GENERIC" },
hlsSegmentFormat: "AAC",
contentId: "id",
contentType: "type",
breakClips: [breakClip],
breaks: [adBreak]
},
queueData: {}
};
const appData: ApplicationData = {
id: () => "id",
launchingSenderId: () => "launch-id",
name: () => "name",
namespaces: () => ["namespace"],
sessionId: () => 1
};
const readyEvent = new ReadyEvent(appData);
const data = readyEvent.data;
const pData: PlayerData = {
breakPercentagePositions: [1],
contentType: "video",
currentBreakClipNumber: 2,
currentTime: 1234,
displayStatus: true,
duration: 222,
isBreakSkippable: false,
isLive: true,
isPlayingBreak: false,
isSeeking: true,
metadata: new MediaMetadata("GENERIC"),
nextSubtitle: "sub",
nextThumbnailUrl: "url",
nextTitle: "title",
numberBreakClips: 3,
preloadingNext: false,
state: "paused",
thumbnailUrl: "url",
title: "title",
whenSkippable: 321
};
const binder = new PlayerDataBinder(pData);
binder.addEventListener("ANY_CHANGE", e => {});
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for chromecast-caf-receiver 3.x
// Project: https://github.com/googlecast
// Definitions by: Craig Bruce <https://github.com/craigrbruce>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference path="./cast.framework.d.ts" />
/// <reference path="./cast.framework.breaks.d.ts" />
/// <reference path="./cast.framework.events.d.ts" />
/// <reference path="./cast.framework.messages.d.ts" />
/// <reference path="./cast.framework.system.d.ts" />
/// <reference path="./cast.framework.ui.d.ts" />
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;
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": false,
"esModuleInterop": true
},
"files": [
"index.d.ts",
"chromecast-caf-receiver-tests.ts",
"cast.framework.d.ts",
"cast.framework.breaks.d.ts",
"cast.framework.events.d.ts",
"cast.framework.messages.d.ts",
"cast.framework.system.d.ts",
"cast.framework.ui.d.ts"
]
}
@@ -0,0 +1,5 @@
{
"extends": "dtslint/dt.json",
"rules": {
}
}
+4 -4
View File
@@ -105,11 +105,11 @@ declare namespace connectMongo {
export class MongoStore extends session.Store {
get: (sid: string, callback: (err: any, session: Express.Session) => void) => void;
set: (sid: string, session: Express.Session, callback: (err: any) => void) => void;
destroy: (sid: string, callback: (err: any) => void) => void;
set: (sid: string, session: Express.Session, callback?: (err: any) => void) => void;
destroy: (sid: string, callback?: (err: any) => void) => void;
length: (callback: (err: any, length: number) => void) => void;
clear: (callback: (err: any) => void) => void;
touch: (sid: string, session: Express.Session, callback: (err: any) => void) => void;
clear: (callback?: (err: any) => void) => void;
touch: (sid: string, session: Express.Session, callback?: (err: any) => void) => void;
}
}
@@ -0,0 +1,13 @@
declare let button: DevExpress.AspNetCore.BootstrapButton;
button.on('click', e => {});
button.doClick();
button.once('click', e => {});
declare let accordion: DevExpress.AspNetCore.BootstrapAccordion;
accordion.on('init', e => {});
const firstGroup = accordion.getGroup(0);
if (firstGroup) {
const groupText = firstGroup.getText();
const item = firstGroup.getItemByName('item10');
item && item.getEnabled();
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"devexpress-aspnetcore-bootstrap-tests.ts"
]
}
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}
+3
View File
@@ -63,6 +63,7 @@ const dropzoneWithOptions = new Dropzone(".test", {
dictRemoveFileConfirmation: "",
dictMaxFilesExceeded: "",
dictFileSizeUnits: { tb: "", gb: "", mb: "", kb: "", b: "" },
dictUploadCanceled: "",
accept: (file: Dropzone.DropzoneFile, done: (error?: string | Error) => void) => {
if (file.accepted) {
@@ -245,6 +246,8 @@ dropzone.resizeImage(firstFile, 120, 120);
dropzone.resizeImage(firstFile, 120, 120, 'contain');
dropzone.resizeImage(firstFile, 120, 120, 'contain', function () { });
document.createElement("div").dropzone;
dropzone
.on("drop", () => {
console.count('drop');
+16 -3
View File
@@ -1,6 +1,12 @@
// Type definitions for Dropzone 5.0.0
// Project: http://www.dropzonejs.com/
// Definitions by: Natan Vivo <https://github.com/nvivo>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Vasya Aksyonov <https://github.com/outring>, Simon Huber <https://github.com/renuo>, Sebastiaan de Rooij <https://github.com/Hikariii>, Ted Bicknell <https://github.com/tedbcsgpro>
// Definitions by: Natan Vivo <https://github.com/nvivo>
// Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>
// Vasya Aksyonov <https://github.com/outring>
// Simon Huber <https://github.com/renuo>
// Sebastiaan de Rooij <https://github.com/Hikariii>
// Ted Bicknell <https://github.com/tedbcsgpro>
// Daniel Waxweiler <https://github.com/dwaxweiler>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -87,6 +93,7 @@ declare namespace Dropzone {
dictRemoveFileConfirmation?: string;
dictMaxFilesExceeded?: string;
dictFileSizeUnits?: DropzoneDictFileSizeUnits;
dictUploadCanceled?: string;
accept?(file: DropzoneFile, done: (error?: string | Error) => void): void;
chunksUploaded?(file: DropzoneFile, done: (error?: string | Error) => void): void;
@@ -306,8 +313,14 @@ declare class Dropzone {
}
interface JQuery {
dropzone(options: Dropzone.DropzoneOptions): Dropzone;
declare global {
interface JQuery {
dropzone(options: Dropzone.DropzoneOptions): Dropzone;
}
interface HTMLElement {
dropzone: Dropzone;
}
}
export = Dropzone;
@@ -0,0 +1,12 @@
import Application from '@ember/application';
import EmberResolver from 'ember-resolver';
const MyResolver = EmberResolver.extend({
pluralizedTypes: {
sheep: 'sheep'
}
});
const App = Application.extend({
Resolver: MyResolver
});
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for ember-resolver 4.5
// Project: https://github.com/ember-cli/ember-resolver#readme
// Definitions by: Dan Freeman <https://github.com/dfreeman>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
/// <reference types="ember" />
import Resolver from '@ember/application/resolver';
/**
* An Ember `Resolver` implementation used by ember-cli.
*/
export default class EmberResolver extends Resolver {}
+23
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",
"ember-resolver-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -2368,7 +2368,7 @@ declare module 'ember' {
function Exception(message: string): void;
class SafeString {
constructor(str: string);
static toString(): string;
toString(): string;
}
function parse(string: string): any;
function print(ast: any): void;
-2
View File
@@ -24,8 +24,6 @@
"only-arrow-functions": false,
"no-submodule-imports": false,
"no-unnecessary-class": false,
// false positives
"unified-signatures": false
}
+30 -8
View File
@@ -1,17 +1,39 @@
import EventSource = require("eventsource");
const eventSource = new EventSource("http://foobar");
eventSource.onmessage = (x: any) => {};
eventSource.onerror = (x: any) => {};
eventSource.onopen = (x: any) => {};
eventSource.addEventListener = (type: string, x: any) => {};
let readyState: number = eventSource.readyState;
let closedState: number = eventSource.CLOSED;
closedState = EventSource.CLOSED;
let connectingState: number = eventSource.CONNECTING;
connectingState = EventSource.CONNECTING;
let openState: number = eventSource.OPEN;
openState = EventSource.OPEN;
let url: string = eventSource.url;
let withCredentials: boolean = eventSource.withCredentials;
eventSource.onmessage = (event: Event) => {};
eventSource.onerror = (event: Event) => {};
eventSource.onopen = (event: Event) => {};
eventSource.addEventListener = (type: string, listener: (e: Event) => void) => {};
eventSource.dispatchEvent = (event: Event) => true;
eventSource.removeEventListener = (type: string, listener: (e: Event) => void) => {};
eventSource.close();
import EventSourcePolyfill = require("eventsource/lib/eventsource-polyfill");
const eventSourcePolyfill = new EventSourcePolyfill("http://foobar");
eventSourcePolyfill.onmessage = (x: any) => {};
eventSourcePolyfill.onerror = (x: any) => {};
eventSourcePolyfill.onopen = (x: any) => {};
eventSourcePolyfill.addEventListener = (type: string, x: any) => {};
readyState = eventSourcePolyfill.readyState;
closedState = eventSource.CLOSED;
closedState = EventSource.CLOSED;
connectingState = eventSource.CONNECTING;
connectingState = EventSource.CONNECTING;
openState = eventSource.OPEN;
openState = EventSource.OPEN;
url = eventSourcePolyfill.url;
withCredentials = eventSource.withCredentials;
eventSourcePolyfill.onmessage = (event: Event) => {};
eventSourcePolyfill.onerror = (event: Event) => {};
eventSourcePolyfill.onopen = (event: Event) => {};
eventSourcePolyfill.addEventListener = (type: string, listener: (e: Event) => void) => {};
eventSourcePolyfill.dispatchEvent = (event: Event) => true;
eventSourcePolyfill.removeEventListener = (type: string, listener: (e: Event) => void) => {};
eventSourcePolyfill.close();
+14 -7
View File
@@ -1,22 +1,29 @@
// Type definitions for eventsource 1.0
// Project: http://github.com/EventSource/eventsource
// Definitions by: Scott Lee Davis <https://github.com/scottleedavis>
// Ali Afroozeh <https://github.com/afroozeh>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
// TypeScript Version: 2.8
declare class EventSource {
static readonly CLOSED: number;
static readonly CONNECTING: number;
static readonly OPEN: number;
constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict);
static CLOSED: EventSource.ReadyState;
static CONNECTING: EventSource.ReadyState;
static OPEN: EventSource.ReadyState;
url: string;
readyState: EventSource.ReadyState;
readonly CLOSED: number;
readonly CONNECTING: number;
readonly OPEN: number;
readonly url: string;
readonly readyState: number;
readonly withCredentials: boolean;
onopen: EventListener;
onmessage: EventListener;
onerror: EventListener;
addEventListener(type: string, listener: EventListener): void;
dispatchEvent(evt: Event): boolean;
removeEventListener(type: string, listener?: EventListener): void;
close(): void;
}
+12 -6
View File
@@ -1,16 +1,22 @@
declare class EventSource {
static readonly CLOSED: number;
static readonly CONNECTING: number;
static readonly OPEN: number;
constructor(url: string, eventSourceInitDict?: EventSource.EventSourceInitDict);
static CLOSED: EventSource.ReadyState;
static CONNECTING: EventSource.ReadyState;
static OPEN: EventSource.ReadyState;
url: string;
readyState: EventSource.ReadyState;
readonly CLOSED: number;
readonly CONNECTING: number;
readonly OPEN: number;
readonly url: string;
readonly readyState: number;
readonly withCredentials: boolean;
onopen: EventListener;
onmessage: EventListener;
onerror: EventListener;
addEventListener(type: string, listener: EventListener): void;
dispatchEvent(evt: Event): boolean;
removeEventListener(type: string, listener?: EventListener): void;
close(): void;
}
+36 -1
View File
@@ -37,7 +37,9 @@ import {
Calendar,
MailComposer,
Location,
Updates
Updates,
MediaLibrary,
Haptic
} from 'expo';
const reverseGeocode: Promise<Location.GeocodeData[]> = Location.reverseGeocodeAsync({
@@ -778,3 +780,36 @@ async () => {
console.log(bundleFetchResult.manifest);
}
};
// #region MediaLibrary
async () => {
const mlAsset: MediaLibrary.Asset = await MediaLibrary.createAssetAsync('localUri');
const mlAssetResult: MediaLibrary.GetAssetsResult = await MediaLibrary.getAssetsAsync({
first: 0,
after: '',
album: 'Album',
sortBy: MediaLibrary.SortBy.creationTime,
mediaType: MediaLibrary.MediaType.photo
});
const mlAsset1: MediaLibrary.Asset = await MediaLibrary.getAssetInfoAsync(mlAsset);
const areDeleted: boolean = await MediaLibrary.deleteAssetsAsync([mlAsset]);
const albums: MediaLibrary.Album[] = await MediaLibrary.getAlbumsAsync();
const album: MediaLibrary.Album = await MediaLibrary.getAlbumAsync('album');
const album1: MediaLibrary.Album = await MediaLibrary.createAlbumAsync('album', mlAsset);
const areAddedToAlbum: boolean = await MediaLibrary.addAssetsToAlbumAsync([mlAsset, mlAsset1], 'album');
const areDeletedFromAlbum: boolean = await MediaLibrary.removeAssetsFromAlbumAsync([mlAsset, mlAsset1], 'album');
const momuents: MediaLibrary.Album[] = await MediaLibrary.getMomentsAsync();
};
//#endregion
// #region Haptic
Haptic.impact(Haptic.ImpactStyles.Heavy);
Haptic.impact(Haptic.ImpactStyles.Light);
Haptic.impact(Haptic.ImpactStyles.Medium);
Haptic.notification(Haptic.NotificationType.Error);
Haptic.notification(Haptic.NotificationType.Success);
Haptic.notification(Haptic.NotificationType.Error);
Haptic.selection();
// #endregion
+195 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for expo 26.0
// Type definitions for expo 27.0
// Project: https://github.com/expo/expo-sdk
// Definitions by: Konstantin Kai <https://github.com/KonstantinKai>
// Martynas Kadiša <https://github.com/martynaskadisa>
@@ -6,6 +6,7 @@
// Sergio Sánchez <https://github.com/ssanchezmarc>
// Fernando Helwanger <https://github.com/fhelwanger>
// Umidbek Karimov <https://github.com/umidbekkarimov>
// Moshe Feuchtwanger <https://github.com/moshfeu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
@@ -1520,6 +1521,9 @@ export namespace ImagePicker {
mediaTypes?: keyof _MediaTypeOptions;
}
/**
* require Permissions.CAMERA_ROLL
*/
function launchImageLibraryAsync(options?: ImageLibraryOptions): Promise<ImageResult>;
interface CameraOptions {
@@ -1528,6 +1532,9 @@ export namespace ImagePicker {
quality?: number;
}
/**
* require Permissions.CAMERA_ROLL
*/
function launchCameraAsync(options?: CameraOptions): Promise<ImageResult>;
}
@@ -2729,7 +2736,7 @@ export namespace Calendar {
}
// #endregion
// #region Calendar
// #region MailComposer
/**
* An API to compose mails using OS specific UI.
*/
@@ -2852,3 +2859,189 @@ export namespace Updates {
*/
function reloadFromCache(): void;
}
// #region MediaLibrary
/**
* https://docs.expo.io/versions/latest/sdk/media-library
* Provides access to user's media library
* Requires Permissions.CAMERA_ROLL permissions.
*/
export namespace MediaLibrary {
/**
* Creates an asset from existing file. The most common use case is to save a picture taken by Camera.
*/
function createAssetAsync(localUri: string): Promise<Asset>;
/**
* Fetches a page of assets matching the provided criteria.
*/
function getAssetsAsync(options: GetAssetsOptions): Promise<GetAssetsResult>;
/**
* Provides more informations about an asset, including GPS location, local URI and EXIF metadata.
*/
function getAssetInfoAsync(asset: string | Asset): Promise<Asset>;
/**
* Deletes assets from the library. On iOS it deletes assets from all albums they belong to, while on Android it keeps all copies of them
* (album is strictly connected to the asset). Also, there is additional dialog on iOS that requires user to confirm this action.
*/
function deleteAssetsAsync(asset: string[] | Asset[]): Promise<boolean>;
/**
* Queries for user-created albums in media gallery.
*/
function getAlbumsAsync(): Promise<Album[]>;
/**
* Queries for an album with a specific name.
*/
function getAlbumAsync(albumName: string): Promise<Album>;
/**
* Creates an album with given name and initial asset.
* The asset parameter is required on Android, since it's not possible to create empty album on this platform.
*/
function createAlbumAsync(albumName: string, asset: string | Asset): Promise<Album>;
/**
* Adds array of assets to the album.
* On Android, by default it copies assets from the current album to provided one, however it's also possible to move them by passing false as copyAssets argument.
* In case they're copied you should keep in mind that getAssetsAsync will return duplicated assets.
*/
function addAssetsToAlbumAsync(assets: Asset[], album: string | Album, copyAssets?: boolean /* default true */): Promise<boolean>;
/**
* Removes given assets from album.
* On Android, album will be automatically deleted if there are no more assets inside.
*/
function removeAssetsFromAlbumAsync(assets: Asset[], album: string | Album): Promise<boolean>;
/**
* Available on iOS only. Fetches a list of moments, which is a group of assets taken around the same place and time.
*/
function getMomentsAsync(): Promise<Album[]>;
enum MediaType {
audio = 'audio',
photo = 'photo',
video = 'video',
unknow = 'unknow'
}
enum SortBy {
default = 'default',
id = 'id',
creationTime = 'creationTime',
modificationTime = 'modificationTime',
mediaType = 'mediaType',
width = 'width',
height = 'height',
duration = 'duration'
}
// region Asset
interface AssetAndroid {
albumId?: string;
}
interface AssetIos {
mediaSubtypes?: MediaType[];
// *
orientation: number;
// *
isFavorite: boolean;
}
interface Asset extends AssetAndroid, AssetIos {
id: string;
filename: string;
uri: string;
mediaType: string;
width: number;
height: number;
creationTime: number;
modificationTime: number;
duration: number;
// *
localUri?: string;
// *
location?: Location.LocationProps;
// *
exif?: object;
}
/**
* These fields can be obtained only by calling getAssetInfoAsync method
*/
//#endregion
// #region Album
interface AlbumIos {
type?: string;
// *
startTime: number;
// *
endTime: number;
// *
approximateLocation?: Location.LocationProps;
// *
locationNames?: string[];
}
/**
* These fields apply only to albums whose type is moment
*/
interface Album extends AlbumIos {
id: string;
title: string;
assetCount: number;
}
// #endregion
interface GetAssetsOptions {
first?: number;
after?: string;
album?: string | Album;
sortBy?: SortBy;
mediaType?: MediaType;
}
interface GetAssetsResult {
assets: Asset[];
endCursor: string;
hasNextPage: boolean;
totalCount: number;
}
}
// #endregion
// #region Haptic
/**
* https://docs.expo.io/versions/latest/sdk/haptic
* Provides haptic feedback for iOS 10+ devices using the Taptic Engine.
* If this is used in Android the device will use ReactNative.Vibrate instead, it's best to just avoid this.
*/
export namespace Haptic {
/**
* Used to let a user know when a selection change has been registered
*/
function selection(): void;
function notification(notificationType?: NotificationType): void;
function impact(impactStyles?: ImpactStyles): void;
enum ImpactStyles {
Light = 'light',
Medium = 'medium',
Heavy = 'heavy'
}
enum NotificationType {
Success = 'success',
Warning = 'warning',
Error = 'error'
}
}
// #endregion
+780
View File
@@ -0,0 +1,780 @@
import * as React from 'react';
import { Text } from 'react-native';
import {
Accelerometer,
AdMobAppEvent,
AdMobBanner,
AdMobInterstitial,
AdMobRewarded,
Amplitude,
Asset,
AuthSession,
Audio,
AppLoading,
BarCodeScanner,
BlurViewProps,
BlurView,
Brightness,
Camera,
CameraObject,
DocumentPicker,
Facebook,
FacebookAds,
FileSystem,
ImagePicker,
ImageManipulator,
FaceDetector,
Svg,
IntentLauncherAndroid,
KeepAwake,
LinearGradient,
Permissions,
PublisherBanner,
registerRootComponent,
ScreenOrientation,
SQLite,
Calendar,
MailComposer,
Location,
Updates
} from 'expo';
const reverseGeocode: Promise<Location.GeocodeData[]> = Location.reverseGeocodeAsync({
latitude: 0,
longitude: 0
});
Accelerometer.addListener((obj) => {
obj.x;
obj.y;
obj.z;
});
Accelerometer.removeAllListeners();
Accelerometer.setUpdateInterval(1000);
() => (
<AdMobBanner
bannerSize="leaderboard"
adUnitID="ca-app-pub-3940256099942544/6300978111"
testDeviceID="EMULATOR"
didFailToReceiveAdWithError={(error: string) => console.log(error)}
style={{ flex: 1 }}
/>
);
() => (
<PublisherBanner
bannerSize="leaderboard"
adUnitID="ca-app-pub-3940256099942544/6300978111"
testDeviceID="EMULATOR"
didFailToReceiveAdWithError={(error: string) => console.log(error)}
onAdMobDispatchAppEvent={(event: AdMobAppEvent) => console.log(event)}
style={{ flex: 1 }}
/>
);
AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id
AdMobInterstitial.setTestDeviceID('EMULATOR');
async () => {
await AdMobInterstitial.requestAdAsync();
await AdMobInterstitial.showAdAsync();
};
AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id
AdMobRewarded.setTestDeviceID('EMULATOR');
async () => {
await AdMobRewarded.requestAdAsync();
await AdMobRewarded.showAdAsync();
};
Amplitude.initialize('key');
Amplitude.setUserId('userId');
Amplitude.setUserProperties({key: 1});
Amplitude.clearUserProperties();
Amplitude.logEvent('name');
Amplitude.logEventWithProperties('event', {key: 'value'});
Amplitude.setGroup('type', ['value']);
const asset = Asset.fromModule(1);
asset.downloadAsync();
Asset.loadAsync(1);
Asset.loadAsync([1, 2, 3]);
const asset1 = new Asset({
uri: 'uri',
type: 'type',
name: 'name',
hash: 'hash',
width: 122,
height: 122
});
const url = AuthSession.getRedirectUrl();
AuthSession.dismiss();
AuthSession.startAsync({
authUrl: 'url1',
returnUrl: 'url2'
}).then(result => {
switch (result.type) {
case 'success':
result.event;
result.params;
break;
case 'error':
result.errorCode;
result.params;
result.event;
break;
case 'dismissed':
case 'cancel':
result.type;
break;
}
});
AuthSession.startAsync({
authUrl: 'url1',
returnUrl: undefined
});
Audio.setAudioModeAsync({
shouldDuckAndroid: false,
playsInSilentModeIOS: true,
interruptionModeIOS: 2,
interruptionModeAndroid: 1,
allowsRecordingIOS: true
});
Audio.setIsEnabledAsync(true);
Audio.INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS === 0;
Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX === 1;
Audio.INTERRUPTION_MODE_IOS_DUCK_OTHERS === 2;
Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX === 1;
Audio.INTERRUPTION_MODE_ANDROID_DUCK_OTHERS === 2;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_DEFAULT === 0;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_THREE_GPP === 1;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG_4 === 2;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_NB === 3;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_WB === 4;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADIF === 5;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADTS === 6;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_RTP_AVP === 7;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG2TS === 8;
Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_WEBM === 9;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_DEFAULT === 0;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_NB === 1;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_WB === 2;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC === 3;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_HE_AAC === 4;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC_ELD === 5;
Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_VORBIS === 6;
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_LINEARPCM === 'lpcm';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AC3 === 'ac-3';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_60958AC3 === 'cac3';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLEIMA4 === 'ima4';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC === 'aac ';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4CELP === 'celp';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4HVXC === 'hvxc';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4TWINVQ === 'twvq';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE3 === 'MAC3';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE6 === 'MAC6';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ULAW === 'ulaw';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ALAW === 'alaw';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN === 'QDMC';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN2 === 'QDM2';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QUALCOMM === 'Qclp';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER1 === '.mp1';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER2 === '.mp2';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER3 === '.mp3';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLELOSSLESS === 'alac';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE === 'aach';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_LD === 'aacl';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD === 'aace';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_SBR === 'aacf';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_V2 === 'aacg';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE_V2 === 'aacp';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_SPATIAL === 'aacs';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR === 'samr';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR_WB === 'sawb';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AUDIBLE === 'AUDB';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ILBC === 'ilbc';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_DVIINTELIMA === 0x6d730011;
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MICROSOFTGSM === 0x6d730031;
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AES3 === 'aes3';
Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ENHANCEDAC3 === 'ec-3';
Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MIN === 0;
Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_LOW === 0x20;
Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MEDIUM === 0x40;
Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_HIGH === 0x60;
Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MAX === 0x7f;
Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_CONSTANT === 0;
Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_LONG_TERM_AVERAGE === 1;
Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE_CONSTRAINED === 2;
Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE === 3;
Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY;
Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY;
async () => {
const result = await Audio.Sound.create({uri: 'uri'}, {
volume: 0.5,
rate: 0.6
}, null, true);
const sound = result.sound;
const status = result.status;
if (!status.isLoaded) {
status.error;
} else {
status.didJustFinish;
// etc.
}
const _status = await sound.getStatusAsync();
await sound.loadAsync({uri: 'uri'});
};
() => (
<AppLoading
startAsync={() => Promise.resolve()}
onFinish={() => {}}
onError={(error) => console.log(error)} />
);
() => (
<AppLoading />
);
const barcodeReadCallback = () => {};
() => (
<BarCodeScanner
type="front"
torchMode="off"
barCodeTypes={[BarCodeScanner.Constants.BarCodeType.aztec]}
onBarCodeRead={barcodeReadCallback} />
);
() => (
<BlurView
tint="dark"
intensity={2} />
);
async () => {
await Brightness.setBrightnessAsync(.6);
await Brightness.setSystemBrightnessAsync(.7);
const br1 = await Brightness.getBrightnessAsync();
const br2 = await Brightness.getSystemBrightnessAsync();
};
Camera.Constants.AutoFocus;
Camera.Constants.Type;
Camera.Constants.FlashMode;
Camera.Constants.WhiteBalance;
Camera.Constants.VideoQuality;
Camera.Constants.BarCodeType;
() => {
return(<Camera ref={(component: any) => {
if (component) {
component.recordAsync();
}
}} />);
};
async () => {
const result = await DocumentPicker.getDocumentAsync();
if (result.type === 'success') {
result.name;
result.uri;
result.size;
}
};
async () => {
const { type, expires, token } = await Facebook.logInWithReadPermissionsAsync("appId");
};
() => (
<FacebookAds.BannerView
type="large"
placementId="str"
onPress={() => {}}
onError={() => {}} />
);
async () => {
const info = await FileSystem.getInfoAsync('file');
info.exists;
info.isDirectory;
if (info.exists) {
info.md5;
info.uri;
info.size;
info.modificationTime;
}
const string: string = await FileSystem.readAsStringAsync('file');
await FileSystem.writeAsStringAsync('file', 'content');
await FileSystem.deleteAsync('file');
await FileSystem.moveAsync({ from: 'from', to: 'to'});
await FileSystem.copyAsync({ from: 'from', to: 'to' });
await FileSystem.makeDirectoryAsync('dir');
const dirs: string[] = await FileSystem.readDirectoryAsync('dir');
const result = await FileSystem.downloadAsync('from', 'to');
result.headers;
result.status;
result.uri;
result.md5;
};
async () => {
// Video test
const result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Videos,
});
if (!result.cancelled) {
result.uri;
result.width;
result.height;
result.duration;
result.type;
}
};
async () => {
// Image test
const result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Images,
base64: true,
aspect: [4, 3],
quality: 1,
exif: true,
});
if (!result.cancelled) {
result.uri;
result.width;
result.height;
result.exif;
result.base64;
result.type;
}
};
async () => {
const result = await ImageManipulator.manipulate('url', {
rotate: 90
}, {
compress: 0.5
});
result.height;
result.uri;
result.width;
};
FaceDetector.Constants.Mode.fast;
FaceDetector.Constants.Mode.accurate;
FaceDetector.Constants.Landmarks.all;
FaceDetector.Constants.Landmarks.none;
FaceDetector.Constants.Classifications.all;
FaceDetector.Constants.Classifications.none;
async () => {
const result = await FaceDetector.detectFaces('url', {
mode: FaceDetector.Constants.Mode.fast,
detectLandmarks: FaceDetector.Constants.Landmarks.all,
runClassifications: FaceDetector.Constants.Classifications.none
});
result.faces[0];
};
() => (
<Svg width={100} height={50}>
<Svg.Rect
x={25}
y={5}
width={150}
height={50}
fill='rgb(0,0,255)'
strokeWidth={3}
stroke='rgb(0,0,0)'
/>
<Svg.Circle
cx={50}
cy={50}
r={50}
fill="pink"
/>
<Svg.Ellipse
cx={55}
cy={55}
rx={50}
ry={30}
stroke="purple"
strokeWidth={2}
fill="yellow"
/>
<Svg.Line
x1={0}
y1={0}
x2={100}
y2={100}
stroke="red"
strokeWidth={2}
/>
<Svg.Polygon
points="40,5 70,80 25,95"
fill="lime"
stroke="purple"
strokeWidth={1}
/>
<Svg.Polyline
points="10,10 20,12 30,20 40,60 60,70 95,90"
fill="none"
stroke="black"
strokeWidth={3}
/>
<Svg.Text
fill="none"
stroke="purple"
fontSize={20}
fontWeight="bold"
x={100}
y={20}
textAnchor="middle"
>
STROKED TEXT
</Svg.Text>
<Svg.Defs>
<Svg.Path
id="path"
d=""
/>
</Svg.Defs>
<Svg.G y={20}>
<Svg.Text fill="blue" >
<Svg.TextPath href="#path" startOffset="-10%">
We go up and down,
<Svg.TSpan fill="red" dy="5,5,5">then up again</Svg.TSpan>
</Svg.TextPath>
</Svg.Text>
<Svg.Path
d=""
fill="none"
stroke="red"
strokeWidth={1}
/>
</Svg.G>
<Svg.Use href="#shape" x="20" y="0" />
<Svg.Symbol id="symbol" viewBox="0 0 150 110" width="100" height="50">
<Svg.Circle cx="50" cy="50" r="40" strokeWidth="8" stroke="red" fill="red"/>
<Svg.Circle cx="90" cy="60" r="40" strokeWidth="8" stroke="green" fill="white"/>
</Svg.Symbol>
<Svg.Defs>
<Svg.ClipPath id="clip">
<Svg.Circle cx="50%" cy="50%" r="40%"/>
</Svg.ClipPath>
<Svg.RadialGradient id="grad" cx="50%" cy="50%" rx="50%" ry="50%" fx="50%" fy="50%" gradientUnits="userSpaceOnUse">
<Svg.Stop
offset="0%"
stopColor="#ff0"
stopOpacity="1"
/>
</Svg.RadialGradient>
<Svg.LinearGradient id="grad" x1="0" y1="0" x2="170" y2="0">
<Svg.Stop offset="1" stopColor="red" stopOpacity="1" />
</Svg.LinearGradient>
</Svg.Defs>
</Svg>
);
IntentLauncherAndroid.ACTION_ACCESSIBILITY_SETTINGS === 'android.settings.ACCESSIBILITY_SETTINGS';
IntentLauncherAndroid.ACTION_APP_NOTIFICATION_REDACTION === 'android.settings.ACTION_APP_NOTIFICATION_REDACTION';
IntentLauncherAndroid.ACTION_CONDITION_PROVIDER_SETTINGS === 'android.settings.ACTION_CONDITION_PROVIDER_SETTINGS';
IntentLauncherAndroid.ACTION_NOTIFICATION_LISTENER_SETTINGS === 'android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS';
IntentLauncherAndroid.ACTION_PRINT_SETTINGS === 'android.settings.ACTION_PRINT_SETTINGS';
IntentLauncherAndroid.ACTION_ADD_ACCOUNT_SETTINGS === 'android.settings.ADD_ACCOUNT_SETTINGS';
IntentLauncherAndroid.ACTION_AIRPLANE_MODE_SETTINGS === 'android.settings.AIRPLANE_MODE_SETTINGS';
IntentLauncherAndroid.ACTION_APN_SETTINGS === 'android.settings.APN_SETTINGS';
IntentLauncherAndroid.ACTION_APPLICATION_DETAILS_SETTINGS === 'android.settings.APPLICATION_DETAILS_SETTINGS';
IntentLauncherAndroid.ACTION_APPLICATION_DEVELOPMENT_SETTINGS === 'android.settings.APPLICATION_DEVELOPMENT_SETTINGS';
IntentLauncherAndroid.ACTION_APPLICATION_SETTINGS === 'android.settings.APPLICATION_SETTINGS';
IntentLauncherAndroid.ACTION_APP_NOTIFICATION_SETTINGS === 'android.settings.APP_NOTIFICATION_SETTINGS';
IntentLauncherAndroid.ACTION_APP_OPS_SETTINGS === 'android.settings.APP_OPS_SETTINGS';
IntentLauncherAndroid.ACTION_BATTERY_SAVER_SETTINGS === 'android.settings.BATTERY_SAVER_SETTINGS';
IntentLauncherAndroid.ACTION_BLUETOOTH_SETTINGS === 'android.settings.BLUETOOTH_SETTINGS';
IntentLauncherAndroid.ACTION_CAPTIONING_SETTINGS === 'android.settings.CAPTIONING_SETTINGS';
IntentLauncherAndroid.ACTION_CAST_SETTINGS === 'android.settings.CAST_SETTINGS';
IntentLauncherAndroid.ACTION_DATA_ROAMING_SETTINGS === 'android.settings.DATA_ROAMING_SETTINGS';
IntentLauncherAndroid.ACTION_DATE_SETTINGS === 'android.settings.DATE_SETTINGS';
IntentLauncherAndroid.ACTION_DEVICE_INFO_SETTINGS === 'android.settings.DEVICE_INFO_SETTINGS';
IntentLauncherAndroid.ACTION_DEVICE_NAME === 'android.settings.DEVICE_NAME';
IntentLauncherAndroid.ACTION_DISPLAY_SETTINGS === 'android.settings.DISPLAY_SETTINGS';
IntentLauncherAndroid.ACTION_DREAM_SETTINGS === 'android.settings.DREAM_SETTINGS';
IntentLauncherAndroid.ACTION_HARD_KEYBOARD_SETTINGS === 'android.settings.HARD_KEYBOARD_SETTINGS';
IntentLauncherAndroid.ACTION_HOME_SETTINGS === 'android.settings.HOME_SETTINGS';
IntentLauncherAndroid.ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS === 'android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS';
IntentLauncherAndroid.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS === 'android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS';
IntentLauncherAndroid.ACTION_INPUT_METHOD_SETTINGS === 'android.settings.INPUT_METHOD_SETTINGS';
IntentLauncherAndroid.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS === 'android.settings.INPUT_METHOD_SUBTYPE_SETTINGS';
IntentLauncherAndroid.ACTION_INTERNAL_STORAGE_SETTINGS === 'android.settings.INTERNAL_STORAGE_SETTINGS';
IntentLauncherAndroid.ACTION_LOCALE_SETTINGS === 'android.settings.LOCALE_SETTINGS';
IntentLauncherAndroid.ACTION_LOCATION_SOURCE_SETTINGS === 'android.settings.LOCATION_SOURCE_SETTINGS';
IntentLauncherAndroid.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS === 'android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS';
IntentLauncherAndroid.ACTION_MANAGE_APPLICATIONS_SETTINGS === 'android.settings.MANAGE_APPLICATIONS_SETTINGS';
IntentLauncherAndroid.ACTION_MANAGE_DEFAULT_APPS_SETTINGS === 'android.settings.MANAGE_DEFAULT_APPS_SETTINGS';
IntentLauncherAndroid.ACTION_MEMORY_CARD_SETTINGS === 'android.settings.MEMORY_CARD_SETTINGS';
IntentLauncherAndroid.ACTION_MONITORING_CERT_INFO === 'android.settings.MONITORING_CERT_INFO';
IntentLauncherAndroid.ACTION_NETWORK_OPERATOR_SETTINGS === 'android.settings.NETWORK_OPERATOR_SETTINGS';
IntentLauncherAndroid.ACTION_NFCSHARING_SETTINGS === 'android.settings.NFCSHARING_SETTINGS';
IntentLauncherAndroid.ACTION_NFC_PAYMENT_SETTINGS === 'android.settings.NFC_PAYMENT_SETTINGS';
IntentLauncherAndroid.ACTION_NFC_SETTINGS === 'android.settings.NFC_SETTINGS';
IntentLauncherAndroid.ACTION_NIGHT_DISPLAY_SETTINGS === 'android.settings.NIGHT_DISPLAY_SETTINGS';
IntentLauncherAndroid.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS === 'android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS';
IntentLauncherAndroid.ACTION_NOTIFICATION_SETTINGS === 'android.settings.NOTIFICATION_SETTINGS';
IntentLauncherAndroid.ACTION_PAIRING_SETTINGS === 'android.settings.PAIRING_SETTINGS';
IntentLauncherAndroid.ACTION_PRIVACY_SETTINGS === 'android.settings.PRIVACY_SETTINGS';
IntentLauncherAndroid.ACTION_QUICK_LAUNCH_SETTINGS === 'android.settings.QUICK_LAUNCH_SETTINGS';
IntentLauncherAndroid.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS === 'android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS';
IntentLauncherAndroid.ACTION_SECURITY_SETTINGS === 'android.settings.SECURITY_SETTINGS';
IntentLauncherAndroid.ACTION_SETTINGS === 'android.settings.SETTINGS';
IntentLauncherAndroid.ACTION_SHOW_ADMIN_SUPPORT_DETAILS === 'android.settings.SHOW_ADMIN_SUPPORT_DETAILS';
IntentLauncherAndroid.ACTION_SHOW_INPUT_METHOD_PICKER === 'android.settings.SHOW_INPUT_METHOD_PICKER';
IntentLauncherAndroid.ACTION_SHOW_REGULATORY_INFO === 'android.settings.SHOW_REGULATORY_INFO';
IntentLauncherAndroid.ACTION_SHOW_REMOTE_BUGREPORT_DIALOG === 'android.settings.SHOW_REMOTE_BUGREPORT_DIALOG';
IntentLauncherAndroid.ACTION_SOUND_SETTINGS === 'android.settings.SOUND_SETTINGS';
IntentLauncherAndroid.ACTION_STORAGE_MANAGER_SETTINGS === 'android.settings.STORAGE_MANAGER_SETTINGS';
IntentLauncherAndroid.ACTION_SYNC_SETTINGS === 'android.settings.SYNC_SETTINGS';
IntentLauncherAndroid.ACTION_SYSTEM_UPDATE_SETTINGS === 'android.settings.SYSTEM_UPDATE_SETTINGS';
IntentLauncherAndroid.ACTION_TETHER_PROVISIONING_UI === 'android.settings.TETHER_PROVISIONING_UI';
IntentLauncherAndroid.ACTION_TRUSTED_CREDENTIALS_USER === 'android.settings.TRUSTED_CREDENTIALS_USER';
IntentLauncherAndroid.ACTION_USAGE_ACCESS_SETTINGS === 'android.settings.USAGE_ACCESS_SETTINGS';
IntentLauncherAndroid.ACTION_USER_DICTIONARY_INSERT === 'android.settings.USER_DICTIONARY_INSERT';
IntentLauncherAndroid.ACTION_USER_DICTIONARY_SETTINGS === 'android.settings.USER_DICTIONARY_SETTINGS';
IntentLauncherAndroid.ACTION_USER_SETTINGS === 'android.settings.USER_SETTINGS';
IntentLauncherAndroid.ACTION_VOICE_CONTROL_AIRPLANE_MODE === 'android.settings.VOICE_CONTROL_AIRPLANE_MODE';
IntentLauncherAndroid.ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE === 'android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE';
IntentLauncherAndroid.ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE === 'android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE';
IntentLauncherAndroid.ACTION_VOICE_INPUT_SETTINGS === 'android.settings.VOICE_INPUT_SETTINGS';
IntentLauncherAndroid.ACTION_VPN_SETTINGS === 'android.settings.VPN_SETTINGS';
IntentLauncherAndroid.ACTION_VR_LISTENER_SETTINGS === 'android.settings.VR_LISTENER_SETTINGS';
IntentLauncherAndroid.ACTION_WEBVIEW_SETTINGS === 'android.settings.WEBVIEW_SETTINGS';
IntentLauncherAndroid.ACTION_WIFI_IP_SETTINGS === 'android.settings.WIFI_IP_SETTINGS';
IntentLauncherAndroid.ACTION_WIFI_SETTINGS === 'android.settings.WIFI_SETTINGS';
IntentLauncherAndroid.ACTION_WIRELESS_SETTINGS === 'android.settings.WIRELESS_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_AUTOMATION_SETTINGS === 'android.settings.ZEN_MODE_AUTOMATION_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_EVENT_RULE_SETTINGS === 'android.settings.ZEN_MODE_EVENT_RULE_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS === 'android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_PRIORITY_SETTINGS === 'android.settings.ZEN_MODE_PRIORITY_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS === 'android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS';
IntentLauncherAndroid.ACTION_ZEN_MODE_SETTINGS === 'android.settings.ZEN_MODE_SETTINGS';
KeepAwake.activate();
KeepAwake.deactivate();
() => (
<LinearGradient
colors={['#fff']}
start={[1, 1]} />
);
() => (
<LinearGradient
colors={['#fff']}
style={{ flex: 1 }} />
);
Permissions.CAMERA === 'camera';
Permissions.CAMERA_ROLL === 'cameraRoll';
Permissions.AUDIO_RECORDING === 'audioRecording';
Permissions.CONTACTS === 'contacts';
Permissions.NOTIFICATIONS === 'remoteNotifications';
Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications';
Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness';
Permissions.USER_FACING_NOTIFICATIONS === 'userFacingNotifications';
Permissions.REMINDERS === 'reminders';
async () => {
const result = await Permissions.askAsync(Permissions.CAMERA);
result.status === 'granted';
result.status === 'denied';
result.status === 'undetermined';
result.expires === 'never';
};
ScreenOrientation.Orientation.ALL;
ScreenOrientation.allow(ScreenOrientation.Orientation.ALL);
class __TestEntry__ extends React.Component {
render() {
return(
<Text>test</Text>
);
}
}
registerRootComponent(__TestEntry__);
Calendar.EntityTypes.EVENT === 'event';
Calendar.EntityTypes.REMINDER === 'reminder';
Calendar.CalendarType.LOCAL === 'local';
Calendar.CalendarType.CALDAV === 'caldav';
Calendar.CalendarType.EXCHANGE === 'exchange';
Calendar.CalendarType.SUBSCRIBED === 'subscribed';
Calendar.CalendarType.BIRTHDAYS === 'birthdays';
async () => {
const result = await Calendar.getCalendarsAsync(Calendar.EntityTypes.EVENT);
result.length;
const calendar = result[0];
calendar.id === '';
calendar.title === '';
calendar.sourceId === '';
calendar.type === Calendar.CalendarType.BIRTHDAYS;
calendar.color === '';
calendar.entityType === Calendar.EntityTypes.EVENT;
calendar.allowsModifications === true;
calendar.allowedAvailabilities === [''];
calendar.isPrimary === true;
calendar.name === '';
calendar.ownerAccount === '';
calendar.timeZone === '';
calendar.allowedReminders === [''];
calendar.allowedAttendeeTypes === [''];
calendar.isVisible === false;
calendar.isSynced === false;
calendar.accessLevel === Calendar.CalendarAccessLevel.CONTRIBUTOR;
if (calendar.source) {
calendar.source.id === '';
calendar.source.type === '';
calendar.source.name === '';
calendar.source.isLocalAccount === false;
}
const id1 = await Calendar.createCalendarAsync({
accessLevel: Calendar.CalendarAccessLevel.EDITOR
});
id1 === '';
const id2 = await Calendar.updateCalendarAsync('1234', {
isVisible: false
});
id2 === '';
const id3 = await Calendar.updateCalendarAsync('1234', null);
await Calendar.deleteCalendarAsync('1234');
const events = await Calendar.getEventsAsync(
['123', '124'],
new Date(),
new Date()
);
const event1 = events[0];
event1.accessLevel === Calendar.EventAccessLevel.CONFIDENTIAL;
event1.alarms === [];
event1.allDay === true;
event1.availability === Calendar.Availability.FREE;
event1.calendarId === '';
event1.creationDate === '';
event1.endDate === '';
event1.endTimeZone === '';
event1.guestsCanInviteOthers === true;
event1.guestsCanModify === true;
event1.guestsCanSeeGuests === false;
event1.id === '';
event1.instanceId === '';
event1.isDetached === false;
const event2 = await Calendar.getEventAsync('123', {
futureEvents: true
});
const eventId1 = await Calendar.createEventAsync('123');
const eventId2 = await Calendar.updateEventAsync('1234');
await Calendar.deleteEventAsync('1234');
const attendees = await Calendar.getAttendeesForEventAsync('123');
const aId1 = await Calendar.createAttendeeAsync('123');
const aId2 = await Calendar.updateAttendeeAsync('123');
await Calendar.deleteAttendeeAsync('123');
const reminders = await Calendar.getRemindersAsync(['123']);
const reminder = await Calendar.getReminderAsync('123');
const remId1 = await Calendar.createReminderAsync('123');
const remId2 = await Calendar.updateReminderAsync('123');
await Calendar.deleteReminderAsync('123');
const sources = await Calendar.getSourcesAsync();
const source = await Calendar.getSourceAsync('123');
Calendar.openEventInCalendar('123');
};
async () => {
const result = await MailComposer.composeAsync({
subject: 'sss'
});
result.status === 'saved';
};
async () => {
const updateEventListener: Updates.UpdateEventListener = ({ type, manifest, message }) => {
switch (type) {
case Updates.EventType.DOWNLOAD_STARTED:
case Updates.EventType.DOWNLOAD_PROGRESS:
case Updates.EventType.DOWNLOAD_FINISHED:
case Updates.EventType.NO_UPDATE_AVAILABLE:
case Updates.EventType.ERROR:
return true;
}
};
Updates.reload();
Updates.reloadFromCache();
Updates.addListener(updateEventListener);
const updateCheckResult = await Updates.checkForUpdateAsync();
if (updateCheckResult.isAvailable) {
console.log(updateCheckResult.manifest);
}
Updates.fetchUpdateAsync(updateEventListener);
const bundleFetchResult = await Updates.fetchUpdateAsync();
if (bundleFetchResult.isNew) {
console.log(bundleFetchResult.manifest);
}
};
+2854
View File
File diff suppressed because it is too large Load Diff
+33
View File
@@ -0,0 +1,33 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"dom",
"es6"
],
"jsx": "react",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../../",
"typeRoots": [
"../../"
],
"paths": {
"expo": [
"expo/v26"
],
"expo/*": [
"expo/v26/*"
]
},
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"expo-tests.tsx"
]
}
+7
View File
@@ -0,0 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"void-return": false,
"max-line-length": false
}
}
@@ -11,7 +11,7 @@ app.use(session({
secret: 'keyboard cat',
name: 'connect.sid',
store: new session.MemoryStore(),
cookie: { path: '/', httpOnly: true, secure: false },
cookie: { path: '/', httpOnly: true, secure: false, sameSite: true },
genid: (req: express.Request): string => '',
rolling: false,
resave: true,
+1
View File
@@ -32,6 +32,7 @@ declare global {
httpOnly: boolean;
domain?: string;
expires: Date | boolean;
sameSite?: boolean | string;
}
interface SessionCookie extends SessionCookieData {
@@ -18,7 +18,7 @@ let buffer: Buffer;
declare const modeNum: number;
declare const modeStr: string;
declare const encoding: string;
declare const type: string;
declare const symlinkType: "file" | "dir" | "junction";
declare const flags: string;
declare const srcpath: string;
declare const dstpath: string;
@@ -117,8 +117,8 @@ stats = fs.lstatSync(path);
stats = fs.fstatSync(fd);
fs.link(srcpath, dstpath, errorCallback);
fs.linkSync(srcpath, dstpath);
fs.symlink(srcpath, dstpath, type, errorCallback);
fs.symlinkSync(srcpath, dstpath, type);
fs.symlink(srcpath, dstpath, symlinkType, errorCallback);
fs.symlinkSync(srcpath, dstpath, symlinkType);
fs.readlink(path, (err: Error, linkString: string) => {
});
fs.realpath(path, (err: Error, resolvedPath: string) => {
+2 -2
View File
@@ -90,7 +90,7 @@ export function fstatSync(fd: number): Stats;
export function link(srcpath: string, dstpath: string, callback?: (err: Error) => void): void;
export function linkSync(srcpath: string, dstpath: string): void;
export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err: Error) => void): void;
export function symlinkSync(srcpath: string, dstpath: string, type?: string): void;
export function symlinkSync(srcpath: string, dstpath: string, type?: fs.symlink.Type): void;
export function readlink(path: string, callback?: (err: Error, linkString: string) => void): void;
export function realpath(path: string, callback?: (err: Error, resolvedPath: string) => void): void;
export function realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) => void): void;
@@ -189,7 +189,7 @@ export function statAsync(path: string): Promise<Stats>;
export function lstatAsync(path: string): Promise<Stats>;
export function fstatAsync(fd: number): Promise<Stats>;
export function linkAsync(srcpath: string, dstpath: string): Promise<void>;
export function symlinkAsync(srcpath: string, dstpath: string, type?: string): Promise<void>;
export function symlinkAsync(srcpath: string, dstpath: string, type?: fs.symlink.Type): Promise<void>;
export function readlinkAsync(path: string): Promise<string>;
export function realpathAsync(path: string, cache?: string): Promise<string>;
export function unlinkAsync(path: string): Promise<void>;
@@ -20,7 +20,7 @@ let buffer: Buffer;
declare const modeNum: number;
declare const modeStr: string;
declare const encoding: string;
declare const type: string;
declare const symlinkType: "file" | "dir" | "junction";
declare const flags: string;
declare const srcpath: string;
declare const dstpath: string;
@@ -117,8 +117,8 @@ stats = fs.lstatSync(path);
stats = fs.fstatSync(fd);
fs.link(srcpath, dstpath, errorCallback);
fs.linkSync(srcpath, dstpath);
fs.symlink(srcpath, dstpath, type, errorCallback);
fs.symlinkSync(srcpath, dstpath, type);
fs.symlink(srcpath, dstpath, symlinkType, errorCallback);
fs.symlinkSync(srcpath, dstpath, symlinkType);
fs.readlink(path, (err: Error, linkString: string) => {
});
fs.realpath(path, (err: Error, resolvedPath: string) => {
+3 -2
View File
@@ -7,9 +7,10 @@
/// <reference types="node" />
import * as stream from 'stream';
import { Stats } from 'fs';
import * as fs from 'fs';
import * as Promise from 'bluebird';
import { CopyFilter, CopyOptions, ReadOptions, WriteOptions, MoveOptions } from 'fs-extra';
import Stats = fs.Stats;
export * from 'fs-extra';
@@ -53,7 +54,7 @@ export function statAsync(path: string): Promise<Stats>;
export function lstatAsync(path: string): Promise<Stats>;
export function fstatAsync(fd: number): Promise<Stats>;
export function linkAsync(srcpath: string, dstpath: string): Promise<void>;
export function symlinkAsync(srcpath: string, dstpath: string, type?: string): Promise<void>;
export function symlinkAsync(srcpath: string, dstpath: string, type?: fs.symlink.Type): Promise<void>;
export function readlinkAsync(path: string): Promise<string>;
export function realpathAsync(path: string, cache?: { [path: string]: string }): Promise<string>;
export function unlinkAsync(path: string): Promise<void>;
+5 -3
View File
@@ -10,7 +10,8 @@
/// <reference types="node" />
import { Stats } from "fs";
import * as fs from "fs";
import Stats = fs.Stats;
export * from "fs";
@@ -206,8 +207,9 @@ export function rmdir(path: string | Buffer): Promise<void>;
export function stat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
export function stat(path: string | Buffer): Promise<Stats>;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: string, callback: (err: NodeJS.ErrnoException) => void): void;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: string): Promise<void>;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: fs.symlink.Type | undefined, callback: (err: NodeJS.ErrnoException) => void): void;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: fs.symlink.Type): Promise<void>;
export function truncate(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void;
export function truncate(path: string | Buffer, len: number, callback: (err: NodeJS.ErrnoException) => void): void;
+14
View File
@@ -0,0 +1,14 @@
import gitBranch = require('git-branch');
gitBranch()
.then((name) => {});
gitBranch('cwd')
.then((name) => {});
gitBranch.sync();
gitBranch.sync('cwd');
gitBranch((err, name) => {});
gitBranch('cwd', (err, name) => {});
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for git-branch 2.0
// Project: https://github.com/jonschlinkert/git-branch
// Definitions by: Ryan Clark <https://github.com/rynclark>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
export = GitBranch;
declare function GitBranch(cwd?: string): Promise<string>;
declare function GitBranch(cwd?: string, callback?: (err: null | string, name: string) => void): void;
declare function GitBranch(callback?: (err: null | string, name: string) => void): void;
declare namespace GitBranch {
function sync(cwd?: string): string;
}
+23
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",
"git-branch-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
@@ -0,0 +1,26 @@
import globToRegExp = require('glob-to-regexp');
let re = globToRegExp("p*uck");
re.test("pot luck"); // true
re.test("pluck"); // true
re.test("puck"); // true
re = globToRegExp("*.min.js");
re.test("http://example.com/jquery.min.js"); // true
re.test("http://example.com/jquery.min.js.map"); // false
re = globToRegExp("*/www/*.js");
re.test("http://example.com/www/app.js"); // true
re.test("http://example.com/www/lib/factory-proxy-model-observer.js"); // true
// Extended globs
re = globToRegExp("*/www/{*.js,*.html}", { extended: true });
re.test("http://example.com/www/app.js"); // true
re.test("http://example.com/www/index.html"); // true
// globstar
re = globToRegExp("**/www/*", { globstar: true });
re.test("http://example.com/www/index.html"); // true
re.test("http://example.com/www/articles/index.html"); // false
re = globToRegExp("*/www/*", { globstar: true });
re.test("http://example.com/www/index.html"); // false
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for glob-to-regexp 0.4
// Project: https://github.com/fitzgen/glob-to-regexp#readme
// Definitions by: whatasoda <https://github.com/whatasoda>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export as namespace GlobToRegExp;
export = GlobToRegExp;
declare function GlobToRegExp(glob: string, options?: GlobToRegExp.Options): RegExp;
declare namespace GlobToRegExp {
interface Options {
extended?: boolean;
globstar?: boolean;
flags ?: string;
}
}
+23
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",
"glob-to-regexp-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+6 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for @google-cloud/pubsub 0.14
// Type definitions for @google-cloud/pubsub 0.18
// Project: https://github.com/GoogleCloudPlatform/google-cloud-node/tree/master/packages/pubsub
// Definitions by: Paul Huynh <https://github.com/pheromonez>
// LunaPg <https://github.com/LunaPg>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -13,9 +14,13 @@ declare namespace PubSub {
// https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/0.14.1/pubsub/v1
function v1(config?: GCloudConfiguration): any;
/**
* @version: Google PubSub 0.18.0
*/
interface GCloudConfiguration {
projectId?: string;
keyFilename?: string;
apiEndpoint?: string;
email?: string;
credentials?: {
client_email?: string;
+7
View File
@@ -110,8 +110,15 @@ declare namespace libphonenumber {
}
}
class StringBuffer {
constructor(opt_a1?: any, ...var_args: any[]);
append(a1: any, opt_a2?: any, ...var_args: any[]): StringBuffer;
toString(): string;
}
export class PhoneNumberUtil {
static getInstance(): PhoneNumberUtil
extractCountryCode(fullNumber: StringBuffer, nationalNumber: StringBuffer): number;
format(phoneNumber: PhoneNumber, format: PhoneNumberFormat): string;
formatOutOfCountryCallingNumber(phoneNumber: PhoneNumber, regionDialingFrom?: string): string;
getNddPrefixForRegion(regionCode?: string, stripNonDigits?: boolean): string | undefined;
@@ -0,0 +1,12 @@
import * as gulp from 'gulp';
import stripComments = require('gulp-strip-comments');
gulp.task('default', () => {
return gulp.src('src/app.js')
.pipe(stripComments({
safe: true,
}))
.pipe(stripComments.html())
.pipe(stripComments.text())
.pipe(gulp.dest('dist'));
});
+26
View File
@@ -0,0 +1,26 @@
// Type definitions for gulp-strip-comments 2.5
// Project: https://github.com/RnbWd/gulp-strip-comments
// Definitions by: Aqours <https://github.com/Aqours>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare namespace stripComments {
interface StripOptions {
safe?: boolean;
ignore?: RegExp | RegExp[];
space?: boolean;
trim?: boolean;
}
interface Strip {
(options?: StripOptions): NodeJS.ReadWriteStream;
text(options?: StripOptions): NodeJS.ReadWriteStream;
html(options?: StripOptions): NodeJS.ReadWriteStream;
getEOL(): string;
}
}
declare const strip: stripComments.Strip;
export = strip;
+23
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",
"gulp-strip-comments-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -338,6 +338,6 @@ declare module "handlebars" {
export = Handlebars;
}
declare module "handlebars/handlebars.runtime" {
declare module "handlebars/runtime" {
export = Handlebars;
}
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for intl-locales-supported 1.0
// Project: https://github.com/yahoo/intl-locales-supported
// Definitions by: Edward Sammut Alessi <https://github.com/Slessi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = areIntlLocalesSupported;
declare function areIntlLocalesSupported(locales: string | string[]): boolean;
@@ -0,0 +1,4 @@
import areIntlLocalesSupported = require("intl-locales-supported");
areIntlLocalesSupported("en-GB");
areIntlLocalesSupported([ "en-GB", "en-US" ]);
@@ -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",
"intl-locales-supported-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -1,6 +1,6 @@
{
"private": true,
"dependencies": {
"axe-core": "^2.6.1"
"axe-core": "^3.0.3"
}
}
+6
View File
@@ -14,6 +14,7 @@
// Josh Goldberg <https://github.com/joshuakgoldberg>
// Bradley Ayers <https://github.com/bradleyayers>
// Martin Hochel <https://github.com/hotell>
// Andrew Makarov <https://github.com/r3nya>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -474,6 +475,11 @@ declare namespace jest {
* to test what arguments it was last called with.
*/
toHaveBeenLastCalledWith(...params: any[]): R;
/**
* If you have a mock function, you can use `.toHaveBeenNthCalledWith`
* to test what arguments it was nth called with.
*/
toHaveBeenNthCalledWith(nthCall: number, ...params: any[]): R;
/**
* Used to check that an object has a `.length` property
* and it is set to a certain numeric value.
+6
View File
@@ -732,6 +732,12 @@ test('moduleName 2', () => {
expect(moduleName()).toEqual(2);
});
describe('toHaveBeenNthCalledWith', () => {
const fn = jest.fn();
expect(fn).toHaveBeenNthCalledWith(3, "foo");
});
// Jest config
{
interface JestConfigModule {defaults: jest.DefaultOptions; }
+2 -2
View File
@@ -7,7 +7,7 @@
/// <reference types="node" />
import { EventEmitter } from 'events';
import { MarkupData } from 'parse5';
import { ElementLocation } from 'parse5';
import * as tough from 'tough-cookie';
import { Script } from 'vm';
@@ -32,7 +32,7 @@ export class JSDOM {
/**
* The nodeLocation() method will find where a DOM node is within the source document, returning the parse5 location info for the node.
*/
nodeLocation(node: Node): MarkupData.ElementLocation | null;
nodeLocation(node: Node): ElementLocation | null;
/**
* The built-in vm module of Node.js allows you to create Script instances,
+3 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for jsreport-html-to-xlsx 1.4
// Type definitions for jsreport-html-to-xlsx 2.0
// Project: https://github.com/jsreport/jsreport-html-to-xlsx
// Definitions by: My Self <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -8,7 +8,9 @@ import { ExtensionDefinition } from 'jsreport-core';
import { Options as BaseOptions } from 'jsreport-xlsx';
declare module 'jsreport-core' {
type htmlEngine = 'phantom' | 'chrome';
interface Template {
htmlToXlsx: { htmlEngine: htmlEngine; };
recipe: 'html-to-xlsx' | string;
}
}
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for jsreport-html-to-xlsx 1.4
// Project: https://github.com/jsreport/jsreport-html-to-xlsx
// Definitions by: My Self <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { ExtensionDefinition } from 'jsreport-core';
import { Options as BaseOptions } from 'jsreport-xlsx';
declare module 'jsreport-core' {
interface Template {
recipe: 'html-to-xlsx' | string;
}
}
declare namespace JsReportHtml2Xlsx {
interface Options extends BaseOptions {
strategy: string;
}
}
declare function JsReportHtml2Xlsx(options?: Partial<JsReportHtml2Xlsx.Options>): ExtensionDefinition;
export = JsReportHtml2Xlsx;
@@ -0,0 +1,19 @@
import JsReport = require('jsreport-core');
import JsreportHtml2Xlsx = require('jsreport-html-to-xlsx');
import JsreportXlsx = require('jsreport-xlsx');
const jsreport = JsReport();
jsreport.use(JsreportXlsx());
jsreport.use(JsreportHtml2Xlsx());
(async () => {
const content = `<table><tr><td>test</td></tr></table>`;
await jsreport.init();
const resp = await jsreport.render({
template: {
content,
engine: 'none',
recipe: 'xlsx'
}
});
})();
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"esnext"
],
"strictFunctionTypes": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../../",
"typeRoots": [
"../../"
],
"paths": {
"jsreport-html-to-xlsx": [ "jsreport-html-to-xlsx/v1" ]
},
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"jsreport-html-to-xlsx-tests.ts"
]
}
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1
View File
@@ -210,6 +210,7 @@ declare namespace wx {
localIds: string[];
errMsg: string;
}): void;
cancel(): void;
}
/**
* 从本地相册选择图片或使用相机拍照。
+1 -1
View File
@@ -4311,7 +4311,7 @@ declare namespace kendo.ui {
scrollable?: boolean | GridScrollable;
selectable?: boolean|string;
sortable?: boolean | GridSortable;
toolbar?: GridToolbarItem[];
toolbar?: string|Function|(string|GridToolbarItem)[];
beforeEdit?(e: GridBeforeEditEvent): void;
cancel?(e: GridCancelEvent): void;
cellClose?(e: GridCellCloseEvent): void;
+7 -2
View File
@@ -1,8 +1,9 @@
// Type definitions for koa-webpack 5.x
// Project: https://github.com/shellscape/koa-webpack#readme
// Type definitions for koa-webpack 5.0
// Project: https://github.com/shellscape/koa-webpack
// Definitions by: Luka Maljic <https://github.com/malj>
// Lee Benson <https://github.com/leebenson>
// miZyind <https://github.com/miZyind>
// Tomek Łaziuk <https://github.com/tlaziuk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -25,11 +26,15 @@ declare namespace koaWebpack {
interface CombinedWebpackMiddleware {
devMiddleware: webpackDevMiddleware.WebpackDevMiddleware;
/**
* @todo make this a `webpack-hot-client@^4.0.0` instance, no typings for v4 available yet
*/
hotClient: {
close: () => void;
options: webpackHotClient.Options;
server: any;
};
close(callback?: () => any): void;
}
}
+5
View File
@@ -53,4 +53,9 @@ koaWebpack({
middleware.hotClient.close();
middleware.hotClient.options;
middleware.hotClient.server;
// close the middleware
middleware.close(() => {
console.log('closed');
});
});
+1 -1
View File
@@ -27,7 +27,7 @@ declare module 'leaflet' {
drawMarker?: boolean;
markerClass?: any;
circleStyle?: PathOptions;
markerStyle?: PathOptions;
markerStyle?: PathOptions | MarkerOptions;
followCircleStyle?: PathOptions;
followMarkerStyle?: PathOptions;
icon?: string;
+133 -74
View File
@@ -1,114 +1,173 @@
// Type definitions for Libxmljs v0.14.2
// Project: https://github.com/polotek/libxmljs
// Type definitions for Libxmljs 0.18
// Project: https://github.com/libxmljs/libxmljs
// Definitions by: François de Campredon <https://github.com/fdecampredon>
// ComFreek <https://github.com/ComFreek>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
import { EventEmitter } from 'events';
export const version: string;
export const libxml_version: string;
export const libxml_parser_version: string;
// tslint:disable-next-line:strict-export-declare-modifiers
interface ParseOptions {
[optionName: string]: string;
}
import events = require('events');
export function parseXml(source: string, options?: ParseOptions): Document;
export function parseXmlString(source: string, options?: ParseOptions): Document;
export declare function parseXml(source: string): XMLDocument;
export declare function parseHtml(source: string): HTMLDocument;
export declare function parseXmlString(source: string, options?: { [key: string]: string }): XMLDocument;
export declare function parseHtmlString(source: string): HTMLDocument;
export function parseHtml(source: string, options?: ParseOptions): Document;
export function parseHtmlString(source: string, options?: ParseOptions): Document;
export function parseHtmlFragment(source: string, options?: ParseOptions): Document;
export function memoryUsage(): number;
export function nodeCount(): number;
export declare class XMLDocument {
constructor(version: number, encoding: string);
child(idx: number): Element | undefined;
export class Document {
/**
* Create a new XML Document
* @param version XML document version, defaults to 1.0
* @param encoding Encoding, defaults to utf8
*/
constructor(version?: number, encoding?: string);
errors: SyntaxError[];
child(idx: number): Element|null;
childNodes(): Element[];
errors(): SyntaxError[];
encoding(): string;
encoding(enc: string): void;
encoding(enc: string): this;
find(xpath: string): Element[];
get(xpath: string): Element | undefined;
node(name: string, content: string): Element;
root(): Element;
toString(): string;
validate(xsdDoc: XMLDocument): boolean;
validationErrors: XmlError[];
version(): Number;
get(xpath: string): Element|null;
node(name: string, content?: string): Element;
root(): Element|null;
root(newRoot: Node): Node;
toString(formatted?: boolean): string;
type(): 'document';
version(): string;
setDtd(name: string, ext: string, sys: string): void;
getDtd(): {
name: string;
externalId: string;
systemId: string;
};
}
export declare class HTMLDocument extends XMLDocument {
export class Node {
doc(): Document;
parent(): Element|Document;
/**
* The namespace or null in case of comment nodes
*/
namespace(): Namespace|null;
/**
* An array of namespaces that the object belongs to.
*
* @param local If it is true, only the namespace declarations local to this
* node are returned, rather than all of the namespaces in scope
* at this node (including the ones from the parent elements).
*/
namespaces(local?: boolean): Namespace[];
prevSibling(): Node|null;
nextSibling(): Node|null;
type(): 'comment'|'element'|'text'|'attribute';
remove(): this;
clone(): this;
/**
* Serializes the node to a string. The string will contain all contents of the node formatted as XML and can be used to print the node.
*/
toString(format?: boolean|{
declaration: boolean;
selfCloseEmpty: boolean;
whitespace: boolean;
type: 'xml'|'html'|'xhtml'
}): string;
}
export declare class Element {
constructor(doc: XMLDocument, name: string, content?: string);
export class Element extends Node {
constructor(doc: Document, name: string, content?: string);
node(name: string, content?: string): Element;
name(): string;
name(newName: string): void;
name(newName: string): this;
text(): string;
attr(name: string): Attribute;
attr(attr: Attribute): void;
attr(attrObject: { [key: string]: string; }): void;
text(newText: string): this;
attr(name: string): Attribute|null;
attr(attrObject: { [key: string]: string; }): this;
attrs(): Attribute[];
parent(): Element;
doc(): XMLDocument;
child(idx: number): Element | undefined;
childNodes(): Element[];
addChild(child: Element): Element;
nextSibling(): Element;
nextElement(): Element;
addNextSibling(siblingNode: Element): Element;
prevSibling(): Element;
prevElement(): Element;
addPrevSibling(siblingNode: Element): Element;
find(xpath: string): Element[];
find(xpath: string, ns_uri: string): Element[];
find(xpath: string, namespaces: { [key: string]: string; }): Element[];
get(xpath: string): Element | undefined;
get(xpath: string, ns_uri: string): Element | undefined;
get(xpath: string, ns_uri: { [key: string]: string; }): Element | undefined;
defineNamespace(href: string): Namespace;
defineNamespace(prefix: string, href: string): Namespace;
namespace(): Namespace;
namespace(ns: Namespace): void;
namespace(href: string): void;
namespace(prefix: string, href: string): void;
remove(): void;
doc(): Document;
child(idx: number): Node | null;
childNodes(): Node[];
/**
* @return The original element, not the child.
*/
addChild(child: Element): this;
prevElement(): Element|null;
nextElement(): Element|null;
addNextSibling(siblingNode: Node): Node;
find(xpath: string, ns_uri?: string): Node[];
find(xpath: string, namespaces: { [key: string]: string; }): Node[];
get(xpath: string, ns_uri?: string): Element|null;
defineNamespace(prefixOrHref: string, hrefInCaseOfPrefix?: string): Namespace;
namespace(): Namespace|null;
namespace(newNamespace: Namespace): this;
namespace(prefixOrHref: string, hrefInCaseOfPrefix?: string): Namespace;
replace(replacement: string): string;
replace(replacement: Element): Element;
path(): string;
type(): string;
}
export declare class Attribute {
constructor(node: Element, name: string, value: string);
constructor(node: Element, name: string, value: string, ns: Namespace);
export class Attribute {
name(): string;
namespace(): Namespace;
namespace(ns: Namespace): Namespace;
nextSibling(): Attribute;
node(): Element;
prevSibling(): Attribute;
remove(): void;
value(): string;
value(newValue: string): Attribute;
namespace(): Namespace;
remove(): void;
}
export declare class Namespace {
constructor(node: Element, prefix: string, href: string);
export class Namespace {
href(): string;
prefix(): string;
}
export declare class SaxParser extends events.EventEmitter {
export class SaxParser extends EventEmitter {
constructor();
parseString(source: string): boolean;
}
export declare class SaxPushParser extends events.EventEmitter {
export class SaxPushParser extends EventEmitter {
constructor();
push(source: string): boolean;
}
export interface XmlError {
domain: number;
code: number;
message: string;
level: number;
file?: string;
export interface SyntaxError {
domain: number|null;
code: number|null;
message: string|null;
level: number|null;
file: string|null;
line: number|null;
/**
* 1-based column number, 0 if not applicable/available.
*/
column: number;
line: number;
str1: number|null;
str2: number|null;
str3: number|null;
int1: number|null;
}
+20 -19
View File
@@ -1,7 +1,6 @@
import * as libxmljs from 'libxmljs';
var libxmljs = require("libxmljs");
var xml = '<?xml version="1.0" encoding="UTF-8"?>' +
const xml = '<?xml version="1.0" encoding="UTF-8"?>' +
'<root>' +
'<child foo="bar">' +
'<grandchild baz="fizbuzz">grandchild content</grandchild>' +
@@ -9,40 +8,42 @@ var xml = '<?xml version="1.0" encoding="UTF-8"?>' +
'<sibling>with content!</sibling>' +
'</root>';
var xmlDoc = libxmljs.parseXml(xml);
const xmlDoc = libxmljs.parseXml(xml);
// xpath queries
var gchild = xmlDoc.get('//grandchild');
const gchild = xmlDoc.get('//grandchild')!;
console.log(gchild.text()); // prints "grandchild content"
var children = xmlDoc.root().childNodes();
var child = children[0];
const children = xmlDoc.root()!.childNodes();
const child = children[0] as libxmljs.Element;
console.log(child.attr('foo').value()); // prints "bar"
console.log(child.attr('foo')!.value()); // prints "bar"
var parser = new libxmljs.SaxParser();
const parser = new libxmljs.SaxParser();
parser.on('startDocument', null);
parser.on('startElement', null);
parser.on('startDocument', () => 0);
parser.on('startElement', () => 0);
var parser2 = new libxmljs.SaxPushParser();
const parser2 = new libxmljs.SaxPushParser();
// connect any callbacks here
parser2
.on('startDocument', null)
.on('startElement', null)
.on('startDocument', () => 0)
.on('startElement', () => 0);
var xmlChunk: any;
const xmlChunk = '';
while(xmlChunk) {
while (xmlChunk) {
parser2.push(xmlChunk);
}
var doc = new libxmljs.Document();
doc.node('root')
const doc = new libxmljs.Document();
((doc.node('root')
.node('child').attr({foo: 'bar'})
.node('grandchild', 'grandchild content').attr({baz: 'fizbuzz'})
.parent()
.parent()
) as libxmljs.Element).parent()
.node('sibling', 'with content!');
const {name, externalId, systemId} = doc.getDtd();

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