mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge branch 'master' into master
This commit is contained in:
@@ -96,7 +96,7 @@ First, [fork](https://guides.github.com/activities/forking/) this repository, in
|
||||
// Steve <https://github.com/steve>
|
||||
// John <https://github.com/john>
|
||||
```
|
||||
* `npm install -g typescript@2.0` and run `tsc`.
|
||||
* If there is a `tslint.json`, run `npm run lint package-name`. Otherwise, run `tsc` in the package directory.
|
||||
|
||||
When you make a PR to edit an existing package, `dt-bot` should @-mention previous authors.
|
||||
If it doesn't, you can do so yourself in the comment associated with the PR.
|
||||
|
||||
@@ -430,7 +430,7 @@
|
||||
"libraryName": "qiniu",
|
||||
"typingsPackageName": "qiniu",
|
||||
"sourceRepoURL": "https://github.com/qiniu/nodejs-sdk",
|
||||
"asOfVersion": "6.1.0"
|
||||
"asOfVersion": "7.0.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "Raven JS",
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
"scripts": {
|
||||
"compile-scripts": "tsc -p scripts",
|
||||
"not-needed": "node scripts/not-needed.js",
|
||||
"test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed --nProcesses 4",
|
||||
"test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed --nProcesses 8",
|
||||
"lint": "dtslint types"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import * as Alexa from "alexa-sdk";
|
||||
|
||||
const handler = (event: Alexa.RequestBody, context: Alexa.Context, callback: () => void) => {
|
||||
const handler = (event: Alexa.RequestBody<Alexa.Request>, context: Alexa.Context, callback: () => void) => {
|
||||
let alexa = Alexa.handler(event, context);
|
||||
alexa.registerHandlers(handlers);
|
||||
alexa.execute();
|
||||
};
|
||||
|
||||
let handlers: Alexa.Handlers = {
|
||||
let handlers: Alexa.Handlers<Alexa.Request> = {
|
||||
'LaunchRequest': function() {
|
||||
this.emit('SayHello');
|
||||
},
|
||||
|
||||
Vendored
+28
-27
@@ -6,14 +6,14 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export function handler(event: RequestBody, context: Context, callback?: (err: any, response: any) => void ): AlexaObject;
|
||||
export function handler<T>(event: RequestBody<T>, context: Context, callback?: (err: any, response: any) => void ): AlexaObject<T>;
|
||||
export function CreateStateHandler(state: string, obj: any): any;
|
||||
export let StateString: string;
|
||||
|
||||
export type ConfirmationStatuses = "NONE" | "DENIED" | "CONFIRMED";
|
||||
export type DialogStates = "STARTED" | "IN_PROGRESS" | "COMPLETED";
|
||||
|
||||
export interface AlexaObject extends Handler {
|
||||
export interface AlexaObject<T> extends Handler<T> {
|
||||
_event: any;
|
||||
_context: any;
|
||||
_callback: any;
|
||||
@@ -22,26 +22,26 @@ export interface AlexaObject extends Handler {
|
||||
response: any;
|
||||
dynamoDBTableName: any;
|
||||
saveBeforeResponse: boolean;
|
||||
registerHandlers: (...handlers: Handlers[]) => any;
|
||||
registerHandlers: (...handlers: Array<Handlers<T>>) => any;
|
||||
execute: () => void;
|
||||
}
|
||||
|
||||
export interface Handlers {
|
||||
[intent: string]: (this: Handler) => void;
|
||||
export interface Handlers<T> {
|
||||
[intent: string]: (this: Handler<T>) => void;
|
||||
}
|
||||
|
||||
export interface Handler {
|
||||
export interface Handler<T> {
|
||||
on: any;
|
||||
emit(event: string, ...args: any[]): boolean;
|
||||
emitWithState: any;
|
||||
state: any;
|
||||
handler: any;
|
||||
event: RequestBody;
|
||||
event: RequestBody<T>;
|
||||
attributes: any;
|
||||
context: any;
|
||||
name: any;
|
||||
isOverriden: any;
|
||||
t: (token: string) => void;
|
||||
t: (token: string, ...args: any[]) => void;
|
||||
}
|
||||
|
||||
export interface Context {
|
||||
@@ -55,10 +55,10 @@ export interface Context {
|
||||
awsRequestId: string;
|
||||
}
|
||||
|
||||
export interface RequestBody {
|
||||
export interface RequestBody<T> {
|
||||
version: string;
|
||||
session: Session;
|
||||
request: LaunchRequest | IntentRequest | SessionEndedRequest;
|
||||
request: T;
|
||||
}
|
||||
|
||||
export interface Session {
|
||||
@@ -75,36 +75,37 @@ export interface SessionApplication {
|
||||
|
||||
export interface SessionUser {
|
||||
userId: string;
|
||||
accessToken: string;
|
||||
accessToken?: string;
|
||||
}
|
||||
|
||||
export interface LaunchRequest extends Request { }
|
||||
|
||||
export interface IntentRequest extends Request {
|
||||
dialogState: DialogStates;
|
||||
intent: Intent;
|
||||
}
|
||||
|
||||
export interface SlotValue {
|
||||
confirmationStatus: ConfirmationStatuses;
|
||||
name: string;
|
||||
value?: any;
|
||||
}
|
||||
|
||||
export interface Intent {
|
||||
confirmationStatus: ConfirmationStatuses;
|
||||
name: string;
|
||||
slots: Record<string, SlotValue>;
|
||||
dialogState?: DialogStates;
|
||||
intent?: Intent;
|
||||
}
|
||||
|
||||
export interface SessionEndedRequest extends Request {
|
||||
reason: string;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
export interface Request {
|
||||
type: "LaunchRequest" | "IntentRequest" | "SessionEndedRequest";
|
||||
requestId: string;
|
||||
timeStamp: string;
|
||||
timestamp: string;
|
||||
locale?: string;
|
||||
}
|
||||
|
||||
export interface SlotValue {
|
||||
confirmationStatus?: ConfirmationStatuses;
|
||||
name: string;
|
||||
value?: any;
|
||||
}
|
||||
|
||||
export interface Intent {
|
||||
confirmationStatus?: ConfirmationStatuses;
|
||||
name: string;
|
||||
slots: Record<string, SlotValue>;
|
||||
}
|
||||
|
||||
export interface ResponseBody {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"object-literal-key-quote": false,
|
||||
"no-empty-interface": false,
|
||||
"prefer-method-signature": false,
|
||||
"object-literal-key-quotes": false
|
||||
"object-literal-key-quotes": false,
|
||||
"no-any": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+6
@@ -1474,6 +1474,12 @@ declare namespace angular {
|
||||
* See [XMLHttpRequest.responseType]https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype
|
||||
*/
|
||||
responseType?: string;
|
||||
|
||||
/**
|
||||
* Name of the parameter added (by AngularJS) to the request to specify the name (in the server response) of the JSON-P callback to invoke.
|
||||
* If unspecified, $http.defaults.jsonpCallbackParam will be used by default. This property is only applicable to JSON-P requests.
|
||||
*/
|
||||
jsonpCallbackParam?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as $ from 'jquery';
|
||||
import $ = require('jquery');
|
||||
import * as angular from 'angular';
|
||||
|
||||
function JQuery() {
|
||||
@@ -82,11 +82,14 @@ function JQuery() {
|
||||
alt: 'jQuery Logo'
|
||||
});
|
||||
|
||||
// $ExpectType string
|
||||
$('img').attr('src');
|
||||
// @types/angular's definition wins here
|
||||
// // $ExpectType string | undefined
|
||||
// $('img').attr('src');
|
||||
}
|
||||
|
||||
function bind() {
|
||||
interface I1 { kind: 'I1'; }
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('p').bind('myEvent', 'myData', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
@@ -95,6 +98,14 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('p').bind('myEvent', 'myData', function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('p').bind('myEvent', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
@@ -103,16 +114,32 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('p').bind('myEvent', function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('p').bind('myEvent', false);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('p').bind({
|
||||
myEvent1(event) {
|
||||
myEvent1: false,
|
||||
myEvent2(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent3(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
}
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
@@ -123,19 +150,35 @@ function JQuery() {
|
||||
}
|
||||
|
||||
function children() {
|
||||
$('p').children();
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('p').children('span');
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('p').children();
|
||||
}
|
||||
|
||||
function off() {
|
||||
function defaultContext_defaultData(this: HTMLElement, event: JQuery.Event<HTMLElement>) { }
|
||||
|
||||
function defaultContext_customData(this: HTMLElement, event: JQuery.Event<HTMLElement, string>) { }
|
||||
|
||||
function customContext_defaultData(this: I1, event: JQuery.Event<HTMLElement>) { }
|
||||
|
||||
function customContext_customData(this: I1, event: JQuery.Event<HTMLElement, string>) { }
|
||||
|
||||
interface I1 { kind: 'I1'; }
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off('myEvent', 'td', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
});
|
||||
$('table').off('myEvent', 'td', defaultContext_defaultData);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off('myEvent', 'td', defaultContext_customData);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off('myEvent', 'td', customContext_defaultData);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off('myEvent', 'td', customContext_customData);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off('myEvent', 'td', false);
|
||||
@@ -144,12 +187,16 @@ function JQuery() {
|
||||
$('table').off('myEvent', 'td');
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off('myEvent', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
});
|
||||
$('table').off('myEvent', defaultContext_defaultData);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off('myEvent', defaultContext_customData);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off('myEvent', customContext_defaultData);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off('myEvent', customContext_customData);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off('myEvent', false);
|
||||
@@ -159,24 +206,20 @@ function JQuery() {
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off({
|
||||
myEvent1(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent1: false,
|
||||
defaultContext_defaultData,
|
||||
defaultContext_customData,
|
||||
customContext_defaultData,
|
||||
customContext_customData
|
||||
}, 'td');
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').off({
|
||||
myEvent1(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent1: false,
|
||||
defaultContext_defaultData,
|
||||
defaultContext_customData,
|
||||
customContext_defaultData,
|
||||
customContext_customData
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
@@ -187,6 +230,8 @@ function JQuery() {
|
||||
}
|
||||
|
||||
function on() {
|
||||
interface I1 { kind: 'I1'; }
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on('myEvent', 'td', 'myData', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
@@ -195,6 +240,14 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on('myEvent', 'td', 'myData', function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on('myEvent', null, 'myData', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
@@ -203,6 +256,14 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on('myEvent', null, 'myData', function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on('myEvent', 'td', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
@@ -211,6 +272,14 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on('myEvent', 'td', function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on('myEvent', 'td', false);
|
||||
|
||||
@@ -222,6 +291,14 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on('myEvent', 3, function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, number>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on('myEvent', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
@@ -230,66 +307,106 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on('myEvent', function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on('myEvent', false);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on({
|
||||
myEvent1(event) {
|
||||
myEvent1: false,
|
||||
myEvent2(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent3(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
}
|
||||
}, 'td', 'myData');
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on({
|
||||
myEvent1(event) {
|
||||
myEvent1: false,
|
||||
myEvent2(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent3(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
}
|
||||
}, null, 'myData');
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on({
|
||||
myEvent1(event) {
|
||||
myEvent1: false,
|
||||
myEvent2(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent3(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
}
|
||||
}, 'td');
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on({
|
||||
myEvent1(event) {
|
||||
myEvent1: false,
|
||||
myEvent2(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, number>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent3(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, number>
|
||||
event;
|
||||
}
|
||||
}, 3);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').on({
|
||||
myEvent1(event) {
|
||||
myEvent1: false,
|
||||
myEvent2(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent3(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function one() {
|
||||
interface I1 { kind: 'I1'; }
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one('myEvent', 'td', 'myData', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
@@ -298,6 +415,14 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one('myEvent', 'td', 'myData', function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one('myEvent', null, 'myData', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
@@ -306,6 +431,14 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one('myEvent', null, 'myData', function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one('myEvent', 'td', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
@@ -314,6 +447,14 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one('myEvent', 'td', function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one('myEvent', 'td', false);
|
||||
|
||||
@@ -325,6 +466,14 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one('myEvent', 3, function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, number>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one('myEvent', function(event) {
|
||||
// $ExpectType HTMLElement
|
||||
@@ -333,62 +482,100 @@ function JQuery() {
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one('myEvent', function(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
});
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one('myEvent', false);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one({
|
||||
myEvent1(event) {
|
||||
myEvent1: false,
|
||||
myEvent2(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent3(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
}
|
||||
}, 'td', 'myData');
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one({
|
||||
myEvent1(event) {
|
||||
myEvent1: false,
|
||||
myEvent2(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent3(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, string>
|
||||
event;
|
||||
}
|
||||
}, null, 'myData');
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one({
|
||||
myEvent1(event) {
|
||||
myEvent1: false,
|
||||
myEvent2(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent3(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
}
|
||||
}, 'td');
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one({
|
||||
myEvent1(event) {
|
||||
myEvent1: false,
|
||||
myEvent2(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, number>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent3(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, number>
|
||||
event;
|
||||
}
|
||||
}, 3);
|
||||
|
||||
// $ExpectType JQuery<HTMLElement>
|
||||
$('table').one({
|
||||
myEvent1(event) {
|
||||
myEvent1: false,
|
||||
myEvent2(event) {
|
||||
// $ExpectType HTMLElement
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
},
|
||||
myEvent2: false
|
||||
myEvent3(this: I1, event) {
|
||||
// $ExpectType I1
|
||||
this;
|
||||
// $ExpectType Event<HTMLElement, null>
|
||||
event;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3334
-1558
File diff suppressed because it is too large
Load Diff
Vendored
+103
-29
@@ -1,4 +1,4 @@
|
||||
// Type definitions for ArcGIS API for JavaScript 3.20
|
||||
// Type definitions for ArcGIS API for JavaScript 3.21
|
||||
// Project: https://developers.arcgis.com/javascript/3/
|
||||
// Definitions by: Esri <https://github.com/Esri>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -18,6 +18,7 @@ declare module "esri" {
|
||||
import BasemapLayer = require("esri/dijit/BasemapLayer");
|
||||
import Symbol = require("esri/symbols/Symbol");
|
||||
import BookmarkItem = require("esri/dijit/BookmarkItem");
|
||||
import TimeInfo = require("esri/layers/TimeInfo");
|
||||
import Color = require("esri/Color");
|
||||
import LocationProviderBase = require("esri/tasks/locationproviders/LocationProviderBase");
|
||||
import PictureMarkerSymbol = require("esri/symbols/PictureMarkerSymbol");
|
||||
@@ -213,6 +214,8 @@ declare module "esri" {
|
||||
isReference?: boolean;
|
||||
/** Initial opacity or transparency of the basemap layer. */
|
||||
opacity?: number;
|
||||
/** A url to a JSON file containing the stylesheet information to render the VectorTileLayer. */
|
||||
styleUrl?: string;
|
||||
/** Specify subDomains where tiles are served to speed up tile retrieval (using subDomains gets around the browser limit of the max number of concurrent requests to a domain). */
|
||||
subDomains?: string[];
|
||||
/** The URL template used to retrieve the tiles. */
|
||||
@@ -221,7 +224,7 @@ declare module "esri" {
|
||||
tileInfo?: TileInfo;
|
||||
/** Define additional tile server domains for the layer. */
|
||||
tileServer?: string[];
|
||||
/** The type of layer, valid values are "BingMapsAerial", "BingMapsHybrid", "BingMapsRoad", "OpenStreetMap", or "WebTiledLayer". */
|
||||
/** The type of layer. */
|
||||
type?: string;
|
||||
/** URL to the ArcGIS Server REST resource that represents a map or image service. */
|
||||
url?: string;
|
||||
@@ -293,6 +296,8 @@ declare module "esri" {
|
||||
outFields?: string[];
|
||||
/** Refresh interval of the layer in minutes. */
|
||||
refreshInterval?: number;
|
||||
/** Time information for the layer, such as start time field, end time field, track id field, layers time extent and the draw time interval. */
|
||||
timeInfo?: TimeInfo;
|
||||
/** Visibility of the layer. */
|
||||
visible?: boolean;
|
||||
}
|
||||
@@ -474,17 +479,17 @@ declare module "esri" {
|
||||
/** The selected color. */
|
||||
color: Color;
|
||||
/** The row size of the palette. */
|
||||
colorsPerRow: number;
|
||||
colorsPerRow?: number;
|
||||
/** The set of available color options. */
|
||||
palette: Color[];
|
||||
palette?: Color[];
|
||||
/** Array of recent colors to show in the recent colors row. */
|
||||
recentColors: Color[];
|
||||
recentColors?: Color[];
|
||||
/** Toggles color selection being required. */
|
||||
required: boolean;
|
||||
required?: boolean;
|
||||
/** Toggles the recent color row. */
|
||||
showRecentColors: boolean;
|
||||
showRecentColors?: boolean;
|
||||
/** Toggles the transparency slider. */
|
||||
showTransparencySlider: boolean;
|
||||
showTransparencySlider?: boolean;
|
||||
}
|
||||
export interface ConnectOriginsToDestinationsOptions {
|
||||
/** The URL to the GPServer used to execute an analysis job. */
|
||||
@@ -879,6 +884,8 @@ declare module "esri" {
|
||||
showSelectFolder?: boolean;
|
||||
}
|
||||
export interface FeatureLayerOptions {
|
||||
/** Indicates whether attribute features containing m-values can be edited. */
|
||||
allowUpdateWithoutMValues?: boolean;
|
||||
/** Enable or disable the auto generalization of features from a non-editable layer in on-demand mode. */
|
||||
autoGeneralize?: boolean;
|
||||
/** Class attribute to set for the layer's node. */
|
||||
@@ -1401,6 +1408,22 @@ declare module "esri" {
|
||||
force3DTransforms?: boolean;
|
||||
/** By default the map creates and uses an out-of-the-box esri/dijit/Popup. */
|
||||
infoWindow?: InfoWindowBase;
|
||||
/** Indicates whether to enable double-click on a map to recenter and zoom in a level by using SHIFT + Click. */
|
||||
isClickRecenter?: boolean;
|
||||
/** Indicates whether double-clicking on map zooms in on extent. */
|
||||
isDoubleClickZoom?: boolean;
|
||||
/** Indicates whether to enable navigation of the map using a keyboard's arrow keys. */
|
||||
isKeyboardNavigation?: boolean;
|
||||
/** Indicates whether all map navigation is enabled. */
|
||||
isMapNavigation?: boolean;
|
||||
/** Indicates whether panning is enabled within the map. */
|
||||
isPan?: boolean;
|
||||
/** Indicates whether pinch zoom navigation is enabled on touch-enabled devices. */
|
||||
isPinchZoom?: boolean;
|
||||
/** Indicates whether to enable a mouse drag to zoom into to a specific region on the map. */
|
||||
isRubberBandZoom?: boolean;
|
||||
/** (Added at version 3.21). */
|
||||
isScrollWheel?: boolean;
|
||||
/** If provided, the map is initialized with the specified levels of detail. */
|
||||
lods?: LOD[];
|
||||
/** Display the esri logo on the map. */
|
||||
@@ -1547,8 +1570,6 @@ declare module "esri" {
|
||||
popupWindowFeatures?: string;
|
||||
/** The ArcGIS for Portal URL. */
|
||||
portalUrl?: string;
|
||||
/** Indicates whether to display social logins such as Google/Facebook. */
|
||||
showSocialLogins?: boolean;
|
||||
}
|
||||
export interface ObliqueViewerOptions {
|
||||
/** Azimuth angle value for which to display oblique images. */
|
||||
@@ -1765,6 +1786,8 @@ declare module "esri" {
|
||||
export interface PrintOptions {
|
||||
/** Set to true if the print service is an asynchronous geoprocessing service. */
|
||||
async?: boolean;
|
||||
/** Additional parameters for the print service. */
|
||||
extraParameters?: any;
|
||||
/** The map to print. */
|
||||
map?: Map;
|
||||
/** An optional array of user-defined templates. */
|
||||
@@ -1891,8 +1914,6 @@ declare module "esri" {
|
||||
expanded?: boolean;
|
||||
/** This the specified graphicsLayer to use for the highlightGraphic and labelGraphic instead of map.graphics. */
|
||||
graphicsLayer?: Layer;
|
||||
/** The symbol used for highlightGraphic. */
|
||||
highlightSymbol?: Symbol;
|
||||
/** A customized infoTemplate for the selected feature. */
|
||||
infoTemplate?: InfoTemplate;
|
||||
/** The text symbol for the label graphic. */
|
||||
@@ -2528,7 +2549,7 @@ declare module "esri/IdentityManagerBase" {
|
||||
findCredential(url: string, userId?: string): Credential;
|
||||
/**
|
||||
* Returns the OAuth configuration for the passed in Portal server URL.
|
||||
* @param url The URL to the Portal.
|
||||
* @param url The ArcGIS for Portal URL, for example "https://www.arcgis.com" for ArcGIS Online and "https://www.example.com/portal" for your in-house portal.
|
||||
*/
|
||||
findOAuthInfo(url: string): OAuthInfo;
|
||||
/**
|
||||
@@ -2553,7 +2574,7 @@ declare module "esri/IdentityManagerBase" {
|
||||
* Call this method (during your application initialization) with JSON previously obtained from toJson method to re-hydrate the state of identity manager.
|
||||
* @param json The JSON obtained from the toJson method.
|
||||
*/
|
||||
initialize(json: Object): any;
|
||||
initialize(json: Object): void;
|
||||
/** Returns true if the identity manager is busy accepting user input, i.e., the user has invoked signIn and is waiting for a response. */
|
||||
isBusy(): boolean;
|
||||
/**
|
||||
@@ -2576,7 +2597,7 @@ declare module "esri/IdentityManagerBase" {
|
||||
registerServers(serverInfos: ServerInfo[]): void;
|
||||
/**
|
||||
* Registers the given OAuth2 access token with the identity manager.
|
||||
* @param properties See the object specifications table below for the structure of the properties object.
|
||||
* @param properties See the object specifications table below for the structure of the properties object.
|
||||
*/
|
||||
registerToken(properties: any): void;
|
||||
/**
|
||||
@@ -2889,8 +2910,6 @@ declare module "esri/arcgis/OAuthInfo" {
|
||||
popupWindowFeatures: string;
|
||||
/** The ArcGIS for Portal URL. */
|
||||
portalUrl: string;
|
||||
/** Indicates whether to display social logins like Google/Facebook. */
|
||||
showSocialLogins: boolean;
|
||||
/**
|
||||
* Creates a new OAuthInfo given the specified parameters.
|
||||
* @param params Various options to configure the OAuthInfo object.
|
||||
@@ -2947,6 +2966,8 @@ declare module "esri/arcgis/Portal" {
|
||||
defaultBasemap: any;
|
||||
/** The default extent for the map the portal displays in the map viewer. */
|
||||
defaultExtent: any;
|
||||
/** The default vector basemap to use for the portal. */
|
||||
defaultVectorBasemap: any;
|
||||
/** A description of the organization / portal. */
|
||||
description: string;
|
||||
/** The featured groups for the portal. */
|
||||
@@ -2957,6 +2978,8 @@ declare module "esri/arcgis/Portal" {
|
||||
featuredItemsGroupQuery: string;
|
||||
/** The query that identifies the group containing features items for the gallery. */
|
||||
galleryTemplatesGroupQuery: string;
|
||||
/** Helper services provided by the portal. */
|
||||
helperServices: any;
|
||||
/** The group that contains featured content to be displayed on the home page. */
|
||||
homePageFeaturedContent: string;
|
||||
/** The number of featured items that can be displayed on the home page. */
|
||||
@@ -2991,7 +3014,7 @@ declare module "esri/arcgis/Portal" {
|
||||
portalProperties: any;
|
||||
/** The URL to the thumbnail of the portal. */
|
||||
portalThumbnail: string;
|
||||
/** URL to the portal. */
|
||||
/** The REST URL for the portal, for example "https://www.arcgis.com/sharing/rest/" for ArcGIS Online and "https://www.example.com/arcgis/sharing/rest/" for your in-house portal. */
|
||||
portalUrl: string;
|
||||
/** The region for the organization. */
|
||||
region: string;
|
||||
@@ -3013,7 +3036,7 @@ declare module "esri/arcgis/Portal" {
|
||||
thumbnailUrl: string;
|
||||
/** Sets the units of measure for the organization's users. */
|
||||
units: string;
|
||||
/** The portal url. */
|
||||
/** The ArcGIS for Portal URL, for example "https://www.arcgis.com" for ArcGIS Online and "https://www.example.com/arcgis" for your in-house portal. */
|
||||
url: string;
|
||||
/** The prefix selected by the organization's administrator to be used with the customBaseURL. */
|
||||
urlKey: string;
|
||||
@@ -3021,9 +3044,13 @@ declare module "esri/arcgis/Portal" {
|
||||
user: PortalUser;
|
||||
/** If true, only simple where clauses that are complaint with SQL92 can be used when querying layers and tables. */
|
||||
useStandardizedQuery: boolean;
|
||||
/** Whether an organization has opted in to use the vector tile basemaps. */
|
||||
useVectorBasemaps: boolean;
|
||||
/** The query that defines the vector tiles basemaps that should be displayed in the Basemap Gallery when useVectorBasemaps is true. */
|
||||
vectorBasemapGalleryGroupQuery: string;
|
||||
/**
|
||||
* Creates a new Portal object.
|
||||
* @param url URL to the ArcGIS.com site or in-house portal.
|
||||
* @param url The ArcGIS for Portal URL, for example "https://www.arcgis.com" for ArcGIS Online and "https://www.example.com/arcgis" for your in-house portal.
|
||||
*/
|
||||
constructor(url: string);
|
||||
/** Returns a PortalUser object that describes the user currently signed in to the portal. */
|
||||
@@ -3111,6 +3138,11 @@ declare module "esri/arcgis/Portal" {
|
||||
url: string;
|
||||
/** Get the current members for the group. */
|
||||
getMembers(): any;
|
||||
/**
|
||||
* Get the URL to the thumbnail image for the portal group.
|
||||
* @param width The desired image width.
|
||||
*/
|
||||
getThumbnailUrl(width?: number): string;
|
||||
/**
|
||||
* Execute a query against the group to return a deferred that when resolved returns PortalQueryResult that contain a results array of PortalItem objects that match the input query.
|
||||
* @param queryParams The input query parameters.
|
||||
@@ -3196,6 +3228,11 @@ declare module "esri/arcgis/Portal" {
|
||||
getComments(): any;
|
||||
/** Returns the rating (if any) given to the item. */
|
||||
getRating(): any;
|
||||
/**
|
||||
* Get the URL to the thumbnail image for the portal item.
|
||||
* @param width The desired image width.
|
||||
*/
|
||||
getThumbnailUrl(width?: number): string;
|
||||
/**
|
||||
* Updates an item comment.
|
||||
* @param comment A PortalComment that contains the comment updates.
|
||||
@@ -3274,6 +3311,11 @@ declare module "esri/arcgis/Portal" {
|
||||
getNotifications(): any;
|
||||
/** Access the tag objects that have been created by the portal user. */
|
||||
getTags(): any;
|
||||
/**
|
||||
* Get the URL to the thumbnail image for the portal user.
|
||||
* @param width The desired image width.
|
||||
*/
|
||||
getThumbnailUrl(width?: number): string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3440,7 +3482,7 @@ declare module "esri/dijit/BasemapGallery" {
|
||||
import esri = require("esri");
|
||||
import Basemap = require("esri/dijit/Basemap");
|
||||
|
||||
/** The BasemapGallery dijit displays a collection basemaps from ArcGIS.com or a user-defined set of map or image services. */
|
||||
/** The BasemapGallery dijit displays a collection of basemaps from ArcGIS.com or a user-defined set of map or image services. */
|
||||
class BasemapGallery {
|
||||
/** List of basemaps displayed in the BasemapGallery. */
|
||||
basemaps: Basemap[];
|
||||
@@ -3508,6 +3550,8 @@ declare module "esri/dijit/BasemapLayer" {
|
||||
fullExtent: Extent;
|
||||
/** The initial extent of the layer. */
|
||||
initialExtent: Extent;
|
||||
/** A url to a JSON file containing the stylesheet information to render the VectorTileLayer. */
|
||||
styleUrl: string;
|
||||
/** The subDomains where tiles are served to speed up tile retrieval (using subDomains gets around the browser limit of the max number of concurrent requests to a domain). */
|
||||
subDomains: string[];
|
||||
/** The tile info for the layer including lods, rows, cols, origin and spatial reference. */
|
||||
@@ -5288,6 +5332,8 @@ declare module "esri/dijit/PopupTemplate" {
|
||||
|
||||
/** The PopupTemplate class extends esri/InfoTemplate and provides support for defining a layout. */
|
||||
class PopupTemplate extends InfoTemplate {
|
||||
/** An array of objects that reference Arcade expressions. */
|
||||
expressionInfos: any[];
|
||||
/** The popup definition defined as a JavaScript object. */
|
||||
info: any;
|
||||
/**
|
||||
@@ -5640,6 +5686,9 @@ declare module "esri/dijit/SymbolStyler" {
|
||||
startup(): void;
|
||||
/** Saves the recent fill and outline colors. */
|
||||
storeColors(): void;
|
||||
/** Fired every time an edit is committed. */
|
||||
on(type: "style-update", listener: (event: { target: SymbolStyler }) => void): esri.Handle;
|
||||
on(type: string, listener: (event: any) => void): esri.Handle;
|
||||
}
|
||||
export = SymbolStyler;
|
||||
}
|
||||
@@ -5865,7 +5914,7 @@ declare module "esri/dijit/analysis/AnalysisBase" {
|
||||
checkJobStatus(jobId: string): void;
|
||||
/**
|
||||
* Starts an analysis tool.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
*/
|
||||
execute(params: string): void;
|
||||
/**
|
||||
@@ -8633,6 +8682,8 @@ declare module "esri/graphic" {
|
||||
getShape(): any;
|
||||
/** Returns one or more dojox/gfx/shape.Shape used to draw the graphic. */
|
||||
getShapes(): any[];
|
||||
/** In contrast to the getLayer method, getSouceLayer does not change when a graphic is added to another layer. */
|
||||
getSourceLayer(): Layer;
|
||||
/** Returns the title string based on attributes and infoTemplate values. */
|
||||
getTitle(): string;
|
||||
/** Hides the graphic. */
|
||||
@@ -9471,6 +9522,8 @@ declare module "esri/layers/FeatureLayer" {
|
||||
advancedQueryCapabilities: any;
|
||||
/** Returns true if the geometry of the features in the layer can be edited, false otherwise. */
|
||||
allowGeometryUpdates: boolean;
|
||||
/** Indicates whether attribute features containing m-values can be edited. */
|
||||
allowUpdateWithoutMValues: boolean;
|
||||
/** The URL, when available, where the layer's attribution data is stored. */
|
||||
attributionDataUrl: string;
|
||||
/** Information about the capabilities enabled for this layer. */
|
||||
@@ -10279,6 +10332,8 @@ declare module "esri/layers/KMLLayer" {
|
||||
getFeature(featureInfo: any): any;
|
||||
/** Get an array of map layers that were created to draw placemarks, ground and screen overlays. */
|
||||
getLayers(): Layer[];
|
||||
/** Refreshes the features in the KML Layer. */
|
||||
refresh(): void;
|
||||
/**
|
||||
* Set the visibility for the specified folder.
|
||||
* @param folder A KML folder.
|
||||
@@ -11034,6 +11089,8 @@ declare module "esri/layers/VectorTileLayer" {
|
||||
fullExtent: Extent;
|
||||
/** The initial extent of the layer. */
|
||||
initialExtent: Extent;
|
||||
/** Name of the vector tile layer. */
|
||||
name: string;
|
||||
/** The spatial reference of the layer. */
|
||||
spatialReference: SpatialReference;
|
||||
/** Contains information about the tiling scheme for the layer. */
|
||||
@@ -11055,6 +11112,10 @@ declare module "esri/layers/VectorTileLayer" {
|
||||
setStyle(styleUrl: string | any): void;
|
||||
/** Fires when the style is changed on the layer. */
|
||||
on(type: "style-change", listener: (event: { style: any; target: VectorTileLayer }) => void): esri.Handle;
|
||||
/** Fires when the layer has finished updating its content. */
|
||||
on(type: "update-end", listener: (event: { target: VectorTileLayer }) => void): esri.Handle;
|
||||
/** Fires when the layer begins to update its content. */
|
||||
on(type: "update-start", listener: (event: { target: VectorTileLayer }) => void): esri.Handle;
|
||||
on(type: string, listener: (event: any) => void): esri.Handle;
|
||||
}
|
||||
export = VectorTileLayer;
|
||||
@@ -11773,12 +11834,18 @@ declare module "esri/map" {
|
||||
isDoubleClickZoom: boolean;
|
||||
/** When true, keyboard navigation is enabled. */
|
||||
isKeyboardNavigation: boolean;
|
||||
/** Indicates whether all map navigation is enabled. */
|
||||
isMapNavigation: boolean;
|
||||
/** When true, map panning is enabled using the mouse. */
|
||||
isPan: boolean;
|
||||
/** When true, pan arrows are displayed around the edge of the map. */
|
||||
isPanArrows: boolean;
|
||||
/** Indicates whether pinch zoom navigation is enabled on touch-enabled devices. */
|
||||
isPinchZoom: boolean;
|
||||
/** When true, rubberband zoom is enabled. */
|
||||
isRubberBandZoom: boolean;
|
||||
/** It indicates whether map navigation based on mouse scroll wheel is enabled. */
|
||||
isScrollWheel: boolean;
|
||||
/** When true, the mouse scroll wheel zoom is enabled. */
|
||||
isScrollWheelZoom: boolean;
|
||||
/** When true, shift double click zoom is enabled. */
|
||||
@@ -11853,8 +11920,11 @@ declare module "esri/map" {
|
||||
disableMapNavigation(): void;
|
||||
/** Disallows panning a map using the mouse. */
|
||||
disablePan(): void;
|
||||
disablePinchZoom(): void;
|
||||
/** Disallows zooming in or out on a map using a bounding box. */
|
||||
disableRubberBandZoom(): void;
|
||||
/** Disables navigation of the map based on mouse scroll wheel. */
|
||||
disableScrollWheel(): void;
|
||||
/** Disallows zooming in or out on a map using the mouse scroll wheel. */
|
||||
disableScrollWheelZoom(): void;
|
||||
/** Disallows shift double clicking on a map to zoom in a level and center the map. */
|
||||
@@ -11871,8 +11941,12 @@ declare module "esri/map" {
|
||||
enableMapNavigation(): void;
|
||||
/** Permits users to pan a map using the mouse. */
|
||||
enablePan(): void;
|
||||
/** Enables the user to work with pinch zoom navigation for touch-enabled devices. */
|
||||
enablePinchZoom(): void;
|
||||
/** Permits users to zoom in or out on a map using a bounding box. */
|
||||
enableRubberBandZoom(): void;
|
||||
/** Enables the user to navigate the map based on mouse scroll wheel. */
|
||||
enableScrollWheel(): void;
|
||||
/** Permits users to zoom in or out on a map using the mouse scroll wheel. */
|
||||
enableScrollWheelZoom(): void;
|
||||
/** Permits users to shift double click on a map to zoom in a level and center the map. */
|
||||
@@ -12947,7 +13021,7 @@ declare module "esri/renderers/HeatmapRenderer" {
|
||||
import esri = require("esri");
|
||||
import Renderer = require("esri/renderers/Renderer");
|
||||
|
||||
/** The HeatmapRenderer renders point data into a raster visualization that emphasizes areas of higher density or weighted values. */
|
||||
/** The HeatmapRenderer renders feature layer point data into a raster visualization that emphasizes areas of higher density or weighted values. */
|
||||
class HeatmapRenderer extends Renderer {
|
||||
/** The radius (in pixels) of the circle over which the majority of each points value is spread out over. */
|
||||
blurRadius: number;
|
||||
@@ -13052,7 +13126,7 @@ declare module "esri/renderers/Renderer" {
|
||||
* Returns the visual variable of the specified type.
|
||||
* @param type The type of visual variable desired.
|
||||
*/
|
||||
getVisualVariablesForType(type: string): any;
|
||||
getVisualVariablesForType(type: string): any[];
|
||||
/** Indicates if the renderer has defined visualVariables. */
|
||||
hasVisualVariables(): boolean;
|
||||
/**
|
||||
@@ -14873,7 +14947,7 @@ declare module "esri/tasks/GeometryService" {
|
||||
distance(params: DistanceParameters, callback?: Function, errback?: Function): any;
|
||||
/**
|
||||
* Converts an array of well-known strings into xy-coordinates based on the conversion type and spatial reference supplied by the user.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
* @param callback The function to call when the method has completed.
|
||||
* @param errback An error object is returned if an error occurs during task execution.
|
||||
*/
|
||||
@@ -14945,7 +15019,7 @@ declare module "esri/tasks/GeometryService" {
|
||||
simplify(geometries: Geometry[], callback?: Function, errback?: Function): any;
|
||||
/**
|
||||
* Converts an array of xy-coordinates into well-known strings based on the conversion type and spatial reference supplied by the user.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
* @param callback The function to call when the method has completed.
|
||||
* @param errback An error object is returned if an error occurs during task execution.
|
||||
*/
|
||||
@@ -15890,7 +15964,7 @@ declare module "esri/tasks/RouteParameters" {
|
||||
startTimeIsUTC: boolean;
|
||||
/** The set of stops loaded as network locations during analysis. */
|
||||
stops: any;
|
||||
/** If true , the TimeWindowStart and TimeWindowEnd attributes of a stop are in UTC time (milliseconds). */
|
||||
/** If true, the TimeWindowStart and TimeWindowEnd attributes of a stop are in UTC time (milliseconds). */
|
||||
timeWindowsAreUTC: boolean;
|
||||
/** Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. */
|
||||
travelMode: any;
|
||||
@@ -17172,7 +17246,7 @@ declare module "esri/tasks/locator" {
|
||||
*/
|
||||
constructor(url: string);
|
||||
/**
|
||||
* Find address candidates for the input addresses.
|
||||
* Find address candidates for multiple input addresses.
|
||||
* @param params The input addresses in the format supported by the geocoding service.
|
||||
* @param callback The function to call when the method has completed.
|
||||
* @param errback The function to call if an error occurs on the server during task execution.
|
||||
@@ -17180,7 +17254,7 @@ declare module "esri/tasks/locator" {
|
||||
addressesToLocations(params: any, callback: Function, errback: Function): any;
|
||||
/**
|
||||
* Sends a request to the ArcGIS REST geocode resource to find candidates for a single address specified in the address parameter.
|
||||
* @param params Specify the address and optionally specify the outFields and searchExtent.
|
||||
* @param params Specify at least the address and optionally other properties.
|
||||
* @param callback The function to call when the method has completed.
|
||||
* @param errback An error object is returned if an error occurs on the Server during task execution.
|
||||
*/
|
||||
|
||||
Vendored
-2
@@ -44,8 +44,6 @@ declare namespace archiver {
|
||||
glob(pattern: string, options?: glob.IOptions, data?: EntryData): this;
|
||||
finalize(): this;
|
||||
|
||||
pipe(stream: stream.Writable): void;
|
||||
|
||||
setFormat(format: string): this;
|
||||
setModule(module: Function): this;
|
||||
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
|
||||
|
||||
import AutoLaunch = require('auto-launch');
|
||||
|
||||
var a1 = new AutoLaunch({
|
||||
name: 'Foo',
|
||||
const minecraftAutoLauncher = new AutoLaunch({
|
||||
name: 'Minecraft',
|
||||
path: '/Applications/Minecraft.app',
|
||||
mac: {
|
||||
useLaunchAgent: true
|
||||
}
|
||||
});
|
||||
|
||||
var a2 = new AutoLaunch({
|
||||
name: 'Foo',
|
||||
path: '/Applications/Foo.app',
|
||||
isHidden: true,
|
||||
});
|
||||
minecraftAutoLauncher.enable();
|
||||
minecraftAutoLauncher.disable();
|
||||
|
||||
a1.enable();
|
||||
a2.disable();
|
||||
|
||||
a1.isEnabled(function(enabled: boolean) {
|
||||
if (enabled) {
|
||||
return;
|
||||
minecraftAutoLauncher.isEnabled()
|
||||
.then((isEnabled) => {
|
||||
if (isEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
a1.enable(function(err){ console.log(err.message); });
|
||||
});
|
||||
minecraftAutoLauncher.enable();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
Vendored
+39
-33
@@ -1,41 +1,47 @@
|
||||
// Type definitions for auto-launch 0.1.18
|
||||
// Type definitions for auto-launch 5.0
|
||||
// Project: https://github.com/Teamwork/node-auto-launch
|
||||
// Definitions by: rhysd <https://github.com/rhysd>
|
||||
// Definitions by: rhysd <https://github.com/rhysd>, Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface AutoLaunchOption {
|
||||
/**
|
||||
* Application name.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Hidden on launch or not. Default is false.
|
||||
*/
|
||||
isHidden?: boolean;
|
||||
/**
|
||||
* Path to application directory.
|
||||
* Default is process.execPath.
|
||||
*/
|
||||
path?: string;
|
||||
interface AutoLaunchOptions {
|
||||
/**
|
||||
* Application name.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Path to application. Default is `process.execPath`.
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* Hidden on launch. Default is `false`.
|
||||
*/
|
||||
isHidden?: boolean;
|
||||
/**
|
||||
* For Mac-only options.
|
||||
*/
|
||||
mac?: {
|
||||
/**
|
||||
* By default, AppleScript is used to add a Login Item. If this is `true`, Launch Agent will be used to auto-launch your app. Defaults is `false`.
|
||||
*/
|
||||
useLaunchAgent?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
declare class AutoLaunch {
|
||||
constructor(opts: AutoLaunchOption);
|
||||
/**
|
||||
* Enables to launch at start up
|
||||
*/
|
||||
enable(callback?: (err: Error) => void): void;
|
||||
/**
|
||||
* Disables to launch at start up
|
||||
*/
|
||||
disable(callback?: (err: Error) => void): void;
|
||||
/**
|
||||
* Returns if auto start up is enabled
|
||||
*/
|
||||
isEnabled(callback: (enabled: boolean) => void): void;
|
||||
constructor(options: AutoLaunchOptions);
|
||||
|
||||
/**
|
||||
* Enables auto-launch at start up.
|
||||
*/
|
||||
enable(): Promise<void>;
|
||||
/**
|
||||
* Disables auto-launch at start up.
|
||||
*/
|
||||
disable(): Promise<void>;
|
||||
/**
|
||||
* Returns true if auto-launch is enabled.
|
||||
*/
|
||||
isEnabled(): Promise<boolean>;
|
||||
}
|
||||
|
||||
declare module "auto-launch" {
|
||||
var al: typeof AutoLaunch;
|
||||
export = al;
|
||||
}
|
||||
export = AutoLaunch;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
@@ -20,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"auto-launch-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
/// <reference types="babylon" />
|
||||
|
||||
|
||||
|
||||
// Example from https://github.com/babel/babel/tree/master/packages/babel-generator
|
||||
import {parse} from 'babylon';
|
||||
import generate from 'babel-generator';
|
||||
@@ -14,13 +10,13 @@ ast.loc.start;
|
||||
|
||||
const output = generate(ast, { /* options */ }, code);
|
||||
|
||||
|
||||
// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-generator
|
||||
let result = generate(ast, {
|
||||
retainLines: false,
|
||||
compact: "auto",
|
||||
concise: false,
|
||||
quotes: "double",
|
||||
jsonCompatibleStrings: true,
|
||||
// ...
|
||||
}, code);
|
||||
result.code;
|
||||
|
||||
Vendored
+14
-13
@@ -1,12 +1,10 @@
|
||||
// Type definitions for babel-generator v6.7
|
||||
// Type definitions for babel-generator 6.25
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-generator
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Johnny Estilles <https://github.com/johnnyestilles>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="babel-types" />
|
||||
|
||||
import * as t from 'babel-types';
|
||||
type Node = t.Node;
|
||||
|
||||
/**
|
||||
* Turns an AST into code, maintaining sourcemaps, user preferences, and valid output.
|
||||
@@ -15,18 +13,17 @@ type Node = t.Node;
|
||||
* @param code - the original source code, used for source maps.
|
||||
* @returns - an object containing the output code and source map.
|
||||
*/
|
||||
export default function generate(ast: Node, opts?: GeneratorOptions, code?: string | {[filename: string]: string}): GeneratorResult;
|
||||
export default function generate(ast: t.Node, opts?: GeneratorOptions, code?: string | {[filename: string]: string}): GeneratorResult;
|
||||
|
||||
export interface GeneratorOptions {
|
||||
|
||||
/**
|
||||
* Optional string to add as a block comment at the start of the output file.
|
||||
*/
|
||||
*/
|
||||
auxiliaryCommentBefore?: string;
|
||||
|
||||
/**
|
||||
* Optional string to add as a block comment at the end of the output file.
|
||||
*/
|
||||
*/
|
||||
auxiliaryCommentAfter?: string;
|
||||
|
||||
/**
|
||||
@@ -34,7 +31,7 @@ export interface GeneratorOptions {
|
||||
* By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment
|
||||
* contains `@preserve` or `@license`.
|
||||
*/
|
||||
shouldPrintComment?: (comment: string) => boolean;
|
||||
shouldPrintComment?(comment: string): boolean;
|
||||
|
||||
/**
|
||||
* Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces).
|
||||
@@ -60,7 +57,7 @@ export interface GeneratorOptions {
|
||||
/**
|
||||
* Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`.
|
||||
*/
|
||||
concise?: boolean;
|
||||
concise?: boolean;
|
||||
|
||||
/**
|
||||
* The type of quote to use in the output. If omitted, autodetects based on `ast.tokens`.
|
||||
@@ -70,7 +67,7 @@ export interface GeneratorOptions {
|
||||
/**
|
||||
* Used in warning messages
|
||||
*/
|
||||
filename?: string;
|
||||
filename?: string;
|
||||
|
||||
/**
|
||||
* Enable generating source maps. Defaults to `false`.
|
||||
@@ -92,10 +89,14 @@ export interface GeneratorOptions {
|
||||
* This will only be used if `code` is a string.
|
||||
*/
|
||||
sourceFileName?: string;
|
||||
|
||||
/**
|
||||
* Set to true to run jsesc with "json": true to print "\u00A9" vs. "©";
|
||||
*/
|
||||
jsonCompatibleStrings?: boolean;
|
||||
}
|
||||
|
||||
export interface GeneratorResult {
|
||||
map: Object;
|
||||
map: {};
|
||||
code: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as block from "bem-cn";
|
||||
import { Settings } from "bem-cn";
|
||||
|
||||
// expected 'block'
|
||||
block("block")();
|
||||
@@ -44,3 +45,10 @@ block("block")("elem");
|
||||
|
||||
// expected 'block block--mod-value'
|
||||
block("block")({ mod: "value"});
|
||||
|
||||
// I can use bem-cn interfaces
|
||||
const customSettings: Settings = {
|
||||
ns: 'prefix'
|
||||
};
|
||||
|
||||
block.setup(customSettings);
|
||||
|
||||
Vendored
+33
-33
@@ -3,39 +3,39 @@
|
||||
// Definitions by: Vitaly Selkin <https://github.com/selkinvitaly>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type StateFn = (states: { [key: string]: boolean }) => Inner;
|
||||
type StateFn = (states: { [key: string]: boolean }) => BemCn.Inner;
|
||||
declare function BemCn(name: string): BemCn.Inner;
|
||||
|
||||
interface Modifications {
|
||||
[key: string]: (string | boolean);
|
||||
declare namespace BemCn {
|
||||
function reset(): void;
|
||||
function setup(settings?: Settings): void;
|
||||
|
||||
interface Modifications {
|
||||
[key: string]: (string | boolean);
|
||||
}
|
||||
|
||||
interface Inner {
|
||||
(elem: string | Modifications): Inner;
|
||||
(elem: string, mods: Modifications): Inner;
|
||||
(): string;
|
||||
|
||||
mix(mixes: string | string[]): Inner;
|
||||
has: StateFn;
|
||||
state: StateFn;
|
||||
is: StateFn;
|
||||
toString(): string;
|
||||
valueOf(): string;
|
||||
split(separator: string, limit?: number): string[];
|
||||
}
|
||||
|
||||
interface Settings {
|
||||
ns?: string;
|
||||
el?: string;
|
||||
mod?: string;
|
||||
modValue?: string;
|
||||
classMap?: { [className: string]: string } | null;
|
||||
}
|
||||
}
|
||||
|
||||
interface Block {
|
||||
(name: string): Inner;
|
||||
|
||||
reset(): void;
|
||||
setup(settings?: Settings): void;
|
||||
}
|
||||
|
||||
interface Inner {
|
||||
(elem: string | Modifications): Inner;
|
||||
(elem: string, mods: Modifications): Inner;
|
||||
(): string;
|
||||
|
||||
mix(mixes: string | string[]): Inner;
|
||||
has: StateFn;
|
||||
state: StateFn;
|
||||
is: StateFn;
|
||||
toString(): string;
|
||||
split(separator: string, limit?: number): string[];
|
||||
}
|
||||
|
||||
interface Settings {
|
||||
ns?: string;
|
||||
el?: string;
|
||||
mod?: string;
|
||||
modValue?: string;
|
||||
classMap?: { [className: string]: string } | null;
|
||||
}
|
||||
|
||||
declare const block: Block;
|
||||
export = block;
|
||||
export as namespace BemCn;
|
||||
export = BemCn;
|
||||
|
||||
Vendored
+1
-1
@@ -130,7 +130,7 @@ declare namespace Chart {
|
||||
}
|
||||
|
||||
interface ChartData {
|
||||
labels?: string[];
|
||||
labels?: Array<string | string[]>;
|
||||
datasets?: ChartDataSets[];
|
||||
}
|
||||
|
||||
|
||||
@@ -306,3 +306,5 @@ $.parseHTML(html, null, true);
|
||||
* Not in doc
|
||||
*/
|
||||
$el.toArray();
|
||||
|
||||
cheerio.html($el);
|
||||
|
||||
Vendored
+1
-1
@@ -263,7 +263,7 @@ interface CheerioElement {
|
||||
nodeValue: string;
|
||||
}
|
||||
|
||||
interface CheerioAPI extends CheerioSelector {
|
||||
interface CheerioAPI extends CheerioSelector, CheerioStatic {
|
||||
load(html: string, options?: CheerioOptionsInterface): CheerioStatic;
|
||||
load(element: CheerioElement, options?: CheerioOptionsInterface): CheerioStatic;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1681,7 +1681,7 @@ declare namespace CKEDITOR {
|
||||
function addUIElement(typeName: string, builder: Function): void;
|
||||
function cancelButton(): void;
|
||||
function exists(name: string | number): void; // NOTE: documentation says object, but it's an array accessor, so really a string or number will work
|
||||
function getCurrent(): void;
|
||||
function getCurrent(): CKEDITOR.dialog;
|
||||
function isTabEnabled(editor: CKEDITOR.editor, dialogName: string, tabName: string): boolean;
|
||||
function okButton(): void;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
declare function describe(desc: string, f: () => void): void;
|
||||
declare function it(desc: string, f: () => void): void;
|
||||
|
||||
describe("Globals", () => {
|
||||
it("INSTALL_OPTIONS returns InstallOptions (dictionary)", () => {
|
||||
const options: CloudflareApps.InstallOptions = INSTALL_OPTIONS;
|
||||
});
|
||||
|
||||
it("INSTALL_ID should return string", () => {
|
||||
const id: string = INSTALL_ID;
|
||||
});
|
||||
|
||||
it("INSTALL_SCOPE returns InstallScope (dictionary)", () => {
|
||||
const scope: CloudflareApps.InstallScope = INSTALL_SCOPE;
|
||||
});
|
||||
|
||||
it("INSTALL_PRODUCT returns InstallProduct", () => {
|
||||
const product: CloudflareApps.InstallProduct | undefined = INSTALL_PRODUCT;
|
||||
|
||||
if (product != null) {
|
||||
const id = product.id;
|
||||
}
|
||||
});
|
||||
|
||||
it("INSTALL", () => {
|
||||
const id: string = INSTALL.siteId;
|
||||
});
|
||||
|
||||
it("CloudflareApps is CloudflareApps object", () => {
|
||||
const apps: CloudflareApps.CloudflareApps = CloudflareApps;
|
||||
});
|
||||
});
|
||||
|
||||
describe("CloudflareApps methods", () => {
|
||||
it("createElement", () => {
|
||||
const element: Element = CloudflareApps.createElement({
|
||||
method: "replace",
|
||||
selector: "body > *"
|
||||
});
|
||||
|
||||
const div: HTMLDivElement = document.createElement("div");
|
||||
const divElement: HTMLDivElement = CloudflareApps.createElement({
|
||||
method: "replace",
|
||||
selector: "body > *"
|
||||
}, div);
|
||||
});
|
||||
|
||||
it("matchPage", () => {
|
||||
// Example: domain.com
|
||||
const truthyMatch: boolean = CloudflareApps.matchPage(["domain"]);
|
||||
const falsyMatch: boolean = CloudflareApps.matchPage(["foobar"]);
|
||||
});
|
||||
|
||||
it("querySelector", () => {
|
||||
const element: Element | null = CloudflareApps.querySelector("body > *");
|
||||
const bodyElement: HTMLBodyElement | null = CloudflareApps.querySelector("body");
|
||||
});
|
||||
});
|
||||
|
||||
describe("CloudflareApps properties", () => {
|
||||
it("installs", () => {
|
||||
const appId = "preview";
|
||||
const app: CloudflareApps.App | undefined = CloudflareApps.installs[appId];
|
||||
|
||||
if (app != null) {
|
||||
const id: string = app.appId;
|
||||
}
|
||||
});
|
||||
|
||||
it("proxy", () => {
|
||||
const proxy: CloudflareApps.CloudflareAppsProxy = CloudflareApps.proxy;
|
||||
const siteId: string = proxy.embedSiteId;
|
||||
});
|
||||
|
||||
it("siteId", () => {
|
||||
const siteId: string = CloudflareApps.siteId;
|
||||
});
|
||||
});
|
||||
Vendored
+125
@@ -0,0 +1,125 @@
|
||||
// Type definitions for cloudflare-apps 0.1
|
||||
// Project: https://www.cloudflare.com/apps/
|
||||
// Definitions by: MartynasZilinskas <https://github.com/MartynasZilinskas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// tslint:disable-next-line:no-single-declare-module
|
||||
declare module "cloudflare-apps" {
|
||||
global {
|
||||
/**
|
||||
* An object which contains all of the options the installer specified,
|
||||
* based on the structure given in the options section of your `install.json`.
|
||||
*/
|
||||
const INSTALL_OPTIONS: CloudflareApps.InstallOptions;
|
||||
|
||||
/**
|
||||
* A string ID which is equal to the ID of this install.
|
||||
* Its primary purpose is to allow you to easily distinguish between your app being loaded
|
||||
* in the Cloudflare Preview or the installer’s live website.
|
||||
*/
|
||||
const INSTALL_ID: string;
|
||||
|
||||
/**
|
||||
* An object which you can use to store arbitrary values
|
||||
* which you would like to be accessable from other Cloudflare scripts,
|
||||
* without polluting the global scope.
|
||||
* For example, it’s commonly used to share an update function with its update handler.
|
||||
*/
|
||||
const INSTALL_SCOPE: CloudflareApps.InstallScope;
|
||||
|
||||
/**
|
||||
* This object is specific to paid apps. It allows you to know which product the user has purchased.
|
||||
* When you create a paid app you will be given product ids for each of the plans you wish to sell the product for.
|
||||
* `INSTALL_PRODUCT.id` will then be that id for the plan the user has purchased.
|
||||
* This value is absent for free apps and will always be set for paid apps even if the user is on a free plan.
|
||||
*/
|
||||
const INSTALL_PRODUCT: CloudflareApps.InstallProduct | undefined;
|
||||
|
||||
/**
|
||||
* It's the same as CloudflareApps variable.
|
||||
*
|
||||
* DON'T use this variable directly.
|
||||
* BAD Example:
|
||||
* ```ts
|
||||
* const apps: cloudflareApps.CloudflareApps = INSTALL;
|
||||
* ```
|
||||
* -------------------------------------------------
|
||||
* Use directly properties and methods.
|
||||
* GOOD Example:
|
||||
* ```ts
|
||||
* const siteId: string = INSTALL.siteId;
|
||||
* ```
|
||||
*/
|
||||
const INSTALL: CloudflareApps.CloudflareApps;
|
||||
|
||||
/**
|
||||
* This is undocumented global variable.
|
||||
* The documentation may arrive later.
|
||||
*/
|
||||
const CloudflareApps: CloudflareApps.CloudflareApps;
|
||||
|
||||
namespace CloudflareApps {
|
||||
interface InstallOptions {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface InstallScope {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface InstallProduct {
|
||||
id: string;
|
||||
}
|
||||
|
||||
interface CloudflareAppsMethods {
|
||||
createElement<T extends Element>(options: ElementLocation, previousElement?: T): T;
|
||||
|
||||
matchPage(patterns: string[]): boolean;
|
||||
|
||||
querySelector<K extends keyof ElementTagNameMap>(selectors: K): ElementTagNameMap[K] | null;
|
||||
querySelector(selectors: string): Element | null;
|
||||
}
|
||||
|
||||
interface CloudflareApps extends CloudflareAppsMethods {
|
||||
installs: { [id: string]: App | undefined };
|
||||
proxy: CloudflareAppsProxy;
|
||||
siteId: string;
|
||||
}
|
||||
|
||||
interface App {
|
||||
appId: string;
|
||||
options: InstallOptions;
|
||||
scope: InstallScope;
|
||||
}
|
||||
|
||||
interface CloudflareAppsProxy {
|
||||
embedSiteId: string;
|
||||
hasRocketEmbed: boolean;
|
||||
originalURL: OriginalURL;
|
||||
}
|
||||
|
||||
interface OriginalURL {
|
||||
raw: string;
|
||||
parsed: OriginalURLParsed;
|
||||
}
|
||||
|
||||
interface OriginalURLParsed {
|
||||
fragment: string;
|
||||
host: string;
|
||||
path: string;
|
||||
scheme: "https" | "http";
|
||||
query: URLQuery;
|
||||
}
|
||||
|
||||
interface URLQuery {
|
||||
[key: string]: string[];
|
||||
}
|
||||
|
||||
interface ElementLocation {
|
||||
method: "before" | "prepend" | "append" | "after" | "replace";
|
||||
selector: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cloudflare-apps-tests.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "preserve"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
+7
-8
@@ -1,6 +1,8 @@
|
||||
// Type definitions for CodeMirror
|
||||
// Project: https://github.com/marijnh/CodeMirror
|
||||
// Definitions by: jacqt <https://github.com/jacqt>, basarat <https://github.com/basarat>
|
||||
// Definitions by: jacqt <https://github.com/jacqt>
|
||||
// basarat <https://github.com/basarat>
|
||||
// mbilsing <https://github.com/mbilsing>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// See docs https://codemirror.net/doc/manual.html#addon_show-hint
|
||||
@@ -16,7 +18,7 @@ declare module "codemirror" {
|
||||
and return a {list, from, to} object, where list is an array of strings or objects (the completions), and
|
||||
from and to give the start and end of the token that is being completed as {line, ch} objects. An optional
|
||||
selectedHint property (an integer) can be added to the completion object to control the initially selected hint. */
|
||||
function showHint(cm: CodeMirror.Doc, hinter?: HintFunction, options?: ShowHintOptions): void;
|
||||
function showHint(cm: CodeMirror.Editor, hinter?: HintFunction, options?: ShowHintOptions): void;
|
||||
|
||||
interface Hints {
|
||||
from: Position;
|
||||
@@ -32,7 +34,7 @@ declare module "codemirror" {
|
||||
displayText?: string;
|
||||
from?: Position;
|
||||
/** Called if a completion is picked. If provided *you* are responsible for applying the completion */
|
||||
hint?: (cm: any, data: Hints, cur: Hint) => void;
|
||||
hint?: (cm: CodeMirror.Editor, data: Hints, cur: Hint) => void;
|
||||
render?: (element: HTMLLIElement, data: Hints, cur: Hint) => void;
|
||||
to?: Position;
|
||||
}
|
||||
@@ -41,18 +43,15 @@ declare module "codemirror" {
|
||||
/** An extension of the existing CodeMirror typings for the Editor.on("keyup", func) syntax */
|
||||
on(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void;
|
||||
off(eventName: string, handler: (doc: CodeMirror.Doc, event: any) => void): void;
|
||||
}
|
||||
|
||||
interface Doc {
|
||||
showHint: (options: ShowHintOptions) => void;
|
||||
}
|
||||
|
||||
interface HintFunction {
|
||||
(doc: CodeMirror.Doc): Hints;
|
||||
(cm: CodeMirror.Editor): Hints;
|
||||
}
|
||||
|
||||
interface AsyncHintFunction {
|
||||
(doc: CodeMirror.Doc, callback: (hints: Hints) => any): any;
|
||||
(cm: CodeMirror.Editor, callback: (hints: Hints) => any): any;
|
||||
async?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
|
||||
|
||||
var doc = new CodeMirror.Doc('text');
|
||||
var cm = CodeMirror(document.body, {value: 'text'});
|
||||
var pos = new CodeMirror.Pos(2, 3);
|
||||
CodeMirror.showHint(doc);
|
||||
CodeMirror.showHint(doc, function (cm) {
|
||||
CodeMirror.showHint(cm);
|
||||
CodeMirror.showHint(cm, function (cm) {
|
||||
return {
|
||||
from: pos,
|
||||
list: ["one", "two"],
|
||||
to: pos
|
||||
};
|
||||
});
|
||||
CodeMirror.showHint(doc, function (cm) {
|
||||
CodeMirror.showHint(cm, function (cm) {
|
||||
return {
|
||||
from: pos,
|
||||
list: [
|
||||
@@ -32,7 +32,7 @@ CodeMirror.showHint(doc, function (cm) {
|
||||
};
|
||||
});
|
||||
var asyncHintFunc : CodeMirror.AsyncHintFunction =
|
||||
(doc: CodeMirror.Doc, callback: (hints: CodeMirror.Hints) => any) => {
|
||||
(cm: CodeMirror.Editor, callback: (hints: CodeMirror.Hints) => any) => {
|
||||
callback({
|
||||
from: pos,
|
||||
list: ["one", "two"],
|
||||
@@ -41,7 +41,7 @@ var asyncHintFunc : CodeMirror.AsyncHintFunction =
|
||||
};
|
||||
asyncHintFunc.async = true;
|
||||
|
||||
doc.showHint({
|
||||
cm.showHint({
|
||||
completeSingle: false,
|
||||
hint: asyncHintFunc
|
||||
})
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import commandLineArgs = require('command-line-args');
|
||||
|
||||
const optionDefinitions = [
|
||||
{ name: 'verbose', alias: 'v', type: Boolean },
|
||||
{ name: 'src', type: String, multiple: true, defaultOption: true },
|
||||
{ name: 'timeout', alias: 't', type: Number }
|
||||
];
|
||||
|
||||
const options = commandLineArgs(optionDefinitions);
|
||||
|
||||
Vendored
+74
@@ -0,0 +1,74 @@
|
||||
// Type definitions for command-line-args 4.0.6
|
||||
// Project: https://github.com/75lb/command-line-args
|
||||
// Definitions by: CzBuCHi <https://github.com/CzBuCHi/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Returns an object containing all options set on the command line. By default it parses the global [`process.argv`](https://nodejs.org/api/process.html#process_process_argv) array.
|
||||
*
|
||||
* By default, an exception is thrown if the user sets an unknown option (one without a valid [definition](#exp_module_definition--OptionDefinition)). To enable __partial parsing__, invoke `commandLineArgs` with the `partial` option - all unknown arguments will be returned in the `_unknown` property.
|
||||
*
|
||||
*
|
||||
* @param {module:definition[]} - An array of [OptionDefinition](#exp_module_definition--OptionDefinition) objects
|
||||
* @param [options] {object} - Options.
|
||||
* @param [options.argv] {string[]} - An array of strings, which if passed will be parsed instead of `process.argv`.
|
||||
* @param [options.partial] {boolean} - If `true`, an array of unknown arguments is returned in the `_unknown` property of the output.
|
||||
* @returns {object}
|
||||
* @throws `UNKNOWN_OPTION` if `options.partial` is false and the user set an undefined option
|
||||
* @throws `NAME_MISSING` if an option definition is missing the required `name` property
|
||||
* @throws `INVALID_TYPE` if an option definition has a `type` value that's not a function
|
||||
* @throws `INVALID_ALIAS` if an alias is numeric, a hyphen or a length other than 1
|
||||
* @throws `DUPLICATE_NAME` if an option definition name was used more than once
|
||||
* @throws `DUPLICATE_ALIAS` if an option definition alias was used more than once
|
||||
* @throws `DUPLICATE_DEFAULT_OPTION` if more than one option definition has `defaultOption: true`
|
||||
* @alias module:command-line-args
|
||||
*/
|
||||
declare function commandLineArgs(optionDefinitions: commandLineArgs.OptionDefinition[], options?: commandLineArgs.Options): any;
|
||||
|
||||
declare module commandLineArgs {
|
||||
|
||||
export interface OptionDefinition {
|
||||
/**
|
||||
* The only required definition property is name, the value of each option will be either a Boolean or string.
|
||||
*/
|
||||
name: string,
|
||||
/**
|
||||
* The type value is a setter function (you receive the output from this), enabling you to be specific about the type and value received.
|
||||
*/
|
||||
type?: (arg: string) => any,
|
||||
/**
|
||||
* getopt-style short option names. Can be any single character (unicode included) except a digit or hypen.
|
||||
*/
|
||||
alias?: string,
|
||||
/**
|
||||
* Set this flag if the option takes a list of values. You will receive an array of values, each passed through the type function (if specified).
|
||||
*/
|
||||
multiple?: boolean,
|
||||
/**
|
||||
* Any unclaimed command-line args will be set on this option. This flag is typically set on the most commonly-used option to make for more concise usage (i.e. $ myapp *.js instead of $ myapp --files *.js).
|
||||
*/
|
||||
defaultOption?: boolean,
|
||||
/**
|
||||
* An initial value for the option.
|
||||
*/
|
||||
defaultValue?: any,
|
||||
/**
|
||||
* When your app has a large amount of options it makes sense to organise them in groups.
|
||||
* There are two automatic groups: _all (contains all options) and _none (contains options without a group specified in their definition).
|
||||
*/
|
||||
group?: string | string[],
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* An array of strings, which if passed will be parsed instead of `process.argv`.
|
||||
*/
|
||||
argv?: string[];
|
||||
/**
|
||||
* If `true`, an array of unknown arguments is returned in the `_unknown` property of the output.
|
||||
*/
|
||||
partial?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = commandLineArgs;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"command-line-args-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import commandLineCommands = require('command-line-commands');
|
||||
|
||||
const commands = [null, 'first', 'second'];
|
||||
|
||||
const { command, argv } = commandLineCommands(commands, ['first', '--arg']);
|
||||
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for command-line-commands 2.0.0
|
||||
// Project: https://github.com/75lb/command-line-commands
|
||||
// Definitions by: CzBuCHi <https://github.com/CzBuCHi/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Parses the `argv` value supplied (or `process.argv` by default), extracting and returning the `command` and remainder of `argv`. The command will be the first value in the `argv` array unless it is an option (e.g. `--help`).
|
||||
*
|
||||
* @param {string|string[]} - One or more command strings, one of which the user must supply. Include `null` to represent "no command" (effectively making a command optional).
|
||||
* @param [argv] {string[]} - An argv array, defaults to the global `process.argv` if not supplied.
|
||||
* @returns {{ command: string, argv: string[] }}
|
||||
* @throws `INVALID_COMMAND` - user supplied a command not specified in `commands`.
|
||||
*/
|
||||
declare function commandLineCommands(commands: (string | null)[], argv?: string[]): { command: string | null, argv: string[] };
|
||||
|
||||
export = commandLineCommands;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"command-line-commands-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/// <reference types="cordova" />
|
||||
|
||||
function callback(badgeOrGranted: number | boolean) {
|
||||
console.log(badgeOrGranted);
|
||||
}
|
||||
|
||||
window.cordova.plugins.notification.badge.clear();
|
||||
window.cordova.plugins.notification.badge.set(10, callback);
|
||||
window.cordova.plugins.notification.badge.decrease(2, callback);
|
||||
window.cordova.plugins.notification.badge.increase(5, callback);
|
||||
window.cordova.plugins.notification.badge.hasPermission(callback);
|
||||
window.cordova.plugins.notification.badge.requestPermission(callback);
|
||||
window.cordova.plugins.notification.badge.get(callback);
|
||||
window.cordova.plugins.notification.badge.configure({
|
||||
autoClear: true
|
||||
});
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// Type definitions for cordova-plugin-badge 0.8
|
||||
// Project: https://github.com/katzer/cordova-plugin-badge
|
||||
// Definitions by: Tim Brust <https://github.com/timbru31>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface CordovaPlugins {
|
||||
notification: {
|
||||
badge: CordovaPluginBadge;
|
||||
};
|
||||
}
|
||||
|
||||
interface CordovaPluginBadgeOptions {
|
||||
autoClear: boolean;
|
||||
}
|
||||
|
||||
interface CordovaPluginBadge {
|
||||
clear(callback?: (badge: number) => void, scope?: any): void;
|
||||
set(badge?: number, callback?: (badge: number) => void, scope?: any): void;
|
||||
get(callback?: (badge: number) => void, scope?: any): void;
|
||||
increase(count?: number, callback?: (badge: number) => void, scope?: any): void;
|
||||
decrease(count?: number, callback?: (badge: number) => void, scope?: any): void;
|
||||
hasPermission(callback?: (granted: boolean) => void, scope?: any): void;
|
||||
requestPermission(callback?: (granted: boolean) => void, scope?: any): void;
|
||||
configure(config: CordovaPluginBadgeOptions): CordovaPluginBadgeOptions;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cordova-plugin-badge-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,16 @@
|
||||
import countries from 'country-list';
|
||||
const Countries = countries();
|
||||
|
||||
Countries.getCode('Barbados'); // BB
|
||||
|
||||
Countries.getCodes();
|
||||
|
||||
Countries.getCodeList();
|
||||
|
||||
Countries.getData();
|
||||
|
||||
Countries.getName('BB'); // Barbados
|
||||
|
||||
Countries.getNameList();
|
||||
|
||||
Countries.getNames();
|
||||
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
// Type definitions for country-list 1.1
|
||||
// Project: https://github.com/fannarsh/country-list
|
||||
// Definitions by: Kyle Roach <https://github.com/iRoachie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export default function Countries(): {
|
||||
/**
|
||||
* Expects a two-digit country code. Returns the name for that country. If not found, it returns undefined.
|
||||
*/
|
||||
getName(code: string): string | undefined;
|
||||
|
||||
/**
|
||||
* Expects the English country name. Returns the code for that country. If not found, it returns undefined.
|
||||
*/
|
||||
getCode(name: string): string | undefined;
|
||||
|
||||
/**
|
||||
* Returns an array of all country names.
|
||||
*/
|
||||
getNames(): string[];
|
||||
|
||||
/**
|
||||
* Returns an array of all country codes.
|
||||
*/
|
||||
getCodes(): string[];
|
||||
|
||||
/**
|
||||
* Returns a key-value object of all countries using the name as key.
|
||||
*/
|
||||
getNameList(): {[name: string]: string};
|
||||
|
||||
/**
|
||||
* Returns a key-value object of all countries using the code as key.
|
||||
*/
|
||||
getCodeList(): {[code: string]: string};
|
||||
|
||||
/**
|
||||
* Returns an array of all country information, in the same format as it gets imported.
|
||||
*/
|
||||
getData(): Array<{ code: string, name: string }>;
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"country-list-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -12,9 +12,22 @@ stringify([["1", "2", "3"], ["4", "5", "6"]], {
|
||||
// nothing
|
||||
});
|
||||
|
||||
stringify([["1", true, new Date()], ["4", false, new Date()]], {
|
||||
delimiter: ",",
|
||||
formatters: {
|
||||
bool: value => value ? 'yes' : 'no',
|
||||
date: value => value.toISOString()
|
||||
}
|
||||
}, (error: Error, output: string): void => {
|
||||
// nothing
|
||||
});
|
||||
|
||||
stream = stringify({ delimiter: "," });
|
||||
|
||||
stream.write(["1", "2", "3"]);
|
||||
stream.write(["4", true, new Date()], 'utf8', (err: Error, output: string): void => {
|
||||
// nothing
|
||||
});
|
||||
|
||||
const transform: NodeJS.ReadWriteStream = stream;
|
||||
|
||||
|
||||
Vendored
+15
-5
@@ -1,6 +1,7 @@
|
||||
// Type definitions for csv-stringify 1.0
|
||||
// Type definitions for csv-stringify 1.4
|
||||
// Project: https://github.com/wdavidw/node-csv-stringify
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Arjen van der Ende <https://github.com/arjenvanderende>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -55,15 +56,24 @@ declare namespace stringify {
|
||||
* special values are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified).
|
||||
*/
|
||||
rowDelimiter?: string;
|
||||
/**
|
||||
* Override serialization of boolean, dates and complex objects.
|
||||
*/
|
||||
formatters?: FormatterOpts;
|
||||
}
|
||||
|
||||
interface FormatterOpts {
|
||||
bool?: (value: boolean) => string;
|
||||
date?: (value: Date) => string;
|
||||
object?: (value: any) => string;
|
||||
}
|
||||
|
||||
interface Stringifier extends NodeJS.ReadWriteStream {
|
||||
// Stringifier stream takes array of strings or Object
|
||||
write(line: string[] | any): boolean;
|
||||
// Stringifier stream takes array of strings or Object, and optional encoding and callback
|
||||
write(line: string[] | any, encoding?: string, cb?: (error: Error | undefined, output: string) => void): boolean;
|
||||
|
||||
// repeat declarations from NodeJS.WritableStream to avoid compile error
|
||||
write(buffer: string | Buffer, cb?: () => void): boolean;
|
||||
write(str: string, encoding?: string, cb?: () => void): boolean;
|
||||
write(buffer: string | Buffer, cb?: (error: Error | undefined, output: string) => void): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"prefer-method-signature": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import * as Delaunator from 'delaunator';
|
||||
import { Points, GetPoint } from 'delaunator';
|
||||
|
||||
// Default [x, y]
|
||||
const points: Points = [[168, 180], [168, 178], [168, 179], [168, 181], [168, 183], [167, 183], [167, 184]];
|
||||
const d = new Delaunator(points);
|
||||
|
||||
// Custom getX & getY
|
||||
interface CustomPoint {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
const customPoints = [{x: 168, y: 180}, {x: 168, y: 178}, {x: 168, y: 179}, {x: 168, y: 181}, {x: 168, y: 183}, {x: 167, y: 183}, {x: 167, y: 184}];
|
||||
|
||||
const getX = (point: CustomPoint) => point.x;
|
||||
const getY = (point: CustomPoint) => point.y;
|
||||
|
||||
new Delaunator(customPoints, point => point.x, point => point.y);
|
||||
new Delaunator(customPoints, getX, getY);
|
||||
|
||||
// To get the coordinates of all triangles, use:
|
||||
const triangles = d.triangles;
|
||||
const halfedges = d.halfedges;
|
||||
const coordinates: number[][][] = [];
|
||||
for (let i = 0; i < triangles.length; i += 3) {
|
||||
coordinates.push([
|
||||
points[triangles[i]],
|
||||
points[triangles[i + 1]],
|
||||
points[triangles[i + 2]]
|
||||
]);
|
||||
}
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
// Type definitions for delaunator 1.0
|
||||
// Project: https://github.com/mapbox/delaunator#readme
|
||||
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare class Delaunator<T> {
|
||||
/**
|
||||
* A flat Int32Array array of triangle vertex indices (each group of three numbers forms a triangle). All triangles are directed counterclockwise.
|
||||
*/
|
||||
triangles: Int32Array;
|
||||
|
||||
/**
|
||||
* A flat Int32Array array of triangle half-edge indices that allows you to traverse the triangulation.
|
||||
* i-th half-edge in the array corresponds to vertex triangles[i] the half-edge is coming from.
|
||||
* halfedges[i] is the index of a twin half-edge in an adjacent triangle (or -1 for outer half-edges on the convex hull).
|
||||
*
|
||||
* The flat array-based data structures might be counterintuitive, but they're one of the key reasons this library is fast.
|
||||
*/
|
||||
halfedges: Int32Array;
|
||||
|
||||
/**
|
||||
* Constructs a delaunay triangulation object given an array of points ([x, y] by default). Duplicate points are skipped.
|
||||
*/
|
||||
constructor(points: Delaunator.Points);
|
||||
constructor(points: T[], getX: Delaunator.GetPoint<T>, getY: Delaunator.GetPoint<T>);
|
||||
}
|
||||
|
||||
declare namespace Delaunator {
|
||||
type Point = number[];
|
||||
type Points = Point[];
|
||||
type Triangles = Int32Array;
|
||||
type HalfEdges = Int32Array;
|
||||
type GetPoint<T> = (point: T) => number;
|
||||
}
|
||||
export = Delaunator;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"delaunator-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+129
-68
@@ -1,4 +1,4 @@
|
||||
// Type definitions for DevExpress ASP.NET v171.3
|
||||
// Type definitions for DevExpress ASP.NET v171.4
|
||||
// Project: http://devexpress.com/
|
||||
// Definitions by: DevExpress Inc. <http://devexpress.com/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -2554,12 +2554,27 @@ interface ASPxClientDashboardDrillUpPerformedEventArgs extends ASPxClientEventAr
|
||||
*/
|
||||
ItemName: string;
|
||||
}
|
||||
interface CardWidgetCustomizeTextEventArgs {
|
||||
getValue(): Object;
|
||||
getDefaultText(): string;
|
||||
}
|
||||
/**
|
||||
* A Card widget that visualizes a Card dashboard item's data.
|
||||
*/
|
||||
interface CardWidget {
|
||||
/**
|
||||
* Gets or sets the background color for a card.
|
||||
* Value: A string that specifies the <a href="https://www.w3schools.com/html/html_colors.asp">HTML color</a> used to paint a card's background.
|
||||
*/
|
||||
cardBackColor: string;
|
||||
onCustomizeText: Object;
|
||||
}
|
||||
/**
|
||||
* When implemented, represents the Web Dashboard extension.
|
||||
*/
|
||||
interface IExtension {
|
||||
/**
|
||||
* A unique name of a Web Dashboard extension.
|
||||
* Gets a unique name of a Web Dashboard extension.
|
||||
* Value: A string value that is a unique name of a Web Dashboard extension.
|
||||
*/
|
||||
name: string;
|
||||
@@ -2577,12 +2592,12 @@ interface IExtension {
|
||||
*/
|
||||
interface DashboardControl {
|
||||
/**
|
||||
* Gets or sets knockout templates that you can used in the Web Dashboard.
|
||||
* Value: A <see cref="KnockoutObservableArray" /> object that is a knockout template.
|
||||
* Gets or sets knockout templates that you can use in the Web Dashboard.
|
||||
* Value: A <see cref="KnockoutObservableArray" /> object that is a knockout template collection.
|
||||
*/
|
||||
customTemplates: KnockoutObservableArray;
|
||||
/**
|
||||
* Provide an access to the collection of registered dashboard extensions.
|
||||
* Provides an access to the collection of registered dashboard extensions.
|
||||
* Value: An array of IExtension objects that are dashboard extensions.
|
||||
*/
|
||||
extensions: IExtension[];
|
||||
@@ -2719,7 +2734,7 @@ interface DashboardPanelExtension extends IExtension {
|
||||
*/
|
||||
panelWidth: number;
|
||||
/**
|
||||
* Allows you to control the Dashboard Panel's visibility.
|
||||
* Gets or sets whether the Dashboard Panel is visible.
|
||||
* Value: true, to display the Dashboard Panel; otherwise, false.
|
||||
*/
|
||||
visible: KnockoutObservableBoolean;
|
||||
@@ -2739,8 +2754,8 @@ interface AvailableDataSourcesExtension extends IExtension {
|
||||
*/
|
||||
interface DashboardMenuItem {
|
||||
/**
|
||||
* Gets or sets a unique id of a dashboard menu item.
|
||||
* Value: A string value that is a menu item's unique name.
|
||||
* Gets or sets a unique identifier of a dashboard menu item.
|
||||
* Value: A string value that is a menu item's unique identifier.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
@@ -2749,13 +2764,13 @@ interface DashboardMenuItem {
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Gets or sets a position of the dashboard menu item group within the dashboard menu.
|
||||
* Gets or sets a position of the dashboard menu item within the dashboard menu.
|
||||
* Value: A zero-based integer specifying the position of the current dashboard menu item.
|
||||
*/
|
||||
index: number;
|
||||
/**
|
||||
* Gets or sets a keyboard shortcut used to invoke the command.
|
||||
* Value: An integer value that specifies a hotkey combination.
|
||||
* Gets or sets a code of the key used in the keyboard shortcut. This shortcut allows you to invoke the current menu item.
|
||||
* Value: An integer value that specifies a key code.
|
||||
*/
|
||||
hotKey: number;
|
||||
/**
|
||||
@@ -2774,7 +2789,7 @@ interface DashboardMenuItem {
|
||||
*/
|
||||
selected: KnockoutObservableBoolean;
|
||||
/**
|
||||
* Gets or sets whether a dashboard menu item should be disabled.
|
||||
* Gets whether a dashboard menu item is disabled.
|
||||
* Value: true, if a dashboard menu item should be disabled; otherwise, false.
|
||||
*/
|
||||
disabled: KnockoutObservableBoolean;
|
||||
@@ -2845,7 +2860,7 @@ interface DashboardToolbarItem {
|
||||
title: string;
|
||||
/**
|
||||
* Gets or sets whether a toolbar item should be disabled.
|
||||
* Value: true, if a toolbar item should be disabled; otherwise, false.
|
||||
* Value: true, if a toolbar item is disabled; otherwise, false.
|
||||
*/
|
||||
disabled: KnockoutObservableBoolean;
|
||||
/**
|
||||
@@ -3441,6 +3456,10 @@ interface ASPxClientTextEdit extends ASPxClientEdit {
|
||||
* @param position An integer value that specifies the zero-based index of a text character that shall precede the caret.
|
||||
*/
|
||||
SetCaretPosition(position: number): void;
|
||||
/**
|
||||
* Obtains the caret position within the edited text.
|
||||
*/
|
||||
GetCaretPosition(): number;
|
||||
/**
|
||||
* Selects the specified portion of the editor's text.
|
||||
* @param startPos A zero-based integer value specifying the selection's starting position.
|
||||
@@ -5022,6 +5041,11 @@ interface ASPxClientGridToolbarItemClickEventArgs extends ASPxClientProcessingMo
|
||||
* Value: An integer value that is the toolbar index.
|
||||
*/
|
||||
toolbarIndex: number;
|
||||
/**
|
||||
* Gets the toolbar name.
|
||||
* Value: A string value that is the toolbar name.
|
||||
*/
|
||||
toolbarName: string;
|
||||
/**
|
||||
* Gets the clicked toolbar item.
|
||||
* Value: A ASPxClientMenuItem object that is the toolbar item.
|
||||
@@ -9900,7 +9924,7 @@ interface ASPxClientHtmlEditorDialogBase {
|
||||
GetCancelButton(): ASPxClientButton;
|
||||
}
|
||||
/**
|
||||
* Provides client functionality for Html Editor's dialogs operated with the elements.
|
||||
* Provides client functionality for Html Editor dialogs operated with its elements.
|
||||
*/
|
||||
interface ASPxClientHtmlEditorEditElementDialog extends ASPxClientHtmlEditorDialogBase {
|
||||
/**
|
||||
@@ -10949,7 +10973,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
changeFontBackColor: ChangeFontBackColorCommand;
|
||||
/**
|
||||
* Gets a command to reset the selected text's formatting to default.
|
||||
* Gets a command to reset text and paragraph formatting in the selected range to default.
|
||||
* Value: A <see cref="ClearFormattingCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
clearFormatting: ClearFormattingCommand;
|
||||
@@ -10979,7 +11003,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
increaseIndent: IncreaseIndentCommand;
|
||||
/**
|
||||
* Gets a command to decrement the indent level of paragraphs in a selected range.
|
||||
* Gets a command to decrease the indent level of paragraphs in a selected range.
|
||||
* Value: A <see cref="DecreaseIndentCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
decreaseIndent: DecreaseIndentCommand;
|
||||
@@ -11079,7 +11103,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
openInsertTableDialog: OpenInsertTableDialogCommand;
|
||||
/**
|
||||
* Gets a command to invoke the Insert Table dialog window.
|
||||
* Gets a command to insert a rectangle table of a specified size.
|
||||
* Value: A <see cref="InsertTableCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
insertTable: InsertTableCommand;
|
||||
@@ -11089,7 +11113,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
openInsertPictureDialog: OpenInsertPictureDialogCommand;
|
||||
/**
|
||||
* Gets a command to insert a picture from a file.
|
||||
* Gets a command to insert an inline picture stored by specifed web address.
|
||||
* Value: A <see cref="InsertPictureCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
insertPicture: InsertPictureCommand;
|
||||
@@ -11304,7 +11328,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
openTabsDialog: OpenTabsDialogCommand;
|
||||
/**
|
||||
* Gets a command to change paragraph tab stops.
|
||||
* Gets a command to change the tab stop value of a document or selected paragraphs
|
||||
* Value: A <see cref="ChangeTabsCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
changeTabs: ChangeTabsCommand;
|
||||
@@ -11334,7 +11358,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
decrementNumberingIndent: DecrementNumberingIndentCommand;
|
||||
/**
|
||||
* Gets a command to create an empty field in the document.
|
||||
* Gets a command to create a field with an empty code and populate it with the selection (if it is not collapsed).
|
||||
* Value: A <see cref="CreateFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createField: CreateFieldCommand;
|
||||
@@ -11374,17 +11398,17 @@ interface RichEditCommands {
|
||||
*/
|
||||
updateAllFields: UpdateAllFieldsCommand;
|
||||
/**
|
||||
* Gets a command to insert a DATE field displaying the current date.
|
||||
* Gets a command to insert and update a field with a DATE code.
|
||||
* Value: A <see cref="CreateDateFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createDateField: CreateDateFieldCommand;
|
||||
/**
|
||||
* Gets a command to insert a TIME field displaying the current time.
|
||||
* Gets a command to replace the selection with a TIME field displaying the current time.
|
||||
* Value: A <see cref="CreateTimeFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createTimeField: CreateTimeFieldCommand;
|
||||
/**
|
||||
* A command to insert a PAGE field displaying the current page number.
|
||||
* A command to replace the selection with a PAGE field displaying the current page number.
|
||||
* Value: A <see cref="CreatePageFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createPageField: CreatePageFieldCommand;
|
||||
@@ -11434,7 +11458,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
mergeFieldDialog: MergeFieldDialogCommand;
|
||||
/**
|
||||
* Gets a command to insert a MERGEFIELD field (with a data source column name) at the current position in the document.
|
||||
* Gets a command to replace the selection with a MERGEFIELD (a data source column name is passed with a parameter).
|
||||
* Value: A <see cref="CreateMergeFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createMergeField: CreateMergeFieldCommand;
|
||||
@@ -11504,7 +11528,7 @@ interface RichEditCommands {
|
||||
*/
|
||||
closeHeaderFooter: CloseHeaderFooterCommand;
|
||||
/**
|
||||
* Gets a command to insert a NUMPAGES field displaying the total number of pages.
|
||||
* Gets a command to replace the selection with a NUMPAGES field displaying the total number of pages.
|
||||
* Value: A <see cref="CreatePageCountFieldCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
createPageCountField: CreatePageCountFieldCommand;
|
||||
@@ -11863,6 +11887,7 @@ interface RichEditCommands {
|
||||
* Value: A <see cref="ChangeTextBoxContentMarginsCommand" /> object that provides methods for executing the command and checking its state.
|
||||
*/
|
||||
changeTextBoxContentMargins: ChangeTextBoxContentMarginsCommand;
|
||||
changeTextBoxResizeShapeToFitText: ChangeTextBoxResizeShapeToFitTextCommand;
|
||||
}
|
||||
/**
|
||||
* Serves as a base for objects that implement different client command functionalities.
|
||||
@@ -12762,9 +12787,9 @@ interface OpenInsertBookmarkDialogCommand extends CommandWithSimpleStateBase {
|
||||
interface InsertBookmarkCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the InsertBookmarkCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param name A string value specifying name of creating bookmark.
|
||||
* @param start An integer value specifying the start position of bookmark's range.
|
||||
* @param length An integer value specifying the length of bookmark's range.
|
||||
* @param name A string value specifying a name of the created bookmark.
|
||||
* @param start An integer value specifying the start position of the bookmark's range.
|
||||
* @param length An integer value specifying the length of the bookmark's range.
|
||||
*/
|
||||
execute(name: string, start: number, length: number): boolean;
|
||||
}
|
||||
@@ -12774,7 +12799,7 @@ interface InsertBookmarkCommand extends CommandWithSimpleStateBase {
|
||||
interface DeleteBookmarkCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the DeleteBookmarkCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param name A string value specifying name of the deleted bookmark.
|
||||
* @param name A string value specifying a name of the deleted bookmark.
|
||||
*/
|
||||
execute(name: string): boolean;
|
||||
}
|
||||
@@ -13233,8 +13258,8 @@ interface HideFindResultsCommand extends CommandWithSimpleStateBase {
|
||||
interface ReplaceAllCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the ReplaceAllCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param text A string value specifying text to replace.
|
||||
* @param replaceText A string value specifying replacing text.
|
||||
* @param text A string value specifying a text to replace.
|
||||
* @param replaceText A string value specifying the replacing text.
|
||||
* @param matchCase true, to perform a case-sensitive search; otherwise, false.
|
||||
*/
|
||||
execute(text: string, replaceText: string, matchCase: boolean): boolean;
|
||||
@@ -13448,6 +13473,10 @@ interface ChangeTextBoxContentMarginsCommand extends CommandBase {
|
||||
*/
|
||||
getState(): any;
|
||||
}
|
||||
interface ChangeTextBoxResizeShapeToFitTextCommand extends CommandBase {
|
||||
execute(resizeShapeToFitText: boolean): boolean;
|
||||
getState(): any;
|
||||
}
|
||||
/**
|
||||
* Contains alignment position settings for floating objects.
|
||||
*/
|
||||
@@ -13919,7 +13948,7 @@ interface InsertNumerationCommand extends CommandWithSimpleStateBase {
|
||||
execute(abstractNumberingListIndex: number): boolean;
|
||||
/**
|
||||
* Executes the InsertNumerationCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param numberingListIndex An integer value specifying index of numbering list.
|
||||
* @param numberingListIndex An integer value specifying an index of the numbering list.
|
||||
* @param isAbstractNumberingList true, to insert an abstract numbering list; otherwise, false.
|
||||
*/
|
||||
execute(numberingListIndex: number, isAbstractNumberingList: boolean): boolean;
|
||||
@@ -14105,7 +14134,7 @@ interface InsertSymbolCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the InsertSymbolCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param symbol A string value specifying symbols to insert.
|
||||
* @param fontName A string value specifying font of symbols to insert.
|
||||
* @param fontName A string value specifying the font of symbols to insert.
|
||||
*/
|
||||
execute(symbol: string, fontName: string): boolean;
|
||||
}
|
||||
@@ -14124,7 +14153,7 @@ interface InsertParagraphCommand extends CommandWithSimpleStateBase {
|
||||
interface InsertTextCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the InsertTextCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param text A string value specifying text to insert.
|
||||
* @param text A string value specifying a text to insert.
|
||||
*/
|
||||
execute(text: string): boolean;
|
||||
}
|
||||
@@ -14217,7 +14246,15 @@ interface InsertTabCommand extends CommandWithSimpleStateBase {
|
||||
* Defines the scaling settings.
|
||||
*/
|
||||
interface Scale {
|
||||
/**
|
||||
* Gets or sets the image's y-scale factor as a percent.
|
||||
* Value: An integer value that is the y-scale factor as a percent.
|
||||
*/
|
||||
x: number;
|
||||
/**
|
||||
* Gets or sets the image's x-scale factor as a percent.
|
||||
* Value: An integer value that is the x-scale factor as a percent.
|
||||
*/
|
||||
y: number;
|
||||
}
|
||||
/**
|
||||
@@ -14346,7 +14383,7 @@ interface ChangeSectionColumnsCommand extends CommandBase {
|
||||
interface ChangePageColorCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangePageColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param color A string specifying background color of the page. May be specified as color name or hex color value.
|
||||
* @param color A string specifying a background color the page. May be specified as a color name or a hex color value.
|
||||
*/
|
||||
execute(color: string): boolean;
|
||||
/**
|
||||
@@ -14427,7 +14464,7 @@ interface SetDifferentFirstPageHeaderFooterCommand extends CommandWithBooleanSta
|
||||
execute(): boolean;
|
||||
/**
|
||||
* Executes the SetDifferentFirstPageHeaderFooterCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param differentFirstPage true to apply different text for first page's header and footer, false to remove difference.
|
||||
* @param differentFirstPage true to apply a different text for the first page's header and footer, false to remove the difference.
|
||||
*/
|
||||
execute(differentFirstPage: boolean): boolean;
|
||||
}
|
||||
@@ -14441,7 +14478,7 @@ interface SetDifferentOddAndEvenPagesHeaderFooterCommand extends CommandWithBool
|
||||
execute(): boolean;
|
||||
/**
|
||||
* Executes the SetDifferentOddAndEvenPagesHeaderFooterCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param differentOddAndEvenPages true to apply different text for odd and even pages' header and footer, false to remove difference.
|
||||
* @param differentOddAndEvenPages true to apply a different text for the header and footer of the odd and even pages , false to remove the difference.
|
||||
*/
|
||||
execute(differentOddAndEvenPages: boolean): boolean;
|
||||
}
|
||||
@@ -14650,7 +14687,7 @@ interface RemoveSpacingAfterParagraphCommand extends CommandWithSimpleStateBase
|
||||
interface ChangeParagraphBackColorCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeParagraphBackColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param color A string specifying highlighting color of the paragraphs in a selected range. May be specified as color name or hex color value.
|
||||
* @param color A string specifying a background color of the paragraphs in a selected range. May be specified as a color name or a hex color value.
|
||||
*/
|
||||
execute(color: string): boolean;
|
||||
/**
|
||||
@@ -14906,8 +14943,8 @@ interface OpenInsertTableDialogCommand extends CommandWithSimpleStateBase {
|
||||
interface InsertTableCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the InsertTableCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param columnCount An integer value specifying number of columns in a generated table.
|
||||
* @param rowCount An integer value specifying number of rows in a generated table.
|
||||
* @param columnCount An integer value specifying a number of columns in a generated table.
|
||||
* @param rowCount An integer value specifying a number of rows in a generated table.
|
||||
*/
|
||||
execute(columnCount: number, rowCount: number): boolean;
|
||||
}
|
||||
@@ -15122,9 +15159,9 @@ interface SplitTableCellsDialogCommand extends CommandWithSimpleStateBase {
|
||||
interface SplitTableCellsCommand extends CommandWithSimpleStateBase {
|
||||
/**
|
||||
* Executes the SplitTableCellsCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param rowCount An integer value specifying number of rows in the splitted table cells.
|
||||
* @param columnCount An integer value specifying number of columns in the splitted table cells.
|
||||
* @param mergeBeforeSplit true to merge the selected cells before splitting; otherwise, false.
|
||||
* @param rowCount An integer value specifying a number of rows in the split table cells.
|
||||
* @param columnCount An integer value specifying a number of columns in the split table cells.
|
||||
* @param mergeBeforeSplit true to merge the selected cells before the splitting; otherwise, false.
|
||||
*/
|
||||
execute(rowCount: number, columnCount: number, mergeBeforeSplit: boolean): boolean;
|
||||
}
|
||||
@@ -15385,7 +15422,7 @@ interface ChangeTableBorderRepositoryItemCommand extends CommandBase {
|
||||
interface ChangeTableCellShadingCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeTableCellShadingCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param color A string specifying color of the selected cells' shading. May be specified as color name or hex color value.
|
||||
* @param color A string specifying the color of the selected cells' shading. May be specified as a color name or a hex color value.
|
||||
*/
|
||||
execute(color: string): boolean;
|
||||
/**
|
||||
@@ -15856,7 +15893,7 @@ declare enum TableWidthUnitType {
|
||||
interface ChangeFontNameCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeFontNameCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param fontName A string specifying font name.
|
||||
* @param fontName A string specifying the font name.
|
||||
*/
|
||||
execute(fontName: string): boolean;
|
||||
/**
|
||||
@@ -15870,7 +15907,7 @@ interface ChangeFontNameCommand extends CommandBase {
|
||||
interface ChangeFontSizeCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeFontSizeCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param fontSize An integer number specifying font size.
|
||||
* @param fontSize An integer number specifying the font size.
|
||||
*/
|
||||
execute(fontSize: number): boolean;
|
||||
/**
|
||||
@@ -16022,7 +16059,7 @@ interface ChangeFontSubscriptCommand extends CommandWithBooleanStateBase {
|
||||
interface ChangeFontForeColorCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeFontForeColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param color A string specifying font color. May be specified as color name or hex color value.
|
||||
* @param color A string specifying the font color. May be specified as a color name or a hex color value.
|
||||
*/
|
||||
execute(color: string): boolean;
|
||||
/**
|
||||
@@ -16036,7 +16073,7 @@ interface ChangeFontForeColorCommand extends CommandBase {
|
||||
interface ChangeFontBackColorCommand extends CommandBase {
|
||||
/**
|
||||
* Executes the ChangeFontBackColorCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param color A string specifying highlighting color. May be specified as color name or hex color value.
|
||||
* @param color A string specifying the background font color. May be specified as a color name or a hex color value.
|
||||
*/
|
||||
execute(color: string): boolean;
|
||||
/**
|
||||
@@ -16064,8 +16101,8 @@ interface ChangeStyleCommand extends CommandBase {
|
||||
execute(style: StyleBase): boolean;
|
||||
/**
|
||||
* Executes the ChangeStyleCommand command by applying the specified settings. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param styleName A string specifying the name of applying style.
|
||||
* @param isParagraphStyle true to apply style to paragraph, false to apply style to character.
|
||||
* @param styleName A string specifying the applying style's name.
|
||||
* @param isParagraphStyle true to apply the style to a paragraph, false to apply the style to a character.
|
||||
*/
|
||||
execute(styleName: string, isParagraphStyle: boolean): boolean;
|
||||
/**
|
||||
@@ -16213,7 +16250,7 @@ interface SetFullscreenCommand extends CommandWithBooleanStateBase {
|
||||
execute(): boolean;
|
||||
/**
|
||||
* Executes the SetFullscreenCommand command by applying the specified setting. May result in taking no action if the command's state does not allow command execution. Use the object's getState method to check the command state.
|
||||
* @param fullscreen true to apply fullscreen mode, false to remove fullscreen mode.
|
||||
* @param fullscreen true to apply the fullscreen mode, false to disable the fullscreen mode.
|
||||
*/
|
||||
execute(fullscreen: boolean): boolean;
|
||||
}
|
||||
@@ -17101,7 +17138,7 @@ interface ASPxClientScheduler extends ASPxClientControl {
|
||||
*/
|
||||
ActiveViewChanged: ASPxClientEvent<ASPxClientEventHandler<ASPxClientScheduler>>;
|
||||
/**
|
||||
* Occurs when an end-user pressers a keyboard shortcut.
|
||||
* Occurs when an end-user presses a keyboard shortcut.
|
||||
*/
|
||||
Shortcut: ASPxClientEvent<ShortcutEventHandler<ASPxClientScheduler>>;
|
||||
/**
|
||||
@@ -17926,8 +17963,8 @@ interface ASPxClientToolTipBase {
|
||||
*/
|
||||
Close(): void;
|
||||
/**
|
||||
*
|
||||
* @param bounds
|
||||
* Gets the tooltip position.
|
||||
* @param bounds An object that represents the tooltip bounds.
|
||||
*/
|
||||
CalculatePosition(bounds: Object): ASPxClientPoint;
|
||||
/**
|
||||
@@ -19184,6 +19221,11 @@ interface ASPxClientTreeListToolbarItemClickEventArgs extends ASPxClientProcessi
|
||||
* Value: An integer value that is the toolbar index.
|
||||
*/
|
||||
toolbarIndex: number;
|
||||
/**
|
||||
* Gets the toolbar name.
|
||||
* Value: A string object that is the toolbar name.
|
||||
*/
|
||||
toolbarName: string;
|
||||
/**
|
||||
* Gets the toolbar item related to the event.
|
||||
* Value: An ASPxClientMenuItem object that is the toolbar item.
|
||||
@@ -19526,11 +19568,6 @@ interface BootstrapClientDropDownEdit extends ASPxClientDropDownEdit {
|
||||
*/
|
||||
interface BootstrapClientFormLayout extends ASPxClientFormLayout {
|
||||
}
|
||||
/**
|
||||
* Represents a client-side equivalent of the BootstrapGridView control.
|
||||
*/
|
||||
interface BootstrapClientGridView extends ASPxClientGridView {
|
||||
}
|
||||
/**
|
||||
* Represents a client-side equivalent of the BootstrapHyperLink control.
|
||||
*/
|
||||
@@ -19795,6 +19832,8 @@ interface BootstrapUIWidgetBase extends ASPxClientControl {
|
||||
IncidentOccurred: ASPxClientEvent<BootstrapUIWidgetErrorEventHandler<BootstrapUIWidgetBase>>;
|
||||
GetInstance(): Object;
|
||||
SetOptions(options: Object): void;
|
||||
SetDataSource(dataSource: Object): void;
|
||||
GetDataSource(): Object;
|
||||
ExportTo(format: string, fileName: string): void;
|
||||
Print(): void;
|
||||
}
|
||||
@@ -19848,6 +19887,8 @@ interface BootstrapUIWidgetElementClickEventArgs extends BootstrapUIWidgetElemen
|
||||
*/
|
||||
interface BootstrapClientUploadControl extends ASPxClientUploadControl {
|
||||
}
|
||||
interface BootstrapClientGridView extends ASPxClientGridView {
|
||||
}
|
||||
/**
|
||||
* A client-side counterpart of the Calendar and CalendarFor extensions.
|
||||
*/
|
||||
@@ -20489,6 +20530,9 @@ interface MVCxClientRoundPanel extends ASPxClientRoundPanel {
|
||||
* A client-side counterpart of the Scheduler extension.
|
||||
*/
|
||||
interface MVCxClientScheduler extends ASPxClientScheduler {
|
||||
/**
|
||||
* Occurs on the client side when the tooltip is about to be displayed.
|
||||
*/
|
||||
ToolTipDisplaying: ASPxClientEvent<MVCxClientSchedulerToolTipDisplayingEventHandler<MVCxClientScheduler>>;
|
||||
/**
|
||||
* Occurs when a callback for server-side processing is initiated.
|
||||
@@ -20515,6 +20559,10 @@ interface MVCxClientScheduler extends ASPxClientScheduler {
|
||||
* A template that is rendered to display a tooltip.
|
||||
*/
|
||||
interface MVCxClientSchedulerTemplateToolTip extends ASPxClientToolTipBase {
|
||||
/**
|
||||
* Gets the tooltip type.
|
||||
* Value: A MVCxSchedulerToolTipType object that specifies the tooltip type.
|
||||
*/
|
||||
type: MVCxSchedulerToolTipType;
|
||||
}
|
||||
/**
|
||||
@@ -20532,7 +20580,15 @@ interface MVCxClientSchedulerToolTipDisplayingEventHandler<S> {
|
||||
* Provides data for the ToolTipDisplaying event.
|
||||
*/
|
||||
interface MVCxClientSchedulerToolTipDisplayingEventArgs extends ASPxClientEventArgs {
|
||||
/**
|
||||
* Gets the tooltip related to the event.
|
||||
* Value: A MVCxClientSchedulerTemplateToolTip object that specifies the tooltip.
|
||||
*/
|
||||
toolTip: MVCxClientSchedulerTemplateToolTip;
|
||||
/**
|
||||
* Gets information about the tooltip related to the event.
|
||||
* Value: A ASPxClientSchedulerToolTipData object that specifies information about the tooltip.
|
||||
*/
|
||||
data: ASPxClientSchedulerToolTipData;
|
||||
}
|
||||
/**
|
||||
@@ -23396,6 +23452,11 @@ interface ASPxClientHintShowingEventArgs extends ASPxClientEventArgs {
|
||||
* Value: An object representing the hint's title element related to the event.
|
||||
*/
|
||||
titleElement: Object;
|
||||
/**
|
||||
* Gets or sets a value indicating whether the event should be canceled.
|
||||
* Value: true, if the event should be canceled; otherwise, false.
|
||||
*/
|
||||
cancel: boolean;
|
||||
}
|
||||
/**
|
||||
* A method that will handle the Hiding event.
|
||||
@@ -32198,8 +32259,6 @@ interface BootstrapClientDropDownEditStatic extends ASPxClientDropDownEditStatic
|
||||
}
|
||||
interface BootstrapClientFormLayoutStatic extends ASPxClientFormLayoutStatic {
|
||||
}
|
||||
interface BootstrapClientGridViewStatic extends ASPxClientGridViewStatic {
|
||||
}
|
||||
interface BootstrapClientHyperLinkStatic extends ASPxClientHyperLinkStatic {
|
||||
}
|
||||
interface BootstrapClientImageStatic extends ASPxClientImageStatic {
|
||||
@@ -32238,6 +32297,8 @@ interface BootstrapUIWidgetBaseStatic extends ASPxClientControlStatic {
|
||||
}
|
||||
interface BootstrapClientUploadControlStatic extends ASPxClientUploadControlStatic {
|
||||
}
|
||||
interface BootstrapClientGridViewStatic extends ASPxClientGridViewStatic {
|
||||
}
|
||||
interface MVCxClientCalendarStatic extends ASPxClientCalendarStatic {
|
||||
/**
|
||||
* Converts the specified object to the current object's type. This method is effective when you utilize the Client API IntelliSense feature provided by DevExpress.
|
||||
@@ -32702,15 +32763,15 @@ interface ASPxClientHintStatic extends ASPxClientControlStatic {
|
||||
*/
|
||||
Register(targetSelector: string, options: ASPxClientHintOptions): ASPxClientHint;
|
||||
/**
|
||||
*
|
||||
* @param targetSelector
|
||||
* @param contentAttribute
|
||||
* Registers a hint's functionality with the specified settings.
|
||||
* @param targetSelector A string value that is the CSS selector. Specifies to which UI elements the hint is displayed.
|
||||
* @param contentAttribute A string value that is the attribute name. Specifies from which target element's attribute a hint obtains its content.
|
||||
*/
|
||||
Register(targetSelector: string, contentAttribute: string): ASPxClientHint;
|
||||
/**
|
||||
*
|
||||
* @param targetSelector
|
||||
* @param onShowing
|
||||
* Registers a hint's functionality with the specified settings.
|
||||
* @param targetSelector A string value that is the CSS selector. Specifies for which UI elements the hint is displayed.
|
||||
* @param onShowing An ASPxClientHintShowingEventHandler object that is a handler for the displayed event.
|
||||
*/
|
||||
Register(targetSelector: string, onShowing: ASPxClientHintShowingEventHandler): ASPxClientHint;
|
||||
/**
|
||||
@@ -33521,7 +33582,6 @@ declare var BootstrapClientComboBox: BootstrapClientComboBoxStatic;
|
||||
declare var BootstrapClientDateEdit: BootstrapClientDateEditStatic;
|
||||
declare var BootstrapClientDropDownEdit: BootstrapClientDropDownEditStatic;
|
||||
declare var BootstrapClientFormLayout: BootstrapClientFormLayoutStatic;
|
||||
declare var BootstrapClientGridView: BootstrapClientGridViewStatic;
|
||||
declare var BootstrapClientHyperLink: BootstrapClientHyperLinkStatic;
|
||||
declare var BootstrapClientImage: BootstrapClientImageStatic;
|
||||
declare var BootstrapClientListBox: BootstrapClientListBoxStatic;
|
||||
@@ -33541,6 +33601,7 @@ declare var BootstrapClientButtonEdit: BootstrapClientButtonEditStatic;
|
||||
declare var BootstrapClientTreeView: BootstrapClientTreeViewStatic;
|
||||
declare var BootstrapUIWidgetBase: BootstrapUIWidgetBaseStatic;
|
||||
declare var BootstrapClientUploadControl: BootstrapClientUploadControlStatic;
|
||||
declare var BootstrapClientGridView: BootstrapClientGridViewStatic;
|
||||
declare var MVCxClientCalendar: MVCxClientCalendarStatic;
|
||||
declare var MVCxClientCallbackPanel: MVCxClientCallbackPanelStatic;
|
||||
declare var MVCxClientCardView: MVCxClientCardViewStatic;
|
||||
|
||||
Vendored
+21
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for DevExpress ASP.NET v162.7
|
||||
// Type definitions for DevExpress ASP.NET v162.8
|
||||
// Project: http://devexpress.com/
|
||||
// Definitions by: DevExpress Inc. <http://devexpress.com/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -2409,6 +2409,10 @@ interface ASPxClientTextEdit extends ASPxClientEdit {
|
||||
* @param position An integer value that specifies the zero-based index of a text character that shall precede the caret.
|
||||
*/
|
||||
SetCaretPosition(position: number): void;
|
||||
/**
|
||||
* Obtains the caret position within the edited text.
|
||||
*/
|
||||
GetCaretPosition(): number;
|
||||
/**
|
||||
* Selects the specified portion of the editor's text.
|
||||
* @param startPos A zero-based integer value specifying the selection's starting position.
|
||||
@@ -7822,8 +7826,20 @@ interface ASPxClientHtmlEditorCommandStyleSettings {
|
||||
* Value: A string that specifies an element's left margin <a href="http://www.w3schools.com/cssref/pr_margin.asp">in any correct format</a>.
|
||||
*/
|
||||
marginLeft: string;
|
||||
/**
|
||||
* Gets or sets a media element's background color.
|
||||
* Value: A string that specifies a background color <a href="http://www.w3schools.com/cssref/css_colors_legal.asp">in any correct format</a>.
|
||||
*/
|
||||
backgroundColor: string;
|
||||
/**
|
||||
* Gets or sets the element's text alignment.
|
||||
* Value: A string value that specifies the element's text alignment <a href="http://www.w3schools.com/cssref/css_colors_legal.asp">in any correct format</a>.
|
||||
*/
|
||||
textAlign: string;
|
||||
/**
|
||||
* Gets or sets the element's vertical alignment.
|
||||
* Value: A string value that specifies the element's vertical alignment <a href="http://www.w3schools.com/cssref/css_colors_legal.asp">in any correct format</a>.
|
||||
*/
|
||||
verticalAlign: string;
|
||||
}
|
||||
/**
|
||||
@@ -7895,6 +7911,10 @@ interface ASPxClientHtmlEditorInsertLinkCommandArguments extends ASPxClientHtmlE
|
||||
* Value: A string value defining the title of the target link.
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Contains the style settings defining the appearance of the target link element.
|
||||
* Value: An <see cref="ASPxClientHtmlEditorCommandStyleSettings" /> object that contains the style settings defining the appearance of the target link element.
|
||||
*/
|
||||
styleSettings: ASPxClientHtmlEditorCommandStyleSettings;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
const input = document.createElement('input');
|
||||
input.addEventListener('input', (event: InputEvent) => {
|
||||
return event.data === 'foo' && event.isComposing === true;
|
||||
});
|
||||
|
||||
const foo = new InputEvent('input');
|
||||
const bar = new InputEvent('beforeinput', {
|
||||
data: 'bar',
|
||||
isComposing: true,
|
||||
});
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
// Type definitions for UI Events W3C Working Draft — Input Events — Interface InputEvent 1.0
|
||||
// Project: https://w3c.github.io/uievents/#interface-inputevent
|
||||
// Definitions by: Steven Sinatra <https://github.com/diagramatics>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface InputEventInit extends UIEventInit {
|
||||
data?: string;
|
||||
isComposing: boolean;
|
||||
}
|
||||
interface InputEvent extends UIEvent {
|
||||
readonly data: string;
|
||||
readonly isComposing: boolean;
|
||||
}
|
||||
|
||||
declare class InputEvent {
|
||||
constructor(typeArg: 'input' | 'beforeinput', inputEventInit?: InputEventInit);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dom-inputevent-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+3
-2
@@ -4,6 +4,7 @@
|
||||
// Eelco Lempsink <https://github.com/eelco>
|
||||
// Yale Cason <https://github.com/ghotiphud>
|
||||
// Ryan Schwers <https://github.com/schwers>
|
||||
// Michael Wu <https://github.com/michael-yx-wu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -37,7 +38,7 @@ declare namespace Draft {
|
||||
* div, and provides a wide variety of useful function props for managing the
|
||||
* state of the editor. See `DraftEditorProps` for details.
|
||||
*/
|
||||
class DraftEditor extends React.Component<DraftEditorProps> {
|
||||
class DraftEditor extends React.Component<DraftEditorProps, {}> {
|
||||
// Force focus back onto the editor node.
|
||||
focus(): void;
|
||||
// Remove focus from the editor node.
|
||||
@@ -162,7 +163,7 @@ declare namespace Draft {
|
||||
}
|
||||
|
||||
namespace Components {
|
||||
class DraftEditorBlock extends React.Component<any> {
|
||||
class DraftEditorBlock extends React.Component<any, {}> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"immutable": "^3.8.1"
|
||||
"immutable": "^3.8.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
import Draggabilly from 'draggabilly';
|
||||
|
||||
const elem = document.querySelector('.draggable') as Element;
|
||||
|
||||
const draggieA = new Draggabilly('.test');
|
||||
const draggieB = new Draggabilly(elem);
|
||||
|
||||
const draggie = new Draggabilly(elem, {
|
||||
axis: 'x',
|
||||
containment: true,
|
||||
grid: [20, 20],
|
||||
handle: '.handle'
|
||||
});
|
||||
|
||||
const draggiePosX: number = draggie.position.x;
|
||||
const draggiePosY: number = draggie.position.y;
|
||||
|
||||
draggie.on( 'dragMove', (event, pointer, moveVector) => {
|
||||
const pointerPageX: number = pointer.pageX;
|
||||
const pointePageY: number = pointer.pageY;
|
||||
|
||||
const moveVectorX: number = moveVector.x;
|
||||
const moveVectorY: number = moveVector.y;
|
||||
});
|
||||
|
||||
draggie.on( 'dragStart', (event, pointer) => {});
|
||||
|
||||
draggie.on( 'dragEnd', (event, pointer) => {});
|
||||
|
||||
draggie.on( 'pointerDown', (event, pointer) => {});
|
||||
|
||||
draggie.on( 'pointerMove', (event, pointer, moveVector) => {});
|
||||
|
||||
draggie.on( 'pointerUp', (event, pointer) => {});
|
||||
|
||||
draggie.on( 'staticClick', (event, pointer) => {});
|
||||
|
||||
draggie.off('dragMove', (event, pointer, moveVector) => {});
|
||||
|
||||
draggie.once('dragMove', (event, pointer, moveVector) => {});
|
||||
|
||||
draggie.enable();
|
||||
|
||||
draggie.disable();
|
||||
|
||||
draggie.destroy();
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
// Type definitions for draggabilly 2.1
|
||||
// Project: http://draggabilly.desandro.com/
|
||||
// Definitions by: Jason Wu <https://github.com/jaydubu/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
export interface Position {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface DraggabillyOptions {
|
||||
axis?: 'x' | 'y';
|
||||
containment?: Element | string | boolean;
|
||||
grid?: [number, number];
|
||||
handle?: string;
|
||||
}
|
||||
|
||||
export type DraggabillyClickEventName = 'dragStart' | 'dragEnd' | 'pointerDown' | 'pointerUp' | 'staticClick';
|
||||
|
||||
export type DraggabillyMoveEventName = 'dragMove' | 'pointerMove';
|
||||
|
||||
export default class Draggabilly {
|
||||
position: Position;
|
||||
|
||||
constructor(element: Element | string, options?: DraggabillyOptions);
|
||||
|
||||
on(eventName: DraggabillyClickEventName, listener: (event: Event, pointer: MouseEvent | Touch) => void): Draggabilly;
|
||||
|
||||
on(eventName: DraggabillyMoveEventName, listener: (event: Event, pointer: MouseEvent | Touch, moveVector: Position) => void): Draggabilly;
|
||||
|
||||
off(eventName: DraggabillyClickEventName, listener: (event: Event, pointer: MouseEvent | Touch) => void): Draggabilly;
|
||||
|
||||
off(eventName: DraggabillyMoveEventName, listener: (event: Event, pointer: MouseEvent | Touch, moveVector: Position) => void): Draggabilly;
|
||||
|
||||
once(eventName: DraggabillyClickEventName, listener: (event: Event, pointer: MouseEvent | Touch) => void): Draggabilly;
|
||||
|
||||
once(eventName: DraggabillyMoveEventName, listener: (event: Event, pointer: MouseEvent | Touch, moveVector: Position) => void): Draggabilly;
|
||||
|
||||
enable(): void;
|
||||
|
||||
disable(): void;
|
||||
|
||||
destroy(): void;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"draggabilly-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,9 +1,13 @@
|
||||
const dropzoneFromString = new Dropzone(".test");
|
||||
const dropzoneFromElement = new Dropzone(document.getElementById("test"));
|
||||
const dropzoneRenameFunction = function (name:string):string {
|
||||
return name + 'new';
|
||||
const dropzoneRenameFunction = function (name: string): string {
|
||||
return name + 'new';
|
||||
};
|
||||
|
||||
Dropzone.createElement('<div id="divTest"></div>');
|
||||
Dropzone.isBrowserSupported();
|
||||
console.log(Dropzone.instances.length);
|
||||
|
||||
const dropzoneWithOptions = new Dropzone(".test", {
|
||||
url: "/some/url",
|
||||
method: "post",
|
||||
@@ -14,8 +18,14 @@ const dropzoneWithOptions = new Dropzone(".test", {
|
||||
paramName: "file",
|
||||
createImageThumbnails: true,
|
||||
maxThumbnailFilesize: 1024,
|
||||
thumbnailWidth: 50,
|
||||
thumbnailHeight: 50,
|
||||
thumbnailWidth: 120,
|
||||
thumbnailHeight: 120,
|
||||
thumbnailMethod: 'crop',
|
||||
resizeWidth: 1024,
|
||||
resizeHeight: 1024,
|
||||
resizeMimeType: 'image.jpeg',
|
||||
resizeQuality: .8,
|
||||
resizeMethod: 'contain',
|
||||
filesizeBase: 1000,
|
||||
maxFiles: 100,
|
||||
params: {
|
||||
@@ -47,7 +57,7 @@ const dropzoneWithOptions = new Dropzone(".test", {
|
||||
dictRemoveFileConfirmation: "",
|
||||
dictMaxFilesExceeded: "",
|
||||
|
||||
accept: (file:Dropzone.DropzoneFile, done:(error?:string|Error) => void) => {
|
||||
accept: (file: Dropzone.DropzoneFile, done: (error?: string | Error) => void) => {
|
||||
if (file.accepted) {
|
||||
file.previewElement.classList.add("accepted");
|
||||
file.previewTemplate.classList.add("accepted");
|
||||
@@ -61,7 +71,7 @@ const dropzoneWithOptions = new Dropzone(".test", {
|
||||
init: () => console.log("Initialized"),
|
||||
forceFallback: false,
|
||||
fallback: () => console.log("Fallback"),
|
||||
resize: (file:Dropzone.DropzoneFile) => ({
|
||||
resize: (file: Dropzone.DropzoneFile, width: 120, height: 120, resizeMethod: 'contain') => ({
|
||||
srcX: 0,
|
||||
srcY: 0,
|
||||
trgX: 10,
|
||||
@@ -70,54 +80,52 @@ const dropzoneWithOptions = new Dropzone(".test", {
|
||||
srcHeight: 100,
|
||||
trgWidth: 50,
|
||||
trgHeight: 50,
|
||||
optWidth: 50,
|
||||
optHeight: 50
|
||||
}),
|
||||
|
||||
drop: (e:DragEvent) => console.log("Drop"),
|
||||
dragstart: (e:DragEvent) => console.log("Dragstart"),
|
||||
dragend: (e:DragEvent) => console.log("Dragend"),
|
||||
dragenter: (e:DragEvent) => console.log("Dragenter"),
|
||||
dragover: (e:DragEvent) => console.log("Dragover"),
|
||||
dragleave: (e:DragEvent) => console.log("Dragleave"),
|
||||
paste: (e:DragEvent) => console.log("Paste"),
|
||||
drop: (e: DragEvent) => console.log("Drop"),
|
||||
dragstart: (e: DragEvent) => console.log("Dragstart"),
|
||||
dragend: (e: DragEvent) => console.log("Dragend"),
|
||||
dragenter: (e: DragEvent) => console.log("Dragenter"),
|
||||
dragover: (e: DragEvent) => console.log("Dragover"),
|
||||
dragleave: (e: DragEvent) => console.log("Dragleave"),
|
||||
paste: (e: DragEvent) => console.log("Paste"),
|
||||
|
||||
reset: () => console.log("Reset"),
|
||||
|
||||
addedfile: (file:Dropzone.DropzoneFile) => console.log("Addedfile"),
|
||||
addedfiles: (files:Dropzone.DropzoneFile[]) => console.log("Addedfiles"),
|
||||
removedfile: (file:Dropzone.DropzoneFile) => console.log("Removedfile"),
|
||||
thumbnail: (file:Dropzone.DropzoneFile, dataUrl:string) => console.log("Thumbnail"),
|
||||
addedfile: (file: Dropzone.DropzoneFile) => console.log("Addedfile"),
|
||||
addedfiles: (files: Dropzone.DropzoneFile[]) => console.log("Addedfiles"),
|
||||
removedfile: (file: Dropzone.DropzoneFile) => console.log("Removedfile"),
|
||||
thumbnail: (file: Dropzone.DropzoneFile, dataUrl: string) => console.log("Thumbnail"),
|
||||
|
||||
error: (file:Dropzone.DropzoneFile, message:string|Error) => console.log("Error"),
|
||||
errormultiple: (files:Dropzone.DropzoneFile[], message:string|Error) => console.log("Errormultiple"),
|
||||
error: (file: Dropzone.DropzoneFile, message: string | Error) => console.log("Error"),
|
||||
errormultiple: (files: Dropzone.DropzoneFile[], message: string | Error) => console.log("Errormultiple"),
|
||||
|
||||
processing: (file:Dropzone.DropzoneFile) => console.log("Processing"),
|
||||
processingmultiple: (files:Dropzone.DropzoneFile[]) => console.log("Processingmultiple"),
|
||||
processing: (file: Dropzone.DropzoneFile) => console.log("Processing"),
|
||||
processingmultiple: (files: Dropzone.DropzoneFile[]) => console.log("Processingmultiple"),
|
||||
|
||||
uploadprogress: (file:Dropzone.DropzoneFile, progress:number, bytesSent:number) => console.log("Uploadprogress"),
|
||||
totaluploadprogress: (totalProgress:number, totalBytes:number, totalBytesSent:number) => console.log("Totaluploadprogress"),
|
||||
uploadprogress: (file: Dropzone.DropzoneFile, progress: number, bytesSent: number) => console.log("Uploadprogress"),
|
||||
totaluploadprogress: (totalProgress: number, totalBytes: number, totalBytesSent: number) => console.log("Totaluploadprogress"),
|
||||
|
||||
sending: (file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:{}) => console.log("Sending"),
|
||||
sendingmultiple: (files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:{}) => console.log("Sendingmultiple"),
|
||||
sending: (file: Dropzone.DropzoneFile, xhr: XMLHttpRequest, formData: {}) => console.log("Sending"),
|
||||
sendingmultiple: (files: Dropzone.DropzoneFile[], xhr: XMLHttpRequest, formData: {}) => console.log("Sendingmultiple"),
|
||||
|
||||
success: (file:Dropzone.DropzoneFile) => console.log("Success"),
|
||||
successmultiple: (files:Dropzone.DropzoneFile[]) => console.log("Successmultiple"),
|
||||
success: (file: Dropzone.DropzoneFile) => console.log("Success"),
|
||||
successmultiple: (files: Dropzone.DropzoneFile[]) => console.log("Successmultiple"),
|
||||
|
||||
canceled: (file:Dropzone.DropzoneFile) => console.log("Canceled"),
|
||||
canceledmultiple: (file:Dropzone.DropzoneFile[]) => console.log("Canceledmultiple"),
|
||||
canceled: (file: Dropzone.DropzoneFile) => console.log("Canceled"),
|
||||
canceledmultiple: (file: Dropzone.DropzoneFile[]) => console.log("Canceledmultiple"),
|
||||
|
||||
complete: (file:Dropzone.DropzoneFile) => console.log("Complete"),
|
||||
completemultiple: (file:Dropzone.DropzoneFile[]) => console.log("Completemultiple"),
|
||||
complete: (file: Dropzone.DropzoneFile) => console.log("Complete"),
|
||||
completemultiple: (file: Dropzone.DropzoneFile[]) => console.log("Completemultiple"),
|
||||
|
||||
maxfilesexceeded: (file:Dropzone.DropzoneFile) => console.log("Maxfilesexceeded"),
|
||||
maxfilesreached: (files:Dropzone.DropzoneFile[]) => console.log("Maxfilesreached"),
|
||||
maxfilesexceeded: (file: Dropzone.DropzoneFile) => console.log("Maxfilesexceeded"),
|
||||
maxfilesreached: (files: Dropzone.DropzoneFile[]) => console.log("Maxfilesreached"),
|
||||
queuecomplete: () => console.log("Queuecomplete"),
|
||||
|
||||
previewTemplate: "<div></div>",
|
||||
});
|
||||
|
||||
var dropzoneWithOptionsVariations:Dropzone;
|
||||
var dropzoneWithOptionsVariations: Dropzone;
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: ".test"
|
||||
});
|
||||
@@ -135,10 +143,10 @@ dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
});
|
||||
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
success: (file:Dropzone.DropzoneFile, response:Object) => console.log(file, response)
|
||||
success: (file: Dropzone.DropzoneFile, response: Object) => console.log(file, response)
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
success: (file:Dropzone.DropzoneFile, response:string) => console.log(file, response)
|
||||
success: (file: Dropzone.DropzoneFile, response: string) => console.log(file, response)
|
||||
});
|
||||
|
||||
const dropzone = new Dropzone(".test");
|
||||
@@ -167,19 +175,34 @@ dropzone.enqueueFile(firstFile);
|
||||
dropzone.processFile(firstFile);
|
||||
dropzone.uploadFile(firstFile);
|
||||
dropzone.cancelUpload(firstFile);
|
||||
dropzone.createThumbnail(firstFile, () => {
|
||||
|
||||
dropzone.createThumbnail(firstFile);
|
||||
dropzone.createThumbnail(firstFile, dropzone.defaultOptions.resizeWidth);
|
||||
dropzone.createThumbnail(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight);
|
||||
dropzone.createThumbnail(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod);
|
||||
dropzone.createThumbnail(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod, true);
|
||||
dropzone.createThumbnail(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod, true, () => {
|
||||
console.log("createThumbnail")
|
||||
});
|
||||
dropzone.createThumbnailFromUrl(firstFile, "/some/url", () => {
|
||||
|
||||
dropzone.createThumbnailFromUrl(firstFile);
|
||||
dropzone.createThumbnailFromUrl(firstFile, dropzone.defaultOptions.resizeWidth);
|
||||
dropzone.createThumbnailFromUrl(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight);
|
||||
dropzone.createThumbnailFromUrl(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod);
|
||||
dropzone.createThumbnailFromUrl(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod, true);
|
||||
dropzone.createThumbnailFromUrl(firstFile, dropzone.defaultOptions.resizeWidth, dropzone.defaultOptions.resizeHeight, dropzone.defaultOptions.resizeMethod, true, () => {
|
||||
console.log("createThumbnailFromUrl")
|
||||
});
|
||||
dropzone.accept(firstFile, (e:string|Error) => {
|
||||
dropzone.accept(firstFile, (e: string | Error) => {
|
||||
console.log(e);
|
||||
});
|
||||
|
||||
const acceptedFiles = dropzone.getAcceptedFiles();
|
||||
dropzone.processFiles(acceptedFiles);
|
||||
|
||||
const addedFiles = dropzone.getAddedFiles();
|
||||
dropzone.processFiles(addedFiles);
|
||||
|
||||
const rejectedFiles = dropzone.getRejectedFiles();
|
||||
dropzone.enqueueFiles(rejectedFiles);
|
||||
|
||||
@@ -192,12 +215,18 @@ dropzone.processFiles(uploadingFiles);
|
||||
const activeFiles = dropzone.getActiveFiles();
|
||||
dropzone.processFiles(activeFiles);
|
||||
|
||||
const addedFiles = dropzone.getFilesWithStatus(Dropzone.ADDED);
|
||||
dropzone.processFiles(addedFiles);
|
||||
const getFileWithStatusAdded = dropzone.getFilesWithStatus(Dropzone.ADDED);
|
||||
dropzone.processFiles(getFileWithStatusAdded);
|
||||
|
||||
dropzone.processQueue();
|
||||
dropzone.removeAllFiles(true);
|
||||
|
||||
dropzone.resizeImage(firstFile);
|
||||
dropzone.resizeImage(firstFile, 120);
|
||||
dropzone.resizeImage(firstFile, 120, 120);
|
||||
dropzone.resizeImage(firstFile, 120, 120, 'contain');
|
||||
dropzone.resizeImage(firstFile, 120, 120, 'contain', function () { });
|
||||
|
||||
dropzone
|
||||
.on("drop", () => {
|
||||
console.count('drop');
|
||||
@@ -287,9 +316,9 @@ dropzone
|
||||
console.count('queuecomplete');
|
||||
});
|
||||
|
||||
dropzone.off("drop", () => {
|
||||
console.count('drop');
|
||||
})
|
||||
dropzone.off("drop", () => {
|
||||
console.count('drop');
|
||||
})
|
||||
.off("dragstart")
|
||||
.off();
|
||||
|
||||
|
||||
Vendored
+165
-145
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Dropzone 4.3.0
|
||||
// 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>
|
||||
// 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: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -8,16 +8,14 @@
|
||||
|
||||
declare namespace Dropzone {
|
||||
export interface DropzoneResizeInfo {
|
||||
srcX?:number;
|
||||
srcY?:number;
|
||||
trgX?:number;
|
||||
trgY?:number;
|
||||
srcWidth?:number;
|
||||
srcHeight?:number;
|
||||
trgWidth?:number;
|
||||
trgHeight?:number;
|
||||
optWidth?:number;
|
||||
optHeight?:number;
|
||||
srcX?: number;
|
||||
srcY?: number;
|
||||
trgX?: number;
|
||||
trgY?: number;
|
||||
srcWidth?: number;
|
||||
srcHeight?: number;
|
||||
trgWidth?: number;
|
||||
trgHeight?: number;
|
||||
}
|
||||
|
||||
export interface DropzoneFile extends File {
|
||||
@@ -41,18 +39,24 @@ declare namespace Dropzone {
|
||||
maxThumbnailFilesize?: number;
|
||||
thumbnailWidth?: number;
|
||||
thumbnailHeight?: number;
|
||||
thumbnailMethod?: string;
|
||||
resizeWidth?: number;
|
||||
resizeHeight?: number;
|
||||
resizeMimeType?: string;
|
||||
resizeQuality?: number;
|
||||
resizeMethod?: string;
|
||||
filesizeBase?: number;
|
||||
maxFiles?: number;
|
||||
params?: {};
|
||||
headers?: {};
|
||||
clickable?: boolean|string|HTMLElement|(string|HTMLElement)[];
|
||||
clickable?: boolean | string | HTMLElement | (string | HTMLElement)[];
|
||||
ignoreHiddenFiles?: boolean;
|
||||
acceptedFiles?: string;
|
||||
renameFilename?(name:string): string;
|
||||
renameFilename?(name: string): string;
|
||||
autoProcessQueue?: boolean;
|
||||
autoQueue?: boolean;
|
||||
addRemoveLinks?: boolean;
|
||||
previewsContainer?: boolean|string|HTMLElement;
|
||||
previewsContainer?: boolean | string | HTMLElement;
|
||||
hiddenInputContainer?: HTMLElement;
|
||||
capture?: string;
|
||||
|
||||
@@ -68,209 +72,225 @@ declare namespace Dropzone {
|
||||
dictRemoveFileConfirmation?: string;
|
||||
dictMaxFilesExceeded?: string;
|
||||
|
||||
accept?(file:DropzoneFile, done:(error?:string|Error) => void):void;
|
||||
init?():void;
|
||||
accept?(file: DropzoneFile, done: (error?: string | Error) => void): void;
|
||||
init?(): void;
|
||||
forceFallback?: boolean;
|
||||
fallback?():void;
|
||||
resize?(file:DropzoneFile):DropzoneResizeInfo;
|
||||
fallback?(): void;
|
||||
resize?(file: DropzoneFile, width?: number, height?: number, resizeMethod?: string): DropzoneResizeInfo;
|
||||
|
||||
drop?(e:DragEvent):void;
|
||||
dragstart?(e:DragEvent):void;
|
||||
dragend?(e:DragEvent):void;
|
||||
dragenter?(e:DragEvent):void;
|
||||
dragover?(e:DragEvent):void;
|
||||
dragleave?(e:DragEvent):void;
|
||||
paste?(e:DragEvent):void;
|
||||
drop?(e: DragEvent): void;
|
||||
dragstart?(e: DragEvent): void;
|
||||
dragend?(e: DragEvent): void;
|
||||
dragenter?(e: DragEvent): void;
|
||||
dragover?(e: DragEvent): void;
|
||||
dragleave?(e: DragEvent): void;
|
||||
paste?(e: DragEvent): void;
|
||||
|
||||
reset?():void;
|
||||
reset?(): void;
|
||||
|
||||
addedfile?(file:DropzoneFile):void;
|
||||
addedfiles?(files:DropzoneFile[]):void;
|
||||
removedfile?(file:DropzoneFile):void;
|
||||
thumbnail?(file:DropzoneFile, dataUrl:string):void;
|
||||
addedfile?(file: DropzoneFile): void;
|
||||
addedfiles?(files: DropzoneFile[]): void;
|
||||
removedfile?(file: DropzoneFile): void;
|
||||
thumbnail?(file: DropzoneFile, dataUrl: string): void;
|
||||
|
||||
error?(file:DropzoneFile, message:string|Error, xhr:XMLHttpRequest):void;
|
||||
errormultiple?(files:DropzoneFile[], message:string|Error, xhr:XMLHttpRequest):void;
|
||||
error?(file: DropzoneFile, message: string | Error, xhr: XMLHttpRequest): void;
|
||||
errormultiple?(files: DropzoneFile[], message: string | Error, xhr: XMLHttpRequest): void;
|
||||
|
||||
processing?(file:DropzoneFile):void;
|
||||
processingmultiple?(files:DropzoneFile[]):void;
|
||||
processing?(file: DropzoneFile): void;
|
||||
processingmultiple?(files: DropzoneFile[]): void;
|
||||
|
||||
uploadprogress?(file:DropzoneFile, progress:number, bytesSent:number):void;
|
||||
totaluploadprogress?(totalProgress:number, totalBytes:number, totalBytesSent:number):void;
|
||||
uploadprogress?(file: DropzoneFile, progress: number, bytesSent: number): void;
|
||||
totaluploadprogress?(totalProgress: number, totalBytes: number, totalBytesSent: number): void;
|
||||
|
||||
sending?(file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData):void;
|
||||
sendingmultiple?(files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):void;
|
||||
sending?(file: DropzoneFile, xhr: XMLHttpRequest, formData: FormData): void;
|
||||
sendingmultiple?(files: DropzoneFile[], xhr: XMLHttpRequest, formData: FormData): void;
|
||||
|
||||
success?(file: DropzoneFile, response: Object|string): void;
|
||||
successmultiple?(files:DropzoneFile[], responseText:string):void;
|
||||
success?(file: DropzoneFile, response: Object | string): void;
|
||||
successmultiple?(files: DropzoneFile[], responseText: string): void;
|
||||
|
||||
canceled?(file:DropzoneFile):void;
|
||||
canceledmultiple?(file:DropzoneFile[]):void;
|
||||
canceled?(file: DropzoneFile): void;
|
||||
canceledmultiple?(file: DropzoneFile[]): void;
|
||||
|
||||
complete?(file:DropzoneFile):void;
|
||||
completemultiple?(file:DropzoneFile[]):void;
|
||||
complete?(file: DropzoneFile): void;
|
||||
completemultiple?(file: DropzoneFile[]): void;
|
||||
|
||||
maxfilesexceeded?(file:DropzoneFile):void;
|
||||
maxfilesreached?(files:DropzoneFile[]):void;
|
||||
queuecomplete?():void;
|
||||
maxfilesexceeded?(file: DropzoneFile): void;
|
||||
maxfilesreached?(files: DropzoneFile[]): void;
|
||||
queuecomplete?(): void;
|
||||
|
||||
previewTemplate?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare class Dropzone {
|
||||
constructor(container:string|HTMLElement, options?:Dropzone.DropzoneOptions);
|
||||
constructor(container: string | HTMLElement, options?: Dropzone.DropzoneOptions);
|
||||
|
||||
static autoDiscover:boolean;
|
||||
static options:any;
|
||||
static confirm:(question:string, accepted:() => void, rejected?:() => void) => void;
|
||||
static autoDiscover: boolean;
|
||||
static options: any;
|
||||
static confirm: (question: string, accepted: () => void, rejected?: () => void) => void;
|
||||
static createElement(string: string): HTMLElement;
|
||||
static isBrowserSupported(): boolean;
|
||||
static instances: Dropzone[];
|
||||
|
||||
static ADDED:string;
|
||||
static QUEUED:string;
|
||||
static ACCEPTED:string;
|
||||
static UPLOADING:string;
|
||||
static PROCESSING:string;
|
||||
static CANCELED:string;
|
||||
static ERROR:string;
|
||||
static SUCCESS:string;
|
||||
static ADDED: string;
|
||||
static QUEUED: string;
|
||||
static ACCEPTED: string;
|
||||
static UPLOADING: string;
|
||||
static PROCESSING: string;
|
||||
static CANCELED: string;
|
||||
static ERROR: string;
|
||||
static SUCCESS: string;
|
||||
|
||||
files:Dropzone.DropzoneFile[];
|
||||
files: Dropzone.DropzoneFile[];
|
||||
defaultOptions: Dropzone.DropzoneOptions;
|
||||
|
||||
enable():void;
|
||||
enable(): void;
|
||||
|
||||
disable():void;
|
||||
disable(): void;
|
||||
|
||||
destroy():Dropzone;
|
||||
destroy(): Dropzone;
|
||||
|
||||
addFile(file:Dropzone.DropzoneFile):void;
|
||||
addFile(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
removeFile(file:Dropzone.DropzoneFile):void;
|
||||
removeFile(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
removeAllFiles(cancelIfNecessary?:boolean):void;
|
||||
removeAllFiles(cancelIfNecessary?: boolean): void;
|
||||
|
||||
processQueue():void;
|
||||
resizeImage(file: Dropzone.DropzoneFile, width?: number, height?: number, resizeMethod?: string, callback?: (...args: any[]) => void): void;
|
||||
|
||||
cancelUpload(file:Dropzone.DropzoneFile):void;
|
||||
processQueue(): void;
|
||||
|
||||
processFiles(files:Dropzone.DropzoneFile[]):void;
|
||||
cancelUpload(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
processFile(file:Dropzone.DropzoneFile):void;
|
||||
createThumbnail(file: Dropzone.DropzoneFile, width?: number, height?: number, resizeMethod?: string, fixOrientation?: boolean, callback?: (...args: any[]) => void): any;
|
||||
|
||||
uploadFile(file:Dropzone.DropzoneFile):void;
|
||||
createThumbnailFromUrl(file: Dropzone.DropzoneFile, width?: number, height?: number, resizeMethod?: string, fixOrientation?: boolean, callback?: (...args: any[]) => void, crossOrigin?: string): any;
|
||||
|
||||
getAcceptedFiles():Dropzone.DropzoneFile[];
|
||||
processFiles(files: Dropzone.DropzoneFile[]): void;
|
||||
|
||||
getRejectedFiles():Dropzone.DropzoneFile[];
|
||||
processFile(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
getQueuedFiles():Dropzone.DropzoneFile[];
|
||||
uploadFile(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
getUploadingFiles():Dropzone.DropzoneFile[];
|
||||
uploadFiles(files: Dropzone.DropzoneFile[]): void;
|
||||
|
||||
accept(file:Dropzone.DropzoneFile, done:(error?:string|Error) => void):void;
|
||||
getAcceptedFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
getActiveFiles():Dropzone.DropzoneFile[];
|
||||
getActiveFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
getFilesWithStatus(status:string):Dropzone.DropzoneFile[];
|
||||
getAddedFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
enqueueFile(file:Dropzone.DropzoneFile):void;
|
||||
getRejectedFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
enqueueFiles(file:Dropzone.DropzoneFile[]):void;
|
||||
getQueuedFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
createThumbnail(file:Dropzone.DropzoneFile, callback?:(...args:any[]) => void):any;
|
||||
getUploadingFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
createThumbnailFromUrl(file:Dropzone.DropzoneFile, url:string, callback?:(...args:any[]) => void):any;
|
||||
accept(file: Dropzone.DropzoneFile, done: (error?: string | Error) => void): void;
|
||||
|
||||
on(eventName:string, callback:(...args:any[]) => void):Dropzone;
|
||||
getActiveFiles(): Dropzone.DropzoneFile[];
|
||||
|
||||
getFilesWithStatus(status: string): Dropzone.DropzoneFile[];
|
||||
|
||||
enqueueFile(file: Dropzone.DropzoneFile): void;
|
||||
|
||||
enqueueFiles(file: Dropzone.DropzoneFile[]): void;
|
||||
|
||||
createThumbnail(file: Dropzone.DropzoneFile, callback?: (...args: any[]) => void): any;
|
||||
|
||||
createThumbnailFromUrl(file: Dropzone.DropzoneFile, url: string, callback?: (...args: any[]) => void): any;
|
||||
|
||||
on(eventName: string, callback: (...args: any[]) => void): Dropzone;
|
||||
|
||||
off(): Dropzone;
|
||||
off(eventName:string, callback?:(...args:any[]) => void):Dropzone;
|
||||
off(eventName: string, callback?: (...args: any[]) => void): Dropzone;
|
||||
|
||||
emit(eventName:string, ...args:any[]):Dropzone;
|
||||
emit(eventName: string, ...args: any[]): Dropzone;
|
||||
|
||||
on(eventName:"drop", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragstart", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragend", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragenter", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragover", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragleave", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"paste", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName: "drop", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "dragstart", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "dragend", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "dragenter", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "dragover", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "dragleave", callback: (e: DragEvent) => any): Dropzone;
|
||||
on(eventName: "paste", callback: (e: DragEvent) => any): Dropzone;
|
||||
|
||||
on(eventName:"reset"):Dropzone;
|
||||
on(eventName: "reset"): Dropzone;
|
||||
|
||||
on(eventName:"addedfile", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"addedfiles", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName:"removedfile", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"thumbnail", callback:(file:Dropzone.DropzoneFile, dataUrl:string) => any):Dropzone;
|
||||
on(eventName: "addedfile", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "addedfiles", callback: (files: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
on(eventName: "removedfile", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "thumbnail", callback: (file: Dropzone.DropzoneFile, dataUrl: string) => any): Dropzone;
|
||||
|
||||
on(eventName:"error", callback:(file:Dropzone.DropzoneFile, message:string|Error) => any):Dropzone;
|
||||
on(eventName:"errormultiple", callback:(files:Dropzone.DropzoneFile[], message:string|Error) => any):Dropzone;
|
||||
on(eventName: "error", callback: (file: Dropzone.DropzoneFile, message: string | Error) => any): Dropzone;
|
||||
on(eventName: "errormultiple", callback: (files: Dropzone.DropzoneFile[], message: string | Error) => any): Dropzone;
|
||||
|
||||
on(eventName:"processing", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"processingmultiple", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName: "processing", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "processingmultiple", callback: (files: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
|
||||
on(eventName:"uploadprogress", callback:(file:Dropzone.DropzoneFile, progress:number, bytesSent:number) => any):Dropzone;
|
||||
on(eventName:"totaluploadprogress", callback:(totalProgress:number, totalBytes:number, totalBytesSent:number) => any):Dropzone;
|
||||
on(eventName: "uploadprogress", callback: (file: Dropzone.DropzoneFile, progress: number, bytesSent: number) => any): Dropzone;
|
||||
on(eventName: "totaluploadprogress", callback: (totalProgress: number, totalBytes: number, totalBytesSent: number) => any): Dropzone;
|
||||
|
||||
on(eventName:"sending", callback:(file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
|
||||
on(eventName:"sendingmultiple", callback:(files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
|
||||
on(eventName: "sending", callback: (file: Dropzone.DropzoneFile, xhr: XMLHttpRequest, formData: FormData) => any): Dropzone;
|
||||
on(eventName: "sendingmultiple", callback: (files: Dropzone.DropzoneFile[], xhr: XMLHttpRequest, formData: FormData) => any): Dropzone;
|
||||
|
||||
on(eventName:"success", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"successmultiple", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName: "success", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "successmultiple", callback: (files: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
|
||||
on(eventName:"canceled", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"canceledmultiple", callback:(file:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName: "canceled", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "canceledmultiple", callback: (file: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
|
||||
on(eventName:"complete", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"completemultiple", callback:(file:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName: "complete", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "completemultiple", callback: (file: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
|
||||
on(eventName:"maxfilesexceeded", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"maxfilesreached", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName:"queuecomplete"):Dropzone;
|
||||
on(eventName: "maxfilesexceeded", callback: (file: Dropzone.DropzoneFile) => any): Dropzone;
|
||||
on(eventName: "maxfilesreached", callback: (files: Dropzone.DropzoneFile[]) => any): Dropzone;
|
||||
on(eventName: "queuecomplete"): Dropzone;
|
||||
|
||||
emit(eventName:"drop", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragstart", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragend", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragenter", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragover", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragleave", e:DragEvent):Dropzone;
|
||||
emit(eventName:"paste", e:DragEvent):Dropzone;
|
||||
emit(eventName: "drop", e: DragEvent): Dropzone;
|
||||
emit(eventName: "dragstart", e: DragEvent): Dropzone;
|
||||
emit(eventName: "dragend", e: DragEvent): Dropzone;
|
||||
emit(eventName: "dragenter", e: DragEvent): Dropzone;
|
||||
emit(eventName: "dragover", e: DragEvent): Dropzone;
|
||||
emit(eventName: "dragleave", e: DragEvent): Dropzone;
|
||||
emit(eventName: "paste", e: DragEvent): Dropzone;
|
||||
|
||||
emit(eventName:"reset"):Dropzone;
|
||||
emit(eventName: "reset"): Dropzone;
|
||||
|
||||
emit(eventName:"addedfile", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"addedfiles", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName:"removedfile", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"thumbnail", file:Dropzone.DropzoneFile, dataUrl:string):Dropzone;
|
||||
emit(eventName: "addedfile", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "addedfiles", files: Dropzone.DropzoneFile[]): Dropzone;
|
||||
emit(eventName: "removedfile", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "thumbnail", file: Dropzone.DropzoneFile, dataUrl: string): Dropzone;
|
||||
|
||||
emit(eventName:"error", file:Dropzone.DropzoneFile, message:string|Error):Dropzone;
|
||||
emit(eventName:"errormultiple", files:Dropzone.DropzoneFile[], message:string|Error):Dropzone;
|
||||
emit(eventName: "error", file: Dropzone.DropzoneFile, message: string | Error): Dropzone;
|
||||
emit(eventName: "errormultiple", files: Dropzone.DropzoneFile[], message: string | Error): Dropzone;
|
||||
|
||||
emit(eventName:"processing", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"processingmultiple", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName: "processing", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "processingmultiple", files: Dropzone.DropzoneFile[]): Dropzone;
|
||||
|
||||
emit(eventName:"uploadprogress", file:Dropzone.DropzoneFile, progress:number, bytesSent:number):Dropzone;
|
||||
emit(eventName:"totaluploadprogress", totalProgress:number, totalBytes:number, totalBytesSent:number):Dropzone;
|
||||
emit(eventName: "uploadprogress", file: Dropzone.DropzoneFile, progress: number, bytesSent: number): Dropzone;
|
||||
emit(eventName: "totaluploadprogress", totalProgress: number, totalBytes: number, totalBytesSent: number): Dropzone;
|
||||
|
||||
emit(eventName:"sending", file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:FormData):Dropzone;
|
||||
emit(eventName:"sendingmultiple", files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):Dropzone;
|
||||
emit(eventName: "sending", file: Dropzone.DropzoneFile, xhr: XMLHttpRequest, formData: FormData): Dropzone;
|
||||
emit(eventName: "sendingmultiple", files: Dropzone.DropzoneFile[], xhr: XMLHttpRequest, formData: FormData): Dropzone;
|
||||
|
||||
emit(eventName:"success", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"successmultiple", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName: "success", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "successmultiple", files: Dropzone.DropzoneFile[]): Dropzone;
|
||||
|
||||
emit(eventName:"canceled", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"canceledmultiple", file:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName: "canceled", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "canceledmultiple", file: Dropzone.DropzoneFile[]): Dropzone;
|
||||
|
||||
emit(eventName:"complete", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"completemultiple", file:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName: "complete", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "completemultiple", file: Dropzone.DropzoneFile[]): Dropzone;
|
||||
|
||||
emit(eventName:"maxfilesexceeded", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"maxfilesreached", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName:"queuecomplete"):Dropzone;
|
||||
emit(eventName: "maxfilesexceeded", file: Dropzone.DropzoneFile): Dropzone;
|
||||
emit(eventName: "maxfilesreached", files: Dropzone.DropzoneFile[]): Dropzone;
|
||||
emit(eventName: "queuecomplete"): Dropzone;
|
||||
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
dropzone(options:Dropzone.DropzoneOptions): Dropzone;
|
||||
dropzone(options: Dropzone.DropzoneOptions): Dropzone;
|
||||
}
|
||||
|
||||
export = Dropzone;
|
||||
|
||||
@@ -0,0 +1,296 @@
|
||||
const dropzoneFromString = new Dropzone(".test");
|
||||
const dropzoneFromElement = new Dropzone(document.getElementById("test"));
|
||||
const dropzoneRenameFunction = function (name:string):string {
|
||||
return name + 'new';
|
||||
};
|
||||
|
||||
const dropzoneWithOptions = new Dropzone(".test", {
|
||||
url: "/some/url",
|
||||
method: "post",
|
||||
withCredentials: false,
|
||||
parallelUploads: 2,
|
||||
uploadMultiple: true,
|
||||
maxFilesize: 1024,
|
||||
paramName: "file",
|
||||
createImageThumbnails: true,
|
||||
maxThumbnailFilesize: 1024,
|
||||
thumbnailWidth: 50,
|
||||
thumbnailHeight: 50,
|
||||
filesizeBase: 1000,
|
||||
maxFiles: 100,
|
||||
params: {
|
||||
additional: "param"
|
||||
},
|
||||
headers: {
|
||||
"Some-Header": "Value"
|
||||
},
|
||||
clickable: true,
|
||||
ignoreHiddenFiles: true,
|
||||
acceptedFiles: "image/*",
|
||||
renameFilename: dropzoneRenameFunction,
|
||||
autoProcessQueue: true,
|
||||
autoQueue: true,
|
||||
addRemoveLinks: true,
|
||||
previewsContainer: "<div></div>",
|
||||
hiddenInputContainer: document.createElement("input"),
|
||||
capture: "camera",
|
||||
|
||||
dictDefaultMessage: "",
|
||||
dictFallbackMessage: "",
|
||||
dictFallbackText: "",
|
||||
dictFileTooBig: "",
|
||||
dictInvalidFileType: "",
|
||||
dictResponseError: "",
|
||||
dictCancelUpload: "",
|
||||
dictCancelUploadConfirmation: "",
|
||||
dictRemoveFile: "",
|
||||
dictRemoveFileConfirmation: "",
|
||||
dictMaxFilesExceeded: "",
|
||||
|
||||
accept: (file:Dropzone.DropzoneFile, done:(error?:string|Error) => void) => {
|
||||
if (file.accepted) {
|
||||
file.previewElement.classList.add("accepted");
|
||||
file.previewTemplate.classList.add("accepted");
|
||||
file.previewsContainer.classList.add("accepted");
|
||||
done();
|
||||
}
|
||||
else {
|
||||
done(new Error(file.status));
|
||||
}
|
||||
},
|
||||
init: () => console.log("Initialized"),
|
||||
forceFallback: false,
|
||||
fallback: () => console.log("Fallback"),
|
||||
resize: (file:Dropzone.DropzoneFile) => ({
|
||||
srcX: 0,
|
||||
srcY: 0,
|
||||
trgX: 10,
|
||||
trgY: 10,
|
||||
srcWidth: 100,
|
||||
srcHeight: 100,
|
||||
trgWidth: 50,
|
||||
trgHeight: 50,
|
||||
optWidth: 50,
|
||||
optHeight: 50
|
||||
}),
|
||||
|
||||
drop: (e:DragEvent) => console.log("Drop"),
|
||||
dragstart: (e:DragEvent) => console.log("Dragstart"),
|
||||
dragend: (e:DragEvent) => console.log("Dragend"),
|
||||
dragenter: (e:DragEvent) => console.log("Dragenter"),
|
||||
dragover: (e:DragEvent) => console.log("Dragover"),
|
||||
dragleave: (e:DragEvent) => console.log("Dragleave"),
|
||||
paste: (e:DragEvent) => console.log("Paste"),
|
||||
|
||||
reset: () => console.log("Reset"),
|
||||
|
||||
addedfile: (file:Dropzone.DropzoneFile) => console.log("Addedfile"),
|
||||
addedfiles: (files:Dropzone.DropzoneFile[]) => console.log("Addedfiles"),
|
||||
removedfile: (file:Dropzone.DropzoneFile) => console.log("Removedfile"),
|
||||
thumbnail: (file:Dropzone.DropzoneFile, dataUrl:string) => console.log("Thumbnail"),
|
||||
|
||||
error: (file:Dropzone.DropzoneFile, message:string|Error) => console.log("Error"),
|
||||
errormultiple: (files:Dropzone.DropzoneFile[], message:string|Error) => console.log("Errormultiple"),
|
||||
|
||||
processing: (file:Dropzone.DropzoneFile) => console.log("Processing"),
|
||||
processingmultiple: (files:Dropzone.DropzoneFile[]) => console.log("Processingmultiple"),
|
||||
|
||||
uploadprogress: (file:Dropzone.DropzoneFile, progress:number, bytesSent:number) => console.log("Uploadprogress"),
|
||||
totaluploadprogress: (totalProgress:number, totalBytes:number, totalBytesSent:number) => console.log("Totaluploadprogress"),
|
||||
|
||||
sending: (file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:{}) => console.log("Sending"),
|
||||
sendingmultiple: (files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:{}) => console.log("Sendingmultiple"),
|
||||
|
||||
success: (file:Dropzone.DropzoneFile) => console.log("Success"),
|
||||
successmultiple: (files:Dropzone.DropzoneFile[]) => console.log("Successmultiple"),
|
||||
|
||||
canceled: (file:Dropzone.DropzoneFile) => console.log("Canceled"),
|
||||
canceledmultiple: (file:Dropzone.DropzoneFile[]) => console.log("Canceledmultiple"),
|
||||
|
||||
complete: (file:Dropzone.DropzoneFile) => console.log("Complete"),
|
||||
completemultiple: (file:Dropzone.DropzoneFile[]) => console.log("Completemultiple"),
|
||||
|
||||
maxfilesexceeded: (file:Dropzone.DropzoneFile) => console.log("Maxfilesexceeded"),
|
||||
maxfilesreached: (files:Dropzone.DropzoneFile[]) => console.log("Maxfilesreached"),
|
||||
queuecomplete: () => console.log("Queuecomplete"),
|
||||
|
||||
previewTemplate: "<div></div>",
|
||||
});
|
||||
|
||||
var dropzoneWithOptionsVariations:Dropzone;
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: ".test"
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: document.getElementById("test")
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: [".test", ".test"]
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: [document.getElementById("test"), document.getElementById("test")]
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
clickable: ["test", document.getElementById("test")]
|
||||
});
|
||||
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
success: (file:Dropzone.DropzoneFile, response:Object) => console.log(file, response)
|
||||
});
|
||||
dropzoneWithOptionsVariations = new Dropzone(".test", {
|
||||
success: (file:Dropzone.DropzoneFile, response:string) => console.log(file, response)
|
||||
});
|
||||
|
||||
const dropzone = new Dropzone(".test");
|
||||
|
||||
dropzone.enable();
|
||||
dropzone.disable();
|
||||
|
||||
dropzone.files.forEach(f => {
|
||||
if (f.xhr) {
|
||||
console.log(f.xhr.readyState)
|
||||
}
|
||||
if (f.accepted) {
|
||||
f.previewElement.classList.add("accepted");
|
||||
f.previewTemplate.classList.add("accepted");
|
||||
f.previewsContainer.classList.add("accepted");
|
||||
}
|
||||
else {
|
||||
console.log(f.status.toUpperCase());
|
||||
}
|
||||
});
|
||||
|
||||
const firstFile = dropzone.files[0];
|
||||
dropzone.removeFile(firstFile);
|
||||
dropzone.addFile(firstFile);
|
||||
dropzone.enqueueFile(firstFile);
|
||||
dropzone.processFile(firstFile);
|
||||
dropzone.uploadFile(firstFile);
|
||||
dropzone.cancelUpload(firstFile);
|
||||
dropzone.createThumbnail(firstFile, () => {
|
||||
console.log("createThumbnail")
|
||||
});
|
||||
dropzone.createThumbnailFromUrl(firstFile, "/some/url", () => {
|
||||
console.log("createThumbnailFromUrl")
|
||||
});
|
||||
dropzone.accept(firstFile, (e:string|Error) => {
|
||||
console.log(e);
|
||||
});
|
||||
|
||||
const acceptedFiles = dropzone.getAcceptedFiles();
|
||||
dropzone.processFiles(acceptedFiles);
|
||||
|
||||
const rejectedFiles = dropzone.getRejectedFiles();
|
||||
dropzone.enqueueFiles(rejectedFiles);
|
||||
|
||||
const queuedFiles = dropzone.getQueuedFiles();
|
||||
dropzone.processFiles(queuedFiles);
|
||||
|
||||
const uploadingFiles = dropzone.getUploadingFiles();
|
||||
dropzone.processFiles(uploadingFiles);
|
||||
|
||||
const activeFiles = dropzone.getActiveFiles();
|
||||
dropzone.processFiles(activeFiles);
|
||||
|
||||
const addedFiles = dropzone.getFilesWithStatus(Dropzone.ADDED);
|
||||
dropzone.processFiles(addedFiles);
|
||||
|
||||
dropzone.processQueue();
|
||||
dropzone.removeAllFiles(true);
|
||||
|
||||
dropzone
|
||||
.on("drop", () => {
|
||||
console.count('drop');
|
||||
})
|
||||
.on("dragstart", () => {
|
||||
console.count('dragstart');
|
||||
})
|
||||
.on("dragend", () => {
|
||||
console.count('dragend');
|
||||
})
|
||||
.on("dragenter", () => {
|
||||
console.count('dragenter');
|
||||
})
|
||||
.on("dragover", () => {
|
||||
console.count('dragover');
|
||||
})
|
||||
.on("dragleave", () => {
|
||||
console.count('dragleave');
|
||||
})
|
||||
.on("paste", () => {
|
||||
console.count('paste');
|
||||
})
|
||||
.on("reset", () => {
|
||||
console.count('reset');
|
||||
})
|
||||
.on("addedfile", () => {
|
||||
console.count('addedfile');
|
||||
})
|
||||
.on("addedfiles", () => {
|
||||
console.count('addedfiles');
|
||||
})
|
||||
.on("removedfile", () => {
|
||||
console.count('removedfile');
|
||||
})
|
||||
.on("thumbnail", () => {
|
||||
console.count('thumbnail');
|
||||
})
|
||||
.on("error", () => {
|
||||
console.count('error');
|
||||
})
|
||||
.on("errormultiple", () => {
|
||||
console.count('errormultiple');
|
||||
})
|
||||
.on("processing", () => {
|
||||
console.count('processing');
|
||||
})
|
||||
.on("processingmultiple", () => {
|
||||
console.count('processingmultiple');
|
||||
})
|
||||
.on("uploadprogress", () => {
|
||||
console.count('uploadprogress');
|
||||
})
|
||||
.on("totaluploadprogress", () => {
|
||||
console.count('totaluploadprogress');
|
||||
})
|
||||
.on("sending", () => {
|
||||
console.count('sending');
|
||||
})
|
||||
.on("sendingmultiple", () => {
|
||||
console.count('sendingmultiple');
|
||||
})
|
||||
.on("success", () => {
|
||||
console.count('success');
|
||||
})
|
||||
.on("successmultiple", () => {
|
||||
console.count('successmultiple');
|
||||
})
|
||||
.on("canceled", () => {
|
||||
console.count('canceled');
|
||||
})
|
||||
.on("canceledmultiple", () => {
|
||||
console.count('canceledmultiple');
|
||||
})
|
||||
.on("complete", () => {
|
||||
console.count('complete');
|
||||
})
|
||||
.on("completemultiple", () => {
|
||||
console.count('completemultiple');
|
||||
})
|
||||
.on("maxfilesexceeded", () => {
|
||||
console.count('maxfilesexceeded');
|
||||
})
|
||||
.on("maxfilesreached", () => {
|
||||
console.count('maxfilesreached');
|
||||
})
|
||||
.on("queuecomplete", () => {
|
||||
console.count('queuecomplete');
|
||||
});
|
||||
|
||||
dropzone.off("drop", () => {
|
||||
console.count('drop');
|
||||
})
|
||||
.off("dragstart")
|
||||
.off();
|
||||
|
||||
dropzone.destroy();
|
||||
Vendored
+279
@@ -0,0 +1,279 @@
|
||||
// Type definitions for Dropzone 4.3.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>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
import * as $ from "jquery";
|
||||
|
||||
declare namespace Dropzone {
|
||||
export interface DropzoneResizeInfo {
|
||||
srcX?:number;
|
||||
srcY?:number;
|
||||
trgX?:number;
|
||||
trgY?:number;
|
||||
srcWidth?:number;
|
||||
srcHeight?:number;
|
||||
trgWidth?:number;
|
||||
trgHeight?:number;
|
||||
optWidth?:number;
|
||||
optHeight?:number;
|
||||
}
|
||||
|
||||
export interface DropzoneFile extends File {
|
||||
previewElement: HTMLElement;
|
||||
previewTemplate: HTMLElement;
|
||||
previewsContainer: HTMLElement;
|
||||
status: string;
|
||||
accepted: boolean;
|
||||
xhr?: XMLHttpRequest;
|
||||
}
|
||||
|
||||
export interface DropzoneOptions {
|
||||
url?: string;
|
||||
method?: string;
|
||||
withCredentials?: boolean;
|
||||
parallelUploads?: number;
|
||||
uploadMultiple?: boolean;
|
||||
maxFilesize?: number;
|
||||
paramName?: string;
|
||||
createImageThumbnails?: boolean;
|
||||
maxThumbnailFilesize?: number;
|
||||
thumbnailWidth?: number;
|
||||
thumbnailHeight?: number;
|
||||
filesizeBase?: number;
|
||||
maxFiles?: number;
|
||||
params?: {};
|
||||
headers?: {};
|
||||
clickable?: boolean|string|HTMLElement|(string|HTMLElement)[];
|
||||
ignoreHiddenFiles?: boolean;
|
||||
acceptedFiles?: string;
|
||||
renameFilename?(name:string): string;
|
||||
autoProcessQueue?: boolean;
|
||||
autoQueue?: boolean;
|
||||
addRemoveLinks?: boolean;
|
||||
previewsContainer?: boolean|string|HTMLElement;
|
||||
hiddenInputContainer?: HTMLElement;
|
||||
capture?: string;
|
||||
|
||||
dictDefaultMessage?: string;
|
||||
dictFallbackMessage?: string;
|
||||
dictFallbackText?: string;
|
||||
dictFileTooBig?: string;
|
||||
dictInvalidFileType?: string;
|
||||
dictResponseError?: string;
|
||||
dictCancelUpload?: string;
|
||||
dictCancelUploadConfirmation?: string;
|
||||
dictRemoveFile?: string;
|
||||
dictRemoveFileConfirmation?: string;
|
||||
dictMaxFilesExceeded?: string;
|
||||
|
||||
accept?(file:DropzoneFile, done:(error?:string|Error) => void):void;
|
||||
init?():void;
|
||||
forceFallback?: boolean;
|
||||
fallback?():void;
|
||||
resize?(file:DropzoneFile):DropzoneResizeInfo;
|
||||
|
||||
drop?(e:DragEvent):void;
|
||||
dragstart?(e:DragEvent):void;
|
||||
dragend?(e:DragEvent):void;
|
||||
dragenter?(e:DragEvent):void;
|
||||
dragover?(e:DragEvent):void;
|
||||
dragleave?(e:DragEvent):void;
|
||||
paste?(e:DragEvent):void;
|
||||
|
||||
reset?():void;
|
||||
|
||||
addedfile?(file:DropzoneFile):void;
|
||||
addedfiles?(files:DropzoneFile[]):void;
|
||||
removedfile?(file:DropzoneFile):void;
|
||||
thumbnail?(file:DropzoneFile, dataUrl:string):void;
|
||||
|
||||
error?(file:DropzoneFile, message:string|Error, xhr:XMLHttpRequest):void;
|
||||
errormultiple?(files:DropzoneFile[], message:string|Error, xhr:XMLHttpRequest):void;
|
||||
|
||||
processing?(file:DropzoneFile):void;
|
||||
processingmultiple?(files:DropzoneFile[]):void;
|
||||
|
||||
uploadprogress?(file:DropzoneFile, progress:number, bytesSent:number):void;
|
||||
totaluploadprogress?(totalProgress:number, totalBytes:number, totalBytesSent:number):void;
|
||||
|
||||
sending?(file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData):void;
|
||||
sendingmultiple?(files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):void;
|
||||
|
||||
success?(file: DropzoneFile, response: Object|string): void;
|
||||
successmultiple?(files:DropzoneFile[], responseText:string):void;
|
||||
|
||||
canceled?(file:DropzoneFile):void;
|
||||
canceledmultiple?(file:DropzoneFile[]):void;
|
||||
|
||||
complete?(file:DropzoneFile):void;
|
||||
completemultiple?(file:DropzoneFile[]):void;
|
||||
|
||||
maxfilesexceeded?(file:DropzoneFile):void;
|
||||
maxfilesreached?(files:DropzoneFile[]):void;
|
||||
queuecomplete?():void;
|
||||
|
||||
previewTemplate?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare class Dropzone {
|
||||
constructor(container:string|HTMLElement, options?:Dropzone.DropzoneOptions);
|
||||
|
||||
static autoDiscover:boolean;
|
||||
static options:any;
|
||||
static confirm:(question:string, accepted:() => void, rejected?:() => void) => void;
|
||||
|
||||
static ADDED:string;
|
||||
static QUEUED:string;
|
||||
static ACCEPTED:string;
|
||||
static UPLOADING:string;
|
||||
static PROCESSING:string;
|
||||
static CANCELED:string;
|
||||
static ERROR:string;
|
||||
static SUCCESS:string;
|
||||
|
||||
files:Dropzone.DropzoneFile[];
|
||||
|
||||
enable():void;
|
||||
|
||||
disable():void;
|
||||
|
||||
destroy():Dropzone;
|
||||
|
||||
addFile(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
removeFile(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
removeAllFiles(cancelIfNecessary?:boolean):void;
|
||||
|
||||
processQueue():void;
|
||||
|
||||
cancelUpload(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
processFiles(files:Dropzone.DropzoneFile[]):void;
|
||||
|
||||
processFile(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
uploadFile(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
getAcceptedFiles():Dropzone.DropzoneFile[];
|
||||
|
||||
getRejectedFiles():Dropzone.DropzoneFile[];
|
||||
|
||||
getQueuedFiles():Dropzone.DropzoneFile[];
|
||||
|
||||
getUploadingFiles():Dropzone.DropzoneFile[];
|
||||
|
||||
accept(file:Dropzone.DropzoneFile, done:(error?:string|Error) => void):void;
|
||||
|
||||
getActiveFiles():Dropzone.DropzoneFile[];
|
||||
|
||||
getFilesWithStatus(status:string):Dropzone.DropzoneFile[];
|
||||
|
||||
enqueueFile(file:Dropzone.DropzoneFile):void;
|
||||
|
||||
enqueueFiles(file:Dropzone.DropzoneFile[]):void;
|
||||
|
||||
createThumbnail(file:Dropzone.DropzoneFile, callback?:(...args:any[]) => void):any;
|
||||
|
||||
createThumbnailFromUrl(file:Dropzone.DropzoneFile, url:string, callback?:(...args:any[]) => void):any;
|
||||
|
||||
on(eventName:string, callback:(...args:any[]) => void):Dropzone;
|
||||
|
||||
off(): Dropzone;
|
||||
off(eventName:string, callback?:(...args:any[]) => void):Dropzone;
|
||||
|
||||
emit(eventName:string, ...args:any[]):Dropzone;
|
||||
|
||||
on(eventName:"drop", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragstart", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragend", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragenter", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragover", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"dragleave", callback:(e:DragEvent) => any):Dropzone;
|
||||
on(eventName:"paste", callback:(e:DragEvent) => any):Dropzone;
|
||||
|
||||
on(eventName:"reset"):Dropzone;
|
||||
|
||||
on(eventName:"addedfile", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"addedfiles", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName:"removedfile", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"thumbnail", callback:(file:Dropzone.DropzoneFile, dataUrl:string) => any):Dropzone;
|
||||
|
||||
on(eventName:"error", callback:(file:Dropzone.DropzoneFile, message:string|Error) => any):Dropzone;
|
||||
on(eventName:"errormultiple", callback:(files:Dropzone.DropzoneFile[], message:string|Error) => any):Dropzone;
|
||||
|
||||
on(eventName:"processing", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"processingmultiple", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
|
||||
on(eventName:"uploadprogress", callback:(file:Dropzone.DropzoneFile, progress:number, bytesSent:number) => any):Dropzone;
|
||||
on(eventName:"totaluploadprogress", callback:(totalProgress:number, totalBytes:number, totalBytesSent:number) => any):Dropzone;
|
||||
|
||||
on(eventName:"sending", callback:(file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
|
||||
on(eventName:"sendingmultiple", callback:(files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
|
||||
|
||||
on(eventName:"success", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"successmultiple", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
|
||||
on(eventName:"canceled", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"canceledmultiple", callback:(file:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
|
||||
on(eventName:"complete", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"completemultiple", callback:(file:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
|
||||
on(eventName:"maxfilesexceeded", callback:(file:Dropzone.DropzoneFile) => any):Dropzone;
|
||||
on(eventName:"maxfilesreached", callback:(files:Dropzone.DropzoneFile[]) => any):Dropzone;
|
||||
on(eventName:"queuecomplete"):Dropzone;
|
||||
|
||||
emit(eventName:"drop", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragstart", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragend", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragenter", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragover", e:DragEvent):Dropzone;
|
||||
emit(eventName:"dragleave", e:DragEvent):Dropzone;
|
||||
emit(eventName:"paste", e:DragEvent):Dropzone;
|
||||
|
||||
emit(eventName:"reset"):Dropzone;
|
||||
|
||||
emit(eventName:"addedfile", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"addedfiles", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName:"removedfile", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"thumbnail", file:Dropzone.DropzoneFile, dataUrl:string):Dropzone;
|
||||
|
||||
emit(eventName:"error", file:Dropzone.DropzoneFile, message:string|Error):Dropzone;
|
||||
emit(eventName:"errormultiple", files:Dropzone.DropzoneFile[], message:string|Error):Dropzone;
|
||||
|
||||
emit(eventName:"processing", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"processingmultiple", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
|
||||
emit(eventName:"uploadprogress", file:Dropzone.DropzoneFile, progress:number, bytesSent:number):Dropzone;
|
||||
emit(eventName:"totaluploadprogress", totalProgress:number, totalBytes:number, totalBytesSent:number):Dropzone;
|
||||
|
||||
emit(eventName:"sending", file:Dropzone.DropzoneFile, xhr:XMLHttpRequest, formData:FormData):Dropzone;
|
||||
emit(eventName:"sendingmultiple", files:Dropzone.DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):Dropzone;
|
||||
|
||||
emit(eventName:"success", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"successmultiple", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
|
||||
emit(eventName:"canceled", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"canceledmultiple", file:Dropzone.DropzoneFile[]):Dropzone;
|
||||
|
||||
emit(eventName:"complete", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"completemultiple", file:Dropzone.DropzoneFile[]):Dropzone;
|
||||
|
||||
emit(eventName:"maxfilesexceeded", file:Dropzone.DropzoneFile):Dropzone;
|
||||
emit(eventName:"maxfilesreached", files:Dropzone.DropzoneFile[]):Dropzone;
|
||||
emit(eventName:"queuecomplete"):Dropzone;
|
||||
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
dropzone(options:Dropzone.DropzoneOptions): Dropzone;
|
||||
}
|
||||
|
||||
export = Dropzone;
|
||||
export as namespace Dropzone;
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"dropzone": ["dropzone/v4"]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dropzone-tests.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+64757
-62223
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
import ElectronStore = require('electron-store');
|
||||
|
||||
new ElectronStore({
|
||||
defaults: {}
|
||||
});
|
||||
|
||||
new ElectronStore({
|
||||
name: 'myConfiguration',
|
||||
cwd: 'unicorn'
|
||||
});
|
||||
|
||||
const electronStore = new ElectronStore();
|
||||
|
||||
electronStore.set('foo', 'bar');
|
||||
electronStore.set({
|
||||
foo: 'bar',
|
||||
foo2: 'bar2'
|
||||
});
|
||||
electronStore.delete('foo');
|
||||
electronStore.get('foo');
|
||||
electronStore.get('foo', 42);
|
||||
electronStore.has('foo');
|
||||
electronStore.clear();
|
||||
|
||||
electronStore.openInEditor();
|
||||
|
||||
electronStore.size;
|
||||
electronStore.store;
|
||||
|
||||
electronStore.store = {
|
||||
foo: 'bar'
|
||||
};
|
||||
|
||||
electronStore.path;
|
||||
Vendored
+79
@@ -0,0 +1,79 @@
|
||||
// Type definitions for electron-store 1.2
|
||||
// Project: https://github.com/sindresorhus/electron-store
|
||||
// Definitions by: Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface ElectronStoreOptions {
|
||||
/**
|
||||
* Default config.
|
||||
*/
|
||||
defaults?: {};
|
||||
|
||||
/**
|
||||
* Name of the config file (without extension).
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* Storage file location. *Don't specify this unless absolutely necessary!*
|
||||
*/
|
||||
cwd?: string;
|
||||
}
|
||||
|
||||
declare class ElectronStore implements Iterable<[string, string | number | boolean | symbol | {}]> {
|
||||
constructor(options?: ElectronStoreOptions);
|
||||
|
||||
/**
|
||||
* Sets an item.
|
||||
*/
|
||||
set(key: string, value: any): void;
|
||||
|
||||
/**
|
||||
* Sets multiple items at once.
|
||||
*/
|
||||
set(object: {}): void;
|
||||
|
||||
/**
|
||||
* Retrieves an item.
|
||||
*/
|
||||
get(key: string, defaultValue?: any): any;
|
||||
|
||||
/**
|
||||
* Checks if an item exists.
|
||||
*/
|
||||
has(key: string): boolean;
|
||||
|
||||
/**
|
||||
* Deletes an item.
|
||||
*/
|
||||
delete(key: string): void;
|
||||
|
||||
/**
|
||||
* Deletes all items.
|
||||
*/
|
||||
clear(): void;
|
||||
|
||||
/**
|
||||
* Open the storage file in the user's editor.
|
||||
*/
|
||||
openInEditor(): void;
|
||||
|
||||
/**
|
||||
* Gets the item count.
|
||||
*/
|
||||
size: number;
|
||||
|
||||
/**
|
||||
* Gets all the config as an object or replace the current config with an object.
|
||||
*/
|
||||
store: {};
|
||||
|
||||
/**
|
||||
* Gets the path to the config file.
|
||||
*/
|
||||
path: string;
|
||||
|
||||
[Symbol.iterator](): Iterator<[string, string | number | boolean | symbol | {}]>;
|
||||
}
|
||||
|
||||
export = ElectronStore;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"electron-store-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json" ,
|
||||
"rules": {
|
||||
"no-namespace":false,
|
||||
"object-literal-key-quotes": false
|
||||
}
|
||||
}
|
||||
Vendored
+2
@@ -2449,6 +2449,7 @@ declare namespace Ember {
|
||||
function observersFor(obj: any, path: string): any[];
|
||||
function onLoad(name: string, callback: Function): void;
|
||||
const onError: Error;
|
||||
function onerror(error: any): void;
|
||||
function overrideChains(obj: any, keyName: string, m: any): boolean;
|
||||
// ReSharper disable once DuplicatingLocalDeclaration
|
||||
const platform: {
|
||||
@@ -2480,6 +2481,7 @@ declare namespace Ember {
|
||||
throttle(target: any, method: Function | string, ...args: any[]): void;
|
||||
queues: any[];
|
||||
};
|
||||
function runInDebug(fn: Function): void;
|
||||
function runLoadHooks(name: string, object: any): void;
|
||||
function sendEvent(obj: any, eventName: string, params?: any[], actions?: any[]): boolean;
|
||||
function set(obj: any, keyName: string, value: any): any;
|
||||
|
||||
Vendored
+2
-2
@@ -15,7 +15,7 @@ import { ReactElement, Component, HTMLAttributes as ReactHTMLAttributes, SVGAttr
|
||||
|
||||
export type HTMLAttributes = ReactHTMLAttributes<{}> & ReactSVGAttributes<{}>;
|
||||
|
||||
export class ElementClass extends Component<any> {
|
||||
export class ElementClass extends Component<any, any> {
|
||||
}
|
||||
|
||||
/* These are purposefully stripped down versions of React.ComponentClass and React.StatelessComponent.
|
||||
@@ -23,7 +23,7 @@ export class ElementClass extends Component<any> {
|
||||
* all specified in the implementation. TS chooses the EnzymePropSelector overload and loses the generics
|
||||
*/
|
||||
export interface ComponentClass<Props> {
|
||||
new (props?: Props, context?: any): Component<Props>;
|
||||
new (props?: Props, context?: any): Component<Props, any>;
|
||||
}
|
||||
|
||||
export type StatelessComponent<Props> = (props: Props, context?: any) => JSX.Element;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import flash from "express-flash-2";
|
||||
|
||||
flash();
|
||||
Vendored
+57
@@ -0,0 +1,57 @@
|
||||
// Type definitions for express-flash-2 1.0
|
||||
// Project: https://github.com/jack2gs/express-flash-2
|
||||
// Definitions by: Matheus Salmi <https://github.com/mathsalmi/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace Express {
|
||||
interface Request {
|
||||
session?: Session;
|
||||
}
|
||||
|
||||
interface Session {
|
||||
flash: Flash;
|
||||
}
|
||||
|
||||
interface Flash {
|
||||
[key: string]: any[];
|
||||
}
|
||||
|
||||
interface Response {
|
||||
/**
|
||||
* Queue flash `msg` of the given `type`.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* req.flash('info', 'email sent');
|
||||
* req.flash('error', 'email delivery failed');
|
||||
* req.flash('info', 'email re-sent');
|
||||
*
|
||||
*
|
||||
* Formatting:
|
||||
*
|
||||
* Flash notifications also support arbitrary formatting support.
|
||||
* For example you may pass variable arguments to `req.flash()`
|
||||
* and use the %s specifier to be replaced by the associated argument:
|
||||
*
|
||||
* req.flash('info', 'email has been sent to %s.', userName);
|
||||
*
|
||||
* Formatting uses `util.format()`, which is available on Node 0.6+.
|
||||
*/
|
||||
flash(type: string, msg: string | any[]): void;
|
||||
|
||||
locals: {
|
||||
flash: Flash
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'express-flash-2' {
|
||||
import express = require('express');
|
||||
|
||||
/**
|
||||
* Expose `flash()` function on responses.
|
||||
*/
|
||||
function flash(): express.RequestHandler;
|
||||
|
||||
export = flash;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"express-flash-2-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-single-declare-module": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"expect": false
|
||||
}
|
||||
}
|
||||
+12
-12
@@ -239,9 +239,9 @@ interface Request extends http.IncomingMessage, Express.Request {
|
||||
* // => "json"
|
||||
*/
|
||||
accepts(): string[];
|
||||
accepts(type: string): string | boolean;
|
||||
accepts(type: string[]): string | boolean;
|
||||
accepts(...type: string[]): string | boolean;
|
||||
accepts(type: string): string | false;
|
||||
accepts(type: string[]): string | false;
|
||||
accepts(...type: string[]): string | false;
|
||||
|
||||
/**
|
||||
* Returns the first accepted charset of the specified character sets,
|
||||
@@ -252,9 +252,9 @@ interface Request extends http.IncomingMessage, Express.Request {
|
||||
* @param charset
|
||||
*/
|
||||
acceptsCharsets(): string[];
|
||||
acceptsCharsets(charset: string): string | boolean;
|
||||
acceptsCharsets(charset: string[]): string | boolean;
|
||||
acceptsCharsets(...charset: string[]): string | boolean;
|
||||
acceptsCharsets(charset: string): string | false;
|
||||
acceptsCharsets(charset: string[]): string | false;
|
||||
acceptsCharsets(...charset: string[]): string | false;
|
||||
|
||||
/**
|
||||
* Returns the first accepted encoding of the specified encodings,
|
||||
@@ -265,9 +265,9 @@ interface Request extends http.IncomingMessage, Express.Request {
|
||||
* @param encoding
|
||||
*/
|
||||
acceptsEncodings(): string[];
|
||||
acceptsEncodings(encoding: string): string | boolean;
|
||||
acceptsEncodings(encoding: string[]): string | boolean;
|
||||
acceptsEncodings(...encoding: string[]): string | boolean;
|
||||
acceptsEncodings(encoding: string): string | false;
|
||||
acceptsEncodings(encoding: string[]): string | false;
|
||||
acceptsEncodings(...encoding: string[]): string | false;
|
||||
|
||||
/**
|
||||
* Returns the first accepted language of the specified languages,
|
||||
@@ -279,9 +279,9 @@ interface Request extends http.IncomingMessage, Express.Request {
|
||||
* @param lang
|
||||
*/
|
||||
acceptsLanguages(): string[];
|
||||
acceptsLanguages(lang: string): string | boolean;
|
||||
acceptsLanguages(lang: string[]): string | boolean;
|
||||
acceptsLanguages(...lang: string[]): string | boolean;
|
||||
acceptsLanguages(lang: string): string | false;
|
||||
acceptsLanguages(lang: string[]): string | false;
|
||||
acceptsLanguages(...lang: string[]): string | false;
|
||||
|
||||
/**
|
||||
* Parse Range header field,
|
||||
|
||||
@@ -51,22 +51,22 @@ namespace express_tests {
|
||||
router.route('/users')
|
||||
.get((req, res, next) => {
|
||||
let types: string[] = req.accepts();
|
||||
let type: string | boolean = req.accepts('json');
|
||||
let type: string | false = req.accepts('json');
|
||||
type = req.accepts(['json', 'text']);
|
||||
type = req.accepts('json', 'text');
|
||||
|
||||
let charsets: string[] = req.acceptsCharsets();
|
||||
let charset: string | boolean = req.acceptsCharsets('utf-8');
|
||||
let charset: string | false = req.acceptsCharsets('utf-8');
|
||||
charset = req.acceptsCharsets(['utf-8', 'utf-16']);
|
||||
charset = req.acceptsCharsets('utf-8', 'utf-16');
|
||||
|
||||
let encodings: string[] = req.acceptsEncodings();
|
||||
let encoding: string | boolean = req.acceptsEncodings('gzip');
|
||||
let encoding: string | false = req.acceptsEncodings('gzip');
|
||||
encoding = req.acceptsEncodings(['gzip', 'deflate']);
|
||||
encoding = req.acceptsEncodings('gzip', 'deflate');
|
||||
|
||||
let languages: string[] = req.acceptsLanguages();
|
||||
let language: string | boolean = req.acceptsLanguages('en');
|
||||
let language: string | false = req.acceptsLanguages('en');
|
||||
language = req.acceptsLanguages(['en', 'ja']);
|
||||
language = req.acceptsLanguages('en', 'ja');
|
||||
|
||||
|
||||
@@ -60,3 +60,8 @@ fetchMock
|
||||
fetchMock
|
||||
.mock("http://test.com", 200)
|
||||
.spy();
|
||||
|
||||
const myMatcher: fetchMock.MockMatcherFunction = (
|
||||
url: string,
|
||||
opts: fetchMock.MockRequest
|
||||
) => true;
|
||||
|
||||
Vendored
+380
-378
@@ -4,395 +4,397 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
type MockRequest = Request | RequestInit;
|
||||
declare namespace fetchMock {
|
||||
type MockRequest = Request | RequestInit;
|
||||
|
||||
/**
|
||||
* Mock matcher function
|
||||
* @param url
|
||||
* @param opts
|
||||
*/
|
||||
type MockMatcherFunction = (url: string, opts: MockRequest) => boolean;
|
||||
/**
|
||||
* Mock matcher. Can be one of following:
|
||||
* string: Either
|
||||
* * an exact url to match e.g. 'http://www.site.com/page.html'
|
||||
* * if the string begins with a `^`, the string following the `^` must
|
||||
* begin the url e.g. '^http://www.site.com' would match
|
||||
* 'http://www.site.com' or 'http://www.site.com/page.html'
|
||||
* * '*' to match any url
|
||||
* RegExp: A regular expression to test the url against
|
||||
* Function(url, opts): A function (returning a Boolean) that is passed the
|
||||
* url and opts fetch() is called with (or, if fetch() was called with one,
|
||||
* the Request instance)
|
||||
*/
|
||||
type MockMatcher = string | RegExp | MockMatcherFunction;
|
||||
/**
|
||||
* Mock matcher function
|
||||
* @param url
|
||||
* @param opts
|
||||
*/
|
||||
type MockMatcherFunction = (url: string, opts: MockRequest) => boolean;
|
||||
/**
|
||||
* Mock matcher. Can be one of following:
|
||||
* string: Either
|
||||
* * an exact url to match e.g. 'http://www.site.com/page.html'
|
||||
* * if the string begins with a `^`, the string following the `^` must
|
||||
* begin the url e.g. '^http://www.site.com' would match
|
||||
* 'http://www.site.com' or 'http://www.site.com/page.html'
|
||||
* * '*' to match any url
|
||||
* RegExp: A regular expression to test the url against
|
||||
* Function(url, opts): A function (returning a Boolean) that is passed the
|
||||
* url and opts fetch() is called with (or, if fetch() was called with one,
|
||||
* the Request instance)
|
||||
*/
|
||||
type MockMatcher = string | RegExp | MockMatcherFunction;
|
||||
|
||||
/**
|
||||
* Mock response object
|
||||
*/
|
||||
interface MockResponseObject {
|
||||
/**
|
||||
* Set the response body
|
||||
* Mock response object
|
||||
*/
|
||||
body?: string | {};
|
||||
interface MockResponseObject {
|
||||
/**
|
||||
* Set the response body
|
||||
*/
|
||||
body?: string | {};
|
||||
/**
|
||||
* Set the response status
|
||||
* @default 200
|
||||
*/
|
||||
status?: number;
|
||||
/**
|
||||
* Set the response headers.
|
||||
*/
|
||||
headers?: { [key: string]: string };
|
||||
/**
|
||||
* If this property is present then a Promise rejected with the value
|
||||
* of throws is returned
|
||||
*/
|
||||
throws?: boolean;
|
||||
/**
|
||||
* This property determines whether or not the request body should be
|
||||
* JSON.stringified before being sent
|
||||
* @default true
|
||||
*/
|
||||
sendAsJson?: boolean;
|
||||
}
|
||||
/**
|
||||
* Set the response status
|
||||
* @default 200
|
||||
* Response: A Response instance - will be used unaltered
|
||||
* number: Creates a response with this status
|
||||
* string: Creates a 200 response with the string as the response body
|
||||
* object: As long as the object is not a MockResponseObject it is
|
||||
* converted into a json string and returned as the body of a 200 response
|
||||
* If MockResponseObject was given then it's used to configure response
|
||||
* Function(url, opts): A function that is passed the url and opts fetch()
|
||||
* is called with and that returns any of the responses listed above
|
||||
*/
|
||||
status?: number;
|
||||
type MockResponse = Response | Promise<Response>
|
||||
| number | Promise<number>
|
||||
| string | Promise<string>
|
||||
| {} | Promise<{}>
|
||||
| MockResponseObject | Promise<MockResponseObject>;
|
||||
/**
|
||||
* Set the response headers.
|
||||
* Mock response function
|
||||
* @param url
|
||||
* @param opts
|
||||
*/
|
||||
headers?: { [key: string]: string };
|
||||
/**
|
||||
* If this property is present then a Promise rejected with the value
|
||||
* of throws is returned
|
||||
*/
|
||||
throws?: boolean;
|
||||
/**
|
||||
* This property determines whether or not the request body should be
|
||||
* JSON.stringified before being sent
|
||||
* @default true
|
||||
*/
|
||||
sendAsJson?: boolean;
|
||||
}
|
||||
/**
|
||||
* Response: A Response instance - will be used unaltered
|
||||
* number: Creates a response with this status
|
||||
* string: Creates a 200 response with the string as the response body
|
||||
* object: As long as the object is not a MockResponseObject it is
|
||||
* converted into a json string and returned as the body of a 200 response
|
||||
* If MockResponseObject was given then it's used to configure response
|
||||
* Function(url, opts): A function that is passed the url and opts fetch()
|
||||
* is called with and that returns any of the responses listed above
|
||||
*/
|
||||
type MockResponse = Response | Promise<Response>
|
||||
| number | Promise<number>
|
||||
| string | Promise<string>
|
||||
| {} | Promise<{}>
|
||||
| MockResponseObject | Promise<MockResponseObject>;
|
||||
/**
|
||||
* Mock response function
|
||||
* @param url
|
||||
* @param opts
|
||||
*/
|
||||
type MockResponseFunction = (url: string, opts: MockRequest) => MockResponse;
|
||||
type MockResponseFunction = (url: string, opts: MockRequest) => MockResponse;
|
||||
|
||||
/**
|
||||
* Mock options object
|
||||
*/
|
||||
interface MockOptions {
|
||||
/**
|
||||
* A unique string naming the route. Used to subsequently retrieve
|
||||
* references to the calls, grouped by name.
|
||||
* @default matcher.toString()
|
||||
*
|
||||
* Note: If a non-unique name is provided no error will be thrown
|
||||
* (because names are optional, auto-generated ones may legitimately
|
||||
* clash)
|
||||
* Mock options object
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* http method to match
|
||||
*/
|
||||
method?: string;
|
||||
/**
|
||||
* as specified above
|
||||
*/
|
||||
matcher?: MockMatcher;
|
||||
/**
|
||||
* as specified above
|
||||
*/
|
||||
response?: MockResponse | MockResponseFunction;
|
||||
/**
|
||||
* integer, n, limiting the number of times the matcher can be used.
|
||||
* If the route has already been called n times the route will be
|
||||
* ignored and the call to fetch() will fall through to be handled by
|
||||
* any other routes defined (which may eventually result in an error
|
||||
* if nothing matches it).
|
||||
*/
|
||||
times?: number;
|
||||
interface MockOptions {
|
||||
/**
|
||||
* A unique string naming the route. Used to subsequently retrieve
|
||||
* references to the calls, grouped by name.
|
||||
* @default matcher.toString()
|
||||
*
|
||||
* Note: If a non-unique name is provided no error will be thrown
|
||||
* (because names are optional, auto-generated ones may legitimately
|
||||
* clash)
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* http method to match
|
||||
*/
|
||||
method?: string;
|
||||
/**
|
||||
* as specified above
|
||||
*/
|
||||
matcher?: MockMatcher;
|
||||
/**
|
||||
* as specified above
|
||||
*/
|
||||
response?: MockResponse | MockResponseFunction;
|
||||
/**
|
||||
* integer, n, limiting the number of times the matcher can be used.
|
||||
* If the route has already been called n times the route will be
|
||||
* ignored and the call to fetch() will fall through to be handled by
|
||||
* any other routes defined (which may eventually result in an error
|
||||
* if nothing matches it).
|
||||
*/
|
||||
times?: number;
|
||||
}
|
||||
|
||||
type MockCall = [string, MockRequest];
|
||||
|
||||
interface MatchedRoutes {
|
||||
matched: MockCall[];
|
||||
unmatched: MockCall[];
|
||||
}
|
||||
|
||||
interface MockOptionsMethodGet extends MockOptions {
|
||||
method: 'GET';
|
||||
}
|
||||
|
||||
interface MockOptionsMethodPost extends MockOptions {
|
||||
method: 'POST';
|
||||
}
|
||||
|
||||
interface MockOptionsMethodPut extends MockOptions {
|
||||
method: 'PUT';
|
||||
}
|
||||
|
||||
interface MockOptionsMethodDelete extends MockOptions {
|
||||
method: 'DELETE';
|
||||
}
|
||||
|
||||
interface MockOptionsMethodHead extends MockOptions {
|
||||
method: 'HEAD';
|
||||
}
|
||||
|
||||
interface FetchMockStatic {
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Calls to .mock() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
mock(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options?: MockOptions): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Calls to .mock() can be chained.
|
||||
* @param options The route to mock
|
||||
*/
|
||||
mock(options: MockOptions): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() limited to being
|
||||
* called one time only. Calls to .once() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Optional additional properties defining the route to mock
|
||||
*/
|
||||
once(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options?: MockOptions): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the GET
|
||||
* method. Calls to .get() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
get(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodGet): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the GET
|
||||
* method and limited to being called one time only. Calls to .getOnce()
|
||||
* can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
getOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodGet): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the POST
|
||||
* method. Calls to .post() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
post(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPost): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the POST
|
||||
* method and limited to being called one time only. Calls to .postOnce()
|
||||
* can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
postOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPost): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the PUT
|
||||
* method. Calls to .put() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
put(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPut): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the PUT
|
||||
* method and limited to being called one time only. Calls to .putOnce()
|
||||
* can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
putOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPut): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the
|
||||
* DELETE method. Calls to .delete() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
delete(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodDelete): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the
|
||||
* DELETE method and limited to being called one time only. Calls to
|
||||
* .deleteOnce() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
deleteOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodDelete): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the HEAD
|
||||
* method. Calls to .head() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
head(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the HEAD
|
||||
* method and limited to being called one time only. Calls to .headOnce()
|
||||
* can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
headOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the PATCH
|
||||
* method. Calls to .patch() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
patch(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the PATCH
|
||||
* method and limited to being called one time only. Calls to .patchOnce()
|
||||
* can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
patchOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this;
|
||||
|
||||
/**
|
||||
* Chainable method that defines how to respond to calls to fetch that
|
||||
* don't match any of the defined mocks. It accepts the same types of
|
||||
* response as a normal call to .mock(matcher, response). It can also
|
||||
* take an arbitrary function to completely customise behaviour of
|
||||
* unmatched calls. If .catch() is called without any parameters then
|
||||
* every unmatched call will receive a 200 response.
|
||||
* @param [response] Configures the http response returned by the mock
|
||||
*/
|
||||
catch(response?: MockResponse | MockResponseFunction): this;
|
||||
|
||||
/**
|
||||
* Chainable method that records the call history of unmatched calls,
|
||||
* but instead of responding with a stubbed response, the request is
|
||||
* passed through to native fetch() and is allowed to communicate
|
||||
* over the network. Similar to catch().
|
||||
*/
|
||||
spy(response?: MockResponse | MockResponseFunction): this;
|
||||
|
||||
/**
|
||||
* Chainable method that restores fetch() to its unstubbed state and
|
||||
* clears all data recorded for its calls.
|
||||
*/
|
||||
restore(): this;
|
||||
|
||||
/**
|
||||
* Chainable method that clears all data recorded for fetch()'s calls
|
||||
*/
|
||||
reset(): this;
|
||||
|
||||
/**
|
||||
* Returns all calls to fetch, grouped by whether fetch-mock matched
|
||||
* them or not.
|
||||
*/
|
||||
calls(): MatchedRoutes;
|
||||
/**
|
||||
* Returns all calls to fetch matching matcherName.
|
||||
*/
|
||||
calls(matcherName?: string): MockCall[];
|
||||
|
||||
/**
|
||||
* Returns a Boolean indicating whether fetch was called and a route
|
||||
* was matched (or a specific route if matcherName is passed).
|
||||
* @param [matcherName] either the name of a route or equal to
|
||||
* matcher.toString() for any unnamed route
|
||||
*/
|
||||
called(matcherName?: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns a Boolean indicating whether fetch was called the expected
|
||||
* number of times (or at least once if the route defines no expectation
|
||||
* is set) for every route (or for a specific route if matcherName is
|
||||
* passed).
|
||||
* @param [matcherName] either the name of a route or equal to
|
||||
* matcher.toString() for any unnamed route
|
||||
*/
|
||||
done(matcherName?: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns the arguments for the last matched call to fetch (or the
|
||||
* last call to specific route is matcherName is passed).
|
||||
* @param [matcherName] either the name of a route or equal to
|
||||
* matcher.toString() for any unnamed route
|
||||
*/
|
||||
lastCall(matcherName?: string): MockCall;
|
||||
|
||||
/**
|
||||
* Returns the url for the last matched call to fetch (or the last
|
||||
* call to specific route is matcherName is passed).
|
||||
* @param [matcherName] either the name of a route or equal to
|
||||
* matcher.toString() for any unnamed route
|
||||
*/
|
||||
lastUrl(matcherName?: string): string;
|
||||
|
||||
/**
|
||||
* Returns the options for the last matched call to fetch (or the
|
||||
* last call to a specific route is matcherName is passed).
|
||||
* @param [matcherName] either the name of a route or equal to
|
||||
* matcher.toString() for any unnamed route
|
||||
*/
|
||||
lastOptions(matcherName?: string): MockRequest;
|
||||
|
||||
/**
|
||||
* Set some global config options, which include
|
||||
* sendAsJson [default `true`] - by default fetchMock will
|
||||
* convert objects to JSON before sending. This is overrideable
|
||||
* for each call but for some scenarios, e.g. when dealing with a
|
||||
* lot of array buffers, it can be useful to default to `false`
|
||||
*/
|
||||
configure(opts: {}): void;
|
||||
}
|
||||
}
|
||||
|
||||
type MockCall = [string, MockRequest];
|
||||
|
||||
interface MatchedRoutes {
|
||||
matched: MockCall[];
|
||||
unmatched: MockCall[];
|
||||
}
|
||||
|
||||
interface MockOptionsMethodGet extends MockOptions {
|
||||
method: 'GET';
|
||||
}
|
||||
|
||||
interface MockOptionsMethodPost extends MockOptions {
|
||||
method: 'POST';
|
||||
}
|
||||
|
||||
interface MockOptionsMethodPut extends MockOptions {
|
||||
method: 'PUT';
|
||||
}
|
||||
|
||||
interface MockOptionsMethodDelete extends MockOptions {
|
||||
method: 'DELETE';
|
||||
}
|
||||
|
||||
interface MockOptionsMethodHead extends MockOptions {
|
||||
method: 'HEAD';
|
||||
}
|
||||
|
||||
interface FetchMockStatic {
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Calls to .mock() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
mock(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options?: MockOptions): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Calls to .mock() can be chained.
|
||||
* @param options The route to mock
|
||||
*/
|
||||
mock(options: MockOptions): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() limited to being
|
||||
* called one time only. Calls to .once() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Optional additional properties defining the route to mock
|
||||
*/
|
||||
once(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options?: MockOptions): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the GET
|
||||
* method. Calls to .get() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
get(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodGet): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the GET
|
||||
* method and limited to being called one time only. Calls to .getOnce()
|
||||
* can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
getOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodGet): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the POST
|
||||
* method. Calls to .post() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
post(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPost): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the POST
|
||||
* method and limited to being called one time only. Calls to .postOnce()
|
||||
* can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
postOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPost): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the PUT
|
||||
* method. Calls to .put() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
put(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPut): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the PUT
|
||||
* method and limited to being called one time only. Calls to .putOnce()
|
||||
* can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
putOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPut): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the
|
||||
* DELETE method. Calls to .delete() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
delete(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodDelete): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the
|
||||
* DELETE method and limited to being called one time only. Calls to
|
||||
* .deleteOnce() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
deleteOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodDelete): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the HEAD
|
||||
* method. Calls to .head() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
head(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the HEAD
|
||||
* method and limited to being called one time only. Calls to .headOnce()
|
||||
* can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
headOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this;
|
||||
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the PATCH
|
||||
* method. Calls to .patch() can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
patch(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this;
|
||||
/**
|
||||
* Replaces fetch() with a stub which records its calls, grouped by
|
||||
* route, and optionally returns a mocked Response object or passes the
|
||||
* call through to fetch(). Shorthand for mock() restricted to the PATCH
|
||||
* method and limited to being called one time only. Calls to .patchOnce()
|
||||
* can be chained.
|
||||
* @param matcher Condition for selecting which requests to mock
|
||||
* @param response Configures the http response returned by the mock
|
||||
* @param [options] Additional properties defining the route to mock
|
||||
*/
|
||||
patchOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this;
|
||||
|
||||
/**
|
||||
* Chainable method that defines how to respond to calls to fetch that
|
||||
* don't match any of the defined mocks. It accepts the same types of
|
||||
* response as a normal call to .mock(matcher, response). It can also
|
||||
* take an arbitrary function to completely customise behaviour of
|
||||
* unmatched calls. If .catch() is called without any parameters then
|
||||
* every unmatched call will receive a 200 response.
|
||||
* @param [response] Configures the http response returned by the mock
|
||||
*/
|
||||
catch(response?: MockResponse | MockResponseFunction): this;
|
||||
|
||||
/**
|
||||
* Chainable method that records the call history of unmatched calls,
|
||||
* but instead of responding with a stubbed response, the request is
|
||||
* passed through to native fetch() and is allowed to communicate
|
||||
* over the network. Similar to catch().
|
||||
*/
|
||||
spy(response?: MockResponse | MockResponseFunction): this;
|
||||
|
||||
/**
|
||||
* Chainable method that restores fetch() to its unstubbed state and
|
||||
* clears all data recorded for its calls.
|
||||
*/
|
||||
restore(): this;
|
||||
|
||||
/**
|
||||
* Chainable method that clears all data recorded for fetch()'s calls
|
||||
*/
|
||||
reset(): this;
|
||||
|
||||
/**
|
||||
* Returns all calls to fetch, grouped by whether fetch-mock matched
|
||||
* them or not.
|
||||
*/
|
||||
calls(): MatchedRoutes;
|
||||
/**
|
||||
* Returns all calls to fetch matching matcherName.
|
||||
*/
|
||||
calls(matcherName?: string): MockCall[];
|
||||
|
||||
/**
|
||||
* Returns a Boolean indicating whether fetch was called and a route
|
||||
* was matched (or a specific route if matcherName is passed).
|
||||
* @param [matcherName] either the name of a route or equal to
|
||||
* matcher.toString() for any unnamed route
|
||||
*/
|
||||
called(matcherName?: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns a Boolean indicating whether fetch was called the expected
|
||||
* number of times (or at least once if the route defines no expectation
|
||||
* is set) for every route (or for a specific route if matcherName is
|
||||
* passed).
|
||||
* @param [matcherName] either the name of a route or equal to
|
||||
* matcher.toString() for any unnamed route
|
||||
*/
|
||||
done(matcherName?: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns the arguments for the last matched call to fetch (or the
|
||||
* last call to specific route is matcherName is passed).
|
||||
* @param [matcherName] either the name of a route or equal to
|
||||
* matcher.toString() for any unnamed route
|
||||
*/
|
||||
lastCall(matcherName?: string): MockCall;
|
||||
|
||||
/**
|
||||
* Returns the url for the last matched call to fetch (or the last
|
||||
* call to specific route is matcherName is passed).
|
||||
* @param [matcherName] either the name of a route or equal to
|
||||
* matcher.toString() for any unnamed route
|
||||
*/
|
||||
lastUrl(matcherName?: string): string;
|
||||
|
||||
/**
|
||||
* Returns the options for the last matched call to fetch (or the
|
||||
* last call to a specific route is matcherName is passed).
|
||||
* @param [matcherName] either the name of a route or equal to
|
||||
* matcher.toString() for any unnamed route
|
||||
*/
|
||||
lastOptions(matcherName?: string): MockRequest;
|
||||
|
||||
/**
|
||||
* Set some global config options, which include
|
||||
* sendAsJson [default `true`] - by default fetchMock will
|
||||
* convert objects to JSON before sending. This is overrideable
|
||||
* for each call but for some scenarios, e.g. when dealing with a
|
||||
* lot of array buffers, it can be useful to default to `false`
|
||||
*/
|
||||
configure(opts: {}): void;
|
||||
}
|
||||
|
||||
declare var fetchMock: FetchMockStatic;
|
||||
declare var fetchMock: fetchMock.FetchMockStatic;
|
||||
export = fetchMock;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
$(document).foundation();
|
||||
$(document).foundation('method5');
|
||||
$(document).foundation(['method', 'method2']);
|
||||
$(document).foundation('method', 'method2');
|
||||
|
||||
Foundation.Abide($('.selector'));
|
||||
Foundation.Abide($('.selector'), {});
|
||||
|
||||
Vendored
+1
-1
@@ -447,7 +447,7 @@ declare namespace FoundationSites {
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
foundation(method?:string|Array<any>) : JQuery;
|
||||
foundation(method?: string, ...args: any[]): JQuery;
|
||||
}
|
||||
|
||||
declare var Foundation:FoundationSites.FoundationSitesStatic;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import * as framebus from "framebus";
|
||||
|
||||
let popup = window.open('https://example.com');
|
||||
framebus.include(popup);
|
||||
framebus.emit('hello popup and friends!');
|
||||
|
||||
framebus.target('https://example.com').on('my cool event', () => {});
|
||||
|
||||
let callback = (data: any) => {
|
||||
console.log('Got back %s as a reply!', data);
|
||||
};
|
||||
|
||||
framebus.publish('Marco!', callback, 'http://listener.example.com');
|
||||
|
||||
framebus.publish('Marco!', callback, 'http://listener.example.com');
|
||||
Vendored
+105
@@ -0,0 +1,105 @@
|
||||
// Type definitions for framebus 2.0
|
||||
// Project: https://github.com/braintree/framebus
|
||||
// Definitions by: kbukum <https://github.com/kbukum>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/*~ If this module is a UMD module that exposes a global variable 'myLib' when
|
||||
*~ loaded outside a module loader environment, declare that global here.
|
||||
*~ Otherwise, delete this declaration.
|
||||
*/
|
||||
export as namespace framebus;
|
||||
|
||||
export interface FrameBus {
|
||||
publish(event: string, ...args: any[]): boolean;
|
||||
pub(event: string, ...args: any[]): boolean;
|
||||
trigger(event: string, ...args: any[]): boolean;
|
||||
emit(event: string, ...args: any[]): boolean;
|
||||
subscribe(event: string, fn: (...args: any[]) => any): boolean;
|
||||
sub(event: string, fn: (...args: any[]) => any): boolean;
|
||||
on(event: string, fn: (...args: any[]) => any): boolean;
|
||||
unsubscribe(event: string, fn: (...args: any[]) => any): boolean;
|
||||
unsub(event: string, fn: (...args: any[]) => any): boolean;
|
||||
off(event: string, fn: (...args: any[]) => any): boolean;
|
||||
}
|
||||
/*~ If this module has methods, declare them as functions like so.
|
||||
*/
|
||||
/**
|
||||
* let popup = window.open('https://example.com');
|
||||
* framebus.include(popup);
|
||||
* framebus.emit('hello popup and friends!');
|
||||
* @param popup
|
||||
*/
|
||||
export function include(popup: Window): boolean;
|
||||
/**
|
||||
* framebus.target('https://example.com').on('my cool event', function () {});
|
||||
* // will ignore all incoming 'my cool event' NOT from 'https://example.com'
|
||||
* @param origin {string}
|
||||
*/
|
||||
export function target(origin: string): FrameBus;
|
||||
|
||||
/**
|
||||
* let callback = (data: any) => {
|
||||
* console.log('Got back %s as a reply!', data)
|
||||
* }
|
||||
* framebus.publish('Marco!', callback, 'http://listener.example.com');
|
||||
* @param event {string} The name of the event
|
||||
* @param args {...any[]} The data to give to subscribers
|
||||
* // @param last{callback(data)} Give subscribers a function for easy, direct replies
|
||||
*/
|
||||
export function publish(event: string, ...args: any[]/* fn: callback(data:)*/): boolean;
|
||||
|
||||
/**
|
||||
* publish = pub = trigger = emit
|
||||
* framebus.publish('Marco!', callback, 'http://listener.example.com');
|
||||
* @param event {string} The name of the event
|
||||
* @param args {...any[]} The data to give to subscribers
|
||||
* // @param last{callback(data)} Give subscribers a function for easy, direct replies
|
||||
*/
|
||||
export function pub(event: string, ...args: any[]): boolean;
|
||||
/**
|
||||
* publish = pub = trigger = emit
|
||||
* @param event {string} The name of the event
|
||||
* @param args {...any[]} The data to give to subscribers
|
||||
* // @param last{callback(data)} Give subscribers a function for easy, direct replies
|
||||
*/
|
||||
export function trigger(event: string, ...args: any[]): boolean;
|
||||
/**
|
||||
* publish = pub = trigger = emit
|
||||
* @param event {string} The name of the event
|
||||
* @param args {...any[]} The data to give to subscribers
|
||||
* // @param last{callback(data)} Give subscribers a function for easy, direct replies
|
||||
*/
|
||||
export function emit(event: string, ...args: any[]): boolean;
|
||||
/**
|
||||
* **this** scope is the MessageEvent object from the underlying postMessage
|
||||
* @param event {string} The name of the event
|
||||
* @param fn {Callback} ([arg...] [, callback]) Event handler. Arguments are from the publish invocation
|
||||
*/
|
||||
export function subscribe(event: string, fn: (...args: any[]) => any): boolean;
|
||||
/**
|
||||
* **this** scope is the MessageEvent object from the underlying postMessage
|
||||
* @param event {string} The name of the event
|
||||
* @param fn {Callback} ([arg...] [, callback]) Event handler. Arguments are from the publish invocation
|
||||
*/
|
||||
export function sub(event: string, fn: (...args: any[]) => any): boolean;
|
||||
/**
|
||||
* **this** scope is the MessageEvent object from the underlying postMessage
|
||||
* @param event {string} The name of the event
|
||||
* @param fn {Callback} ([arg...] [, callback]) Event handler. Arguments are from the publish invocation
|
||||
*/
|
||||
export function on(event: string, fn: (...args: any[]) => any): boolean;
|
||||
/**
|
||||
* @param event {string} The name of the event
|
||||
* @param fn {Callback} The function that was subscribed
|
||||
*/
|
||||
export function unsubscribe(event: string, fn: (...args: any[]) => any): boolean;
|
||||
/**
|
||||
* @param event {string} The name of the event
|
||||
* @param fn {Callback} The function that was subscribed
|
||||
*/
|
||||
export function unsub(event: string, fn: (...args: any[]) => any): boolean;
|
||||
/**
|
||||
* @param event {string} The name of the event
|
||||
* @param fn {Callback} The function that was subscribed
|
||||
*/
|
||||
export function off(event: string, fn: (...args: any[]) => any): boolean;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"framebus-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+1
-1
@@ -47,7 +47,7 @@ declare namespace gapi.auth2 {
|
||||
/**
|
||||
* Get permission from the user to access the specified scopes offline.
|
||||
*/
|
||||
grantOfflineAccess(options: {
|
||||
grantOfflineAccess(options?: {
|
||||
scope?: string;
|
||||
prompt?: "select_account" | "consent";
|
||||
app_package_name?: string;
|
||||
|
||||
Vendored
+2
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for google-map-react 0.22
|
||||
// Type definitions for google-map-react 0.23
|
||||
// Project: https://github.com/istarkov/google-map-react
|
||||
// Definitions by: Honza Brecka <https://github.com/honzabrecka>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -15,6 +15,7 @@ export interface Options {
|
||||
mapTypeControl?: boolean;
|
||||
minZoomOverride?: boolean;
|
||||
minZoom?: number;
|
||||
maxZoom?: number;
|
||||
gestureHandling?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Test file for Google Maps JavaScript API Definition file
|
||||
|
||||
/***** Create map *****/
|
||||
let map = new google.maps.Map(
|
||||
document.getElementById('map'), {
|
||||
let mapOptions: google.maps.MapOptions = {
|
||||
backgroundColor: "#fff",
|
||||
center: { lat: -25.363, lng: 131.044 },
|
||||
clickableIcons: true,
|
||||
@@ -13,8 +11,34 @@ let map = new google.maps.Map(
|
||||
},
|
||||
gestureHandling: "cooperative",
|
||||
scrollwheel: true,
|
||||
styles: [
|
||||
{
|
||||
elementType: 'geometry',
|
||||
featureType: 'water',
|
||||
stylers: [
|
||||
{
|
||||
color: '#00bdbd'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
elementType: 'geometry',
|
||||
featureType: 'landscape.man_made',
|
||||
stylers: [
|
||||
{
|
||||
color: '#f7f1df'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
zoom: 4
|
||||
});
|
||||
};
|
||||
|
||||
/***** Create map *****/
|
||||
let map: google.maps.Map = new google.maps.Map(
|
||||
document.getElementById('map'),
|
||||
mapOptions
|
||||
);
|
||||
|
||||
|
||||
/***** Data *****/
|
||||
@@ -329,4 +353,4 @@ heatmap.setData([new google.maps.LatLng(37.782551, -122.445368), new google.maps
|
||||
heatmap.setData([
|
||||
{ weight: 1, location: new google.maps.LatLng(37.782551, -122.445368) },
|
||||
{ weight: 2, location: new google.maps.LatLng(37.782745, -122.444586) }
|
||||
]);
|
||||
]);
|
||||
|
||||
Vendored
+49
-62
@@ -1058,7 +1058,7 @@ declare namespace google.maps {
|
||||
clickable?: boolean;
|
||||
/** If set to true, the user can drag this circle over the map. Defaults to false. */
|
||||
draggable?: boolean;
|
||||
/**
|
||||
/**
|
||||
* If set to true, the user can edit this circle by dragging the control points shown at the center and around
|
||||
* the circumference of the circle. Defaults to false.
|
||||
*/
|
||||
@@ -1719,64 +1719,51 @@ declare namespace google.maps {
|
||||
stylers?: MapTypeStyler[];
|
||||
}
|
||||
|
||||
export interface MapTypeStyleFeatureType {
|
||||
administrative?: {
|
||||
country?: string;
|
||||
land_parcel?: string;
|
||||
locality?: string;
|
||||
neighborhood?: string;
|
||||
province?: string;
|
||||
};
|
||||
all?: string;
|
||||
landscape?: {
|
||||
man_made?: string;
|
||||
natural?: {
|
||||
landcover?: string;
|
||||
terrain?: string;
|
||||
};
|
||||
};
|
||||
poi?: {
|
||||
attraction?: string;
|
||||
business?: string;
|
||||
government?: string;
|
||||
medical?: string;
|
||||
park?: string;
|
||||
place_of_worship?: string;
|
||||
school?: string;
|
||||
sports_complex?: string;
|
||||
};
|
||||
road?: {
|
||||
arterial?: string;
|
||||
highway?: {
|
||||
controlled_access?: string;
|
||||
};
|
||||
local?: string;
|
||||
};
|
||||
transit?: {
|
||||
line?: string;
|
||||
station?: {
|
||||
airport?: string;
|
||||
bus?: string;
|
||||
rail?: string;
|
||||
};
|
||||
};
|
||||
water?: string;
|
||||
}
|
||||
export type MapTypeStyleFeatureType =
|
||||
'all' |
|
||||
'administrative' |
|
||||
'administrative.country' |
|
||||
'administrative.land_parcel' |
|
||||
'administrative.locality' |
|
||||
'administrative.neighborhood' |
|
||||
'administrative.province' |
|
||||
'landscape' |
|
||||
'landscape.man_made' |
|
||||
'landscape.natural' |
|
||||
'landscape.natural.landcover' |
|
||||
'landscape.natural.terrain' |
|
||||
'poi' |
|
||||
'poi.attraction' |
|
||||
'poi.business' |
|
||||
'poi.government' |
|
||||
'poi.medical' |
|
||||
'poi.park' |
|
||||
'poi.place_of_worship' |
|
||||
'poi.school' |
|
||||
'poi.sports_complex' |
|
||||
'road' |
|
||||
'road.arterial' |
|
||||
'road.highway' |
|
||||
'road.highway.controlled_access' |
|
||||
'road.local' |
|
||||
'transit' |
|
||||
'transit.line' |
|
||||
'transit.station' |
|
||||
'transit.station.airport' |
|
||||
'transit.station.bus' |
|
||||
'transit.station.rail' |
|
||||
'water';
|
||||
|
||||
export interface MapTypeStyleElementType {
|
||||
all?: string;
|
||||
geometry?: {
|
||||
fill?: string;
|
||||
stroke?: string;
|
||||
};
|
||||
labels?: {
|
||||
icon?: string;
|
||||
text?: {
|
||||
fill?: string;
|
||||
stroke?: string;
|
||||
}
|
||||
};
|
||||
}
|
||||
export type MapTypeStyleElementType =
|
||||
'all' |
|
||||
'geometry' |
|
||||
'geometry.fill' |
|
||||
'geometry.stroke' |
|
||||
'labels' |
|
||||
'labels.icon' |
|
||||
'labels.text' |
|
||||
'labels.text.fill' |
|
||||
'labels.text.stroke';
|
||||
|
||||
export interface MapTypeStyler {
|
||||
color?: string;
|
||||
@@ -2132,7 +2119,7 @@ declare namespace google.maps {
|
||||
}
|
||||
|
||||
/**
|
||||
* This object is returned from various mouse events on the map and overlays,
|
||||
* This object is returned from various mouse events on the map and overlays,
|
||||
* and contains all the fields shown below.
|
||||
*/
|
||||
export interface MouseEvent {
|
||||
@@ -2233,7 +2220,7 @@ declare namespace google.maps {
|
||||
/** Converts to string. */
|
||||
toString(): string;
|
||||
/**
|
||||
* Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the
|
||||
* Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this bounds, where "lo" corresponds to the
|
||||
* southwest corner of the bounding box, while "hi" corresponds to the northeast corner of that box.
|
||||
*/
|
||||
toUrlValue(precision?: number): string;
|
||||
@@ -2718,7 +2705,7 @@ declare namespace google.maps {
|
||||
* and the map property of a new polygon is always set to the DrawingManager's map.
|
||||
*/
|
||||
polygonOptions?: PolygonOptions;
|
||||
/**
|
||||
/**
|
||||
* Options to apply to any new polylines created with this DrawingManager. The path property is ignored,
|
||||
* and the map property of a new polyline is always set to the DrawingManager's map.
|
||||
*/
|
||||
@@ -2749,7 +2736,7 @@ declare namespace google.maps {
|
||||
*/
|
||||
export enum OverlayType {
|
||||
/**
|
||||
* Specifies that the DrawingManager creates circles, and that the overlay given in the overlaycomplete
|
||||
* Specifies that the DrawingManager creates circles, and that the overlay given in the overlaycomplete
|
||||
* event is a circle.
|
||||
*/
|
||||
CIRCLE,
|
||||
|
||||
Vendored
+1
@@ -456,6 +456,7 @@ export interface GraphQLEnumValueConfig {
|
||||
export interface GraphQLEnumValue {
|
||||
name: string;
|
||||
description: string;
|
||||
isDeprecated?: boolean;
|
||||
deprecationReason: string;
|
||||
value: any;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ var post = { url: '/hello-world', body: 'Hello World!' };
|
||||
var context2 = { posts: [post] };
|
||||
var source2 = '<ul>{{#posts}}<li>{{{link_to this}}}</li>{{/posts}}</ul>';
|
||||
|
||||
var template2 = Handlebars.compile(source2);
|
||||
var template2: HandlebarsTemplateDelegate<{ posts: { url: string, body: string }[] }> = Handlebars.compile(source2);
|
||||
template2(context2);
|
||||
|
||||
Handlebars.registerHelper('link_to', (title: string, context: typeof post) => {
|
||||
@@ -45,14 +45,14 @@ Handlebars.registerHelper('link_to', (title: string, context: typeof post) => {
|
||||
|
||||
var context3 = { posts: [{url: '/hello-world', body: 'Hello World!'}] };
|
||||
var source3 = '<ul>{{#posts}}<li>{{{link_to "Post" this}}}</li>{{/posts}}</ul>';
|
||||
var template3 = Handlebars.compile(source3);
|
||||
var template3 = Handlebars.compile<typeof context3>(source3);
|
||||
template3(context3);
|
||||
|
||||
var source4 = '<ul>{{#people}}<li>{{#link}}{{name}}{{/link}}</li>{{/people}}</ul>';
|
||||
Handlebars.registerHelper('link', function(context: any) {
|
||||
return '<a href="/people/' + this.id + '">' + context.fn(this) + '</a>';
|
||||
});
|
||||
var template4 = Handlebars.compile(source4);
|
||||
var template4 = Handlebars.compile<{ people: { name: string, id: number }[] }>(source4);
|
||||
var data2 = { 'people': [
|
||||
{ 'name': 'Alan', 'id': 1 },
|
||||
{ 'name': 'Yehuda', 'id': 2 }
|
||||
|
||||
Vendored
+13
-5
@@ -2,7 +2,7 @@
|
||||
// Project: http://handlebarsjs.com/
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
declare namespace Handlebars {
|
||||
export function registerHelper(name: string, fn: Function, inverse?: boolean): void;
|
||||
@@ -19,9 +19,9 @@ declare namespace Handlebars {
|
||||
export function Exception(message: string): void;
|
||||
export function log(level: number, obj: any): void;
|
||||
export function parse(input: string): hbs.AST.Program;
|
||||
export function compile(input: any, options?: CompileOptions): HandlebarsTemplateDelegate;
|
||||
export function compile<T = any>(input: any, options?: CompileOptions): HandlebarsTemplateDelegate<T>;
|
||||
export function precompile(input: any, options?: PrecompileOptions): TemplateSpecification;
|
||||
export function template(precompilation: TemplateSpecification): HandlebarsTemplateDelegate;
|
||||
export function template<T = any>(precompilation: TemplateSpecification): HandlebarsTemplateDelegate<T>;
|
||||
|
||||
export function create(): typeof Handlebars;
|
||||
|
||||
@@ -96,8 +96,8 @@ interface HandlebarsTemplatable {
|
||||
template: HandlebarsTemplateDelegate;
|
||||
}
|
||||
|
||||
interface HandlebarsTemplateDelegate {
|
||||
(context: any, options?: any): string;
|
||||
interface HandlebarsTemplateDelegate<T = any> {
|
||||
(context: T, options?: RuntimeOptions): string;
|
||||
}
|
||||
|
||||
interface HandlebarsTemplates {
|
||||
@@ -108,6 +108,14 @@ interface TemplateSpecification {
|
||||
|
||||
}
|
||||
|
||||
interface RuntimeOptions {
|
||||
partial?: boolean;
|
||||
depths?: any[];
|
||||
helpers?: { [name: string]: Function }
|
||||
partials?: { [name: string]: HandlebarsTemplateDelegate }
|
||||
decorators?: { [name: string]: Function }
|
||||
}
|
||||
|
||||
interface CompileOptions {
|
||||
data?: boolean;
|
||||
compat?: boolean;
|
||||
|
||||
@@ -160,3 +160,16 @@ enterprieseRouter.calculateIsoline(
|
||||
console.log(error);
|
||||
}
|
||||
);
|
||||
|
||||
// Create a clustering provider
|
||||
const clusteredDataProvider = new H.clustering.Provider([], {
|
||||
clusteringOptions: {
|
||||
// Maximum radius of the neighborhood
|
||||
eps: 64,
|
||||
// minimum weight of points required to form a cluster
|
||||
minWeight: 3
|
||||
}
|
||||
});
|
||||
|
||||
// Create a layer that will consume objects from our clustering provider
|
||||
const layer = new H.map.layer.ObjectLayer(clusteredDataProvider);
|
||||
|
||||
Vendored
+19
-6
@@ -2938,7 +2938,7 @@ declare namespace H {
|
||||
* @param provider {H.map.provider.ObjectProvider} - the ObjectProvider which provides the map objects to this object layer.
|
||||
* @param opt_options {H.map.layer.ObjectLayer.Options=} - The options for this layer
|
||||
*/
|
||||
constructor(provider: H.map.provider.ObjectProvider, opt_options?: H.map.layer.ObjectLayer.Options);
|
||||
constructor(provider: H.map.provider.ObjectProvider | H.clustering.Provider, opt_options?: H.map.layer.ObjectLayer.Options);
|
||||
|
||||
/**
|
||||
* This method returns current ObjectLayer's data provider
|
||||
@@ -4017,6 +4017,17 @@ declare namespace H {
|
||||
type Options = any;
|
||||
}
|
||||
|
||||
/**
|
||||
* This property specifies collection of pre-configured HERE layers
|
||||
*/
|
||||
interface DefaultLayers {
|
||||
normal: H.service.MapType;
|
||||
satellite: H.service.MapType;
|
||||
terrain: H.service.MapType;
|
||||
incidents: H.map.layer.MarkerTileLayer;
|
||||
venues: H.map.layer.TileLayer;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class encapsulates Enterprise Routing REST API as a service stub. An instance of this class can be retrieved by calling the factory method on a platform instance.
|
||||
* H.service.Platform#getEnterpriseRoutingService.
|
||||
@@ -4473,17 +4484,19 @@ declare namespace H {
|
||||
/**
|
||||
* This method creates a pre-configured set of HERE tile layers for convenient use with the map.
|
||||
* @param opt_tileSize {(H.service.Platform.DefaultLayersOptions | number)=} - When a number – optional tile size to be queried from the HERE Map Tile API, default is 256.
|
||||
* If theparameter is an object, then it represents options and all remaining below parameters should be omitted.
|
||||
* If this parameter is a number, it indicates the tile size to be queried from the HERE Map Tile API (the default value is 256); if this parameter is an object, it represents
|
||||
* configuration options for the layer and all the remaining parameters (below) should be omitted
|
||||
* @param opt_ppi {number=} - optional 'ppi' parameter to use when querying tiles, default is not specified
|
||||
* @param opt_lang {string=} - optional primary language parameter, default is not specified
|
||||
* @param opt_secondaryLang {string=} - optional secondary language parameter, default is not specified
|
||||
* @param opt_style {string=} - optional 'style' parameter to use when querying map tiles, default is not specified
|
||||
* @param opt_pois {(string | boolean)=} - indicates if pois are displayed on the map. Pass true to indicate that all pois should be visible. Alternatively you can specify mask for the
|
||||
* POI Categories as described at the Map Tile API documentation POI Categories chapter.
|
||||
* @returns {Object<string, H.service.MapType>} - a set of tile layers ready to use
|
||||
* @returns {H.service.DefaultLayers} - a set of tile layers ready to use
|
||||
*/
|
||||
createDefaultLayers(opt_tileSize?: (H.service.Platform.DefaultLayersOptions | number), opt_ppi?: number, opt_lang?: string, opt_secondaryLang?: string, opt_style?: string,
|
||||
opt_pois?: (string | boolean)): H.service.Platform.MapTypes;
|
||||
createDefaultLayers(opt_tileSize?: (H.service.Platform.DefaultLayersOptions | number), opt_ppi?: number,
|
||||
opt_lang?: string, opt_secondaryLang?: string, opt_style?: string,
|
||||
opt_pois?: (string | boolean)): H.service.DefaultLayers;
|
||||
|
||||
/**
|
||||
* This method returns an instance of H.service.RoutingService to query the Routing API.
|
||||
@@ -5681,7 +5694,7 @@ declare namespace H {
|
||||
* @param opt_locale {(H.ui.i18n.Localization | string)=} - the language to use (or a full localization object).
|
||||
* @returns {H.ui.UI} - the UI instance configured with the default controls
|
||||
*/
|
||||
static createDefault(map: H.Map, mapTypes: H.service.Platform.MapTypes, opt_locale?: H.ui.i18n.Localization | string): UI;
|
||||
static createDefault(map: H.Map, mapTypes: H.service.Platform.MapTypes | H.service.DefaultLayers, opt_locale?: H.ui.i18n.Localization | string): H.ui.UI;
|
||||
|
||||
/**
|
||||
* This method is used to capture the element view
|
||||
|
||||
Vendored
+12
-12
@@ -757,39 +757,39 @@ declare namespace Hls {
|
||||
* Half of the estimate is based on the last abrEwmaSlowLive seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than abrEwmaFastLive
|
||||
*/
|
||||
arbEwmaSlowLive: number;
|
||||
abrEwmaSlowLive: number;
|
||||
/**
|
||||
* (default: 4.0)
|
||||
* Fast bitrate Exponential moving average half-life, used to compute average bitrate for VoD streams.
|
||||
* Half of the estimate is based on the last abrEwmaFastVoD seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than 0
|
||||
*/
|
||||
arbEwmaFastVod: number;
|
||||
abrEwmaFastVod: number;
|
||||
/**
|
||||
* (default: 15.0)
|
||||
* Slow bitrate Exponential moving average half-life, used to compute average bitrate for VoD streams.
|
||||
* Half of the estimate is based on the last abrEwmaSlowVoD seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than abrEwmaFastVoD
|
||||
*/
|
||||
arbEwmaSlowVod: number;
|
||||
abrEwmaSlowVod: number;
|
||||
/**
|
||||
* (default: 500000)
|
||||
* Default bandwidth estimate in bits/second prior to collecting fragment bandwidth samples.
|
||||
* parameter should be a float
|
||||
*/
|
||||
arbEwmaDefaultEstimate: number;
|
||||
abrEwmaDefaultEstimate: number;
|
||||
/**
|
||||
* (default: 0.8)
|
||||
* Scale factor to be applied against measured bandwidth average, to determine whether we can stay on current or lower quality level.
|
||||
* If abrBandWidthFactor * bandwidth average < level.bitrate then ABR can switch to that level providing that it is equal or less than current level.
|
||||
*/
|
||||
arbBandWidthFactor: number;
|
||||
abrBandWidthFactor: number;
|
||||
/**
|
||||
* (default: 0.7)
|
||||
* Scale factor to be applied against measured bandwidth average, to determine whether we can switch up to a higher quality level.
|
||||
* If abrBandWidthUpFactor * bandwidth average < level.bitrate then ABR can switch up to that quality level.
|
||||
*/
|
||||
arbBandWidthUpFactor: number;
|
||||
abrBandWidthUpFactor: number;
|
||||
/**
|
||||
* (default: false)
|
||||
* max bitrate used in ABR by avg measured bitrate i.e. if bitrate signaled in variant manifest for a given level is 2Mb/s but average bitrate measured on this level is 2.5Mb/s,
|
||||
@@ -1161,39 +1161,39 @@ declare namespace Hls {
|
||||
* Half of the estimate is based on the last abrEwmaSlowLive seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than abrEwmaFastLive
|
||||
*/
|
||||
arbEwmaSlowLive?: number;
|
||||
abrEwmaSlowLive?: number;
|
||||
/**
|
||||
* (default: 4.0)
|
||||
* Fast bitrate Exponential moving average half-life, used to compute average bitrate for VoD streams.
|
||||
* Half of the estimate is based on the last abrEwmaFastVoD seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than 0
|
||||
*/
|
||||
arbEwmaFastVod?: number;
|
||||
abrEwmaFastVod?: number;
|
||||
/**
|
||||
* (default: 15.0)
|
||||
* Slow bitrate Exponential moving average half-life, used to compute average bitrate for VoD streams.
|
||||
* Half of the estimate is based on the last abrEwmaSlowVoD seconds of sample history. Each of the sample is weighted by the fragment loading duration.
|
||||
* parameter should be a float greater than abrEwmaFastVoD
|
||||
*/
|
||||
arbEwmaSlowVod?: number;
|
||||
abrEwmaSlowVod?: number;
|
||||
/**
|
||||
* (default: 500000)
|
||||
* Default bandwidth estimate in bits/second prior to collecting fragment bandwidth samples.
|
||||
* parameter should be a float
|
||||
*/
|
||||
arbEwmaDefaultEstimate?: number;
|
||||
abrEwmaDefaultEstimate?: number;
|
||||
/**
|
||||
* (default: 0.8)
|
||||
* Scale factor to be applied against measured bandwidth average, to determine whether we can stay on current or lower quality level.
|
||||
* If abrBandWidthFactor * bandwidth average < level.bitrate then ABR can switch to that level providing that it is equal or less than current level.
|
||||
*/
|
||||
arbBandWidthFactor?: number;
|
||||
abrBandWidthFactor?: number;
|
||||
/**
|
||||
* (default: 0.7)
|
||||
* Scale factor to be applied against measured bandwidth average, to determine whether we can switch up to a higher quality level.
|
||||
* If abrBandWidthUpFactor * bandwidth average < level.bitrate then ABR can switch up to that quality level.
|
||||
*/
|
||||
arbBandWidthUpFactor?: number;
|
||||
abrBandWidthUpFactor?: number;
|
||||
/**
|
||||
* (default: false)
|
||||
* max bitrate used in ABR by avg measured bitrate i.e. if bitrate signaled in variant manifest for a given level is 2Mb/s but average bitrate measured on this level is 2.5Mb/s,
|
||||
|
||||
@@ -1,31 +1,40 @@
|
||||
import * as i18next from 'i18next';
|
||||
import LngDetector from 'i18next-browser-languagedetector';
|
||||
import * as i18next from "i18next";
|
||||
import * as LngDetector from "i18next-browser-languagedetector";
|
||||
|
||||
var options = {
|
||||
const options: LngDetector.DetectorOptions = {
|
||||
// order and from where user language should be detected
|
||||
order: ['querystring', 'cookie', 'localStorage', 'navigator'],
|
||||
order: ["querystring", "cookie", "localStorage", "navigator", "htmlTag"],
|
||||
|
||||
// keys or params to lookup language from
|
||||
lookupQuerystring: 'lng',
|
||||
lookupCookie: 'i18next',
|
||||
lookupLocalStorage: 'i18nextLng',
|
||||
lookupQuerystring: "lng",
|
||||
lookupCookie: "i18next",
|
||||
lookupLocalStorage: "i18nextLng",
|
||||
|
||||
// cache user language on
|
||||
caches: ['localStorage', 'cookie'],
|
||||
caches: ["localStorage", "cookie"],
|
||||
excludeCacheFor: ["cimode"], // languages to not persist (cookie, localStorage)
|
||||
|
||||
// optional expire and domain for set cookie
|
||||
cookieMinutes: 10,
|
||||
cookieDomain: 'myDomain'
|
||||
};
|
||||
var myDetector = {
|
||||
name: 'myDetectorsName',
|
||||
cookieDomain: "myDomain",
|
||||
|
||||
lookup(options: Object) {
|
||||
// optional htmlTag with lang attribute, the default is:
|
||||
htmlTag: document.documentElement
|
||||
};
|
||||
|
||||
i18next.use(LngDetector).init({
|
||||
detection: options
|
||||
});
|
||||
|
||||
const customDetector: LngDetector.CustomDetector = {
|
||||
name: "myDetectorsName",
|
||||
|
||||
lookup(options: LngDetector.DetectorOptions) {
|
||||
// options -> are passed in options
|
||||
return 'en';
|
||||
return "en";
|
||||
},
|
||||
|
||||
cacheUserLanguage(lng: string, options: Object) {
|
||||
cacheUserLanguage(lng: string, options: LngDetector.DetectorOptions) {
|
||||
// options -> are passed in options
|
||||
// lng -> current language, will be called after init and on changeLanguage
|
||||
|
||||
@@ -33,10 +42,20 @@ var myDetector = {
|
||||
}
|
||||
};
|
||||
|
||||
i18next.use(LngDetector).init({
|
||||
detection: options
|
||||
});
|
||||
const customDetector2: LngDetector.CustomDetector = {
|
||||
name: "myDetectorsName",
|
||||
lookup(options: LngDetector.DetectorOptions) {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
const lngDetector = new LngDetector(null, options);
|
||||
|
||||
lngDetector.init(options);
|
||||
lngDetector.addDetector(myDetector);
|
||||
lngDetector.addDetector(customDetector);
|
||||
|
||||
i18next
|
||||
.use(lngDetector)
|
||||
.init({
|
||||
detection: options
|
||||
});
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user