mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 15:27:05 +00:00
Merge remote-tracking branch 'upstream/master' into styled-system
This commit is contained in:
@@ -24,7 +24,12 @@ let array = [ 1, 2, 3 ];
|
||||
chai.spy.on(array, 'push');
|
||||
|
||||
// or you can track multiple object's methods
|
||||
chai.spy.on(array, 'push', 'pop');
|
||||
chai.spy.on(array, ['push', 'pop']);
|
||||
|
||||
// or you can track multiple object's methods
|
||||
chai.spy.on(array, 'push', function(item) {
|
||||
array.push(item);
|
||||
});
|
||||
|
||||
array.push(5);
|
||||
|
||||
@@ -149,4 +154,20 @@ spy.should.not.have.been.called.above(3);
|
||||
expect(spy).to.have.been.called.below(3);
|
||||
expect(spy).to.not.have.been.called.lt(3);
|
||||
spy.should.have.been.called.lt(3);
|
||||
spy.should.not.have.been.called.below(3);
|
||||
spy.should.not.have.been.called.below(3);
|
||||
|
||||
// You can also create sandbox
|
||||
let sb = chai.spy.sandbox();
|
||||
|
||||
sb.on(array, 'pop', () => {
|
||||
return 1;
|
||||
})
|
||||
|
||||
let one = array.pop();
|
||||
expect(one).to.equal(1);
|
||||
|
||||
// Can restore methods in sandbox
|
||||
sb.restore();
|
||||
array.push(2);
|
||||
let two = array.pop();
|
||||
expect(two).to.equal(2);
|
||||
|
||||
Vendored
+108
-54
@@ -1,6 +1,8 @@
|
||||
// Type definitions for chai-spies
|
||||
// Type definitions for chai-spies 1.0.0
|
||||
// Project: https://github.com/chaijs/chai-spies
|
||||
// Definitions by: Ilya Kuznetsov <https://github.com/kuzn-ilya>
|
||||
// Harm van der Werf <https://github.com/harm-less>
|
||||
// Jouni Suorsa <https://github.com/jounisuo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="chai" />
|
||||
@@ -21,7 +23,7 @@ declare namespace Chai {
|
||||
* ```ts
|
||||
* expect(spy).to.be.spy;
|
||||
* spy.should.be.spy;
|
||||
* ```
|
||||
* ```
|
||||
*/
|
||||
spy: Assertion;
|
||||
|
||||
@@ -32,7 +34,7 @@ declare namespace Chai {
|
||||
* expect(spy).to.have.been.called();
|
||||
* spy.should.have.been.called();
|
||||
* ```
|
||||
* Note that ```called``` can be used as a chainable method.
|
||||
* Note that ```called``` can be used as a chainable method.
|
||||
*/
|
||||
called: ChaiSpies.Called;
|
||||
|
||||
@@ -61,7 +63,32 @@ declare namespace Chai {
|
||||
}
|
||||
|
||||
declare namespace ChaiSpies {
|
||||
interface Sandbox {
|
||||
/**
|
||||
* #### chai.spy.on (function)
|
||||
*
|
||||
* Wraps an object method into spy. All calls will pass through to the original function.
|
||||
*
|
||||
* @param {Object} object
|
||||
* @param {String} methodNames names to spy on
|
||||
* @param {function} fn replacement function
|
||||
* @returns function to actually call
|
||||
*/
|
||||
on(object: Object, methodNames: string | string[], fn?: (parameters: any[]|any) => any): any;
|
||||
|
||||
/**
|
||||
* #### chai.spy.restore (function)
|
||||
*
|
||||
* Restores previously wrapped object's method.
|
||||
* Restores all spied objects of a sandbox if called without parameters.
|
||||
*
|
||||
* @function
|
||||
* @param {Object} [object]
|
||||
* @param {String|String[]} [methods] name or names
|
||||
* @return {Sandbox} Sandbox instance
|
||||
*/
|
||||
restore(object?: Object, methodNames?: string | string[]): void;
|
||||
}
|
||||
interface Spy {
|
||||
/**
|
||||
* #### chai.spy (function)
|
||||
@@ -72,9 +99,9 @@ declare namespace ChaiSpies {
|
||||
* var spy = chai.spy(original)
|
||||
* , e_spy = chai.spy();
|
||||
* ```
|
||||
* @param fn function to spy on. @default ```function () {}```
|
||||
* @param fn function to spy on. @default ```function () {}```
|
||||
* @returns function to actually call
|
||||
*/
|
||||
*/
|
||||
(): SpyFunc0Proxy<void>;
|
||||
<R>(fn: SpyFunc0<R>): SpyFunc0Proxy<R>;
|
||||
<A1, R>(fn: SpyFunc1<A1, R>): SpyFunc1Proxy<A1, R>;
|
||||
@@ -107,10 +134,11 @@ declare namespace ChaiSpies {
|
||||
* var spy = chai.spy.on(Array, 'isArray');
|
||||
* ```
|
||||
* @param {Object} object
|
||||
* @param {String} method name to spy on
|
||||
* @param {String} method names to spy on
|
||||
* @param {function} fn replacement function
|
||||
* @returns function to actually call
|
||||
*/
|
||||
on(object: Object, ...methodNames: string[]): any;
|
||||
*/
|
||||
on(object: Object, methodNames: string | string[], fn?: (parameters: any[]|any) => any): any;
|
||||
|
||||
/**
|
||||
* #### chai.spy.object (function)
|
||||
@@ -123,10 +151,24 @@ declare namespace ChaiSpies {
|
||||
* @param {String[]|Object} method names or method definitions
|
||||
* @returns object with spied methods
|
||||
*/
|
||||
object(name: string, methods: string[]): any;
|
||||
object(methods: string[]): any;
|
||||
object<T>(name: string, methods: T): T;
|
||||
object<T>(methods: T): T;
|
||||
object(name: string, methods: string[]): any;
|
||||
object(methods: string[]): any;
|
||||
object<T>(name: string, methods: T): T;
|
||||
object<T>(methods: T): T;
|
||||
|
||||
/**
|
||||
* #### chai.spy.restore (function)
|
||||
*
|
||||
* Restores spy assigned to DEFAULT sandbox
|
||||
*
|
||||
* Restores previously wrapped object's method.
|
||||
* Restores all spied objects of a sandbox if called without parameters.
|
||||
*
|
||||
* @param {Object} [object]
|
||||
* @param {String|String[]} [methods] name or names
|
||||
* @return {Sandbox} Sandbox instance
|
||||
*/
|
||||
restore(object?: Object, methodNames?: string | string[]): void;
|
||||
|
||||
/**
|
||||
* #### chai.spy.returns (function)
|
||||
@@ -141,6 +183,18 @@ declare namespace ChaiSpies {
|
||||
*/
|
||||
|
||||
returns<T>(value: T): SpyFunc0Proxy<T>;
|
||||
|
||||
/**
|
||||
* ### chai.spy.sandbox
|
||||
*
|
||||
* Creates a sandbox.
|
||||
*
|
||||
* Sandbox is a set of spies.
|
||||
* Sandbox allows to track methods on objects and restore original methods with on restore call.
|
||||
*
|
||||
* @returns {Sandbox}
|
||||
*/
|
||||
sandbox(): Sandbox;
|
||||
}
|
||||
|
||||
interface Called {
|
||||
@@ -158,12 +212,12 @@ declare namespace ChaiSpies {
|
||||
* spy.should.not.have.been.called.once;
|
||||
* ```
|
||||
*/
|
||||
once: Chai.Assertion;
|
||||
once: Chai.Assertion;
|
||||
|
||||
/**
|
||||
* ####.twice
|
||||
* Assert that a spy has been called exactly twice.
|
||||
* ```ts
|
||||
* ```ts
|
||||
* expect(spy).to.have.been.called.twice;
|
||||
* expect(spy).to.not.have.been.called.twice;
|
||||
* spy.should.have.been.called.twice;
|
||||
@@ -215,7 +269,7 @@ declare namespace ChaiSpies {
|
||||
* ```ts
|
||||
* expect(spy).to.have.been.called.above(3);
|
||||
* spy.should.not.have.been.called.above(3);
|
||||
* ```
|
||||
* ```
|
||||
*/
|
||||
above(n: number): Chai.Assertion;
|
||||
|
||||
@@ -225,7 +279,7 @@ declare namespace ChaiSpies {
|
||||
* ```ts
|
||||
* expect(spy).to.have.been.called.gt(3);
|
||||
* spy.should.not.have.been.called.gt(3);
|
||||
* ```
|
||||
* ```
|
||||
*/
|
||||
gt(n: number): Chai.Assertion;
|
||||
|
||||
@@ -235,7 +289,7 @@ declare namespace ChaiSpies {
|
||||
* ```ts
|
||||
* expect(spy).to.have.been.called.below(3);
|
||||
* spy.should.not.have.been.called.below(3);
|
||||
* ```
|
||||
* ```
|
||||
*/
|
||||
below(n: number): Chai.Assertion;
|
||||
|
||||
@@ -245,7 +299,7 @@ declare namespace ChaiSpies {
|
||||
* ```ts
|
||||
* expect(spy).to.have.been.called.lt(3);
|
||||
* spy.should.not.have.been.called.lt(3);
|
||||
* ```
|
||||
* ```
|
||||
*/
|
||||
lt(n: number): Chai.Assertion;
|
||||
}
|
||||
@@ -301,7 +355,7 @@ declare namespace ChaiSpies {
|
||||
* spy.should.have.been.called.with('foo');
|
||||
* ```
|
||||
* Will also pass for ```spy('foo', 'bar')``` and ```spy(); spy('foo')```.
|
||||
* If used with multiple arguments, assert that a spy has been called with all the given arguments at least once.
|
||||
* If used with multiple arguments, assert that a spy has been called with all the given arguments at least once.
|
||||
* ```ts
|
||||
* spy('foo', 'bar', 1);
|
||||
* expect(spy).to.have.been.called.with('bar', 'foo');
|
||||
@@ -389,7 +443,7 @@ declare namespace ChaiSpies {
|
||||
*
|
||||
* Resets __spy object parameters for instantiation and reuse
|
||||
* @returns proxy spy object
|
||||
*/
|
||||
*/
|
||||
reset(): this;
|
||||
}
|
||||
|
||||
@@ -397,77 +451,77 @@ declare namespace ChaiSpies {
|
||||
(): R;
|
||||
}
|
||||
|
||||
interface SpyFunc1<A1, R> {
|
||||
(a: A1): R;
|
||||
interface SpyFunc1<A1, R> {
|
||||
(a: A1): R;
|
||||
}
|
||||
|
||||
interface SpyFunc2<A1, A2, R> {
|
||||
(a: A1, b: A2): R;
|
||||
interface SpyFunc2<A1, A2, R> {
|
||||
(a: A1, b: A2): R;
|
||||
}
|
||||
|
||||
interface SpyFunc3<A1, A2, A3, R> {
|
||||
(a: A1, b: A2, c: A3): R;
|
||||
interface SpyFunc3<A1, A2, A3, R> {
|
||||
(a: A1, b: A2, c: A3): R;
|
||||
}
|
||||
|
||||
interface SpyFunc4<A1, A2, A3, A4, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4): R;
|
||||
interface SpyFunc4<A1, A2, A3, A4, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4): R;
|
||||
}
|
||||
|
||||
interface SpyFunc5<A1, A2, A3, A4, A5, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5): R;
|
||||
interface SpyFunc5<A1, A2, A3, A4, A5, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5): R;
|
||||
}
|
||||
|
||||
interface SpyFunc6<A1, A2, A3, A4, A5, A6, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5, f: A6): R;
|
||||
interface SpyFunc6<A1, A2, A3, A4, A5, A6, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5, f: A6): R;
|
||||
}
|
||||
|
||||
interface SpyFunc7<A1, A2, A3, A4, A5, A6, A7, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7): R;
|
||||
interface SpyFunc7<A1, A2, A3, A4, A5, A6, A7, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7): R;
|
||||
}
|
||||
|
||||
interface SpyFunc8<A1, A2, A3, A4, A5, A6, A7, A8, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8): R;
|
||||
interface SpyFunc8<A1, A2, A3, A4, A5, A6, A7, A8, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8): R;
|
||||
}
|
||||
|
||||
interface SpyFunc9<A1, A2, A3, A4, A5, A6, A7, A8, A9, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8, i: A9): R;
|
||||
|
||||
interface SpyFunc9<A1, A2, A3, A4, A5, A6, A7, A8, A9, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8, i: A9): R;
|
||||
}
|
||||
|
||||
interface SpyFunc10<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8, i: A9, j: A10): R;
|
||||
|
||||
interface SpyFunc10<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, R> {
|
||||
(a: A1, b: A2, c: A3, d: A4, e: A5, f: A6, g: A7, h: A8, i: A9, j: A10): R;
|
||||
}
|
||||
|
||||
interface SpyFunc0Proxy<R> extends SpyFunc0<R>, Resetable {
|
||||
}
|
||||
|
||||
interface SpyFunc1Proxy<A1, R> extends SpyFunc1<A1, R>, Resetable {
|
||||
interface SpyFunc1Proxy<A1, R> extends SpyFunc1<A1, R>, Resetable {
|
||||
}
|
||||
|
||||
interface SpyFunc2Proxy<A1, A2, R> extends SpyFunc2<A1, A2, R>, Resetable {
|
||||
interface SpyFunc2Proxy<A1, A2, R> extends SpyFunc2<A1, A2, R>, Resetable {
|
||||
}
|
||||
|
||||
interface SpyFunc3Proxy<A1, A2, A3, R> extends SpyFunc3<A1, A2, A3, R>, Resetable {
|
||||
interface SpyFunc3Proxy<A1, A2, A3, R> extends SpyFunc3<A1, A2, A3, R>, Resetable {
|
||||
}
|
||||
|
||||
interface SpyFunc4Proxy<A1, A2, A3, A4, R> extends SpyFunc4<A1, A2, A3, A4, R>, Resetable {
|
||||
interface SpyFunc4Proxy<A1, A2, A3, A4, R> extends SpyFunc4<A1, A2, A3, A4, R>, Resetable {
|
||||
}
|
||||
|
||||
interface SpyFunc5Proxy<A1, A2, A3, A4, A5, R> extends SpyFunc5<A1, A2, A3, A4, A5, R>, Resetable {
|
||||
interface SpyFunc5Proxy<A1, A2, A3, A4, A5, R> extends SpyFunc5<A1, A2, A3, A4, A5, R>, Resetable {
|
||||
}
|
||||
|
||||
interface SpyFunc6Proxy<A1, A2, A3, A4, A5, A6, R> extends SpyFunc6<A1, A2, A3, A4, A5, A6, R>, Resetable {
|
||||
interface SpyFunc6Proxy<A1, A2, A3, A4, A5, A6, R> extends SpyFunc6<A1, A2, A3, A4, A5, A6, R>, Resetable {
|
||||
}
|
||||
|
||||
interface SpyFunc7Proxy<A1, A2, A3, A4, A5, A6, A7, R> extends SpyFunc7<A1, A2, A3, A4, A5, A6, A7, R>, Resetable {
|
||||
interface SpyFunc7Proxy<A1, A2, A3, A4, A5, A6, A7, R> extends SpyFunc7<A1, A2, A3, A4, A5, A6, A7, R>, Resetable {
|
||||
}
|
||||
|
||||
interface SpyFunc8Proxy<A1, A2, A3, A4, A5, A6, A7, A8, R> extends SpyFunc8<A1, A2, A3, A4, A5, A6, A7, A8, R>, Resetable {
|
||||
interface SpyFunc8Proxy<A1, A2, A3, A4, A5, A6, A7, A8, R> extends SpyFunc8<A1, A2, A3, A4, A5, A6, A7, A8, R>, Resetable {
|
||||
}
|
||||
|
||||
interface SpyFunc9Proxy<A1, A2, A3, A4, A5, A6, A7, A8, A9, R> extends SpyFunc9<A1, A2, A3, A4, A5, A6, A7, A8, A9, R>, Resetable {
|
||||
|
||||
interface SpyFunc9Proxy<A1, A2, A3, A4, A5, A6, A7, A8, A9, R> extends SpyFunc9<A1, A2, A3, A4, A5, A6, A7, A8, A9, R>, Resetable {
|
||||
}
|
||||
|
||||
interface SpyFunc10Proxy<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, R> extends SpyFunc10<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, R>, Resetable {
|
||||
|
||||
interface SpyFunc10Proxy<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, R> extends SpyFunc10<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, R>, Resetable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
-1
@@ -7,6 +7,7 @@
|
||||
// Jason Dreyzehner <https://github.com/bitjson>
|
||||
// Synarque <https://github.com/synarque>
|
||||
// Justin Rockwood <https://github.com/jrockwood>
|
||||
// Keith Kelly <https://github.com/kwkelly>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// TypeScript Version: 2.3
|
||||
@@ -21,6 +22,13 @@ declare namespace inquirer {
|
||||
| Question<T>
|
||||
| ReadonlyArray<Question<T>>
|
||||
| Rx.Observable<Question<T>>;
|
||||
interface OutputStreamOption {
|
||||
output: NodeJS.WriteStream
|
||||
}
|
||||
interface InputStreamOption {
|
||||
input: NodeJS.ReadStream
|
||||
}
|
||||
type StreamOptions = InputStreamOption | OutputStreamOption | (InputStreamOption & OutputStreamOption);
|
||||
|
||||
interface Inquirer {
|
||||
restoreDefaultPrompts(): void;
|
||||
@@ -32,8 +40,9 @@ declare namespace inquirer {
|
||||
registerPrompt(name: string, prompt: PromptModule): void;
|
||||
/**
|
||||
* Create a new self-contained prompt module.
|
||||
* @param opt Object specifying input and output streams for the prompt
|
||||
*/
|
||||
createPromptModule(): PromptModule;
|
||||
createPromptModule(opt?: StreamOptions): PromptModule;
|
||||
/**
|
||||
* Public CLI helper interface
|
||||
* @param questions Questions settings array
|
||||
|
||||
@@ -626,3 +626,47 @@ async function testAsyncPrompt(): Promise<void> {
|
||||
}
|
||||
|
||||
testAsyncPrompt();
|
||||
|
||||
/**
|
||||
* Different prompt output example
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
//var inquirer = require("../lib/inquirer");
|
||||
|
||||
var questions = [
|
||||
{
|
||||
type: "input",
|
||||
name: "first_name",
|
||||
message: "What's your first name",
|
||||
prefix: "1 - "
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
name: "last_name",
|
||||
message: "What's your last name",
|
||||
default: function() {
|
||||
return "Doe";
|
||||
},
|
||||
suffix: "!!"
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
name: "phone",
|
||||
message: "What's your phone number",
|
||||
validate: function(value: string): string | boolean {
|
||||
var pass = value.match(
|
||||
/^([01]{1})?[\-\.\s]?\(?(\d{3})\)?[\-\.\s]?(\d{3})[\-\.\s]?(\d{4})\s?((?:#|ext\.?\s?|x\.?\s?){1}(?:\d+)?)?$/i
|
||||
);
|
||||
if (pass) {
|
||||
return true;
|
||||
} else {
|
||||
return "Please enter a valid phone number";
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
inquirer.createPromptModule({ output: process.stderr })(questions, function(answers) {
|
||||
console.log(JSON.stringify(answers, null, " "));
|
||||
});
|
||||
|
||||
Vendored
+601
-581
File diff suppressed because it is too large
Load Diff
@@ -7058,7 +7058,7 @@ function JQuery_jqXHR() {
|
||||
}
|
||||
}
|
||||
|
||||
function compatibleWithPromise(): Promise<any> {
|
||||
function compatibleWithPromise(): JQuery._Promise<any> {
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -7480,7 +7480,7 @@ function JQuery_Promise3() {
|
||||
return s;
|
||||
}
|
||||
|
||||
function compatibleWithPromise(): Promise<any> {
|
||||
function compatibleWithPromise(): JQuery._Promise<any> {
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -7624,7 +7624,7 @@ function JQuery_Promise2(p: JQuery.Promise2<string, Error, number, JQuery, strin
|
||||
return s;
|
||||
}
|
||||
|
||||
function compatibleWithPromise(): Promise<any> {
|
||||
function compatibleWithPromise(): JQuery._Promise<any> {
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -7745,7 +7745,7 @@ function JQuery_Promise(p: JQuery.Promise<string, Error, number>) {
|
||||
return s;
|
||||
}
|
||||
|
||||
function compatibleWithPromise(): Promise<any> {
|
||||
function compatibleWithPromise(): JQuery._Promise<any> {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
/// <reference types="bluebird-global" />
|
||||
|
||||
// Pulls in bluebird-global to test compatibility.
|
||||
// Fixes https://github.com/DefinitelyTyped/DefinitelyTyped/issues/26328.
|
||||
@@ -21,6 +21,7 @@
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jquery-tests.ts",
|
||||
"test/bluebird-global-tests.ts",
|
||||
"test/example-tests.ts",
|
||||
"test/longdesc-tests.ts",
|
||||
"test/learn-tests.ts",
|
||||
@@ -29,4 +30,4 @@
|
||||
"test/jquery-slim-no-window-module-tests.ts",
|
||||
"test/jquery-slim-window-module-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -4760,6 +4760,6 @@ declare namespace _ {
|
||||
zipObjectDeep: LodashZipObjectDeep;
|
||||
zipWith: LodashZipWith;
|
||||
__: lodash.__;
|
||||
placehodler: lodash.__;
|
||||
placeholder: lodash.__;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ async function main() {
|
||||
" interface LoDashFp {",
|
||||
...interfaceGroups.map(g => ` ${g.functionName}: ${g.interfaces[0].name};`),
|
||||
" __: lodash.__;",
|
||||
" placehodler: lodash.__;",
|
||||
" placeholder: lodash.__;",
|
||||
" }",
|
||||
"}",
|
||||
"",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": false,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
|
||||
Vendored
+2
@@ -854,6 +854,8 @@ declare module "mongoose" {
|
||||
typeKey?: string;
|
||||
/** defaults to false */
|
||||
useNestedStrict?: boolean;
|
||||
/** defaults to false */
|
||||
usePushEach?: boolean;
|
||||
/** defaults to true */
|
||||
validateBeforeSave?: boolean;
|
||||
/** defaults to "__v" */
|
||||
|
||||
Vendored
+29
@@ -25,6 +25,7 @@
|
||||
// Alexander T. <https://github.com/a-tarasyuk>
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Zane Hannan AU <https://github.com/ZaneHannanAU>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** inspector module types */
|
||||
@@ -2560,11 +2561,19 @@ declare module "dns" {
|
||||
ttl: number;
|
||||
}
|
||||
|
||||
export interface AnyRecordWithTtl extends RecordWithTtl {
|
||||
type: "A" | "AAAA";
|
||||
}
|
||||
|
||||
export interface MxRecord {
|
||||
priority: number;
|
||||
exchange: string;
|
||||
}
|
||||
|
||||
export interface AnyMxRecord extends MxRecord {
|
||||
type: "MX";
|
||||
}
|
||||
|
||||
export interface NaptrRecord {
|
||||
flags: string;
|
||||
service: string;
|
||||
@@ -2574,6 +2583,10 @@ declare module "dns" {
|
||||
preference: number;
|
||||
}
|
||||
|
||||
export interface AnyNaptrRecord extends NaptrRecord {
|
||||
type: "NAPTR";
|
||||
}
|
||||
|
||||
export interface SoaRecord {
|
||||
nsname: string;
|
||||
hostmaster: string;
|
||||
@@ -2584,6 +2597,10 @@ declare module "dns" {
|
||||
minttl: number;
|
||||
}
|
||||
|
||||
export interface AnySoaRecord extends SoaRecord {
|
||||
type: "SOA";
|
||||
}
|
||||
|
||||
export interface SrvRecord {
|
||||
priority: number;
|
||||
weight: number;
|
||||
@@ -2591,9 +2608,19 @@ declare module "dns" {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface AnySrvRecord extends SrvRecord {
|
||||
type: "SRV";
|
||||
}
|
||||
|
||||
export interface AnyTxtRecord {
|
||||
type: "TXT";
|
||||
entries: string[];
|
||||
}
|
||||
|
||||
export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray<AnySrvRecord | AnySoaRecord | AnyNaptrRecord | AnyRecordWithTtl | AnyMxRecord | AnyTxtRecord>) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
|
||||
export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
|
||||
@@ -2607,6 +2634,7 @@ declare module "dns" {
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
export namespace resolve {
|
||||
export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
||||
export function __promisify__(hostname: string, rrtype: "ANY"): Promise<ReadonlyArray<AnySrvRecord | AnySoaRecord | AnyNaptrRecord | AnyRecordWithTtl | AnyMxRecord | AnyTxtRecord>>;
|
||||
export function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
||||
export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
||||
export function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
||||
@@ -2637,6 +2665,7 @@ declare module "dns" {
|
||||
export function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
||||
}
|
||||
|
||||
export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray<AnySrvRecord | AnySoaRecord | AnyNaptrRecord | AnyRecordWithTtl | AnyMxRecord | AnyTxtRecord>) => void): void;
|
||||
export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
||||
export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
|
||||
export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
|
||||
|
||||
@@ -3142,6 +3142,9 @@ namespace dns_tests {
|
||||
dns.resolve("nodejs.org", "AAAA", (err, addresses) => {
|
||||
const _addresses: string[] = addresses;
|
||||
});
|
||||
dns.resolve("nodejs.org", "ANY", (err, addresses) => {
|
||||
const _addresses: ReadonlyArray<dns.AnySrvRecord | dns.AnySoaRecord | dns.AnyNaptrRecord | dns.AnyRecordWithTtl | dns.AnyMxRecord | dns.AnyTxtRecord> = addresses;
|
||||
});
|
||||
dns.resolve("nodejs.org", "MX", (err, addresses) => {
|
||||
const _addresses: dns.MxRecord[] = addresses;
|
||||
});
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/nodemailer/nodemailer
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Piotr Roszatycki <https://github.com/dex4er>
|
||||
// Daniel Chao <https://github.com/bioball>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
|
||||
Vendored
+5
-7
@@ -1,14 +1,12 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
import { Transport, TransportOptions } from '../..';
|
||||
|
||||
import { Transport, TransportOptions } from '..';
|
||||
import * as shared from '../shared';
|
||||
|
||||
import * as shared from './shared';
|
||||
|
||||
import Mail = require('./mailer');
|
||||
import MailMessage = require('./mailer/mail-message');
|
||||
import MimeNode = require('./mime-node');
|
||||
import Mail = require('../mailer');
|
||||
import MailMessage = require('../mailer/mail-message');
|
||||
import MimeNode = require('../mime-node');
|
||||
|
||||
declare namespace SendmailTransport {
|
||||
type MailOptions = Mail.Options;
|
||||
@@ -0,0 +1,7 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Transform } from 'stream';
|
||||
|
||||
declare class LeUnix extends Transform {}
|
||||
|
||||
export = LeUnix;
|
||||
@@ -0,0 +1,7 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Transform } from 'stream';
|
||||
|
||||
declare class LeWindows extends Transform {}
|
||||
|
||||
export = LeWindows;
|
||||
@@ -21,6 +21,8 @@ import SMTPTransport = require('nodemailer/lib/smtp-transport');
|
||||
import StreamTransport = require('nodemailer/lib/stream-transport');
|
||||
import wellKnown = require('nodemailer/lib/well-known');
|
||||
import XOAuth2 = require('nodemailer/lib/xoauth2');
|
||||
import LeWindows = require('nodemailer/lib/sendmail-transport/le-windows');
|
||||
import LeUnix = require('nodemailer/lib/sendmail-transport/le-unix');
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as stream from 'stream';
|
||||
@@ -722,6 +724,24 @@ function sendmail_test() {
|
||||
});
|
||||
}
|
||||
|
||||
// line ending transforms using windows-style newlines
|
||||
|
||||
function sendmail_line_endings_windows_test() {
|
||||
function process_le(mail: MailMessage) {
|
||||
const input = mail.message.createReadStream();
|
||||
input.pipe(new LeWindows());
|
||||
}
|
||||
}
|
||||
|
||||
// line ending transforms using unix-style newlines
|
||||
|
||||
function sendmail_line_endings_unix_test() {
|
||||
function process_le(mail: MailMessage) {
|
||||
const input = mail.message.createReadStream();
|
||||
input.pipe(new LeUnix());
|
||||
}
|
||||
}
|
||||
|
||||
// 5. SES transport
|
||||
|
||||
// Send a message using SES transport
|
||||
|
||||
@@ -31,7 +31,9 @@
|
||||
"lib/mime-funcs/mime-types.d.ts",
|
||||
"lib/mime-node.d.ts",
|
||||
"lib/qp.d.ts",
|
||||
"lib/sendmail-transport.d.ts",
|
||||
"lib/sendmail-transport/index.d.ts",
|
||||
"lib/sendmail-transport/le-unix.d.ts",
|
||||
"lib/sendmail-transport/le-windows.d.ts",
|
||||
"lib/ses-transport.d.ts",
|
||||
"lib/shared.d.ts",
|
||||
"lib/smtp-connection.d.ts",
|
||||
|
||||
Vendored
+2949
-129
File diff suppressed because it is too large
Load Diff
Vendored
+3
-1
@@ -1,14 +1,16 @@
|
||||
// Type definitions for query-string 5.1
|
||||
// Type definitions for query-string 6.1
|
||||
// Project: https://github.com/sindresorhus/query-string
|
||||
// Definitions by: Sam Verschueren <https://github.com/SamVerschueren>
|
||||
// Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// HuHuanming <https://github.com/huhuanming>
|
||||
// Madara Uchiha <https://github.com/MadaraUchiha>
|
||||
// Josh Holmer <https://github.com/shssoichiro>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export interface ParseOptions {
|
||||
arrayFormat?: 'bracket' | 'index' | 'none';
|
||||
decode?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,6 +24,7 @@ import * as queryString from 'query-string';
|
||||
let fooBar: { foo: 'bar' };
|
||||
fooBar = queryString.parse('?foo=bar');
|
||||
fooBar = queryString.parse('#foo=bar');
|
||||
fooBar = queryString.parse('?foo=bar%20baz', { decode: true });
|
||||
|
||||
let fooBarBaz: { foo: ['bar', 'baz'] };
|
||||
fooBarBaz = queryString.parse('&foo=bar&foo=baz');
|
||||
|
||||
Vendored
+1
-9
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-pointable 1.1
|
||||
// Type definitions for react-pointable 1.2
|
||||
// Project: https://github.com/MilllerTime/react-pointable
|
||||
// Definitions by: Stefan Fochler <https://github.com/istefo>
|
||||
// Dibyo Majumdar <https://github.com/mdibyo>
|
||||
@@ -13,14 +13,6 @@ export interface PointableProps extends React.HTMLAttributes<Element>, React.SVG
|
||||
tagName?: keyof ElementTagNameMap;
|
||||
touchAction?: TouchAction;
|
||||
elementRef?(el: HTMLElement|SVGElement): void;
|
||||
onPointerMove?(evt: PointerEvent): void;
|
||||
onPointerDown?(evt: PointerEvent): void;
|
||||
onPointerUp?(evt: PointerEvent): void;
|
||||
onPointerOver?(evt: PointerEvent): void;
|
||||
onPointerOut?(evt: PointerEvent): void;
|
||||
onPointerEnter?(evt: PointerEvent): void;
|
||||
onPointerLeave?(evt: PointerEvent): void;
|
||||
onPointerCancel?(evt: PointerEvent): void;
|
||||
}
|
||||
|
||||
export default class Pointable extends React.Component<PointableProps> {
|
||||
|
||||
@@ -3,7 +3,7 @@ import Pointable from 'react-pointable';
|
||||
|
||||
class Test extends React.Component<object, object> {
|
||||
elementRef(el: HTMLElement) {}
|
||||
somePointerEvent(evt: PointerEvent) {}
|
||||
somePointerEvent(evt: React.PointerEvent) {}
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ export namespace ReactStripeElements {
|
||||
interface StripeProviderOptions {
|
||||
stripeAccount?: string;
|
||||
}
|
||||
type StripeProviderProps = { apiKey: string; stripe?: never; } & StripeProviderOptions | { apiKey?: never; stripe: StripeProps | null; } & StripeProviderOptions;
|
||||
type StripeProviderProps = { apiKey: string; stripe?: never; } & StripeProviderOptions | { apiKey?: never; stripe: stripe.Stripe | null; } & StripeProviderOptions;
|
||||
|
||||
interface StripeProps {
|
||||
createSource(sourceData?: SourceOptions): Promise<SourceResponse>;
|
||||
|
||||
@@ -16,7 +16,6 @@ import ElementChangeResponse = stripe.elements.ElementChangeResponse;
|
||||
import ElementsOptions = stripe.elements.ElementsOptions;
|
||||
import ElementsCreateOptions = stripe.elements.ElementsCreateOptions;
|
||||
import PatchedTokenResponse = ReactStripeElements.PatchedTokenResponse;
|
||||
import StripeProps = ReactStripeElements.StripeProps;
|
||||
|
||||
const cardElementProps: ElementsOptions = {
|
||||
iconStyle: 'solid',
|
||||
@@ -185,7 +184,7 @@ const ElementsDefaultPropsTest: React.SFC = () => (
|
||||
const TestStripeProviderProps1: React.SFC = () => <StripeProvider apiKey="" />;
|
||||
|
||||
const TestStripeProviderProps2: React.SFC<{
|
||||
stripe: StripeProps;
|
||||
stripe: stripe.Stripe;
|
||||
}> = props => <StripeProvider stripe={props.stripe} />;
|
||||
|
||||
/**
|
||||
@@ -193,9 +192,22 @@ const TestStripeProviderProps2: React.SFC<{
|
||||
* See: https://github.com/stripe/react-stripe-elements#props-shape
|
||||
*/
|
||||
const TestStripeProviderProps3: React.SFC<{
|
||||
stripe: StripeProps;
|
||||
stripe: stripe.Stripe;
|
||||
}> = props => <StripeProvider stripe={null} />;
|
||||
|
||||
/**
|
||||
* End-to-end usage of loading stripe.js asynchronously.
|
||||
* See: https://github.com/stripe/react-stripe-elements#loading-stripejs-asynchronously
|
||||
*/
|
||||
const TestStripeProviderProps4: React.SFC<{
|
||||
stripe: null | stripe.Stripe
|
||||
}> = props =>
|
||||
<StripeProvider stripe={props.stripe}>
|
||||
<Elements>
|
||||
<div />
|
||||
</Elements>
|
||||
</StripeProvider>;
|
||||
|
||||
/**
|
||||
* StripeProvider should be able to accept options.
|
||||
* See: https://stripe.com/docs/stripe-js/reference#stripe-function for options.
|
||||
|
||||
Vendored
+1
@@ -13,6 +13,7 @@ interface FocusEvent extends Event { }
|
||||
interface KeyboardEvent extends Event { }
|
||||
interface MouseEvent extends Event { }
|
||||
interface TouchEvent extends Event { }
|
||||
interface PointerEvent extends Event { }
|
||||
interface TransitionEvent extends Event { }
|
||||
interface UIEvent extends Event { }
|
||||
interface WheelEvent extends Event { }
|
||||
|
||||
Vendored
+37
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for React 16.3
|
||||
// Type definitions for React 16.4
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// AssureSign <http://www.assuresign.com>
|
||||
@@ -31,6 +31,7 @@ type NativeFocusEvent = FocusEvent;
|
||||
type NativeKeyboardEvent = KeyboardEvent;
|
||||
type NativeMouseEvent = MouseEvent;
|
||||
type NativeTouchEvent = TouchEvent;
|
||||
type NativePointerEvent = PointerEvent;
|
||||
type NativeTransitionEvent = TransitionEvent;
|
||||
type NativeUIEvent = UIEvent;
|
||||
type NativeWheelEvent = WheelEvent;
|
||||
@@ -590,6 +591,18 @@ declare namespace React {
|
||||
nativeEvent: NativeDragEvent;
|
||||
}
|
||||
|
||||
interface PointerEvent<T = Element> extends MouseEvent<T> {
|
||||
pointerId: number;
|
||||
pressure: number;
|
||||
tiltX: number;
|
||||
tiltY: number;
|
||||
width: number;
|
||||
height: number;
|
||||
pointerType: 'mouse' | 'pen' | 'touch';
|
||||
isPrimary: boolean;
|
||||
nativeEvent: NativePointerEvent;
|
||||
}
|
||||
|
||||
interface FocusEvent<T = Element> extends SyntheticEvent<T> {
|
||||
nativeEvent: NativeFocusEvent;
|
||||
relatedTarget: EventTarget;
|
||||
@@ -711,6 +724,7 @@ declare namespace React {
|
||||
type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
|
||||
type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
|
||||
type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>;
|
||||
type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>;
|
||||
type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
|
||||
type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>;
|
||||
type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>;
|
||||
@@ -898,6 +912,28 @@ declare namespace React {
|
||||
onTouchStart?: TouchEventHandler<T>;
|
||||
onTouchStartCapture?: TouchEventHandler<T>;
|
||||
|
||||
// Pointer Events
|
||||
onPointerDown?: PointerEventHandler<T>;
|
||||
onPointerDownCapture?: PointerEventHandler<T>;
|
||||
onPointerMove?: PointerEventHandler<T>;
|
||||
onPointerMoveCapture?: PointerEventHandler<T>;
|
||||
onPointerUp?: PointerEventHandler<T>;
|
||||
onPointerUpCapture?: PointerEventHandler<T>;
|
||||
onPointerCancel?: PointerEventHandler<T>;
|
||||
onPointerCancelCapture?: PointerEventHandler<T>;
|
||||
onPointerEnter?: PointerEventHandler<T>;
|
||||
onPointerEnterCapture?: PointerEventHandler<T>;
|
||||
onPointerLeave?: PointerEventHandler<T>;
|
||||
onPointerLeaveCapture?: PointerEventHandler<T>;
|
||||
onPointerOver?: PointerEventHandler<T>;
|
||||
onPointerOverCapture?: PointerEventHandler<T>;
|
||||
onPointerOut?: PointerEventHandler<T>;
|
||||
onPointerOutCapture?: PointerEventHandler<T>;
|
||||
onGotPointerCapture?: PointerEventHandler<T>;
|
||||
onGotPointerCaptureCapture?: PointerEventHandler<T>;
|
||||
onLostPointerCapture?: PointerEventHandler<T>;
|
||||
onLostPointerCaptureCapture?: PointerEventHandler<T>;
|
||||
|
||||
// UI Events
|
||||
onScroll?: UIEventHandler<T>;
|
||||
onScrollCapture?: UIEventHandler<T>;
|
||||
|
||||
Vendored
+5
@@ -5262,6 +5262,11 @@ declare namespace sequelize {
|
||||
* Set to true or a string with the attribute name you want to use to enable.
|
||||
*/
|
||||
version?: boolean | string;
|
||||
|
||||
/**
|
||||
* Throws an error when no records found
|
||||
*/
|
||||
rejectOnError?: boolean | Error;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
@@ -150,7 +150,7 @@ declare namespace request {
|
||||
write(data: string | Buffer, encoding?: string): this;
|
||||
}
|
||||
|
||||
type Plugin = (req: Request) => void;
|
||||
type Plugin = (req: SuperAgentRequest) => void;
|
||||
|
||||
interface ProgressEvent {
|
||||
direction: 'download' | 'upload';
|
||||
|
||||
@@ -390,3 +390,18 @@ request
|
||||
.then(response => {
|
||||
// reads 404 page as a successful response
|
||||
});
|
||||
|
||||
// Test that the "Plugin" type from "use" provides a SuperAgentRequest rather than a Request,
|
||||
// which has additional properties.
|
||||
const echoPlugin = (request: request.SuperAgentRequest) => {
|
||||
req.url = '' + req.url;
|
||||
req.cookies = '' + req.cookies;
|
||||
if (req.method) {
|
||||
req.url = '/echo';
|
||||
}
|
||||
};
|
||||
|
||||
request
|
||||
.get('/echo')
|
||||
.use(echoPlugin)
|
||||
.end();
|
||||
|
||||
Vendored
+9
-6
@@ -12,6 +12,7 @@
|
||||
// Jason Cheatham <https://github.com/jason0x43>
|
||||
// Dennis George <https://github.com/dennispg>
|
||||
// Christophe Hurpeau <https://github.com/christophehurpeau>
|
||||
// ZSkycat <https://github.com/ZSkycat>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -349,14 +350,16 @@ declare namespace webpack {
|
||||
type ExternalsFunctionElement = (context: any, request: any, callback: (error: any, result: any) => void) => any;
|
||||
|
||||
interface Node {
|
||||
console?: boolean;
|
||||
console?: boolean | 'mock';
|
||||
process?: boolean | 'mock';
|
||||
global?: boolean;
|
||||
process?: boolean;
|
||||
Buffer?: boolean;
|
||||
__filename?: boolean | string;
|
||||
__dirname?: boolean | string;
|
||||
[nodeBuiltin: string]: boolean | string | undefined;
|
||||
__filename?: boolean | 'mock';
|
||||
__dirname?: boolean | 'mock';
|
||||
Buffer?: boolean | 'mock';
|
||||
setImmediate?: boolean | 'mock' | 'empty';
|
||||
[nodeBuiltin: string]: boolean | 'mock' | 'empty' | undefined;
|
||||
}
|
||||
|
||||
interface NewLoader {
|
||||
loader: string;
|
||||
options?: { [name: string]: any };
|
||||
|
||||
Reference in New Issue
Block a user