Merge pull request #11284 from DefinitelyTyped/types-2.0-fix-ci

Fix Types-2.0 CI
This commit is contained in:
Andy
2016-09-16 17:25:34 -07:00
committed by GitHub
11 changed files with 140 additions and 177 deletions
@@ -1,19 +1,10 @@
import Bowser = require('bowser');
Bowser.msedge === true;
Bowser.test(['msie']) === true;
Bowser.a === Bowser.c;
Bowser.osversion > 10;
Bowser.osversion === '10.1A';
bowser.msedge === true;
bowser.test(['msie']) === true;
bowser.a === bowser.c;
bowser.osversion > 10;
bowser.osversion === '10.1A';
bowser.compareVersions(['9.0', '10']);
bowser() === <BowserModule.IBowserDetection>{android: true, x: true};
bowser() === {android: true, x: true};
bowser.check({msie: "11"}, window.navigator.userAgent);
bowser.isUnsupportedBrowser({msie: "10"}, window.navigator.userAgent);
+9
View File
@@ -0,0 +1,9 @@
import Bowser = require('bowser');
Bowser.msedge === true;
Bowser.test(['msie']) === true;
Bowser.a === Bowser.c;
Bowser.osversion > 10;
Bowser.osversion === '10.1A';
+2 -1
View File
@@ -14,6 +14,7 @@
},
"files": [
"index.d.ts",
"bowser-tests.ts"
"bowser-tests-module.ts",
"bowser-tests-global.ts"
]
}
+4 -4
View File
@@ -1,8 +1,8 @@
// Type definitions for Apache Cordova Contacts plugin.
// Type definitions for Apache Cordova Contacts plugin
// Project: https://github.com/apache/cordova-plugin-contacts
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
//
//
// Copyright (c) Microsoft Open Technologies, Inc.
// Licensed under the MIT license.
@@ -204,7 +204,7 @@ declare var ContactName: {
* The ContactField object is a reusable component that represents contact fields generically.
* Each ContactField object contains a value, type, and pref property. A Contact object stores
* several properties in ContactField[] arrays, such as phone numbers and email addresses.
*
*
* In most instances, there are no pre-determined values for a ContactField object's type attribute.
* For example, a phone number can specify type values of home, work, mobile, iPhone,
* or any other value that is supported by a particular device platform's contact database.
+2 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for Apache Cordova File System plugin.
// Type definitions for Apache Cordova File System plugin
// Project: https://github.com/apache/cordova-plugin-file
// Definitions by: Microsoft Open Technologies, Inc. <http://msopentech.com>
// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies, Inc.
+1 -1
View File
@@ -3,7 +3,7 @@
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>, Milan Burda <https://github.com/miniak/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
/// <reference types="node" />
declare namespace Electron {
+1 -1
View File
@@ -21,7 +21,7 @@ declare namespace esprima {
value: string;
}
interface Comment extends ESTree.Node {
interface Comment extends ESTree.BaseNode {
value: string;
}
+2
View File
@@ -5,9 +5,11 @@
/// <reference types="node" />
/// <reference types="orchestrator" />
/// <reference types="vinyl" />
import Orchestrator = require("orchestrator");
import VinylFile = require("vinyl");
declare namespace gulp {
interface Gulp extends Orchestrator {
+115 -116
View File
@@ -3,126 +3,125 @@
// Definitions by: simonxca <https://github.com/simonxca/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/*
* These are the default promises included in the Mongoose v4.x
* definitions. They will be deprecated beginning Mongoose V5.x
* in favor of native ES6 Promises.
*
* You can switch the promise library that mongoose uses by:
*
* 1. Including this somewhere in your code:
* mongoose.Promise = YOUR_PROMISE;
*
* 2. Including this somewhere in your main .d.ts file:
* type MongoosePromise<T> = YOUR_PROMISE<T>;
*/
/// <reference types="mongoose" />
/// <reference types="mpromise" />
/*
* http://mongoosejs.com/docs/api.html#promise-js
*
* Callback signatures are from the mPromise type definitions.
* mongoose.d.ts uses global.Promise by default. This is the MongooseJS
* mpromise implementation (which are deprecated). If you still want to
* use it, install these definitions in your project.
*/
interface MongoosePromise<T> {
/**
* Promise constructor.
* Promises are returned from executed queries.
* @param fn a function which will be called when the promise
* is resolved that accepts fn(err, ...){} as signature
* @event err Emits when the promise is rejected
* @event complete Emits when the promise is fulfilled
* @deprecated Mongoose 5.0 will use native promises by default (or bluebird, if native
* promises are not present) but still support plugging in your own ES6-compatible
* promises library. Mongoose 5.0 will not support mpromise.
import mpromise = require('mpromise');
declare module 'mongoose' {
type Promise<T> = MongoosePromise<T>;
/*
* mpromise definitions.
* Callback signatures are from the mPromise type definitions.
*/
new(fn?: (err: any, arg: T) => void): MongoosePromise<T>;
new(fn?: (err: any, ...args: T[]) => void): MongoosePromise<T>;
class MongoosePromise<T> extends mpromise<T, any> {
/**
* Promise constructor.
* Promises are returned from executed queries.
* @param fn a function which will be called when the promise
* is resolved that accepts fn(err, ...){} as signature
* @event err Emits when the promise is rejected
* @event complete Emits when the promise is fulfilled
* @deprecated Mongoose 5.0 will use native promises by default (or bluebird, if native
* promises are not present) but still support plugging in your own ES6-compatible
* promises library. Mongoose 5.0 will not support mpromise.
*/
constructor(fn?: (err: any, arg: T) => void);
constructor(fn?: (err: any, ...args: T[]) => void);
/**
* Adds a single function as a listener to both err and complete.
* It will be executed with traditional node.js argument position when the promise is resolved.
* @deprecated Use onResolve instead.
*/
addBack(listener: (err: any, arg: T) => void): this;
addBack(listener: (err: any, ...args: T[]) => void): this;
/**
* Adds a listener to the complete (success) event.
* @deprecated Adds a listener to the complete (success) event.
*/
addCallback(listener: (arg: T) => void): this;
addCallback(listener: (...args: T[]) => void): this;
/**
* Adds a listener to the err (rejected) event.
* @deprecated Use onReject instead.
*/
addErrback(listener: (err: any) => void): this;
/** ES6-style .catch() shorthand */
catch<TRes>(onReject?: (err: any) => void | TRes | PromiseLike<TRes>): MongoosePromise<TRes>;
/**
* Signifies that this promise was the last in a chain of then()s: if a handler passed
* to the call to then which produced this promise throws, the exception will go uncaught.
*/
end(): void;
/**
* Rejects this promise with err.
* If the promise has already been fulfilled or rejected, not action is taken.
* Differs from #reject by first casting err to an Error if it is not instanceof Error.
*/
error(err: any): this;
/**
* Adds listener to the event.
* If event is either the success or failure event and the event has already been emitted,
* thelistener is called immediately and passed the results of the original emitted event.
*/
on(event: string, listener: Function): this;
/**
* Rejects this promise with reason.
* If the promise has already been fulfilled or rejected, not action is taken.
*/
reject(reason: Object | string | Error): this;
/**
* Resolves this promise to a rejected state if err is passed or a fulfilled state if no err is passed.
* If the promise has already been fulfilled or rejected, not action is taken.
* err will be cast to an Error if not already instanceof Error.
* NOTE: overrides mpromise#resolve to provide error casting.
* @param err error or null
* @param val value to fulfill the promise with
*/
resolve(err?: any, val?: Object): this;
/**
* Creates a new promise and returns it. If onFulfill or onReject are passed, they are added as
* SUCCESS/ERROR callbacks to this promise after the nextTick.
* Conforms to promises/A+ specification.
*/
then<TRes>(onFulFill: (arg: T) => void | TRes | PromiseLike<TRes>,
onReject?: (err: any) => void | TRes | PromiseLike<TRes>): MongoosePromise<TRes>;
then<TRes>(onFulfill: (...args: T[]) => void | TRes | PromiseLike<TRes>,
onReject?: (err: any) => void | TRes | PromiseLike<TRes>): MongoosePromise<TRes>;
/**
* Fulfills this promise with passed arguments. Alias of mpromise#fulfill.
* @deprecated Use fulfill instead.
*/
complete(args: T): this;
complete(...args: T[]): this;
/** Fulfills this promise with passed arguments. */
fulfill(...args: T[]): this;
fulfill(arg: T): this;
/** ES6-style promise constructor wrapper around mpromise. */
static ES6<TRes>(resolver: (
complete: (...args: TRes[]) => void | TRes | PromiseLike<TRes>,
error: (e: any) => void | TRes | PromiseLike<TRes>
) => void): MongoosePromise<TRes>;
}
}
declare class MongoosePromise<T> {
/**
* Adds a single function as a listener to both err and complete.
* It will be executed with traditional node.js argument position when the promise is resolved.
* @deprecated Use onResolve instead.
*/
addBack(listener: (err: any, arg: T) => void): this;
addBack(listener: (err: any, ...args: T[]) => void): this;
/**
* Adds a listener to the complete (success) event.
* @deprecated Adds a listener to the complete (success) event.
*/
addCallback(listener: (arg: T) => void): this;
addCallback(listener: (...args: T[]) => void): this;
/**
* Adds a listener to the err (rejected) event.
* @deprecated Use onReject instead.
*/
addErrback(listener: (err: any) => void): this;
/** ES6-style .catch() shorthand */
catch<TRes>(onReject?: (err: any) => void | TRes | PromiseLike<TRes>): MongoosePromise<TRes>;
/**
* Signifies that this promise was the last in a chain of then()s: if a handler passed
* to the call to then which produced this promise throws, the exception will go uncaught.
*/
end(): void;
/**
* Rejects this promise with err.
* If the promise has already been fulfilled or rejected, not action is taken.
* Differs from #reject by first casting err to an Error if it is not instanceof Error.
*/
error(err: any): this;
/**
* Adds listener to the event.
* If event is either the success or failure event and the event has already been emitted,
* thelistener is called immediately and passed the results of the original emitted event.
*/
on(event: string, listener: Function): this;
/**
* Rejects this promise with reason.
* If the promise has already been fulfilled or rejected, not action is taken.
*/
reject(reason: Object | string | Error): this;
/**
* Resolves this promise to a rejected state if err is passed or a fulfilled state if no err is passed.
* If the promise has already been fulfilled or rejected, not action is taken.
* err will be cast to an Error if not already instanceof Error.
* NOTE: overrides mpromise#resolve to provide error casting.
* @param err error or null
* @param val value to fulfill the promise with
*/
resolve(err?: any, val?: Object): this;
/**
* Creates a new promise and returns it. If onFulfill or onReject are passed, they are added as
* SUCCESS/ERROR callbacks to this promise after the nextTick.
* Conforms to promises/A+ specification.
*/
then<TRes>(onFulFill: (arg: T) => void | TRes | PromiseLike<TRes>,
onReject?: (err: any) => void | TRes | PromiseLike<TRes>): MongoosePromise<TRes>;
then<TRes>(onFulfill: (...args: T[]) => void | TRes | PromiseLike<TRes>,
onReject?: (err: any) => void | TRes | PromiseLike<TRes>): MongoosePromise<TRes>;
/**
* Fulfills this promise with passed arguments. Alias of mpromise#fulfill.
* @deprecated Use fulfill instead.
*/
complete(args: T): this;
complete(...args: T[]): this;
/** Fulfills this promise with passed arguments. */
fulfill(...args: T[]): this;
fulfill(arg: T): this;
/** ES6-style promise constructor wrapper around mpromise. */
static ES6<TRes>(resolver: (
complete: (...args: TRes[]) => void | TRes | PromiseLike<TRes>,
error: (e: any) => void | TRes | PromiseLike<TRes>
) => void): MongoosePromise<TRes>;
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
+1 -40
View File
@@ -1,44 +1,5 @@
function test_HeadersCopiedFromHeaders1() {
var source = new Headers();
source.append('Content-Type', 'application/json');
return new Headers(source);
}
function test_HeadersCopiedFromHash1() {
var source:HeadersMap = {
'Content-Type': 'application/json'
};
return new Headers(source);
}
function test_HeadersCopiedFromHeaders2() {
var source = new Headers();
source.append('Content-Type', 'application/json');
return new Headers(source);
}
function test_HeadersCopiedFromHash2() {
var source:HeadersMap = {
'Content-Type': 'application/json'
};
return new Headers(source);
}
function test_HeadersCopiedFromHeaders3() {
var source = new Headers();
source.append('Content-Type', 'application/json');
return new Headers(source);
}
function test_HeadersCopiedFromHash3() {
var source:HeadersMap = {
'Content-Type': 'application/json'
};
return new Headers(source);
}
function test_HeadersCopiedFromHeaders() {
var source = new Headers();
source.append('Content-Type', 'application/json');
@@ -107,4 +68,4 @@ function handlePromise(promise: Promise<Response>) {
}).then((text) => {
console.log(text);
});
}
}