From 1136e3f00c525d2eeb381aee7497c730748eecfd Mon Sep 17 00:00:00 2001 From: abraaoalves Date: Sun, 4 Sep 2016 22:22:59 -0300 Subject: [PATCH 01/91] feat(data_table): add support to cucumberjs --- cucumber/cucumber-tests.ts | 48 ++++++++++++++++++++++++++++++++++---- cucumber/cucumber.d.ts | 11 ++++++++- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/cucumber/cucumber-tests.ts b/cucumber/cucumber-tests.ts index d6ada278c2..9f22e3f75d 100644 --- a/cucumber/cucumber-tests.ts +++ b/cucumber/cucumber-tests.ts @@ -1,24 +1,26 @@ /// +/// function StepSample() { type Callback = cucumber.CallbackStepDefinition; + type Table = cucumber.TableDefinition; var step = this; var hook = this; - + hook.Before(function(scenario, callback){ scenario.isFailed() && callback.pending(); }) - + hook.Around(function(scenario, runScenario) { scenario.isFailed() && runScenario(null, function(){ console.log('finish tasks'); }); }); - + hook.registerHandler('AfterFeatures', function (event, callback) { callback(); }); - + step.Given(/^I am on the Cucumber.js GitHub repository$/, function(callback:Callback) { this.visit('https://github.com/cucumber/cucumber-js', callback); }); @@ -36,5 +38,43 @@ function StepSample() { callback(new Error("Expected to be on page with title " + title)); } }); + + // Type for data_table.js on + // https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js + + step.Given(/^a table step with Table raw$/, function(table:Table){ + var expected = [ + ['Cucumber', 'Cucumis sativus'], + ['Burr Gherkin', 'Cucumis anguria'] + ]; + + assert.deepEqual(table.raw(), expected); + }); + + step.Given(/^a table step with Table rows$/, function(table: Table){ + var expected = [ + ['Apricot', '5'], + ['Brocolli', '2'], + ['Cucumber', '10'] + ]; + assert.deepEqual(table.rows(), expected) + }); + + step.Given(/^a table step with Table rowHash$/, function(table:Table){ + var expected = { + 'Cucumber': 'Cucumis sativus', + 'Burr Gherkin': 'Cucumis anguria' + }; + assert.deepEqual(table.rowsHash(), expected) + }); + + step.Given(/^a table step$/, function(table:Table){ + var expected = [ + {'Vegetable': 'Apricot', 'Rating': '5'}, + {'Vegetable': 'Brocolli', 'Rating': '2'}, + {'Vegetable': 'Cucumber', 'Rating': '10'} + ]; + assert.deepEqual(table.hashes(), expected) + }); } diff --git a/cucumber/cucumber.d.ts b/cucumber/cucumber.d.ts index 6c4273e4e0..cb37208477 100644 --- a/cucumber/cucumber.d.ts +++ b/cucumber/cucumber.d.ts @@ -10,8 +10,17 @@ declare namespace cucumber { (errror?:any):void; } + export interface TableDefinition{ + raw: () => Array; + rows: () => Array; + rowsHash: () => {}; + hashes: () => {}; + } + + type StepDefinitionParam = string | CallbackStepDefinition | TableDefinition; + interface StepDefinitionCode { - (...stepArgs: Array): PromiseLike | any | void; + (...stepArgs: Array): PromiseLike | any | void; } interface StepDefinitionOptions{ From f8f4be9d84ffc082ec0b6d90bcbf5edb7cb7fccd Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 5 Sep 2016 19:07:55 -0400 Subject: [PATCH 02/91] README fix mongoose.model example --- mongoose/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongoose/README.md b/mongoose/README.md index 411f6ace2e..9becde8b89 100644 --- a/mongoose/README.md +++ b/mongoose/README.md @@ -49,7 +49,7 @@ interface IUser extends Document { data: any[]; } -var UserModel: Model = mongoose.model('User', UserSchema); +var UserModel: Model = model('User', UserSchema); var user = new UserModel({name: 'Jane'}); user.username; // IUser properties are available From 34e18a172cb547b5e95a83d41c49fb90f0e13d82 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Mon, 5 Sep 2016 17:54:25 -0700 Subject: [PATCH 03/91] Add clickableIcons?: boolean; to MapOptions https://developers.google.com/maps/documentation/javascript/3.exp/reference --- googlemaps/google.maps.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index 97d29bbf04..0eaa0b9c3d 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -61,6 +61,7 @@ declare namespace google.maps { backgroundColor?: string; center?: LatLng|LatLngLiteral; disableDefaultUI?: boolean; + clickableIcons?: boolean; disableDoubleClickZoom?: boolean; draggable?: boolean; draggableCursor?: string; From a8657deb82bd819a5d041e58463c19398a3163ee Mon Sep 17 00:00:00 2001 From: Florent Poujol Date: Tue, 6 Sep 2016 08:23:07 +0200 Subject: [PATCH 04/91] Update THREE.js definitions to r80. Fix some style errors (whitespaces and missing semicolons). --- threejs/three.d.ts | 121 ++++++++++++++++++++++++--------------------- 1 file changed, 66 insertions(+), 55 deletions(-) diff --git a/threejs/three.d.ts b/threejs/three.d.ts index 15510a5821..9e70f1e898 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -1,4 +1,4 @@ -// Type definitions for three.js r79 +// Type definitions for three.js r80 // Project: http://mrdoob.github.com/three.js/ // Definitions by: Kon , Satoru Kimura , Florent Poujol , SereznoKot // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -149,6 +149,7 @@ declare namespace THREE { export const UnsignedShort4444Type: PixelType; export const UnsignedShort5551Type: PixelType; export const UnsignedShort565Type: PixelType; + export const UnsignedInt248Type: PixelType; // Pixel formats export enum PixelFormat { } @@ -159,6 +160,7 @@ declare namespace THREE { export const LuminanceAlphaFormat: PixelFormat; export const RGBEFormat: PixelFormat; export const DepthFormat: PixelFormat; + export const DepthStencilFormat: PixelFormat; // Compressed texture formats // DDS / ST3C Compressed texture formats @@ -246,8 +248,8 @@ declare namespace THREE { getEffectiveWeight(): number; fadeIn(duration: number): AnimationAction; fadeOut(duration: number): AnimationAction; - crossFadeFrom(fadeOutAction: AnimationAction,duration: number, warp: boolean): AnimationAction; - crossFadeTo(fadeInAction: AnimationAction,duration: number, warp: boolean): AnimationAction; + crossFadeFrom(fadeOutAction: AnimationAction, duration: number, warp: boolean): AnimationAction; + crossFadeTo(fadeInAction: AnimationAction, duration: number, warp: boolean): AnimationAction; stopFading(): AnimationAction; setEffectiveTimeScale(timeScale: number): AnimationAction; getEffectiveTimeScale(): number; @@ -673,7 +675,7 @@ declare namespace THREE { array: ArrayLike; itemSize: number; dynamic: boolean; - updateRange: {offset:number, count:number}; + updateRange: {offset: number, count: number}; version: number; normalized: boolean; needsUpdate: boolean; @@ -684,11 +686,11 @@ declare namespace THREE { copy(source: BufferAttribute): BufferAttribute; copyAt(index1: number, attribute: BufferAttribute, index2: number): BufferAttribute; copyArray(array: ArrayLike): BufferAttribute; - copyColorsArray(colors: {r:number, g:number, b:number}[]): BufferAttribute; - copyIndicesArray(indices: {a:number, b:number, c:number}[]): BufferAttribute; - copyVector2sArray(vectors: {x:number, y:number}[]): BufferAttribute; - copyVector3sArray(vectors: {x:number, y:number, z:number}[]): BufferAttribute; - copyVector4sArray(vectors: {x:number, y:number, z:number, w:number}[]): BufferAttribute; + copyColorsArray(colors: {r: number, g: number, b: number}[]): BufferAttribute; + copyIndicesArray(indices: {a: number, b: number, c: number}[]): BufferAttribute; + copyVector2sArray(vectors: {x: number, y: number}[]): BufferAttribute; + copyVector3sArray(vectors: {x: number, y: number, z: number}[]): BufferAttribute; + copyVector4sArray(vectors: {x: number, y: number, z: number, w: number}[]): BufferAttribute; set(value: ArrayLike, offset?: number): BufferAttribute; getX(index: number): number; setX(index: number, x: number): BufferAttribute; @@ -802,8 +804,8 @@ declare namespace THREE { center(): Vector3; - setFromObject(object: Object3D) : void; - updateFromObject(object: Object3D) : void; + setFromObject(object: Object3D): void; + updateFromObject(object: Object3D): void; fromGeometry(geometry: Geometry, settings?: any): BufferGeometry; @@ -1317,7 +1319,7 @@ declare namespace THREE { dispose(): void; - //These properties do not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added. + // These properties do not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added. bones: Bone[]; animation: AnimationClip; animations: AnimationClip[]; @@ -1339,7 +1341,7 @@ declare namespace THREE { */ export class InstancedBufferAttribute extends BufferAttribute { constructor(data: ArrayLike, itemSize: number, meshPerAttribute?: number); - + meshPerAttribute: number; clone(): InstancedBufferAttribute; @@ -1352,9 +1354,9 @@ declare namespace THREE { export class InstancedBufferGeometry extends BufferGeometry { constructor(); - groups: {start:number, count:number, instances:number}[]; + groups: {start: number, count: number, instances: number}[]; maxInstancedCount: number; - + addGroup(start: number, count: number, instances: number): void; clone(): InstancedBufferGeometry; copy(source: InstancedBufferGeometry): InstancedBufferGeometry; @@ -1388,7 +1390,7 @@ declare namespace THREE { */ export class InstancedInterleavedBuffer extends InterleavedBuffer { constructor(array: ArrayLike, stride: number, meshPerAttribute?: number); - + meshPerAttribute: number; clone(): InstancedInterleavedBuffer; @@ -1726,9 +1728,9 @@ declare namespace THREE { params: RaycasterParameters; precision: number; linePrecision: number; - + set(origin: Vector3, direction: Vector3): void; - setFromCamera(coords: { x: number; y: number;}, camera: Camera ): void; + setFromCamera(coords: { x: number; y: number; }, camera: Camera ): void; intersectObject(object: Object3D, recursive?: boolean): Intersection[]; intersectObjects(objects: Object3D[], recursive?: boolean): Intersection[]; } @@ -1792,6 +1794,7 @@ declare namespace THREE { copy(source: LightShadow): LightShadow; clone(recursive?: boolean): LightShadow; + toJSON(): any; } /** @@ -1988,7 +1991,7 @@ declare namespace THREE { static Handlers: LoaderHandler; } - export interface LoaderHandler{ + export interface LoaderHandler { handlers: (RegExp | Loader)[]; add(regex: RegExp, loader: Loader): void; @@ -2027,6 +2030,7 @@ declare namespace THREE { manager: LoadingManager; crossOrigin: string; + withCredentials: string; path: string; /** @@ -2035,7 +2039,8 @@ declare namespace THREE { */ load(url: string, onLoad?: (image: HTMLImageElement) => void, onProgress?: (event: any) => void, onError?: (event: any) => void): HTMLImageElement; setCrossOrigin(crossOrigin: string): ImageLoader; - setPath(value: any): ImageLoader; + setWithCredentials(value: string): ImageLoader; + setPath(value: string): ImageLoader; } /** @@ -2134,6 +2139,7 @@ declare namespace THREE { manager: LoadingManager; crossOrigin: string; + withCredentials: string; path: string; /** @@ -2143,6 +2149,7 @@ declare namespace THREE { */ load(url: string, onLoad?: (texture: Texture) => void): Texture; setCrossOrigin(crossOrigin: string): TextureLoader; + setWithCredentials(value: string): TextureLoader; setPath(path: string): TextureLoader; } @@ -2747,7 +2754,7 @@ declare namespace THREE { export interface ShaderMaterialParameters extends MaterialParameters { defines?: any; - uniforms?: any; + uniforms?: any; vertexShader?: string; fragmentShader?: string; lineWidth?: number; @@ -2881,7 +2888,7 @@ declare namespace THREE { applyMatrix4(matrix: Matrix4): Box3; translate(offset: Vector3): Box3; equals(box: Box3): boolean; - + empty(): any; // deprecated, use isEmpty() isIntersectionBox(b: any): any; // deprecated, use intersectsBox() isIntersectionSphere(s: any): any; // deprecated, use intersectsSphere() @@ -3169,7 +3176,7 @@ declare namespace THREE { export class Euler { constructor(x?: number, y?: number, z?: number, order?: string); - + x: number; y: number; z: number; @@ -3180,7 +3187,7 @@ declare namespace THREE { clone(): Euler; copy(euler: Euler): Euler; setFromRotationMatrix(m: Matrix4, order?: string, update?: boolean): Euler; - setFromQuaternion(q:Quaternion, order?: string, update?: boolean): Euler; + setFromQuaternion(q: Quaternion, order?: string, update?: boolean): Euler; setFromVector3( v: Vector3, order?: string ): Euler; reorder(newOrder: string): Euler; equals(euler: Euler): boolean; @@ -3482,7 +3489,7 @@ declare namespace THREE { * Sets the position component for this matrix from vector v. */ setPosition(v: Vector3): Matrix4; - + /** * Sets this matrix to the inverse of matrix m. @@ -3718,7 +3725,7 @@ declare namespace THREE { * Adapted from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/. */ static slerp(qa: Quaternion, qb: Quaternion, qm: Quaternion, t: number): Quaternion; - + static slerpFlat(dst: number[], dstOffset: number, src0: number[], srcOffset: number, src1: number[], stcOffset1: number, t: number): Quaternion; // deprecated @@ -3751,7 +3758,7 @@ declare namespace THREE { intersectTriangle(a: Vector3, b: Vector3, c: Vector3, backfaceCulling: boolean, optionalTarget?: Vector3): Vector3; applyMatrix4(matrix4: Matrix4): Ray; equals(ray: Ray): boolean; - + // deprecated isIntersectionBox(b: any): any; isIntersectionPlane(p: any): any; @@ -4348,7 +4355,7 @@ declare namespace THREE { * Sets all values of this vector. */ setScalar(scalar: number): Vector4; - + /** * Sets X component of this vector. */ @@ -4501,7 +4508,7 @@ declare namespace THREE { interpolate_(i1: number, t0: number, t: number, t1: number): any; } - + export class DiscreteInterpolant extends Interpolant { constructor(parameterPositions: any, samplesValues: any, sampleSize: number, resultBuffer?: any); @@ -4721,7 +4728,7 @@ declare namespace THREE { domElement: HTMLCanvasElement; render(scene: Scene, camera: Camera): void; - setSize(width:number, height:number, updateStyle?:boolean): void; + setSize(width: number, height: number, updateStyle?: boolean): void; } export interface WebGLRendererParameters { @@ -4899,7 +4906,7 @@ declare namespace THREE { getPrecision(): string; getPixelRatio(): number; setPixelRatio(value: number): void; - + getSize(): { width: number; height: number; }; /** @@ -4933,12 +4940,12 @@ declare namespace THREE { setClearColor(color: Color, alpha?: number): void; setClearColor(color: string, alpha?: number): void; setClearColor(color: number, alpha?: number): void; - + /** * Returns a float with the current clear alpha. Ranges from 0 to 1. */ getClearAlpha(): number; - + setClearAlpha(alpha: number): void; /** @@ -4950,7 +4957,7 @@ declare namespace THREE { clearColor(): void; clearDepth(): void; clearStencil(): void; - clearTarget(renderTarget:WebGLRenderTarget, color: boolean, depth: boolean, stencil: boolean): void; + clearTarget(renderTarget: WebGLRenderTarget, color: boolean, depth: boolean, stencil: boolean): void; resetGLState(): void; dispose(): void; @@ -5163,7 +5170,7 @@ declare namespace THREE { uv_pars_vertex: string; uv_vertex: string; worldpos_vertex: string; - } + }; export interface Shader { uniforms: IUniform; @@ -5307,7 +5314,7 @@ declare namespace THREE { export function clone(uniforms_src: any): any; } - export class Uniform { + export class Uniform { constructor(value: any); constructor(type: string, value: any); // deprecated @@ -5335,7 +5342,7 @@ declare namespace THREE { init(planes: any[], enableLocalClipping: boolean, camera: Camera): boolean; beginShadows(): void; endShadows(): void; - setState(planes: any[], clipShadows: boolean, camera: Camera, cache: boolean, fromCache: boolean): void; + setState(planes: any[], clipShadows: boolean, camera: Camera, cache: boolean, fromCache: boolean): void; } export interface WebGLCapabilitiesParameters { @@ -5378,7 +5385,7 @@ declare namespace THREE { export class WebGLLights { constructor(gl: WebGLRenderingContext, properties: any, info: any); - + get(light: any): any; } @@ -5390,7 +5397,7 @@ declare namespace THREE { render(start: any, count: number): void; renderInstances(geometry: any, start: any, count: number): void; } - + export class WebGLObjects { constructor(gl: WebGLRenderingContext, properties: any, info: any); @@ -5401,7 +5408,7 @@ declare namespace THREE { export class WebGLProgram { constructor(renderer: WebGLRenderer, code: string, material: ShaderMaterial, parameters: WebGLRendererParameters); - + id: number; code: string; usedTimes: number; @@ -5428,7 +5435,7 @@ declare namespace THREE { } export class WebGLTextures { - constructor(gl: any, extensions: any, state: any, properties:any, capabilities: any, paramThreeToGL: Function, info: any); + constructor(gl: any, extensions: any, state: any, properties: any, capabilities: any, paramThreeToGL: Function, info: any); setTexture2D(texture: any, slot: number): void; setTextureCube(texture: any, slot: number): void; @@ -5451,7 +5458,7 @@ declare namespace THREE { static splitDynamic(seq: any, values: any[]): any[]; static evalDynamic(seq: any, values: any[], object: any, camera: any): any[]; } - + export class WebGLProperties { constructor(); @@ -5479,7 +5486,7 @@ declare namespace THREE { // deprecated cullFace: any; } - + export class WebGLState { constructor(gl: any, extensions: any, paramThreeToGL: Function); @@ -5559,7 +5566,7 @@ declare namespace THREE { // Renderers / WebGL / Plugins ///////////////////////////////////////////////////////////////////// export class LensFlarePlugin { constructor(renderer: WebGLRenderer, flares: any[]); - + render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; } @@ -5570,7 +5577,7 @@ declare namespace THREE { } // Scenes ///////////////////////////////////////////////////////////////////// - + /** * Scenes allow you to set up what and where is to be rendered by three.js. This is where you place objects, lights and cameras. */ @@ -5590,12 +5597,14 @@ declare namespace THREE { background: any; copy(source: Scene, recursive?: boolean): Scene; + toJSON(meta?: any): any; } export interface IFog { - name:string; + name: string; color: Color; - clone():IFog; + clone(): IFog; + toJSON(): any; } /** @@ -5604,7 +5613,7 @@ declare namespace THREE { export class Fog implements IFog { constructor(hex: number, near?: number, far?: number); - name:string; + name: string; /** * Fog color. @@ -5623,6 +5632,7 @@ declare namespace THREE { far: number; clone(): Fog; + toJSON(): any; } /** @@ -5641,6 +5651,7 @@ declare namespace THREE { density: number; clone(): FogExp2; + toJSON(): any; } // Textures ///////////////////////////////////////////////////////////////////// @@ -5949,7 +5960,7 @@ declare namespace THREE { * Returns a vector for point at relative position in curve according to arc length * getPointAt(u: number): T; */ - getPointAt(u: number):T; + getPointAt(u: number): T; /** * Get sequence of points using getPoint( t ) @@ -6096,7 +6107,7 @@ declare namespace THREE { export class ClosedSplineCurve3 extends CatmullRomCurve3 {} // deprecated, use CatmullRomCurve3 export class SplineCurve3 extends CatmullRomCurve3 {} // will be deprecated, use CatmullRomCurve3 - + export class CubicBezierCurve extends Curve { constructor(v0: Vector2, v1: Vector2, v2: Vector2, v3: Vector2); @@ -6116,7 +6127,7 @@ declare namespace THREE { getPoint(t: number): Vector3; } - + export class EllipseCurve extends Curve { constructor(aX: number, aY: number, xRadius: number, yRadius: number, aStartAngle: number, aEndAngle: number, aClockwise: boolean, aRotation: number); @@ -6148,7 +6159,7 @@ declare namespace THREE { getPoint(t: number): Vector3; } - + export class QuadraticBezierCurve extends Curve { constructor( v0: Vector2, v1: Vector2, v2: Vector2 ); @@ -6172,7 +6183,7 @@ declare namespace THREE { points: Vector2[]; } - + // Extras / Geometries ///////////////////////////////////////////////////////////////////// export class BoxBufferGeometry extends BufferGeometry { @@ -6487,7 +6498,7 @@ declare namespace THREE { bevelEnabled: boolean; bevelThickness: number; bevelSize: number; - } + }; } export class TorusBufferGeometry extends BufferGeometry { @@ -6735,6 +6746,6 @@ declare namespace THREE { } } -declare module 'three' { +declare module "three" { export = THREE; } From 993460c27c81aa88aa70ce4692676d182082ab5c Mon Sep 17 00:00:00 2001 From: Zafix Date: Tue, 6 Sep 2016 11:30:28 +0200 Subject: [PATCH 05/91] Update riot-api-nodejs.d.ts --- riot-api-nodejs/riot-api-nodejs.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/riot-api-nodejs/riot-api-nodejs.d.ts b/riot-api-nodejs/riot-api-nodejs.d.ts index 05fb20e81f..83db2c68d9 100644 --- a/riot-api-nodejs/riot-api-nodejs.d.ts +++ b/riot-api-nodejs/riot-api-nodejs.d.ts @@ -321,13 +321,13 @@ declare module "riot-api-nodejs" { * get league of legends status * @param {RiotGamesAPI.LolStatus.Shard[]} callback data callback */ - getSatus(): Promise; + getStatus(): Promise; /** * get status for a given region * @param {region_e} region region * @param {RiotGamesAPI.LolStatus.Shard} callback data callback */ - getSatusByRegion(region: region_e): Promise; + getStatusByRegion(region: region_e): Promise; /** * get match infos for a given match ID * @param {number} matchId Match ID From 3189e4959f2256b068e212f8d06ca7e776bad9bc Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Tue, 6 Sep 2016 12:50:56 +0200 Subject: [PATCH 06/91] Fix musicmetadata --- musicmetadata/musicmetadata.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/musicmetadata/musicmetadata.d.ts b/musicmetadata/musicmetadata.d.ts index b772468546..0e951f8d08 100644 --- a/musicmetadata/musicmetadata.d.ts +++ b/musicmetadata/musicmetadata.d.ts @@ -19,8 +19,8 @@ declare module "musicmetadata" { declare namespace MM { export interface Options { - duration: boolean; - fileSize: number; + duration?: boolean; + fileSize?: number; } export interface Metadata { @@ -45,4 +45,4 @@ declare namespace MM { format: string; data: Buffer; } -} \ No newline at end of file +} From 596e14d6d1ac32c5f0aff01ddff6def832d63f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Guillot?= Date: Tue, 6 Sep 2016 14:55:08 +0200 Subject: [PATCH 07/91] error can be anything, you decide I was wrong. 'Error' is whatever YOUR validate and asyncValidate functions will return. --- redux-form/redux-form.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redux-form/redux-form.d.ts b/redux-form/redux-form.d.ts index e0fd8ead8d..44fdf211e2 100644 --- a/redux-form/redux-form.d.ts +++ b/redux-form/redux-form.d.ts @@ -39,7 +39,7 @@ declare module 'redux-form' { * The error for this field if its value is not passing validation. Both * synchronous and asynchronous validation errors will be reported here. */ - error?: string[]; + error?: any; /** * The value for this field as supplied in initialValues to the form. @@ -163,7 +163,7 @@ declare module 'redux-form' { * result from the synchronous validation function, the asynchronous * validation, or the rejected promise from onSubmit. */ - error?: string[]; + error?: any; /** * The form data, in the form { field1: , field2: }. The From 7cc38a3274cba841b772606de07534768e86749c Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Tue, 6 Sep 2016 10:32:48 -0300 Subject: [PATCH 08/91] revalidator: fix and update (#10757) * fix and update * naming convention and split the declaration for easy typecasting * fix for nested properties * enforce type according to the object --- revalidator/revalidator-tests.ts | 94 +++++++++++++++++++++++++++++++- revalidator/revalidator.d.ts | 92 ++++++++++++++++++++++++------- 2 files changed, 164 insertions(+), 22 deletions(-) diff --git a/revalidator/revalidator-tests.ts b/revalidator/revalidator-tests.ts index b65c9f971b..8c622b3bee 100644 --- a/revalidator/revalidator-tests.ts +++ b/revalidator/revalidator-tests.ts @@ -1,3 +1,95 @@ /// +import revalidator = require('revalidator'); + +let someObject = { + hello: true, + there: 'string' +}; + +let schema: Revalidator.JSONSchema = { + +}; + +revalidator.validate(someObject, { + properties: { + url: { + description: 'the url the object should be stored at', + type: 'string', + pattern: '^/[^#%&*{}\\:<>?\/+]+$', + required: true + }, + challenge: { + description: 'a means of protecting data (insufficient for production, used as example)', + type: 'string', + minLength: 5 + }, + body: { + description: 'what to store at the url', + type: 'any', + default: null + }, + obj: { + type: 'object', + properties: { + items: { + type: 'object', + properties: { + title: { + type: 'string', + maxLength: 140, + conditions: { + optional: function () { + return !this.published; + } + } + }, + date: { type: 'string', format: 'date', messages: { format: "must be a valid %{expected} and nothing else" } }, + body: { type: 'string' }, + tags: { + type: 'array', + uniqueItems: true, + minItems: 2, + items: { + type: 'string', + pattern: /[a-z ]+/ + } + }, + tuple: { + type: 'array', + minItems: 2, + maxItems: 2, + items: { + type: ['string', 'number'] + } + }, + author: { type: 'string', pattern: /^[\w ]+$/i, required: true, messages: { required: "is essential for survival" } }, + published: { type: 'boolean', 'default': false }, + category: { type: 'string' }, + palindrome: { + type: 'string', conform: function (val) { + return val == val.split("").reverse().join(""); + } + }, + name: { + type: 'string', default: '', conform: function (val, data) { + return (val === data.hello); + } + } + }, + patternProperties: { + '^_': { + type: 'boolean', default: false + } + } + } + } + } + } +}, { + validateFormats: true, + validateFormatsStrict: false, + validateFormatExtensions: true, + additionalProperties: false, + cast: false + }).valid === true; -revalidator.validate(null, null, null); \ No newline at end of file diff --git a/revalidator/revalidator.d.ts b/revalidator/revalidator.d.ts index 63f492e9c3..2c20e9876b 100644 --- a/revalidator/revalidator.d.ts +++ b/revalidator/revalidator.d.ts @@ -4,10 +4,27 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module Revalidator { - interface RevalidatorStatic { - validate(object: any, schema: ISchema, options: any): IReturnMessage; + + interface IOptions { + /** Enforce format constraints (default true) */ + validateFormats?: boolean; + /** When validateFormats is true treat unrecognized formats as validation errors (default false) */ + validateFormatsStrict?: boolean; + /** When validateFormats is true also validate formats defined in validate.formatExtensions (default true) */ + validateFormatExtensions?: boolean; + /** When additionalProperties is true allow additional unvisited properties on the object. (default true) */ + additionalProperties?: boolean; + /** Enforce casting of some types (for integers/numbers are only supported) when it's possible, e.g. "42" => 42, but "forty2" => "forty2" for the integer type. */ + cast?: boolean; } + interface RevalidatorStatic { + validate(object: T, schema: JSONSchema, options?: IOptions): IReturnMessage; + } + + type Types = 'string' | 'number' | 'integer' | 'array' | 'boolean' | 'object' | 'null' | 'any'; + type Formats = 'url' | 'email' | 'ip-address' | 'ipv6' | 'date-time' | 'date' | 'time' | 'color' | 'host-name' | 'utc-millisec' | 'regex'; + interface IErrrorProperty { property: string; message: string; @@ -18,26 +35,59 @@ declare module Revalidator { errors: IErrrorProperty[]; } - interface ISchema { - required?: boolean; - type: string; - pattern?: any; - maxLength?: number; - minLength?: number; - minimum?: number; - maximum?: number; - allowEmpty: boolean; - exclusiveMinimum: number; - exclusiveMaximum?: number; - divisibleBy?: number; - minItems?: number; - maxItems?: number; - uniqueItems?: boolean; - enum?: any; - format?: string; - conform?: (data:any) => boolean; - depdendencies?: string; + interface JSONSchema { + properties?: ISchemas; + } + interface ISchemas { + [index: string]: ISchema|JSONSchema; + } + + interface ISchema { + /**The type of value should be equal to the expected value */ + type: Types|Types[]; + /**If true, the value should not be undefined */ + required?: boolean; + /**The expected value regex needs to be satisfied by the value */ + pattern?: RegExp|string; + /**The length of value must be greater than or equal to expected value */ + maxLength?: number; + /**Description for this object */ + description?: string; + /**The length of value must be lesser than or equal to expected value */ + minLength?: number; + /**Value must be greater than or equal to the expected value */ + minimum?: number; + /**Value must be lesser than or equal to the expected value */ + maximum?: number; + /**If false, the value must not be an empty string */ + allowEmpty?: boolean; + /**Value must be greater than expected value */ + exclusiveMinimum?: number; + /**Value must be lesser than expected value */ + exclusiveMaximum?: number; + /**Value must be divisible by expected value */ + divisibleBy?: number; + /**Value must contain more than expected number of items */ + minItems?: number; + /**Value must contain fewer than expected number of items */ + maxItems?: number; + /**Value must hold a unique set of values */ + uniqueItems?: boolean; + /**Value must be present in the array of expected values */ + enum?: any[]; + /**Custom messages for different constraints */ + message?: string; + /**Custom messages for different constraints */ + messages?: {[index: string]: string}; + /**Default value */ + default?: any; + /**Value must be a valid format */ + format?: Formats; + /**Value must conform to constraint denoted by expected value */ + conform?: (value: any, data?: T) => boolean; + /**Value is valid only if the dependent value is valid */ + dependencies?: string; } } From 981a25bd1f5fabb8265d3dbf534299fd8928b420 Mon Sep 17 00:00:00 2001 From: Tyler Waters Date: Tue, 6 Sep 2016 06:41:47 -0700 Subject: [PATCH 09/91] Updates resolve-from typings to support import as syntax (#10927) Fixes #10926 --- resolve-from/resolve-from-tests.ts | 13 +++++++++---- resolve-from/resolve-from.d.ts | 10 ++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/resolve-from/resolve-from-tests.ts b/resolve-from/resolve-from-tests.ts index 840a19b861..7c9e8e17f1 100644 --- a/resolve-from/resolve-from-tests.ts +++ b/resolve-from/resolve-from-tests.ts @@ -1,6 +1,11 @@ /// -// Much better testing in https://github.com/typed-typings/typed-resolve-from -if (typeof resolveFrom !== 'function') { - throw new Error('resolveFrom is not a function'); -} +import resolveFrom1 = require('resolve-from'); +import * as resolveFrom2 from 'resolve-from'; + +let from: string; +let moduleId: string; +let result: string; + +result = resolveFrom1(from, moduleId); +result = resolveFrom2(from, moduleId); diff --git a/resolve-from/resolve-from.d.ts b/resolve-from/resolve-from.d.ts index a8d0441136..4b8c92a516 100644 --- a/resolve-from/resolve-from.d.ts +++ b/resolve-from/resolve-from.d.ts @@ -1,9 +1,15 @@ // Type definitions for resolve-from // Project: https://github.com/sindresorhus/resolve-from -// Definitions by: unional +// Definitions by: unional , tswaters // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function resolveFrom(fromDir: string, moduleId: string): string; declare module "resolve-from" { + + function resolveFrom(fromDir: string, moduleId: string): string; + + namespace resolveFrom { + + } + export = resolveFrom; } From 9726ab64609a5b14c71eea1234a0c8478af1c6b4 Mon Sep 17 00:00:00 2001 From: akankov Date: Tue, 6 Sep 2016 20:42:05 +0700 Subject: [PATCH 10/91] swiper constructor update (#10928) --- swiper/swiper.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/swiper/swiper.d.ts b/swiper/swiper.d.ts index 78ad2813a4..2be39474d2 100644 --- a/swiper/swiper.d.ts +++ b/swiper/swiper.d.ts @@ -122,8 +122,7 @@ declare class SwiperSlide { } declare class Swiper { - constructor(container: string, options?: SwiperOptions); - constructor(container: Element, options?: SwiperOptions); + constructor(container: string|Element, options?: SwiperOptions); // Properties width: number; From f01a67a8f2165f4e34eab01b6c44b869b0ac3550 Mon Sep 17 00:00:00 2001 From: adstep Date: Tue, 6 Sep 2016 06:42:24 -0700 Subject: [PATCH 11/91] authManager update and tests (#10858) * authManager update and tests * return type annotation --- angular-jwt/angular-jwt-tests.ts | 15 +++++++++++++++ angular-jwt/angular-jwt.d.ts | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/angular-jwt/angular-jwt-tests.ts b/angular-jwt/angular-jwt-tests.ts index 3a6b7d6bf1..818899e829 100644 --- a/angular-jwt/angular-jwt-tests.ts +++ b/angular-jwt/angular-jwt-tests.ts @@ -15,3 +15,18 @@ var $jwtInterceptor: ng.jwt.IJwtInterceptor; $jwtInterceptor.tokenGetter = () => { return expToken; } + + +var authManager: ng.jwt.IAuthManagerServiceProvider; + +// Indicate the user is authenticated +authManager.authenticate(); + +// Indicate the user is unauthenticated +authManager.unauthenticate(); + +// Keep the user authenticated +authManager.checkAuthOnRefresh(); + +// Redirect the user on unauthorized requests +authManager.redirectWhenUnauthenticated(); \ No newline at end of file diff --git a/angular-jwt/angular-jwt.d.ts b/angular-jwt/angular-jwt.d.ts index eb02cf24df..d1f9eb085f 100644 --- a/angular-jwt/angular-jwt.d.ts +++ b/angular-jwt/angular-jwt.d.ts @@ -27,4 +27,11 @@ declare namespace angular.jwt { interface IJwtInterceptor { tokenGetter(...params : any[]): string; } + + interface IAuthManagerServiceProvider { + authenticate(): void; + unauthenticate(): void; + checkAuthOnRefresh(): void; + redirectWhenUnauthenticated(): void; + } } From 49870cb1d4d273ade957c776adae343d92555e99 Mon Sep 17 00:00:00 2001 From: kfickel Date: Tue, 6 Sep 2016 15:44:37 +0200 Subject: [PATCH 12/91] Fixed node.js-crypto-typings Verify.verify and Signer.sign (#10930) source for Verify https://nodejs.org/dist/latest-v6.x/docs/api/crypto.html#crypto_verifier_verify_object_signature_signature_format source for Signer https://nodejs.org/dist/latest-v6.x/docs/api/crypto.html#crypto_sign_sign_private_key_output_format --- node/node.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 6b043fbe83..63de7fc766 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -2136,12 +2136,14 @@ declare module "crypto" { export function createSign(algorithm: string): Signer; export interface Signer extends NodeJS.WritableStream { update(data: any): void; - sign(private_key: string, output_format: string): string; + sign(private_key: string): Buffer; + sign(private_key: string, output_format: 'latin1' | 'hex' | 'base64'): string; } export function createVerify(algorith: string): Verify; export interface Verify extends NodeJS.WritableStream { update(data: any): void; - verify(object: string, signature: string, signature_format?: string): boolean; + verify(object: string, signature: Buffer): boolean; + verify(object: string, signature: string, signature_format: 'latin1' | 'hex' | 'base64'): boolean; } export function createDiffieHellman(prime_length: number): DiffieHellman; export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman; From 545269415d970474d71faba3e1032c5f76b82588 Mon Sep 17 00:00:00 2001 From: Jasper Siegmund Date: Tue, 6 Sep 2016 15:45:42 +0200 Subject: [PATCH 13/91] Updated method sig for logout which returns a promise (not void) (#10931) --- azure-mobile-services-client/AzureMobileServicesClient.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mobile-services-client/AzureMobileServicesClient.d.ts b/azure-mobile-services-client/AzureMobileServicesClient.d.ts index afd6014598..6fa0f9c475 100644 --- a/azure-mobile-services-client/AzureMobileServicesClient.d.ts +++ b/azure-mobile-services-client/AzureMobileServicesClient.d.ts @@ -17,7 +17,7 @@ declare namespace Microsoft.WindowsAzure { login(provider: string, token: string): asyncPromise; login(provider: string, callback: (error: any, user: User) => void ): void; login(provider: string): asyncPromise; - logout(): void; + logout(): asyncPromise; getTable(tableName: string): MobileServiceTable; withFilter(serviceFilter: (request: any, next: (request: any, callback: (error: any, response: any) => void) => void, callback: (error: any, response: any) => void) => void): MobileServiceClient; /** From 26de5a524f8dd66f7f25dc0b2c4297e87ae6b0bb Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Tue, 6 Sep 2016 14:50:30 +0100 Subject: [PATCH 14/91] Add some missing typings to js-data-http (#10940) --- js-data-http/js-data-http-tests.ts | 6 ++++++ js-data-http/js-data-http.d.ts | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/js-data-http/js-data-http-tests.ts b/js-data-http/js-data-http-tests.ts index 390e20aa9e..9f0c4c3169 100644 --- a/js-data-http/js-data-http-tests.ts +++ b/js-data-http/js-data-http-tests.ts @@ -1,9 +1,15 @@ +/// /// +import * as axios from 'axios'; + var adapter = new DSHttpAdapter(); var store = new JSData.DS(); store.registerAdapter('http', adapter, { default: true }); +adapter.defaults.basePath = '/api'; +adapter.http = axios; + var ADocument:JSData.DSResourceDefinition = store.defineResource('document'); ADocument.inject({ id: 5, author: 'John' }); diff --git a/js-data-http/js-data-http.d.ts b/js-data-http/js-data-http.d.ts index cde3b4a2e1..04d07f5a38 100644 --- a/js-data-http/js-data-http.d.ts +++ b/js-data-http/js-data-http.d.ts @@ -15,6 +15,8 @@ declare namespace JSData { forceTrailingSlash?: boolean; log?: boolean | ((message?:any, ...optionalParams:any[])=> void); error?: boolean | ((message?:any, ...optionalParams:any[])=> void); + basePath?: string; + verbsUseBasePath?: string; } interface DSHttpAdapterPromiseResolveType { @@ -28,6 +30,9 @@ declare namespace JSData { new(options?:DSHttpAdapterOptions):DSHttpAdapter; + defaults: DSHttpAdapterOptions; + http: any; + // DSHttpAdapter uses axios so options are axios config objects. HTTP(options?:Object):JSDataPromise; DEL(url:string, data?:Object, options?:Object):JSDataPromise; From 09a6c853921eacf8a59e4d82bd131f64aae33983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Carretero?= Date: Tue, 6 Sep 2016 15:52:50 +0200 Subject: [PATCH 15/91] FullCalendar header option accepts boolean value (#10942) --- fullCalendar/fullCalendar.d.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/fullCalendar/fullCalendar.d.ts b/fullCalendar/fullCalendar.d.ts index fd43e51c5f..81ce91d119 100644 --- a/fullCalendar/fullCalendar.d.ts +++ b/fullCalendar/fullCalendar.d.ts @@ -25,15 +25,17 @@ declare namespace FullCalendar { end: moment.Moment; } + export interface Header { + left: string; + center: string; + right: string; + } + export interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions { // General display - http://fullcalendar.io/docs/display/ - header?: { - left: string; - center: string; - right: string; - } - theme?: boolean + header?: boolean | Header; + theme?: boolean; buttonIcons?: { prev: string; next: string; @@ -50,7 +52,7 @@ declare namespace FullCalendar { contentHeight?: number; aspectRatio?: number; handleWindowResize?: boolean; - views?: ViewSpecificOptions; + views?: ViewSpecificOptions; viewRender?: (view: ViewObject, element: JQuery) => void; viewDestroy?: (view: ViewObject, element: JQuery) => void; dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void; From db2cdad3e6d7027b6f9f39b45f0a61213090d58a Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Tue, 6 Sep 2016 14:53:07 +0100 Subject: [PATCH 16/91] Add DSUtils global (#10939) --- js-data/js-data-tests.ts | 2 ++ js-data/js-data.d.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/js-data/js-data-tests.ts b/js-data/js-data-tests.ts index 7c66952162..9bbbfdfd64 100644 --- a/js-data/js-data-tests.ts +++ b/js-data/js-data-tests.ts @@ -600,3 +600,5 @@ customActionResource.emit("DS.change", customActionResource, customActionResourc customActionResourceInstance.on("DS.change", myEvtHandler); customActionResourceInstance.off("DS.change", myEvtHandler); customActionResourceInstance.emit("DS.change", customActionResource, customActionResourceInstance); + +JSData.DSUtils.Promise = Promise; \ No newline at end of file diff --git a/js-data/js-data.d.ts b/js-data/js-data.d.ts index f7fc785c82..58bef671b1 100644 --- a/js-data/js-data.d.ts +++ b/js-data/js-data.d.ts @@ -342,6 +342,7 @@ declare namespace JSData { declare var JSData:{ DS: JSData.DS; DSErrors: JSData.DSErrors; + DSUtils: any; }; //Support node require From f3507ff480a601af8c4f33e3b9f6d91b1619d7cc Mon Sep 17 00:00:00 2001 From: Matt Lewis Date: Tue, 6 Sep 2016 14:53:18 +0100 Subject: [PATCH 17/91] Add missing chai-things typings (#10936) --- chai-things/chai-things-tests.ts | 20 ++++++++++++++++++++ chai-things/chai-things.d.ts | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/chai-things/chai-things-tests.ts b/chai-things/chai-things-tests.ts index de6a4c3ffe..c49ac3b468 100644 --- a/chai-things/chai-things-tests.ts +++ b/chai-things/chai-things-tests.ts @@ -18,9 +18,19 @@ function test_somethingSyntax() { array.should.include.something.with.property('b', 2); array.should.not.include.something.with.property('b', 3); + chai.expect(array).to.include.something(); + chai.expect(array).to.include.something.that.deep.equals({ b: 2 }); + chai.expect(array).to.include.something.that.not.deep.equals({ b: 2 }); + chai.expect(array).not.to.include.something.that.deep.equals({ c: 3 }); + chai.expect(array).to.include.something.that.not.deep.equals({ c: 3 }); + chai.expect(array).to.include.something.with.property('b', 2); + chai.expect(array).not.to.include.something.with.property('b', 3); + var array2 = [{ a: 'b' }, { a: 'b' }]; array2.should.include.something.that.have.property("a"); array2.should.include.something.that.have.property("a").not.equal("d"); + chai.expect(array2).to.include.something.that.have.property("a"); + chai.expect(array2).to.include.something.that.have.property("a").not.equal("d"); } function test_somethingVariantsSyntax() { @@ -35,6 +45,16 @@ function test_somethingVariantsSyntax() { array.should.include.one.that.deep.equals({ b: 2 }); array.should.include.some(); array.should.include.some.that.deep.equal({ b: 2 }); + + chai.expect(array).to.include.a.thing(); + chai.expect(array).to.include.a.thing.that.deep.equals({ b: 2 }); + chai.expect(array).to.include.an.item(); + chai.expect(array).to.include.an.item.that.deep.equals({ b: 2 }); + chai.expect(array).to.include.one.that.deep.equals({ b: 2 }); + chai.expect(array).to.include.some(); + chai.expect(array).to.include.some.that.deep.equal({ b: 2 }); + chai.expect(array).to.contain.a.thing(); + chai.expect(array).to.contain.a.thing.with.property('a', 1); } function test_allSyntax() { diff --git a/chai-things/chai-things.d.ts b/chai-things/chai-things.d.ts index 2636c9dcea..18c138ff38 100644 --- a/chai-things/chai-things.d.ts +++ b/chai-things/chai-things.d.ts @@ -23,6 +23,15 @@ declare namespace Chai { any: Anything; } + interface Include { + (item: any): any; + a: Item; + an: Item; + one: Something; + some: Something; + something: Something; + } + interface Anything extends Assertion { (): any; that: Assertion; From c923214e96b998fff1f6787785467de7cb1f9c36 Mon Sep 17 00:00:00 2001 From: Cody Lundquist Date: Tue, 6 Sep 2016 07:01:28 -0700 Subject: [PATCH 18/91] Add typings for lazy() method (#10945) * Add typings for lazy() method Here is a link to the documentation: https://github.com/hapijs/joi/blob/v9.0.4/API.md#lazyfn * Add test for lazy method. --- joi/joi-tests.ts | 4 ++++ joi/joi.d.ts | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/joi/joi-tests.ts b/joi/joi-tests.ts index 37848203df..c75309b45e 100644 --- a/joi/joi-tests.ts +++ b/joi/joi-tests.ts @@ -752,6 +752,10 @@ schema = Joi.alternatives(schema, anySchema, boolSchema); // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- +schema = Joi.lazy(() => schema) + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + Joi.validate(value, obj); Joi.validate(value, schema); Joi.validate(value, schema, validOpts); diff --git a/joi/joi.d.ts b/joi/joi.d.ts index 3ba51d7383..b827903f9b 100644 --- a/joi/joi.d.ts +++ b/joi/joi.d.ts @@ -816,6 +816,13 @@ declare module 'joi' { export function alternatives(): AlternativesSchema; export function alternatives(types: Schema[]): AlternativesSchema; export function alternatives(type1: Schema, type2: Schema, ...types: Schema[]): AlternativesSchema; + + /** + * Generates a placeholder schema for a schema that you would provide with the fn. + * Supports the same methods of the any() type. + * This is mostly useful for recursive schemas + */ + export function lazy(cb: () => Schema): Schema; /** * Validates a value using the given schema and options. From e7f20ea2f468dfd7bcca3fb1fdb3380dd0ef0054 Mon Sep 17 00:00:00 2001 From: Mudkip Date: Tue, 6 Sep 2016 22:02:09 +0800 Subject: [PATCH 19/91] Use for path in koa-router (#10941) --- koa-router/koa-router.d.ts | 50 ++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/koa-router/koa-router.d.ts b/koa-router/koa-router.d.ts index 25ec962dad..a6e8909e83 100644 --- a/koa-router/koa-router.d.ts +++ b/koa-router/koa-router.d.ts @@ -83,10 +83,8 @@ declare module "koa-router" { regexp: RegExp; path: string; - constructor(path: string, methods: string[], middleware: Router.IMiddleware, opts?: Layer.ILayerOptions); - constructor(path: string, methods: string[], middleware: Array, opts?: Layer.ILayerOptions); - constructor(path: RegExp, methods: string[], middleware: Router.IMiddleware, opts?: Layer.ILayerOptions); - constructor(path: RegExp, methods: string[], middleware: Array, opts?: Layer.ILayerOptions); + constructor(path: string | RegExp, methods: string[], middleware: Router.IMiddleware, opts?: Layer.ILayerOptions); + constructor(path: string | RegExp, methods: string[], middleware: Array, opts?: Layer.ILayerOptions); /** * Returns whether request `path` matches route. @@ -96,7 +94,7 @@ declare module "koa-router" { /** * Returns map of URL parameters for given `path` and `paramNames`. */ - params(path: string, captures: string[], existingParams?: Object): Object; + params(path: string | RegExp, captures: string[], existingParams?: Object): Object; /** * Returns array of regexp url path captures. @@ -138,61 +136,61 @@ declare module "koa-router" { * "down" the middleware stack. */ use(...middleware: Array): Router; - use(path: string, ...middleware: Array): Router; + use(path: string | RegExp, ...middleware: Array): Router; /** * HTTP get method */ - get(name: string, path: string, ...middleware: Array): Router; - get(path: string, ...middleware: Array): Router; + get(name: string, path: string | RegExp, ...middleware: Array): Router; + get(path: string | RegExp, ...middleware: Array): Router; /** * HTTP post method */ - post(name: string, path: string, ...middleware: Array): Router; - post(path: string, ...middleware: Array): Router; + post(name: string, path: string | RegExp, ...middleware: Array): Router; + post(path: string | RegExp, ...middleware: Array): Router; /** * HTTP put method */ - put(name: string, path: string, ...middleware: Array): Router; - put(path: string, ...middleware: Array): Router; + put(name: string, path: string | RegExp, ...middleware: Array): Router; + put(path: string | RegExp, ...middleware: Array): Router; /** * HTTP delete method */ - delete(name: string, path: string, ...middleware: Array): Router; - delete(path: string, ...middleware: Array): Router; + delete(name: string, path: string | RegExp, ...middleware: Array): Router; + delete(path: string | RegExp, ...middleware: Array): Router; /** * Alias for `router.delete()` because delete is a reserved word */ - del(name: string, path: string, ...middleware: Array): Router; - del(path: string, ...middleware: Array): Router; + del(name: string, path: string | RegExp, ...middleware: Array): Router; + del(path: string | RegExp, ...middleware: Array): Router; /** * HTTP head method */ - head(name: string, path: string, ...middleware: Array): Router; - head(path: string, ...middleware: Array): Router; + head(name: string, path: string | RegExp, ...middleware: Array): Router; + head(path: string | RegExp, ...middleware: Array): Router; /** * HTTP options method */ - options(name: string, path: string, ...middleware: Array): Router; - options(path: string, ...middleware: Array): Router; + options(name: string, path: string | RegExp, ...middleware: Array): Router; + options(path: string | RegExp, ...middleware: Array): Router; /** * HTTP path method */ - patch(name: string, path: string, ...middleware: Array): Router; - patch(path: string, ...middleware: Array): Router; + patch(name: string, path: string | RegExp, ...middleware: Array): Router; + patch(path: string | RegExp, ...middleware: Array): Router; /** * Register route with all methods. */ - all(name: string, path: string, ...middleware: Array): Router; - all(path: string, ...middleware: Array): Router; + all(name: string, path: string | RegExp, ...middleware: Array): Router; + all(path: string | RegExp, ...middleware: Array): Router; /** * Set the path prefix for a Router instance that was already initialized. @@ -226,7 +224,7 @@ declare module "koa-router" { /** * Create and register a route. */ - register(path: string, methods: string[], middleware: Router.IMiddleware, opts?: Object): Layer; + register(path: string | RegExp, methods: string[], middleware: Router.IMiddleware, opts?: Object): Layer; /** * Lookup route with given `name`. @@ -254,7 +252,7 @@ declare module "koa-router" { /** * Generate URL from url pattern and given `params`. */ - static url(path: string, params: Object): string; + static url(path: string | RegExp, params: Object): string; } export = Router; From 8ca65ab187b14e6659de7690ecee75aab5311827 Mon Sep 17 00:00:00 2001 From: Mudkip Date: Tue, 6 Sep 2016 22:02:57 +0800 Subject: [PATCH 20/91] ES2015 module support for koa-compress and koa-favicon (#10949) --- koa-compress/koa-compress.d.ts | 1 + koa-favicon/koa-favicon.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/koa-compress/koa-compress.d.ts b/koa-compress/koa-compress.d.ts index c4cd2af582..49a0bb5f1b 100644 --- a/koa-compress/koa-compress.d.ts +++ b/koa-compress/koa-compress.d.ts @@ -37,5 +37,6 @@ declare module "koa-compress" { */ function compress(options?: CompressOptions): { (ctx: Koa.Context, next?: () => any): any }; + namespace compress {} export = compress; } diff --git a/koa-favicon/koa-favicon.d.ts b/koa-favicon/koa-favicon.d.ts index 618683fc76..e09c685173 100644 --- a/koa-favicon/koa-favicon.d.ts +++ b/koa-favicon/koa-favicon.d.ts @@ -31,5 +31,6 @@ declare module "koa-favicon" { }): { (ctx: Koa.Context, next?: () => any): any }; + namespace favicon {} export = favicon; } From fdbf262aa93f9e994037c0055a2c9db2694cff09 Mon Sep 17 00:00:00 2001 From: Mudkip Date: Tue, 6 Sep 2016 22:06:12 +0800 Subject: [PATCH 21/91] Add type definition for koa-json-error (#10951) * Add type definition for koa-json-error * Consist with import statement --- koa-json-error/koa-json-error-tests.ts | 13 ++++++++++ koa-json-error/koa-json-error.d.ts | 36 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 koa-json-error/koa-json-error-tests.ts create mode 100644 koa-json-error/koa-json-error.d.ts diff --git a/koa-json-error/koa-json-error-tests.ts b/koa-json-error/koa-json-error-tests.ts new file mode 100644 index 0000000000..37aae696b0 --- /dev/null +++ b/koa-json-error/koa-json-error-tests.ts @@ -0,0 +1,13 @@ +/// +/// +/// + +import * as Koa from "koa"; +import * as error from "koa-json-error"; +import { assign } from "lodash"; + +const app = new Koa(); + +app.use(error({ + preFormat: err => assign({}, err) +})); \ No newline at end of file diff --git a/koa-json-error/koa-json-error.d.ts b/koa-json-error/koa-json-error.d.ts new file mode 100644 index 0000000000..491ead463e --- /dev/null +++ b/koa-json-error/koa-json-error.d.ts @@ -0,0 +1,36 @@ +// Type definitions for koa-json-error v3.x +// Project: https://github.com/koajs/json-error +// Definitions by: Mudkip +// Definitions: https://github.com/mudkipme/DefinitelyTyped + +/// + +declare module "koa-json-error" { + + import * as Koa from "koa"; + + interface JSONErrorOptions { + /** + * Perform some task before calling `options.format`. Must be a function with the original err as its only argument. + */ + preFormat?: { (err: Error): any }; + + /** + * Runs inmediatly after `options.preFormat`. It receives two arguments: the original `err` and the output of `options.preFormat`. It should `return` a newly formatted error. + */ + format?: { (err: Error, obj: any): any }; + + /** + * Runs inmediatly after `options.format`. It receives two arguments: the original `err` and the output of `options.format`. It should `return` a newly formatted error. + */ + postFormat?: { (err: Error, obj: any): any }; + } + + /** + * Error handler for pure Koa 2.0.0+ JSON apps + */ + function jsonError(options?: JSONErrorOptions) : { (ctx: Koa.Context, next?: () => any): any }; + + namespace jsonError {} + export = jsonError; +} \ No newline at end of file From 8c6386ebf41ab6f7f6ce40f1456325ee036b55b9 Mon Sep 17 00:00:00 2001 From: Kensuke Matsuzaki Date: Tue, 6 Sep 2016 23:06:29 +0900 Subject: [PATCH 22/91] Add missing method definitions for sql.js (#10948) --- sql.js/sql.js-tests.ts | 17 +++++++++++++++-- sql.js/sql.js.d.ts | 5 +++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/sql.js/sql.js-tests.ts b/sql.js/sql.js-tests.ts index 40fceb8fbd..ece6e536e4 100644 --- a/sql.js/sql.js-tests.ts +++ b/sql.js/sql.js-tests.ts @@ -1,8 +1,8 @@ /// /// -import fs = require("fs"); -import SQL = require("sql.js"); +import * as fs from "fs"; +import * as SQL from "sql.js"; var DB_PATH = "data.db"; @@ -34,6 +34,8 @@ db.run(insertRecordStatement, { "@content": "Content 2" }); +var n = db.getRowsModified(); + try { // This query will throw exception: primary key constraint failed. db.run(insertRecordStatement, { @@ -79,3 +81,14 @@ function dbAccessDone(): void { // Finally, close the database connection and release the resources in memory. db.close(); } + +// Create a database +var db2 = new SQL.Database(); + +// You can also use javascript functions inside your SQL code +// Create the js function you need +function add(a: number, b: number): number {return a+b;} +// Specifies the SQL function's name, the number of it's arguments, and the js function to use +db2.create_function("add_js", add); +// Run a query in which the function is used +db2.run("INSERT INTO hello VALUES (add_js(7, 3), add_js('Hello ', 'world'));"); // Inserts 10 and 'Hello world' diff --git a/sql.js/sql.js.d.ts b/sql.js/sql.js.d.ts index 67f0a183c2..c5ebb67023 100644 --- a/sql.js/sql.js.d.ts +++ b/sql.js/sql.js.d.ts @@ -8,6 +8,7 @@ declare module "sql.js" { class Database { + constructor(); constructor(data: Buffer); constructor(data: Uint8Array); constructor(data: number[]); @@ -29,6 +30,10 @@ declare module "sql.js" { export(): Uint8Array; close(): void; + + getRowsModified(): number; + + create_function(name: string, func: Function): void; } class Statement { From 03b4cf5036c4c7fd097fcca32ef8e407dff96f74 Mon Sep 17 00:00:00 2001 From: Mario Adrian Date: Tue, 6 Sep 2016 16:07:25 +0200 Subject: [PATCH 23/91] Update underscore.d.ts (#10953) the chain functions: indexOf, lastIndexOf, sortedIndex returns a _ChainSingle --- underscore/underscore.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index cb5dfaa393..0f0637b4b8 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -5390,18 +5390,18 @@ interface _Chain { * Wrapped type `any[]`. * @see _.indexOf **/ - indexOf(value: T, isSorted?: boolean): _ChainSingle; + indexOf(value: T, isSorted?: boolean): _ChainSingle; /** * @see _.indexOf **/ - indexOf(value: T, startFrom: number): _ChainSingle; + indexOf(value: T, startFrom: number): _ChainSingle; /** * Wrapped type `any[]`. * @see _.lastIndexOf **/ - lastIndexOf(value: T, from?: number): _ChainSingle; + lastIndexOf(value: T, from?: number): _ChainSingle; /** * @see _.findIndex @@ -5417,7 +5417,7 @@ interface _Chain { * Wrapped type `any[]`. * @see _.sortedIndex **/ - sortedIndex(value: T, iterator?: (x: T) => any, context?: any): _Chain; + sortedIndex(value: T, iterator?: (x: T) => any, context?: any): _ChainSingle; /** * Wrapped type `number`. From 76a497660f959dcbb5a8aafde1f372a99527e433 Mon Sep 17 00:00:00 2001 From: hriss95 Date: Tue, 6 Sep 2016 15:10:30 +0100 Subject: [PATCH 24/91] Node.d.ts: Update definitions for module "http" (#10954) --- node/node.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 63de7fc766..800918a9de 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -655,6 +655,9 @@ declare module "http" { } export interface IncomingMessage extends events.EventEmitter, stream.Readable { httpVersion: string; + httpVersionMajor: string; + httpVersionMinor: string; + connection: any; headers: any; rawHeaders: string[]; trailers: any; From b74d0bee45a0ffc10e33fd03f7dd44da5c45ff37 Mon Sep 17 00:00:00 2001 From: Mario Adrian Date: Tue, 6 Sep 2016 16:10:57 +0200 Subject: [PATCH 25/91] The "chain" methods "all" return boolean values. (#10955) They actually return _ChainSingle, not _Chain. http://underscorejs.org/#every --- underscore/underscore.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index 0f0637b4b8..0891d6d304 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -5074,7 +5074,7 @@ interface _Chain { * Wrapped type `any[]`. * @see _.all **/ - all(iterator?: _.ListIterator, context?: any): _Chain; + all(iterator?: _.ListIterator, context?: any): _ChainSingle; /** * @see _.all From 90c2247f74fd16e2d03d8ebe4dd3dabc16298b1d Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Tue, 6 Sep 2016 14:11:58 +0000 Subject: [PATCH 26/91] Updated aws-lambda (#10966) * Updated aws-lambda Fixed issue #10956 * Bring back old functions for Node.js Runtime v0.10.42 Bring back old functions for Node.js Runtime v0.10.42 --- aws-lambda/aws-lambda-tests.ts | 52 ++++++--------------- aws-lambda/aws-lambda.d.ts | 83 ++++++++++++++++++++-------------- 2 files changed, 61 insertions(+), 74 deletions(-) diff --git a/aws-lambda/aws-lambda-tests.ts b/aws-lambda/aws-lambda-tests.ts index 8b9f53a8ab..f562b59d3d 100644 --- a/aws-lambda/aws-lambda-tests.ts +++ b/aws-lambda/aws-lambda-tests.ts @@ -4,55 +4,29 @@ import lambda = require('aws-lambda'); var str: string; var date: Date; -var sns: lambda.SNS; -var kinesis: lambda.Kinesis; -var recordsList: lambda.Record[]; var anyObj: any; var num: number; -var identity: lambda.Identity; +var identity: lambda.CognitoIdentity; var error: Error; - -/* Records */ -var records: lambda.Records; - -recordsList = records.Records; - -/* Record */ -var record: lambda.Record; - -str = record.EventVersion; -str = record.EventSubscriptionArn; -str = record.EnventSource; -sns = record.Sns; -kinesis = record.kinesis; - -/* SNS */ -str = sns.Type; -str = sns.MessageId; -str = sns.TopicArn; -str = sns.Subject; -str = sns.Message; -date = sns.Timestamp; - -/* Kinesis */ -var kinesis: lambda.Kinesis; - -str = kinesis.data; +var b: boolean; +var clientCtx: lambda.ClientContext; /* Context */ var context: lambda.Context; -context.log(str, anyObj); -context.fail(str); -context.succeed(str); -context.succeed(anyObj); -context.succeed(str, anyObj); +b = context.callbackWaitsForEmptyEventLoop; +str = context.functionName; +str = context.functionVersion; +str = context.invokedFunctionArn; +num = context.memoryLimitInMB; str = context.awsRequestId; -num = context.getRemainingTimeInMillis(); +str = context.logGroupName; +str = context.logStreamName; identity = context.identity; +clientCtx = context.clientContext; -/* Identity */ -var identity: lambda.Identity; +/* CognitoIdentity */ +var identity: lambda.CognitoIdentity; str = identity.cognitoIdentityId; str = identity.cognitoIdentityPoolId; diff --git a/aws-lambda/aws-lambda.d.ts b/aws-lambda/aws-lambda.d.ts index 081c6e0e3e..c9a66a3783 100644 --- a/aws-lambda/aws-lambda.d.ts +++ b/aws-lambda/aws-lambda.d.ts @@ -1,55 +1,68 @@ // Type definitions for AWS Lambda // Project: http://docs.aws.amazon.com/lambda -// Definitions by: Michael Skarum +// Definitions by: James Darbyshire , Michael Skarum , Stef Heyenrath // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "aws-lambda" { + // Context + // http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html + interface Context { + // Properties + callbackWaitsForEmptyEventLoop: boolean; + functionName: string; + functionVersion: string; + invokedFunctionArn: string; + memoryLimitInMB: number; + awsRequestId: string; + logGroupName: string; + logStreamName: string; + identity?: CognitoIdentity; + clientContext?: ClientContext; + + // Functions + getRemainingTimeInMillis(): number; - export interface Records { - Records: Record[]; - } - interface Record { - EventVersion: string; - EventSubscriptionArn: string; - EnventSource: string; - Sns: SNS; - kinesis: Kinesis; - } - interface SNS { - Type: string; - MessageId: string; - TopicArn: string; - Subject: string; - Message: string; - Timestamp: Date; - } - - interface Kinesis { - data: string; - } - - export interface Context { + // Functions for compatibility with earlier Node.js Runtime v0.10.42 log(message: string, object: any): void; fail(message: string): void; succeed(message: string): void; succeed(object: any): void; - succeed(message: string, object: any): void; - awsRequestId: string; - getRemainingTimeInMillis(): number; - /** Information about the Amazon Cognito identity provider when invoked through the AWS Mobile SDK. It can be null. */ - identity?: Identity; + succeed(message: string, object: any): void; } - - interface Identity { + + interface CognitoIdentity { cognitoIdentityId: string; cognitoIdentityPoolId: string; } - + + interface ClientContext { + client: ClientContextClient; + Custom?: any; + env: ClientContextEnv; + } + + interface ClientContextClient { + installationId: string; + appTitle: string; + appVersionName: string; + appVersionCode: string; + appPackageName: string; + } + + interface ClientContextEnv { + platformVersion: string; + platform: string; + make: string; + model: string; + locale: string; + } + /** * Optional callback parameter. + * http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html * - * @param error – an optional parameter that you can use to provide results of the failed Lambda function execution. - * @param result – an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible. + * @param error – an optional parameter that you can use to provide results of the failed Lambda function execution. + * @param result – an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible. */ export type Callback = (error?: Error, result?: any) => void; } \ No newline at end of file From 6ae3be6d82599aba90a87b9fa2d3776c396243e0 Mon Sep 17 00:00:00 2001 From: Tomas Mozeris Date: Tue, 6 Sep 2016 17:12:40 +0300 Subject: [PATCH 27/91] Add actionTypes export (#10957) --- redux-form/redux-form.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/redux-form/redux-form.d.ts b/redux-form/redux-form.d.ts index e0fd8ead8d..0702a8aa28 100644 --- a/redux-form/redux-form.d.ts +++ b/redux-form/redux-form.d.ts @@ -11,6 +11,8 @@ declare module 'redux-form' { import { Component, SyntheticEvent, FormEventHandler } from 'react'; import { Dispatch, ActionCreator, Reducer } from 'redux'; + export const actionTypes: {[actionName:string]: string}; + export type FieldValue = any; export type FormData = {[fieldName:string]: FieldValue}; From ef8a45b6e52d3815a9a9e1d8654472e695f87617 Mon Sep 17 00:00:00 2001 From: hriss95 Date: Tue, 6 Sep 2016 15:13:49 +0100 Subject: [PATCH 28/91] Node.d.ts: Update definitions for module "repl" (#10958) --- node/node.d.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 800918a9de..c93e6e0b65 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -970,7 +970,7 @@ declare module "punycode" { declare module "repl" { import * as stream from "stream"; - import * as events from "events"; + import * as readline from "readline"; export interface ReplOptions { prompt?: string; @@ -982,8 +982,17 @@ declare module "repl" { useGlobal?: boolean; ignoreUndefined?: boolean; writer?: Function; + completer?: Function; + replMode?: any; + breakEvalOnSigint?: any; } - export function start(options: ReplOptions): events.EventEmitter; + + export interface REPLServer extends readline.ReadLine { + defineCommand(keyword: string, cmd: Function | { help: string, action: Function }): void; + displayPrompt(preserveCursor?: boolean): void + } + + export function start(options: ReplOptions): REPLServer; } declare module "readline" { From 5c826046177433d60189110de75faedd972ace89 Mon Sep 17 00:00:00 2001 From: David Poetzsch-Heffter Date: Tue, 6 Sep 2016 16:15:33 +0200 Subject: [PATCH 29/91] SendOptions for parse push on new parse-server need the useMasterKey flag to work (#10962) --- parse/parse.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse/parse.d.ts b/parse/parse.d.ts index 3a7d6b25f8..84fbc76027 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -1072,7 +1072,7 @@ declare namespace Parse { title?: string; } - interface SendOptions { + interface SendOptions extends UseMasterKeyOption { success?: () => void; error?: (error: Error) => void; } From 6866455f51c4923332ae22d9e1ace89cebba564c Mon Sep 17 00:00:00 2001 From: hriss95 Date: Tue, 6 Sep 2016 15:17:33 +0100 Subject: [PATCH 30/91] Node.d.ts: Introduce module "timers" (#10964) --- node/node.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index c93e6e0b65..b7d3e6a735 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -2647,3 +2647,12 @@ declare module "constants" { declare module "process" { export = process; } + +declare module "timers" { + export function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; + export function clearTimeout(timeoutId: NodeJS.Timer): void; + export function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; + export function clearInterval(intervalId: NodeJS.Timer): void; + export function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; + export function clearImmediate(immediateId: any): void; +} From 6013c413c2f58b29dfb4c5bcea4e18c94f04cdbc Mon Sep 17 00:00:00 2001 From: hriss95 Date: Tue, 6 Sep 2016 15:18:35 +0100 Subject: [PATCH 31/91] Node.d.ts: Update definitions for module "domain" (#10965) * Node.d.ts: Update definitions for module "domain" * Node.d.ts: Update definitions for module "domain" --- node/node.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index b7d3e6a735..c7fea7dad4 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -2392,6 +2392,9 @@ declare module "domain" { bind(cb: (err: Error, data: any) => any): any; intercept(cb: (data: any) => any): any; dispose(): void; + members: any[]; + enter(): void; + exit(): void; } export function create(): Domain; From 2966b1b8bad3b515b8ebeaaf40d95809a46e74a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez?= Date: Tue, 6 Sep 2016 08:31:02 -0600 Subject: [PATCH 32/91] Fix #10919 - Added IterableIterator forward declaration to enable compilation on targets lower than es2015 (#10943) * Fix #10919 * Fix IterableIterator is not an Array type error for test when targetting lower than es2015 * Revert "Fix IterableIterator is not an Array type error for test when targetting lower than es2015" This reverts commit ce1108c87574dca0a47801bf4e7cf818aafae1b4. --- node/node.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index c7fea7dad4..54bad2289a 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -456,6 +456,8 @@ declare namespace NodeJS { } } +interface IterableIterator {} + /** * @deprecated */ From fc931b26dd6f540a9b201e1e000bfa5286af9af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez?= Date: Tue, 6 Sep 2016 08:46:48 -0600 Subject: [PATCH 33/91] Made ErrnoException.errno a string as per NodeJS API documentation (#10970) --- node/node-tests.ts | 2 +- node/node.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/node/node-tests.ts b/node/node-tests.ts index af214a4385..4dd490fd35 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -134,7 +134,7 @@ class Networker extends events.EventEmitter { } } -var errno: number; +var errno: string; fs.readFile('testfile', (err, data) => { if (err && err.errno) { errno = err.errno; diff --git a/node/node.d.ts b/node/node.d.ts index 54bad2289a..8d0ac7d1b9 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -233,7 +233,7 @@ declare var Buffer: { ************************************************/ declare namespace NodeJS { export interface ErrnoException extends Error { - errno?: number; + errno?: string; code?: string; path?: string; syscall?: string; From 7b7425e8ba69f4565f4e86c53bb988cd73af1b85 Mon Sep 17 00:00:00 2001 From: Nathan Ainslie Date: Tue, 6 Sep 2016 10:51:24 -0400 Subject: [PATCH 34/91] add definitions for phonegap-plugin-barcodescanner (#10974) --- .../phonegap-plugin-barcodescanner-tests.ts | 29 +++++++++++++++ .../phonegap-plugin-barcodescanner.d.ts | 37 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 phonegap-plugin-barcodescanner/phonegap-plugin-barcodescanner-tests.ts create mode 100644 phonegap-plugin-barcodescanner/phonegap-plugin-barcodescanner.d.ts diff --git a/phonegap-plugin-barcodescanner/phonegap-plugin-barcodescanner-tests.ts b/phonegap-plugin-barcodescanner/phonegap-plugin-barcodescanner-tests.ts new file mode 100644 index 0000000000..7b1f23a3fd --- /dev/null +++ b/phonegap-plugin-barcodescanner/phonegap-plugin-barcodescanner-tests.ts @@ -0,0 +1,29 @@ +/// +/// + +cordova.plugins.barcodeScanner.scan( + function (result) { + alert("We got a barcode\n" + + "Result: " + result.text + "\n" + + "Format: " + result.format + "\n" + + "Cancelled: " + result.cancelled); + }, + function (error) { + alert("Scanning failed: " + error); + }, + { + "preferFrontCamera" : true, // iOS and Android + "showFlipCameraButton" : true, // iOS and Android + "prompt" : "Place a barcode inside the scan area", // supported on Android only + "formats" : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED + "orientation" : "landscape" // Android only (portrait|landscape), default unset so it rotates with the device + } +); + + +cordova.plugins.barcodeScanner.encode(cordova.plugins.barcodeScanner.Encode.TEXT_TYPE, "http://www.nytimes.com", function(success) { + alert("encode success: " + success); + }, function(fail) { + alert("encoding failed: " + fail); + } +); \ No newline at end of file diff --git a/phonegap-plugin-barcodescanner/phonegap-plugin-barcodescanner.d.ts b/phonegap-plugin-barcodescanner/phonegap-plugin-barcodescanner.d.ts new file mode 100644 index 0000000000..85bde977b7 --- /dev/null +++ b/phonegap-plugin-barcodescanner/phonegap-plugin-barcodescanner.d.ts @@ -0,0 +1,37 @@ +// Type definitions for phonegap-plugin-barcodescanner +// Project: https://github.com/phonegap/phonegap-plugin-barcodescanner +// Definitions by: Nathan Ainslie +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface CordovaPlugins { + barcodeScanner: phonegapBarcode.BarcodeScanner; +} + +declare namespace phonegapBarcode { + interface BarcodeScanResult { + text: string; + format: string; + cancelled: boolean; + } + + interface BarcodeScanOptions { + preferFrontCamera?: boolean; + showFlipCameraButton?: boolean; + prompt?: string; + formats?: string; + orientation?: "landscape" | "portrait"; + } + + interface EncodingType { + TEXT_TYPE: any; + EMAIL_TYPE: any; + PHONE_TYPE: any; + SMS_TYPE: any; + } + + interface BarcodeScanner { + scan: (success: ((result: BarcodeScanResult) => any), failure?: ((err: any) => any), opts?: BarcodeScanOptions) => void; + encode: (encodingType: EncodingType, data: string, success: ((result: any) => any), failure?: ((err: any) => any)) => void; + Encode: EncodingType; + } +} \ No newline at end of file From d6f0ad10bf45c813d6b954d0994e5ba8902e17b1 Mon Sep 17 00:00:00 2001 From: Tobias Kahlert Date: Tue, 6 Sep 2016 16:51:59 +0200 Subject: [PATCH 35/91] added defs for a filter function to the options (#10975) As described in https://github.com/AvianFlu/ncp the option.filter-property also takes a function, that takes a filename and returns a Boolean signalling, if the given file should be copied or not. --- ncp/ncp-tests.ts | 3 +++ ncp/ncp.d.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ncp/ncp-tests.ts b/ncp/ncp-tests.ts index f1ce04c21e..06f818e0f8 100644 --- a/ncp/ncp-tests.ts +++ b/ncp/ncp-tests.ts @@ -8,6 +8,9 @@ opts = {}; opts = { filter: /abc/ }; +opts = { + filter: (filename: string) => true +}; opts = { transform: (read: NodeJS.ReadableStream, write: NodeJS.WritableStream) => { diff --git a/ncp/ncp.d.ts b/ncp/ncp.d.ts index 50393195e6..b76fa5c912 100644 --- a/ncp/ncp.d.ts +++ b/ncp/ncp.d.ts @@ -10,7 +10,7 @@ declare module 'ncp' { function ncp (source: string, destination: string, options: Options, callback: (err: Error) => void): void; interface Options { - filter? : RegExp; + filter? : RegExp | ((filename: string) => boolean); transform? : (read: NodeJS.ReadableStream, write: NodeJS.WritableStream) => void; clobber? : boolean; stopOnErr? : boolean; From 7c4c718b5b4cbd296eaa2315477b840fe0e0d25e Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 6 Sep 2016 10:53:38 -0400 Subject: [PATCH 36/91] Added `complete` boolean to progress definition (#10843) The `complete` variable is described as (true|false) if the progress status is completed. Quickstart instructions has `complete` in the example. ```javascript var ProgressBar = require('progress'); var bar = new ProgressBar(':bar', { total: 10 }); var timer = setInterval(function () { bar.tick(); if (bar.complete) { console.log('\ncomplete\n'); clearInterval(timer); } }, 100); ``` --- progress/progress.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/progress/progress.d.ts b/progress/progress.d.ts index 6eb55a917e..79c769deaa 100644 --- a/progress/progress.d.ts +++ b/progress/progress.d.ts @@ -114,6 +114,11 @@ declare module "progress" * Terminates a progress bar. */ terminate():void; + + /** + * Completed status of progress (Boolean) + */ + complete:boolean; } namespace ProgressBar { } From 700d3aa99898bfd5cc0cf5d7eef9febc5b1ba400 Mon Sep 17 00:00:00 2001 From: hriss95 Date: Tue, 6 Sep 2016 16:05:45 +0100 Subject: [PATCH 37/91] Node.d.ts: Update definitions for module "dgram" (#10982) --- node/node.d.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 8d0ac7d1b9..d4548c4e6e 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1389,19 +1389,35 @@ declare module "dgram" { port: number; } + interface BindOptions { + port: number; + address?: string; + exclusive?: boolean; + } + + interface SocketOptions { + type: string; + reuseAddr?: boolean; + } + export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + export function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; interface Socket extends events.EventEmitter { - send(buf: Buffer, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; - send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; + send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error, bytes: number) => void): void; + send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; bind(port?: number, address?: string, callback?: () => void): void; - close(): void; + bind(options: BindOptions, callback?: Function): void; + close(callback?: any): void; address(): AddressInfo; setBroadcast(flag: boolean): void; + setTTL(ttl: number): void; setMulticastTTL(ttl: number): void; setMulticastLoopback(flag: boolean): void; addMembership(multicastAddress: string, multicastInterface?: string): void; dropMembership(multicastAddress: string, multicastInterface?: string): void; + ref(): void; + unref(): void; } } From 2bf1d27063c06568ef0f52df6542d1fe3837ed95 Mon Sep 17 00:00:00 2001 From: hriss95 Date: Tue, 6 Sep 2016 16:11:18 +0100 Subject: [PATCH 38/91] Node.d.ts: Update definitions for module "os" (#10986) --- node/node.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/node/node.d.ts b/node/node.d.ts index d4548c4e6e..6d771c9d9f 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -899,6 +899,7 @@ declare module "os" { export function freemem(): number; export function cpus(): CpuInfo[]; export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] }; + export function userInfo(options?: {encoding: string}): { username: string, uid: number, gid: number, shell: any, homedir: string } export var EOL: string; } From 3be6a88598870900567be5ac505ecd00a7b62c4b Mon Sep 17 00:00:00 2001 From: hriss95 Date: Tue, 6 Sep 2016 16:12:01 +0100 Subject: [PATCH 39/91] Node.d.ts: Update definitions for module "fs" (#10987) --- node/node.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 6d771c9d9f..18d1a378cf 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1719,6 +1719,8 @@ declare module "fs" { fd?: number; mode?: number; }): WriteStream; + export function fdatasync(fd: number, callback: Function): void; + export function fdatasyncSync(fd: number): void; } declare module "path" { From bbbc2633179c978b41ab44c6a37a260cf7f4f21b Mon Sep 17 00:00:00 2001 From: Mickael Burguet Date: Tue, 6 Sep 2016 11:12:59 -0400 Subject: [PATCH 40/91] [pino]: Fix constructor argument stream typing --- pino/pino.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pino/pino.d.ts b/pino/pino.d.ts index 1d7049cf05..0a51c49275 100644 --- a/pino/pino.d.ts +++ b/pino/pino.d.ts @@ -41,8 +41,8 @@ declare module 'pino' { } interface Pino { - (optionsOrStream?: LoggerOptions | stream.Writable): Logger - (options: LoggerOptions, stream: stream.Writable): Logger + (optionsOrStream?: LoggerOptions | stream.Writable | stream.Readable): Logger + (options: LoggerOptions, stream: stream.Writable | stream.Readable): Logger levels: { values: LevelLabelsToValues labels: LevelValuesToLabels From 15c0df84ce1ffebc85296a28b337dc348052e599 Mon Sep 17 00:00:00 2001 From: hriss95 Date: Tue, 6 Sep 2016 16:19:06 +0100 Subject: [PATCH 41/91] Node.d.ts: Update definitions for module "util" (#10989) --- node/node.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 18d1a378cf..af9cdd93dd 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -2338,6 +2338,18 @@ declare module "util" { export function isError(object: any): boolean; export function inherits(constructor: any, superConstructor: any): void; export function debuglog(key: string): (msg: string, ...param: any[]) => void; + export function isBoolean(object: any): boolean; + export function isBuffer(object: any): boolean; + export function isFunction(object: any): boolean; + export function isNull(object: any): boolean; + export function isNullOrUndefined(object: any): boolean; + export function isNumber(object: any): boolean; + export function isObject(object: any): boolean; + export function isPrimitive(object: any): boolean; + export function isString(object: any): boolean; + export function isSymbol(object: any): boolean; + export function isUndefined(object: any): boolean; + export function deprecate(fn: Function, message: string): Function; } declare module "assert" { From 8caf4a5724a92a6f6edfae151b3defb38eb8b04a Mon Sep 17 00:00:00 2001 From: hriss95 Date: Tue, 6 Sep 2016 16:19:55 +0100 Subject: [PATCH 42/91] Node.d.ts: Update definitions for module "dns" (#10990) --- node/node.d.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index af9cdd93dd..d8ec206f42 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1288,6 +1288,32 @@ declare module "dns" { export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; export function reverse(ip: string, callback: (err: Error, domains: string[]) => void): string[]; + + //Error codes + export var NODATA: string; + export var FORMERR: string; + export var SERVFAIL: string; + export var NOTFOUND: string; + export var NOTIMP: string; + export var REFUSED: string; + export var BADQUERY: string; + export var BADNAME: string; + export var BADFAMILY: string; + export var BADRESP: string; + export var CONNREFUSED: string; + export var TIMEOUT: string; + export var EOF: string; + export var FILE: string; + export var NOMEM: string; + export var DESTRUCTION: string; + export var BADSTR: string; + export var BADFLAGS: string; + export var NONAME: string; + export var BADHINTS: string; + export var NOTINITIALIZED: string; + export var LOADIPHLPAPI: string; + export var ADDRGETNETWORKPARAMS: string; + export var CANCELLED: string; } declare module "net" { From 5bf030ac72d0b748689be18a69df22843ebb0aa5 Mon Sep 17 00:00:00 2001 From: Masahiro Wakame Date: Wed, 7 Sep 2016 00:20:08 +0900 Subject: [PATCH 43/91] suppress error about node/node-tests.ts with --target es5 (#11056) --- node/node-tests.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/node/node-tests.ts b/node/node-tests.ts index 4dd490fd35..de2f284c1f 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -263,9 +263,11 @@ function bufferTests() { let buffer = new Buffer('123'); let val: [number, number]; + /* comment out for --target es5 for (let entry of buffer.entries()) { val = entry; } + */ } { @@ -286,18 +288,22 @@ function bufferTests() { let buffer = new Buffer('123'); let val: number; + /* comment out for --target es5 for (let key of buffer.keys()) { val = key; } + */ } { let buffer = new Buffer('123'); let val: number; + /* comment out for --target es5 for (let value of buffer.values()) { val = value; } + */ } // Imported Buffer from buffer module works properly @@ -1001,4 +1007,4 @@ namespace process_tests{ var eventEmitter: events.EventEmitter; eventEmitter = process; // Test that process implements EventEmitter... } -} \ No newline at end of file +} From 03f3ca4333161dea8c5fa0ba47d55b02da92d40d Mon Sep 17 00:00:00 2001 From: Nick Zelei Date: Tue, 6 Sep 2016 10:26:30 -0500 Subject: [PATCH 44/91] added missing property to child_process (#10997) added missing property to child_process --- node/node-0.10.d.ts | 1 + node/node-0.11.d.ts | 1 + node/node-0.12.d.ts | 1 + node/node-0.8.8.d.ts | 1 + node/node-4.d.ts | 1 + 5 files changed, 5 insertions(+) diff --git a/node/node-0.10.d.ts b/node/node-0.10.d.ts index 80b46a475c..9055ec82a7 100644 --- a/node/node-0.10.d.ts +++ b/node/node-0.10.d.ts @@ -688,6 +688,7 @@ declare module "child_process" { pid: number; kill(signal?: string): void; send(message: any, sendHandle: any): void; + connected: boolean; disconnect(): void; } diff --git a/node/node-0.11.d.ts b/node/node-0.11.d.ts index 212768c21a..91cfef468d 100644 --- a/node/node-0.11.d.ts +++ b/node/node-0.11.d.ts @@ -611,6 +611,7 @@ declare module "child_process" { pid: number; kill(signal?: string): void; send(message: any, sendHandle: any): void; + connected: boolean; disconnect(): void; } diff --git a/node/node-0.12.d.ts b/node/node-0.12.d.ts index 49091419a8..4459ebe96a 100644 --- a/node/node-0.12.d.ts +++ b/node/node-0.12.d.ts @@ -829,6 +829,7 @@ declare module "child_process" { pid: number; kill(signal?: string): void; send(message: any, sendHandle?: any): void; + connected: boolean; disconnect(): void; unref(): void; } diff --git a/node/node-0.8.8.d.ts b/node/node-0.8.8.d.ts index 321c386655..2be7c6aae3 100644 --- a/node/node-0.8.8.d.ts +++ b/node/node-0.8.8.d.ts @@ -545,6 +545,7 @@ declare module "child_process" { pid: number; kill(signal?: string): void; send(message: any, sendHandle: any): void; + connected: boolean; disconnect(): void; } diff --git a/node/node-4.d.ts b/node/node-4.d.ts index 4516331d7d..2dffaac688 100644 --- a/node/node-4.d.ts +++ b/node/node-4.d.ts @@ -1036,6 +1036,7 @@ declare module "child_process" { pid: number; kill(signal?: string): void; send(message: any, sendHandle?: any): void; + connected: boolean; disconnect(): void; unref(): void; } From 3fd4936d27036760eca71110d833bb1e33529c13 Mon Sep 17 00:00:00 2001 From: Amy Slagle Date: Tue, 6 Sep 2016 14:06:53 -0400 Subject: [PATCH 45/91] jsdom: Added changeURL. --- jsdom/jsdom.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/jsdom/jsdom.d.ts b/jsdom/jsdom.d.ts index c6ebde2ce3..2efebc059f 100644 --- a/jsdom/jsdom.d.ts +++ b/jsdom/jsdom.d.ts @@ -68,6 +68,7 @@ declare module "jsdom" { export function createCookieJar(): CookieJar; export function nodeLocation(node: Node): any; export function reconfigureWindow(window: Window, newProps: WindowProperties): void; + export function changeURL(window: Window, url: string): void; export function jQueryify(window: Window, jqueryUrl: string, callback: (window: Window, jquery: JQuery) => any): void; From 9db6c38b188c1b1e495d012da2871e387b5b6e9b Mon Sep 17 00:00:00 2001 From: Julien CROUZET Date: Tue, 6 Sep 2016 21:01:03 +0200 Subject: [PATCH 46/91] Add bluebird's cancelation method. From request-promise v4.1.0 (2016-07-30), Bluebird `cancel()` is exposed. https://github.com/request/request-promise/pull/123 http://bluebirdjs.com/docs/api/cancellation.html --- request-promise/request-promise.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/request-promise/request-promise.d.ts b/request-promise/request-promise.d.ts index 5a5927284f..e7febe94d3 100644 --- a/request-promise/request-promise.d.ts +++ b/request-promise/request-promise.d.ts @@ -23,6 +23,7 @@ declare module 'request-promise' { finally(handler: () => PromiseLike): Promise; finally(handler: () => TResult): Promise; promise(): Promise; + cancel(): void; } interface RequestPromiseOptions extends request.CoreOptions { From bd33db1db56619530151db2511528740110b899d Mon Sep 17 00:00:00 2001 From: jan-molak Date: Tue, 6 Sep 2016 20:32:21 +0100 Subject: [PATCH 47/91] Amended the signature of the callback function so that it's up to date with the latest version of cucumber-js. https://github.com/cucumber/cucumber-js#step-definitions --- cucumber/cucumber-tests.ts | 10 +++++----- cucumber/cucumber.d.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cucumber/cucumber-tests.ts b/cucumber/cucumber-tests.ts index d6ada278c2..816f0e7c70 100644 --- a/cucumber/cucumber-tests.ts +++ b/cucumber/cucumber-tests.ts @@ -4,27 +4,27 @@ function StepSample() { type Callback = cucumber.CallbackStepDefinition; var step = this; var hook = this; - + hook.Before(function(scenario, callback){ scenario.isFailed() && callback.pending(); }) - + hook.Around(function(scenario, runScenario) { scenario.isFailed() && runScenario(null, function(){ console.log('finish tasks'); }); }); - + hook.registerHandler('AfterFeatures', function (event, callback) { callback(); }); - + step.Given(/^I am on the Cucumber.js GitHub repository$/, function(callback:Callback) { this.visit('https://github.com/cucumber/cucumber-js', callback); }); step.When(/^I go to the README file$/, function(title:string, callback:Callback) { - callback.pending(); + callback(null, 'pending'); }); step.Then(/^I should see "(.*)" as the page title$/, { timeout:60*1000}, function(title:string, callback:Callback) { diff --git a/cucumber/cucumber.d.ts b/cucumber/cucumber.d.ts index 6c4273e4e0..dc5c44ef33 100644 --- a/cucumber/cucumber.d.ts +++ b/cucumber/cucumber.d.ts @@ -7,7 +7,7 @@ declare namespace cucumber { export interface CallbackStepDefinition{ pending : () => PromiseLike; - (errror?:any):void; + (errror?:any, pending?: string):void; } interface StepDefinitionCode { From ff773ccff899b0dc1826508f12516b831cddc04c Mon Sep 17 00:00:00 2001 From: rvassar Date: Tue, 6 Sep 2016 14:56:46 -0700 Subject: [PATCH 48/91] Added a constructor and interface for the OSM class. --- openlayers/openlayers.d.ts | 77 +++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 25 deletions(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index ec180bf45d..486a488724 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -211,6 +211,30 @@ declare namespace olx { /** experimental Whether to wrap the world horizontally. When set to false, only one world will be rendered. When true, tiles will be requested for one world only, but they will be wrapped horizontally to render multiple worlds. The default is true. */ wrapX?: boolean; } + interface OSMOptions { + /** Attributions */ + attributions?: ol.AttributionLike; + /** Cache size. Default is 2048. */ + cacheSize?: number; + /** + * The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL + * renderer or if you want to access pixel data with the Canvas renderer. + * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. Default is anonymous. + */ + crossOrigin?: string; + /** Max zoom. Default is 19. */ + maxZoom?: number; + /** Whether the layer is opaque. Default is true. */ + opaque?: boolean; + /** Maximum allowed reprojection error (in pixels). Default is 0.5. Higher values can increase reprojection performance, but decrease precision. */ + reprojectionErrorThreshold?: number; + /** Optional function to load a tile given a URL. */ + tileLoadFunction?: ol.TileLoadFunctionType; + /** URL template. Must include {x}, {y} or {-y}, and {z} placeholders. Default is https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png. */ + url?: string; + /** Whether to wrap the world horizontally. Default is true. */ + wrapX?: boolean; + } /** * Object literal with config options for the map logo. */ @@ -791,24 +815,24 @@ declare namespace olx { */ wrapX?: boolean; } - + interface ClusterOptions extends VectorOptions{ - + /** * Minimum distance in pixels between clusters. Default is 20. */ distance?: number; - + extent?: ol.Extent; - + geometryFunction?: any; - + projection?: ol.proj.ProjectionLike; - + source: ol.source.Vector; - + } - + interface WMTSOptions { attributions?: Array; crossOrigin?: string; @@ -1127,6 +1151,8 @@ declare namespace ol { interface ImageLoadFunctionType { (image: ol.Image, url: string): void } + type AttributionLike = string | Array | ol.Attribution | Array + /** * An attribution for a layer source. */ @@ -2422,9 +2448,9 @@ declare namespace ol { * @returns Control.s */ function defaults(options?: olx.control.DefaultsOptions): ol.Collection; - + namespace ScaleLine { - + /** * Units for the scale line. Supported values are 'degrees', 'imperial', 'nautical', 'metric', 'us'. */ @@ -2433,29 +2459,29 @@ declare namespace ol { class Control extends ol.Object{ constructor(options: olx.control.ControlOptions); - + /** * Get the map associated with this control. */ getMap():ol.Map; - + /** - * Remove the control from its current map and attach it to the new map. + * Remove the control from its current map and attach it to the new map. * Subclasses may set up event handlers to get notified about changes to the map here. */ setMap(map: ol.Map):void; - + /** - * This function is used to set a target element for the control. - * It has no effect if it is called after the control has been added to the map (i.e. after setMap is called on the control). + * This function is used to set a target element for the control. + * It has no effect if it is called after the control has been added to the map (i.e. after setMap is called on the control). * If no target is set in the options passed to the control constructor and if setTarget is not called then the control is * added to the map's overlay container. */ setTarget(target: Element | string):void; - - + + } - + class Attribution extends Control { } @@ -2472,17 +2498,17 @@ declare namespace ol { } class ScaleLine extends Control { - + /** * Return the units to use in the scale line. */ getUnits(): ScaleLine.Units; - + /** * Set the units to use in the scale line. */ setUnits(units: ScaleLine.Units): void; - + } class Zoom extends Control{ @@ -4061,7 +4087,7 @@ declare namespace ol { * @argument map. */ setMap(map: ol.Map): void; - + /** * Set Z-index of the layer, which is used to order layers before rendering. The default Z-index is 0. */ @@ -4254,12 +4280,13 @@ declare namespace ol { } class OSM extends XYZ { + constructor(opt_options?: olx.OSMOptions); } class Source extends ol.Object { - + constructor(options: any); - + /** * Get the projection of the source. * @return Projection. From e11ba9884dd1e45f9d6c9966737025f2e7776600 Mon Sep 17 00:00:00 2001 From: rvassar Date: Tue, 6 Sep 2016 15:00:28 -0700 Subject: [PATCH 49/91] Added a constructor and options interface for the Rotate class. --- openlayers/openlayers.d.ts | 72 ++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index ec180bf45d..319b770cc3 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -48,6 +48,25 @@ declare namespace olx { extent: ol.Extent; } + interface RotateOptions { + /*** CSS class name. Default is ol-rotate.*/ + className?: string; + /*** Text label to use for the rotate button. Default is ⇧. Instead of text, also a Node (e.g. a span element) can be used.*/ + label?: string | Element; + /*** Text label to use for the rotate tip. Default is Reset rotation.*/ + tipLabel?: string; + /*** Animation duration in milliseconds. Default is 250.*/ + duration?: number; + /*** Hide the control when rotation is 0. Default is true.*/ + autoHide?: boolean; + /*** Function called when the control should be re-rendered. This is called in a requestAnimationFrame callback.*/ + render?: Function; + /*** Function called when the control is clicked. This will override the default resetNorth.*/ + resetNorth?: Function; + /*** Target.*/ + target?: Element; + } + interface AttributionOptions { /** HTML markup for this attribution. */ @@ -791,24 +810,24 @@ declare namespace olx { */ wrapX?: boolean; } - + interface ClusterOptions extends VectorOptions{ - + /** * Minimum distance in pixels between clusters. Default is 20. */ distance?: number; - + extent?: ol.Extent; - + geometryFunction?: any; - + projection?: ol.proj.ProjectionLike; - + source: ol.source.Vector; - + } - + interface WMTSOptions { attributions?: Array; crossOrigin?: string; @@ -2422,9 +2441,9 @@ declare namespace ol { * @returns Control.s */ function defaults(options?: olx.control.DefaultsOptions): ol.Collection; - + namespace ScaleLine { - + /** * Units for the scale line. Supported values are 'degrees', 'imperial', 'nautical', 'metric', 'us'. */ @@ -2433,29 +2452,29 @@ declare namespace ol { class Control extends ol.Object{ constructor(options: olx.control.ControlOptions); - + /** * Get the map associated with this control. */ getMap():ol.Map; - + /** - * Remove the control from its current map and attach it to the new map. + * Remove the control from its current map and attach it to the new map. * Subclasses may set up event handlers to get notified about changes to the map here. */ setMap(map: ol.Map):void; - + /** - * This function is used to set a target element for the control. - * It has no effect if it is called after the control has been added to the map (i.e. after setMap is called on the control). - * If no target is set in the options passed to the control constructor and if setTarget is not called then the control is + * This function is used to set a target element for the control. + * It has no effect if it is called after the control has been added to the map (i.e. after setMap is called on the control). + * If no target is set in the options passed to the control constructor and if setTarget is not called then the control is * added to the map's overlay container. */ setTarget(target: Element | string):void; - - + + } - + class Attribution extends Control { } @@ -2469,20 +2488,21 @@ declare namespace ol { } class Rotate extends Control { + constructor(opt_options?: olx.RotateOptions); } class ScaleLine extends Control { - + /** * Return the units to use in the scale line. */ getUnits(): ScaleLine.Units; - + /** * Set the units to use in the scale line. */ setUnits(units: ScaleLine.Units): void; - + } class Zoom extends Control{ @@ -4061,7 +4081,7 @@ declare namespace ol { * @argument map. */ setMap(map: ol.Map): void; - + /** * Set Z-index of the layer, which is used to order layers before rendering. The default Z-index is 0. */ @@ -4257,9 +4277,9 @@ declare namespace ol { } class Source extends ol.Object { - + constructor(options: any); - + /** * Get the projection of the source. * @return Projection. From 762c57262d4ffe294060f828b4671b0c8540416b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lachance Date: Tue, 6 Sep 2016 18:29:33 -0400 Subject: [PATCH 50/91] + Add the missing optional callback for the MockJaxSettings.response function --- jquery-mockjax/jquery-mockjax-tests.ts | 48 ++++++++++++++++++++------ jquery-mockjax/jquery-mockjax.d.ts | 2 +- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/jquery-mockjax/jquery-mockjax-tests.ts b/jquery-mockjax/jquery-mockjax-tests.ts index 6fae52eb07..55e77cd2bb 100644 --- a/jquery-mockjax/jquery-mockjax-tests.ts +++ b/jquery-mockjax/jquery-mockjax-tests.ts @@ -9,7 +9,7 @@ class Tests { run(): void { const self = this; - var t = QUnit.test; + let t = QUnit.test; QUnit.begin(() => { @@ -36,7 +36,7 @@ class Tests { responseText: 'Hello Word' }); - var xhr = $.ajax({ + let xhr = $.ajax({ url: '/xmlhttprequest', complete: () => { } }); @@ -67,7 +67,7 @@ class Tests { }); t('Intercept asynchronized proxy calls', (assert) => { - var done = assert.async(); + let done = assert.async(); $.mockjax({ url: '/proxy', proxy: 'test_proxy.json' @@ -85,7 +85,7 @@ class Tests { }); t('Intercept and proxy (sub-ajax request)', (assert) => { - var done = assert.async(); + let done = assert.async(); $.mockjax({ url: '/proxy', @@ -104,7 +104,7 @@ class Tests { }); t('Proxy type specification', (assert) => { - var done = assert.async(); + let done = assert.async(); $.mockjax({ url: '/proxy', @@ -124,7 +124,7 @@ class Tests { }); t('Support 1.5 $.ajax(url, settings) signature.', (assert) => { - var done = assert.async(); + let done = assert.async(); $.mockjax({ url: '/resource', @@ -141,9 +141,9 @@ class Tests { }); t('Dynamic response callback', (assert) => { - var done = assert.async(); + let done = assert.async(); - var settings: MockJaxSettings = { + let settings: MockJaxSettings = { url: '/response-callback', response: (settings) => { settings.responseText = settings.data.response + ' 2'; @@ -165,8 +165,36 @@ class Tests { } }); }); + + t('Asyncronous response callback', (assert) => { + let done = assert.async(); + + let settings: MockJaxSettings = { + url: '/async-response-callback', + response: (settings, callback) => { + setTimeout(() => { + settings.responseText = settings.data.response + ' 3'; + callback(); + }, 10); + } + }; + + $.mockjax(settings); + + $.ajax({ + url: '/async-response-callback', + dataType: 'text', + data: { + response: 'Hello world' + }, + error: self._noErrorCallbackExpected, + complete: (xhr) => { + assert.equal(xhr.responseText, 'Hello world 3', 'Response Text matches'); + done(); + } + }); + }); } } -var tests = new Tests(); -tests.run(); +new Tests().run(); diff --git a/jquery-mockjax/jquery-mockjax.d.ts b/jquery-mockjax/jquery-mockjax.d.ts index 7505a30e6f..8a7c64d815 100644 --- a/jquery-mockjax/jquery-mockjax.d.ts +++ b/jquery-mockjax/jquery-mockjax.d.ts @@ -22,7 +22,7 @@ interface MockJaxSettings { isTimeout?: boolean; dataType?: string; contentType?: string; - response?: (settings: any) => void; + response?: (settings: any, callback?: Function) => void; responseText?: string | Object; responseXml?: string; proxy?: string; From 0bc8dbd7d90b2b7ad2de5bf43bf607cb6e0a9fbe Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lachance Date: Tue, 6 Sep 2016 18:41:35 -0400 Subject: [PATCH 51/91] * Rename the parameter to fit with the doc (https://github.com/jakerella/jquery-mockjax/#callback) --- jquery-mockjax/jquery-mockjax-tests.ts | 4 ++-- jquery-mockjax/jquery-mockjax.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery-mockjax/jquery-mockjax-tests.ts b/jquery-mockjax/jquery-mockjax-tests.ts index 55e77cd2bb..36ebd7e64c 100644 --- a/jquery-mockjax/jquery-mockjax-tests.ts +++ b/jquery-mockjax/jquery-mockjax-tests.ts @@ -171,10 +171,10 @@ class Tests { let settings: MockJaxSettings = { url: '/async-response-callback', - response: (settings, callback) => { + response: (settings, completed) => { setTimeout(() => { settings.responseText = settings.data.response + ' 3'; - callback(); + completed(); }, 10); } }; diff --git a/jquery-mockjax/jquery-mockjax.d.ts b/jquery-mockjax/jquery-mockjax.d.ts index 8a7c64d815..c054f33317 100644 --- a/jquery-mockjax/jquery-mockjax.d.ts +++ b/jquery-mockjax/jquery-mockjax.d.ts @@ -22,7 +22,7 @@ interface MockJaxSettings { isTimeout?: boolean; dataType?: string; contentType?: string; - response?: (settings: any, callback?: Function) => void; + response?: (settings: any, done?: Function) => void; responseText?: string | Object; responseXml?: string; proxy?: string; From fbfb2a48ec6a06dcaacfe4ee1d2880c51a848883 Mon Sep 17 00:00:00 2001 From: Sumit Kumar Maitra Date: Wed, 7 Sep 2016 00:43:03 +0100 Subject: [PATCH 52/91] Updating Quill JS definitions to v1.0.0 Refactoring definitions as per latest guidelines/best-practices Built using Typescript 1.8 --- quill/quill-tests.ts | 78 +++++++----------- quill/quill.d.ts | 183 ++++++++++++++++++------------------------- 2 files changed, 104 insertions(+), 157 deletions(-) diff --git a/quill/quill-tests.ts b/quill/quill-tests.ts index 3a87bd5948..dbf8cb466f 100644 --- a/quill/quill-tests.ts +++ b/quill/quill-tests.ts @@ -1,10 +1,6 @@ /// -/// - -//export var Quill = require("quill"); function test_quill() { - var quillEditor = new Quill('#editor', { modules: { @@ -14,6 +10,31 @@ function test_quill() { }); } +function test_deleteText() { + var quillEditor = new Quill('#editor'); + quillEditor.deleteText(0, 10); +} + +function test_disable() { + let quillEditor = new Quill('#Editor'); + quillEditor.disable(); +} + +function test_enable() { + let quillEditor = new Quill('#Editor'); + quillEditor.enable(); +} + +function test_getContents() { + var quillEditor = new Quill('#editor'); + var delta: QuillJS.DeltaStatic = quillEditor.getContents(); +} + +function test_getLength() { + var quillEditor = new Quill('#editor'); + var num: number = quillEditor.getLength(); +} + function test_getText() { var quillEditor = new Quill('#editor'); var strValue: string = quillEditor.getText(); @@ -29,26 +50,11 @@ function test_getText_substring() { var strValue: string = quillEditor.getText(0, 10); } -function test_getLength() { - var quillEditor = new Quill('#editor'); - var num: number = quillEditor.getLength(); -} - -function test_getContents() { - var quillEditor = new Quill('#editor'); - var delta: DeltaStatic = quillEditor.getContents(); -} - function test_insertText() { var quillEditor = new Quill('#editor'); quillEditor.insertText(0, "Hello World"); } -function test_deleteText() { - var quillEditor = new Quill('#editor'); - quillEditor.deleteText(0, 10); -} - function test_formatText() { var quillEditor = new Quill('#editor'); quillEditor.formatText(0, 5, 'bold', true); @@ -71,7 +77,7 @@ function test_formatLine() { function test_insertEmbed() { var quillEditor = new Quill('#editor'); - quillEditor.insertEmbed(10, 'image', 'http://quilljs.com/images/cloud.png'); + quillEditor.insertEmbed(10, 'image', 'http://com/images/cloud.png'); } function test_updateContents() { @@ -96,12 +102,6 @@ function test_setContents() { ]); } -function test_setHTML() { - var quillEditor = new Quill('#editor'); - - quillEditor.setHTML('
Hello
'); -} - function test_setText() { var quillEditor = new Quill('#editor'); quillEditor.setText('Hello\n'); @@ -113,10 +113,10 @@ function test_getSelection() { var range = quillEditor.getSelection(); if (range) { - if (range.start == range.end) { - console.log('User cursor is at index', range.start); + if (range.index == range.length) { + console.log('User cursor is at index', range.index); } else { - var text = quillEditor.getText(range.start, range.end); + var text = quillEditor.getText(range.index, range.length); console.log('User has highlighted: ', text); } } else { @@ -129,11 +129,6 @@ function test_setSelection() { quillEditor.setSelection(0, 5); } -function test_prepareFormat() { - var quillEditor = new Quill('#editor'); - quillEditor.prepareFormat('bold', true); -} - function test_focus() { var quillEditor = new Quill('#editor'); quillEditor.focus(); @@ -144,14 +139,6 @@ function test_getBounds() { quillEditor.setText('Hello\nWorld\n'); } -function test_addModule() { - var quillEditor = new Quill('#editor'); - - var toolbar = quillEditor.addModule('toolbar', { - container: '#toolbar-container' - }); -} - function test_getModule() { var quillEditor = new Quill('#editor'); @@ -159,13 +146,6 @@ function test_getModule() var toolbar = quillEditor.getModule('toolbar'); } - -function test_addFormat() -{ - var quillEditor = new Quill('#editor'); - quillEditor.addFormat('strike', { tag: 'S', prepare: 'strikeThrough' }); -} - function test_addContainer() { var quillEditor = new Quill('#editor'); diff --git a/quill/quill.d.ts b/quill/quill.d.ts index 3cef088442..f1afd4c69f 100644 --- a/quill/quill.d.ts +++ b/quill/quill.d.ts @@ -1,118 +1,85 @@ -// Type definitions for Quill +// Type definitions for Quill v1.0.0 // Project: http://quilljs.com // Definitions by: Sumit // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +declare namespace QuillJS { -declare interface DeltaStatic{ - ops? : Array; - retain?: any, - delete?: any, - insert?: any, - attributes?: any + + export interface BoundsStatic { + left: number, + top: number, + height: number, + width: number + } + + export interface DeltaStatic { + ops?: Array; + retain?: any, + delete?: any, + insert?: any, + attributes?: any + } + + export interface RangeStatic { + new (): RangeStatic; + index: number; + length: number; + } + + export interface QuillStatic { + new (selector: string, options?: Object): QuillStatic; + + deleteText(start: number, end: number, source?: string): void; + disable(): void; + enable(enabled?: boolean): void; + getContents(start?: number, end?: number): DeltaStatic; + getLength(): number; + getText(start?: number, end?: number): string; + insertEmbed(index: number, type: string, url: string, source?: string): void; + insertText(index: number, text: string, source?: string): void; + insertText(index: number, text: string, format: string, value: string, source?: string): void; + insertText(index: number, text: string, formats: any, source?: string): void; + pasteHTML(): string; + setContents(delta: DeltaStatic, source?: string): void; + setText(text: string, source?: string): void; + update(source?: string): void; + updateContents(delta: DeltaStatic, source?: string): void; + + format(name: string, value: any, source?: string): void; + formatLine(index: number, length: number, source?: string): void; + formatLine(index: number, length: number, format: string, value: any, source?: string): void; + formatLine(index: number, length: number, formats: any, source?: string): void; + formatText(index: number, length: number, source?: string): void; + formatText(index: number, length: number, format: string, value: any, source?: string): void; + formatText(index: number, length: number, formats: any, source?: string): void; + getFormat(range?: RangeStatic): any; + getFormat(index: number, length?: number): any; + removeFormat(index: Number, length: Number, source?: String): void; + + blur(): void; + focus(): void; + getBounds(index: number, length?: number): BoundsStatic; + getSelection(focus?: boolean): RangeStatic; + hasFocus(): boolean; + setSelection(index: number, length: number, source?: string): void; + setSelection(range: RangeStatic, source?: string): void; + + on(eventName: string, callback: (delta: DeltaStatic, oldContents: DeltaStatic, source: String) => void): QuillStatic; + on(eventName: string, callback: (range: RangeStatic, oldRange: RangeStatic, source: String) => void): QuillStatic; + once(eventName: string, callback: (delta: DeltaStatic, source: string) => void): QuillStatic; + off(eventName: string, callback: (delta: DeltaStatic, source: string) => void): QuillStatic; + + debug(level: string): void; + import(path: string): any; + register(path: string, def: any, suppressWarning?: boolean): void; + register(defs: any, suppressWarning?: boolean): void; + addContainer(className: string, refNode?: any): any; + getModule(name: string): any + } } -declare interface RangeStatic{ - new(): RangeStatic; - start: number; - end: number; -} - -declare interface QuillStatic { - new(selector: string, options?: Object):QuillStatic; - - on(eventName: string, callback: (delta: DeltaStatic, source: string) => void): EventEmitter2; - addModule(id: string, options: any) : Object; - - getText(): string; - getText(start: number): string; - getText(start: number, end: number): string; - - getLength(): number; - - getContents(): DeltaStatic; - getContents(start: number): DeltaStatic; - getContents(start: number, end: number): DeltaStatic; - - getHTML(): string; - - insertText(index: number, text: string): void; - insertText(index: number, text: string, name: string, value: string): void; - insertText(index: number, text: string, formats: any): void; - insertText(index: number, text: string, source: string) : void; - insertText(index: number, text: string, name: string, value: string, source: string): void; - insertText(index: number, text: string, formats: any, source: string): void; - - deleteText(start: number, end: number): void; - deleteText(start: number, end: number, source: string): void; - - formatText(start: number, end: number): void; - formatText(start: number, end: number, name: string, value: boolean): void; - formatText(start: number, end: number, formats: any): void; - formatText(start: number, end: number, source: string): void; - formatText(start: number, end: number, name: string, value: string, source: string): void; - formatText(start: number, end: number, formats: string, source: string): void; - - - formatLine(start: number, end: number): void; - formatLine(start: number, end: number, name: string, value: boolean): void; - formatLine(start: number, end: number, formats: any): void; - formatLine(start: number, end: number, source: string): void; - formatLine(start: number, end: number, name: string, value: string, source: string): void; - formatLine(start: number, end: number, formats: any, source: string): void; - - - insertEmbed(index: number, type: string, url: string): void; - insertEmbed(index: number, type: string, url: string, source: string): void; - - updateContents(delta: DeltaStatic): void; - - setContents(delta: DeltaStatic): void; - - setHTML(html: string): void; - - setText(text: string): void; - - getSelection(): RangeStatic; - - setSelection(start: number, end: number): void; - setSelection(start: number, end: number, source: string): void; - setSelection(range: RangeStatic): void; - setSelection(range: RangeStatic, source: string): void; - - prepareFormat(format: string, value: boolean): void; - - focus(): void; - - getBounds(index: number): any; - - registerModule(name: string, callback: (quill: QuillStatic, options: any) => {}): any; - - addModule(name: string, options: any): any; - - getModule(name: string): any; - - onModuleLoad(name: string, callback: (input: any) => {}): void; - - addFormat(name: string, config: any): void; - - addContainer(cssClass: string, before?: number): HTMLDivElement; -} - -declare module "Range" -{ - var Range: RangeStatic; - export = Range; -} - -declare var Delta: DeltaStatic; - -declare module "Delta"{ - export = Delta; -} - -declare var Quill: QuillStatic; +declare var Quill: QuillJS.QuillStatic; declare module "Quill" { export = Quill; From 6e2f2280ef16ef277049d0ce8583af167d586c59 Mon Sep 17 00:00:00 2001 From: Nicolas Thiebaud Date: Tue, 6 Sep 2016 17:57:44 -0700 Subject: [PATCH 53/91] Add tick() to d3.layout.Force --- d3/d3.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 3ad327ffc3..d539b7439d 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -297,7 +297,7 @@ declare namespace d3 { * @param value the function to compute data for each node */ datum(value: (datum: Datum, index: number, outerIndex: number) => NewDatum): Update; - + /** * Set the data item for each node in the selection. * @param value the constant element to use for each node @@ -415,7 +415,7 @@ declare namespace d3 { select(name: (datum: Datum, index: number, outerIndex: number) => EventTarget): Selection; call(func: (selection: Enter, ...args: any[]) => any, ...args: any[]): Enter; - + empty(): boolean; size(): number; } @@ -1078,7 +1078,7 @@ declare namespace d3 { * Return the min and max simultaneously. */ export function extent(array: T[], accessor: (datum: T, index: number) => string): [string, string]; - + /** * Return the min and max simultaneously. */ @@ -2928,6 +2928,8 @@ declare namespace d3 { start(): Force; + tick(): Force; + alpha(): number; alpha(value: number): Force; From d13b79b85168ffcfccf2923b076a03e02705601f Mon Sep 17 00:00:00 2001 From: Sumit Kumar Maitra Date: Wed, 7 Sep 2016 03:37:18 +0100 Subject: [PATCH 54/91] Updated Quill definitions (to v1.0.0) with revisions as per inputs from @zhengbli --- quill/quill-tests.ts | 23 +++++++++++++++++- quill/quill.d.ts | 55 +++++++++++++++++++++++++------------------- 2 files changed, 53 insertions(+), 25 deletions(-) diff --git a/quill/quill-tests.ts b/quill/quill-tests.ts index dbf8cb466f..5116ace525 100644 --- a/quill/quill-tests.ts +++ b/quill/quill-tests.ts @@ -69,11 +69,24 @@ function test_formatText2() { }); } -function test_formatLine() { +function test_formatLine1() { + var quillEditor = new Quill('#editor'); + quillEditor.formatLine(1, 3, 'api'); +} + +function test_formatLine2() { var quillEditor = new Quill('#editor'); quillEditor.formatLine(1, 3, 'align', 'right'); } +function test_formatLine3() { + var quillEditor = new Quill('#editor'); + quillEditor.formatLine(1, 3, { + 'align': 'right', + 'bold': false, + }); +} + function test_insertEmbed() { var quillEditor = new Quill('#editor'); @@ -151,3 +164,11 @@ function test_addContainer() var quillEditor = new Quill('#editor'); quillEditor.addContainer('ql-custom'); } + +function test_on_EventType1(){ + var quillEditor = new Quill('#editor'); + quillEditor.on('text-change', (newDelta, oldDelta, source)=>{ + // happened + }); + +} diff --git a/quill/quill.d.ts b/quill/quill.d.ts index f1afd4c69f..2ec959ef99 100644 --- a/quill/quill.d.ts +++ b/quill/quill.d.ts @@ -5,6 +5,13 @@ declare namespace QuillJS { + export interface QuillOptionsStatic { + debug?: string, + modules?: {[key: string]: any}, + placeholder?: string, + readOnly?: boolean, + theme?: string + } export interface BoundsStatic { left: number, @@ -28,52 +35,52 @@ declare namespace QuillJS { } export interface QuillStatic { - new (selector: string, options?: Object): QuillStatic; + new (selector: string, options?: QuillOptionsStatic): QuillStatic; - deleteText(start: number, end: number, source?: string): void; + deleteText(start: number, end: number, source?: "api"|"user"|"silent"): void; disable(): void; enable(enabled?: boolean): void; getContents(start?: number, end?: number): DeltaStatic; getLength(): number; getText(start?: number, end?: number): string; - insertEmbed(index: number, type: string, url: string, source?: string): void; - insertText(index: number, text: string, source?: string): void; - insertText(index: number, text: string, format: string, value: string, source?: string): void; - insertText(index: number, text: string, formats: any, source?: string): void; + insertEmbed(index: number, type: string, url: string, source?: "api"|"user"|"silent"): void; + insertText(index: number, text: string, source?: "api"|"user"|"silent"): void; + insertText(index: number, text: string, format: string, value: string, source?: "api"|"user"|"silent"): void; + insertText(index: number, text: string, formats: { [key: string] : any }, source?: "api"|"user"|"silent"): void; pasteHTML(): string; - setContents(delta: DeltaStatic, source?: string): void; - setText(text: string, source?: string): void; + setContents(delta: DeltaStatic, source?: "api"|"user"|"silent"): void; + setText(text: string, source?: "api"|"user"|"silent"): void; update(source?: string): void; - updateContents(delta: DeltaStatic, source?: string): void; + updateContents(delta: DeltaStatic, source?: "api"|"user"|"silent"): void; - format(name: string, value: any, source?: string): void; - formatLine(index: number, length: number, source?: string): void; - formatLine(index: number, length: number, format: string, value: any, source?: string): void; - formatLine(index: number, length: number, formats: any, source?: string): void; - formatText(index: number, length: number, source?: string): void; - formatText(index: number, length: number, format: string, value: any, source?: string): void; - formatText(index: number, length: number, formats: any, source?: string): void; - getFormat(range?: RangeStatic): any; - getFormat(index: number, length?: number): any; - removeFormat(index: Number, length: Number, source?: String): void; + format(name: string, value: any, source?: "api"|"user"|"silent"): void; + formatLine(index: number, length: number, source?: "api"|"user"|"silent"): void; + formatLine(index: number, length: number, format: string, value: any, source?: "api"|"user"|"silent"): void; + formatLine(index: number, length: number, formats: { [key: string] : any }, source?: "api"|"user"|"silent"): void; + formatText(index: number, length: number, source?: "api"|"user"|"silent"): void; + formatText(index: number, length: number, format: string, value: any, source?: "api"|"user"|"silent"): void; + formatText(index: number, length: number, formats: { [key: string] : any }, source?: "api"|"user"|"silent"): void; + getFormat(range?: RangeStatic): {[key: string]: any}; + getFormat(index: number, length?: number): {[key: string]: any}; + removeFormat(index: Number, length: Number, source?: "api"|"user"|"silent"): void; blur(): void; focus(): void; getBounds(index: number, length?: number): BoundsStatic; getSelection(focus?: boolean): RangeStatic; hasFocus(): boolean; - setSelection(index: number, length: number, source?: string): void; - setSelection(range: RangeStatic, source?: string): void; + setSelection(index: number, length: number, source?: "api"|"user"|"silent"): void; + setSelection(range: RangeStatic, source?: "api"|"user"|"silent"): void; - on(eventName: string, callback: (delta: DeltaStatic, oldContents: DeltaStatic, source: String) => void): QuillStatic; - on(eventName: string, callback: (range: RangeStatic, oldRange: RangeStatic, source: String) => void): QuillStatic; + on(eventName: string, callback: ((delta: T, oldContents: T, source: string) => void) | + ((name: string, ...args) => void )): QuillStatic; once(eventName: string, callback: (delta: DeltaStatic, source: string) => void): QuillStatic; off(eventName: string, callback: (delta: DeltaStatic, source: string) => void): QuillStatic; debug(level: string): void; import(path: string): any; register(path: string, def: any, suppressWarning?: boolean): void; - register(defs: any, suppressWarning?: boolean): void; + register(defs: { [key: string] : any }, suppressWarning?: boolean): void; addContainer(className: string, refNode?: any): any; getModule(name: string): any } From fecb5454fdda83792af72e47cd5345f2ce5284ea Mon Sep 17 00:00:00 2001 From: Sumit Kumar Maitra Date: Wed, 7 Sep 2016 03:45:10 +0100 Subject: [PATCH 55/91] Missed out one change to fix build --- quill/quill.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quill/quill.d.ts b/quill/quill.d.ts index 2ec959ef99..88436f7f58 100644 --- a/quill/quill.d.ts +++ b/quill/quill.d.ts @@ -73,7 +73,7 @@ declare namespace QuillJS { setSelection(range: RangeStatic, source?: "api"|"user"|"silent"): void; on(eventName: string, callback: ((delta: T, oldContents: T, source: string) => void) | - ((name: string, ...args) => void )): QuillStatic; + ((name: string, ...args:any[]) => void )): QuillStatic; once(eventName: string, callback: (delta: DeltaStatic, source: string) => void): QuillStatic; off(eventName: string, callback: (delta: DeltaStatic, source: string) => void): QuillStatic; From baddf2c360cf9198053f0f2d482d1ed97b021736 Mon Sep 17 00:00:00 2001 From: Sumit Kumar Maitra Date: Wed, 7 Sep 2016 07:40:40 +0100 Subject: [PATCH 56/91] creating type aliases --- quill/quill.d.ts | 50 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/quill/quill.d.ts b/quill/quill.d.ts index 88436f7f58..885f6bdc34 100644 --- a/quill/quill.d.ts +++ b/quill/quill.d.ts @@ -7,7 +7,7 @@ declare namespace QuillJS { export interface QuillOptionsStatic { debug?: string, - modules?: {[key: string]: any}, + modules?: { [key: string]: any }, placeholder?: string, readOnly?: boolean, theme?: string @@ -34,53 +34,55 @@ declare namespace QuillJS { length: number; } + type sourceType = "api" | "user" | "silent"; + type formatsType = { [key: string]: any }; + export interface QuillStatic { new (selector: string, options?: QuillOptionsStatic): QuillStatic; - - deleteText(start: number, end: number, source?: "api"|"user"|"silent"): void; + deleteText(start: number, end: number, source?: sourceType): void; disable(): void; enable(enabled?: boolean): void; getContents(start?: number, end?: number): DeltaStatic; getLength(): number; getText(start?: number, end?: number): string; - insertEmbed(index: number, type: string, url: string, source?: "api"|"user"|"silent"): void; - insertText(index: number, text: string, source?: "api"|"user"|"silent"): void; - insertText(index: number, text: string, format: string, value: string, source?: "api"|"user"|"silent"): void; - insertText(index: number, text: string, formats: { [key: string] : any }, source?: "api"|"user"|"silent"): void; + insertEmbed(index: number, type: string, url: string, source?: sourceType): void; + insertText(index: number, text: string, source?: sourceType): void; + insertText(index: number, text: string, format: string, value: string, source?: sourceType): void; + insertText(index: number, text: string, formats: formatsType, source?: sourceType): void; pasteHTML(): string; - setContents(delta: DeltaStatic, source?: "api"|"user"|"silent"): void; - setText(text: string, source?: "api"|"user"|"silent"): void; + setContents(delta: DeltaStatic, source?: sourceType): void; + setText(text: string, source?: sourceType): void; update(source?: string): void; - updateContents(delta: DeltaStatic, source?: "api"|"user"|"silent"): void; + updateContents(delta: DeltaStatic, source?: sourceType): void; - format(name: string, value: any, source?: "api"|"user"|"silent"): void; - formatLine(index: number, length: number, source?: "api"|"user"|"silent"): void; - formatLine(index: number, length: number, format: string, value: any, source?: "api"|"user"|"silent"): void; - formatLine(index: number, length: number, formats: { [key: string] : any }, source?: "api"|"user"|"silent"): void; - formatText(index: number, length: number, source?: "api"|"user"|"silent"): void; - formatText(index: number, length: number, format: string, value: any, source?: "api"|"user"|"silent"): void; - formatText(index: number, length: number, formats: { [key: string] : any }, source?: "api"|"user"|"silent"): void; - getFormat(range?: RangeStatic): {[key: string]: any}; - getFormat(index: number, length?: number): {[key: string]: any}; - removeFormat(index: Number, length: Number, source?: "api"|"user"|"silent"): void; + format(name: string, value: any, source?: sourceType): void; + formatLine(index: number, length: number, source?: sourceType): void; + formatLine(index: number, length: number, format: string, value: any, source?: sourceType): void; + formatLine(index: number, length: number, formats: formatsType, source?: sourceType): void; + formatText(index: number, length: number, source?: sourceType): void; + formatText(index: number, length: number, format: string, value: any, source?: sourceType): void; + formatText(index: number, length: number, formats: formatsType, source?: sourceType): void; + getFormat(range?: RangeStatic): formatsType; + getFormat(index: number, length?: number): formatsType; + removeFormat(index: Number, length: Number, source?: sourceType): void; blur(): void; focus(): void; getBounds(index: number, length?: number): BoundsStatic; getSelection(focus?: boolean): RangeStatic; hasFocus(): boolean; - setSelection(index: number, length: number, source?: "api"|"user"|"silent"): void; - setSelection(range: RangeStatic, source?: "api"|"user"|"silent"): void; + setSelection(index: number, length: number, source?: sourceType): void; + setSelection(range: RangeStatic, source?: sourceType): void; on(eventName: string, callback: ((delta: T, oldContents: T, source: string) => void) | - ((name: string, ...args:any[]) => void )): QuillStatic; + ((name: string, ...args: any[]) => void)): QuillStatic; once(eventName: string, callback: (delta: DeltaStatic, source: string) => void): QuillStatic; off(eventName: string, callback: (delta: DeltaStatic, source: string) => void): QuillStatic; debug(level: string): void; import(path: string): any; register(path: string, def: any, suppressWarning?: boolean): void; - register(defs: { [key: string] : any }, suppressWarning?: boolean): void; + register(defs: formatsType, suppressWarning?: boolean): void; addContainer(className: string, refNode?: any): any; getModule(name: string): any } From 0e267a89f1b7c319ffefc772d55dedc557c23d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez?= Date: Wed, 7 Sep 2016 04:23:52 -0600 Subject: [PATCH 57/91] Use same type for next function in middleware as koa main project (#10785) --- koa-router/koa-router-tests.ts | 4 ++-- koa-router/koa-router.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koa-router/koa-router-tests.ts b/koa-router/koa-router-tests.ts index 36d3e6c1c8..d2bae290a4 100644 --- a/koa-router/koa-router-tests.ts +++ b/koa-router/koa-router-tests.ts @@ -23,11 +23,11 @@ router .put('/users/:id', function (ctx, next) { ctx.body = ctx.params.id; }) - .del('/users/:id', function (ctx, next) { + .del('/users/:id', function () { // ... }); -router.get('user', '/users/:id', function (ctx, next) { +router.get('user', '/users/:id', function (ctx) { ctx.body = "sdsd"; }); diff --git a/koa-router/koa-router.d.ts b/koa-router/koa-router.d.ts index a6e8909e83..81a961b93a 100644 --- a/koa-router/koa-router.d.ts +++ b/koa-router/koa-router.d.ts @@ -49,11 +49,11 @@ declare module "koa-router" { } export interface IMiddleware { - (ctx: Router.IRouterContext, next?: () => any): any; + (ctx: Router.IRouterContext, next: () => Promise): any; } export interface IParamMiddleware { - (param: string, ctx: Router.IRouterContext, next?: () => any): any; + (param: string, ctx: Router.IRouterContext, next: () => Promise): any; } export interface IRouterAllowedMethodsOptions { From f15deaa4ee778667791b2a25362e37d3cc10592d Mon Sep 17 00:00:00 2001 From: IIIMADDINIII Date: Wed, 7 Sep 2016 12:24:51 +0200 Subject: [PATCH 58/91] Completed NodeBuffer.Compare and Process.nextTick definition (#11008) --- node/node.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index d8ec206f42..1b338fcd80 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -372,7 +372,7 @@ declare namespace NodeJS { arch: string; platform: string; memoryUsage(): MemoryUsage; - nextTick(callback: Function): void; + nextTick(callback: Function, ...args: any[]): void; umask(mask?: number): number; uptime(): number; hrtime(time?: number[]): number[]; @@ -466,7 +466,7 @@ interface NodeBuffer extends Uint8Array { toString(encoding?: string, start?: number, end?: number): string; toJSON(): any; equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Buffer): number; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; slice(start?: number, end?: number): Buffer; writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; From eff6f01782aa1e4ffca7a6ad6cd124aa92fdd487 Mon Sep 17 00:00:00 2001 From: Bastien Caudan Date: Wed, 7 Sep 2016 12:25:41 +0200 Subject: [PATCH 59/91] Add colors enabled property (#11011) --- colors/colors-tests.ts | 6 ++++++ colors/colors.d.ts | 2 ++ 2 files changed, 8 insertions(+) diff --git a/colors/colors-tests.ts b/colors/colors-tests.ts index 15fd5ab4e5..1b9b12834e 100644 --- a/colors/colors-tests.ts +++ b/colors/colors-tests.ts @@ -3,9 +3,15 @@ import colors = require("colors"); +colors.enabled = true; + console.log(colors.black.underline('test')); console.log(colors.rainbow.black.blue.gray('test')); console.log(colors.random.reset.bgWhite.dim('test')); console.log('test'.black.underline); console.log('test'.rainbow.black.blue.gray); console.log('test'.random.reset.bgWhite.dim); + +colors.enabled = false; + +console.log(colors.black.underline('test')); diff --git a/colors/colors.d.ts b/colors/colors.d.ts index 7a78240287..8ce8cca8b7 100644 --- a/colors/colors.d.ts +++ b/colors/colors.d.ts @@ -47,6 +47,8 @@ declare module "colors" { namespace e { export function setTheme(theme:any): void; + export var enabled: boolean; + export var black: Color; export var red: Color; export var green: Color; From 092e7f33ba65b4162419b7c5d56e8f1a55ffdbf9 Mon Sep 17 00:00:00 2001 From: Mikael Hermansson Date: Wed, 7 Sep 2016 12:26:02 +0200 Subject: [PATCH 60/91] Radium: Bumped version to 0.18.1 (#11010) * Changed version number * Allowed Style.rules to take non-nested React.CSSProperties --- radium/radium-tests.tsx | 6 ++++++ radium/radium.d.ts | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/radium/radium-tests.tsx b/radium/radium-tests.tsx index c8379b39b2..b8ad3928dd 100644 --- a/radium/radium-tests.tsx +++ b/radium/radium-tests.tsx @@ -43,6 +43,12 @@ class TestComponentWithConfig extends React.Component<{ a?: number }, {}> { }} > + ) diff --git a/radium/radium.d.ts b/radium/radium.d.ts index 1989156877..0cb4304d96 100644 --- a/radium/radium.d.ts +++ b/radium/radium.d.ts @@ -1,6 +1,6 @@ -// Type definitions for radium 0.17.1 +// Type definitions for radium 0.18.1 // Project: https://github.com/formidablelabs/radium -// Definitions by: Alex Gorbatchev , Philipp Holzer , Alexey Svetliakov +// Definitions by: Alex Gorbatchev , Philipp Holzer , Alexey Svetliakov , Mikael Hermansson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -19,10 +19,10 @@ declare module 'radium' { */ export interface StyleProps { /** - * An object of CSS rules to render. Each key of the rules object is a CSS selector and the value is an object - * of styles. If rules is empty, the component will render nothing. + * An object of styles, or an object of CSS rules to render. Each key of the rules object is a CSS + * selector and the value is an object of styles. If rules is empty, the component will render nothing. */ - rules: StyleRules; + rules: React.CSSProperties | StyleRules; /** * A string that any included selectors in rules will be appended to. * Use to scope styles in the component to a particular element. A good use case might be to generate a unique From 7ea32601157defdbbeb952ec1d8ad41a45fb7070 Mon Sep 17 00:00:00 2001 From: Joshua DeVinney Date: Wed, 7 Sep 2016 05:26:51 -0500 Subject: [PATCH 61/91] Adding S3.waitFor command to aws-sdk (#11014) --- aws-sdk/aws-sdk.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/aws-sdk/aws-sdk.d.ts b/aws-sdk/aws-sdk.d.ts index cb35f34e97..90f56d0702 100644 --- a/aws-sdk/aws-sdk.d.ts +++ b/aws-sdk/aws-sdk.d.ts @@ -235,6 +235,7 @@ declare module "aws-sdk" { upload(params?: s3.PutObjectRequest, options?: s3.UploadOptions, callback?: (err: Error, data: any) => void): void; listObjects(params: s3.ListObjectRequest, callback: (err: Error, data: s3.ListObjectResponse) => void): void; listObjectsV2(params: s3.ListObjectV2Request, callback: (err: Error, data: s3.ListObjectV2Response) => void): void; + waitFor(state: string, params: s3.HeadObjectRequest, callback: (err: Error, data: any) => void): void; } export class STS { From 44104ccdc31f82411f7a5647848a90f744ef8729 Mon Sep 17 00:00:00 2001 From: Hongbo Miao Date: Wed, 7 Sep 2016 06:29:48 -0400 Subject: [PATCH 62/91] add length for io.sockets.adapter.rooms['foo'] (#11005) const room = io.sockets.adapter.rooms['foo']; console.log(room.length); --- socket.io/socket.io.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socket.io/socket.io.d.ts b/socket.io/socket.io.d.ts index ad95f39ef3..ec65a0f8d4 100644 --- a/socket.io/socket.io.d.ts +++ b/socket.io/socket.io.d.ts @@ -752,7 +752,7 @@ declare namespace SocketIO { * A dictionary of all the rooms that we have in this namespace * The rooms are made of a `sockets` key which is the dictionary of sockets per ID */ - rooms: {[room: string]: {sockets: {[id: string]: boolean }}}; + rooms: {[room: string]: {sockets: {[id: string]: boolean }, length: number }}; /** * A dictionary of all the socket ids that we're dealing with, and all From 1e2cd99bf71700e531774615b456565e8b491cee Mon Sep 17 00:00:00 2001 From: niko <644506165@qq.com> Date: Wed, 7 Sep 2016 18:30:10 +0800 Subject: [PATCH 63/91] add dva declaration (#11021) * add dva declaration * pass the test --- dva/dva-tests.tsx | 48 ++++++++++++++++++++++++++++++++++++ dva/dva.d.ts | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 dva/dva-tests.tsx create mode 100644 dva/dva.d.ts diff --git a/dva/dva-tests.tsx b/dva/dva-tests.tsx new file mode 100644 index 0000000000..917ee69e60 --- /dev/null +++ b/dva/dva-tests.tsx @@ -0,0 +1,48 @@ +/// +/// + +import React = __React; + +import dva from 'dva'; +import { connect } from 'dva'; +import { Router, Route } from 'dva/router'; + +// 1. Initialize +const app = dva(); + +// 2. Model +app.model({ + namespace: 'count', + state: 0, + reducers: { + add(count: number) { + return count + 1 + }, + minus(count: number) { + return count - 1 + }, + }, +}); + +// 3. View +const App = connect(({ count }) => ({ + count +}))(function ({ count, dispatch }) { + return ( +
+

{ count }

+ + +
+ ); +}); + +// 4. Router +app.router(({ history }) => + + + +); + +// 5. Start +const countApp = app.start(); diff --git a/dva/dva.d.ts b/dva/dva.d.ts new file mode 100644 index 0000000000..b6d7e78248 --- /dev/null +++ b/dva/dva.d.ts @@ -0,0 +1,62 @@ +// Type definitions for dva v1.0.0 +// Project: https://github.com/dvajs/dva +// Definitions by: nikogu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +declare module 'dva' { + /** connecting Container Components */ + export function connect(maps:Object):Function; + + export default function dva(opts?:Object):{ + + /** dva plugin */ + use: (hooks:Object)=>void, + + /** dva bootstrap */ + start: (selector?:Object)=>void, + + /** dva add model */ + model: (model:Object)=>void, + + /** dva setting router */ + router: (router:Object)=>void, + }; +} + +/** + * https://github.com/reactjs/react-router + */ +declare module 'dva/router' { + import React = __React; + + interface RouterProps { + history?: Object + } + export class Router extends React.Component { + render(): JSX.Element + } + + + interface RouteProps { + path?: string, + component?: React.ReactNode + } + export class Route extends React.Component { + render(): JSX.Element + } +} + +/** + * https://github.com/reactjs/react-router-redux + */ +declare module 'dva/routerRedux' { + export default Object; +} + +/** + * https://github.com/fis-components/whatwg-fetch + */ +declare module 'dva/fetch' { + export default Function; +} From ef2754d9de65cb69160fea5ced3d59202012ee9c Mon Sep 17 00:00:00 2001 From: hriss95 Date: Wed, 7 Sep 2016 11:34:00 +0100 Subject: [PATCH 64/91] Node.d.ts: Update "constants" module (#11022) --- node/node.d.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 1b338fcd80..cad7c9564b 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -2704,6 +2704,33 @@ declare module "constants" { export var W_OK: number; export var X_OK: number; export var UV_UDP_REUSEADDR: number; + export var SIGQUIT: number; + export var SIGTRAP: number; + export var SIGIOT: number; + export var SIGBUS: number; + export var SIGUSR1: number; + export var SIGUSR2: number; + export var SIGPIPE: number; + export var SIGALRM: number; + export var SIGCHLD: number; + export var SIGSTKFLT: number; + export var SIGCONT: number; + export var SIGSTOP: number; + export var SIGTSTP: number; + export var SIGTTIN: number; + export var SIGTTOU: number; + export var SIGURG: number; + export var SIGXCPU: number; + export var SIGXFSZ: number; + export var SIGVTALRM: number; + export var SIGPROF: number; + export var SIGIO: number; + export var SIGPOLL: number; + export var SIGPWR: number; + export var SIGSYS: number; + export var SIGUNUSED: number; + export var defaultCoreCipherList: string; + export var defaultCipherList: string; } declare module "process" { From e58c63689e542ac429a5b354166a92358ad4535e Mon Sep 17 00:00:00 2001 From: hriss95 Date: Wed, 7 Sep 2016 11:36:12 +0100 Subject: [PATCH 65/91] Node.d.ts: Update definitions for module "crypto" (#11026) --- node/node.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index cad7c9564b..245aa95abe 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -2239,6 +2239,15 @@ declare module "crypto" { export function getCiphers(): string[]; export function getCurves(): string[]; export function getHashes(): string[]; + export interface ECDH { + computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string | Buffer; + generateKeys(encoding?: string, format?: string): string | Buffer; + getPrivateKey(encoding?: string): string | Buffer; + getPublicKey(encodind?: string): string | Buffer; + setPrivateKey(private_key: string | Buffer, encoding?: string): void; + setPublicKey(publick_key: string | Buffer, encoding?: string): void; + } + export function createECDH(curve_name: string): ECDH; } declare module "stream" { From e3558df40ed9ca4c722ca21491066701db3feb18 Mon Sep 17 00:00:00 2001 From: rinzeb Date: Wed, 7 Sep 2016 12:52:11 +0200 Subject: [PATCH 66/91] Update fs-extra.d.ts (#11028) --- fs-extra/fs-extra.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs-extra/fs-extra.d.ts b/fs-extra/fs-extra.d.ts index 39656ce685..7061f08746 100644 --- a/fs-extra/fs-extra.d.ts +++ b/fs-extra/fs-extra.d.ts @@ -79,8 +79,9 @@ declare module "fs-extra" { export interface CopyOptions { clobber?: boolean preserveTimestamps?: boolean - dereference?: boolean + dereference?: boolean filter?: CopyFilter + recursive?: boolean } export interface OpenOptions { From 2eb6ca7acf205d87f212a874e1316050e8cf79b2 Mon Sep 17 00:00:00 2001 From: Joost Farla Date: Wed, 7 Sep 2016 12:52:49 +0200 Subject: [PATCH 67/91] nock: Added missing delay functions (#11029) --- nock/nock-tests.ts | 6 ++++++ nock/nock.d.ts | 3 +++ 2 files changed, 9 insertions(+) diff --git a/nock/nock-tests.ts b/nock/nock-tests.ts index bc936a05b8..ffb456b420 100644 --- a/nock/nock-tests.ts +++ b/nock/nock-tests.ts @@ -97,6 +97,12 @@ inst = inst.log(() => { }); +inst = inst.delay(2000); +inst = inst.delayBody(2000); +inst = inst.delayConnection(2000); +inst.getTotalDelay(); +inst = inst.socketDelay(2000); + inst.done(); bool = inst.isDone(); inst.restore(); diff --git a/nock/nock.d.ts b/nock/nock.d.ts index b82721da78..615ec0d3ca 100644 --- a/nock/nock.d.ts +++ b/nock/nock.d.ts @@ -96,7 +96,10 @@ declare module "nock" { log(out: () => void): Scope; delay(timeMs: number): Scope; + delayBody(timeMs: number): Scope; delayConnection(timeMs: number): Scope; + getTotalDelay(): number; + socketDelay(timeMs: number): Scope; times(repeats: number): Scope; once(): Scope; From 823c53c9b6f52d2c3364c79fe89d601f67c49140 Mon Sep 17 00:00:00 2001 From: Artur Eshenbrener Date: Wed, 7 Sep 2016 14:57:32 +0400 Subject: [PATCH 68/91] Normalize line feeding (#11034) --- masonry-layout/masonry-layout-tests.ts | 96 ++++----- masonry-layout/masonry-layout.d.ts | 140 ++++++------- notify.js/notify.js.d.ts | 262 ++++++++++++------------- notify.js/notify.js.tests.ts | 104 +++++----- 4 files changed, 301 insertions(+), 301 deletions(-) diff --git a/masonry-layout/masonry-layout-tests.ts b/masonry-layout/masonry-layout-tests.ts index e83a898f54..65f629db10 100644 --- a/masonry-layout/masonry-layout-tests.ts +++ b/masonry-layout/masonry-layout-tests.ts @@ -1,48 +1,48 @@ -// test file for masonry-layout.d.ts - -/// -/// - -//import {Masonry} from "./masonry-layout.d.ts"; - -// responsive layouts -function testResponsiveLayouts() { - $('.grid').masonry({ - itemSelector: '.grid-item', - columnWidth: '.grid-sizer', - percentPosition: true - }); -} - -// recommended Options -function testRecommendedOptions() { - $('.grid').masonry({ - columnWidth: 200, - itemSelector: '.grid-item' - }); - - var msnry = new Masonry.Masonry('.grid', { - columnWidth: 200, - itemSelector: '.grid-item' - }); -} - -// extended Options -function testExtendedOptions() { - var msnry = new Masonry.Masonry('.grid', { - itemSelector: '.grid-item', - columnWidth: '.grid-sizer', - percentPosition: true, - gutter: '.gutter-sizer', - stamp: '.stamp', - fitWidth: true, - originLeft: true, - originTop: true, - containerStyle: { - position: 'relative' - }, - transitionDuration: '0.4s', - resize: true, - initLayout: true - }); -} +// test file for masonry-layout.d.ts + +/// +/// + +//import {Masonry} from "./masonry-layout.d.ts"; + +// responsive layouts +function testResponsiveLayouts() { + $('.grid').masonry({ + itemSelector: '.grid-item', + columnWidth: '.grid-sizer', + percentPosition: true + }); +} + +// recommended Options +function testRecommendedOptions() { + $('.grid').masonry({ + columnWidth: 200, + itemSelector: '.grid-item' + }); + + var msnry = new Masonry.Masonry('.grid', { + columnWidth: 200, + itemSelector: '.grid-item' + }); +} + +// extended Options +function testExtendedOptions() { + var msnry = new Masonry.Masonry('.grid', { + itemSelector: '.grid-item', + columnWidth: '.grid-sizer', + percentPosition: true, + gutter: '.gutter-sizer', + stamp: '.stamp', + fitWidth: true, + originLeft: true, + originTop: true, + containerStyle: { + position: 'relative' + }, + transitionDuration: '0.4s', + resize: true, + initLayout: true + }); +} diff --git a/masonry-layout/masonry-layout.d.ts b/masonry-layout/masonry-layout.d.ts index 0923a8f463..a76796096b 100644 --- a/masonry-layout/masonry-layout.d.ts +++ b/masonry-layout/masonry-layout.d.ts @@ -1,70 +1,70 @@ -// Type definitions for Masonry 4.0.0 -// Project: https://github.com/desandro/masonry -// Definitions by: Mark Wilson -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -// Modified from original definitions by: -// Travis Brown < https://github.com/warriorrocker> - -declare module Masonry { - - class Masonry implements MasonryGrid { - constructor(options?: MasonryOptions); - constructor(selector: string, options?: MasonryOptions); - } - - interface MasonryGrid { - masonry?(): void; - masonry?(eventName: string, listener: any): void; - - // layout - layout?(): void; - layoutItems?(items: Array, isStill?: boolean): void; - stamp?(elements: Array): void; - unstamp?(elements: Array): void; - - // add and remove items - appended?(elements: Array): void; - prepended?(elements: Array): void; - addItems?(elements: Array): void; - remove?(elements: Array): void; - - // events - on?(eventName: string, listener: any): void; - off?(eventName: string, listener: any): void; - once?(eventName: string, listener: any): void; - - // utilities - reloadItems?(): void; - destroy?(): void; - getItemElements?(): Array; - data?(element: Element): Masonry; - } - - interface MasonryOptions { - - // layout - itemSelector?: string; - columnWidth?: any; - percentPosition?: boolean; - gutter?: any; - stamp?: string; - fitWidth?: boolean; - originLeft?: boolean; - originTop?: boolean; - - // setup - containerStyle?: Object; - transitionDuration?: any; - resize?: boolean; - initLayout?: boolean; - } -} - -interface JQuery { - masonry(options?: Masonry.MasonryOptions): JQuery; -} - - +// Type definitions for Masonry 4.0.0 +// Project: https://github.com/desandro/masonry +// Definitions by: Mark Wilson +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +// Modified from original definitions by: +// Travis Brown < https://github.com/warriorrocker> + +declare module Masonry { + + class Masonry implements MasonryGrid { + constructor(options?: MasonryOptions); + constructor(selector: string, options?: MasonryOptions); + } + + interface MasonryGrid { + masonry?(): void; + masonry?(eventName: string, listener: any): void; + + // layout + layout?(): void; + layoutItems?(items: Array, isStill?: boolean): void; + stamp?(elements: Array): void; + unstamp?(elements: Array): void; + + // add and remove items + appended?(elements: Array): void; + prepended?(elements: Array): void; + addItems?(elements: Array): void; + remove?(elements: Array): void; + + // events + on?(eventName: string, listener: any): void; + off?(eventName: string, listener: any): void; + once?(eventName: string, listener: any): void; + + // utilities + reloadItems?(): void; + destroy?(): void; + getItemElements?(): Array; + data?(element: Element): Masonry; + } + + interface MasonryOptions { + + // layout + itemSelector?: string; + columnWidth?: any; + percentPosition?: boolean; + gutter?: any; + stamp?: string; + fitWidth?: boolean; + originLeft?: boolean; + originTop?: boolean; + + // setup + containerStyle?: Object; + transitionDuration?: any; + resize?: boolean; + initLayout?: boolean; + } +} + +interface JQuery { + masonry(options?: Masonry.MasonryOptions): JQuery; +} + + diff --git a/notify.js/notify.js.d.ts b/notify.js/notify.js.d.ts index ae31ea6317..49fd3415ec 100644 --- a/notify.js/notify.js.d.ts +++ b/notify.js/notify.js.d.ts @@ -1,131 +1,131 @@ -// Type definitions for notify.js -// Project: https://github.com/notifyjs/notifyjs -// Definitions by: Bahman Nikkhahan -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace NotifyJS { - interface NotificationOptions { - // whether to hide the notification on click - clickToHide: boolean; - // whether to auto-hide the notification - autoHide: boolean; - // if autoHide, hide after milliseconds - autoHideDelay: number; - // show the arrow pointing at the element - arrowShow: boolean; - // arrow size in pixels - arrowSize: number; - // position defines the notification position though uses the defaults below - position: string; - // default positions - elementPosition: string; - globalPosition: string; - // default style - style: string; - // default class (string or [string]) - className: string; - // show animation - showAnimation: string; - // show animation duration - showDuration: number; - // hide animation - hideAnimation: string; - // hide animation duration - hideDuration: number; - // padding between element and notification - gap: number; - } - - interface JQueryStaticNotify { - /** - * notify user - * @param element a jquery element - * @param notificationdata global notification data - * @param options notification options - */ - (element?: any, notificationdata?: any, options?: NotificationOptions): JQueryStatic; - - /** - * Add style - * @param styleName style name - * @param styleDefinition style definition object - */ - addStyle(styleName: string, styleDefinition: any): any; - - /** - * Remove style - * @param styleName style name - */ - removeStyle(styleName: string): any; - - /** - * Get style - * @param styleName style name - */ - getStyle(styleName: string): any; - - /** - * Insert css - * @param cssText css text to insert - */ - insertCSS(cssText: string): any; - - /** - * Set defaults for notifications - * @param options notification iptions - */ - defaults(options: NotificationOptions): any; - } - - interface JQueryStatic { - notify: JQueryStaticNotify; - } - - interface JQueryNotify { - /** - * notify user - * @param element a jquery element - * @param notificationdata global notification data - * @param options notification options - */ - (element?: any, notificationdata?: any, options?: NotificationOptions): JQuery; - - /** - * Add style - * @param styleName style name - * @param styleDefinition style definition object - */ - addStyle(styleName: string, styleDefinition: any): any; - - /** - * Remove style - * @param styleName style name - */ - removeStyle(styleName: string): any; - - /** - * Get style - * @param styleName style name - */ - getStyle(styleName: string): any; - - /** - * Insert css - * @param cssText css text to insert - */ - insertCSS(cssText: string): any; - - /** - * Set defaults for notifications - * @param options notification iptions - */ - defaults(options: NotificationOptions): any; - - } - - interface JQuery { - notify: JQueryStaticNotify; - } -} +// Type definitions for notify.js +// Project: https://github.com/notifyjs/notifyjs +// Definitions by: Bahman Nikkhahan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace NotifyJS { + interface NotificationOptions { + // whether to hide the notification on click + clickToHide: boolean; + // whether to auto-hide the notification + autoHide: boolean; + // if autoHide, hide after milliseconds + autoHideDelay: number; + // show the arrow pointing at the element + arrowShow: boolean; + // arrow size in pixels + arrowSize: number; + // position defines the notification position though uses the defaults below + position: string; + // default positions + elementPosition: string; + globalPosition: string; + // default style + style: string; + // default class (string or [string]) + className: string; + // show animation + showAnimation: string; + // show animation duration + showDuration: number; + // hide animation + hideAnimation: string; + // hide animation duration + hideDuration: number; + // padding between element and notification + gap: number; + } + + interface JQueryStaticNotify { + /** + * notify user + * @param element a jquery element + * @param notificationdata global notification data + * @param options notification options + */ + (element?: any, notificationdata?: any, options?: NotificationOptions): JQueryStatic; + + /** + * Add style + * @param styleName style name + * @param styleDefinition style definition object + */ + addStyle(styleName: string, styleDefinition: any): any; + + /** + * Remove style + * @param styleName style name + */ + removeStyle(styleName: string): any; + + /** + * Get style + * @param styleName style name + */ + getStyle(styleName: string): any; + + /** + * Insert css + * @param cssText css text to insert + */ + insertCSS(cssText: string): any; + + /** + * Set defaults for notifications + * @param options notification iptions + */ + defaults(options: NotificationOptions): any; + } + + interface JQueryStatic { + notify: JQueryStaticNotify; + } + + interface JQueryNotify { + /** + * notify user + * @param element a jquery element + * @param notificationdata global notification data + * @param options notification options + */ + (element?: any, notificationdata?: any, options?: NotificationOptions): JQuery; + + /** + * Add style + * @param styleName style name + * @param styleDefinition style definition object + */ + addStyle(styleName: string, styleDefinition: any): any; + + /** + * Remove style + * @param styleName style name + */ + removeStyle(styleName: string): any; + + /** + * Get style + * @param styleName style name + */ + getStyle(styleName: string): any; + + /** + * Insert css + * @param cssText css text to insert + */ + insertCSS(cssText: string): any; + + /** + * Set defaults for notifications + * @param options notification iptions + */ + defaults(options: NotificationOptions): any; + + } + + interface JQuery { + notify: JQueryStaticNotify; + } +} diff --git a/notify.js/notify.js.tests.ts b/notify.js/notify.js.tests.ts index f533b47288..505f3c4ec5 100644 --- a/notify.js/notify.js.tests.ts +++ b/notify.js/notify.js.tests.ts @@ -1,53 +1,53 @@ -/// -/// - -// setting defaults for notification plugin -$.notify.defaults({ - clickToHide: true, - autoHide: false, - autoHideDelay: 5000, - arrowShow: true, - arrowSize: 5, - position: 'top center', - elementPosition: 'bottom left', - globalPosition: 'top center', - style: 'bootstrap', - className: 'error', - showAnimation: 'slideDown', - showDuration: 400, - hideAnimation: 'slideUp', - hideDuration: 200, - gap: 2 -}); - -$(".elem-demo").notify("Hello Box"); -$.notify("Access granted", "success"); -$.notify("Do not press this button", "info"); -$.notify('hello !!', { - style: 'happyblue' -}); -$.notify('hello !!', { - style: 'happyblue' -}); -//add a new style 'foo' -$.notify.addStyle('foo', { - html: - "
" + - "
" + - "
" + - "
" + - "" + - "" + - "
" + - "
" + - "
" -}); - -$.notify({ - title: 'Would you like some Foo ?', - button: 'Confirm' -}, { - style: 'foo', - autoHide: false, - clickToHide: false +/// +/// + +// setting defaults for notification plugin +$.notify.defaults({ + clickToHide: true, + autoHide: false, + autoHideDelay: 5000, + arrowShow: true, + arrowSize: 5, + position: 'top center', + elementPosition: 'bottom left', + globalPosition: 'top center', + style: 'bootstrap', + className: 'error', + showAnimation: 'slideDown', + showDuration: 400, + hideAnimation: 'slideUp', + hideDuration: 200, + gap: 2 +}); + +$(".elem-demo").notify("Hello Box"); +$.notify("Access granted", "success"); +$.notify("Do not press this button", "info"); +$.notify('hello !!', { + style: 'happyblue' +}); +$.notify('hello !!', { + style: 'happyblue' +}); +//add a new style 'foo' +$.notify.addStyle('foo', { + html: + "
" + + "
" + + "
" + + "
" + + "" + + "" + + "
" + + "
" + + "
" +}); + +$.notify({ + title: 'Would you like some Foo ?', + button: 'Confirm' +}, { + style: 'foo', + autoHide: false, + clickToHide: false }); \ No newline at end of file From 9b111fde729ec9f105c01930f98fab212e0cb21e Mon Sep 17 00:00:00 2001 From: Artur Eshenbrener Date: Wed, 7 Sep 2016 15:01:15 +0400 Subject: [PATCH 69/91] Allow Bluebird to be assignable to ES2016 Promise. (#11036) * Allow Bluebird to be assignable to ES2016 Promise. Add yet another one `.then` overloadings. * bluebird: Fix .then overloadings --- bluebird/bluebird-tests.ts | 5 +++-- bluebird/bluebird.d.ts | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index 59cef89b1a..d7995438c1 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -82,6 +82,7 @@ var voidProm: Promise; var fooProm: Promise; var barProm: Promise; +var barOrVoidProm: Promise; var fooOrBarProm: Promise; var bazProm: Promise; @@ -221,12 +222,12 @@ barProm = fooProm.then((value: Foo) => { }, (reason: any) => { return barProm; }); -barProm = fooProm.then((value: Foo) => { +barOrVoidProm = fooProm.then((value: Foo) => { return bar; }, (reason: any) => { return; }); -barProm = fooProm.then((value: Foo) => { +barOrVoidProm = fooProm.then((value: Foo) => { return bar; }, (reason: any) => { return voidProm; diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index 042347f096..35b506542a 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -47,8 +47,10 @@ class Bluebird implements Bluebird.Thenable, Bluebird.Inspection { /** * Promises/A+ `.then()`. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. */ - then(onFulfill: (value: R) => U | Bluebird.Thenable, onReject?: (error: any) => U | Bluebird.Thenable): Bluebird; - then(onFulfill: (value: R) => U | Bluebird.Thenable, onReject?: (error: any) => void | Bluebird.Thenable): Bluebird; + then(onFulfill: (value: R) => U1 | Bluebird.Thenable, onReject: (error: any) => U2 | Bluebird.Thenable): Bluebird; + then(onFulfill: (value: R) => U | Bluebird.Thenable, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; + then(onFulfill: (value: R) => U | Bluebird.Thenable): Bluebird; + then(): Bluebird; /** * This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler. From a5608d64a3955d4abd112a267b40adc2c95271a4 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 7 Sep 2016 14:04:49 +0300 Subject: [PATCH 70/91] Revert "Add missing definition" (#11039) --- angularjs/angular.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 111ba86cce..b989e640ea 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -238,7 +238,6 @@ declare namespace angular { * @param directiveFactory An injectable directive factory function. */ directive(name: string, inlineAnnotatedFunction: any[]): IModule; - directive(name: string, injectionFunction: Function): IModule; directive(object: Object): IModule; /** * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. From ae77424967ab0b8ddb149f0798a8e499a079c3cd Mon Sep 17 00:00:00 2001 From: York Yao Date: Wed, 7 Sep 2016 19:08:18 +0800 Subject: [PATCH 71/91] add missing command of hincrbyfloat (#11044) --- ioredis/ioredis.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ioredis/ioredis.d.ts b/ioredis/ioredis.d.ts index 983ed39f10..60eccd0272 100644 --- a/ioredis/ioredis.d.ts +++ b/ioredis/ioredis.d.ts @@ -197,6 +197,8 @@ declare module IORedis { hmget(...args: any[]): any; hincrby(args: any[], callback?: ResCallbackT): any; hincrby(...args: any[]): any; + hincrbyfloat(args: any[], callback?: ResCallbackT): any; + hincrbyfloat(...args: any[]): any; hdel(args: any[], callback?: ResCallbackT): any; hdel(...args: any[]): any; hlen(args: any[], callback?: ResCallbackT): any; @@ -478,6 +480,8 @@ declare module IORedis { hmget(...args: any[]): Pipeline; hincrby(args: any[], callback?: ResCallbackT): Pipeline; hincrby(...args: any[]): Pipeline; + hincrbyfloat(args: any[], callback?: ResCallbackT): Pipeline; + hincrbyfloat(...args: any[]): Pipeline; hdel(args: any[], callback?: ResCallbackT): Pipeline; hdel(...args: any[]): Pipeline; hlen(args: any[], callback?: ResCallbackT): Pipeline; From a773c2bc8185eb1b098f958befb891622da1f971 Mon Sep 17 00:00:00 2001 From: Diego Pedro Date: Wed, 7 Sep 2016 08:12:02 -0300 Subject: [PATCH 72/91] add removeBackView() to ionic.d.ts (#11031) * Update ionic.d.ts removeBackHistory added in ionic.d.ts * Add removeBackView in ionic.d.ts * Added removeBackView test --- ionic/ionic-tests.ts | 1 + ionic/ionic.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/ionic/ionic-tests.ts b/ionic/ionic-tests.ts index d8c98ae25f..140d102a8c 100644 --- a/ionic/ionic-tests.ts +++ b/ionic/ionic-tests.ts @@ -176,6 +176,7 @@ class IonicTestController { var currentStateName: string = this.$ionicHistory.currentStateName(); this.$ionicHistory.goBack(5); + this.$ionicHistory.removeBackView(); this.$ionicHistory.clearHistory(); this.$ionicHistory.clearCache().then(() => console.log("done clearing cache!")); this.$ionicHistory.nextViewOptions({ diff --git a/ionic/ionic.d.ts b/ionic/ionic.d.ts index fae9cdbf63..1df593037b 100644 --- a/ionic/ionic.d.ts +++ b/ionic/ionic.d.ts @@ -213,6 +213,7 @@ declare namespace ionic { currentStateName(): string; goBack(backCount?: number): void; + removeBackView(): void; clearHistory(): void; clearCache(): angular.IPromise; nextViewOptions(options: IonicHistoryNextViewOptions): void; From 13322c67cc494eb9034e8e5f93aefe23956ffc56 Mon Sep 17 00:00:00 2001 From: Hedley Luna Date: Wed, 7 Sep 2016 08:12:39 -0300 Subject: [PATCH 73/91] [RavenJS] showReportDialog Function (#11038) * Adding the sorter function to the options. This function is called when append is called * Adding the showReportDialog function to RavenStatic. --- ravenjs/ravenjs-tests.ts | 2 ++ ravenjs/ravenjs.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ravenjs/ravenjs-tests.ts b/ravenjs/ravenjs-tests.ts index db0ddd6932..eafa48871c 100644 --- a/ravenjs/ravenjs-tests.ts +++ b/ravenjs/ravenjs-tests.ts @@ -44,3 +44,5 @@ Raven.setUserContext({ Raven.captureMessage('Broken!'); Raven.captureMessage('Broken!', {tags: { key: "value" }}); + +Raven.showReportDialog(options); diff --git a/ravenjs/ravenjs.d.ts b/ravenjs/ravenjs.d.ts index ae891a7cda..e7e68b69aa 100644 --- a/ravenjs/ravenjs.d.ts +++ b/ravenjs/ravenjs.d.ts @@ -183,6 +183,8 @@ interface RavenStatic { /** If you need to conditionally check if raven needs to be initialized or not, you can use the isSetup function. It will return true if Raven is already initialized. */ isSetup(): boolean; + + showReportDialog(options: RavenOptions): void; } interface RavenTransportOptions { From 49d0ce6918543644b8e27df7dfd2c851c18b94e6 Mon Sep 17 00:00:00 2001 From: Hendrik Liebau Date: Wed, 7 Sep 2016 13:12:55 +0200 Subject: [PATCH 74/91] export types of redux-mock-store (#10933) Within a test you sometimes want to declare the store first and then assign it the result of mockStore(state) in a beforeEach(). For that we need to export IStore. --- redux-mock-store/redux-mock-store-tests.ts | 9 +++++---- redux-mock-store/redux-mock-store.d.ts | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/redux-mock-store/redux-mock-store-tests.ts b/redux-mock-store/redux-mock-store-tests.ts index 4a6045c288..960591f8fb 100644 --- a/redux-mock-store/redux-mock-store-tests.ts +++ b/redux-mock-store/redux-mock-store-tests.ts @@ -1,6 +1,6 @@ /// -import configureStore from 'redux-mock-store'; +import configureStore, {IStore} from 'redux-mock-store'; // Redux store API tests // The following test are taken from ../redux/redux-tests.ts @@ -25,10 +25,11 @@ function loggingMiddleware() { }; } -const storeMock = configureStore([loggingMiddleware]); +const storeMock = configureStore([loggingMiddleware]); const initialState = 0 -let store = storeMock(initialState); +let store: IStore; +store = storeMock(initialState); store.subscribe(() => { // ... @@ -40,4 +41,4 @@ store.dispatch({ type: 'INCREMENT' }); // Additional mock store API tests var actions: Array = store.getActions(); -store.clearActions(); \ No newline at end of file +store.clearActions(); diff --git a/redux-mock-store/redux-mock-store.d.ts b/redux-mock-store/redux-mock-store.d.ts index 770603826a..6cc463e2d1 100644 --- a/redux-mock-store/redux-mock-store.d.ts +++ b/redux-mock-store/redux-mock-store.d.ts @@ -10,9 +10,9 @@ declare module 'redux-mock-store' { function createMockStore(middlewares?:Redux.Middleware[]):mockStore - type mockStore = (state?:T) => IStore; + export type mockStore = (state?:T) => IStore; - type IStore = { + export type IStore = { dispatch(action: any):any getState():T getActions():Object[] @@ -21,4 +21,4 @@ declare module 'redux-mock-store' { } export default createMockStore -} \ No newline at end of file +} From 2364c306eb21a478c5a10ee3a20048b17765ffe7 Mon Sep 17 00:00:00 2001 From: Shinya Ohyanagi Date: Wed, 7 Sep 2016 20:15:23 +0900 Subject: [PATCH 75/91] Add definitions for react-daterange-picker (#10983) * Add react-daterange-picker * Fix 2-space to 4-space and add semicolon DefinitelyTyped contributing says 'use tabs or 4-space indentation'. * Remove declare var declare var did not effected to build and run application. * Add comment Use Literal Types after TypeScript 2.0 GA released. * Fix file name Change react-daterange-picker-test.tsx to react-daterange-picker-tests.tsx --- .../react-daterange-picker-tests.tsx | 178 ++++++++++++++++++ .../react-daterange-picker.d.ts | 77 ++++++++ 2 files changed, 255 insertions(+) create mode 100644 react-daterange-picker/react-daterange-picker-tests.tsx create mode 100644 react-daterange-picker/react-daterange-picker.d.ts diff --git a/react-daterange-picker/react-daterange-picker-tests.tsx b/react-daterange-picker/react-daterange-picker-tests.tsx new file mode 100644 index 0000000000..98665fddb6 --- /dev/null +++ b/react-daterange-picker/react-daterange-picker-tests.tsx @@ -0,0 +1,178 @@ +/// +/// + +// Test app from https://github.com/onefinestay/react-daterange-picker/blob/master/example/index.jsx +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import * as moment from 'moment'; +import 'moment-range'; +import * as DateRangePicker from 'react-daterange-picker'; + +interface AppProps extends ReactDateRangePicker.Props { +} + +class App extends React.Component { + constructor(props: AppProps, context: any) { + super(props, context); + + this.state = {}; + } + + handleSelect(value: AppProps, states: any): void { + this.setState({value, states}); + } + + render(): any { + return ( +
+ +
+ + +
+
+ ); + } +} + +class DateSinglePicker extends React.Component { + constructor(props : AppProps, context: any) { + super(props, context); + + this.state = {}; + } + + handleSelect(value: AppProps) { + this.setState({value: value}); + } + + render() { + return ( +
+ +
+ +
+
+ ); + } +} + +export class Main extends React.Component { + + render() { + const stateDefinitions: ReactDateRangePicker.StateDefinitions = { + available: { + color: '#ffffff', + label: 'Available', + }, + enquire: { + color: '#ffd200', + label: 'Enquire', + }, + unavailable: { + selectable: false, + color: '#78818b', + label: 'Unavailable', + } + }; + + const dateRanges = [ + { + state: 'enquire', + range: moment.range( + moment().add(2, 'weeks').subtract(5, 'days'), + moment().add(2, 'weeks').add(6, 'days') + ), + }, + { + state: 'unavailable', + range: moment.range( + moment().add(3, 'weeks'), + moment().add(3, 'weeks').add(5, 'days') + ), + }, + ]; + + const initialStart = moment().add(1, 'weeks').startOf('day'); + const initialEnd = moment().add(1, 'weeks').add(3, 'days').startOf('day'); + const range = moment.range(initialStart, initialEnd); + + return ( +
+
+ +
+ +
+

Examples

+ +
+

Range with no date states

+ +
+ +
+

Range with day-long ranges allowed

+ +
+ +
+

Range with no minimum date

+ +
+
+

Single with no date states

+ +
+
+
+ ); + } +} + +const MainFactory = React.createFactory(Main); + +ReactDOM.render( + MainFactory(), + document.getElementById('app') +); diff --git a/react-daterange-picker/react-daterange-picker.d.ts b/react-daterange-picker/react-daterange-picker.d.ts new file mode 100644 index 0000000000..4754e77140 --- /dev/null +++ b/react-daterange-picker/react-daterange-picker.d.ts @@ -0,0 +1,77 @@ +// Type definitions for React Daterange Picker v1.1.0 +// Project: https://github.com/onefinestay/react-daterange-picker +// Definitions by: UNCOVER TRUTH Inc. +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// + +declare module 'react-daterange-picker' { + import DateRangePicker = ReactDateRangePicker.DateRangePicker; + export = DateRangePicker; +} + +declare namespace ReactDateRangePicker { + import React = __React; + + interface Props extends React.Props<{}> { + bemBlock?: string; + bemNamespace?: string; + dateStates?: DateState[]; + defaultState?: string; + disableNavigation?: boolean; + // Use Number Literal Types after TypeScript 2.0 GA released. + firstOfWeek?: number; // React.PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6]) + helpMessage?: string; + initialFromValue?: boolean; + initialDate?: Date; + initialMonth?: number; + initialYear?: number; + initialRange?: {}; + maximumDate?: Date; + minimumDate?: Date; + numberOfCalendars?: number; + onHighlightDate?(date: Date): void; + onHighlightRange?(date: Date): void; + onSelect?(value: Props): void; + onSelectStart?(value: moment.Moment): void; + paginationArrowComponent?: PaginationArrow; + selectedLabel?: string; + selectionType?: 'single' |'range'; + singleDateRange?: boolean; + showLegend?: boolean; + stateDefinitions?: StateDefinitions; + value?: moment.Moment | moment.Range; + } + + interface DateState { + state: string; + range: moment.Range; + } + + interface StateDefinitions { + [key: string]: StateDefinition; + } + + interface StateDefinition { + color: string; + label: string; + selectable?: boolean; + } + + interface PaginationArrowProps extends React.Props<{}> { + disabled?: boolean; + onTrigger?(): void; + direction?: 'next' | 'previous'; + } + + class PaginationArrow extends React.Component { + } + + class DateRangePicker extends React.Component { + } + + namespace DateRangePicker { + } +} From 14c74ee373501a19c60253ab4aff0f9e2575516e Mon Sep 17 00:00:00 2001 From: Michael McKenzie Date: Wed, 7 Sep 2016 12:15:43 +0100 Subject: [PATCH 76/91] Changing dojo/_base/lang mixin signature to match documentation (#10991) * adding multiple signatures * update --- dojo/dojo.d.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dojo/dojo.d.ts b/dojo/dojo.d.ts index bca5721240..eaab995a36 100644 --- a/dojo/dojo.d.ts +++ b/dojo/dojo.d.ts @@ -5686,7 +5686,23 @@ declare namespace dojo { * @param dest The object to which to copy/add all properties contained in source. If dest is falsy, thena new object is manufactured before copying/adding properties begins. * @param sources One of more objects from which to draw all properties to copy into dest. sources are processedleft-to-right and if more than one of these objects contain the same property name, the right-mostvalue "wins". */ - mixin(dest: Object, source: Object, sources?: Object[]): Object; + mixin(dest: T): T; + mixin( + dest: T, + source: U + ): T & U; + mixin( + dest: T, + source1: U, + source2: V + ): T & U & V; + mixin( + dest: T, + source1: U, + source2: V, + source3: W + ): T & U & V & W; + mixin(dest: Object, ...sources: Object[]): T; /** * similar to hitch() except that the scope object is left to be * whatever the execution context eventually becomes. From d219a83c311d80452db852c2db4f83d1da1b53a1 Mon Sep 17 00:00:00 2001 From: Schmulik Raskin Date: Wed, 7 Sep 2016 14:29:08 +0300 Subject: [PATCH 77/91] Fix gulp.dest overload parameter type to be Vinyl File (#10825) * Fix gulp.dest overload parameter type to be Vinyl File * Change Vinyl version to match Gulp * Revert changing Vinyl version, due to conflicts with gulp plugins --- gulp/gulp.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gulp/gulp.d.ts b/gulp/gulp.d.ts index 74968ddcc5..f4314bd2f2 100644 --- a/gulp/gulp.d.ts +++ b/gulp/gulp.d.ts @@ -5,9 +5,11 @@ /// /// +/// declare module "gulp" { import Orchestrator = require("orchestrator"); + import VinylFile = require("vinyl"); namespace gulp { interface Gulp extends Orchestrator { @@ -92,7 +94,7 @@ declare module "gulp" { * @param outFolder The path (output folder) to write files to. Or a function that returns it, the function will be provided a vinyl File instance. * @param opt */ - (outFolder: string|((file: string) => string), opt?: DestOptions): NodeJS.ReadWriteStream; + (outFolder: string|((file: VinylFile) => string), opt?: DestOptions): NodeJS.ReadWriteStream; } interface SrcMethod { @@ -149,7 +151,7 @@ declare module "gulp" { * Note that an explicit dot in a portion of the pattern will always match dot files. */ dot?: boolean; - + /** * Set to match only fles, not directories. Set this flag to prevent copying empty directories */ From 98d009b22750c0c8f60292e2ccd01a1ee1071476 Mon Sep 17 00:00:00 2001 From: TonyYang Date: Wed, 7 Sep 2016 19:42:29 +0800 Subject: [PATCH 78/91] [node] Test that imported and global `console` are same (#11062) * Node.d.ts: Introduce module "console" * Test that imported and global `console` are same * Test that imported and global `console` are same * declare module "console" for node v4 --- node/node-4-tests.ts | 14 +++++++++++++- node/node-4.d.ts | 4 ++++ node/node-tests.ts | 11 +++++++++++ node/node.d.ts | 4 ++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/node/node-4-tests.ts b/node/node-4-tests.ts index 9db708b910..5a25f1fa20 100644 --- a/node/node-4-tests.ts +++ b/node/node-4-tests.ts @@ -839,4 +839,16 @@ namespace errors_tests { const myObject = {}; Error.captureStackTrace(myObject); } -} \ No newline at end of file +} + +/////////////////////////////////////////////////////////// +/// Console Tests : https://nodejs.org/api/console.html /// +/////////////////////////////////////////////////////////// + +import * as c from "console"; +namespace console_tests{ + { + assert(c === console); + } +} + diff --git a/node/node-4.d.ts b/node/node-4.d.ts index 2dffaac688..6c45fa2f75 100644 --- a/node/node-4.d.ts +++ b/node/node-4.d.ts @@ -2408,3 +2408,7 @@ declare module "constants" { declare module "process" { export = process; } + +declare module "console" { + export = console; +} diff --git a/node/node-tests.ts b/node/node-tests.ts index de2f284c1f..e1df5c499b 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -1008,3 +1008,14 @@ namespace process_tests{ eventEmitter = process; // Test that process implements EventEmitter... } } + +/////////////////////////////////////////////////////////// +/// Console Tests : https://nodejs.org/api/console.html /// +/////////////////////////////////////////////////////////// + +import * as c from "console"; +namespace console_tests{ + { + assert(c === console); + } +} diff --git a/node/node.d.ts b/node/node.d.ts index 245aa95abe..12d87d2c1e 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -2754,3 +2754,7 @@ declare module "timers" { export function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; export function clearImmediate(immediateId: any): void; } + +declare module "console" { + export = console; +} \ No newline at end of file From df987a4110733ea7c79d1a7ec5b6e98779994633 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Wed, 7 Sep 2016 07:43:01 -0400 Subject: [PATCH 79/91] Typings for rbush (#11072) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Typings for rbush * Object → any --- rbush/rbush-tests.ts | 41 ++++++++++++++++ rbush/rbush.d.ts | 110 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 rbush/rbush-tests.ts create mode 100644 rbush/rbush.d.ts diff --git a/rbush/rbush-tests.ts b/rbush/rbush-tests.ts new file mode 100644 index 0000000000..305f4b7205 --- /dev/null +++ b/rbush/rbush-tests.ts @@ -0,0 +1,41 @@ +/// + +import * as rbush from 'rbush'; + +interface IndexedRect extends rbush.BBox { + index: number; +} + +function test_rbush() { + var index = rbush(); + + index + .clear() + .insert({ + minX: 0, + minY: 0, + maxX: 10, + maxY: 10, + index: 0, + }); + + index.all(); + index.fromJSON(index.toJSON()); + + index.search({ + minX: 5, + maxX: 15, + minY: 5, + maxY: 11, + }) + + index.load([ + { + minX: 0, + minY: 0, + maxX: 10, + maxY: 10, + index: 0, + } + ]) +} diff --git a/rbush/rbush.d.ts b/rbush/rbush.d.ts new file mode 100644 index 0000000000..6c04ce241c --- /dev/null +++ b/rbush/rbush.d.ts @@ -0,0 +1,110 @@ +// Type definitions for rbush 2.0.1 +// Project: https://github.com/mourner/rbush +// Definitions by: Dan Vanderkam +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace rbush { + export interface BBox { + minX: number; + minY: number; + maxX: number; + maxY: number; + } + + export interface RBush { + /** + * Insert an item. To insert many items, use load(). + */ + insert(item: T): RBush; + + /** + * Bulk-insert the given data into the tree. + * + * Bulk insertion is usually ~2-3 times faster than inserting items one by one. + * After bulk loading (bulk insertion into an empty tree), subsequent query + * performance is also ~20-30% better. + * + * Note that when you do bulk insertion into an existing tree, it bulk-loads + * the given data into a separate tree and inserts the smaller tree into the + * larger tree. This means that bulk insertion works very well for clustered + * data (where items in one update are close to each other), but makes query + * performance worse if the data is scattered. + */ + load(items: T[]): RBush; + + /** + * Remove a previously inserted item. + * + * By default, RBush removes objects by reference. However, you can pass a + * custom equals function to compare by value for removal, which is useful + * when you only have a copy of the object you need removed (e.g. loaded + * from server). + */ + remove(item: T, equals?: (a: T, b: T) => boolean): RBush; + + /** Remove all items */ + clear(): RBush; + + /** + * Returns an array of data items (points or rectangles) that the given + * bounding box intersects. + * + * Note that the search method accepts a bounding box in {minX, minY, maxX, maxY} + * format regardless of the format specified in the constructor (which only + * affects inserted objects). + */ + search(bbox: BBox): T[]; + + /** Returns all items of the tree. */ + all(): T[]; + + /** + * Returns true if there are any items intersecting the given bounding box, + * otherwise false. + */ + collides(bbox: BBox): boolean; + + /** + * Export data as JSON object. + * + * Importing and exporting as JSON allows you to use RBush on both the server + * (using Node.js) and the browser combined, e.g. first indexing the data on + * the server and and then importing the resulting tree data on the client + * for searching. + * + * Note that the nodeSize option passed to the constructor must be the same + * in both trees for export/import to work properly. + */ + toJSON(): any; + + /** + * Import previously exported data. + * + * Importing and exporting as JSON allows you to use RBush on both the server + * (using Node.js) and the browser combined, e.g. first indexing the data on + * the server and and then importing the resulting tree data on the client + * for searching. + * + * Note that the nodeSize option passed to the constructor must be the same + * in both trees for export/import to work properly. + */ + fromJSON(data: any): RBush; + } + + interface IRBush { + /** + * Create a spatial index. + * + * An optional argument to rbush defines the maximum number of entries in a tree node. + * 9 (used by default) is a reasonable choice for most applications. Higher value means\ + * faster insertion and slower search, and vice versa. + */ + (nodeSize?: number): RBush; + (nodeSize: number, formatter: string[]): RBush; + } +} + +declare module 'rbush' { + const temp: rbush.IRBush; + export = temp; +} From e3d9ff9fe705702362af236d9e924e2203dc4a78 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Wed, 7 Sep 2016 07:43:24 -0400 Subject: [PATCH 80/91] Support ES6 import of jsts (#11059) * Support ES6 import of jsts * Use ES6 imports with jsts --- jsts/jsts-tests.ts | 5 ++++- jsts/jsts.d.ts | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/jsts/jsts-tests.ts b/jsts/jsts-tests.ts index 3b37d0f185..e9c00fd52a 100644 --- a/jsts/jsts-tests.ts +++ b/jsts/jsts-tests.ts @@ -1,4 +1,7 @@ /// + +import * as jsts from 'jsts'; + var str: string; var n: number; var bool: boolean; @@ -142,4 +145,4 @@ obj = gjw.write(g); var wr: jsts.io.WKTReader = new jsts.io.WKTReader(); g = wr.read(str); -wr.reducePrecision(g); \ No newline at end of file +wr.reducePrecision(g); diff --git a/jsts/jsts.d.ts b/jsts/jsts.d.ts index 909dbbf7a1..f06b5c7f51 100644 --- a/jsts/jsts.d.ts +++ b/jsts/jsts.d.ts @@ -1664,3 +1664,7 @@ declare namespace jsts { } } } + +declare module "jsts" { + export = jsts; +} From 882898317e1328f08c8caf990c9dc9e2aed47d9e Mon Sep 17 00:00:00 2001 From: Oleksii Date: Wed, 7 Sep 2016 14:44:38 +0300 Subject: [PATCH 81/91] Fix string type name. (#11000) * Fix string type name. * Fix toJSON() method return type. Return type has been changed from Object to any. --- elastic.js/elastic.js.d.ts | 420 ++++++++++++++++++------------------- 1 file changed, 210 insertions(+), 210 deletions(-) diff --git a/elastic.js/elastic.js.d.ts b/elastic.js/elastic.js.d.ts index 850d1ccdfa..9bf5f6a9dc 100644 --- a/elastic.js/elastic.js.d.ts +++ b/elastic.js/elastic.js.d.ts @@ -19,7 +19,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -40,7 +40,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -58,7 +58,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -107,7 +107,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the field to operate on. @@ -139,7 +139,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -161,7 +161,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -226,7 +226,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets if the Query should be enhanced with a @@ -278,7 +278,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -298,7 +298,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost factor. @@ -314,7 +314,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -335,7 +335,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -362,7 +362,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -382,7 +382,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the field to operate on. @@ -425,7 +425,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -454,7 +454,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the analyzer name used to analyze the Query object. @@ -522,7 +522,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -536,7 +536,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets analyzer used to analyze the suggest text. @@ -593,7 +593,7 @@ declare module elasticjs { Retrieves the internal suggest object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets if transpositions should be counted as one or two changes, defaults @@ -635,7 +635,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -666,7 +666,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -693,7 +693,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -805,7 +805,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -839,7 +839,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enables caching of the facetFilter @@ -986,7 +986,7 @@ declare module elasticjs { Retrieves the internal facet object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Allows you to specify a different value field to aggrerate over. @@ -1023,7 +1023,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -1086,7 +1086,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -1110,7 +1110,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the decay value which defines how documents are scored at the distance @@ -1165,7 +1165,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -1185,7 +1185,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the accuracy. How similar the suggested terms at least @@ -1285,7 +1285,7 @@ declare module elasticjs { Retrieves the internal generator object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -1389,7 +1389,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -1419,7 +1419,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -1438,7 +1438,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -1489,7 +1489,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the field to operate on. @@ -1521,7 +1521,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -1531,7 +1531,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enables caching of the facetFilter @@ -1573,7 +1573,7 @@ declare module elasticjs { Retrieves the internal facet object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -1595,7 +1595,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -1616,7 +1616,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -1636,7 +1636,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -1662,7 +1662,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -1684,7 +1684,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -1734,7 +1734,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -1766,7 +1766,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enables caching of the facetFilter @@ -1813,7 +1813,7 @@ declare module elasticjs { Retrieves the internal facet object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -1823,7 +1823,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -1864,7 +1864,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -1908,7 +1908,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -1946,7 +1946,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* The analyzer that will be used to analyze the text. Defaults to the @@ -2000,7 +2000,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -2035,7 +2035,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* The analyzer that will be used to analyze the text. Defaults to the @@ -2091,7 +2091,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -2116,7 +2116,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value of the Query. @@ -2179,7 +2179,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Set to false to use classic Levenshtein edit distance. @@ -2208,7 +2208,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the bottom-right coordinate of the bounding box @@ -2284,7 +2284,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -2344,7 +2344,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the distance unit. Valid values are: @@ -2383,7 +2383,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Adds a new bounded range. @@ -2479,7 +2479,7 @@ declare module elasticjs { Retrieves the internal facet object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the distance unit. Valid values are "mi" for miles or "km" @@ -2515,7 +2515,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -2601,7 +2601,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -2728,7 +2728,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -2771,7 +2771,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -2792,7 +2792,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the GeoPoint from an array point. The array must contain only @@ -2834,7 +2834,7 @@ declare module elasticjs { Retrieves the internal script object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -2853,7 +2853,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -2921,7 +2921,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -3007,7 +3007,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -3059,7 +3059,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -3079,7 +3079,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -3100,7 +3100,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -3119,7 +3119,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -3185,7 +3185,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -3232,7 +3232,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the child document type to search against @@ -3256,7 +3256,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -3317,7 +3317,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -3360,7 +3360,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -3390,7 +3390,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Set's the boundary characters. When highlighting a field that is @@ -3462,7 +3462,7 @@ declare module elasticjs { Sets arbitrary options that can be passed to the highlighter implementation in use. */ - options(opts: string, oField: Object): Highlight; + options(opts: string, oField: string): Highlight; /* Sets the order of highlight fragments. You can apply the option @@ -3508,7 +3508,7 @@ declare module elasticjs { Retrieves the internal script object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the highligher type. You can apply the option @@ -3539,7 +3539,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -3621,7 +3621,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -3655,7 +3655,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enables caching of the facetFilter @@ -3762,7 +3762,7 @@ declare module elasticjs { Retrieves the internal facet object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Allows you to specify a different value field to aggrerate over. @@ -3793,7 +3793,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -3848,7 +3848,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -3859,7 +3859,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the type as a single type or an array of types. If type is a @@ -3896,7 +3896,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the document id of the indexed shape. @@ -3919,7 +3919,7 @@ declare module elasticjs { Retrieves the internal script object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the type which the shape is indexed under. @@ -3945,7 +3945,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -4006,7 +4006,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -4036,7 +4036,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -4057,7 +4057,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -4115,7 +4115,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -4133,7 +4133,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -4177,7 +4177,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -4216,7 +4216,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -4227,7 +4227,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -4248,7 +4248,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the analyzer name used to analyze the Query object. @@ -4377,7 +4377,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the type of the MatchQuery. Valid values are @@ -4411,7 +4411,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the field to operate on. @@ -4443,7 +4443,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -4453,7 +4453,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the field to operate on. @@ -4485,7 +4485,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -4507,7 +4507,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the field to operate on. @@ -4539,7 +4539,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -4559,7 +4559,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -4585,7 +4585,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -4603,7 +4603,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -4657,7 +4657,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* The analyzer that will be used to analyze the text. Defaults to the @@ -4748,7 +4748,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -4767,7 +4767,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* The analyzer that will be used to analyze the text. Defaults to the @@ -4860,7 +4860,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -4883,7 +4883,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the analyzer name used to analyze the Query object. @@ -5022,7 +5022,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the type of the MultiMatchQuery. Valid values are @@ -5061,7 +5061,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -5087,7 +5087,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -5113,7 +5113,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value of the nested Query. @@ -5190,7 +5190,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -5227,7 +5227,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -5246,7 +5246,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -5300,7 +5300,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -5388,7 +5388,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -5437,7 +5437,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Compression controls memory usage and approximation error. The compression @@ -5496,7 +5496,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -5518,7 +5518,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets analyzer used to analyze the suggest text. @@ -5625,7 +5625,7 @@ declare module elasticjs { Retrieves the internal suggest object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the token limit. @@ -5649,7 +5649,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -5698,7 +5698,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value of the Query. @@ -5743,7 +5743,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* The prefix value. @@ -5780,7 +5780,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enables caching of the facetFilter @@ -5827,7 +5827,7 @@ declare module elasticjs { Retrieves the internal facet object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -5853,7 +5853,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -5888,7 +5888,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -5899,7 +5899,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -5922,7 +5922,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets whether or not wildcard characters (* and ?) are allowed as the @@ -6114,7 +6114,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets whether or not queries against multiple fields should be combined using Lucene's @@ -6140,7 +6140,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Adds a filter whose matching documents will have the score function applied. @@ -6156,7 +6156,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -6181,7 +6181,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -6223,7 +6223,7 @@ declare module elasticjs { /* Adds a range to the list of exsiting range expressions. */ - range(from: string, to: string, key: string): RangeAggregation; + range(from: number, to?: number, key?: string): RangeAggregation; /* Allows you generate or modify the terms using a script. @@ -6239,7 +6239,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -6271,7 +6271,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Adds a new bounded range. @@ -6356,7 +6356,7 @@ declare module elasticjs { Retrieves the internal facet object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Allows you to specify an alternate value field to be used to compute statistical information. @@ -6385,7 +6385,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -6476,7 +6476,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value of the Query. @@ -6537,7 +6537,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -6557,7 +6557,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -6630,7 +6630,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value of the Query. @@ -6698,7 +6698,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* The regexp value. @@ -6721,7 +6721,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add an aggregation. This method can be called multiple times @@ -6769,7 +6769,7 @@ declare module elasticjs { by making multiple request. This parameters specifies the starting result/document number point. Combine with size() to achieve paging. */ - from(f: any[]): Request; + from(f: number): Request; /* Performs highlighting based on the Highlight @@ -6827,7 +6827,7 @@ declare module elasticjs { It is recommended to use Sort objects when possible. */ - sort(fieldName: string): Request; + sort(fieldName?: string | any[] | Sort, order?: string): Request; /* Allows to control how the _source field is returned with every hit. @@ -6859,7 +6859,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Enables score computation and tracking during sorting. Be default, @@ -6889,7 +6889,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the weight assigned to the original query of the rescoring. @@ -6921,7 +6921,7 @@ declare module elasticjs { Retrieves the internal script object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the window_size parameter of the rescoring. @@ -6936,7 +6936,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Adds a filter whose matching documents will have the score function applied. @@ -6947,7 +6947,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -6969,7 +6969,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* If execeptions thrown from the script should be ignored or not. @@ -6997,7 +6997,7 @@ declare module elasticjs { Retrieves the internal script object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7015,7 +7015,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -7071,7 +7071,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Adds a filter whose matching documents will have the score function applied. @@ -7098,7 +7098,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7119,7 +7119,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the coordinates for the shape definition. Note, the coordinates @@ -7137,7 +7137,7 @@ declare module elasticjs { Retrieves the internal script object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the shape type. Can be set to one of: point, linestring, polygon, @@ -7163,7 +7163,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -7237,7 +7237,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7258,7 +7258,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the sort order to ascending (asc). Same as calling @@ -7393,7 +7393,7 @@ declare module elasticjs { Retrieves the internal script object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the script sort type. Valid values are: @@ -7433,7 +7433,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -7454,7 +7454,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7474,7 +7474,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -7490,7 +7490,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7509,7 +7509,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -7543,7 +7543,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7562,7 +7562,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -7583,7 +7583,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7602,7 +7602,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -7620,7 +7620,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7640,7 +7640,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -7661,7 +7661,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7693,7 +7693,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enables caching of the facetFilter @@ -7762,7 +7762,7 @@ declare module elasticjs { Retrieves the internal facet object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7786,7 +7786,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the field to operate on. @@ -7818,7 +7818,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7854,7 +7854,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the text to get suggestions for. If not set, the global @@ -7866,7 +7866,7 @@ declare module elasticjs { Retrieves the internal suggest object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7888,7 +7888,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the field to operate on. @@ -7920,7 +7920,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -7940,7 +7940,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -7994,7 +7994,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -8015,7 +8015,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -8034,7 +8034,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Add a nested aggregation. This method can be called multiple times @@ -8134,7 +8134,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the type of the field value for use in scripts. Current values are: @@ -8169,7 +8169,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Allows you to return all terms, even if the frequency count is 0. This should not be @@ -8301,7 +8301,7 @@ declare module elasticjs { Retrieves the internal facet object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -8320,7 +8320,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -8416,7 +8416,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -8451,7 +8451,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -8483,7 +8483,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Allows you to return all terms, even if the frequency count is 0. This should not be @@ -8579,7 +8579,7 @@ declare module elasticjs { Retrieves the internal facet object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the field for which statistical information will be generated. @@ -8612,7 +8612,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the accuracy. How similar the suggested terms at least @@ -8716,7 +8716,7 @@ declare module elasticjs { Retrieves the internal suggest object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -8740,7 +8740,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -8787,7 +8787,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the child document type to search against @@ -8810,7 +8810,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Enable or disable caching of the filter @@ -8858,7 +8858,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the field to operate on. @@ -8890,7 +8890,7 @@ declare module elasticjs { Retrieves the internal agg object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; } @@ -8915,7 +8915,7 @@ declare module elasticjs { /* The type of ejs object. For internal use only. */ - _type(): String; + _type(): string; /* Sets the boost value for documents matching the Query. @@ -8960,7 +8960,7 @@ declare module elasticjs { Retrieves the internal query object. This is typically used by internal API functions so use with caution. */ - toJSON(): String; + toJSON(): any; /* Sets the wildcard query value. From d9af52a23d11690d49cba71f04d1e1942813995c Mon Sep 17 00:00:00 2001 From: Yuichi Watanabe Date: Wed, 7 Sep 2016 20:45:36 +0900 Subject: [PATCH 82/91] add type definitions of backlog-js (#10984) * add type definitions of backlog-js * rename file --- backlog-js/backlog-js-tests.ts | 88 +++++ backlog-js/backlog-js.d.ts | 695 +++++++++++++++++++++++++++++++++ 2 files changed, 783 insertions(+) create mode 100644 backlog-js/backlog-js-tests.ts create mode 100644 backlog-js/backlog-js.d.ts diff --git a/backlog-js/backlog-js-tests.ts b/backlog-js/backlog-js-tests.ts new file mode 100644 index 0000000000..979eb57ca4 --- /dev/null +++ b/backlog-js/backlog-js-tests.ts @@ -0,0 +1,88 @@ +/// + +import * as backlogjs from 'backlog-js'; + +const host = 'example.backlog.jp'; +const apiKey = 'apiKey'; +const clientId = 'clientId'; +const clientSecret = 'clientSecret'; +const redirectUri = 'redirectUri'; +const state = 'state'; +const code = 'code'; +const refreshToken = 'refreshToken'; +const configure = { host, apiKey } +const credentials = { clientId, clientSecret } + +const oauth2 = new backlogjs.OAuth2(credentials); +oauth2.getAuthorizationURL({ host, redirectUri, state }); +oauth2.getAccessToken({ host, code, redirectUri }).then(data => {}).catch(err => {}); +oauth2.refreshAccessToken({ host, refreshToken }).then(data => {}).catch(err => {}); + +const backlog = new backlogjs.Backlog(configure); +backlog.getSpace().then(data => { }).catch(err => { }); +backlog.getSpaceActivities({ + activityTypeId: [ + backlogjs.Option.ActivityType.IssueCreated, + backlogjs.Option.ActivityType.IssueUpdated + ], + minId: 1, + maxId: 2, + count: 3, + order: "asc" +}).then(data => { }).catch(err => { }); +backlog.getSpaceDiskUsage().then(data => { }).catch(err => { }); +backlog.getSpaceIcon().then(data => { }).catch(err => { }); +backlog.postSpaceAttachment(new FormData()).then(data => { }).catch(err => { }); +backlog.getUsers().then(data => { }).catch(err => { }); +backlog.getUser(1).then(data => { }).catch(err => { }); +backlog.postUser({ + userId: 'string', + password: 'string', + name: 'string', + mailAddress: 'string', + roleType: backlogjs.Option.User.RoleType.Admin +}).then(data => { }).catch(err => { }); +backlog.patchUser(1, { + password: 'string', + name: 'string', + mailAddress: 'string', + roleType: backlogjs.Option.User.RoleType.Admin +}).then(data => { }).catch(err => { }); +backlog.deleteUser(1).then(data => { }).catch(err => { }); +backlog.getMyself().then(data => { }).catch(err => { }); +backlog.getUserActivities(1, { + activityTypeId: [ + backlogjs.Option.ActivityType.IssueCreated, + backlogjs.Option.ActivityType.IssueUpdated + ], + minId: 1, + maxId: 2, + count: 3, + order: "asc" +}).then(data => { }).catch(err => { }); +backlog.getUserStars(1, { + minId: 1, + maxId: 2, + count: 3, + order: "asc" +}).then(data => { }).catch(err => { }); +backlog.getUserStarsCount(1, { + since: 'YYYY-MM-DD', + until: 'YYYY-MM-DD' +}).then(data => { }).catch(err => { }); +backlog.getRecentlyViewedIssues({ + order: 'asc', + offset: 1, + count: 2 +}).then(data => { }).catch(err => { }); +backlog.getRecentlyViewedProjects({ + order: 'asc', + offset: 1, + count: 2 +}).then(data => { }).catch(err => { }); +backlog.getRecentlyViewedWikis({ + order: 'asc', + offset: 1, + count: 2 +}).then(data => { }).catch(err => { }); +backlog.getUserIcon(1).then(data => {}).catch(err => {}); diff --git a/backlog-js/backlog-js.d.ts b/backlog-js/backlog-js.d.ts new file mode 100644 index 0000000000..353e7e90cd --- /dev/null +++ b/backlog-js/backlog-js.d.ts @@ -0,0 +1,695 @@ +// Type definitions for backlog-js 0.9.0 +// Project: https://github.com/nulab/backlog-js +// Definitions by: Yuichi Watanabe +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// + +declare module 'backlog-js' { + + class Request { + private configure; + constructor(configure: { + host: string; + apiKey?: string; + accessToken?: string; + timeout?: number; + }); + get(path: string, params?: any): Promise; + post(path: string, params?: any): Promise; + put(path: string, params: any): Promise; + patch(path: string, params: any): Promise; + delete(path: string, params?: any): Promise; + request(options: { + method: string; + path: string; + params?: Params | FormData; + }): Promise; + checkStatus(response: IResponse): Promise; + parseJSON(response: IResponse): Promise; + private toFormData(params); + private toQueryString(params); + webAppBaseURL: string; + restBaseURL: string; + } + + type Params = { + [index: string]: number | string | number[] | string[]; + }; + + export class Backlog extends Request { + constructor(configure: { + host: string; + apiKey?: string; + accessToken?: string; + timeout?: number; + }); + getSpace(): Promise; + getSpaceActivities(params: Option.Space.GetActivitiesParams): Promise; + getSpaceNotification(): Promise; + putSpaceNotification(params: Option.Space.PutSpaceNotificationParams): Promise; + getSpaceDiskUsage(): Promise; + getSpaceIcon(): Promise; + postSpaceAttachment(form: FormData): Promise; + getUsers(): Promise; + getUser(userId: number): Promise; + postUser(params: Option.User.PostUserParams): Promise; + patchUser(userId: number, params: Option.User.PatchUserParams): Promise; + deleteUser(userId: number): Promise; + getMyself(): Promise; + getUserActivities(userId: number, params: Option.User.GetUserActivitiesParams): Promise; + getUserStars(userId: number, params: Option.User.GetUserStarsParams): Promise; + getUserStarsCount(userId: number, params: Option.User.GetUserStarsCountParams): Promise; + getRecentlyViewedIssues(params: Option.User.GetRecentlyViewedParams): Promise; + getRecentlyViewedProjects(params: Option.User.GetRecentlyViewedParams): Promise; + getRecentlyViewedWikis(params: Option.User.GetRecentlyViewedParams): Promise; + getUserIcon(userId: number): Promise; + getGroups(params: Option.Group.GetGroupsParams): Promise; + postGroups(params: Option.Group.PostGroupsParams): Promise; + getGroup(groupId: number): Promise; + patchGroup(groupId: number, params: Option.Group.PatchGroupParams): Promise; + deleteGroup(groupId: number): Promise; + getStatuses(): Promise; + getResolutions(): Promise; + getPriorities(): Promise; + postProject(params: Option.Project.PostProjectParams): Promise; + getProjects(params?: Option.Project.GetProjectsParams): Promise; + getProject(projectIdOrKey: string): Promise; + patchProject(projectIdOrKey: string, params: Option.Project.PatchProjectParams): Promise; + deleteProject(projectIdOrKey: string): Promise; + getProjectActivities(projectIdOrKey: string, params: Option.Space.GetActivitiesParams): Promise; + getProjectUsers(projectIdOrKey: string): Promise; + deleteProjectUsers(projectIdOrKey: string, params: Option.Project.DeleteProjectUsersParams): Promise; + postProjectAdministrators(projectIdOrKey: string, params: Option.Project.PostProjectAdministrators): Promise; + getProjectAdministrators(projectIdOrKey: string): Promise; + deleteProjectAdministrators(projectIdOrKey: string, params: Option.Project.DeleteProjectAdministrators): Promise; + getIssueTypes(projectIdOrKey: string): Promise; + postIssueType(projectIdOrKey: string, params: Option.Project.PostIssueTypeParams): Promise; + patchIssueType(projectIdOrKey: string, id: number, params: Option.Project.PatchIssueTypeParams): Promise; + deleteIssueType(projectIdOrKey: string, id: number, params: Option.Project.DeleteIssueTypeParams): Promise; + getCategories(projectIdOrKey: string): Promise; + postCategories(projectIdOrKey: string, params: Option.Project.PostCategoriesParams): Promise; + patchCategories(projectIdOrKey: string, id: number, params: Option.Project.PatchCategoriesParams): Promise; + deleteCategories(projectIdOrKey: string, id: number): Promise; + getVersions(projectIdOrKey: string): Promise; + postVersions(projectIdOrKey: string, params: Option.Project.PostVersionsParams): Promise; + patchVersions(projectIdOrKey: string, id: number, params: Option.Project.PatchVersionsParams): Promise; + deleteVersions(projectIdOrKey: string, id: number): Promise; + getCustomFields(projectIdOrKey: string): Promise; + postCustomField(projectIdOrKey: string, params: Option.Project.PostCustomFieldParams | Option.Project.PostCustomFieldWithNumericParams | Option.Project.PostCustomFieldWithDateParams | Option.Project.PostCustomFieldWithListParams): Promise; + patchCustomField(projectIdOrKey: string, id: number, params: Option.Project.PatchCustomFieldParams | Option.Project.PatchCustomFieldWithNumericParams | Option.Project.PatchCustomFieldWithDateParams | Option.Project.PatchCustomFieldWithListParams): Promise; + deleteCustomField(projectIdOrKey: string, id: number): Promise; + postCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise; + patchCustomFieldItem(projectIdOrKey: string, id: number, itemId: number, params: Option.Project.PatchCustomFieldItemParams): Promise; + deleteCustomFieldItem(projectIdOrKey: string, id: number, params: Option.Project.PostCustomFieldItemParams): Promise; + getSharedFiles(projectIdOrKey: string, path: string, params: Option.Project.GetSharedFilesParams): Promise; + getProjectsDiskUsage(projectIdOrKey: string): Promise; + getWebhooks(projectIdOrKey: string): Promise; + postWebhook(projectIdOrKey: string, params: Option.Project.PostWebhookParams): Promise; + getWebhook(projectIdOrKey: string, webhookId: string): Promise; + patchWebhook(projectIdOrKey: string, webhookId: string, params: Option.Project.PatchWebhookParams): Promise; + deleteWebhook(projectIdOrKey: string, webhookId: string): Promise; + postIssue(params: Option.Issue.PostIssueParams): Promise; + patchIssue(issueIdOrKey: string, params: Option.Issue.PatchIssueParams): Promise; + getIssues(params?: Option.Issue.GetIssuesParams): Promise; + getIssue(issueIdOrKey: string): Promise; + getIssuesCount(params?: Option.Issue.GetIssuesParams): Promise; + deleteIssuesCount(issueIdOrKey: string): Promise; + getIssueComments(issueIdOrKey: string, params: Option.Issue.GetIssueCommentsParams): Promise; + postIssueComments(issueIdOrKey: string, params: Option.Issue.PostIssueCommentsParams): Promise; + getIssueCommentsCount(issueIdOrKey: string): Promise; + getIssueComment(issueIdOrKey: string, commentId: number): Promise; + patchIssueComment(issueIdOrKey: string, commentId: number, params: Option.Issue.PatchIssueCommentParams): Promise; + getIssueCommentNotifications(issueIdOrKey: string, commentId: number): Promise; + postIssueCommentNotifications(issueIdOrKey: string, commentId: number, prams: Option.Issue.IssueCommentNotifications): Promise; + getIssueAttachments(issueIdOrKey: string): Promise; + deleteIssueAttachment(issueIdOrKey: string, attachmentId: string): Promise; + getIssueSharedFiles(issueIdOrKey: string): Promise; + linkIssueSharedFiles(issueIdOrKey: string, params: Option.Issue.LinkIssueSharedFilesParams): Promise; + unlinkIssueSharedFile(issueIdOrKey: string, id: number): Promise; + getWikis(projectIdOrKey: number): Promise; + getWikisCount(projectIdOrKey: number): Promise; + getWikisTags(projectIdOrKey: number): Promise; + postWiki(params: Option.Wiki.PostWikiParams): Promise; + getWiki(wikiId: number): Promise; + patchWiki(wikiId: number, params: Option.Wiki.PatchWikiParams): Promise; + deleteWiki(wikiId: number, mailNotify: boolean): Promise; + getWikisAttachments(wikiId: number): Promise; + postWikisAttachments(wikiId: number, attachmentId: number[]): Promise; + deleteWikisAttachments(wikiId: number, attachmentId: number): Promise; + getWikisSharedFiles(wikiId: number): Promise; + linkWikisSharedFiles(wikiId: number, fileId: number[]): Promise; + unlinkWikisSharedFiles(wikiId: number, id: number): Promise; + getWikisHistory(wikiId: number, params: Option.Wiki.GetWikisHistoryParams): Promise; + getWikisStars(wikiId: number): Promise; + postStar(params: Option.Project.PostStarParams): Promise; + getNotifications(params: Option.Notification.GetNotificationsParams): Promise; + getNotificationsCount(params: Option.Notification.GetNotificationsCountParams): Promise; + resetNotificationsMarkAsRead(): Promise; + markAsReadNotification(id: number): Promise; + getGitRepositories(projectIdOrKey: string): Promise; + getGitRepository(projectIdOrKey: string, repoIdOrName: string): Promise; + getPullRequests(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise; + getPullRequestsCount(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise; + postPullRequest(projectIdOrKey: string, repoIdOrName: string, params: Option.PullRequest.PostPullRequestParams): Promise; + getPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number): Promise; + patchPullRequest(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PatchPullRequestParams): Promise; + getPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.GetPullRequestCommentsParams): Promise; + postPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, params: Option.PullRequest.PostPullRequestCommentsParams): Promise; + getPullRequestCommentsCount(projectIdOrKey: string, repoIdOrName: string, number: number): Promise; + patchPullRequestComments(projectIdOrKey: string, repoIdOrName: string, number: number, commentId: number, params: Option.PullRequest.PatchPullRequestCommentsParams): Promise; + getPullRequestAttachments(projectIdOrKey: string, repoIdOrName: string, number: number): Promise; + deletePullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise; + getProjectIcon(projectIdOrKey: string): Promise; + getSharedFile(projectIdOrKey: string, sharedFileId: number): Promise; + getIssueAttachment(issueIdOrKey: string, attachmentId: number): Promise; + getWikiAttachment(wikiId: number, attachmentId: number): Promise; + getPullRequestAttachment(projectIdOrKey: string, repoIdOrName: string, number: number, attachmentId: number): Promise; + private download(path); + private upload(path, params); + private parseFileData(response); + } + + export class OAuth2 { + private credentials; + private timeout; + constructor(credentials: Option.OAuth2.Credentials, timeout?: number); + getAuthorizationURL(options: { + host: string; + redirectUri?: string; + state?: string; + }): string; + getAccessToken(options: { + host: string; + code: string; + redirectUri?: string; + }): Promise; + refreshAccessToken(options: { + host: string; + refreshToken: string; + }): Promise; + } + + import { PassThrough } from 'stream'; + export namespace Entity { + export namespace File { + export type FileData = NodeFileData | BrowserFileData; + export interface NodeFileData { + body: PassThrough; + url: string; + filename: string; + } + export interface BrowserFileData { + body: any; + url: string; + blob?: () => Promise; + } + } + export namespace OAuth2 { + export interface AccessToken { + access_token: string; + token_type: string; + expires_in: number; + refresh_token: string; + } + } + } + + + export namespace Option { + export type Order = "asc" | "desc"; + export enum ActivityType { + Undefined = -1, + IssueCreated = 1, + IssueUpdated = 2, + IssueCommented = 3, + IssueDeleted = 4, + WikiCreated = 5, + WikiUpdated = 6, + WikiDeleted = 7, + FileAdded = 8, + FileUpdated = 9, + FileDeleted = 10, + SvnCommitted = 11, + GitPushed = 12, + GitRepositoryCreated = 13, + IssueMultiUpdated = 14, + ProjectUserAdded = 15, + ProjectUserRemoved = 16, + NotifyAdded = 17, + PullRequestAdded = 18, + PullRequestUpdated = 19, + PullRequestCommented = 20, + PullRequestMerged = 21, + } + export namespace Notification { + export interface GetNotificationsParams { + minId?: number; + maxId?: number; + count?: number; + order?: Order; + } + export interface GetNotificationsCountParams { + alreadyRead: boolean; + resourceAlreadyRead: boolean; + } + } + export namespace Space { + export interface GetActivitiesParams { + activityTypeId?: ActivityType[]; + minId?: number; + maxId?: number; + count?: number; + order?: Order; + } + export interface PutSpaceNotificationParams { + content: string; + } + } + export namespace User { + export interface PostUserParams { + userId: string; + password: string; + name: string; + mailAddress: string; + roleType: RoleType; + } + export interface PatchUserParams { + password?: string; + name?: string; + mailAddress?: string; + roleType?: RoleType; + } + export enum RoleType { + Admin = 1, + User = 2, + Reporter = 3, + Viewer = 4, + GuestReporter = 5, + GuestViewer = 6, + } + export interface GetUserActivitiesParams { + activityTypeId?: ActivityType[]; + minId?: number; + maxId?: number; + count?: number; + order?: Order; + } + export interface GetUserStarsParams { + minId?: number; + maxId?: number; + count?: number; + order?: Order; + } + export interface GetUserStarsCountParams { + since?: string; + until?: string; + } + export interface GetRecentlyViewedParams { + order?: Order; + offset?: number; + count?: number; + } + } + export namespace Group { + export interface GetGroupsParams { + order?: Order; + offset?: number; + count?: number; + } + export interface PostGroupsParams { + name: string; + members?: string[]; + } + export interface PatchGroupParams { + name?: string; + members?: string[]; + } + } + export namespace Project { + export type TextFormattingRule = "backlog" | "markdown"; + export interface PostProjectParams { + name: string; + key: string; + chartEnabled: boolean; + projectLeaderCanEditProjectLeader?: boolean; + subtaskingEnabled: boolean; + textFormattingRule: TextFormattingRule; + } + export interface PatchProjectParams { + name?: string; + key?: string; + chartEnabled?: boolean; + subtaskingEnabled?: boolean; + projectLeaderCanEditProjectLeader?: boolean; + textFormattingRule?: TextFormattingRule; + archived?: boolean; + } + export interface GetProjectsParams { + archived?: boolean; + all?: boolean; + } + export interface DeleteProjectUsersParams { + userId: number; + } + export interface PostProjectAdministrators { + userId: number; + } + export interface DeleteProjectAdministrators { + userId: number; + } + export type IssueTypeColor = "#e30000" | "#990000" | "#934981" | "#814fbc" | "#2779ca" | "#007e9a" | "#7ea800" | "#ff9200" | "#ff3265" | "#666665"; + export interface PostIssueTypeParams { + name: string; + color: IssueTypeColor; + } + export interface PatchIssueTypeParams { + name?: string; + color?: IssueTypeColor; + } + export interface DeleteIssueTypeParams { + substituteIssueTypeId: number; + } + export interface PostCategoriesParams { + name: string; + } + export interface PatchCategoriesParams { + name: string; + } + export interface PostVersionsParams { + name: string; + description: string; + startDate: string; + releaseDueDate: string; + } + export interface PatchVersionsParams { + name: string; + description?: string; + startDate?: string; + releaseDueDate?: string; + archived?: boolean; + } + export interface PostCustomFieldParams { + typeId: FieldType; + name: string; + applicableIssueTypes?: number[]; + description?: string; + required?: boolean; + } + export interface PostCustomFieldWithNumericParams extends PostCustomFieldParams { + min?: number; + max?: number; + initialValue?: number; + unit?: string; + } + export interface PostCustomFieldWithDateParams extends PostCustomFieldParams { + min?: string; + max?: string; + initialValueType?: number; + initialDate?: string; + initialShift?: number; + } + export interface PostCustomFieldWithListParams extends PostCustomFieldParams { + items?: string[]; + allowInput?: boolean; + allowAddItem?: boolean; + } + export interface PatchCustomFieldParams { + name?: string; + applicableIssueTypes?: number[]; + description?: string; + required?: boolean; + } + export interface PatchCustomFieldWithNumericParams extends PatchCustomFieldParams { + min?: number; + max?: number; + initialValue?: number; + unit?: string; + } + export interface PatchCustomFieldWithDateParams extends PatchCustomFieldParams { + min?: string; + max?: string; + initialValueType?: number; + initialDate?: string; + initialShift?: number; + } + export interface PatchCustomFieldWithListParams extends PatchCustomFieldParams { + items?: string[]; + allowInput?: boolean; + allowAddItem?: boolean; + } + export interface PostCustomFieldItemParams { + name: string; + } + export interface PatchCustomFieldItemParams { + name: string; + } + export interface GetSharedFilesParams { + order?: Order; + offset?: number; + count?: number; + } + export interface PostWebhookParams { + name?: string; + description?: string; + hookUrl?: string; + allEvent?: boolean; + activityTypeIds?: number[]; + } + export interface PatchWebhookParams { + name?: string; + description?: string; + hookUrl?: string; + allEvent?: boolean; + activityTypeIds?: number[]; + } + export enum FieldType { + Text = 1, + TextArea = 2, + Numeric = 3, + Date = 4, + SingleList = 5, + MultipleList = 6, + CheckBox = 7, + Radio = 8, + } + export interface PostStarParams { + issueId?: number; + commentId?: number; + wikiId?: number; + pullRequestId?: number; + pullRequestCommentId?: number; + } + } + export namespace Issue { + export interface PostIssueParams { + projectId: number; + summary: string; + priorityId: number; + issueTypeId: number; + parentIssueId?: number; + description?: string; + startDate?: string; + dueDate?: string; + estimatedHours?: number; + actualHours?: number; + categoryId?: number[]; + versionId?: number[]; + milestoneId?: number[]; + assigneeId?: number; + notifiedUserId?: number[]; + attachmentId?: number[]; + [customField_: string]: any; + } + export interface PatchIssueParams { + summary?: string; + parentIssueId?: number; + description?: string; + statusId?: number; + resolutionId?: number; + startDate?: string; + dueDate?: string; + estimatedHours?: number; + actualHours?: number; + issueTypeId?: number; + categoryId?: number[]; + versionId?: number[]; + milestoneId?: number[]; + priorityId?: number; + assigneeId?: number; + notifiedUserId?: number[]; + attachmentId?: number[]; + comment?: string; + [customField_: string]: any; + } + export interface GetIssuesParams { + projectId?: number[]; + issueTypeId?: number[]; + categoryId?: number[]; + versionId?: number[]; + milestoneId?: number[]; + statusId?: number[]; + priorityId?: number[]; + assigneeId?: number[]; + createdUserId?: number[]; + resolutionId?: number[]; + parentChild?: ParentChildType; + attachment?: boolean; + sharedFile?: boolean; + sort?: SortKey; + order?: Order; + offset?: number; + count?: number; + createdSince?: string; + createdUntil?: string; + updatedSince?: string; + updatedUntil?: string; + startDateSince?: string; + startDateUntil?: string; + dueDateSince?: string; + dueDateUntil?: string; + id?: number[]; + parentIssueId?: number[]; + keyword: string; + [customField_: string]: any; + } + export enum ParentChildType { + All = 0, + NotChild = 1, + Child = 2, + NotChildNotParent = 3, + Parent = 4, + } + export type SortKey = "issueType" | "category" | "version" | "milestone" | "summary" | "status" | "priority" | "attachment" | "sharedFile" | "created" | "createdUser" | "updated" | "updatedUser" | "assignee" | "startDate" | "dueDate" | "estimatedHours" | "actualHours" | "childIssue"; + export interface GetIssueCommentsParams { + minId?: number; + maxId?: number; + count?: number; + order?: Order; + } + export interface PostIssueCommentsParams { + content: string; + notifiedUserId?: number[]; + attachmentId?: number[]; + } + export interface PatchIssueCommentParams { + content: string; + } + export interface IssueCommentNotifications { + notifiedUserId: number[]; + } + export interface LinkIssueSharedFilesParams { + fileId: number[]; + } + } + export namespace PullRequest { + export interface GetPullRequestsParams { + statusId?: number[]; + assigneeId?: number[]; + issueId?: number[]; + createdUserId?: number[]; + offset?: number; + count?: number; + } + export interface PostPullRequestParams { + summary: string; + description: string; + base: string; + branch: string; + issueId?: number; + assigneeId?: number; + notifiedUserId?: number[]; + attachmentId?: number[]; + } + export interface PatchPullRequestParams { + summary?: string; + description?: string; + issueId?: number; + assigneeId?: number; + notifiedUserId?: number[]; + comment?: string[]; + } + export interface GetPullRequestCommentsParams { + minId?: number; + maxId?: number; + count?: number; + order?: Order; + } + export interface PostPullRequestCommentsParams { + content: string; + notifiedUserId?: number[]; + } + export interface PatchPullRequestCommentsParams { + content: string; + } + } + export namespace Wiki { + export interface PostWikiParams { + projectId: number; + name: string; + content: string; + mailNotify?: boolean; + } + export interface PatchWikiParams { + name?: string; + content?: string; + mailNotify?: boolean; + } + export interface GetWikisHistoryParams { + minId?: number; + maxId?: number; + count?: number; + order?: Order; + } + } + export namespace OAuth2 { + export interface Credentials { + clientId: string; + clientSecret: string; + } + } + } + + export namespace Error { + export class BacklogError extends global.Error { + private _name; + private _url; + private _status; + private _body; + private _response; + constructor(name: BacklogErrorNameType, response: IResponse, body?: { + errors: BacklogErrorMessage[]; + }); + name: BacklogErrorNameType; + url: string; + status: number; + body: { + errors: BacklogErrorMessage[]; + }; + response: IResponse; + } + export class BacklogApiError extends BacklogError { + constructor(response: IResponse, body?: { + errors: BacklogErrorMessage[]; + }); + } + export class BacklogAuthError extends BacklogError { + constructor(response: IResponse, body?: { + errors: BacklogErrorMessage[]; + }); + } + export class UnexpectedError extends BacklogError { + constructor(response: IResponse); + } + export interface BacklogErrorMessage { + message: string; + code: number; + errorInfo: string; + moreInfo: string; + } + export type BacklogErrorNameType = 'BacklogApiError' | 'BacklogAuthError' | 'UnexpectedError'; + } + +} From 104dfb08ed919c95a0978bb43155f81b3c141c25 Mon Sep 17 00:00:00 2001 From: hriss95 Date: Wed, 7 Sep 2016 12:47:11 +0100 Subject: [PATCH 83/91] Node: Add tests for "timers" module (#11080) --- node/node-tests.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/node/node-tests.ts b/node/node-tests.ts index e1df5c499b..b250a732dc 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -21,6 +21,7 @@ import * as os from "os"; import * as vm from "vm"; import * as string_decoder from "string_decoder"; import * as stream from "stream"; +import * as timers from "timers"; // Specifically test buffer module regression. import {Buffer as ImportedBuffer, SlowBuffer as ImportedSlowBuffer} from "buffer"; @@ -988,6 +989,31 @@ namespace vm_tests { } } +///////////////////////////////////////////////////// +/// Timers tests : https://nodejs.org/api/timers.html +///////////////////////////////////////////////////// + +namespace timers_tests { + { + let immediateId = timers.setImmediate(function(){ console.log("immediate"); }); + timers.clearImmediate(immediateId); + } + { + let counter = 0; + let timeout = timers.setInterval(function(){ console.log("interval"); }, 20); + timeout.unref(); + timeout.ref(); + timers.clearInterval(timeout); + } + { + let counter = 0; + let timeout = timers.setTimeout(function(){ console.log("timeout"); }, 20); + timeout.unref(); + timeout.ref(); + timers.clearTimeout(timeout); + } +} + ///////////////////////////////////////////////////////// /// Errors Tests : https://nodejs.org/api/errors.html /// ///////////////////////////////////////////////////////// From 6e12852dc95b1b07024fe0f99d241a48eb379f93 Mon Sep 17 00:00:00 2001 From: AbraaoAlves Date: Wed, 7 Sep 2016 09:02:22 -0300 Subject: [PATCH 84/91] unify the indent style with other lines --- cucumber/cucumber.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cucumber/cucumber.d.ts b/cucumber/cucumber.d.ts index cb37208477..ff384b481f 100644 --- a/cucumber/cucumber.d.ts +++ b/cucumber/cucumber.d.ts @@ -10,14 +10,14 @@ declare namespace cucumber { (errror?:any):void; } - export interface TableDefinition{ - raw: () => Array; - rows: () => Array; - rowsHash: () => {}; - hashes: () => {}; - } + export interface TableDefinition{ + raw: () => Array; + rows: () => Array; + rowsHash: () => {}; + hashes: () => {}; + } - type StepDefinitionParam = string | CallbackStepDefinition | TableDefinition; + type StepDefinitionParam = string | CallbackStepDefinition | TableDefinition; interface StepDefinitionCode { (...stepArgs: Array): PromiseLike | any | void; From 2a761971e7d0ec5d261b10eed0ec9dc73212f50c Mon Sep 17 00:00:00 2001 From: hriss95 Date: Wed, 7 Sep 2016 13:15:44 +0100 Subject: [PATCH 85/91] Node.d.ts: Introduce module "console" (#10980) From 58c375c8bbdda159434ede03ba67975603e42d63 Mon Sep 17 00:00:00 2001 From: Denis Date: Wed, 7 Sep 2016 08:16:08 -0400 Subject: [PATCH 86/91] Implementation of geojson2osm definition (#11037) * Implementation of geojson2osm defintion Many forks of this project, this definition uses the actively maintained project hosted on NPM. https://www.npmjs.com/package/geojson2osm Authors: @Ruby21 & @aaronlidman * geojson2osm fixed comments - renamed test > tests - added space after project @vvakame --- geojson2osm/geojson2osm-tests.ts | 47 ++++++++++++++++++++++++++++++++ geojson2osm/geojson2osm.d.ts | 15 ++++++++++ 2 files changed, 62 insertions(+) create mode 100644 geojson2osm/geojson2osm-tests.ts create mode 100644 geojson2osm/geojson2osm.d.ts diff --git a/geojson2osm/geojson2osm-tests.ts b/geojson2osm/geojson2osm-tests.ts new file mode 100644 index 0000000000..c7bfc05b85 --- /dev/null +++ b/geojson2osm/geojson2osm-tests.ts @@ -0,0 +1,47 @@ +/// +/// + +import { geojson2osm } from 'geojson2osm' + +const features: GeoJSON.FeatureCollection = { + type: 'FeatureCollection', + features: [{ + type: 'Feature', + properties: { + 'building:colour': '#9F8169', + 'building:levels': 21, + building: 'yes', + height: 57, + }, + geometry: { + type: 'Polygon', + coordinates: [ + [ + [ + -434.2249470949173, + -13.15996269397843, + ], + [ + -434.2249470949173, + -13.159751140560356, + ], + [ + -434.2242631316185, + -13.159751140560356, + ], + [ + -434.2242631316185, + -13.15996269397843, + ], + [ + -434.2249470949173, + -13.15996269397843, + ], + ], + ], + }, + }, + ], +} + +geojson2osm(features) diff --git a/geojson2osm/geojson2osm.d.ts b/geojson2osm/geojson2osm.d.ts new file mode 100644 index 0000000000..58393411f1 --- /dev/null +++ b/geojson2osm/geojson2osm.d.ts @@ -0,0 +1,15 @@ +// Type definitions for geojson2osm 0.0.5 +// Project: https://github.com/Rub21/geojson2osm +// Definitions by: Denis Carriere +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'geojson2osm' { + /** + * Converts GeoJSON features to OpenStreetMap XML. + * @param features Input features + * @returns OpenStreetMap XML + */ + export function geojson2osm(features: GeoJSON.Feature | GeoJSON.FeatureCollection): any +} From 4c530f28d1e4bea629efe6232072889e3c6c93ac Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 7 Sep 2016 15:16:23 +0300 Subject: [PATCH 87/91] I'd like to become a reviewer for the core Angular 1.x definitions (#11083) To prevent situations like #11039 --- angularjs/angular.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index b989e640ea..3d5e5a7b19 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1,6 +1,6 @@ // Type definitions for Angular JS 1.5 // Project: http://angularjs.org -// Definitions by: Diego Vilar +// Definitions by: Diego Vilar , Georgii Dolzhykov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 28f791f3ea3082f00159a150938f71f4403c36ce Mon Sep 17 00:00:00 2001 From: AbraaoAlves Date: Wed, 7 Sep 2016 09:45:17 -0300 Subject: [PATCH 88/91] unify the indent style with other lines in tests --- cucumber/cucumber-tests.ts | 76 +++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/cucumber/cucumber-tests.ts b/cucumber/cucumber-tests.ts index 9f22e3f75d..56623e14d6 100644 --- a/cucumber/cucumber-tests.ts +++ b/cucumber/cucumber-tests.ts @@ -3,7 +3,7 @@ function StepSample() { type Callback = cucumber.CallbackStepDefinition; - type Table = cucumber.TableDefinition; + type Table = cucumber.TableDefinition; var step = this; var hook = this; @@ -39,42 +39,42 @@ function StepSample() { } }); - // Type for data_table.js on - // https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js - - step.Given(/^a table step with Table raw$/, function(table:Table){ - var expected = [ - ['Cucumber', 'Cucumis sativus'], - ['Burr Gherkin', 'Cucumis anguria'] - ]; - - assert.deepEqual(table.raw(), expected); - }); - - step.Given(/^a table step with Table rows$/, function(table: Table){ - var expected = [ - ['Apricot', '5'], - ['Brocolli', '2'], - ['Cucumber', '10'] - ]; - assert.deepEqual(table.rows(), expected) - }); - - step.Given(/^a table step with Table rowHash$/, function(table:Table){ - var expected = { - 'Cucumber': 'Cucumis sativus', - 'Burr Gherkin': 'Cucumis anguria' - }; - assert.deepEqual(table.rowsHash(), expected) - }); - - step.Given(/^a table step$/, function(table:Table){ - var expected = [ - {'Vegetable': 'Apricot', 'Rating': '5'}, - {'Vegetable': 'Brocolli', 'Rating': '2'}, - {'Vegetable': 'Cucumber', 'Rating': '10'} - ]; - assert.deepEqual(table.hashes(), expected) - }); + // Type for data_table.js on + // https://github.com/cucumber/cucumber-js/blob/a5fd8251918c278ab2e389226d165cedb44df14a/lib/cucumber/ast/data_table.js + + step.Given(/^a table step with Table raw$/, function(table:Table){ + var expected = [ + ['Cucumber', 'Cucumis sativus'], + ['Burr Gherkin', 'Cucumis anguria'] + ]; + + assert.deepEqual(table.raw(), expected); + }); + + step.Given(/^a table step with Table rows$/, function(table: Table){ + var expected = [ + ['Apricot', '5'], + ['Brocolli', '2'], + ['Cucumber', '10'] + ]; + assert.deepEqual(table.rows(), expected) + }); + + step.Given(/^a table step with Table rowHash$/, function(table:Table){ + var expected = { + 'Cucumber': 'Cucumis sativus', + 'Burr Gherkin': 'Cucumis anguria' + }; + assert.deepEqual(table.rowsHash(), expected) + }); + + step.Given(/^a table step$/, function(table:Table){ + var expected = [ + {'Vegetable': 'Apricot', 'Rating': '5'}, + {'Vegetable': 'Brocolli', 'Rating': '2'}, + {'Vegetable': 'Cucumber', 'Rating': '10'} + ]; + assert.deepEqual(table.hashes(), expected) + }); } From 11999b5ef590a1e4101173da776e37f2052705a7 Mon Sep 17 00:00:00 2001 From: Mickael Burguet Date: Wed, 7 Sep 2016 10:06:58 -0400 Subject: [PATCH 89/91] Add testcase --- pino/pino-tests.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pino/pino-tests.ts b/pino/pino-tests.ts index 9a2c423222..4a1470db24 100644 --- a/pino/pino-tests.ts +++ b/pino/pino-tests.ts @@ -26,6 +26,12 @@ var instance = PINO({ } }) +var pretty = PINO.pretty() +var instance2 = PINO({ + name: 'app', + safe: true +}, pretty) + var logger = instance logger.child({ a: 'property' }).info('hello child!') From 69089fffa5deb6dd1914139944ac70da5e1bdeee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez?= Date: Tue, 6 Sep 2016 14:12:51 -0600 Subject: [PATCH 90/91] Moved fs constants under constants as per documentation and added tests for access and accessSync --- node/node-tests.ts | 16 ++++++++++++++++ node/node.d.ts | 25 +++++++++++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/node/node-tests.ts b/node/node-tests.ts index de2f284c1f..1b05e60bdb 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -165,6 +165,22 @@ fs.watch('/tmp/foo-', { console.log(event, filename); }); +fs.access('/path/to/folder', (err) => {}); + +fs.access(Buffer.from(''), (err) => {}); + +fs.access('/path/to/folder', fs.constants.F_OK | fs.constants.R_OK, (err) => {}); + +fs.access(Buffer.from(''), fs.constants.F_OK | fs.constants.R_OK, (err) => {}); + +fs.accessSync('/path/to/folder'); + +fs.accessSync(Buffer.from('')); + +fs.accessSync('path/to/folder', fs.constants.W_OK | fs.constants.X_OK); + +fs.accessSync(Buffer.from(''), fs.constants.W_OK | fs.constants.X_OK); + /////////////////////////////////////////////////////// /// Buffer tests : https://nodejs.org/api/buffer.html /////////////////////////////////////////////////////// diff --git a/node/node.d.ts b/node/node.d.ts index d8ec206f42..4439dee6e8 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1717,14 +1717,23 @@ declare module "fs" { export function watch(filename: string, options: { persistent?: boolean; recursive?: boolean; encoding?: string }, listener?: (event: string, filename: string | Buffer) => any): FSWatcher; export function exists(path: string | Buffer, callback?: (exists: boolean) => void): void; export function existsSync(path: string | Buffer): boolean; - /** Constant for fs.access(). File is visible to the calling process. */ - export var F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - export var R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - export var W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - export var X_OK: number; + + interface Constants { + /** Constant for fs.access(). File is visible to the calling process. */ + F_OK: number; + + /** Constant for fs.access(). File can be read by the calling process. */ + R_OK: number; + + /** Constant for fs.access(). File can be written by the calling process. */ + W_OK: number; + + /** Constant for fs.access(). File can be executed by the calling process. */ + X_OK: number; + } + + export const constants: Constants; + /** Tests a user's permissions for the file specified by path. */ export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; From 7a87e2477320855830b31786a5ae72e741bb51fb Mon Sep 17 00:00:00 2001 From: rvassar Date: Wed, 7 Sep 2016 09:32:09 -0700 Subject: [PATCH 91/91] Updated version number. --- openlayers/openlayers.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index 6287edec46..00922aeb3b 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -1,4 +1,4 @@ -// Type definitions for OpenLayers v3.6.0 +// Type definitions for OpenLayers v3.18.2 // Project: http://openlayers.org/ // Definitions by: Wouter Goedhart // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped