From 94b20ad7cd384ae0798d7e137e0a90b8101b31db Mon Sep 17 00:00:00 2001 From: Kirill Dmitrenko Date: Tue, 21 Mar 2017 21:57:16 +0300 Subject: [PATCH 1/3] webgl-ext: fix OESVertexArrayObject to confom spec --- webgl-ext/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 { From 17fc016765c5f12589198f6b922c54a48ba48c4f Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Tue, 21 Mar 2017 14:52:16 -0700 Subject: [PATCH 2/3] chai-as-promised: Fix tests --- chai-as-promised/chai-as-promised-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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") From 3845b5dcaca9a5ee1ebe82f71c3dcc8b872bb694 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Tue, 21 Mar 2017 14:57:41 -0700 Subject: [PATCH 3/3] Fix fetch.io and fetch-mock --- fetch-mock/index.d.ts | 2 +- fetch.io/index.d.ts | 226 ++++++++++++++++++++---------------------- 2 files changed, 110 insertions(+), 118 deletions(-) diff --git a/fetch-mock/index.d.ts b/fetch-mock/index.d.ts index 4d69096845..bda708ee55 100644 --- a/fetch-mock/index.d.ts +++ b/fetch-mock/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/wheresrhys/fetch-mock // Definitions by: Alexey Svetliakov , Tamir Duberstein , Risto Keravuori // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +// TypeScript Version: 2.2 type MockRequest = Request | RequestInit; 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) +}