From 0e70c031b052fbf944a1997331c5c82b81744608 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 7 Oct 2014 09:51:45 -0700 Subject: [PATCH 001/292] Aligned backpressure defintion to v2.3. --- rx.backpressure-lite.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rx.backpressure-lite.d.ts b/rx.backpressure-lite.d.ts index d1c244195f..9d4027be69 100644 --- a/rx.backpressure-lite.d.ts +++ b/rx.backpressure-lite.d.ts @@ -15,8 +15,7 @@ declare module Rx { * @param pauser The observable sequence used to pause the underlying sequence. * @returns The observable sequence which is paused based upon the pauser. */ - pausable(pauser: Observable): Observable; - pausable(pauser?: ISubject): PausableObservable; + pausable(pauser?: Observable): PausableObservable; /** * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, @@ -27,7 +26,7 @@ declare module Rx { * @param pauser The observable sequence used to pause the underlying sequence. * @returns The observable sequence which is paused based upon the pauser. */ - pausableBuffered(pauser?: ISubject): PausableObservable; + pausableBuffered(pauser?: Observable): PausableObservable; /** * Attaches a controller to the observable sequence with the ability to queue. From 0f296af96299baee7d428401dae1fbbbf6ec7d40 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 7 Oct 2014 09:52:47 -0700 Subject: [PATCH 002/292] Removed clear, contains from CompositeDisposable. --- rx-lite.d.ts | 2 -- rx.backpressure.d.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/rx-lite.d.ts b/rx-lite.d.ts index a472331770..b7bd9fb718 100644 --- a/rx-lite.d.ts +++ b/rx-lite.d.ts @@ -76,8 +76,6 @@ declare module Rx { dispose(): void; add(item: IDisposable): void; remove(item: IDisposable): boolean; - clear(): void; - contains(item: IDisposable): boolean; toArray(): IDisposable[]; } diff --git a/rx.backpressure.d.ts b/rx.backpressure.d.ts index 9c5e8abd50..18ab4ddd95 100644 --- a/rx.backpressure.d.ts +++ b/rx.backpressure.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RxJS-BackPressure v2.2.28 +// Type definitions for RxJS-BackPressure v2.3.12 // Project: http://rx.codeplex.com/ // Definitions by: Igor Oleinikov // Definitions: https://github.com/borisyankov/DefinitelyTyped From 7e358f4c507725a819ef2fee82f9fb398f7ffb97 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 7 Oct 2014 10:31:55 -0700 Subject: [PATCH 003/292] Made SerialDisposable be an alias of SingleAssigmentDisposable. --- rx-lite.d.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/rx-lite.d.ts b/rx-lite.d.ts index b7bd9fb718..68273c2fbd 100644 --- a/rx-lite.d.ts +++ b/rx-lite.d.ts @@ -100,15 +100,9 @@ declare module Rx { setDisposable(value: IDisposable): void ; } - // Multiple assignment disposable - export class SerialDisposable implements IDisposable { + // SerialDisposable it's an alias of SingleAssignmentDisposable + export class SerialDisposable extends SingleAssignmentDisposable { constructor(); - - isDisposed: boolean; - - dispose(): void; - getDisposable(): IDisposable; - setDisposable(value: IDisposable): void; } export class RefCountDisposable implements IDisposable { From e56c6d9aaa0daf4164216daa7dd413fe1ef89b33 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 7 Oct 2014 11:19:10 -0700 Subject: [PATCH 004/292] Added helpers.isFunction; added thisArg to Observer.fromNotifier; added Observable.subscribeOn*. --- rx-lite.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rx-lite.d.ts b/rx-lite.d.ts index 68273c2fbd..78b0c5a8c7 100644 --- a/rx-lite.d.ts +++ b/rx-lite.d.ts @@ -60,6 +60,7 @@ declare module Rx { function isPromise(p: any): boolean; function asArray(...args: T[]): T[]; function not(value: any): boolean; + function isFunction(value: any): boolean; } export interface IDisposable { @@ -180,7 +181,7 @@ declare module Rx { interface ObserverStatic { create(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observer; - fromNotifier(handler: (notification: Notification) => void): Observer; + fromNotifier(handler: (notification: Notification, thisArg?: any) => void): Observer; } export var Observer: ObserverStatic; @@ -188,6 +189,10 @@ declare module Rx { export interface IObservable { subscribe(observer: Observer): IDisposable; subscribe(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): IDisposable; + + subscribeOnNext(onNext: (value: T) => void, thisArg?: any): IDisposable; + subscribeOnError(onError: (exception: any) => void, thisArg?: any): IDisposable; + subscribeOnCompleted(onCompleted: () => void, thisArg?: any): IDisposable; } export interface Observable extends IObservable { From 8d80d832dcb1fee7806c9201431e4fe6ee612a23 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Tue, 7 Oct 2014 17:44:17 -0700 Subject: [PATCH 005/292] Added tap, doOn*, tapOn*, throwError, catchError. --- rx-lite.d.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rx-lite.d.ts b/rx-lite.d.ts index 78b0c5a8c7..63ce074d27 100644 --- a/rx-lite.d.ts +++ b/rx-lite.d.ts @@ -268,8 +268,18 @@ declare module Rx { distinctUntilChanged(keySelector?: (value: T) => TValue, comparer?: (x: TValue, y: TValue) => boolean): Observable; do(observer: Observer): Observable; doAction(observer: Observer): Observable; // alias for do + tap(observer: Observer): Observable; // alias for do do(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; doAction(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; // alias for do + tap(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; // alias for do + + doOnNext(onNext: (value: T) => void, thisArg?: any): Observable; + doOnError(onError: (exception: any) => void, thisArg?: any): Observable; + doOnCompleted(onCompleted: () => void, thisArg?: any): Observable; + tapOnNext(onNext: (value: T) => void, thisArg?: any): Observable; + tapOnError(onError: (exception: any) => void, thisArg?: any): Observable; + tapOnCompleted(onCompleted: () => void, thisArg?: any): Observable; + finally(action: () => void): Observable; finallyAction(action: () => void): Observable; // alias for finally ignoreElements(): Observable; @@ -498,15 +508,21 @@ declare module Rx { throw(exception: any, scheduler?: IScheduler): Observable; throwException(exception: Error, scheduler?: IScheduler): Observable; // alias for throw throwException(exception: any, scheduler?: IScheduler): Observable; // alias for throw + throwError(error: Error, scheduler?: IScheduler): Observable; // alias for throw + throwError(error: any, scheduler?: IScheduler): Observable; // alias for throw catch(sources: Observable[]): Observable; catch(sources: IPromise[]): Observable; catchException(sources: Observable[]): Observable; // alias for catch catchException(sources: IPromise[]): Observable; // alias for catch + catchError(sources: Observable[]): Observable; // alias for catch + catchError(sources: IPromise[]): Observable; // alias for catch catch(...sources: Observable[]): Observable; catch(...sources: IPromise[]): Observable; catchException(...sources: Observable[]): Observable; // alias for catch catchException(...sources: IPromise[]): Observable; // alias for catch + catchError(...sources: Observable[]): Observable; // alias for catch + catchError(...sources: IPromise[]): Observable; // alias for catch combineLatest(first: Observable, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; combineLatest(first: IPromise, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; From 4838b8ac0d3cb16c521dffc7c9440158fa374fbd Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 8 Oct 2014 17:21:17 -0700 Subject: [PATCH 006/292] Fixed `takeLast`, added `pluck`, `config.useNativeEvents`. --- rx-lite.d.ts | 3 ++- rx.async-lite.d.ts | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/rx-lite.d.ts b/rx-lite.d.ts index 63ce074d27..fc75833535 100644 --- a/rx-lite.d.ts +++ b/rx-lite.d.ts @@ -291,11 +291,12 @@ declare module Rx { skipLast(count: number): Observable; startWith(...values: T[]): Observable; startWith(scheduler: IScheduler, ...values: T[]): Observable; - takeLast(count: number, scheduler?: IScheduler): Observable; + takeLast(count: number): Observable; takeLastBuffer(count: number): Observable; select(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; map(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for select + pluck(prop: string): Observable; selectMany(selector: (value: T) => Observable, resultSelector: (item: T, other: TOther) => TResult): Observable; selectMany(selector: (value: T) => IPromise, resultSelector: (item: T, other: TOther) => TResult): Observable; selectMany(selector: (value: T) => Observable): Observable; diff --git a/rx.async-lite.d.ts b/rx.async-lite.d.ts index 77dc23b57d..f86dc326f3 100644 --- a/rx.async-lite.d.ts +++ b/rx.async-lite.d.ts @@ -6,6 +6,13 @@ /// declare module Rx { + export module config { + /** + * Configuration option to determine whether to use native events only + */ + export var useNativeEvents: boolean; + } + interface ObservableStatic { /** * Invokes the asynchronous function, surfacing the result through an observable sequence. From c24dbf968045564ffd2681c145377e83167a4554 Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Wed, 8 Oct 2014 17:26:25 -0700 Subject: [PATCH 007/292] Moved removed `rx.time` operators from rx.time-lite to rx.time. --- rx.time-lite.d.ts | 27 +-------------------------- rx.time.d.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/rx.time-lite.d.ts b/rx.time-lite.d.ts index 7a7d8f46ff..3642377f82 100644 --- a/rx.time-lite.d.ts +++ b/rx.time-lite.d.ts @@ -17,6 +17,7 @@ declare module Rx { } export interface Observable { + delay(dueTime: Date, scheduler?: IScheduler): Observable; delay(dueTime: number, scheduler?: IScheduler): Observable; throttle(dueTime: number, scheduler?: IScheduler): Observable; timeInterval(scheduler?: IScheduler): Observable>; @@ -25,25 +26,6 @@ declare module Rx { sample(sampler: Observable, scheduler?: IScheduler): Observable; timeout(dueTime: Date, other?: Observable, scheduler?: IScheduler): Observable; timeout(dueTime: number, other?: Observable, scheduler?: IScheduler): Observable; - - delaySubscription(dueTime: number, scheduler?: IScheduler): Observable; - delayWithSelector(delayDurationSelector: (item: T) => number): Observable; - delayWithSelector(subscriptionDelay: number, delayDurationSelector: (item: T) => number): Observable; - - timeoutWithSelector(firstTimeout: Observable, timeoutdurationSelector?: (item: T) => Observable, other?: Observable): Observable; - throttleWithSelector(throttleDurationSelector: (item: T) => Observable): Observable; - - skipLastWithTime(duration: number, scheduler?: IScheduler): Observable; - takeLastWithTime(duration: number, timerScheduler?: IScheduler, loopScheduler?: IScheduler): Observable; - - takeLastBufferWithTime(duration: number, scheduler?: IScheduler): Observable; - takeWithTime(duration: number, scheduler?: IScheduler): Observable; - skipWithTime(duration: number, scheduler?: IScheduler): Observable; - - skipUntilWithTime(startTime: Date, scheduler?: IScheduler): Observable; - skipUntilWithTime(duration: number, scheduler?: IScheduler): Observable; - takeUntilWithTime(endTime: Date, scheduler?: IScheduler): Observable; - takeUntilWithTime(duration: number, scheduler?: IScheduler): Observable; } interface ObservableStatic { @@ -51,12 +33,5 @@ declare module Rx { interval(dutTime: number, period: number, scheduler?: IScheduler): Observable; timer(dueTime: number, period: number, scheduler?: IScheduler): Observable; timer(dueTime: number, scheduler?: IScheduler): Observable; - generateWithRelativeTime( - initialState: TState, - condition: (state: TState) => boolean, - iterate: (state: TState) => TState, - resultSelector: (state: TState) => TResult, - timeSelector: (state: TState) => number, - scheduler?: IScheduler): Observable; } } diff --git a/rx.time.d.ts b/rx.time.d.ts index 2cdb1d56a8..3da66b95c5 100644 --- a/rx.time.d.ts +++ b/rx.time.d.ts @@ -8,6 +8,25 @@ declare module Rx { export interface Observable { + delaySubscription(dueTime: number, scheduler?: IScheduler): Observable; + delayWithSelector(delayDurationSelector: (item: T) => number): Observable; + delayWithSelector(subscriptionDelay: number, delayDurationSelector: (item: T) => number): Observable; + + timeoutWithSelector(firstTimeout: Observable, timeoutdurationSelector?: (item: T) => Observable, other?: Observable): Observable; + throttleWithSelector(throttleDurationSelector: (item: T) => Observable): Observable; + + skipLastWithTime(duration: number, scheduler?: IScheduler): Observable; + takeLastWithTime(duration: number, timerScheduler?: IScheduler, loopScheduler?: IScheduler): Observable; + + takeLastBufferWithTime(duration: number, scheduler?: IScheduler): Observable; + takeWithTime(duration: number, scheduler?: IScheduler): Observable; + skipWithTime(duration: number, scheduler?: IScheduler): Observable; + + skipUntilWithTime(startTime: Date, scheduler?: IScheduler): Observable; + skipUntilWithTime(duration: number, scheduler?: IScheduler): Observable; + takeUntilWithTime(endTime: Date, scheduler?: IScheduler): Observable; + takeUntilWithTime(duration: number, scheduler?: IScheduler): Observable; + windowWithTime(timeSpan: number, timeShift: number, scheduler?: IScheduler): Observable>; windowWithTime(timeSpan: number, scheduler?: IScheduler): Observable>; windowWithTimeOrCount(timeSpan: number, count: number, scheduler?: IScheduler): Observable>; @@ -20,6 +39,13 @@ declare module Rx { timer(dueTime: Date, period: number, scheduler?: IScheduler): Observable; timer(dueTime: Date, scheduler?: IScheduler): Observable; + generateWithRelativeTime( + initialState: TState, + condition: (state: TState) => boolean, + iterate: (state: TState) => TState, + resultSelector: (state: TState) => TResult, + timeSelector: (state: TState) => number, + scheduler?: IScheduler): Observable; generateWithAbsoluteTime( initialState: TState, condition: (state: TState) => boolean, From e2d0963430c542bfbda1a21fa7bdcab9a160b565 Mon Sep 17 00:00:00 2001 From: Bernd Paradies Date: Mon, 27 Oct 2014 11:50:09 -0700 Subject: [PATCH 008/292] Fix for issue 1 - SchedulerStatic --- rx.d.ts | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/rx.d.ts b/rx.d.ts index 1f26a94a9a..73c97bbc9f 100644 --- a/rx.d.ts +++ b/rx.d.ts @@ -11,19 +11,7 @@ declare module Rx { catchException(handler: (exception: any) => boolean): IScheduler; } - export class Scheduler implements IScheduler { - constructor( - now: () => number, - schedule: (state: any, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, - scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, - scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable); - - static normalize(timeSpan: number): number; - - static immediate: IScheduler; - static currentThread: ICurrentThreadScheduler; - static timeout: IScheduler; - + export interface Scheduler extends IScheduler { now(): number; catch(handler: (exception: any) => boolean): IScheduler; catchException(handler: (exception: any) => boolean): IScheduler; @@ -46,7 +34,22 @@ declare module Rx { schedulePeriodicWithState(state: TState, period: number, action: (state: TState) => TState): IDisposable; } - // Observer + interface SchedulerStatic { + new (now: () => number, + schedule: (state: any, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, + scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, + scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable): Scheduler; + + normalize(timeSpan: number): number; + + immediate: IScheduler; + currentThread: ICurrentThreadScheduler; + timeout: IScheduler; + } + + export var Scheduler: SchedulerStatic; + + // Observer export interface Observer { checked(): Observer; } From 83c228755fe21c6da6aa2fecde019b3fec42172e Mon Sep 17 00:00:00 2001 From: Justin Filip Date: Mon, 27 Oct 2014 15:34:46 -0400 Subject: [PATCH 009/292] Add type description for cookie.js --- CONTRIBUTORS.md | 1 + cookiejs/cookiejs-tests.ts | 30 ++++++++++++++++++++++++++++++ cookiejs/cookiejs.d.ts | 24 ++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 cookiejs/cookiejs-tests.ts create mode 100644 cookiejs/cookiejs.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 083204e8fa..9152d04b1c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -64,6 +64,7 @@ All definitions files include a header with the author and editors, so at some p * [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) * [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem) and [vvakame](https://github.com/vvakame)) * [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [cookie.js](https://github.com/js-coder/cookie.js) (by [Boltmade](https://github.com/Boltmade)) * [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/)) * [Cordovarduino](https://github.com/stereolux/cordovarduino) (by [Hendrik Maus](https://github.com/hendrikmaus)) * [Couchbase / Couchnode](https://github.com/couchbase/couchnode) (by [Basarat Ali Syed](https://github.com/basarat)) diff --git a/cookiejs/cookiejs-tests.ts b/cookiejs/cookiejs-tests.ts new file mode 100644 index 0000000000..b4dd6927b6 --- /dev/null +++ b/cookiejs/cookiejs-tests.ts @@ -0,0 +1,30 @@ +/// + +// Based on https://github.com/js-coder/cookie.js/blob/gh-pages/tests/spec.js + +cookie.set({a: '1', b: '2', c: '3'}); + +cookie; +cookie.enabled(); + +cookie.set('n', '5'); + +cookie.get('a'); +cookie.get('__undef__'); +cookie.get('__undef__', 'fallback'); +cookie.get(['a', 'b']); +cookie.get(['a', '__undef__'], 'fallback'); + +cookie('a'); +cookie('__undef__'); +cookie('__undef__', 'fallback'); +cookie(['a', 'b']); +cookie(['a', '__undef__'], 'fallback'); + +cookie.remove('a'); +cookie.remove('a', 'b'); +cookie.remove(['a', 'b']); + +cookie.empty(); + +cookie.all(); diff --git a/cookiejs/cookiejs.d.ts b/cookiejs/cookiejs.d.ts new file mode 100644 index 0000000000..bdd71f0219 --- /dev/null +++ b/cookiejs/cookiejs.d.ts @@ -0,0 +1,24 @@ +// Type definitions for cookie.js v1.0.0 +// Project: https://github.com/js-coder/cookie.js +// Definitions by: Boltmade +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare function cookie(key : string, fallback?: string) : string; +declare function cookie(keys : string[], fallback?: string) : string; + +declare module cookie { + export function set(key : string, value : string, options? : any) : void; + export function set(obj : any, options? : any) : void; + export function remove(key : string) : void; + export function remove(keys : string[]) : void; + export function remove(...args : string[]) : void; + export function empty() : void; + export function get(key : string, fallback?: string) : string; + export function get(keys : string[], fallback?: string) : string; + export function all() : any; + export function enabled() : boolean; +} + +declare module "cookiejs" { + export = cookie; +} From 0573a8bf5d76b261f71ef4f6576d036ca0e3de59 Mon Sep 17 00:00:00 2001 From: Yang Guan Date: Fri, 31 Oct 2014 00:25:51 -0700 Subject: [PATCH 010/292] Add type definitions for heatmap.js --- heatmap.js/heatmap-tests.ts | 42 +++++++++++ heatmap.js/heatmap.d.ts | 134 ++++++++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+) create mode 100644 heatmap.js/heatmap-tests.ts create mode 100644 heatmap.js/heatmap.d.ts diff --git a/heatmap.js/heatmap-tests.ts b/heatmap.js/heatmap-tests.ts new file mode 100644 index 0000000000..c61458faec --- /dev/null +++ b/heatmap.js/heatmap-tests.ts @@ -0,0 +1,42 @@ +/// + +var baseLayer = L.tileLayer( + 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { + attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © CloudMade', + maxZoom: 18 + }); + +var testData: HeatmapDataObject = { + max: 8, + data: [ + { + lat: 24.6408, + lng:46.7728, + count: 3 + }, { + lat: 50.75, + lng: -1.55, + count: 1 + } + ] +}; + +var config : HeatmapConfiguration = { + radius: 2, + maxOpacity: .8, + scaleRadius: true, + useLocalExtrema: true, + latField: 'lat', + lngField: 'lng', + valueField: 'count' +}; + +var heatmapLayer = new HeatmapOverlay(config); + +var map = new L.Map('map-canvas', { + center: new L.LatLng(25.6586, -80.3568), + zoom: 4, + layers: [baseLayer, heatmapLayer] +}); + +heatmapLayer.setData(testData); diff --git a/heatmap.js/heatmap.d.ts b/heatmap.js/heatmap.d.ts new file mode 100644 index 0000000000..bff76db98f --- /dev/null +++ b/heatmap.js/heatmap.d.ts @@ -0,0 +1,134 @@ +// Type definitions for heatmap.js v2.0 +// Project: https://github.com/pa7/heatmap.js/ +// Definitions by: Yang Guan +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/* + * Configuration object of a heatmap + */ +interface HeatmapConfiguration { + + /* + * A background color string in form of hexcode, color name, or rgb(a) + */ + backgroundColor?: string; + + /* + * An object that represents the gradient + */ + gradient?: any; + + /* + * The radius each datapoint will have (if not specified on the datapoint + * itself) + */ + radius?: number; + + /* + * The radius each datapoint will have (if not specified on the datapoint + * itself) + */ + useLocalExtrema?: boolean; + + /* + * A global opacity for the whole heatmap. This overrides maxOpacity and + * minOpacity if set + */ + opacity?: number; + + /* + * The maximal opacity the highest value in the heatmap will have. (will be + * overridden if opacity set) + * Default value: 0.6 + */ + maxOpacity?: number; + + /* + * The minimum opacity the lowest value in the heatmap will have (will be + * overridden if opacity set) + */ + minOpacity?: number; + + /* + * The blur factor that will be applied to all datapoints. The higher the + * blur factor is, the smoother the gradients will be + * Default value: 0.85 + */ + blur?: number; + + /* + * The property name of your latitude coordinate in a datapoint + * Default value: 'x' + */ + latField?: string; + + /* + * The property name of your longitude coordinate in a datapoint + * Default value: 'y' + */ + lngField?: string; + + /* + * The property name of your y coordinate in a datapoint + */ + valueField: string; +} + +/* + * A single data point on a heatmap. The keys are specified by + * HeatmapConfig.latField, HeatmapConfig.lngField and HeatmapConfig.valueField + */ +interface HeatmapDataPoint { + [index: string] : number; +} + +/* + * An object representing the set of data points on a heatmap. + */ +interface HeatmapDataObject { + + /* + * Max value of of the valueField + */ + max?: number; + + /* + * Min value of of the valueField + */ + min?: number; + + /* + * An array of HeatmapDataPoints + */ + data: HeatmapDataPoint[]; +} + +/* + * The overlay layer to be added onto leaflet map + */ +declare class HeatmapOverlay { + + /* + * Initialization function + */ + constructor(configuration: HeatmapConfiguration) + + /* + * Create DOM elements for othe overlay, adding them to map panes and + * puts listeners on relevant map events + */ + onAdd(map: L.Map): void; + + /* + * Remove the overlay's elements from the DOM and remove listeners + * previously added by onAdd() + */ + onRemove(map: L.Map): void; + + /* + * Initialize a heatmap instance with the given dataset + */ + setData(data: {}): void; +} From e0d184fc836d56ad435c926885dc67a4fb3729d8 Mon Sep 17 00:00:00 2001 From: Damiano Date: Fri, 31 Oct 2014 18:04:28 +0100 Subject: [PATCH 011/292] Update ckeditor Added toolbarGroups and removePlugins on configuration object. http://docs.ckeditor.com/#!/guide/dev_toolbar --- ckeditor/ckeditor.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index 491ae01572..315f9bdf10 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -550,11 +550,17 @@ declare module CKEDITOR { } + interface toolbarGroups { + name?: string; + groups?: string[]; + } interface config { startupMode?: string; removeButtons?: string; + removePlugins?: string; toolbar?: any; + toolbarGroups?: toolbarGroups[]; skin?: string; language?: string; plugins?: string; From 05896329891138898edee72177aefa1e3482453d Mon Sep 17 00:00:00 2001 From: Yang Guan Date: Fri, 31 Oct 2014 12:20:52 -0700 Subject: [PATCH 012/292] Update contributor list --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 234fdad560..197492f8b8 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -140,6 +140,7 @@ All definitions files include a header with the author and editors, so at some p * [HashMap](https://github.com/flesler/hashmap) (by [Rafał Wrzeszcz](https://wrzasq.pl)) * [HashSet](http://www.timdown.co.uk/jshashtable/jshashset.html) (by [Sergey Gerasimov](https://github.com/gerich-home)) * [Hashtable](http://www.timdown.co.uk/jshashtable/) (by [Sergey Gerasimov](https://github.com/gerich-home)) +* [heatmap.js](https://github.com/pa7/heatmap.js/) (by [Yang Guan](https://github.com/lookuptable)) * [HelloJS](http://adodson.com/hello.js) (by [Pavel Zika](https://github.com/PavelPZ)) * [Highcharts](http://www.highcharts.com/) (by [damianog](https://github.com/damianog)) * [Highland](http://highlandjs.org/) (by [Bart van der Schoor](https://github.com/Bartvds/)) From 9cbb16d81e20e670b6b15e157b46fb3ef8a78286 Mon Sep 17 00:00:00 2001 From: d-ph Date: Sat, 1 Nov 2014 10:57:08 +0000 Subject: [PATCH 013/292] Fix .fail<> generic precedence bug and missing generic on .reject() --- q/Q-tests.ts | 48 +++++++++++++++++++++++++++++++++++++++++++++++- q/Q.d.ts | 4 ++-- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/q/Q-tests.ts b/q/Q-tests.ts index 48a3224bc1..b5f03a3fd8 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -137,4 +137,50 @@ class Repo { } var kitty = new Repo(); -Q.nbind(kitty.find, kitty)({ cute: true }).done((kitties: any[]) => {}); \ No newline at end of file +Q.nbind(kitty.find, kitty)({ cute: true }).done((kitties: any[]) => {}); + + +/* + * Test: Can "rethrow" rejected promises + */ +module TestCanRethrowRejectedPromises { + + interface Foo { + a: number; + } + + function nestedBar(): Q.Promise { + var deferred = Q.defer(); + + return deferred.promise; + } + + function bar(): Q.Promise { + return nestedBar() + .then((foo:Foo) => { + console.log("Lorem ipsum"); + }) + .fail((error) => { + console.log("Intermediate error handling"); + + /* + * Cannot do this, because: + * error TS2322: Type 'Promise' is not assignable to type 'Promise' + */ + //throw error; + + return Q.reject(error); + }) + ; + } + + bar() + .finally(() => { + console.log("Cleanup") + }) + .done() + ; + +} + + diff --git a/q/Q.d.ts b/q/Q.d.ts index 3e7371ead2..b43f516f6e 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -74,8 +74,8 @@ declare module Q { */ spread(onFulfilled: Function, onRejected?: Function): Promise; - fail(onRejected: (reason: any) => U): Promise; fail(onRejected: (reason: any) => IPromise): Promise; + fail(onRejected: (reason: any) => U): Promise; /** * A sugar method, equivalent to promise.then(undefined, onRejected). */ @@ -329,7 +329,7 @@ declare module Q { /** * Returns a promise that is rejected with reason. */ - export function reject(reason?: any): Promise; + export function reject(reason?: any): Promise; export function Promise(resolver: (resolve: (val: IPromise) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise; export function Promise(resolver: (resolve: (val: T) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise; From 9e30e0687f1345fbfce0769b29e76d8962e8465e Mon Sep 17 00:00:00 2001 From: ryiwamoto Date: Fri, 31 Oct 2014 20:30:59 +0900 Subject: [PATCH 014/292] add wolfy87-eventemitter --- CONTRIBUTORS.md | 1 + .../wolfy87-eventemitter-test.ts | 111 ++++ .../wolfy87-eventemitter.d.ts | 512 ++++++++++++++++++ 3 files changed, 624 insertions(+) create mode 100644 wolfy87-eventemitter/wolfy87-eventemitter-test.ts create mode 100644 wolfy87-eventemitter/wolfy87-eventemitter.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 234fdad560..9d27a0d1d4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -427,6 +427,7 @@ All definitions files include a header with the author and editors, so at some p * [websocket](https://github.com/Worlize/WebSocket-Node) (by [Paul Loyd](https://github.com/loyd)) * [WinJS](http://msdn.microsoft.com/en-us/library/windows/apps/br229773.aspx) (from TypeScript samples) * [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) (from TypeScript samples) +* [wolfy87-eventemitter](https://github.com/Wolfy87/EventEmitter) (by [Ryo Iwamoto](https://github.com/ryiwamoto)) * [ws](http://einaros.github.io/ws/) (by [Paul Loyd](https://github.com/loyd)) * [x2js](https://code.google.com/p/x2js/) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) * [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) (by [Michel Salib](https://github.com/michelsalib)) diff --git a/wolfy87-eventemitter/wolfy87-eventemitter-test.ts b/wolfy87-eventemitter/wolfy87-eventemitter-test.ts new file mode 100644 index 0000000000..adef23a39f --- /dev/null +++ b/wolfy87-eventemitter/wolfy87-eventemitter-test.ts @@ -0,0 +1,111 @@ +/// + +//import EventEmitter = require("wolfy87-eventemitter"); + +var emitter = new EventEmitter(); + +var listener = function (value: any) { + console.log("The event was raised."); +}; + +function testGetListeners() { + var listeners: Function[] = emitter.getListeners("foo"); + var listenersSearchedByRegexp: {[key:string]: Function} = emitter.getListeners(/^foo/); +} + +function testFlattenListeners() { + var listeners: Function[] = emitter.flattenListeners([{listener: listener}]); +} + +function testGetListenersAsObject() { + emitter.getListenersAsObject("foo"); + emitter.getListenersAsObject(/^foo/); +} + +function testAddListener() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .addListener("foo", listener) + .addListener(/^foo/, listener); +} + +function testOn() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .on("foo", listener) + .on(/^foo/, listener); +} + +function testAddOnceListener() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .addOnceListener("foo", listener) + .addOnceListener(/^foo/, listener); +} + +function testOnce() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .once("foo", listener) + .once(/^foo/, listener); +} + +function testDefineEvent() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.defineEvent("foo"); +} + +function testDefineEvents() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.defineEvents(["foo", "bar"]); +} + +function testAddListeners() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .addListeners("foo", [listener]) + .addListeners({ + "foo": listener, + "bar": [listener] + }); +} + +function testRemoveListeners() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .removeListeners("foo", [listener]) + .removeListeners({ + "foo": listener, + "bar": [listener] + }); +} + +function testRemoveListener() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.removeListener("foo", listener); +} + +function testManipulateListeners() { + var e: Wolfy87EventEmitter.EventEmitter = emitter + .manipulateListeners(true, "foo", [listener]) + .manipulateListeners(true, { + "foo": listener + }); +} + +function testRemoveEvent() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.removeEvent("foo").removeEvent(); +} + +function testEmitEvent() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.emitEvent("foo", ["arg1", "arg2"]).emitEvent("foo"); +} + +function testTrigger() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.trigger("foo", ["arg1", "arg2"]).trigger("foo"); +} + +function testEmit() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.emit("foo", ["arg1", "arg2"]).emit("foo"); +} + +function testSetOnceReturnValue() { + var e: Wolfy87EventEmitter.EventEmitter = emitter.setOnceReturnValue(false); +} + +function testNoConflict() { + var NoConflictEventEmitter = EventEmitter.noConflict(); + var e: Wolfy87EventEmitter.EventEmitter = new NoConflictEventEmitter(); +} + diff --git a/wolfy87-eventemitter/wolfy87-eventemitter.d.ts b/wolfy87-eventemitter/wolfy87-eventemitter.d.ts new file mode 100644 index 0000000000..59c17284af --- /dev/null +++ b/wolfy87-eventemitter/wolfy87-eventemitter.d.ts @@ -0,0 +1,512 @@ +// Type definitions for wolfy87-eventemitter v4.2.9 +// Project: https://github.com/Wolfy87/EventEmitter +// Definitions by: ryiwamoto +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Wolfy87EventEmitter { + + /** + * Hash Object for manipulating multiple events. + */ + interface MultipleEvents { + [event:string]: any //Function | Function[] + } + + /** + * Class for managing events. + * Can be extended to provide event functionality in other classes. + * + * @class EventEmitter Manages event registering and emitting. + */ + export class EventEmitter { + /** + * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version. + * @return {Function} Non conflicting EventEmitter class. + */ + static noConflict(): typeof EventEmitter; + + /** + * Returns the listener array for the specified event. + * Will initialise the event object and listener arrays if required. + * Will return an object if you use a regex search. The object contains keys for each matched event. + * So /ba[rz]/ might return an object containing bar and baz. + * But only if you have either defined them with defineEvent or added some listeners to them. + * Each property in the object response is an array of listener functions. + * + * @param {string|RegExp} event Name of the event to return the listeners from. + * @return {Function[|Object]} All listener functions for the event. + */ + getListeners(event: string): Function[]; + + /** + * Returns the listener array for the specified event. + * Will initialise the event object and listener arrays if required. + * Will return an object if you use a regex search. The object contains keys for each matched event. + * So /ba[rz]/ might return an object containing bar and baz. + * But only if you have either defined them with defineEvent or added some listeners to them. + * Each property in the object response is an array of listener functions. + * + * @param {string|RegExp} event Name of the event to return the listeners from. + * @return {Function[]|Object} All listener functions for the event. + */ + getListeners(event: RegExp): {[event:string]: Function}; + + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {string|RegExp} event Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addListener(event: string, listener: Function): EventEmitter; + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {string|RegExp} event Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addListener(event: RegExp, listener: Function): EventEmitter; + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {string|RegExp} event Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + on(event: string, listener: Function): EventEmitter; + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {string|RegExp} event Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + on(event: RegExp, listener: Function): EventEmitter; + + /** + * Takes a list of listener objects and flattens it into a list of listener functions. + * + * @param {Object[]} listeners Raw listener objects. + * @return {Function[]} Just the listener functions. + */ + flattenListeners(listeners: {listener: Function}[]): Function[]; + + /** + * Fetches the requested listeners via getListeners but will always return the results inside an object. + * This is mainly for internal use but others may find it useful. + * + * @param event {string|RegExp} Name of the event to return the listeners from. + * @return {Object} All listener functions for an event in object + */ + getListenersAsObject(event: string): {[event:string]: Function}; + + /** + * Fetches the requested listeners via getListeners but will always return the results inside an object. + * This is mainly for internal use but others may find it useful. + * + * @param event {string|RegExp} Name of the event to return the listeners from. + * @return {Object} All listener functions for an event in object + */ + getListenersAsObject(event: RegExp): {[event:string]: Function}; + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after it's first execution. + * + * @param event {string|RegExp} Name of the event to attach the listener to. + * @param listener {Function} Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addOnceListener(event: string, listener: Function): EventEmitter; + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after it's first execution. + * + * @param event {string|RegExp} Name of the event to attach the listener to. + * @param listener {Function} Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addOnceListener(event: RegExp, listener: Function): EventEmitter; + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after it's first execution. + * + * @param event {string|RegExp} Name of the event to attach the listener to. + * @param listener {Function} Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + once(event: string, listener: Function): EventEmitter; + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after it's first execution. + * + * @param event {string|RegExp} Name of the event to attach the listener to. + * @param listener {Function} Method to be called when the event is emitted. + * If the function returns true then it will be removed after calling. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + once(event: RegExp, listener: Function): EventEmitter; + + /** + * Defines an event name. + * This is required if you want to use a regex to add a listener to multiple events at once. + * If you don't do this then how do you expect it to know what event to add to? + * Should it just add to every possible match for a regex? No. That is scary and bad. + * You need to tell it what event names should be matched by a regex. + * + * @param {string} event Name of the event to create. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + defineEvent(event: string): EventEmitter; + + /** + * Defines an event name. + * This is required if you want to use a regex to add a listener to multiple events at once. + * If you don't do this then how do you expect it to know what event to add to? + * Should it just add to every possible match for a regex? No. That is scary and bad. + * You need to tell it what event names should be matched by a regex. + * + * @param {string[]} events Name of the event to create. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + defineEvents(events: string[]): EventEmitter; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} event Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeListener(event: string, listener: Function): EventEmitter; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} event Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeListener(event: RegExp, listener: Function): EventEmitter; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} event Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + off(event: string, listener: Function): EventEmitter; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} event Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + off(event: RegExp, listener: Function): EventEmitter; + + /** + * Adds listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can add to multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added. + * You can also pass it a regular expression to add the array of listeners to all events that match it. + * Yeah, this function does quite a bit. That's probably a bad thing. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add to multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addListeners(event: string, listeners: Function[]): EventEmitter; + + /** + * Adds listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can add to multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added. + * You can also pass it a regular expression to add the array of listeners to all events that match it. + * Yeah, this function does quite a bit. That's probably a bad thing. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add to multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addListeners(event: RegExp, listeners: Function[]): EventEmitter; + + /** + * Adds listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can add to multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added. + * You can also pass it a regular expression to add the array of listeners to all events that match it. + * Yeah, this function does quite a bit. That's probably a bad thing. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add to multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + addListeners(event: MultipleEvents): EventEmitter; + + /** + * Removes listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be removed. + * You can also pass it a regular expression to remove the listeners from all events that match it. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeListeners(event: string, listeners: Function[]): EventEmitter; + + /** + * Removes listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be removed. + * You can also pass it a regular expression to remove the listeners from all events that match it. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeListeners(event: RegExp, listeners: Function[]): EventEmitter; + + /** + * Removes listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be removed. + * You can also pass it a regular expression to remove the listeners from all events that match it. + * + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeListeners(event: MultipleEvents): EventEmitter; + + /** + * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. + * You should really use those instead, this is a little lower level. + * The first argument will determine if the listeners are removed (true) or added (false). + * If you pass an object as the second argument you can add/remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added/removed. + * You can also pass it a regular expression to manipulate the listeners of all events that match it. + * + * @param {Boolean} remove True if you want to remove listeners, false if you want to add. + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add/remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add/remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + manipulateListeners(remove: boolean, event: string, listeners: Function[]): EventEmitter; + + /** + * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. + * You should really use those instead, this is a little lower level. + * The first argument will determine if the listeners are removed (true) or added (false). + * If you pass an object as the second argument you can add/remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added/removed. + * You can also pass it a regular expression to manipulate the listeners of all events that match it. + * + * @param {Boolean} remove True if you want to remove listeners, false if you want to add. + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add/remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add/remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + manipulateListeners(remove: boolean, event: RegExp, listeners: Function[]): EventEmitter; + + /** + * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. + * You should really use those instead, this is a little lower level. + * The first argument will determine if the listeners are removed (true) or added (false). + * If you pass an object as the second argument you can add/remove from multiple events at once. + * The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added/removed. + * You can also pass it a regular expression to manipulate the listeners of all events that match it. + * + * @param {Boolean} remove True if you want to remove listeners, false if you want to add. + * @param {String|Object|RegExp} event An event name if you will pass an array of listeners next. + * An object if you wish to add/remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add/remove. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + manipulateListeners(remove: boolean, event: MultipleEvents): EventEmitter; + + /** + * Removes all listeners from a specified event. + * If you do not specify an event then all listeners will be removed. + * That means every event will be emptied. + * You can also pass a regex to remove all events that match it. + * + * @param {String|RegExp} [event] Optional name of the event to remove all listeners for. + * Will remove from every event if not passed. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeEvent(event?: string): EventEmitter; + + /** + * Removes all listeners from a specified event. + * If you do not specify an event then all listeners will be removed. + * That means every event will be emptied. + * You can also pass a regex to remove all events that match it. + * + * @param {String|RegExp} [event] Optional name of the event to remove all listeners for. + * Will remove from every event if not passed. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + removeEvent(event?: RegExp): EventEmitter; + + /** + * Alias of removeEvent. + * + * Added to mirror the node API. + */ + removeAllListeners(event: string): EventEmitter; + + /** + * Alias of removeEvent. + * + * Added to mirror the node API. + */ + removeAllListeners(event: RegExp): EventEmitter; + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + emitEvent(event: string, ...args: any[]): EventEmitter; + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + emitEvent(event: RegExp, ...args: any[]): EventEmitter; + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + trigger(event: string, ...args: any[]): EventEmitter; + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + trigger(event: RegExp, ...args: any[]): EventEmitter; + + /** + * Subtly different from emitEvent in that it will pass its arguments on to the listeners, + * as opposed to taking a single array of arguments to pass on. + * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {... any[]} args Optional additional arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + emit(event: string, ...args: any[]): EventEmitter; + + /** + * Subtly different from emitEvent in that it will pass its arguments on to the listeners, + * as opposed to taking a single array of arguments to pass on. + * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. + * + * @param {String|RegExp} event Name of the event to emit and execute listeners for. + * @param {... any[]} args Optional additional arguments to be passed to each listener. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + emit(event: RegExp, ...args: any[]): EventEmitter; + + /** + * Sets the current value to check against when executing listeners. If a + * listeners return value matches the one set here then it will be removed + * after execution. This value defaults to true. + * + * @param {any} value The new value to check for when executing listeners. + * @return {EventEmitter} Current instance of EventEmitter for chaining. + */ + setOnceReturnValue(value: any): EventEmitter; + } +} + +declare module "wolfy87-eventemitter" { + export = EventEmitter; +} + +declare var EventEmitter: typeof Wolfy87EventEmitter.EventEmitter; + From d290ea22c1d83d337aaa5e04fc01b3240acfa41e Mon Sep 17 00:00:00 2001 From: RHAD1969 Date: Sat, 1 Nov 2014 19:47:18 +0100 Subject: [PATCH 015/292] Update breeze.d.ts Added: createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: StrategySymbol): Entity; to the breeze class. --- breeze/breeze.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/breeze/breeze.d.ts b/breeze/breeze.d.ts index fab5dd0772..7aad436ba9 100644 --- a/breeze/breeze.d.ts +++ b/breeze/breeze.d.ts @@ -376,6 +376,7 @@ declare module breeze { clear(): void; createEmptyCopy(): EntityManager; createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol) : Entity; + createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: StrategySymbol): Entity; createEntity(entityType: EntityType, config?: {}, entityState?: EntityStateSymbol): Entity; detachEntity(entity: Entity): boolean; executeQuery(query: string, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Q.Promise; From 9fbcb5108ecda264110ce15d2a9d5d7ad65968fe Mon Sep 17 00:00:00 2001 From: Philipp Simon Schmidt Date: Sun, 2 Nov 2014 01:04:13 +0000 Subject: [PATCH 016/292] Allow param and fparam be executed without a parameterName --- purl/purl.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/purl/purl.d.ts b/purl/purl.d.ts index 00312595e3..0686b6269d 100644 --- a/purl/purl.d.ts +++ b/purl/purl.d.ts @@ -1,10 +1,14 @@ -// Type definitions for Purl 2.3.1 +// Type definitions for Purl 2.3.1 // Project: https://github.com/allmarkedup/purl // Definitions by: Daniel Ferreira Monteiro Alves // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module purl { + interface ParameterMap { + [parameterName: string]: string; + } + export interface Url { /** @@ -15,6 +19,7 @@ declare module purl { /** * The .param() method is used to return the values of querystring parameters. */ + param(): ParameterMap; param(parameterName: string): string; /** @@ -27,6 +32,7 @@ declare module purl { /** * Gets a parameter from the fragment segment */ + fparam(): ParameterMap; fparam(parameterName: string): string; /** From 0cca9182b9048d37ddb64b4445d70f6603bb881a Mon Sep 17 00:00:00 2001 From: satoru kimura Date: Sun, 2 Nov 2014 20:54:51 +0900 Subject: [PATCH 017/292] update to three.js r69. --- physijs/tests/body.ts | 2 +- physijs/tests/constraints_car.ts | 2 +- physijs/tests/jenga.ts | 2 +- physijs/tests/vehicle.ts | 1 + .../canvas/canvas_camera_orthographic.ts | 2 +- threejs/tests/canvas/canvas_materials.ts | 2 +- threejs/tests/three-tests-setup.ts | 2 + threejs/three-canvasrenderer.d.ts | 57 ++ threejs/three-projector.d.ts | 97 +++ threejs/three.d.ts | 624 ++++++++---------- 10 files changed, 421 insertions(+), 370 deletions(-) create mode 100644 threejs/three-canvasrenderer.d.ts create mode 100644 threejs/three-projector.d.ts diff --git a/physijs/tests/body.ts b/physijs/tests/body.ts index acf9df5004..649805c035 100644 --- a/physijs/tests/body.ts +++ b/physijs/tests/body.ts @@ -1,6 +1,6 @@ /// /// - +/// Physijs.scripts.worker = '../physijs_worker.js'; Physijs.scripts.ammo = 'examples/js/ammo.js'; diff --git a/physijs/tests/constraints_car.ts b/physijs/tests/constraints_car.ts index b74c444490..4202b0c041 100644 --- a/physijs/tests/constraints_car.ts +++ b/physijs/tests/constraints_car.ts @@ -1,6 +1,6 @@ /// /// - +/// Physijs.scripts.worker = '../physijs_worker.js'; Physijs.scripts.ammo = 'examples/js/ammo.js'; diff --git a/physijs/tests/jenga.ts b/physijs/tests/jenga.ts index 05bbd78613..e2eeecc94e 100644 --- a/physijs/tests/jenga.ts +++ b/physijs/tests/jenga.ts @@ -1,6 +1,6 @@ /// /// - +/// Physijs.scripts.worker = '../physijs_worker.js'; Physijs.scripts.ammo = 'examples/js/ammo.js'; diff --git a/physijs/tests/vehicle.ts b/physijs/tests/vehicle.ts index 1b11066fe0..ef064f0387 100644 --- a/physijs/tests/vehicle.ts +++ b/physijs/tests/vehicle.ts @@ -1,5 +1,6 @@ /// /// +/// var TWEEN: any; var SimplexNoise: any; diff --git a/threejs/tests/canvas/canvas_camera_orthographic.ts b/threejs/tests/canvas/canvas_camera_orthographic.ts index 7391d978b0..54ac792d2b 100644 --- a/threejs/tests/canvas/canvas_camera_orthographic.ts +++ b/threejs/tests/canvas/canvas_camera_orthographic.ts @@ -50,7 +50,7 @@ var material1 = new THREE.LineBasicMaterial({ color: 0x000000, opacity: 0.2 }); var line = new THREE.Line(geometry, material1); - line.type = THREE.LinePieces; + line.mode = THREE.LinePieces; scene.add(line); // Cubes diff --git a/threejs/tests/canvas/canvas_materials.ts b/threejs/tests/canvas/canvas_materials.ts index 0d8f8a631e..e65dfe3beb 100644 --- a/threejs/tests/canvas/canvas_materials.ts +++ b/threejs/tests/canvas/canvas_materials.ts @@ -45,7 +45,7 @@ var material = new THREE.LineBasicMaterial({ color: 0xffffff, opacity: 0.2 }); var line = new THREE.Line(geometry, material); - line.type = THREE.LinePieces; + line.mode = THREE.LinePieces; scene.add(line); // Spheres diff --git a/threejs/tests/three-tests-setup.ts b/threejs/tests/three-tests-setup.ts index 235dd631db..edb913a3d3 100644 --- a/threejs/tests/three-tests-setup.ts +++ b/threejs/tests/three-tests-setup.ts @@ -4,7 +4,9 @@ /// /// +/// /// +/// /// /// /// diff --git a/threejs/three-canvasrenderer.d.ts b/threejs/three-canvasrenderer.d.ts new file mode 100644 index 0000000000..c751d87228 --- /dev/null +++ b/threejs/three-canvasrenderer.d.ts @@ -0,0 +1,57 @@ +// Type definitions for CanvasRenderer.js +// Project: https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module THREE { + export interface SpriteCanvasMaterialParameters extends MaterialParameters{ + color?: number; + + } + + export class SpriteCanvasMaterial extends Material { + constructor(parameters?: SpriteCanvasMaterialParameters); + + color: Color; + + program(context: any, color: Color): void; + clone(): SpriteCanvasMaterial; + } + + export interface CanvasRendererParameters { + canvas?: HTMLCanvasElement; + devicePixelRatio?: number; + } + + export class CanvasRenderer implements Renderer { + constructor(parameters?: CanvasRendererParameters); + + domElement: HTMLCanvasElement; + devicePixelRatio: number; + autoClear: boolean; + sortObjects: boolean; + sortElements: boolean; + info: { render: { vertices: number; faces: number; }; }; + + supportsVertexTextures(): void; + setFaceCulling(): void; + setSize(width: number, height: number, updateStyle?: boolean): void; + setViewport(x: number, y: number, width: number, height: number): void; + setScissor(): void; + enableScissorTest(): void; + setClearColor(color: Color, opacity?: number): void; + setClearColor(color: string, opacity?: number): void; + setClearColor(color: number, opacity?: number): void; + setClearColorHex(hex: number, alpha?: number): void; + getClearColor(): Color; + getClearAlpha(): number; + getMaxAnisotropy(): number; + clear(): void; + clearColor(): void; + clearDepth(): void; + clearStencil(): void; + render(scene: Scene, camera: Camera): void; + } +} \ No newline at end of file diff --git a/threejs/three-projector.d.ts b/threejs/three-projector.d.ts new file mode 100644 index 0000000000..11d674188f --- /dev/null +++ b/threejs/three-projector.d.ts @@ -0,0 +1,97 @@ +// Type definitions for Projector.js +// Project: https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/Projector.js +// Definitions by: Satoru Kimura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module THREE { + // Renderers / Renderables ///////////////////////////////////////////////////////////////////// + export class RenderableObject { + constructor(); + + id: number; + object: Object; + z: number; + } + + export class RenderableFace { + constructor(); + + id: number; + v1: RenderableVertex; + v2: RenderableVertex; + v3: RenderableVertex; + normalModel: Vector3; + vertexNormalsModel: Vector3[]; + vertexNormalsLength: number; + color: Color; + material: Material; + uvs: Vector2[][]; + z: number; + + } + + export class RenderableVertex { + constructor(); + + position: Vector3; + positionWorld: Vector3; + positionScreen: Vector4; + visible: boolean; + + copy(vertex: RenderableVertex): void; + } + + export class RenderableLine { + constructor(); + + id: number; + v1: RenderableVertex; + v2: RenderableVertex; + vertexColors: Color[]; + material: Material; + z: number; + } + + export class RenderableSprite { + constructor(); + + id: number; + object: Object; + x: number; + y: number; + z: number; + rotation: number; + scale: Vector2; + material: Material; + } + + /** + * Projects points between spaces. + */ + export class Projector { + constructor(); + + // deprecated. + projectVector(vector: Vector3, camera: Camera): Vector3; + + // deprecated. + unprojectVector(vector: Vector3, camera: Camera): Vector3; + + /** + * Transforms a 3D scene object into 2D render data that can be rendered in a screen with your renderer of choice, projecting and clipping things out according to the used camera. + * If the scene were a real scene, this method would be the equivalent of taking a picture with the camera (and developing the film would be the next step, using a Renderer). + * + * @param scene scene to project. + * @param camera camera to use in the projection. + * @param sort select whether to sort elements using the Painter's algorithm. + */ + projectScene(scene: Scene, camera: Camera, sortObjects: boolean, sortElements?: boolean): { + objects: Object3D[]; // Mesh, Line or other object + sprites: Object3D[]; // Sprite or Particle + lights: Light[]; + elements: Face3[]; // Line, Particle, Face3 or Face4 + }; + } +} \ No newline at end of file diff --git a/threejs/three.d.ts b/threejs/three.d.ts index f114cd9583..2a5535cbb5 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -3,6 +3,8 @@ // Definitions by: Kon , Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + interface WebGLRenderingContext {} declare module THREE { @@ -67,6 +69,8 @@ declare module THREE { export var AddEquation: BlendingEquation; export var SubtractEquation: BlendingEquation; export var ReverseSubtractEquation: BlendingEquation; + export var MinEquation: BlendingEquation; + export var MaxEquation: BlendingEquation; // custom blending destination factors export enum BlendingDstFactor { } @@ -143,12 +147,18 @@ declare module THREE { export var LuminanceAlphaFormat: PixelFormat; // Compressed texture formats + // DDS / ST3C Compressed texture formats export enum CompressedPixelFormat { } export var RGB_S3TC_DXT1_Format: CompressedPixelFormat; export var RGBA_S3TC_DXT1_Format: CompressedPixelFormat; export var RGBA_S3TC_DXT3_Format: CompressedPixelFormat; export var RGBA_S3TC_DXT5_Format: CompressedPixelFormat; + // PVRTC compressed texture formats + export var RGB_PVRTC_4BPPV1_Format: CompressedPixelFormat; + export var RGB_PVRTC_2BPPV1_Format: CompressedPixelFormat; + export var RGBA_PVRTC_4BPPV1_Format: CompressedPixelFormat; + export var RGBA_PVRTC_2BPPV1_Format: CompressedPixelFormat; // Cameras //////////////////////////////////////////////////////////////////////////////////////// @@ -171,6 +181,8 @@ declare module THREE { */ projectionMatrix: Matrix4; + getWorldDirection(optionalTarget?: Vector3): Vector3; + /** * This make the camera look at the vector position in local space. * @param vector point to look at @@ -209,6 +221,8 @@ declare module THREE { */ constructor(left: number, right: number, top: number, bottom: number, near?: number, far?: number); + zoom: number; + /** * Camera frustum left plane. */ @@ -265,6 +279,8 @@ declare module THREE { */ constructor(fov?: number, aspect?: number, near?: number, far?: number); + zoom: number; + /** * Camera frustum vertical field of view, from bottom to top of view, in degrees. */ @@ -345,8 +361,10 @@ declare module THREE { array: number[]; itemSize: number; + needsUpdate: boolean; length: number; + copyAt(index1: number, attribute: BufferAttribute, index2: number): void; set(value: number): BufferAttribute; setX(index: number, x: number): BufferAttribute; setY(index: number, y: number): BufferAttribute; @@ -354,6 +372,7 @@ declare module THREE { setXY(index: number, x: number, y: number): BufferAttribute; setXYZ(index: number, x: number, y: number, z: number): BufferAttribute; setXYZW(index: number, x: number, y: number, z: number, w: number): BufferAttribute; + clone(): BufferAttribute; } // deprecated @@ -420,7 +439,9 @@ declare module THREE { id: number; uuid: string; name: string; + type: string; attributes: BufferAttribute[]; + attributesKeys: string[]; drawcalls: { start: number; count: number; index: number; }[]; offsets: { start: number; count: number; index: number; }[]; boundingBox: BoundingBox3D; @@ -436,6 +457,9 @@ declare module THREE { */ applyMatrix(matrix: Matrix4): void; + // this method is currently empty. + center(): void; + fromGeometry( geometry: Geometry, settings?: any ): BufferGeometry; /** @@ -469,6 +493,7 @@ declare module THREE { merge(): void; normalizeNormals(): void; reorderBuffers(indexBuffer: number, indexMap: number[], vertexCount: number): void; + toJSON(): any; clone(): BufferGeometry; /** @@ -729,6 +754,8 @@ declare module THREE { */ name: string; + type: string; + /** * The array of vertices hold every position of points of the model. * To signal an update in this array, Geometry.verticesNeedUpdate needs to be set to true. @@ -852,11 +879,6 @@ declare module THREE { */ lineDistancesNeedUpdate: boolean; - /** - * Set to true if an array has changed in length. - */ - buffersNeedUpdate: boolean; - /** * */ @@ -867,6 +889,8 @@ declare module THREE { */ applyMatrix(matrix: Matrix4): void; + fromBufferGeometry(geometry: BufferGeometry): Geometry; + /** * */ @@ -916,7 +940,7 @@ declare module THREE { */ mergeVertices(): number; - makeGroups(usesFaceMaterial: boolean, maxVerticesInGroup: number): void; + toJSON(): any; /** * Creates a new clone of the Geometry. @@ -929,6 +953,7 @@ declare module 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. bones: Bone[]; animation: AnimationData; @@ -962,6 +987,8 @@ declare module THREE { */ name: string; + type: string; + /** * Object's parent in the scene graph. */ @@ -1174,17 +1201,7 @@ declare module THREE { */ remove(object: Object3D): void; - /** - * - */ - raycast(raycaster: Raycaster, intersects: any): void; - - /** - * Translates object along arbitrary axis by distance. - * @param distance Distance. - * @param axis Translation direction. - */ - traverse(callback: (object: Object3D) => any): void; + getChildByName( name: string, recursive?: boolean ): Object3D; /** * Searches through the object's children and returns the first with a matching id, optionally recursive. @@ -1193,7 +1210,6 @@ declare module THREE { */ getObjectById(id: string, recursive: boolean): Object3D; - /** * Searches through the object's children and returns the first with a matching name, optionally recursive. * @param name String to match to the children's Object3d.name property. @@ -1201,8 +1217,20 @@ declare module THREE { */ getObjectByName(name: string, recursive?: boolean): Object3D; + getWorldPosition(optionalTarget: Vector3): Vector3; + getWorldQuaternion(optionalTarget: Quaternion): Quaternion; + getWorldRotation(optionalTarget: Euler): Euler; + getWorldScale(optionalTarget: Vector3): Vector3; + getWorldDirection(optionalTarget: Vector3): Vector3; - getChildByName( name: string, recursive?: boolean ): Object3D; + /** + * Translates object along arbitrary axis by distance. + * @param distance Distance. + * @param axis Translation direction. + */ + traverse(callback: (object: Object3D) => any): void; + + traverseVisible(callback: (object: Object3D) => any): void; /** * Updates local transform. @@ -1214,6 +1242,8 @@ declare module THREE { */ updateMatrixWorld(force: boolean): void; + toJSON(): any; + /** * * @param object @@ -1229,37 +1259,6 @@ declare module THREE { } - /** - * Projects points between spaces. - */ - export class Projector { - constructor(); - - projectVector(vector: Vector3, camera: Camera): Vector3; - - unprojectVector(vector: Vector3, camera: Camera): Vector3; - - /** - * Translates a 2D point from NDC (Normalized Device Coordinates) to a Raycaster that can be used for picking. NDC range from [-1..1] in x (left to right) and [1.0 .. -1.0] in y (top to bottom). - */ - pickingRay(vector: Vector3, camera: Camera): Raycaster; - - /** - * Transforms a 3D scene object into 2D render data that can be rendered in a screen with your renderer of choice, projecting and clipping things out according to the used camera. - * If the scene were a real scene, this method would be the equivalent of taking a picture with the camera (and developing the film would be the next step, using a Renderer). - * - * @param scene scene to project. - * @param camera camera to use in the projection. - * @param sort select whether to sort elements using the Painter's algorithm. - */ - projectScene(scene: Scene, camera: Camera, sortObjects: boolean, sortElements?: boolean): { - objects: Object3D[]; // Mesh, Line or other object - sprites: Object3D[]; // Sprite or Particle - lights: Light[]; - elements: Face3[]; // Line, Particle, Face3 or Face4 - }; - } - export interface Intersection { distance: number; point: Vector3; @@ -1296,6 +1295,7 @@ declare module THREE { */ export class Light extends Object3D { constructor(hex?: number); + color: Color; clone(light?: Light): Light; @@ -1749,6 +1749,12 @@ declare module THREE { clear(): void; } + export class CompressedTextureLoader{ + constructor(); + + load(url: string, onLoad: (bufferGeometry: BufferGeometry) => void, onError?: (event: any) => void): void; + } + /* * GeometryLoader class is experimental, and it is not yet included in the compiled source code. * @@ -1909,6 +1915,8 @@ declare module THREE { */ name: string; + type: string; + /** * Defines which of the face sides will be rendered - front, back or both. * Default is THREE.FrontSide. Other options are THREE.BackSide and THREE.DoubleSide. @@ -1994,6 +2002,7 @@ declare module THREE { needsUpdate: boolean; setValues(values: Object): void; + toJSON(): any; clone(material?:Material): Material; dispose(): void; @@ -2119,6 +2128,7 @@ declare module THREE { constructor(materials?: Material[]); materials: Material[]; + toJSON(): any; clone(): MeshFaceMaterial; } @@ -2342,20 +2352,6 @@ declare module THREE { clone(): ShaderMaterial; } - export interface SpriteCanvasMaterialParameters extends MaterialParameters{ - color?: number; - - } - - export class SpriteCanvasMaterial extends Material { - constructor(parameters?: SpriteCanvasMaterialParameters); - - color: Color; - - program(context: any, color: Color): void; - clone(): SpriteCanvasMaterial; - } - export interface SpriteMaterialParameters extends MaterialParameters{ color?: number; map?: Texture; @@ -2835,11 +2831,6 @@ declare module THREE { */ randFloatSpread(range: number): number; - /** - * Returns -1 if x is less than 0, 1 if x is greater than 0, and 0 if x is zero. - */ - sign(x: number): number; - degToRad(degrees: number): number; radToDeg(radians: number): number; @@ -3237,6 +3228,10 @@ declare module THREE { equals(v: Quaternion): boolean; fromArray(n: number[]): Quaternion; toArray(): number[]; + + fromArray(xyzw: number[], offset?: number): Quaternion; + toArray(xyzw?: number[], offset?: number): number[]; + onChange: () => void; /** @@ -3617,9 +3612,10 @@ declare module THREE { * Checks for strict equality of this vector and v. */ equals(v: Vector2): boolean; - fromArray(xy: number[]): Vector2; - toArray(): number[]; + fromArray(xy: number[], offset?: number): Vector2; + + toArray(xy?: number[], offset?: number): number[]; /** * Clones this vector. */ @@ -3708,6 +3704,8 @@ declare module THREE { applyMatrix4(m: Matrix4): Vector3; applyProjection(m: Matrix4): Vector3; applyQuaternion(q: Quaternion): Vector3; + project(camrea: Camera): Vector3; + unproject(camera: Camera): Vector3; transformDirection(m: Matrix4): Vector3; divide(v: Vector3): Vector3; @@ -3794,8 +3792,10 @@ declare module THREE { * Checks for strict equality of this vector and v. */ equals(v: Vector3): boolean; - fromArray(xyz: number[]): Vector3; - toArray(): number[]; + + fromArray(xyz: number[], offset?: number): Vector3; + + toArray(xyz?: number[], offset?: number): number[]; /** * Clones this vector. @@ -3942,8 +3942,9 @@ declare module THREE { */ equals(v: Vector4): boolean; - fromArray(xyzw: number[]): number[]; - toArray(): number[]; + fromArray(xyzw: number[], offset?: number): Vector4; + + toArray(xyzw?: number[], offset?: number): number[]; /** * Clones this vector. @@ -3957,33 +3958,59 @@ declare module THREE { constructor(belongsToSkin: SkinnedMesh); skin: SkinnedMesh; + } - accumulatedRotWeight: number; - accumulatedPosWeight: number; - accumulatedSclWeight: number; + export class Group extends Object3D { + constructor(); + } - updateMatrixWorld(forceUpdate?: boolean): void; + export interface LensFlareProperty { + texture: Texture; // Texture + size: number; // size in pixels (-1 = use texture.width) + distance: number; // distance (0-1) from light source (0=at light source) + x: number; + y: number; + z: number; // screen position (-1 => 1) z = 0 is ontop z = 1 is back + scale: number; // scale + rotation: number; // rotation + opacity: number; // opacity + color: Color; // color + blending: Blending; + } + + export class LensFlare extends Object3D { + constructor(texture?: Texture, size?: number, distance?: number, blending?: Blending, color?: Color); + + lensFlares: LensFlareProperty[]; + positionScreen: Vector3; + customUpdateCallback: (object: LensFlare) => void; + + add(texture: Texture, size?: number, distance?: number, blending?: Blending, color?: Color): void; + add(obj: Object3D): void; + + + updateLensFlares(): void; } export class Line extends Object3D { - constructor(geometry?: Geometry, material?: LineDashedMaterial, type?: number); - constructor(geometry?: Geometry, material?: LineBasicMaterial, type?: number); - constructor(geometry?: Geometry, material?: ShaderMaterial, type?: number); - constructor(geometry?: BufferGeometry, material?: LineDashedMaterial, type?: number); - constructor(geometry?: BufferGeometry, material?: LineBasicMaterial, type?: number); - constructor(geometry?: BufferGeometry, material?: ShaderMaterial, type?: number); + constructor(geometry?: Geometry, material?: LineDashedMaterial, mode?: number); + constructor(geometry?: Geometry, material?: LineBasicMaterial, mode?: number); + constructor(geometry?: Geometry, material?: ShaderMaterial, mode?: number); + constructor(geometry?: BufferGeometry, material?: LineDashedMaterial, mode?: number); + constructor(geometry?: BufferGeometry, material?: LineBasicMaterial, mode?: number); + constructor(geometry?: BufferGeometry, material?: ShaderMaterial, mode?: number); geometry: Geometry; material: LineBasicMaterial; - type: LineType; + mode: LineMode; raycast(raycaster: Raycaster, intersects: any): void; clone(object?: Line): Line; } - enum LineType{} - var LineStrip: LineType; - var LinePieces: LineType; + enum LineMode{} + var LineStrip: LineMode; + var LinePieces: LineMode; export class LOD extends Object3D { constructor(); @@ -4119,7 +4146,6 @@ declare module THREE { material: SpriteMaterial; raycast(raycaster: Raycaster, intersects: any): void; - updateMatrix(): void; clone(object?: Sprite): Sprite; } @@ -4132,46 +4158,6 @@ declare module THREE { domElement: HTMLCanvasElement; } - export interface CanvasRendererParameters { - canvas?: HTMLCanvasElement; - devicePixelRatio?: number; - } - - export class CanvasRenderer implements Renderer { - constructor(parameters?: CanvasRendererParameters); - - domElement: HTMLCanvasElement; - devicePixelRatio: number; - autoClear: boolean; - sortObjects: boolean; - sortElements: boolean; - info: { render: { vertices: number; faces: number; }; }; - - supportsVertexTextures(): void; - setFaceCulling(): void; - setSize(width: number, height: number, updateStyle?: boolean): void; - setViewport(x: number, y: number, width: number, height: number): void; - setScissor(): void; - enableScissorTest(): void; - setClearColor(color: Color, opacity?: number): void; - setClearColor(color: string, opacity?: number): void; - setClearColor(color: number, opacity?: number): void; - setClearColorHex(hex: number, alpha?: number): void; - getClearColor(): Color; - getClearAlpha(): number; - getMaxAnisotropy(): number; - clear(): void; - clearColor(): void; - clearDepth(): void; - clearStencil(): void; - render(scene: Scene, camera: Camera): void; - } - - export interface RendererPlugin { - init(renderer: WebGLRenderer): void; - render(scene: Scene, camera: Camera, currentWidth: number, currentHeight: number): void; - } - export interface WebGLRendererParameters { /** * A Canvas where the renderer draws its output. @@ -4289,11 +4275,6 @@ declare module THREE { */ shadowMapEnabled: boolean; - /** - * Default is true. - */ - shadowMapAutoUpdate: boolean; - /** * Defines shadow map type (unfiltered, percentage close filtering, percentage close filtering with bilinear filtering in shader) * Options are THREE.BasicShadowMap, THREE.PCFShadowMap, THREE.PCFSoftShadowMap. Default is THREE.PCFShadowMap. @@ -4330,18 +4311,6 @@ declare module THREE { */ autoScaleCubemaps: boolean; - /** - * An array with render plugins to be applied before rendering. - * Default is an empty array, or []. - */ - renderPluginsPre: RendererPlugin[]; - - /** - * An array with render plugins to be applied after rendering. - * Default is an empty array, or []. - */ - renderPluginsPost: RendererPlugin[]; - /** * An object with a series of statistical information about the graphics board memory and the rendering process. Useful for debugging or just for the sake of curiosity. The object contains the following fields: */ @@ -4373,6 +4342,8 @@ declare module THREE { supportsFloatTextures(): boolean; supportsStandardDerivatives(): boolean; supportsCompressedTextureS3TC(): boolean; + supportsCompressedTexturePVRTC(): boolean; + supportsBlendMinMax(): boolean; getMaxAnisotropy(): number; getPrecision(): string; @@ -4434,16 +4405,7 @@ declare module THREE { clearDepth(): void; clearStencil(): void; clearTarget(renderTarget:WebGLRenderTarget, color: boolean, depth: boolean, stencil: boolean): void; - - /** - * Initialises the postprocessing plugin, and adds it to the renderPluginsPost array. - */ - addPostPlugin(plugin: RendererPlugin): void; - - /** - * Initialises the preprocessing plugin, and adds it to the renderPluginsPre array. - */ - addPrePlugin(plugin: RendererPlugin): void; + resetGLState(): void; /** * Tells the shadow map plugin to update using the passed scene and camera parameters. @@ -4466,7 +4428,6 @@ declare module THREE { */ render(scene: Scene, camera: Camera, renderTarget?: RenderTarget, forceClear?: boolean): void; renderImmediateObject(camera: Camera, lights: Light[], fog: Fog, material: Material, object: Object3D): void; - initMaterial(material: Material, lights: Light[], fog: Fog, object: Object3D): void; /** * Used for setting the gl frontFace, cullFace states in the GPU, thus enabling/disabling face culling when rendering. @@ -4479,8 +4440,10 @@ declare module THREE { setDepthTest(depthTest: boolean): void; setDepthWrite(depthWrite: boolean): void; setBlending(blending: Blending, blendEquation: BlendingEquation, blendSrc: BlendingSrcFactor, blendDst: BlendingDstFactor): void; + uploadTexture(texture: Texture): void; setTexture(texture: Texture, slot: number): void; setRenderTarget(renderTarget: RenderTarget): void; + } export interface RenderTarget { @@ -4534,67 +4497,6 @@ declare module THREE { activeCubeFace: number; // PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5 } - // Renderers / Renderables ///////////////////////////////////////////////////////////////////// - export class RenderableFace { - constructor(); - - id: number; - v1: RenderableVertex; - v2: RenderableVertex; - v3: RenderableVertex; - normalModel: Vector3; - vertexNormalsModel: Vector3[]; - vertexNormalsLength: number; - color: Color; - material: Material; - uvs: Vector2[][]; - z: number; - - } - - export class RenderableLine { - constructor(); - - id: number; - v1: RenderableVertex; - v2: RenderableVertex; - vertexColors: Color[]; - material: Material; - z: number; - } - - export class RenderableObject { - constructor(); - - id: number; - object: Object; - z: number; - } - - export class RenderableSprite { - constructor(); - - id: number; - object: Object; - x: number; - y: number; - z: number; - rotation: number; - scale: Vector2; - material: Material; - } - - export class RenderableVertex { - constructor(); - - position: Vector3; - positionWorld: Vector3; - positionScreen: Vector4; - visible: boolean; - - copy(vertex: RenderableVertex): void; - } - // Renderers / Shaders ///////////////////////////////////////////////////////////////////// export interface ShaderChunk { [name: string]: string; @@ -4692,14 +4594,57 @@ declare module THREE { }; // Renderers / WebGL ///////////////////////////////////////////////////////////////////// + export class WebGLExtensions{ + constructor(gl: any); // WebGLRenderingContext + + get(name: string): any; + } + export class WebGLProgram{ constructor(renderer: WebGLRenderer, code: string, material: ShaderMaterial, parameters: WebGLRendererParameters); + + attributes: any; + attributesKeys: string[]; + id: number; + code: string; + usedTimes: number; + program: any; + vertexShader: WebGLShader; + fragmentShader: WebGLShader; } export class WebGLShader{ constructor(gl: any, type: string, string: string); } + // Renderers / WebGL / Plugins ///////////////////////////////////////////////////////////////////// + export interface RendererPlugin { + init(renderer: WebGLRenderer): void; + render(scene: Scene, camera: Camera, currentWidth: number, currentHeight: number): void; + } + + export class LensFlarePlugin implements RendererPlugin { + constructor(); + + init(renderer: Renderer): void; + render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; + } + + export class ShadowMapPlugin implements RendererPlugin { + constructor(); + + init(renderer: Renderer): void; + render(scene: Scene, camera: Camera): void; + update(scene: Scene, camera: Camera): void; + } + + export class SpritePlugin implements RendererPlugin { + constructor(); + + init(renderer: Renderer): void; + render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; + } + // Scenes ///////////////////////////////////////////////////////////////////// export interface IFog { @@ -4771,10 +4716,7 @@ declare module THREE { overrideMaterial: Material; autoUpdate: boolean; - /** - * Default is false. - */ - matrixAutoUpdate: boolean; + clone(): Scene; } // Textures ///////////////////////////////////////////////////////////////////// @@ -4795,6 +4737,7 @@ declare module THREE { image: { width: number; height: number; }; mipmaps: ImageData[]; + flipY: boolean; generateMipmaps: boolean; clone(): CompressedTexture; @@ -4840,7 +4783,7 @@ declare module THREE { export class Texture { constructor( - image: any, // HTMLImageElement or HTMLCanvasElement + image: any, // HTMLImageElement or HTMLCanvasElement ( or HTMLVideoElement) mapping?: Mapping, wrapS?: Wrapping, wrapT?: Wrapping, @@ -4919,6 +4862,22 @@ declare module THREE { dispatchEvent(event: { type: string; target: any; }): void; } + class VideoTexture extends Texture { + constructor( + video: HTMLVideoElement, + mapping?: MappingConstructor, + wrapS?: Wrapping, + wrapT?: Wrapping, + magFilter?: TextureFilter, + minFilter?: TextureFilter, + format?: PixelFormat, + type?: TextureDataType, + anisotropy?: number + ); + + generateMipmaps: boolean; + } + // Extras ///////////////////////////////////////////////////////////////////// export interface TypefaceData { @@ -5012,6 +4971,7 @@ declare module THREE { play(startTime?: number, weight?: number): void; stop(): void; reset(): void; + resetBlendWeights(): void; update(deltaTimeMS: number): void; getNextKeyWith(type: string, h: number, key: number): KeyFrame; getPrevKeyWith(type: string, h: number, key: number): KeyFrame; @@ -5065,6 +5025,32 @@ declare module THREE { update(deltaTimeMS: number): void; } + // Extras / Audio ///////////////////////////////////////////////////////////////////// + + export class Audio extends Object3D { + constructor(listener: AudioListener); + type: string; + context: AudioContext; + source: AudioBufferSourceNode; + gain: GainNode; + panner: PannerNode; + + load(file: string): Audio; + setLoop(value: boolean): void; + setRefDistance(value: number): void; + setRolloffFactor(value: number): void; + updateMatrixWorld(force?: boolean): void; + } + + export class AudioListener extends Object3D { + constructor(); + + type: string; + context: AudioContext; + + updateMatrixWorld(force?: boolean): void; + } + // Extras / Core ///////////////////////////////////////////////////////////////////// /** @@ -5172,13 +5158,6 @@ declare module THREE { export class Gyroscope extends Object3D { constructor(); - translationWorld: Vector3; - translationObject: Vector3; - quaternionWorld: Quaternion; - quaternionObject: Quaternion; - scaleWorld: Vector3; - scaleObject: Vector3; - updateMatrixWorld(force?: boolean): void; } @@ -5366,9 +5345,6 @@ declare module THREE { heightSegments: number; depthSegments: number; }; - widthSegments: number; - heightSegments: number; - depthSegments: number; } export class CircleGeometry extends Geometry { @@ -5380,10 +5356,6 @@ declare module THREE { thetaStart: number; thetaLength: number; }; - radius: number; - segments: number; - thetaStart: number; - thetaLength: number; } // deprecated @@ -5409,54 +5381,60 @@ declare module THREE { heightSegments: number; openEnded: boolean; }; - radiusTop: number; - radiusBottom: number; - height: number; - radialSegments: number; - heightSegments: number; - openEnded: boolean; + } + + export class DodecahedronGeometry extends Geometry { + constructor(radius: number, detail: number); + + parameters: { + radius: number; + detail: number; + }; } export class ExtrudeGeometry extends Geometry { constructor(shape?: Shape, options?: any); constructor(shapes?: Shape[], options?: any); + WorldUVGenerator: { + generateTopUV(geometry: Geometry, indexA: number, indexB: number, indexC: number): Vector2[]; + generateSideWallUV(geometry: Geometry, indexA: number, indexB: number, indexC: number, indexD: number): Vector2[]; + }; + addShapeList(shapes: Shape[], options?: any): void; addShape(shape: Shape, options?: any): void; } export class IcosahedronGeometry extends PolyhedronGeometry { constructor(radius: number, detail: number); - - parameters: { - radius: number; - detail: number; - }; - radius: number; - detail: number; } export class LatheGeometry extends Geometry { constructor(points: Vector3[], segments?: number, phiStart?: number, phiLength?: number); - + + parameters: { + points: Vector3[]; + segments: number; + phiStart: number; + phiLength: number; + }; } export class OctahedronGeometry extends PolyhedronGeometry { constructor(radius: number, detail: number); - - parameters: { - radius: number; - detail: number; - }; - radius: number; - detail: number; } export class ParametricGeometry extends Geometry { - constructor(func: (u: number, v: number) => Vector3, slices: number, stacks: number, useTris?: boolean); + constructor(func: (u: number, v: number) => Vector3, slices: number, stacks: number); + + parameters: { + func: (u: number, v: number) => Vector3; + slices: number; + stacks: number; + }; } - export class PlaneGeometry extends Geometry { + export class PlaneBufferGeometry extends Geometry { constructor(width: number, height: number, widthSegments?: number, heightSegments?: number); parameters: { @@ -5465,24 +5443,40 @@ declare module THREE { widthSegments: number; heightSegments: number; }; - width: number; - height: number; - widthSegments: number; - heightSegments: number; + } + + export class PlaneGeometry extends PlaneBufferGeometry { } export class PolyhedronGeometry extends Geometry { constructor(vertices: Vector3[], faces: Face3[], radius?: number, detail?: number); + + parameters: { + vertices: Vector3[]; + faces: Face3[]; + radius: number; + detail: number; + }; } export class RingGeometry extends Geometry { constructor(innerRadius?: number, outerRadius?: number, thetaSegments?: number, phiSegments?: number, thetaStart?: number, thetaLength?: number); + + parameters: { + innerRadius: number; + outerRadius: number; + thetaSegments: number; + phiSegments: number; + thetaStart: number; + thetaLength: number; + }; } export class ShapeGeometry extends Geometry { constructor(shape: Shape, options?: any); constructor(shapes: Shape[], options?: any); + addShapeList(shapes: Shape[], options: any): ShapeGeometry; addShape(shape: Shape, options?: any): void; } @@ -5513,13 +5507,6 @@ declare module THREE { thetaStart: number; thetaLength: number; }; - radius: number; - widthSegments: number; - heightSegments: number; - phiStart: number; - phiLength: number; - thetaStart: number; - thetaLength: number; } export class TetrahedronGeometry extends PolyhedronGeometry { @@ -5552,11 +5539,6 @@ declare module THREE { tubularSegments: number; arc: number; }; - radius: number; - tube: number; - radialSegments: number; - tubularSegments: number; - arc: number; } export class TorusKnotGeometry extends Geometry { @@ -5571,13 +5553,6 @@ declare module THREE { q: number; heightScale: number; }; - radius: number; - tube: number; - radialSegments: number; - tubularSegments: number; - p: number; - q: number; - heightScale: number; } export class TubeGeometry extends Geometry { @@ -5590,11 +5565,6 @@ declare module THREE { radialSegments: number; closed: boolean; }; - path: Path; - segments: number; - radius: number; - radialSegments: number; - closed: boolean; tangents: Vector3[]; normals: Vector3[]; binormals: Vector3[]; @@ -5749,34 +5719,6 @@ declare module THREE { render(renderCallback:Function): void; } - export interface LensFlareProperty { - texture: Texture; // Texture - size: number; // size in pixels (-1 = use texture.width) - distance: number; // distance (0-1) from light source (0=at light source) - x: number; - y: number; - z: number; // screen position (-1 => 1) z = 0 is ontop z = 1 is back - scale: number; // scale - rotation: number; // rotation - opacity: number; // opacity - color: Color; // color - blending: Blending; - } - - export class LensFlare extends Object3D { - constructor(texture?: Texture, size?: number, distance?: number, blending?: Blending, color?: Color); - - lensFlares: LensFlareProperty[]; - positionScreen: Vector3; - customUpdateCallback: (object: LensFlare) => void; - - add(texture: Texture, size?: number, distance?: number, blending?: Blending, color?: Color): void; - add(obj: Object3D): void; - - - updateLensFlares(): void; - } - export interface MorphBlendMeshAnimation { startFrame: number; endFrame: number; @@ -5813,54 +5755,6 @@ declare module THREE { stopAnimation(name: string): void; update(delta: number): void; } - - // Extras / Renderers / Plugins ///////////////////////////////////////////////////////////////////// - - export class DepthPassPlugin implements RendererPlugin { - constructor(); - - enabled: boolean; - renderTarget: RenderTarget; - - init(renderer: Renderer): void; - render(scene: Scene, camera: Camera): void; - update(scene: Scene, camera: Camera): void; - } - - export class LensFlarePlugin implements RendererPlugin { - constructor(); - - init(renderer: Renderer): void; - render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; - } - - export class ShadowMapPlugin implements RendererPlugin { - constructor(); - - init(renderer: Renderer): void; - render(scene: Scene, camera: Camera): void; - update(scene: Scene, camera: Camera): void; - } - - export class SpritePlugin implements RendererPlugin { - constructor(); - - init(renderer: Renderer): void; - render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void; - } - - // Extras / Shaders ///////////////////////////////////////////////////////////////////// - - export var ShaderFlares: { - 'lensFlareVertexTexture': { - vertexShader: string; - fragmentShader: string; - }; - 'lensFlare': { - vertexShader: string; - fragmentShader: string; - }; - }; } declare module 'three' { From 5eba93f5813418f10da92861def0ed1bdc6b9815 Mon Sep 17 00:00:00 2001 From: progre Date: Mon, 3 Nov 2014 12:11:41 +0900 Subject: [PATCH 018/292] move to legacy --- .../socket.io-0.9-tests.ts} | 46 +++--- .../socket.io-0.9-tests.ts.tscparams} | 2 +- .../socket.io-0.9.d.ts} | 140 +++++++++--------- 3 files changed, 94 insertions(+), 94 deletions(-) rename socket.io/{socket.io-tests.ts => legacy/socket.io-0.9-tests.ts} (96%) rename socket.io/{socket.io-tests.ts.tscparams => legacy/socket.io-0.9-tests.ts.tscparams} (50%) rename socket.io/{socket.io.d.ts => legacy/socket.io-0.9.d.ts} (96%) diff --git a/socket.io/socket.io-tests.ts b/socket.io/legacy/socket.io-0.9-tests.ts similarity index 96% rename from socket.io/socket.io-tests.ts rename to socket.io/legacy/socket.io-0.9-tests.ts index 0b29890ca1..40f0c6b897 100644 --- a/socket.io/socket.io-tests.ts +++ b/socket.io/legacy/socket.io-0.9-tests.ts @@ -1,24 +1,24 @@ -import io = require('socket.io'); - -var socketManager = io.listen(80); - -socketManager.sockets.on('connection', socket => { - socket.emit('news', { hello: 'world' }); - socket.on('my other event', data => { - console.log(data); - }); -}); - -// Storing data Associated to a client. -// Server side sample -io.listen(80).sockets.on('connection', function (socket) { - socket.on('set nickname', function (name) { - socket.set('nickname', name, function () { socket.emit('ready'); }); - }); - - socket.on('msg', function () { - socket.get('nickname', function (err, name) { - console.log('Chat message by ', name); - }); - }); +import io = require('socket.io'); + +var socketManager = io.listen(80); + +socketManager.sockets.on('connection', socket => { + socket.emit('news', { hello: 'world' }); + socket.on('my other event', data => { + console.log(data); + }); +}); + +// Storing data Associated to a client. +// Server side sample +io.listen(80).sockets.on('connection', function (socket) { + socket.on('set nickname', function (name) { + socket.set('nickname', name, function () { socket.emit('ready'); }); + }); + + socket.on('msg', function () { + socket.get('nickname', function (err, name) { + console.log('Chat message by ', name); + }); + }); }); \ No newline at end of file diff --git a/socket.io/socket.io-tests.ts.tscparams b/socket.io/legacy/socket.io-0.9-tests.ts.tscparams similarity index 50% rename from socket.io/socket.io-tests.ts.tscparams rename to socket.io/legacy/socket.io-0.9-tests.ts.tscparams index d3f5a12faa..8b13789179 100644 --- a/socket.io/socket.io-tests.ts.tscparams +++ b/socket.io/legacy/socket.io-0.9-tests.ts.tscparams @@ -1 +1 @@ - + diff --git a/socket.io/socket.io.d.ts b/socket.io/legacy/socket.io-0.9.d.ts similarity index 96% rename from socket.io/socket.io.d.ts rename to socket.io/legacy/socket.io-0.9.d.ts index 184468b127..44edbb1745 100644 --- a/socket.io/socket.io.d.ts +++ b/socket.io/legacy/socket.io-0.9.d.ts @@ -1,70 +1,70 @@ -// Type definitions for socket.io -// Project: http://socket.io/ -// Definitions by: William Orr -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -/// - -declare module "socket.io" { - import http = require('http'); - - export function listen(server: http.Server, options: any, fn: Function): SocketManager; - export function listen(server: http.Server, fn?: Function): SocketManager; - export function listen(port: Number): SocketManager; - - - interface Socket { - id: string; - json:any; - log: any; - volatile: any; - broadcast: any; - handshake: any; - in(room: string): Socket; - to(room: string): Socket; - join(name: string, fn: Function): Socket; - leave(name: string, fn: Function): Socket; - set(key: string, value: any, fn: Function): Socket; - get(key: string, fn: Function): Socket; - has(key: string, fn: Function): Socket; - del(key: string, fn: Function): Socket; - disconnect(): Socket; - send(data: any, fn: Function): Socket; - emit(ev: any, ...data:any[]): Socket; - on(ns: string, fn: Function): Socket; - } - - interface SocketNamespace { - clients(room: string): Socket[]; - log: any; - store: any; - json: any; - volatile: any; - in(room: string): SocketNamespace; - on(evt: string, fn: (socket: Socket) => void): SocketNamespace; - to(room: string): SocketNamespace; - except(id: any): SocketNamespace; - send(data: any): any; - emit(ev: any, ...data:any[]): Socket; - socket(sid: any, readable: boolean): Socket; - authorization(fn: Function): SocketNamespace; - } - - interface SocketManager { - get(key: any): any; - set(key: any, value: any): SocketManager; - enable(key: any): SocketManager; - disable(key: any): SocketManager; - enabled(key: any): boolean; - disabled(key: any): boolean; - configure(env: string, fn: Function): SocketManager; - configure(fn: Function): SocketManager; - of(nsp: string): SocketNamespace; - on(ns: string, fn: Function): SocketManager; - sockets: SocketNamespace; - } - - -} - +// Type definitions for socket.io +// Project: http://socket.io/ +// Definitions by: William Orr +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +declare module "socket.io" { + import http = require('http'); + + export function listen(server: http.Server, options: any, fn: Function): SocketManager; + export function listen(server: http.Server, fn?: Function): SocketManager; + export function listen(port: Number): SocketManager; + + + interface Socket { + id: string; + json:any; + log: any; + volatile: any; + broadcast: any; + handshake: any; + in(room: string): Socket; + to(room: string): Socket; + join(name: string, fn: Function): Socket; + leave(name: string, fn: Function): Socket; + set(key: string, value: any, fn: Function): Socket; + get(key: string, fn: Function): Socket; + has(key: string, fn: Function): Socket; + del(key: string, fn: Function): Socket; + disconnect(): Socket; + send(data: any, fn: Function): Socket; + emit(ev: any, ...data:any[]): Socket; + on(ns: string, fn: Function): Socket; + } + + interface SocketNamespace { + clients(room: string): Socket[]; + log: any; + store: any; + json: any; + volatile: any; + in(room: string): SocketNamespace; + on(evt: string, fn: (socket: Socket) => void): SocketNamespace; + to(room: string): SocketNamespace; + except(id: any): SocketNamespace; + send(data: any): any; + emit(ev: any, ...data:any[]): Socket; + socket(sid: any, readable: boolean): Socket; + authorization(fn: Function): SocketNamespace; + } + + interface SocketManager { + get(key: any): any; + set(key: any, value: any): SocketManager; + enable(key: any): SocketManager; + disable(key: any): SocketManager; + enabled(key: any): boolean; + disabled(key: any): boolean; + configure(env: string, fn: Function): SocketManager; + configure(fn: Function): SocketManager; + of(nsp: string): SocketNamespace; + on(ns: string, fn: Function): SocketManager; + sockets: SocketNamespace; + } + + +} + From e5a6aa1c49c0ad4df32f0678cb93485b9b24f795 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Sun, 2 Nov 2014 22:20:59 -0600 Subject: [PATCH 019/292] Declare jszip as a module, too. --- jszip/jszip.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jszip/jszip.d.ts b/jszip/jszip.d.ts index 038b52957f..df571793b3 100644 --- a/jszip/jszip.d.ts +++ b/jszip/jszip.d.ts @@ -169,4 +169,8 @@ declare var JSZip: { prototype: JSZip; support: JSZipSupport; -} \ No newline at end of file +} + +declare module "jszip" { + export = JSZip; +} From 06d5b07ea2ae23d1ff38e1d7d8d9168036745645 Mon Sep 17 00:00:00 2001 From: ryiwamoto Date: Mon, 3 Nov 2014 14:04:40 +0900 Subject: [PATCH 020/292] fix eventemitter2 in browser --- eventemitter2/eventemitter2-tests.ts | 18 ++- eventemitter2/eventemitter2.d.ts | 157 ++++++++++++++++++++++----- 2 files changed, 146 insertions(+), 29 deletions(-) diff --git a/eventemitter2/eventemitter2-tests.ts b/eventemitter2/eventemitter2-tests.ts index 831561b876..747f2e87b6 100644 --- a/eventemitter2/eventemitter2-tests.ts +++ b/eventemitter2/eventemitter2-tests.ts @@ -1,7 +1,19 @@ /// -// import eventemitter2 = require("eventemitter2"); -// var EventEmitter2 = eventemitter2.EventEmitter2; +// Example for CommonJS/AMD +/* +import eventemitter2 = require("eventemitter2"); +var EventEmitter2 = eventemitter2.EventEmitter2; + +class Child extends eventemitter2.EventEmitter2 { +} +*/ + +// This class definition doesn't work in CommonJS/AMD. +class Child extends EventEmitter2 { +} + +var server = new EventEmitter2(); function testConfiguration() { var foo = new EventEmitter2({ @@ -14,8 +26,6 @@ function testConfiguration() { var bazz = new EventEmitter2(); } -var server = new EventEmitter2(); - function testAddListener() { server.addListener('data', function (value1: any, value2: any, value3: any) { console.log('The event was raised!'); diff --git a/eventemitter2/eventemitter2.d.ts b/eventemitter2/eventemitter2.d.ts index a02124c374..8b95681926 100644 --- a/eventemitter2/eventemitter2.d.ts +++ b/eventemitter2/eventemitter2.d.ts @@ -3,34 +3,146 @@ // Definitions by: ryiwamoto // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module eventemitter2 { - interface Configuration { - /** - * use wildcards - */ - wildcard?: boolean; +interface EventEmitter2Configuration { + /** + * use wildcards + */ + wildcard?: boolean; - /** - * the delimiter used to segment namespaces, defaults to `.`. - */ - delimiter?: string; + /** + * the delimiter used to segment namespaces, defaults to `.`. + */ + delimiter?: string; - /** - * if you want to emit the newListener event set to true. - */ - newListener?: boolean; + /** + * if you want to emit the newListener event set to true. + */ + newListener?: boolean; - /** - * max listeners that can be assigned to an event, default 10. - */ - maxListeners?: number; - } + /** + * max listeners that can be assigned to an event, default 10. + */ + maxListeners?: number; +} +declare class EventEmitter2 { + /** + * @param conf + */ + constructor(conf?: EventEmitter2Configuration); + + /** + * Adds a listener to the end of the listeners array for the specified event. + * @param event + * @param listener + */ + addListener(event: string, listener: Function): EventEmitter2; + + /** + * Adds a listener to the end of the listeners array for the specified event. + * @param event + * @param listener + */ + on(event: string, listener: Function): EventEmitter2; + + /** + * Adds a listener that will be fired when any event is emitted. + * @param listener + */ + onAny(listener: Function): EventEmitter2; + + /** + * Removes the listener that will be fired when any event is emitted. + * @param listener + */ + offAny(listener: Function): EventEmitter2; + + /** + * Adds a one time listener for the event. + * The listener is invoked only the first time the event is fired, after which it is removed. + * @param event + * @param listener + */ + once(event: string, listener: Function): EventEmitter2; + + /** + * Adds a listener that will execute n times for the event before being removed. + * The listener is invoked only the first n times the event is fired, after which it is removed. + * @param event + * @param timesToListen + * @param listener + */ + many(event: string, timesToListen: number, listener: Function): EventEmitter2; + + /** + * Remove a listener from the listener array for the specified event. + * Caution: changes array indices in the listener array behind the listener. + * @param event + * @param listener + */ + removeListener(event: string, listener: Function): EventEmitter2; + + /** + * Remove a listener from the listener array for the specified event. + * Caution: changes array indices in the listener array behind the listener. + * @param event + * @param listener + */ + off(event: string, listener: Function): EventEmitter2; + + /** + * Removes all listeners, or those of the specified event. + * @param event + */ + removeAllListeners(event?: string): EventEmitter2; + + /** + * Removes all listeners, or those of the specified event. + * @param events + */ + removeAllListeners(events: string[]): EventEmitter2; + + /** + * By default EventEmitters will print a warning if more than 10 listeners are added to it. + * This is a useful default which helps finding memory leaks. + * Obviously not all Emitters should be limited to 10. This function allows that to be increased. + * Set to zero for unlimited. + * @param n + */ + setMaxListeners(n: number): void; + + /** + * Returns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners. + * @param event + */ + listeners(event: string): Function[]; + + /** + * Returns an array of listeners that are listening for any event that is specified. + * This array can be manipulated, e.g. to remove listeners. + */ + listenersAny(): Function[]; + + /** + * Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. + * @param event + * @param args + */ + emit(event: string, ...args: string[]): boolean; + + /** + * Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. + * @param event + */ + emit(event: string[]): boolean; +} + +declare module "eventemitter2" { export class EventEmitter2 { /** * @param conf */ - constructor(conf?: Configuration); + constructor(conf?: EventEmitter2Configuration); /** * Adds a listener to the end of the listeners array for the specified event. @@ -139,8 +251,3 @@ declare module eventemitter2 { } } -declare module "eventemitter2" { - export = eventemitter2; -} - -declare var EventEmitter2: typeof eventemitter2.EventEmitter2; From 7e58e7c469d9775d03fcdee4bde8ff45132e6fa0 Mon Sep 17 00:00:00 2001 From: Carl-Erik Kopseng Date: Mon, 3 Nov 2014 11:53:12 +0100 Subject: [PATCH 021/292] Revert "Fixed error in test for indexedDB" --- modernizr/modernizr.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modernizr/modernizr.d.ts b/modernizr/modernizr.d.ts index 25043375c2..5827bbf9eb 100644 --- a/modernizr/modernizr.d.ts +++ b/modernizr/modernizr.d.ts @@ -75,7 +75,7 @@ interface ModernizrStatic { history: boolean; audio: Audioboolean; video: Videoboolean; - indexedDB: boolean; + indexeddb: boolean; input: Inputboolean; inputtypes: InputTypesboolean; localstorage: boolean; From 6810682be11601c3cdd332ae986ede246c7cebb9 Mon Sep 17 00:00:00 2001 From: Jakub Olek Date: Mon, 3 Nov 2014 13:39:36 +0100 Subject: [PATCH 022/292] add definitions for Headroom --- Headroom/headroom-tests.ts | 13 +++++++++++++ Headroom/headroom.d.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Headroom/headroom-tests.ts create mode 100644 Headroom/headroom.d.ts diff --git a/Headroom/headroom-tests.ts b/Headroom/headroom-tests.ts new file mode 100644 index 0000000000..e0e83449eb --- /dev/null +++ b/Headroom/headroom-tests.ts @@ -0,0 +1,13 @@ +/// + +new Headroom(document.getElementById('siteHead')); + +new Headroom(document.getElementsByClassName('siteHead')[0]); + +new Headroom(document.getElementsByClassName('siteHead')[0], { + tolerance: 34 +}); + +new Headroom(document.getElementsByClassName('siteHead')[0], { + offset: 500 +}); diff --git a/Headroom/headroom.d.ts b/Headroom/headroom.d.ts new file mode 100644 index 0000000000..b4fc3133e7 --- /dev/null +++ b/Headroom/headroom.d.ts @@ -0,0 +1,28 @@ +// Type definitions for headroom.js v0.7.0 +// Project: http://wicky.nillia.ms/headroom.js/ +// Definitions by: Jakub Olek +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface HeadroomOptions { + offset?: number; + tolerance?: any; + classes?: { + initial?: string; + pinned?: string; + unpinned?: string; + top?: string; + notTop?: string; + }; + scroller?: Element; + onPin?: () => void; + onUnPin?: () => void; + onTop?: () => void; + onNotTop?: () => void; + +} + +declare class Headroom { + constructor(element: Node, options?: HeadroomOptions); + constructor(element: Element, options?: HeadroomOptions); + init: () => void; +} From bafa39895f5294f75357a5fa649d92fb4231226a Mon Sep 17 00:00:00 2001 From: vingarg Date: Mon, 3 Nov 2014 19:50:00 +0530 Subject: [PATCH 023/292] Added interface for rowGrid.js --- jquery.rowGrid/jquery.rowGrid.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 jquery.rowGrid/jquery.rowGrid.d.ts diff --git a/jquery.rowGrid/jquery.rowGrid.d.ts b/jquery.rowGrid/jquery.rowGrid.d.ts new file mode 100644 index 0000000000..4b136d2bac --- /dev/null +++ b/jquery.rowGrid/jquery.rowGrid.d.ts @@ -0,0 +1,17 @@ +// Type definitions for jQuery rowGrid.js plugin (v1.0.2) +// Project: https://github.com/brunjo/rowGrid.js +// Definitions by: Vinayak Garg +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface JQueryRowGridJSOptions { + minMargin?: number; + maxMargin?: number; + itemSelector: string; +} + +interface JQuery { + rowGrid(options?: JQueryRowGridJSOptions): JQuery; + rowGrid(appended: string): JQuery; +} \ No newline at end of file From 3a8f59bc933292f1cb89438e8c3b7a1b722b4ce3 Mon Sep 17 00:00:00 2001 From: vingarg Date: Mon, 3 Nov 2014 20:02:55 +0530 Subject: [PATCH 024/292] Added name in CONTRIBUTORS.md --- CONTRIBUTORS.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9d27a0d1d4..639abfb7aa 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -63,7 +63,7 @@ All definitions files include a header with the author and editors, so at some p * [Clone](https://github.com/pvorb/node-clone) (by [Kieran Simpson](https://github.com/kierans)) * [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) * [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem) and [vvakame](https://github.com/vvakame)) -* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) * [cookie](https://github.com/jshttp/cookie) (by [Pine Mizune](https://github.com/jshttp/cookie)) * [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/)) * [Cordovarduino](https://github.com/stereolux/cordovarduino) (by [Hendrik Maus](https://github.com/hendrikmaus)) @@ -207,6 +207,7 @@ All definitions files include a header with the author and editors, so at some p * [jQuery.pnotify](http://sciactive.github.io/pnotify/) (by [David Sichau](https://github.com/DavidSichau/)) * [jQuery.postMessage](http://benalman.com/projects/jquery-postmessage-plugin/) (by [Junle Li](https://github.com/lijunle)) * [jQuery.prettyphoto](https://github.com/scaron/prettyphoto) (by [Paul Gaske](https://github.com/pgaske)) +* [jQuery.rowGrid](https://github.com/brunjo/rowGrid.js) (by [Vinayak Garg](https://github.com/vinayak-garg)) * [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/)) * [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/)) * [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) (by [Blake Niemyjski](https://github.com/niemyjski)) @@ -248,7 +249,7 @@ All definitions files include a header with the author and editors, so at some p * [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC)) * [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov)) * [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel)) -* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) +* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) * [Knockout Secure Binding](https://github.com/brianmhunt/knockout-secure-binding) (by [Pine Mizune](https://github.com/pine613)) * [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig)) * [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising)) @@ -326,9 +327,9 @@ All definitions files include a header with the author and editors, so at some p * [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin)) * [PeerJS](http://peerjs.com/) (by [Toshiya Nakakura](https://github.com/nakakura)) * [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame)) -* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) -* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613)) -* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) +* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) +* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613)) +* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) * [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov)) * [Physijs](http://chandlerprall.github.io/Physijs/) (by [gyoh_k](https://github.com/gyohk)) * [Pickadate.js](https://github.com/amsul/pickadate.js) (by [Adi Dahiya](https://github.com/adidahiya)) From d68d470bbd9053908f1b72ffa2c2b13b43d491ad Mon Sep 17 00:00:00 2001 From: progre Date: Mon, 3 Nov 2014 17:11:03 +0900 Subject: [PATCH 025/292] add socket.io 1.2.0 --- socket.io/legacy/socket.io-0.9-tests.ts | 2 +- socket.io/legacy/socket.io-0.9.d.ts | 4 +- socket.io/socket.io-tests.ts | 145 ++++++++++++++++++++++++ socket.io/socket.io.d.ts | 76 +++++++++++++ 4 files changed, 224 insertions(+), 3 deletions(-) create mode 100644 socket.io/socket.io-tests.ts create mode 100644 socket.io/socket.io.d.ts diff --git a/socket.io/legacy/socket.io-0.9-tests.ts b/socket.io/legacy/socket.io-0.9-tests.ts index 40f0c6b897..0d7e12bb6d 100644 --- a/socket.io/legacy/socket.io-0.9-tests.ts +++ b/socket.io/legacy/socket.io-0.9-tests.ts @@ -1,4 +1,4 @@ -import io = require('socket.io'); +import io = require('socket.io-0.9'); var socketManager = io.listen(80); diff --git a/socket.io/legacy/socket.io-0.9.d.ts b/socket.io/legacy/socket.io-0.9.d.ts index 44edbb1745..5ead4abde5 100644 --- a/socket.io/legacy/socket.io-0.9.d.ts +++ b/socket.io/legacy/socket.io-0.9.d.ts @@ -4,9 +4,9 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// -declare module "socket.io" { +declare module "socket.io-0.9" { import http = require('http'); export function listen(server: http.Server, options: any, fn: Function): SocketManager; diff --git a/socket.io/socket.io-tests.ts b/socket.io/socket.io-tests.ts new file mode 100644 index 0000000000..442e677751 --- /dev/null +++ b/socket.io/socket.io-tests.ts @@ -0,0 +1,145 @@ +import socketIO = require('socket.io'); + +function testUsingWithNodeHTTPServer() { + var app = require('http').createServer(handler); + var io = socketIO(app); + var fs = require('fs'); + + app.listen(80); + + function handler(req: any, res: any) { + fs.readFile(__dirname + '/index.html', + function (err: any, data: any) { + if (err) { + res.writeHead(500); + return res.end('Error loading index.html'); + } + + res.writeHead(200); + res.end(data); + }); + } + + io.on('connection', function (socket) { + socket.emit('news', { hello: 'world' }); + socket.on('my other event', function (data: any) { + console.log(data); + }); + }); +} + +function testUsingWithExpress() { + var app = require('express')(); + var server = require('http').Server(app); + var io = socketIO(server); + + server.listen(80); + + app.get('/', function (req: any, res: any) { + res.sendfile(__dirname + '/index.html'); + }); + + io.on('connection', function (socket) { + socket.emit('news', { hello: 'world' }); + socket.on('my other event', function (data: any) { + console.log(data); + }); + }); +} + +function testUsingWithTheExpressFramework() { + var app = require('express').createServer(); + var io = socketIO(app); + + app.listen(80); + + app.get('/', function (req: any, res: any) { + res.sendfile(__dirname + '/index.html'); + }); + + io.on('connection', function (socket) { + socket.emit('news', { hello: 'world' }); + socket.on('my other event', function (data: any) { + console.log(data); + }); + }); +} + +function testSendingAndReceivingEvents() { + var io = socketIO(80); + + io.on('connection', function (socket) { + io.emit('this', { will: 'be received by everyone' }); + + socket.on('private message', function (from: any, msg: any) { + console.log('I received a private message by ', from, ' saying ', msg); + }); + + socket.on('disconnect', function () { + io.sockets.emit('user disconnected'); + }); + }); +} + +function testRestrictingYourselfToANamespace() { + var io = socketIO.listen(80); + var chat = io + .of('/chat') + .on('connection', function (socket) { + socket.emit('a message', { + that: 'only' + , '/chat': 'will get' + }); + chat.emit('a message', { + everyone: 'in' + , '/chat': 'will get' + }); + }); + + var news = io + .of('/news') + .on('connection', function (socket) { + socket.emit('item', { news: 'item' }); + }); +} + +function testSendingVolatileMessages() { + var io = socketIO.listen(80); + + io.sockets.on('connection', function (socket) { + var tweets = setInterval(function () { + socket.volatile.emit('bieber tweet', {}); + }, 100); + + socket.on('disconnect', function () { + clearInterval(tweets); + }); + }); +} + +function testSendingAndGettingData() { + var io = socketIO.listen(80); + + io.sockets.on('connection', function (socket) { + socket.on('ferret', function (name: any, fn: any) { + fn('woot'); + }); + }); +} + +function testBroadcastingMessages() { + var io = socketIO.listen(80); + + io.sockets.on('connection', function (socket) { + socket.broadcast.emit('user connected'); + }); +} + +function testUsingItJustAsACrossBrowserWebSocket() { + var io = socketIO.listen(80); + + io.sockets.on('connection', function (socket) { + socket.on('message', function () { }); + socket.on('disconnect', function () { }); + }); +} diff --git a/socket.io/socket.io.d.ts b/socket.io/socket.io.d.ts new file mode 100644 index 0000000000..ddf7ff11bb --- /dev/null +++ b/socket.io/socket.io.d.ts @@ -0,0 +1,76 @@ +// Type definitions for socket.io 1.2.0 +// Project: http://socket.io/ +// Definitions by: PROGRE +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'socket.io' { + var server: SocketIOStatic; + + export = server; +} + +interface SocketIOStatic { + (): SocketIO.Server; + (srv: any, opts?: any): SocketIO.Server; + (port: number, opts?: any): SocketIO.Server; + (opts: any): SocketIO.Server; + + listen: SocketIOStatic; +} + +declare module SocketIO { + interface Server { + serveClient(v: boolean): Server; + path(v: string): Server; + adapter(v: any): Server; + origins(v: string): Server; + sockets: Namespace; + attach(srv: any, opts: any): Server; + attach(port: number, opts: any): Server; + listen(srv: any, opts: any): Server; + listen(port: number, opts: any): Server; + bind(srv: any): Server; + onconnection(socket: any): Server; + of(nsp: String): Namespace; + emit(name: string, ...args: any[]): Socket; + use(fn: Function): Namespace; + + on(event: 'connection', listener: (socket: Socket) => void): any; + on(event: 'connect', listener: (socket: Socket) => void): any; + on(event: string, listener: Function): any; + } + + interface Namespace extends NodeJS.EventEmitter { + name: String; + connected: { [id: number]: Socket }; + use(fn: Function): Namespace + + on(event: 'connection', listener: (socket: Socket) => void): any; + on(event: 'connect', listener: (socket: Socket) => void): any; + on(event: string, listener: Function): any; + } + + interface Socket { + rooms: string[]; + client: Client; + conn: Socket; + request: any; + id: string; + emit(name: string, ...args: any[]): Socket; + join(name: string, fn?: Function): Socket; + leave(name: string, fn?: Function): Socket; + to(room: string): Socket; + in(room: string): Socket; + + on(event: string, listener: Function): any; + broadcast: Socket; + volatile: Socket; + } + + interface Client { + conn: any; + request: any; + } +} From bff52380d69b6736575bc933730c777d5a93ec9e Mon Sep 17 00:00:00 2001 From: progre Date: Tue, 4 Nov 2014 00:11:09 +0900 Subject: [PATCH 026/292] add socket.io-client 1.2.0 --- .../socket.io-client-0.9-commonjs-tests.ts} | 20 +++--- .../legacy/socket.io-client-0.9-tests.ts | 10 +++ .../legacy/socket.io-client-0.9.d.ts | 40 ++++++++++++ socket.io-client/socket.io-client-tests.ts | 61 ++++++++++++++++--- socket.io-client/socket.io-client.d.ts | 56 +++++++++-------- 5 files changed, 145 insertions(+), 42 deletions(-) rename socket.io-client/{socket.io-client-commonjs-tests.ts => legacy/socket.io-client-0.9-commonjs-tests.ts} (81%) create mode 100644 socket.io-client/legacy/socket.io-client-0.9-tests.ts create mode 100644 socket.io-client/legacy/socket.io-client-0.9.d.ts diff --git a/socket.io-client/socket.io-client-commonjs-tests.ts b/socket.io-client/legacy/socket.io-client-0.9-commonjs-tests.ts similarity index 81% rename from socket.io-client/socket.io-client-commonjs-tests.ts rename to socket.io-client/legacy/socket.io-client-0.9-commonjs-tests.ts index 7b5f967473..beb8f0fad5 100644 --- a/socket.io-client/socket.io-client-commonjs-tests.ts +++ b/socket.io-client/legacy/socket.io-client-0.9-commonjs-tests.ts @@ -1,10 +1,10 @@ -import io = require('socket.io-client'); - -var socket = io.connect('http://localhost:80'); - -socket.on('connect', function () { - console.log('Connected!'); - socket.emit('event', 'some test data', function () { - console.log('Sent some data.'); - }); -}); +import io = require('socket.io-client-0.9'); + +var socket = io.connect('http://localhost:80'); + +socket.on('connect', function () { + console.log('Connected!'); + socket.emit('event', 'some test data', function () { + console.log('Sent some data.'); + }); +}); diff --git a/socket.io-client/legacy/socket.io-client-0.9-tests.ts b/socket.io-client/legacy/socket.io-client-0.9-tests.ts new file mode 100644 index 0000000000..7178306281 --- /dev/null +++ b/socket.io-client/legacy/socket.io-client-0.9-tests.ts @@ -0,0 +1,10 @@ +/// + +var socket = io.connect('http://localhost:80'); + +socket.on('connect', function () { + console.log('Connected!'); + socket.emit('event', 'some test data', function () { + console.log('Sent some data.'); + }); +}); diff --git a/socket.io-client/legacy/socket.io-client-0.9.d.ts b/socket.io-client/legacy/socket.io-client-0.9.d.ts new file mode 100644 index 0000000000..0b3626e420 --- /dev/null +++ b/socket.io-client/legacy/socket.io-client-0.9.d.ts @@ -0,0 +1,40 @@ +// Type definitions for socket.io nodejs client +// Project: http://socket.io/ +// Definitions by: Maido Kaara +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "socket.io-client-0.9" { + export = io; +} + +declare var io: SocketIOStatic; + +interface SocketIOStatic { + connect(host: string, details?: any): SocketIOClient.Socket; +} + +declare module SocketIOClient { + interface EventEmitter { + emit(name: string, ...data: any[]): any; + on(ns: string, fn: Function): EventEmitter; + addListener(ns: string, fn: Function): EventEmitter; + removeListener(ns: string, fn: Function): EventEmitter; + removeAllListeners(ns: string): EventEmitter; + once(ns: string, fn: Function): EventEmitter; + listeners(ns: string): Function[]; + } + + interface SocketNamespace extends EventEmitter { + of(name: string): SocketNamespace; + send(data: any, fn: Function): SocketNamespace; + emit(name: string): SocketNamespace; + } + + interface Socket extends EventEmitter { + of(name: string): SocketNamespace; + connect(fn: Function): Socket; + packet(data: any): Socket; + flushBuffer(): void; + disconnect(): Socket; + } +} diff --git a/socket.io-client/socket.io-client-tests.ts b/socket.io-client/socket.io-client-tests.ts index e1022c61af..215932c460 100644 --- a/socket.io-client/socket.io-client-tests.ts +++ b/socket.io-client/socket.io-client-tests.ts @@ -1,10 +1,57 @@ /// -var socket = io.connect('http://localhost:80'); - -socket.on('connect', function () { - console.log('Connected!'); - socket.emit('event', 'some test data', function () { - console.log('Sent some data.'); +function testUsingWithNodeHTTPServer() { + var socket = io('http://localhost'); + socket.on('news', function (data: any) { + console.log(data); + socket.emit('my other event', { my: 'data' }); }); -}); +} + +function testUsingWithExpress() { + var socket = io.connect('http://localhost'); + socket.on('news', function (data: any) { + console.log(data); + socket.emit('my other event', { my: 'data' }); + }); +} + +function testUsingWithTheExpressFramework() { + var socket = io.connect('http://localhost'); + socket.on('news', function (data: any) { + console.log(data); + socket.emit('my other event', { my: 'data' }); + }); +} + +function testRestrictingYourselfToANamespace() { + var chat = io.connect('http://localhost/chat') + , news = io.connect('http://localhost/news'); + + chat.on('connect', function () { + chat.emit('hi!'); + }); + + news.on('news', function () { + news.emit('woot'); + }); +} + +function testSendingAndGettingData() { + var socket = io(); + socket.on('connect', function () { + socket.emit('ferret', 'tobi', function (data: any) { + console.log(data); + }); + }); +} + +function testUsingItJustAsACrossBrowserWebSocket() { + var socket = io('http://localhost/'); + socket.on('connect', function () { + socket.emit('hi'); + + socket.on('message', function (msg: any) { + }); + }); +} diff --git a/socket.io-client/socket.io-client.d.ts b/socket.io-client/socket.io-client.d.ts index 079ca7cbb8..b03cc830bc 100644 --- a/socket.io-client/socket.io-client.d.ts +++ b/socket.io-client/socket.io-client.d.ts @@ -1,40 +1,46 @@ -// Type definitions for socket.io nodejs client +// Type definitions for socket.io-client 1.2.0 // Project: http://socket.io/ -// Definitions by: Maido Kaara +// Definitions by: PROGRE // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module "socket.io-client" { - export = io; +/// + +declare var io: SocketIOClientStatic; + +declare module 'socket.io-client' { + export = io; } -declare var io: SocketIOStatic; - -interface SocketIOStatic { +interface SocketIOClientStatic { + (host: string, details?: any): SocketIOClient.Socket; + (details?: any): SocketIOClient.Socket; connect(host: string, details?: any): SocketIOClient.Socket; + connect(details?: any): SocketIOClient.Socket; + protocol: number; + Socket: { new (...args: any[]): SocketIOClient.Socket }; + Manager: SocketIOClient.ManagerStatic; } declare module SocketIOClient { - interface EventEmitter { - emit(name: string, ...data: any[]): any; - on(ns: string, fn: Function): EventEmitter; - addListener(ns: string, fn: Function): EventEmitter; - removeListener(ns: string, fn: Function): EventEmitter; - removeAllListeners(ns: string): EventEmitter; - once(ns: string, fn: Function): EventEmitter; - listeners(ns: string): Function[]; + interface Socket { + on(event: string, fn: Function): Socket; + once(event: string, fn: Function): Socket; + off(event: string, fn: Function): Socket; + emit(event: string, ...args: any[]): Socket; + listeners(event: string): Function[]; + hasListeners(event: string): boolean; } - interface SocketNamespace extends EventEmitter { - of(name: string): SocketNamespace; - send(data: any, fn: Function): SocketNamespace; - emit(name: string): SocketNamespace; + interface ManagerStatic { + (url: string, opts: any): SocketIOClient.Manager; + new (url: string, opts: any): SocketIOClient.Manager; } - interface Socket extends EventEmitter { - of(name: string): SocketNamespace; - connect(fn: Function): Socket; - packet(data: any): Socket; - flushBuffer(): void; - disconnect(): Socket; + interface Manager { + reconnection(v: boolean): Manager; + reconnectionAttempts(v: boolean): Manager; + reconnectionDelay(v: boolean): Manager; + reconnectionDelayMax(v: boolean): Manager; + timeout(v: boolean): Manager; } } From 5868972ea7b9d804a806519d4ef4c8cba6476b00 Mon Sep 17 00:00:00 2001 From: Xiaohan Zhang Date: Mon, 3 Nov 2014 13:37:12 -0800 Subject: [PATCH 027/292] Add applyAsync to IRootScopeService --- angularjs/angular.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 2c1436096d..4659da7612 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -482,6 +482,9 @@ declare module ng { $apply(): any; $apply(exp: string): any; $apply(exp: (scope: IScope) => any): any; + + $applyAsync(exp: string): any; + $applyAsync(exp: (scope: IScope) => any): any; $broadcast(name: string, ...args: any[]): IAngularEvent; $destroy(): void; From 17df17872947da251560c3ba61f8a4cbf051bc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20De=20Saint=20Florent?= Date: Mon, 3 Nov 2014 17:08:23 -0500 Subject: [PATCH 028/292] Update Q.d.ts with optional onRejected parameter Spread method does not require onRejected param. From Q documentation: function eventualAdd(a, b) { return Q.spread([a, b], function (a, b) { return a + b; }) } --- q/Q.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/q/Q.d.ts b/q/Q.d.ts index 3e7371ead2..59e891c527 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -248,43 +248,43 @@ declare module Q { * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: any[], onFulfilled: (...args: any[]) => IPromise, onRejected: (reason: any) => IPromise): Promise; + export function spread(promises: any[], onFulfilled: (...args: any[]) => IPromise, onRejected?: (reason: any) => IPromise): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: any[], onFulfilled: (...args: any[]) => IPromise, onRejected: (reason: any) => U): Promise; + export function spread(promises: any[], onFulfilled: (...args: any[]) => IPromise, onRejected?: (reason: any) => U): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: any[], onFulfilled: (...args: any[]) => U, onRejected: (reason: any) => IPromise): Promise; + export function spread(promises: any[], onFulfilled: (...args: any[]) => U, onRejected?: (reason: any) => IPromise): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: any[], onFulfilled: (...args: any[]) => U, onRejected: (reason: any) => U): Promise; + export function spread(promises: any[], onFulfilled: (...args: any[]) => U, onRejected?: (reason: any) => U): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => IPromise, onRejected: (reason: any) => IPromise): Promise; + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => IPromise, onRejected?: (reason: any) => IPromise): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => IPromise, onRejected: (reason: any) => U): Promise; + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => IPromise, onRejected?: (reason: any) => U): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => U, onRejected: (reason: any) => IPromise): Promise; + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => U, onRejected?: (reason: any) => IPromise): Promise; /** * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all. */ - export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => U, onRejected: (reason: any) => U): Promise; + export function spread(promises: IPromise[], onFulfilled: (...args: T[]) => U, onRejected?: (reason: any) => U): Promise; /** * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected before ms milliseconds, the returned promise will be rejected with an Error with the given message. If message is not supplied, the message will be "Timed out after " + ms + " ms". From d41f971197675d244b72db63fb8b180fbc35e086 Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Tue, 4 Nov 2014 16:41:19 +0900 Subject: [PATCH 029/292] Fix a bug --- zepto/zepto.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zepto/zepto.d.ts b/zepto/zepto.d.ts index 5aa3aa8258..aa497b03f9 100644 --- a/zepto/zepto.d.ts +++ b/zepto/zepto.d.ts @@ -993,6 +993,12 @@ interface ZeptoCollection { **/ prependTo(content: HTMLElement[]): ZeptoCollection; + /** + * @see ZeptoCollection.prependTo + * @param content + **/ + prependTo(content: ZeptoCollection): ZeptoCollection; + /** * Get the previous sibling—optionally filtered by selector—of each element in the collection. * @param selector From 5559466c5484bec46643fa9ff980f5aa0552d370 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Tue, 4 Nov 2014 19:08:20 +0900 Subject: [PATCH 030/292] update typefiles --- superagent/superagent.d.ts | 2 ++ supertest/supertest-tests.ts | 29 +++++++++++++++++++++- supertest/supertest.d.ts | 47 +++++++++++++++++++++++++++++------- 3 files changed, 68 insertions(+), 10 deletions(-) diff --git a/superagent/superagent.d.ts b/superagent/superagent.d.ts index 9e6f9c4b5b..0abed74380 100644 --- a/superagent/superagent.d.ts +++ b/superagent/superagent.d.ts @@ -79,6 +79,8 @@ declare module "superagent" { subscribe(url: string, callback?: (err: Error, res: Response) => void): Request; unsubscribe(url: string, callback?: (err: Error, res: Response) => void): Request; patch(url: string, callback?: (err: Error, res: Response) => void): Request; + search(url: string, callback?: (err: Error, res: Response) => void): Request; + connect(url: string, callback?: (err: Error, res: Response) => void): Request; parse(fn: Function): Request; saveCookies(res: Response): void; attachCookies(req: Request): void; diff --git a/supertest/supertest-tests.ts b/supertest/supertest-tests.ts index c4bdfb2711..120cb43c00 100644 --- a/supertest/supertest-tests.ts +++ b/supertest/supertest-tests.ts @@ -29,4 +29,31 @@ request req.expect(200, (err, res) => { if (err) throw err; }); - }); \ No newline at end of file + }); + +// cookie scenario, new version +var client = supertest.agent(app); +client + .post('/login') + .end((err, res) => { + if (err) throw err; + + client.get('/admin') + .expect(200, (err, res) => { + if (err) throw err; + }); + }); + +// functional expect +supertest(app) + .get('/') + .expect(hasPreviousAndNextKeys) + .end((err, res) => { + if (err) throw err; + }); + +function hasPreviousAndNextKeys(res: supertest.Response) { + if (!('next' in res.body)) return "missing next key"; + if (!('prev' in res.body)) throw new Error("missing prev key"); +} + diff --git a/supertest/supertest.d.ts b/supertest/supertest.d.ts index 9b60431f06..075102a53f 100644 --- a/supertest/supertest.d.ts +++ b/supertest/supertest.d.ts @@ -1,4 +1,4 @@ -// Type definitions for SuperTest 0.8.0 +// Type definitions for SuperTest 0.14.0 // Project: https://github.com/visionmedia/supertest // Definitions by: Alex Varju // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -12,19 +12,21 @@ declare module "supertest" { interface Test extends superagent.Request { url: string; serverAddress(app: any, path: string): string; - expect(status: number, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(status: number, body: string, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(body: string, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(body: RegExp, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(body: Object, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(field: string, val: string, callback?: (err: Error, res: superagent.Response) => void): Test; - expect(field: string, val: RegExp, callback?: (err: Error, res: superagent.Response) => void): Test; + expect(status: number, callback?: (err: Error, res: Response) => void): Test; + expect(status: number, body: string, callback?: (err: Error, res: Response) => void): Test; + expect(body: string, callback?: (err: Error, res: Response) => void): Test; + expect(body: RegExp, callback?: (err: Error, res: Response) => void): Test; + expect(body: Object, callback?: (err: Error, res: Response) => void): Test; + expect(field: string, val: string, callback?: (err: Error, res: Response) => void): Test; + expect(field: string, val: RegExp, callback?: (err: Error, res: Response) => void): Test; + expect(checker: (res: Response) => any): Test; set(field: string, val: string): Test; set(field: Object): Test; query(val: Object): Test; send(data: string): Test; send(data: Object): Test; } + interface Response extends superagent.Response {} interface SuperTest { get(url: string): Test; @@ -52,7 +54,34 @@ declare module "supertest" { patch(url: string): Test; } - function agent(): superagent.Agent; + interface TestAgent extends superagent.Agent { + get(url: string, callback?: (err: Error, res: Response) => void): Test; + post(url: string, callback?: (err: Error, res: Response) => void): Test; + put(url: string, callback?: (err: Error, res: Response) => void): Test; + head(url: string, callback?: (err: Error, res: Response) => void): Test; + del(url: string, callback?: (err: Error, res: Response) => void): Test; + options(url: string, callback?: (err: Error, res: Response) => void): Test; + trace(url: string, callback?: (err: Error, res: Response) => void): Test; + copy(url: string, callback?: (err: Error, res: Response) => void): Test; + lock(url: string, callback?: (err: Error, res: Response) => void): Test; + mkcol(url: string, callback?: (err: Error, res: Response) => void): Test; + move(url: string, callback?: (err: Error, res: Response) => void): Test; + propfind(url: string, callback?: (err: Error, res: Response) => void): Test; + proppatch(url: string, callback?: (err: Error, res: Response) => void): Test; + unlock(url: string, callback?: (err: Error, res: Response) => void): Test; + report(url: string, callback?: (err: Error, res: Response) => void): Test; + mkactivity(url: string, callback?: (err: Error, res: Response) => void): Test; + checkout(url: string, callback?: (err: Error, res: Response) => void): Test; + merge(url: string, callback?: (err: Error, res: Response) => void): Test; + //m-search(url: string, callback?: (err: Error, res: Response) => void): Test; + notify(url: string, callback?: (err: Error, res: Response) => void): Test; + subscribe(url: string, callback?: (err: Error, res: Response) => void): Test; + unsubscribe(url: string, callback?: (err: Error, res: Response) => void): Test; + patch(url: string, callback?: (err: Error, res: Response) => void): Test; + search(url: string, callback?: (err: Error, res: Response) => void): Test; + connect(url: string, callback?: (err: Error, res: Response) => void): Test; + } + function agent(app?: any): supertest.TestAgent; } function supertest(app: any): supertest.SuperTest; From 56bdc23f7832bd2563a58d08f41f102e49d294c8 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Tue, 4 Nov 2014 21:15:58 +0900 Subject: [PATCH 031/292] add agent methods --- supertest/supertest.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/supertest/supertest.d.ts b/supertest/supertest.d.ts index 075102a53f..cb2bb78b30 100644 --- a/supertest/supertest.d.ts +++ b/supertest/supertest.d.ts @@ -20,11 +20,22 @@ declare module "supertest" { expect(field: string, val: string, callback?: (err: Error, res: Response) => void): Test; expect(field: string, val: RegExp, callback?: (err: Error, res: Response) => void): Test; expect(checker: (res: Response) => any): Test; + + attach(field: string, file: string, filename: string): Test; + redirects(n: number): Test; + part(): Test; set(field: string, val: string): Test; set(field: Object): Test; + type(val: string): Test; query(val: Object): Test; send(data: string): Test; send(data: Object): Test; + buffer(val: boolean): Test; + timeout(ms: number): Test; + clearTimeout(): Test; + auth(user: string, name: string): Test; + field(name: string, val: string): Test; + end(callback?: (err: Error, res: Response) => void): Test; } interface Response extends superagent.Response {} From 5c44d00ca60516e637e93283eb0ca02bc0781a78 Mon Sep 17 00:00:00 2001 From: Yang Guan Date: Tue, 4 Nov 2014 15:18:20 -0800 Subject: [PATCH 032/292] Correct a comment --- heatmap.js/heatmap.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/heatmap.js/heatmap.d.ts b/heatmap.js/heatmap.d.ts index bff76db98f..04b038c25b 100644 --- a/heatmap.js/heatmap.d.ts +++ b/heatmap.js/heatmap.d.ts @@ -27,8 +27,8 @@ interface HeatmapConfiguration { radius?: number; /* - * The radius each datapoint will have (if not specified on the datapoint - * itself) + * Indicate whether the heatmap should use a global extrema or a local + * extrema (the maximum and minimum of the currently displayed viewport) */ useLocalExtrema?: boolean; From 0a16b7f522b801a0eb741eea4cf9ed74d5f67e1f Mon Sep 17 00:00:00 2001 From: Yang Guan Date: Tue, 4 Nov 2014 17:00:14 -0800 Subject: [PATCH 033/292] Put variables into alphabetical order --- heatmap.js/heatmap.d.ts | 78 ++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/heatmap.js/heatmap.d.ts b/heatmap.js/heatmap.d.ts index 04b038c25b..012e3f9d9f 100644 --- a/heatmap.js/heatmap.d.ts +++ b/heatmap.js/heatmap.d.ts @@ -15,28 +15,29 @@ interface HeatmapConfiguration { */ backgroundColor?: string; + /* + * The blur factor that will be applied to all datapoints. The higher the + * blur factor is, the smoother the gradients will be + * Default value: 0.85 + */ + blur?: number; + /* * An object that represents the gradient */ gradient?: any; /* - * The radius each datapoint will have (if not specified on the datapoint - * itself) + * The property name of your latitude coordinate in a datapoint + * Default value: 'x' */ - radius?: number; + latField?: string; /* - * Indicate whether the heatmap should use a global extrema or a local - * extrema (the maximum and minimum of the currently displayed viewport) + * The property name of your longitude coordinate in a datapoint + * Default value: 'y' */ - useLocalExtrema?: boolean; - - /* - * A global opacity for the whole heatmap. This overrides maxOpacity and - * minOpacity if set - */ - opacity?: number; + lngField?: string; /* * The maximal opacity the highest value in the heatmap will have. (will be @@ -52,26 +53,25 @@ interface HeatmapConfiguration { minOpacity?: number; /* - * The blur factor that will be applied to all datapoints. The higher the - * blur factor is, the smoother the gradients will be - * Default value: 0.85 + * A global opacity for the whole heatmap. This overrides maxOpacity and + * minOpacity if set */ - blur?: number; + opacity?: number; /* - * The property name of your latitude coordinate in a datapoint - * Default value: 'x' + * The radius each datapoint will have (if not specified on the datapoint + * itself) */ - latField?: string; + radius?: number; /* - * The property name of your longitude coordinate in a datapoint - * Default value: 'y' + * Indicate whether the heatmap should use a global extrema or a local + * extrema (the maximum and minimum of the currently displayed viewport) */ - lngField?: string; + useLocalExtrema?: boolean; /* - * The property name of your y coordinate in a datapoint + * The property name of the value/weight in a datapoint */ valueField: string; } @@ -81,28 +81,28 @@ interface HeatmapConfiguration { * HeatmapConfig.latField, HeatmapConfig.lngField and HeatmapConfig.valueField */ interface HeatmapDataPoint { - [index: string] : number; + [index: string]: number; } /* - * An object representing the set of data points on a heatmap. + * An object representing the set of data points on a heatmap */ -interface HeatmapDataObject { - - /* - * Max value of of the valueField - */ - max?: number; - - /* - * Min value of of the valueField - */ - min?: number; +interface HeatmapData { /* * An array of HeatmapDataPoints */ data: HeatmapDataPoint[]; + + /* + * Max value of the valueField + */ + max?: number; + + /* + * Min value of the valueField + */ + min?: number; } /* @@ -116,8 +116,8 @@ declare class HeatmapOverlay { constructor(configuration: HeatmapConfiguration) /* - * Create DOM elements for othe overlay, adding them to map panes and - * puts listeners on relevant map events + * Create DOM elements for an overlay, adding them to map panes and puts + * listeners on relevant map events */ onAdd(map: L.Map): void; @@ -130,5 +130,5 @@ declare class HeatmapOverlay { /* * Initialize a heatmap instance with the given dataset */ - setData(data: {}): void; + setData(data: HeatmapData): void; } From f8c4f8dfb1e6a38afefdce0d1caf949ed3b66e4b Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 3 Nov 2014 18:14:50 +0900 Subject: [PATCH 034/292] update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1081 ++++++++++++++++++++++++++++------------------- 1 file changed, 641 insertions(+), 440 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9d27a0d1d4..2b4c0083c0 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,443 +1,644 @@ # Contributors -This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url. +This document generated by [dt-contributors-generator](https://github.com/vvakame/dt-contributors-generator). +(but run scripts are manual operation. please wait :P) +* [:link:](accounting/accounting.d.ts) [accounting.js](http://josscrowcroft.github.io/accounting.js) by [Sergey Gerasimov](https://github.com/gerich-home) +* [:link:](ace/ace.d.ts) [Ace Ajax.org Cloud9 Editor](http://ace.ajax.org) by [Diullei Gomes](https://github.com/Diullei) +* [:link:](add2home/add2home.d.ts) [add2home](http://cubiq.org/add-to-home-screen) by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw) +* [:link:](alertify/alertify.d.ts) [alertify](http://fabien-d.github.io/alertify.js) by [John Jeffery](http://github.com/jjeffery) +* [:link:](amcharts/AmCharts.d.ts) [amCharts](http://www.amcharts.com) by [aleksey-bykov](https://github.com/aleksey-bykov) +* [:link:](amplifyjs/amplifyjs.d.ts) [AmplifyJs](http://amplifyjs.com) by [Jonas Eriksson](https://github.com/joeriks) +* [:link:](angular-file-upload/angular-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/angular-file-upload) by [John Reilly](https://github.com/johnnyreilly) +* [:link:](angularjs/angular.d.ts) [Angular JS](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) +* [:link:](angularjs/angular-animate.d.ts) [Angular JS (ngAnimate module)](http://angularjs.org) by [Michel Salib](https://github.com/michelsalib), [Adi Dahiya](https://github.com/adidahiya) +* [:link:](angularjs/angular-cookies.d.ts) [Angular JS (ngCookies module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) +* [:link:](angularjs/angular-mocks.d.ts) [Angular JS (ngMock, ngMockE2E module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) +* [:link:](angularjs/angular-resource.d.ts) [Angular JS (ngResource module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar), [Michael Jess](http://github.com/miffels) +* [:link:](angularjs/angular-route.d.ts) [Angular JS (ngRoute module)](http://angularjs.org) by [Jonathan Park](https://github.com/park9140) +* [:link:](angularjs/angular-sanitize.d.ts) [Angular JS (ngSanitize module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) +* [:link:](angular-ui/angular-ui-router.d.ts) [Angular JS (ui.router module)](https://github.com/angular-ui/ui-router) by [Michel Salib](https://github.com/michelsalib) +* [:link:](angular-protractor/angular-protractor.d.ts) [Angular Protractor](https://github.com/angular/protractor) by [Bill Armstrong](https://github.com/BillArmstrong) +* [:link:](angularjs/angular-scenario.d.ts) [Angular Scenario Testing](http://angularjs.org) by [RomanoLindano](https://github.com/RomanoLindano) +* [:link:](angular-translate/angular-translate.d.ts) [Angular Translate (pascalprecht.translate module)](https://github.com/PascalPrecht/angular-translate) by [Michel Salib](https://github.com/michelsalib) +* [:link:](angular-ui-bootstrap/angular-ui-bootstrap.d.ts) [Angular UI Bootstrap](https://github.com/angular-ui/bootstrap) by [Brian Surowiec](https://github.com/xt0rted) +* [:link:](angular-bootstrap-lightbox/angular-bootstrap-lightbox.d.ts) [angular-bootstrap-lightbox](https://github.com/compact/angular-bootstrap-lightbox) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](angular-hotkeys/angular-hotkeys.d.ts) [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) by [Jason Zhao](https://github.com/jlz27) +* [:link:](angular-http-auth/angular-http-auth.d.ts) [angular-http-auth](https://github.com/witoldsz/angular-http-auth) by [vvakame](https://github.com/vvakame) +* [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped) +* [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin Biegała](https://github.com/Biegal) +* [:link:](angular-agility/angular-agility.d.ts) [AngularAgility](https://github.com/AngularAgility/AngularAgility) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](angularfire/angularfire.d.ts) [AngularFire](http://angularfire.com) by [Dénes Harmath](http://github.com/thSoft) +* [:link:](angularLocalStorage/angularLocalStorage.d.ts) [AngularLocalStorage](https://github.com/agrublev/angularLocalStorage) by [Horiuchi_H](https://github.com/horiuchi) +* [:link:](ansicolors/ansicolors.d.ts) [ansicolors](https://github.com/thlorenz/ansicolors) by [rogierschouten](https://github.com/rogierschouten) +* [:link:](any-db/any-db.d.ts) [any-db](https://github.com/grncdr/node-any-db) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](any-db-transaction/any-db-transaction.d.ts) [any-db-transaction](https://github.com/grncdr/node-any-db-transaction) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](cordova/cordova.d.ts) [Apache Cordova](http://cordova.apache.org) by [Microsoft Open Technologies Inc.](http://msopentech.com) +* [:link:](appframework/appframework.d.ts) [AppFramework](http://app-framework-software.intel.com) by [kyo_ago](https://github.com/kyo-ago) +* [:link:](arbiter/Arbiter.d.ts) [Arbiter.js](http://arbiterjs.com) by [Arash Shakery](https://github.com/arash16) +* [:link:](asciify/asciify.d.ts) [asciify](https://www.npmjs.org/package/asciify) by [Alan Norbauer](http://alan.norbauer.com) +* [:link:](assert/assert.d.ts) [assert and power-assert](https://github.com/Jxck/assert) by [vvakame](https://github.com/vvakame) +* [:link:](assertion-error/assertion-error.d.ts) [assertion-error 1.0 0](https://github.com/chaijs/assertion-error) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](async/async.d.ts) [Async](https://github.com/caolan/async) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](atmosphere/atmosphere.d.ts) [Atmosphere](https://github.com/Atmosphere/atmosphere-javascript) by [Kai Toedter](https://github.com/toedter) +* [:link:](atom/atom.d.ts) [Atom](https://atom.io) by [vvakame](https://github.com/vvakame) +* [:link:](atpl/atpl.d.ts) [atpl](https://github.com/soywiz/atpl.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](auth0/auth0.d.ts) [Auth0.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) +* [:link:](auth0.widget/auth0.widget.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) +* [:link:](aws-sdk/aws-sdk.d.ts) [aws-sdk](https://github.com/aws/aws-sdk-js) by [midknight41](https://github.com/midknight41) +* [:link:](node-azure/azure.d.ts) [Azure SDK for Node -](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](backbone/backbone.d.ts) [Backbone](http://backbonejs.org) by [Boris Yankov](https://github.com/borisyankov), [Natan Vivo](https://github.com/nvivo) +* [:link:](backbone-relational/backbone-relational.d.ts) [Backbone-relational](http://backbonerelational.org) by [Eirik Hoem](https://github.com/eirikhm) +* [:link:](backgrid/backgrid.d.ts) [Backgrid](http://backgridjs.com) by [Jeremy Lujan](https://github.com/jlujan) +* [:link:](bcrypt/bcrypt.d.ts) [bcrypt](https://www.npmjs.org/package/bcrypt) by [Peter Harris](https://github.com/codeanimal) +* [:link:](bgiframe/typescript.bgiframe.d.ts) [bgiframe](https://github.com/sumegizoltan/BgiFrame) by [Zoltan Sumegi](https://github.com/sumegizoltan) +* [:link:](big.js/big.js.d.ts) [big.js](https://github.com/MikeMcl/big.js) by [Steve Ognibene](https://github.com/nycdotnet) +* [:link:](bigint/bigint.d.ts) [BigInt](https://github.com/Evgenus/BigInt) by [Eugene Chernyshov](https://github.com/Evgenus) +* [:link:](big-integer/big-integer.d.ts) [BigInteger.js](https://github.com/peterolson/BigInteger.js) by [Ingo Bürk](https://github.com/Airblader) +* [:link:](bigscreen/bigscreen.d.ts) [BigScreen](http://brad.is/coding/BigScreen) by [Douglas Eichelberger](https://github.com/dduugg) +* [:link:](bluebird/bluebird.d.ts) [bluebird](https://github.com/petkaantonov/bluebird) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](body-parser/body-parser.d.ts) [body-parser](http://expressjs.com) by [Santi Albo](https://github.com/santialbo), [VILIC VANE](https://vilic.info), [Jonathan Häberle](https://github.com/dreampulse) +* [:link:](bootbox/bootbox.d.ts) [Bootbox](https://github.com/makeusabrew/bootbox) by [Vincent Bortone](https://github.com/vbortone), [Kon Pik](https://github.com/konpikwastaken) +* [:link:](bootstrap/bootstrap.d.ts) [Bootstrap](http://twitter.github.com/bootstrap) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts) [Bootstrap datetimepicker v3](http://eonasdan.github.io/bootstrap-datetimepicker) by [Jesica N. Fera](https://github.com/bayitajesi) +* [:link:](bootstrap-notify/bootstrap-notify.d.ts) [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker) +* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker) +* [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin) +* [:link:](breeze/breeze.d.ts) [Breeze](http://www.breezejs.com) by [Boris Yankov](https://github.com/borisyankov), [IdeaBlade](https://github.com/IdeaBlade/Breeze) +* [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby) +* [:link:](browserify/browserify.d.ts) [Browserify](http://browserify.org) by [Andrew Gaspar](https://github.com/AndrewGaspar) +* [:link:](bucks/bucks.d.ts) [bucks.js](https://github.com/CyberAgent/bucks.js) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](buffer-equal/buffer-equal.d.ts) [buffer-equal 1.0 0](https://github.com/substack/node-buffer-equal) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](bl/bl.d.ts) [BufferList](https://github.com/rvagg/bl) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](bufferstream/bufferstream.d.ts) [bufferstream](https://github.com/dodo/node-bufferstream) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine -](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) +* [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com) +* [:link:](canvasjs/canvasjs.d.ts) [CanvasJS v1.5.1 GA](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5) +* [:link:](threejs/three-canvasrenderer.d.ts) [CanvasRenderer.js](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](casperjs/casperjs.d.ts) [CasperJS v1.0.0 API](http://casperjs.org) by [Jed Mao](https://github.com/jedmao) +* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Hunsaker](https://github.com/jedhunsaker), [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](chai-datetime/chai-datetime.d.ts) [chai-datetime](https://github.com/gaslight/chai-datetime.git) by [Cliff Burger](https://github.com/cliffburger) +* [:link:](chai-fuzzy/chai-fuzzy.d.ts) [chai-fuzzy 1.3.0 assert style](http://chaijs.com/plugins/chai-fuzzy) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](chai-jquery/chai-jquery.d.ts) [chai-jquery](https://github.com/chaijs/chai-jquery) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) +* [:link:](chalk/chalk.d.ts) [chalk](https://github.com/sindresorhus/chalk) by [Diullei Gomes](https://github.com/Diullei), [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](chartjs/chart.d.ts) [Chart.js](https://github.com/nnnick/Chart.js) by [Steve Fenton](https://github.com/Steve-Fenton) +* [:link:](devextreme/dx.chartjs.d.ts) [ChartJS](http://js.devexpress.com/WebDevelopment/Charts) by [DevExpress Inc.](http://devexpress.com) +* [:link:](checksum/checksum.d.ts) [checksum](https://github.com/dshaw/checksum) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](cheerio/cheerio.d.ts) [Cheerio](https://github.com/cheeriojs/cheerio) by [Bret Little](https://github.com/blittle), [VILIC VANE](http://vilic.info), [Wayne Maurer](https://github.com/wmaurer) +* [:link:](chosen/chosen.jquery.d.ts) [Chosen.JQuery](http://harvesthq.github.com/chosen) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](chroma-js/chroma-js.d.ts) [Chroma.js](https://github.com/gka/chroma.js) by [Sebastian Brückner](https://github.com/invliD) +* [:link:](chrome/chrome.d.ts) [Chrome extension development](http://developer.chrome.com/extensions) by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10) +* [:link:](chrome/chrome-app.d.ts) [Chrome packaged application development](http://developer.chrome.com/apps) by [Adam Lay](https://github.com/AdamLay), [MIZUNE Pine](https://github.com/pine613), [MIZUSHIMA Junki](https://github.com/mzsm) +* [:link:](ckeditor/ckeditor.d.ts) [CKEditor](http://ckeditor.com) by [Ondrej Sevcik](https://github.com/ondrejsevcik) +* [:link:](clone/clone.d.ts) [clone](https://github.com/pvorb/node-clone) by [Kieran Simpson](https://github.com/kierans/DefinitelyTyped) +* [:link:](codemirror/codemirror.d.ts) [CodeMirror](https://github.com/marijnh/CodeMirror) by [mihailik](https://github.com/mihailik) +* [:link:](colors/colors.d.ts) [Colors.js 0.6.0-1](https://github.com/Marak/colors.js) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](cometd/cometd.d.ts) [CometD](http://cometd.org) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](commander/commander.d.ts) [commanderjs](https://github.com/visionmedia/commander.js) by [Marcelo Dezem](http://github.com/mdezem), [vvakame](http://github.com/vvakame) +* [:link:](compression/compression.d.ts) [compression](https://github.com/expressjs/compression) by [Santi Albo](https://github.com/santialbo) +* [:link:](configstore/configstore.d.ts) [configstore](https://github.com/yeoman/configstore) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](consolidate/consolidate.d.ts) [consolidate](https://github.com/visionmedia/consolidate.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](convert-source-map/convert-source-map.d.ts) [convert-source-map](https://github.com/thlorenz/convert-source-map) by [Andrew Gaspar](https://github.com/AndrewGaspar) +* [:link:](cookie/cookie.d.ts) [cookie](https://github.com/jshttp/cookie) by [Pine Mizune](https://github.com/pine613) +* [:link:](cookie-parser/cookie-parser.d.ts) [cookie-parser](https://github.com/expressjs/cookie-parser) by [Santi Albo](https://github.com/santialbo) +* [:link:](threejs/three-copyshader.d.ts) [CopyShader.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/shaders/CopyShader.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](cordova-ionic/plugins/keyboard.d.ts) [Cordova Keyboard plugin](https://github.com/driftyco/ionic-plugins-keyboard) by [Hendrik Maus](https://github.com/hendrikmaus) +* [:link:](cordovarduino/cordovarduino.d.ts) [Cordovarduino plugin](https://github.com/stereolux/cordovarduino) by [Hendrik Maus](https://github.com/hendrikmaus) +* [:link:](couchbase/couchbase.d.ts) [Couchbase Couchnode](https://github.com/couchbase/couchnode) by [Basarat Ali Syed](https://github.com/basarat) +* [:link:](createjs/createjs.d.ts) [CreateJS](http://www.createjs.com) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist), [Satoru Kimura](https://github.com/gyohk) +* [:link:](crossfilter/crossfilter.d.ts) [CrossFilter](https://github.com/square/crossfilter) by [Schmulik Raskin](https://github.com/schmuli) +* [:link:](crossroads/crossroads.d.ts) [Crossroads.js](http://millermedeiros.github.io/crossroads.js) by [Diullei Gomes](https://github.com/diullei) +* [:link:](cryptojs/cryptojs.d.ts) [CryptoJS](https://code.google.com/p/crypto-js) by [Gia Bảo @ Sân Đình](https://github.com/giabao) +* [:link:](googlemaps.infobubble/google.maps.infobubble.d.ts) [CSS3 InfoBubble with tabs for Google Maps API V3](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/src) by [Johan Nilsson](https://github.com/Dashue) +* [:link:](threejs/three-css3drenderer.d.ts) [CSS3DRenderer.js](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CSS3DRenderer.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](csurf/csurf.d.ts) [csurf](https://www.npmjs.org/package/csurf) by [Hiroki Horiuchi](https://github.com/horiuchi) +* [:link:](md5/md5.d.ts) [CybozuLabs.MD5](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) by [MIZUNE Pine](https://github.com/pine613) +* [:link:](d3/d3.d.ts) [d3JS](http://d3js.org) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](dat-gui/dat-gui.d.ts) [dat.GUI](https://github.com/dataarts/dat.gui) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](date.format.js/date.format.d.ts) [Date Format](http://blog.stevenlevithan.com/archives/date-time-format) by [Rob Stutton](https://github.com/balrob) +* [:link:](datejs/datejs.d.ts) [DateJS](http://www.datejs.com) by [David Khristepher Santos](http://github.com/rupertavery) +* [:link:](dcjs/dc.d.ts) [DCJS](https://github.com/dc-js) by [hans windhoff](https://github.com/hansrwindhoff) +* [:link:](debug/debug.d.ts) [debug](https://github.com/visionmedia/debug) by [Seon-Wook Park](https://github.com/swook) +* [:link:](deep-diff/deep-diff.d.ts) [deep-diff](https://github.com/flitbit/diff) by [ZauberNerd](https://github.com/ZauberNerd) +* [:link:](deep-freeze/deep-freeze.d.ts) [deep-freeze](https://github.com/substack/deep-freeze) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](detect-indent/detect-indent.d.ts) [detect-indent](https://github.com/sindresorhus/detect-indent) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](threejs/detector.d.ts) [Detector.js](https://github.com/mrdoob/three.js/blob/master/examples/js/Detector.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](dhtmlxgantt/dhtmlxgantt.d.ts) [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) by [Maksim Kozhukh](http://github.com/mkozhukh) +* [:link:](dhtmlxscheduler/dhtmlxscheduler.d.ts) [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) by [Maksim Kozhukh](http://github.com/mkozhukh) +* [:link:](diff/diff.d.ts) [diff](https://github.com/kpdecker/jsdiff) by [vvakame](https://github.com/vvakame) +* [:link:](docCookies/docCookies.d.ts) [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) by [Jon Egerton](https://github.com/jonegerton) +* [:link:](dock-spawn/dock-spawn.d.ts) [Dock Spawn](http://dockspawn.com) by [Drew Noakes](https://drewnoakes.com) +* [:link:](dojo/dojo.d.ts) [Dojo](http://dojotoolkit.org) by [Michael Van Sickle](https://github.com/vansimke) +* [:link:](domo/domo.d.ts) [Domo](http://domo-js.com) by [Steve Fenton](https://github.com/Steve-Fenton) +* [:link:](domready/domready.d.ts) [domready](https://github.com/ded/domready) by [Christian Holm Nielsen](https://github.com/dotnetnerd) +* [:link:](dot/dot.d.ts) [doT](https://github.com/olado/doT) by [ZombieHunter](https://github.com/ZombieHunter) +* [:link:](dropboxjs/dropboxjs.d.ts) [dropbox-js](https://github.com/dropbox/dropbox-js) by [Steve Fenton](https://github.com/Steve-Fenton), [Pedro Casaubon](https://github.com/xperiments) +* [:link:](dropzone/dropzone.d.ts) [Dropzone](http://www.dropzonejs.com) by [Natan Vivo](https://github.com/nvivo) +* [:link:](durandal/durandal.d.ts) [Durandal](http://durandaljs.com) by [Blue Spire](https://github.com/BlueSpire) +* [:link:](easeljs/easeljs.d.ts) [EaselJS](http://www.createjs.com/#!/EaselJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist) +* [:link:](easy-table/easy-table.d.ts) [easy-table](https://github.com/eldargab/easy-table) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](easystarjs/easystarjs.d.ts) [EasyStar.js](http://easystarjs.com) by [Magnus Gustafsson](https://github.com/borundin) +* [:link:](threejs/three-effectcomposer.d.ts) [EffectComposer.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/EffectComposer.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan) +* [:link:](elm/elm.d.ts) [Elm](http://elm-lang.org) by [Dénes Harmath](https://github.com/thSoft) +* [:link:](ember/ember.d.ts) [Ember.js](http://emberjs.com) by [Jed Mao](https://github.com/jedmao) +* [:link:](emissary/emissary.d.ts) [emissary](https://github.com/atom/emissary) by [vvakame](https://github.com/vvakame) +* [:link:](emscripten/emscripten.d.ts) [Emscripten](http://kripken.github.io/emscripten-site/index.html) by [Kensuke Matsuzaki](https://github.com/zakki) +* [:link:](epiceditor/epiceditor.d.ts) [EpicEditor](http://epiceditor.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](errorhandler/errorhandler.d.ts) [errorhandler](https://github.com/expressjs/errorhandler) by [Santi Albo](https://github.com/santialbo) +* [:link:](es6-promise/es6-promise.d.ts) [es6-promise](https://github.com/jakearchibald/ES6-Promise) by [François de Campredon](https://github.com/fdecampredon) +* [:link:](esprima/esprima.d.ts) [Esprima](http://esprima.org) by [teppeis](https://github.com/teppeis) +* [:link:](eventemitter2/eventemitter2.d.ts) [EventEmitter2](https://github.com/asyncly/EventEmitter2) by [ryiwamoto](https://github.com/ryiwamoto) +* [:link:](exit/exit.d.ts) [exit](https://github.com/cowboy/node-exit) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](expect.js/expect.js.d.ts) [expect.js](https://github.com/LearnBoost/expect.js) by [Teppei Sato](https://github.com/teppeis) +* [:link:](expectations/expectations.d.ts) [expectations.js](https://github.com/spmason/expectations) by [vvakame](https://github.com/vvakame) +* [:link:](express/express.d.ts) [Express 4.x](http://expressjs.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](express-myconnection/express-myconnection.d.ts) [express-myconnection](https://www.npmjs.org/package/express-myconnection) by [Michael Ferris](https://github.com/Cellule) +* [:link:](express-session/express-session.d.ts) [express-session](https://www.npmjs.org/package/express-session) by [Hiroki Horiuchi](https://github.com/horiuchi) +* [:link:](express-validator/express-validator.d.ts) [express-validator](https://github.com/ctavan/express-validator) by [Nathan Ridley](https://github.com/axefrog), [Jonathan Häberle](http://dreampulse.de) +* [:link:](extjs/ExtJS.d.ts) [ExtJS](http://www.sencha.com/products/extjs) by [Brian Kotek](https://github.com/brian428) +* [:link:](fabricjs/fabricjs.d.ts) [FabricJS](http://fabricjs.com) by [Oliver Klemencic](https://github.com/oklemencic) +* [:link:](fbsdk/fbsdk.d.ts) [Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Joshua Strobl](https://github.com/JoshStrobl) +* [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](fastclick/fastclick.d.ts) [FastClick](https://github.com/ftlabs/fastclick) by [Shinnosuke Watanabe](https://github.com/shinnn) +* [:link:](fibers/fibers.d.ts) [fibers](https://github.com/laverdet/node-fibers) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](filewriter/filewriter.d.ts) [File API: Writer](http://www.w3.org/TR/file-writer-api) by [Kon](http://phyzkit.net) +* [:link:](filesystem/filesystem.d.ts) [File System API](http://www.w3.org/TR/file-system-api) by [Kon](http://phyzkit.net) +* [:link:](Finch/Finch.d.ts) [Finch](https://github.com/stoodder/finchjs) by [David Sichau](https://github.com/DavidSichau) +* [:link:](findup-sync/findup-sync.d.ts) [findup-sync](https://github.com/cowboy/node-findup-sync) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](fingerprintjs/fingerprint.d.ts) [fingerprintjs](https://github.com/Valve/fingerprintjs) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](state-machine/state-machine.d.ts) [Finite State Machine](https://github.com/jakesgordon/javascript-state-machine) by [Boris Yankov](https://github.com/borisyankov), [Maarten Docter](https://github.com/mdocter), [William Sears](https://github.com/MrBigDog2U) +* [:link:](firebase/firebase.d.ts) [Firebase API](https://www.firebase.com/docs/javascript/firebase) by [Vincent Botone](https://github.com/vbortone) +* [:link:](firebase/firebase-simplelogin.d.ts) [Firebase Simple Login](https://www.firebase.com/docs/security/simple-login-overview.html) by [Wilker Lucio](http://github.com/wilkerlucio) +* [:link:](flexSlider/flexSlider.d.ts) [FlexSlider 2 jquery plugin](https://github.com/woothemes/FlexSlider) by [Diullei Gomes](https://github.com/diullei) +* [:link:](flight/flight.d.ts) [Flight](http://flightjs.github.com/flight) by [Jonathan Hedrén](https://github.com/jonathanhedren) +* [:link:](flipsnap/flipsnap.d.ts) [flipsnap.js](http://pxgrid.github.io/js-flipsnap) by [kubosho](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki) +* [:link:](flot/jquery.flot.d.ts) [Flot](http://www.flotcharts.org) by [Matt Burland](https://github.com/burlandm) +* [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Douglas Eichelberger](https://github.com/dduugg) +* [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](fpsmeter/FPSMeter.d.ts) [FPSmeter](http://darsa.in/fpsmeter) by [Aaron Lampros](http://github.com/alampros) +* [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](fs-extra/fs-extra.d.ts) [fs-extra](https://github.com/jprichardson/node-fs-extra) by [midknight41](https://github.com/midknight41) +* [:link:](ftdomdelegate/ftdomdelegate.d.ts) [ftdomdelegate](https://github.com/ftlabs/ftdomdelegate) by [Christian Holm Nielsen](https://github.com/dotnetnerd) +* [:link:](fullCalendar/fullCalendar.d.ts) [FullCalendar](http://arshaw.com/fullcalendar) by [Neil Stalker](https://github.com/nestalk) +* [:link:](fuse/fuse.d.ts) [Fuse.js](https://github.com/krisk/Fuse) by [Greg Smith](https://github.com/smrq) +* [:link:](gamepad/gamepad.d.ts) [Gamepad API](http://www.w3.org/TR/gamepad) by [Kon](http://phyzkit.net) +* [:link:](gamequery/gamequery.d.ts) [gameQuery](http://gamequeryjs.com) by [David Laubreiter](https://github.com/Laubi) +* [:link:](gently/gently.d.ts) [gently](https://www.npmjs.org/package/gently) by [bonnici](https://github.com/bonnici) +* [:link:](geojson/geojson.d.ts) [GeoJSON Format Specification](http://geojson.org) by [Jacob Bruun](https://github.com/cobster) +* [:link:](giraffe/giraffe.d.ts) [Giraffe](https://github.com/barc/backbone.giraffe) by [Matt McCray](https://github.com/darthapo) +* [:link:](gldatepicker/gldatepicker.d.ts) [glDatePicker](http://glad.github.com/glDatePicker) by [Dániel Tar](https://github.com/qcz) +* [:link:](glob/glob.d.ts) [Glob](https://github.com/isaacs/node-glob) by [vvakame](https://github.com/vvakame) +* [:link:](glob-stream/glob-stream.d.ts) [glob-stream](http://github.com/wearefractal/glob-stream) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](globalize/globalize.d.ts) [Globalize](https://github.com/jquery/globalize) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](goJS/goJS.d.ts) [GoJS](http://gojs.net) by [Barbara Duckworth](https://github.com/barbara42) +* [:link:](google.analytics/ga.d.ts) [Google Analytics (Classic and Universal)](https://developers.google.com/analytics/devguides/collection/gajs) by [Ronnie Haakon Hegelund](http://ronniehegelund.blogspot.dk), [Pat Kujawa](http://patkujawa.com) +* [:link:](gapi/gapi.d.ts) [Google API Client](https://code.google.com/p/google-api-javascript-client) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](google.feeds/google.feed.api.d.ts) [Google Feed Apis](https://developers.google.com/feed) by [RodneyJT](https://github.com/RodneyJT) +* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](googlemaps/google.maps.d.ts) [Google Geolocation](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk) +* [:link:](gapi.pagespeedonline/gapi.pagespeedonline.d.ts) [Google Page Speed Online Api](https://developers.google.com/speed/pagespeed) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73) +* [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](gapi.urlshortener/gapi.urlshortener.d.ts) [Google Url Shortener API](https://developers.google.com/url-shortener) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](google.visualization/google.visualization.d.ts) [Google Visualisation Apis](https://developers.google.com/chart) by [Dan Ludwig](https://github.com/danludwig) +* [:link:](gae.channel.api/gae.channel.api.d.ts) [GoogleAppEngine's Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) by [vvakame](https://github.com/vvakame) +* [:link:](graceful-fs/graceful-fs.d.ts) [graceful-fs](https://github.com/cowboy/graceful-fs) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](greasemonkey/greasemonkey.d.ts) [Greasemonkey](http://www.greasespot.net) by [Kota Saito](https://github.com/kotas) +* [:link:](greensock/greensock.d.ts) [GreenSock Animation Platform](http://www.greensock.com/get-started-js) by [Robert S](https://github.com/codebelt) +* [:link:](gridfs-stream/gridfs-stream.d.ts) [gridfs-stream](https://github.com/aheckmann/gridfs-stream) by [Lior Mualem](https://github.com/liorm) +* [:link:](gruntjs/gruntjs.d.ts) [Grunt 0.4.x](http://gruntjs.com) by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat) +* [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com) +* [:link:](gulp-util/gulp-util.d.ts) [gulp-util v3.0.x](https://github.com/gulpjs/gulp-util) by [jedmao](https://github.com/jedmao) +* [:link:](hammerjs/hammerjs.d.ts) [Hammer.js](http://eightmedia.github.com/hammer.js) by [Boris Yankov](https://github.com/borisyankov), [Drew Noakes](https://drewnoakes.com) +* [:link:](handlebars/handlebars.d.ts) [Handlebars](http://handlebarsjs.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](hapi/hapi.d.ts) [hapi](http://github.com/spumko/hapi) by [Hakubo](http://github.com/hakubo) +* [:link:](hashmap/hashmap.d.ts) [HashMap](https://github.com/flesler/hashmap) by [Rafał Wrzeszcz](http://wrzasq.pl) +* [:link:](hellojs/hellojs.d.ts) [hello.js](http://adodson.com/hello.js) by [Pavel Zika](https://github.com/PavelPZ) +* [:link:](highcharts/highcharts.d.ts) [Highcharts](http://www.highcharts.com) by [Damiano Gambarotto](http://github.com/damianog) +* [:link:](highland/highland.d.ts) [Highland](http://highlandjs.org) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](highlightjs/highlightjs.d.ts) [highlight.js](https://github.com/isagalaev/highlight.js) by [Niklas Mollenhauer](https://github.com/nikeee), [Jeremy Hull](https://github.com/sourrust) +* [:link:](history/history.d.ts) [History.js](https://github.com/browserstate/history.js) by [Boris Yankov](https://github.com/borisyankov), [Gidon Junge](https://github.com/gjunge) +* [:link:](howlerjs/howler.d.ts) [howler.js](https://github.com/goldfire/howler.js) by [Pedro Casaubon](https://github.com/xperiments) +* [:link:](html2canvas/html2canvas.d.ts) [html2canvas.js](https://github.com/niklasvh/html2canvas) by [Richard Hepburn](https://github.com/rwhepburn) +* [:link:](htmlparser2/htmlparser2.d.ts) [htmlparser2 v3.7.x](https://github.com/fb55/htmlparser2) by [James Roland Cabresos](https://github.com/staticfunction) +* [:link:](http-string-parser/http-string-parser.d.ts) [http-string-parser](https://github.com/apiaryio/http-string-parser) by [MIZUNE Pine](https://github.com/pine613) +* [:link:](humane/humane.d.ts) [Humane](http://wavded.github.com/humane-js) by [jmvrbanac](https://github.com/jmvrbanac) +* [:link:](i18n-node/i18n-node.d.ts) [i18n-node](https://github.com/mashpie/i18n-node) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Maarten Docter](https://github.com/mdocter) +* [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz) +* [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](impress/impress.d.ts) [Impress.js](https://github.com/bartaz/impress.js) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](inflection/inflection.d.ts) [inflection](https://github.com/dreamerslab/node.inflection) by [Shogo Iwano](https://github.com/shiwano) +* [:link:](insight/insight.d.ts) [insight](https://github.com/yeoman/insight) by [vvakame](http://github.com/vvakame) +* [:link:](interactjs/interact.d.ts) [Interacting for interact.js](https://github.com/taye/interact.js) by [Douglas Eichelberger](https://github.com/dduugg), [Adi Dahiya](https://github.com/adidahiya) +* [:link:](intercomjs/intercom.d.ts) [intercom.js](https://github.com/diy/intercom.js) by [spencerwi](http://github.com/spencerwi) +* [:link:](cordova-ionic/cordova-ionic.d.ts) [Ionic Cordova plugins](https://github.com/driftyco) by [Hendrik Maus](https://github.com/hendrikmaus) +* [:link:](iscroll/iscroll.d.ts) [iScroll](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](iscroll/iscroll-5.d.ts) [iScroll 5](http://cubiq.org/iscroll-5-ready-for-beta-test) by [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](iscroll/iscroll-lite.d.ts) [iScroll Lite](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](iscroll/iscroll-5-lite.d.ts) [iScroll Lite 5](http://cubiq.org/iscroll-5-ready-for-beta-test) by [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](ix.js/ix.d.ts) [IxJS 1.0.6 / ix.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](ix.js/l2o.d.ts) [IxJS 1.0.6 / l2o.js](https://github.com/Reactive-Extensions/IxJS) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](jake/jake.d.ts) [jake](https://github.com/mde/jake) by [Kon](http://phyzkit.net) +* [:link:](jasmine/jasmine.d.ts) [Jasmine](http://pivotal.github.com/jasmine) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) +* [:link:](jasmine-data_driven_tests/jasmine-data_driven_tests.d.ts) [Jasmine Data Driven Tests](https://github.com/gburghardt/jasmine-data_driven_tests) by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon) +* [:link:](jasmine-fixture/jasmine-fixture.d.ts) [Jasmine-fixture](https://github.com/searls/jasmine-fixture) by [Craig Brett](https://github.com/craigbrett17) +* [:link:](jasmine-jquery/jasmine-jquery.d.ts) [Jasmine-JQuery](https://github.com/velesin/jasmine-jquery) by [Gregor Stamac](https://github.com/gstamac) +* [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers v0.2.1 API](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jdataview/jdataview.d.ts) [jDataView](https://github.com/jDataView/jDataView) by [Ingvar Stepanyan](https://github.com/RReverser) +* [:link:](jest/jest.d.ts) [Jest](http://facebook.github.io/jest) by [Asana](https://asana.com) +* [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jointjs/jointjs.d.ts) [Joint JS](http://www.jointjs.com) by [Aidan Reel](http://github.com/areel), [David Durman](http://github.com/DavidDurman) +* [:link:](jqrangeslider/jqrangeslider.d.ts) [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) by [Dániel Tar](https://github.com/qcz) +* [:link:](jquery/jquery.d.ts) [jQuery 1.10.x / 2.0.x](http://jquery.com) by [Boris Yankov](https://github.com/borisyankov), [Christian Hoffmeister](https://github.com/choffmeister), [Steve Fenton](https://github.com/Steve-Fenton), [Diullei Gomes](https://github.com/Diullei), [Tass Iliopoulos](https://github.com/tasoili), [Jason Swearingen](https://github.com/jasons-novaleaf), [Sean Hill](https://github.com/seanski), [Guus Goossens](https://github.com/Guuz), [Kelly Summerlin](https://github.com/ksummerlin), [Basarat Ali Syed](https://github.com/basarat), [Nicholas Wolverson](https://github.com/nwolverson), [Derek Cicerone](https://github.com/derekcicerone), [Andrew Gaspar](https://github.com/AndrewGaspar), [James Harrison Fisher](https://github.com/jameshfisher), [Seikichi Kondo](https://github.com/seikichi), [Benjamin Jackman](https://github.com/benjaminjackman), [Poul Sorensen](https://github.com/s093294), [Josh Strobl](https://github.com/JoshStrobl), [John Reilly](https://github.com/johnnyreilly), [Dick van den Brink](https://github.com/DickvdBrink) +* [:link:](jquery.blockUI/jquery.blockUI.d.ts) [jQuery BlockUI Plugin](http://malsup.com/jquery/block) by [Jeffrey Lee](http://blog.darkthread.net) +* [:link:](jquery.cleditor/jquery.cleditor.d.ts) [jQuery CLEditor Plugin](http://premiumsoftware.net/CLEditor) by [Jeffery Grajkowski](https://github.com/pushplay) +* [:link:](jquery.colorpicker/jquery.colorpicker.d.ts) [jQuery Colorpicker Plugin](https://github.com/vanderlee/colorpicker) by [Jeffery Grajkowski](https://github.com/pushplay) +* [:link:](jquery.contextMenu/jquery.contextMenu.d.ts) [jQuery contextMenu](http://medialize.github.com/jQuery-contextMenu) by [Natan Vivo](https://github.com/nvivo) +* [:link:](jquery.cookie/jquery.cookie.d.ts) [jQuery Cookie Plugin](https://github.com/carhartl/jquery-cookie) by [Roy Goode](https://github.com/RoyGoode) +* [:link:](jquery.cycle2/jquery.cycle2.d.ts) [jQuery Cycle2 version (build 20140216)](http://jquery.malsup.com/cycle2) by [Donny Nadolny](https://github.com/dnadolny) +* [:link:](jquery.dataTables/jquery.dataTables.d.ts) [JQuery DataTables](http://www.datatables.net) by [Armin Sander](https://github.com/pragmatrix) +* [:link:](jquery.fileupload/jquery.fileupload.d.ts) [jQuery File Upload Plugin](https://github.com/blueimp/jQuery-File-Upload) by [Rob Alarcon](https://github.com/rob-alarcon) +* [:link:](jquery.joyride/jquery.joyride.d.ts) [jQuery JoyRide Plugin](https://github.com/zurb/joyride) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](jquerymobile/jquerymobile.d.ts) [jQuery Mobile](http://jquerymobile.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](jquery.notifyBar/jquery.notifyBar.d.ts) [jQuery Notify Bar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](jquery.base64/jquery.base64.d.ts) [jQuery Plugin - base64 codec](https://github.com/yatt/jquery.base64) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki) +* [:link:](jquery.postMessage/jquery.postMessage.d.ts) [jQuery postMessage](http://benalman.com/projects/jquery-postmessage-plugin) by [Junle Li](https://github.com/lijunle) +* [:link:](jquery.prettyphoto/jquery.prettyphoto.d.ts) [jQuery prettyPhoto](https://github.com/scaron/prettyphoto) by [pgaske](https://github.com/pgaske) +* [:link:](royalslider/royalslider.d.ts) [jQuery royal-slider](http://dimsemenov.com/plugins/royal-slider/documentation) by [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](jquery.simplePagination/jquery.simplePagination.d.ts) [jQuery simplePagination.js](https://github.com/flaviusmatis/simplePagination.js) by [Natan Vivo](https://github.com/nvivo) +* [:link:](jquery.tagsmanager/jquery.tagsmanager.d.ts) [jQuery Tags Manager](http://welldonethings.com/tags/manager) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](jquery.tinycarousel/jquery.tinycarousel.d.ts) [jQuery tinycarousel](http://baijs.nl/tinycarousel) by [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](jquery.tinyscrollbar/jquery.tinyscrollbar.d.ts) [jQuery tinyscrollbar](http://baijs.nl/tinyscrollbar) by [Christiaan Rakowski](https://github.com/csrakowski) +* [:link:](jquery.tooltipster/jquery.tooltipster.d.ts) [jQuery Tooltipster](https://github.com/iamceege/tooltipster) by [Patrick Magee](https://github.com/pjmagee) +* [:link:](jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts) [jQuery UI DateTimePicker](http://trentrichardson.com/examples/timepicker) by [dougajmcdonald](https://github.com/dougajmcdonald) +* [:link:](jquery.timepicker/jquery.timepicker.d.ts) [jQuery UI Timepicker](http://fgelinas.com/code/timepicker) by [Anwar Javed](https://github.com/anwarjaved) +* [:link:](jquery-handsontable/jquery-handsontable.d.ts) [jquery-handsontable](http://handsontable.com) by [Ted John](https://github.com/intelorca) +* [:link:](jquery.menuaim/jquery.menuaim.d.ts) [jQuery-menu-aim](https://github.com/kamens/jQuery-menu-aim) by [Robert Fonseca-Ensor](http://www.robfe.com) +* [:link:](jquery.pjax/jquery.pjax.d.ts) [jquery-pjax](https://github.com/defunkt/jquery-pjax) by [Junle Li](https://github.com/lijunle) +* [:link:](jquery.address/jquery.address.d.ts) [jQuery.Address](https://github.com/asual/jquery-address) by [Martin Duparc](https://github.com/martinduparc), [Tim Klingeleers](https://github.com/mardaneus86) +* [:link:](jquery.are-you-sure/jquery.are-you-sure.d.ts) [jquery.are-you-sure.js](https://github.com/codedance/jquery.AreYouSure) by [Jon Egerton](https://github.com/jonegerton) +* [:link:](jquery.autosize/jquery.autosize.d.ts) [jquery.autosize (un-versioned)](http://www.jacklmoore.com/autosize) by [Aaron T. King](https://github.com/kingdango) +* [:link:](jquery.bbq/jquery.bbq.d.ts) [jquery.bbq](http://benalman.com/projects/jquery-bbq-plugin) by [Adam R. Smith](https://github.com/sunetos) +* [:link:](jquery.clientSideLogging/jquery.clientSideLogging.d.ts) [jquery.clientSideLogging](https://github.com/remybach/jQuery.clientSideLogging) by [Diullei Gomes](https://github.com/diullei) +* [:link:](jquery.color/jquery.color.d.ts) [jquery.color.js](https://github.com/jquery/jquery-color) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](jquery.colorbox/jquery.colorbox.d.ts) [jQuery.Colorbox](http://www.jacklmoore.com/colorbox) by [Gidon Junge](https://github.com/gjunge) +* [:link:](jquery.customSelect/jquery.customSelect.d.ts) [jquery.customSelect.js](http://adam.co/lab/jquery/customselect/) by [adamcoulombe](https://github.com/adamcoulombe) +* [:link:](jquery.cycle/jquery.cycle.d.ts) [jQuery.cycle.js](http://jquery.malsup.com/cycle) by [François Guillot](http://fguillot.developpez.com) +* [:link:](jquery.dynatree/jquery.dynatree.d.ts) [jquery.dynatree](http://code.google.com/p/dynatree) by [François de Campredon](https://github.com/fdecampredon) +* [:link:](jquery.finger/jquery.finger.d.ts) [jquery.finger.js](http://ngryman.sh/jquery.finger) by [Max Ackley](https://github.com/maxackley) +* [:link:](jquery.form/jquery.form.d.ts) [jQuery.form.js 3.26.0](http://malsup.com/jquery/form) by [François Guillot](http://fguillot.developpez.com) +* [:link:](jquery.gridster/gridster.d.ts) [jQuery.gridster](https://github.com/jbaldwin/gridster) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](jquery.jnotify/jquery.jnotify.d.ts) [jQuery.jNotify](http://jnotify.codeplex.com) by [James Curran](https://github.com/jamescurran) +* [:link:](jquery.jsignature/jquery.jsignature.d.ts) [jQuery.jsignature v2](https://github.com/willowsystems/jSignature) by [Patrick Magee](https://github.com/pjmagee) +* [:link:](jquery.noty/jquery.noty.d.ts) [jQuery.noty](http://needim.github.io/noty) by [Aaron King](https://github.com/kingdango) +* [:link:](jquery.payment/jquery.payment.d.ts) [jQuery.payment](https://github.com/stripe/jquery.payment) by [Eric J. Smith](https://github.com/ejsmith) +* [:link:](jquery.pjax.falsandtru/jquery.pjax.d.ts) [jquery.pjax.ts by falsandtru](https://github.com/falsandtru/jquery.pjax.js) by [新ゝ月 NewNotMoon](http://new.not-moon.net) +* [:link:](jquery.placeholder/jquery.placeholder.d.ts) [jquery.placeholder.js](https://github.com/mathiasbynens/jquery-placeholder) by [Peter Gill](https://github.com/majorsilence) +* [:link:](jquery.pnotify/jquery.pnotify.d.ts) [jquery.pnotify](https://github.com/sciactive/pnotify) by [David Sichau](https://github.com/DavidSichau) +* [:link:](jquery.scrollTo/jquery.scrollTo.d.ts) [jQuery.scrollTo.js](https://github.com/flesler/jquery.scrollTo) by [Neil Stalker](https://github.com/nestalk) +* [:link:](jquery.simulate/jquery.simulate.d.ts) [jquery.simulate.js](https://github.com/jquery/jquery-simulate) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](jquery.sortElements/jquery.sortElement.d.ts) [jQuery.sortElements](http://james.padolsey.com/javascript/sorting-elements-with-jquery) by [Tim Bureck](https://github.com/tbureck) +* [:link:](jquery.superLink/jquery.superLink.d.ts) [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](jquery.tile/jquery.tile.d.ts) [jquery.tile.js](https://github.com/urin/jquery.tile.js) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](jquery.timeago/jquery.timeago.d.ts) [jQuery.timeago.js](http://timeago.yarp.com) by [François Guillot](http://fguillot.developpez.com) +* [:link:](jquery.transit/jquery.transit.d.ts) [jQuery.transit.js](http://ricostacruz.com/jquery.transit) by [MrBigDog2U](https://github.com/MrBigDog2U) +* [:link:](jquery.validation/jquery.validation.d.ts) [jquery.validation](http://jqueryvalidation.org) by [François de Campredon](https://github.com/fdecampredon), [Johj Reilly](https://github.com/johnnyreilly) +* [:link:](jquery.timer/jquery.timer.d.ts) [jQueryTimer](https://github.com/jchavannes/jquery-timer) by [Joshua Strobl](https://github.com/JoshStrobl) +* [:link:](jquery.total-storage/jquery.total-storage.d.ts) [jQueryTotalStorage](https://github.com/Upstatement/jquery-total-storage) by [Jeremy Brooks](https://github.com/JeremyCBrooks) +* [:link:](jquery.ui.layout/jquery.ui.layout.d.ts) [jQueryUI](http://layout.jquery-dev.net) by [Steve Fenton](https://github.com/Steve-Fenton) +* [:link:](jqueryui/jqueryui.d.ts) [jQueryUI](http://jqueryui.com) by [Boris Yankov](https://github.com/borisyankov), [John Reilly](https://github.com/johnnyreilly) +* [:link:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) +* [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](js-signals/js-signals.d.ts) [JS-Signals](http://millermedeiros.github.io/js-signals) by [Diullei Gomes](https://github.com/diullei) +* [:link:](js-yaml/js-yaml.d.ts) [js-yaml](https://github.com/nodeca/js-yaml) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jsbn/jsbn.d.ts) [jsbn](http://www-cs-students.stanford.edu/%7Etjw/jsbn) by [Eugene Chernyshov](https://github.com/Evgenus) +* [:link:](jscrollpane/jscrollpane.d.ts) [jScrollPane](http://jscrollpane.kelvinluck.com) by [Dániel Tar](https://github.com/qcz) +* [:link:](jsdeferred/jsdeferred.d.ts) [JSDeferred](https://github.com/cho45/jsdeferred) by [Daisuke Mino](https://github.com/minodisk) +* [:link:](jsesc/jsesc.d.ts) [jsesc](https://github.com/mathiasbynens/jsesc) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jsfl/jsfl.d.ts) [JSFL](https://adobe.com) by [soywiz](https://github.com/soywiz) +* [:link:](hashset/hashset.d.ts) [jshashset](http://www.timdown.co.uk/jshashtable/jshashset.html) by [Sergey Gerasimov](https://github.com/gerich-home) +* [:link:](hashtable/hashtable.d.ts) [jshashtable](http://www.timdown.co.uk/jshashtable) by [Sergey Gerasimov](https://github.com/gerich-home) +* [:link:](json-pointer/json-pointer.d.ts) [json-pointer 1.0 l](https://www.npmjs.org/package/json-pointer) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jsoneditoronline/jsoneditoronline.d.ts) [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](JSONStream/JSONStream.d.ts) [JSONStream](http://github.com/dominictarr/JSONStream) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jsonwebtoken/jsonwebtoken.d.ts) [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](jsplumb/jquery.jsPlumb.d.ts) [jsPlumb 1.3.16 jQuery adapter](http://jsplumb.org) by [Steve Shearn](https://github.com/shearnie) +* [:link:](jsrender/jsrender.d.ts) [JsRender](http://www.jsviews.com/#jsrender) by [Kensuke Matsuzaki](https://github.com/zakki) +* [:link:](jstorage/jstorage.d.ts) [jStorage](http://www.jstorage.info) by [Danil Flores](https://github.com/dflor003) +* [:link:](jstree/jstree.d.ts) [jsTree](http://www.jstree.com) by [Adam Pluciński](https://github.com/adaskothebeast) +* [:link:](jszip/jszip.d.ts) [JSZip](http://stuk.github.com/jszip) by [mzeiher](https://github.com/mzeiher) +* [:link:](jwplayer/jwplayer.d.ts) [JW Player](http://developer.longtailvideo.com/trac) by [Martin Duparc](https://github.com/martinduparc) +* [:link:](karma-jasmine/karma-jasmine.d.ts) [karma-jasmine plugin](https://github.com/karma-runner/karma-jasmine) by [Michel Salib](https://github.com/michelsalib) +* [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509) +* [:link:](keypress/keypress.d.ts) [Keypress](https://github.com/dmauro/Keypress) by [Roger Chen](https://github.com/rcchen) +* [:link:](kineticjs/kineticjs.d.ts) [KineticJS](http://kineticjs.com) by [Basarat Ali Syed](http://www.github.com/basarat), [Ralph de Ruijter](http://www.superdopey.nl/techblog) +* [:link:](knockback/knockback.d.ts) [Knockback.js](http://kmalakoff.github.io/knockback) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](knockout/knockout.d.ts) [Knockout](http://knockoutjs.com) by [Boris Yankov](https://github.com/borisyankov), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](knockout.deferred.updates/knockout.deferred.updates.d.ts) [Knockout Deferred Updates](https://github.com/mbest/knockout-deferred-updates) by [Sebastián Galiano](https://github.com/sgaliano) +* [:link:](knockout.validation/knockout.validation.d.ts) [Knockout Validation](https://github.com/ericmbarnard/Knockout-Validation) by [Dan Ludwig](https://github.com/danludwig) +* [:link:](knockout.viewmodel/knockout.viewmodel.d.ts) [Knockout Viewmodel](http://coderenaissance.github.com/knockout.viewmodel) by [Oisin Grehan](https://github.com/oising) +* [:link:](knockout.amd.helpers/knockout-amd-helpers.d.ts) [knockout-amd-helpers](https://github.com/rniemeyer/knockout-amd-helpers) by [David Sichau](https://github.com/DavidSichau) +* [:link:](knockout.editables/ko.editables.d.ts) [knockout-editables](http://romanych.github.com/ko.editables) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](knockout.es5/knockout.es5.d.ts) [Knockout-ES5](https://github.com/SteveSanderson/knockout-es5) by [Sebastián Galiano](https://github.com/sgaliano) +* [:link:](knockout.postbox/knockout-postbox.d.ts) [knockout-postbox](https://github.com/rniemeyer/knockout-postbox) by [Judah Gabriel Himango](https://debuggerdotbreak.wordpress.com) +* [:link:](knockout.projections/knockout.projections.d.ts) [knockout-projections](https://github.com/stevesanderson/knockout-projections) by [John Reilly](https://github.com/johnnyreilly) +* [:link:](knockout-secure-binding/knockout-secure-binding.d.ts) [knockout-secure-binding](https://github.com/brianmhunt/knockout-secure-binding) by [Pine Mizune](https://github.com/pine613) +* [:link:](knockout.mapper/knockout.mapper.d.ts) [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) by [Brandon Meyer](https://github.com/BMeyerKC) +* [:link:](knockout.mapping/knockout.mapping.d.ts) [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](knockout.rx/knockout.rx.d.ts) [knockout.rx](https://github.com/Igorbek/knockout.rx) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](knockstrap/knockstrap.d.ts) [Knockstrap](http://faulknercs.github.io/Knockstrap) by [Adam Pluciński](https://github.com/adaskothebeast) +* [:link:](knockout.kogrid/ko-grid.d.ts) [ko-grid](http://knockout-contrib.github.io/KoGrid) by [huer12](https://github.com/huer12) +* [:link:](kolite/kolite.d.ts) [KoLite](https://github.com/CodeSeven/kolite) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](ladda/ladda.d.ts) [Ladda](https://github.com/hakimel/Ladda) by [Danil Flores](https://github.com/dflor003) +* [:link:](lazy.js/lazy.js.d.ts) [Lazy.js](https://github.com/dtao/lazy.js) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](leaflet/leaflet.d.ts) [Leaflet.js](https://github.com/Leaflet/Leaflet) by [Vladimir Zotov](https://github.com/rgripper) +* [:link:](jquery.leanModal/jquery.leanModal.d.ts) [leanModal.js](http://leanmodal.finelysliced.com.au) by [FinelySliced](https://github.com/FinelySliced) +* [:link:](leapmotionTS/LeapMotionTS.d.ts) [Leap Motion TS](https://github.com/logotype/LeapMotionTS) by [Victor Norgren](https://github.com/logotype) +* [:link:](less/less.d.ts) [LESS](http://lesscss.org) by [AndrewGaspar](https://github.com/AndrewGaspar) +* [:link:](levelup/levelup.d.ts) [LevelUp](https://github.com/rvagg/node-levelup) by [Bret Little](https://github.com/blittle) +* [:link:](libxmljs/libxmljs.d.ts) [Libxmljs](https://github.com/polotek/libxmljs) by [François de Campredon](https://github.com/fdecampredon) +* [:link:](dustjs-linkedin/dustjs-linkedin.d.ts) [linkedin dustjs](https://github.com/linkedin/dustjs) by [Marcelo Dezem](http://github.com/mdezem) +* [:link:](linq/linq.jquery.d.ts) [linq.jquery (from linq.js)](http://linqjs.codeplex.com) by [neuecc](http://www.codeplex.com/site/users/view/neuecc) +* [:link:](linq/linq.d.ts) [linq.js](http://linqjs.codeplex.com) by [Marcin Najder](https://github.com/marcinnajder) +* [:link:](jquery.livestampjs/jquery.livestampjs.d.ts) [Livestamp.js](http://mattbradley.github.com/livestampjs) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](lodash/lodash.d.ts) [Lo-Dash](http://lodash.com) by [Brian Zengel](https://github.com/bczengel) +* [:link:](lockfile/lockfile.d.ts) [lockfile](https://github.com/isaacs/lockfile) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](logg/logg.d.ts) [logg](https://github.com/dpup/node-logg) by [Bret Little](https://github.com/blittle) +* [:link:](long/long.d.ts) [Long.js](https://github.com/dcodeIO/Long.js) by [Toshihide Hara](https://github.com/kerug) +* [:link:](lru-cache/lru-cache.d.ts) [lru-cache](https://github.com/isaacs/node-lru-cache) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](lunr/lunr.d.ts) [lunr.js](https://github.com/olivernn/lunr.js) by [Sebastian Lenz](https://github.com/sebastian-lenz) +* [:link:](lz-string/lz-string.d.ts) [lz-string](https://github.com/pieroxy/lz-string) by [Roman Nikitin](https://github.com/M0ns1gn0r) +* [:link:](mapbox/mapbox.d.ts) [Mapbox](https://www.mapbox.com/mapbox.js) by [Maxime Fabre](https://github.com/anahkiasen) +* [:link:](mapsjs/mapsjs.d.ts) [Mapsjs](https://github.com/mapsjs) by [Matthew James Davis](https://github.com/davismj) +* [:link:](marionette/marionette.d.ts) [Marionette](https://github.com/marionettejs) by [Zeeshan Hamid](https://github.com/zhamid), [Natan Vivo](https://github.com/nvivo), [Sven Tschui](https://github.com/sventschui) +* [:link:](marked/marked.d.ts) [Marked](https://github.com/chjj/marked) by [William Orr](https://github.com/worr) +* [:link:](threejs/three-maskpass.d.ts) [MaskPass.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/MaskPass.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](mathjax/mathjax.d.ts) [MathJax](https://github.com/mathjax/MathJax) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](mCustomScrollbar/mCustomScrollbar.d.ts) [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) by [Sarah Williams](https://github.com/flurg) +* [:link:](memory-cache/memory-cache.d.ts) [memory-cache](http://github.com/ptarjan/node-cache) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](messenger/messenger.d.ts) [Messenger.js](https://github.com/HubSpot/messenger) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](meteor/meteor.d.ts) [Meteor](http://www.meteor.com) by [Dave Allen](https://github.com/fullflavedave) +* [:link:](method-override/method-override.d.ts) [method-override](https://github.com/expressjs/method-override) by [Santi Albo](https://github.com/santialbo) +* [:link:](microsoft-ajax/microsoft.ajax.d.ts) [Microsoft ASP.NET Ajax client side library](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) by [Patrick Magee](https://github.com/pjmagee) +* [:link:](microsoft-live-connect/microsoft-live-connect.d.ts) [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) by [John Vilk](https://github.com/jvilk) +* [:link:](azure-mobile-services-client/AzureMobileServicesClient.d.ts) [Microsoft Windows AzureMobile Service](http://www.windowsazure.com/en-us/develop/mobile) by [Morosinotto Daniele](https://github.com/dmorosinotto) +* [:link:](mime/mime.d.ts) [mime](https://github.com/broofa/node-mime) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](minimatch/minimatch.d.ts) [Minimatch](https://github.com/isaacs/minimatch) by [vvakame](https://github.com/vvakame) +* [:link:](minimist/minimist.d.ts) [minimist](https://github.com/substack/minimist) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](mithril/mithril.d.ts) [Mithril](http://lhorie.github.io/mithril) by [Leo Horie](https://github.com/lhorie), [Chris Bowdon](https://github.com/cbowdon) +* [:link:](mixpanel/mixpanel.d.ts) [Mixpanel](https://mixpanel.com) by [Knut Eirik Leira Hjelle](https://github.com/hjellek) +* [:link:](mixto/mixto.d.ts) [mixto](https://github.com/atom/mixto) by [vvakame](https://github.com/vvakame) +* [:link:](mkdirp/mkdirp.d.ts) [mkdirp](http://github.com/substack/node-mkdirp) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](mocha/mocha.d.ts) [mocha](http://visionmedia.github.io/mocha) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10) +* [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom) +* [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) +* [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya) +* [:link:](mongodb/mongodb.d.ts) [MongoDB](https://github.com/mongodb/node-mongodb-native) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [horiuchi](https://github.com/horiuchi) +* [:link:](morgan/morgan.d.ts) [morgan](https://github.com/expressjs/morgan) by [James Roland Cabresos](https://github.com/staticfunction) +* [:link:](mousetrap/mousetrap.d.ts) [Mousetrap](http://craig.is/killing/mice) by [Dániel Tar](https://github.com/qcz) +* [:link:](moviedb/moviedb.d.ts) [MovieDB](https://github.com/danzajdband/moviedb) by [Basarat Ali Syed](https://github.com/basarat) +* [:link:](firefox/firefox.d.ts) [Mozilla Web API](https://developer.mozilla.org/en-US/docs/Web/API) by [vvakame](https://github.com/vvakame) +* [:link:](localForage/localForage.d.ts) [Mozilla's localForage](https://github.com/mozilla/localforage) by [david pichsenmeister](https://github.com/3x14159265) +* [:link:](msgpack/msgpack.d.ts) [msgpack.js - MessagePack JavaScript Implementation](https://github.com/uupaa/msgpack.js) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki) +* [:link:](msnodesql/msnodesql.d.ts) [msnodesql](https://github.com/WindowsAzure/node-sqlserver) by [Boris Yankov](https://github.com/borisyankov), [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](mu2/mu2.d.ts) [mu2](http://github.com/raycmorgan/mu) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](mustache/mustache.d.ts) [Mustache](https://github.com/janl/mustache.js) by [Mark Ashley Bell](https://github.com/markashleybell) +* [:link:](nconf/nconf.d.ts) [nconf](https://github.com/flatiron/nconf) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](ncp/ncp.d.ts) [ncp](https://github.com/AvianFlu/ncp) by [Bart van der Schoor](https://github.com/bartvds) +* [:link:](needle/needle.d.ts) [needle](https://github.com/tomas/needle) by [San Chen](https://github.com/bigsan) +* [:link:](nexpect/nexpect.d.ts) [nexpect](https://github.com/nodejitsu/nexpect) by [vvakame](http://github.com/vvakame) +* [:link:](ng-grid/ng-grid.d.ts) [ng-grid](http://angular-ui.github.io/ng-grid) by [Ken Smith](https://github.com/smithkl42), [Roland Zwaga](https://github.com/rolandzwaga), [Kent Cooper](https://github.com/kentcooper) +* [:link:](ngprogress-lite/ngprogress-lite.d.ts) [ngprogress-lite](https://github.com/voronianski/ngprogress-lite) by [Luke Forder](https://github.com/LukeForder) +* [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook) +* [:link:](nock/nock.d.ts) [nock](https://github.com/pgte/nock) by [bonnici](https://github.com/bonnici) +* [:link:](bunyan/bunyan.d.ts) [node-bunyan](https://github.com/trentm/node-bunyan) by [Alex Mikhalev](https://github.com/amikhalev) +* [:link:](bunyan-logentries/bunyan-logentries.d.ts) [node-bunyan-logentries](https://github.com/nemtsov/node-bunyan-logentries) by [Aymeric Beaumet](http://aymericbeaumet.me) +* [:link:](node-ffi/node-ffi.d.ts) [node-ffi](https://github.com/rbranson/node-ffi) by [Paul Loyd](https://github.com/loyd) +* [:link:](node-fibers/node-fibers.d.ts) [node-fibers](https://github.com/laverdet/node-fibers) by [Cary Haynie](https://github.com/caryhaynie) +* [:link:](node-form/node-form.d.ts) [node-form](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) +* [:link:](node-git/node-git.d.ts) [node-git](https://github.com/christkv/node-git) by [vvakame](https://github.com/vvakame) +* [:link:](ip/ip.d.ts) [node-ip](https://github.com/indutny/node-ip) by [Peter Harris](https://github.com/codeanimal) +* [:link:](mysql/mysql.d.ts) [node-mysql](https://github.com/felixge/node-mysql) by [William Johnston](https://github.com/wjohnsto) +* [:link:](promptly/promptly.d.ts) [node-promptly](https://github.com/IndigoUnited/node-promptly) by [Dan Spencer](https://github.com/danrspencer) +* [:link:](radius/radius.d.ts) [node-radius](https://github.com/retailnext/node-radius) by [Peter Harris](https://github.com/codeanimal) +* [:link:](node-uuid/node-uuid.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) +* [:link:](node-webkit/node-webkit.d.ts) [node-webkit](https://github.com/rogerwang/node-webkit) by [Pedro Casaubon](https://github.com/xperiments) +* [:link:](xml2js/xml2js.d.ts) [node-xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) by [Michel Salib](https://github.com/michelsalib), [Jason McNeil](https://github.com/jasonrm) +* [:link:](node/node.d.ts) [Node.js](http://nodejs.org) by [Microsoft TypeScript](http://typescriptlang.org), [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped) +* [:link:](restify/restify.d.ts) [node.js REST framework](https://github.com/mcavage/node-restify) by [Bret Little](https://github.com/blittle) +* [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](nodeunit/nodeunit.d.ts) [nodeunit](https://github.com/caolan/nodeunit) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](nomnom/nomnom.d.ts) [nomnom](https://github.com/harthur/nomnom) by [Paul Vick](https://github.com/panopticoncentral) +* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker) +* [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42) +* [:link:](npm/npm.d.ts) [npm](https://github.com/npm/npm) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](nprogress/nprogress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com) +* [:link:](numeraljs/numeraljs.d.ts) [Numeral.js](https://github.com/adamwdraper/Numeral-js) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](object-path/object-path.d.ts) [objectPath](https://github.com/mariocasciaro/object-path) by [Paulo Cesar](https://github.com/pocesar) +* [:link:](oclazyload/oclazyload.d.ts) [oc.LazyLoad](https://github.com/ocombe/ocLazyLoad) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](open/open.d.ts) [open](https://github.com/jjrdn/node-open) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](openlayers/openlayers.d.ts) [OpenLayers.js](https://github.com/openlayers/openlayers) by [Ilya Bolkhovsky](https://github.com/bolhovsky) +* [:link:](opn/opn.d.ts) [opn](https://github.com/sindresorhus/opn) by [Shinnosuke Watanabe](https://github.com/shinnn) +* [:link:](optimist/optimist.d.ts) [optimist](https://github.com/substack/node-optimist) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](threejs/three-orbitcontrols.d.ts) [OrbitControls.js](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/OrbitControls.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](parallel/parallel.d.ts) [parallel.js](http://adambom.github.io/parallel.js) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](parse/parse.d.ts) [Parse](https://parse.com) by [Ullisen Media Group](http://ullisenmedia.com) +* [:link:](parsimmon/parsimmon.d.ts) [Parsimmon](https://github.com/jneen/parsimmon) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](passport/passport.d.ts) [Passport](http://passportjs.org) by [Horiuchi_H](https://github.com/horiuchi) +* [:link:](passport-strategy/passport-strategy.d.ts) [Passport Strategy module](https://github.com/jaredhanson/passport-strategy) by [Lior Mualem](https://github.com/liorm) +* [:link:](passport-facebook/passport-facebook.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) +* [:link:](passport-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](pathwatcher/pathwatcher.d.ts) [pathwatcher](https://github.com/atom/node-pathwatcher) by [vvakame](https://github.com/vvakame) +* [:link:](pdf/pdf.d.ts) [PDF.js](https://github.com/mozilla/pdf.js) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](peerjs/Peer.d.ts) [PeerJS](http://peerjs.com) by [Toshiya Nakakura](https://github.com/nakakura) +* [:link:](pegjs/pegjs.d.ts) [PEG.js](http://pegjs.majda.cz) by [vvakame](https://github.com/vvakame) +* [:link:](persona/persona.d.ts) [Persona](http://www.mozilla.org/en-US/persona) by [James Frasca](https://github.com/Nycto) +* [:link:](pg/pg.d.ts) [pg](https://github.com/brianc/node-postgres) by [Phips Peter](http://pspeter3.com) +* [:link:](pgwmodal/pgwmodal.d.ts) [PgwModal](http://pgwjs.com/pgwmodal) by [Pine Mizune](https://github.com/pine613) +* [:link:](phantomjs/phantomjs.d.ts) [PhantomJS v1.9.0 API](https://github.com/ariya/phantomjs/wiki/API-Reference) by [Jed Hunsaker](https://github.com/jedhunsaker), [Mike Keesey](https://github.com/keesey) +* [:link:](phonegap/phonegap.d.ts) [PhoneGap](http://phonegap.com) by [Boris Yankov](https://github.com/borisyankov), [Dick van den Brink](https://github.com/DickvdBrink) +* [:link:](devextreme/dx.phonejs.d.ts) [PhoneJS](http://js.devexpress.com/MobileDevelopment) by [DevExpress Inc.](http://devexpress.com) +* [:link:](physijs/physijs.d.ts) [Physijs](http://chandlerprall.github.io/Physijs) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](pickadate/pickadate.d.ts) [pickadate.js](https://github.com/amsul/pickadate.js) by [Adi Dahiya](https://github.com/adidahiya) +* [:link:](pixi/pixi.d.ts) [PIXI](https://github.com/GoodBoyDigital/pixi.js) by [xperiments](http://github.com/xperiments) +* [:link:](platform/platform.d.ts) [Platform](https://github.com/bestiejs/platform.js) by [Jake Hickman](https://github.com/JakeH) +* [:link:](podcast/podcast.d.ts) [podcast](http://github.com/maxnowack/node-podcast) by [Niklas Mollenhauer](https://github.com/nikeee) +* [:link:](popcorn/popcorn.d.ts) [Popcorn](https://github.com/mozilla/popcorn-js) by [grapswiz](https://github.com/grapswiz) +* [:link:](pouchDB/pouch.d.ts) [Pouch](http://pouchdb.com) by [Bill Sears](https://github.com/MrBigDog2U) +* [:link:](precise/precise.d.ts) [precise](https://www.npmjs.org/package/precise) by [Peter Harris](https://github.com/codeanimal) +* [:link:](preloadjs/preloadjs.d.ts) [PreloadJS](http://www.createjs.com/#!/PreloadJS) by [Pedro Ferreira](https://bitbucket.org/drk4) +* [:link:](progressjs/progress.d.ts) [ProgressJs](http://usablica.github.io/progress.js) by [Shunsuke Ohtani](https://github.com/zaneli) +* [:link:](threejs/three-projector.d.ts) [Projector.js](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/Projector.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](promise-pool/promise-pool.d.ts) [promise-pool](https://github.com/vilic/promise-pool) by [VILIC VANE](https://github.com/vilic) +* [:link:](promises-a-plus/promises-a-plus.d.ts) [promises-a-plus](http://promisesaplus.com) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](pubsubjs/pubsub.d.ts) [PubSubJS](https://github.com/mroderick/PubSubJS) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](purl/purl.d.ts) [Purl](https://github.com/allmarkedup/purl) by [Daniel Ferreira Monteiro Alves](https://github.com/danfma) +* [:link:](q/Q.d.ts) [Q](https://github.com/kriskowal/q) by [Barrie Nemetchek](https://github.com/bnemetchek), [Andrew Gaspar](https://github.com/AndrewGaspar), [John Reilly](https://github.com/johnnyreilly) +* [:link:](q-io/Q-io.d.ts) [Q-io](https://github.com/kriskowal/q-io) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](q-retry/q-retry.d.ts) [q-retry](https://github.com/vilic/q-retry) by [VILIC VANE](https://github.com/vilic) +* [:link:](qajax/qajax.d.ts) [Qajax](https://github.com/gre/qajax) by [Boltmade](https://github.com/Boltmade) +* [:link:](qunit/qunit.d.ts) [QUnit](http://qunitjs.com) by [Diullei Gomes](https://github.com/diullei) +* [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall) +* [:link:](ravenjs/ravenjs.d.ts) [Raven.js](https://github.com/getsentry/raven-js) by [Santi Albo](https://github.com/santialbo) +* [:link:](react/react.d.ts) [React 0.12.RC](http://facebook.github.io/react) by [Asana](https://asana.com) +* [:link:](react-addons/react-addons.d.ts) [React with Addons 0.12.RC](http://facebook.github.io/react) by [Asana](https://asana.com) +* [:link:](readdir-stream/readdir-stream.d.ts) [readdir-stream](https://github.com/logicalparadox/readdir-stream) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal) +* [:link:](ref-array/ref-array.d.ts) [ref-array](https://github.com/TooTallNate/ref-array) by [Paul Loyd](https://github.com/loyd) +* [:link:](ref-union/ref-union.d.ts) [ref-union](https://github.com/TooTallNate/ref-union) by [Paul Loyd](https://github.com/loyd) +* [:link:](threejs/three-renderpass.d.ts) [RenderPass.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/RenderPass.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](request/request.d.ts) [request](https://github.com/mikeal/request) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [bonnici](https://github.com/bonnici), [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](requirejs/require.d.ts) [RequireJS](http://requirejs.org) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](restangular/restangular.d.ts) [Restangular](https://github.com/mgonto/restangular) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](rethinkdb/rethinkdb.d.ts) [Rethinkdb](http://rethinkdb.com) by [Sean Hess](https://seanhess.github.io) +* [:link:](reveal/reveal.d.ts) [Reveal](https://github.com/hakimel/reveal.js) by [grapswiz](https://github.com/grapswiz) +* [:link:](rickshaw/rickshaw.d.ts) [Rickshaw](http://code.shutterstock.com/rickshaw) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](rimraf/rimraf.d.ts) [rimraf](https://github.com/isaacs/rimraf) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](riotjs/riotjs.d.ts) [riot.js](https://github.com/moot/riotjs) by [vvakame](https://github.com/vvakame) +* [:link:](routie/routie.d.ts) [routie](https://github.com/jgallen23/routie) by [Adilson](https://github.com/Adilson) +* [:link:](rtree/rtree.d.ts) [rtree](https://github.com/leaflet-extras/RTree) by [Omede Firouz](https://github.com/oefirouz) +* [:link:](rx/rx.d.ts) [RxJS](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.aggregates.d.ts) [RxJS-Aggregates](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.async.d.ts) [RxJS-Async](http://rx.codeplex.com) by [zoetrope](https://github.com/zoetrope), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.backpressure.d.ts) [RxJS-BackPressure](http://rx.codeplex.com) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.binding.d.ts) [RxJS-Binding](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.coincidence.d.ts) [RxJS-Coincidence](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.experimental.d.ts) [RxJS-Experimental](https://github.com/Reactive-Extensions/RxJS) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.joinpatterns.d.ts) [RxJS-Join](http://rx.codeplex.com) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx-jquery/rx.jquery.d.ts) [RxJS-jQuery](https://github.com/Reactive-Extensions/RxJS-jQuery) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.lite.d.ts) [RxJS-Lite](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.testing.d.ts) [RxJS-Testing](https://github.com/Reactive-Extensions/RxJS) by [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.time.d.ts) [RxJS-Time](http://rx.codeplex.com) by [Carl de Billy](http://carl.debilly.net), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](rx/rx.virtualtime.d.ts) [RxJS-VirtualTime](http://rx.codeplex.com) by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek) +* [:link:](sammyjs/sammyjs.d.ts) [Sammy.js](http://sammyjs.org) by [Boris Yankov](https://github.com/borisyankov), [Oisin Grehan](https://github.com/oising) +* [:link:](select2/select2.d.ts) [Select2](http://ivaynberg.github.com/select2) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](selenium-webdriver/selenium-webdriver.d.ts) [Selenium WebDriverJS](https://code.google.com/p/selenium) by [Bill Armstrong](https://github.com/BillArmstrong) +* [:link:](semver/semver.d.ts) [semver](https://github.com/isaacs/node-semver) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](sendgrid/sendgrid.d.ts) [sendgrid](https://github.com/sendgrid/sendgrid-nodejs) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](threejs/three-shaderpass.d.ts) [ShaderPass.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/ShaderPass.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](shelljs/shelljs.d.ts) [ShellJS](http://shelljs.org) by [Niklas Mollenhauer](https://github.com/nikeee) +* [:link:](should/should.d.ts) [should.js](https://github.com/visionmedia/should.js) by [Alex Varju](https://github.com/varju), [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](showdown/showdown.d.ts) [Showdown](https://github.com/coreyti/showdown) by [cbowdon](https://github.com/cbowdon) +* [:link:](siesta/siesta.d.ts) [Siesta](http://www.bryntum.com/products/siesta) by [bquarmby](https://github.com/bquarmby) +* [:link:](signalr/signalr.d.ts) [SignalR](http://www.asp.net/signalr) by [Boris Yankov](https://github.com/borisyankov), [T. Michael Keesey](https://github.com/keesey) +* [:link:](signature_pad/signature_pad.d.ts) [signature_pad](https://github.com/szimek/signature_pad) by [Abubaker Bashir](https://github.com/AbubakerB) +* [:link:](simple-cw-node/simple-cw-node.d.ts) [simple-cw-node](https://github.com/astronaughts/simple-cw-node) by [vvakame](https://github.com/vvakame) +* [:link:](sinon/sinon.d.ts) [Sinon](http://sinonjs.org) by [William Sears](https://github.com/mrbigdog2u) +* [:link:](sinon-chai/sinon-chai.d.ts) [sinon-chai](https://github.com/domenic/sinon-chai) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) +* [:link:](sipml/sipml.d.ts) [SIPml5](http://sipml5.org) by [A. Groenenboom](https://github.com/chookies) +* [:link:](sjcl/sjcl.d.ts) [sjcl](http://crypto.stanford.edu/sjcl) by [Eugene Chernyshov](https://github.com/Evgenus) +* [:link:](slickgrid/SlickGrid.d.ts) [SlickGrid](https://github.com/mleibman/SlickGrid) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](slickgrid/slick.headerbuttons.d.ts) [SlickGrid HeaderButtons Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](slickgrid/slick.rowselectionmodel.d.ts) [SlickGrid RowSelectionModel Plugin](https://github.com/mleibman/SlickGrid) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](smoothie/smoothie.d.ts) [Smoothie Charts](https://github.com/joewalnes/smoothie) by [Drew Noakes](https://drewnoakes.com), [Mike H. Hawley](https://github.com/mikehhawley) +* [:link:](socket.io/socket.io.d.ts) [socket.io](http://socket.io) by [William Orr](https://github.com/worr) +* [:link:](socket.io-client/socket.io-client.d.ts) [socket.io nodejs client](http://socket.io) by [Maido Kaara](https://github.com/v3rm0n) +* [:link:](sockjs/sockjs.d.ts) [SockJS 0.3.x](https://github.com/sockjs/sockjs-client) by [Emil Ivanov](https://github.com/vladev) +* [:link:](sockjs-node/sockjs-node.d.ts) [sockjs-node 0.3.x](https://github.com/sockjs/sockjs-node) by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing) +* [:link:](soundjs/soundjs.d.ts) [SoundJS](http://www.createjs.com/#!/SoundJS) by [Pedro Ferreira](https://bitbucket.org/drk4) +* [:link:](source-map/source-map.d.ts) [source-map](https://github.com/mozilla/source-map) by [Morten Houston Ludvigsen](https://github.com/MortenHoustonLudvigsen) +* [:link:](source-map-support/source-map-support.d.ts) [source-map-support](https://github.com/evanw/source-map-support) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](space-pen/space-pen.d.ts) [SpacePen](https://github.com/atom/space-pen) by [vvakame](https://github.com/vvakame) +* [:link:](spin/spin.d.ts) [Spin.js](http://fgnass.github.com/spin.js) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) +* [:link:](sprintf/sprintf.d.ts) [sprintff](https://github.com/maritz/node-sprintff) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](sharepoint/SharePoint.d.ts) [sptypescript](http://sptypescript.codeplex.com) by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru), [Andrey Markeev](http://markeev.com) +* [:link:](sqlite3/sqlite3.d.ts) [sqlite3](https://github.com/mapbox/node-sqlite3) by [Nick Malaguti](https://github.com/nmalaguti) +* [:link:](stampit/stampit.d.ts) [stampit](https://github.com/ericelliott/stampit) by [Vasyl Boroviak](https://github.com/koresar) +* [:link:](stats/stats.d.ts) [Stats.js r11](http://github.com/mrdoob/stats.js) by [Gregory Dalton](https://github.com/gregolai) +* [:link:](status-bar/status-bar.d.ts) [status-bar](https://github.com/atom/status-bar) by [vvakame](https://github.com/vvakame) +* [:link:](storejs/storejs.d.ts) [store.js](https://github.com/marcuswestin/store.js) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](stream-to-array/stream-to-array.d.ts) [stream-to-array](https://github.com/stream-utils/stream-to-array) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Eric J. Smith](https://github.com/ejsmith) +* [:link:](stylus/stylus.d.ts) [stylus](https://github.com/LearnBoost/stylus) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](sugar/sugar.d.ts) [Sugar](http://sugarjs.com) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](superagent/superagent.d.ts) [SuperAgent](https://github.com/visionmedia/superagent) by [Alex Varju](https://github.com/varju) +* [:link:](supertest/supertest.d.ts) [SuperTest](https://github.com/visionmedia/supertest) by [Alex Varju](https://github.com/varju) +* [:link:](svg-pan-zoom/svg-pan-zoom.d.ts) [svg-pan-zoom](https://github.com/ariutta/svg-pan-zoom) by [Chintan Shah](https://github.com/Promact) +* [:link:](svgjs/svgjs.d.ts) [svg.js](http://www.svgjs.com) by [Sean Hess](https://seanhess.github.io) +* [:link:](svgjs.draggable/svgjs.draggable.d.ts) [svgjs.draggable](http://www.svgjs.com) by [Luigi Trabacchin](https://github.com/LiFeleSs) +* [:link:](swfobject/swfobject.d.ts) [swfobject](https://code.google.com/p/swfobject) by [rou](https://github.com/rou) +* [:link:](swig/swig.d.ts) [swig](http://github.com/paularmstrong/swig) by [Peter Harris](https://github.com/CodeAnimal), [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](swiper/swiper.d.ts) [Swiper](https://github.com/nolimits4web/Swiper) by [Sebastián Galiano](https://github.com/sgaliano) +* [:link:](swipeview/swipeview.d.ts) [SwipeView](http://cubiq.org/swipeview) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](swiz/swiz.d.ts) [swiz](https://github.com/racker/node-swiz) by [Jeff Goddard](https://github.com/jedigo) +* [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](teechart/teechart.d.ts) [TeeChart](http://www.steema.com) by [Steema Software](https://steema.com) +* [:link:](text-buffer/text-buffer.d.ts) [text-buffer](https://github.com/atom/text-buffer) by [vvakame](https://github.com/vvakame) +* [:link:](text-encoding/text-encoding.d.ts) [text-encoding](https://github.com/inexorabletash/text-encoding) by [MIZUNE Pine](https://github.com/pine613) +* [:link:](threejs/three.d.ts) [three.js r68](http://mrdoob.github.com/three.js) by [Kon](http://phyzkit.net), [Satoru Kimura](https://github.com/gyohk) +* [:link:](through/through.d.ts) [through](https://github.com/dominictarr/through) by [Andrew Gaspar](https://github.com/AndrewGaspar) +* [:link:](through2/through2.d.ts) [through2 v](https://github.com/rvagg/through2) by [Bart van der Schoor](https://github.com/Bartvds), [jedmao](https://github.com/jedmao) +* [:link:](timelinejs/timelinejs.d.ts) [timelinejs](https://github.com/NUKnightLab/TimelineJS) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](timezone-js/timezone-js.d.ts) [timezone-js](https://github.com/mde/timezone-js) by [bonnici](https://github.com/bonnici) +* [:link:](timezonecomplete/timezonecomplete.d.ts) [timezonecomplete](https://github.com/SpiritIT/timezonecomplete) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](tv4/tv4.d.ts) [Tiny Validator tv4](https://github.com/geraintluff/tv4) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](titanium/titanium.d.ts) [Titanium Movile 3.1.3.GA](http://www.appcelerator.com) by [Airam Rguez](https://github.com/airamrguez) +* [:link:](toastr/toastr.d.ts) [Toastr](https://github.com/CodeSeven/toastr) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](sencha_touch/SenchaTouch.d.ts) [Touch](http://www.sencha.com/products/touch) by [Brian Kotek](https://github.com/brian428) +* [:link:](threejs/three-trackballcontrols.d.ts) [TrackballControls.js](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](trunk8/trunk8.d.ts) [trunk8](https://github.com/rviscomi/trunk8) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](tspromise/tspromise.d.ts) [tspromise](https://github.com/soywiz/tspromise) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](tween.js/tween.js.d.ts) [tween.js r12](https://github.com/sole/tween.js) by [sunetos](https://github.com/sunetos), [jzarnikov](https://github.com/jzarnikov) +* [:link:](tweenjs/tweenjs.d.ts) [TweenJS](http://www.createjs.com/#!/TweenJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist) +* [:link:](twig/twig.d.ts) [twig](https://github.com/justjohn/twig.js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](jquery.bootstrap.wizard/jquery.bootstrap.wizard.d.ts) [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](type-detect/type-detect.d.ts) [type-detect](https://github.com/chaijs/type-detect) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](typeahead/typeahead.d.ts) [typeahead.js](http://twitter.github.io/typeahead.js) by [Ivaylo Gochkov](https://github.com/igochkov), [Gidon Junge](https://github.com/gjunge) +* [:link:](typescript-services/typescriptServices.d.ts) [TypeScript-Services](https://www.npmjs.org/package/typescript-services) by [Basarat Ali Syed](http://github.com/basarat) +* [:link:](unity-webapi/unity-webapi.d.ts) [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) by [John Vrbanac](jhttps://github.com/jmvrbanac) +* [:link:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](underscore-ko/underscore-ko.d.ts) [Underscore-ko 1.2.2 with underscore](https://github.com/kamranayub/UnderscoreKO) by [Maurits Elbers](https://github.com/MagicMau) +* [:link:](underscore.string/underscore.string.d.ts) [underscore.string](https://github.com/epeli/underscore.string) by [Ry Racherbaumer](http://github.com/rygine) +* [:link:](universal-analytics/universal-analytics.d.ts) [universal-analytics](https://github.com/peaksandpies/universal-analytics) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](update-notifier/update-notifier.d.ts) [update-notifier](https://github.com/yeoman/update-notifier) by [vvakame](https://github.com/vvakame) +* [:link:](uri-templates/uri-templates.d.ts) [uri-templates](https://github.com/geraintluff/uri-templates) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](urijs/URI.d.ts) [URI.js](https://github.com/medialize/URI.js) by [RodneyJT](https://github.com/RodneyJT) +* [:link:](js-url/js-url.d.ts) [url](https://github.com/websanova/js-url) by [MIZUNE Pine](https://github.com/pine613) +* [:link:](urlrouter/urlrouter.d.ts) [urlrouter](https://github.com/fengmk2/urlrouter) by [soywiz](https://github.com/soywiz) +* [:link:](UUID/UUID.d.ts) [UUID.js core](https://github.com/LiosK/UUID.js) by [Jason Jarrett](https://github.com/staxmanade) +* [:link:](valerie/valerie.d.ts) [valerie](https://github.com/davewatts/valerie) by [Howard Richards](https://github.com/conficient) +* [:link:](vega/vega.d.ts) [Vega](http://trifacta.github.io/vega) by [Tom Crockett](http://github.com/pelotom) +* [:link:](velocity-animate/velocity-animate.d.ts) [Velocity](http://velocityjs.org) by [Greg Smith](https://github.com/smrq) +* [:link:](videojs/videojs.d.ts) [Video.js](https://github.com/zencoder/video-js) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](vimeo/froogaloop.d.ts) [Vimeo](http://developer.vimeo.com/player/js-api) by [Daz Wilkin](https://github.com/DazWilkin) +* [:link:](vinyl/vinyl.d.ts) [vinyl](https://github.com/wearefractal/vinyl) by [vvakame](https://github.com/vvakame), [jedmao](https://github.com/jedmao) +* [:link:](vinyl-fs/vinyl-fs.d.ts) [vinyl-fs](https://github.com/wearefractal/vinyl-fs) by [vvakame](https://github.com/vvakame) +* [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved) +* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net) +* [:link:](webaudioapi/waa-nightly.d.ts) [Web Audio API (nightly)](http://www.w3.org/TR/2012/WD-webaudio-20120802) by [Baruch Berger](https://github.com/bbss) +* [:link:](devextreme/dx.webappjs.d.ts) [WebAppJS](http://js.devexpress.com/WebDevelopment) by [DevExpress Inc.](http://devexpress.com) +* [:link:](webcrypto/WebCrypto.d.ts) [WebCrypto](http://www.w3.org/TR/WebCryptoAPI) by [Lucas Dixon](https://github.com/iislucas) +* [:link:](webrtc/MediaStream.d.ts) [WebRTC](http://dev.w3.org/2011/webrtc) by [Ken Smith](https://github.com/smithkl42) +* [:link:](websocket/websocket.d.ts) [websocket](https://github.com/Worlize/WebSocket-Node) by [Paul Loyd](https://github.com/loyd) +* [:link:](when/when.d.ts) [When](https://github.com/cujojs/when) by [Derek Cicerone](https://github.com/derekcicerone) +* [:link:](winjs/winjs.d.ts) [WinJS](http://try.buildwinjs.com) by [TypeScript samples](https://www.typescriptlang.org), [Adam Hewitt](https://github.com/adamhewitt627), [Craig Treasure](https://github.com/craigktreasure), [Jeff Fisher](https://github.com/xirzec) +* [:link:](winrt/winrt.d.ts) [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) by [TypeScript samples](https://www.typescriptlang.org) +* [:link:](winston/winston.d.ts) [winston](https://github.com/flatiron/winston) by [bonnici](https://github.com/bonnici), [Peter Harris](https://github.com/codeanimal) +* [:link:](wolfy87-eventemitter/wolfy87-eventemitter.d.ts) [wolfy87-eventemitter](https://github.com/Wolfy87/EventEmitter) by [ryiwamoto](https://github.com/ryiwamoto) +* [:link:](wrench/wrench.d.ts) [wrench](https://github.com/ryanmcgrath/wrench-js) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](ws/ws.d.ts) [ws](https://github.com/einaros/ws) by [Paul Loyd](https://github.com/loyd) +* [:link:](x2js/xml2json.d.ts) [x2js](https://code.google.com/p/x2js) by [Horiuchi_H](https://github.com/horiuchi) +* [:link:](jsfl/xJSFL.d.ts) [xJSFL](http://www.xjsfl.com) by [soywiz](https://github.com/soywiz) +* [:link:](xpath/xpath.d.ts) [xpath](https://github.com/goto100/xpath) by [Andrew Bradley](https://github.com/cspotcode) +* [:link:](xregexp/xregexp.d.ts) [XRegExp](http://xregexp.com) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](xsockets/XSockets.d.ts) [XSockets.NET](http://xsockets.net) by [Jeffery Grajkowski](https://github.com/pushplay) +* [:link:](yargs/yargs.d.ts) [yargs](https://github.com/chevex/yargs) by [Martin Poelstra](https://github.com/poelstra) +* [:link:](youtube/youtube.d.ts) [YouTube](https://developers.google.com/youtube) by [Daz Wilkin](https://github.com/DazWilkin), [Ian Obermiller](http://ianobermiller.com) +* [:link:](gapi.youtubeAnalytics/gapi.youtubeAnalytics.d.ts) [YouTube Analytics API](https://developers.google.com/youtube/analytics) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](gapi.youtube/gapi.youtube.d.ts) [YouTube Data API v3](https://developers.google.com/youtube/v3) by [Frank M](https://github.com/sgtfrankieboy) +* [:link:](yui/yui.d.ts) [yui](https://github.com/yui/yui3) by [Gia Bảo @ Sân Đình](https://github.com/giabao) +* [:link:](zepto/zepto.d.ts) [Zepto](http://zeptojs.com) by [Josh Baldwin](https://github.com/jbaldwin) +* [:link:](zeroclipboard/zeroclipboard.d.ts) [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) by [Eric J. Smith](https://github.com/ejsmith), [Blake Niemyjski](https://github.com/niemyjski), [György Balássy](https://github.com/balassy) +* [:link:](node_zeromq/zmq.d.ts) [ZeroMQ Node](https://github.com/JustinTulloss/zeromq.node) by [Dave McKeown](http://github.com/davemckeown) +* [:link:](scroller/easyscroller.d.ts) [Zynga EasyScroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](scroller/scroller.d.ts) [Zynga Scroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](viewporter/viewporter.d.ts) [Zynga Viewporter](https://github.com/zynga/viewporter) by [Boris Yankov](https://github.com/borisyankov) -All definitions files include a header with the author and editors, so at some point this list will be auto-generated. - -* [accounting.js](http://josscrowcroft.github.io/accounting.js/) (by [Sergey Gerasimov](https://github.com/gerich-home)) -* [Ace Cloud9 Editor](http://ace.ajax.org/) (by [Diullei Gomes](https://github.com/Diullei)) -* [Add To Home Screen](http://cubiq.org/add-to-home-screen) (by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw)) -* [AmCharts](http://www.amcharts.com/) (by [Covobonomo](https://github.com/covobonomo/)) -* [AngularAgility](https://github.com/AngularAgility/AngularAgility) (by [Roland Zwaga](https://github.com/rolandzwaga)) -* [AngularBootstrapLightbox](https://github.com/compact/angular-bootstrap-lightbox) (by [Roland Zwaga](https://github.com/rolandzwaga)) -* [AngularFire](https://www.firebase.com/docs/angular/reference.html) (by [Dénes Harmath](https://github.com/thSoft)) -* [AngularJS](http://angularjs.org) (by [Diego Vilar](https://github.com/diegovilar)) ([wiki](https://github.com/borisyankov/DefinitelyTyped/wiki/AngularJS-Definitions-Usage-Notes)) -* [angularLocalStorage](https://github.com/agrublev/angularLocalStorage) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) -* [angular-file-upload](https://github.com/danialfarid/angular-file-upload) (by [John Reilly](https://github.com/johnnyreilly)) -* [angular-spinner](https://github.com/urish/angular-spinner) (by [Marcin Biegała](https://github.com/Biegal)) -* [AngularUI](http://angular-ui.github.io/) (by [Michel Salib](https://github.com/michelsalib)) -* [Angular Hotkeys](https://github.com/chieffancypants/angular-hotkeys/) (by [Jason Zhao](https://github.com/jlz27)) -* [angular-http-auth](https://github.com/witoldsz/angular-http-auth) (by [vvakame](https://github.com/vvakame)) -* [Angular Protractor](https://github.com/angular/protractor) (by [Bill Armstrong](https://github.com/BillArmstrong)) -* [Angular notify](https://github.com/cgross/angular-notify) (by [Suwato](https://github.com/Suwato)) -* [Angular Translate](http://pascalprecht.github.io/angular-translate/) (by [Michel Salib](https://github.com/michelsalib)) -* [Angular UI Bootstrap](http://angular-ui.github.io/bootstrap) (by [Brian Surowiec](https://github.com/xt0rted)) -* [any-db](https://github.com/grncdr/node-any-db) (by [Rogier Schouten](https://github.com/rogier-schouten)) -* [any-db-transaction](https://github.com/grncdr/node-any-db-transaction) (by [Rogier Schouten](https://github.com/rogier-schouten)) -* [AppFramework](http://app-framework-software.intel.com/) (by [Kyo Ago](https://github.com/kyo-ago)) -* [Arbiter](http://arbiterjs.com/) (by [Arash Shakery](https://github.com/arash16)) -* [asciify](https://github.com/olizilla/asciify) (by [Alan](http://alan.norbauer.com)) -* [assert](https://github.com/Jxck/assert) (by [vvakame](https://github.com/vvakame)) -* [async](https://github.com/caolan/async) (by [Boris Yankov](https://github.com/borisyankov)) -* [atmosphere](https://github.com/Atmosphere/atmosphere-javascript) (by [Kai Toedter](https://github.com/toedter)) -* [Atom](https://atom.io/) (by [vvakame](https://github.com/vvakame)) -* [Auth0](https://auth0.com/) (by [Robert McLaws](https://github.com/advancedrei)) -* [Auth0.Widget](https://auth0.com/) (by [Robert McLaws](https://github.com/advancedrei)) -* [aws-sdk-js](https://github.com/aws/aws-sdk-js) (by [midknight41](https://github.com/midknight41)) -* [Backbone.js](http://backbonejs.org/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Backbone Relational](http://backbonerelational.org/) (by [Eirik Hoem](https://github.com/eirikhm)) -* [big.js](https://github.com/MikeMcl/big.js) (by [Steve Ognibene](https://github.com/nycdotnet)) -* [BigInt](https://github.com/Evgenus/BigInt) (by [Eugene Chernyshov](https://github.com/Evgenus)) -* [BigInteger](https://github.com/peterolson/BigInteger.js) (by [Ingo Bürk](https://github.com/Airblader)) -* [BigScreen](http://brad.is/coding/BigScreen/) (by [Douglas Eichelberger](https://github.com/dduugg)) -* [Bluebird](https://github.com/petkaantonov/bluebird) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [Bootbox](https://github.com/makeusabrew/bootbox) (by [Vincent Bortone](https://github.com/vbortone/)) -* [Bootstrap](http://twitter.github.com/bootstrap/) (by [Boris Yankov](https://github.com/borisyankov)) -* [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) (by [Blake Niemyjski](https://github.com/niemyjski)) -* [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) (by [Boris Yankov](https://github.com/borisyankov)) -* [Box2DWeb](http://code.google.com/p/box2dweb/) (by [Josh Baldwin](https://github.com/jbaldwin/)) -* [Breeze](http://www.breezejs.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Browser Harness](https://github.com/scriby/browser-harness) (by [Chris Scribner](https://github.com/scriby)) -* [bucks](https://github.com/CyberAgent/bucks.js) (by [Shunsuke Ohtani](https://github.com/zaneli)) -* [bunyan](https://github.com/trentm/node-bunyan) (by [Alex Mikhalev](https://github.com/amikhalev)) -* [bunyan-logentries](https://github.com/nemtsov/node-bunyan-logentries) (by [Aymeric Beaumet](http://aymericbeaumet.me)) -* [CasperJS](http://casperjs.org) (by [Jed Mao](https://github.com/jedmao)) -* [CanvasJS](http://canvasjs.com) (by [Mark Overholt](https://github.com/mover5)) -* [checksum](https://github.com/dshaw/checksum) (by [Rogier Schouten](https://github.com/rogierschouten)) -* [Cheerio](https://github.com/MatthewMueller/cheerio) (by [Bret Little](https://github.com/blittle)) -* [Chosen](http://harvesthq.github.com/chosen/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Chroma.js](https://github.com/gka/chroma.js) (by [Sebastian Brückner](https://github.com/invliD)) -* [Chrome](http://developer.chrome.com/extensions/) (by [Matthew Kimber](https://github.com/matthewkimber) and [otiai10](https://github.com/otiai10)) -* [Chrome App](http://developer.chrome.com/apps/) (by [Adam Lay](https://github.com/AdamLay)) -* [CKEditor](https://github.com/ckeditor/ckeditor-dev) (by [Ondrej Sevcik](https://github.com/ondrejsevcik)) -* [Clone](https://github.com/pvorb/node-clone) (by [Kieran Simpson](https://github.com/kierans)) -* [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) -* [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem) and [vvakame](https://github.com/vvakame)) -* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [cookie](https://github.com/jshttp/cookie) (by [Pine Mizune](https://github.com/jshttp/cookie)) -* [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/)) -* [Cordovarduino](https://github.com/stereolux/cordovarduino) (by [Hendrik Maus](https://github.com/hendrikmaus)) -* [Couchbase / Couchnode](https://github.com/couchbase/couchnode) (by [Basarat Ali Syed](https://github.com/basarat)) -* [Crossfilter](https://github.com/square/crossfilter) (by [Schmulik Raskin](https://github.com/schmuli)) -* [crypto-js](https://code.google.com/p/crypto-js/) (by [Gia Bảo @ Sân Đình](https://github.com/giabao)). @see [cryptojs.d.ts repo](https://github.com/giabao/cryptojs.d.ts) -* [d3.js](http://d3js.org/) (from TypeScript samples) -* [dat.GUI](https://github.com/dataarts/dat.gui) (by [gyoh_k](https://github.com/gyohk)) -* [debug](https://github.com/visionmedia/debug) (by [Seon-Wook Park](https://github.com/swook)) -* [dhtmlxGantt](http://dhtmlx.com/docs/products/dhtmlxGantt) (by [Maksim Kozhukh](http://github.com/mkozhukh)) -* [dhtmlxScheduler](http://dhtmlx.com/docs/products/dhtmlxScheduler) (by [Maksim Kozhukh](http://github.com/mkozhukh)) -* [diff](https://github.com/kpdecker/jsdiff) (by [vvakame](http://github.com/vvakame)) -* [Dock Spawn](http://dockspawn.com) (by [Drew Noakes](https://drewnoakes.com)) -* [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) (by [Jon Egerton](https://github.com/jonegerton)) -* [domo](http://domo-js.com/) (by [Steve Fenton](https://github.com/Steve-Fenton)) -* [doT](https://github.com/olado/doT) (by [ZombieHunter](https://github.com/ZombieHunter)) -* [dust](http://linkedin.github.com/dustjs) (by [Marcelo Dezem](https://github.com/mdezem)) -* [EaselJS](http://www.createjs.com/#!/EaselJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) -* [EasyStar](http://easystarjs.com/) (by [Magnus Gustafsson](https://github.com/Borundin)) -* [Elm](http://elm-lang.org) (by [Dénes Harmath](https://github.com/thSoft)) -* [Ember.js](http://emberjs.com/) (by [Jed Mao](https://github.com/jedmao) and [Boris Yankov](https://github.com/borisyankov)) -* [emissary](https://github.com/atom/emissary) (by [vvakame](https://github.com/vvakame)) -* [Emscripten](http://kripken.github.io/emscripten-site/) (by [Kensuke MATSUZAKI](https://github.com/zakki)) -* [EpicEditor](http://epiceditor.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [ES6-Promises](https://github.com/jakearchibald/ES6-Promises) (by [François de Campredon](https://github.com/fdecampredon/)) -* [Esprima](http://esprima.org/) (by [Teppei Sato](https://github.com/teppeis)) -* [expect.js](https://github.com/LearnBoost/expect.js) (by [Teppei Sato](https://github.com/teppeis)) -* [EventEmitter2](https://github.com/asyncly/EventEmitter2) (by [Ryo Iwamoto](https://github.com/ryiwamoto)) -* [expectations](https://github.com/spmason/expectations) (by [vvakame](https://github.com/vvakame)) -* [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [express-session](https://www.npmjs.org/package/express-session) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) -* [express-myconnection](https://www.npmjs.org/package/express-myconnection) (by [Michael Ferris](https://github.com/cellule/) -* [Ext JS](http://www.sencha.com/products/extjs/) (by [Brian Kotek](https://github.com/brian428)) -* [Fabric.js](http://fabricjs.com/) (by [Oliver Klemencic](https://github.com/oklemencic/)) -* [Fancybox](http://fancybox.net/) (by [Boris Yankov](https://github.com/borisyankov)) -* [FastClick](https://github.com/ftlabs/fastclick) (by [Shinnosuke Watanabe](https://github.com/shinnn)) -* [File API: Directories and System](http://www.w3.org/TR/file-system-api/) (by [Kon](http://phyzkit.net/)) -* [File API: Writer](http://www.w3.org/TR/file-writer-api/) (by [Kon](http://phyzkit.net/)) -* [Finch](https://github.com/stoodder/finchjs) (by [David Sichau](https://github.com/DavidSichau/)) -* [fingerprintjs](https://github.com/Valve/fingerprintjs) (by [Shunsuke Ohtani](https://github.com/zaneli)) -* [Finite State Machine](https://github.com/jakesgordon/javascript-state-machine) (by [Boris Yankov](https://github.com/borisyankov)) -* [Firebase](https://www.firebase.com/docs/javascript/firebase) (by [Vincent Bortone](https://github.com/vbortone)) -* [Firefox](https://developer.mozilla.org/en-US/docs/Web/API) (by [vvakame](https://github.com/vvakame)) -* [FlexSlider](http://www.woothemes.com/flexslider/) (by [Diullei Gomes](https://github.com/Diullei)) -* [Flight by Twitter](http://flightjs.github.com/flight/) (by [Jonathan Hedrén](https://github.com/jonathanhedren)) -* [flipsnap.js](http://pxgrid.github.io/js-flipsnap/) (by [kubosho_](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki)) -* [Foundation](http://foundation.zurb.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [FPSMeter](http://darsa.in/fpsmeter/) (by [Aaron Lampros](https://github.com/alampros)) -* [fs-extra](https://github.com/jprichardson/node-fs-extra) (by [midknight41](https://github.com/midknight41)) -* [FullCalendar](http://arshaw.com/fullcalendar/) (by [Neil Stalker](https://github.com/nestalk)) -* [Fuse.js](https://github.com/krisk/Fuse) (by [Greg Smith](https://github.com/smrq)) -* [Gamepad](http://www.w3.org/TR/gamepad/) (by [Kon](http://phyzkit.net/)) -* [GeoJSON](http://geojson.org/) (by [Jake Bruun](https://github.com/cobster)) -* [Giraffe](https://github.com/barc/backbone.giraffe) (by [Matt McCray](https://github.com/darthapo)) -* [glDatePicker](http://glad.github.com/glDatePicker/) (by [Dániel Tar](https://github.com/qcz)) -* [Glob](https://github.com/isaacs/node-glob) (by [vvakame](https://github.com/vvakame)) -* [GoJS](http://gojs.net/) (by [Barbara Duckworth](https://github.com/barbara42)) -* [Greasemonkey](http://www.greasespot.net/) (by [Kota Saito](https://github.com/kotas)) -* [GreenSock Animation Platform (GSAP)](http://www.greensock.com/get-started-js/) (by [Robert S.](https://github.com/codeBelt)) -* [gridfs-stream](https://github.com/aheckmann/gridfs-stream) (by [Lior Mualem](https://github.com/liorm)) -* [Grunt JS](http://gruntjs.com/) (by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat) and [San Chen](https://github.com/bigsan)) -* [Google API Client](https://code.google.com/p/google-api-javascript-client/) (by [Frank M](https://github.com/sgtfrankieboy)) -* [Google App Engine Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) (by [vvakame](https://github.com/vvakame)) -* [GoogleMaps](https://developers.google.com/maps/) (by [Esben Nepper](https://github.com/eNepper)) -* [GoogleMaps InfoBubble](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/) (by [Johan Nilsson](https://github.com/dashue)) -* [Google Geolocation](https://code.google.com/p/geo-location-javascript/) (by [Vincent Bortone](https://github.com/vbortone)) -* [Google Page Speed Online API](https://developers.google.com/speed/pagespeed/) (by [Frank M](https://github.com/sgtfrankieboy)) -* [Google Translate API](https://developers.google.com/translate/) (by [Frank M](https://github.com/sgtfrankieboy)) -* [Google Url Shortener](https://developers.google.com/url-shortener/) (by [Frank M](https://github.com/sgtfrankieboy)) -* [gulp](http://gulpjs.com/) (by [Drew Noakes](https://drewnoakes.com)) -* [Hammer.js](http://eightmedia.github.com/hammer.js/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Hapi](http://github.com/spumko/hapi) (by [Hakubo](http://github.com/hakubo)) -* [Handlebars](http://handlebarsjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [HashMap](https://github.com/flesler/hashmap) (by [Rafał Wrzeszcz](https://wrzasq.pl)) -* [HashSet](http://www.timdown.co.uk/jshashtable/jshashset.html) (by [Sergey Gerasimov](https://github.com/gerich-home)) -* [Hashtable](http://www.timdown.co.uk/jshashtable/) (by [Sergey Gerasimov](https://github.com/gerich-home)) -* [HelloJS](http://adodson.com/hello.js) (by [Pavel Zika](https://github.com/PavelPZ)) -* [Highcharts](http://www.highcharts.com/) (by [damianog](https://github.com/damianog)) -* [Highland](http://highlandjs.org/) (by [Bart van der Schoor](https://github.com/Bartvds/)) -* [highlight.js](https://github.com/isagalaev/highlight.js) (by [Niklas Mollenhauer](https://github.com/nikeee) and [Jeremy Hull](https://github.com/sourrust)) -* [History.js](https://github.com/browserstate/history.js) (by [Boris Yankov](https://github.com/borisyankov)) -* [Html2Canvas.js](https://github.com/niklasvh/html2canvas/) (by [Richard Hepburn](https://github.com/rwhepburn)) -* [htmlparser2](https://github.com/fb55/htmlparser2/) (by [James Roland Cabresos](https://github.com/staticfunction)) -* [http-string-parser](https://github.com/apiaryio/http-string-parser) (by [MIZUNE Pine](https://github.com/pine613)) -* [Humane.js](http://wavded.github.com/humane-js/) (by [John Vrbanac](https://github.com/jmvrbanac)) -* [i18next](http://i18next.com/) (by [Maarten Docter](https://github.com/mdocter)) -* [i18n-node](https://github.com/mashpie/i18n-node) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [iCheck](http://damirfoy.com/iCheck/) (by [Dániel Tar](https://github.com/qcz)) -* [Impress.js](https://github.com/bartaz/impress.js) (by [Boris Yankov](https://github.com/borisyankov)) -* [Intercom.js](https://github.com/diy/intercom.js) (by [Spencer Williams](https://github.com/spencerwi)) -* [Imagemagick](http://github.com/rsms/node-imagemagick) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) -* [inflection](https://github.com/dreamerslab/node.inflection) (by [Shogo Iwano](https://github.com/shiwano)) -* [insight](https://github.com/yeoman/insight) (by [vvakame](https://github.com/vvakame)) -* [interact.js](http://github.com/taye/interact.js) (by [Douglas Eichelberger](https://github.com/dduugg)) -* [Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) (by [Douglas Eichelberger](https://github.com/dduugg)) -* [Ionic-Cordova](https://github.com/driftyco/) (by [Hendrik Maus](https://github.com/hendrikmaus)) -* [iScroll](http://cubiq.org/iscroll-4) (by [Boris Yankov](https://github.com/borisyankov) and [Christiaan Rakowski](https://github.com/csrakowski)) -* [IxJS (Interactive extensions)](https://github.com/Reactive-Extensions/IxJS) (by [Igor Oleinikov](https://github.com/Igorbek)) -* [jake](https://github.com/mde/jake) (by [Kon](http://phyzkit.net/)) -* [Jasmine](http://pivotal.github.com/jasmine/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Jasmine-data_driven_tests](https://github.com/gburghardt/jasmine-data_driven_tests) (by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon)) -* [Jasmine-jQuery](https://github.com/velesin/jasmine-jquery) (by [Gregor Stamac](https://github.com/gstamac)) -* [jDataView](https://github.com/jDataView/jDataView) (by [Ingvar Stepanyan](https://github.com/RReverser)) -* [Jest](http://facebook.github.io/jest/) (by [Joshua Smith](https://github.com/Josh211ua)) -* [JointJS](http://www.jointjs.com/) (by [Aidan Reel](http://github.com/areel)) -* [jQRangeSlider](http://ghusse.github.com/jQRangeSlider) (by [Dániel Tar](https://github.com/qcz)) -* [jQuery](http://jquery.com/) (from TypeScript samples) -* [jQuery Mobile](http://jquerymobile.com) (by [Boris Yankov](https://github.com/borisyankov)) -* [jQuery UI](http://jqueryui.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [jQuery.Address](https://github.com/asual/jquery-address) (by [Martin Duparc](https://github.com/martinduparc/) and [Tim Klingeleers](https://github.com/mardaneus86/)) -* [jQuery.areYouSure](https://github.com/codedance/jquery.AreYouSure) (by [Jon Egerton](https://github.com/jonegerton)) -* [jQuery.autosize](http://www.jacklmoore.com/autosize/) (by [Jack Moore](http://www.jacklmoore.com/)) -* [jQuery.BBQ](http://benalman.com/projects/jquery-bbq-plugin/) (by [Adam R. Smith](https://github.com/sunetos)) -* [jQuery.CLEditor](http://premiumsoftware.net/CLEditor) (by [Jeffery Grajkowski](https://github.com/pushplay)) -* [jQuery.clientSideLogging](https://github.com/remybach/jQuery.clientSideLogging/) (by [Diullei Gomes](https://github.com/diullei/)) -* [jQuery.Colorbox](http://www.jacklmoore.com/colorbox/) (by [Gidon Junge](https://github.com/gjunge)) -* [jQuery.contextMenu](http://medialize.github.com/jQuery-contextMenu/) (by [Natan Vivo](https://github.com/nvivo/)) -* [jQuery.Cookie](https://github.com/carhartl/jquery-cookie) (by [Roy Goode](https://github.com/RoyGoode)) -* [jQuery.customSelect](https://github.com/adamcoulombe/jquery.customSelect) (by [tomato360](https://github.com/tomato360)) -* [jQuery.Cycle](http://jquery.malsup.com/cycle/) (by [François Guillot](http://fguillot.developpez.com/)) -* [jQuery.Cycle2](http://jquery.malsup.com/cycle2/) (by [Donny Nadolny](https://github.com/dnadolny)) -* [jQuery.dataTables](http://www.datatables.net) (by [Armin Sander](https://github.com/pragmatrix)) -* [jQuery.datetimepicker](http://trentrichardson.com/examples/timepicker/) (by [Doug McDonald](https://github.com/dougajmcdonald)) -* [jQuery.dynatree](http://code.google.com/p/dynatree/) (by [François de Campredon](https://github.com/fdecampredon)) -* [jQuery.Fileupload](https://github.com/blueimp/jQuery-File-Upload/) (by [Rob Alarcon](https://github.com/rob-alarcon)) -* [jQuery.Finger](http://ngryman.sh/jquery.finger/) (by [Max Ackley](https://github.com/maxackley)) -* [jQuery.Flot](http://www.flotcharts.org/) (by [Matt Burland](https://github.com/burlandm)) -* [jQuery.form](http://malsup.com/jquery/form/) (by [François Guillot](http://fguillot.developpez.com/)) -* [jQuery.Globalize](https://github.com/jquery/globalize) (by [Boris Yankov](https://github.com/borisyankov)) -* [jQuery.gridster](http://gridster.net) (by [Josh Baldwin](https://github.com/jbaldwin/gridster.d.ts)) -* [jQuery.jNotify](http://jnotify.codeplex.com) (by [James Curran](https://github.com/jamescurran/)) -* [jQuery.joyride](http://zurb.com/playground/jquery-joyride-feature-tour-plugin) (by [Vincent Bortone](https://github.com/vbortone)) -* [jQuery.jSignature](https://github.com/willowsystems/jSignature) (by [Patrick Magee](https://github.com/pjmagee)) -* [jQuery.leanModal](http://leanmodal.finelysliced.com.au/)(by [tomato360](https://github.com/tomato360)) -* [jQuery.notifyBar](http://www.whoop.ee/posts/2013-04-05-the-resurrection-of-jquery-notify-bar/) (by [Shunsuke Ohtani](https://github.com/zaneli)) -* [jQuery.noty](http://needim.github.io/noty/) (by [Aaron King](https://github.com/kingdango/)) -* [jQuery.payment](http://needim.github.io/noty/) (by [Eric J. Smith](https://github.com/ejsmith/)) -* [jQuery.pickadate](https://github.com/amsul/pickadate.js) (by [Theodore Brown](https://github.com/theodorejb)) -* [jQuery.pjax](https://github.com/defunkt/jquery-pjax) (by [Junle Li](https://github.com/lijunle)) -* [jQuery.pjax.falsandtru](https://github.com/falsandtru/jquery.pjax.js/) (by [NewNotMoon](http://new.not-moon.net/)) -* [jQuery.pnotify](http://sciactive.github.io/pnotify/) (by [David Sichau](https://github.com/DavidSichau/)) -* [jQuery.postMessage](http://benalman.com/projects/jquery-postmessage-plugin/) (by [Junle Li](https://github.com/lijunle)) -* [jQuery.prettyphoto](https://github.com/scaron/prettyphoto) (by [Paul Gaske](https://github.com/pgaske)) -* [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/)) -* [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/)) -* [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) (by [Blake Niemyjski](https://github.com/niemyjski)) -* [jQuery.tile](https://github.com/urin/jquery.tile.js) (by [Shunsuke Ohtani](https://github.com/zaneli)) -* [jQuery.timeago](http://timeago.yarp.com/) (by [François Guillot](http://fguillot.developpez.com/)) -* [jQuery.Timepicker](http://fgelinas.com/code/timepicker/) (by [Anwar Javed](https://github.com/anwarjaved)) -* [jQuery.Timer](http://jchavannes.com/jquery-timer/demo) (by [Joshua Strobl](https://github.com/JoshStrobl)) -* [jQuery.TinyCarousel](http://baijs.nl/tinycarousel/) (by [Christiaan Rakowski](https://github.com/csrakowski)) -* [jQuery.TinyScrollbar](http://baijs.nl/tinyscrollbar/) (by [Christiaan Rakowski](https://github.com/csrakowski)) -* [jQuery.tooltipster](https://github.com/iamceege/tooltipster) (by [Patrick Magee](https://github.com/pjmagee)) -* [jQuery.total-storage](https://github.com/Upstatement/jquery-total-storage) (by [Jeremy Brooks](https://github.com/JeremyCBrooks/)) -* [jQuery.Transit](http://ricostacruz.com/jquery.transit/) (by [MrBigDog2U](https://github.com/MrBigDog2U)) -* [jQuery.Validation](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) (by [Boris Yankov](https://github.com/borisyankov)) -* [jQuery.Watermark](http://jquery-watermark.googlecode.com) (by [Anwar Javed](https://github.com/anwarjaved)) -* [jQuery.base64](https://github.com/yatt/jquery.base64) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki)) -* [jquery-handsontable](https://github.com/handsontable/jquery-handsontable) (by [Ted John](https://github.com/intelorca)) -* [js-git](https://github.com/creationix/js-git) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [js-url](https://github.com/websanova/js-url) (by [MIZUNE Pine](https://github.com/pine613)) -* [js-yaml](https://github.com/nodeca/js-yaml) (by [Bart van der Schoor](https://github.com/Bartvds/)) -* [jsbn](http://www-cs-students.stanford.edu/%7Etjw/jsbn/) (by [Eugene Chernyshov](https://github.com/Evgenus)) -* [jScrollPane](http://jscrollpane.kelvinluck.com) (by [Dániel Tar](https://github.com/qcz)) -* [JSDeferred](http://cho45.stfuawsc.com/jsdeferred/) (by [Daisuke Mino](https://github.com/minodisk)) -* [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) (by [Vincent Bortone](https://github.com/vbortone/)) -* [JSON-Pointer](https://www.npmjs.org/package/json-pointer) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [JsRender](http://www.jsviews.com/#jsrender) (by [Kensuke MATSUZAKI](https://github.com/zakki)) -* [jStorage](http://www.jstorage.info/) (by [Danil Flores](https://github.com/dflor003/)) -* [jsTree](http://www.jstree.com/) (by [Adam Pluciński](https://github.com/adaskothebeast)) -* [JWPlayer](http://developer.longtailvideo.com/trac/) (by [Martin Duparc](https://github.com/martinduparc/)) -* [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) (by [Vincent Bortone](https://github.com/vbortone/)) -* [keymaster.js](https://github.com/madrobby/keymaster) (by [Marting W. Kirst](https://github.com/nitram509/)) -* [Keypress](https://github.com/dmauro/Keypress/) (by [Roger Chen](https://github.com/rcchen/)) -* [KineticJS](http://kineticjs.com/) (by [Basarat Ali Syed](https://github.com/basarat)) -* [Knockback](http://kmalakoff.github.com/knockback/) (by [Marcel Binot](https://github.com/docgit)) -* [Knockout.js](http://knockoutjs.com/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Knockout.Amd.Helpers](https://github.com/rniemeyer/knockout-amd-helpers) (by [David Sichau](https://github.com/DavidSichau/)) -* [Knockout.DeferredUpdates](https://github.com/mbest/knockout-deferred-updates) (by [Sebastián Galiano](https://github.com/sgaliano)) -* [Knockout.ES5](https://github.com/SteveSanderson/knockout-es5) (by [Sebastián Galiano](https://github.com/sgaliano)) -* [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC)) -* [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov)) -* [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel)) -* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) -* [Knockout Secure Binding](https://github.com/brianmhunt/knockout-secure-binding) (by [Pine Mizune](https://github.com/pine613)) -* [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig)) -* [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising)) -* [Knockstrap](http://faulknercs.github.io/Knockstrap/) (by [Adam Pluciński](https://github.com/adaskothebeast)) -* [ko.editables](http://romanych.github.com/ko.editables/) (by [Oisin Grehan](https://github.com/oising)) -* [KoLite](https://github.com/CodeSeven/kolite) (by [Boris Yankov](https://github.com/borisyankov)) -* [Lazy.js](http://danieltao.com/lazy.js/) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [Leaflet](https://github.com/Leaflet/Leaflet) (by [Vladimir](https://github.com/rgripper)) -* [Libxmljs](https://github.com/polotek/libxmljs) (by [François de Campredon](https://github.com/fdecampredon)) -* [ladda](https://github.com/hakimel/Ladda) (by [Danil Flores](https://github.com/dflor003)) -* [Levelup](https://github.com/rvagg/node-levelup) (by [Bret Little](https://github.com/blittle)) -* [linq.js](http://linqjs.codeplex.com/) (by [Marcin Najder](https://github.com/marcinnajder)) -* [Livestamp.js](https://github.com/mattbradley/livestampjs) (by [Vincent Bortone](https://github.com/vbortone)) -* [localForage](https://github.com/mozilla/localForage) (by [david pichsenmeister](https://github.com/3x14159265)) -* [Lodash](http://lodash.com/) (by [Brian Zengel](https://github.com/bczengel)) -* [Logg](https://github.com/dpup/node-logg) (by [Bret Little](https://github.com/blittle)) -* [Long.js](https://github.com/dcodeIO/Long.js) (by [Toshihide Hara](https://github.com/kerug)) -* [lz-string](https://github.com/pieroxy/lz-string) (by [Roman Nikitin](https://github.com/M0ns1gn0r)) -* [Mapbox](https://github.com/mapbox/mapbox.js/) (by [Maxime Fabre](https://github.com/anahkiasen)) -* [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr)) -* [MathJax](https://github.com/mathjax/MathJax) (by [Roland Zwaga](https://github.com/rolandzwaga)) -* [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) (by [Sarah Williams](https://github.com/flurg)) -* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave)) -* [md5.js](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) (by [MIZUNE Pine](https://github.com/pine613)) -* [Microsoft Ajax](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) (by [Patrick Magee](https://github.com/pjmagee)) -* [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk)) -* [Minimatch](https://github.com/isaacs/minimatch) (by [vvakame](https://github.com/vvakame)) -* [minimist](https://github.com/substack/minimist) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [Mithril](http://lhorie.github.io/mithril) (by [Leo Horie](https://github.com/lhorie) and [Chris Bowdon](https://github.com/cbowdon)) -* [Mixpanel](https://github.com/mixpanel/mixpanel-js) (by [Knut Eirik Leira Hjelle](https://github.com/hjellek)) -* [mixto](https://github.com/atom/mixto) (by [vvakame](https://github.com/vvakame)) -* [mocha-phantomjs](https://github.com/metaskills/mocha-phantomjs) (by [ErikSchierboom](https://github.com/ErikSchierboom)) -* [Modernizr](http://modernizr.com/) (by [Boris Yankov](https://github.com/borisyankov) and [Theodore Brown](https://github.com/theodorejb/)) -* [Moment.js](https://github.com/timrwood/moment) (by [Michael Lakerveld](https://github.com/Lakerfield)) -* [MongoDB](http://mongodb.github.io/node-mongodb-native/) (from TypeScript samples, updated by [Niklas Mollenhauer](https://github.com/nikeee)) -* [mongoose](http://mongoosejs.com/) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) -* [morgan](https://github.com/expressjs/morgan/) (by [James Roland Cabresos](https://github.com/staticfunction/)) -* [Mousetrap](http://craig.is/killing/mice) (by [Dániel Tar](https://github.com/qcz)) -* [msgpack.js](https://github.com/uupaa/msgpack.js) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki)) -* [msnodesql](https://github.com/WindowsAzure/node-sqlserver) (by [Boris Yankov](https://github.com/borisyankov) and [Maxime LUCE](https://github.com/SomaticIT)) -* [Mustache.js](https://github.com/janl/mustache.js) (by [Boris Yankov](https://github.com/borisyankov)) -* [mysql](https://github.com/felixge/node-mysql) (by [William Johnston](https://github.com/wjohnsto)) -* [nconf](https://github.com/flatiron/nconf) (by [Jeff Goddard](https://github.com/jedigo)) -* [needle](https://github.com/tomas/needle) (by [San Chen](https://github.com/bigsan)) -* [nexpect](https://github.com/nodejitsu/nexpect) (by [vvakame](https://github.com/vvakame)) -* [noble](https://github.com/sandeepmistry/noble) (by [Seon-Wook Park](https://github.com/swook)) -* [nock](https://github.com/pgte/nock) (by [bonnici](https://github.com/bonnici)) -* [Node.js](http://nodejs.org/) (from TypeScript samples) -* [node_redis](https://github.com/mranney/node_redis) (by [Boris Yankov](https://github.com/borisyankov)) -* [node-azure](https://github.com/Azure/azure-sdk-for-node) (by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna) and [Maxime LUCE](https://github.com/SomaticIT)) -* [node-ffi](https://github.com/rbranson/node-ffi) (by [Paul Loyd](https://github.com/loyd)) -* [node-form](https://github.com/rsamec/form) (by [Roman Samec](https://github.com/rsamec)) -* [node-git](https://github.com/christkv/node-git) (by [vvakame](https://github.com/vvakame)) -* [node-sqlserver](https://github.com/WindowsAzure/node-sqlserver) (by [Boris Yankov](https://github.com/borisyankov) and [Maxime LUCE](https://github.com/SomaticIT)) -* [nodeunit](https://github.com/caolan/nodeunit) (by [Jeff Goddard](https://github.com/jedigo)) -* [node_zeromq](https://github.com/JustinTulloss/zeromq.node) (by [Dave McKeown](https://github.com/davemckeown)) -* [node-tar](https://github.com/npm/node-tar) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [node-uuid](https://github.com/broofa/node-uuid) (by [Jeff May](https://github.com/jeffmay)) -* [notify.js](https://github.com/alexgibson/notify.js) (by [soundTricker](https://github.com/soundTricker)) -* [npm](https://github.com/npm/npm) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [NProgress](https://github.com/rstacruz/nprogress) (by [Judah Gabriel Himango](https://github.com/judahgabriel)) -* [Numeral.js](https://github.com/adamwdraper/Numeral-js) (by [Vincent Bortone](https://github.com/vbortone/)) -* [object-path](https://github.com/mariocasciaro/object-path) (by [Paulo Cesar](https://github.com/pocesar/)) -* [ocLazyLoad](https://github.com/ocombe/ocLazyLoad) (by [Roland Zwaga](https://github.com/rolandzwaga/)) -* [OpenLayers](https://github.com/openlayers/openlayers) (by [Ilya Bolkhovsky](https://github.com/bolhovsky/)) -* [opn](https://github.com/sindresorhus/opn) (by [Shinnosuke Watanabe](https://github.com/shinnn)) -* [Optimist](https://github.com/substack/node-optimist) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) -* [Passport](http://passportjs.org/) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) -* [passport-facebook](https://github.com/jaredhanson/passport-facebook) (by [James Roland Cabresos](https://github.com/staticfunction/)) -* [passport-local](https://github.com/jaredhanson/passport-local) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [passport-strategy](https://github.com/jaredhanson/passport-strategy) (by [Lior Mualem](https://github.com/liorm)) -* [pathwatcher](http://atom.github.io/node-pathwatcher/) (by [vvakame](https://github.com/vvakame)) -* [Parallel.js](https://github.com/adambom/parallel.js) (by [Josh Baldwin](https://github.com/jbaldwin)) -* [Parsimmon](https://github.com/jayferd/parsimmon) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin)) -* [PeerJS](http://peerjs.com/) (by [Toshiya Nakakura](https://github.com/nakakura)) -* [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame)) -* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) -* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613)) -* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) -* [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov)) -* [Physijs](http://chandlerprall.github.io/Physijs/) (by [gyoh_k](https://github.com/gyohk)) -* [Pickadate.js](https://github.com/amsul/pickadate.js) (by [Adi Dahiya](https://github.com/adidahiya)) -* [PixiJS](https://github.com/GoodBoyDigital/pixi.js) (by [Pedro Casaubon](https://github.com/xperiments)) -* [Platform](https://github.com/bestiejs/platform.js) (by [Jake Hickman](https://github.com/JakeH)) -* [podcast](http://github.com/maxnowack/node-podcast) (by [Niklas Mollenhauer](https://github.com/nikeee)) -* [PouchDB](http://pouchdb.com) (by [Bill Sears](https://github.com/MrBigDog2U/)) -* [PreloadJS](http://www.createjs.com/#!/PreloadJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) -* [ProgressJs](http://usablica.github.io/progress.js/) (by [Shunsuke Ohtani](https://github.com/zaneli)) -* [promise-pool](https://github.com/vilic/promise-pool) (by [VILIC VANE](https://github.com/vilic)) -* [Q](https://github.com/kriskowal/q) (by Barrie Nemetchek, Andrew Gaspar) -* [Qajax](https://github.com/gre/qajax) (by [Boltmade](https://github.com/Boltmade)) -* [Q-io](https://github.com/kriskowal/q-io) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [q-retry](https://github.com/vilic/q-retry) (by [VILIC VANE](https://github.com/vilic)) -* [QUnit](http://qunitjs.com/) (by [Diullei Gomes](https://github.com/Diullei)) -* [Raven.js](https://github.com/getsentry/raven-js) (by [Santi Albo](https://github.com/santialbo)) -* [Recaptcha.js](https://www.google.com/recaptcha) (by [Brent Jenkins](https://github.com/brentj73)) -* [Rickshaw](http://code.shutterstock.com/rickshaw/) (by [Blake Niemyjski](https://github.com/niemyjski)) -* [Riot.js](https://github.com/moot/riotjs) (by [vvakame](https://github.com/vvakame)) -* [Restify](https://github.com/mcavage/node-restify) (by [Bret Little](https://github.com/blittle)) -* [React](http://facebook.github.io/react/) (by [Phips Peter](https://github.com/pspeter3) -* [Redis](https://github.com/mranney/node_redis) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) -* [Request](https://github.com/mikeal/request) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) -* [Royalslider](http://dimsemenov.com/plugins/royal-slider/) (by [Christiaan Rakowski](https://github.com/csrakowski)) -* [Rx.js](http://rx.codeplex.com/) (by [gsino](http://www.codeplex.com/site/users/view/gsino), [Igor Oleinikov](https://github.com/Igorbek), [Carl de Billy](http://carl.debilly.net/), [zoetrope](https://github.com/zoetrope)) -* [Raphael](http://raphaeljs.com/) (by [CheCoxshall](https://github.com/CheCoxshall)) -* [Restangular](https://github.com/mgonto/restangular/) (by [Boris Yankov](https://github.com/borisyankov)) -* [require.js](http://requirejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/)) -* [rtree.js](https://github.com/leaflet-extras/RTree) (by [Omede Firouz](https://github.com/oefirouz)) -* [Sammy.js](http://sammyjs.org/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Select2](http://ivaynberg.github.com/select2/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Selenium WebDriverJS](https://code.google.com/p/selenium/) (by [Bill Armstrong](https://github.com/BillArmstrong)) -* [Semver](https://github.com/isaacs/node-semver) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [Sencha Touch](http://www.sencha.com/products/touch/) (by [Brian Kotek](https://github.com/brian428)) -* [sendgrid](https://github.com/sendgrid/sendgrid-nodejs) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [SharePoint](http://sptypescript.codeplex.com) (by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru) and [Andrey Markeev](http://markeev.com)) -* [ShellJS](http://shelljs.org) (by [Niklas Mollenhauer](https://github.com/nikeee)) -* [Showdown](https://github.com/coreyti/showdown) (by [Chris Bowdon](https://github.com/cbowdon)) -* [SignalR](http://www.asp.net/signalr) (by [Boris Yankov](https://github.com/borisyankov)) -* [simple-cw-node](https://github.com/astronaughts/simple-cw-node) (by [vvakame](https://github.com/vvakame)) -* [Sinon](http://sinonjs.org/) (by [William Sears](https://github.com/mrbigdog2u)) -* [SIPml](http://sipml5.org/) (by [Adriaan Groenenboom](https://github.com/chookies)) -* [sjcl](http://crypto.stanford.edu/sjcl/) (by [Eugene Chernyshov](https://github.com/Evgenus)) -* [SlickGrid](https://github.com/mleibman/SlickGrid) (by [Josh Baldwin](https://github.com/jbaldwin)) -* [smoothie](https://github.com/joewalnes/smoothie) (by [Mike H. Hawley](https://github.com/mikehhawley) and [Drew Noakes](https://drewnoakes.com)) -* [socket.io](http://socket.io) (by [William Orr](https://github.com/worr)) -* [socket.io-client](http://socket.io) (by [Maido Kaara](https://github.com/v3rm0n)) -* [SockJS](https://github.com/sockjs/sockjs-client) (by [Emil Ivanov](https://github.com/vladev)) -* [sockjs-node](https://github.com/sockjs/sockjs-node) (by [Phil McCloghry-Laing](https://github.com/pmccloghrylaing)) -* [SoundJS](http://www.createjs.com/#!/SoundJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) -* [source-map](https://github.com/mozilla/source-map) (by [Morten Houston Ludvigsen](https://github.com/MortenHoustonLudvigsen)) -* [Spin](http://fgnass.github.com/spin.js/) (by [Boris Yankov](https://github.com/borisyankov)) -* [sqlite3](https://github.com/mapbox/node-sqlite3) (by [Nick Malaguti](https://github.com/nmalaguti)) -* [stampit](https://github.com/ericelliott/stampit) (by [Vasyl Boroviak](https://github.com/koresar)) -* [status-bar](https://github.com/atom/status-bar) (by [vvakame](https://github.com/vvakame)) -* [stripe](https://stripe.com/) (by [Eric J. Smith](https://github.com/ejsmith/)) -* [Store.js](https://github.com/marcuswestin/store.js/) (by [Vincent Bortone](https://github.com/vbortone)) -* [stylus](https://github.com/LearnBoost/stylus) (by [Maxime LUCE](https://github.com/SomaticIT)) -* [Sugar](http://sugarjs.com/) (by [Josh Baldwin](https://github.com/jbaldwin/)) -* [svg-pan-zoom] (https://github.com/ariutta/svg-pan-zoom) (by [Chintan Shah] (https://github.com/Promact)) -* [swfobject](https://code.google.com/p/swfobject/) (by [rou](https://github.com/rou)) -* [Swiper](http://www.idangero.us/sliders/swiper) (by [Sebastián Galiano](https://github.com/sgaliano)) -* [SwipeView](http://cubiq.org/swipeview) (by [Boris Yankov](https://github.com/borisyankov)) -* [Swiz](https://github.com/racker/node-swiz) (by [Jeff Goddard](https://github.com/jedigo)) -* [TV4](https://github.com/geraintluff/tv4) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [Tags Manager](http://welldonethings.com/tags/manager) (by [Vincent Bortone](https://github.com/vbortone)) -* [Teechart](http://www.steema.com) (by [Steema](http://www.steema.com)) -* [text-buffer](https://github.com/atom/text-buffer) (by [vvakame](https://github.com/vvakame)) -* [text-encoding](https://github.com/inexorabletash/text-encoding) (by [MIZUNE Pine](https://github.com/pine613)) -* [three.js](http://mrdoob.github.com/three.js/) (by [Kon](http://phyzkit.net/)) -* [through2](https://github.com/rvagg/through2) (by [Bart van der Schoor](https://github.com/Bartvds) and [jedmao](https://github.com/jedmao)) -* [TimelineJS](https://github.com/NUKnightLab/TimelineJS) (by [Roland Zwaga](https://github.com/rolandzwaga)) -* [timezonecomplete](https://github.com/SpiritIT/timezonecomplete) (by [Rogier Schouten](https://github.com/rogierschouten)) -* [Toastr](https://github.com/CodeSeven/toastr) (by [Boris Yankov](https://github.com/borisyankov)) -* [trunk8](https://github.com/rviscomi/trunk8) (by [Blake Niemyjski](https://github.com/niemyjski)) -* [TweenJS](http://www.createjs.com/#!/TweenJS) (by [Pedro Ferreira](https://bitbucket.org/drk4)) -* [tween.js](https://github.com/sole/tween.js/) (by [Adam R. Smith](https://github.com/sunetos)) -* [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) (by [Blake Niemyjski](https://github.com/niemyjski)) -* [Twitter Typeahead](http://twitter.github.io/typeahead.js) (by [Ivaylo Gochkov](https://github.com/igochkov)) -* [Ubuntu Unity Web API](https://launchpad.net/libunity-webapps) (by [John Vrbanac](https://github.com/jmvrbanac)) -* [Underscore.js](http://underscorejs.org/) (by [Boris Yankov](https://github.com/borisyankov)) -* [Underscore.js (Typed)](http://underscorejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/)) -* [Underscore-ko.js](https://github.com/kamranayub/UnderscoreKO) (by [Maurits Elbers](https://github.com/MagicMau)) -* [universal-analytics](https://github.com/peaksandpies/universal-analytics) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [update-notifier](https://github.com/yeoman/update-notifier) (by [vvakame](https://github.com/vvakame)) -* [uri-templates](https://github.com/geraintluff/uri-templates) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [urlrouter](https://github.com/fengmk2/urlrouter) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) -* [UUID.js](https://github.com/LiosK/UUID.js) (by [Jason Jarrett](https://github.com/staxmanade)) -* [Valerie](https://github.com/davewatts/valerie) (by [Howard Richards](https://github.com/conficient)) -* [Velocity](http://velocityjs.org/) (by [Greg Smith](https://github.com/smrq)) -* [Viewporter](https://github.com/zynga/viewporter) (by [Boris Yankov](https://github.com/borisyankov)) -* [Vimeo](http://developer.vimeo.com/player/js-api) (by [Daz Wilkin](https://github.com/DazWilkin/)) -* [vinyl](https://github.com/wearefractal/vinyl) (by [vvakame](https://github.com/vvakame/)) -* [vinyl-fs](https://github.com/wearefractal/vinyl-fs) (by [vvakame](https://github.com/vvakame/) and [jedmao](https://github.com/jedmao)) -* [WebRTC](http://dev.w3.org/2011/webrtc/editor/webrtc.html) (by [Ken Smith](https://github.com/smithkl42)) -* [websocket](https://github.com/Worlize/WebSocket-Node) (by [Paul Loyd](https://github.com/loyd)) -* [WinJS](http://msdn.microsoft.com/en-us/library/windows/apps/br229773.aspx) (from TypeScript samples) -* [WinRT](http://msdn.microsoft.com/en-us/library/windows/apps/br211377.aspx) (from TypeScript samples) -* [wolfy87-eventemitter](https://github.com/Wolfy87/EventEmitter) (by [Ryo Iwamoto](https://github.com/ryiwamoto)) -* [ws](http://einaros.github.io/ws/) (by [Paul Loyd](https://github.com/loyd)) -* [x2js](https://code.google.com/p/x2js/) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) -* [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) (by [Michel Salib](https://github.com/michelsalib)) -* [xpath](https://github.com/goto100/xpath) (by [Andrew Bradley](https://github.com/cspotcode)) -* [XRegExp](http://xregexp.com/) (by [Bart van der Schoor](https://github.com/Bartvds)) -* [yargs](https://github.com/chevex/yargs) (by [Martin Poelstra](https://github.com/poelstra)) -* [YouTube](https://developers.google.com/youtube/) (by [Daz Wilkin](https://github.com/DazWilkin/)) -* [YouTube Analytics API](https://developers.google.com/youtube/analytics/) (by [Frank M](https://github.com/sgtfrankieboy)) -* [YouTube Data API](https://developers.google.com/youtube/v3/) (by [Frank M](https://github.com/sgtfrankieboy/)) -* [Zepto.js](http://zeptojs.com/) (by [Josh Baldwin](https://github.com/jbaldwin)) -* [Zynga Scroller](https://github.com/zynga/scroller) (by [Boris Yankov](https://github.com/borisyankov)) -* [ZeroClipboard](https://github.com/jonrohan/ZeroClipboard) (by [Eric J. Smith](https://github.com/ejsmith)) -* [Parse SDK](https://parse.com/docs/js_guide) (by [Ullisen Media Group, LLC](http://ullisenmedia.com)) From 822663f07620912d3d0e6827a7dbef9af79779dc Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 3 Nov 2014 18:25:33 +0900 Subject: [PATCH 035/292] fix invalid library names --- CONTRIBUTORS.md | 7 +++++-- form-data/form-data.d.ts | 2 +- ref-struct/ref-struct.d.ts | 2 +- ref/ref.d.ts | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 2b4c0083c0..7bbcd35034 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -63,8 +63,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bootstrap-notify/bootstrap-notify.d.ts) [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) by [Blake Niemyjski](https://github.com/niemyjski) * [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov) * [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker) -* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker) * [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin) +* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker) * [:link:](breeze/breeze.d.ts) [Breeze](http://www.breezejs.com) by [Boris Yankov](https://github.com/borisyankov), [IdeaBlade](https://github.com/IdeaBlade/Breeze) * [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby) * [:link:](browserify/browserify.d.ts) [Browserify](http://browserify.org) by [Andrew Gaspar](https://github.com/AndrewGaspar) @@ -176,6 +176,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](flipsnap/flipsnap.d.ts) [flipsnap.js](http://pxgrid.github.io/js-flipsnap) by [kubosho](https://github.com/kubosho), [gsino](https://github.com/gsino), [Mayuki Sawatari](https://github.com/mayuki) * [:link:](flot/jquery.flot.d.ts) [Flot](http://www.flotcharts.org) by [Matt Burland](https://github.com/burlandm) * [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Douglas Eichelberger](https://github.com/dduugg) +* [:link:](form-data/form-data.d.ts) [form-data](https://github.com/felixge/node-form-data) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov) * [:link:](fpsmeter/FPSMeter.d.ts) [FPSmeter](http://darsa.in/fpsmeter) by [Aaron Lampros](http://github.com/alampros) * [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds) @@ -196,8 +197,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](google.analytics/ga.d.ts) [Google Analytics (Classic and Universal)](https://developers.google.com/analytics/devguides/collection/gajs) by [Ronnie Haakon Hegelund](http://ronniehegelund.blogspot.dk), [Pat Kujawa](http://patkujawa.com) * [:link:](gapi/gapi.d.ts) [Google API Client](https://code.google.com/p/google-api-javascript-client) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](google.feeds/google.feed.api.d.ts) [Google Feed Apis](https://developers.google.com/feed) by [RodneyJT](https://github.com/RodneyJT) -* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone) * [:link:](googlemaps/google.maps.d.ts) [Google Geolocation](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk) +* [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone) * [:link:](gapi.pagespeedonline/gapi.pagespeedonline.d.ts) [Google Page Speed Online Api](https://developers.google.com/speed/pagespeed) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73) * [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy) @@ -490,7 +491,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](react-addons/react-addons.d.ts) [React with Addons 0.12.RC](http://facebook.github.io/react) by [Asana](https://asana.com) * [:link:](readdir-stream/readdir-stream.d.ts) [readdir-stream](https://github.com/logicalparadox/readdir-stream) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](redis/redis.d.ts) [redis](https://github.com/mranney/node_redis) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [Peter Harris](https://github.com/CodeAnimal) +* [:link:](ref/ref.d.ts) [ref](https://github.com/TooTallNate/ref) by [Paul Loyd](https://github.com/loyd) * [:link:](ref-array/ref-array.d.ts) [ref-array](https://github.com/TooTallNate/ref-array) by [Paul Loyd](https://github.com/loyd) +* [:link:](ref-struct/ref-struct.d.ts) [ref-struct](https://github.com/TooTallNate/ref-struct) by [Paul Loyd](https://github.com/loyd) * [:link:](ref-union/ref-union.d.ts) [ref-union](https://github.com/TooTallNate/ref-union) by [Paul Loyd](https://github.com/loyd) * [:link:](threejs/three-renderpass.d.ts) [RenderPass.js](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/RenderPass.js) by [Satoru Kimura](https://github.com/gyohk) * [:link:](request/request.d.ts) [request](https://github.com/mikeal/request) by [Carlos Ballesteros Velasco](https://github.com/soywiz), [bonnici](https://github.com/bonnici), [Bart van der Schoor](https://github.com/Bartvds) diff --git a/form-data/form-data.d.ts b/form-data/form-data.d.ts index af0f2d799b..0f22b8ff5a 100644 --- a/form-data/form-data.d.ts +++ b/form-data/form-data.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fibers +// Type definitions for form-data // Project: https://github.com/felixge/node-form-data // Definitions by: Carlos Ballesteros Velasco // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/ref-struct/ref-struct.d.ts b/ref-struct/ref-struct.d.ts index 7c2019655c..2a7ac02e96 100644 --- a/ref-struct/ref-struct.d.ts +++ b/ref-struct/ref-struct.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ref-union +// Type definitions for ref-struct // Project: https://github.com/TooTallNate/ref-struct // Definitions by: Paul Loyd // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/ref/ref.d.ts b/ref/ref.d.ts index 86e7840bed..5967ea3745 100644 --- a/ref/ref.d.ts +++ b/ref/ref.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ref-union +// Type definitions for ref // Project: https://github.com/TooTallNate/ref // Definitions by: Paul Loyd // Definitions: https://github.com/borisyankov/DefinitelyTyped From 800a7047cf275cc9f695cbd116748cd408a09d6d Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 3 Nov 2014 18:45:14 +0900 Subject: [PATCH 036/292] fix invalid version naming --- CONTRIBUTORS.md | 16 ++++++++-------- assertion-error/assertion-error.d.ts | 2 +- buffer-equal/buffer-equal.d.ts | 2 +- business-rules-engine/business-rules-engine.d.ts | 2 +- canvasjs/canvasjs.d.ts | 2 +- casperjs/casperjs.d.ts | 2 +- chai-fuzzy/chai-fuzzy.d.ts | 2 +- jasmine-matchers/jasmine-matchers.d.ts | 2 +- node-azure/azure.d.ts | 10 +++++----- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 7bbcd35034..ba5ef048fb 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -37,7 +37,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](arbiter/Arbiter.d.ts) [Arbiter.js](http://arbiterjs.com) by [Arash Shakery](https://github.com/arash16) * [:link:](asciify/asciify.d.ts) [asciify](https://www.npmjs.org/package/asciify) by [Alan Norbauer](http://alan.norbauer.com) * [:link:](assert/assert.d.ts) [assert and power-assert](https://github.com/Jxck/assert) by [vvakame](https://github.com/vvakame) -* [:link:](assertion-error/assertion-error.d.ts) [assertion-error 1.0 0](https://github.com/chaijs/assertion-error) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](assertion-error/assertion-error.d.ts) [assertion-error](https://github.com/chaijs/assertion-error) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](async/async.d.ts) [Async](https://github.com/caolan/async) by [Boris Yankov](https://github.com/borisyankov) * [:link:](atmosphere/atmosphere.d.ts) [Atmosphere](https://github.com/Atmosphere/atmosphere-javascript) by [Kai Toedter](https://github.com/toedter) * [:link:](atom/atom.d.ts) [Atom](https://atom.io) by [vvakame](https://github.com/vvakame) @@ -45,7 +45,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](auth0/auth0.d.ts) [Auth0.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) * [:link:](auth0.widget/auth0.widget.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) * [:link:](aws-sdk/aws-sdk.d.ts) [aws-sdk](https://github.com/aws/aws-sdk-js) by [midknight41](https://github.com/midknight41) -* [:link:](node-azure/azure.d.ts) [Azure SDK for Node -](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](node-azure/azure.d.ts) [Azure SDK for Node](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT) * [:link:](backbone/backbone.d.ts) [Backbone](http://backbonejs.org) by [Boris Yankov](https://github.com/borisyankov), [Natan Vivo](https://github.com/nvivo) * [:link:](backbone-relational/backbone-relational.d.ts) [Backbone-relational](http://backbonerelational.org) by [Eirik Hoem](https://github.com/eirikhm) * [:link:](backgrid/backgrid.d.ts) [Backgrid](http://backgridjs.com) by [Jeremy Lujan](https://github.com/jlujan) @@ -69,17 +69,17 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby) * [:link:](browserify/browserify.d.ts) [Browserify](http://browserify.org) by [Andrew Gaspar](https://github.com/AndrewGaspar) * [:link:](bucks/bucks.d.ts) [bucks.js](https://github.com/CyberAgent/bucks.js) by [Shunsuke Ohtani](https://github.com/zaneli) -* [:link:](buffer-equal/buffer-equal.d.ts) [buffer-equal 1.0 0](https://github.com/substack/node-buffer-equal) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](buffer-equal/buffer-equal.d.ts) [buffer-equal](https://github.com/substack/node-buffer-equal) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](bl/bl.d.ts) [BufferList](https://github.com/rvagg/bl) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](bufferstream/bufferstream.d.ts) [bufferstream](https://github.com/dodo/node-bufferstream) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine -](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) +* [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) * [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com) -* [:link:](canvasjs/canvasjs.d.ts) [CanvasJS v1.5.1 GA](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5) +* [:link:](canvasjs/canvasjs.d.ts) [CanvasJS](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5) * [:link:](threejs/three-canvasrenderer.d.ts) [CanvasRenderer.js](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js) by [Satoru Kimura](https://github.com/gyohk) -* [:link:](casperjs/casperjs.d.ts) [CasperJS v1.0.0 API](http://casperjs.org) by [Jed Mao](https://github.com/jedmao) +* [:link:](casperjs/casperjs.d.ts) [CasperJS](http://casperjs.org) by [Jed Mao](https://github.com/jedmao) * [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Hunsaker](https://github.com/jedhunsaker), [Bart van der Schoor](https://github.com/Bartvds) * [:link:](chai-datetime/chai-datetime.d.ts) [chai-datetime](https://github.com/gaslight/chai-datetime.git) by [Cliff Burger](https://github.com/cliffburger) -* [:link:](chai-fuzzy/chai-fuzzy.d.ts) [chai-fuzzy 1.3.0 assert style](http://chaijs.com/plugins/chai-fuzzy) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](chai-fuzzy/chai-fuzzy.d.ts) [chai-fuzzy](http://chaijs.com/plugins/chai-fuzzy) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](chai-jquery/chai-jquery.d.ts) [chai-jquery](https://github.com/chaijs/chai-jquery) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) * [:link:](chalk/chalk.d.ts) [chalk](https://github.com/sindresorhus/chalk) by [Diullei Gomes](https://github.com/Diullei), [Bart van der Schoor](https://github.com/Bartvds) * [:link:](chartjs/chart.d.ts) [Chart.js](https://github.com/nnnick/Chart.js) by [Steve Fenton](https://github.com/Steve-Fenton) @@ -247,7 +247,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jasmine-data_driven_tests/jasmine-data_driven_tests.d.ts) [Jasmine Data Driven Tests](https://github.com/gburghardt/jasmine-data_driven_tests) by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon) * [:link:](jasmine-fixture/jasmine-fixture.d.ts) [Jasmine-fixture](https://github.com/searls/jasmine-fixture) by [Craig Brett](https://github.com/craigbrett17) * [:link:](jasmine-jquery/jasmine-jquery.d.ts) [Jasmine-JQuery](https://github.com/velesin/jasmine-jquery) by [Gregor Stamac](https://github.com/gstamac) -* [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers v0.2.1 API](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](jdataview/jdataview.d.ts) [jDataView](https://github.com/jDataView/jDataView) by [Ingvar Stepanyan](https://github.com/RReverser) * [:link:](jest/jest.d.ts) [Jest](http://facebook.github.io/jest) by [Asana](https://asana.com) * [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds) diff --git a/assertion-error/assertion-error.d.ts b/assertion-error/assertion-error.d.ts index 5b63d63cf2..08217c9e54 100644 --- a/assertion-error/assertion-error.d.ts +++ b/assertion-error/assertion-error.d.ts @@ -1,4 +1,4 @@ -// Type definitions for assertion-error 1.0 0 +// Type definitions for assertion-error 1.0.0 // Project: https://github.com/chaijs/assertion-error // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/buffer-equal/buffer-equal.d.ts b/buffer-equal/buffer-equal.d.ts index a3597c6847..d6af4f8134 100644 --- a/buffer-equal/buffer-equal.d.ts +++ b/buffer-equal/buffer-equal.d.ts @@ -1,4 +1,4 @@ -// Type definitions for buffer-equal 1.0 0 +// Type definitions for buffer-equal 0.0.1 // Project: https://github.com/substack/node-buffer-equal // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/business-rules-engine/business-rules-engine.d.ts b/business-rules-engine/business-rules-engine.d.ts index 7c17714cc5..7ca758eb88 100644 --- a/business-rules-engine/business-rules-engine.d.ts +++ b/business-rules-engine/business-rules-engine.d.ts @@ -1,4 +1,4 @@ -// Type definitions for business-rules-engine - v1.0.20 +// Type definitions for business-rules-engine v1.0.20 // Project: https://github.com/rsamec/form // Definitions by: Roman Samec // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/canvasjs/canvasjs.d.ts b/canvasjs/canvasjs.d.ts index f572ce3298..6de602c7e0 100644 --- a/canvasjs/canvasjs.d.ts +++ b/canvasjs/canvasjs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for CanvasJS v1.5.1 GA +// Type definitions for CanvasJS v1.5.1 // Project: http://canvasjs.com/ // Definitions by: Mark Overholt // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/casperjs/casperjs.d.ts b/casperjs/casperjs.d.ts index 6cb40a6a6d..f03840380c 100644 --- a/casperjs/casperjs.d.ts +++ b/casperjs/casperjs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for CasperJS v1.0.0 API +// Type definitions for CasperJS v1.0.0 // Project: http://casperjs.org/ // Definitions by: Jed Mao // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/chai-fuzzy/chai-fuzzy.d.ts b/chai-fuzzy/chai-fuzzy.d.ts index 0cbb1741b9..acfb515f41 100644 --- a/chai-fuzzy/chai-fuzzy.d.ts +++ b/chai-fuzzy/chai-fuzzy.d.ts @@ -1,4 +1,4 @@ -// Type definitions for chai-fuzzy 1.3.0 assert style +// Type definitions for chai-fuzzy 1.3.0 // Project: http://chaijs.com/plugins/chai-fuzzy // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/jasmine-matchers/jasmine-matchers.d.ts b/jasmine-matchers/jasmine-matchers.d.ts index 059b8075e2..c7f2018e43 100644 --- a/jasmine-matchers/jasmine-matchers.d.ts +++ b/jasmine-matchers/jasmine-matchers.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jasmine-matchers v0.2.1 API +// Type definitions for jasmine-matchers v0.2.1 // Project: https://github.com/uxebu/jasmine-matchers // Definitions by: Bart van der Schoor // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/node-azure/azure.d.ts b/node-azure/azure.d.ts index 5328dd9371..91c5c0bf0b 100644 --- a/node-azure/azure.d.ts +++ b/node-azure/azure.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Azure SDK for Node - v0.9.16 +// Type definitions for Azure SDK for Node v0.9.16 // Project: https://github.com/WindowsAzure/azure-sdk-for-node // Definitions by: Andrew Gaspar , // Anti Veeranna , @@ -159,13 +159,13 @@ declare module "azure" { //#region Service Methods /** - * Gets the properties of a storage accounts Blob service, including Azure Storage Analytics. + * Gets the properties of a storage account�s Blob service, including Azure Storage Analytics. */ getServiceProperties(callback: StorageServicePropertiesCallback): void; getServiceProperties(options: TimeoutIntervalOptions, callback: StorageServicePropertiesCallback): void; /** - * Sets the properties of a storage accounts Blob service, including Azure Storage Analytics. + * Sets the properties of a storage account�s Blob service, including Azure Storage Analytics. * You can also use this operation to set the default request version for all incoming requests that do not have a version specified. */ setServiceProperties(serviceProperties: StorageServiceProperties, callback: StorageCallbackVoid): void; @@ -521,13 +521,13 @@ declare module "azure" { //#region Service Methods /** - * Gets the properties of a storage accounts Blob service, including Azure Storage Analytics. + * Gets the properties of a storage account�s Blob service, including Azure Storage Analytics. */ getServiceProperties(callback: StorageServicePropertiesCallback): void; getServiceProperties(options: TimeoutIntervalOptions, callback: StorageServicePropertiesCallback): void; /** - * Sets the properties of a storage accounts Blob service, including Azure Storage Analytics. + * Sets the properties of a storage account�s Blob service, including Azure Storage Analytics. * You can also use this operation to set the default request version for all incoming requests that do not have a version specified. */ setServiceProperties(serviceProperties: StorageServiceProperties, callback: StorageCallbackVoid): void; From 381882fd9e78754a3bbb522810b6a1a0746f268c Mon Sep 17 00:00:00 2001 From: vvakame Date: Mon, 3 Nov 2014 19:12:43 +0900 Subject: [PATCH 037/292] fix jquery.ui.layout/jquery.ui.layout.d.ts header --- CONTRIBUTORS.md | 2 +- jquery.ui.layout/jquery.ui.layout.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ba5ef048fb..da1fb51a1c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -275,6 +275,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.tinyscrollbar/jquery.tinyscrollbar.d.ts) [jQuery tinyscrollbar](http://baijs.nl/tinyscrollbar) by [Christiaan Rakowski](https://github.com/csrakowski) * [:link:](jquery.tooltipster/jquery.tooltipster.d.ts) [jQuery Tooltipster](https://github.com/iamceege/tooltipster) by [Patrick Magee](https://github.com/pjmagee) * [:link:](jquery.ui.datetimepicker/jquery.ui.datetimepicker.d.ts) [jQuery UI DateTimePicker](http://trentrichardson.com/examples/timepicker) by [dougajmcdonald](https://github.com/dougajmcdonald) +* [:link:](jquery.ui.layout/jquery.ui.layout.d.ts) [jQuery UI Layout Plug-in](http://layout.jquery-dev.net) by [Steve Fenton](https://github.com/Steve-Fenton) * [:link:](jquery.timepicker/jquery.timepicker.d.ts) [jQuery UI Timepicker](http://fgelinas.com/code/timepicker) by [Anwar Javed](https://github.com/anwarjaved) * [:link:](jquery-handsontable/jquery-handsontable.d.ts) [jquery-handsontable](http://handsontable.com) by [Ted John](https://github.com/intelorca) * [:link:](jquery.menuaim/jquery.menuaim.d.ts) [jQuery-menu-aim](https://github.com/kamens/jQuery-menu-aim) by [Robert Fonseca-Ensor](http://www.robfe.com) @@ -309,7 +310,6 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.validation/jquery.validation.d.ts) [jquery.validation](http://jqueryvalidation.org) by [François de Campredon](https://github.com/fdecampredon), [Johj Reilly](https://github.com/johnnyreilly) * [:link:](jquery.timer/jquery.timer.d.ts) [jQueryTimer](https://github.com/jchavannes/jquery-timer) by [Joshua Strobl](https://github.com/JoshStrobl) * [:link:](jquery.total-storage/jquery.total-storage.d.ts) [jQueryTotalStorage](https://github.com/Upstatement/jquery-total-storage) by [Jeremy Brooks](https://github.com/JeremyCBrooks) -* [:link:](jquery.ui.layout/jquery.ui.layout.d.ts) [jQueryUI](http://layout.jquery-dev.net) by [Steve Fenton](https://github.com/Steve-Fenton) * [:link:](jqueryui/jqueryui.d.ts) [jQueryUI](http://jqueryui.com) by [Boris Yankov](https://github.com/borisyankov), [John Reilly](https://github.com/johnnyreilly) * [:link:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) * [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds) diff --git a/jquery.ui.layout/jquery.ui.layout.d.ts b/jquery.ui.layout/jquery.ui.layout.d.ts index 01ec42570a..b15dd33867 100644 --- a/jquery.ui.layout/jquery.ui.layout.d.ts +++ b/jquery.ui.layout/jquery.ui.layout.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jQueryUI 1.9 +// Type definitions for jQuery UI Layout Plug-in // Project: http://layout.jquery-dev.net/ // Definitions by: Steve Fenton // Definitions: https://github.com/borisyankov/DefinitelyTyped From a3c57a84a51084b829196437416e5eed8d665496 Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Wed, 5 Nov 2014 15:01:00 +0530 Subject: [PATCH 038/292] Added test file --- jquery.rowGrid/jquery.rowGrid-tests.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 jquery.rowGrid/jquery.rowGrid-tests.ts diff --git a/jquery.rowGrid/jquery.rowGrid-tests.ts b/jquery.rowGrid/jquery.rowGrid-tests.ts new file mode 100644 index 0000000000..be4cb443eb --- /dev/null +++ b/jquery.rowGrid/jquery.rowGrid-tests.ts @@ -0,0 +1,24 @@ +/// +/// + +/* + * Testing different options + */ + +var options = { + minMargin: 10, + maxMargin: 35, + itemSelector: ".item" +}; + +$(".container").rowGrid(options); + + +/* + * Test endless scrolling + */ + +// append new items +$(".container").append("
"); +// arrange appended items +$(".container").rowGrid("appended"); \ No newline at end of file From f71c594fb6fdb84bf7fd28d8cda58a5ac40584a1 Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Wed, 5 Nov 2014 15:08:15 +0530 Subject: [PATCH 039/292] Fixed the comment --- jquery.rowGrid/jquery.rowGrid-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.rowGrid/jquery.rowGrid-tests.ts b/jquery.rowGrid/jquery.rowGrid-tests.ts index be4cb443eb..cb11d65964 100644 --- a/jquery.rowGrid/jquery.rowGrid-tests.ts +++ b/jquery.rowGrid/jquery.rowGrid-tests.ts @@ -2,7 +2,7 @@ /// /* - * Testing different options + * Test different options */ var options = { From de91990ef21174f371ab250f68ce6ab5fb641285 Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Mon, 3 Nov 2014 19:50:00 +0530 Subject: [PATCH 040/292] Added interface for rowGrid.js --- jquery.rowGrid/jquery.rowGrid.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 jquery.rowGrid/jquery.rowGrid.d.ts diff --git a/jquery.rowGrid/jquery.rowGrid.d.ts b/jquery.rowGrid/jquery.rowGrid.d.ts new file mode 100644 index 0000000000..4b136d2bac --- /dev/null +++ b/jquery.rowGrid/jquery.rowGrid.d.ts @@ -0,0 +1,17 @@ +// Type definitions for jQuery rowGrid.js plugin (v1.0.2) +// Project: https://github.com/brunjo/rowGrid.js +// Definitions by: Vinayak Garg +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface JQueryRowGridJSOptions { + minMargin?: number; + maxMargin?: number; + itemSelector: string; +} + +interface JQuery { + rowGrid(options?: JQueryRowGridJSOptions): JQuery; + rowGrid(appended: string): JQuery; +} \ No newline at end of file From b4145190265c07661b17b0c15a6fa127fd4d39ba Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Mon, 3 Nov 2014 20:02:55 +0530 Subject: [PATCH 041/292] Added name in CONTRIBUTORS.md --- CONTRIBUTORS.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9d27a0d1d4..639abfb7aa 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -63,7 +63,7 @@ All definitions files include a header with the author and editors, so at some p * [Clone](https://github.com/pvorb/node-clone) (by [Kieran Simpson](https://github.com/kierans)) * [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) * [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem) and [vvakame](https://github.com/vvakame)) -* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) * [cookie](https://github.com/jshttp/cookie) (by [Pine Mizune](https://github.com/jshttp/cookie)) * [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/)) * [Cordovarduino](https://github.com/stereolux/cordovarduino) (by [Hendrik Maus](https://github.com/hendrikmaus)) @@ -207,6 +207,7 @@ All definitions files include a header with the author and editors, so at some p * [jQuery.pnotify](http://sciactive.github.io/pnotify/) (by [David Sichau](https://github.com/DavidSichau/)) * [jQuery.postMessage](http://benalman.com/projects/jquery-postmessage-plugin/) (by [Junle Li](https://github.com/lijunle)) * [jQuery.prettyphoto](https://github.com/scaron/prettyphoto) (by [Paul Gaske](https://github.com/pgaske)) +* [jQuery.rowGrid](https://github.com/brunjo/rowGrid.js) (by [Vinayak Garg](https://github.com/vinayak-garg)) * [jQuery.scrollTo](https://github.com/flesler/jquery.scrollTo) (by [Neil Stalker](https://github.com/nestalk/)) * [jQuery.simplePagination](https://github.com/flaviusmatis/simplePagination.js) (by [Natan Vivo](https://github.com/nvivo/)) * [jquery.superLink](http://james.padolsey.com/demos/plugins/jQuery/superLink/superlink.jquery.js) (by [Blake Niemyjski](https://github.com/niemyjski)) @@ -248,7 +249,7 @@ All definitions files include a header with the author and editors, so at some p * [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC)) * [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov)) * [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel)) -* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) +* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek)) * [Knockout Secure Binding](https://github.com/brianmhunt/knockout-secure-binding) (by [Pine Mizune](https://github.com/pine613)) * [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig)) * [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising)) @@ -326,9 +327,9 @@ All definitions files include a header with the author and editors, so at some p * [PDF.js](https://github.com/mozilla/pdf.js) (by [Josh Baldwin](https://github.com/jbaldwin)) * [PeerJS](http://peerjs.com/) (by [Toshiya Nakakura](https://github.com/nakakura)) * [PEG.js](http://pegjs.majda.cz/) (by [vvakame](https://github.com/vvakame)) -* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) -* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613)) -* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) +* [Persona](http://www.mozilla.org/en-US/persona) (by [James Frasca](https://github.com/Nycto)) +* [PgwModal](http://pgwjs.com/pgwmodal/) (by [Pine Mizune](https://github.com/pine613)) +* [PhantomJS](http://phantomjs.org) (by [Jed Hunsaker](https://github.com/jedhunsaker)) * [PhoneGap](http://phonegap.com) (by [Boris Yankov](https://github.com/borisyankov)) * [Physijs](http://chandlerprall.github.io/Physijs/) (by [gyoh_k](https://github.com/gyohk)) * [Pickadate.js](https://github.com/amsul/pickadate.js) (by [Adi Dahiya](https://github.com/adidahiya)) From e9fa156a9c870c34dc98243e9bf9d20b83ecac1b Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Wed, 5 Nov 2014 15:01:00 +0530 Subject: [PATCH 042/292] Added test file --- jquery.rowGrid/jquery.rowGrid-tests.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 jquery.rowGrid/jquery.rowGrid-tests.ts diff --git a/jquery.rowGrid/jquery.rowGrid-tests.ts b/jquery.rowGrid/jquery.rowGrid-tests.ts new file mode 100644 index 0000000000..be4cb443eb --- /dev/null +++ b/jquery.rowGrid/jquery.rowGrid-tests.ts @@ -0,0 +1,24 @@ +/// +/// + +/* + * Testing different options + */ + +var options = { + minMargin: 10, + maxMargin: 35, + itemSelector: ".item" +}; + +$(".container").rowGrid(options); + + +/* + * Test endless scrolling + */ + +// append new items +$(".container").append("
"); +// arrange appended items +$(".container").rowGrid("appended"); \ No newline at end of file From 8e017781ba31f23baf611a556db312a0b5545bd6 Mon Sep 17 00:00:00 2001 From: Vinayak Garg Date: Wed, 5 Nov 2014 15:08:15 +0530 Subject: [PATCH 043/292] Fixed the comment --- jquery.rowGrid/jquery.rowGrid-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.rowGrid/jquery.rowGrid-tests.ts b/jquery.rowGrid/jquery.rowGrid-tests.ts index be4cb443eb..cb11d65964 100644 --- a/jquery.rowGrid/jquery.rowGrid-tests.ts +++ b/jquery.rowGrid/jquery.rowGrid-tests.ts @@ -2,7 +2,7 @@ /// /* - * Testing different options + * Test different options */ var options = { From f4c08ac9ea9ab6ed3f29b8f74082cf5d011eeece Mon Sep 17 00:00:00 2001 From: armorik83 Date: Thu, 6 Nov 2014 00:12:16 +0900 Subject: [PATCH 044/292] add yeoman-generator/yeoman-generator.d.ts --- yeoman-generator/yeoman-generator-tests.ts | 114 +++++++++++++++++ yeoman-generator/yeoman-generator.d.ts | 141 +++++++++++++++++++++ 2 files changed, 255 insertions(+) create mode 100644 yeoman-generator/yeoman-generator-tests.ts create mode 100644 yeoman-generator/yeoman-generator.d.ts diff --git a/yeoman-generator/yeoman-generator-tests.ts b/yeoman-generator/yeoman-generator-tests.ts new file mode 100644 index 0000000000..84f0072065 --- /dev/null +++ b/yeoman-generator/yeoman-generator-tests.ts @@ -0,0 +1,114 @@ +/// +import yeoman = require('yeoman-generator'); + +var base = yeoman.generators.Base; +var namedBase = yeoman.generators.NamedBase; + +var generator = base.extend({ + initializing: function() { + return; + }, + writing: { + app: function() { + return; + }, + other: function() { + return; + } + }, + end: function() { + return; + } +}); + +generator.argument('name', { + desc: 'desc', + required: true, + optional: true, + type: 'any', + defaults: 'any', +}); + +var compose = generator.composeWith('namespace', 'any', { + local: 'local', + link: 'link' +}); + +compose.defaultFor('name'); +compose.destinationRoot('rootPath') === 'string'; +compose.determineAppname(); +compose.getCollisionFilter()('output'); +compose.hookFor('name', { + as: 'string', + args: 'any', + options: 'any' +}); +compose.option('name', { + alias: 'string', + defaults: 'any', + desc: 'string', + hide: true, + type: 'any' +}); +var returnString: boolean; +returnString = compose.rootGeneratorName() === 'string'; +compose.run('args'); +compose.run('args', () => { + return; +}); +compose.runHooks(() => { + return; +}); +returnString = compose.sourceRoot('rootPath') === 'string'; + +var assert = yeoman.assert; + +assert.file('path'); +assert.file(['paths', 'paths']); +assert.fileContent('file', /.*/); +assert.fileContent([ + ['string', /.*/], + ['string', /.*/], + ['string', /.*/] +]); +assert.files([ + ['string', /.*/], + 'string', + ['string', /.*/], + 'string' +]); +assert.implement('subject', 'methods'); +assert.noFile('file'); +assert.noFileContent('file', /.*/); +assert.noFileContent([ + ['string', /.*/], + ['string', /.*/], + ['string', /.*/] +]); +assert.noImplement('subject', 'methods'); +assert.textEqual('value', 'expected'); + +var test = yeoman.test; +var dummyGen = test.createDummyGenerator(); +dummyGen.determineAppname(); + +var createdGen = test.createGenerator('name', ['any', 'amy'], 'args', 'options'); +createdGen.determineAppname(); + +test.decorate('context', 'method', () => { + return; // replacement +}, 'options'); +test.gruntfile('options', () => { + return; // done +}); +test.mockPrompt(createdGen, 'answers'); +test.registerDependencies(['dependencies', 'dependencies']); +test.restore(); +var runContext = test.run('generator'); + +runContext.async()(); +runContext.inDir('dirPath') + .withArguments('args') + .withGenerators(['deps', 'deps']) + .withOptions('opts') + .withPrompts('answers'); diff --git a/yeoman-generator/yeoman-generator.d.ts b/yeoman-generator/yeoman-generator.d.ts new file mode 100644 index 0000000000..aed7a8f034 --- /dev/null +++ b/yeoman-generator/yeoman-generator.d.ts @@ -0,0 +1,141 @@ +// Type definitions for yeoman-generator +// Project: https://github.com/yeoman/generator +// Definitions by: Kentaro Okuno +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module yo { + export interface IYeomanGenerator { + argument(name: string, config: IArgumentConfig): void; + composeWith(namespace: string, options: any, settings?: IComposeSetting): IYeomanGenerator; + defaultFor(name: string): void; + destinationRoot(rootPath: string): string; + determineAppname(): void; + getCollisionFilter(): (output: any) => void; + hookFor(name: string, config: IHookConfig): void; + option(name: string, config: IYeomanGeneratorOption): void; + rootGeneratorName(): string; + run(args?: any): void; + run(args: any, callback?: Function): void; + runHooks(callback?: Function): void; + sourceRoot(rootPath: string): string; + } + + export interface IArgumentConfig { + desc: string; + required: boolean; + optional: boolean; + type: any; + defaults: any; + } + + export interface IComposeSetting { + local?: string; + link?: string; + } + + export interface IHookConfig { + as: string; + args: any; + options: any; + } + + export interface IYeomanGeneratorOption { + alias: string; + defaults: any; + desc: string; + hide: boolean; + type: any; + } + + export interface IQueueProps { + initializing: () => void; + prompting?: () => void; + configuring?: () => void; + default?: () => void; + writing: { + [target: string]: () => void; + }; + conflicts?: () => void; + install?: () => void; + end: () => void; + } + + export interface IBase { + new(args: string, options: any): IYeomanGenerator; + new(args: string[], options: any): IYeomanGenerator; + extend(protoProps: IQueueProps, staticProps?: any): IYeomanGenerator; + } + + export interface INamedBase { + new(args: string, options: any): IYeomanGenerator; + new(args: string[], options: any): IYeomanGenerator; + } + + export interface IAssert { + file(path: string): void; + file(paths: string[]): void; + fileContent(file: string, reg: RegExp): void; + + /** @param {[String, RegExp][]} pairs */ + fileContent(pairs: any[][]): void; + + /** @param {[String, RegExp][]|String[]} pairs */ + files(pairs: any[]): void; + + /** + * @param {Object} subject + * @param {Object|Array} methods + */ + implement(subject: any, methods: any): void; + noFile(file: string): void; + noFileContent(file: string, reg: RegExp): void; + + /** @param {[String, RegExp][]} pairs */ + noFileContent(pairs: any[][]): void; + + /** + * @param {Object} subject + * @param {Object|Array} methods + */ + noImplement(subject: any, methods: any): void; + + textEqual(value: string, expected: string): void; + } + + export interface ITestHelper { + createDummyGenerator(): IYeomanGenerator; + createGenerator(name: string, dependencies: any[], args: any, options: any): IYeomanGenerator; + decorate(context: any, method: string, replacement: Function, options: any): void; + gruntfile(options: any, done: Function): void; + mockPrompt(generator: IYeomanGenerator, answers: any): void; + registerDependencies(dependencies: string[]): void; + restore(): void; + + /** @param {String|Function} generator */ + run(generator: any): IRunContext; + } + + export interface IRunContext { + async(): Function; + inDir(dirPath: string): IRunContext; + + /** @param {String|String[]} args */ + withArguments(args: any): IRunContext; + withGenerators(dependencies: string[]): IRunContext; + withOptions(options: any): IRunContext; + withPrompts(answers: any): IRunContext; + } + + /** @type file file-utils */ + var file: any; + var assert: IAssert; + var test: ITestHelper; + var generators: { + Base: IBase; + NamedBase: INamedBase; + }; +} + +declare module "yeoman-generator" { + export = yo; +} From 0ddb142d5104efae4b45b76abe6d788396b498ee Mon Sep 17 00:00:00 2001 From: armorik83 Date: Thu, 6 Nov 2014 01:04:01 +0900 Subject: [PATCH 045/292] add yosay/yosay.d.ts --- yosay/yosay-tests.ts | 3 +++ yosay/yosay.d.ts | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 yosay/yosay-tests.ts create mode 100644 yosay/yosay.d.ts diff --git a/yosay/yosay-tests.ts b/yosay/yosay-tests.ts new file mode 100644 index 0000000000..257b546eae --- /dev/null +++ b/yosay/yosay-tests.ts @@ -0,0 +1,3 @@ +/// +import yosay = require('yosay'); +yosay('Welcome to the generator!', {maxLength: 20}); \ No newline at end of file diff --git a/yosay/yosay.d.ts b/yosay/yosay.d.ts new file mode 100644 index 0000000000..a46049e102 --- /dev/null +++ b/yosay/yosay.d.ts @@ -0,0 +1,9 @@ +// Type definitions for yosay +// Project: https://github.com/yeoman/yosay +// Definitions by: Kentaro Okuno +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'yosay' { + function yosay(message?: string, options?: {maxLength: number}): string; + export = yosay; +} \ No newline at end of file From 779d3e58b6d77cb0f1bcb9f7b5b56013a4ed99ae Mon Sep 17 00:00:00 2001 From: in-async Date: Thu, 6 Nov 2014 01:38:27 +0900 Subject: [PATCH 046/292] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AE=E6=9B=B4=E6=96=B0=E9=80=94=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- angularfire/angularfire-tests.ts | 45 ++++++++++++++++++++------- angularfire/angularfire.d.ts | 52 ++++++++++++++++++++++++-------- 2 files changed, 74 insertions(+), 23 deletions(-) diff --git a/angularfire/angularfire-tests.ts b/angularfire/angularfire-tests.ts index eced9d7fe7..74a6c5a302 100644 --- a/angularfire/angularfire-tests.ts +++ b/angularfire/angularfire-tests.ts @@ -3,7 +3,7 @@ var myapp = angular.module("myapp", ["firebase"]); interface AngularFireScope extends ng.IScope { - items: AngularFire; + items: AngularFireArray; remoteItems: RemoteItems; } @@ -14,23 +14,46 @@ interface RemoteItems { var url = "https://myapp.firebaseio.com"; myapp.controller("MyController", ["$scope", "$firebase", - function($scope: AngularFireScope, $firebase: AngularFireService) { - $scope.items = $firebase(new Firebase(url)); + function ($scope: AngularFireScope, $firebase: AngularFireService) { + var sync = $firebase(new Firebase(url)); + + sync.$asArray() + .$loaded() + .then(function (list: AngularFireArray) { + console.log("list has " + list.length + " items"); + + list.$add({ foo: "bar" }).then(function (ref) { + ref.on("value", function (snapshot) { + if (snapshot.val().foo !== "bar") throw "error"; + }); + }); + + var item = list.$getRecord("foo"); + list.$remove("foo"); + list.$remove(0); + list.$save(); + }); + sync.$asObject() + + + $scope.items = sync.$asArray(); + $scope.object = sync.$asObject(); + $scope.items.$add({ foo: "bar" }); $scope.items.$remove("foo"); $scope.items.$remove(); $scope.items.$save(); var child = $scope.items.$child("foo"); child.$remove(); - $scope.items.$set({ bar: "baz" }); + $scope.items.$set({ bar: "baz" }); var keys = $scope.items.$getIndex(); - keys.forEach(function(key, i) { + keys.forEach(function (key, i) { console.log(i, ($scope.items)[key]); }); - $scope.items.$on("loaded", function() { + $scope.items.$on("loaded", function () { console.log("Initial data received!"); }); - $scope.items.$on("change", function() { + $scope.items.$on("change", function () { console.log("A remote change was applied locally!"); }); $scope.items.$off('loaded'); @@ -39,7 +62,7 @@ myapp.controller("MyController", ["$scope", "$firebase", } $scope.items.$bind($scope, "remoteItems"); $scope.remoteItems.bar = "foo"; - $scope.items.$bind($scope, "remote").then(function(unbind) { + $scope.items.$bind($scope, "remote").then(function (unbind) { unbind(); $scope.remoteItems.bar = "foo"; }); @@ -55,7 +78,7 @@ interface AngularFireAuthScope extends ng.IScope { } myapp.controller("MyAuthController", ["$scope", "$firebaseSimpleLogin", - function($scope: AngularFireAuthScope, $firebaseSimpleLogin: AngularFireAuthService) { + function ($scope: AngularFireAuthScope, $firebaseSimpleLogin: AngularFireAuthService) { var dataRef = new Firebase(url); $scope.loginObj = $firebaseSimpleLogin(dataRef); $scope.loginObj.$getCurrentUser().then(_ => { @@ -65,9 +88,9 @@ myapp.controller("MyAuthController", ["$scope", "$firebaseSimpleLogin", $scope.loginObj.$login('password', { email: email, password: password - }).then(function(user) { + }).then(function (user) { console.log('Logged in as: ', user.uid); - }, function(error) { + }, function (error) { console.error('Login failed: ', error); }); $scope.loginObj.$logout(); diff --git a/angularfire/angularfire.d.ts b/angularfire/angularfire.d.ts index 3f2b0aa106..f81ac243fa 100644 --- a/angularfire/angularfire.d.ts +++ b/angularfire/angularfire.d.ts @@ -1,4 +1,4 @@ -// Type definitions for AngularFire 0.6.0 +// Type definitions for AngularFire 0.8.2 and Firebase Simple Login 1.6.4 // Project: http://angularfire.com // Definitions by: Dénes Harmath // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -7,25 +7,53 @@ /// interface AngularFireService { - (firebase: Firebase): AngularFire; + (firebase: Firebase, config?:any): AngularFire; } interface AngularFire { - $add(value: any): void; - $remove(key?: string): void; - $save(key?: string): void; - $child(key: string): AngularFire; - $set(value: any): void; - $getIndex(): string[]; - $on(eventType: string, callback: (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void, cancelCallback?: ()=> void, context?: Object): (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void; - $off(eventType?: string, callback?: (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void, cancelCallback?: ()=> void, context?: Object): (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void; - $bind($scope: ng.IScope, modelName: string): ng.IPromise; + $asArray(): AngularFireArray; + $asObject(): AngularFireObject; + $ref(): Firebase; + $push(data: any): ng.IPromise; + $set(key: string, data: any): ng.IPromise; + $set(data: any): ng.IPromise; + $remove(key?: string): ng.IPromise; + $update(key: string, data: any): ng.IPromise; + $update(data: any): ng.IPromise; + $transaction(updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; } interface AngularFireObject { + $id: string; $priority: number; + $value: any; + $save(): ng.IPromise; + $loaded(): ng.IPromise; + $inst(): Firebase; + $bindTo(scope: ng.IScope, varName: string): ng.IPromise; + $watch(callback: Function, context: any): Function; + $destroy(): void; + + $extendFactory(ChildClass: Object, methods?: Object); } +interface AngularFireArray extends Array { + $add(newData: any): ng.IPromise; + $save(recordOrIndex: any): ng.IPromise; + $remove(recordOrIndex: any): ng.IPromise; + $getRecord(key: string): any; + $keyAt(recordOrIndex: any): string; + $indexFor(key: string): number; + $loaded(): ng.IPromise; + $inst(): Firebase; + $watch(cb: (event: string, key: string, prevChild: string) => void, context?: any): Function; + $destroy(): void; + + $extendFactory(ChildClass:Object, methods?:Object); +} + + + interface AngularFireAuthService { (firebase: Firebase): AngularFireAuth; } @@ -34,7 +62,7 @@ interface AngularFireAuth { $getCurrentUser(): ng.IPromise; $login(provider: string, options?: Object): ng.IPromise; $logout(): void; - $createUser(email: string, password: string, noLogin?: boolean): ng.IPromise; + $createUser(email: string, password: string): ng.IPromise; $changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise; $removeUser(email: string, password: string): ng.IPromise; $sendPasswordResetEmail(email: string): ng.IPromise; From b4a99c8bfde13845f9398aee488284c2096189c4 Mon Sep 17 00:00:00 2001 From: David Harkness Date: Tue, 4 Nov 2014 18:00:35 -0800 Subject: [PATCH 047/292] Add JsHamcrest with all classes and functions defined TODO: - Decide what to do with Matcher and SelfDescribing interfaces - Find better way to expose functions to global scope --- jshamcrest/jshamcrest-tests.ts | 444 +++++++++++++ jshamcrest/jshamcrest.d.ts | 1144 ++++++++++++++++++++++++++++++++ 2 files changed, 1588 insertions(+) create mode 100644 jshamcrest/jshamcrest-tests.ts create mode 100644 jshamcrest/jshamcrest.d.ts diff --git a/jshamcrest/jshamcrest-tests.ts b/jshamcrest/jshamcrest-tests.ts new file mode 100644 index 0000000000..a65290e6d2 --- /dev/null +++ b/jshamcrest/jshamcrest-tests.ts @@ -0,0 +1,444 @@ +/// + + +function test_version() { + var version: string = JsHamcrest.version; +} + + +// +// Descriptions +// + +function test_append() { + new JsHamcrest.Description().append("foo"); +} + +function test_appendDescriptionOf_acceptsSelfDescribingType() { + var obj: JsHamcrest.SelfDescribing; + new JsHamcrest.Description().appendDescriptionOf(obj); +} + +function test_appendDescriptionOf_acceptsObjectWithDescribeToMethod() { + var obj: any = { + describeTo(description: JsHamcrest.Description): void { + description.append('obj'); + } + } + new JsHamcrest.Description().appendDescriptionOf(obj); +} + +function test_appendList() { + new JsHamcrest.Description().appendList("[", ",", "]", [1, 2, 3]); +} + +function test_appendLiteral() { + new JsHamcrest.Description().appendLiteral(undefined); + new JsHamcrest.Description().appendLiteral(null); + new JsHamcrest.Description().appendLiteral(true); + new JsHamcrest.Description().appendLiteral(42); + new JsHamcrest.Description().appendLiteral(3.14159); + new JsHamcrest.Description().appendLiteral("foo"); + new JsHamcrest.Description().appendLiteral([1, 2, 3]); + new JsHamcrest.Description().appendLiteral(JsHamcrest.Description); +} + +function test_appendValueList() { + var obj: JsHamcrest.SelfDescribing; + new JsHamcrest.Description().appendValueList("[", ",", "]", [obj, obj, obj]); +} + +function test_get() { + var desc: string = new JsHamcrest.Description().get(); +} + + +// +// Matcher +// + +function test_SimpleMatcher(actual: any, matcher: JsHamcrest.SimpleMatcher): JsHamcrest.Description { + var description = new JsHamcrest.Description(); + description.append('Expected '); + matcher.describeTo(description); + if (!matcher.matches(actual)) { + description.append(', but was '); + matcher.describeValueTo(actual, description); + description.append(': FAIL'); + } + else { + description.append(': PASS'); + } + return description; +} + +function test_CombinableMatcher(matcher: JsHamcrest.CombinableMatcher): JsHamcrest.CombinableMatcher { + return matcher.and(not(string())).or(bool()); +} + + +// +// Helpers +// + +function test_isMatcher() { + JsHamcrest.isMatcher(empty()); +} + +function test_EqualTo() { + var hasSecondCharacter = JsHamcrest.EqualTo(function (matcher: JsHamcrest.Matcher) { + return new JsHamcrest.SimpleMatcher({ + matches: function (actual: any) { + return actual && actual.length >= 2 && matcher.matches(actual.charAt(2)); + }, + describeTo: function (description: JsHamcrest.Description) { + description.append('string with second character ').appendDescriptionOf(matcher); + } + }); + }); + assertThat('foo', hasSecondCharacter('o')); + assertThat('foo', hasSecondCharacter(greaterThan('n'))); +} + + +// +// Operators +// + +function test_assert() { + // truthiness + JsHamcrest.Operators.assert('foo'); + // basic equality + JsHamcrest.Operators.assert('foo', 'foo'); + // matcher + JsHamcrest.Operators.assert('foo', is('foo')); + // options + JsHamcrest.Operators.assert('foo', is('foo'), { + message: 'Name', + pass: function (result) { alert('[PASS] ' + result); }, + fail: function (result) { alert('[FAIL] ' + result); } + }); +} + +function test_filter() { + var evens = JsHamcrest.Operators.filter([1, 2, 3, 4, 5], even()); +} + +function test_callTo() { + var thrower = JsHamcrest.Operators.callTo(function (ok) { if (!ok) { throw new Error(); } }, false); +} + + +// +// Collection Matchers +// + +function test_empty() { + assertThat([], empty()); + assertThat('', empty()); +} + +function test_everyItem() { + assertThat([1,2,3], everyItem(greaterThan(0))); + assertThat([1,'1'], everyItem(1)); +} + +function test_hasItem() { + assertThat([1,2,3], hasItem(equalTo(3))); + assertThat([1,2,3], hasItem(3)); +} + +function test_hasItems() { + assertThat([1,2,3], hasItems(2,3)); + assertThat([1,2,3], hasItems(greaterThan(2))); + assertThat([1,2,3], hasItems(1, greaterThan(2))); +} + +function test_hasSize() { + assertThat([1,2,3], hasSize(3)); + assertThat([1,2,3], hasSize(lessThan(5))); + assertThat('string', hasSize(6)); + assertThat('string', hasSize(greaterThan(3))); + assertThat({a:1, b:2}, hasSize(equalTo(2))); +} + +function test_isIn() { + assertThat(1, isIn([1,2,3])); + assertThat(1, isIn(1,2,3)); +} + +function test_oneOf() { + assertThat(1, oneOf([1,2,3])); + assertThat(1, oneOf(1,2,3)); +} + +// +// Core Matchers +// + +function test_allOf() { + assertThat(5, allOf([greaterThan(0), lessThan(10)])); + assertThat(5, allOf([5, lessThan(10)])); + assertThat(5, allOf(greaterThan(0), lessThan(10))); + assertThat(5, allOf(5, lessThan(10))); +} + +function test_anyOf() { + assertThat(5, anyOf([even(), greaterThan(2)])); + assertThat(5, anyOf(even(), greaterThan(2))); +} + +function test_both() { + assertThat(10, both(greaterThan(5)).and(even())); +} + +function test_either() { + assertThat(10, either(greaterThan(50)).or(even())); +} + +function test_equalTo() { + assertThat('10', equalTo(10)); +} + +function test_is() { + assertThat('10', is(10)); + assertThat('10', is(equalTo(10))); +} + +function test_nil() { + assertThat(undefined, nil()); + assertThat(null, nil()); +} + +function test_not() { + assertThat(10, not(20)); + assertThat(10, not(is(20))); +} + +function test_raises() { + var myFunction = function() { + // Do something dangerous... + throw new Error(); + }; + + assertThat(myFunction, raises('Error')); +} + +function test_raisesAnything() { + var myFunction = function() { + // Do something dangerous... + throw 'Some unexpected error'; + }; + + assertThat(myFunction, raisesAnything()); +} + +function test_sameAs() { + var number = 10, anotherNumber = number; + assertThat(number, sameAs(anotherNumber)); +} + +function test_truth() { + assertThat(10, truth()); + assertThat({}, truth()); + assertThat(0, not(truth())); + assertThat('', not(truth())); + assertThat(null, not(truth())); + assertThat(undefined, not(truth())); +} + + +// +// Number Matchers +// + +function test_between() { + assertThat(5, between(4).and(7)); +} + +function test_closeTo() { + assertThat(0.5, closeTo(1.0, 0.5)); + assertThat(1.0, closeTo(1.0, 0.5)); + assertThat(1.5, closeTo(1.0, 0.5)); + assertThat(2.0, not(closeTo(1.0, 0.5))); +} + +function test_divisibleBy() { + assertThat(21, divisibleBy(3)); +} + +function test_even() { + assertThat(4, even()); +} + +function test_greaterThan() { + assertThat(10, greaterThan(5)); +} + +function test_greaterThanOrEqualTo() { + assertThat(10, greaterThanOrEqualTo(5)); +} + +function test_lessThan() { + assertThat(5, lessThan(10)); +} + +function test_lessThanOrEqualTo() { + assertThat(5, lessThanOrEqualTo(10)); +} + +function test_notANumber() { + assertThat(Math.sqrt(-1), notANumber()); +} + +function test_zero() { + assertThat(0, zero()); + assertThat('0', not(zero())); +} + + +// +// Object Matchers +// + +function test_bool() { + assertThat(true, bool()); + assertThat(false, bool()); + assertThat("text", not(bool())); +} + +function test_func() { + assertThat(function() {}, func()); + assertThat("text", not(func())); +} + +function test_hasFunction() { + var greeter = { + sayHello: function(name: string) { + alert('Hello, ' + name); + } + }; + + assertThat(greeter, hasFunction('sayHello')); +} + +function test_hasMember() { + var greeter = { + marco: 'polo', + sayHello: function(name: string) { + alert('Hello, ' + name); + } + }; + + assertThat(greeter, hasMember('marco')); + assertThat(greeter, hasMember('sayHello')); + + assertThat(greeter, hasMember('marco', equalTo('polo'))); +} + +function test_instanceOf() { + assertThat([], instanceOf(Array)); +} + +function test_number() { + assertThat(10, number()); + assertThat('10', not(number())); +} + +function test_object() { + assertThat({}, object()); + assertThat(10, not(object())); +} + +function test_string() { + assertThat('10', string()); + assertThat(10, not(string())); +} + +function test_typeOf() { + assertThat(10, typeOf('number')); + assertThat({}, typeOf('object')); + assertThat('10', typeOf('string')); + assertThat(function(){}, typeOf('function')); +} + + +// +// Text Matchers +// + +function test_containsString() { + assertThat('string', containsString('tri')); +} + +function test_emailAddress() { + assertThat('user@domain.com', emailAddress()); +} + +function test_endsWith() { + assertThat('string', endsWith('ring')); +} + +function test_equalIgnoringCase() { + assertThat('str', equalIgnoringCase('Str')); +} + +function test_matches() { + assertThat('0xa4f2c', matches(/\b0[xX][0-9a-fA-F]+\b/)); +} + +function test_startsWith() { + assertThat('string', startsWith('str')); +} + + +// +// Integration +// + +JsHamcrest.Integration.copyMembers(window); + +JsHamcrest.Integration.copyMembers(JsHamcrest.Matchers, window); + +JsHamcrest.Integration.installMatchers({ truthy: JsHamcrest.Matchers.truth }); + +JsHamcrest.Integration.installOperators({ + assertNotThat: function (actual: any, matcher: JsHamcrest.Matcher, message?: string): JsHamcrest.Description { + return JsHamcrest.Operators.assert(actual, JsHamcrest.Matchers.not(matcher), { message: message }); + } +}); + + +// +// Testing Frameworks +// + +JsHamcrest.Integration.WebBrowser(); + +JsHamcrest.Integration.Rhino(); + +JsHamcrest.Integration.JsTestDriver(); +JsHamcrest.Integration.JsTestDriver({ scope: window }); + +JsHamcrest.Integration.Nodeunit(); +JsHamcrest.Integration.Nodeunit({ scope: window }); + +JsHamcrest.Integration.JsUnitTest(); +JsHamcrest.Integration.JsUnitTest({ scope: window }); + +JsHamcrest.Integration.YUITest(); +JsHamcrest.Integration.YUITest({ scope: window }); + +JsHamcrest.Integration.QUnit(); +JsHamcrest.Integration.QUnit({ scope: window }); + +JsHamcrest.Integration.jsUnity(); +JsHamcrest.Integration.jsUnity({ scope: window }); +JsHamcrest.Integration.jsUnity({ attachAssertions: true }); +JsHamcrest.Integration.jsUnity({ scope: window, attachAssertions: true }); + +JsHamcrest.Integration.screwunit(); +JsHamcrest.Integration.screwunit({ scope: window }); + +JsHamcrest.Integration.jasmine(); +JsHamcrest.Integration.jasmine({ scope: window }); diff --git a/jshamcrest/jshamcrest.d.ts b/jshamcrest/jshamcrest.d.ts new file mode 100644 index 0000000000..91fb210826 --- /dev/null +++ b/jshamcrest/jshamcrest.d.ts @@ -0,0 +1,1144 @@ +// Type definitions for JsHamcrest 0.7.0 +// Project: https://github.com/danielfm/jshamcrest/ +// Definitions by: David Harkness +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * Top-level module for the JsHamcrest matcher library. + * + * @author Daniel Martins + */ +declare module JsHamcrest { + /** + * Library version. + */ + export var version: string; + + + // + // Description + // + + /** + * Defines the method for describing the object to a description. + */ + interface DescribeTo { + (description: Description): void; + } + + /** + * Defines the method for describing a value to a description. + */ + interface DescribeValueTo { + (value: any, description: Description): void; + } + + /** + * Defines a method for describing the object implementing this interface to a description. + * + * TODO Remove? Not actually declared by JsHamcrest, but useful for type-checking in Description methods + */ + export interface SelfDescribing { + describeTo: DescribeTo; + } + + /** + * Builder for a textual description. + */ + export class Description { + /** + * Appends text to this description. + * + * @param text Text to append to this description + * @return {Description} Itself for method chaining + */ + append(text: any): Description; + + /** + * Appends the description of a self describing object to this description. + * + * @param selfDescribingObject Any object that has a describeTo() function that accepts a JsHamcrest.Description object as argument + * @return {Description} Itself for method chaining + */ + appendDescriptionOf(selfDescribingObject: SelfDescribing): Description; + + /** + * Appends the description of several self describing objects to this description. + * + * @param start Start string + * @param separator Separator string + * @param end End string + * @param list Array of self describing objects. These objects must have a describeTo() function that accepts a JsHamcrest.Description object as argument + * @return {Description} Itself for method chaining + */ + appendList(start: string, separator: string, end: string, list: any[]): Description; + + /** + * Appends a JavaScript language’s literal to this description. + * + * @param literal Literal to append to this description + * @return {Description} Itself for method chaining + */ + appendLiteral(literal: any): Description; + + /** + * Appends an array of values to this description. + * + * @param start Start string + * @param separator Separator string + * @param end End string + * @param list Array of values to be described to this description + * @return {Description} Itself for method chaining + */ + appendValueList(start: string, separator: string, end: string, list: SelfDescribing[]): Description; + + /** + * Gets the current content of this description. + * + * @return {string} Current content of this description + */ + get(): string; + } + + + // + // Matcher + // + + /** + * Defines the method for testing the matcher against an actual value. + */ + interface Matches { + (value: any): boolean; + } + + /** + * Defines the minimal interface for every matcher. + * + * FIXME Remove since isMatcher tests for SimpleMatcher :( + */ + export interface Matcher extends SelfDescribing { + matches: Matches; + describeValueTo: DescribeValueTo; + } + + /** + * Defines the configurable methods for declaring a new matcher using JsHamcrest.SimpleMatcher. + */ + interface MatcherConfig { + matches: Matches; + describeTo: DescribeTo; + describeValueTo?: DescribeValueTo; + } + + /** + * Defines a matcher that relies on the external functions provided by the caller in order to shape the current matching logic. + */ + export class SimpleMatcher implements Matcher { + matches: Matches; + describeTo: DescribeTo; + describeValueTo: DescribeValueTo; + + constructor(config: MatcherConfig); + } + + /** + * Defines a composite matcher, that is, a matcher that wraps several matchers into one. + */ + export class CombinableMatcher extends SimpleMatcher { + /** + * Wraps this matcher and the given matcher using JsHamcrest.Matchers.allOf(). + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {CombinableMatcher} Instance of JsHamcrest.CombinableMatcher + */ + and(matcherOrValue: any): CombinableMatcher; + + /** + * Wraps this matcher and the given matcher using JsHamcrest.Matchers.anyOf(). + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {CombinableMatcher} Instance of JsHamcrest.CombinableMatcher + */ + or(matcherOrValue: any): CombinableMatcher; + } + + + // + // Helpers + // + + /** + * Checks if the given object is a matcher or not. + * + * @param obj Object to check + * @return {boolean} True if the given object is a matcher; false otherwise + */ + export function isMatcher(obj: any): boolean; + + /** + * Delegate function, useful when used to create a matcher that has a value-equalTo semantic. + * + * @param factory Creates a new matcher that delegates to the passed/wrapped matcherOrValue + * @return {function(*): Matcher} Wraps the value with equalTo before passing to factory + */ + export function EqualTo(factory: (matcher: Matcher) => Matcher): (matcherOrValue: any) => Matcher; + + + /** + * Provides the assertion, filtering, and currying methods. + */ + module Operators { + /** + * Defines the options accepted by assert(). + */ + interface AssertOptions { + message?: any; + pass?: (description: string) => void; + fail?: (description: string) => void; + } + + /** + * Fails if the actual value does not match the matcher. + * + * @param actual Value to test against the matcher + * @param matcherOrValue Applied to the value; wrapped with equalTo() if not a matcher + * @param options Provides message and pass/fail handlers + * @return {JsHamcrest.Description} Contains the message, actual value, matcher, and result + */ + export function assert(actual: any, matcherOrValue?: any, options?: AssertOptions): JsHamcrest.Description; + + /** + * Returns those items of the array for which matcher matches. + * + * @param array The values to filter + * @param matcherOrValue Applied to each value + * @return {Array.<*>} Contains all values from array matched by the matcher in the original order + */ + export function filter(array: any[], matcherOrValue: any): any[]; + + /** + * Delegate function, useful when used along with raises() and raisesAnything(). + * + * @param func Function to delegate to + * @param args Passed to func + * @return {function(): *} A function that calls func with args and returns its result + */ + export function callTo(func: (...args: any[]) => any, ...args: any[]): () => any; + } + + + /** + * Defines all of the built-in matchers grouped into five categories. + */ + module Matchers { + // + // Collection Matchers + // + + /** + * The length of the actual value must be zero. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function empty(): JsHamcrest.SimpleMatcher; + + /** + * The actual value should be an array and matcherOrValue must match all items. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function everyItem(matcherOrValue: any): JsHamcrest.SimpleMatcher; + + /** + * The actual value should be an array and it must contain at least one value that matches matcherOrValue. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function hasItem(matcherOrValue: any): JsHamcrest.SimpleMatcher; + + /** + * The actual value should be an array and matchersOrValues must match at least one item. + * + * @param matchersOrValues Instances of JsHamcrest.SimpleMatcher and/or values + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function hasItems(...matchersOrValues: any[]): JsHamcrest.SimpleMatcher; + + /** + * The length of the actual value must match matcherOrValue. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function hasSize(matcherOrValue: any): JsHamcrest.SimpleMatcher; + + /** + * The given array or arguments must contain the actual value. + * + * @param items Array or list of values + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function isIn(...items: any[]): JsHamcrest.SimpleMatcher; + + /** + * Alias to isIn() function. + * + * @param items Array or list of values + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function oneOf(...items: any[]): JsHamcrest.SimpleMatcher; + + + // + // Core Matchers + // + + /** + * All matchesOrValues must match the actual value. This matcher behaves pretty much like the JavaScript && (and) operator. + * + * @param matchersOrValues Instances of JsHamcrest.SimpleMatcher and/or values + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function allOf(...matchersOrValues: any[]): JsHamcrest.SimpleMatcher; + + /** + * At least one of the matchersOrValues should match the actual value. This matcher behaves pretty much like the JavaScript || (or) operator. + * + * @param matchersOrValues Instances of JsHamcrest.SimpleMatcher and/or values + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function anyOf(...matchersOrValues: any[]): JsHamcrest.SimpleMatcher; + + /** + * Useless always-match matcher. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function anything(): JsHamcrest.SimpleMatcher; + + /** + * Combinable matcher where the actual value must match all the given matchers or values. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.CombinableMatcher} Instance of JsHamcrest.CombinableMatcher + */ + export function both(matcherOrValue: any): JsHamcrest.CombinableMatcher; + + /** + * Combinable matcher where the actual value must match at least one of the given matchers or values. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.CombinableMatcher} Instance of JsHamcrest.CombinableMatcher + */ + export function either(matcherOrValue: any): JsHamcrest.CombinableMatcher; + + /** + * The actual value must be equal to expected. + * + * @param expected Expected value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function equalTo(expected: any): JsHamcrest.SimpleMatcher; + + /** + * Delegate-only matcher frequently used to improve readability. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function is(matcherOrValue: any): JsHamcrest.SimpleMatcher; + + /** + * The actual value must be null or undefined. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function nil(): JsHamcrest.SimpleMatcher; + + /** + * The actual value must not match matcherOrValue. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function not(matcherOrValue: any): JsHamcrest.SimpleMatcher; + + /** + * The actual value is a function and, when invoked, it should throw an exception with the given name. + * + * @param exceptionName Name of the expected exception + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function raises(exceptionName: string): JsHamcrest.SimpleMatcher; + + /** + * The actual value is a function and, when invoked, it should raise any exception. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function raisesAnything(): JsHamcrest.SimpleMatcher; + + /** + * The actual value must be the same as expected. + * + * @param expected Expected value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function sameAs(expected: any): JsHamcrest.SimpleMatcher; + + /** + * Matches any truthy value (not undefined, null, false, 0, NaN, or ""). + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function truth(): JsHamcrest.SimpleMatcher; + + + // + // Number Matchers + // + + /** + * The actual number must be between the given range (inclusive). + * + * @param start Range start + * @return {JsHamcrest.BetweenBuilder} Builder object with an and(end) method, which returns a JsHamcrest.SimpleMatcher instance and thus should be called to finish the matcher creation + */ + export function between(start: any): JsHamcrest.BetweenBuilder; + + /** + * The actual number must be close enough to expected, that is, the actual number is equal to a value within some range of acceptable error. + * + * @param expected Expected number + * @param [delta=0] Expected difference delta + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function closeTo(expected: number, delta?: number): JsHamcrest.SimpleMatcher; + + /** + * The actual number must be divisible by divisor. + * + * @param divisor Divisor + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function divisibleBy(divisor: number): JsHamcrest.SimpleMatcher; + + /** + * The actual number must be even. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function even(): JsHamcrest.SimpleMatcher; + + /** + * The actual number must be greater than expected. + * + * @param expected Expected number + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function greaterThan(expected: any): JsHamcrest.SimpleMatcher; + + /** + * The actual number must be greater than or equal to expected. + * + * @param expected Expected number + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function greaterThanOrEqualTo(expected: any): JsHamcrest.SimpleMatcher; + + /** + * The actual number must be less than expected. + * + * @param expected Expected number + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function lessThan(expected: any): JsHamcrest.SimpleMatcher; + + /** + * The actual number must be less than or equal to expected. + * + * @param expected Expected number + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function lessThanOrEqualTo(expected: any): JsHamcrest.SimpleMatcher; + + /** + * The actual value must not be a number. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function notANumber(): JsHamcrest.SimpleMatcher; + + /** + * The actual number must be odd. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function odd(): JsHamcrest.SimpleMatcher; + + /** + * The actual number must be zero. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function zero(): JsHamcrest.SimpleMatcher; + + + // + // Object Matchers + // + + /** + * The actual value must be a boolean. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function bool(): JsHamcrest.SimpleMatcher; + + /** + * The actual value must be a function. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function func(): JsHamcrest.SimpleMatcher; + + /** + * The actual value has a function with the given name. + * + * @param functionName Function name + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function hasFunction(functionName: string): JsHamcrest.SimpleMatcher; + + /** + * The actual value has an attribute with the given name. + * + * @param memberName Member name + * @param [matcherOrValue] Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function hasMember(memberName: string, matcherOrValue?: any): JsHamcrest.SimpleMatcher; + + /** + * The actual value must be an instance of clazz. + * + * @param clazz Constructor function + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function instanceOf(clazz: new() => any): JsHamcrest.SimpleMatcher; + + /** + * The actual value must be a number. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function number(): JsHamcrest.SimpleMatcher; + + /** + * The actual value must be an object. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function object(): JsHamcrest.SimpleMatcher; + + /** + * The actual value must be a string. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function string(): JsHamcrest.SimpleMatcher; + + /** + * The actual value must be of the given type. + * + * @param typeName Name of the type + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function typeOf(typeName: string): JsHamcrest.SimpleMatcher; + + + // + // Text Matchers + // + + /** + * The actual string must have a substring equals to str. + * + * @param str Substring + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function containsString(str: string): JsHamcrest.SimpleMatcher; + + /** + * The actual string must look like an e-mail address. + * + * Warning: This matcher is not fully compliant with RFC2822 due to its complexity. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function emailAddress(): JsHamcrest.SimpleMatcher; + + /** + * The actual string must end with str. + * + * @param str Substring + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function endsWith(str: string): JsHamcrest.SimpleMatcher; + + /** + * The actual string must be equal to str, ignoring case. + * + * @param str String + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function equalIgnoringCase(str: string): JsHamcrest.SimpleMatcher; + + /** + * The actual string must match regex. + * + * @param regex String + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function matches(regex: RegExp): JsHamcrest.SimpleMatcher; + + /** + * The actual string must start with str. + * + * @param str Substring + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ + export function startsWith(str: string): JsHamcrest.SimpleMatcher; + } + + + /** + * Provides methods for exposing matchers and operators for several testing frameworks. + */ + module Integration { + /** + * Copies all members of the Matchers and Operators modules to target. + * + * Does not overwrite properties with the same name. + * + * @param target + */ + export function copyMembers(target: {}): void; + + /** + * Copies all members of source to target. + * + * Does not overwrite properties with the same name. + * + * @param source + * @param target + */ + export function copyMembers(source: {}, target: {}): void; + + /** + * Adds the members of the given object to JsHamcrest.Matchers namespace. + * + * @param source + */ + export function installMatchers(source: {}): void; + + /** + * Adds the members of the given object to JsHamcrest.Operators namespace. + * + * @param source + */ + export function installOperators(source: {}): void; + + + // + // Testing Frameworks + // + + /** + * Uses the web browser's alert() function to display the assertion results. + * Great for quick prototyping. + */ + export function WebBrowser(): void; + + /** + * Uses Rhino's print() function to display the assertion results. + * Great for quick prototyping. + */ + export function Rhino(): void; + + /** + * JsTestDriver integration. + * + * @param params Omit to copy members to global scope + */ + export function JsTestDriver(params?: { scope?: {} }): void; + + /** + * NodeUnit (Node.js Unit Testing) integration. + * + * @param params Omit to copy members to "global" + */ + export function Nodeunit(params?: { scope?: {} }): void; + + /** + * JsUnitTest integration. + * + * @param params Omit to copy members to "JsUnitTest.Unit.Testcase.prototype" + */ + export function JsUnitTest(params?: { scope?: {} }): void; + + /** + * YUITest (Yahoo UI) integration. + * + * @param params Omit to copy members to global scope + */ + export function YUITest(params?: { scope?: {} }): void; + + /** + * QUnit (JQuery) integration. + * + * @param params Omit to copy members to global scope + */ + export function QUnit(params?: { scope?: {} }): void; + + /** + * jsUnity integration. + * + * @param params Omit to copy members to "jsUnity.env.defaultScope" + */ + export function jsUnity(params?: { scope?: {}; attachAssertions?: boolean }): void; + + /** + * Screw.Unit integration. + * + * @param params Omit to copy members to "Screw.Matchers" + */ + export function screwunit(params?: { scope?: {} }): void; + + /** + * Jasmine integration. + * + * @param params Omit to copy members to global scope + */ + export function jasmine(params?: { scope?: {} }): void; + } + + + // + // Builders + // + + /** + * Used by the between() matcher to specify the ending value. + */ + export class BetweenBuilder { + and(end: any): SimpleMatcher; + } +} + + +// +// Functions that are copied by copyMembers() to the global scope are copy-n-pasted here. +// +// TODO There must be a better way to do this, and not every testing framework places them in the global scope. +// + + +// +// Assert +// + +/** + * Fails if the actual value does not match the matcher. + * + * @param actual Value to test against the matcher + * @param matcher Applied to the value + * @param message Prepends the built description + * @return {JsHamcrest.Description} Contains the message, actual value, matcher, and result + */ +declare function assertThat(actual: any, matcher?: JsHamcrest.Matcher, message?: any): JsHamcrest.Description; + + +// +// Collection Matchers +// + +/** + * The length of the actual value must be zero. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function empty(): JsHamcrest.SimpleMatcher; + +/** + * The actual value should be an array and matcherOrValue must match all items. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function everyItem(matcherOrValue: any): JsHamcrest.SimpleMatcher; + +/** + * The actual value should be an array and it must contain at least one value that matches matcherOrValue. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function hasItem(matcherOrValue: any): JsHamcrest.SimpleMatcher; + +/** + * The actual value should be an array and matchersOrValues must match at least one item. + * + * @param matchersOrValues Instances of JsHamcrest.SimpleMatcher and/or values + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function hasItems(...matchersOrValues: any[]): JsHamcrest.SimpleMatcher; + +/** + * The length of the actual value must match matcherOrValue. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function hasSize(matcherOrValue: any): JsHamcrest.SimpleMatcher; + +/** + * The given array or arguments must contain the actual value. + * + * @param items Array or list of values + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function isIn(...items: any[]): JsHamcrest.SimpleMatcher; + +/** + * Alias to isIn() function. + * + * @param items Array or list of values + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function oneOf(...items: any[]): JsHamcrest.SimpleMatcher; + + +// +// Core Matchers +// + +/** + * All matchesOrValues must match the actual value. This matcher behaves pretty much like the JavaScript && (and) operator. + * + * @param matchersOrValues Instances of JsHamcrest.SimpleMatcher and/or values + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function allOf(...matchersOrValues: any[]): JsHamcrest.SimpleMatcher; + +/** + * At least one of the matchersOrValues should match the actual value. This matcher behaves pretty much like the JavaScript || (or) operator. + * + * @param matchersOrValues Instances of JsHamcrest.SimpleMatcher and/or values + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function anyOf(...matchersOrValues: any[]): JsHamcrest.SimpleMatcher; + +/** + * Useless always-match matcher. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function anything(): JsHamcrest.SimpleMatcher; + +/** + * Combinable matcher where the actual value must match all the given matchers or values. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.CombinableMatcher} Instance of JsHamcrest.CombinableMatcher + */ +declare function both(matcherOrValue: any): JsHamcrest.CombinableMatcher; + +/** + * Combinable matcher where the actual value must match at least one of the given matchers or values. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.CombinableMatcher} Instance of JsHamcrest.CombinableMatcher + */ +declare function either(matcherOrValue: any): JsHamcrest.CombinableMatcher; + +/** + * The actual value must be equal to expected. + * + * @param expected Expected value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function equalTo(expected: any): JsHamcrest.SimpleMatcher; + +/** + * Delegate-only matcher frequently used to improve readability. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function is(matcherOrValue: any): JsHamcrest.SimpleMatcher; + +/** + * The actual value must be null or undefined. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function nil(): JsHamcrest.SimpleMatcher; + +/** + * The actual value must not match matcherOrValue. + * + * @param matcherOrValue Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function not(matcherOrValue: any): JsHamcrest.SimpleMatcher; + +/** + * The actual value is a function and, when invoked, it should throw an exception with the given name. + * + * @param exceptionName Name of the expected exception + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function raises(exceptionName: string): JsHamcrest.SimpleMatcher; + +/** + * The actual value is a function and, when invoked, it should raise any exception. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function raisesAnything(): JsHamcrest.SimpleMatcher; + +/** + * The actual value must be the same as expected. + * + * @param expected Expected value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function sameAs(expected: any): JsHamcrest.SimpleMatcher; + +/** + * Matches any truthy value (not undefined, null, false, 0, NaN, or ""). + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function truth(): JsHamcrest.SimpleMatcher; + + +// +// Number Matchers +// + +/** + * The actual number must be between the given range (inclusive). + * + * @param start Range start + * @return {JsHamcrest.BetweenBuilder} Builder object with an and(end) method, which returns a JsHamcrest.SimpleMatcher instance and thus should be called to finish the matcher creation + */ +declare function between(start: any): JsHamcrest.BetweenBuilder; + +/** + * The actual number must be close enough to expected, that is, the actual number is equal to a value within some range of acceptable error. + * + * @param expected Expected number + * @param [delta=0] Expected difference delta + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function closeTo(expected: number, delta?: number): JsHamcrest.SimpleMatcher; + +/** + * The actual number must be divisible by divisor. + * + * @param divisor Divisor + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function divisibleBy(divisor: number): JsHamcrest.SimpleMatcher; + +/** + * The actual number must be even. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function even(): JsHamcrest.SimpleMatcher; + +/** + * The actual number must be greater than expected. + * + * @param expected Expected number + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function greaterThan(expected: any): JsHamcrest.SimpleMatcher; + +/** + * The actual number must be greater than or equal to expected. + * + * @param expected Expected number + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function greaterThanOrEqualTo(expected: any): JsHamcrest.SimpleMatcher; + +/** + * The actual number must be less than expected. + * + * @param expected Expected number + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function lessThan(expected: any): JsHamcrest.SimpleMatcher; + +/** + * The actual number must be less than or equal to expected. + * + * @param expected Expected number + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function lessThanOrEqualTo(expected: any): JsHamcrest.SimpleMatcher; + +/** + * The actual value must not be a number. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function notANumber(): JsHamcrest.SimpleMatcher; + +/** + * The actual number must be odd. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function odd(): JsHamcrest.SimpleMatcher; + +/** + * The actual number must be zero. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function zero(): JsHamcrest.SimpleMatcher; + + +// +// Object Matchers +// + +/** + * The actual value must be a boolean. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function bool(): JsHamcrest.SimpleMatcher; + +/** + * The actual value must be a function. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function func(): JsHamcrest.SimpleMatcher; + +/** + * The actual value has a function with the given name. + * + * @param functionName Function name + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function hasFunction(functionName: string): JsHamcrest.SimpleMatcher; + +/** + * The actual value has an attribute with the given name. + * + * @param memberName Member name + * @param [matcherOrValue] Instance of JsHamcrest.SimpleMatcher or a value + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function hasMember(memberName: string, matcherOrValue?: any): JsHamcrest.SimpleMatcher; + +/** + * The actual value must be an instance of clazz. + * + * @param clazz Constructor function + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function instanceOf(clazz: new() => any): JsHamcrest.SimpleMatcher; + +/** + * The actual value must be a number. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function number(): JsHamcrest.SimpleMatcher; + +/** + * The actual value must be an object. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function object(): JsHamcrest.SimpleMatcher; + +/** + * The actual value must be a string. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function string(): JsHamcrest.SimpleMatcher; + +/** + * The actual value must be of the given type. + * + * @param typeName Name of the type + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function typeOf(typeName: string): JsHamcrest.SimpleMatcher; + + +// +// Text Matchers +// + +/** + * The actual string must have a substring equals to str. + * + * @param str Substring + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function containsString(str: string): JsHamcrest.SimpleMatcher; + +/** + * The actual string must look like an e-mail address. + * + * Warning: This matcher is not fully compliant with RFC2822 due to its complexity. + * + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function emailAddress(): JsHamcrest.SimpleMatcher; + +/** + * The actual string must end with str. + * + * @param str Substring + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function endsWith(str: string): JsHamcrest.SimpleMatcher; + +/** + * The actual string must be equal to str, ignoring case. + * + * @param str String + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function equalIgnoringCase(str: string): JsHamcrest.SimpleMatcher; + +/** + * The actual string must match regex. + * + * @param regex String + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function matches(regex: RegExp): JsHamcrest.SimpleMatcher; + +/** + * The actual string must start with str. + * + * @param str Substring + * @return {JsHamcrest.SimpleMatcher} Instance of JsHamcrest.SimpleMatcher + */ +declare function startsWith(str: string): JsHamcrest.SimpleMatcher; From e8ef646a00958726fcda776698e59d0248718103 Mon Sep 17 00:00:00 2001 From: David Harkness Date: Wed, 5 Nov 2014 13:30:17 -0800 Subject: [PATCH 048/292] Add entry to contributors file --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 083204e8fa..a5dae6616b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -226,6 +226,7 @@ All definitions files include a header with the author and editors, so at some p * [jsbn](http://www-cs-students.stanford.edu/%7Etjw/jsbn/) (by [Eugene Chernyshov](https://github.com/Evgenus)) * [jScrollPane](http://jscrollpane.kelvinluck.com) (by [Dániel Tar](https://github.com/qcz)) * [JSDeferred](http://cho45.stfuawsc.com/jsdeferred/) (by [Daisuke Mino](https://github.com/minodisk)) +* [JsHamcrest](http://danielmartins.ninja/jshamcrest/) (by [David Harkness](https://github.com/dharkness)) * [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) (by [Vincent Bortone](https://github.com/vbortone/)) * [JSON-Pointer](https://www.npmjs.org/package/json-pointer) (by [Bart van der Schoor](https://github.com/Bartvds)) * [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) (by [Maxime LUCE](https://github.com/SomaticIT)) From 6d29b22607b6ca611a600706991755170ab73780 Mon Sep 17 00:00:00 2001 From: Daniel Phan Date: Wed, 5 Nov 2014 16:25:13 -0800 Subject: [PATCH 049/292] Add d.ts for change-case --- change-case/change-case-tests.ts | 37 ++++++++++++++++++++++++++++++++ change-case/change-case.d.ts | 37 ++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 change-case/change-case-tests.ts create mode 100644 change-case/change-case.d.ts diff --git a/change-case/change-case-tests.ts b/change-case/change-case-tests.ts new file mode 100644 index 0000000000..24276654c6 --- /dev/null +++ b/change-case/change-case-tests.ts @@ -0,0 +1,37 @@ +/// + +import changeCase = require("change-case"); + +var s: string; +var b: boolean; + +s = changeCase.dot(s); +s = changeCase.dotCase(s); +s = changeCase.swap(s); +s = changeCase.swapCase(s); +s = changeCase.path(s); +s = changeCase.pathCase(s); +s = changeCase.upper(s); +s = changeCase.upperCase(s); +s = changeCase.lower(s); +s = changeCase.lowerCase(s); +s = changeCase.camel(s); +s = changeCase.camelCase(s); +s = changeCase.snake(s); +s = changeCase.snakeCase(s); +s = changeCase.title(s); +s = changeCase.titleCase(s); +s = changeCase.param(s); +s = changeCase.paramCase(s); +s = changeCase.pascal(s); +s = changeCase.pascalCase(s); +s = changeCase.constant(s); +s = changeCase.constantCase(s); +s = changeCase.sentence(s); +s = changeCase.sentenceCase(s); +b = changeCase.isUpper(s); +b = changeCase.isUpperCase(s); +b = changeCase.isLower(s); +b = changeCase.isLowerCase(s); +s = changeCase.ucFirst(s); +s = changeCase.upperCaseFirst(s); diff --git a/change-case/change-case.d.ts b/change-case/change-case.d.ts new file mode 100644 index 0000000000..e61d70de64 --- /dev/null +++ b/change-case/change-case.d.ts @@ -0,0 +1,37 @@ +// Type definitions for change-case +// Project: https://github.com/blakeembrey/change-case +// Definitions by: Asana +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "change-case" { + function dot(s: string): string; + function dotCase(s: string): string; + function swap(s: string): string; + function swapCase(s: string): string; + function path(s: string): string; + function pathCase(s: string): string; + function upper(s: string): string; + function upperCase(s: string): string; + function lower(s: string): string; + function lowerCase(s: string): string; + function camel(s: string): string; + function camelCase(s: string): string; + function snake(s: string): string; + function snakeCase(s: string): string; + function title(s: string): string; + function titleCase(s: string): string; + function param(s: string): string; + function paramCase(s: string): string; + function pascal(s: string): string; + function pascalCase(s: string): string; + function constant(s: string): string; + function constantCase(s: string): string; + function sentence(s: string): string; + function sentenceCase(s: string): string; + function isUpper(s: string): boolean; + function isUpperCase(s: string): boolean; + function isLower(s: string): boolean; + function isLowerCase(s: string): boolean; + function ucFirst(s: string): string; + function upperCaseFirst(s: string): string; +} From a0e56c27e72009602b8587b696ee42888f8fe5a5 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Thu, 6 Nov 2014 01:17:54 -0500 Subject: [PATCH 050/292] Adds definitions and tests for the Mousetrap global-bind extension --- .../mousetrap-global-bind-tests.ts | 42 +++++++++++++++++++ .../mousetrap-global-bind.d.ts | 11 +++++ 2 files changed, 53 insertions(+) create mode 100644 mousetrap-global-bind/mousetrap-global-bind-tests.ts create mode 100644 mousetrap-global-bind/mousetrap-global-bind.d.ts diff --git a/mousetrap-global-bind/mousetrap-global-bind-tests.ts b/mousetrap-global-bind/mousetrap-global-bind-tests.ts new file mode 100644 index 0000000000..92374d862e --- /dev/null +++ b/mousetrap-global-bind/mousetrap-global-bind-tests.ts @@ -0,0 +1,42 @@ +/// + +Mousetrap.globalBind('4', function() { console.log('4'); }); +Mousetrap.globalBind("?", function() { console.log('show shortcuts!'); }); +Mousetrap.globalBind('esc', function() { console.log('escape'); }, 'keyup'); + +// combinations +Mousetrap.globalBind('command+shift+K', function() { console.log('command shift k'); }); + +// map multiple combinations to the same callback +Mousetrap.globalBind(['command+k', 'ctrl+k'], function() { + console.log('command k or control k'); + + // return false to prevent default browser behavior + // and stop event from bubbling + return false; +}); + +// gmail style sequences +Mousetrap.globalBind('g i', function() { console.log('go to inbox'); }); +Mousetrap.globalBind('* a', function() { console.log('select all'); }); + +// konami code! +Mousetrap.globalBind('up up down down left right left right b a enter', function() { + console.log('konami code'); +}); + +Mousetrap.globalBind(['ctrl+s', 'meta+s'], (e, combo) => { + if (e.preventDefault) { + e.preventDefault(); + } else { + // internet explorer + e.returnValue = false; + } +}); + +Mousetrap.unbind('?'); + +Mousetrap.trigger('esc'); +Mousetrap.trigger('esc', 'keyup'); + +Mousetrap.reset(); diff --git a/mousetrap-global-bind/mousetrap-global-bind.d.ts b/mousetrap-global-bind/mousetrap-global-bind.d.ts new file mode 100644 index 0000000000..b22d5e3382 --- /dev/null +++ b/mousetrap-global-bind/mousetrap-global-bind.d.ts @@ -0,0 +1,11 @@ +// Type definitions for Mousetrap 1.4.6's global-bind extension +// Project: http://craig.is/killing/mice#extensions.global +// Definitions by: Andrew Bradley +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface MousetrapStatic { + globalBind(keys: string, callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; + globalBind(keyArray: string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; +} From 1d556e1d7c7d0c0a32ca48daaa4582ed165cd01b Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Thu, 6 Nov 2014 01:31:01 -0500 Subject: [PATCH 051/292] Modified Mousetrap definition to allow Mousetrap to be loaded as an external module. - tests are also updated to test loading as an external module - mousetrap exports itself as an AMD module when an AMD define function is present --- mousetrap/mousetrap-tests.ts | 8 ++++++++ mousetrap/mousetrap.d.ts | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/mousetrap/mousetrap-tests.ts b/mousetrap/mousetrap-tests.ts index 3eac1eef16..d60d8278d3 100644 --- a/mousetrap/mousetrap-tests.ts +++ b/mousetrap/mousetrap-tests.ts @@ -41,3 +41,11 @@ Mousetrap.trigger('esc'); Mousetrap.trigger('esc', 'keyup'); Mousetrap.reset(); + +// Test that Mousetrap can be loaded as an external module. +// Assume that if the externally-loaded module can be assigned to a variable with the type of global Mousetrap, +// then everything is working correctly. + +import importedMousetrap = require('mousetrap'); +var mousetrapModuleReference: typeof Mousetrap = importedMousetrap; + diff --git a/mousetrap/mousetrap.d.ts b/mousetrap/mousetrap.d.ts index dee352b42b..846e1f3ce2 100644 --- a/mousetrap/mousetrap.d.ts +++ b/mousetrap/mousetrap.d.ts @@ -19,3 +19,7 @@ interface MousetrapStatic { } declare var Mousetrap: MousetrapStatic; + +declare module "mousetrap" { + export = Mousetrap; +} From 5eef2e22f9980b06625e816bfc47b3bdc37d0f52 Mon Sep 17 00:00:00 2001 From: in-async Date: Thu, 6 Nov 2014 21:27:22 +0900 Subject: [PATCH 052/292] update angularfire.d.ts from 0.6.0 to 0.8.2 --- angularfire/angularfire-tests.ts | 208 ++++++++++++++++++++++--------- angularfire/angularfire.d.ts | 59 +++++---- 2 files changed, 185 insertions(+), 82 deletions(-) diff --git a/angularfire/angularfire-tests.ts b/angularfire/angularfire-tests.ts index 74a6c5a302..231c0f992c 100644 --- a/angularfire/angularfire-tests.ts +++ b/angularfire/angularfire-tests.ts @@ -3,76 +3,166 @@ var myapp = angular.module("myapp", ["firebase"]); interface AngularFireScope extends ng.IScope { - items: AngularFireArray; - remoteItems: RemoteItems; -} - -interface RemoteItems { - bar: string; + data: any; } var url = "https://myapp.firebaseio.com"; -myapp.controller("MyController", ["$scope", "$firebase", - function ($scope: AngularFireScope, $firebase: AngularFireService) { - var sync = $firebase(new Firebase(url)); +myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$FirebaseArray', + function ($scope: AngularFireScope, $firebase: AngularFireService, $FirebaseObject: AngularFireObjectService, $FirebaseArray: AngularFireArrayService) { + var ref = new Firebase(url); + var sync = $firebase(ref); - sync.$asArray() - .$loaded() - .then(function (list: AngularFireArray) { - console.log("list has " + list.length + " items"); + // AngularFire + { + sync.$asArray(); + sync.$asObject(); + sync.$ref(); + sync.$remove(); + sync.$push({ foo: "foo data" }); + sync.$set("foo", 1); + sync.$set({ foo: 2 }); + sync.$update({ foo: 3 }); + sync.$update("foo", { bar: 1 }); - list.$add({ foo: "bar" }).then(function (ref) { - ref.on("value", function (snapshot) { - if (snapshot.val().foo !== "bar") throw "error"; - }); + // Increment the message count by 1 + sync.$transaction('count', function (currentCount) { + if (!currentCount) return 1; // Initial value for counter. + if (currentCount < 0) return; // Return undefined to abort transaction. + return currentCount + 1; // Increment the count by 1. + }).then(function (snapshot) { + if (!snapshot) { + // Handle aborted transaction. + } else { + // Do something. + console.log(snapshot.val()); + } + }, function (err) { + // Handle the error condition. + console.log(err.stack); }); - - var item = list.$getRecord("foo"); - list.$remove("foo"); - list.$remove(0); - list.$save(); - }); - sync.$asObject() - - - $scope.items = sync.$asArray(); - $scope.object = sync.$asObject(); - - $scope.items.$add({ foo: "bar" }); - $scope.items.$remove("foo"); - $scope.items.$remove(); - $scope.items.$save(); - var child = $scope.items.$child("foo"); - child.$remove(); - $scope.items.$set({ bar: "baz" }); - var keys = $scope.items.$getIndex(); - keys.forEach(function (key, i) { - console.log(i, ($scope.items)[key]); - }); - $scope.items.$on("loaded", function () { - console.log("Initial data received!"); - }); - $scope.items.$on("change", function () { - console.log("A remote change was applied locally!"); - }); - $scope.items.$off('loaded'); - function stopSync() { - $scope.items.$off(); } - $scope.items.$bind($scope, "remoteItems"); - $scope.remoteItems.bar = "foo"; - $scope.items.$bind($scope, "remote").then(function (unbind) { - unbind(); - $scope.remoteItems.bar = "foo"; - }); + + + // AngularFireObject + { + var obj = sync.$asObject(); + + // $id + if (obj.$id !== ref.name()) throw "error"; + + // $loaded() + obj.$loaded().then((data) => { + if (data !== obj) throw "error"; + // $priority + obj.$priority; + + // $value, $save() + obj.$value = "foobar"; + obj.$save(); + }); + + // $inst() + if (obj.$inst() !== sync) throw "error"; + + // $bindTo() + obj.$bindTo($scope, "data").then(function () { + console.log($scope.data); + $scope.data.foo = "baz"; // will be saved to Firebase + sync.$set({ foo: "baz" }); // this would update Firebase and $scope.data + }); + + // $watch() + var unwatch = obj.$watch(function () { + console.log("data changed!"); + }); + unwatch(); + + // $destroy() + obj.$destroy(); + + // $extendFactory() + var NewFactory = $FirebaseObject.$extendFactory({ + getMyFavoriteColor: function () { + return this.favoriteColor + ", no green!"; // obscure Monty Python reference + } + }); + var customObj = $firebase(ref, { objectFactory: NewFactory }).$asObject(); + } + + // AngularFireArray + { + var list = sync.$asArray(); + + // $inst() + if (list.$inst() !== sync) throw "error"; + + // $add() + list.$add({ foo: "foo value" }); + + // $keyAt() + var key = list.$keyAt(0); + + // $indexFor() + var index = list.$indexFor(key); + + // $getRecord() + var item = list.$getRecord(key); + + // $save() + item["bar"] = "bar value"; + list.$save(item); + + // $remove() + list.$remove(item); + + // $loaded() + list.$loaded().then(data => { + if (data !== list) throw "error"; + }); + + // $watch() + var unwatch = list.$watch((event, key, prevChild) => { + switch (event) { + case "child_added": + console.log(key + " added"); + break; + case "child_changed": + console.log(key + " changed"); + break; + case "child_moved": + console.log(key + " moved"); + break; + case "child_removed": + console.log(key + " removed"); + break; + default: + throw "error"; + } + }); + unwatch(); + + // $destroy() + list.$destroy(); + + // $extendFactory() + var ArrayWithSum = $FirebaseArray.$extendFactory({ + sum: function () { + var total = 0; + angular.forEach(this.$list, function (rec) { + total += rec.x; + }); + return total; + } + }); + var list = $firebase(ref, { arrayFactory: ArrayWithSum }).$asArray(); + list.$loaded().then(function () { + console.log("List has " + (list).sum() + " items"); + }); + } } ]); -var foo: AngularFireObject = { - $priority: 0 -}; - interface AngularFireAuthScope extends ng.IScope { loginObj: AngularFireAuth; } diff --git a/angularfire/angularfire.d.ts b/angularfire/angularfire.d.ts index f81ac243fa..b6a0d55d26 100644 --- a/angularfire/angularfire.d.ts +++ b/angularfire/angularfire.d.ts @@ -1,4 +1,4 @@ -// Type definitions for AngularFire 0.8.2 and Firebase Simple Login 1.6.4 +// Type definitions for AngularFire 0.8.2 // Project: http://angularfire.com // Definitions by: Dénes Harmath // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -7,7 +7,7 @@ /// interface AngularFireService { - (firebase: Firebase, config?:any): AngularFire; + (firebase: Firebase, config?: any): AngularFire; } interface AngularFire { @@ -18,52 +18,65 @@ interface AngularFire { $set(key: string, data: any): ng.IPromise; $set(data: any): ng.IPromise; $remove(key?: string): ng.IPromise; - $update(key: string, data: any): ng.IPromise; + $update(key: string, data: Object): ng.IPromise; $update(data: any): ng.IPromise; $transaction(updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; + $transaction(key:string, updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; } -interface AngularFireObject { +interface AngularFireObject extends AngularFireSimpleObject { $id: string; $priority: number; $value: any; $save(): ng.IPromise; - $loaded(): ng.IPromise; - $inst(): Firebase; + $loaded(resolve?: (x: AngularFireObject) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireObject) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireObject) => void, reject?: (err: any) => any): ng.IPromise; + $inst(): AngularFire; $bindTo(scope: ng.IScope, varName: string): ng.IPromise; - $watch(callback: Function, context: any): Function; + $watch(callback: Function, context?: any): Function; $destroy(): void; - - $extendFactory(ChildClass: Object, methods?: Object); +} +interface AngularFireObjectService { + $extendFactory(ChildClass: Object, methods?: Object): Object; } -interface AngularFireArray extends Array { +interface AngularFireArray extends Array { $add(newData: any): ng.IPromise; $save(recordOrIndex: any): ng.IPromise; $remove(recordOrIndex: any): ng.IPromise; - $getRecord(key: string): any; + $getRecord(key: string): AngularFireSimpleObject; $keyAt(recordOrIndex: any): string; $indexFor(key: string): number; - $loaded(): ng.IPromise; - $inst(): Firebase; + $loaded(resolve?: (x: AngularFireArray) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireArray) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireArray) => void, reject?: (err: any) => any): ng.IPromise; + $inst(): AngularFire; $watch(cb: (event: string, key: string, prevChild: string) => void, context?: any): Function; $destroy(): void; - - $extendFactory(ChildClass:Object, methods?:Object); +} +interface AngularFireArrayService { + $extendFactory(ChildClass: Object, methods?: Object): Object; } +interface AngularFireSimpleObject { + $id: string; + $priority: number; + $value: any; + [key: string]: any; +} interface AngularFireAuthService { - (firebase: Firebase): AngularFireAuth; + (firebase: Firebase): AngularFireAuth; } interface AngularFireAuth { - $getCurrentUser(): ng.IPromise; - $login(provider: string, options?: Object): ng.IPromise; - $logout(): void; - $createUser(email: string, password: string): ng.IPromise; - $changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise; - $removeUser(email: string, password: string): ng.IPromise; - $sendPasswordResetEmail(email: string): ng.IPromise; + $getCurrentUser(): ng.IPromise; + $login(provider: string, options?: Object): ng.IPromise; + $logout(): void; + $createUser(email: string, password: string): ng.IPromise; + $changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise; + $removeUser(email: string, password: string): ng.IPromise; + $sendPasswordResetEmail(email: string): ng.IPromise; } From e0ffa8d04db54c071d276367c937fefd1df8fd67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Bourgeois?= Date: Thu, 6 Nov 2014 18:10:44 +0100 Subject: [PATCH 053/292] Missing function declaration for knockout. The destroy(function() {...}) was missing inside knockout declarations. --- knockout/knockout.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 861fc8fe30..5c9ab58f32 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -1,6 +1,6 @@ // Type definitions for Knockout v3.2.0-beta // Project: http://knockoutjs.com -// Definitions by: Boris Yankov , Igor Oleinikov +// Definitions by: Boris Yankov , Igor Oleinikov , Clément Bourgeois // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -38,6 +38,7 @@ interface KnockoutObservableArrayFunctions { removeAll(): T[]; destroy(item: T): void; + destroy(destroyFunction: (item: T) => boolean): void; destroyAll(items: T[]): void; destroyAll(): void; } From 59ea3f230968073885dc9f72bcb66747b737f2e5 Mon Sep 17 00:00:00 2001 From: Yang Guan Date: Thu, 6 Nov 2014 10:23:22 -0800 Subject: [PATCH 054/292] Modify tests for heatmap.js --- heatmap.js/heatmap-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heatmap.js/heatmap-tests.ts b/heatmap.js/heatmap-tests.ts index c61458faec..a90eb0aea4 100644 --- a/heatmap.js/heatmap-tests.ts +++ b/heatmap.js/heatmap-tests.ts @@ -6,7 +6,7 @@ var baseLayer = L.tileLayer( maxZoom: 18 }); -var testData: HeatmapDataObject = { +var testData: HeatmapData = { max: 8, data: [ { From c71628e0765eb8e240d8eabd2225f64ea2e2fdb8 Mon Sep 17 00:00:00 2001 From: Jeremy Bell Date: Thu, 6 Nov 2014 16:10:37 -0500 Subject: [PATCH 055/292] Adding legacy 1.2 versions of angular-animate, angular-cookies, angular-mocks, angular-resource, angular-route, angular-sanitize, and angular-scenario to address a reference issue when you bring in the 1.2 version of the core angular library. Updated documentation links in the 1.2 versions to point to the 1.2 versions of the documentation. Labeled /angularjs/angular-*.ts as 1.3 in the headers. These will be the starting points for a deeper 1.3 update review - though they are mostly backwards compatible as-is. --- angularjs/angular-animate.d.ts | 2 +- angularjs/angular-cookies.d.ts | 2 +- angularjs/angular-mocks.d.ts | 2 +- angularjs/angular-resource.d.ts | 30 +- angularjs/angular-route.d.ts | 2 +- angularjs/angular-sanitize.d.ts | 2 +- angularjs/angular-scenario.d.ts | 2 +- angularjs/legacy/angular-1.2.d.ts | 7 + angularjs/legacy/angular-animate-1.2.d.ts | 110 +++++++ angularjs/legacy/angular-cookies-1.2.d.ts | 43 +++ angularjs/legacy/angular-mocks-1.2-tests.ts | 305 ++++++++++++++++++ angularjs/legacy/angular-mocks-1.2.d.ts | 226 +++++++++++++ .../legacy/angular-resource-1.2-tests.ts | 138 ++++++++ angularjs/legacy/angular-resource-1.2.d.ts | 152 +++++++++ angularjs/legacy/angular-route-1.2-tests.ts | 17 + angularjs/legacy/angular-route-1.2.d.ts | 145 +++++++++ .../legacy/angular-sanitize-1.2-tests.ts | 10 + angularjs/legacy/angular-sanitize-1.2.d.ts | 35 ++ angularjs/legacy/angular-scenario-1.0.d.ts | 2 +- angularjs/legacy/angular-scenario-1.2.d.ts | 166 ++++++++++ 20 files changed, 1381 insertions(+), 17 deletions(-) create mode 100644 angularjs/legacy/angular-animate-1.2.d.ts create mode 100644 angularjs/legacy/angular-cookies-1.2.d.ts create mode 100644 angularjs/legacy/angular-mocks-1.2-tests.ts create mode 100644 angularjs/legacy/angular-mocks-1.2.d.ts create mode 100644 angularjs/legacy/angular-resource-1.2-tests.ts create mode 100644 angularjs/legacy/angular-resource-1.2.d.ts create mode 100644 angularjs/legacy/angular-route-1.2-tests.ts create mode 100644 angularjs/legacy/angular-route-1.2.d.ts create mode 100644 angularjs/legacy/angular-sanitize-1.2-tests.ts create mode 100644 angularjs/legacy/angular-sanitize-1.2.d.ts create mode 100644 angularjs/legacy/angular-scenario-1.2.d.ts diff --git a/angularjs/angular-animate.d.ts b/angularjs/angular-animate.d.ts index aa12399e5e..a01c93ef5b 100644 --- a/angularjs/angular-animate.d.ts +++ b/angularjs/angular-animate.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2+ (ngAnimate module) +// Type definitions for Angular JS 1.3 (ngAnimate module) // Project: http://angularjs.org // Definitions by: Michel Salib , Adi Dahiya // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/angular-cookies.d.ts b/angularjs/angular-cookies.d.ts index 6222216750..dc0c449089 100644 --- a/angularjs/angular-cookies.d.ts +++ b/angularjs/angular-cookies.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2 (ngCookies module) +// Type definitions for Angular JS 1.3 (ngCookies module) // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/angular-mocks.d.ts b/angularjs/angular-mocks.d.ts index 2591c006e9..877071127f 100644 --- a/angularjs/angular-mocks.d.ts +++ b/angularjs/angular-mocks.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2 (ngMock, ngMockE2E module) +// Type definitions for Angular JS 1.3 (ngMock, ngMockE2E module) // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 597a58e401..ed08c77dd9 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2 (ngResource module) +// Type definitions for Angular JS 1.3 (ngResource module) // Project: http://angularjs.org // Definitions by: Diego Vilar , Michael Jess // Definitions: https://github.com/daptiv/DefinitelyTyped @@ -11,6 +11,16 @@ /////////////////////////////////////////////////////////////////////////////// declare module ng.resource { + /** + * Currently supported options for the $resource factory options argument. + */ + interface IResourceOptions { + /** + * If true then the trailing slashes from any calculated URL will be stripped (defaults to true) + */ + stripTrailingSlashes?: boolean; + } + /////////////////////////////////////////////////////////////////////////// // ResourceService // see http://docs.angularjs.org/api/ngResource.$resource @@ -20,17 +30,17 @@ declare module ng.resource { /////////////////////////////////////////////////////////////////////////// interface IResourceService { (url: string, paramDefaults?: any, - /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } - where deleteDescriptor : IActionDescriptor */ - actionDescriptors?: any): IResourceClass>; + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actions?: any, options?: IResourceOptions): IResourceClass>; (url: string, paramDefaults?: any, - /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } - where deleteDescriptor : IActionDescriptor */ - actionDescriptors?: any): U; + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actions?: any, options?: IResourceOptions): U; (url: string, paramDefaults?: any, - /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } - where deleteDescriptor : IActionDescriptor */ - actionDescriptors?: any): IResourceClass; + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actions?: any, options?: IResourceOptions): IResourceClass; } // Just a reference to facilitate describing new actions diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index a71299e258..949680bf2d 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2 (ngRoute module) +// Type definitions for Angular JS 1.3 (ngRoute module) // Project: http://angularjs.org // Definitions by: Jonathan Park // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/angular-sanitize.d.ts b/angularjs/angular-sanitize.d.ts index a28bdb0d77..6fde0baef9 100644 --- a/angularjs/angular-sanitize.d.ts +++ b/angularjs/angular-sanitize.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.2 (ngSanitize module) +// Type definitions for Angular JS 1.3 (ngSanitize module) // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/angular-scenario.d.ts b/angularjs/angular-scenario.d.ts index ee71ffbea0..d1b7b19f61 100644 --- a/angularjs/angular-scenario.d.ts +++ b/angularjs/angular-scenario.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular Scenario Testing +// Type definitions for Angular Scenario Testing 1.3 (ngScenario module) // Project: http://angularjs.org // Definitions by: RomanoLindano // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/legacy/angular-1.2.d.ts b/angularjs/legacy/angular-1.2.d.ts index a1a4cb15be..fb21b030a6 100644 --- a/angularjs/legacy/angular-1.2.d.ts +++ b/angularjs/legacy/angular-1.2.d.ts @@ -410,6 +410,13 @@ declare module ng { cancel(promise: IPromise): boolean; } + /** + * The animation object which contains callback functions for each event that is expected to be animated. + */ + interface IAnimateCallbackObject { + eventFn(element: Node, doneFn: () => void): Function; + } + /////////////////////////////////////////////////////////////////////////// // FilterService // see http://docs.angularjs.org/api/ng.$filter diff --git a/angularjs/legacy/angular-animate-1.2.d.ts b/angularjs/legacy/angular-animate-1.2.d.ts new file mode 100644 index 0000000000..307e50760c --- /dev/null +++ b/angularjs/legacy/angular-animate-1.2.d.ts @@ -0,0 +1,110 @@ +// Type definitions for Angular JS 1.2 (ngAnimate module) +// Project: http://angularjs.org +// Definitions by: Michel Salib , Adi Dahiya +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/////////////////////////////////////////////////////////////////////////////// +// ngAnimate module (angular-animate.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng.animate { + + /////////////////////////////////////////////////////////////////////////// + // AnimateService + // see https://code.angularjs.org/1.2.26/docs/api/ngAnimate/service/$animate + /////////////////////////////////////////////////////////////////////////// + interface IAnimateService extends ng.IAnimateService { + /** + * Globally enables / disables animations. + * + * @param value If provided then set the animation on or off. + * @param element If provided then the element will be used to represent the enable/disable operation. + * @returns current animation state + */ + enabled(value?: boolean, element?: JQuery): boolean; + + /** + * Appends the element to the parentElement element that resides in the document and then runs the enter animation. + * + * @param element the element that will be the focus of the enter animation + * @param parentElement the parent element of the element that will be the focus of the enter animation + * @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the enter animation + * @param doneCallback the callback function that will be called once the animation is complete + */ + enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery, doneCallback?: () => void): void; + + /** + * Runs the leave animation operation and, upon completion, removes the element from the DOM. + * + * @param element the element that will be the focus of the leave animation + * @param doneCallback the callback function that will be called once the animation is complete + */ + leave(element: JQuery, doneCallback?: () => void): void; + + /** + * Fires the move DOM operation. Just before the animation starts, the animate service will either append + * it into the parentElement container or add the element directly after the afterElement element if present. + * Then the move animation will be run. + * + * @param element the element that will be the focus of the move animation + * @param parentElement the parent element of the element that will be the focus of the move animation + * @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation + * @param doneCallback the callback function that will be called once the animation is complete + */ + move(element: JQuery, parentElement: JQuery, afterElement?: JQuery, doneCallback?: () => void): void; + + /** + * Triggers a custom animation event based off the className variable and then attaches the className + * value to the element as a CSS class. + * + * @param element the element that will be animated + * @param className the CSS class that will be added to the element and then animated + * @param doneCallback the callback function that will be called once the animation is complete + */ + addClass(element: JQuery, className: string, doneCallback?: () => void): void; + + /** + * Triggers a custom animation event based off the className variable and then removes the CSS class + * provided by the className value from the element. + * + * @param element the element that will be animated + * @param className the CSS class that will be animated and then removed from the element + * @param doneCallback the callback function that will be called once the animation is complete + */ + removeClass(element: JQuery, className: string, doneCallback?: () => void): void; + + /** + * Adds and/or removes the given CSS classes to and from the element. Once complete, the done() callback + * will be fired (if provided). + * + * @param element the element which will have its CSS classes changed removed from it + * @param add the CSS classes which will be added to the element + * @param remove the CSS class which will be removed from the element CSS classes have been set on the element + * @param doneCallback done the callback function (if provided) that will be fired after the CSS classes have been set on the element + */ + setClass(element: JQuery, add: string, remove: string, doneCallback?: () => void): void; + } + + /////////////////////////////////////////////////////////////////////////// + // AngularProvider + // see https://code.angularjs.org/1.2.26/docs/api/ngAnimate/provider/$animateProvider + /////////////////////////////////////////////////////////////////////////// + interface IAnimateProvider { + /** + * Registers a new injectable animation factory function. + * + * @param name The name of the animation. + * @param factory The factory function that will be executed to return the animation object. + */ + register(name: string, factory: () => ng.IAnimateCallbackObject): void; + + /** + * Gets and/or sets the CSS class expression that is checked when performing an animation. + * + * @param expression The className expression which will be checked against all animations. + * @returns The current CSS className expression value. If null then there is no expression value. + */ + classNameFilter(expression?: RegExp): RegExp; + } +} diff --git a/angularjs/legacy/angular-cookies-1.2.d.ts b/angularjs/legacy/angular-cookies-1.2.d.ts new file mode 100644 index 0000000000..c5ff512e84 --- /dev/null +++ b/angularjs/legacy/angular-cookies-1.2.d.ts @@ -0,0 +1,43 @@ +// Type definitions for Angular JS 1.2 (ngCookies module) +// Project: http://angularjs.org +// Definitions by: Diego Vilar +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +/////////////////////////////////////////////////////////////////////////////// +// ngCookies module (angular-cookies.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng.cookies { + + /////////////////////////////////////////////////////////////////////////// + // CookieService + // see https://code.angularjs.org/1.2.26/docs/api/ngCookies/service/$cookies + /////////////////////////////////////////////////////////////////////////// + interface ICookiesService {} + + /////////////////////////////////////////////////////////////////////////// + // CookieStoreService + // see https://code.angularjs.org/1.2.26/docs/api/ngCookies/service/$cookieStore + /////////////////////////////////////////////////////////////////////////// + interface ICookieStoreService { + /** + * Returns the value of given cookie key + * @param key Id to use for lookup + */ + get(key: string): any; + /** + * Sets a value for given cookie key + * @param key Id for the value + * @param value Value to be stored + */ + put(key: string, value: any): void; + /** + * Remove given cookie + * @param key Id of the key-value pair to delete + */ + remove(key: string): void; + } + +} diff --git a/angularjs/legacy/angular-mocks-1.2-tests.ts b/angularjs/legacy/angular-mocks-1.2-tests.ts new file mode 100644 index 0000000000..6f359a67c4 --- /dev/null +++ b/angularjs/legacy/angular-mocks-1.2-tests.ts @@ -0,0 +1,305 @@ +/// + +/////////////////////////////////////// +// IAngularStatic +/////////////////////////////////////// +var angular: ng.IAngularStatic; +var mock: ng.IMockStatic; + +mock = angular.mock; + + +/////////////////////////////////////// +// IMockStatic +/////////////////////////////////////// +var date: Date; + +mock.dump({ key: 'value' }); + +mock.inject( + function () { return 1; }, + function () { return 2; } + ); + +mock.inject( + ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }]); + +// This overload is not documented on the website, but flows from +// how the injector works. +mock.inject( + ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 1; }], + ['$rootScope', function ($rootScope: ng.IRootScopeService) { return 2; }]); + +mock.module('module1', 'module2'); +mock.module( + function () { return 1; }, + function () { return 2; } + ); +mock.module({ module1: function () { return 1; } }); + +date = mock.TzDate(-7, '2013-1-1T15:00:00Z'); +date = mock.TzDate(-8, 12345678); + + +/////////////////////////////////////// +// IExceptionHandlerProvider +/////////////////////////////////////// +var exceptionHandlerProvider: ng.IExceptionHandlerProvider; + +exceptionHandlerProvider.mode('log'); + + +/////////////////////////////////////// +// ITimeoutService +/////////////////////////////////////// +var timeoutService: ng.ITimeoutService; + +timeoutService.flush(); +timeoutService.flush(1234); +timeoutService.flushNext(); +timeoutService.flushNext(1234); +timeoutService.verifyNoPendingTasks(); + +//////////////////////////////////////// +// IIntervalService +//////////////////////////////////////// +var intervalService: ng.IIntervalService; +var intervalServiceTimeActuallyAdvanced: number; + +intervalServiceTimeActuallyAdvanced = intervalService.flush(); +intervalServiceTimeActuallyAdvanced = intervalService.flush(1234); + +/////////////////////////////////////// +// ILogService, ILogCall +/////////////////////////////////////// +var logService: ng.ILogService; +var logCall: ng.ILogCall; +var logs: string[]; + +logService.assertEmpty(); +logService.reset(); + +logCall = logService.debug; +logCall = logService.error; +logCall = logService.info; +logCall = logService.log; +logCall = logService.warn; + +logs = logCall.logs; + + +/////////////////////////////////////// +// IHttpBackendService +/////////////////////////////////////// +var httpBackendService: ng.IHttpBackendService; +var requestHandler: ng.mock.IRequestHandler; + +httpBackendService.flush(); +httpBackendService.flush(1234); +httpBackendService.resetExpectations(); +httpBackendService.verifyNoOutstandingExpectation(); +httpBackendService.verifyNoOutstandingRequest(); + +requestHandler = httpBackendService.expect('GET', 'http://test.local'); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data'); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', 'http://test.local', { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data'); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expect('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); + +requestHandler = httpBackendService.expectDELETE('http://test.local'); +requestHandler = httpBackendService.expectDELETE('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.expectDELETE(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectGET('http://test.local'); +requestHandler = httpBackendService.expectGET('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.expectGET(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectHEAD('http://test.local'); +requestHandler = httpBackendService.expectHEAD('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.expectHEAD(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.expectJSONP('http://test.local'); +requestHandler = httpBackendService.expectJSONP(/test.local/); + +requestHandler = httpBackendService.expectPATCH('http://test.local'); +requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data'); +requestHandler = httpBackendService.expectPATCH('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/); +requestHandler = httpBackendService.expectPATCH('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPATCH('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expectPATCH('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/); +requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data'); +requestHandler = httpBackendService.expectPATCH(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/); +requestHandler = httpBackendService.expectPATCH(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.expectPATCH(/test.local/, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.expectPOST('http://test.local'); +requestHandler = httpBackendService.expectPOST('http://test.local', 'response data'); +requestHandler = httpBackendService.expectPOST('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', /response data/); +requestHandler = httpBackendService.expectPOST('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPOST('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expectPOST('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/); +requestHandler = httpBackendService.expectPOST(/test.local/, 'response data'); +requestHandler = httpBackendService.expectPOST(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, /response data/); +requestHandler = httpBackendService.expectPOST(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.expectPOST(/test.local/, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.expectPUT('http://test.local'); +requestHandler = httpBackendService.expectPUT('http://test.local', 'response data'); +requestHandler = httpBackendService.expectPUT('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', /response data/); +requestHandler = httpBackendService.expectPUT('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPUT('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.expectPUT('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/); +requestHandler = httpBackendService.expectPUT(/test.local/, 'response data'); +requestHandler = httpBackendService.expectPUT(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, /response data/); +requestHandler = httpBackendService.expectPUT(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.expectPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.expectPUT(/test.local/, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.when('GET', 'http://test.local'); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data'); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', 'http://test.local', { key: 'value' }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/); +requestHandler = httpBackendService.when('GET', /test.local/, 'response data'); +requestHandler = httpBackendService.when('GET', /test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, 'response data', function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, /response data/); +requestHandler = httpBackendService.when('GET', /test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, /response data/, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, function (data: string): boolean { return true; }, function (headers: Object): boolean { return true; }); +requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.when('GET', /test.local/, { key: 'value' }, function (headers: Object): boolean { return true; }); + +requestHandler = httpBackendService.whenDELETE('http://test.local'); +requestHandler = httpBackendService.whenDELETE('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.whenDELETE(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenGET('http://test.local'); +requestHandler = httpBackendService.whenGET('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.whenGET(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenHEAD('http://test.local'); +requestHandler = httpBackendService.whenHEAD('http://test.local', { header: 'value' }); +requestHandler = httpBackendService.whenHEAD(/test.local/, { header: 'value' }); +requestHandler = httpBackendService.whenJSONP('http://test.local'); +requestHandler = httpBackendService.whenJSONP(/test.local/); + +requestHandler = httpBackendService.whenPATCH('http://test.local'); +requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data'); +requestHandler = httpBackendService.whenPATCH('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/); +requestHandler = httpBackendService.whenPATCH('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPATCH('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.whenPATCH('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/); +requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data'); +requestHandler = httpBackendService.whenPATCH(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/); +requestHandler = httpBackendService.whenPATCH(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPATCH(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.whenPATCH(/test.local/, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.whenPOST('http://test.local'); +requestHandler = httpBackendService.whenPOST('http://test.local', 'response data'); +requestHandler = httpBackendService.whenPOST('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', /response data/); +requestHandler = httpBackendService.whenPOST('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPOST('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.whenPOST('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/); +requestHandler = httpBackendService.whenPOST(/test.local/, 'response data'); +requestHandler = httpBackendService.whenPOST(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, /response data/); +requestHandler = httpBackendService.whenPOST(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPOST(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.whenPOST(/test.local/, { key: 'value' }, { header: 'value' }); + +requestHandler = httpBackendService.whenPUT('http://test.local'); +requestHandler = httpBackendService.whenPUT('http://test.local', 'response data'); +requestHandler = httpBackendService.whenPUT('http://test.local', 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', /response data/); +requestHandler = httpBackendService.whenPUT('http://test.local', /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPUT('http://test.local', function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', { key: 'value' }); +requestHandler = httpBackendService.whenPUT('http://test.local', { key: 'value' }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/); +requestHandler = httpBackendService.whenPUT(/test.local/, 'response data'); +requestHandler = httpBackendService.whenPUT(/test.local/, 'response data', { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, /response data/); +requestHandler = httpBackendService.whenPUT(/test.local/, /response data/, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }); +requestHandler = httpBackendService.whenPUT(/test.local/, function (data: string): boolean { return true; }, { header: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }); +requestHandler = httpBackendService.whenPUT(/test.local/, { key: 'value' }, { header: 'value' }); + + +/////////////////////////////////////// +// IRequestHandler +/////////////////////////////////////// +requestHandler.passThrough(); +requestHandler.respond(function () { }); +requestHandler.respond({ key: 'value' }); +requestHandler.respond({ key: 'value' }, { header: 'value' }); +requestHandler.respond(404); +requestHandler.respond(404, { key: 'value' }); +requestHandler.respond(404, { key: 'value' }, { header: 'value' }); diff --git a/angularjs/legacy/angular-mocks-1.2.d.ts b/angularjs/legacy/angular-mocks-1.2.d.ts new file mode 100644 index 0000000000..e9b0dc8d24 --- /dev/null +++ b/angularjs/legacy/angular-mocks-1.2.d.ts @@ -0,0 +1,226 @@ +// Type definitions for Angular JS 1.2 (ngMock, ngMockE2E module) +// Project: http://angularjs.org +// Definitions by: Diego Vilar +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +/////////////////////////////////////////////////////////////////////////////// +// functions attached to global object (window) +/////////////////////////////////////////////////////////////////////////////// +declare var module: (...modules: any[]) => any; +declare var inject: (...fns: Function[]) => any; + +/////////////////////////////////////////////////////////////////////////////// +// ngMock module (angular-mocks.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng { + + /////////////////////////////////////////////////////////////////////////// + // AngularStatic + // We reopen it to add the MockStatic definition + /////////////////////////////////////////////////////////////////////////// + interface IAngularStatic { + mock: IMockStatic; + } + + interface IMockStatic { + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/function/angular.mock.dump + dump(obj: any): string; + + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/function/angular.mock.inject + inject(...fns: Function[]): any; + inject(...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works + + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/function/angular.mock.module + module(...modules: any[]): any; + + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/type/angular.mock.TzDate + TzDate(offset: number, timestamp: number): Date; + TzDate(offset: number, timestamp: string): Date; + } + + /////////////////////////////////////////////////////////////////////////// + // ExceptionHandlerService + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/service/$exceptionHandler + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/provider/$exceptionHandlerProvider + /////////////////////////////////////////////////////////////////////////// + interface IExceptionHandlerProvider extends IServiceProvider { + mode(mode: string): void; + } + + /////////////////////////////////////////////////////////////////////////// + // TimeoutService + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/service/$timeout + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface ITimeoutService { + flush(delay?: number): void; + flushNext(expectedDelay?: number): void; + verifyNoPendingTasks(): void; + } + + /////////////////////////////////////////////////////////////////////////// + // IntervalService + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/service/$interval + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface IIntervalService { + flush(millis?: number): number; + } + + /////////////////////////////////////////////////////////////////////////// + // LogService + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/service/$log + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface ILogService { + assertEmpty(): void; + reset(): void; + } + + interface ILogCall { + logs: string[]; + } + + /////////////////////////////////////////////////////////////////////////// + // HttpBackendService + // see https://code.angularjs.org/1.2.26/docs/api/ngMock/service/$httpBackend + /////////////////////////////////////////////////////////////////////////// + interface IHttpBackendService { + flush(count?: number): void; + resetExpectations(): void; + verifyNoOutstandingExpectation(): void; + verifyNoOutstandingRequest(): void; + + expect(method: string, url: string, data?: string, headers?: Object): mock.IRequestHandler; + expect(method: string, url: string, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + expect(method: string, url: string, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expect(method: string, url: string, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: string, data?: Object, headers?: Object): mock.IRequestHandler; + expect(method: string, url: string, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + expect(method: string, url: RegExp, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler; + + expectDELETE(url: string, headers?: Object): mock.IRequestHandler; + expectDELETE(url: RegExp, headers?: Object): mock.IRequestHandler; + expectGET(url: string, headers?: Object): mock.IRequestHandler; + expectGET(url: RegExp, headers?: Object): mock.IRequestHandler; + expectHEAD(url: string, headers?: Object): mock.IRequestHandler; + expectHEAD(url: RegExp, headers?: Object): mock.IRequestHandler; + expectJSONP(url: string): mock.IRequestHandler; + expectJSONP(url: RegExp): mock.IRequestHandler; + + expectPATCH(url: string, data?: string, headers?: Object): mock.IRequestHandler; + expectPATCH(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPATCH(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPATCH(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + expectPATCH(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + expectPATCH(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPATCH(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPATCH(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + + expectPOST(url: string, data?: string, headers?: Object): mock.IRequestHandler; + expectPOST(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPOST(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPOST(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + expectPOST(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + expectPOST(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPOST(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPOST(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + + expectPUT(url: string, data?: string, headers?: Object): mock.IRequestHandler; + expectPUT(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPUT(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPUT(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + expectPUT(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + expectPUT(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + expectPUT(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + expectPUT(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + + when(method: string, url: string, data?: string, headers?: Object): mock.IRequestHandler; + when(method: string, url: string, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + when(method: string, url: string, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + when(method: string, url: string, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: string, data?: Object, headers?: Object): mock.IRequestHandler; + when(method: string, url: string, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + when(method: string, url: RegExp, data?: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + when(method: string, url: RegExp, data?: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + when(method: string, url: RegExp, data?: (data: string) => boolean, headers?: (object: Object) => boolean): mock.IRequestHandler; + when(method: string, url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + when(method: string, url: RegExp, data?: Object, headers?: (object: Object) => boolean): mock.IRequestHandler; + + whenDELETE(url: string, headers?: Object): mock.IRequestHandler; + whenDELETE(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + whenDELETE(url: RegExp, headers?: Object): mock.IRequestHandler; + whenDELETE(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + + whenGET(url: string, headers?: Object): mock.IRequestHandler; + whenGET(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + whenGET(url: RegExp, headers?: Object): mock.IRequestHandler; + whenGET(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + + whenHEAD(url: string, headers?: Object): mock.IRequestHandler; + whenHEAD(url: string, headers?: (object: Object) => boolean): mock.IRequestHandler; + whenHEAD(url: RegExp, headers?: Object): mock.IRequestHandler; + whenHEAD(url: RegExp, headers?: (object: Object) => boolean): mock.IRequestHandler; + + whenJSONP(url: string): mock.IRequestHandler; + whenJSONP(url: RegExp): mock.IRequestHandler; + + whenPATCH(url: string, data?: string, headers?: Object): mock.IRequestHandler; + whenPATCH(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPATCH(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPATCH(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + whenPATCH(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + whenPATCH(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPATCH(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPATCH(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + + whenPOST(url: string, data?: string, headers?: Object): mock.IRequestHandler; + whenPOST(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPOST(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPOST(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + whenPOST(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + whenPOST(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPOST(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPOST(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + + whenPUT(url: string, data?: string, headers?: Object): mock.IRequestHandler; + whenPUT(url: string, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPUT(url: string, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPUT(url: string, data?: Object, headers?: Object): mock.IRequestHandler; + whenPUT(url: RegExp, data?: string, headers?: Object): mock.IRequestHandler; + whenPUT(url: RegExp, data?: RegExp, headers?: Object): mock.IRequestHandler; + whenPUT(url: RegExp, data?: (data: string) => boolean, headers?: Object): mock.IRequestHandler; + whenPUT(url: RegExp, data?: Object, headers?: Object): mock.IRequestHandler; + } + + export module mock { + + // returned interface by the the mocked HttpBackendService expect/when methods + interface IRequestHandler { + respond(func: Function): void; + respond(status: number, data?: any, headers?: any): void; + respond(data: any, headers?: any): void; + + // Available wehn ngMockE2E is loaded + passThrough(): void; + } + + } + +} diff --git a/angularjs/legacy/angular-resource-1.2-tests.ts b/angularjs/legacy/angular-resource-1.2-tests.ts new file mode 100644 index 0000000000..ca970f5c40 --- /dev/null +++ b/angularjs/legacy/angular-resource-1.2-tests.ts @@ -0,0 +1,138 @@ +/// + +interface IMyResource extends ng.resource.IResource { }; +interface IMyResourceClass extends ng.resource.IResourceClass { }; + +/////////////////////////////////////// +// IActionDescriptor +/////////////////////////////////////// +var actionDescriptor: ng.resource.IActionDescriptor; + +actionDescriptor.headers = { header: 'value' }; +actionDescriptor.isArray = true; +actionDescriptor.method = 'method action'; +actionDescriptor.params = { key: 'value' }; + + +/////////////////////////////////////// +// IResourceClass +/////////////////////////////////////// +var resourceClass: IMyResourceClass; +var resource: IMyResource; +var resourceArray: ng.resource.IResourceArray; + +resource = resourceClass.delete(); +resource = resourceClass.delete({ key: 'value' }); +resource = resourceClass.delete({ key: 'value' }, function () { }); +resource = resourceClass.delete(function () { }); +resource = resourceClass.delete(function () { }, function () { }); +resource = resourceClass.delete({ key: 'value' }, { key: 'value' }); +resource = resourceClass.delete({ key: 'value' }, { key: 'value' }, function () { }); +resource = resourceClass.delete({ key: 'value' }, { key: 'value' }, function () { }, function () { }); +resource.$promise.then(function(data: IMyResource) {}); + +resource = resourceClass.get(); +resource = resourceClass.get({ key: 'value' }); +resource = resourceClass.get({ key: 'value' }, function () { }); +resource = resourceClass.get(function () { }); +resource = resourceClass.get(function () { }, function () { }); +resource = resourceClass.get({ key: 'value' }, { key: 'value' }); +resource = resourceClass.get({ key: 'value' }, { key: 'value' }, function () { }); +resource = resourceClass.get({ key: 'value' }, { key: 'value' }, function () { }, function () { }); + +resourceArray = resourceClass.query(); +resourceArray = resourceClass.query({ key: 'value' }); +resourceArray = resourceClass.query({ key: 'value' }, function () { }); +resourceArray = resourceClass.query(function () { }); +resourceArray = resourceClass.query(function () { }, function () { }); +resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' }); +resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' }, function () { }); +resourceArray = resourceClass.query({ key: 'value' }, { key: 'value' }, function () { }, function () { }); +resourceArray.push(resource); +resourceArray.$promise.then(function(data: ng.resource.IResourceArray) {}); + +resource = resourceClass.remove(); +resource = resourceClass.remove({ key: 'value' }); +resource = resourceClass.remove({ key: 'value' }, function () { }); +resource = resourceClass.remove(function () { }); +resource = resourceClass.remove(function () { }, function () { }); +resource = resourceClass.remove({ key: 'value' }, { key: 'value' }); +resource = resourceClass.remove({ key: 'value' }, { key: 'value' }, function () { }); +resource = resourceClass.remove({ key: 'value' }, { key: 'value' }, function () { }, function () { }); + +resource = resourceClass.save(); +resource = resourceClass.save({ key: 'value' }); +resource = resourceClass.save({ key: 'value' }, function () { }); +resource = resourceClass.save(function () { }); +resource = resourceClass.save(function () { }, function () { }); +resource = resourceClass.save({ key: 'value' }, { key: 'value' }); +resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { }); +resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { }, function () { }); + +/////////////////////////////////////// +// IResource +/////////////////////////////////////// + +var promise : ng.IPromise; +var arrayPromise : ng.IPromise; + +promise = resource.$delete(); +promise = resource.$delete({ key: 'value' }); +promise = resource.$delete({ key: 'value' }, function () { }); +promise = resource.$delete(function () { }); +promise = resource.$delete(function () { }, function () { }); +promise = resource.$delete({ key: 'value' }, function () { }, function () { }); +promise.then(function(data: IMyResource) {}); + +promise = resource.$get(); +promise = resource.$get({ key: 'value' }); +promise = resource.$get({ key: 'value' }, function () { }); +promise = resource.$get(function () { }); +promise = resource.$get(function () { }, function () { }); +promise = resource.$get({ key: 'value' }, function () { }, function () { }); + +arrayPromise = resourceArray[0].$query(); +arrayPromise = resourceArray[0].$query({ key: 'value' }); +arrayPromise = resourceArray[0].$query({ key: 'value' }, function () { }); +arrayPromise = resourceArray[0].$query(function () { }); +arrayPromise = resourceArray[0].$query(function () { }, function () { }); +arrayPromise = resourceArray[0].$query({ key: 'value' }, function () { }, function () { }); +arrayPromise.then(function(data: ng.resource.IResourceArray) {}); + +promise = resource.$remove(); +promise = resource.$remove({ key: 'value' }); +promise = resource.$remove({ key: 'value' }, function () { }); +promise = resource.$remove(function () { }); +promise = resource.$remove(function () { }, function () { }); +promise = resource.$remove({ key: 'value' }, function () { }, function () { }); + +promise = resource.$save(); +promise = resource.$save({ key: 'value' }); +promise = resource.$save({ key: 'value' }, function () { }); +promise = resource.$save(function () { }); +promise = resource.$save(function () { }, function () { }); +promise = resource.$save({ key: 'value' }, function () { }, function () { }); + +/////////////////////////////////////// +// IResourceService +/////////////////////////////////////// +var resourceService: ng.resource.IResourceService; +resourceClass = resourceService('test'); +resourceClass = resourceService('test'); +resourceClass = resourceService('test'); + +/////////////////////////////////////// +// IModule +/////////////////////////////////////// +var mod: ng.IModule; +var resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction; +var resourceService: ng.resource.IResourceService; + +resourceClass = resourceServiceFactoryFunction(resourceService); + +resourceServiceFactoryFunction = function (resourceService: ng.resource.IResourceService) { return resourceClass; }; +mod = mod.factory('factory name', resourceServiceFactoryFunction); + +/////////////////////////////////////// +// IResource +/////////////////////////////////////// \ No newline at end of file diff --git a/angularjs/legacy/angular-resource-1.2.d.ts b/angularjs/legacy/angular-resource-1.2.d.ts new file mode 100644 index 0000000000..f3c3fbe65c --- /dev/null +++ b/angularjs/legacy/angular-resource-1.2.d.ts @@ -0,0 +1,152 @@ +// Type definitions for Angular JS 1.2 (ngResource module) +// Project: http://angularjs.org +// Definitions by: Diego Vilar , Michael Jess +// Definitions: https://github.com/daptiv/DefinitelyTyped + +/// + + +/////////////////////////////////////////////////////////////////////////////// +// ngResource module (angular-resource.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng.resource { + + /////////////////////////////////////////////////////////////////////////// + // ResourceService + // see https://code.angularjs.org/1.2.26/docs/api/ngResource/service/$resource + // Most of the following definitions were achieved by analyzing the + // actual implementation, since the documentation doesn't seem to cover + // that deeply. + /////////////////////////////////////////////////////////////////////////// + interface IResourceService { + (url: string, paramDefaults?: any, + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actionDescriptors?: any): IResourceClass>; + (url: string, paramDefaults?: any, + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actionDescriptors?: any): U; + (url: string, paramDefaults?: any, + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actionDescriptors?: any): IResourceClass; + } + + // Just a reference to facilitate describing new actions + interface IActionDescriptor { + method: string; + isArray?: boolean; + params?: any; + headers?: any; + } + + // Baseclass for everyresource with default actions. + // If you define your new actions for the resource, you will need + // to extend this interface and typecast the ResourceClass to it. + // + // In case of passing the first argument as anything but a function, + // it's gonna be considered data if the action method is POST, PUT or + // PATCH (in other words, methods with body). Otherwise, it's going + // to be considered as parameters to the request. + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L461-L465 + // + // Only those methods with an HTTP body do have 'data' as first parameter: + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L463 + // More specifically, those methods are POST, PUT and PATCH: + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L432 + // + // Also, static calls always return the IResource (or IResourceArray) retrieved + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L549 + interface IResourceClass { + new(dataOrParams? : any) : T; + get(): T; + get(params: Object): T; + get(success: Function, error?: Function): T; + get(params: Object, success: Function, error?: Function): T; + get(params: Object, data: Object, success?: Function, error?: Function): T; + + query(): IResourceArray; + query(params: Object): IResourceArray; + query(success: Function, error?: Function): IResourceArray; + query(params: Object, success: Function, error?: Function): IResourceArray; + query(params: Object, data: Object, success?: Function, error?: Function): IResourceArray; + + save(): T; + save(data: Object): T; + save(success: Function, error?: Function): T; + save(data: Object, success: Function, error?: Function): T; + save(params: Object, data: Object, success?: Function, error?: Function): T; + + remove(): T; + remove(params: Object): T; + remove(success: Function, error?: Function): T; + remove(params: Object, success: Function, error?: Function): T; + remove(params: Object, data: Object, success?: Function, error?: Function): T; + + delete(): T; + delete(params: Object): T; + delete(success: Function, error?: Function): T; + delete(params: Object, success: Function, error?: Function): T; + delete(params: Object, data: Object, success?: Function, error?: Function): T; + } + + // Instance calls always return the the promise of the request which retrieved the object + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L546 + interface IResource { + $get(): ng.IPromise; + $get(params?: Object, success?: Function, error?: Function): ng.IPromise; + $get(success: Function, error?: Function): ng.IPromise; + + $query(): ng.IPromise>; + $query(params?: Object, success?: Function, error?: Function): ng.IPromise>; + $query(success: Function, error?: Function): ng.IPromise>; + + $save(): ng.IPromise; + $save(params?: Object, success?: Function, error?: Function): ng.IPromise; + $save(success: Function, error?: Function): ng.IPromise; + + $remove(): ng.IPromise; + $remove(params?: Object, success?: Function, error?: Function): ng.IPromise; + $remove(success: Function, error?: Function): ng.IPromise; + + $delete(): ng.IPromise; + $delete(params?: Object, success?: Function, error?: Function): ng.IPromise; + $delete(success: Function, error?: Function): ng.IPromise; + + /** the promise of the original server interaction that created this instance. **/ + $promise : ng.IPromise; + $resolved : boolean; + } + + /** + * Really just a regular Array object with $promise and $resolve attached to it + */ + interface IResourceArray extends Array { + /** the promise of the original server interaction that created this collection. **/ + $promise : ng.IPromise>; + $resolved : boolean; + } + + /** when creating a resource factory via IModule.factory */ + interface IResourceServiceFactoryFunction { + ($resource: ng.resource.IResourceService): IResourceClass; + >($resource: ng.resource.IResourceService): U; + } +} + +/** extensions to base ng based on using angular-resource */ +declare module ng { + + interface IModule { + /** creating a resource service factory */ + factory(name: string, resourceServiceFactoryFunction: ng.resource.IResourceServiceFactoryFunction): IModule; + } +} + +interface Array +{ + /** the promise of the original server interaction that created this collection. **/ + $promise : ng.IPromise>; + $resolved : boolean; +} diff --git a/angularjs/legacy/angular-route-1.2-tests.ts b/angularjs/legacy/angular-route-1.2-tests.ts new file mode 100644 index 0000000000..0b82110ef2 --- /dev/null +++ b/angularjs/legacy/angular-route-1.2-tests.ts @@ -0,0 +1,17 @@ +/// + +/** + * @license HTTP Auth Interceptor Module for AngularJS + * (c) 2013 Jonathan Park @ Daptiv Solutions Inc + * License: MIT + */ + +declare var $routeProvider: ng.route.IRouteProvider; +$routeProvider + .when('/projects/:projectId/dashboard',{ + controller: '', + templateUrl: '', + caseInsensitiveMatch: true, + reloadOnSearch: false + }) + .otherwise({redirectTo: '/'}); diff --git a/angularjs/legacy/angular-route-1.2.d.ts b/angularjs/legacy/angular-route-1.2.d.ts new file mode 100644 index 0000000000..7afd4af5a5 --- /dev/null +++ b/angularjs/legacy/angular-route-1.2.d.ts @@ -0,0 +1,145 @@ +// Type definitions for Angular JS 1.2 (ngRoute module) +// Project: http://angularjs.org +// Definitions by: Jonathan Park +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + + +/////////////////////////////////////////////////////////////////////////////// +// ngRoute module (angular-route.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng.route { + + /////////////////////////////////////////////////////////////////////////// + // RouteParamsService + // see https://code.angularjs.org/1.2.26/docs/api/ngRoute/service/$routeParams + /////////////////////////////////////////////////////////////////////////// + interface IRouteParamsService { + [key: string]: any; + } + + /////////////////////////////////////////////////////////////////////////// + // RouteService + // see https://code.angularjs.org/1.2.26/docs/api/ngRoute/service/$route + // see https://code.angularjs.org/1.2.26/docs/api/ngRoute/provider/$routeProvider + /////////////////////////////////////////////////////////////////////////// + interface IRouteService { + /** + * Causes $route service to reload the current route even if $location hasn't changed. + * As a result of that, ngView creates new scope, reinstantiates the controller. + */ + reload(): void; + + /** + * Object with all route configuration Objects as its properties. + */ + routes: any; + + // May not always be available. For instance, current will not be available + // to a controller that was not initialized as a result of a route maching. + current?: ICurrentRoute; + } + + + /** + * see https://code.angularjs.org/1.2.26/docs/api/ngRoute/provider/$routeProvider#when for API documentation + */ + interface IRoute { + /** + * {(string|function()=} + * Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string. + */ + controller?: any; + /** + * A controller alias name. If present the controller will be published to scope under the controllerAs name. + */ + controllerAs?: string; + /** + * Undocumented? + */ + name?: string; + /** + * {string=|function()=} + * Html template as a string or a function that returns an html template as a string which should be used by ngView or ngInclude directives. This property takes precedence over templateUrl. + * + * If template is a function, it will be called with the following parameters: + * + * {Array.} - route parameters extracted from the current $location.path() by applying the current route + */ + template?: string; + /** + * {string=|function()=} + * Path or function that returns a path to an html template that should be used by ngView. + * + * If templateUrl is a function, it will be called with the following parameters: + * + * {Array.} - route parameters extracted from the current $location.path() by applying the current route + */ + templateUrl?: any; + /** + * {Object.=} - An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired. The map object is: + * + * - key - {string}: a name of a dependency to be injected into the controller. + * - factory - {string|function}: If string then it is an alias for a service. Otherwise if function, then it is injected and the return value is treated as the dependency. If the result is a promise, it is resolved before its value is injected into the controller. Be aware that ngRoute.$routeParams will still refer to the previous route within these resolve functions. Use $route.current.params to access the new route parameters, instead. + */ + resolve?: {[key: string]: any}; + /** + * {(string|function())=} + * Value to update $location path with and trigger route redirection. + * + * If redirectTo is a function, it will be called with the following parameters: + * + * - {Object.} - route parameters extracted from the current $location.path() by applying the current route templateUrl. + * - {string} - current $location.path() + * - {Object} - current $location.search() + * - The custom redirectTo function is expected to return a string which will be used to update $location.path() and $location.search(). + */ + redirectTo?: any; + /** + * Reload route when only $location.search() or $location.hash() changes. + * + * This option defaults to true. If the option is set to false and url in the browser changes, then $routeUpdate event is broadcasted on the root scope. + */ + reloadOnSearch?: boolean; + /** + * Match routes without being case sensitive + * + * This option defaults to false. If the option is set to true, then the particular route can be matched without being case sensitive + */ + caseInsensitiveMatch?: boolean; + } + + // see https://code.angularjs.org/1.2.26/docs/api/ngRoute/service/$route#current + interface ICurrentRoute extends IRoute { + locals: { + $scope: IScope; + $template: string; + }; + + params: any; + } + + interface IRouteProvider extends IServiceProvider { + /** + * Sets route definition that will be used on route change when no other route definition is matched. + * + * @params Mapping information to be assigned to $route.current. + */ + otherwise(params: IRoute): IRouteProvider; + /** + * Adds a new route definition to the $route service. + * + * @param path Route path (matched against $location.path). If $location.path contains redundant trailing slash or is missing one, the route will still match and the $location.path will be updated to add or drop the trailing slash to exactly match the route definition. + * + * - path can contain named groups starting with a colon: e.g. :name. All characters up to the next slash are matched and stored in $routeParams under the given name when the route matches. + * - path can contain named groups starting with a colon and ending with a star: e.g.:name*. All characters are eagerly stored in $routeParams under the given name when the route matches. + * - path can contain optional named groups with a question mark: e.g.:name?. + * + * For example, routes like /color/:color/largecode/:largecode*\/edit will match /color/brown/largecode/code/with/slashes/edit and extract: color: brown and largecode: code/with/slashes. + * + * @param route Mapping information to be assigned to $route.current on route match. + */ + when(path: string, route: IRoute): IRouteProvider; + } +} diff --git a/angularjs/legacy/angular-sanitize-1.2-tests.ts b/angularjs/legacy/angular-sanitize-1.2-tests.ts new file mode 100644 index 0000000000..853bbf3495 --- /dev/null +++ b/angularjs/legacy/angular-sanitize-1.2-tests.ts @@ -0,0 +1,10 @@ +/// + +var shouldBeString: string; + +declare var $sanitizeService: ng.sanitize.ISanitizeService; +shouldBeString = $sanitizeService(shouldBeString); + +declare var $linky: ng.sanitize.filter.ILinky; +shouldBeString = $linky(shouldBeString); +shouldBeString = $linky(shouldBeString, shouldBeString); diff --git a/angularjs/legacy/angular-sanitize-1.2.d.ts b/angularjs/legacy/angular-sanitize-1.2.d.ts new file mode 100644 index 0000000000..4c6805c9a4 --- /dev/null +++ b/angularjs/legacy/angular-sanitize-1.2.d.ts @@ -0,0 +1,35 @@ +// Type definitions for Angular JS 1.2 (ngSanitize module) +// Project: http://angularjs.org +// Definitions by: Diego Vilar +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +/////////////////////////////////////////////////////////////////////////////// +// ngSanitize module (angular-sanitize.js) +/////////////////////////////////////////////////////////////////////////////// +declare module ng.sanitize { + + /////////////////////////////////////////////////////////////////////////// + // SanitizeService + // see https://code.angularjs.org/1.2.26/docs/api/ngSanitize/service/$sanitize + /////////////////////////////////////////////////////////////////////////// + interface ISanitizeService { + (html: string): string; + } + + /////////////////////////////////////////////////////////////////////////// + // Filters included with the ngSanitize + // see https://code.angularjs.org/1.2.26/docs/api/ngSanitize/filter + /////////////////////////////////////////////////////////////////////////// + export module filter { + + // Finds links in text input and turns them into html links. + // Supports http/https/ftp/mailto and plain email address links. + // see https://code.angularjs.org/1.2.26/docs/api/ngSanitize/filter/linky + interface ILinky { + (text: string, target?: string): string; + } + } +} diff --git a/angularjs/legacy/angular-scenario-1.0.d.ts b/angularjs/legacy/angular-scenario-1.0.d.ts index 8dd605f7d8..a44b79096c 100644 --- a/angularjs/legacy/angular-scenario-1.0.d.ts +++ b/angularjs/legacy/angular-scenario-1.0.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular Scenario Testing +// Type definitions for Angular Scenario Testing 1.0 (ngScenario module) // Project: [http://angularjs.org] // Definitions by: [RomanoLindano] // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/angularjs/legacy/angular-scenario-1.2.d.ts b/angularjs/legacy/angular-scenario-1.2.d.ts new file mode 100644 index 0000000000..9e72db8956 --- /dev/null +++ b/angularjs/legacy/angular-scenario-1.2.d.ts @@ -0,0 +1,166 @@ +// Type definitions for Angular Scenario Testing 1.2 (ngScenario module) +// Project: http://angularjs.org +// Definitions by: RomanoLindano +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module ng { + export interface IAngularStatic { + scenario: any; + } +} + +declare module angularScenario { + + export interface RunFunction { + (functionToRun: any): any; + } + export interface RunFunctionWithDescription { + (description: string, functionToRun: any): any; + } + + export interface PauseFunction { + (): any; + } + + export interface SleepFunction { + (seconds: number): any; + } + + export interface Future { + } + + export interface testWindow { + href(): Future; + path(): Future; + search(): Future; + hash(): Future; + } + + export interface testLocation { + url(): Future; + path(): Future; + search(): Future; + hash(): Future; + } + + export interface Browser { + navigateTo(url: string): void; + navigateTo(urlDescription: string, urlFunction: () => string): void; + reload(): void; + window(): testWindow; + location(): testLocation; + } + + export interface Matchers { + toEqual(value: any): void; + toBe(value: any): void; + toBeDefined(): void; + toBeTruthy(): void; + toBeFalsy(): void; + toMatch(regularExpression: any): void; + toBeNull(): void; + toContain(value: any): void; + toBeLessThan(value: any): void; + toBeGreaterThan(value: any): void; + } + + export interface CustomMatchers extends Matchers { + } + + export interface Expect extends CustomMatchers { + not(): angularScenario.CustomMatchers; + } + + export interface UsingFunction { + (selector: string, selectorDescription?: string): void; + } + + export interface BindingFunction { + (bracketBindingExpression: string): Future; + } + + export interface Input { + enter(value: any): any; + check(): any; + select(radioButtonValue: any): any; + val(): Future; + } + + export interface Repeater { + count(): Future; + row(index: number): Future; + column(ngBindingExpression: string): Future; + } + + export interface Select { + option(value: any): any; + option(...listOfValues: any[]): any; + } + + export interface Element { + count(): Future; + click(): any; + dblclick(): any; + mouseover(): any; + mousedown(): any; + mouseup(): any; + query(callback: (selectedDOMElements: JQuery, callbackWhenDone: (objNull: any, futureValue: any) => any) => any): any; + val(): Future; + text(): Future; + html(): Future; + height(): Future; + innerHeight(): Future; + outerHeight(): Future; + width(): Future; + innerWidth(): Future; + outerWidth(): Future; + position(): Future; + scrollLeft(): Future; + scrollTop(): Future; + offset(): Future; + + val(value: any): void; + text(value: any): void; + html(value: any): void; + height(value: any): void; + innerHeight(value: any): void; + outerHeight(value: any): void; + width(value: any): void; + innerWidth(value: any): void; + outerWidth(value: any): void; + position(value: any): void; + scrollLeft(value: any): void; + scrollTop(value: any): void; + offset(value: any): void; + + attr(key: any): Future; + prop(key: any): Future; + css(key: any): Future; + + attr(key: any, value: any): void; + prop(key: any, value: any): void; + css(key: any, value: any): void; + } +} + +declare var describe: angularScenario.RunFunctionWithDescription; +declare var ddescribe: angularScenario.RunFunctionWithDescription; +declare var xdescribe: angularScenario.RunFunctionWithDescription; +declare var beforeEach: angularScenario.RunFunction; +declare var afterEach: angularScenario.RunFunction; +declare var it: angularScenario.RunFunctionWithDescription; +declare var iit: angularScenario.RunFunctionWithDescription; +declare var xit: angularScenario.RunFunctionWithDescription; +declare var pause: angularScenario.PauseFunction; +declare var sleep: angularScenario.SleepFunction; +declare function browser(): angularScenario.Browser; +declare function expect(expectation: angularScenario.Future): angularScenario.Expect; +declare var using: angularScenario.UsingFunction; +declare var binding: angularScenario.BindingFunction; +declare function input(ngModelBinding: string): angularScenario.Input; +declare function repeater(selector: string, repeaterDescription?: string): angularScenario.Repeater; +declare function select(ngModelBinding: string): angularScenario.Select; +declare function element(selector: string, elementDescription?: string): angularScenario.Element; +declare var angular: ng.IAngularStatic; From a012987c65e53119c57a76403d1797dbe3367e15 Mon Sep 17 00:00:00 2001 From: PROGRE Date: Fri, 7 Nov 2014 07:01:15 +0900 Subject: [PATCH 056/292] fix String to string --- socket.io/socket.io.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/socket.io/socket.io.d.ts b/socket.io/socket.io.d.ts index ddf7ff11bb..b6aad32931 100644 --- a/socket.io/socket.io.d.ts +++ b/socket.io/socket.io.d.ts @@ -33,7 +33,7 @@ declare module SocketIO { listen(port: number, opts: any): Server; bind(srv: any): Server; onconnection(socket: any): Server; - of(nsp: String): Namespace; + of(nsp: string): Namespace; emit(name: string, ...args: any[]): Socket; use(fn: Function): Namespace; @@ -43,7 +43,7 @@ declare module SocketIO { } interface Namespace extends NodeJS.EventEmitter { - name: String; + name: string; connected: { [id: number]: Socket }; use(fn: Function): Namespace From 01c33d5b56938244110cc71d0d36c65bc0f5ad0b Mon Sep 17 00:00:00 2001 From: Payton Yao Date: Fri, 7 Nov 2014 16:20:40 +0800 Subject: [PATCH 057/292] Update swfobject to work with other scopes and variable names. --- swfobject/swfobject.d.ts | 144 ++++++++++++++++++++------------------- 1 file changed, 74 insertions(+), 70 deletions(-) diff --git a/swfobject/swfobject.d.ts b/swfobject/swfobject.d.ts index 98c748d7ab..7128e269ee 100644 --- a/swfobject/swfobject.d.ts +++ b/swfobject/swfobject.d.ts @@ -3,90 +3,94 @@ // Definitions by: rou // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module swfobject { - export var ua: { - w3: boolean; - pv: number[]; - wk: any; // number or boolean - ie: boolean; - win: boolean; - mac: boolean; - }; +declare var swfobject: swfobject.SwfObject; - export function registerObject( - objectIdStr: string, - swfVersionStr: string, - xiSwfUrlStr?: string, - callbackFn?: (callbackObj: ICallbackObj) => void +declare module swfobject { + export interface SwfObject { + ua: { + w3: boolean; + pv: number[]; + wk: any; // number or boolean + ie: boolean; + win: boolean; + mac: boolean; + }; + + registerObject( + objectIdStr: string, + swfVersionStr: string, + xiSwfUrlStr?: string, + callbackFn?: (callbackObj: ICallbackObj) => void ): void; - export function getObjectById( - objectIdStr: string + getObjectById( + objectIdStr: string ): HTMLElement; - export function embedSWF( - swfUrlStr: string, - replaceElemIdStr: string, - widthStr: string, - heightStr: string, - swfVersionStr: string, - xiSwfUrlStr?: string, - flashvarsObj?: Object, - parObj?: Object, - attObj?: Object, - callbackFn?: (callbackObj: ICallbackObj) => void + embedSWF( + swfUrlStr: string, + replaceElemIdStr: string, + widthStr: string, + heightStr: string, + swfVersionStr: string, + xiSwfUrlStr?: string, + flashvarsObj?: Object, + parObj?: Object, + attObj?: Object, + callbackFn?: (callbackObj: ICallbackObj) => void ): void; - export function switchOffAutoHideShow(): void; + switchOffAutoHideShow(): void; - export function getFlashPlayerVersion(): IFlashPlayerVersion; + getFlashPlayerVersion(): IFlashPlayerVersion; - interface IFlashPlayerVersion { + hasFlashPlayerVersion( + rv: string + ): void; + + createSWF( + attObj: ISwfObjectAttribute, + parObj: ISwfObjectParameter, + replaceElemIdStr: string + ): HTMLElement; + + showExpressInstall( + att: ISwfObjectAttribute, + par: ISwfObjectParameter, + replaceElemIdStr: string, + callbackFn?: (callbackObj: ICallbackObj) => void + ): void; + + removeSWF( + objElemIdStr: string + ): void; + + createCSS( + selStr: string, + declStr: string, + mediaStr?: string, + newStyleBoolean?: boolean + ): void; + + addDomLoadEvent( + fn: () => void + ): void; + + addLoadEvent( + fn: (event?: Event) => void + ): void; + + getQueryParamValue( + param?: string + ): string; + } + + export interface IFlashPlayerVersion { major: number; minor: number; release: number; } - export function hasFlashPlayerVersion( - rv: string - ): void; - - export function createSWF( - attObj: ISwfObjectAttribute, - parObj: ISwfObjectParameter, - replaceElemIdStr: string - ): HTMLElement; - - export function showExpressInstall( - att: ISwfObjectAttribute, - par: ISwfObjectParameter, - replaceElemIdStr: string, - callbackFn?: (callbackObj: ICallbackObj) => void - ): void; - - export function removeSWF( - objElemIdStr: string - ): void; - - export function createCSS( - selStr: string, - declStr: string, - mediaStr?: string, - newStyleBoolean?: boolean - ): void; - - export function addDomLoadEvent( - fn: () => void - ): void; - - export function addLoadEvent( - fn: (event?: Event) => void - ): void; - - export function getQueryParamValue( - param?: string - ): string; - export interface ISwfObjectAttribute { id?: string; width?: string; From 24bf981aba084453a946f3a4f588cd2c90a0d4c9 Mon Sep 17 00:00:00 2001 From: in-async Date: Fri, 7 Nov 2014 17:49:10 +0900 Subject: [PATCH 058/292] =?UTF-8?q?=E4=BD=9C=E6=A5=AD=E9=80=94=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- firebase/firebase-tests.ts | 142 +++++++++++++++++++++++++++++++++++++ firebase/firebase.d.ts | 96 ++++++++++++++++++++++++- 2 files changed, 235 insertions(+), 3 deletions(-) diff --git a/firebase/firebase-tests.ts b/firebase/firebase-tests.ts index eb6be83734..647ecb663d 100644 --- a/firebase/firebase-tests.ts +++ b/firebase/firebase-tests.ts @@ -11,6 +11,94 @@ dataRef.auth(AUTH_TOKEN, function(error, result) { } }); +// Log me in +dataRef.authWithCustomToken(AUTH_TOKEN, function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); + +// Log me in +dataRef.authAnonymously(function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); + +// Log me in +dataRef.authWithPassword({ + "email" : "bobtony@firebase.com", + "password" : "correcthorsebatterystaple" +}, function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); + +// Log me in +dataRef.authWithOAuthPopup("twitter", function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); + +// Log me in +dataRef.authWithOAuthRedirect("twitter", function(error) { + if (error) { + console.log('Login Failed!', error); + } else { + // We'll never get here, as the page will redirect on success. + } +}); + +// Authenticate with Facebook using an existing OAuth 2.0 access token +dataRef.authWithOAuthToken("facebook", "", function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); +// Authenticate with Twitter using an existing OAuth 1.0a credential set +dataRef.authWithOAuthToken("twitter", { + "user_id" : "", + "oauth_token" : "", + "oauth_token_secret" : "", +}, function(error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } +}); + +var authData = dataRef.getAuth(); +if (authData) { + console.log('Authenticated user with uid:', authData.uid); +} + +var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com'); +firebaseRef.onAuth(function(authData) { + if (authData) { + console.log('Client is authenticated with uid ' + authData.uid); + } else { + // Client is unauthenticated + } +}); + +var onAuthChange = function(authData) { /*...*/ }; +firebaseRef.onAuth(onAuthChange); +// Sometime later... +firebaseRef.offAuth(onAuthChange); + //Time to log out! dataRef.unauth(); @@ -32,10 +120,64 @@ var sampleChatRef2 :Firebase= fredRef2.root(); var x3:string = sampleChatRef2.toString(); // x is now 'https://SampleChat.firebaseIO-demo.com'. +var fredRef = new Firebase("https://samplechat.firebaseio-demo.com/users/fred"); +var key = fredRef.key(); // key === "fred" +key = fredRef.child("name/last").key(); // key === "last" +key = fredRef.root().key(); // key === null, since fredRef refers to the root of the Firebase. + var fredRef3:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred'); var x4:string = fredRef3.name(); // x is now 'fred'. +/* + * $set + */ +var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); +fredNameRef.child('first').set('Fred'); +fredNameRef.child('last').set('Flintstone'); +// We've written 'Fred' to the Firebase location storing fred's first name, +// and 'Flintstone' to the location storing his last name + +fredNameRef.set({ first: 'Fred', last: 'Flintstone' }); +// Exact same effect as the previous example, except we've written +// fred's first and last name simultaneously + +var onComplete = function(error) { + if (error) { + console.log('Synchronization failed'); + } else { + console.log('Synchronization succeeded'); + } +}; +fredNameRef.set({ first: 'Fred', last: 'Flintstone' }, onComplete); +// Same as the previous example, except we will also log a message +// when the data has finished synchronizing + + +/* + * $update + */ +var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); +// Modify the 'first' and 'last' children, but leave other data at fredNameRef unchanged +fredNameRef.update({ first: 'Fred', last: 'Flintstone' }); + +// Same as the previous example, except we will also display an alert +// message when the data has finished synchronizing. +var onComplete = function(error) { + if (error) { + console.log('Synchronization failed'); + } else { + console.log('Synchronization succeeded'); + } +}; +fredNameRef.update({ first: 'Wilma', last: 'Flintstone' }, onComplete); + +var fredRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred'); +//The following 2 function calls are equivalent +fredRef.update({ name: { first: 'Fred', last: 'Flintstone' }}); +fredRef.child('name').set({ first: 'Fred', last: 'Flintstone' }); + + // Increment Fred's rank by 1. var fredRankRef:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred/rank'); fredRankRef.transaction(function(currentRank: number) { diff --git a/firebase/firebase.d.ts b/firebase/firebase.d.ts index bac32fbc63..796d14d59e 100644 --- a/firebase/firebase.d.ts +++ b/firebase/firebase.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Firebase API +// Type definitions for Firebase API 2.0.2 // Project: https://www.firebase.com/docs/javascript/firebase // Definitions by: Vincent Botone // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -43,16 +43,92 @@ interface IFirebaseQuery { } declare class Firebase implements IFirebaseQuery { + /** + * Constructs a new Firebase reference from a full Firebase URL. + */ constructor(firebaseURL: string); - auth(authToken: string, onComplete?: (error: any, result: IFirebaseAuthResult) => void, onCancel?:(error: any) => void): void; + /** + * @deprecated Use authWithCustomToken() instead. + * Authenticates a Firebase client using the provided authentication token or Firebase Secret. + */ + auth(authToken: string, onComplete?: (error: any, result: IFirebaseAuthResult) => void, onCancel?: (error: any) => void): void; + /** + * Authenticates a Firebase client using an authentication token or Firebase Secret. + */ + authWithCustomToken(autoToken: string, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?:Object): void; + /** + * Authenticates a Firebase client using a new, temporary guest account. + */ + authAnonymously(onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Authenticates a Firebase client using an email / password combination. + */ + authWithPassword(credentials: IFirebaseCredentials, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Authenticates a Firebase client using a popup-based OAuth flow. + */ + authWithOAuthPopup(provider: string, onComplete:(error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Authenticates a Firebase client using a redirect-based OAuth flow. + */ + authWithOAuthRedirect(provider: string, onComplete: (error: any) => void, options?: Object): void; + /** + * Authenticates a Firebase client using OAuth access tokens or credentials. + */ + authWithOAuthToken(provider: string, credentials: string, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + authWithOAuthToken(provider: string, credentials: Object, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Synchronously access the current authentication state of the client. + */ + getAuth(): IFirebaseAuthData; + /** + * Listen for changes to the client's authentication state. + */ + onAuth(onComplete: (authData: IFirebaseAuthData) => void, context?: Object): void; + /** + * Detaches a callback previously attached with onAuth(). + */ + offAuth(onComplete: (authData: IFirebaseAuthData) => void, context?: Object): void; + /** + * Unauthenticates a Firebase client. + */ unauth(): void; + /** + * Gets a Firebase reference for the location at the specified relative path. + */ child(childPath: string): Firebase; + /** + * Gets a Firebase reference to the parent location. + */ parent(): Firebase; + /** + * Gets a Firebase reference to the root of the Firebase. + */ root(): Firebase; + /** + * Returns the last token in a Firebase location. + */ + key(): string; + /** + * @deprecated Use key() instead. + * Returns the last token in a Firebase location. + */ name(): string; + /** + * Gets the absolute URL corresponding to this Firebase reference's location. + */ toString(): string; + /** + * Writes data to this Firebase location. + */ set(value: any, onComplete?: (error: any) => void): void; - update(value: any, onComplete?: (error: any) => void): void; + /** + * Writes the enumerated children to this Firebase location. + */ + update(value: Object, onComplete?: (error: any) => void): void; + /** + * + */ remove(onComplete?: (error: any) => void): void; push(value: any, onComplete?: (error: any) => void): Firebase; setWithPriority(value: any, priority: string, onComplete?: (error: any) => void): void; @@ -73,3 +149,17 @@ declare class Firebase implements IFirebaseQuery { goOffline(): void; goOnline(): void; } + +// Reference: https://www.firebase.com/docs/web/api/firebase/getauth.html +interface IFirebaseAuthData { + uid: string; + provider: string; + token: string; + expires: number; + auth: Object; +} + +interface IFirebaseCredentials { + email: string; + password: string; +} \ No newline at end of file From 154c40d628946ea6b6b15dc9fc341f47036ccf0b Mon Sep 17 00:00:00 2001 From: in-async Date: Fri, 7 Nov 2014 17:56:53 +0900 Subject: [PATCH 059/292] =?UTF-8?q?Revert=20"=E4=BD=9C=E6=A5=AD=E9=80=94?= =?UTF-8?q?=E4=B8=AD"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 24bf981aba084453a946f3a4f588cd2c90a0d4c9. --- firebase/firebase-tests.ts | 142 ------------------------------------- firebase/firebase.d.ts | 96 +------------------------ 2 files changed, 3 insertions(+), 235 deletions(-) diff --git a/firebase/firebase-tests.ts b/firebase/firebase-tests.ts index 647ecb663d..eb6be83734 100644 --- a/firebase/firebase-tests.ts +++ b/firebase/firebase-tests.ts @@ -11,94 +11,6 @@ dataRef.auth(AUTH_TOKEN, function(error, result) { } }); -// Log me in -dataRef.authWithCustomToken(AUTH_TOKEN, function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); - -// Log me in -dataRef.authAnonymously(function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); - -// Log me in -dataRef.authWithPassword({ - "email" : "bobtony@firebase.com", - "password" : "correcthorsebatterystaple" -}, function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); - -// Log me in -dataRef.authWithOAuthPopup("twitter", function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); - -// Log me in -dataRef.authWithOAuthRedirect("twitter", function(error) { - if (error) { - console.log('Login Failed!', error); - } else { - // We'll never get here, as the page will redirect on success. - } -}); - -// Authenticate with Facebook using an existing OAuth 2.0 access token -dataRef.authWithOAuthToken("facebook", "", function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); -// Authenticate with Twitter using an existing OAuth 1.0a credential set -dataRef.authWithOAuthToken("twitter", { - "user_id" : "", - "oauth_token" : "", - "oauth_token_secret" : "", -}, function(error, authData) { - if (error) { - console.log('Login Failed!', error); - } else { - console.log('Authenticated successfully with payload:', authData); - } -}); - -var authData = dataRef.getAuth(); -if (authData) { - console.log('Authenticated user with uid:', authData.uid); -} - -var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com'); -firebaseRef.onAuth(function(authData) { - if (authData) { - console.log('Client is authenticated with uid ' + authData.uid); - } else { - // Client is unauthenticated - } -}); - -var onAuthChange = function(authData) { /*...*/ }; -firebaseRef.onAuth(onAuthChange); -// Sometime later... -firebaseRef.offAuth(onAuthChange); - //Time to log out! dataRef.unauth(); @@ -120,64 +32,10 @@ var sampleChatRef2 :Firebase= fredRef2.root(); var x3:string = sampleChatRef2.toString(); // x is now 'https://SampleChat.firebaseIO-demo.com'. -var fredRef = new Firebase("https://samplechat.firebaseio-demo.com/users/fred"); -var key = fredRef.key(); // key === "fred" -key = fredRef.child("name/last").key(); // key === "last" -key = fredRef.root().key(); // key === null, since fredRef refers to the root of the Firebase. - var fredRef3:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred'); var x4:string = fredRef3.name(); // x is now 'fred'. -/* - * $set - */ -var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); -fredNameRef.child('first').set('Fred'); -fredNameRef.child('last').set('Flintstone'); -// We've written 'Fred' to the Firebase location storing fred's first name, -// and 'Flintstone' to the location storing his last name - -fredNameRef.set({ first: 'Fred', last: 'Flintstone' }); -// Exact same effect as the previous example, except we've written -// fred's first and last name simultaneously - -var onComplete = function(error) { - if (error) { - console.log('Synchronization failed'); - } else { - console.log('Synchronization succeeded'); - } -}; -fredNameRef.set({ first: 'Fred', last: 'Flintstone' }, onComplete); -// Same as the previous example, except we will also log a message -// when the data has finished synchronizing - - -/* - * $update - */ -var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); -// Modify the 'first' and 'last' children, but leave other data at fredNameRef unchanged -fredNameRef.update({ first: 'Fred', last: 'Flintstone' }); - -// Same as the previous example, except we will also display an alert -// message when the data has finished synchronizing. -var onComplete = function(error) { - if (error) { - console.log('Synchronization failed'); - } else { - console.log('Synchronization succeeded'); - } -}; -fredNameRef.update({ first: 'Wilma', last: 'Flintstone' }, onComplete); - -var fredRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred'); -//The following 2 function calls are equivalent -fredRef.update({ name: { first: 'Fred', last: 'Flintstone' }}); -fredRef.child('name').set({ first: 'Fred', last: 'Flintstone' }); - - // Increment Fred's rank by 1. var fredRankRef:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred/rank'); fredRankRef.transaction(function(currentRank: number) { diff --git a/firebase/firebase.d.ts b/firebase/firebase.d.ts index 796d14d59e..bac32fbc63 100644 --- a/firebase/firebase.d.ts +++ b/firebase/firebase.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Firebase API 2.0.2 +// Type definitions for Firebase API // Project: https://www.firebase.com/docs/javascript/firebase // Definitions by: Vincent Botone // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -43,92 +43,16 @@ interface IFirebaseQuery { } declare class Firebase implements IFirebaseQuery { - /** - * Constructs a new Firebase reference from a full Firebase URL. - */ constructor(firebaseURL: string); - /** - * @deprecated Use authWithCustomToken() instead. - * Authenticates a Firebase client using the provided authentication token or Firebase Secret. - */ - auth(authToken: string, onComplete?: (error: any, result: IFirebaseAuthResult) => void, onCancel?: (error: any) => void): void; - /** - * Authenticates a Firebase client using an authentication token or Firebase Secret. - */ - authWithCustomToken(autoToken: string, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?:Object): void; - /** - * Authenticates a Firebase client using a new, temporary guest account. - */ - authAnonymously(onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; - /** - * Authenticates a Firebase client using an email / password combination. - */ - authWithPassword(credentials: IFirebaseCredentials, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; - /** - * Authenticates a Firebase client using a popup-based OAuth flow. - */ - authWithOAuthPopup(provider: string, onComplete:(error: any, authData: IFirebaseAuthData) => void, options?: Object): void; - /** - * Authenticates a Firebase client using a redirect-based OAuth flow. - */ - authWithOAuthRedirect(provider: string, onComplete: (error: any) => void, options?: Object): void; - /** - * Authenticates a Firebase client using OAuth access tokens or credentials. - */ - authWithOAuthToken(provider: string, credentials: string, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; - authWithOAuthToken(provider: string, credentials: Object, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; - /** - * Synchronously access the current authentication state of the client. - */ - getAuth(): IFirebaseAuthData; - /** - * Listen for changes to the client's authentication state. - */ - onAuth(onComplete: (authData: IFirebaseAuthData) => void, context?: Object): void; - /** - * Detaches a callback previously attached with onAuth(). - */ - offAuth(onComplete: (authData: IFirebaseAuthData) => void, context?: Object): void; - /** - * Unauthenticates a Firebase client. - */ + auth(authToken: string, onComplete?: (error: any, result: IFirebaseAuthResult) => void, onCancel?:(error: any) => void): void; unauth(): void; - /** - * Gets a Firebase reference for the location at the specified relative path. - */ child(childPath: string): Firebase; - /** - * Gets a Firebase reference to the parent location. - */ parent(): Firebase; - /** - * Gets a Firebase reference to the root of the Firebase. - */ root(): Firebase; - /** - * Returns the last token in a Firebase location. - */ - key(): string; - /** - * @deprecated Use key() instead. - * Returns the last token in a Firebase location. - */ name(): string; - /** - * Gets the absolute URL corresponding to this Firebase reference's location. - */ toString(): string; - /** - * Writes data to this Firebase location. - */ set(value: any, onComplete?: (error: any) => void): void; - /** - * Writes the enumerated children to this Firebase location. - */ - update(value: Object, onComplete?: (error: any) => void): void; - /** - * - */ + update(value: any, onComplete?: (error: any) => void): void; remove(onComplete?: (error: any) => void): void; push(value: any, onComplete?: (error: any) => void): Firebase; setWithPriority(value: any, priority: string, onComplete?: (error: any) => void): void; @@ -149,17 +73,3 @@ declare class Firebase implements IFirebaseQuery { goOffline(): void; goOnline(): void; } - -// Reference: https://www.firebase.com/docs/web/api/firebase/getauth.html -interface IFirebaseAuthData { - uid: string; - provider: string; - token: string; - expires: number; - auth: Object; -} - -interface IFirebaseCredentials { - email: string; - password: string; -} \ No newline at end of file From 6d9f08eda8b2f7e8560095801b3a3d88b5c11ca6 Mon Sep 17 00:00:00 2001 From: Shinya Ohira Date: Fri, 7 Nov 2014 23:31:02 +0900 Subject: [PATCH 060/292] Fix server.method --- hapi/hapi-tests.ts | 30 ++++++++++++++++++++++++++++++ hapi/hapi.d.ts | 4 ++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/hapi/hapi-tests.ts b/hapi/hapi-tests.ts index da28b97a37..586d3d29f8 100644 --- a/hapi/hapi-tests.ts +++ b/hapi/hapi-tests.ts @@ -25,6 +25,36 @@ server.pack.register([plugin], (err: Object) => { if (err) { throw err; } }); +// Add server method +var add = function (a: number, b: number, next: (err: any, result?: any, ttl?: number) => void) { + next(null, a + b); +}; + +server.method('sum', add, { cache: { expiresIn: 2000 } }); + +server.methods.sum(4, 5, (err: any, result: any) => { + console.log(result); +}); + +var addArray = function (array: Array, next: (err: any, result?: any, ttl?: number) => void) { + var sum: number = 0; + array.forEach((item: number) => { + sum += item; + }); + next(null, sum); +}; + +server.method('sumObj', addArray, { + cache: { expiresIn: 2000 }, + generateKey: (array: Array) => { + return array.join(','); + } +}); + +server.methods.sumObj([5, 6], (err: any, result: any) => { + console.log(result); +}); + // Add the route server.route({ method: 'GET', diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index 09453737ad..de65efcdc8 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -279,7 +279,7 @@ declare module Hapi { export class Server { app: any; - methods: Array<() => void>; + methods: any; info: { port: number; host?: string; @@ -336,7 +336,7 @@ declare module Hapi { }; ext(event: any, method: string, options?: any): void; method(method: Array<{name: string; fn: () => void; options: any}>): void; - method(name: string, fn: () => void, options: any): void; + method(name: string, fn: Function, options: any): void; inject(options: any, callback: any): void; handler(name: string, method: (name: string, options: any) => void): void; } From fd5dbacc769bab316b82a052e1c58f7fd72bf88c Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Sat, 8 Nov 2014 03:42:15 +0900 Subject: [PATCH 061/292] Fix ajaxSettings --- zepto/zepto.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zepto/zepto.d.ts b/zepto/zepto.d.ts index aa497b03f9..b01df91739 100644 --- a/zepto/zepto.d.ts +++ b/zepto/zepto.d.ts @@ -1580,13 +1580,20 @@ interface ZeptoAjaxSettings { data?: any; processData?: boolean; contentType?: string; + mimeType?: string; dataType?: string; + jsonp?: string; + jsonpCallback?: any; // string or Function timeout?: number; headers?: { [key: string]: string }; async?: boolean; global?: boolean; context?: any; traditional?: boolean; + cache?: boolean; + xhrFields?: { [key: string]: any }; + username?: string; + password?: string; beforeSend?: (xhr: XMLHttpRequest, settings: ZeptoAjaxSettings) => boolean; success?: (data: any, status: string, xhr: XMLHttpRequest) => void; error?: (xhr: XMLHttpRequest, errorType: string, error: Error) => void; From 17641114cc82526031fd20b966c8a2d73e9531f8 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Fri, 7 Nov 2014 17:01:09 -0500 Subject: [PATCH 062/292] Adding definition file for adm-zip. --- CONTRIBUTORS.md | 1 + adm-zip/adm-zip-tests.ts | 33 +++++ adm-zip/adm-zip.d.ts | 300 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 334 insertions(+) create mode 100644 adm-zip/adm-zip-tests.ts create mode 100644 adm-zip/adm-zip.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f4665695e0..4dbaecc21b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -7,6 +7,7 @@ All definitions files include a header with the author and editors, so at some p * [accounting.js](http://josscrowcroft.github.io/accounting.js/) (by [Sergey Gerasimov](https://github.com/gerich-home)) * [Ace Cloud9 Editor](http://ace.ajax.org/) (by [Diullei Gomes](https://github.com/Diullei)) * [Add To Home Screen](http://cubiq.org/add-to-home-screen) (by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw)) +* [adm-zip](https://github.com/cthackers/adm-zip) (by [John Vilk](https://github.com/jvilk/)) * [AmCharts](http://www.amcharts.com/) (by [Covobonomo](https://github.com/covobonomo/)) * [AngularAgility](https://github.com/AngularAgility/AngularAgility) (by [Roland Zwaga](https://github.com/rolandzwaga)) * [AngularBootstrapLightbox](https://github.com/compact/angular-bootstrap-lightbox) (by [Roland Zwaga](https://github.com/rolandzwaga)) diff --git a/adm-zip/adm-zip-tests.ts b/adm-zip/adm-zip-tests.ts new file mode 100644 index 0000000000..f8583ae617 --- /dev/null +++ b/adm-zip/adm-zip-tests.ts @@ -0,0 +1,33 @@ +/// +import AdmZip = require("adm-zip"); + + +// reading archives +var zip = new AdmZip("./my_file.zip"); +var zipEntries = zip.getEntries(); // an array of ZipEntry records + +zipEntries.forEach(function (zipEntry) { + console.log(zipEntry.toString()); // outputs zip entries information + if (zipEntry.entryName == "my_file.txt") { + console.log(zipEntry.getData().toString('utf8')); + } +}); +// outputs the content of some_folder/my_file.txt +console.log(zip.readAsText("some_folder/my_file.txt")); +// extracts the specified file to the specified location +zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/home/me/tempfolder", /*overwrite*/true) +// extracts everything +zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true); + + +// creating archives +var zip = new AdmZip(); + +// add file directly +zip.addFile("test.txt", new Buffer("inner content of the file"), "entry comment goes here"); +// add local file +zip.addLocalFile("/home/me/some_picture.png"); +// get everything as a buffer +var willSendthis = zip.toBuffer(); +// or write everything to disk +zip.writeZip(/*target file name*/"/home/me/files.zip"); diff --git a/adm-zip/adm-zip.d.ts b/adm-zip/adm-zip.d.ts new file mode 100644 index 0000000000..9f2eb7dfdb --- /dev/null +++ b/adm-zip/adm-zip.d.ts @@ -0,0 +1,300 @@ +// Type definitions for adm-zip v0.4.4 +// Project: https://github.com/cthackers/adm-zip +// Definitions by: John Vilk +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module AdmZip { + class ZipFile { + /** + * Create a new, empty archive. + */ + constructor(); + /** + * Read an existing archive. + */ + constructor(fileName: string); + /** + * Extracts the given entry from the archive and returns the content as a + * Buffer object. + * @param entry String with the full path of the entry + * @return Buffer or Null in case of error + */ + readFile(entry: string): Buffer; + /** + * Extracts the given entry from the archive and returns the content as a + * Buffer object. + * @param entry ZipEntry object + * @return Buffer or Null in case of error + */ + readFile(entry: IZipEntry): Buffer; + /** + * Asynchronous readFile + * @param entry String with the full path of the entry + * @param callback Called with a Buffer or Null in case of error + */ + readFileAsync(entry: string, callback: (data: Buffer, err: string) => any): void; + /** + * Asynchronous readFile + * @param entry ZipEntry object + * @param callback Called with a Buffer or Null in case of error + * @return Buffer or Null in case of error + */ + readFileAsync(entry: IZipEntry, callback: (data: Buffer, err: string) => any): void; + /** + * Extracts the given entry from the archive and returns the content as + * plain text in the given encoding + * @param entry String with the full path of the entry + * @param encoding Optional. If no encoding is specified utf8 is used + * @return String + */ + readAsText(fileName: string, encoding?: string): string; + /** + * Extracts the given entry from the archive and returns the content as + * plain text in the given encoding + * @param entry ZipEntry object + * @param encoding Optional. If no encoding is specified utf8 is used + * @return String + */ + readAsText(fileName: IZipEntry, encoding?: string): string; + /** + * Asynchronous readAsText + * @param entry String with the full path of the entry + * @param callback Called with the resulting string. + * @param encoding Optional. If no encoding is specified utf8 is used + */ + readAsTextAsync(fileName: string, callback: (data: string) => any, encoding?: string): void; + /** + * Asynchronous readAsText + * @param entry ZipEntry object + * @param callback Called with the resulting string. + * @param encoding Optional. If no encoding is specified utf8 is used + */ + readAsTextAsync(fileName: IZipEntry, callback: (data: string) => any, encoding?: string): void; + /** + * Remove the entry from the file or the entry and all its nested directories + * and files if the given entry is a directory + * @param entry String with the full path of the entry + */ + deleteFile(entry: string): void; + /** + * Remove the entry from the file or the entry and all its nested directories + * and files if the given entry is a directory + * @param entry A ZipEntry object. + */ + deleteFile(entry: IZipEntry): void; + /** + * Adds a comment to the zip. The zip must be rewritten after + * adding the comment. + * @param comment Content of the comment. + */ + addZipComment(comment: string): void; + /** + * Returns the zip comment + * @return The zip comment. + */ + getZipComment(): string; + /** + * Adds a comment to a specified zipEntry. The zip must be rewritten after + * adding the comment. + * The comment cannot exceed 65535 characters in length. + * @param entry String with the full path of the entry + * @param comment The comment to add to the entry. + */ + addZipEntryComment(entry: string, comment: string): void; + /** + * Adds a comment to a specified zipEntry. The zip must be rewritten after + * adding the comment. + * The comment cannot exceed 65535 characters in length. + * @param entry ZipEntry object. + * @param comment The comment to add to the entry. + */ + addZipEntryComment(entry: IZipEntry, comment: string): void; + /** + * Returns the comment of the specified entry. + * @param entry String with the full path of the entry. + * @return String The comment of the specified entry. + */ + getZipEntryComment(entry: string): string; + /** + * Returns the comment of the specified entry + * @param entry ZipEntry object. + * @return String The comment of the specified entry. + */ + getZipEntryComment(entry: IZipEntry): string; + /** + * Updates the content of an existing entry inside the archive. The zip + * must be rewritten after updating the content + * @param entry String with the full path of the entry. + * @param content The entry's new contents. + */ + updateFile(entry: string, content: Buffer): void; + /** + * Updates the content of an existing entry inside the archive. The zip + * must be rewritten after updating the content + * @param entry ZipEntry object. + * @param content The entry's new contents. + */ + updateFile(entry: IZipEntry, content: Buffer): void; + /** + * Adds a file from the disk to the archive. + * @param localPath Path to a file on disk. + * @param zipPath Path to a directory in the archive. Defaults to the empty + * string. + */ + addLocalFile(localPath: string, zipPath?: string): void; + /** + * Adds a local directory and all its nested files and directories to the + * archive. + * @param localPath Path to a folder on disk. + * @param zipPath Path to a folder in the archive. Defaults to an empty + * string. + */ + addLocalFolder(localPath: string, zipPath?: string): void; + /** + * Allows you to create a entry (file or directory) in the zip file. + * If you want to create a directory the entryName must end in / and a null + * buffer should be provided. + * @param entryName Entry path + * @param content Content to add to the entry; must be a 0-length buffer + * for a directory. + * @param comment Comment to add to the entry. + * @param attr Attribute to add to the entry. + */ + addFile(entryName: string, data: Buffer, comment?: string, attr?: number): void; + /** + * Returns an array of ZipEntry objects representing the files and folders + * inside the archive + */ + getEntries(): IZipEntry[]; + /** + * Returns a ZipEntry object representing the file or folder specified by + * ``name``. + * @param name Name of the file or folder to retrieve. + * @return ZipEntry The entry corresponding to the name. + */ + getEntry(name: string): IZipEntry; + /** + * Extracts the given entry to the given targetPath. + * If the entry is a directory inside the archive, the entire directory and + * its subdirectories will be extracted. + * @param entry String with the full path of the entry + * @param targetPath Target folder where to write the file + * @param maintainEntryPath If maintainEntryPath is true and the entry is + * inside a folder, the entry folder will be created in targetPath as + * well. Default is TRUE + * @param overwrite If the file already exists at the target path, the file + * will be overwriten if this is true. Default is FALSE + * + * @return Boolean + */ + extractEntryTo(entryPath: string, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean; + /** + * Extracts the given entry to the given targetPath. + * If the entry is a directory inside the archive, the entire directory and + * its subdirectories will be extracted. + * @param entry ZipEntry object + * @param targetPath Target folder where to write the file + * @param maintainEntryPath If maintainEntryPath is true and the entry is + * inside a folder, the entry folder will be created in targetPath as + * well. Default is TRUE + * @param overwrite If the file already exists at the target path, the file + * will be overwriten if this is true. Default is FALSE + * @return Boolean + */ + extractEntryTo(entryPath: IZipEntry, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean; + /** + * Extracts the entire archive to the given location + * @param targetPath Target location + * @param overwrite If the file already exists at the target path, the file + * will be overwriten if this is true. Default is FALSE + */ + extractAllTo(targetPath: string, overwrite?: boolean): void; + /** + * Writes the newly created zip file to disk at the specified location or + * if a zip was opened and no ``targetFileName`` is provided, it will + * overwrite the opened zip + * @param targetFileName + */ + writeZip(targetPath?: string): void; + /** + * Returns the content of the entire zip file as a Buffer object + * @return Buffer + */ + toBuffer(): Buffer; + } + + /** + * The ZipEntry is more than a structure representing the entry inside the + * zip file. Beside the normal attributes and headers a entry can have, the + * class contains a reference to the part of the file where the compressed + * data resides and decompresses it when requested. It also compresses the + * data and creates the headers required to write in the zip file. + */ + interface IZipEntry { + /** + * Represents the full name and path of the file + */ + entryName: string; + rawEntryName: Buffer; + /** + * Extra data associated with this entry. + */ + extra: Buffer; + /** + * Entry comment. + */ + comment: string; + name: string; + /** + * Read-Only property that indicates the type of the entry. + */ + isDirectory: boolean; + /** + * Get the header associated with this ZipEntry. + */ + header: Buffer; + /** + * Retrieve the compressed data for this entry. Note that this may trigger + * compression if any properties were modified. + */ + getCompressedData(): Buffer; + /** + * Asynchronously retrieve the compressed data for this entry. Note that + * this may trigger compression if any properties were modified. + */ + getCompressedDataAsync(callback: (data: Buffer) => void): void; + /** + * Set the (uncompressed) data to be associated with this entry. + */ + setData(value: string): void; + /** + * Set the (uncompressed) data to be associated with this entry. + */ + setData(value: Buffer): void; + /** + * Get the decompressed data associated with this entry. + */ + getData(): Buffer; + /** + * Asynchronously get the decompressed data associated with this entry. + */ + getDataAsync(callback: (data: Buffer) => void): void; + /** + * Returns the CEN Entry Header to be written to the output zip file, plus + * the extra data and the entry comment. + */ + packHeader(): Buffer; + /** + * Returns a nicely formatted string with the most important properties of + * the ZipEntry. + */ + toString(): string; + } +} + +declare module "adm-zip" { + import zipFile = AdmZip.ZipFile; + export = zipFile; +} From 20ebd41950f57573ade486620e32436def29d94e Mon Sep 17 00:00:00 2001 From: Niklas Mollenhauer Date: Sat, 8 Nov 2014 01:14:26 +0100 Subject: [PATCH 063/292] Fix bug in node-webkit when requiring "nw.gui" --- node-webkit/node-webkit.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-webkit/node-webkit.d.ts b/node-webkit/node-webkit.d.ts index 92afbff2dd..78c9dd3f0f 100644 --- a/node-webkit/node-webkit.d.ts +++ b/node-webkit/node-webkit.d.ts @@ -3,7 +3,7 @@ // Definitions by: Pedro Casaubon // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module nw.gui { +declare module "nw.gui" { interface IEventEmitter { addListener(event: string, listener: Function): EventEmitter; From a7114686aa0d922d6f6aec7e2083908dc912a6d8 Mon Sep 17 00:00:00 2001 From: Niklas Mollenhauer Date: Sat, 8 Nov 2014 01:15:15 +0100 Subject: [PATCH 064/292] Update tests to use require() --- node-webkit/node-webkit-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node-webkit/node-webkit-tests.ts b/node-webkit/node-webkit-tests.ts index da10f2901c..fab532d36c 100644 --- a/node-webkit/node-webkit-tests.ts +++ b/node-webkit/node-webkit-tests.ts @@ -1,7 +1,9 @@ /// /// + // Load native UI library -var gui: typeof nw.gui; +// See docs: https://github.com/rogerwang/node-webkit/wiki/Shell +import gui = require("nw.gui"); /* WINDOW */ From 0ffe89ddb428924e90f78818bd50f92c1f5109d7 Mon Sep 17 00:00:00 2001 From: Niklas Mollenhauer Date: Sat, 8 Nov 2014 01:52:05 +0100 Subject: [PATCH 065/292] Fix failed test --- node-webkit/node-webkit-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-webkit/node-webkit-tests.ts b/node-webkit/node-webkit-tests.ts index fab532d36c..ba53c3fc4f 100644 --- a/node-webkit/node-webkit-tests.ts +++ b/node-webkit/node-webkit-tests.ts @@ -111,7 +111,7 @@ import gui = require("nw.gui"); /* MENU ITEM */ - var itemc:nw.gui.MenuItem; + var itemc:gui.MenuItem; // Create a separator itemc = new gui.MenuItem({ type: 'separator' }); From f7b6a613adbd8159a4a7cb24e4606972cac0483e Mon Sep 17 00:00:00 2001 From: in-async Date: Sat, 8 Nov 2014 20:11:36 +0900 Subject: [PATCH 066/292] update firebase/firebase.d.ts to version 2.0.2 --- firebase/firebase-tests.ts | 813 ++++++++++++++++++++++++++++++++++++- firebase/firebase.d.ts | 276 +++++++++++-- 2 files changed, 1057 insertions(+), 32 deletions(-) diff --git a/firebase/firebase-tests.ts b/firebase/firebase-tests.ts index eb6be83734..571eae69af 100644 --- a/firebase/firebase-tests.ts +++ b/firebase/firebase-tests.ts @@ -11,6 +11,152 @@ dataRef.auth(AUTH_TOKEN, function(error, result) { } }); +var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com/'); +/* + * Firebase.authWithCustomToken() + */ +() => { + var dataRef = new Firebase('https://samplechat.firebaseio-demo.com'); + // Log me in + dataRef.authWithCustomToken(AUTH_TOKEN, function (error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } + }); +} + +/* + * Firebase.authAnonymously() + */ +() => { + var dataRef = new Firebase('https://samplechat.firebaseio-demo.com'); + // Log me in + dataRef.authAnonymously(function (error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } + }); +} + +/* + * Firebase.authWithPassword() + */ +() => { + var dataRef = new Firebase('https://samplechat.firebaseio-demo.com'); + // Log me in + dataRef.authWithPassword({ + "email": "bobtony@firebase.com", + "password": "correcthorsebatterystaple" + }, function (error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } + }); +} + +/* + * Firebase.authWithOAuthPopup() + */ +() => { + var dataRef = new Firebase('https://samplechat.firebaseio-demo.com'); + // Log me in + dataRef.authWithOAuthPopup("twitter", function (error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } + }); +} + +/* + * Firebase.authWithOAuthRedirect + */ +() => { + var dataRef = new Firebase('https://samplechat.firebaseio-demo.com'); + // Log me in + dataRef.authWithOAuthRedirect("twitter", function (error) { + if (error) { + console.log('Login Failed!', error); + } else { + // We'll never get here, as the page will redirect on success. + } + }); +} + +/* + * Firebase.authWithOAuthToken() + */ +() => { + var dataRef = new Firebase('https://samplechat.firebaseio-demo.com'); + // Authenticate with Facebook using an existing OAuth 2.0 access token + dataRef.authWithOAuthToken("facebook", "", function (error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } + }); +} +() => { + var dataRef = new Firebase('https://samplechat.firebaseio-demo.com'); + // Authenticate with Twitter using an existing OAuth 1.0a credential set + dataRef.authWithOAuthToken("twitter", { + "user_id": "", + "oauth_token": "", + "oauth_token_secret": "", + }, function (error, authData) { + if (error) { + console.log('Login Failed!', error); + } else { + console.log('Authenticated successfully with payload:', authData); + } + }); +} + +/* + * Firebase.getAuth() + */ +() => { + var dataRef = new Firebase('https://samplechat.firebaseio-demo.com'); + var authData = dataRef.getAuth(); + + if (authData) { + console.log('Authenticated user with uid:', authData.uid); + } +} + +/* + * Firebase.onAuth() + */ +() => { + var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com'); + firebaseRef.onAuth(function (authData) { + if (authData) { + console.log('Client is authenticated with uid ' + authData.uid); + } else { + // Client is unauthenticated + } + }); +} + +/* + * Firebase.offAuth + */ +() => { + var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com'); + var onAuthChange = function (authData: IFirebaseAuthData) { /*...*/ }; + firebaseRef.onAuth(onAuthChange); + // Sometime later... + firebaseRef.offAuth(onAuthChange); +} + //Time to log out! dataRef.unauth(); @@ -36,6 +182,146 @@ var fredRef3:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/use var x4:string = fredRef3.name(); // x is now 'fred'. +/* + * Firebase.key() + */ +() => { + var fredRef = new Firebase("https://samplechat.firebaseio-demo.com/users/fred"); + var key = fredRef.key(); // key === "fred" + key = fredRef.child("name/last").key(); // key === "last" +} +() => { + // Calling key() on the root of a Firebase will return null: + var rootRef = new Firebase("https://samplechat.firebaseio-demo.com"); + var key = rootRef.key(); // key === null +} + +/* + * Firebase.set() + */ +() => { + var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); + fredNameRef.child('first').set('Fred'); + fredNameRef.child('last').set('Flintstone'); + // We've written 'Fred' to the Firebase location storing fred's first name, + // and 'Flintstone' to the location storing his last name +} +() => { + var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); + fredNameRef.set({ first: 'Fred', last: 'Flintstone' }); + // Exact same effect as the previous example, except we've written + // fred's first and last name simultaneously +} +() => { + var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); + var onComplete = function (error: any) { + if (error) { + console.log('Synchronization failed'); + } else { + console.log('Synchronization succeeded'); + } + }; + fredNameRef.set({ first: 'Fred', last: 'Flintstone' }, onComplete); + // Same as the previous example, except we will also log a message + // when the data has finished synchronizing +} + +/* + * Firebase.update() + */ +() => { + var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); + // Modify the 'first' and 'last' children, but leave other data at fredNameRef unchanged + fredNameRef.update({ first: 'Fred', last: 'Flintstone' }); +} +() => { + var fredNameRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/name'); + // Same as the previous example, except we will also display an alert + // message when the data has finished synchronizing. + var onComplete = function (error:any) { + if (error) { + console.log('Synchronization failed'); + } else { + console.log('Synchronization succeeded'); + } + }; + fredNameRef.update({ first: 'Wilma', last: 'Flintstone' }, onComplete); +} +() => { + var fredRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred'); + //The following 2 function calls are equivalent + fredRef.update({ name: { first: 'Fred', last: 'Flintstone' }}); + fredRef.child('name').set({ first: 'Fred', last: 'Flintstone' }); +} + +/* + * Firebase.remove() + */ +() => { + var fredRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred'); + fredRef.remove(); + // All data at the Firebase location for user 'fred' has been deleted + // (including any child data) +} +() => { + var onComplete = function (error: any) { + if (error) { + console.log('Synchronization failed'); + } else { + console.log('Synchronization succeeded'); + } + }; + fredRef.remove(onComplete); + // Same as the previous example, except we will also log + // a message when the delete has finished synchronizing +} + +/* + * Firebase.push() + */ +() => { + var messageListRef = new Firebase('https://samplechat.firebaseio-demo.com/message_list'); + var newMessageRef = messageListRef.push(); + newMessageRef.set({ 'user_id': 'fred', 'text': 'Yabba Dabba Doo!' }); + // We've appended a new message to the message_list location. + var path = newMessageRef.toString(); + // path will be something like + // 'https://samplechat.firebaseio-demo.com/message_list/-IKo28nwJLH0Nc5XeFmj' +} +() => { + var messageListRef = new Firebase('https://SampleChat.firebaseIO-demo.com/message_list'); + messageListRef.push({ 'user_id': 'fred', 'text': 'Yabba Dabba Doo!' }); + // Same effect as the previous example, but we've combined the push() and the set(). +} + +/* + * Firebase.setWithPriority() + */ +() => { + var fredRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred'); + + var user = { + name: { + first: 'Fred', + last: 'Flintstone' + }, + rank: 1000 + }; + + fredRef.setWithPriority(user, 1000); + // We've written Fred's name and rank to firebase, and used his rank (1000) as the + // priority of the data so he'll be ordered relative to other users by his rank +} + +/* + * Firebase.setPriority() + */ +() => { + var fredRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred'); + fredRef.setPriority(1000); + // We have changed the priority of fred's user data to 1000 +} + // Increment Fred's rank by 1. var fredRankRef:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred/rank'); fredRankRef.transaction(function(currentRank: number) { @@ -61,14 +347,523 @@ wilmaRef.transaction(function(currentData) { console.log('Wilma\'s data: ', snapshot.val()); }); -var messageListRef: Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/message_list'); -var lastMessagesQuery:IFirebaseQuery = messageListRef.endAt().limit(500); -lastMessagesQuery.on('child_added', function(childSnapshot: IFirebaseDataSnapshot) { /* handle child add */ }); +/* + * Firebase.createUser() + */ +() => { + var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com'); + firebaseRef.createUser({ + email: "bobtony@firebase.com", + password: "correcthorsebatterystaple" + }, function (err) { + if (err) { + switch (err.code) { + case 'EMAIL_TAKEN': + // The new user account cannot be created because the email is already in use. + case 'INVALID_EMAIL': + // The specified email is not a valid email. + default: + } + } else { + // User account created successfully! + } + }); +} -var messageListRef2:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/message_list'); -var firstMessagesQuery:IFirebaseQuery = messageListRef2.startAt().limit(500); -firstMessagesQuery.on('child_added', function(childSnapshot: IFirebaseDataSnapshot) { /* handle child add */ }); +/* + * Firebase.changePassword() + */ +() => { + var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com'); + firebaseRef.changePassword({ + email: "bobtony@firebase.com", + oldPassword: "correcthorsebatterystaple", + newPassword: "shinynewpassword" + }, function (err) { + if (err) { + switch (err.code) { + case 'INVALID_PASSWORD': + // The specified user account password is incorrect. + case 'INVALID_USER': + // The specified user account does not exist. + default: + } + } else { + // User password changed successfully! + } + }); +} -var usersRef3: Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users'); -var usersQuery: IFirebaseQuery = usersRef3.startAt(1000).limit(50); -usersQuery.on('child_added', function(userSnapshot: IFirebaseDataSnapshot) { /* handle user */ }); +/* + * Firebase.removeUser() + */ +() => { + var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com'); + firebaseRef.removeUser({ + email: "bobtony@firebase.com", + password: "correcthorsebatterystaple" + }, function (err) { + if (err) { + switch (err.code) { + case 'INVALID_USER': + // The specified user account does not exist. + case 'INVALID_PASSWORD': + // The specified user account password is incorrect. + default: + } + } else { + // User account deleted successfully! + } + }); +} + +/* + * Firebase.resetPassword() + */ +() => { + var firebaseRef = new Firebase('https://samplechat.firebaseio-demo.com'); + firebaseRef.resetPassword({ + email: "bobtony@firebase.com" + }, function (err) { + if (err) { + switch (err.code) { + case 'INVALID_USER': + // The specified user account does not exist. + default: + } + } else { + // Password reset email sent successfully! + } + }); +} + +//var messageListRef: Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/message_list'); +//var lastMessagesQuery:IFirebaseQuery = messageListRef.endAt().limit(500); +//lastMessagesQuery.on('child_added', function(childSnapshot: IFirebaseDataSnapshot) { /* handle child add */ }); + +//var messageListRef2:Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/message_list'); +//var firstMessagesQuery:IFirebaseQuery = messageListRef2.startAt().limit(500); +//firstMessagesQuery.on('child_added', function(childSnapshot: IFirebaseDataSnapshot) { /* handle child add */ }); + +//var usersRef3: Firebase = new Firebase('https://SampleChat.firebaseIO-demo.com/users'); +//var usersQuery: IFirebaseQuery = usersRef3.startAt(1000).limit(50); +//usersQuery.on('child_added', function(userSnapshot: IFirebaseDataSnapshot) { /* handle user */ }); + +/* + * Firebase.goOffline() + * Firebase.goOnline() + */ +() => { + var usersRef = new Firebase('https://samplechat.firebaseio-demo.com/users'); + Firebase.goOffline(); // All Firebase instances are disconnected + Firebase.goOnline(); // All Firebase instances automatically reconnect +} + +/* + * IFirebaseQuery.on() + */ +() => { + firebaseRef.on('value', function (dataSnapshot) { + // code to handle new value. + }); + + firebaseRef.on('child_added', function (childSnapshot, prevChildName) { + // code to handle new child. + }); + + firebaseRef.on('child_removed', function (oldChildSnapshot) { + // code to handle child removal. + }); + + firebaseRef.on('child_changed', function (childSnapshot, prevChildName) { + // code to handle child data changes. + }); + + firebaseRef.on('child_changed', function (childSnapshot, prevChildName) { + // code to handle child data changes. + }); +} + +/* + * IFirebaseQuery.off() + */ +() => { + var onValueChange = function (dataSnapshot: IFirebaseDataSnapshot) { /* handle... */ }; + firebaseRef.on('value', onValueChange); + // Sometime later... + firebaseRef.off('value', onValueChange); +} +() => { + // Or you can save a line of code by using an inline function + // and on()'s return value. + var onValueChange = firebaseRef.on('value', function (dataSnapshot) { /* handle... */ }); + // Sometime later... + firebaseRef.off('value', onValueChange); +} + +/* + * IFirebaseQuery.once() + */ +() => { + // Basic usage of .once() to read the data located at firebaseRef. + firebaseRef.once('value', function (dataSnapshot) { + // handle read data. + }); +} +() => { + // Provide a failureCallback to be notified when this + // callback is revoked due to security violations. + firebaseRef.once('value', function (dataSnapshot) { + // code to handle new value + }, function (err: any) { + // code to handle read error + }); +} +() => { + // Provide a context to override "this" when callbacks are triggered. + firebaseRef.once('value', function (dataSnapshot) { + // this.x is 1 + }, { x: 1 }); +} + +/* + * IFirebaseQuery.orderByChild() + */ +() => { + // For example, using our sample Firebase of dinosaur facts, + // we can read all dinosaurs ordered by height using the following query: + var ref = new Firebase("https://dinosaur-facts.firebaseio.com/"); + ref.orderByChild("height").on("child_added", function (snapshot) { + console.log(snapshot.key() + " was " + snapshot.val().height + " meters tall"); + }); +} + +/* + * IFirebaseQuery.orderByKey() + */ +() => { + // For example, using our sample Firebase of dinosaur facts, + // we can read all dinosaurs in alphabetical order, ignoring their priority, + // using the following query: + var ref = new Firebase("https://dinosaur-facts.firebaseio.com/"); + ref.orderByKey().on("child_added", function (snapshot) { + console.log(snapshot.key()); + }); +} + +/* + * IFirebaseQuery.orderByPriority() + */ +() => { + // For example, using our sample Firebase of dinosaur facts, + // we can read all dinosaurs in priority order using the following query: + var ref = new Firebase("https://dinosaur-facts.firebaseio.com/"); + ref.orderByPriority().on("child_added", function (snapshot) { + console.log(snapshot.key()); + }); +} + +/* + * IFirebaseQuery.startAt() + */ +() => { + // For example, using our sample Firebase of dinosaur facts, + // we can find all dinosaurs that are at least three meters tall + // by combining orderByChild() and startAt(): + var ref = new Firebase("https://dinosaur-facts.firebaseio.com/"); + ref.orderByChild("height").startAt(3).on("child_added", function (snapshot) { + console.log(snapshot.key()) + }); +} + +/* + * IFirebaseQuery.endAt() + */ +() => { + // For example, using our sample Firebase of dinosaur facts, + // we can find all dinosaurs whose names come before Pterodactyl lexicographically + // by combining orderByKey() and endAt(): + var ref = new Firebase("https://dinosaur-facts.firebaseio.com/"); + ref.orderByKey().endAt("pterodactyl").on("child_added", function (snapshot) { + console.log(snapshot.key()); + }); +} + +/* + * IFirebaseQuery.equalTo() + */ +() => { + // For example, using our sample Firebase of dinosaur facts, + // we can find all dinosaurs whose height is exactly 25 meters + // by combining orderByChild() and equalTo(): + var ref = new Firebase("https://dinosaur-facts.firebaseio.com/"); + ref.orderByChild("height").equalTo(25).on("child_added", function (snapshot) { + console.log(snapshot.key()); + }); +} + +/* + * IFirebaseQuery.limitToFirst + */ +() => { + // Using our sample Firebase of dinosaur facts, + // we can find the two shortest dinosaurs with this query: + var ref = new Firebase("https://dinosaur-facts.firebaseio.com/"); + ref.orderByChild("height").limitToFirst(2).on("child_added", function (snapshot) { + console.log(snapshot.key()); + }); +} + +/* + * IFirebaseQuery.limitToLast + */ +() => { + // Using our sample Firebase of dinosaur facts, + // we can find the two heaviest dinosaurs with this query: + var ref = new Firebase("https://dinosaur-facts.firebaseio.com/"); + ref.orderByChild("weight").limitToLast(2).on("child_added", function (snapshot) { + console.log(snapshot.key()); + }); +} + +/* + * IFirebaseQuery.ref() + */ +() => { + // The Firebase reference returned by ref() is equivalent to the Firebase reference used to create the Query. + var ref = new Firebase("https://samplechat.firebaseio-demo.com/users"); + var query = ref.limitToFirst(5); + var refToSameLocation = query.ref(); // ref === refToSameLocation +} + +/* + * Firebase.onDisconnect().set() + */ +() => { + var disconnectRef = new Firebase('https://samplechat.firebaseio-demo.com/disconnectmessage'); + disconnectRef.onDisconnect().set('I disconnected!'); +} + +/* + * Firebase.onDisconnect().update() + */ +() => { + var disconnectRef = new Firebase('https://samplechat.firebaseio-demo.com/disconnectmessage'); + disconnectRef.onDisconnect().update({ message: 'I disconnected!' }); +} + +/* + * Firebase.onDisconnect().remove() + */ +() => { + var disconnectRef = new Firebase('https://samplechat.firebaseio-demo.com/disconnectdata'); + disconnectRef.onDisconnect().remove(); +} + +/* + * Firebase.onDisconnect().setWithPriority() + */ +() => { + var disconnectRef = new Firebase('https://samplechat.firebaseio-demo.com/disconnectMessage'); + disconnectRef.onDisconnect().setWithPriority('I disconnected', 10); +} + +/* + * Firebase.onDisconnect().cancel() + */ +() => { + var fredOnlineRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred/online'); + fredOnlineRef.onDisconnect().set(false); + + // cancel the previously set onDisconnect().set() event + fredOnlineRef.onDisconnect().cancel(); +} + +/* + * Firebase.ServerValue.TIMESTAMP + */ +() => { + // Record the current time immediately, and queue an event to + // record the time at which the user disconnects. + var sessionsRef = new Firebase('https://samplechat.firebaseio-demo.com/sessions/'); + var mySessionRef = sessionsRef.push(); + mySessionRef.onDisconnect().update({ endedAt: Firebase.ServerValue.TIMESTAMP }); + mySessionRef.update({ startedAt: Firebase.ServerValue.TIMESTAMP }); +} + +/* + * DataSnapshot.val() + */ +() => { + // Demonstrate writing data and then reading it back as a Javascript object. + var fredNameRef = new Firebase('https://SampleChat.firebaseIO-demo.com/users/fred'); + fredNameRef.set({ first: 'Fred', last: 'Flintstone' }); + + fredNameRef.once('value', function (nameSnapshot) { + var val = nameSnapshot.val(); + // val now contains the object { first: 'Fred', last: 'Flintstone' }. + }); +} + +/* + * DataSnapshot.child() + */ +(dataSnapshot:IFirebaseDataSnapshot) => { + // Given a DataSnapshot containing a child 'name' that has children 'first' + // (set to 'Fred') and 'last' (set to 'Flintstone'): + var nameSnapshot = dataSnapshot.child('name'); + var name = nameSnapshot.val(); + // name now contains { first: 'Fred', last: 'Flintstone'}. + + var firstNameSnapshot = dataSnapshot.child('name/first'); + var firstName = firstNameSnapshot.val(); + // firstName now contains 'Fred'. + + var favoriteColorSnapshot = dataSnapshot.child('favorite_color'); + var favoriteColor = favoriteColorSnapshot.val(); + // favoriteColor will be null, because there is no 'favorite_color' child in dataSnapshot. +} + +/* + * DataSnapshot.forEach() + */ +(dataSnapshot:IFirebaseDataSnapshot) => { + // Given a DataSnapshot containing a child "fred" and a child "wilma", this callback + // function will be called twice + dataSnapshot.forEach(function (childSnapshot) { + // key will be "fred" the first time and "wilma" the second time + var key = childSnapshot.key(); + + // childData will be the actual contents of the child + var childData = childSnapshot.val(); + }); +} +(dataSnapshot:IFirebaseDataSnapshot) => { + // Given a DataSnapshot containing a child "fred" and a child "wilma", this callback + // funciton will only be called once (since we return true) + dataSnapshot.forEach(function (childSnapshot) { + var key = childSnapshot.key(); // key will be "fred" + return true; + }); +} + +/* + * DataSnapshot.hasChild() + */ +(dataSnapshot: IFirebaseDataSnapshot) => { + // Given a DataSnapshot with child 'fred' and no other children: + var x = dataSnapshot.hasChild('fred'); + var y = dataSnapshot.hasChild('whales'); + // x is true and y is false. +} + +/* + * DataSnapshot.hasChildren() + */ +(dataSnapshot: IFirebaseDataSnapshot) => { + // Given a DataSnapshot containing a child 'name' with children 'first' + // (set to 'Fred') and 'last' (set to 'Flintstone'): + var x = dataSnapshot.hasChildren(); + // x is true. + var y = dataSnapshot.child('name').hasChildren(); + // y is true. + var z = dataSnapshot.child('name/first').hasChildren(); + // z is false since 'Fred' is a string and therefore has no children. +} + +/* + * DataSnapshot.key() + */ +() => { + // Calling key() on any DataSnapshot (except for one which represents the root of a Firebase) + // will return the key name of the location that generated it: + var fredRef = new Firebase("https://samplechat.firebaseio-demo.com/users/fred"); + fredRef.on("value", function (fredSnapshot) { + var key = fredSnapshot.key(); // key === "fred" + key = fredSnapshot.child("name/last").key(); // key === "last" + }); +} +() => { + // Calling key() on a DataSnapshot generated from a reference to the root of a Firebase return null: + var rootRef = new Firebase("https://samplechat.firebaseio-demo.com"); + rootRef.on("value", function (rootSnapshot) { + var key = rootSnapshot.key(); // key === null + }); +} + +/* + * DataSnapshot.name() + */ +() => { + var fredRef = new Firebase("https://samplechat.firebaseio-demo.com/users/fred"); + fredRef.on("value", function (fredSnapshot) { + var key = fredSnapshot.name(); // key === "fred" + key = fredSnapshot.child("name/last").name(); // key === "last" + }); +} +() => { + var rootRef = new Firebase("https://samplechat.firebaseio-demo.com"); + rootRef.on("value", function (rootSnapshot) { + var key = rootSnapshot.name(); // key === null + }); +} + +/* + * DataSnapshot.numChildren() + */ +(dataSnapshot: IFirebaseDataSnapshot) => { + // Given a DataSnapshot containing a child 'name' with children 'first' + // (set to 'Fred') and 'last' (set to 'Flintstone'): + var x = dataSnapshot.numChildren(); + // x is 1. + var y = dataSnapshot.child('name').numChildren(); + // y is 2. + var z = dataSnapshot.child('name/first').numChildren(); + // z is 0 since 'Fred' is a string and therefore has no children. +} + +/* + * DataSnaphot.ref() + */ +() => { + var fredRef = new Firebase('https://samplechat.firebaseio-demo.com/users/fred'); + fredRef.on('value', function (fredSnapshot) { + var fredRef2 = fredSnapshot.ref(); + // fredRef and fredRef2 both point to the same location. + }); +} + +/* + * DataSnapshot.getPriority() + */ +(dataSnapshot: IFirebaseDataSnapshot) => { + // Given a snapshot for data with priority 1000: + var x = dataSnapshot.getPriority(); + // x is now 1000. +} + +/* + * DataSnapshot.exportVal() + */ +(dataSnapshot: IFirebaseDataSnapshot) => { + firebaseRef.setWithPriority('hello', 500); + firebaseRef.once('value', function (dataSnapshot) { + var x = dataSnapshot.exportVal(); + // x now contains { '.value': 'hello', '.priority': 500 } + }); +} +(dataSnapshot: IFirebaseDataSnapshot) => { + firebaseRef.set('hello'); + firebaseRef.once('value', function (dataSnapshot) { + var x = dataSnapshot.exportVal(); + // x now contains 'hello' + }); +} +(dataSnapshot: IFirebaseDataSnapshot) => { + // Note: To access these variables in JavaScript, you can use x['.value'] and x['.priority']. + firebaseRef.setWithPriority({ a: 'hello', b: 'hi' }, 500); + firebaseRef.once('value', function (dataSnapshot) { + var x = dataSnapshot.exportVal(); + // x now contains { 'a': 'hello', 'b': 'hi', '.priority': 500 } + }); +} diff --git a/firebase/firebase.d.ts b/firebase/firebase.d.ts index bac32fbc63..40e3b81261 100644 --- a/firebase/firebase.d.ts +++ b/firebase/firebase.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Firebase API +// Type definitions for Firebase API 2.0.2 // Project: https://www.firebase.com/docs/javascript/firebase // Definitions by: Vincent Botone // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -9,67 +9,297 @@ interface IFirebaseAuthResult { } interface IFirebaseDataSnapshot { + /** + * Gets the JavaScript object representation of the DataSnapshot. + */ val(): any; + /** + * Gets a DataSnapshot for the location at the specified relative path. + */ child(childPath: string): IFirebaseDataSnapshot; + /** + * Enumerates through the DataSnapshot’s children (in the default order). + */ + forEach(childAction: (childSnapshot: IFirebaseDataSnapshot) => void): boolean; forEach(childAction: (childSnapshot: IFirebaseDataSnapshot) => boolean): boolean; + /** + * Returns true if the specified child exists. + */ hasChild(childPath: string): boolean; + /** + * Returns true if the DataSnapshot has any children. + */ hasChildren(): boolean; + /** + * Gets the key name of the location that generated this DataSnapshot. + */ + key(): string; + /** + * @deprecated Use key() instead. + * Gets the key name of the location that generated this DataSnapshot. + */ name(): string; + /** + * Gets the number of children for this DataSnapshot. + */ numChildren(): number; + /** + * Gets the Firebase reference for the location that generated this DataSnapshot. + */ ref(): Firebase; + /** + * Gets the priority of the data in this DataSnapshot. + * @returns {string, number, null} The priority, or null if no priority was set. + */ getPriority(): any; // string or number + /** + * Exports the entire contents of the DataSnapshot as a JavaScript object. + */ exportVal(): Object; } interface IFirebaseOnDisconnect { + /** + * Ensures the data at this location is set to the specified value when the client is disconnected + * (due to closing the browser, navigating to a new page, or network issues). + */ set(value: any, onComplete?: (error: any) => void): void; + /** + * Ensures the data at this location is set to the specified value and priority when the client is disconnected + * (due to closing the browser, navigating to a new page, or network issues). + */ setWithPriority(value: any, priority: string, onComplete?: (error: any) => void): void; setWithPriority(value: any, priority: number, onComplete?: (error: any) => void): void; - update(value: any, onComplete?: (error: any) => void): void; + /** + * Writes the enumerated children at this Firebase location when the client is disconnected + * (due to closing the browser, navigating to a new page, or network issues). + */ + update(value: Object, onComplete?: (error: any) => void): void; + /** + * Ensures the data at this location is deleted when the client is disconnected + * (due to closing the browser, navigating to a new page, or network issues). + */ remove(onComplete?: (error: any) => void): void; + /** + * Cancels all previously queued onDisconnect() set or update events for this location and all children. + */ cancel(onComplete?: (error: any) => void): void; } -interface IFirebaseQuery { - on(eventType: string, callback: (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void, cancelCallback?: ()=> void, context?: Object): (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void; +declare class IFirebaseQuery { + /** + * Listens for data changes at a particular location. + */ + on(eventType: string, callback: (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void, cancelCallback?: (error: any) => void, context?: Object): (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void; + /** + * Detaches a callback previously attached with on(). + */ off(eventType?: string, callback?: (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void, context?: Object): void; - once(eventType: string, successCallback: (dataSnapshot: IFirebaseDataSnapshot) => void, failureCallback?: () => void, context?: Object): void; + /** + * Listens for exactly one event of the specified event type, and then stops listening. + */ + once(eventType: string, successCallback: (dataSnapshot: IFirebaseDataSnapshot) => void, context?: Object): void; + once(eventType: string, successCallback: (dataSnapshot: IFirebaseDataSnapshot) => void, failureCallback?: (error: any) => void, context?: Object): void; + /** + * Generates a new Query object ordered by the specified child key. + */ + orderByChild(key: string): IFirebaseQuery; + /** + * Generates a new Query object ordered by key name. + */ + orderByKey(): IFirebaseQuery; + /** + * Generates a new Query object ordered by priority. + */ + orderByPriority(): IFirebaseQuery; + /** + * @deprecated Use limitToFirst() and limitToLast() instead. + * Generates a new Query object limited to the specified number of children. + */ limit(limit: number): IFirebaseQuery; - startAt(priority?: string, name?: string): IFirebaseQuery; - startAt(priority?: number, name?: string): IFirebaseQuery; - endAt(priority?: string, name?: string): IFirebaseQuery; - endAt(priority?: number, name?: string): IFirebaseQuery; + /** + * Creates a Query with the specified starting point. + * The generated Query includes children which match the specified starting point. + */ + startAt(value: string, key?: string): IFirebaseQuery; + startAt(value: number, key?: string): IFirebaseQuery; + /** + * Creates a Query with the specified ending point. + * The generated Query includes children which match the specified ending point. + */ + endAt(value: string, key?: string): IFirebaseQuery; + endAt(value: number, key?: string): IFirebaseQuery; + /** + * Creates a Query which includes children which match the specified value. + */ + equalTo(value: string, key?: string): IFirebaseQuery; + equalTo(value: number, key?: string): IFirebaseQuery; + /** + * Generates a new Query object limited to the first certain number of children. + */ + limitToFirst(limit: number): IFirebaseQuery; + /** + * Generates a new Query object limited to the last certain number of children. + */ + limitToLast(limit: number): IFirebaseQuery; + /** + * Gets a Firebase reference to the Query's location. + */ ref(): Firebase; } -declare class Firebase implements IFirebaseQuery { +declare class Firebase extends IFirebaseQuery { + /** + * Constructs a new Firebase reference from a full Firebase URL. + */ constructor(firebaseURL: string); + /** + * @deprecated Use authWithCustomToken() instead. + * Authenticates a Firebase client using the provided authentication token or Firebase Secret. + */ auth(authToken: string, onComplete?: (error: any, result: IFirebaseAuthResult) => void, onCancel?:(error: any) => void): void; + /** + * Authenticates a Firebase client using an authentication token or Firebase Secret. + */ + authWithCustomToken(autoToken: string, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?:Object): void; + /** + * Authenticates a Firebase client using a new, temporary guest account. + */ + authAnonymously(onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Authenticates a Firebase client using an email / password combination. + */ + authWithPassword(credentials: IFirebaseCredentials, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Authenticates a Firebase client using a popup-based OAuth flow. + */ + authWithOAuthPopup(provider: string, onComplete:(error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Authenticates a Firebase client using a redirect-based OAuth flow. + */ + authWithOAuthRedirect(provider: string, onComplete: (error: any) => void, options?: Object): void; + /** + * Authenticates a Firebase client using OAuth access tokens or credentials. + */ + authWithOAuthToken(provider: string, credentials: string, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + authWithOAuthToken(provider: string, credentials: Object, onComplete: (error: any, authData: IFirebaseAuthData) => void, options?: Object): void; + /** + * Synchronously access the current authentication state of the client. + */ + getAuth(): IFirebaseAuthData; + /** + * Listen for changes to the client's authentication state. + */ + onAuth(onComplete: (authData: IFirebaseAuthData) => void, context?: Object): void; + /** + * Detaches a callback previously attached with onAuth(). + */ + offAuth(onComplete: (authData: IFirebaseAuthData) => void, context?: Object): void; + /** + * Unauthenticates a Firebase client. + */ unauth(): void; + /** + * Gets a Firebase reference for the location at the specified relative path. + */ child(childPath: string): Firebase; + /** + * Gets a Firebase reference to the parent location. + */ parent(): Firebase; + /** + * Gets a Firebase reference to the root of the Firebase. + */ root(): Firebase; + /** + * Returns the last token in a Firebase location. + */ + key(): string; + /** + * @deprecated Use key() instead. + * Returns the last token in a Firebase location. + */ name(): string; + /** + * Gets the absolute URL corresponding to this Firebase reference's location. + */ toString(): string; + /** + * Writes data to this Firebase location. + */ set(value: any, onComplete?: (error: any) => void): void; - update(value: any, onComplete?: (error: any) => void): void; + /** + * Writes the enumerated children to this Firebase location. + */ + update(value: Object, onComplete?: (error: any) => void): void; + /** + * Removes the data at this Firebase location. + */ remove(onComplete?: (error: any) => void): void; - push(value: any, onComplete?: (error: any) => void): Firebase; + /** + * Generates a new child location using a unique name and returns a Firebase reference to it. + * @returns {Firebase} A Firebase reference for the generated location. + */ + push(value?: any, onComplete?: (error: any) => void): Firebase; + /** + * Writes data to this Firebase location. Like set() but also specifies the priority for that data. + */ setWithPriority(value: any, priority: string, onComplete?: (error: any) => void): void; setWithPriority(value: any, priority: number, onComplete?: (error: any) => void): void; + /** + * Sets a priority for the data at this Firebase location. + */ setPriority(priority: string, onComplete?: (error: any) => void): void; setPriority(priority: number, onComplete?: (error: any) => void): void; + /** + * Atomically modifies the data at this location. + */ transaction(updateFunction: (currentData: any)=> any, onComplete?: (error: any, committed: boolean, snapshot: IFirebaseDataSnapshot) => void, applyLocally?: boolean): void; + /** + * Creates a new user account using an email / password combination. + */ + createUser(credentials: IFirebaseCredentials, onComplete: (error: any) => void): void; + /** + * Change the password of an existing user using an email / password combination. + */ + changePassword(credentials: { email: string; oldPassword: string; newPassword: string }, onComplete: (error: any) => void): void; + /** + * Removes an existing user account using an email / password combination. + */ + removeUser(credentials: IFirebaseCredentials, onComplete: (error: any) => void): void; + /** + * Sends a password-reset email to the owner of the account, containing a token that may be used to authenticate and change the user password. + */ + resetPassword(credentials: { email: string }, onComplete: (error: any) => void): void; onDisconnect(): IFirebaseOnDisconnect; - on(eventType: string, callback: (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void, cancelCallback?: ()=> void, context?: Object): (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void; - off(eventType?: string, callback?: (dataSnapshot: IFirebaseDataSnapshot, prevChildName?: string) => void, context?: Object): void; - once(eventType: string, successCallback: (dataSnapshot: IFirebaseDataSnapshot) => void, failureCallback?: () => void, context?: Object): void; - limit(limit: number): IFirebaseQuery; - startAt(priority?: string, name?: string): IFirebaseQuery; - startAt(priority?: number, name?: string): IFirebaseQuery; - endAt(priority?: string, name?: string): IFirebaseQuery; - endAt(priority?: number, name?: string): IFirebaseQuery; - ref(): Firebase; - goOffline(): void; - goOnline(): void; + /** + * Manually disconnects the Firebase client from the server and disables automatic reconnection. + */ + static goOffline(): void; + /** + * Manually reestablishes a connection to the Firebase server and enables automatic reconnection. + */ + static goOnline(): void; + + static ServerValue: { + /** + * A placeholder value for auto-populating the current timestamp + * (time since the Unix epoch, in milliseconds) by the Firebase servers. + */ + TIMESTAMP: any; + }; } + +// Reference: https://www.firebase.com/docs/web/api/firebase/getauth.html +interface IFirebaseAuthData { + uid: string; + provider: string; + token: string; + expires: number; + auth: Object; +} + +interface IFirebaseCredentials { + email: string; + password: string; +} \ No newline at end of file From 12af931fb003092a3dc5eb97dfbe210b40d5288b Mon Sep 17 00:00:00 2001 From: in-async Date: Sat, 8 Nov 2014 23:50:15 +0900 Subject: [PATCH 067/292] Fix along the guidelines. --- angularfire/angularfire-tests.ts | 6 +- angularfire/angularfire.d.ts | 98 ++++++++++++++++---------------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/angularfire/angularfire-tests.ts b/angularfire/angularfire-tests.ts index 231c0f992c..7d39e4181d 100644 --- a/angularfire/angularfire-tests.ts +++ b/angularfire/angularfire-tests.ts @@ -168,7 +168,7 @@ interface AngularFireAuthScope extends ng.IScope { } myapp.controller("MyAuthController", ["$scope", "$firebaseSimpleLogin", - function ($scope: AngularFireAuthScope, $firebaseSimpleLogin: AngularFireAuthService) { + function($scope: AngularFireAuthScope, $firebaseSimpleLogin: AngularFireAuthService) { var dataRef = new Firebase(url); $scope.loginObj = $firebaseSimpleLogin(dataRef); $scope.loginObj.$getCurrentUser().then(_ => { @@ -178,9 +178,9 @@ myapp.controller("MyAuthController", ["$scope", "$firebaseSimpleLogin", $scope.loginObj.$login('password', { email: email, password: password - }).then(function (user) { + }).then(function(user) { console.log('Logged in as: ', user.uid); - }, function (error) { + }, function(error) { console.error('Login failed: ', error); }); $scope.loginObj.$logout(); diff --git a/angularfire/angularfire.d.ts b/angularfire/angularfire.d.ts index b6a0d55d26..0bebb23c52 100644 --- a/angularfire/angularfire.d.ts +++ b/angularfire/angularfire.d.ts @@ -7,76 +7,76 @@ /// interface AngularFireService { - (firebase: Firebase, config?: any): AngularFire; + (firebase: Firebase, config?: any): AngularFire; } interface AngularFire { - $asArray(): AngularFireArray; - $asObject(): AngularFireObject; - $ref(): Firebase; - $push(data: any): ng.IPromise; - $set(key: string, data: any): ng.IPromise; - $set(data: any): ng.IPromise; - $remove(key?: string): ng.IPromise; - $update(key: string, data: Object): ng.IPromise; - $update(data: any): ng.IPromise; - $transaction(updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; - $transaction(key:string, updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; + $asArray(): AngularFireArray; + $asObject(): AngularFireObject; + $ref(): Firebase; + $push(data: any): ng.IPromise; + $set(key: string, data: any): ng.IPromise; + $set(data: any): ng.IPromise; + $remove(key?: string): ng.IPromise; + $update(key: string, data: Object): ng.IPromise; + $update(data: any): ng.IPromise; + $transaction(updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; + $transaction(key:string, updateFn: (currentData: any) => any, applyLocally?: boolean): ng.IPromise; } interface AngularFireObject extends AngularFireSimpleObject { - $id: string; - $priority: number; - $value: any; - $save(): ng.IPromise; - $loaded(resolve?: (x: AngularFireObject) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; - $loaded(resolve?: (x: AngularFireObject) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; - $loaded(resolve?: (x: AngularFireObject) => void, reject?: (err: any) => any): ng.IPromise; - $inst(): AngularFire; - $bindTo(scope: ng.IScope, varName: string): ng.IPromise; - $watch(callback: Function, context?: any): Function; - $destroy(): void; + $id: string; + $priority: number; + $value: any; + $save(): ng.IPromise; + $loaded(resolve?: (x: AngularFireObject) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireObject) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireObject) => void, reject?: (err: any) => any): ng.IPromise; + $inst(): AngularFire; + $bindTo(scope: ng.IScope, varName: string): ng.IPromise; + $watch(callback: Function, context?: any): Function; + $destroy(): void; } interface AngularFireObjectService { - $extendFactory(ChildClass: Object, methods?: Object): Object; + $extendFactory(ChildClass: Object, methods?: Object): Object; } interface AngularFireArray extends Array { - $add(newData: any): ng.IPromise; - $save(recordOrIndex: any): ng.IPromise; - $remove(recordOrIndex: any): ng.IPromise; - $getRecord(key: string): AngularFireSimpleObject; - $keyAt(recordOrIndex: any): string; - $indexFor(key: string): number; - $loaded(resolve?: (x: AngularFireArray) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; - $loaded(resolve?: (x: AngularFireArray) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; - $loaded(resolve?: (x: AngularFireArray) => void, reject?: (err: any) => any): ng.IPromise; - $inst(): AngularFire; - $watch(cb: (event: string, key: string, prevChild: string) => void, context?: any): Function; - $destroy(): void; + $add(newData: any): ng.IPromise; + $save(recordOrIndex: any): ng.IPromise; + $remove(recordOrIndex: any): ng.IPromise; + $getRecord(key: string): AngularFireSimpleObject; + $keyAt(recordOrIndex: any): string; + $indexFor(key: string): number; + $loaded(resolve?: (x: AngularFireArray) => ng.IHttpPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireArray) => ng.IPromise<{}>, reject?: (err: any) => any): ng.IPromise; + $loaded(resolve?: (x: AngularFireArray) => void, reject?: (err: any) => any): ng.IPromise; + $inst(): AngularFire; + $watch(cb: (event: string, key: string, prevChild: string) => void, context?: any): Function; + $destroy(): void; } interface AngularFireArrayService { - $extendFactory(ChildClass: Object, methods?: Object): Object; + $extendFactory(ChildClass: Object, methods?: Object): Object; } interface AngularFireSimpleObject { - $id: string; - $priority: number; - $value: any; - [key: string]: any; + $id: string; + $priority: number; + $value: any; + [key: string]: any; } interface AngularFireAuthService { - (firebase: Firebase): AngularFireAuth; + (firebase: Firebase): AngularFireAuth; } interface AngularFireAuth { - $getCurrentUser(): ng.IPromise; - $login(provider: string, options?: Object): ng.IPromise; - $logout(): void; - $createUser(email: string, password: string): ng.IPromise; - $changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise; - $removeUser(email: string, password: string): ng.IPromise; - $sendPasswordResetEmail(email: string): ng.IPromise; + $getCurrentUser(): ng.IPromise; + $login(provider: string, options?: Object): ng.IPromise; + $logout(): void; + $createUser(email: string, password: string): ng.IPromise; + $changePassword(email: string, oldPassword: string, newPassword: string): ng.IPromise; + $removeUser(email: string, password: string): ng.IPromise; + $sendPasswordResetEmail(email: string): ng.IPromise; } From 0607d042b41fd53aef05afca5a0679c0e211fbc9 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sun, 9 Nov 2014 00:14:20 +0900 Subject: [PATCH 068/292] mv mousetrap-global-bind/mousetrap-global-bind.d.ts -> mousetrap/mousetrap-global-bind.d.ts --- .../mousetrap-global-bind-tests.ts | 0 {mousetrap-global-bind => mousetrap}/mousetrap-global-bind.d.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {mousetrap-global-bind => mousetrap}/mousetrap-global-bind-tests.ts (100%) rename {mousetrap-global-bind => mousetrap}/mousetrap-global-bind.d.ts (88%) diff --git a/mousetrap-global-bind/mousetrap-global-bind-tests.ts b/mousetrap/mousetrap-global-bind-tests.ts similarity index 100% rename from mousetrap-global-bind/mousetrap-global-bind-tests.ts rename to mousetrap/mousetrap-global-bind-tests.ts diff --git a/mousetrap-global-bind/mousetrap-global-bind.d.ts b/mousetrap/mousetrap-global-bind.d.ts similarity index 88% rename from mousetrap-global-bind/mousetrap-global-bind.d.ts rename to mousetrap/mousetrap-global-bind.d.ts index b22d5e3382..ecfdd2ff23 100644 --- a/mousetrap-global-bind/mousetrap-global-bind.d.ts +++ b/mousetrap/mousetrap-global-bind.d.ts @@ -3,7 +3,7 @@ // Definitions by: Andrew Bradley // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// interface MousetrapStatic { globalBind(keys: string, callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; From 6c618f28eda73800d343941d3e877ca24094bedf Mon Sep 17 00:00:00 2001 From: in-async Date: Sun, 9 Nov 2014 02:21:02 +0900 Subject: [PATCH 069/292] Add name to "Definitions by". --- firebase/firebase.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firebase/firebase.d.ts b/firebase/firebase.d.ts index 40e3b81261..c87f5c322f 100644 --- a/firebase/firebase.d.ts +++ b/firebase/firebase.d.ts @@ -1,6 +1,6 @@ // Type definitions for Firebase API 2.0.2 // Project: https://www.firebase.com/docs/javascript/firebase -// Definitions by: Vincent Botone +// Definitions by: Vincent Botone , Shin1 Kashimura // Definitions: https://github.com/borisyankov/DefinitelyTyped interface IFirebaseAuthResult { From eae67433b791fa98ee59c33aa99f6219daeae956 Mon Sep 17 00:00:00 2001 From: jbblanchet Date: Sat, 8 Nov 2014 12:45:12 -0500 Subject: [PATCH 070/292] Declare variable so import works When declaring a module, it's necessary to declare a variable then export it, else the import keyword won't work properly when using modules. --- tv4/tv4.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tv4/tv4.d.ts b/tv4/tv4.d.ts index 702d3c3bc6..02b7ebba2f 100644 --- a/tv4/tv4.d.ts +++ b/tv4/tv4.d.ts @@ -43,5 +43,6 @@ interface TV4 { errorCodes:TV4ErrorCodes; } declare module "tv4" { -export = TV4; + var tv4: TV4 + export = tv4; } From 82e42f3d53015af41a3224795b929b46f72a05a1 Mon Sep 17 00:00:00 2001 From: Hraban Luyat Date: Sun, 9 Nov 2014 04:12:34 +0100 Subject: [PATCH 071/292] React.render() return value incorrect React.render does not return an element but a component. It's the `this` from the render callback: > Instances of a React Component are created internally in React when rendering. These instances are reused in subsequent renders, and can be accessed in your component methods as this. The only way to get a handle to a React Component instance outside of React is by storing the return value of React.render. Inside other Components, you may use refs to achieve the same result. http://facebook.github.io/react/docs/component-api.html This particular pull request is probably not perfect (e.g. I don't know what to pass as the type parameter for state so I just set it to `void`). It does scratch my particular itch, though; calling `.setProps(..)` on the return value of `React.render(...)` is now possible. Sorry if I misunderstood. By no means a react expert. Nor typescript, for that matter. Cheers --- react/react.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react/react.d.ts b/react/react.d.ts index 40522920fc..b8d627eea3 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -18,7 +18,7 @@ declare module React { export function createElement(type: string, props: SvgAttributes, ...children: any[]): ReactSVGElement; - export function render

(component: ReactComponentElement

, container: Element, callback?: () => void): ReactComponentElement

; + export function render

(component: ReactComponentElement

, container: Element, callback?: () => void): Component; export function render(component: ReactHTMLElement, container: Element, callback?: () => void): ReactHTMLElement; @@ -604,4 +604,4 @@ declare module React { text: SvgElement; tspan: SvgElement; }; -} \ No newline at end of file +} From a1639fb602c07c0fb57d895f7e95b981e047d70c Mon Sep 17 00:00:00 2001 From: in-async Date: Sun, 9 Nov 2014 15:10:39 +0900 Subject: [PATCH 072/292] Modify the "Firebase" declaration to interface by decomposing class. --- firebase/firebase.d.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/firebase/firebase.d.ts b/firebase/firebase.d.ts index c87f5c322f..97bea923e7 100644 --- a/firebase/firebase.d.ts +++ b/firebase/firebase.d.ts @@ -86,7 +86,7 @@ interface IFirebaseOnDisconnect { cancel(onComplete?: (error: any) => void): void; } -declare class IFirebaseQuery { +interface IFirebaseQuery { /** * Listens for data changes at a particular location. */ @@ -148,11 +148,7 @@ declare class IFirebaseQuery { ref(): Firebase; } -declare class Firebase extends IFirebaseQuery { - /** - * Constructs a new Firebase reference from a full Firebase URL. - */ - constructor(firebaseURL: string); +interface Firebase extends IFirebaseQuery { /** * @deprecated Use authWithCustomToken() instead. * Authenticates a Firebase client using the provided authentication token or Firebase Secret. @@ -272,16 +268,22 @@ declare class Firebase extends IFirebaseQuery { */ resetPassword(credentials: { email: string }, onComplete: (error: any) => void): void; onDisconnect(): IFirebaseOnDisconnect; +} +interface FirebaseStatic { + /** + * Constructs a new Firebase reference from a full Firebase URL. + */ + new (firebaseURL: string): Firebase; /** * Manually disconnects the Firebase client from the server and disables automatic reconnection. */ - static goOffline(): void; + goOffline(): void; /** * Manually reestablishes a connection to the Firebase server and enables automatic reconnection. */ - static goOnline(): void; + goOnline(): void; - static ServerValue: { + ServerValue: { /** * A placeholder value for auto-populating the current timestamp * (time since the Unix epoch, in milliseconds) by the Firebase servers. @@ -289,6 +291,7 @@ declare class Firebase extends IFirebaseQuery { TIMESTAMP: any; }; } +declare var Firebase: FirebaseStatic; // Reference: https://www.firebase.com/docs/web/api/firebase/getauth.html interface IFirebaseAuthData { From e07da8a6fabb4c52295f09a65d39d86bd60fbf42 Mon Sep 17 00:00:00 2001 From: Maks3w Date: Sun, 9 Nov 2014 12:09:26 +0100 Subject: [PATCH 073/292] [jquery.validation][1.11.1] invalidElements and validElements methods --- jquery.validation/jquery.validation-tests.ts | 2 ++ jquery.validation/jquery.validation.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/jquery.validation/jquery.validation-tests.ts b/jquery.validation/jquery.validation-tests.ts index 64fe6ef942..fcc22d2961 100644 --- a/jquery.validation/jquery.validation-tests.ts +++ b/jquery.validation/jquery.validation-tests.ts @@ -227,4 +227,6 @@ function test_methods() { maxlength: 5 } }); + var invalidElements: HTMLElement[] = validator.invalidElements(); + var validElements: HTMLElement[] = validator.validElements(); } diff --git a/jquery.validation/jquery.validation.d.ts b/jquery.validation/jquery.validation.d.ts index f66edadab9..916ae1016b 100644 --- a/jquery.validation/jquery.validation.d.ts +++ b/jquery.validation/jquery.validation.d.ts @@ -197,6 +197,7 @@ interface Validator * @param template The string to format. */ format(template: string, ...arguments: string[]): string; + invalidElements(): HTMLElement[]; /** * Returns the number of invalid fields. */ @@ -220,6 +221,7 @@ interface Validator showErrors(errors: any): void; hideErrors(): void; valid(): boolean; + validElements(): HTMLElement[]; size(): number; errorMap: ErrorDictionary; From 5f4765a1c903a82b35d96023f866bf381afbafa7 Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Mon, 10 Nov 2014 16:15:58 +1100 Subject: [PATCH 074/292] Use the new beta build env on Travis https://github.com/travis-ci/docs-travis-ci-com/blob/ha-docker-documentation/user/container-based-infrastructure.md Seen on `Microsoft/TypeScript/pull/1085` by travis team --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index acfc5176f9..0bad26ece1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,5 +2,7 @@ language: node_js node_js: - "0.10" +sudo: false + notifications: email: false From 0008781fb2a165a68d10b7f579330dcb4f6a1cb6 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Mon, 10 Nov 2014 12:59:50 -0500 Subject: [PATCH 075/292] Fixing type definition for semver.satisfies to return a boolean. Cleaning up type definitions a bit, and lifting function comments into JSDoc so IDEs like Visual Studio will appropriately display the comment. --- semver/semver-tests.ts | 7 +- semver/semver.d.ts | 148 +++++++++++++++++++++++++++-------------- 2 files changed, 102 insertions(+), 53 deletions(-) diff --git a/semver/semver-tests.ts b/semver/semver-tests.ts index f339be75ba..c3631cd721 100644 --- a/semver/semver-tests.ts +++ b/semver/semver-tests.ts @@ -20,10 +20,9 @@ var loose:boolean; str = mod.valid(str); str = mod.valid(str, loose); -//TODO maybe add an enum for release? str = mod.inc(str, str, loose); -//Comparison +// Comparison bool = mod.gt(v1, v2, loose); bool = mod.gte(v1, v2, loose); bool = mod.lt(v1, v2, loose); @@ -34,9 +33,9 @@ bool = mod.cmp(v1, x, v2, loose); num = mod.compare(v1, v2, loose); num = mod.rcompare(v1, v2, loose); -//Ranges +// Ranges str = mod.validRange(str, loose); -str = mod.satisfies(version, str, loose); +bool = mod.satisfies(version, str, loose); str = mod.maxSatisfying(versions, str, loose); bool = mod.gtr(version, str, loose); bool = mod.ltr(version, str, loose); diff --git a/semver/semver.d.ts b/semver/semver.d.ts index 12909d90e1..cb8efa4f50 100644 --- a/semver/semver.d.ts +++ b/semver/semver.d.ts @@ -4,72 +4,122 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module SemVerModule { + /** + * Return the parsed version, or null if it's not valid. + */ + function valid(v: string, loose?: boolean): string; + /** + * Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid. + */ + function inc(v: string, release: string, loose?: boolean): string; - function valid(v:string, loose?:boolean):string; // Return the parsed version, or null if it's not valid. - //TODO maybe add an enum for release? - function inc(v:string, release:string, loose?:boolean):string; // Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid. + // Comparison + /** + * v1 > v2 + */ + function gt(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 >= v2 + */ + function gte(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 < v2 + */ + function lt(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 <= v2 + */ + function lte(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. + */ + function eq(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 != v2 The opposite of eq. + */ + function neq(v1: string, v2: string, loose?: boolean): boolean; + /** + * Pass in a comparison string, and it'll call the corresponding semver comparison function. "===" and "!==" do simple string comparison, but are included for completeness. Throws if an invalid comparison string is provided. + */ + function cmp(v1: string, comparator: any, v2: string, loose?: boolean): boolean; + /** + * Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort(). + */ + function compare(v1: string, v2: string, loose?: boolean): number; + /** + * The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort(). + */ + function rcompare(v1: string, v2: string, loose?: boolean): number; - //Comparison - function gt(v1:string, v2:string, loose?:boolean):boolean; // v1 > v2 - function gte(v1:string, v2:string, loose?:boolean):boolean; // v1 >= v2 - function lt(v1:string, v2:string, loose?:boolean):boolean; // v1 < v2 - function lte(v1:string, v2:string, loose?:boolean):boolean; // v1 <= v2 - function eq(v1:string, v2:string, loose?:boolean):boolean; // v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. - function neq(v1:string, v2:string, loose?:boolean):boolean; // v1 != v2 The opposite of eq. - function cmp(v1:string, comparator:any, v2:string, loose?:boolean):boolean; // Pass in a comparison string, and it'll call the corresponding function above. "===" and "!==" do simple string comparison, but are included for completeness. Throws if an invalid comparison string is provided. - function compare(v1:string, v2:string, loose?:boolean):number; // Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort(). - function rcompare(v1:string, v2:string, loose?:boolean):number; // The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort(). - - //Ranges - function validRange(range:string, loose?:boolean):string; // Return the valid range or null if it's not valid - function satisfies(version:string, range:string, loose?:boolean):string; // Return true if the version satisfies the range. - function maxSatisfying(versions:string[], range:string, loose?:boolean):string; // Return the highest version in the list that satisfies the range, or null if none of them do. - function gtr(version:string, range:string, loose?:boolean):boolean; // Return true if version is greater than all the versions possible in the range. - function ltr(version:string, range:string, loose?:boolean):boolean; // Return true if version is less than all the versions possible in the range. - function outside(version:string, range:string, hilo:string, loose?:boolean):boolean; // Return true if the version is outside the bounds of the range in either the high or low direction. The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.) + // Ranges + /** + * Return the valid range or null if it's not valid + */ + function validRange(range: string, loose?: boolean): string; + /** + * Return true if the version satisfies the range. + */ + function satisfies(version: string, range: string, loose?: boolean): boolean; + /** + * Return the highest version in the list that satisfies the range, or null if none of them do. + */ + function maxSatisfying(versions: string[], range: string, loose?: boolean): string; + /** + * Return true if version is greater than all the versions possible in the range. + */ + function gtr(version: string, range: string, loose?: boolean): boolean; + /** + * Return true if version is less than all the versions possible in the range. + */ + function ltr(version: string, range: string, loose?: boolean): boolean; + /** + * Return true if the version is outside the bounds of the range in either the high or low direction. The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.) + */ + function outside(version: string, range: string, hilo: string, loose?: boolean): boolean; class SemVerBase { - raw:string; - loose:boolean; - format():string; - inspect():string; - toString():string; + raw: string; + loose: boolean; + format(): string; + inspect(): string; + toString(): string; } - class SemVer extends SemVerBase { - constructor(version:string, loose?:boolean); + class SemVer extends SemVerBase { + constructor(version: string, loose?: boolean); - major:number; - minor:number; - patch:number; - version:string; - build:string[]; - prerelease:string[]; + major: number; + minor: number; + patch: number; + version: string; + build: string[]; + prerelease: string[]; - compare(other:SemVer):number; - compareMain(other:SemVer):number; - comparePre(other:SemVer):number; - inc(release:string):SemVer; + compare(other:SemVer): number; + compareMain(other:SemVer): number; + comparePre(other:SemVer): number; + inc(release: string): SemVer; } class Comparator extends SemVerBase { - constructor(comp:string, loose?:boolean); + constructor(comp: string, loose?: boolean); - semver:SemVer; - operator:string; - value:boolean; - parse(comp:string) :void; - test(version:SemVer):boolean; + semver: SemVer; + operator: string; + value: boolean; + parse(comp: string): void; + test(version:SemVer): boolean; } class Range extends SemVerBase { - constructor(range:string, loose?:boolean); + constructor(range: string, loose?: boolean); - set:Comparator[][]; - parseRange(range:string):Comparator[]; - test(version:SemVer):boolean; + set: Comparator[][]; + parseRange(range: string): Comparator[]; + test(version: SemVer): boolean; } } + declare module "semver" { -export = SemVerModule; + export = SemVerModule; } From 64d394d81a74bf817515f323bf22dfcc26426870 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Mon, 10 Nov 2014 13:16:30 -0500 Subject: [PATCH 076/292] Fixing tar.Pack to have an optional properties parameter. Adding in some JSDoc for the main methods, lifted directly from documentation, and adding a TODO for the future if someone decides to type the fstream library. --- tar/tar-tests.ts | 11 +++++++---- tar/tar.d.ts | 33 +++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/tar/tar-tests.ts b/tar/tar-tests.ts index 3a7783d521..b23ad7d06b 100644 --- a/tar/tar-tests.ts +++ b/tar/tar-tests.ts @@ -1,8 +1,8 @@ /** -* Test suite created by Maxime LUCE -* -* Created by using code samples from https://github.com/npm/node-tar. -*/ + * Test suite created by Maxime LUCE + * + * Created by using code samples from https://github.com/npm/node-tar. + */ /// /// @@ -26,3 +26,6 @@ readStream.pipe(extract); extract.on("entry", (entry: any) => { }); + +var packStream: tar.PackStream = tar.Pack(); +packStream = tar.Pack({ path: 'test' }); diff --git a/tar/tar.d.ts b/tar/tar.d.ts index 6b25a02a78..3116b5cc9e 100644 --- a/tar/tar.d.ts +++ b/tar/tar.d.ts @@ -2,13 +2,14 @@ // Project: https://github.com/npm/node-tar // Definitions by: Maxime LUCE // Definitions: https://github.com/borisyankov/DefinitelyTyped +// TODO: When/if typings for [fstream](https://github.com/npm/fstream) are written, refactor this typing to use it for the various streams. /// declare module "tar" { import stream = require("stream"); - //#region Interfaces + // #region Interfaces export interface HeaderProperties { path?: string; @@ -64,9 +65,9 @@ declare module "tar" { export interface ExtractStream extends ParseStream { } - //#endregion + // #endregion - //#region Enums + // #region Enums export var fields: { path: number; @@ -198,11 +199,31 @@ declare module "tar" { //#region Global Methods + /** + * Returns a writable stream. Write tar data to it and it will emit entry events for each entry parsed from the tarball. This is used by tar.Extract. + */ export function Parse(): ParseStream; - - export function Pack(props: HeaderProperties): PackStream; - + /** + * Returns a through stream. Use fstream to write files into the pack stream and you will receive tar archive data from the pack stream. + * This only works with directories, it does not work with individual files. + * The optional properties object are used to set properties in the tar 'Global Extended Header'. + */ + export function Pack(props?: HeaderProperties): PackStream; + /** + * Returns a through stream. Write tar data to the stream and the files in the tarball will be extracted onto the filesystem. + */ export function Extract(path: string): ExtractStream; + /** + * Returns a through stream. Write tar data to the stream and the files in the tarball will be extracted onto the filesystem. + * options can be: + * ``` + * { + * path: '/path/to/extract/tar/into', + * strip: 0, // how many path segments to strip from the root when extracting + * } + * ``` + * options also get passed to the fstream.Writer instance that tar uses internally. + */ export function Extract(opts: ExtractOptions): ExtractStream; //#endregion From cc534e611972a126324f8af40dc026c80fdddb1d Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Mon, 10 Nov 2014 22:00:13 -0600 Subject: [PATCH 077/292] Fix async.d.ts each* signatures Add generic ErrorCallback type Rename AsyncIterator -> AsyncResultIterator Add AsyncIterator as resultless iterator type Rename AsyncMultipleResultsCallback -> AsyncResultsCallback Rename AsyncSingleResultCallback -> AsyncResultCallback --- async/async.d.ts | 95 +++++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/async/async.d.ts b/async/async.d.ts index 1efa5046bb..5f558c3846 100644 --- a/async/async.d.ts +++ b/async/async.d.ts @@ -3,12 +3,14 @@ // Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface AsyncMultipleResultsCallback { (err: Error, results: T[]): any; } -interface AsyncSingleResultCallback { (err: Error, result: T): void; } -interface AsyncTimesCallback { (n: number, callback: AsyncMultipleResultsCallback): void; } +interface ErrorCallback { (err?: Error): void; } +interface AsyncResultsCallback { (err: Error, results: T[]): void; } +interface AsyncResultCallback { (err: Error, result: T): void; } +interface AsyncTimesCallback { (n: number, callback: AsyncResultsCallback): void; } -interface AsyncIterator { (item: T, callback: AsyncSingleResultCallback): void; } -interface AsyncMemoIterator { (memo: R, item: T, callback: AsyncSingleResultCallback): void; } +interface AsyncIterator { (item: T, callback: ErrorCallback): void; } +interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } +interface AsyncMemoIterator { (memo: R, item: T, callback: AsyncResultCallback): void; } interface AsyncWorker { (task: T, callback: Function): void; } @@ -17,10 +19,10 @@ interface AsyncQueue { concurrency: number; started: boolean; paused: boolean; - push(task: T, callback?: AsyncMultipleResultsCallback): void; - push(task: T[], callback?: AsyncMultipleResultsCallback): void; - unshift(task: T, callback?: AsyncMultipleResultsCallback): void; - unshift(task: T[], callback?: AsyncMultipleResultsCallback): void; + push(task: T, callback?: AsyncResultsCallback): void; + push(task: T[], callback?: AsyncResultsCallback): void; + unshift(task: T, callback?: AsyncResultsCallback): void; + unshift(task: T[], callback?: AsyncResultsCallback): void; saturated: () => any; empty: () => any; drain: () => any; @@ -36,8 +38,8 @@ interface AsyncPriorityQueue { concurrency: number; started: boolean; paused: boolean; - push(task: T, priority: number, callback?: AsyncMultipleResultsCallback): void; - push(task: T[], priority: number, callback?: AsyncMultipleResultsCallback): void; + push(task: T, priority: number, callback?: AsyncResultsCallback): void; + push(task: T[], priority: number, callback?: AsyncResultsCallback): void; saturated: () => any; empty: () => any; drain: () => any; @@ -51,47 +53,48 @@ interface AsyncPriorityQueue { interface Async { // Collections - each(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): void; - eachSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): void; - eachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): void; - map(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - mapSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - filter(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - select(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - filterSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - selectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - reject(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - rejectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - reduce(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncSingleResultCallback): any; - inject(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncSingleResultCallback): any; - foldl(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncSingleResultCallback): any; - reduceRight(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncSingleResultCallback): any; - foldr(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncSingleResultCallback): any; - detect(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - detectSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - sortBy(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - some(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - any(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - every(arr: T[], iterator: AsyncIterator, callback: (result: boolean) => any): any; - all(arr: T[], iterator: AsyncIterator, callback: (result: boolean) => any): any; - concat(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; - concatSeries(arr: T[], iterator: AsyncIterator, callback: AsyncMultipleResultsCallback): any; + each(arr: T[], iterator: AsyncIterator, callback: ErrorCallback): void; + eachSeries(arr: T[], iterator: AsyncIterator, callback: ErrorCallback): void; + eachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback: ErrorCallback): void; + map(arr: T[], iterator: AsyncResultIterator, callback: AsyncResultsCallback): any; + mapSeries(arr: T[], iterator: AsyncResultIterator, callback: AsyncResultsCallback): any; + mapLimit(arr: T[], limit: number, iterator: AsyncResultIterator, callback: AsyncResultsCallback): any; + filter(arr: T[], iterator: AsyncResultIterator, callback: (results: T[]) => any): any; + select(arr: T[], iterator: AsyncResultIterator, callback: (results: T[]) => any): any; + filterSeries(arr: T[], iterator: AsyncResultIterator, callback: (results: T[]) => any): any; + selectSeries(arr: T[], iterator: AsyncResultIterator, callback: (results: T[]) => any): any; + reject(arr: T[], iterator: AsyncResultIterator, callback: (results: T[]) => any): any; + rejectSeries(arr: T[], iterator: AsyncResultIterator, callback: (results: T[]) => any): any; + reduce(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any; + inject(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any; + foldl(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any; + reduceRight(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any; + foldr(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any; + detect(arr: T[], iterator: AsyncResultIterator, callback: AsyncResultsCallback): any; + detectSeries(arr: T[], iterator: AsyncResultIterator, callback: AsyncResultsCallback): any; + sortBy(arr: T[], iterator: AsyncResultIterator, callback: AsyncResultsCallback): any; + some(arr: T[], iterator: AsyncResultIterator, callback: AsyncResultsCallback): any; + any(arr: T[], iterator: AsyncResultIterator, callback: AsyncResultsCallback): any; + every(arr: T[], iterator: AsyncResultIterator, callback: (result: boolean) => any): any; + all(arr: T[], iterator: AsyncResultIterator, callback: (result: boolean) => any): any; + concat(arr: T[], iterator: AsyncResultIterator, callback: AsyncResultsCallback): any; + concatSeries(arr: T[], iterator: AsyncResultIterator, callback: AsyncResultsCallback): any; // Control Flow - series(tasks: T[], callback?: AsyncMultipleResultsCallback): void; - series(tasks: T, callback?: AsyncMultipleResultsCallback): void; - parallel(tasks: T[], callback?: AsyncMultipleResultsCallback): void; - parallel(tasks: T, callback?: AsyncMultipleResultsCallback): void; - parallelLimit(tasks: T[], limit: number, callback?: AsyncMultipleResultsCallback): void; - parallelLimit(tasks: T, limit: number, callback?: AsyncMultipleResultsCallback): void; + series(tasks: T[], callback?: AsyncResultsCallback): void; + series(tasks: T, callback?: AsyncResultsCallback): void; + parallel(tasks: T[], callback?: AsyncResultsCallback): void; + parallel(tasks: T, callback?: AsyncResultsCallback): void; + parallelLimit(tasks: T[], limit: number, callback?: AsyncResultsCallback): void; + parallelLimit(tasks: T, limit: number, callback?: AsyncResultsCallback): void; whilst(test: Function, fn: Function, callback: Function): void; until(test: Function, fn: Function, callback: Function): void; - waterfall(tasks: T[], callback?: AsyncMultipleResultsCallback): void; - waterfall(tasks: T, callback?: AsyncMultipleResultsCallback): void; + waterfall(tasks: T[], callback?: AsyncResultsCallback): void; + waterfall(tasks: T, callback?: AsyncResultsCallback): void; queue(worker: AsyncWorker, concurrency: number): AsyncQueue; priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; - // auto(tasks: any[], callback?: AsyncMultipleResultsCallback): void; - auto(tasks: any, callback?: AsyncMultipleResultsCallback): void; + // auto(tasks: any[], callback?: AsyncResultsCallback): void; + auto(tasks: any, callback?: AsyncResultsCallback): void; iterator(tasks: Function[]): Function; apply(fn: Function, ...arguments: any[]): void; nextTick(callback: Function): void; From 9cd13294ae6c8b16ea7595e2ca0ce12e04ece6bd Mon Sep 17 00:00:00 2001 From: Chris Martinez Date: Tue, 11 Nov 2014 12:24:13 -0500 Subject: [PATCH 078/292] Added lscache definition Added lscache definition --- CONTRIBUTORS.md | 3 ++- lscache/lscache-tests.ts | 13 +++++++++++++ lscache/lscache.d.ts | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 lscache/lscache-tests.ts create mode 100644 lscache/lscache.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a628bd4814..e10ca14d4c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,4 +1,4 @@ -# Contributors +# Contributors This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url. @@ -270,6 +270,7 @@ All definitions files include a header with the author and editors, so at some p * [Lodash](http://lodash.com/) (by [Brian Zengel](https://github.com/bczengel)) * [Logg](https://github.com/dpup/node-logg) (by [Bret Little](https://github.com/blittle)) * [Long.js](https://github.com/dcodeIO/Long.js) (by [Toshihide Hara](https://github.com/kerug)) +* [lscache](https://github.com/pamelafox/lscache) (by [Chris Martinez](https://github.com/Chris-Martinezz)) * [lz-string](https://github.com/pieroxy/lz-string) (by [Roman Nikitin](https://github.com/M0ns1gn0r)) * [Mapbox](https://github.com/mapbox/mapbox.js/) (by [Maxime Fabre](https://github.com/anahkiasen)) * [Marked](https://github.com/chjj/marked) (by [William Orr](https://github.com/worr)) diff --git a/lscache/lscache-tests.ts b/lscache/lscache-tests.ts new file mode 100644 index 0000000000..103cb6c8c9 --- /dev/null +++ b/lscache/lscache-tests.ts @@ -0,0 +1,13 @@ +/// + +// Copied examples directly from lscache github site with slight modifications + +lscache.set('greeting', 'Hello World!', 2); + +alert(lscache.get('greeting')); + +lscache.remove('greeting'); + +lscache.set('data', { 'name': 'Pamela', 'age': 26 }, 2); + +alert(lscache.get('data').name); \ No newline at end of file diff --git a/lscache/lscache.d.ts b/lscache/lscache.d.ts new file mode 100644 index 0000000000..777c89421c --- /dev/null +++ b/lscache/lscache.d.ts @@ -0,0 +1,13 @@ +// Type definitions for lscache v1.0.2 +// Project: https://github.com/pamelafox/lscache +// Definitions by: Chris Martinez https://github.com/Chris-Martinezz +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface LSCache { + + set(key: string, value: any, time?: number): void; + get(key: string): any; + remove(key: string): void; +} + +declare var lscache: LSCache; \ No newline at end of file From 49e799b01b777784efd569212788e8baf2c40a58 Mon Sep 17 00:00:00 2001 From: Chris Martinez Date: Tue, 11 Nov 2014 12:33:12 -0500 Subject: [PATCH 079/292] Fix lscache header Fix lscache header so npm test passes. --- lscache/lscache.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lscache/lscache.d.ts b/lscache/lscache.d.ts index 777c89421c..24c34bd8da 100644 --- a/lscache/lscache.d.ts +++ b/lscache/lscache.d.ts @@ -1,6 +1,6 @@ // Type definitions for lscache v1.0.2 // Project: https://github.com/pamelafox/lscache -// Definitions by: Chris Martinez https://github.com/Chris-Martinezz +// Definitions by: Chris Martinez // Definitions: https://github.com/borisyankov/DefinitelyTyped interface LSCache { From 6eaa9d0a160b2c245a527dd41ced100e5843758f Mon Sep 17 00:00:00 2001 From: Jared Kells Date: Wed, 12 Nov 2014 10:36:14 +1100 Subject: [PATCH 080/292] The data property can be an MVCArray or LatLng[]. All other properties are optional --- googlemaps/google.maps.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index cf51d84c18..eb85899c4b 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -1574,13 +1574,13 @@ declare module google.maps { } export interface HeatmapLayerOptions { - data: LatLng[]; - dissipating: boolean; - gradient: string[]; - map: Map; - maxIntensity: number; - opacity: number; - radius: number; + data: any; + dissipating?: boolean; + gradient?: string[]; + map?: Map; + maxIntensity?: number; + opacity?: number; + radius?: number; } export interface WeightedLocation { From 792d0aa3c97d6367d5494bdc36f531c32bd8f296 Mon Sep 17 00:00:00 2001 From: "Yubing (Tom) Dong" Date: Tue, 11 Nov 2014 17:22:07 -0800 Subject: [PATCH 081/292] TrackballControls should extend EventDispatcher (threejs) Please see https://github.com/mrdoob/three.js/blob/master/examples/js/controls/Trac kballControls.js#L611 The prototype of THREE.TrackballControls is THREE.EventDispatcher.prototype. --- threejs/three-trackballcontrols.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threejs/three-trackballcontrols.d.ts b/threejs/three-trackballcontrols.d.ts index b4bda75ee9..ad6ffa9c36 100644 --- a/threejs/three-trackballcontrols.d.ts +++ b/threejs/three-trackballcontrols.d.ts @@ -6,7 +6,7 @@ /// declare module THREE { - class TrackballControls { + class TrackballControls extends EventDispatcher { constructor(object:Camera, domElement?:HTMLElement); object:Camera; From eb3420c93c76638aadf8a5a6456f06611d4b061e Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Wed, 12 Nov 2014 01:57:38 -0200 Subject: [PATCH 082/292] update angular to released version 1.3+ --- .gitignore | 2 + angularjs/angular-cookies.d.ts | 4 +- angularjs/angular-tests.ts | 43 +++++++++- angularjs/angular.d.ts | 141 +++++++++++++++++++++++++-------- 4 files changed, 157 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index d4bc5dd91f..bbbef03572 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ _infrastructure/tests/build !rx.js node_modules + +.sublimets diff --git a/angularjs/angular-cookies.d.ts b/angularjs/angular-cookies.d.ts index dc0c449089..0feffae83a 100644 --- a/angularjs/angular-cookies.d.ts +++ b/angularjs/angular-cookies.d.ts @@ -15,7 +15,9 @@ declare module ng.cookies { // CookieService // see http://docs.angularjs.org/api/ngCookies.$cookies /////////////////////////////////////////////////////////////////////////// - interface ICookiesService {} + interface ICookiesService { + [index: string]: any; + } /////////////////////////////////////////////////////////////////////////// // CookieStoreService diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts index 7adb0bab0b..628b6d1d25 100644 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -83,7 +83,7 @@ angular.module('http-auth-interceptor', []) } }]; - $httpProvider.responseInterceptors.push(interceptor); + $httpProvider.interceptors.push(interceptor); }]); @@ -326,6 +326,47 @@ class SampleDirective2 implements ng.IDirective { angular.module('SameplDirective', []).directive('sampleDirective', SampleDirective.instance).directive('sameplDirective2', SampleDirective2.instance); +angular.module('AnotherSampleDirective', []).directive('myDirective', ['$interpolate', '$q', ($interpolate: ng.IInterpolateService, $q: ng.IQService) => { + return { + restrict: 'A', + link: (scope: ng.IScope, el: ng.IAugmentedJQuery, attr: ng.IAttributes) => { + $interpolate(attr['test'])(scope); + $interpolate('', true)(scope); + $interpolate('', true, 'html')(scope); + $interpolate('', true, 'html', true)(scope); + var defer = $q.defer(); + defer.reject(); + defer.resolve(); + defer.promise.then(function(d) { + return d; + }).then(function(): any { + return null; + }, function(): any { + return null; + }) + .catch((): any => { + return null; + }) + .finally((): any => { + return null; + }); + var promise = new $q((resolve) => { + resolve(); + }); + + promise = new $q((resolve, reject) => { + reject(); + resolve(true); + }); + + promise = new $q((resolver, reject) => { + resolver(true); + reject(false); + }); + } + }; +}]); + // test from https://docs.angularjs.org/guide/directive angular.module('docsSimpleDirective', []) .controller('Controller', ['$scope', function($scope: any) { diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 4659da7612..b5cc51dafa 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -13,6 +13,11 @@ interface Function { $inject?: string[]; } +// Support AMD require +declare module 'angular' { + export = angular; +} + /////////////////////////////////////////////////////////////////////////////// // ng module (angular.js) /////////////////////////////////////////////////////////////////////////////// @@ -32,6 +37,10 @@ declare module ng { $get: any; } + interface IAngularBootstrapConfig { + strictDi?: boolean; + } + /////////////////////////////////////////////////////////////////////////// // AngularStatic // see http://docs.angularjs.org/api @@ -46,8 +55,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: string, modules?: string): auto.IInjectorService; + bootstrap(element: string, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -55,8 +66,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: string, modules?: Function): auto.IInjectorService; + bootstrap(element: string, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -64,8 +77,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: string, modules?: string[]): auto.IInjectorService; + bootstrap(element: string, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -73,8 +88,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: JQuery, modules?: string): auto.IInjectorService; + bootstrap(element: JQuery, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -82,8 +99,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: JQuery, modules?: Function): auto.IInjectorService; + bootstrap(element: JQuery, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -91,8 +110,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: JQuery, modules?: string[]): auto.IInjectorService; + bootstrap(element: JQuery, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -100,8 +121,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Element, modules?: string): auto.IInjectorService; + bootstrap(element: Element, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -109,8 +132,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Element, modules?: Function): auto.IInjectorService; + bootstrap(element: Element, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -118,8 +143,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Element, modules?: string[]): auto.IInjectorService; + bootstrap(element: Element, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -127,8 +154,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Document, modules?: string): auto.IInjectorService; + bootstrap(element: Document, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -136,8 +165,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Document, modules?: Function): auto.IInjectorService; + bootstrap(element: Document, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Use this function to manually start up angular application. * @@ -145,8 +176,10 @@ declare module ng { * @param modules An array of modules to load into the application. * Each item in the array should be the name of a predefined module or a (DI annotated) * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. */ - bootstrap(element: Document, modules?: string[]): auto.IInjectorService; + bootstrap(element: Document, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; /** * Creates a deep copy of source, which should be an object or an array. @@ -230,6 +263,7 @@ declare module ng { configFn?: Function): IModule; noop(...args: any[]): void; + reloadWithDebugInfo(): void; toJson(obj: any, pretty?: boolean): string; uppercase(str: string): string; version: { @@ -412,6 +446,7 @@ declare module ng { $commitViewValue(): void; $rollbackViewValue(): void; $setSubmitted(): void; + $setUntouched(): void; } /////////////////////////////////////////////////////////////////////////// @@ -423,13 +458,13 @@ declare module ng { $setValidity(validationErrorKey: string, isValid: boolean): void; // Documentation states viewValue and modelValue to be a string but other // types do work and it's common to use them. - $setViewValue(value: any): void; + $setViewValue(value: any, trigger?: string): void; $setPristine(): void; $validate(): void; $setTouched(): void; $setUntouched(): void; $rollbackViewValue(): void; - $commitViewValue(revalidate?: boolean): void; + $commitViewValue(): void; $isEmpty(value: any): boolean; $viewValue: any; @@ -448,6 +483,7 @@ declare module ng { $validators: IModelValidators; $asyncValidators: IAsyncModelValidators; + $pending: any; $pristine: boolean; $dirty: boolean; $valid: boolean; @@ -479,10 +515,13 @@ declare module ng { * see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope */ interface IRootScopeService { + [index: string]: any; + $apply(): any; $apply(exp: string): any; $apply(exp: (scope: IScope) => any): any; - + + $applyAsync(): any; $applyAsync(exp: string): any; $applyAsync(exp: (scope: IScope) => any): any; @@ -491,14 +530,20 @@ declare module ng { $digest(): void; $emit(name: string, ...args: any[]): IAngularEvent; - $eval(expression?: string, args?: Object): any; - $eval(expression?: (scope: IScope) => any, args?: Object): any; + $eval(): any; + $eval(expression: string): any; + $eval(expression: string, locals: Object): any; + $eval(expression: (scope: IScope) => any): any; + $eval(expression: (scope: IScope) => any, locals: Object): any; - $evalAsync(expression?: string): void; - $evalAsync(expression?: (scope: IScope) => any): void; + $evalAsync(): void; + $evalAsync(expression: string): void; + $evalAsync(expression: (scope: IScope) => any): void; // Defaults to false by the implementation checking strategy - $new(isolate?: boolean): IScope; + $new(): IScope; + $new(isolate: boolean): IScope; + $new(isolate: boolean, parent: IScope): IScope; /** * Listens on events of a given type. See $emit for discussion of event life cycle. @@ -522,10 +567,7 @@ declare module ng { $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; $parent: IScope; - $root: IRootScopeService; - this: IRootScopeService; - $id: number; // Hidden members @@ -533,9 +575,7 @@ declare module ng { $$phase: any; } - interface IScope extends IRootScopeService { - [index: string]: any; - } + interface IScope extends IRootScopeService { } interface IAngularEvent { /** @@ -585,7 +625,9 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$timeout /////////////////////////////////////////////////////////////////////////// interface ITimeoutService { - (func: Function, delay?: number, invokeApply?: boolean): IPromise; + (func: Function): IPromise; + (func: Function, delay: number): IPromise; + (func: Function, delay: number, invokeApply: boolean): IPromise; cancel(promise: IPromise): boolean; } @@ -594,7 +636,9 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$interval /////////////////////////////////////////////////////////////////////////// interface IIntervalService { - (func: Function, delay: number, count?: number, invokeApply?: boolean): IPromise; + (func: Function, delay: number): IPromise; + (func: Function, delay: number, count: number): IPromise; + (func: Function, delay: number, count: number, invokeApply: boolean): IPromise; cancel(promise: IPromise): boolean; } @@ -812,6 +856,8 @@ declare module ng { */ search(search: string, paramValue: boolean): ILocationService; + state(): any; + state(state: any): ILocationService; url(): string; url(url: string): ILocationService; } @@ -847,12 +893,20 @@ declare module ng { /////////////////////////////////////////////////////////////////////////// interface IRootElementService extends JQuery {} + interface IQResolveReject { + (): void; + (value: T): void; + } /** * $q - service in module ng * A promise/deferred implementation inspired by Kris Kowal's Q. * See http://docs.angularjs.org/api/ng/service/$q */ interface IQService { + new (resolver: (resolve: IQResolveReject) => any): IPromise; + new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; + new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; + /** * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. * @@ -955,6 +1009,7 @@ declare module ng { /////////////////////////////////////////////////////////////////////////// interface IAnchorScrollService { (): void; + yOffset: any; } interface IAnchorScrollProvider extends IServiceProvider { @@ -1014,6 +1069,9 @@ declare module ng { imgSrcSanitizationWhitelist(): RegExp; imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider; + + debugInfoEnabled(): any; + debugInfoEnabled(enabled: boolean): any; } interface ICloneAttachFunction { @@ -1048,6 +1106,7 @@ declare module ng { interface IControllerProvider extends IServiceProvider { register(name: string, controllerConstructor: Function): void; register(name: string, dependencyAnnotatedConstructor: any[]): void; + allowGlobals(): void; } /** @@ -1227,10 +1286,22 @@ declare module ng { then(successCallback: (response: IHttpPromiseCallbackArg) => TResult, errorCallback?: (response: IHttpPromiseCallbackArg) => any): IPromise; } + interface IHttpProviderDefaults { + xsrfCookieName?: string; + xsrfHeaderName?: string; + headers?: { + common?: any; + post?: any; + put?: any; + patch?: any; + } + } + interface IHttpProvider extends IServiceProvider { - defaults: IRequestConfig; + defaults: IHttpProviderDefaults; interceptors: any[]; - responseInterceptors: any[]; + useApplyAsync(): boolean; + useApplyAsync(value: boolean): IHttpProvider; } /////////////////////////////////////////////////////////////////////////// @@ -1249,7 +1320,10 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$interpolateProvider /////////////////////////////////////////////////////////////////////////// interface IInterpolateService { - (text: string, mustHaveExpression?: boolean): IInterpolationFunction; + (text: string): IInterpolationFunction; + (text: string, mustHaveExpression: boolean): IInterpolationFunction; + (text: string, mustHaveExpression: boolean, trustedContext: string): IInterpolationFunction; + (text: string, mustHaveExpression: boolean, trustedContext: string, allOrNothing: boolean): IInterpolationFunction; endSymbol(): string; startSymbol(): string; } @@ -1345,6 +1419,11 @@ declare module ng { * @return A promise whose value is the template content. */ (tpl: string, ignoreRequestError?: boolean): IPromise; + /** + * total amount of pending template requests being downloaded. + * @type {number} + */ + totalPendingRequests: number; } /////////////////////////////////////////////////////////////////////////// From 91ea0ef4cec935d3777ff805f8beea695be98364 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Wed, 12 Nov 2014 06:04:00 -0200 Subject: [PATCH 083/292] squash! update angular to released version 1.3+ undo optionals --- angularjs/angular.d.ts | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index b5cc51dafa..d28c40e21e 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -531,19 +531,15 @@ declare module ng { $emit(name: string, ...args: any[]): IAngularEvent; $eval(): any; - $eval(expression: string): any; - $eval(expression: string, locals: Object): any; - $eval(expression: (scope: IScope) => any): any; - $eval(expression: (scope: IScope) => any, locals: Object): any; + $eval(expression: string, locals?: Object): any; + $eval(expression: (scope: IScope) => any, locals?: Object): any; $evalAsync(): void; $evalAsync(expression: string): void; $evalAsync(expression: (scope: IScope) => any): void; // Defaults to false by the implementation checking strategy - $new(): IScope; - $new(isolate: boolean): IScope; - $new(isolate: boolean, parent: IScope): IScope; + $new(isolate?: boolean, parent?: IScope): IScope; /** * Listens on events of a given type. See $emit for discussion of event life cycle. @@ -625,9 +621,7 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$timeout /////////////////////////////////////////////////////////////////////////// interface ITimeoutService { - (func: Function): IPromise; - (func: Function, delay: number): IPromise; - (func: Function, delay: number, invokeApply: boolean): IPromise; + (func: Function, delay?: number, invokeApply?: boolean): IPromise; cancel(promise: IPromise): boolean; } @@ -636,9 +630,7 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$interval /////////////////////////////////////////////////////////////////////////// interface IIntervalService { - (func: Function, delay: number): IPromise; - (func: Function, delay: number, count: number): IPromise; - (func: Function, delay: number, count: number, invokeApply: boolean): IPromise; + (func: Function, delay?: number, count?: number, invokeApply?: boolean): IPromise; cancel(promise: IPromise): boolean; } @@ -747,8 +739,8 @@ declare module ng { } interface ILogProvider { - debugEnabled(enabled: boolean): ILogProvider; debugEnabled(): boolean; + debugEnabled(enabled: boolean): ILogProvider; } // We define this as separete interface so we can reopen it later for @@ -1070,8 +1062,7 @@ declare module ng { imgSrcSanitizationWhitelist(): RegExp; imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider; - debugInfoEnabled(): any; - debugInfoEnabled(enabled: boolean): any; + debugInfoEnabled(enabled?: boolean): any; } interface ICloneAttachFunction { @@ -1320,10 +1311,7 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$interpolateProvider /////////////////////////////////////////////////////////////////////////// interface IInterpolateService { - (text: string): IInterpolationFunction; - (text: string, mustHaveExpression: boolean): IInterpolationFunction; - (text: string, mustHaveExpression: boolean, trustedContext: string): IInterpolationFunction; - (text: string, mustHaveExpression: boolean, trustedContext: string, allOrNothing: boolean): IInterpolationFunction; + (text: string, mustHaveExpression?: boolean, trustedContext?: string, allOrNothing?: boolean): IInterpolationFunction; endSymbol(): string; startSymbol(): string; } @@ -1443,7 +1431,7 @@ declare module ng { instanceAttributes: IAttributes, controller: any, transclude: ITranscludeFunction - ): void; + ): void; } interface IDirectivePrePost { @@ -1456,7 +1444,7 @@ declare module ng { templateElement: IAugmentedJQuery, templateAttributes: IAttributes, transclude: ITranscludeFunction - ): IDirectivePrePost; + ): IDirectivePrePost; } interface IDirective { From 11694760b1f84f7e1ed05950bb9ebb0d5d33a825 Mon Sep 17 00:00:00 2001 From: Brian Geppert Date: Wed, 12 Nov 2014 02:08:14 -0600 Subject: [PATCH 084/292] Filled out the 'config' object for 'aws-sdk'. --- aws-sdk/aws-sdk.d.ts | 71 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/aws-sdk/aws-sdk.d.ts b/aws-sdk/aws-sdk.d.ts index 5f8b3c3ac6..ff9a7b1a70 100644 --- a/aws-sdk/aws-sdk.d.ts +++ b/aws-sdk/aws-sdk.d.ts @@ -18,7 +18,76 @@ declare module "aws-sdk" { accessKeyId: string; } - export interface ClientConfig { + export interface Logger { + write?: (chunk: any, encoding?: string, callback?: () => void) => void; + log?: (...messages: any[]) => void; + } + + export interface HttpOptions { + proxy?: string; + agent?: any; + timeout?: number; + xhrAsync?: boolean; + xhrWithCredentials?: boolean; + } + + export interface ClientConfigPartial { + credentials?: Credentials; + region?: string; + computeChecksums?: boolean; + convertResponseTypes?: boolean; + logger?: Logger; + maxRedirects?: number; + maxRetries?: number; + paramValidation?: boolean; + s3ForcePathStyle?: boolean; + signatureVersion?: string; + sslEnabled?: boolean; + systemClockOffset?: number; + autoscaling?: any; + cloudformation?: any; + cloudfront?: any; + cloudsearch?: any; + cloudsearchdomain?: any; + cloudtrail?: any; + cloudwatch?: any; + cloudwatchlogs?: any; + cognitoidentity?: any; + cognitosync?: any; + datapipeline?: any; + directconnect?: any; + dynamodb?: any; + ec2?: any; + elasticache?: any; + elasticbeanstalk?: any; + elastictranscoder?: any; + elb?: any; + emr?: any; + glacier?: any; + httpOptions?: HttpOptions; + iam?: any; + importexport?: any; + kinesis?: any; + opsworks?: any; + rds?: any; + redshift?: any; + route53?: any; + route53domains?: any; + s3?: any; + ses?: any; + simpledb?: any; + sns?: any; + sqs?: any; + storagegateway?: any; + sts?: any; + support?: any; + swf?: any; + } + + export interface ClientConfig extends ClientConfigPartial { + update?: (options: ClientConfigPartial, allUnknownKeys?: boolean) => void; + getCredentials?: (callback: (err?: any) => void) => void ; + loadFromPath?: (path: string) => void; credentials: Credentials; region: string; } From 2fc9b9ac8cd93faeea5b487032e21c386377c6e2 Mon Sep 17 00:00:00 2001 From: Brian Geppert Date: Wed, 12 Nov 2014 02:21:57 -0600 Subject: [PATCH 085/292] aws-sdk: added support for apiVersion/apiVersions config options. --- aws-sdk/aws-sdk.d.ts | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/aws-sdk/aws-sdk.d.ts b/aws-sdk/aws-sdk.d.ts index ff9a7b1a70..3a500bbbb4 100644 --- a/aws-sdk/aws-sdk.d.ts +++ b/aws-sdk/aws-sdk.d.ts @@ -31,19 +31,7 @@ declare module "aws-sdk" { xhrWithCredentials?: boolean; } - export interface ClientConfigPartial { - credentials?: Credentials; - region?: string; - computeChecksums?: boolean; - convertResponseTypes?: boolean; - logger?: Logger; - maxRedirects?: number; - maxRetries?: number; - paramValidation?: boolean; - s3ForcePathStyle?: boolean; - signatureVersion?: string; - sslEnabled?: boolean; - systemClockOffset?: number; + export interface Services { autoscaling?: any; cloudformation?: any; cloudfront?: any; @@ -84,6 +72,23 @@ declare module "aws-sdk" { swf?: any; } + export interface ClientConfigPartial extends Services { + credentials?: Credentials; + region?: string; + computeChecksums?: boolean; + convertResponseTypes?: boolean; + logger?: Logger; + maxRedirects?: number; + maxRetries?: number; + paramValidation?: boolean; + s3ForcePathStyle?: boolean; + apiVersion?: any; + apiVersions?: Services; + signatureVersion?: string; + sslEnabled?: boolean; + systemClockOffset?: number; + } + export interface ClientConfig extends ClientConfigPartial { update?: (options: ClientConfigPartial, allUnknownKeys?: boolean) => void; getCredentials?: (callback: (err?: any) => void) => void ; From a3b4851dfce1ae035e0e57b18673f4cd65f25b1e Mon Sep 17 00:00:00 2001 From: Martin Poelstra Date: Wed, 12 Nov 2014 11:19:15 +0100 Subject: [PATCH 086/292] Update Bluebird typings to 2.x and fix some issues: - 'Old' typings moved to "-1.0" version - Not all v2 methods are added yet - Promise also implements Inspection - .finally() doesn't get the value in its callback - .done() returns void, not a Promise - Add .tap() and .setScheduler() - Add error types for use in e.g. catch()'ing specific errors - Inspection.error() renamed to .reason() --- bluebird/bluebird-1.0-tests.ts | 882 +++++++++++++++++++++++++++++++++ bluebird/bluebird-1.0.d.ts | 670 +++++++++++++++++++++++++ bluebird/bluebird-tests.ts | 73 +-- bluebird/bluebird.d.ts | 64 ++- 4 files changed, 1648 insertions(+), 41 deletions(-) create mode 100644 bluebird/bluebird-1.0-tests.ts create mode 100644 bluebird/bluebird-1.0.d.ts diff --git a/bluebird/bluebird-1.0-tests.ts b/bluebird/bluebird-1.0-tests.ts new file mode 100644 index 0000000000..f04317f6ae --- /dev/null +++ b/bluebird/bluebird-1.0-tests.ts @@ -0,0 +1,882 @@ +/// + +// Tests by: Bart van der Schoor + +// Note: replicate changes to all overloads in both definition and test file +// Note: keep both static and instance members inline (so similar) + +// Note: try to maintain the ordering and separators, and keep to the pattern + +var obj: Object; +var bool: boolean; +var num: number; +var str: string; +var err: Error; +var x: any; +var f: Function; +var func: Function; +var arr: any[]; +var exp: RegExp; +var anyArr: any[]; +var strArr: string[]; +var numArr: number[]; + +// - - - - - - - - - - - - - - - - - + +var value: any; +var reason: any; +var insanity: any; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +interface Foo { + foo(): string; +} +interface Bar { + bar(): string; +} + +// - - - - - - - - - - - - - - - - - + +interface StrFooMap { + [key:string]:Foo; +} + +interface StrBarMap { + [key:string]:Bar; +} + +// - - - - - - - - - - - - - - - - - + +interface StrFooArrMap { + [key:string]:Foo[]; +} + +interface StrBarArrMap { + [key:string]:Bar[]; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +var foo: Foo; +var bar: Bar; + +var fooArr: Foo[]; +var barArr: Bar[]; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +var numProm: Promise; +var strProm: Promise; +var anyProm: Promise; +var boolProm: Promise; +var objProm: Promise; +var voidProm: Promise; + +var fooProm: Promise; +var barProm: Promise; + +// - - - - - - - - - - - - - - - - - + +var numThen: Promise.Thenable; +var strThen: Promise.Thenable; +var anyThen: Promise.Thenable; +var boolThen: Promise.Thenable; +var objThen: Promise.Thenable; +var voidThen: Promise.Thenable; + +var fooThen: Promise.Thenable; +var barThen: Promise.Thenable; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +var numArrProm: Promise; +var strArrProm: Promise; +var anyArrProm: Promise; + +var fooArrProm: Promise; +var barArrProm: Promise; + +// - - - - - - - - - - - - - - - - - + +var numArrThen: Promise.Thenable; +var strArrThen: Promise.Thenable; +var anyArrThen: Promise.Thenable; + +var fooArrThen: Promise.Thenable; +var barArrThen: Promise.Thenable; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +var numPromArr: Promise[]; +var strPromArr: Promise[]; +var anyPromArr: Promise[]; + +var fooPromArr: Promise[]; +var barPromArr: Promise[]; + +// - - - - - - - - - - - - - - - - - + +var numThenArr: Promise.Thenable[]; +var strThenArr: Promise.Thenable[]; +var anyThenArr: Promise.Thenable[]; + +var fooThenArr: Promise.Thenable[]; +var barThenArr: Promise.Thenable[]; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// booya! +var fooThenArrThen: Promise.Thenable[]>; +var barThenArrThen: Promise.Thenable[]>; + +var fooResolver: Promise.Resolver; +var barResolver: Promise.Resolver; + +var fooInspection: Promise.Inspection; +var barInspection: Promise.Inspection; + +var fooInspectionArrProm: Promise[]>; +var barInspectionArrProm: Promise[]>; + +var BlueBird: typeof Promise; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooThen = fooProm; +barThen = barProm; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = new Promise((resolve: (value: Foo) => void, reject: (reason: any) => void) => { + if (bool) { + resolve(foo); + } + else { + reject(new Error(str)); + } +}); +fooProm = new Promise((resolve: (value: Foo) => void) => { + if (bool) { + resolve(foo); + } +}); + +// - - - - - - - - - - - - - - - - - - - - - - - + +// needs a hint when used untyped? +fooProm = new Promise((resolve, reject) => { + if (bool) { + resolve(fooThen); + } + else { + reject(new Error(str)); + } +}); +fooProm = new Promise((resolve) => { + resolve(fooThen); +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooResolver.resolve(foo); + +fooResolver.reject(err); + +fooResolver.progress(bar); + +fooResolver.callback = (err: any, value: Foo) => { + +}; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +bool = fooInspection.isFulfilled(); + +bool = fooInspection.isRejected(); + +bool = fooInspection.isPending(); + +foo = fooInspection.value(); + +x = fooInspection.error(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.then((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}, (note: any) => { + return bar; +}); +barProm = fooProm.then((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}); +barProm = fooProm.then((value: Foo) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.catch((reason: any) => { + return bar; +}); +barProm = fooProm.caught((reason: any) => { + return bar; +}); + +barProm = fooProm.catch((reason: any) => { + return bar; +}, (reason: any) => { + return bar; +}); +barProm = fooProm.caught((reason: any) => { + return bar; +}, (reason: any) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.catch(Error, (reason: any) => { + return bar; +}); +barProm = fooProm.caught(Error, (reason: any) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.error((reason: any) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.finally((value: Foo) => { + // return is ignored + return foo; +}); +fooProm = fooProm.finally((value: Foo) => { + // return is ignored + return fooThen; +}); +fooProm = fooProm.finally((value: Foo) => { + // return is ignored +}); +fooProm = fooProm.finally(() => { + // return is ignored +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.lastly((value: Foo) => { + // return is ignored + return foo; +}); +fooProm = fooProm.lastly((value: Foo) => { + // return is ignored + return fooThen; +}); +fooProm = fooProm.lastly((value: Foo) => { + // return is ignored +}); +fooProm = fooProm.lastly(() => { + // return is ignored +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.bind(obj); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.done((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}, (note: any) => { + +}); +barProm = fooProm.done((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}); +barProm = fooProm.done((value: Foo) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.done((value: Foo) => { + return barThen; +}, (reason: any) => { + return barThen; +}, (note: any) => { + +}); +barProm = fooProm.done((value: Foo) => { + return barThen; +}, (reason: any) => { + return barThen; +}); +barProm = fooProm.done((value: Foo) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.progressed((note: any) => { + return foo; +}); +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.delay(num); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.timeout(num); +fooProm = fooProm.timeout(num, str); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm.nodeify(); +fooProm = fooProm.nodeify((err: any) => { + +}); +fooProm = fooProm.nodeify((err: any, foo?: Foo) => { + +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.fork((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}, (note: any) => { + +}); +barProm = fooProm.fork((value: Foo) => { + return bar; +}, (reason: any) => { + return bar; +}); +barProm = fooProm.fork((value: Foo) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.fork((value: Foo) => { + return barThen; +}, (reason: any) => { + return barThen; +}, (note: any) => { + +}); +barProm = fooProm.fork((value: Foo) => { + return barThen; +}, (reason: any) => { + return barThen; +}); +barProm = fooProm.fork((value: Foo) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.cancel(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.cancellable(); +fooProm = fooProm.uncancellable(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +bool = fooProm.isCancellable(); +bool = fooProm.isFulfilled(); +bool = fooProm.isRejected(); +bool = fooProm.isPending(); +bool = fooProm.isResolved(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooInspection = fooProm.inspect(); + +anyProm = fooProm.call(str); +anyProm = fooProm.call(str, 1, 2, 3); + +//TODO enable get() test when implemented +// barProm = fooProm.get(str); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.return(bar); +barProm = fooProm.thenReturn(bar); + +voidProm = fooProm.return(); +voidProm = fooProm.thenReturn(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooProm +fooProm = fooProm.throw(err); +fooProm = fooProm.thenThrow(err); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +str = fooProm.toString(); + +obj = fooProm.toJSON(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooArrProm.spread((one: Foo, two: Bar) => { + return bar; +}, (reason: any) => { + return bar; +}); +barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - + +barProm = fooArrProm.spread((one: Foo, two: Bar) => { + return barThen; +}, (reason: any) => { + return barThen; +}); +barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO fix collection inference + +barArrProm = fooProm.all(); + +objProm = fooProm.props(); + +barInspectionArrProm = fooProm.settle(); + +barProm = fooProm.any(); + +barArrProm = fooProm.some(num); + +barProm = fooProm.race(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO fix collection inference + +barArrProm = fooProm.map((item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = fooProm.map((item: Foo) => { + return bar; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +barProm = fooProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { + return memo; +}); +barProm = fooProm.reduce((memo: Bar, item: Foo) => { + return memo; +}, bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooArrProm = fooArrProm.filter((item: Foo, index: number, arrayLength: number) => { + return bool; +}); +fooArrProm = fooArrProm.filter((item: Foo) => { + return bool; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +fooProm = Promise.try(() => { + return foo; +}); +fooProm = Promise.try(() => { + return foo; +}, arr); +fooProm = Promise.try(() => { + return foo; +}, arr, x); + +// - - - - - - - - - - - - - - - - - + +fooProm = Promise.try(() => { + return fooThen; +}); +fooProm = Promise.try(() => { + return fooThen; +}, arr); +fooProm = Promise.try(() => { + return fooThen; +}, arr, x); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = Promise.attempt(() => { + return foo; +}); +fooProm = Promise.attempt(() => { + return foo; +}, arr); +fooProm = Promise.attempt(() => { + return foo; +}, arr, x); + +// - - - - - - - - - - - - - - - - - + +fooProm = Promise.attempt(() => { + return fooThen; +}); +fooProm = Promise.attempt(() => { + return fooThen; +}, arr); +fooProm = Promise.attempt(() => { + return fooThen; +}, arr, x); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +func = Promise.method(function () { + +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = Promise.resolve(foo); +fooProm = Promise.resolve(fooThen); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +voidProm = Promise.reject(reason); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooResolver = Promise.defer(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = Promise.cast(foo); +fooProm = Promise.cast(fooThen); + +voidProm = Promise.bind(x); + +bool = Promise.is(value); + +Promise.longStackTraces(); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO enable delay + +fooProm = Promise.delay(fooThen, num); +fooProm = Promise.delay(foo, num); +voidProm = Promise.delay(num); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +func = Promise.promisify(f); +func = Promise.promisify(f, obj); +; + +obj = Promise.promisifyAll(obj); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO enable generator +/* + func = Promise.coroutine(f); + + barProm = Promise.spawn(f); + */ +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +BlueBird = Promise.noConflict(); + +Promise.onPossiblyUnhandledRejection((reason: any) => { + +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO expand tests to overloads +fooArrProm = Promise.all(fooThenArrThen); +fooArrProm = Promise.all(fooArrProm); +fooArrProm = Promise.all(fooThenArr); +fooArrProm = Promise.all(fooArr); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +objProm = Promise.props(objProm); +objProm = Promise.props(obj); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO expand tests to overloads +fooInspectionArrProm = Promise.settle(fooThenArrThen); +fooInspectionArrProm = Promise.settle(fooArrProm); +fooInspectionArrProm = Promise.settle(fooThenArr); +fooInspectionArrProm = Promise.settle(fooArr); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO expand tests to overloads +fooProm = Promise.any(fooThenArrThen); +fooProm = Promise.any(fooArrProm); +fooProm = Promise.any(fooThenArr); +fooProm = Promise.any(fooArr); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO expand tests to overloads +fooProm = Promise.race(fooThenArrThen); +fooProm = Promise.race(fooArrProm); +fooProm = Promise.race(fooThenArr); +fooProm = Promise.race(fooArr); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +//TODO expand tests to overloads +fooArrProm = Promise.some(fooThenArrThen, num); +fooArrProm = Promise.some(fooArrThen, num); +fooArrProm = Promise.some(fooThenArr, num); +fooArrProm = Promise.some(fooArr, num); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooArrProm = Promise.join(foo, foo, foo); +fooArrProm = Promise.join(fooThen, fooThen, fooThen); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// map() + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArrThen + +barArrProm = Promise.map(fooThenArrThen, (item: Foo) => { + return bar; +}); +barArrProm = Promise.map(fooThenArrThen, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.map(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.map(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArrThen + +barArrProm = Promise.map(fooArrThen, (item: Foo) => { + return bar; +}); +barArrProm = Promise.map(fooArrThen, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.map(fooArrThen, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.map(fooArrThen, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArr + +barArrProm = Promise.map(fooThenArr, (item: Foo) => { + return bar; +}); +barArrProm = Promise.map(fooThenArr, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.map(fooThenArr, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.map(fooThenArr, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArr + +barArrProm = Promise.map(fooArr, (item: Foo) => { + return bar; +}); +barArrProm = Promise.map(fooArr, (item: Foo) => { + return barThen; +}); +barArrProm = Promise.map(fooArr, (item: Foo, index: number, arrayLength: number) => { + return bar; +}); +barArrProm = Promise.map(fooArr, (item: Foo, index: number, arrayLength: number) => { + return barThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// reduce() + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArrThen + +barProm = Promise.reduce(fooThenArrThen, (memo: Bar, item: Foo) => { + return memo; +}, bar); +barProm = Promise.reduce(fooThenArrThen, (memo: Bar, item: Foo) => { + return barThen; +}, bar); +barProm = Promise.reduce(fooThenArrThen, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return memo; +}, bar); +barProm = Promise.reduce(fooThenArrThen, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return barThen; +}, bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArrThen + +barProm = Promise.reduce(fooArrThen, (memo: Bar, item: Foo) => { + return memo; +}, bar); +barProm = Promise.reduce(fooArrThen, (memo: Bar, item: Foo) => { + return barThen; +}, bar); +barProm = Promise.reduce(fooArrThen, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return memo; +}, bar); +barProm = Promise.reduce(fooArrThen, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return barThen; +}, bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArr + +barProm = Promise.reduce(fooThenArr, (memo: Bar, item: Foo) => { + return memo; +}, bar); +barProm = Promise.reduce(fooThenArr, (memo: Bar, item: Foo) => { + return barThen; +}, bar); +barProm = Promise.reduce(fooThenArr, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return memo; +}, bar); +barProm = Promise.reduce(fooThenArr, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return barThen; +}, bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArr + +barProm = Promise.reduce(fooArr, (memo: Bar, item: Foo) => { + return memo; +}, bar); +barProm = Promise.reduce(fooArr, (memo: Bar, item: Foo) => { + return barThen; +}, bar); +barProm = Promise.reduce(fooArr, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return memo; +}, bar); +barProm = Promise.reduce(fooArr, (memo: Bar, item: Foo, index: number, arrayLength: number) => { + return barThen; +}, bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// filter() + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArrThen + +fooArrProm = Promise.filter(fooThenArrThen, (item: Foo) => { + return bool; +}); +fooArrProm = Promise.filter(fooThenArrThen, (item: Foo) => { + return boolThen; +}); +fooArrProm = Promise.filter(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => { + return bool; +}); +fooArrProm = Promise.filter(fooThenArrThen, (item: Foo, index: number, arrayLength: number) => { + return boolThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArrThen + +fooArrProm = Promise.filter(fooArrThen, (item: Foo) => { + return bool; +}); +fooArrProm = Promise.filter(fooArrThen, (item: Foo) => { + return boolThen; +}); +fooArrProm = Promise.filter(fooArrThen, (item: Foo, index: number, arrayLength: number) => { + return bool; +}); +fooArrProm = Promise.filter(fooArrThen, (item: Foo, index: number, arrayLength: number) => { + return boolThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooThenArr + +fooArrProm = Promise.filter(fooThenArr, (item: Foo) => { + return bool; +}); +fooArrProm = Promise.filter(fooThenArr, (item: Foo) => { + return boolThen; +}); +fooArrProm = Promise.filter(fooThenArr, (item: Foo, index: number, arrayLength: number) => { + return bool; +}); +fooArrProm = Promise.filter(fooThenArr, (item: Foo, index: number, arrayLength: number) => { + return boolThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooArr + +fooArrProm = Promise.filter(fooArr, (item: Foo) => { + return bool; +}); +fooArrProm = Promise.filter(fooArr, (item: Foo) => { + return boolThen; +}); +fooArrProm = Promise.filter(fooArr, (item: Foo, index: number, arrayLength: number) => { + return bool; +}); +fooArrProm = Promise.filter(fooArr, (item: Foo, index: number, arrayLength: number) => { + return boolThen; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bluebird/bluebird-1.0.d.ts b/bluebird/bluebird-1.0.d.ts new file mode 100644 index 0000000000..210032f864 --- /dev/null +++ b/bluebird/bluebird-1.0.d.ts @@ -0,0 +1,670 @@ +// Type definitions for bluebird 1.0.0 +// Project: https://github.com/petkaantonov/bluebird +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// ES6 model with generics overload was sourced and trans-multiplied from es6-promises.d.ts +// By: Campredon + +// Warning: recommended to use `tsc > v0.9.7` (critical bugs in earlier generic code): +// - https://github.com/borisyankov/DefinitelyTyped/issues/1563 + +// Note: replicate changes to all overloads in both definition and test file +// Note: keep both static and instance members inline (so similar) + +// TODO fix remaining TODO annotations in both definition and test + +// TODO verify support to have no return statement in handlers to get a Promise (more overloads?) + +declare class Promise implements Promise.Thenable { + /** + * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. + */ + constructor(callback: (resolve: (thenable: Promise.Thenable) => void, reject: (error: any) => void) => void); + constructor(callback: (resolve: (result: R) => void, reject: (error: any) => void) => void); + + /** + * Promises/A+ `.then()` with progress handler. 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) => Promise.Thenable, onReject: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + then(onFulfill: (value: R) => Promise.Thenable, onReject?: (error: any) => U, onProgress?: (note: any) => any): Promise; + then(onFulfill: (value: R) => U, onReject: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + then(onFulfill?: (value: R) => U, onReject?: (error: any) => U, onProgress?: (note: any) => any): Promise; + + /** + * 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. + * + * Alias `.caught();` for compatibility with earlier ECMAScript version. + */ + catch(onReject?: (error: any) => Promise.Thenable): Promise; + caught(onReject?: (error: any) => Promise.Thenable): Promise; + + catch(onReject?: (error: any) => U): Promise; + caught(onReject?: (error: any) => U): Promise; + + /** + * This extends `.catch` to work more like catch-clauses in languages like Java or C#. Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler. The catch handler that is first met that has eligible constructors specified, is the one that will be called. + * + * This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. The return result of the predicate will be used determine whether the error handler should be called. + * + * Alias `.caught();` for compatibility with earlier ECMAScript version. + */ + catch(predicate: (error: any) => boolean, onReject: (error: any) => Promise.Thenable): Promise; + caught(predicate: (error: any) => boolean, onReject: (error: any) => Promise.Thenable): Promise; + + catch(predicate: (error: any) => boolean, onReject: (error: any) => U): Promise; + caught(predicate: (error: any) => boolean, onReject: (error: any) => U): Promise; + + catch(ErrorClass: Function, onReject: (error: any) => Promise.Thenable): Promise; + caught(ErrorClass: Function, onReject: (error: any) => Promise.Thenable): Promise; + + catch(ErrorClass: Function, onReject: (error: any) => U): Promise; + caught(ErrorClass: Function, onReject: (error: any) => U): Promise; + + /** + * Like `.catch` but instead of catching all types of exceptions, it only catches those that don't originate from thrown errors but rather from explicit rejections. + */ + error(onReject: (reason: any) => Promise.Thenable): Promise; + error(onReject: (reason: any) => U): Promise; + + /** + * Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. There are special semantics for `.finally()` in that the final value cannot be modified from the handler. + * + * Alias `.lastly();` for compatibility with earlier ECMAScript version. + */ + finally(handler: (value: R) => Promise.Thenable): Promise; + finally(handler: (value: R) => R): Promise; + finally(handler: (value: R) => void): Promise; + + lastly(handler: (value: R) => Promise.Thenable): Promise; + lastly(handler: (value: R) => R): Promise; + lastly(handler: (value: R) => void): Promise; + + /** + * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. + */ + bind(thisArg: any): Promise; + + /** + * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. + */ + done(onFulfilled: (value: R) => Promise.Thenable, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + done(onFulfilled: (value: R) => Promise.Thenable, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + done(onFulfilled: (value: R) => U, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + done(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + + /** + * Shorthand for `.then(null, null, handler);`. Attach a progress handler that will be called if this promise is progressed. Returns a new promise chained from this promise. + */ + progressed(handler: (note: any) => any): Promise; + + /** + * Same as calling `Promise.delay(this, ms)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + delay(ms: number): Promise; + + /** + * Returns a promise that will be fulfilled with this promise's fulfillment value or rejection reason. However, if this promise is not fulfilled or rejected within `ms` milliseconds, the returned promise is rejected with a `Promise.TimeoutError` instance. + * + * You may specify a custom error message with the `message` parameter. + */ + timeout(ms: number, message?: string): Promise; + + /** + * Register a node-style callback on this promise. When this promise is is either fulfilled or rejected, the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. The error argument will be `null` in case of success. + * Returns back this promise instead of creating a new one. If the `callback` argument is not a function, this method does not do anything. + */ + nodeify(callback: (err: any, value?: R) => void): Promise; + nodeify(...sink: any[]): void; + + /** + * Marks this promise as cancellable. Promises by default are not cancellable after v0.11 and must be marked as such for `.cancel()` to have any effect. Marking a promise as cancellable is infectious and you don't need to remark any descendant promise. + */ + cancellable(): Promise; + + /** + * Cancel this promise. The cancellation will propagate to farthest cancellable ancestor promise which is still pending. + * + * That ancestor will then be rejected with a `CancellationError` (get a reference from `Promise.CancellationError`) object as the rejection reason. + * + * In a promise rejection handler you may check for a cancellation by seeing if the reason object has `.name === "Cancel"`. + * + * Promises are by default not cancellable. Use `.cancellable()` to mark a promise as cancellable. + */ + // TODO what to do with this? + cancel(): Promise; + + /** + * Like `.then()`, but cancellation of the the returned promise or any of its descendant will not propagate cancellation to this promise or this promise's ancestors. + */ + fork(onFulfilled: (value: R) => Promise.Thenable, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + fork(onFulfilled: (value: R) => Promise.Thenable, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + fork(onFulfilled: (value: R) => U, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + fork(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + + /** + * Create an uncancellable promise based on this promise. + */ + uncancellable(): Promise; + + /** + * See if this promise can be cancelled. + */ + isCancellable(): boolean; + + /** + * See if this `promise` has been fulfilled. + */ + isFulfilled(): boolean; + + /** + * See if this `promise` has been rejected. + */ + isRejected(): boolean; + + /** + * See if this `promise` is still defer. + */ + isPending(): boolean; + + /** + * See if this `promise` is resolved -> either fulfilled or rejected. + */ + isResolved(): boolean; + + /** + * Synchronously inspect the state of this `promise`. The `PromiseInspection` will represent the state of the promise as snapshotted at the time of calling `.inspect()`. + */ + inspect(): Promise.Inspection; + + /** + * This is a convenience method for doing: + * + * + * promise.then(function(obj){ + * return obj[propertyName].call(obj, arg...); + * }); + * + */ + call(propertyName: string, ...args: any[]): Promise; + + /** + * This is a convenience method for doing: + * + * + * promise.then(function(obj){ + * return obj[propertyName]; + * }); + * + */ + // TODO find way to fix get() + // get(propertyName: string): Promise; + + /** + * Convenience method for: + * + * + * .then(function() { + * return value; + * }); + * + * + * in the case where `value` doesn't change its value. That means `value` is bound at the time of calling `.return()` + * + * Alias `.thenReturn();` for compatibility with earlier ECMAScript version. + */ + return(): Promise; + thenReturn(): Promise; + return(value: U): Promise; + thenReturn(value: U): Promise; + + /** + * Convenience method for: + * + * + * .then(function() { + * throw reason; + * }); + * + * Same limitations apply as with `.return()`. + * + * Alias `.thenThrow();` for compatibility with earlier ECMAScript version. + */ + throw(reason: Error): Promise; + thenThrow(reason: Error): Promise; + + /** + * Convert to String. + */ + toString(): string; + + /** + * This is implicitly called by `JSON.stringify` when serializing the object. Returns a serialized representation of the `Promise`. + */ + toJSON(): Object; + + /** + * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. + */ + // TODO how to model instance.spread()? like Q? + spread(onFulfill: Function, onReject?: (reason: any) => Promise.Thenable): Promise; + spread(onFulfill: Function, onReject?: (reason: any) => U): Promise; + /* + // TODO or something like this? + spread(onFulfill: (...values: W[]) => Promise.Thenable, onReject?: (reason: any) => Promise.Thenable): Promise; + spread(onFulfill: (...values: W[]) => Promise.Thenable, onReject?: (reason: any) => U): Promise; + spread(onFulfill: (...values: W[]) => U, onReject?: (reason: any) => Promise.Thenable): Promise; + spread(onFulfill: (...values: W[]) => U, onReject?: (reason: any) => U): Promise; + */ + /** + * Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + all(): Promise; + + /** + * Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO how to model instance.props()? + props(): Promise; + + /** + * Same as calling `Promise.settle(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + settle(): Promise[]>; + + /** + * Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + any(): Promise; + + /** + * Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + some(count: number): Promise; + + /** + * Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + race(): Promise; + + /** + * Same as calling `Promise.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + map(mapper: (item: Q, index: number, arrayLength: number) => Promise.Thenable): Promise; + map(mapper: (item: Q, index: number, arrayLength: number) => U): Promise; + + /** + * Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; + reduce(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U, initialValue?: U): Promise; + + /** + * Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too. + */ + // TODO type inference from array-resolving promise? + filter(filterer: (item: U, index: number, arrayLength: number) => Promise.Thenable): Promise; + filter(filterer: (item: U, index: number, arrayLength: number) => boolean): Promise; + + /** + * Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise. + * + * Note about second argument: if it's specifically a true array, its values become respective arguments for the function call. Otherwise it is passed as is as the first argument for the function call. + * + * Alias for `attempt();` for compatibility with earlier ECMAScript version. + */ + static try(fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; + static try(fn: () => R, args?: any[], ctx?: any): Promise; + + static attempt(fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; + static attempt(fn: () => R, args?: any[], ctx?: any): Promise; + + /** + * Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. + * This method is convenient when a function can sometimes return synchronously or throw synchronously. + */ + static method(fn: Function): Function; + + /** + * Create a promise that is resolved with the given `value`. If `value` is a thenable or promise, the returned promise will assume its state. + */ + static resolve(): Promise; + static resolve(value: Promise.Thenable): Promise; + static resolve(value: R): Promise; + + /** + * Create a promise that is rejected with the given `reason`. + */ + static reject(reason: any): Promise; + static reject(reason: any): Promise; + + /** + * Create a promise with undecided fate and return a `PromiseResolver` to control it. See resolution?: Promise(#promise-resolution). + */ + static defer(): Promise.Resolver; + + /** + * Cast the given `value` to a trusted promise. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. + */ + static cast(value: Promise.Thenable): Promise; + static cast(value: R): Promise; + + /** + * Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`. + */ + static bind(thisArg: any): Promise; + + /** + * See if `value` is a trusted Promise. + */ + static is(value: any): boolean; + + /** + * Call this right after the library is loaded to enabled long stack traces. Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have alread been created. Long stack traces imply a substantial performance penalty, around 4-5x for throughput and 0.5x for latency. + */ + static longStackTraces(): void; + + /** + * Returns a promise that will be fulfilled with `value` (or `undefined`) after given `ms` milliseconds. If `value` is a promise, the delay will start counting down when it is fulfilled and the returned promise will be fulfilled with the fulfillment value of the `value` promise. + */ + // TODO enable more overloads + static delay(value: Promise.Thenable, ms: number): Promise; + static delay(value: R, ms: number): Promise; + static delay(ms: number): Promise; + + /** + * Returns a function that will wrap the given `nodeFunction`. Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. The node function should conform to node.js convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument. + * + * If the `nodeFunction` calls its callback with multiple success values, the fulfillment value will be an array of them. + * + * If you pass a `receiver`, the `nodeFunction` will be called as a method on the `receiver`. + */ + // TODO how to model promisify? + static promisify(nodeFunction: Function, receiver?: any): Function; + + /** + * Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain. The promisified method name will be the original method name postfixed with `Async`. Returns the input object. + * + * Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method. + */ + // TODO how to model promisifyAll? + static promisifyAll(target: Object): Object; + + /** + * Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. + */ + // TODO fix coroutine GeneratorFunction + static coroutine(generatorFunction: Function): Function; + + /** + * Spawn a coroutine which may yield promises to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. + */ + // TODO fix spawn GeneratorFunction + static spawn(generatorFunction: Function): Promise; + + /** + * This is relevant to browser environments with no module loader. + * + * Release control of the `Promise` namespace to whatever it was before this library was loaded. Returns a reference to the library namespace so you can attach it to something else. + */ + static noConflict(): typeof Promise; + + /** + * Add `handler` as the handler to call when there is a possibly unhandled rejection. The default handler logs the error stack to stderr or `console.error` in browsers. + * + * Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections. + */ + static onPossiblyUnhandledRejection(handler: (reason: any) => any): void; + + /** + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled. The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. If any promise in the array rejects, the returned promise is rejected with the rejection reason. + */ + // TODO enable more overloads + // promise of array with promises of value + static all(values: Promise.Thenable[]>): Promise; + // promise of array with values + static all(values: Promise.Thenable): Promise; + // array with promises of value + static all(values: Promise.Thenable[]): Promise; + // array with values + static all(values: R[]): Promise; + + /** + * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. If any promise in the object rejects, the returned promise is rejected with the rejection reason. + * + * If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties. All other objects are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties. + * + * *The original object is not modified.* + */ + // TODO verify this is correct + // trusted promise for object + static props(object: Promise): Promise; + // object + static props(object: Object): Promise; + + /** + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are either fulfilled or rejected. The fulfillment value is an array of ``PromiseInspection`` instances at respective positions in relation to the input array. + * + * *original: The array is not modified. The input array sparsity is retained in the resulting array.* + */ + // promise of array with promises of value + static settle(values: Promise.Thenable[]>): Promise[]>; + // promise of array with values + static settle(values: Promise.Thenable): Promise[]>; + // array with promises of value + static settle(values: Promise.Thenable[]): Promise[]>; + // array with values + static settle(values: R[]): Promise[]>; + + /** + * Like `Promise.some()`, with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly. + */ + // promise of array with promises of value + static any(values: Promise.Thenable[]>): Promise; + // promise of array with values + static any(values: Promise.Thenable): Promise; + // array with promises of value + static any(values: Promise.Thenable[]): Promise; + // array with values + static any(values: R[]): Promise; + + /** + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. + * + * **Note** If you pass empty array or a sparse array with no values, or a promise/thenable for such, it will be forever pending. + */ + // promise of array with promises of value + static race(values: Promise.Thenable[]>): Promise; + // promise of array with values + static race(values: Promise.Thenable): Promise; + // array with promises of value + static race(values: Promise.Thenable[]): Promise; + // array with values + static race(values: R[]): Promise; + + /** + * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. + * + * If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in. + * + * *The original array is not modified.* + */ + // promise of array with promises of value + static some(values: Promise.Thenable[]>, count: number): Promise; + // promise of array with values + static some(values: Promise.Thenable, count: number): Promise; + // array with promises of value + static some(values: Promise.Thenable[], count: number): Promise; + // array with values + static some(values: R[], count: number): Promise; + + /** + * Like `Promise.all()` but instead of having to pass an array, the array is generated from the passed variadic arguments. + */ + // variadic array with promises of value + static join(...values: Promise.Thenable[]): Promise; + // variadic array with values + static join(...values: R[]): Promise; + + /** + * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * + * If the `mapper` function returns promises or thenables, the returned promise will wait for all the mapped results to be resolved as well. + * + * *The original array is not modified.* + */ + // promise of array with promises of value + static map(values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static map(values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; + + // promise of array with values + static map(values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static map(values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; + + // array with promises of value + static map(values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static map(values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; + + // array with values + static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; + + /** + * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * + * If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. + * + * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* + */ + // promise of array with promises of value + static reduce(values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; + static reduce(values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + + // promise of array with values + static reduce(values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; + static reduce(values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + + // array with promises of value + static reduce(values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; + static reduce(values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + + // array with values + static reduce(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; + static reduce(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; + + /** + * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * + * The return values from the filtered functions are coerced to booleans, with the exception of promises and thenables which are awaited for their eventual result. + * + * *The original array is not modified. + */ + // promise of array with promises of value + static filter(values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static filter(values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; + + // promise of array with values + static filter(values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static filter(values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; + + // array with promises of value + static filter(values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static filter(values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; + + // array with values + static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; + static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; +} + +declare module Promise { + export interface RangeError extends Error { + } + export interface CancellationError extends Error { + } + export interface TimeoutError extends Error { + } + export interface TypeError extends Error { + } + export interface RejectionError extends Error { + } + + export interface Thenable { + then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; + then(onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; + then(onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Thenable; + then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; + } + + export interface Resolver { + /** + * Returns a reference to the controlled promise that can be passed to clients. + */ + promise: Promise; + + /** + * Resolve the underlying promise with `value` as the resolution value. If `value` is a thenable or a promise, the underlying promise will assume its state. + */ + resolve(value: R): void; + resolve(): void; + + /** + * Reject the underlying promise with `reason` as the rejection reason. + */ + reject(reason: any): void; + + /** + * Progress the underlying promise with `value` as the progression value. + */ + progress(value: any): void; + + /** + * Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. + * + * If the the callback is called with multiple success values, the resolver fullfills its promise with an array of the values. + */ + // TODO specify resolver callback + callback: (err: any, value: R, ...values: R[]) => void; + } + + export interface Inspection { + /** + * See if the underlying promise was fulfilled at the creation time of this inspection object. + */ + isFulfilled(): boolean; + + /** + * See if the underlying promise was rejected at the creation time of this inspection object. + */ + isRejected(): boolean; + + /** + * See if the underlying promise was defer at the creation time of this inspection object. + */ + isPending(): boolean; + + /** + * Get the fulfillment value of the underlying promise. Throws if the promise wasn't fulfilled at the creation time of this inspection object. + * + * throws `TypeError` + */ + value(): R; + + /** + * Get the rejection reason for the underlying promise. Throws if the promise wasn't rejected at the creation time of this inspection object. + * + * throws `TypeError` + */ + error(): any; + } +} + +declare module 'bluebird' { + export = Promise; +} diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index 6eb154e83d..65d9a0055d 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -20,6 +20,7 @@ var exp: RegExp; var anyArr: any[]; var strArr: string[]; var numArr: number[]; +var voidVar: void; // - - - - - - - - - - - - - - - - - @@ -199,7 +200,7 @@ bool = fooInspection.isPending(); foo = fooInspection.value(); -x = fooInspection.error(); +x = fooInspection.reason(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -244,9 +245,15 @@ barProm = fooProm.caught((reason: any) => { barProm = fooProm.catch(Error, (reason: any) => { return bar; }); +barProm = fooProm.catch(Promise.CancellationError, (reason: any) => { + return bar; +}); barProm = fooProm.caught(Error, (reason: any) => { return bar; }); +barProm = fooProm.caught(Promise.CancellationError, (reason: any) => { + return bar; +}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -256,36 +263,28 @@ barProm = fooProm.error((reason: any) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooProm = fooProm.finally((value: Foo) => { - // return is ignored - return foo; -}); -fooProm = fooProm.finally((value: Foo) => { - // return is ignored - return fooThen; -}); -fooProm = fooProm.finally((value: Foo) => { - // return is ignored +fooProm = fooProm.finally(() => { + // non-Thenable return is ignored + return "foo"; }); fooProm = fooProm.finally(() => { - // return is ignored + return fooThen; +}); +fooProm = fooProm.finally(() => { + // non-Thenable return is ignored }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooProm = fooProm.lastly((value: Foo) => { - // return is ignored - return foo; -}); -fooProm = fooProm.lastly((value: Foo) => { - // return is ignored - return fooThen; -}); -fooProm = fooProm.lastly((value: Foo) => { - // return is ignored +fooProm = fooProm.lastly(() => { + // non-Thenable return is ignored + return "foo"; }); fooProm = fooProm.lastly(() => { - // return is ignored + return fooThen; +}); +fooProm = fooProm.lastly(() => { + // non-Thenable return is ignored }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -294,40 +293,56 @@ fooProm = fooProm.bind(obj); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return bar; }, (reason: any) => { return bar; }, (note: any) => { }); -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return bar; }, (reason: any) => { return bar; }); -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return bar; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return barThen; }, (reason: any) => { return barThen; }, (note: any) => { }); -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return barThen; }, (reason: any) => { return barThen; }); -barProm = fooProm.done((value: Foo) => { +voidVar = fooProm.done((value: Foo) => { return barThen; }); +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +fooProm = fooProm.tap((value: Foo) => { + // non-Thenable return is ignored + return "foo"; +}); +fooProm = fooProm.tap((value: Foo) => { + return fooThen; +}); +fooProm = fooProm.tap((value: Foo) => { + return voidThen; +}); +fooProm = fooProm.tap(() => { + // non-Thenable return is ignored +}); + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fooProm = fooProm.progressed((note: any) => { diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index 210032f864..f9f081c963 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -16,7 +16,7 @@ // TODO verify support to have no return statement in handlers to get a Promise (more overloads?) -declare class Promise implements Promise.Thenable { +declare class Promise implements Promise.Thenable, Promise.Inspection { /** * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. */ @@ -72,13 +72,11 @@ declare class Promise implements Promise.Thenable { * * Alias `.lastly();` for compatibility with earlier ECMAScript version. */ - finally(handler: (value: R) => Promise.Thenable): Promise; - finally(handler: (value: R) => R): Promise; - finally(handler: (value: R) => void): Promise; + finally(handler: () => Promise.Thenable): Promise; + finally(handler: () => U): Promise; - lastly(handler: (value: R) => Promise.Thenable): Promise; - lastly(handler: (value: R) => R): Promise; - lastly(handler: (value: R) => void): Promise; + lastly(handler: () => Promise.Thenable): Promise; + lastly(handler: () => U): Promise; /** * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. @@ -88,10 +86,16 @@ declare class Promise implements Promise.Thenable { /** * Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error. */ - done(onFulfilled: (value: R) => Promise.Thenable, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - done(onFulfilled: (value: R) => Promise.Thenable, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; - done(onFulfilled: (value: R) => U, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - done(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise; + done(onFulfilled: (value: R) => Promise.Thenable, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): void; + done(onFulfilled: (value: R) => Promise.Thenable, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void; + done(onFulfilled: (value: R) => U, onRejected: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): void; + done(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void; + + /** + * Like `.finally()`, but not called for rejections. + */ + tap(onFulFill: (value: R) => Promise.Thenable): Promise; + tap(onFulfill: (value: R) => U): Promise; /** * Shorthand for `.then(null, null, handler);`. Attach a progress handler that will be called if this promise is progressed. Returns a new promise chained from this promise. @@ -172,6 +176,20 @@ declare class Promise implements Promise.Thenable { */ isResolved(): boolean; + /** + * Get the fulfillment value of the underlying promise. Throws if the promise isn't fulfilled yet. + * + * throws `TypeError` + */ + value(): R; + + /** + * Get the rejection reason for the underlying promise. Throws if the promise isn't rejected yet. + * + * throws `TypeError` + */ + reason(): any; + /** * Synchronously inspect the state of this `promise`. The `PromiseInspection` will represent the state of the promise as snapshotted at the time of calling `.inspect()`. */ @@ -594,6 +612,20 @@ declare module Promise { } export interface RejectionError extends Error { } + export interface OperationalError extends Error { + } + + // Ideally, we'd define e.g. "export class RangeError extends Error {}", + // but as Error is defined as an interface (not a class), TypeScript doesn't + // allow extending Error, only implementing it. + // However, if we want to catch() only a specific error type, we need to pass + // a constructor function to it. So, as a workaround, we define them here as such. + export function RangeError(): RangeError; + export function CancellationError(): CancellationError; + export function TimeoutError(): TimeoutError; + export function TypeError(): TypeError; + export function RejectionError(): RejectionError; + export function OperationalError(): OperationalError; export interface Thenable { then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; @@ -661,8 +693,16 @@ declare module Promise { * * throws `TypeError` */ - error(): any; + reason(): any; } + + /** + * Changes how bluebird schedules calls a-synchronously. + * + * @param scheduler Should be a function that asynchronously schedules + * the calling of the passed in function + */ + export function setScheduler(scheduler: (callback: (...args: any[]) => void) => void): void; } declare module 'bluebird' { From 5ab1bd484034f61fbf688e14eecc28638c36f7ea Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Wed, 12 Nov 2014 08:30:07 -0200 Subject: [PATCH 087/292] squash! squash! update angular to released version 1.3+ interval delay isnt optional --- 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 d28c40e21e..64a9d0652b 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -630,7 +630,7 @@ declare module ng { // see http://docs.angularjs.org/api/ng.$interval /////////////////////////////////////////////////////////////////////////// interface IIntervalService { - (func: Function, delay?: number, count?: number, invokeApply?: boolean): IPromise; + (func: Function, delay: number, count?: number, invokeApply?: boolean): IPromise; cancel(promise: IPromise): boolean; } From f5f114f1e65756500789c0b39dd5d99981bcd8a7 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Wed, 12 Nov 2014 13:07:51 -0500 Subject: [PATCH 088/292] Adding fs.(Read|Write)Stream.close(). It's undocumented, but it is present in the source code and programs rely on it. --- node/node-tests.ts | 1 + node/node.d.ts | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/node/node-tests.ts b/node/node-tests.ts index a8c13f8b0c..7f59ab9859 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -91,6 +91,7 @@ function stream_readable_pipe_test() { var z = zlib.createGzip(); var w = fs.createWriteStream('file.txt.gz'); r.pipe(z).pipe(w); + r.close(); } //////////////////////////////////////////////////// diff --git a/node/node.d.ts b/node/node.d.ts index 7edbdfd609..2405b4408d 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -721,8 +721,8 @@ declare module "net" { setKeepAlive(enable?: boolean, initialDelay?: number): void; address(): { port: number; family: string; address: string; }; unref(): void; - ref(): void; - + ref(): void; + remoteAddress: string; remotePort: number; bytesRead: number; @@ -770,13 +770,13 @@ declare module "dgram" { port: number; size: number; } - + interface AddressInfo { - address: string; - family: string; - port: number; + address: string; + family: string; + port: number; } - + export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; interface Socket extends events.EventEmitter { @@ -823,8 +823,12 @@ declare module "fs" { close(): void; } - export interface ReadStream extends stream.Readable {} - export interface WriteStream extends stream.Writable {} + export interface ReadStream extends stream.Readable { + close(): void; + } + export interface WriteStream extends stream.Writable { + close(): void; + } export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; export function renameSync(oldPath: string, newPath: string): void; From 161a175f8584bb9fb242fde066fcd02afac0c8b4 Mon Sep 17 00:00:00 2001 From: Guido Zuidhof Date: Wed, 12 Nov 2014 20:53:16 +0100 Subject: [PATCH 089/292] Add minilog typings --- CONTRIBUTORS.md | 3 +- minilog/minilog-tests.ts | 63 ++++++++++++++++++++++++++ minilog/minilog.d.ts | 98 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 minilog/minilog-tests.ts create mode 100644 minilog/minilog.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e10ca14d4c..c45542a9f3 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,4 +1,4 @@ -# Contributors +# Contributors This is a non-exhaustive list of definitions and their creators. If you created a definition but are not listed then feel free to send a pull request on this file with your name and url. @@ -280,6 +280,7 @@ All definitions files include a header with the author and editors, so at some p * [md5.js](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) (by [MIZUNE Pine](https://github.com/pine613)) * [Microsoft Ajax](http://msdn.microsoft.com/en-us/library/ee341002(v=vs.100).aspx) (by [Patrick Magee](https://github.com/pjmagee)) * [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk)) +* [minilog](http://mixu.net/minilog/index.html) (by [Guido Zuidhof](https://github.com/Rahazan)) * [Minimatch](https://github.com/isaacs/minimatch) (by [vvakame](https://github.com/vvakame)) * [minimist](https://github.com/substack/minimist) (by [Bart van der Schoor](https://github.com/Bartvds)) * [Mithril](http://lhorie.github.io/mithril) (by [Leo Horie](https://github.com/lhorie) and [Chris Bowdon](https://github.com/cbowdon)) diff --git a/minilog/minilog-tests.ts b/minilog/minilog-tests.ts new file mode 100644 index 0000000000..3a9bb0f4de --- /dev/null +++ b/minilog/minilog-tests.ts @@ -0,0 +1,63 @@ +// Type definitions for minilog v2 +// Project: https://github.com/mixu/minilog +// Definitions by: Guido +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + + +//Following are example snippets from mixu.net/minilog + +var log = Minilog('app'); +Minilog.enable(); + +log + .debug('debug message') + .info('info message') + .warn('warning') + .error('this is an error message'); + +Minilog.pipe(Minilog.backends.console.formatWithStack) + .pipe(Minilog.backends.console); + + +Minilog +// formatter + .pipe(Minilog.backends.console.formatClean) +// backend + .pipe(Minilog.backends.console); + + +Minilog.pipe(Minilog.suggest) // filter + .pipe(Minilog.defaultFormatter) // formatter + .pipe(Minilog.defaultBackend); // backend - e.g. the console + +Minilog.suggest.deny(/mymodule\/.*/, 'warn'); + +Minilog + .suggest + .clear() + .deny('foo', 'warn'); +Minilog.enable(); + +Minilog.suggest.defaultResult = false; +Minilog + .suggest + .clear() + .allow('bar', 'info'); +Minilog.enable(); + + +var myFilter = new Minilog.Filter(); +// allow any logs from the namespace/module "foo", level >= 'info +myFilter.allow('foo', 'debug'); +// deny any logs where the module name matches "bar.*", level < 'warn' +// e.g. only let through "warn" and "error" +myFilter.deny(new RegExp('bar.*', 'warn')); + +// now, create a custom pipe +Minilog.pipe(myFilter) + .pipe(Minilog.defaultFormatter) + .pipe(Minilog.defaultBackend); + + diff --git a/minilog/minilog.d.ts b/minilog/minilog.d.ts new file mode 100644 index 0000000000..d9d1695bf2 --- /dev/null +++ b/minilog/minilog.d.ts @@ -0,0 +1,98 @@ +// Type definitions for minilog v2 +// Project: https://github.com/mixu/minilog +// Definitions by: Guido +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +//These type definitions are not complete, although basic usage should be typed. +interface Minilog { + debug(msg: any): Minilog; + info(msg: any): Minilog; + log(msg: any): Minilog; + warn(msg: any): Minilog; + error(msg: any): Minilog; +} + +declare function Minilog(namespace: string): Minilog; + +declare module Minilog { + export function enable(): Minilog; + export function disable() : Minilog; + export function pipe(dest: any): Transform; + + export var suggest: Filter; + export var backends: Minilog.MinilogBackends; + + export var defaultBackend: any; + export var defaultFormatter: string; + + + export class Filter extends Transform{ + + /** + * Adds an entry to the whitelist + * Returns this filter + */ + allow(name: any, level?: any): Filter; + /** + * Adds an entry to the blacklist + * Returns this filter + */ + deny(name: any, level?: any): Filter; + /** + * Empties the whitelist and blacklist + * Returns this filter + */ + clear(): Filter; + + test(name:any, level:any): boolean; + + /** + * specifies the behavior when a log line doesn't match either the whitelist or the blacklist. + The default is true (= "allow by default") - lines that do not match the whitelist or the blacklist are not filtered (e.g. ). + If you want to flip the default so that lines are filtered unless they are on the whitelist, set this to false (= "deny by default"). + */ + defaultResult: boolean; + + /** + * controls whether the filter is enabled. Default: true + */ + enabled: boolean; + } + + + export interface MinilogBackends { + array: any; + browser: any; + console: Console; + localstorage: any; + jQuery: any; + } + + export class Console extends Transform{ + + /** + * List of available formatters + */ + formatters: string[]; + + //Only available on client + color: Transform; + minilog: Transform; + + //Only available on backend + formatClean: Transform; + formatColor: Transform; + formatNpm: Transform; + formatLearnboost: Transform; + formatMinilog: Transform; + formatWithStack: Transform; + } + + export class Transform { + write(name: any, level: any, args: any): void; + pipe(dest: any): any; + unpipe(from: any): Transform; + mixin(dest: any): void; + } + +} \ No newline at end of file From 5e5b95afa3a32cf7e9a40cc5d4bbe2f0b8a5674c Mon Sep 17 00:00:00 2001 From: MIZUNE Pine Date: Thu, 13 Nov 2014 06:36:43 +0900 Subject: [PATCH 090/292] Add content-type --- content-type/content-type-test.ts | 47 +++++++++++++++++++++++++++++++ content-type/content-type.d.ts | 32 +++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 content-type/content-type-test.ts create mode 100644 content-type/content-type.d.ts diff --git a/content-type/content-type-test.ts b/content-type/content-type-test.ts new file mode 100644 index 0000000000..4bf63e2ab6 --- /dev/null +++ b/content-type/content-type-test.ts @@ -0,0 +1,47 @@ +/// + +import MediaType = require('content-type'); + +// https://github.com/deoxxa/content-type/blob/master/README.md +function new_test(): void { + var p = new MediaType('text/html;level=1;q=0.5'); + p.q === 0.5; + p.params.level === "1"; + + var q = new MediaType('application/json', { profile: 'http://example.com/schema.json' }); + q.type === "application/json"; + q.params.profile === "http://example.com/schema.json"; + + q.q = 1; + q.toString() === 'application/json;q=1;profile="http://example.com/schema.json"'; +} + +function mediaCmp_test(): void { + MediaType.mediaCmp(MediaType.parseMedia('text/html'), MediaType.parseMedia('text/html')) === 0; + MediaType.mediaCmp(MediaType.parseMedia('*/*'), MediaType.parseMedia('text/html')) === 1; + MediaType.mediaCmp(MediaType.parseMedia('text/html;level=1'), MediaType.parseMedia('text/html')) === -1; + MediaType.mediaCmp(MediaType.parseMedia('application/json;profile="v1.json"'), MediaType.parseMedia('application/json;profile="v2.json"')) === null; +} + +// https://github.com/deoxxa/content-type/blob/master/example.js +function example(): void { + var representations = [ + 'application/json', + 'text/html', + 'application/json;profile="schema.json"', + 'application/json;profile="different.json"', + ]; + + var accept = [ + 'text/html;q=0.50', + '*/*;q=0.01', + 'application/json;profile=different.json', + 'application/json;profile="a,b;c.json?d=1;f=2";q=0.2', + ]; + + console.log('Formats:\n\t' + representations.map(MediaType.parseMedia).join('\n\t')); + + console.log('Accept:\n\t' + accept.map(MediaType.parseMedia).join('\n\t')); + + console.log('Selected:', (MediaType.select(representations.map(MediaType.parseMedia), accept.map(MediaType.parseMedia)) || 'None').toString()); +} \ No newline at end of file diff --git a/content-type/content-type.d.ts b/content-type/content-type.d.ts new file mode 100644 index 0000000000..fbca9c96b3 --- /dev/null +++ b/content-type/content-type.d.ts @@ -0,0 +1,32 @@ +// Type definitions for content-type v0.0.1 +// Project: https://github.com/deoxxa/content-type +// Definitions by: Pine Mizune +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module ContentType { + interface MediaType { + type: string; + q?: number; + params: any; + toString(): string; + } + + interface SelectOptions { + sortAvailable?: boolean; + sortAccepted?: boolean; + } + + interface MediaTypeStatic { + new (s: string, p?: any): MediaType; + parseMedia(type: string): MediaType; + splitQuotedString(str: string, delimiter?: string, quote?: string): string[]; + splitContentTypes(str: string): string[]; + select(availableTypes: MediaType[], acceptedTypes: MediaType[], options?: SelectOptions): string; + mediaCmp(a: MediaType, b: MediaType): number; + } +} + +declare module "content-type" { + var x: ContentType.MediaTypeStatic; + export = x; +} \ No newline at end of file From 6e4aec7eea37ca93c7f587403caaf8317c5b3e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Jaro=C5=A1?= Date: Thu, 13 Nov 2014 00:21:12 +0100 Subject: [PATCH 091/292] Added dotdotdot definitions. --- dotdotdot/dotdotdot-tests.ts | 54 +++++++++++++++++++++++++ dotdotdot/dotdotdot.d.ts | 76 ++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 dotdotdot/dotdotdot-tests.ts create mode 100644 dotdotdot/dotdotdot.d.ts diff --git a/dotdotdot/dotdotdot-tests.ts b/dotdotdot/dotdotdot-tests.ts new file mode 100644 index 0000000000..95fe346745 --- /dev/null +++ b/dotdotdot/dotdotdot-tests.ts @@ -0,0 +1,54 @@ +/// +/// + +$("span").dotdotdot({ ellipsis: ":::" }); +$("span").dotdotdot({ wrap: "letter" }); +$("span").dotdotdot({ fallbackToLetter: false }); +$("span").dotdotdot({ after: $("#after") }); +$("span").dotdotdot({ watch: true }); +$("span").dotdotdot({ height: 42 }); +$("span").dotdotdot({ tolerance: 69 }); +$("span").dotdotdot({ callback: () => { } }); +$("span").dotdotdot({ callback: (isTruncated: boolean) => { } }); +$("span").dotdotdot({ callback: (isTruncated: boolean, orgContent: any) => { } }); +$("span").dotdotdot({ lastCharacter: {} }); +$("span").dotdotdot({ lastCharacter: { remove: [','] } }); +$("span").dotdotdot({ lastCharacter: { noEllipsis: ['.', '.'] } }); + +// Copied from documentation +$("#wrapper").dotdotdot({ + /* The text to add as ellipsis. */ + ellipsis: '... ', + + /* How to cut off the text/html: 'word'/'letter'/'children' */ + wrap: 'word', + + /* Wrap-option fallback to 'letter' for long words */ + fallbackToLetter: true, + + /* jQuery-selector for the element to keep and put after the ellipsis. */ + after: null, + + /* Whether to update the ellipsis: true/'window' */ + watch: false, + + /* Optionally set a max-height, if null, the height will be measured. */ + height: null, + + /* Deviation for the height-option. */ + tolerance: 0, + + /* Callback function that is fired after the ellipsis is added, + receives two parameters: isTruncated(boolean), orgContent(string). */ + callback: function (isTruncated, orgContent) { }, + + lastCharacter: { + + /* Remove these characters from the end of the truncated text. */ + remove: [' ', ',', ';', '.', '!', '?'], + + /* Don't add an ellipsis if this array contains + the last character of the truncated text. */ + noEllipsis: [] + } +}); diff --git a/dotdotdot/dotdotdot.d.ts b/dotdotdot/dotdotdot.d.ts new file mode 100644 index 0000000000..af682e94c9 --- /dev/null +++ b/dotdotdot/dotdotdot.d.ts @@ -0,0 +1,76 @@ +// Type definitions for dotdotdot v1.6.16 +// Project: http://dotdotdot.frebsite.nl/ +// Definitions by: Milan Jaros +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface JQuery { + /** + * jQuery.dotdotdot is an advanced cross-browser ellipsis for multiple line content plugin. + * @param options settings that could modify a behaviour. + */ + dotdotdot(options?: JQueryDotDotDot.IDotDotDotOptions): JQuery; +} + +declare module JQueryDotDotDot { + interface IDotDotDotOptions { + /** The text to add as ellipsis. + * Default: '... ' + */ + ellipsis?: string; + + /** How to cut off the text/html: 'word'/'letter'/'children' + * Default: 'word' + */ + wrap?: string; + + /** Wrap-option fallback to 'letter' for long words + * Default: true + */ + fallbackToLetter?: boolean; + + /** jQuery-selector for the element to keep and put after the ellipsis. + * Default: null + */ + after?: JQuery; + + /** Whether to update the ellipsis: true/'window' + * Default: false + */ + watch?: boolean; + + /** Optionally set a max-height, if null, the height will be measured. + * Default: null + */ + height?: number; + + /** Deviation for the height-option. + * Default: 0 + */ + tolerance?: number; // + + /** Callback function that is fired after the ellipsis is added, + * receives two parameters: + * @param isTruncated (boolean) + * @param orgContent (string) Documentation says it is string but it is object + * which has e.g. + * context: HTMLHtmlElement; + * length: number; // seems to be always 1 + * [index] // this contains the text: orgContent[0].data + */ + callback? (isTruncated: boolean, orgContent: any): void; + + lastCharacter?: IDotDotDotOptionsLastCharacter; + } + + interface IDotDotDotOptionsLastCharacter { + /** Remove these characters from the end of the truncated text. + * Default: [' ', ',', ';', '.', '!', '?'] + */ + remove?: string[]; + /** Don't add an ellipsis if this array contains + * the last character of the truncated text. + * Default: [] + */ + noEllipsis?: string[]; + } +} \ No newline at end of file From 31b873c6b58a8176aa10e9304c33b542b0b3cc12 Mon Sep 17 00:00:00 2001 From: tgfjt Date: Thu, 13 Nov 2014 11:47:03 +0900 Subject: [PATCH 092/292] added validator/validator.d.ts for chriso/validator.js @3.22.1 --- CONTRIBUTORS.md | 1 + validator/validator-tests.ts | 106 +++++++++++++++++++ validator/validator.d.ts | 190 +++++++++++++++++++++++++++++++++++ 3 files changed, 297 insertions(+) create mode 100644 validator/validator-tests.ts create mode 100644 validator/validator.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e10ca14d4c..1ab702c85b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -423,6 +423,7 @@ All definitions files include a header with the author and editors, so at some p * [urlrouter](https://github.com/fengmk2/urlrouter) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) * [UUID.js](https://github.com/LiosK/UUID.js) (by [Jason Jarrett](https://github.com/staxmanade)) * [Valerie](https://github.com/davewatts/valerie) (by [Howard Richards](https://github.com/conficient)) +* [validator](https://github.com/chriso/validator.js) (by [tgfjt](https://github.com/tgfjt)) * [Velocity](http://velocityjs.org/) (by [Greg Smith](https://github.com/smrq)) * [Viewporter](https://github.com/zynga/viewporter) (by [Boris Yankov](https://github.com/borisyankov)) * [Vimeo](http://developer.vimeo.com/player/js-api) (by [Daz Wilkin](https://github.com/DazWilkin/)) diff --git a/validator/validator-tests.ts b/validator/validator-tests.ts new file mode 100644 index 0000000000..b7f45d4271 --- /dev/null +++ b/validator/validator-tests.ts @@ -0,0 +1,106 @@ +/// + +import validator = require("validator"); + + +validator.extend("isTest", function(str) { + return !str; +}); + +validator.equals("abc", "Abc"); + +validator.contains("foo", "foobar"); + +validator.matches("foobar", "foo/i"); + +validator.isEmail("sample"); + +validator.isURL("sample"); + +validator.isFQDN("sample"); + +validator.isIP("sample"); + +validator.isAlpha("sample"); + +validator.isNumeric("sample"); + +validator.isAlphanumeric("sample"); + +validator.isBase64("sample"); + +validator.isHexadecimal("sample"); + +validator.isHexColor("sample"); + +validator.isLowercase("sample"); + +validator.isUppercase("sample"); + +validator.isInt("sample"); + +validator.isFloat("sample"); + +validator.isDivisibleBy("sample", 2); + +validator.isNull("sample"); + +validator.isLength("sample", 3, 5); + +validator.isByteLength("sample", 3); + +validator.isUUID("sample"); + +validator.isDate("sample"); + +validator.isAfter("sample"); + +validator.isBefore("sample"); + +validator.isIn("sample", []); + +validator.isCreditCard("sample"); + +validator.isISBN("sample"); + +validator.isJSON("sample"); + +validator.isMultibyte("sample"); + +validator.isAscii("sample"); + +validator.isFullWidth("sample"); + +validator.isHalfWidth("sample"); + +validator.isVariableWidth("sample"); + +validator.isSurrogatePair("sample"); + +validator.isMongoId("sample"); + +validator.toString(123); + +validator.toDate(1225); + +validator.toFloat('011'); + +validator.toInt('aa'); + +validator.toBoolean('yes!'); + +validator.trim(' triming '); + +validator.ltrim(' triming '); + +validator.rtrim(' triming '); + +validator.escape('