diff --git a/chai-as-promised/chai-as-promised-tests.ts b/chai-as-promised/chai-as-promised-tests.ts index d9f681769b..7dceef924a 100644 --- a/chai-as-promised/chai-as-promised-tests.ts +++ b/chai-as-promised/chai-as-promised-tests.ts @@ -1,6 +1,5 @@ import chai = require('chai'); import chaiAsPromised = require('chai-as-promised'); -import Q = require('q'); chai.use(chaiAsPromised); @@ -45,7 +44,7 @@ thenableNum.should.be.fulfilled.then(function () { thenableNum.should.equal("after"); }).should.notify(() => console.log('done')); -Q.all([ +Promise.all([ thenableNum.should.become("happy"), thenableNum.should.eventually.have.property("fun times"), thenableNum.should.be.rejectedWith(TypeError, "only joyful types are allowed") diff --git a/fetch.io/index.d.ts b/fetch.io/index.d.ts index 3c4ff7d781..966925b68f 100644 --- a/fetch.io/index.d.ts +++ b/fetch.io/index.d.ts @@ -2,125 +2,117 @@ // Project: https://github.com/haoxins/fetch.io // Definitions by: newraina // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -/// +type TUrl = string; - type TUrl = string; +type TMethod = 'delete' | 'get' | 'head' | 'options' | 'post' | 'put'; - type TMethod = 'delete' | 'get' | 'head' | 'options' | 'post' | 'put'; - - interface Query { - [key: string]: number | boolean | string; - } - - interface Header { - [key: string]: string; - } - - interface Options extends RequestInit { - - prefix?: string; - - query?: Query; - - header?: Header; - - beforeRequest?(url: TUrl, body: BodyInit): boolean; - - afterResponse?(res: Response): void; - - afterJSON?(body: any): void; - } - - declare namespace FetchIo { - - class Request { - - constructor(method: TMethod, url: TUrl, options: Options) - - /** - * HTTP delete method - */ - delete: (url: TUrl) => this; - - /** - * HTTP get method - */ - get: (url: TUrl) => this; - - /** - * HTTP head method - */ - head: (url: TUrl) => this; - - /** - * HTTP options method - */ - options: (url: TUrl) => this; - - /** - * HTTP post method - */ - post: (url: TUrl) => this; - - /** - * HTTP put method - */ - put: (url: TUrl) => this; - - /** - * Set Options - */ - config(key: string, value: any): this - - config(opts: {[key: string]: any}): this - - /** - * Set Header - */ - set(key: string, value: any): this - - set(opts: {[key: string]: any}): this - - /** - * Set Content-Type - */ - type(type: 'json' | 'form' | 'urlencoded'): this - - /** - * Add query string - */ - query(object: {[key: string]: any}): this - - /** - * Send data - */ - send(data: {[key: string]: any}): this - - /** - * ppend formData - */ - append(key: string, value: string): this - - /** - * Get Response directly - */ - then(resolve: (value?: Response) => void, reject?: (reason?: any) => void): Promise - - /** - * Make Response to JSON - */ - json(strict?: boolean): Promise - - /** - * Make Response to string - */ - text(): Promise - } - - class Fetch extends Request { - constructor(options?: Options) - } +interface Query { + [key: string]: number | boolean | string; } -export default FetchIo.Fetch; +interface Header { + [key: string]: string; +} + +interface Options extends RequestInit { + prefix?: string; + + query?: Query; + + header?: Header; + + beforeRequest?(url: TUrl, body: BodyInit): boolean; + + afterResponse?(res: Response): void; + + afterJSON?(body: any): void; +} + +declare class Request { + constructor(method: TMethod, url: TUrl, options: Options) + + /** + * HTTP delete method + */ + delete: (url: TUrl) => this; + + /** + * HTTP get method + */ + get: (url: TUrl) => this; + + /** + * HTTP head method + */ + head: (url: TUrl) => this; + + /** + * HTTP options method + */ + options: (url: TUrl) => this; + + /** + * HTTP post method + */ + post: (url: TUrl) => this; + + /** + * HTTP put method + */ + put: (url: TUrl) => this; + + /** + * Set Options + */ + config(key: string, value: any): this + + config(opts: {[key: string]: any}): this + + /** + * Set Header + */ + set(key: string, value: any): this + + set(opts: {[key: string]: any}): this + + /** + * Set Content-Type + */ + type(type: 'json' | 'form' | 'urlencoded'): this + + /** + * Add query string + */ + query(object: {[key: string]: any}): this + + /** + * Send data + */ + send(data: {[key: string]: any}): this + + /** + * ppend formData + */ + append(key: string, value: string): this + + /** + * Get Response directly + */ + then(resolve: (value?: Response) => void, reject?: (reason?: any) => void): Promise + + /** + * Make Response to JSON + */ + json(strict?: boolean): Promise + + /** + * Make Response to string + */ + text(): Promise +} + +export default class Fetch extends Request { + constructor(options?: Options) +} diff --git a/webgl-ext/index.d.ts b/webgl-ext/index.d.ts index 44b7565b42..56a26e3327 100644 --- a/webgl-ext/index.d.ts +++ b/webgl-ext/index.d.ts @@ -118,10 +118,10 @@ interface WebGLVertexArrayObjectOES extends WebGLObject { interface OESVertexArrayObject { VERTEX_ARRAY_BINDING_OES: number; - createVertexArrayOES(): WebGLVertexArrayObjectOES; - deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void; - isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): boolean; - bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void; + createVertexArrayOES(): WebGLVertexArrayObjectOES | null; + deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void; + isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): boolean; + bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES | null): void; } interface WebGLColorBufferFloat {