From 65d386f2de01f5399bc3010002058b3e04a32fea Mon Sep 17 00:00:00 2001 From: Roland Zwaga Date: Thu, 31 Jul 2014 09:23:37 +0200 Subject: [PATCH 001/259] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4c2fbc8e16..b91802e87f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -9,6 +9,7 @@ All definitions files include a header with the author and editors, so at some p * [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/)) From 76ea613b90f40db3afae3ff77c21298d13775257 Mon Sep 17 00:00:00 2001 From: Gabriel Garcia Date: Mon, 20 Jul 2015 18:49:06 -0400 Subject: [PATCH 002/259] localforage typings --- localForage/localForage.d.ts | 135 ++++++++++++++++++----------------- 1 file changed, 70 insertions(+), 65 deletions(-) diff --git a/localForage/localForage.d.ts b/localForage/localForage.d.ts index b5c40dd616..6deef52770 100644 --- a/localForage/localForage.d.ts +++ b/localForage/localForage.d.ts @@ -3,71 +3,76 @@ // Definitions by: yuichi david pichsenmeister // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module lf { - interface ILocalForage { - /** - * Removes every key from the database, returning it to a blank slate. - */ - clear(callback: IErrorCallback): void - /** - * Iterate over all value/key pairs in datastore. - */ - iterate(iterateCallback: IIterateCallback): void - /** - * Get the name of a key based on its ID. - */ - key(keyIndex: number, callback: IKeyCallback): void - /** - * Get the list of all keys in the datastore. - */ - keys(callback: IKeysCallback): void; - /** - * Gets the number of keys in the offline store (i.e. its “length”). - */ - length(callback: INumberCallback): void - /** - * Gets an item from the storage library and supplies the result to a callback. - * If the key does not exist, getItem() will return null. - */ - getItem(key: string, callback: ICallback): void - getItem(key: string): IPromise - /** - * Saves data to an offline store. - */ - setItem(key: string, value: T, callback: ICallback): void - setItem(key: string, value: T): IPromise - /** - * Removes the value of a key from the offline store. - */ - removeItem(key: string, callback: IErrorCallback): void - removeItem(key: string): IPromise - } +/// - interface ICallback { - (err: any, value: T): void - } +interface LocalForageOptions { + driver?: LocalForageDriver | LocalForageDriver[]; + + name?: string; + + size?: number; + + storeName?: string; + + version?: string; + + description?: string; +} - interface IIterateCallback { - (value: T, key: string, iterationNumber: number): void - } +interface LocalForageDriver { + _driver: string; + + _initStorage(options: LocalForageOptions): void; + + _support: boolean | Promise; + + clear(callback: (err: any) => void): void; + + getItem(key: string, callback: (err: any, value: any) => void): void; + + key(keyIndex: number, callback: (err: any, key: string) => void): void; + + keys(callback: (err: any, keys: string[]) => void): void; + + length(callback: (err: any, numberOfKeys: number) => void): void; + + removeItem(key: string, callback: (err: any) => void): void; + + setItem(key: string, value: any, callback: (err: any, value: any) => void): void; +} - interface IErrorCallback { - (err: any): void - } - - interface IKeyCallback { - (err: any, keyName: string): void - } - - interface IKeysCallback { - (err: any, keys: Array): void - } - - interface INumberCallback { - (err: any, numberOfKeys: number): void - } - - interface IPromise { - then(callback: ICallback): void - } -} \ No newline at end of file +interface LocalForage { + LOCALSTORAGE: LocalForageDriver; + WEBSQL: LocalForageDriver; + INDEXEDDB: LocalForageDriver; + + config(options: LocalForageOptions): void; + + setDriver(driver: LocalForageDriver): void; + setDriver(driver: LocalForageDriver[]): void; + + getItem(key: string): Promise; + getItem(key: string, callback: (err: any, value: T) => void): void; + + setItem(key: string, value: T): Promise; + setItem(key: string, value: T, callback: (err: any, value: T) => void): void; + + removeItem(key: string): Promise; + removeItem(key: string, callback: (err: any) => void): void; + + clear(): Promise; + clear(callback: (err: any) => void): void; + + length(): Promise; + length(callback: (err: any, numberOfKeys: number) => void): void; + + key(keyIndex: number): Promise; + key(keyIndex: number, callback: (err: any, key: string) => void): void; + + keys(): Promise; + keys(callback: (err: any, keys: string[]) => void): void; + + iterate(iteratee: (value: any, key: string, iterationNumber: number) => any): Promise; + iterate(iteratee: (value: any, key: string, iterationNumber: number) => any, + callback: (err: any, result: any) => void): void; +} From e7335515d8bd5a258087918530842595554b909c Mon Sep 17 00:00:00 2001 From: Gabriel Garcia Date: Fri, 24 Jul 2015 18:01:38 -0400 Subject: [PATCH 003/259] Update localForage tests --- localForage/localForage-tests.ts | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/localForage/localForage-tests.ts b/localForage/localForage-tests.ts index 15638c1cb2..59e429a76a 100644 --- a/localForage/localForage-tests.ts +++ b/localForage/localForage-tests.ts @@ -1,13 +1,6 @@ /// -declare var localForage: lf.ILocalForage; -declare var callback: lf.ICallback; -declare var iterateCallback: lf.IIterateCallback; -declare var errorCallback: lf.IErrorCallback; -declare var keyCallback: lf.IKeyCallback; -declare var keysCallback: lf.IKeysCallback; -declare var numberCallback: lf.INumberCallback; -declare var promise: lf.IPromise; +declare var localForage: LocalForage; () => { localForage.clear((err: any) => { @@ -25,7 +18,7 @@ declare var promise: lf.IPromise; var newNumber: number = num; }); - localForage.key(0,(err: any, value: string) => { + localForage.key(0, (err: any, value: string) => { var newError: any = err; var newValue: string = value; }); @@ -40,9 +33,8 @@ declare var promise: lf.IPromise; var newStr: string = str }); - localForage.getItem("key").then((err: any, str: string) => { - var newError: any = err; - var newStr: string = str + localForage.getItem("key").then((str: string) => { + var newStr: string = str; }); localForage.setItem("key", "value",(err: any, str: string) => { @@ -50,8 +42,7 @@ declare var promise: lf.IPromise; var newStr: string = str }); - localForage.setItem("key", "value").then((err: any, str: string) => { - var newError: any = err; + localForage.setItem("key", "value").then((str: string) => { var newStr: string = str; }); @@ -59,10 +50,6 @@ declare var promise: lf.IPromise; var newError: any = err; }); - localForage.removeItem("key").then((err: any, str: string) => { - var newError: any = err; - var newStr: string = str + localForage.removeItem("key").then(() => { }); - - promise.then(callback); } From 90d7feb531e0935de1eebbac1bb5bedf8ab5ccc1 Mon Sep 17 00:00:00 2001 From: Gabriel Garcia Date: Fri, 24 Jul 2015 18:18:58 -0400 Subject: [PATCH 004/259] Correct misunderstanding of documentation --- angular-localForage/angular-localForage.d.ts | 4 ++-- localForage/localForage.d.ts | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/angular-localForage/angular-localForage.d.ts b/angular-localForage/angular-localForage.d.ts index ee2aeeb6d8..c7a8f7daee 100644 --- a/angular-localForage/angular-localForage.d.ts +++ b/angular-localForage/angular-localForage.d.ts @@ -22,8 +22,8 @@ declare module angular.localForage { } interface ILocalForageService { - setDriver(driver:string):angular.IPromise; - driver():lf.ILocalForage; + driver(): LocalForageDriver; + setDriver(name: string | string[]): angular.IPromise; setItem(key:string, value:any):angular.IPromise; setItem(keys:Array, values:Array):angular.IPromise; diff --git a/localForage/localForage.d.ts b/localForage/localForage.d.ts index 6deef52770..d169d01e3f 100644 --- a/localForage/localForage.d.ts +++ b/localForage/localForage.d.ts @@ -42,14 +42,17 @@ interface LocalForageDriver { } interface LocalForage { - LOCALSTORAGE: LocalForageDriver; - WEBSQL: LocalForageDriver; - INDEXEDDB: LocalForageDriver; + LOCALSTORAGE: string; + WEBSQL: string; + INDEXEDDB: string; config(options: LocalForageOptions): void; - setDriver(driver: LocalForageDriver): void; - setDriver(driver: LocalForageDriver[]): void; + driver(): LocalForageDriver; + setDriver(driver: string | string[]): Promise; + setDriver(driver: string | string[], callback: () => void, errorCallback: (error: any) => void): void; + defineDriver(driver: LocalForageDriver): Promise; + defineDriver(driver: LocalForageDriver, callback: () => void, errorCallback: (error: any) => void): void; getItem(key: string): Promise; getItem(key: string, callback: (err: any, value: T) => void): void; From b316f99df4612d7f11b1fb8f4e3ab4024f8a604a Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Wed, 19 Aug 2015 19:42:30 +0300 Subject: [PATCH 005/259] updated to 1.0.5 version added jsdocs. es6 import added module lscache for es6 import --- lscache/lscache.d.ts | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/lscache/lscache.d.ts b/lscache/lscache.d.ts index 24c34bd8da..340d54b768 100644 --- a/lscache/lscache.d.ts +++ b/lscache/lscache.d.ts @@ -1,13 +1,48 @@ -// Type definitions for lscache v1.0.2 +// Type definitions for lscache v1.0.5 // Project: https://github.com/pamelafox/lscache // Definitions by: Chris Martinez // Definitions: https://github.com/borisyankov/DefinitelyTyped interface LSCache { + /** + * Stores the value in localStorage. Expires after specified number of minutes. + * @param {string} key + * @param {Object|string} value + * @param {number} time + */ set(key: string, value: any, time?: number): void; + /** + * Retrieves specified value from localStorage, if not expired. + * @param {string} key + * @return {string|Object} + */ get(key: string): any; + /** + * Removes a value from localStorage. + * Equivalent to 'delete' in memcache, but that's a keyword in JS. + * @param {string} key + */ remove(key: string): void; + /** + * Flushes all lscache items and expiry markers without affecting rest of localStorage + */ + flush(): void; + /** + * Flushes expired lscache items and expiry markers without affecting rest of localStorage + */ + flushExpired(): void; + /** + * Appends CACHE_PREFIX so lscache will partition data in to different buckets. + * @param {string} bucket + */ + setBucket(bucket: string); + /** + * Resets the string being appended to CACHE_PREFIX so lscache will use the default storage behavior. + */ + resetBucket(): void; +} +declare module 'lscache' { + var lscache: LSCache; + export = lscache; } - -declare var lscache: LSCache; \ No newline at end of file From 35afc7dc2c61c0ea91b07bf7859488b61d83714b Mon Sep 17 00:00:00 2001 From: Stepan Mikhaylyuk Date: Wed, 19 Aug 2015 19:46:47 +0300 Subject: [PATCH 006/259] minor fix --- lscache/lscache.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lscache/lscache.d.ts b/lscache/lscache.d.ts index 340d54b768..ed5d133a53 100644 --- a/lscache/lscache.d.ts +++ b/lscache/lscache.d.ts @@ -36,12 +36,13 @@ interface LSCache { * Appends CACHE_PREFIX so lscache will partition data in to different buckets. * @param {string} bucket */ - setBucket(bucket: string); + setBucket(bucket: string):void; /** * Resets the string being appended to CACHE_PREFIX so lscache will use the default storage behavior. */ resetBucket(): void; } +declare var lscache:LSCache; declare module 'lscache' { var lscache: LSCache; export = lscache; From 39c95a0a56c3ccb7f29a91797099c48e61ba5388 Mon Sep 17 00:00:00 2001 From: MugeSo Date: Thu, 20 Aug 2015 10:43:39 +0900 Subject: [PATCH 007/259] redis: uniform indent to 4 spaces --- redis/redis.d.ts | 664 ++++++++++++++++++++++++----------------------- 1 file changed, 333 insertions(+), 331 deletions(-) diff --git a/redis/redis.d.ts b/redis/redis.d.ts index 8e9c978567..ec7220cee4 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -1,6 +1,6 @@ // Type definitions for redis // Project: https://github.com/mranney/node_redis -// Definitions by: Carlos Ballesteros Velasco , Peter Harris +// Definitions by: Carlos Ballesteros Velasco , Peter Harris , TANAKA Koichi // Definitions: https://github.com/borisyankov/DefinitelyTyped // Imported from: https://github.com/soywiz/typescript-node-definitions/redis.d.ts @@ -8,347 +8,349 @@ /// declare module "redis" { - export function createClient(port_arg: number, host_arg?: string, options?: ClientOpts): RedisClient; - export function createClient(unix_socket: string, options?: ClientOpts): RedisClient; - export function createClient(options?: ClientOpts): RedisClient; - export function print(err: Error, reply: any): void; - export var debug_mode: boolean; + export function createClient(port_arg:number, host_arg?:string, options?:ClientOpts):RedisClient; + export function createClient(unix_socket:string, options?:ClientOpts):RedisClient; + export function createClient(options?:ClientOpts):RedisClient; - interface MessageHandler { - (channel: string, message: any): void; - } + export function print(err:Error, reply:any):void; - interface CommandT { //This is a placeholder to be used eventually, to not have to define each command twice, or four times if all caps versions are to be implemented. - (args: any[], callback?: ResCallbackT): void; - (...args: any[]): void; - } + export var debug_mode:boolean; - interface ResCallbackT { - (err: Error, res: R): void; - } + interface MessageHandler { + (channel:string, message:any): void; + } - interface ServerInfo { - redis_version: string; - versions: number[]; - } + interface CommandT { //This is a placeholder to be used eventually, to not have to define each command twice, or four times if all caps versions are to be implemented. + (args:any[], callback?:ResCallbackT): void; + (...args:any[]): void; + } - interface ClientOpts { - parser?: string; - return_buffers?: boolean; - detect_buffers?: boolean; - socket_nodelay?: boolean; - no_ready_check?: boolean; - enable_offline_queue?: boolean; - retry_max_delay?: number; - connect_timeout?: number; - max_attempts?: number; - auth_pass?: string; - } + interface ResCallbackT { + (err:Error, res:R): void; + } - interface RedisClient extends NodeJS.EventEmitter { - // event: connect - // event: error - // event: message - // event: pmessage - // event: subscribe - // event: psubscribe - // event: unsubscribe - // event: punsubscribe + interface ServerInfo { + redis_version: string; + versions: number[]; + } - connected: boolean; - retry_delay: number; - retry_backoff: number; - command_queue: any[]; - offline_queue: any[]; - server_info: ServerInfo; + interface ClientOpts { + parser?: string; + return_buffers?: boolean; + detect_buffers?: boolean; + socket_nodelay?: boolean; + no_ready_check?: boolean; + enable_offline_queue?: boolean; + retry_max_delay?: number; + connect_timeout?: number; + max_attempts?: number; + auth_pass?: string; + } - end(): void; + interface RedisClient extends NodeJS.EventEmitter { + // event: connect + // event: error + // event: message + // event: pmessage + // event: subscribe + // event: psubscribe + // event: unsubscribe + // event: punsubscribe - // Connection (http://redis.io/commands#connection) - auth(password: string, callback?: ResCallbackT): void; - ping(callback?: ResCallbackT): void; + connected: boolean; + retry_delay: number; + retry_backoff: number; + command_queue: any[]; + offline_queue: any[]; + server_info: ServerInfo; - // Strings (http://redis.io/commands#strings) - append(key: string, value: string, callback?: ResCallbackT): void; - bitcount(key: string, callback?: ResCallbackT): void; - bitcount(key: string, start: number, end: number, callback?: ResCallbackT): void; - set(key: string, value: string, callback?: ResCallbackT): void; - get(key: string, callback?: ResCallbackT): void; - exists(key: string, value: string, callback?: ResCallbackT): void; + end(): void; - publish(channel: string, value: any): void; - subscribe(channel: string): void; + // Connection (http://redis.io/commands#connection) + auth(password:string, callback?:ResCallbackT): void; + ping(callback?:ResCallbackT): void; - /* - commands = set_union([ - "get", "set", "setnx", "setex", "append", "strlen", "del", "exists", "setbit", "getbit", "setrange", "getrange", "substr", - "incr", "decr", "mget", "rpush", "lpush", "rpushx", "lpushx", "linsert", "rpop", "lpop", "brpop", "brpoplpush", "blpop", "llen", "lindex", - "lset", "lrange", "ltrim", "lrem", "rpoplpush", "sadd", "srem", "smove", "sismember", "scard", "spop", "srandmember", "sinter", "sinterstore", - "sunion", "sunionstore", "sdiff", "sdiffstore", "smembers", "zadd", "zincrby", "zrem", "zremrangebyscore", "zremrangebyrank", "zunionstore", - "zinterstore", "zrange", "zrangebyscore", "zrevrangebyscore", "zcount", "zrevrange", "zcard", "zscore", "zrank", "zrevrank", "hset", "hsetnx", - "hget", "hmset", "hmget", "hincrby", "hdel", "hlen", "hkeys", "hvals", "hgetall", "hexists", "incrby", "decrby", "getset", "mset", "msetnx", - "randomkey", "select", "move", "rename", "renamenx", "expire", "expireat", "keys", "dbsize", "auth", "ping", "echo", "save", "bgsave", - "bgrewriteaof", "shutdown", "lastsave", "type", "multi", "exec", "discard", "sync", "flushdb", "flushall", "sort", "info", "monitor", "ttl", - "persist", "slaveof", "debug", "config", "subscribe", "unsubscribe", "psubscribe", "punsubscribe", "publish", "watch", "unwatch", "cluster", - "restore", "migrate", "dump", "object", "client", "eval", "evalsha"], require("./lib/commands")); - */ + // Strings (http://redis.io/commands#strings) + append(key:string, value:string, callback?:ResCallbackT): void; + bitcount(key:string, callback?:ResCallbackT): void; + bitcount(key:string, start:number, end:number, callback?:ResCallbackT): void; + set(key:string, value:string, callback?:ResCallbackT): void; + get(key:string, callback?:ResCallbackT): void; + exists(key:string, value:string, callback?:ResCallbackT): void; - get(args: any[], callback?: ResCallbackT): void; - get(...args: any[]): void; - set(args: any[], callback?: ResCallbackT): void; - set(...args: any[]): void; - setnx(args: any[], callback?: ResCallbackT): void; - setnx(...args: any[]): void; - setex(args: any[], callback?: ResCallbackT): void; - setex(...args: any[]): void; - append(args: any[], callback?: ResCallbackT): void; - append(...args: any[]): void; - strlen(args: any[], callback?: ResCallbackT): void; - strlen(...args: any[]): void; - del(args: any[], callback?: ResCallbackT): void; - del(...args: any[]): void; - exists(args: any[], callback?: ResCallbackT): void; - exists(...args: any[]): void; - setbit(args: any[], callback?: ResCallbackT): void; - setbit(...args: any[]): void; - getbit(args: any[], callback?: ResCallbackT): void; - getbit(...args: any[]): void; - setrange(args: any[], callback?: ResCallbackT): void; - setrange(...args: any[]): void; - getrange(args: any[], callback?: ResCallbackT): void; - getrange(...args: any[]): void; - substr(args: any[], callback?: ResCallbackT): void; - substr(...args: any[]): void; - incr(args: any[], callback?: ResCallbackT): void; - incr(...args: any[]): void; - decr(args: any[], callback?: ResCallbackT): void; - decr(...args: any[]): void; - mget(args: any[], callback?: ResCallbackT): void; - mget(...args: any[]): void; - rpush(...args: any[]): void; - lpush(args: any[], callback?: ResCallbackT): void; - lpush(...args: any[]): void; - rpushx(args: any[], callback?: ResCallbackT): void; - rpushx(...args: any[]): void; - lpushx(args: any[], callback?: ResCallbackT): void; - lpushx(...args: any[]): void; - linsert(args: any[], callback?: ResCallbackT): void; - linsert(...args: any[]): void; - rpop(args: any[], callback?: ResCallbackT): void; - rpop(...args: any[]): void; - lpop(args: any[], callback?: ResCallbackT): void; - lpop(...args: any[]): void; - brpop(args: any[], callback?: ResCallbackT): void; - brpop(...args: any[]): void; - brpoplpush(args: any[], callback?: ResCallbackT): void; - brpoplpush(...args: any[]): void; - blpop(args: any[], callback?: ResCallbackT): void; - blpop(...args: any[]): void; - llen(args: any[], callback?: ResCallbackT): void; - llen(...args: any[]): void; - lindex(args: any[], callback?: ResCallbackT): void; - lindex(...args: any[]): void; - lset(args: any[], callback?: ResCallbackT): void; - lset(...args: any[]): void; - lrange(args: any[], callback?: ResCallbackT): void; - lrange(...args: any[]): void; - ltrim(args: any[], callback?: ResCallbackT): void; - ltrim(...args: any[]): void; - lrem(args: any[], callback?: ResCallbackT): void; - lrem(...args: any[]): void; - rpoplpush(args: any[], callback?: ResCallbackT): void; - rpoplpush(...args: any[]): void; - sadd(args: any[], callback?: ResCallbackT): void; - sadd(...args: any[]): void; - srem(args: any[], callback?: ResCallbackT): void; - srem(...args: any[]): void; - smove(args: any[], callback?: ResCallbackT): void; - smove(...args: any[]): void; - sismember(args: any[], callback?: ResCallbackT): void; - sismember(...args: any[]): void; - scard(args: any[], callback?: ResCallbackT): void; - scard(...args: any[]): void; - spop(args: any[], callback?: ResCallbackT): void; - spop(...args: any[]): void; - srandmember(args: any[], callback?: ResCallbackT): void; - srandmember(...args: any[]): void; - sinter(args: any[], callback?: ResCallbackT): void; - sinter(...args: any[]): void; - sinterstore(args: any[], callback?: ResCallbackT): void; - sinterstore(...args: any[]): void; - sunion(args: any[], callback?: ResCallbackT): void; - sunion(...args: any[]): void; - sunionstore(args: any[], callback?: ResCallbackT): void; - sunionstore(...args: any[]): void; - sdiff(args: any[], callback?: ResCallbackT): void; - sdiff(...args: any[]): void; - sdiffstore(args: any[], callback?: ResCallbackT): void; - sdiffstore(...args: any[]): void; - smembers(args: any[], callback?: ResCallbackT): void; - smembers(...args: any[]): void; - zadd(args: any[], callback?: ResCallbackT): void; - zadd(...args: any[]): void; - zincrby(args: any[], callback?: ResCallbackT): void; - zincrby(...args: any[]): void; - zrem(args: any[], callback?: ResCallbackT): void; - zrem(...args: any[]): void; - zremrangebyscore(args: any[], callback?: ResCallbackT): void; - zremrangebyscore(...args: any[]): void; - zremrangebyrank(args: any[], callback?: ResCallbackT): void; - zremrangebyrank(...args: any[]): void; - zunionstore(args: any[], callback?: ResCallbackT): void; - zunionstore(...args: any[]): void; - zinterstore(args: any[], callback?: ResCallbackT): void; - zinterstore(...args: any[]): void; - zrange(args: any[], callback?: ResCallbackT): void; - zrange(...args: any[]): void; - zrangebyscore(args: any[], callback?: ResCallbackT): void; - zrangebyscore(...args: any[]): void; - zrevrangebyscore(args: any[], callback?: ResCallbackT): void; - zrevrangebyscore(...args: any[]): void; - zcount(args: any[], callback?: ResCallbackT): void; - zcount(...args: any[]): void; - zrevrange(args: any[], callback?: ResCallbackT): void; - zrevrange(...args: any[]): void; - zcard(args: any[], callback?: ResCallbackT): void; - zcard(...args: any[]): void; - zscore(args: any[], callback?: ResCallbackT): void; - zscore(...args: any[]): void; - zrank(args: any[], callback?: ResCallbackT): void; - zrank(...args: any[]): void; - zrevrank(args: any[], callback?: ResCallbackT): void; - zrevrank(...args: any[]): void; - hset(args: any[], callback?: ResCallbackT): void; - hset(...args: any[]): void; - hsetnx(args: any[], callback?: ResCallbackT): void; - hsetnx(...args: any[]): void; - hget(args: any[], callback?: ResCallbackT): void; - hget(...args: any[]): void; - hmset(args: any[], callback?: ResCallbackT): void; - hmset(key: string, hash: any, callback?: ResCallbackT): void; - hmset(...args: any[]): void; - hmget(args: any[], callback?: ResCallbackT): void; - hmget(...args: any[]): void; - hincrby(args: any[], callback?: ResCallbackT): void; - hincrby(...args: any[]): void; - hdel(args: any[], callback?: ResCallbackT): void; - hdel(...args: any[]): void; - hlen(args: any[], callback?: ResCallbackT): void; - hlen(...args: any[]): void; - hkeys(args: any[], callback?: ResCallbackT): void; - hkeys(...args: any[]): void; - hvals(args: any[], callback?: ResCallbackT): void; - hvals(...args: any[]): void; - hgetall(args: any[], callback?: ResCallbackT): void; - hgetall(...args: any[]): void; - hgetall(key: string, callback?: ResCallbackT): void; - hexists(args: any[], callback?: ResCallbackT): void; - hexists(...args: any[]): void; - incrby(args: any[], callback?: ResCallbackT): void; - incrby(...args: any[]): void; - decrby(args: any[], callback?: ResCallbackT): void; - decrby(...args: any[]): void; - getset(args: any[], callback?: ResCallbackT): void; - getset(...args: any[]): void; - mset(args: any[], callback?: ResCallbackT): void; - mset(...args: any[]): void; - msetnx(args: any[], callback?: ResCallbackT): void; - msetnx(...args: any[]): void; - randomkey(args: any[], callback?: ResCallbackT): void; - randomkey(...args: any[]): void; - select(args: any[], callback?: ResCallbackT): void; - select(...args: any[]): void; - move(args: any[], callback?: ResCallbackT): void; - move(...args: any[]): void; - rename(args: any[], callback?: ResCallbackT): void; - rename(...args: any[]): void; - renamenx(args: any[], callback?: ResCallbackT): void; - renamenx(...args: any[]): void; - expire(args: any[], callback?: ResCallbackT): void; - expire(...args: any[]): void; - expireat(args: any[], callback?: ResCallbackT): void; - expireat(...args: any[]): void; - keys(args: any[], callback?: ResCallbackT): void; - keys(...args: any[]): void; - dbsize(args: any[], callback?: ResCallbackT): void; - dbsize(...args: any[]): void; - auth(args: any[], callback?: ResCallbackT): void; - auth(...args: any[]): void; - ping(args: any[], callback?: ResCallbackT): void; - ping(...args: any[]): void; - echo(args: any[], callback?: ResCallbackT): void; - echo(...args: any[]): void; - save(args: any[], callback?: ResCallbackT): void; - save(...args: any[]): void; - bgsave(args: any[], callback?: ResCallbackT): void; - bgsave(...args: any[]): void; - bgrewriteaof(args: any[], callback?: ResCallbackT): void; - bgrewriteaof(...args: any[]): void; - shutdown(args: any[], callback?: ResCallbackT): void; - shutdown(...args: any[]): void; - lastsave(args: any[], callback?: ResCallbackT): void; - lastsave(...args: any[]): void; - type(args: any[], callback?: ResCallbackT): void; - type(...args: any[]): void; - multi(args: any[], callback?: ResCallbackT): void; - multi(...args: any[]): void; - exec(args: any[], callback?: ResCallbackT): void; - exec(...args: any[]): void; - discard(args: any[], callback?: ResCallbackT): void; - discard(...args: any[]): void; - sync(args: any[], callback?: ResCallbackT): void; - sync(...args: any[]): void; - flushdb(args: any[], callback?: ResCallbackT): void; - flushdb(...args: any[]): void; - flushall(args: any[], callback?: ResCallbackT): void; - flushall(...args: any[]): void; - sort(args: any[], callback?: ResCallbackT): void; - sort(...args: any[]): void; - info(args: any[], callback?: ResCallbackT): void; - info(...args: any[]): void; - monitor(args: any[], callback?: ResCallbackT): void; - monitor(...args: any[]): void; - ttl(args: any[], callback?: ResCallbackT): void; - ttl(...args: any[]): void; - persist(args: any[], callback?: ResCallbackT): void; - persist(...args: any[]): void; - slaveof(args: any[], callback?: ResCallbackT): void; - slaveof(...args: any[]): void; - debug(args: any[], callback?: ResCallbackT): void; - debug(...args: any[]): void; - config(args: any[], callback?: ResCallbackT): void; - config(...args: any[]): void; - subscribe(args: any[], callback?: ResCallbackT): void; - subscribe(...args: any[]): void; - unsubscribe(args: any[], callback?: ResCallbackT): void; - unsubscribe(...args: any[]): void; - psubscribe(args: any[], callback?: ResCallbackT): void; - psubscribe(...args: any[]): void; - punsubscribe(args: any[], callback?: ResCallbackT): void; - punsubscribe(...args: any[]): void; - publish(args: any[], callback?: ResCallbackT): void; - publish(...args: any[]): void; - watch(args: any[], callback?: ResCallbackT): void; - watch(...args: any[]): void; - unwatch(args: any[], callback?: ResCallbackT): void; - unwatch(...args: any[]): void; - cluster(args: any[], callback?: ResCallbackT): void; - cluster(...args: any[]): void; - restore(args: any[], callback?: ResCallbackT): void; - restore(...args: any[]): void; - migrate(args: any[], callback?: ResCallbackT): void; - migrate(...args: any[]): void; - dump(args: any[], callback?: ResCallbackT): void; - dump(...args: any[]): void; - object(args: any[], callback?: ResCallbackT): void; - object(...args: any[]): void; - client(args: any[], callback?: ResCallbackT): void; - client(...args: any[]): void; - eval(args: any[], callback?: ResCallbackT): void; - eval(...args: any[]): void; - evalsha(args: any[], callback?: ResCallbackT): void; - evalsha(...args: any[]): void; - quit(args: any[], callback?: ResCallbackT): void; - quit(...args: any[]): void; - } + publish(channel:string, value:any): void; + subscribe(channel:string): void; + + /* + commands = set_union([ + "get", "set", "setnx", "setex", "append", "strlen", "del", "exists", "setbit", "getbit", "setrange", "getrange", "substr", + "incr", "decr", "mget", "rpush", "lpush", "rpushx", "lpushx", "linsert", "rpop", "lpop", "brpop", "brpoplpush", "blpop", "llen", "lindex", + "lset", "lrange", "ltrim", "lrem", "rpoplpush", "sadd", "srem", "smove", "sismember", "scard", "spop", "srandmember", "sinter", "sinterstore", + "sunion", "sunionstore", "sdiff", "sdiffstore", "smembers", "zadd", "zincrby", "zrem", "zremrangebyscore", "zremrangebyrank", "zunionstore", + "zinterstore", "zrange", "zrangebyscore", "zrevrangebyscore", "zcount", "zrevrange", "zcard", "zscore", "zrank", "zrevrank", "hset", "hsetnx", + "hget", "hmset", "hmget", "hincrby", "hdel", "hlen", "hkeys", "hvals", "hgetall", "hexists", "incrby", "decrby", "getset", "mset", "msetnx", + "randomkey", "select", "move", "rename", "renamenx", "expire", "expireat", "keys", "dbsize", "auth", "ping", "echo", "save", "bgsave", + "bgrewriteaof", "shutdown", "lastsave", "type", "multi", "exec", "discard", "sync", "flushdb", "flushall", "sort", "info", "monitor", "ttl", + "persist", "slaveof", "debug", "config", "subscribe", "unsubscribe", "psubscribe", "punsubscribe", "publish", "watch", "unwatch", "cluster", + "restore", "migrate", "dump", "object", "client", "eval", "evalsha"], require("./lib/commands")); + */ + + get(args:any[], callback?:ResCallbackT): void; + get(...args:any[]): void; + set(args:any[], callback?:ResCallbackT): void; + set(...args:any[]): void; + setnx(args:any[], callback?:ResCallbackT): void; + setnx(...args:any[]): void; + setex(args:any[], callback?:ResCallbackT): void; + setex(...args:any[]): void; + append(args:any[], callback?:ResCallbackT): void; + append(...args:any[]): void; + strlen(args:any[], callback?:ResCallbackT): void; + strlen(...args:any[]): void; + del(args:any[], callback?:ResCallbackT): void; + del(...args:any[]): void; + exists(args:any[], callback?:ResCallbackT): void; + exists(...args:any[]): void; + setbit(args:any[], callback?:ResCallbackT): void; + setbit(...args:any[]): void; + getbit(args:any[], callback?:ResCallbackT): void; + getbit(...args:any[]): void; + setrange(args:any[], callback?:ResCallbackT): void; + setrange(...args:any[]): void; + getrange(args:any[], callback?:ResCallbackT): void; + getrange(...args:any[]): void; + substr(args:any[], callback?:ResCallbackT): void; + substr(...args:any[]): void; + incr(args:any[], callback?:ResCallbackT): void; + incr(...args:any[]): void; + decr(args:any[], callback?:ResCallbackT): void; + decr(...args:any[]): void; + mget(args:any[], callback?:ResCallbackT): void; + mget(...args:any[]): void; + rpush(...args:any[]): void; + lpush(args:any[], callback?:ResCallbackT): void; + lpush(...args:any[]): void; + rpushx(args:any[], callback?:ResCallbackT): void; + rpushx(...args:any[]): void; + lpushx(args:any[], callback?:ResCallbackT): void; + lpushx(...args:any[]): void; + linsert(args:any[], callback?:ResCallbackT): void; + linsert(...args:any[]): void; + rpop(args:any[], callback?:ResCallbackT): void; + rpop(...args:any[]): void; + lpop(args:any[], callback?:ResCallbackT): void; + lpop(...args:any[]): void; + brpop(args:any[], callback?:ResCallbackT): void; + brpop(...args:any[]): void; + brpoplpush(args:any[], callback?:ResCallbackT): void; + brpoplpush(...args:any[]): void; + blpop(args:any[], callback?:ResCallbackT): void; + blpop(...args:any[]): void; + llen(args:any[], callback?:ResCallbackT): void; + llen(...args:any[]): void; + lindex(args:any[], callback?:ResCallbackT): void; + lindex(...args:any[]): void; + lset(args:any[], callback?:ResCallbackT): void; + lset(...args:any[]): void; + lrange(args:any[], callback?:ResCallbackT): void; + lrange(...args:any[]): void; + ltrim(args:any[], callback?:ResCallbackT): void; + ltrim(...args:any[]): void; + lrem(args:any[], callback?:ResCallbackT): void; + lrem(...args:any[]): void; + rpoplpush(args:any[], callback?:ResCallbackT): void; + rpoplpush(...args:any[]): void; + sadd(args:any[], callback?:ResCallbackT): void; + sadd(...args:any[]): void; + srem(args:any[], callback?:ResCallbackT): void; + srem(...args:any[]): void; + smove(args:any[], callback?:ResCallbackT): void; + smove(...args:any[]): void; + sismember(args:any[], callback?:ResCallbackT): void; + sismember(...args:any[]): void; + scard(args:any[], callback?:ResCallbackT): void; + scard(...args:any[]): void; + spop(args:any[], callback?:ResCallbackT): void; + spop(...args:any[]): void; + srandmember(args:any[], callback?:ResCallbackT): void; + srandmember(...args:any[]): void; + sinter(args:any[], callback?:ResCallbackT): void; + sinter(...args:any[]): void; + sinterstore(args:any[], callback?:ResCallbackT): void; + sinterstore(...args:any[]): void; + sunion(args:any[], callback?:ResCallbackT): void; + sunion(...args:any[]): void; + sunionstore(args:any[], callback?:ResCallbackT): void; + sunionstore(...args:any[]): void; + sdiff(args:any[], callback?:ResCallbackT): void; + sdiff(...args:any[]): void; + sdiffstore(args:any[], callback?:ResCallbackT): void; + sdiffstore(...args:any[]): void; + smembers(args:any[], callback?:ResCallbackT): void; + smembers(...args:any[]): void; + zadd(args:any[], callback?:ResCallbackT): void; + zadd(...args:any[]): void; + zincrby(args:any[], callback?:ResCallbackT): void; + zincrby(...args:any[]): void; + zrem(args:any[], callback?:ResCallbackT): void; + zrem(...args:any[]): void; + zremrangebyscore(args:any[], callback?:ResCallbackT): void; + zremrangebyscore(...args:any[]): void; + zremrangebyrank(args:any[], callback?:ResCallbackT): void; + zremrangebyrank(...args:any[]): void; + zunionstore(args:any[], callback?:ResCallbackT): void; + zunionstore(...args:any[]): void; + zinterstore(args:any[], callback?:ResCallbackT): void; + zinterstore(...args:any[]): void; + zrange(args:any[], callback?:ResCallbackT): void; + zrange(...args:any[]): void; + zrangebyscore(args:any[], callback?:ResCallbackT): void; + zrangebyscore(...args:any[]): void; + zrevrangebyscore(args:any[], callback?:ResCallbackT): void; + zrevrangebyscore(...args:any[]): void; + zcount(args:any[], callback?:ResCallbackT): void; + zcount(...args:any[]): void; + zrevrange(args:any[], callback?:ResCallbackT): void; + zrevrange(...args:any[]): void; + zcard(args:any[], callback?:ResCallbackT): void; + zcard(...args:any[]): void; + zscore(args:any[], callback?:ResCallbackT): void; + zscore(...args:any[]): void; + zrank(args:any[], callback?:ResCallbackT): void; + zrank(...args:any[]): void; + zrevrank(args:any[], callback?:ResCallbackT): void; + zrevrank(...args:any[]): void; + hset(args:any[], callback?:ResCallbackT): void; + hset(...args:any[]): void; + hsetnx(args:any[], callback?:ResCallbackT): void; + hsetnx(...args:any[]): void; + hget(args:any[], callback?:ResCallbackT): void; + hget(...args:any[]): void; + hmset(args:any[], callback?:ResCallbackT): void; + hmset(key:string, hash:any, callback?:ResCallbackT): void; + hmset(...args:any[]): void; + hmget(args:any[], callback?:ResCallbackT): void; + hmget(...args:any[]): void; + hincrby(args:any[], callback?:ResCallbackT): void; + hincrby(...args:any[]): void; + hdel(args:any[], callback?:ResCallbackT): void; + hdel(...args:any[]): void; + hlen(args:any[], callback?:ResCallbackT): void; + hlen(...args:any[]): void; + hkeys(args:any[], callback?:ResCallbackT): void; + hkeys(...args:any[]): void; + hvals(args:any[], callback?:ResCallbackT): void; + hvals(...args:any[]): void; + hgetall(args:any[], callback?:ResCallbackT): void; + hgetall(...args:any[]): void; + hgetall(key:string, callback?:ResCallbackT): void; + hexists(args:any[], callback?:ResCallbackT): void; + hexists(...args:any[]): void; + incrby(args:any[], callback?:ResCallbackT): void; + incrby(...args:any[]): void; + decrby(args:any[], callback?:ResCallbackT): void; + decrby(...args:any[]): void; + getset(args:any[], callback?:ResCallbackT): void; + getset(...args:any[]): void; + mset(args:any[], callback?:ResCallbackT): void; + mset(...args:any[]): void; + msetnx(args:any[], callback?:ResCallbackT): void; + msetnx(...args:any[]): void; + randomkey(args:any[], callback?:ResCallbackT): void; + randomkey(...args:any[]): void; + select(args:any[], callback?:ResCallbackT): void; + select(...args:any[]): void; + move(args:any[], callback?:ResCallbackT): void; + move(...args:any[]): void; + rename(args:any[], callback?:ResCallbackT): void; + rename(...args:any[]): void; + renamenx(args:any[], callback?:ResCallbackT): void; + renamenx(...args:any[]): void; + expire(args:any[], callback?:ResCallbackT): void; + expire(...args:any[]): void; + expireat(args:any[], callback?:ResCallbackT): void; + expireat(...args:any[]): void; + keys(args:any[], callback?:ResCallbackT): void; + keys(...args:any[]): void; + dbsize(args:any[], callback?:ResCallbackT): void; + dbsize(...args:any[]): void; + auth(args:any[], callback?:ResCallbackT): void; + auth(...args:any[]): void; + ping(args:any[], callback?:ResCallbackT): void; + ping(...args:any[]): void; + echo(args:any[], callback?:ResCallbackT): void; + echo(...args:any[]): void; + save(args:any[], callback?:ResCallbackT): void; + save(...args:any[]): void; + bgsave(args:any[], callback?:ResCallbackT): void; + bgsave(...args:any[]): void; + bgrewriteaof(args:any[], callback?:ResCallbackT): void; + bgrewriteaof(...args:any[]): void; + shutdown(args:any[], callback?:ResCallbackT): void; + shutdown(...args:any[]): void; + lastsave(args:any[], callback?:ResCallbackT): void; + lastsave(...args:any[]): void; + type(args:any[], callback?:ResCallbackT): void; + type(...args:any[]): void; + multi(args:any[], callback?:ResCallbackT): void; + multi(...args:any[]): void; + exec(args:any[], callback?:ResCallbackT): void; + exec(...args:any[]): void; + discard(args:any[], callback?:ResCallbackT): void; + discard(...args:any[]): void; + sync(args:any[], callback?:ResCallbackT): void; + sync(...args:any[]): void; + flushdb(args:any[], callback?:ResCallbackT): void; + flushdb(...args:any[]): void; + flushall(args:any[], callback?:ResCallbackT): void; + flushall(...args:any[]): void; + sort(args:any[], callback?:ResCallbackT): void; + sort(...args:any[]): void; + info(args:any[], callback?:ResCallbackT): void; + info(...args:any[]): void; + monitor(args:any[], callback?:ResCallbackT): void; + monitor(...args:any[]): void; + ttl(args:any[], callback?:ResCallbackT): void; + ttl(...args:any[]): void; + persist(args:any[], callback?:ResCallbackT): void; + persist(...args:any[]): void; + slaveof(args:any[], callback?:ResCallbackT): void; + slaveof(...args:any[]): void; + debug(args:any[], callback?:ResCallbackT): void; + debug(...args:any[]): void; + config(args:any[], callback?:ResCallbackT): void; + config(...args:any[]): void; + subscribe(args:any[], callback?:ResCallbackT): void; + subscribe(...args:any[]): void; + unsubscribe(args:any[], callback?:ResCallbackT): void; + unsubscribe(...args:any[]): void; + psubscribe(args:any[], callback?:ResCallbackT): void; + psubscribe(...args:any[]): void; + punsubscribe(args:any[], callback?:ResCallbackT): void; + punsubscribe(...args:any[]): void; + publish(args:any[], callback?:ResCallbackT): void; + publish(...args:any[]): void; + watch(args:any[], callback?:ResCallbackT): void; + watch(...args:any[]): void; + unwatch(args:any[], callback?:ResCallbackT): void; + unwatch(...args:any[]): void; + cluster(args:any[], callback?:ResCallbackT): void; + cluster(...args:any[]): void; + restore(args:any[], callback?:ResCallbackT): void; + restore(...args:any[]): void; + migrate(args:any[], callback?:ResCallbackT): void; + migrate(...args:any[]): void; + dump(args:any[], callback?:ResCallbackT): void; + dump(...args:any[]): void; + object(args:any[], callback?:ResCallbackT): void; + object(...args:any[]): void; + client(args:any[], callback?:ResCallbackT): void; + client(...args:any[]): void; + eval(args:any[], callback?:ResCallbackT): void; + eval(...args:any[]): void; + evalsha(args:any[], callback?:ResCallbackT): void; + evalsha(...args:any[]): void; + quit(args:any[], callback?:ResCallbackT): void; + quit(...args:any[]): void; + } } From f371b44439297704fa3cb738a3ea17797cdf1027 Mon Sep 17 00:00:00 2001 From: MugeSo Date: Thu, 20 Aug 2015 10:54:20 +0900 Subject: [PATCH 008/259] redis: add properties to ClientOpts interface --- redis/redis.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/redis/redis.d.ts b/redis/redis.d.ts index ec7220cee4..886e285caf 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -39,12 +39,16 @@ declare module "redis" { return_buffers?: boolean; detect_buffers?: boolean; socket_nodelay?: boolean; + socket_keepalive?: boolean; no_ready_check?: boolean; enable_offline_queue?: boolean; retry_max_delay?: number; connect_timeout?: number; max_attempts?: number; auth_pass?: string; + family?: string; + command_queue_high_water?: number; + command_queue_low_water?: number; } interface RedisClient extends NodeJS.EventEmitter { From 0c3aa92a0b1d8da19600644123fc1652d8c87b1c Mon Sep 17 00:00:00 2001 From: MugeSo Date: Thu, 20 Aug 2015 11:24:21 +0900 Subject: [PATCH 009/259] redis: update tests --- redis/redis-tests.ts | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/redis/redis-tests.ts b/redis/redis-tests.ts index 9c7003541f..b65cad599b 100644 --- a/redis/redis-tests.ts +++ b/redis/redis-tests.ts @@ -4,6 +4,7 @@ import redis = require('redis'); var value: any; var valueArr: any[]; +var commandArr: any[][]; var num: number; var str: string; var bool: boolean; @@ -40,6 +41,7 @@ client.end(); // Connection (http://redis.io/commands#connection) client.auth(str, resCallback); client.ping(numCallback); +client.unref(); // Strings (http://redis.io/commands#strings) client.append(str, str, numCallback); @@ -49,9 +51,7 @@ client.set(str, str, strCallback); client.get(str, strCallback); client.exists(str, numCallback); -client.publish(str, value); -client.subscribe(str); - +// Event handlers client.on(str, messageHandler); client.once(str, messageHandler); @@ -62,5 +62,28 @@ client.get(args); client.get(args, resCallback); client.set(args); client.set(args, resCallback); +client.mset(args, resCallback); client.incr(str, resCallback); + +// Friendlier hash commands +client.hgetall(str, resCallback); +client.hmset(str, value, resCallback); +client.hmset(str, str, str, str, str, resCallback); + +// Publish / Subscribe +client.publish(str, value); +client.subscribe(str); + +// Multi +client.multi() + .scard(str) + .smembers(str) + .keys('*', resCallback) + .dbsize() + .exec(resCallback); + +client.multi(commandArr).exec(); + +// Monitor mode +client.monitor(resCallback); \ No newline at end of file From da1d0dcc70a919cd5e2ef29daec707b20d60bc65 Mon Sep 17 00:00:00 2001 From: MugeSo Date: Thu, 20 Aug 2015 11:27:08 +0900 Subject: [PATCH 010/259] redis: update tests --- redis/redis-tests.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/redis/redis-tests.ts b/redis/redis-tests.ts index b65cad599b..5acb02465e 100644 --- a/redis/redis-tests.ts +++ b/redis/redis-tests.ts @@ -86,4 +86,7 @@ client.multi() client.multi(commandArr).exec(); // Monitor mode -client.monitor(resCallback); \ No newline at end of file +client.monitor(resCallback); + +// Send command +client.send_command(str, args, resCallback); \ No newline at end of file From 9ae4d7f7bac138e262f9061843378a22b4298f44 Mon Sep 17 00:00:00 2001 From: MugeSo Date: Thu, 20 Aug 2015 11:44:58 +0900 Subject: [PATCH 011/259] redis: fix return value type of command methods. --- redis/redis.d.ts | 528 +++++++++++++++++++++++------------------------ 1 file changed, 264 insertions(+), 264 deletions(-) diff --git a/redis/redis.d.ts b/redis/redis.d.ts index 886e285caf..78d49499de 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -71,19 +71,19 @@ declare module "redis" { end(): void; // Connection (http://redis.io/commands#connection) - auth(password:string, callback?:ResCallbackT): void; - ping(callback?:ResCallbackT): void; + auth(password:string, callback?:ResCallbackT): boolean; + ping(callback?:ResCallbackT): boolean; // Strings (http://redis.io/commands#strings) - append(key:string, value:string, callback?:ResCallbackT): void; - bitcount(key:string, callback?:ResCallbackT): void; - bitcount(key:string, start:number, end:number, callback?:ResCallbackT): void; - set(key:string, value:string, callback?:ResCallbackT): void; - get(key:string, callback?:ResCallbackT): void; - exists(key:string, value:string, callback?:ResCallbackT): void; + append(key:string, value:string, callback?:ResCallbackT): boolean; + bitcount(key:string, callback?:ResCallbackT): boolean; + bitcount(key:string, start:number, end:number, callback?:ResCallbackT): boolean; + set(key:string, value:string, callback?:ResCallbackT): boolean; + get(key:string, callback?:ResCallbackT): boolean; + exists(key:string, value:string, callback?:ResCallbackT): boolean; - publish(channel:string, value:any): void; - subscribe(channel:string): void; + publish(channel:string, value:any): boolean; + subscribe(channel:string): boolean; /* commands = set_union([ @@ -99,262 +99,262 @@ declare module "redis" { "restore", "migrate", "dump", "object", "client", "eval", "evalsha"], require("./lib/commands")); */ - get(args:any[], callback?:ResCallbackT): void; - get(...args:any[]): void; - set(args:any[], callback?:ResCallbackT): void; - set(...args:any[]): void; - setnx(args:any[], callback?:ResCallbackT): void; - setnx(...args:any[]): void; - setex(args:any[], callback?:ResCallbackT): void; - setex(...args:any[]): void; - append(args:any[], callback?:ResCallbackT): void; - append(...args:any[]): void; - strlen(args:any[], callback?:ResCallbackT): void; - strlen(...args:any[]): void; - del(args:any[], callback?:ResCallbackT): void; - del(...args:any[]): void; - exists(args:any[], callback?:ResCallbackT): void; - exists(...args:any[]): void; - setbit(args:any[], callback?:ResCallbackT): void; - setbit(...args:any[]): void; - getbit(args:any[], callback?:ResCallbackT): void; - getbit(...args:any[]): void; - setrange(args:any[], callback?:ResCallbackT): void; - setrange(...args:any[]): void; - getrange(args:any[], callback?:ResCallbackT): void; - getrange(...args:any[]): void; - substr(args:any[], callback?:ResCallbackT): void; - substr(...args:any[]): void; - incr(args:any[], callback?:ResCallbackT): void; - incr(...args:any[]): void; - decr(args:any[], callback?:ResCallbackT): void; - decr(...args:any[]): void; - mget(args:any[], callback?:ResCallbackT): void; - mget(...args:any[]): void; - rpush(...args:any[]): void; - lpush(args:any[], callback?:ResCallbackT): void; - lpush(...args:any[]): void; - rpushx(args:any[], callback?:ResCallbackT): void; - rpushx(...args:any[]): void; - lpushx(args:any[], callback?:ResCallbackT): void; - lpushx(...args:any[]): void; - linsert(args:any[], callback?:ResCallbackT): void; - linsert(...args:any[]): void; - rpop(args:any[], callback?:ResCallbackT): void; - rpop(...args:any[]): void; - lpop(args:any[], callback?:ResCallbackT): void; - lpop(...args:any[]): void; - brpop(args:any[], callback?:ResCallbackT): void; - brpop(...args:any[]): void; - brpoplpush(args:any[], callback?:ResCallbackT): void; - brpoplpush(...args:any[]): void; - blpop(args:any[], callback?:ResCallbackT): void; - blpop(...args:any[]): void; - llen(args:any[], callback?:ResCallbackT): void; - llen(...args:any[]): void; - lindex(args:any[], callback?:ResCallbackT): void; - lindex(...args:any[]): void; - lset(args:any[], callback?:ResCallbackT): void; - lset(...args:any[]): void; - lrange(args:any[], callback?:ResCallbackT): void; - lrange(...args:any[]): void; - ltrim(args:any[], callback?:ResCallbackT): void; - ltrim(...args:any[]): void; - lrem(args:any[], callback?:ResCallbackT): void; - lrem(...args:any[]): void; - rpoplpush(args:any[], callback?:ResCallbackT): void; - rpoplpush(...args:any[]): void; - sadd(args:any[], callback?:ResCallbackT): void; - sadd(...args:any[]): void; - srem(args:any[], callback?:ResCallbackT): void; - srem(...args:any[]): void; - smove(args:any[], callback?:ResCallbackT): void; - smove(...args:any[]): void; - sismember(args:any[], callback?:ResCallbackT): void; - sismember(...args:any[]): void; - scard(args:any[], callback?:ResCallbackT): void; - scard(...args:any[]): void; - spop(args:any[], callback?:ResCallbackT): void; - spop(...args:any[]): void; - srandmember(args:any[], callback?:ResCallbackT): void; - srandmember(...args:any[]): void; - sinter(args:any[], callback?:ResCallbackT): void; - sinter(...args:any[]): void; - sinterstore(args:any[], callback?:ResCallbackT): void; - sinterstore(...args:any[]): void; - sunion(args:any[], callback?:ResCallbackT): void; - sunion(...args:any[]): void; - sunionstore(args:any[], callback?:ResCallbackT): void; - sunionstore(...args:any[]): void; - sdiff(args:any[], callback?:ResCallbackT): void; - sdiff(...args:any[]): void; - sdiffstore(args:any[], callback?:ResCallbackT): void; - sdiffstore(...args:any[]): void; - smembers(args:any[], callback?:ResCallbackT): void; - smembers(...args:any[]): void; - zadd(args:any[], callback?:ResCallbackT): void; - zadd(...args:any[]): void; - zincrby(args:any[], callback?:ResCallbackT): void; - zincrby(...args:any[]): void; - zrem(args:any[], callback?:ResCallbackT): void; - zrem(...args:any[]): void; - zremrangebyscore(args:any[], callback?:ResCallbackT): void; - zremrangebyscore(...args:any[]): void; - zremrangebyrank(args:any[], callback?:ResCallbackT): void; - zremrangebyrank(...args:any[]): void; - zunionstore(args:any[], callback?:ResCallbackT): void; - zunionstore(...args:any[]): void; - zinterstore(args:any[], callback?:ResCallbackT): void; - zinterstore(...args:any[]): void; - zrange(args:any[], callback?:ResCallbackT): void; - zrange(...args:any[]): void; - zrangebyscore(args:any[], callback?:ResCallbackT): void; - zrangebyscore(...args:any[]): void; - zrevrangebyscore(args:any[], callback?:ResCallbackT): void; - zrevrangebyscore(...args:any[]): void; - zcount(args:any[], callback?:ResCallbackT): void; - zcount(...args:any[]): void; - zrevrange(args:any[], callback?:ResCallbackT): void; - zrevrange(...args:any[]): void; - zcard(args:any[], callback?:ResCallbackT): void; - zcard(...args:any[]): void; - zscore(args:any[], callback?:ResCallbackT): void; - zscore(...args:any[]): void; - zrank(args:any[], callback?:ResCallbackT): void; - zrank(...args:any[]): void; - zrevrank(args:any[], callback?:ResCallbackT): void; - zrevrank(...args:any[]): void; - hset(args:any[], callback?:ResCallbackT): void; - hset(...args:any[]): void; - hsetnx(args:any[], callback?:ResCallbackT): void; - hsetnx(...args:any[]): void; - hget(args:any[], callback?:ResCallbackT): void; - hget(...args:any[]): void; - hmset(args:any[], callback?:ResCallbackT): void; - hmset(key:string, hash:any, callback?:ResCallbackT): void; - hmset(...args:any[]): void; - hmget(args:any[], callback?:ResCallbackT): void; - hmget(...args:any[]): void; - hincrby(args:any[], callback?:ResCallbackT): void; - hincrby(...args:any[]): void; - hdel(args:any[], callback?:ResCallbackT): void; - hdel(...args:any[]): void; - hlen(args:any[], callback?:ResCallbackT): void; - hlen(...args:any[]): void; - hkeys(args:any[], callback?:ResCallbackT): void; - hkeys(...args:any[]): void; - hvals(args:any[], callback?:ResCallbackT): void; - hvals(...args:any[]): void; - hgetall(args:any[], callback?:ResCallbackT): void; - hgetall(...args:any[]): void; - hgetall(key:string, callback?:ResCallbackT): void; - hexists(args:any[], callback?:ResCallbackT): void; - hexists(...args:any[]): void; - incrby(args:any[], callback?:ResCallbackT): void; - incrby(...args:any[]): void; - decrby(args:any[], callback?:ResCallbackT): void; - decrby(...args:any[]): void; - getset(args:any[], callback?:ResCallbackT): void; - getset(...args:any[]): void; - mset(args:any[], callback?:ResCallbackT): void; - mset(...args:any[]): void; - msetnx(args:any[], callback?:ResCallbackT): void; - msetnx(...args:any[]): void; - randomkey(args:any[], callback?:ResCallbackT): void; - randomkey(...args:any[]): void; + get(args:any[], callback?:ResCallbackT): boolean; + get(...args:any[]): boolean; + set(args:any[], callback?:ResCallbackT): boolean; + set(...args:any[]): boolean; + setnx(args:any[], callback?:ResCallbackT): boolean; + setnx(...args:any[]): boolean; + setex(args:any[], callback?:ResCallbackT): boolean; + setex(...args:any[]): boolean; + append(args:any[], callback?:ResCallbackT): boolean; + append(...args:any[]): boolean; + strlen(args:any[], callback?:ResCallbackT): boolean; + strlen(...args:any[]): boolean; + del(args:any[], callback?:ResCallbackT): boolean; + del(...args:any[]): boolean; + exists(args:any[], callback?:ResCallbackT): boolean; + exists(...args:any[]): boolean; + setbit(args:any[], callback?:ResCallbackT): boolean; + setbit(...args:any[]): boolean; + getbit(args:any[], callback?:ResCallbackT): boolean; + getbit(...args:any[]): boolean; + setrange(args:any[], callback?:ResCallbackT): boolean; + setrange(...args:any[]): boolean; + getrange(args:any[], callback?:ResCallbackT): boolean; + getrange(...args:any[]): boolean; + substr(args:any[], callback?:ResCallbackT): boolean; + substr(...args:any[]): boolean; + incr(args:any[], callback?:ResCallbackT): boolean; + incr(...args:any[]): boolean; + decr(args:any[], callback?:ResCallbackT): boolean; + decr(...args:any[]): boolean; + mget(args:any[], callback?:ResCallbackT): boolean; + mget(...args:any[]): boolean; + rpush(...args:any[]): boolean; + lpush(args:any[], callback?:ResCallbackT): boolean; + lpush(...args:any[]): boolean; + rpushx(args:any[], callback?:ResCallbackT): boolean; + rpushx(...args:any[]): boolean; + lpushx(args:any[], callback?:ResCallbackT): boolean; + lpushx(...args:any[]): boolean; + linsert(args:any[], callback?:ResCallbackT): boolean; + linsert(...args:any[]): boolean; + rpop(args:any[], callback?:ResCallbackT): boolean; + rpop(...args:any[]): boolean; + lpop(args:any[], callback?:ResCallbackT): boolean; + lpop(...args:any[]): boolean; + brpop(args:any[], callback?:ResCallbackT): boolean; + brpop(...args:any[]): boolean; + brpoplpush(args:any[], callback?:ResCallbackT): boolean; + brpoplpush(...args:any[]): boolean; + blpop(args:any[], callback?:ResCallbackT): boolean; + blpop(...args:any[]): boolean; + llen(args:any[], callback?:ResCallbackT): boolean; + llen(...args:any[]): boolean; + lindex(args:any[], callback?:ResCallbackT): boolean; + lindex(...args:any[]): boolean; + lset(args:any[], callback?:ResCallbackT): boolean; + lset(...args:any[]): boolean; + lrange(args:any[], callback?:ResCallbackT): boolean; + lrange(...args:any[]): boolean; + ltrim(args:any[], callback?:ResCallbackT): boolean; + ltrim(...args:any[]): boolean; + lrem(args:any[], callback?:ResCallbackT): boolean; + lrem(...args:any[]): boolean; + rpoplpush(args:any[], callback?:ResCallbackT): boolean; + rpoplpush(...args:any[]): boolean; + sadd(args:any[], callback?:ResCallbackT): boolean; + sadd(...args:any[]): boolean; + srem(args:any[], callback?:ResCallbackT): boolean; + srem(...args:any[]): boolean; + smove(args:any[], callback?:ResCallbackT): boolean; + smove(...args:any[]): boolean; + sismember(args:any[], callback?:ResCallbackT): boolean; + sismember(...args:any[]): boolean; + scard(args:any[], callback?:ResCallbackT): boolean; + scard(...args:any[]): boolean; + spop(args:any[], callback?:ResCallbackT): boolean; + spop(...args:any[]): boolean; + srandmember(args:any[], callback?:ResCallbackT): boolean; + srandmember(...args:any[]): boolean; + sinter(args:any[], callback?:ResCallbackT): boolean; + sinter(...args:any[]): boolean; + sinterstore(args:any[], callback?:ResCallbackT): boolean; + sinterstore(...args:any[]): boolean; + sunion(args:any[], callback?:ResCallbackT): boolean; + sunion(...args:any[]): boolean; + sunionstore(args:any[], callback?:ResCallbackT): boolean; + sunionstore(...args:any[]): boolean; + sdiff(args:any[], callback?:ResCallbackT): boolean; + sdiff(...args:any[]): boolean; + sdiffstore(args:any[], callback?:ResCallbackT): boolean; + sdiffstore(...args:any[]): boolean; + smembers(args:any[], callback?:ResCallbackT): boolean; + smembers(...args:any[]): boolean; + zadd(args:any[], callback?:ResCallbackT): boolean; + zadd(...args:any[]): boolean; + zincrby(args:any[], callback?:ResCallbackT): boolean; + zincrby(...args:any[]): boolean; + zrem(args:any[], callback?:ResCallbackT): boolean; + zrem(...args:any[]): boolean; + zremrangebyscore(args:any[], callback?:ResCallbackT): boolean; + zremrangebyscore(...args:any[]): boolean; + zremrangebyrank(args:any[], callback?:ResCallbackT): boolean; + zremrangebyrank(...args:any[]): boolean; + zunionstore(args:any[], callback?:ResCallbackT): boolean; + zunionstore(...args:any[]): boolean; + zinterstore(args:any[], callback?:ResCallbackT): boolean; + zinterstore(...args:any[]): boolean; + zrange(args:any[], callback?:ResCallbackT): boolean; + zrange(...args:any[]): boolean; + zrangebyscore(args:any[], callback?:ResCallbackT): boolean; + zrangebyscore(...args:any[]): boolean; + zrevrangebyscore(args:any[], callback?:ResCallbackT): boolean; + zrevrangebyscore(...args:any[]): boolean; + zcount(args:any[], callback?:ResCallbackT): boolean; + zcount(...args:any[]): boolean; + zrevrange(args:any[], callback?:ResCallbackT): boolean; + zrevrange(...args:any[]): boolean; + zcard(args:any[], callback?:ResCallbackT): boolean; + zcard(...args:any[]): boolean; + zscore(args:any[], callback?:ResCallbackT): boolean; + zscore(...args:any[]): boolean; + zrank(args:any[], callback?:ResCallbackT): boolean; + zrank(...args:any[]): boolean; + zrevrank(args:any[], callback?:ResCallbackT): boolean; + zrevrank(...args:any[]): boolean; + hset(args:any[], callback?:ResCallbackT): boolean; + hset(...args:any[]): boolean; + hsetnx(args:any[], callback?:ResCallbackT): boolean; + hsetnx(...args:any[]): boolean; + hget(args:any[], callback?:ResCallbackT): boolean; + hget(...args:any[]): boolean; + hmset(args:any[], callback?:ResCallbackT): boolean; + hmset(key:string, hash:any, callback?:ResCallbackT): boolean; + hmset(...args:any[]): boolean; + hmget(args:any[], callback?:ResCallbackT): boolean; + hmget(...args:any[]): boolean; + hincrby(args:any[], callback?:ResCallbackT): boolean; + hincrby(...args:any[]): boolean; + hdel(args:any[], callback?:ResCallbackT): boolean; + hdel(...args:any[]): boolean; + hlen(args:any[], callback?:ResCallbackT): boolean; + hlen(...args:any[]): boolean; + hkeys(args:any[], callback?:ResCallbackT): boolean; + hkeys(...args:any[]): boolean; + hvals(args:any[], callback?:ResCallbackT): boolean; + hvals(...args:any[]): boolean; + hgetall(args:any[], callback?:ResCallbackT): boolean; + hgetall(...args:any[]): boolean; + hgetall(key:string, callback?:ResCallbackT): boolean; + hexists(args:any[], callback?:ResCallbackT): boolean; + hexists(...args:any[]): boolean; + incrby(args:any[], callback?:ResCallbackT): boolean; + incrby(...args:any[]): boolean; + decrby(args:any[], callback?:ResCallbackT): boolean; + decrby(...args:any[]): boolean; + getset(args:any[], callback?:ResCallbackT): boolean; + getset(...args:any[]): boolean; + mset(args:any[], callback?:ResCallbackT): boolean; + mset(...args:any[]): boolean; + msetnx(args:any[], callback?:ResCallbackT): boolean; + msetnx(...args:any[]): boolean; + randomkey(args:any[], callback?:ResCallbackT): boolean; + randomkey(...args:any[]): boolean; select(args:any[], callback?:ResCallbackT): void; - select(...args:any[]): void; - move(args:any[], callback?:ResCallbackT): void; - move(...args:any[]): void; - rename(args:any[], callback?:ResCallbackT): void; - rename(...args:any[]): void; - renamenx(args:any[], callback?:ResCallbackT): void; - renamenx(...args:any[]): void; - expire(args:any[], callback?:ResCallbackT): void; - expire(...args:any[]): void; - expireat(args:any[], callback?:ResCallbackT): void; - expireat(...args:any[]): void; - keys(args:any[], callback?:ResCallbackT): void; - keys(...args:any[]): void; - dbsize(args:any[], callback?:ResCallbackT): void; - dbsize(...args:any[]): void; + select(...args:any[]): boolean; + move(args:any[], callback?:ResCallbackT): boolean; + move(...args:any[]): boolean; + rename(args:any[], callback?:ResCallbackT): boolean; + rename(...args:any[]): boolean; + renamenx(args:any[], callback?:ResCallbackT): boolean; + renamenx(...args:any[]): boolean; + expire(args:any[], callback?:ResCallbackT): boolean; + expire(...args:any[]): boolean; + expireat(args:any[], callback?:ResCallbackT): boolean; + expireat(...args:any[]): boolean; + keys(args:any[], callback?:ResCallbackT): boolean; + keys(...args:any[]): boolean; + dbsize(args:any[], callback?:ResCallbackT): boolean; + dbsize(...args:any[]): boolean; auth(args:any[], callback?:ResCallbackT): void; auth(...args:any[]): void; - ping(args:any[], callback?:ResCallbackT): void; - ping(...args:any[]): void; - echo(args:any[], callback?:ResCallbackT): void; - echo(...args:any[]): void; - save(args:any[], callback?:ResCallbackT): void; - save(...args:any[]): void; - bgsave(args:any[], callback?:ResCallbackT): void; - bgsave(...args:any[]): void; - bgrewriteaof(args:any[], callback?:ResCallbackT): void; - bgrewriteaof(...args:any[]): void; - shutdown(args:any[], callback?:ResCallbackT): void; - shutdown(...args:any[]): void; - lastsave(args:any[], callback?:ResCallbackT): void; - lastsave(...args:any[]): void; - type(args:any[], callback?:ResCallbackT): void; - type(...args:any[]): void; - multi(args:any[], callback?:ResCallbackT): void; - multi(...args:any[]): void; - exec(args:any[], callback?:ResCallbackT): void; - exec(...args:any[]): void; - discard(args:any[], callback?:ResCallbackT): void; - discard(...args:any[]): void; - sync(args:any[], callback?:ResCallbackT): void; - sync(...args:any[]): void; - flushdb(args:any[], callback?:ResCallbackT): void; - flushdb(...args:any[]): void; - flushall(args:any[], callback?:ResCallbackT): void; - flushall(...args:any[]): void; - sort(args:any[], callback?:ResCallbackT): void; - sort(...args:any[]): void; - info(args:any[], callback?:ResCallbackT): void; - info(...args:any[]): void; - monitor(args:any[], callback?:ResCallbackT): void; - monitor(...args:any[]): void; - ttl(args:any[], callback?:ResCallbackT): void; - ttl(...args:any[]): void; - persist(args:any[], callback?:ResCallbackT): void; - persist(...args:any[]): void; - slaveof(args:any[], callback?:ResCallbackT): void; - slaveof(...args:any[]): void; - debug(args:any[], callback?:ResCallbackT): void; - debug(...args:any[]): void; - config(args:any[], callback?:ResCallbackT): void; - config(...args:any[]): void; - subscribe(args:any[], callback?:ResCallbackT): void; - subscribe(...args:any[]): void; - unsubscribe(args:any[], callback?:ResCallbackT): void; - unsubscribe(...args:any[]): void; - psubscribe(args:any[], callback?:ResCallbackT): void; - psubscribe(...args:any[]): void; - punsubscribe(args:any[], callback?:ResCallbackT): void; - punsubscribe(...args:any[]): void; - publish(args:any[], callback?:ResCallbackT): void; - publish(...args:any[]): void; - watch(args:any[], callback?:ResCallbackT): void; - watch(...args:any[]): void; - unwatch(args:any[], callback?:ResCallbackT): void; - unwatch(...args:any[]): void; - cluster(args:any[], callback?:ResCallbackT): void; - cluster(...args:any[]): void; - restore(args:any[], callback?:ResCallbackT): void; - restore(...args:any[]): void; - migrate(args:any[], callback?:ResCallbackT): void; - migrate(...args:any[]): void; - dump(args:any[], callback?:ResCallbackT): void; - dump(...args:any[]): void; - object(args:any[], callback?:ResCallbackT): void; - object(...args:any[]): void; - client(args:any[], callback?:ResCallbackT): void; - client(...args:any[]): void; - eval(args:any[], callback?:ResCallbackT): void; - eval(...args:any[]): void; - evalsha(args:any[], callback?:ResCallbackT): void; - evalsha(...args:any[]): void; - quit(args:any[], callback?:ResCallbackT): void; - quit(...args:any[]): void; + ping(args:any[], callback?:ResCallbackT): boolean; + ping(...args:any[]): boolean; + echo(args:any[], callback?:ResCallbackT): boolean; + echo(...args:any[]): boolean; + save(args:any[], callback?:ResCallbackT): boolean; + save(...args:any[]): boolean; + bgsave(args:any[], callback?:ResCallbackT): boolean; + bgsave(...args:any[]): boolean; + bgrewriteaof(args:any[], callback?:ResCallbackT): boolean; + bgrewriteaof(...args:any[]): boolean; + shutdown(args:any[], callback?:ResCallbackT): boolean; + shutdown(...args:any[]): boolean; + lastsave(args:any[], callback?:ResCallbackT): boolean; + lastsave(...args:any[]): boolean; + type(args:any[], callback?:ResCallbackT): boolean; + type(...args:any[]): boolean; + multi(args:any[], callback?:ResCallbackT): boolean; + multi(...args:any[]): boolean; + exec(args:any[], callback?:ResCallbackT): boolean; + exec(...args:any[]): boolean; + discard(args:any[], callback?:ResCallbackT): boolean; + discard(...args:any[]): boolean; + sync(args:any[], callback?:ResCallbackT): boolean; + sync(...args:any[]): boolean; + flushdb(args:any[], callback?:ResCallbackT): boolean; + flushdb(...args:any[]): boolean; + flushall(args:any[], callback?:ResCallbackT): boolean; + flushall(...args:any[]): boolean; + sort(args:any[], callback?:ResCallbackT): boolean; + sort(...args:any[]): boolean; + info(args:any[], callback?:ResCallbackT): boolean; + info(...args:any[]): boolean; + monitor(args:any[], callback?:ResCallbackT): boolean; + monitor(...args:any[]): boolean; + ttl(args:any[], callback?:ResCallbackT): boolean; + ttl(...args:any[]): boolean; + persist(args:any[], callback?:ResCallbackT): boolean; + persist(...args:any[]): boolean; + slaveof(args:any[], callback?:ResCallbackT): boolean; + slaveof(...args:any[]): boolean; + debug(args:any[], callback?:ResCallbackT): boolean; + debug(...args:any[]): boolean; + config(args:any[], callback?:ResCallbackT): boolean; + config(...args:any[]): boolean; + subscribe(args:any[], callback?:ResCallbackT): boolean; + subscribe(...args:any[]): boolean; + unsubscribe(args:any[], callback?:ResCallbackT): boolean; + unsubscribe(...args:any[]): boolean; + psubscribe(args:any[], callback?:ResCallbackT): boolean; + psubscribe(...args:any[]): boolean; + punsubscribe(args:any[], callback?:ResCallbackT): boolean; + punsubscribe(...args:any[]): boolean; + publish(args:any[], callback?:ResCallbackT): boolean; + publish(...args:any[]): boolean; + watch(args:any[], callback?:ResCallbackT): boolean; + watch(...args:any[]): boolean; + unwatch(args:any[], callback?:ResCallbackT): boolean; + unwatch(...args:any[]): boolean; + cluster(args:any[], callback?:ResCallbackT): boolean; + cluster(...args:any[]): boolean; + restore(args:any[], callback?:ResCallbackT): boolean; + restore(...args:any[]): boolean; + migrate(args:any[], callback?:ResCallbackT): boolean; + migrate(...args:any[]): boolean; + dump(args:any[], callback?:ResCallbackT): boolean; + dump(...args:any[]): boolean; + object(args:any[], callback?:ResCallbackT): boolean; + object(...args:any[]): boolean; + client(args:any[], callback?:ResCallbackT): boolean; + client(...args:any[]): boolean; + eval(args:any[], callback?:ResCallbackT): boolean; + eval(...args:any[]): boolean; + evalsha(args:any[], callback?:ResCallbackT): boolean; + evalsha(...args:any[]): boolean; + quit(args:any[], callback?:ResCallbackT): boolean; + quit(...args:any[]): boolean; } } From 014ff4745d4b02f8408e5ba4f9dca8e5ea92893a Mon Sep 17 00:00:00 2001 From: MugeSo Date: Thu, 20 Aug 2015 12:04:33 +0900 Subject: [PATCH 012/259] redis: add Multi interface as a return value of RedisClient.mult() --- redis/redis.d.ts | 266 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 264 insertions(+), 2 deletions(-) diff --git a/redis/redis.d.ts b/redis/redis.d.ts index 78d49499de..444b91c4ca 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -296,8 +296,8 @@ declare module "redis" { lastsave(...args:any[]): boolean; type(args:any[], callback?:ResCallbackT): boolean; type(...args:any[]): boolean; - multi(args:any[], callback?:ResCallbackT): boolean; - multi(...args:any[]): boolean; + multi(args:any[], callback?:ResCallbackT): Multi; + multi(...args:any[]): Multi; exec(args:any[], callback?:ResCallbackT): boolean; exec(...args:any[]): boolean; discard(args:any[], callback?:ResCallbackT): boolean; @@ -357,4 +357,266 @@ declare module "redis" { quit(args:any[], callback?:ResCallbackT): boolean; quit(...args:any[]): boolean; } + + interface Multi { + exec(callback?:ResCallbackT): boolean; + + get(args:any[], callback?:ResCallbackT): Multi; + get(...args:any[]): Multi; + set(args:any[], callback?:ResCallbackT): Multi; + set(...args:any[]): Multi; + setnx(args:any[], callback?:ResCallbackT): Multi; + setnx(...args:any[]): Multi; + setex(args:any[], callback?:ResCallbackT): Multi; + setex(...args:any[]): Multi; + append(args:any[], callback?:ResCallbackT): Multi; + append(...args:any[]): Multi; + strlen(args:any[], callback?:ResCallbackT): Multi; + strlen(...args:any[]): Multi; + del(args:any[], callback?:ResCallbackT): Multi; + del(...args:any[]): Multi; + exists(args:any[], callback?:ResCallbackT): Multi; + exists(...args:any[]): Multi; + setbit(args:any[], callback?:ResCallbackT): Multi; + setbit(...args:any[]): Multi; + getbit(args:any[], callback?:ResCallbackT): Multi; + getbit(...args:any[]): Multi; + setrange(args:any[], callback?:ResCallbackT): Multi; + setrange(...args:any[]): Multi; + getrange(args:any[], callback?:ResCallbackT): Multi; + getrange(...args:any[]): Multi; + substr(args:any[], callback?:ResCallbackT): Multi; + substr(...args:any[]): Multi; + incr(args:any[], callback?:ResCallbackT): Multi; + incr(...args:any[]): Multi; + decr(args:any[], callback?:ResCallbackT): Multi; + decr(...args:any[]): Multi; + mget(args:any[], callback?:ResCallbackT): Multi; + mget(...args:any[]): Multi; + rpush(...args:any[]): Multi; + lpush(args:any[], callback?:ResCallbackT): Multi; + lpush(...args:any[]): Multi; + rpushx(args:any[], callback?:ResCallbackT): Multi; + rpushx(...args:any[]): Multi; + lpushx(args:any[], callback?:ResCallbackT): Multi; + lpushx(...args:any[]): Multi; + linsert(args:any[], callback?:ResCallbackT): Multi; + linsert(...args:any[]): Multi; + rpop(args:any[], callback?:ResCallbackT): Multi; + rpop(...args:any[]): Multi; + lpop(args:any[], callback?:ResCallbackT): Multi; + lpop(...args:any[]): Multi; + brpop(args:any[], callback?:ResCallbackT): Multi; + brpop(...args:any[]): Multi; + brpoplpush(args:any[], callback?:ResCallbackT): Multi; + brpoplpush(...args:any[]): Multi; + blpop(args:any[], callback?:ResCallbackT): Multi; + blpop(...args:any[]): Multi; + llen(args:any[], callback?:ResCallbackT): Multi; + llen(...args:any[]): Multi; + lindex(args:any[], callback?:ResCallbackT): Multi; + lindex(...args:any[]): Multi; + lset(args:any[], callback?:ResCallbackT): Multi; + lset(...args:any[]): Multi; + lrange(args:any[], callback?:ResCallbackT): Multi; + lrange(...args:any[]): Multi; + ltrim(args:any[], callback?:ResCallbackT): Multi; + ltrim(...args:any[]): Multi; + lrem(args:any[], callback?:ResCallbackT): Multi; + lrem(...args:any[]): Multi; + rpoplpush(args:any[], callback?:ResCallbackT): Multi; + rpoplpush(...args:any[]): Multi; + sadd(args:any[], callback?:ResCallbackT): Multi; + sadd(...args:any[]): Multi; + srem(args:any[], callback?:ResCallbackT): Multi; + srem(...args:any[]): Multi; + smove(args:any[], callback?:ResCallbackT): Multi; + smove(...args:any[]): Multi; + sismember(args:any[], callback?:ResCallbackT): Multi; + sismember(...args:any[]): Multi; + scard(args:any[], callback?:ResCallbackT): Multi; + scard(...args:any[]): Multi; + spop(args:any[], callback?:ResCallbackT): Multi; + spop(...args:any[]): Multi; + srandmember(args:any[], callback?:ResCallbackT): Multi; + srandmember(...args:any[]): Multi; + sinter(args:any[], callback?:ResCallbackT): Multi; + sinter(...args:any[]): Multi; + sinterstore(args:any[], callback?:ResCallbackT): Multi; + sinterstore(...args:any[]): Multi; + sunion(args:any[], callback?:ResCallbackT): Multi; + sunion(...args:any[]): Multi; + sunionstore(args:any[], callback?:ResCallbackT): Multi; + sunionstore(...args:any[]): Multi; + sdiff(args:any[], callback?:ResCallbackT): Multi; + sdiff(...args:any[]): Multi; + sdiffstore(args:any[], callback?:ResCallbackT): Multi; + sdiffstore(...args:any[]): Multi; + smembers(args:any[], callback?:ResCallbackT): Multi; + smembers(...args:any[]): Multi; + zadd(args:any[], callback?:ResCallbackT): Multi; + zadd(...args:any[]): Multi; + zincrby(args:any[], callback?:ResCallbackT): Multi; + zincrby(...args:any[]): Multi; + zrem(args:any[], callback?:ResCallbackT): Multi; + zrem(...args:any[]): Multi; + zremrangebyscore(args:any[], callback?:ResCallbackT): Multi; + zremrangebyscore(...args:any[]): Multi; + zremrangebyrank(args:any[], callback?:ResCallbackT): Multi; + zremrangebyrank(...args:any[]): Multi; + zunionstore(args:any[], callback?:ResCallbackT): Multi; + zunionstore(...args:any[]): Multi; + zinterstore(args:any[], callback?:ResCallbackT): Multi; + zinterstore(...args:any[]): Multi; + zrange(args:any[], callback?:ResCallbackT): Multi; + zrange(...args:any[]): Multi; + zrangebyscore(args:any[], callback?:ResCallbackT): Multi; + zrangebyscore(...args:any[]): Multi; + zrevrangebyscore(args:any[], callback?:ResCallbackT): Multi; + zrevrangebyscore(...args:any[]): Multi; + zcount(args:any[], callback?:ResCallbackT): Multi; + zcount(...args:any[]): Multi; + zrevrange(args:any[], callback?:ResCallbackT): Multi; + zrevrange(...args:any[]): Multi; + zcard(args:any[], callback?:ResCallbackT): Multi; + zcard(...args:any[]): Multi; + zscore(args:any[], callback?:ResCallbackT): Multi; + zscore(...args:any[]): Multi; + zrank(args:any[], callback?:ResCallbackT): Multi; + zrank(...args:any[]): Multi; + zrevrank(args:any[], callback?:ResCallbackT): Multi; + zrevrank(...args:any[]): Multi; + hset(args:any[], callback?:ResCallbackT): Multi; + hset(...args:any[]): Multi; + hsetnx(args:any[], callback?:ResCallbackT): Multi; + hsetnx(...args:any[]): Multi; + hget(args:any[], callback?:ResCallbackT): Multi; + hget(...args:any[]): Multi; + hmset(args:any[], callback?:ResCallbackT): Multi; + hmset(key:string, hash:any, callback?:ResCallbackT): Multi; + hmset(...args:any[]): Multi; + hmget(args:any[], callback?:ResCallbackT): Multi; + hmget(...args:any[]): Multi; + hincrby(args:any[], callback?:ResCallbackT): Multi; + hincrby(...args:any[]): Multi; + hdel(args:any[], callback?:ResCallbackT): Multi; + hdel(...args:any[]): Multi; + hlen(args:any[], callback?:ResCallbackT): Multi; + hlen(...args:any[]): Multi; + hkeys(args:any[], callback?:ResCallbackT): Multi; + hkeys(...args:any[]): Multi; + hvals(args:any[], callback?:ResCallbackT): Multi; + hvals(...args:any[]): Multi; + hgetall(args:any[], callback?:ResCallbackT): Multi; + hgetall(...args:any[]): Multi; + hgetall(key:string, callback?:ResCallbackT): Multi; + hexists(args:any[], callback?:ResCallbackT): Multi; + hexists(...args:any[]): Multi; + incrby(args:any[], callback?:ResCallbackT): Multi; + incrby(...args:any[]): Multi; + decrby(args:any[], callback?:ResCallbackT): Multi; + decrby(...args:any[]): Multi; + getset(args:any[], callback?:ResCallbackT): Multi; + getset(...args:any[]): Multi; + mset(args:any[], callback?:ResCallbackT): Multi; + mset(...args:any[]): Multi; + msetnx(args:any[], callback?:ResCallbackT): Multi; + msetnx(...args:any[]): Multi; + randomkey(args:any[], callback?:ResCallbackT): Multi; + randomkey(...args:any[]): Multi; + select(args:any[], callback?:ResCallbackT): void; + select(...args:any[]): Multi; + move(args:any[], callback?:ResCallbackT): Multi; + move(...args:any[]): Multi; + rename(args:any[], callback?:ResCallbackT): Multi; + rename(...args:any[]): Multi; + renamenx(args:any[], callback?:ResCallbackT): Multi; + renamenx(...args:any[]): Multi; + expire(args:any[], callback?:ResCallbackT): Multi; + expire(...args:any[]): Multi; + expireat(args:any[], callback?:ResCallbackT): Multi; + expireat(...args:any[]): Multi; + keys(args:any[], callback?:ResCallbackT): Multi; + keys(...args:any[]): Multi; + dbsize(args:any[], callback?:ResCallbackT): Multi; + dbsize(...args:any[]): Multi; + auth(args:any[], callback?:ResCallbackT): void; + auth(...args:any[]): void; + ping(args:any[], callback?:ResCallbackT): Multi; + ping(...args:any[]): Multi; + echo(args:any[], callback?:ResCallbackT): Multi; + echo(...args:any[]): Multi; + save(args:any[], callback?:ResCallbackT): Multi; + save(...args:any[]): Multi; + bgsave(args:any[], callback?:ResCallbackT): Multi; + bgsave(...args:any[]): Multi; + bgrewriteaof(args:any[], callback?:ResCallbackT): Multi; + bgrewriteaof(...args:any[]): Multi; + shutdown(args:any[], callback?:ResCallbackT): Multi; + shutdown(...args:any[]): Multi; + lastsave(args:any[], callback?:ResCallbackT): Multi; + lastsave(...args:any[]): Multi; + type(args:any[], callback?:ResCallbackT): Multi; + type(...args:any[]): Multi; + multi(args:any[], callback?:ResCallbackT): Multi; + multi(...args:any[]): Multi; + exec(args:any[], callback?:ResCallbackT): Multi; + exec(...args:any[]): Multi; + discard(args:any[], callback?:ResCallbackT): Multi; + discard(...args:any[]): Multi; + sync(args:any[], callback?:ResCallbackT): Multi; + sync(...args:any[]): Multi; + flushdb(args:any[], callback?:ResCallbackT): Multi; + flushdb(...args:any[]): Multi; + flushall(args:any[], callback?:ResCallbackT): Multi; + flushall(...args:any[]): Multi; + sort(args:any[], callback?:ResCallbackT): Multi; + sort(...args:any[]): Multi; + info(args:any[], callback?:ResCallbackT): Multi; + info(...args:any[]): Multi; + monitor(args:any[], callback?:ResCallbackT): Multi; + monitor(...args:any[]): Multi; + ttl(args:any[], callback?:ResCallbackT): Multi; + ttl(...args:any[]): Multi; + persist(args:any[], callback?:ResCallbackT): Multi; + persist(...args:any[]): Multi; + slaveof(args:any[], callback?:ResCallbackT): Multi; + slaveof(...args:any[]): Multi; + debug(args:any[], callback?:ResCallbackT): Multi; + debug(...args:any[]): Multi; + config(args:any[], callback?:ResCallbackT): Multi; + config(...args:any[]): Multi; + subscribe(args:any[], callback?:ResCallbackT): Multi; + subscribe(...args:any[]): Multi; + unsubscribe(args:any[], callback?:ResCallbackT): Multi; + unsubscribe(...args:any[]): Multi; + psubscribe(args:any[], callback?:ResCallbackT): Multi; + psubscribe(...args:any[]): Multi; + punsubscribe(args:any[], callback?:ResCallbackT): Multi; + punsubscribe(...args:any[]): Multi; + publish(args:any[], callback?:ResCallbackT): Multi; + publish(...args:any[]): Multi; + watch(args:any[], callback?:ResCallbackT): Multi; + watch(...args:any[]): Multi; + unwatch(args:any[], callback?:ResCallbackT): Multi; + unwatch(...args:any[]): Multi; + cluster(args:any[], callback?:ResCallbackT): Multi; + cluster(...args:any[]): Multi; + restore(args:any[], callback?:ResCallbackT): Multi; + restore(...args:any[]): Multi; + migrate(args:any[], callback?:ResCallbackT): Multi; + migrate(...args:any[]): Multi; + dump(args:any[], callback?:ResCallbackT): Multi; + dump(...args:any[]): Multi; + object(args:any[], callback?:ResCallbackT): Multi; + object(...args:any[]): Multi; + client(args:any[], callback?:ResCallbackT): Multi; + client(...args:any[]): Multi; + eval(args:any[], callback?:ResCallbackT): Multi; + eval(...args:any[]): Multi; + evalsha(args:any[], callback?:ResCallbackT): Multi; + evalsha(...args:any[]): Multi; + quit(args:any[], callback?:ResCallbackT): Multi; + quit(...args:any[]): Multi; + } } From 907e23613e49fb5a979ee0e8cd0d8ad8b6f3cc43 Mon Sep 17 00:00:00 2001 From: MugeSo Date: Thu, 20 Aug 2015 12:05:49 +0900 Subject: [PATCH 013/259] redis: add missing methods to RedisClient --- redis/redis.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/redis/redis.d.ts b/redis/redis.d.ts index 444b91c4ca..c7e068d47c 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -69,6 +69,10 @@ declare module "redis" { server_info: ServerInfo; end(): void; + unref(): void; + + // Low level command execution + send_command(command:string, ...args:any[]): boolean; // Connection (http://redis.io/commands#connection) auth(password:string, callback?:ResCallbackT): boolean; From af84e7675e25c62cf5ea4f89ac002d5875490f3a Mon Sep 17 00:00:00 2001 From: MugeSo Date: Thu, 20 Aug 2015 12:10:23 +0900 Subject: [PATCH 014/259] redis: write redis version --- redis/redis.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/redis.d.ts b/redis/redis.d.ts index c7e068d47c..4f80416813 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -1,4 +1,4 @@ -// Type definitions for redis +// Type definitions for redis 0.12.1 // Project: https://github.com/mranney/node_redis // Definitions by: Carlos Ballesteros Velasco , Peter Harris , TANAKA Koichi // Definitions: https://github.com/borisyankov/DefinitelyTyped From 83d5bc71bc6bffb4a43147ab062a7c64bccca63e Mon Sep 17 00:00:00 2001 From: MugeSo Date: Sat, 22 Aug 2015 00:27:06 +0900 Subject: [PATCH 015/259] redis: fix RedisClient.select returns void degraded in 9ae4d7f --- redis/redis.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/redis.d.ts b/redis/redis.d.ts index 4f80416813..0e0a0a8a0a 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -267,7 +267,7 @@ declare module "redis" { randomkey(args:any[], callback?:ResCallbackT): boolean; randomkey(...args:any[]): boolean; select(args:any[], callback?:ResCallbackT): void; - select(...args:any[]): boolean; + select(...args:any[]): void; move(args:any[], callback?:ResCallbackT): boolean; move(...args:any[]): boolean; rename(args:any[], callback?:ResCallbackT): boolean; From 5760ad3aa8b50b38a95e5c009236d795b7b3962b Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Wed, 19 Aug 2015 05:09:15 +0500 Subject: [PATCH 016/259] lodash: added _.thru() method --- lodash/lodash-tests.ts | 42 ++++++++++++++++++++++++++-- lodash/lodash.d.ts | 62 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 98 insertions(+), 6 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 00ca144fd2..a363b8ea53 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -403,9 +403,45 @@ result = _([1, 2]).zipWith(testZipWithFn, any).value(); result = _([1, 2]).zipWith([1, 2], testZipWithFn, any).value(); result = _([1, 2]).zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, 2], testZipWithFn, any).value(); -// /* ************* -// * Collections * -// ************* */ +/********* + * Chain * + *********/ + +// _.thru +{ + let result: number; + result = _.thru(1, (value: number) => value); + result = _.thru(1, (value: number) => value, any); +} +{ + let result: _.LoDashWrapper; + result = _(1).thru((value: number) => value); + result = _(1).thru((value: number) => value, any); +} +{ + let result: _.LoDashWrapper; + result = _('').thru((value: string) => value); + result = _('').thru((value: string) => value, any); +} +{ + let result: _.LoDashWrapper; + result = _(true).thru((value: boolean) => value); + result = _(true).thru((value: boolean) => value, any); +} +{ + let result: _.LoDashObjectWrapper; + result = _({}).thru((value: Object) => value); + result = _({}).thru((value: Object) => value, any); +} +{ + let result: _.LoDashArrayWrapper; + result = _([1, 2, 3]).thru((value: number[]) => value); + result = _([1, 2, 3]).thru((value: number[]) => value, any); +} + +/************** + * Collection * + **************/ result = _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); result = _.at(['moe', 'larry', 'curly'], 0, 2); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 77daeca2a1..3436c48c4f 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2000,9 +2000,65 @@ declare module _ { zipWith(...args: any[]): LoDashArrayWrapper; } - /* ************* - * Collections * - ************* */ + /********* + * Chain * + *********/ + + //_.thru + interface LoDashStatic { + /** + * This method is like _.tap except that it returns the result of interceptor. + * @param value The value to provide to interceptor. + * @param interceptor The function to invoke. + * @param thisArg The this binding of interceptor. + * @return Returns the result of interceptor. + */ + thru( + value: T, + interceptor: (value: T) => TResult, + thisArg?: any): TResult; + } + + interface LoDashWrapperBase { + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult, + thisArg?: any): LoDashWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult, + thisArg?: any): LoDashWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult, + thisArg?: any): LoDashWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult, + thisArg?: any): LoDashObjectWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult[], + thisArg?: any): LoDashArrayWrapper; + } + + /************** + * Collection * + **************/ //_.at interface LoDashStatic { From e491d5785627cddaede890386dc84272040c47fc Mon Sep 17 00:00:00 2001 From: Louis Lagrange Date: Thu, 27 Aug 2015 17:11:06 +0200 Subject: [PATCH 017/259] fix cordova-plugin-vibration Functions in interface Notification are deprecated and replaced with a function in interface Navigator --- cordova/plugins/Vibration.d.ts | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/cordova/plugins/Vibration.d.ts b/cordova/plugins/Vibration.d.ts index 715f6625f9..65952f8e9b 100644 --- a/cordova/plugins/Vibration.d.ts +++ b/cordova/plugins/Vibration.d.ts @@ -1,17 +1,32 @@ // Type definitions for Apache Cordova Vibration plugin. // Project: https://github.com/apache/cordova-plugin-vibration -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies, Inc. , Louis Lagrange // Definitions: https://github.com/borisyankov/DefinitelyTyped -// +// // Copyright (c) Microsoft Open Technologies, Inc. // Licensed under the MIT license. +interface Navigator { + /** + * Vibrates the device for the specified amount of time. + * @param time Milliseconds to vibrate the device. 0 cancels the vibration. Ignored on iOS. + */ + vibrate(time: number): void; + + /** + * Vibrates the device with a given pattern. + * @param time Sequence of durations (in milliseconds) for which to turn on or off the vibrator. Ignored on iOS. + */ + vibrate(time: number[]): void; +} + interface Notification { /** * Vibrates the device for the specified amount of time. * @param time Milliseconds to vibrate the device. Ignored on iOS. + * @deprecated */ - vibrate(time: number): void + vibrate(time: number): void; /** * Vibrates the device with a given pattern. * @param number[] pattern Pattern with which to vibrate the device. @@ -19,10 +34,12 @@ interface Notification { * The next value - the number of milliseconds for which to keep the vibrator on before turning it off. * @param number repeat Optional index into the pattern array at which to start repeating (will repeat until canceled), * or -1 for no repetition (default). + * @deprecated */ vibrateWithPattern(pattern: number[], repeat: number): void; /** * Immediately cancels any currently running vibration. + * @deprecated */ cancelVibration(): void; -} \ No newline at end of file +} From 07c4e447f11813939def8d1d8ca818fc89d32e27 Mon Sep 17 00:00:00 2001 From: James Brantly Date: Thu, 27 Aug 2015 22:09:55 -0400 Subject: [PATCH 018/259] Reorganize React definitions --- react/README.md | 10 +- react/react-addons-tests.ts | 11 +- react/react-addons.d.ts | 1054 ---------------- react/react-global.d.ts | 941 --------------- ...-addons-global.d.ts => react-namespace.ts} | 12 +- react/react.d.ts | 1069 ++++++++++++++++- 6 files changed, 1080 insertions(+), 2017 deletions(-) delete mode 100644 react/react-addons.d.ts delete mode 100644 react/react-global.d.ts rename react/{react-addons-global.d.ts => react-namespace.ts} (98%) diff --git a/react/README.md b/react/README.md index 1f4cb7f036..c17ccaebe0 100644 --- a/react/README.md +++ b/react/README.md @@ -1,11 +1,5 @@ # React v0.13.3 Type Definitions This folder contains the following `.d.ts` files: -* `react.d.ts` declares the external module `"react"` -* `react-addons.d.ts` declares the external module `"react/addons"` -* `react-global.d.ts` declares the internal module `React` in the global namespace -* `react-addons-global.d.ts` extends the global `React` module with `addons` - -Interfaces are duplicated between these files; please take care to keep them in sync when making changes. -See [#3615](https://github.com/borisyankov/DefinitelyTyped/pull/3615) for relevant discussion. - +* `react.d.ts` declares the module `"react"` and `"react/addons"` +* `react-namespace.d.ts` declares the global namespace `React` (only include this if you are actually using the global `React`) diff --git a/react/react-addons-tests.ts b/react/react-addons-tests.ts index 6976d9959d..f4f6db8e7e 100644 --- a/react/react-addons-tests.ts +++ b/react/react-addons-tests.ts @@ -1,4 +1,4 @@ -/// +/// import React = require("react/addons"); import TestUtils = React.addons.TestUtils; @@ -206,16 +206,15 @@ myComponent.reset(); // -------------------------------------------------------------------------- var children: any[] = ["Hello world", [null], React.DOM.span(null)]; -var divStyle = { // CSSProperties - flex: "1 1 main-size", - backgroundImage: "url('hello.png')" -}; var htmlAttr: React.HTMLAttributes = { key: 36, ref: "htmlComponent", children: children, className: "test-attr", - style: divStyle, + style: { // CSSProperties + flex: "1 1 main-size", + backgroundImage: "url('hello.png')" + }, onClick: (event: React.MouseEvent) => { event.preventDefault(); event.stopPropagation(); diff --git a/react/react-addons.d.ts b/react/react-addons.d.ts deleted file mode 100644 index 822f370b8e..0000000000 --- a/react/react-addons.d.ts +++ /dev/null @@ -1,1054 +0,0 @@ -// Type definitions for ReactWithAddons v0.13.1 (external module) -// Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare module "react/addons" { - // - // React Elements - // ---------------------------------------------------------------------- - - type ReactType = ComponentClass | string; - - interface ReactElement

{ - type: string | ComponentClass

; - props: P; - key: string | number; - ref: string | ((component: Component) => any); - } - - interface ClassicElement

extends ReactElement

{ - type: string | ClassicComponentClass

; - ref: string | ((component: ClassicComponent) => any); - } - - interface DOMElement

extends ClassicElement

{ - type: string; - ref: string | ((component: DOMComponent

) => any); - } - - type HTMLElement = DOMElement; - type SVGElement = DOMElement; - - // - // Factories - // ---------------------------------------------------------------------- - - interface Factory

{ - (props?: P, ...children: ReactNode[]): ReactElement

; - } - - interface ClassicFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ClassicElement

; - } - - interface DOMFactory

extends ClassicFactory

{ - (props?: P, ...children: ReactNode[]): DOMElement

; - } - - type HTMLFactory = DOMFactory; - type SVGFactory = DOMFactory; - - // - // React Nodes - // http://facebook.github.io/react/docs/glossary.html - // ---------------------------------------------------------------------- - - type ReactText = string | number; - type ReactChild = ReactElement | ReactText; - - // Should be Array but type aliases cannot be recursive - type ReactFragment = {} | Array; - type ReactNode = ReactChild | ReactFragment | boolean; - - // - // Top Level API - // ---------------------------------------------------------------------- - - function createClass(spec: ComponentSpec): ClassicComponentClass

; - - function createFactory

(type: string): DOMFactory

; - function createFactory

(type: ClassicComponentClass

| string): ClassicFactory

; - function createFactory

(type: ComponentClass

): Factory

; - - function createElement

( - type: string, - props?: P, - ...children: ReactNode[]): DOMElement

; - function createElement

( - type: ClassicComponentClass

| string, - props?: P, - ...children: ReactNode[]): ClassicElement

; - function createElement

( - type: ComponentClass

, - props?: P, - ...children: ReactNode[]): ReactElement

; - - function cloneElement

( - element: DOMElement

, - props?: P, - ...children: ReactNode[]): DOMElement

; - function cloneElement

( - element: ClassicElement

, - props?: P, - ...children: ReactNode[]): ClassicElement

; - function cloneElement

( - element: ReactElement

, - props?: P, - ...children: ReactNode[]): ReactElement

; - - function render

( - element: DOMElement

, - container: Element, - callback?: () => any): DOMComponent

; - function render( - element: ClassicElement

, - container: Element, - callback?: () => any): ClassicComponent; - function render( - element: ReactElement

, - container: Element, - callback?: () => any): Component; - - function unmountComponentAtNode(container: Element): boolean; - function renderToString(element: ReactElement): string; - function renderToStaticMarkup(element: ReactElement): string; - function isValidElement(object: {}): boolean; - function initializeTouchEvents(shouldUseTouch: boolean): void; - - function findDOMNode( - componentOrElement: Component | Element): TElement; - function findDOMNode( - componentOrElement: Component | Element): Element; - - var DOM: ReactDOM; - var PropTypes: ReactPropTypes; - var Children: ReactChildren; - - // - // Component API - // ---------------------------------------------------------------------- - - // Base component for plain JS classes - class Component implements ComponentLifecycle { - constructor(props?: P, context?: any); - setState(f: (prevState: S, props: P) => S, callback?: () => any): void; - setState(state: S, callback?: () => any): void; - forceUpdate(): void; - props: P; - state: S; - context: {}; - refs: { - [key: string]: Component - }; - } - - interface ClassicComponent extends Component { - replaceState(nextState: S, callback?: () => any): void; - getDOMNode(): TElement; - getDOMNode(): Element; - isMounted(): boolean; - getInitialState?(): S; - setProps(nextProps: P, callback?: () => any): void; - replaceProps(nextProps: P, callback?: () => any): void; - } - - interface DOMComponent

extends ClassicComponent { - tagName: string; - } - - type HTMLComponent = DOMComponent; - type SVGComponent = DOMComponent; - - interface ChildContextProvider { - getChildContext(): CC; - } - - // - // Class Interfaces - // ---------------------------------------------------------------------- - - interface ComponentClass

{ - new(props?: P, context?: any): Component; - propTypes?: ValidationMap

; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap; - defaultProps?: P; - } - - interface ClassicComponentClass

extends ComponentClass

{ - new(props?: P, context?: any): ClassicComponent; - getDefaultProps?(): P; - displayName?: string; - } - - // - // Component Specs and Lifecycle - // ---------------------------------------------------------------------- - - interface ComponentLifecycle { - componentWillMount?(): void; - componentDidMount?(): void; - componentWillReceiveProps?(nextProps: P, nextContext: any): void; - shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; - componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; - componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; - componentWillUnmount?(): void; - } - - interface Mixin extends ComponentLifecycle { - mixins?: Mixin; - statics?: { - [key: string]: any; - }; - - displayName?: string; - propTypes?: ValidationMap; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap - - getDefaultProps?(): P; - getInitialState?(): S; - } - - interface ComponentSpec extends Mixin { - render(): ReactElement; - } - - // - // Event System - // ---------------------------------------------------------------------- - - interface SyntheticEvent { - bubbles: boolean; - cancelable: boolean; - currentTarget: EventTarget; - defaultPrevented: boolean; - eventPhase: number; - isTrusted: boolean; - nativeEvent: Event; - preventDefault(): void; - stopPropagation(): void; - target: EventTarget; - timeStamp: Date; - type: string; - } - - interface DragEvent extends SyntheticEvent { - dataTransfer: DataTransfer; - } - - interface ClipboardEvent extends SyntheticEvent { - clipboardData: DataTransfer; - } - - interface KeyboardEvent extends SyntheticEvent { - altKey: boolean; - charCode: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - key: string; - keyCode: number; - locale: string; - location: number; - metaKey: boolean; - repeat: boolean; - shiftKey: boolean; - which: number; - } - - interface FocusEvent extends SyntheticEvent { - relatedTarget: EventTarget; - } - - interface FormEvent extends SyntheticEvent { - } - - interface MouseEvent extends SyntheticEvent { - altKey: boolean; - button: number; - buttons: number; - clientX: number; - clientY: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - pageX: number; - pageY: number; - relatedTarget: EventTarget; - screenX: number; - screenY: number; - shiftKey: boolean; - } - - interface TouchEvent extends SyntheticEvent { - altKey: boolean; - changedTouches: TouchList; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - shiftKey: boolean; - targetTouches: TouchList; - touches: TouchList; - } - - interface UIEvent extends SyntheticEvent { - detail: number; - view: AbstractView; - } - - interface WheelEvent extends SyntheticEvent { - deltaMode: number; - deltaX: number; - deltaY: number; - deltaZ: number; - } - - // - // Event Handler Types - // ---------------------------------------------------------------------- - - interface EventHandler { - (event: E): void; - } - - interface DragEventHandler extends EventHandler {} - interface ClipboardEventHandler extends EventHandler {} - interface KeyboardEventHandler extends EventHandler {} - interface FocusEventHandler extends EventHandler {} - interface FormEventHandler extends EventHandler {} - interface MouseEventHandler extends EventHandler {} - interface TouchEventHandler extends EventHandler {} - interface UIEventHandler extends EventHandler {} - interface WheelEventHandler extends EventHandler {} - - // - // Props / DOM Attributes - // ---------------------------------------------------------------------- - - interface Props { - children?: ReactNode; - key?: string | number; - ref?: string | ((component: T) => any); - } - - interface DOMAttributes extends Props> { - onCopy?: ClipboardEventHandler; - onCut?: ClipboardEventHandler; - onPaste?: ClipboardEventHandler; - onKeyDown?: KeyboardEventHandler; - onKeyPress?: KeyboardEventHandler; - onKeyUp?: KeyboardEventHandler; - onFocus?: FocusEventHandler; - onBlur?: FocusEventHandler; - onChange?: FormEventHandler; - onInput?: FormEventHandler; - onSubmit?: FormEventHandler; - onClick?: MouseEventHandler; - onDoubleClick?: MouseEventHandler; - onDrag?: DragEventHandler; - onDragEnd?: DragEventHandler; - onDragEnter?: DragEventHandler; - onDragExit?: DragEventHandler; - onDragLeave?: DragEventHandler; - onDragOver?: DragEventHandler; - onDragStart?: DragEventHandler; - onDrop?: DragEventHandler; - onMouseDown?: MouseEventHandler; - onMouseEnter?: MouseEventHandler; - onMouseLeave?: MouseEventHandler; - onMouseMove?: MouseEventHandler; - onMouseOut?: MouseEventHandler; - onMouseOver?: MouseEventHandler; - onMouseUp?: MouseEventHandler; - onTouchCancel?: TouchEventHandler; - onTouchEnd?: TouchEventHandler; - onTouchMove?: TouchEventHandler; - onTouchStart?: TouchEventHandler; - onScroll?: UIEventHandler; - onWheel?: WheelEventHandler; - - dangerouslySetInnerHTML?: { - __html: string; - }; - } - - // This interface is not complete. Only properties accepting - // unitless numbers are listed here (see CSSProperty.js in React) - interface CSSProperties { - boxFlex?: number; - boxFlexGroup?: number; - columnCount?: number; - flex?: number | string; - flexGrow?: number; - flexShrink?: number; - fontWeight?: number | string; - lineClamp?: number; - lineHeight?: number | string; - opacity?: number; - order?: number; - orphans?: number; - widows?: number; - zIndex?: number; - zoom?: number; - - // SVG-related properties - fillOpacity?: number; - strokeOpacity?: number; - strokeWidth?: number; - } - - interface HTMLAttributes extends DOMAttributes { - ref?: string | ((component: HTMLComponent) => void); - - accept?: string; - acceptCharset?: string; - accessKey?: string; - action?: string; - allowFullScreen?: boolean; - allowTransparency?: boolean; - alt?: string; - async?: boolean; - autoComplete?: boolean; - autoFocus?: boolean; - autoPlay?: boolean; - cellPadding?: number | string; - cellSpacing?: number | string; - charSet?: string; - checked?: boolean; - classID?: string; - className?: string; - cols?: number; - colSpan?: number; - content?: string; - contentEditable?: boolean; - contextMenu?: string; - controls?: any; - coords?: string; - crossOrigin?: string; - data?: string; - dateTime?: string; - defaultChecked?: boolean; - defaultValue?: string; - defer?: boolean; - dir?: string; - disabled?: boolean; - download?: any; - draggable?: boolean; - encType?: string; - form?: string; - formAction?: string; - formEncType?: string; - formMethod?: string; - formNoValidate?: boolean; - formTarget?: string; - frameBorder?: number | string; - headers?: string; - height?: number | string; - hidden?: boolean; - high?: number; - href?: string; - hrefLang?: string; - htmlFor?: string; - httpEquiv?: string; - icon?: string; - id?: string; - label?: string; - lang?: string; - list?: string; - loop?: boolean; - low?: number; - manifest?: string; - marginHeight?: number; - marginWidth?: number; - max?: number | string; - maxLength?: number; - media?: string; - mediaGroup?: string; - method?: string; - min?: number | string; - multiple?: boolean; - muted?: boolean; - name?: string; - noValidate?: boolean; - open?: boolean; - optimum?: number; - pattern?: string; - placeholder?: string; - poster?: string; - preload?: string; - radioGroup?: string; - readOnly?: boolean; - rel?: string; - required?: boolean; - role?: string; - rows?: number; - rowSpan?: number; - sandbox?: string; - scope?: string; - scoped?: boolean; - scrolling?: string; - seamless?: boolean; - selected?: boolean; - shape?: string; - size?: number; - sizes?: string; - span?: number; - spellCheck?: boolean; - src?: string; - srcDoc?: string; - srcSet?: string; - start?: number; - step?: number | string; - style?: CSSProperties; - tabIndex?: number; - target?: string; - title?: string; - type?: string; - useMap?: string; - value?: string; - width?: number | string; - wmode?: string; - - // Non-standard Attributes - autoCapitalize?: boolean; - autoCorrect?: boolean; - property?: string; - itemProp?: string; - itemScope?: boolean; - itemType?: string; - unselectable?: boolean; - } - - interface SVGAttributes extends DOMAttributes { - ref?: string | ((component: SVGComponent) => void); - - cx?: number | string; - cy?: number | string; - d?: string; - dx?: number | string; - dy?: number | string; - fill?: string; - fillOpacity?: number | string; - fontFamily?: string; - fontSize?: number | string; - fx?: number | string; - fy?: number | string; - gradientTransform?: string; - gradientUnits?: string; - height?: number | string; - markerEnd?: string; - markerMid?: string; - markerStart?: string; - offset?: number | string; - opacity?: number | string; - patternContentUnits?: string; - patternUnits?: string; - points?: string; - preserveAspectRatio?: string; - r?: number | string; - rx?: number | string; - ry?: number | string; - spreadMethod?: string; - stopColor?: string; - stopOpacity?: number | string; - stroke?: string; - strokeDasharray?: string; - strokeLinecap?: string; - strokeOpacity?: number | string; - strokeWidth?: number | string; - textAnchor?: string; - transform?: string; - version?: string; - viewBox?: string; - width?: number | string; - x1?: number | string; - x2?: number | string; - x?: number | string; - y1?: number | string; - y2?: number | string - y?: number | string; - } - - // - // React.DOM - // ---------------------------------------------------------------------- - - interface ReactDOM { - // HTML - a: HTMLFactory; - abbr: HTMLFactory; - address: HTMLFactory; - area: HTMLFactory; - article: HTMLFactory; - aside: HTMLFactory; - audio: HTMLFactory; - b: HTMLFactory; - base: HTMLFactory; - bdi: HTMLFactory; - bdo: HTMLFactory; - big: HTMLFactory; - blockquote: HTMLFactory; - body: HTMLFactory; - br: HTMLFactory; - button: HTMLFactory; - canvas: HTMLFactory; - caption: HTMLFactory; - cite: HTMLFactory; - code: HTMLFactory; - col: HTMLFactory; - colgroup: HTMLFactory; - data: HTMLFactory; - datalist: HTMLFactory; - dd: HTMLFactory; - del: HTMLFactory; - details: HTMLFactory; - dfn: HTMLFactory; - dialog: HTMLFactory; - div: HTMLFactory; - dl: HTMLFactory; - dt: HTMLFactory; - em: HTMLFactory; - embed: HTMLFactory; - fieldset: HTMLFactory; - figcaption: HTMLFactory; - figure: HTMLFactory; - footer: HTMLFactory; - form: HTMLFactory; - h1: HTMLFactory; - h2: HTMLFactory; - h3: HTMLFactory; - h4: HTMLFactory; - h5: HTMLFactory; - h6: HTMLFactory; - head: HTMLFactory; - header: HTMLFactory; - hr: HTMLFactory; - html: HTMLFactory; - i: HTMLFactory; - iframe: HTMLFactory; - img: HTMLFactory; - input: HTMLFactory; - ins: HTMLFactory; - kbd: HTMLFactory; - keygen: HTMLFactory; - label: HTMLFactory; - legend: HTMLFactory; - li: HTMLFactory; - link: HTMLFactory; - main: HTMLFactory; - map: HTMLFactory; - mark: HTMLFactory; - menu: HTMLFactory; - menuitem: HTMLFactory; - meta: HTMLFactory; - meter: HTMLFactory; - nav: HTMLFactory; - noscript: HTMLFactory; - object: HTMLFactory; - ol: HTMLFactory; - optgroup: HTMLFactory; - option: HTMLFactory; - output: HTMLFactory; - p: HTMLFactory; - param: HTMLFactory; - picture: HTMLFactory; - pre: HTMLFactory; - progress: HTMLFactory; - q: HTMLFactory; - rp: HTMLFactory; - rt: HTMLFactory; - ruby: HTMLFactory; - s: HTMLFactory; - samp: HTMLFactory; - script: HTMLFactory; - section: HTMLFactory; - select: HTMLFactory; - small: HTMLFactory; - source: HTMLFactory; - span: HTMLFactory; - strong: HTMLFactory; - style: HTMLFactory; - sub: HTMLFactory; - summary: HTMLFactory; - sup: HTMLFactory; - table: HTMLFactory; - tbody: HTMLFactory; - td: HTMLFactory; - textarea: HTMLFactory; - tfoot: HTMLFactory; - th: HTMLFactory; - thead: HTMLFactory; - time: HTMLFactory; - title: HTMLFactory; - tr: HTMLFactory; - track: HTMLFactory; - u: HTMLFactory; - ul: HTMLFactory; - "var": HTMLFactory; - video: HTMLFactory; - wbr: HTMLFactory; - - // SVG - circle: SVGFactory; - defs: SVGFactory; - ellipse: SVGFactory; - g: SVGFactory; - line: SVGFactory; - linearGradient: SVGFactory; - mask: SVGFactory; - path: SVGFactory; - pattern: SVGFactory; - polygon: SVGFactory; - polyline: SVGFactory; - radialGradient: SVGFactory; - rect: SVGFactory; - stop: SVGFactory; - svg: SVGFactory; - text: SVGFactory; - tspan: SVGFactory; - } - - // - // React.PropTypes - // ---------------------------------------------------------------------- - - interface Validator { - (object: T, key: string, componentName: string): Error; - } - - interface Requireable extends Validator { - isRequired: Validator; - } - - interface ValidationMap { - [key: string]: Validator; - } - - interface ReactPropTypes { - any: Requireable; - array: Requireable; - bool: Requireable; - func: Requireable; - number: Requireable; - object: Requireable; - string: Requireable; - node: Requireable; - element: Requireable; - instanceOf(expectedClass: {}): Requireable; - oneOf(types: any[]): Requireable; - oneOfType(types: Validator[]): Requireable; - arrayOf(type: Validator): Requireable; - objectOf(type: Validator): Requireable; - shape(type: ValidationMap): Requireable; - } - - // - // React.Children - // ---------------------------------------------------------------------- - - interface ReactChildren { - map(children: ReactNode, fn: (child: ReactChild, index: number) => T): { [key:string]: T }; - forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; - count(children: ReactNode): number; - only(children: ReactNode): ReactChild; - } - - // - // React.addons - // ---------------------------------------------------------------------- - - export module addons { - export var CSSTransitionGroup: CSSTransitionGroup; - export var TransitionGroup: TransitionGroup; - - export var LinkedStateMixin: LinkedStateMixin; - export var PureRenderMixin: PureRenderMixin; - - export function batchedUpdates( - callback: (a: A, b: B) => any, a: A, b: B): void; - export function batchedUpdates(callback: (a: A) => any, a: A): void; - export function batchedUpdates(callback: () => any): void; - - // deprecated: use petehunt/react-classset or JedWatson/classnames - export function classSet(cx: { [key: string]: boolean }): string; - export function classSet(...classList: string[]): string; - - export function cloneWithProps

( - element: DOMElement

, props: P): DOMElement

; - export function cloneWithProps

( - element: ClassicElement

, props: P): ClassicElement

; - export function cloneWithProps

( - element: ReactElement

, props: P): ReactElement

; - - export function createFragment( - object: { [key: string]: ReactNode }): ReactFragment; - - export function update(value: any[], spec: UpdateArraySpec): any[]; - export function update(value: {}, spec: UpdateSpec): any; - - // Development tools - export import Perf = ReactPerf; - export import TestUtils = ReactTestUtils; - } - - // - // React.addons (Transitions) - // ---------------------------------------------------------------------- - - interface TransitionGroupProps { - component?: ReactType; - childFactory?: (child: ReactElement) => ReactElement; - } - - interface CSSTransitionGroupProps extends TransitionGroupProps { - transitionName: string; - transitionAppear?: boolean; - transitionEnter?: boolean; - transitionLeave?: boolean; - } - - type CSSTransitionGroup = ComponentClass; - type TransitionGroup = ComponentClass; - - // - // React.addons (Mixins) - // ---------------------------------------------------------------------- - - interface ReactLink { - value: T; - requestChange(newValue: T): void; - } - - interface LinkedStateMixin extends Mixin { - linkState(key: string): ReactLink; - } - - interface PureRenderMixin extends Mixin { - } - - // - // Reat.addons.update - // ---------------------------------------------------------------------- - - interface UpdateSpec { - $set?: any; - $merge?: {}; - $apply?(value: any): any; - // [key: string]: UpdateSpec; - } - - interface UpdateArraySpec extends UpdateSpec { - $push?: any[]; - $unshift?: any[]; - $splice?: any[][]; - } - - // - // React.addons.Perf - // ---------------------------------------------------------------------- - - interface ComponentPerfContext { - current: string; - owner: string; - } - - interface NumericPerfContext { - [key: string]: number; - } - - interface Measurements { - exclusive: NumericPerfContext; - inclusive: NumericPerfContext; - render: NumericPerfContext; - counts: NumericPerfContext; - writes: NumericPerfContext; - displayNames: { - [key: string]: ComponentPerfContext; - }; - totalTime: number; - } - - module ReactPerf { - export function start(): void; - export function stop(): void; - export function printInclusive(measurements: Measurements[]): void; - export function printExclusive(measurements: Measurements[]): void; - export function printWasted(measurements: Measurements[]): void; - export function printDOM(measurements: Measurements[]): void; - export function getLastMeasurements(): Measurements[]; - } - - // - // React.addons.TestUtils - // ---------------------------------------------------------------------- - - interface MockedComponentClass { - new(): any; - } - - module ReactTestUtils { - export import Simulate = ReactSimulate; - - export function renderIntoDocument

( - element: ReactElement

): Component; - export function renderIntoDocument>( - element: ReactElement): C; - - export function mockComponent( - mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils; - - export function isElementOfType( - element: ReactElement, type: ReactType): boolean; - export function isTextComponent(instance: Component): boolean; - export function isDOMComponent(instance: Component): boolean; - export function isCompositeComponent(instance: Component): boolean; - export function isCompositeComponentWithType( - instance: Component, - type: ComponentClass): boolean; - - export function findAllInRenderedTree( - tree: Component, - fn: (i: Component) => boolean): Component; - - export function scryRenderedDOMComponentsWithClass( - tree: Component, - className: string): DOMComponent[]; - export function findRenderedDOMComponentWithClass( - tree: Component, - className: string): DOMComponent; - - export function scryRenderedDOMComponentsWithTag( - tree: Component, - tagName: string): DOMComponent[]; - export function findRenderedDOMComponentWithTag( - tree: Component, - tagName: string): DOMComponent; - - export function scryRenderedComponentsWithType

( - tree: Component, - type: ComponentClass

): Component[]; - export function scryRenderedComponentsWithType>( - tree: Component, - type: ComponentClass): C[]; - - export function findRenderedComponentWithType

( - tree: Component, - type: ComponentClass

): Component; - export function findRenderedComponentWithType>( - tree: Component, - type: ComponentClass): C; - - export function createRenderer(): ShallowRenderer; - } - - interface SyntheticEventData { - altKey?: boolean; - button?: number; - buttons?: number; - clientX?: number; - clientY?: number; - changedTouches?: TouchList; - charCode?: boolean; - clipboardData?: DataTransfer; - ctrlKey?: boolean; - deltaMode?: number; - deltaX?: number; - deltaY?: number; - deltaZ?: number; - detail?: number; - getModifierState?(key: string): boolean; - key?: string; - keyCode?: number; - locale?: string; - location?: number; - metaKey?: boolean; - pageX?: number; - pageY?: number; - relatedTarget?: EventTarget; - repeat?: boolean; - screenX?: number; - screenY?: number; - shiftKey?: boolean; - targetTouches?: TouchList; - touches?: TouchList; - view?: AbstractView; - which?: number; - } - - interface EventSimulator { - (element: Element, eventData?: SyntheticEventData): void; - (component: Component, eventData?: SyntheticEventData): void; - } - - module ReactSimulate { - export var blur: EventSimulator; - export var change: EventSimulator; - export var click: EventSimulator; - export var cut: EventSimulator; - export var doubleClick: EventSimulator; - export var drag: EventSimulator; - export var dragEnd: EventSimulator; - export var dragEnter: EventSimulator; - export var dragExit: EventSimulator; - export var dragLeave: EventSimulator; - export var dragOver: EventSimulator; - export var dragStart: EventSimulator; - export var drop: EventSimulator; - export var focus: EventSimulator; - export var input: EventSimulator; - export var keyDown: EventSimulator; - export var keyPress: EventSimulator; - export var keyUp: EventSimulator; - export var mouseDown: EventSimulator; - export var mouseEnter: EventSimulator; - export var mouseLeave: EventSimulator; - export var mouseMove: EventSimulator; - export var mouseOut: EventSimulator; - export var mouseOver: EventSimulator; - export var mouseUp: EventSimulator; - export var paste: EventSimulator; - export var scroll: EventSimulator; - export var submit: EventSimulator; - export var touchCancel: EventSimulator; - export var touchEnd: EventSimulator; - export var touchMove: EventSimulator; - export var touchStart: EventSimulator; - export var wheel: EventSimulator; - } - - class ShallowRenderer { - getRenderOutput>(): E; - getRenderOutput(): ReactElement; - render(element: ReactElement, context?: any): void; - unmount(): void; - } - - // - // Browser Interfaces - // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts - // ---------------------------------------------------------------------- - - interface AbstractView { - styleMedia: StyleMedia; - document: Document; - } - - interface Touch { - identifier: number; - target: EventTarget; - screenX: number; - screenY: number; - clientX: number; - clientY: number; - pageX: number; - pageY: number; - } - - interface TouchList { - [index: number]: Touch; - length: number; - item(index: number): Touch; - identifiedTouch(identifier: number): Touch; - } -} diff --git a/react/react-global.d.ts b/react/react-global.d.ts deleted file mode 100644 index df8aaf421c..0000000000 --- a/react/react-global.d.ts +++ /dev/null @@ -1,941 +0,0 @@ -// Type definitions for React v0.13.1 (internal module) -// Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign , Microsoft -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare module React { - // - // React Elements - // ---------------------------------------------------------------------- - - type ReactType = ComponentClass | string; - - interface ReactElement

{ - type: string | ComponentClass

; - props: P; - key: string | number; - ref: string | ((component: Component) => any); - } - - interface ClassicElement

extends ReactElement

{ - type: string | ClassicComponentClass

; - ref: string | ((component: ClassicComponent) => any); - } - - interface DOMElement

extends ClassicElement

{ - type: string; - ref: string | ((component: DOMComponent

) => any); - } - - type HTMLElement = DOMElement; - type SVGElement = DOMElement; - - // - // Factories - // ---------------------------------------------------------------------- - - interface Factory

{ - (props?: P, ...children: ReactNode[]): ReactElement

; - } - - interface ClassicFactory

extends Factory

{ - (props?: P, ...children: ReactNode[]): ClassicElement

; - } - - interface DOMFactory

extends ClassicFactory

{ - (props?: P, ...children: ReactNode[]): DOMElement

; - } - - type HTMLFactory = DOMFactory; - type SVGFactory = DOMFactory; - type SVGElementFactory = DOMFactory; - - // - // React Nodes - // http://facebook.github.io/react/docs/glossary.html - // ---------------------------------------------------------------------- - - type ReactText = string | number; - type ReactChild = ReactElement | ReactText; - - // Should be Array but type aliases cannot be recursive - type ReactFragment = {} | Array; - type ReactNode = ReactChild | ReactFragment | boolean; - - // - // Top Level API - // ---------------------------------------------------------------------- - - function createClass(spec: ComponentSpec): ClassicComponentClass

; - - function createFactory

(type: string): DOMFactory

; - function createFactory

(type: ClassicComponentClass

| string): ClassicFactory

; - function createFactory

(type: ComponentClass

): Factory

; - - function createElement

( - type: string, - props?: P, - ...children: ReactNode[]): DOMElement

; - function createElement

( - type: ClassicComponentClass

| string, - props?: P, - ...children: ReactNode[]): ClassicElement

; - function createElement

( - type: ComponentClass

, - props?: P, - ...children: ReactNode[]): ReactElement

; - - function cloneElement

( - element: DOMElement

, - props?: P, - ...children: ReactNode[]): DOMElement

; - function cloneElement

( - element: ClassicElement

, - props?: P, - ...children: ReactNode[]): ClassicElement

; - function cloneElement

( - element: ReactElement

, - props?: P, - ...children: ReactNode[]): ReactElement

; - - function render

( - element: DOMElement

, - container: Element, - callback?: () => any): DOMComponent

; - function render( - element: ClassicElement

, - container: Element, - callback?: () => any): ClassicComponent; - function render( - element: ReactElement

, - container: Element, - callback?: () => any): Component; - - function unmountComponentAtNode(container: Element): boolean; - function renderToString(element: ReactElement): string; - function renderToStaticMarkup(element: ReactElement): string; - function isValidElement(object: {}): boolean; - function initializeTouchEvents(shouldUseTouch: boolean): void; - - function findDOMNode( - componentOrElement: Component | Element): TElement; - function findDOMNode( - componentOrElement: Component | Element): Element; - - var DOM: ReactDOM; - var PropTypes: ReactPropTypes; - var Children: ReactChildren; - - // - // Component API - // ---------------------------------------------------------------------- - - // Base component for plain JS classes - class Component implements ComponentLifecycle { - constructor(props?: P, context?: any); - setState(f: (prevState: S, props: P) => S, callback?: () => any): void; - setState(state: S, callback?: () => any): void; - forceUpdate(): void; - render(): JSX.Element; - props: P; - state: S; - context: {}; - refs: { - [key: string]: Component - }; - } - - interface ClassicComponent extends Component { - replaceState(nextState: S, callback?: () => any): void; - getDOMNode(): TElement; - getDOMNode(): Element; - isMounted(): boolean; - getInitialState?(): S; - setProps(nextProps: P, callback?: () => any): void; - replaceProps(nextProps: P, callback?: () => any): void; - } - - interface DOMComponent

extends ClassicComponent { - tagName: string; - } - - type HTMLComponent = DOMComponent; - type SVGComponent = DOMComponent; - - interface ChildContextProvider { - getChildContext(): CC; - } - - // - // Class Interfaces - // ---------------------------------------------------------------------- - - interface ComponentClass

{ - new(props?: P, context?: any): Component; - propTypes?: ValidationMap

; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap; - defaultProps?: P; - } - - interface ClassicComponentClass

extends ComponentClass

{ - new(props?: P, context?: any): ClassicComponent; - getDefaultProps?(): P; - displayName?: string; - } - - // - // Component Specs and Lifecycle - // ---------------------------------------------------------------------- - - interface ComponentLifecycle { - componentWillMount?(): void; - componentDidMount?(): void; - componentWillReceiveProps?(nextProps: P, nextContext: any): void; - shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; - componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; - componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; - componentWillUnmount?(): void; - } - - interface Mixin extends ComponentLifecycle { - mixins?: Mixin; - statics?: { - [key: string]: any; - }; - - displayName?: string; - propTypes?: ValidationMap; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap - - getDefaultProps?(): P; - getInitialState?(): S; - } - - interface ComponentSpec extends Mixin { - render(): ReactElement; - - [propertyName: string]: any; - } - - // - // Event System - // ---------------------------------------------------------------------- - - interface SyntheticEvent { - bubbles: boolean; - cancelable: boolean; - currentTarget: EventTarget; - defaultPrevented: boolean; - eventPhase: number; - isTrusted: boolean; - nativeEvent: Event; - preventDefault(): void; - stopPropagation(): void; - target: EventTarget; - timeStamp: Date; - type: string; - } - - interface DragEvent extends SyntheticEvent { - dataTransfer: DataTransfer; - } - - interface ClipboardEvent extends SyntheticEvent { - clipboardData: DataTransfer; - } - - interface KeyboardEvent extends SyntheticEvent { - altKey: boolean; - charCode: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - key: string; - keyCode: number; - locale: string; - location: number; - metaKey: boolean; - repeat: boolean; - shiftKey: boolean; - which: number; - } - - interface FocusEvent extends SyntheticEvent { - relatedTarget: EventTarget; - } - - interface FormEvent extends SyntheticEvent { - } - - interface MouseEvent extends SyntheticEvent { - altKey: boolean; - button: number; - buttons: number; - clientX: number; - clientY: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - pageX: number; - pageY: number; - relatedTarget: EventTarget; - screenX: number; - screenY: number; - shiftKey: boolean; - } - - interface TouchEvent extends SyntheticEvent { - altKey: boolean; - changedTouches: TouchList; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - shiftKey: boolean; - targetTouches: TouchList; - touches: TouchList; - } - - interface UIEvent extends SyntheticEvent { - detail: number; - view: AbstractView; - } - - interface WheelEvent extends SyntheticEvent { - deltaMode: number; - deltaX: number; - deltaY: number; - deltaZ: number; - } - - // - // Event Handler Types - // ---------------------------------------------------------------------- - - interface EventHandler { - (event: E): void; - } - - interface DragEventHandler extends EventHandler {} - interface ClipboardEventHandler extends EventHandler {} - interface KeyboardEventHandler extends EventHandler {} - interface FocusEventHandler extends EventHandler {} - interface FormEventHandler extends EventHandler {} - interface MouseEventHandler extends EventHandler {} - interface TouchEventHandler extends EventHandler {} - interface UIEventHandler extends EventHandler {} - interface WheelEventHandler extends EventHandler {} - - // - // Props / DOM Attributes - // ---------------------------------------------------------------------- - - interface Props { - children?: ReactNode; - key?: string | number; - ref?: string | ((component: T) => any); - } - - interface DOMAttributes extends Props> { - onCopy?: ClipboardEventHandler; - onCut?: ClipboardEventHandler; - onPaste?: ClipboardEventHandler; - onKeyDown?: KeyboardEventHandler; - onKeyPress?: KeyboardEventHandler; - onKeyUp?: KeyboardEventHandler; - onFocus?: FocusEventHandler; - onBlur?: FocusEventHandler; - onChange?: FormEventHandler; - onInput?: FormEventHandler; - onSubmit?: FormEventHandler; - onClick?: MouseEventHandler; - onDoubleClick?: MouseEventHandler; - onDrag?: DragEventHandler; - onDragEnd?: DragEventHandler; - onDragEnter?: DragEventHandler; - onDragExit?: DragEventHandler; - onDragLeave?: DragEventHandler; - onDragOver?: DragEventHandler; - onDragStart?: DragEventHandler; - onDrop?: DragEventHandler; - onMouseDown?: MouseEventHandler; - onMouseEnter?: MouseEventHandler; - onMouseLeave?: MouseEventHandler; - onMouseMove?: MouseEventHandler; - onMouseOut?: MouseEventHandler; - onMouseOver?: MouseEventHandler; - onMouseUp?: MouseEventHandler; - onTouchCancel?: TouchEventHandler; - onTouchEnd?: TouchEventHandler; - onTouchMove?: TouchEventHandler; - onTouchStart?: TouchEventHandler; - onScroll?: UIEventHandler; - onWheel?: WheelEventHandler; - - dangerouslySetInnerHTML?: { - __html: string; - }; - } - - // This interface is not complete. Only properties accepting - // unitless numbers are listed here (see CSSProperty.js in React) - interface CSSProperties { - boxFlex?: number; - boxFlexGroup?: number; - columnCount?: number; - flex?: number | string; - flexGrow?: number; - flexShrink?: number; - fontWeight?: number | string; - lineClamp?: number; - lineHeight?: number | string; - opacity?: number; - order?: number; - orphans?: number; - widows?: number; - zIndex?: number; - zoom?: number; - - fontSize?: number | string; - - // SVG-related properties - fillOpacity?: number; - strokeOpacity?: number; - strokeWidth?: number; - - [propertyName: string]: string | number | boolean; - } - - interface HTMLAttributes extends DOMAttributes { - ref?: string | ((component: HTMLComponent) => void); - - accept?: string; - acceptCharset?: string; - accessKey?: string; - action?: string; - allowFullScreen?: boolean; - allowTransparency?: boolean; - alt?: string; - async?: boolean; - autoComplete?: boolean; - autoFocus?: boolean; - autoPlay?: boolean; - cellPadding?: number | string; - cellSpacing?: number | string; - charSet?: string; - checked?: boolean; - classID?: string; - className?: string; - cols?: number; - colSpan?: number; - content?: string; - contentEditable?: boolean; - contextMenu?: string; - controls?: any; - coords?: string; - crossOrigin?: string; - data?: string; - dateTime?: string; - defaultChecked?: boolean; - defaultValue?: string; - defer?: boolean; - dir?: string; - disabled?: boolean; - download?: any; - draggable?: boolean; - encType?: string; - form?: string; - formAction?: string; - formEncType?: string; - formMethod?: string; - formNoValidate?: boolean; - formTarget?: string; - frameBorder?: number | string; - headers?: string; - height?: number | string; - hidden?: boolean; - high?: number; - href?: string; - hrefLang?: string; - htmlFor?: string; - httpEquiv?: string; - icon?: string; - id?: string; - label?: string; - lang?: string; - list?: string; - loop?: boolean; - low?: number; - manifest?: string; - marginHeight?: number; - marginWidth?: number; - max?: number | string; - maxLength?: number; - media?: string; - mediaGroup?: string; - method?: string; - min?: number | string; - multiple?: boolean; - muted?: boolean; - name?: string; - noValidate?: boolean; - open?: boolean; - optimum?: number; - pattern?: string; - placeholder?: string; - poster?: string; - preload?: string; - radioGroup?: string; - readOnly?: boolean; - rel?: string; - required?: boolean; - role?: string; - rows?: number; - rowSpan?: number; - sandbox?: string; - scope?: string; - scoped?: boolean; - scrolling?: string; - seamless?: boolean; - selected?: boolean; - shape?: string; - size?: number; - sizes?: string; - span?: number; - spellCheck?: boolean; - src?: string; - srcDoc?: string; - srcSet?: string; - start?: number; - step?: number | string; - style?: CSSProperties; - tabIndex?: number; - target?: string; - title?: string; - type?: string; - useMap?: string; - value?: string; - width?: number | string; - wmode?: string; - - // Non-standard Attributes - autoCapitalize?: boolean; - autoCorrect?: boolean; - property?: string; - itemProp?: string; - itemScope?: boolean; - itemType?: string; - unselectable?: boolean; - } - - interface SVGElementAttributes extends HTMLAttributes { - viewBox?: string; - preserveAspectRatio?: string; - } - - interface SVGAttributes extends DOMAttributes { - ref?: string | ((component: SVGComponent) => void); - - cx?: number | string; - cy?: number | string; - d?: string; - dx?: number | string; - dy?: number | string; - fill?: string; - fillOpacity?: number | string; - fontFamily?: string; - fontSize?: number | string; - fx?: number | string; - fy?: number | string; - gradientTransform?: string; - gradientUnits?: string; - height?: number | string; - markerEnd?: string; - markerMid?: string; - markerStart?: string; - offset?: number | string; - opacity?: number | string; - patternContentUnits?: string; - patternUnits?: string; - points?: string; - preserveAspectRatio?: string; - r?: number | string; - rx?: number | string; - ry?: number | string; - spreadMethod?: string; - stopColor?: string; - stopOpacity?: number | string; - stroke?: string; - strokeDasharray?: string; - strokeLinecap?: string; - strokeOpacity?: number | string; - strokeWidth?: number | string; - textAnchor?: string; - transform?: string; - version?: string; - viewBox?: string; - width?: number | string; - x1?: number | string; - x2?: number | string; - x?: number | string; - y1?: number | string; - y2?: number | string - y?: number | string; - } - - // - // React.DOM - // ---------------------------------------------------------------------- - - interface ReactDOM { - // HTML - a: HTMLFactory; - abbr: HTMLFactory; - address: HTMLFactory; - area: HTMLFactory; - article: HTMLFactory; - aside: HTMLFactory; - audio: HTMLFactory; - b: HTMLFactory; - base: HTMLFactory; - bdi: HTMLFactory; - bdo: HTMLFactory; - big: HTMLFactory; - blockquote: HTMLFactory; - body: HTMLFactory; - br: HTMLFactory; - button: HTMLFactory; - canvas: HTMLFactory; - caption: HTMLFactory; - cite: HTMLFactory; - code: HTMLFactory; - col: HTMLFactory; - colgroup: HTMLFactory; - data: HTMLFactory; - datalist: HTMLFactory; - dd: HTMLFactory; - del: HTMLFactory; - details: HTMLFactory; - dfn: HTMLFactory; - dialog: HTMLFactory; - div: HTMLFactory; - dl: HTMLFactory; - dt: HTMLFactory; - em: HTMLFactory; - embed: HTMLFactory; - fieldset: HTMLFactory; - figcaption: HTMLFactory; - figure: HTMLFactory; - footer: HTMLFactory; - form: HTMLFactory; - h1: HTMLFactory; - h2: HTMLFactory; - h3: HTMLFactory; - h4: HTMLFactory; - h5: HTMLFactory; - h6: HTMLFactory; - head: HTMLFactory; - header: HTMLFactory; - hr: HTMLFactory; - html: HTMLFactory; - i: HTMLFactory; - iframe: HTMLFactory; - img: HTMLFactory; - input: HTMLFactory; - ins: HTMLFactory; - kbd: HTMLFactory; - keygen: HTMLFactory; - label: HTMLFactory; - legend: HTMLFactory; - li: HTMLFactory; - link: HTMLFactory; - main: HTMLFactory; - map: HTMLFactory; - mark: HTMLFactory; - menu: HTMLFactory; - menuitem: HTMLFactory; - meta: HTMLFactory; - meter: HTMLFactory; - nav: HTMLFactory; - noscript: HTMLFactory; - object: HTMLFactory; - ol: HTMLFactory; - optgroup: HTMLFactory; - option: HTMLFactory; - output: HTMLFactory; - p: HTMLFactory; - param: HTMLFactory; - picture: HTMLFactory; - pre: HTMLFactory; - progress: HTMLFactory; - q: HTMLFactory; - rp: HTMLFactory; - rt: HTMLFactory; - ruby: HTMLFactory; - s: HTMLFactory; - samp: HTMLFactory; - script: HTMLFactory; - section: HTMLFactory; - select: HTMLFactory; - small: HTMLFactory; - source: HTMLFactory; - span: HTMLFactory; - strong: HTMLFactory; - style: HTMLFactory; - sub: HTMLFactory; - summary: HTMLFactory; - sup: HTMLFactory; - table: HTMLFactory; - tbody: HTMLFactory; - td: HTMLFactory; - textarea: HTMLFactory; - tfoot: HTMLFactory; - th: HTMLFactory; - thead: HTMLFactory; - time: HTMLFactory; - title: HTMLFactory; - tr: HTMLFactory; - track: HTMLFactory; - u: HTMLFactory; - ul: HTMLFactory; - "var": HTMLFactory; - video: HTMLFactory; - wbr: HTMLFactory; - - // SVG - svg: SVGElementFactory; - circle: SVGFactory; - defs: SVGFactory; - ellipse: SVGFactory; - g: SVGFactory; - line: SVGFactory; - linearGradient: SVGFactory; - mask: SVGFactory; - path: SVGFactory; - pattern: SVGFactory; - polygon: SVGFactory; - polyline: SVGFactory; - radialGradient: SVGFactory; - rect: SVGFactory; - stop: SVGFactory; - text: SVGFactory; - tspan: SVGFactory; - } - - // - // React.PropTypes - // ---------------------------------------------------------------------- - - interface Validator { - (object: T, key: string, componentName: string): Error; - } - - interface Requireable extends Validator { - isRequired: Validator; - } - - interface ValidationMap { - [key: string]: Validator; - } - - interface ReactPropTypes { - any: Requireable; - array: Requireable; - bool: Requireable; - func: Requireable; - number: Requireable; - object: Requireable; - string: Requireable; - node: Requireable; - element: Requireable; - instanceOf(expectedClass: {}): Requireable; - oneOf(types: any[]): Requireable; - oneOfType(types: Validator[]): Requireable; - arrayOf(type: Validator): Requireable; - objectOf(type: Validator): Requireable; - shape(type: ValidationMap): Requireable; - } - - // - // React.Children - // ---------------------------------------------------------------------- - - interface ReactChildren { - map(children: ReactNode, fn: (child: ReactChild, index: number) => T): { [key:string]: T }; - forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; - count(children: ReactNode): number; - only(children: ReactNode): ReactChild; - } - - // - // Browser Interfaces - // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts - // ---------------------------------------------------------------------- - - interface AbstractView { - styleMedia: StyleMedia; - document: Document; - } - - interface Touch { - identifier: number; - target: EventTarget; - screenX: number; - screenY: number; - clientX: number; - clientY: number; - pageX: number; - pageY: number; - } - - interface TouchList { - [index: number]: Touch; - length: number; - item(index: number): Touch; - identifiedTouch(identifier: number): Touch; - } -} - -declare module JSX { - interface Element extends React.ReactElement { } - interface ElementClass extends React.Component { - render(): JSX.Element; - } - interface ElementAttributesProperty { props: {}; } - - interface IntrinsicElements { - // HTML - a: React.HTMLAttributes; - abbr: React.HTMLAttributes; - address: React.HTMLAttributes; - area: React.HTMLAttributes; - article: React.HTMLAttributes; - aside: React.HTMLAttributes; - audio: React.HTMLAttributes; - b: React.HTMLAttributes; - base: React.HTMLAttributes; - bdi: React.HTMLAttributes; - bdo: React.HTMLAttributes; - big: React.HTMLAttributes; - blockquote: React.HTMLAttributes; - body: React.HTMLAttributes; - br: React.HTMLAttributes; - button: React.HTMLAttributes; - canvas: React.HTMLAttributes; - caption: React.HTMLAttributes; - cite: React.HTMLAttributes; - code: React.HTMLAttributes; - col: React.HTMLAttributes; - colgroup: React.HTMLAttributes; - data: React.HTMLAttributes; - datalist: React.HTMLAttributes; - dd: React.HTMLAttributes; - del: React.HTMLAttributes; - details: React.HTMLAttributes; - dfn: React.HTMLAttributes; - dialog: React.HTMLAttributes; - div: React.HTMLAttributes; - dl: React.HTMLAttributes; - dt: React.HTMLAttributes; - em: React.HTMLAttributes; - embed: React.HTMLAttributes; - fieldset: React.HTMLAttributes; - figcaption: React.HTMLAttributes; - figure: React.HTMLAttributes; - footer: React.HTMLAttributes; - form: React.HTMLAttributes; - h1: React.HTMLAttributes; - h2: React.HTMLAttributes; - h3: React.HTMLAttributes; - h4: React.HTMLAttributes; - h5: React.HTMLAttributes; - h6: React.HTMLAttributes; - head: React.HTMLAttributes; - header: React.HTMLAttributes; - hr: React.HTMLAttributes; - html: React.HTMLAttributes; - i: React.HTMLAttributes; - iframe: React.HTMLAttributes; - img: React.HTMLAttributes; - input: React.HTMLAttributes; - ins: React.HTMLAttributes; - kbd: React.HTMLAttributes; - keygen: React.HTMLAttributes; - label: React.HTMLAttributes; - legend: React.HTMLAttributes; - li: React.HTMLAttributes; - link: React.HTMLAttributes; - main: React.HTMLAttributes; - map: React.HTMLAttributes; - mark: React.HTMLAttributes; - menu: React.HTMLAttributes; - menuitem: React.HTMLAttributes; - meta: React.HTMLAttributes; - meter: React.HTMLAttributes; - nav: React.HTMLAttributes; - noscript: React.HTMLAttributes; - object: React.HTMLAttributes; - ol: React.HTMLAttributes; - optgroup: React.HTMLAttributes; - option: React.HTMLAttributes; - output: React.HTMLAttributes; - p: React.HTMLAttributes; - param: React.HTMLAttributes; - picture: React.HTMLAttributes; - pre: React.HTMLAttributes; - progress: React.HTMLAttributes; - q: React.HTMLAttributes; - rp: React.HTMLAttributes; - rt: React.HTMLAttributes; - ruby: React.HTMLAttributes; - s: React.HTMLAttributes; - samp: React.HTMLAttributes; - script: React.HTMLAttributes; - section: React.HTMLAttributes; - select: React.HTMLAttributes; - small: React.HTMLAttributes; - source: React.HTMLAttributes; - span: React.HTMLAttributes; - strong: React.HTMLAttributes; - style: React.HTMLAttributes; - sub: React.HTMLAttributes; - summary: React.HTMLAttributes; - sup: React.HTMLAttributes; - table: React.HTMLAttributes; - tbody: React.HTMLAttributes; - td: React.HTMLAttributes; - textarea: React.HTMLAttributes; - tfoot: React.HTMLAttributes; - th: React.HTMLAttributes; - thead: React.HTMLAttributes; - time: React.HTMLAttributes; - title: React.HTMLAttributes; - tr: React.HTMLAttributes; - track: React.HTMLAttributes; - u: React.HTMLAttributes; - ul: React.HTMLAttributes; - "var": React.HTMLAttributes; - video: React.HTMLAttributes; - wbr: React.HTMLAttributes; - - // SVG - svg: React.SVGElementAttributes; - - circle: React.SVGAttributes; - defs: React.SVGAttributes; - ellipse: React.SVGAttributes; - g: React.SVGAttributes; - line: React.SVGAttributes; - linearGradient: React.SVGAttributes; - mask: React.SVGAttributes; - path: React.SVGAttributes; - pattern: React.SVGAttributes; - polygon: React.SVGAttributes; - polyline: React.SVGAttributes; - radialGradient: React.SVGAttributes; - rect: React.SVGAttributes; - stop: React.SVGAttributes; - text: React.SVGAttributes; - tspan: React.SVGAttributes; - } -} diff --git a/react/react-addons-global.d.ts b/react/react-namespace.ts similarity index 98% rename from react/react-addons-global.d.ts rename to react/react-namespace.ts index 508ae05225..99fba1e3de 100644 --- a/react/react-addons-global.d.ts +++ b/react/react-namespace.ts @@ -1,10 +1,13 @@ -// Type definitions for ReactWithAddons v0.13.1 (internal module) +// Type definitions for React v0.13.3 (namespace) // Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign +// Definitions by: Asana , AssureSign , Microsoft // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// -declare module React { +/// + +import React = __React; + +declare namespace __React { // // React.addons // ---------------------------------------------------------------------- @@ -275,4 +278,3 @@ declare module React { unmount(): void; } } - diff --git a/react/react.d.ts b/react/react.d.ts index a124e7b50d..98d19688be 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -1,9 +1,9 @@ -// Type definitions for React v0.13.1 (external module) +// Type definitions for React v0.13.3 // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign , Microsoft // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module __React { +declare namespace __React { // // React Elements // ---------------------------------------------------------------------- @@ -800,7 +800,1070 @@ declare module "react" { export = __React; } -declare module JSX { +declare module "react/addons" { + // + // React Elements + // ---------------------------------------------------------------------- + + type ReactType = ComponentClass | string; + + interface ReactElement

{ + type: string | ComponentClass

; + props: P; + key: string | number; + ref: string | ((component: Component) => any); + } + + interface ClassicElement

extends ReactElement

{ + type: string | ClassicComponentClass

; + ref: string | ((component: ClassicComponent) => any); + } + + interface DOMElement

extends ClassicElement

{ + type: string; + ref: string | ((component: DOMComponent

) => any); + } + + type HTMLElement = DOMElement; + type SVGElement = DOMElement; + + // + // Factories + // ---------------------------------------------------------------------- + + interface Factory

{ + (props?: P, ...children: ReactNode[]): ReactElement

; + } + + interface ClassicFactory

extends Factory

{ + (props?: P, ...children: ReactNode[]): ClassicElement

; + } + + interface DOMFactory

extends ClassicFactory

{ + (props?: P, ...children: ReactNode[]): DOMElement

; + } + + type HTMLFactory = DOMFactory; + type SVGFactory = DOMFactory; + type SVGElementFactory = DOMFactory; + + // + // React Nodes + // http://facebook.github.io/react/docs/glossary.html + // ---------------------------------------------------------------------- + + type ReactText = string | number; + type ReactChild = ReactElement | ReactText; + + // Should be Array but type aliases cannot be recursive + type ReactFragment = {} | Array; + type ReactNode = ReactChild | ReactFragment | boolean; + + // + // Top Level API + // ---------------------------------------------------------------------- + + function createClass(spec: ComponentSpec): ClassicComponentClass

; + + function createFactory

(type: string): DOMFactory

; + function createFactory

(type: ClassicComponentClass

| string): ClassicFactory

; + function createFactory

(type: ComponentClass

): Factory

; + + function createElement

( + type: string, + props?: P, + ...children: ReactNode[]): DOMElement

; + function createElement

( + type: ClassicComponentClass

| string, + props?: P, + ...children: ReactNode[]): ClassicElement

; + function createElement

( + type: ComponentClass

, + props?: P, + ...children: ReactNode[]): ReactElement

; + + function cloneElement

( + element: DOMElement

, + props?: P, + ...children: ReactNode[]): DOMElement

; + function cloneElement

( + element: ClassicElement

, + props?: P, + ...children: ReactNode[]): ClassicElement

; + function cloneElement

( + element: ReactElement

, + props?: P, + ...children: ReactNode[]): ReactElement

; + + function render

( + element: DOMElement

, + container: Element, + callback?: () => any): DOMComponent

; + function render( + element: ClassicElement

, + container: Element, + callback?: () => any): ClassicComponent; + function render( + element: ReactElement

, + container: Element, + callback?: () => any): Component; + + function unmountComponentAtNode(container: Element): boolean; + function renderToString(element: ReactElement): string; + function renderToStaticMarkup(element: ReactElement): string; + function isValidElement(object: {}): boolean; + function initializeTouchEvents(shouldUseTouch: boolean): void; + + function findDOMNode( + componentOrElement: Component | Element): TElement; + function findDOMNode( + componentOrElement: Component | Element): Element; + + var DOM: ReactDOM; + var PropTypes: ReactPropTypes; + var Children: ReactChildren; + + // + // Component API + // ---------------------------------------------------------------------- + + // Base component for plain JS classes + class Component implements ComponentLifecycle { + constructor(props?: P, context?: any); + setState(f: (prevState: S, props: P) => S, callback?: () => any): void; + setState(state: S, callback?: () => any): void; + forceUpdate(): void; + render(): JSX.Element; + props: P; + state: S; + context: {}; + refs: { + [key: string]: Component + }; + } + + interface ClassicComponent extends Component { + replaceState(nextState: S, callback?: () => any): void; + getDOMNode(): TElement; + getDOMNode(): Element; + isMounted(): boolean; + getInitialState?(): S; + setProps(nextProps: P, callback?: () => any): void; + replaceProps(nextProps: P, callback?: () => any): void; + } + + interface DOMComponent

extends ClassicComponent { + tagName: string; + } + + type HTMLComponent = DOMComponent; + type SVGComponent = DOMComponent; + + interface ChildContextProvider { + getChildContext(): CC; + } + + // + // Class Interfaces + // ---------------------------------------------------------------------- + + interface ComponentClass

{ + new(props?: P, context?: any): Component; + propTypes?: ValidationMap

; + contextTypes?: ValidationMap; + childContextTypes?: ValidationMap; + defaultProps?: P; + } + + interface ClassicComponentClass

extends ComponentClass

{ + new(props?: P, context?: any): ClassicComponent; + getDefaultProps?(): P; + displayName?: string; + } + + // + // Component Specs and Lifecycle + // ---------------------------------------------------------------------- + + interface ComponentLifecycle { + componentWillMount?(): void; + componentDidMount?(): void; + componentWillReceiveProps?(nextProps: P, nextContext: any): void; + shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; + componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; + componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; + componentWillUnmount?(): void; + } + + interface Mixin extends ComponentLifecycle { + mixins?: Mixin; + statics?: { + [key: string]: any; + }; + + displayName?: string; + propTypes?: ValidationMap; + contextTypes?: ValidationMap; + childContextTypes?: ValidationMap + + getDefaultProps?(): P; + getInitialState?(): S; + } + + interface ComponentSpec extends Mixin { + render(): ReactElement; + + [propertyName: string]: any; + } + + // + // Event System + // ---------------------------------------------------------------------- + + interface SyntheticEvent { + bubbles: boolean; + cancelable: boolean; + currentTarget: EventTarget; + defaultPrevented: boolean; + eventPhase: number; + isTrusted: boolean; + nativeEvent: Event; + preventDefault(): void; + stopPropagation(): void; + target: EventTarget; + timeStamp: Date; + type: string; + } + + interface DragEvent extends SyntheticEvent { + dataTransfer: DataTransfer; + } + + interface ClipboardEvent extends SyntheticEvent { + clipboardData: DataTransfer; + } + + interface KeyboardEvent extends SyntheticEvent { + altKey: boolean; + charCode: number; + ctrlKey: boolean; + getModifierState(key: string): boolean; + key: string; + keyCode: number; + locale: string; + location: number; + metaKey: boolean; + repeat: boolean; + shiftKey: boolean; + which: number; + } + + interface FocusEvent extends SyntheticEvent { + relatedTarget: EventTarget; + } + + interface FormEvent extends SyntheticEvent { + } + + interface MouseEvent extends SyntheticEvent { + altKey: boolean; + button: number; + buttons: number; + clientX: number; + clientY: number; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + pageX: number; + pageY: number; + relatedTarget: EventTarget; + screenX: number; + screenY: number; + shiftKey: boolean; + } + + interface TouchEvent extends SyntheticEvent { + altKey: boolean; + changedTouches: TouchList; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + shiftKey: boolean; + targetTouches: TouchList; + touches: TouchList; + } + + interface UIEvent extends SyntheticEvent { + detail: number; + view: AbstractView; + } + + interface WheelEvent extends SyntheticEvent { + deltaMode: number; + deltaX: number; + deltaY: number; + deltaZ: number; + } + + // + // Event Handler Types + // ---------------------------------------------------------------------- + + interface EventHandler { + (event: E): void; + } + + interface DragEventHandler extends EventHandler {} + interface ClipboardEventHandler extends EventHandler {} + interface KeyboardEventHandler extends EventHandler {} + interface FocusEventHandler extends EventHandler {} + interface FormEventHandler extends EventHandler {} + interface MouseEventHandler extends EventHandler {} + interface TouchEventHandler extends EventHandler {} + interface UIEventHandler extends EventHandler {} + interface WheelEventHandler extends EventHandler {} + + // + // Props / DOM Attributes + // ---------------------------------------------------------------------- + + interface Props { + children?: ReactNode; + key?: string | number; + ref?: string | ((component: T) => any); + } + + interface DOMAttributes extends Props> { + onCopy?: ClipboardEventHandler; + onCut?: ClipboardEventHandler; + onPaste?: ClipboardEventHandler; + onKeyDown?: KeyboardEventHandler; + onKeyPress?: KeyboardEventHandler; + onKeyUp?: KeyboardEventHandler; + onFocus?: FocusEventHandler; + onBlur?: FocusEventHandler; + onChange?: FormEventHandler; + onInput?: FormEventHandler; + onSubmit?: FormEventHandler; + onClick?: MouseEventHandler; + onDoubleClick?: MouseEventHandler; + onDrag?: DragEventHandler; + onDragEnd?: DragEventHandler; + onDragEnter?: DragEventHandler; + onDragExit?: DragEventHandler; + onDragLeave?: DragEventHandler; + onDragOver?: DragEventHandler; + onDragStart?: DragEventHandler; + onDrop?: DragEventHandler; + onMouseDown?: MouseEventHandler; + onMouseEnter?: MouseEventHandler; + onMouseLeave?: MouseEventHandler; + onMouseMove?: MouseEventHandler; + onMouseOut?: MouseEventHandler; + onMouseOver?: MouseEventHandler; + onMouseUp?: MouseEventHandler; + onTouchCancel?: TouchEventHandler; + onTouchEnd?: TouchEventHandler; + onTouchMove?: TouchEventHandler; + onTouchStart?: TouchEventHandler; + onScroll?: UIEventHandler; + onWheel?: WheelEventHandler; + + dangerouslySetInnerHTML?: { + __html: string; + }; + } + + // This interface is not complete. Only properties accepting + // unitless numbers are listed here (see CSSProperty.js in React) + interface CSSProperties { + boxFlex?: number; + boxFlexGroup?: number; + columnCount?: number; + flex?: number | string; + flexGrow?: number; + flexShrink?: number; + fontWeight?: number | string; + lineClamp?: number; + lineHeight?: number | string; + opacity?: number; + order?: number; + orphans?: number; + widows?: number; + zIndex?: number; + zoom?: number; + + fontSize?: number | string; + + // SVG-related properties + fillOpacity?: number; + strokeOpacity?: number; + strokeWidth?: number; + + [propertyName: string]: string | number | boolean; + } + + interface HTMLAttributes extends DOMAttributes { + ref?: string | ((component: HTMLComponent) => void); + + accept?: string; + acceptCharset?: string; + accessKey?: string; + action?: string; + allowFullScreen?: boolean; + allowTransparency?: boolean; + alt?: string; + async?: boolean; + autoComplete?: boolean; + autoFocus?: boolean; + autoPlay?: boolean; + cellPadding?: number | string; + cellSpacing?: number | string; + charSet?: string; + checked?: boolean; + classID?: string; + className?: string; + cols?: number; + colSpan?: number; + content?: string; + contentEditable?: boolean; + contextMenu?: string; + controls?: any; + coords?: string; + crossOrigin?: string; + data?: string; + dateTime?: string; + defaultChecked?: boolean; + defaultValue?: string; + defer?: boolean; + dir?: string; + disabled?: boolean; + download?: any; + draggable?: boolean; + encType?: string; + form?: string; + formAction?: string; + formEncType?: string; + formMethod?: string; + formNoValidate?: boolean; + formTarget?: string; + frameBorder?: number | string; + headers?: string; + height?: number | string; + hidden?: boolean; + high?: number; + href?: string; + hrefLang?: string; + htmlFor?: string; + httpEquiv?: string; + icon?: string; + id?: string; + label?: string; + lang?: string; + list?: string; + loop?: boolean; + low?: number; + manifest?: string; + marginHeight?: number; + marginWidth?: number; + max?: number | string; + maxLength?: number; + media?: string; + mediaGroup?: string; + method?: string; + min?: number | string; + multiple?: boolean; + muted?: boolean; + name?: string; + noValidate?: boolean; + open?: boolean; + optimum?: number; + pattern?: string; + placeholder?: string; + poster?: string; + preload?: string; + radioGroup?: string; + readOnly?: boolean; + rel?: string; + required?: boolean; + role?: string; + rows?: number; + rowSpan?: number; + sandbox?: string; + scope?: string; + scoped?: boolean; + scrolling?: string; + seamless?: boolean; + selected?: boolean; + shape?: string; + size?: number; + sizes?: string; + span?: number; + spellCheck?: boolean; + src?: string; + srcDoc?: string; + srcSet?: string; + start?: number; + step?: number | string; + style?: CSSProperties; + tabIndex?: number; + target?: string; + title?: string; + type?: string; + useMap?: string; + value?: string; + width?: number | string; + wmode?: string; + + // Non-standard Attributes + autoCapitalize?: boolean; + autoCorrect?: boolean; + property?: string; + itemProp?: string; + itemScope?: boolean; + itemType?: string; + unselectable?: boolean; + } + + interface SVGElementAttributes extends HTMLAttributes { + viewBox?: string; + preserveAspectRatio?: string; + } + + interface SVGAttributes extends DOMAttributes { + ref?: string | ((component: SVGComponent) => void); + + cx?: number | string; + cy?: number | string; + d?: string; + dx?: number | string; + dy?: number | string; + fill?: string; + fillOpacity?: number | string; + fontFamily?: string; + fontSize?: number | string; + fx?: number | string; + fy?: number | string; + gradientTransform?: string; + gradientUnits?: string; + height?: number | string; + markerEnd?: string; + markerMid?: string; + markerStart?: string; + offset?: number | string; + opacity?: number | string; + patternContentUnits?: string; + patternUnits?: string; + points?: string; + preserveAspectRatio?: string; + r?: number | string; + rx?: number | string; + ry?: number | string; + spreadMethod?: string; + stopColor?: string; + stopOpacity?: number | string; + stroke?: string; + strokeDasharray?: string; + strokeLinecap?: string; + strokeOpacity?: number | string; + strokeWidth?: number | string; + textAnchor?: string; + transform?: string; + version?: string; + viewBox?: string; + width?: number | string; + x1?: number | string; + x2?: number | string; + x?: number | string; + y1?: number | string; + y2?: number | string + y?: number | string; + } + + // + // React.DOM + // ---------------------------------------------------------------------- + + interface ReactDOM { + // HTML + a: HTMLFactory; + abbr: HTMLFactory; + address: HTMLFactory; + area: HTMLFactory; + article: HTMLFactory; + aside: HTMLFactory; + audio: HTMLFactory; + b: HTMLFactory; + base: HTMLFactory; + bdi: HTMLFactory; + bdo: HTMLFactory; + big: HTMLFactory; + blockquote: HTMLFactory; + body: HTMLFactory; + br: HTMLFactory; + button: HTMLFactory; + canvas: HTMLFactory; + caption: HTMLFactory; + cite: HTMLFactory; + code: HTMLFactory; + col: HTMLFactory; + colgroup: HTMLFactory; + data: HTMLFactory; + datalist: HTMLFactory; + dd: HTMLFactory; + del: HTMLFactory; + details: HTMLFactory; + dfn: HTMLFactory; + dialog: HTMLFactory; + div: HTMLFactory; + dl: HTMLFactory; + dt: HTMLFactory; + em: HTMLFactory; + embed: HTMLFactory; + fieldset: HTMLFactory; + figcaption: HTMLFactory; + figure: HTMLFactory; + footer: HTMLFactory; + form: HTMLFactory; + h1: HTMLFactory; + h2: HTMLFactory; + h3: HTMLFactory; + h4: HTMLFactory; + h5: HTMLFactory; + h6: HTMLFactory; + head: HTMLFactory; + header: HTMLFactory; + hr: HTMLFactory; + html: HTMLFactory; + i: HTMLFactory; + iframe: HTMLFactory; + img: HTMLFactory; + input: HTMLFactory; + ins: HTMLFactory; + kbd: HTMLFactory; + keygen: HTMLFactory; + label: HTMLFactory; + legend: HTMLFactory; + li: HTMLFactory; + link: HTMLFactory; + main: HTMLFactory; + map: HTMLFactory; + mark: HTMLFactory; + menu: HTMLFactory; + menuitem: HTMLFactory; + meta: HTMLFactory; + meter: HTMLFactory; + nav: HTMLFactory; + noscript: HTMLFactory; + object: HTMLFactory; + ol: HTMLFactory; + optgroup: HTMLFactory; + option: HTMLFactory; + output: HTMLFactory; + p: HTMLFactory; + param: HTMLFactory; + picture: HTMLFactory; + pre: HTMLFactory; + progress: HTMLFactory; + q: HTMLFactory; + rp: HTMLFactory; + rt: HTMLFactory; + ruby: HTMLFactory; + s: HTMLFactory; + samp: HTMLFactory; + script: HTMLFactory; + section: HTMLFactory; + select: HTMLFactory; + small: HTMLFactory; + source: HTMLFactory; + span: HTMLFactory; + strong: HTMLFactory; + style: HTMLFactory; + sub: HTMLFactory; + summary: HTMLFactory; + sup: HTMLFactory; + table: HTMLFactory; + tbody: HTMLFactory; + td: HTMLFactory; + textarea: HTMLFactory; + tfoot: HTMLFactory; + th: HTMLFactory; + thead: HTMLFactory; + time: HTMLFactory; + title: HTMLFactory; + tr: HTMLFactory; + track: HTMLFactory; + u: HTMLFactory; + ul: HTMLFactory; + "var": HTMLFactory; + video: HTMLFactory; + wbr: HTMLFactory; + + // SVG + svg: SVGElementFactory; + circle: SVGFactory; + defs: SVGFactory; + ellipse: SVGFactory; + g: SVGFactory; + line: SVGFactory; + linearGradient: SVGFactory; + mask: SVGFactory; + path: SVGFactory; + pattern: SVGFactory; + polygon: SVGFactory; + polyline: SVGFactory; + radialGradient: SVGFactory; + rect: SVGFactory; + stop: SVGFactory; + text: SVGFactory; + tspan: SVGFactory; + } + + // + // React.PropTypes + // ---------------------------------------------------------------------- + + interface Validator { + (object: T, key: string, componentName: string): Error; + } + + interface Requireable extends Validator { + isRequired: Validator; + } + + interface ValidationMap { + [key: string]: Validator; + } + + interface ReactPropTypes { + any: Requireable; + array: Requireable; + bool: Requireable; + func: Requireable; + number: Requireable; + object: Requireable; + string: Requireable; + node: Requireable; + element: Requireable; + instanceOf(expectedClass: {}): Requireable; + oneOf(types: any[]): Requireable; + oneOfType(types: Validator[]): Requireable; + arrayOf(type: Validator): Requireable; + objectOf(type: Validator): Requireable; + shape(type: ValidationMap): Requireable; + } + + // + // React.Children + // ---------------------------------------------------------------------- + + interface ReactChildren { + map(children: ReactNode, fn: (child: ReactChild, index: number) => T): { [key:string]: T }; + forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; + count(children: ReactNode): number; + only(children: ReactNode): ReactChild; + } + + // + // Browser Interfaces + // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts + // ---------------------------------------------------------------------- + + interface AbstractView { + styleMedia: StyleMedia; + document: Document; + } + + interface Touch { + identifier: number; + target: EventTarget; + screenX: number; + screenY: number; + clientX: number; + clientY: number; + pageX: number; + pageY: number; + } + + interface TouchList { + [index: number]: Touch; + length: number; + item(index: number): Touch; + identifiedTouch(identifier: number): Touch; + } + + // + // React.addons + // ---------------------------------------------------------------------- + + export module addons { + export var CSSTransitionGroup: CSSTransitionGroup; + export var TransitionGroup: TransitionGroup; + + export var LinkedStateMixin: LinkedStateMixin; + export var PureRenderMixin: PureRenderMixin; + + export function batchedUpdates( + callback: (a: A, b: B) => any, a: A, b: B): void; + export function batchedUpdates(callback: (a: A) => any, a: A): void; + export function batchedUpdates(callback: () => any): void; + + // deprecated: use petehunt/react-classset or JedWatson/classnames + export function classSet(cx: { [key: string]: boolean }): string; + export function classSet(...classList: string[]): string; + + export function cloneWithProps

( + element: DOMElement

, props: P): DOMElement

; + export function cloneWithProps

( + element: ClassicElement

, props: P): ClassicElement

; + export function cloneWithProps

( + element: ReactElement

, props: P): ReactElement

; + + export function createFragment( + object: { [key: string]: ReactNode }): ReactFragment; + + export function update(value: any[], spec: UpdateArraySpec): any[]; + export function update(value: {}, spec: UpdateSpec): any; + + // Development tools + export import Perf = ReactPerf; + export import TestUtils = ReactTestUtils; + } + + // + // React.addons (Transitions) + // ---------------------------------------------------------------------- + + interface TransitionGroupProps { + component?: ReactType; + childFactory?: (child: ReactElement) => ReactElement; + } + + interface CSSTransitionGroupProps extends TransitionGroupProps { + transitionName: string; + transitionAppear?: boolean; + transitionEnter?: boolean; + transitionLeave?: boolean; + } + + type CSSTransitionGroup = ComponentClass; + type TransitionGroup = ComponentClass; + + // + // React.addons (Mixins) + // ---------------------------------------------------------------------- + + interface ReactLink { + value: T; + requestChange(newValue: T): void; + } + + interface LinkedStateMixin extends Mixin { + linkState(key: string): ReactLink; + } + + interface PureRenderMixin extends Mixin { + } + + // + // Reat.addons.update + // ---------------------------------------------------------------------- + + interface UpdateSpec { + $set?: any; + $merge?: {}; + $apply?(value: any): any; + // [key: string]: UpdateSpec; + } + + interface UpdateArraySpec extends UpdateSpec { + $push?: any[]; + $unshift?: any[]; + $splice?: any[][]; + } + + // + // React.addons.Perf + // ---------------------------------------------------------------------- + + interface ComponentPerfContext { + current: string; + owner: string; + } + + interface NumericPerfContext { + [key: string]: number; + } + + interface Measurements { + exclusive: NumericPerfContext; + inclusive: NumericPerfContext; + render: NumericPerfContext; + counts: NumericPerfContext; + writes: NumericPerfContext; + displayNames: { + [key: string]: ComponentPerfContext; + }; + totalTime: number; + } + + module ReactPerf { + export function start(): void; + export function stop(): void; + export function printInclusive(measurements: Measurements[]): void; + export function printExclusive(measurements: Measurements[]): void; + export function printWasted(measurements: Measurements[]): void; + export function printDOM(measurements: Measurements[]): void; + export function getLastMeasurements(): Measurements[]; + } + + // + // React.addons.TestUtils + // ---------------------------------------------------------------------- + + interface MockedComponentClass { + new(): any; + } + + module ReactTestUtils { + export import Simulate = ReactSimulate; + + export function renderIntoDocument

( + element: ReactElement

): Component; + export function renderIntoDocument>( + element: ReactElement): C; + + export function mockComponent( + mocked: MockedComponentClass, mockTagName?: string): typeof ReactTestUtils; + + export function isElementOfType( + element: ReactElement, type: ReactType): boolean; + export function isTextComponent(instance: Component): boolean; + export function isDOMComponent(instance: Component): boolean; + export function isCompositeComponent(instance: Component): boolean; + export function isCompositeComponentWithType( + instance: Component, + type: ComponentClass): boolean; + + export function findAllInRenderedTree( + tree: Component, + fn: (i: Component) => boolean): Component; + + export function scryRenderedDOMComponentsWithClass( + tree: Component, + className: string): DOMComponent[]; + export function findRenderedDOMComponentWithClass( + tree: Component, + className: string): DOMComponent; + + export function scryRenderedDOMComponentsWithTag( + tree: Component, + tagName: string): DOMComponent[]; + export function findRenderedDOMComponentWithTag( + tree: Component, + tagName: string): DOMComponent; + + export function scryRenderedComponentsWithType

( + tree: Component, + type: ComponentClass

): Component[]; + export function scryRenderedComponentsWithType>( + tree: Component, + type: ComponentClass): C[]; + + export function findRenderedComponentWithType

( + tree: Component, + type: ComponentClass

): Component; + export function findRenderedComponentWithType>( + tree: Component, + type: ComponentClass): C; + + export function createRenderer(): ShallowRenderer; + } + + interface SyntheticEventData { + altKey?: boolean; + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + changedTouches?: TouchList; + charCode?: boolean; + clipboardData?: DataTransfer; + ctrlKey?: boolean; + deltaMode?: number; + deltaX?: number; + deltaY?: number; + deltaZ?: number; + detail?: number; + getModifierState?(key: string): boolean; + key?: string; + keyCode?: number; + locale?: string; + location?: number; + metaKey?: boolean; + pageX?: number; + pageY?: number; + relatedTarget?: EventTarget; + repeat?: boolean; + screenX?: number; + screenY?: number; + shiftKey?: boolean; + targetTouches?: TouchList; + touches?: TouchList; + view?: AbstractView; + which?: number; + } + + interface EventSimulator { + (element: Element, eventData?: SyntheticEventData): void; + (component: Component, eventData?: SyntheticEventData): void; + } + + module ReactSimulate { + export var blur: EventSimulator; + export var change: EventSimulator; + export var click: EventSimulator; + export var cut: EventSimulator; + export var doubleClick: EventSimulator; + export var drag: EventSimulator; + export var dragEnd: EventSimulator; + export var dragEnter: EventSimulator; + export var dragExit: EventSimulator; + export var dragLeave: EventSimulator; + export var dragOver: EventSimulator; + export var dragStart: EventSimulator; + export var drop: EventSimulator; + export var focus: EventSimulator; + export var input: EventSimulator; + export var keyDown: EventSimulator; + export var keyPress: EventSimulator; + export var keyUp: EventSimulator; + export var mouseDown: EventSimulator; + export var mouseEnter: EventSimulator; + export var mouseLeave: EventSimulator; + export var mouseMove: EventSimulator; + export var mouseOut: EventSimulator; + export var mouseOver: EventSimulator; + export var mouseUp: EventSimulator; + export var paste: EventSimulator; + export var scroll: EventSimulator; + export var submit: EventSimulator; + export var touchCancel: EventSimulator; + export var touchEnd: EventSimulator; + export var touchMove: EventSimulator; + export var touchStart: EventSimulator; + export var wheel: EventSimulator; + } + + class ShallowRenderer { + getRenderOutput>(): E; + getRenderOutput(): ReactElement; + render(element: ReactElement, context?: any): void; + unmount(): void; + } +} + +declare namespace JSX { import React = __React; interface Element extends React.ReactElement { } From 6102332bf03c95c4166407685ced15ca9fda9f65 Mon Sep 17 00:00:00 2001 From: James Brantly Date: Thu, 27 Aug 2015 22:18:59 -0400 Subject: [PATCH 019/259] Update react-router to work with react reorganization --- react-router/react-router.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index f43f56484a..bc19e568c0 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// -/// declare module ReactRouter { import React = __React; From cf72a199fbe39230f548cda5b3de70bdead4d0dd Mon Sep 17 00:00:00 2001 From: matjos Date: Fri, 28 Aug 2015 11:36:44 +0200 Subject: [PATCH 020/259] Added ImageWMS constructor options. --- openlayers/openlayers.d.ts | 39 +++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index 39091a8490..96b544cdc9 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -88,6 +88,42 @@ declare module olx { targetSize?: number; } + interface ImageWMSOptions { + + /** Attributions. */ + attributions?: Array; + + /** The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. */ + crossOrigin?: string; + + /** experimental Use the ol.Map#pixelRatio value when requesting the image from the remote server. Default is true. */ + hidpi?: boolean; + + /** experimental The type of the remote WMS server: mapserver, geoserver or qgis. Only needed if hidpi is true. Default is undefined. */ + serverType?: any; + + /** experimental Optional function to load an image given a URL. */ + imageLoadFunction?: any; + + /** Logo. */ + logo?: any; + + /** WMS request parameters. At least a LAYERS param is required. STYLES is '' by default. VERSION is 1.3.0 by default. WIDTH, HEIGHT, BBOX and CRS (SRS for WMS version < 1.3.0) will be set dynamically. */ + params?: any; + + /** experimental Projection. */ + projection?: ol.proj.ProjectionLike; + /** Ratio. 1 means image requests are the size of the map viewport, 2 means twice the width and height of the map viewport, and so on. Must be 1 or higher. Default is 1.5. */ + ratio?: number; + + /** Resolutions. If specified, requests will be made for these resolutions only. */ + resolutions?: Array; + + /** WMS service URL. */ + url?: string; + } + + interface MapOptions { /** Controls initially added to the map. If not specified, ol.control.defaults() is used. */ @@ -2150,7 +2186,7 @@ declare module ol { * @param number Input between 0 and 1 * @returns Output between 0 and 1 */ - function inAndOut (t: number): number; + function inAndOut(t: number): number; /** * Maintain a constant speed over time. @@ -3112,6 +3148,7 @@ declare module ol { } class ImageWMS { + constructor(options: olx.ImageWMSOptions); } class MapQuest { From 9390bb6fe4251784708c7c301625846d396b30f0 Mon Sep 17 00:00:00 2001 From: matjos Date: Fri, 28 Aug 2015 16:18:15 +0200 Subject: [PATCH 021/259] Added TileWMS, Projection and refactored --- openlayers/openlayers.d.ts | 87 +++++++++++++++++++++++++++++++++----- 1 file changed, 76 insertions(+), 11 deletions(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index 96b544cdc9..842ebfd5ae 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -88,11 +88,14 @@ declare module olx { targetSize?: number; } - interface ImageWMSOptions { - + interface BaseWMSOptions { + /** Attributions. */ attributions?: Array; + /** WMS request parameters. At least a LAYERS param is required. STYLES is '' by default. VERSION is 1.3.0 by default. WIDTH, HEIGHT, BBOX and CRS (SRS for WMS version < 1.3.0) will be set dynamically. */ + params?: any; + /** The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. */ crossOrigin?: string; @@ -102,27 +105,48 @@ declare module olx { /** experimental The type of the remote WMS server: mapserver, geoserver or qgis. Only needed if hidpi is true. Default is undefined. */ serverType?: any; - /** experimental Optional function to load an image given a URL. */ - imageLoadFunction?: any; + /** WMS service URL. */ + url?: string; /** Logo. */ logo?: any; - /** WMS request parameters. At least a LAYERS param is required. STYLES is '' by default. VERSION is 1.3.0 by default. WIDTH, HEIGHT, BBOX and CRS (SRS for WMS version < 1.3.0) will be set dynamically. */ - params?: any; - /** experimental Projection. */ projection?: ol.proj.ProjectionLike; + } + + interface ImageWMSOptions extends BaseWMSOptions { + + /** experimental Optional function to load an image given a URL. */ + imageLoadFunction?: any; + /** Ratio. 1 means image requests are the size of the map viewport, 2 means twice the width and height of the map viewport, and so on. Must be 1 or higher. Default is 1.5. */ ratio?: number; /** Resolutions. If specified, requests will be made for these resolutions only. */ resolutions?: Array; - - /** WMS service URL. */ - url?: string; } + interface TileWMSOptions { + + /** The size in pixels of the gutter around image tiles to ignore. By setting this property to a non-zero value, images will be requested that are wider and taller than the tile size by a value of 2 x gutter. Defaults to zero. Using a non-zero value allows artifacts of rendering at tile edges to be ignored. If you control the WMS service it is recommended to address "artifacts at tile edges" issues by properly configuring the WMS service. For example, MapServer has a tile_map_edge_buffer configuration parameter for this. See http://mapserver.org/output/tile_mode.html. */ + gutter?: number; + + /** Tile grid. Base this on the resolutions, tilesize and extent supported by the server. If this is not defined, a default grid will be used: if there is a projection extent, the grid will be based on that; if not, a grid based on a global extent with origin at 0,0 will be used. */ + tileGrid?: ol.tilegrid.TileGrid; + + /** experimental Maximum zoom. */ + maxZoom?: number; + + /** experimental Optional function to load a tile given a URL. */ + tileLoadFunction?: any; //todo + + /** WMS service urls. Use this instead of url when the WMS supports multiple urls for GetMap requests. */ + urls?: Array; + + /** experimental Whether to wrap the world horizontally. When set to false, only one world will be rendered. When true, tiles will be requested for one world only, but they will be wrapped horizontally to render multiple worlds. The default is true. */ + wrapX?: boolean; + } interface MapOptions { @@ -279,6 +303,45 @@ declare module olx { rotation: number; } + interface Projection { + /** + * The SRS identifier code, e.g. EPSG:4326. + */ + code: string; + + /** + * Units. Required unless a proj4 projection is defined for code. + */ + units?: ol.proj.Units; + + /** + * The validity extent for the SRS. + */ + extent?: Array; + + /** + * The axis orientation as specified in Proj4. The default is enu. + */ + axisOrientation?: string; + + /** + * Whether the projection is valid for the whole globe. Default is false. + */ + global?: boolean; + + /** + * experimental The world extent for the SRS. + */ + worldExtent?: ol.Extent; + + /** + * experimental Function to determine resolution at a point. The function is called with + * a {number} view resolution and an {ol.Coordinate} as arguments, and returns the {number} + * resolution at the passed coordinate. + */ + getPointResolution?: any; + } + module animation { interface BounceOptions { @@ -3103,7 +3166,8 @@ declare module ol { */ function transformExtent(extent: Extent, source: ProjectionLike, destination: ProjectionLike): Extent; - interface Projection { + class Projection { + constructor(options: olx.Projection) } } @@ -3189,6 +3253,7 @@ declare module ol { } class TileWMS { + constructor(options: olx.TileWMSOptions); } class Vector { From f37be4678917cb05a1d99149462ebfe5262c4943 Mon Sep 17 00:00:00 2001 From: vvakame Date: Fri, 28 Aug 2015 23:44:10 +0900 Subject: [PATCH 022/259] depends on the tsc 1.6 --- npm-shrinkwrap.json | 313 -------------------------------------------- package.json | 2 +- 2 files changed, 1 insertion(+), 314 deletions(-) delete mode 100644 npm-shrinkwrap.json diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json deleted file mode 100644 index d332a49ef8..0000000000 --- a/npm-shrinkwrap.json +++ /dev/null @@ -1,313 +0,0 @@ -{ - "name": "DefinitelyTyped", - "version": "0.0.1", - "dependencies": { - "definition-tester": { - "version": "0.2.0", - "from": "definition-tester@0.2.0", - "resolved": "https://registry.npmjs.org/definition-tester/-/definition-tester-0.2.0.tgz", - "dependencies": { - "bluebird": { - "version": "2.9.34", - "from": "bluebird@>=2.5.3 <3.0.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.34.tgz" - }, - "definition-header": { - "version": "0.1.0", - "from": "definition-header@>=0.1.0 <0.2.0", - "resolved": "https://registry.npmjs.org/definition-header/-/definition-header-0.1.0.tgz", - "dependencies": { - "joi": { - "version": "4.9.0", - "from": "joi@>=4.0.0 <5.0.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-4.9.0.tgz", - "dependencies": { - "hoek": { - "version": "2.14.0", - "from": "hoek@>=2.2.0 <3.0.0", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.14.0.tgz" - }, - "topo": { - "version": "1.0.2", - "from": "topo@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/topo/-/topo-1.0.2.tgz" - }, - "isemail": { - "version": "1.1.1", - "from": "isemail@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.1.1.tgz" - }, - "moment": { - "version": "2.10.3", - "from": "moment@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.10.3.tgz" - } - } - }, - "joi-assert": { - "version": "0.0.3", - "from": "joi-assert@0.0.3", - "resolved": "https://registry.npmjs.org/joi-assert/-/joi-assert-0.0.3.tgz", - "dependencies": { - "assertion-error": { - "version": "1.0.1", - "from": "assertion-error@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.1.tgz" - } - } - }, - "parsimmon": { - "version": "0.5.1", - "from": "parsimmon@>=0.5.0 <0.6.0", - "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-0.5.1.tgz", - "dependencies": { - "pjs": { - "version": "5.1.1", - "from": "pjs@>=5.0.0 <6.0.0", - "resolved": "https://registry.npmjs.org/pjs/-/pjs-5.1.1.tgz" - } - } - }, - "xregexp": { - "version": "2.0.0", - "from": "xregexp@>=2.0.0 <2.1.0", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz" - } - } - }, - "findup-sync": { - "version": "0.2.1", - "from": "findup-sync@>=0.2.1 <0.3.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.2.1.tgz", - "dependencies": { - "glob": { - "version": "4.3.5", - "from": "glob@>=4.3.0 <4.4.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", - "dependencies": { - "inflight": { - "version": "1.0.4", - "from": "inflight@>=1.0.4 <2.0.0", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", - "dependencies": { - "wrappy": { - "version": "1.0.1", - "from": "wrappy@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - } - } - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - }, - "minimatch": { - "version": "2.0.9", - "from": "minimatch@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.9.tgz", - "dependencies": { - "brace-expansion": { - "version": "1.1.0", - "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", - "dependencies": { - "balanced-match": { - "version": "0.2.0", - "from": "balanced-match@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" - }, - "concat-map": { - "version": "0.0.1", - "from": "concat-map@0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - } - } - } - } - }, - "once": { - "version": "1.3.2", - "from": "once@>=1.3.0 <2.0.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.2.tgz", - "dependencies": { - "wrappy": { - "version": "1.0.1", - "from": "wrappy@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - } - } - } - } - } - } - }, - "git-wrapper": { - "version": "0.1.1", - "from": "git-wrapper@>=0.1.1 <0.2.0", - "resolved": "https://registry.npmjs.org/git-wrapper/-/git-wrapper-0.1.1.tgz" - }, - "glob": { - "version": "4.5.3", - "from": "glob@>=4.3.2 <5.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", - "dependencies": { - "inflight": { - "version": "1.0.4", - "from": "inflight@>=1.0.4 <2.0.0", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", - "dependencies": { - "wrappy": { - "version": "1.0.1", - "from": "wrappy@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - } - } - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@>=2.0.0 <3.0.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - }, - "minimatch": { - "version": "2.0.9", - "from": "minimatch@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.9.tgz", - "dependencies": { - "brace-expansion": { - "version": "1.1.0", - "from": "brace-expansion@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", - "dependencies": { - "balanced-match": { - "version": "0.2.0", - "from": "balanced-match@>=0.2.0 <0.3.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" - }, - "concat-map": { - "version": "0.0.1", - "from": "concat-map@0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - } - } - } - } - }, - "once": { - "version": "1.3.2", - "from": "once@>=1.3.0 <2.0.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.2.tgz", - "dependencies": { - "wrappy": { - "version": "1.0.1", - "from": "wrappy@>=1.0.0 <2.0.0", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - } - } - } - } - }, - "lazy.js": { - "version": "0.4.0", - "from": "lazy.js@>=0.4.0 <0.5.0", - "resolved": "https://registry.npmjs.org/lazy.js/-/lazy.js-0.4.0.tgz" - }, - "manticore": { - "version": "0.2.4", - "from": "manticore@>=0.2.4 <0.3.0", - "resolved": "https://registry.npmjs.org/manticore/-/manticore-0.2.4.tgz", - "dependencies": { - "JSONStream": { - "version": "0.8.4", - "from": "JSONStream@>=0.8.4 <0.9.0", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz", - "dependencies": { - "jsonparse": { - "version": "0.0.5", - "from": "jsonparse@0.0.5", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz" - }, - "through": { - "version": "2.3.8", - "from": "through@>=2.2.7 <3.0.0", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" - } - } - }, - "bluebird": { - "version": "1.2.4", - "from": "bluebird@>=1.2.4 <2.0.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz" - }, - "through2": { - "version": "0.5.1", - "from": "through2@>=0.5.1 <0.6.0", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", - "dependencies": { - "readable-stream": { - "version": "1.0.33", - "from": "readable-stream@>=1.0.17 <1.1.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz", - "dependencies": { - "core-util-is": { - "version": "1.0.1", - "from": "core-util-is@>=1.0.0 <1.1.0", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" - }, - "isarray": { - "version": "0.0.1", - "from": "isarray@0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "string_decoder": { - "version": "0.10.31", - "from": "string_decoder@>=0.10.0 <0.11.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "inherits": { - "version": "2.0.1", - "from": "inherits@>=2.0.1 <2.1.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - } - } - }, - "xtend": { - "version": "3.0.0", - "from": "xtend@>=3.0.0 <3.1.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz" - } - } - }, - "type-detect": { - "version": "0.1.2", - "from": "type-detect@>=0.1.2 <0.2.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.2.tgz" - } - } - }, - "optimist": { - "version": "0.6.1", - "from": "optimist@>=0.6.1 <0.7.0", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "dependencies": { - "wordwrap": { - "version": "0.0.3", - "from": "wordwrap@>=0.0.2 <0.1.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" - }, - "minimist": { - "version": "0.0.10", - "from": "minimist@>=0.0.1 <0.1.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" - } - } - } - } - }, - "typescript": { - "version": "1.5.3", - "from": "typescript@1.5.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.5.3.tgz" - } - } -} diff --git a/package.json b/package.json index 2c5b834ed0..854e15f8f3 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,6 @@ }, "devDependencies": { "definition-tester": "0.2.0", - "typescript": "1.5.3" + "typescript": "https://github.com/Microsoft/TypeScript/tarball/release-1.6" } } From 74c525a19a888eeff34759d1395f9ed243257504 Mon Sep 17 00:00:00 2001 From: vvakame Date: Fri, 28 Aug 2015 23:50:01 +0900 Subject: [PATCH 023/259] fix webrtc/RTCPeerConnection.d.ts --- webrtc/RTCPeerConnection.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/webrtc/RTCPeerConnection.d.ts b/webrtc/RTCPeerConnection.d.ts index 9e96a86c80..0e186fd278 100644 --- a/webrtc/RTCPeerConnection.d.ts +++ b/webrtc/RTCPeerConnection.d.ts @@ -360,5 +360,4 @@ interface Window{ RTCIceCandidate: RTCIceCandidate; webkitRTCIceCandidate: webkitRTCIceCandidate; mozRTCIceCandidate: mozRTCIceCandidate; - URL: URL; } From 6697d6f7dadbf5773cb40ecda35a76027e0783b2 Mon Sep 17 00:00:00 2001 From: vvakame Date: Fri, 28 Aug 2015 23:57:51 +0900 Subject: [PATCH 024/259] fix es6-shim/es6-shim.d.ts --- es6-shim/es6-shim.d.ts | 123 ++++++++++++++++++++--------------------- 1 file changed, 59 insertions(+), 64 deletions(-) diff --git a/es6-shim/es6-shim.d.ts b/es6-shim/es6-shim.d.ts index cff5a9b7e4..30621b372e 100644 --- a/es6-shim/es6-shim.d.ts +++ b/es6-shim/es6-shim.d.ts @@ -12,7 +12,7 @@ interface IteratorResult { interface IterableShim { /** - * Shim for an ES6 iterable. Not intended for direct use by user code. + * Shim for an ES6 iterable. Not intended for direct use by user code. */ "_es6-shim iterator_"(): Iterator; } @@ -39,7 +39,7 @@ interface StringConstructor { /** * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest + * as such the first argument will be a well formed template call site object and the rest * parameter will contain the substitution values. * @param template A well-formed template string call site representation. * @param substitutions A set of substitution values. @@ -49,40 +49,40 @@ interface StringConstructor { interface String { /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. + * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point + * value of the UTF-16 encoded code point starting at the string element at position pos in + * the String resulting from converting this object to a String. + * If there is no element at that position, the result is undefined. * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. */ codePointAt(pos: number): number; /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are + * Returns true if searchString appears as a substring of the result of converting this + * object to a String, at one or more positions that are * greater than or equal to position; otherwise, returns false. - * @param searchString search string + * @param searchString search string * @param position If position is undefined, 0 is assumed, so as to search all of the String. */ includes(searchString: string, position?: number): boolean; /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at * endPosition – length(this). Otherwise returns false. */ endsWith(searchString: string, endPosition?: number): boolean; /** - * Returns a String value that is made from count copies appended together. If count is 0, + * Returns a String value that is made from count copies appended together. If count is 0, * T is the empty String is returned. * @param count number of copies to append */ repeat(count: number): string; /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at * position. Otherwise returns false. */ startsWith(searchString: string, position?: number): boolean; @@ -130,19 +130,14 @@ interface String { sub(): string; /** Returns a HTML element */ - sup(): string; + sup(): string; /** - * Shim for an ES6 iterable. Not intended for direct use by user code. + * Shim for an ES6 iterable. Not intended for direct use by user code. */ "_es6-shim iterator_"(): IterableIteratorShim; } -interface ArrayLike { - length: number; - [n: number]: T; -} - interface ArrayConstructor { /** * Creates an array from an array-like object. @@ -180,24 +175,24 @@ interface ArrayConstructor { } interface Array { - /** - * Returns the value of the first element in the array where predicate is true, and undefined + /** + * Returns the value of the first element in the array where predicate is true, and undefined * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of + * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - /** - * Returns the index of the first element in the array where predicate is true, and undefined + /** + * Returns the index of the first element in the array where predicate is true, and undefined * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of + * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ findIndex(predicate: (value: T) => boolean, thisArg?: any): number; @@ -205,41 +200,41 @@ interface Array { /** * Returns the this object after filling the section identified by start and end with value * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as * length+end. */ fill(value: T, start?: number, end?: number): T[]; - /** + /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. + * @param end If not specified, length of the this object is used as its default value. */ copyWithin(target: number, start: number, end?: number): T[]; - /** + /** * Returns an array of key, value pairs for every entry in the array */ entries(): IterableIteratorShim<[number, T]>; - /** + /** * Returns an list of keys in the array */ keys(): IterableIteratorShim; - /** + /** * Returns an list of values in the array */ values(): IterableIteratorShim; /** - * Shim for an ES6 iterable. Not intended for direct use by user code. + * Shim for an ES6 iterable. Not intended for direct use by user code. */ "_es6-shim iterator_"(): IterableIteratorShim; } @@ -247,14 +242,14 @@ interface Array { interface NumberConstructor { /** * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: + * that is representable as a Number value, which is approximately: * 2.2204460492503130808472633361816 x 10‍−‍16. */ EPSILON: number; /** * Returns true if passed value is finite. - * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a + * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a * number. Only finite values of the type number, result in true. * @param number A numeric value. */ @@ -267,7 +262,7 @@ interface NumberConstructor { isInteger(number: number): boolean; /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter * to a number. Only values of the type number, that are also NaN, result in true. * @param number A numeric value. @@ -280,30 +275,30 @@ interface NumberConstructor { */ isSafeInteger(number: number): boolean; - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. + /** + * The value of the largest integer n such that n and n + 1 are both exactly representable as + * a Number value. * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. */ MAX_SAFE_INTEGER: number; - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. + /** + * The value of the smallest integer n such that n and n − 1 are both exactly representable as + * a Number value. * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). */ MIN_SAFE_INTEGER: number; /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. */ parseFloat(string: string): number; /** * Converts A string to an integer. * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. * All other strings are considered decimal. */ @@ -312,7 +307,7 @@ interface NumberConstructor { interface ObjectConstructor { /** - * Copy the values of all of the enumerable own properties from one or more source objects to a + * Copy the values of all of the enumerable own properties from one or more source objects to a * target object. Returns the target object. * @param target The target object to copy to. * @param sources One or more source objects to copy properties from. @@ -390,7 +385,7 @@ interface Math { log1p(x: number): number; /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of + * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of * the natural logarithms). * @param x A numeric expression. */ @@ -497,21 +492,21 @@ interface Promise { } interface PromiseConstructor { - /** - * A reference to the prototype. + /** + * A reference to the prototype. */ prototype: Promise; /** * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises + * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. @@ -519,7 +514,7 @@ interface PromiseConstructor { all(values: IterableShim>): Promise; /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. @@ -670,4 +665,4 @@ declare module "es6-shim" { function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; function setPrototypeOf(target: any, proto: any): boolean; } -} \ No newline at end of file +} From 990caac6dc7eea22bf5329ad9da4e4a97eb6a9da Mon Sep 17 00:00:00 2001 From: vvakame Date: Fri, 28 Aug 2015 23:58:41 +0900 Subject: [PATCH 025/259] fix core-js/core-js.d.ts --- core-js/core-js.d.ts | 297 +++++++++++++++++++++---------------------- 1 file changed, 146 insertions(+), 151 deletions(-) diff --git a/core-js/core-js.d.ts b/core-js/core-js.d.ts index 476ab99162..9c492e4338 100644 --- a/core-js/core-js.d.ts +++ b/core-js/core-js.d.ts @@ -22,13 +22,13 @@ declare type PropertyKey = string | number | symbol; // ############################################################################################# // ECMAScript 6: Object & Function -// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, +// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, // es6.object.to-string, es6.function.name and es6.function.has-instance. // ############################################################################################# - + interface ObjectConstructor { /** - * Copy the values of all of the enumerable own properties from one or more source objects to a + * Copy the values of all of the enumerable own properties from one or more source objects to a * target object. Returns the target object. * @param target The target object to copy to. * @param sources One or more source objects to copy properties from. @@ -57,10 +57,10 @@ interface Function { */ name: string; - /** - * Determines if a constructor object recognizes an object as one of the + /** + * Determines if a constructor object recognizes an object as one of the * constructor’s instances. - * @param value The object to test. + * @param value The object to test. */ [Symbol.hasInstance](value: any): boolean; } @@ -71,30 +71,25 @@ interface Function { // and es6.array.find-index // ############################################################################################# -interface ArrayLike { - length: number; - [n: number]: T; -} - interface Array { - /** - * Returns the value of the first element in the array where predicate is true, and undefined + /** + * Returns the value of the first element in the array where predicate is true, and undefined * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of + * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - /** - * Returns the index of the first element in the array where predicate is true, and undefined + /** + * Returns the index of the first element in the array where predicate is true, and undefined * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of + * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ findIndex(predicate: (value: T) => boolean, thisArg?: any): number; @@ -102,21 +97,21 @@ interface Array { /** * Returns the this object after filling the section identified by start and end with value * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as * length+end. */ fill(value: T, start?: number, end?: number): T[]; - /** + /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. + * @param end If not specified, length of the this object is used as its default value. */ copyWithin(target: number, start: number, end?: number): T[]; @@ -161,47 +156,47 @@ interface ArrayConstructor { // ############################################################################################# // ECMAScript 6: String & RegExp -// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at, -// es6.string.ends-with, es6.string.includes, es6.string.repeat, +// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at, +// es6.string.ends-with, es6.string.includes, es6.string.repeat, // es6.string.starts-with, and es6.regexp // ############################################################################################# interface String { /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. + * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point + * value of the UTF-16 encoded code point starting at the string element at position pos in + * the String resulting from converting this object to a String. + * If there is no element at that position, the result is undefined. * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. */ codePointAt(pos: number): number; /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are + * Returns true if searchString appears as a substring of the result of converting this + * object to a String, at one or more positions that are * greater than or equal to position; otherwise, returns false. - * @param searchString search string + * @param searchString search string * @param position If position is undefined, 0 is assumed, so as to search all of the String. */ includes(searchString: string, position?: number): boolean; /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at * endPosition – length(this). Otherwise returns false. */ endsWith(searchString: string, endPosition?: number): boolean; /** - * Returns a String value that is made from count copies appended together. If count is 0, + * Returns a String value that is made from count copies appended together. If count is 0, * T is the empty String is returned. * @param count number of copies to append */ repeat(count: number): string; /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at * position. Otherwise returns false. */ startsWith(searchString: string, position?: number): boolean; @@ -216,7 +211,7 @@ interface StringConstructor { /** * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest + * as such the first argument will be a well formed template call site object and the rest * parameter will contain the substitution values. * @param template A well-formed template string call site representation. * @param substitutions A set of substitution values. @@ -248,14 +243,14 @@ interface RegExp { interface NumberConstructor { /** * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: + * that is representable as a Number value, which is approximately: * 2.2204460492503130808472633361816 x 10‍−‍16. */ EPSILON: number; /** * Returns true if passed value is finite. - * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a + * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a * number. Only finite values of the type number, result in true. * @param number A numeric value. */ @@ -268,7 +263,7 @@ interface NumberConstructor { isInteger(number: number): boolean; /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter * to a number. Only values of the type number, that are also NaN, result in true. * @param number A numeric value. @@ -281,30 +276,30 @@ interface NumberConstructor { */ isSafeInteger(number: number): boolean; - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. + /** + * The value of the largest integer n such that n and n + 1 are both exactly representable as + * a Number value. * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. */ MAX_SAFE_INTEGER: number; - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. + /** + * The value of the smallest integer n such that n and n − 1 are both exactly representable as + * a Number value. * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). */ MIN_SAFE_INTEGER: number; /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. */ parseFloat(string: string): number; /** * Converts A string to an integer. * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. * All other strings are considered decimal. */ @@ -350,7 +345,7 @@ interface Math { log1p(x: number): number; /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of + * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of * the natural logarithms). * @param x A numeric expression. */ @@ -436,8 +431,8 @@ interface Symbol { } interface SymbolConstructor { - /** - * A reference to the prototype. + /** + * A reference to the prototype. */ prototype: Symbol; @@ -448,14 +443,14 @@ interface SymbolConstructor { (description?: string|number): symbol; /** - * Returns a Symbol object from the global symbol registry matching the given key if found. + * Returns a Symbol object from the global symbol registry matching the given key if found. * Otherwise, returns a new symbol with this key. * @param key key to search for. */ for(key: string): symbol; /** - * Returns a key from the global symbol registry matching the given Symbol if found. + * Returns a key from the global symbol registry matching the given Symbol if found. * Otherwise, returns a undefined. * @param sym Symbol to find the key for. */ @@ -463,72 +458,72 @@ interface SymbolConstructor { // Well-known Symbols - /** - * A method that determines if a constructor object recognizes an object as one of the - * constructor’s instances. Called by the semantics of the instanceof operator. + /** + * A method that determines if a constructor object recognizes an object as one of the + * constructor’s instances. Called by the semantics of the instanceof operator. */ hasInstance: symbol; - /** + /** * A Boolean value that if true indicates that an object should flatten to its array elements * by Array.prototype.concat. */ isConcatSpreadable: symbol; - /** - * A method that returns the default iterator for an object. Called by the semantics of the + /** + * A method that returns the default iterator for an object. Called by the semantics of the * for-of statement. */ iterator: symbol; /** - * A regular expression method that matches the regular expression against a string. Called - * by the String.prototype.match method. + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. */ match: symbol; - /** - * A regular expression method that replaces matched substrings of a string. Called by the + /** + * A regular expression method that replaces matched substrings of a string. Called by the * String.prototype.replace method. */ replace: symbol; /** - * A regular expression method that returns the index within a string that matches the + * A regular expression method that returns the index within a string that matches the * regular expression. Called by the String.prototype.search method. */ search: symbol; - /** - * A function valued property that is the constructor function that is used to create + /** + * A function valued property that is the constructor function that is used to create * derived objects. */ species: symbol; /** - * A regular expression method that splits a string at the indices that match the regular + * A regular expression method that splits a string at the indices that match the regular * expression. Called by the String.prototype.split method. */ split: symbol; - /** + /** * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive * abstract operation. */ toPrimitive: symbol; - /** + /** * A String value that is used in the creation of the default string description of an object. * Called by the built-in method Object.prototype.toString. */ toStringTag: symbol; - /** - * An Object whose own property names are property names that are excluded from the with + /** + * An Object whose own property names are property names that are excluded from the with * environment bindings of the associated objects. */ unscopables: symbol; - + /** * Non-standard. Use simple mode for core-js symbols. See https://github.com/zloirock/core-js/#caveats-when-using-symbol-polyfill */ @@ -544,12 +539,12 @@ declare var Symbol: SymbolConstructor; interface Object { /** - * Determines whether an object has a property with the specified name. + * Determines whether an object has a property with the specified name. * @param v A property name. */ hasOwnProperty(v: PropertyKey): boolean; - /** + /** * Determines whether a specified property is enumerable. * @param v A property name. */ @@ -564,17 +559,17 @@ interface ObjectConstructor { getOwnPropertySymbols(o: any): symbol[]; /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not - * inherited from the object's prototype. + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not + * inherited from the object's prototype. * @param o Object that contains the property. * @param p Name of the property. */ getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript * object (that is, a user-defined object or a built in object) or a DOM object. * @param p The property name. * @param attributes Descriptor for the property. It can be for a data property or an accessor @@ -693,17 +688,17 @@ interface Array { /** Iterator */ [Symbol.iterator](): IterableIterator; - /** + /** * Returns an array of key, value pairs for every entry in the array */ entries(): IterableIterator<[number, T]>; - /** + /** * Returns an list of keys in the array */ keys(): IterableIterator; - /** + /** * Returns an list of values in the array */ values(): IterableIterator; @@ -776,21 +771,21 @@ interface Promise { } interface PromiseConstructor { - /** - * A reference to the prototype. + /** + * A reference to the prototype. */ prototype: Promise; /** * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises + * Creates a Promise that is resolved with an array of results when all of the provided Promises * resolve, or rejected when any Promise is rejected. * @param values An array of Promises. * @returns A new Promise. @@ -798,7 +793,7 @@ interface PromiseConstructor { all(values: Iterable>): Promise; /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. * @param values An array of Promises. * @returns A new Promise. @@ -859,7 +854,7 @@ declare module Reflect { // ############################################################################################# // ECMAScript 7 -// Modules: es7.array.includes, es7.string.at, es7.string.lpad, es7.string.rpad, +// Modules: es7.array.includes, es7.string.at, es7.string.lpad, es7.string.rpad, // es7.object.to-array, es7.object.get-own-property-descriptors, es7.regexp.escape, // es7.map.to-json, and es7.set.to-json // ############################################################################################# @@ -918,14 +913,14 @@ interface ArrayConstructor { */ join(array: ArrayLike, separator?: string): string; /** - * Reverses the elements in an Array. + * Reverses the elements in an Array. */ reverse(array: ArrayLike): T[]; /** * Removes the first element from an array and returns it. */ shift(array: ArrayLike): T; - /** + /** * Returns a section of an array. * @param start The beginning of the specified portion of the array. * @param end The end of the specified portion of the array. @@ -988,21 +983,21 @@ interface ArrayConstructor { /** * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ forEach(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; /** * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ map(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ filter(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; @@ -1021,53 +1016,53 @@ interface ArrayConstructor { */ reduce(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** + /** * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ reduceRight(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - /** + /** * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ reduceRight(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** + /** * Returns an array of key, value pairs for every entry in the array */ entries(array: ArrayLike): IterableIterator<[number, T]>; - /** + /** * Returns an list of keys in the array */ keys(array: ArrayLike): IterableIterator; - /** + /** * Returns an list of values in the array */ values(array: ArrayLike): IterableIterator; - /** - * Returns the value of the first element in the array where predicate is true, and undefined + /** + * Returns the value of the first element in the array where predicate is true, and undefined * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of + * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ find(array: ArrayLike, predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - /** - * Returns the index of the first element in the array where predicate is true, and undefined + /** + * Returns the index of the first element in the array where predicate is true, and undefined * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of + * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ findIndex(array: ArrayLike, predicate: (value: T) => boolean, thisArg?: any): number; @@ -1075,21 +1070,21 @@ interface ArrayConstructor { /** * Returns the this object after filling the section identified by start and end with value * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as * length+end. */ fill(array: ArrayLike, value: T, start?: number, end?: number): T[]; - /** + /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. + * @param end If not specified, length of the this object is used as its default value. */ copyWithin(array: ArrayLike, target: number, start: number, end?: number): T[]; @@ -1113,7 +1108,7 @@ interface ObjectConstructor { * Non-standard. */ classof(value: any): string; - + /** * Non-standard. */ @@ -1477,13 +1472,13 @@ declare module core { } declare module "core-js" { - export = core; + export = core; } declare module "core-js/shim" { - export = core; + export = core; } declare module "core-js/core" { - export = core; + export = core; } declare module "core-js/core/$for" { import $for = core.$for; @@ -2149,10 +2144,10 @@ declare module "core-js/fn/symbol/unscopables" { export = unscopables; } declare module "core-js/es5" { - export = core; + export = core; } declare module "core-js/es6" { - export = core; + export = core; } declare module "core-js/es6/array" { var Array: typeof core.Array; @@ -2211,7 +2206,7 @@ declare module "core-js/es6/weak-set" { export = WeakSet; } declare module "core-js/es7" { - export = core; + export = core; } declare module "core-js/es7/array" { var Array: typeof core.Array; @@ -2238,32 +2233,32 @@ declare module "core-js/es7/string" { export = String; } declare module "core-js/js" { - export = core; + export = core; } declare module "core-js/js/array" { var Array: typeof core.Array; export = Array; } declare module "core-js/web" { - export = core; + export = core; } declare module "core-js/web/dom" { - export = core; + export = core; } declare module "core-js/web/immediate" { - export = core; + export = core; } declare module "core-js/web/timers" { - export = core; + export = core; } declare module "core-js/libary" { - export = core; + export = core; } declare module "core-js/libary/shim" { - export = core; + export = core; } declare module "core-js/libary/core" { - export = core; + export = core; } declare module "core-js/libary/core/$for" { import $for = core.$for; @@ -2928,10 +2923,10 @@ declare module "core-js/libary/fn/symbol/unscopables" { export = unscopables; } declare module "core-js/libary/es5" { - export = core; + export = core; } declare module "core-js/libary/es6" { - export = core; + export = core; } declare module "core-js/libary/es6/array" { var Array: typeof core.Array; @@ -2990,7 +2985,7 @@ declare module "core-js/libary/es6/weak-set" { export = WeakSet; } declare module "core-js/libary/es7" { - export = core; + export = core; } declare module "core-js/libary/es7/array" { var Array: typeof core.Array; @@ -3017,21 +3012,21 @@ declare module "core-js/libary/es7/string" { export = String; } declare module "core-js/libary/js" { - export = core; + export = core; } declare module "core-js/libary/js/array" { var Array: typeof core.Array; export = Array; } declare module "core-js/libary/web" { - export = core; + export = core; } declare module "core-js/libary/web/dom" { - export = core; + export = core; } declare module "core-js/libary/web/immediate" { - export = core; + export = core; } declare module "core-js/libary/web/timers" { - export = core; + export = core; } From fcefa9f5a0aef7c6c26a8db8d7998668ddb1687e Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:06:08 +0900 Subject: [PATCH 026/259] fix bowser/bowser-tests.ts --- bowser/bowser-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bowser/bowser-tests.ts b/bowser/bowser-tests.ts index 07d9f18cba..6006187655 100644 --- a/bowser/bowser-tests.ts +++ b/bowser/bowser-tests.ts @@ -1,7 +1,9 @@ +/// + import Bowser = require('bowser'); Bowser.msedge === true; Bowser.test(['msie']) === true; Bowser.a === Bowser.c; Bowser.osversion > 10; -Bowser.osversion === '10.1A'; \ No newline at end of file +Bowser.osversion === '10.1A'; From c7908638ffebce32baea5ef0b3a835e5c585e28e Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:07:16 +0900 Subject: [PATCH 027/259] fix uniq/uniq-tests.ts --- uniq/uniq-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uniq/uniq-tests.ts b/uniq/uniq-tests.ts index b9facc8e23..1dc3d6fd81 100644 --- a/uniq/uniq-tests.ts +++ b/uniq/uniq-tests.ts @@ -1,3 +1,5 @@ +/// + import unique = require("uniq"); var data = [1, 2, 2, 3, 4, 5, 5, 5, 6]; var datastr = ["1", "2", "2", "3", "4", "5", "5", "5", "6"]; From ba89bd71f2985926ed1872eab91d7737382b500c Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:08:12 +0900 Subject: [PATCH 028/259] fix through/through-tests.ts --- through/through-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/through/through-tests.ts b/through/through-tests.ts index 93fc6d2fa8..35822c9e89 100644 --- a/through/through-tests.ts +++ b/through/through-tests.ts @@ -1,3 +1,5 @@ +/// + import through = require('through'); var i = 0; @@ -6,4 +8,4 @@ through( this.queue((i++).toString()); }, function () { this.queue(null); - }, { autoDestroy: true }).pipe(process.stdout); \ No newline at end of file + }, { autoDestroy: true }).pipe(process.stdout); From 66204f64dec70f9ee32dfa8f0086ca56bf9d6dff Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:09:09 +0900 Subject: [PATCH 029/259] fix stack-trace/stack-trace-tests.ts --- stack-trace/stack-trace-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stack-trace/stack-trace-tests.ts b/stack-trace/stack-trace-tests.ts index a0b2f8d55f..c18f637519 100644 --- a/stack-trace/stack-trace-tests.ts +++ b/stack-trace/stack-trace-tests.ts @@ -1,3 +1,5 @@ +/// + import stackTrace = require('stack-trace'); var currentStackTrace = stackTrace.get(); From f9e262a0357b686783510268d1043877971b9935 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:10:02 +0900 Subject: [PATCH 030/259] fix source-map/source-map-tests.ts --- source-map/source-map-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source-map/source-map-tests.ts b/source-map/source-map-tests.ts index f7ad78e853..3ec6b666d6 100644 --- a/source-map/source-map-tests.ts +++ b/source-map/source-map-tests.ts @@ -1,3 +1,5 @@ +/// + import SourceMap = require('source-map'); function testSourceMapConsumer() { @@ -162,4 +164,4 @@ function testSourceNode() { result = node.toStringWithSourceMap(); result = node.toStringWithSourceMap(sos); } -} \ No newline at end of file +} From 1321ffbee64eb9485d42a6ccf6ed7ef1d5beac8c Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:11:17 +0900 Subject: [PATCH 031/259] remove socket.io/legacy and socket.io-client/legacy --- .../socket.io-client-0.9-commonjs-tests.ts | 10 -- .../legacy/socket.io-client-0.9-tests.ts | 10 -- .../legacy/socket.io-client-0.9.d.ts | 40 ----- .../legacy/socket.io-client-1.2.0-tests.ts | 57 ------- .../legacy/socket.io-client-1.2.0.d.ts | 45 ------ socket.io/legacy/socket.io-0.9-tests.ts | 24 --- .../legacy/socket.io-0.9-tests.ts.tscparams | 1 - socket.io/legacy/socket.io-0.9.d.ts | 70 --------- socket.io/legacy/socket.io-1.2.0-tests.ts | 147 ------------------ socket.io/legacy/socket.io-1.2.0.d.ts | 96 ------------ 10 files changed, 500 deletions(-) delete mode 100644 socket.io-client/legacy/socket.io-client-0.9-commonjs-tests.ts delete mode 100644 socket.io-client/legacy/socket.io-client-0.9-tests.ts delete mode 100644 socket.io-client/legacy/socket.io-client-0.9.d.ts delete mode 100644 socket.io-client/legacy/socket.io-client-1.2.0-tests.ts delete mode 100644 socket.io-client/legacy/socket.io-client-1.2.0.d.ts delete mode 100644 socket.io/legacy/socket.io-0.9-tests.ts delete mode 100644 socket.io/legacy/socket.io-0.9-tests.ts.tscparams delete mode 100644 socket.io/legacy/socket.io-0.9.d.ts delete mode 100644 socket.io/legacy/socket.io-1.2.0-tests.ts delete mode 100644 socket.io/legacy/socket.io-1.2.0.d.ts diff --git a/socket.io-client/legacy/socket.io-client-0.9-commonjs-tests.ts b/socket.io-client/legacy/socket.io-client-0.9-commonjs-tests.ts deleted file mode 100644 index beb8f0fad5..0000000000 --- a/socket.io-client/legacy/socket.io-client-0.9-commonjs-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 7178306281..0000000000 --- a/socket.io-client/legacy/socket.io-client-0.9-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -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 deleted file mode 100644 index 0b3626e420..0000000000 --- a/socket.io-client/legacy/socket.io-client-0.9.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -// 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/legacy/socket.io-client-1.2.0-tests.ts b/socket.io-client/legacy/socket.io-client-1.2.0-tests.ts deleted file mode 100644 index 3ad8db95f6..0000000000 --- a/socket.io-client/legacy/socket.io-client-1.2.0-tests.ts +++ /dev/null @@ -1,57 +0,0 @@ -/// - -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/legacy/socket.io-client-1.2.0.d.ts b/socket.io-client/legacy/socket.io-client-1.2.0.d.ts deleted file mode 100644 index c5d7837641..0000000000 --- a/socket.io-client/legacy/socket.io-client-1.2.0.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Type definitions for socket.io-client 1.2.0 -// Project: http://socket.io/ -// Definitions by: PROGRE -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare var io: SocketIOClientStatic; - -declare module 'socket.io-client' { - export = io; -} - -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 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; - connected: boolean; - } - - interface ManagerStatic { - (url: string, opts: any): SocketIOClient.Manager; - new (url: string, opts: any): SocketIOClient.Manager; - } - - interface Manager { - reconnection(v: boolean): Manager; - reconnectionAttempts(v: boolean): Manager; - reconnectionDelay(v: boolean): Manager; - reconnectionDelayMax(v: boolean): Manager; - timeout(v: boolean): Manager; - } -} diff --git a/socket.io/legacy/socket.io-0.9-tests.ts b/socket.io/legacy/socket.io-0.9-tests.ts deleted file mode 100644 index 0d7e12bb6d..0000000000 --- a/socket.io/legacy/socket.io-0.9-tests.ts +++ /dev/null @@ -1,24 +0,0 @@ -import io = require('socket.io-0.9'); - -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/legacy/socket.io-0.9-tests.ts.tscparams b/socket.io/legacy/socket.io-0.9-tests.ts.tscparams deleted file mode 100644 index 8b13789179..0000000000 --- a/socket.io/legacy/socket.io-0.9-tests.ts.tscparams +++ /dev/null @@ -1 +0,0 @@ - diff --git a/socket.io/legacy/socket.io-0.9.d.ts b/socket.io/legacy/socket.io-0.9.d.ts deleted file mode 100644 index 5ead4abde5..0000000000 --- a/socket.io/legacy/socket.io-0.9.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Type definitions for socket.io -// Project: http://socket.io/ -// Definitions by: William Orr -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -/// - -declare module "socket.io-0.9" { - 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; - } - - -} - diff --git a/socket.io/legacy/socket.io-1.2.0-tests.ts b/socket.io/legacy/socket.io-1.2.0-tests.ts deleted file mode 100644 index c2664f9cd7..0000000000 --- a/socket.io/legacy/socket.io-1.2.0-tests.ts +++ /dev/null @@ -1,147 +0,0 @@ -/// - -import socketIO = require('socket.io-1.2.0'); - -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/legacy/socket.io-1.2.0.d.ts b/socket.io/legacy/socket.io-1.2.0.d.ts deleted file mode 100644 index 01b5e08365..0000000000 --- a/socket.io/legacy/socket.io-1.2.0.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -// 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-1.2.0' { - 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): Namespace; - on(event: 'connect', listener: (socket: Socket) => void): Namespace; - on(event: string, listener: Function): Namespace; - } - - interface Namespace extends NodeJS.EventEmitter { - name: string; - connected: { [id: string]: Socket }; - use(fn: Function): Namespace; - in(room: string): Namespace; - - on(event: 'connection', listener: (socket: Socket) => void): Namespace; - on(event: 'connect', listener: (socket: Socket) => void): Namespace; - on(event: string, listener: Function): Namespace; - } - - interface Socket { - rooms: string[]; - client: Client; - conn: any; - request: any; - id: string; - handshake: { - headers: any; - time: string; - address: any; - xdomain: boolean; - secure: boolean; - issued: number; - url: string; - query: any; - }; - - 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; - send(...args: any[]): Socket; - write(...args: any[]): Socket; - - on(event: string, listener: Function): Socket; - once(event: string, listener: Function): Socket; - removeListener(event: string, listener: Function): Socket; - removeAllListeners(event: string): Socket; - broadcast: Socket; - volatile: Socket; - connected: boolean; - disconnect(close?: boolean): Socket; - } - - interface Client { - conn: any; - request: any; - id: string; - } -} From d6c72efdab3b4385b75316137f48f081b047b7a2 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:12:49 +0900 Subject: [PATCH 032/259] fix seedrandom/seedrandom-tests.ts --- seedrandom/seedrandom-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/seedrandom/seedrandom-tests.ts b/seedrandom/seedrandom-tests.ts index 1f913a406b..69a11622fa 100644 --- a/seedrandom/seedrandom-tests.ts +++ b/seedrandom/seedrandom-tests.ts @@ -1,3 +1,5 @@ +/// + import seedrandom = require("seedrandom"); var rng = seedrandom("hello."); From 1c5de0e7380acc2d8ef94c502be65bd61260167b Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:13:39 +0900 Subject: [PATCH 033/259] fix rsmq-worker/rsmq-worker-tests.ts --- rsmq-worker/rsmq-worker-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rsmq-worker/rsmq-worker-tests.ts b/rsmq-worker/rsmq-worker-tests.ts index fa635e4152..d5d974bd06 100644 --- a/rsmq-worker/rsmq-worker-tests.ts +++ b/rsmq-worker/rsmq-worker-tests.ts @@ -1,3 +1,4 @@ +/// import RSMQWorker = require('rsmq-worker'); @@ -20,4 +21,3 @@ worker.send('message2', 1, (e: Error, id:string) => { worker.send('message3', () => {}); worker.stop(); - From 982e1e0be6aa93fb724f5e1088a9f2c828c2e2b2 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:14:37 +0900 Subject: [PATCH 034/259] fix q-retry/q-retry-tests.ts --- q-retry/q-retry-tests.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/q-retry/q-retry-tests.ts b/q-retry/q-retry-tests.ts index e5d5dd8ca6..fc33d7ba97 100644 --- a/q-retry/q-retry-tests.ts +++ b/q-retry/q-retry-tests.ts @@ -1,3 +1,5 @@ +/// + import Q = require('q-retry'); Q @@ -9,7 +11,7 @@ Q return 0; }) .retry(num => { - num.toFixed; + num.toFixed; }) .retry(() => { @@ -32,8 +34,8 @@ Q limit: 10, interval: 1000, maxInterval: 20000, - intervalMultiplier: 1.5 + intervalMultiplier: 1.5 }) .then(str => { str.charAt; - }); \ No newline at end of file + }); From 5ce4c2f472de80e65582faf2176fabd76e252cdc Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:15:35 +0900 Subject: [PATCH 035/259] fix promise-pool/promise-pool-tests.ts --- promise-pool/promise-pool-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/promise-pool/promise-pool-tests.ts b/promise-pool/promise-pool-tests.ts index 4f3bd40def..a9cc160bea 100644 --- a/promise-pool/promise-pool-tests.ts +++ b/promise-pool/promise-pool-tests.ts @@ -1,3 +1,5 @@ +/// + import Q = require('q'); import promisePool = require('promise-pool'); @@ -44,4 +46,4 @@ function onProgress(progress: promisePool.IProgress) { progress.fulfilled == 0; progress.total == 0; progress.index == 0; -} \ No newline at end of file +} From db262949c6416996ef3c1d9bd18ac63f5fddbc98 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:18:55 +0900 Subject: [PATCH 036/259] fix passport-twitter/passport-twitter-tests.ts --- passport-twitter/passport-twitter-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/passport-twitter/passport-twitter-tests.ts b/passport-twitter/passport-twitter-tests.ts index ae644dfa2a..f7d539f16b 100644 --- a/passport-twitter/passport-twitter-tests.ts +++ b/passport-twitter/passport-twitter-tests.ts @@ -1,3 +1,5 @@ +/// + /** * Created by jcabresos on 4/19/2014. */ From 1fbda2c6681c36d0b745de414726bb6e1a15b568 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:21:15 +0900 Subject: [PATCH 037/259] fix passport-strategy/passport-strategy-tests.ts --- passport-strategy/passport-strategy-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/passport-strategy/passport-strategy-tests.ts b/passport-strategy/passport-strategy-tests.ts index e9c6fd604f..ad5a9a38d3 100644 --- a/passport-strategy/passport-strategy-tests.ts +++ b/passport-strategy/passport-strategy-tests.ts @@ -1,3 +1,4 @@ +/// import express = require('express'); import passport = require('passport-strategy'); From a3661b304820400b5738c9f38ff12f0133557120 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:21:58 +0900 Subject: [PATCH 038/259] fix passport-local/passport-local-tests.ts --- passport-local/passport-local-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/passport-local/passport-local-tests.ts b/passport-local/passport-local-tests.ts index 873dc609bc..68056db49b 100644 --- a/passport-local/passport-local-tests.ts +++ b/passport-local/passport-local-tests.ts @@ -1,3 +1,5 @@ +/// + /** * Created by Maxime LUCE . */ From 443feef52bd3f8ff968e2bc152b4dc431cd816eb Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:24:13 +0900 Subject: [PATCH 039/259] fix passport-google-oauth/passport-google-oauth-tests.ts --- passport-google-oauth/passport-google-oauth-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/passport-google-oauth/passport-google-oauth-tests.ts b/passport-google-oauth/passport-google-oauth-tests.ts index 60fad97b41..ef7a4e9ef9 100644 --- a/passport-google-oauth/passport-google-oauth-tests.ts +++ b/passport-google-oauth/passport-google-oauth-tests.ts @@ -1,3 +1,5 @@ +/// + /** * Created by jcabresos on 4/19/2014. */ From 67aace1c299908c594c8196b69b565cea167293b Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:26:04 +0900 Subject: [PATCH 040/259] fix passport-facebook/passport-facebook-tests.ts --- passport-facebook/passport-facebook-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/passport-facebook/passport-facebook-tests.ts b/passport-facebook/passport-facebook-tests.ts index b35770479f..8accf57c07 100644 --- a/passport-facebook/passport-facebook-tests.ts +++ b/passport-facebook/passport-facebook-tests.ts @@ -1,3 +1,5 @@ +/// + /** * Created by jcabresos on 4/19/2014. */ @@ -22,4 +24,4 @@ passport.use(new facebook.Strategy({ done(null, user); }); }) -); \ No newline at end of file +); From 20ed167e6354363393bee0b8d71b194d4f364144 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:26:42 +0900 Subject: [PATCH 041/259] fix node-polyglot/node-polyglot-tests.ts --- node-polyglot/node-polyglot-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node-polyglot/node-polyglot-tests.ts b/node-polyglot/node-polyglot-tests.ts index fee07d79e9..249be95778 100644 --- a/node-polyglot/node-polyglot-tests.ts +++ b/node-polyglot/node-polyglot-tests.ts @@ -1,3 +1,5 @@ +/// + import Polyglot = require("node-polyglot"); function instantiatePolyglot(): void { From 7eaf3ddddc9a5ed5138b23af62e3b53c5aa0b52b Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:31:19 +0900 Subject: [PATCH 042/259] fix node-imap/imap-tests.ts --- node-imap/imap-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node-imap/imap-tests.ts b/node-imap/imap-tests.ts index 61f4b2e0c1..3c124ca46d 100644 --- a/node-imap/imap-tests.ts +++ b/node-imap/imap-tests.ts @@ -1,3 +1,5 @@ +/// + import Imap = require('imap'); var inspect = require('util').inspect; From 4dc47448f767b8a0a2c96f313aa0c439f492549d Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:32:40 +0900 Subject: [PATCH 043/259] fix mariasql/mariasql-tests.ts --- mariasql/mariasql-tests.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mariasql/mariasql-tests.ts b/mariasql/mariasql-tests.ts index 76819feba8..c3ab5c848c 100644 --- a/mariasql/mariasql-tests.ts +++ b/mariasql/mariasql-tests.ts @@ -1,7 +1,8 @@ // These are the examples from the node-mariasql README transposed to TypeScript // https://github.com/mscdex/node-mariasql -/// +/// +/// // Example 1 - SHOW DATABASES import util = require('util'); @@ -198,4 +199,4 @@ c.end(); Query #3 finished successfully Done with all queries Client closed - */ \ No newline at end of file + */ From f9f932198f109604fc0612eea19ef20b8734cc6c Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:33:27 +0900 Subject: [PATCH 044/259] fix mailparser/mailparser-tests.ts --- mailparser/mailparser-tests.ts | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/mailparser/mailparser-tests.ts b/mailparser/mailparser-tests.ts index 51d5627889..b7df9adb44 100644 --- a/mailparser/mailparser-tests.ts +++ b/mailparser/mailparser-tests.ts @@ -1,3 +1,5 @@ +/// + import mailparser_mod = require("mailparser"); import MailParser = mailparser_mod.MailParser; import ParsedMail = mailparser_mod.ParsedMail; @@ -12,25 +14,25 @@ mailparser.on("headers", function(headers){ }); mailparser.on("end", function(mail){ - mail; // object structure for parsed e-mail + mail; // object structure for parsed e-mail }); - + // Decode a simple e-mail // This example decodes an e-mail from a string - + var email = "From: 'Sender Name' \r\n"+ "To: 'Receiver Name' \r\n"+ "Subject: Hello world!\r\n"+ "\r\n"+ "How are you today?"; - // setup an event listener when the parsing finishes + // setup an event listener when the parsing finishes mailparser.on("end", function(mail_object){ - console.log("From:", mail_object.from); //[{address:'sender@example.com',name:'Sender Name'}] - console.log("Subject:", mail_object.subject); // Hello world! - console.log("Text body:", mail_object.text); // How are you today? + console.log("From:", mail_object.from); //[{address:'sender@example.com',name:'Sender Name'}] + console.log("Subject:", mail_object.subject); // Hello world! + console.log("Text body:", mail_object.text); // How are you today? }); - // send the email source to the parser + // send the email source to the parser mailparser.write(email); mailparser.end(); @@ -42,7 +44,7 @@ import fs = require("fs"); mailparser.on("end", function(mail_object){ console.log("Subject:", mail_object.subject); }); - + fs.createReadStream("email.eml").pipe(mailparser); @@ -63,7 +65,3 @@ mp.on("attachment", function(attachment, mail){ var output = fs.createWriteStream(attachment.generatedFileName); attachment.stream.pipe(output); }); - - - - From 1246be30cc2fc2e7c2b97ed5b2ad4e23655bfa84 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:35:05 +0900 Subject: [PATCH 045/259] fix leapmotionTS/LeapMotionTS-tests.ts --- leapmotionTS/LeapMotionTS-tests.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/leapmotionTS/LeapMotionTS-tests.ts b/leapmotionTS/LeapMotionTS-tests.ts index c6db49c3ef..ac392941ef 100755 --- a/leapmotionTS/LeapMotionTS-tests.ts +++ b/leapmotionTS/LeapMotionTS-tests.ts @@ -1,6 +1,4 @@ -/// - -import Leap = require('LeapMotionTS'); +import Leap = require('./LeapMotionTS'); var controller: Leap.Controller = new Leap.Controller(); controller.addEventListener(Leap.LeapEvent.LEAPMOTION_FRAME, (event: Leap.LeapEvent) => { From 9bffb08e1bf258bb59051d77b016a0744e2ed828 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:36:20 +0900 Subject: [PATCH 046/259] fix knockout/knockoutamd-tests.ts --- knockout/knockoutamd-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/knockout/knockoutamd-tests.ts b/knockout/knockoutamd-tests.ts index dd2124b70d..447da840e8 100644 --- a/knockout/knockoutamd-tests.ts +++ b/knockout/knockoutamd-tests.ts @@ -1,3 +1,5 @@ +/// + import ko = require("knockout"); var myArray = ko.observableArray([1, 2, 3]); @@ -6,4 +8,4 @@ class MyViewModel { name = ko.observable("Jeff"); } -ko.applyBindings(new MyViewModel()); \ No newline at end of file +ko.applyBindings(new MyViewModel()); From c936537423931b4e4ed933c0bd704d9b3c02f5c4 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:37:28 +0900 Subject: [PATCH 047/259] fix jsdom/jsdom-tests.ts --- jsdom/jsdom-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jsdom/jsdom-tests.ts b/jsdom/jsdom-tests.ts index 504f1f0641..1f0d04a0b5 100644 --- a/jsdom/jsdom-tests.ts +++ b/jsdom/jsdom-tests.ts @@ -1,3 +1,5 @@ +/// + import jsdom = require("jsdom"); jsdom.defaultDocumentFeatures.FetchExternalResources = ["img"]; From 4fd210018df1910dadf0c0e853fa9c787691ac82 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:40:00 +0900 Subject: [PATCH 048/259] fix convert-source-map/convert-source-map-tests.ts --- convert-source-map/convert-source-map-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/convert-source-map/convert-source-map-tests.ts b/convert-source-map/convert-source-map-tests.ts index a89cfb7127..1701e0065e 100644 --- a/convert-source-map/convert-source-map-tests.ts +++ b/convert-source-map/convert-source-map-tests.ts @@ -1,3 +1,5 @@ +/// + import convert = require("convert-source-map"); var json = convert @@ -10,4 +12,4 @@ var modified = convert .toJSON(); console.log(json); -console.log(modified); \ No newline at end of file +console.log(modified); From b4174340fffb51f106358fa219b524b64cf259b0 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:40:46 +0900 Subject: [PATCH 049/259] fix contextjs/contextjs-tests.ts --- contextjs/contextjs-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contextjs/contextjs-tests.ts b/contextjs/contextjs-tests.ts index 0b0d55d094..abfc643efa 100644 --- a/contextjs/contextjs-tests.ts +++ b/contextjs/contextjs-tests.ts @@ -1,3 +1,5 @@ +/// + import context = require("contextjs"); context.init(); From 56a373439cfb5041854d6f4a1a11e7edbf5072eb Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:41:55 +0900 Subject: [PATCH 050/259] fix connect-slashes/connect-slashes-tests.ts --- connect-slashes/connect-slashes-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connect-slashes/connect-slashes-tests.ts b/connect-slashes/connect-slashes-tests.ts index 6fc66bbc03..f4c8ac965c 100644 --- a/connect-slashes/connect-slashes-tests.ts +++ b/connect-slashes/connect-slashes-tests.ts @@ -1,4 +1,4 @@ -/// +/// import express = require('express'); import slashes = require('connect-slashes'); From 6e1a983aee976b1c361879818d3e29b18598e937 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:43:17 +0900 Subject: [PATCH 051/259] fix clone/clone-tests.ts --- clone/clone-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clone/clone-tests.ts b/clone/clone-tests.ts index 6a25fb7c30..8cb0681fd6 100644 --- a/clone/clone-tests.ts +++ b/clone/clone-tests.ts @@ -1,3 +1,5 @@ +/// + import clone = require("clone"); var original = { From 2ee4111baec9dcb578f3563776c5e1b4b75ea240 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 00:44:26 +0900 Subject: [PATCH 052/259] fix async/asyncamd-tests.ts --- async/asyncamd-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/async/asyncamd-tests.ts b/async/asyncamd-tests.ts index 4618a67bf5..fc1c254607 100644 --- a/async/asyncamd-tests.ts +++ b/async/asyncamd-tests.ts @@ -1,3 +1,5 @@ +/// + import async = require("async"); -async.map(["a", "b", "c"], (item, cb) => cb(null, [item.toUpperCase()]), (err, results) => { }); \ No newline at end of file +async.map(["a", "b", "c"], (item, cb) => cb(null, [item.toUpperCase()]), (err, results) => { }); From bb7ad74e06bedd29c372a4477b9339a259c7f1ca Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 09:54:10 +0900 Subject: [PATCH 053/259] fix dragula/dragula-amd-tests.ts --- dragula/dragula-amd-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dragula/dragula-amd-tests.ts b/dragula/dragula-amd-tests.ts index 99cb5e043f..0dcca91e23 100644 --- a/dragula/dragula-amd-tests.ts +++ b/dragula/dragula-amd-tests.ts @@ -1,3 +1,5 @@ +/// + import dragula = require("dragula"); // containers From cb96c96f7d6087ae06a8188eed0e049872bbe798 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 10:18:23 +0900 Subject: [PATCH 054/259] fix protobufjs/protobufjs-tests.ts --- protobufjs/protobufjs-tests.ts | 92 +++++++++++++++++----------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/protobufjs/protobufjs-tests.ts b/protobufjs/protobufjs-tests.ts index 8cf52b274b..f20efec3c5 100644 --- a/protobufjs/protobufjs-tests.ts +++ b/protobufjs/protobufjs-tests.ts @@ -15,51 +15,51 @@ function testProtoBufJs() { assert.ok("loadProto" in ProtoBuf, "ProtoBuf should contain property loadProto"); assert.ok("loadProtoFile" in ProtoBuf, "ProtoBuf should contain property loadProtoFile"); assert.ok("newBuilder" in ProtoBuf, "ProtoBuf should contain property newBuilder"); - + var jsonProto: ProtoBuf.ProtoBuilder = ProtoBuf.loadJson(readFileSync("test.json", {"encoding": "utf8"})); assertIsProtoBuilder(jsonProto, "loadJson"); - + var jsonFileProto: ProtoBuf.ProtoBuilder = ProtoBuf.loadJsonFile("test.json"); assertIsProtoBuilder(jsonFileProto, "loadJsonFile"); - + ProtoBuf.loadJsonFile("test.json", (error: any, builder: ProtoBuf.ProtoBuilder) => { assertIsProtoBuilder(builder, "loadJsonFile callback"); }); - + var proto: ProtoBuf.ProtoBuilder = ProtoBuf.loadProto(readFileSync("test.proto", {"encoding": "utf8"})); assertIsProtoBuilder(proto, "loadProto"); - + var protoFile: ProtoBuf.ProtoBuilder = ProtoBuf.loadProtoFile("test.proto"); assertIsProtoBuilder(protoFile, "loadProtoFile"); - + ProtoBuf.loadProtoFile("test.proto", (error: any, builder: ProtoBuf.ProtoBuilder) => { assertIsProtoBuilder(builder, "loadProtoFile callback"); }); - + var newBuilder: ProtoBuf.ProtoBuilder = ProtoBuf.newBuilder(); assertIsProtoBuilder(newBuilder, "newBuilder"); - + assertIsNamespace(protoFile.ns, "protoFile.ns"); assertIsNamespace(protoFile.ptr, "protoFile.ptr"); - + assertIsProtoBuf(protoFile.build(), "protoFile.build()"); assertIsProtoBuf(protoFile.result, "protoFile.result"); - + assertIsProtoBuilder(protoFile.create(), "protoFile.create()"); assertIsProtoBuilder(protoFile.define("js"), "protoFile.define()"); - + assertIsT(protoFile.lookup(), "protoFile.lookup()"); } function testBuilderJs() { var Builder: ProtoBuf.Builder = ProtoBuf.Builder; assertIsBuilder(Builder, "Builder"); - + var newBuilder: ProtoBuf.ProtoBuilder = new ProtoBuf.Builder(); assertIsProtoBuilder(newBuilder, "new Builder()"); - + var Message: ProtoBuf.Message = Builder.Message; var Service: ProtoBuf.Service = Builder.Service; } @@ -104,13 +104,13 @@ function assertIsBuilder(b: ProtoBuf.Builder, name: string) { } function assertIsProtoBuf(pb: ProtoBuf.ProtoBuf, name: string) { - for (var package in pb) { - if (pb.hasOwnProperty(package)) { - for (var property in pb[package]) { - if (typeof pb[package][property] == typeof Object - && pb[package].hasOwnProperty(property)) { - assertIsMetaMessage(pb[package][property], - name + "." + package + "." + property); + for (var pkg in pb) { + if (pb.hasOwnProperty(pkg)) { + for (var property in pb[pkg]) { + if (typeof pb[pkg][property] == typeof Object + && pb[pkg].hasOwnProperty(property)) { + assertIsMetaMessage(pb[pkg][property], + name + "." + pkg + "." + property); } } } @@ -127,7 +127,7 @@ function assertIsMetaMessage(mm: ProtoBuf.MetaMessage, name: string) { function assertIsDotProto(dp: ProtoBuf.DotProto, name: string) { assert.ok("Parser" in dp, name + " should contain property Parser"); assert.ok("Tokenizer" in dp, name + " should contain property Tokenizer"); - + assertIsParser(new dp.Parser(readFileSync("test.proto", {"encoding": "utf8"})), name + ".Parser"); assertIsTokenizer(new dp.Tokenizer(readFileSync("test.proto", {"encoding": "utf8"})), @@ -138,7 +138,7 @@ function assertIsParser(p: ProtoBuf.Parser, name: string) { assert.ok("tn" in p, name + " should contain property tn"); assert.ok("parse" in p, name + " should contain property parse"); assert.ok("toString" in p, name + " should contain property toString"); - + assertIsTokenizer(p.tn, name + ".tn"); assertIsMetaProto(p.parse(), name + ".parse()"); } @@ -162,7 +162,7 @@ function assertIsMetaProto(mp: ProtoBuf.MetaProto, name: string) { assert.ok("imports" in mp, name + " should contain proeprty imports"); assert.ok("options" in mp, name + " should contain proeprty options"); assert.ok("services" in mp, name + " should contain proeprty services"); - + for (var message in mp.messages) { assertIsProtoMessage(mp.messages[message], name + ".messages." + message); } @@ -178,7 +178,7 @@ function assertIsProtoEnum(pe: ProtoBuf.ProtoEnum, name: string) { assert.ok("name" in pe, name + " should contain property name"); assert.ok("values" in pe, name + " should contain property values"); assert.ok("options" in pe, name + " should contain property options"); - + assertIsProtoEnumValue(pe.values, name + ".values"); } @@ -202,7 +202,7 @@ function assertIsProtoMessage(pm: ProtoBuf.ProtoMessage, name: string) { assert.ok("messages" in pm, name + " should contain property messages"); assert.ok("options" in pm, name + " should contain property options"); assert.ok("oneofs" in pm, name + " should contain property oneofs"); - + for (var f in pm.fields) { assertIsProtoField(pm.fields[f], name + ".fields." + f); } @@ -224,7 +224,7 @@ function assertIsProtoService(ps: ProtoBuf.ProtoService, name: string) { assert.ok("name" in ps, name + " should contain property name"); assert.ok("rpc" in ps, name + " should contain property rpc"); assert.ok("options" in ps, name + " should contain property options"); - + for (var rpc in ps.rpc) { assertIsProtoRpcService(ps.rpc[rpc], name + ".rpc." + rpc); } @@ -237,14 +237,14 @@ function assertIsReflect(r: ProtoBuf.Reflect, name: string) { assert.ok("Enum" in r, name + " should contain property Enum"); assert.ok("Extension" in r, name + " should contain property Extension"); assert.ok("Service" in r, name + " should contain property Service"); - + assertIsT(new ProtoBuf.Reflect.T(), "new ProtoBuf.Reflect.T()"); assertIsNamespace(new ProtoBuf.Reflect.Namespace(), "new ProtoBuf.Reflect.Namespace()"); assertIsMessage(new ProtoBuf.Reflect.Message(), "new ProtoBuf.Reflect.Message()"); assertIsEnum(new ProtoBuf.Reflect.Enum(), "new ProtoBuf.Reflect.Enum()"); assertIsExtension(new ProtoBuf.Reflect.Extension(), "new ProtoBuf.Reflect.Extension()"); assertIsService(new ProtoBuf.Reflect.Service(), "new ProtoBuf.Reflect.Service()"); - + assertIsValue(new ProtoBuf.Reflect.Enum.Value(), "new ProtoBuf.Reflect.Enum.Value()"); assertIsOneOf(new ProtoBuf.Reflect.Message.OneOf(), "new ProtoBuf.Reflect.Message.OneOf()"); assertIsMethod(new ProtoBuf.Reflect.Service.Method(), "new ProtoBuf.Reflect.Service.Method()"); @@ -255,7 +255,7 @@ function assertIsReflect(r: ProtoBuf.Reflect, name: string) { function assertIsT(t: ProtoBuf.ReflectT, name: string) { if (t != null && t != undefined) { assertIsTNoRecursion(t, name); - + assertIsProtoBuilder(t.builder, name + ".builder"); assertIsTNoRecursion(t.parent, name + ".parent"); } @@ -273,9 +273,9 @@ function assertIsTNoRecursion(t: ProtoBuf.ReflectT, name: string) { function assertIsNamespace(ns: ProtoBuf.ReflectNamespace, name: string) { assertIsNamespaceNoRecursion(ns, name); - + assertIsT(ns, name); - + for (var child in ns.children) { assertIsT(ns.children[child], name + ".children." + child); } @@ -308,7 +308,7 @@ function assertIsMessage(m: ProtoBuf.ReflectMessage, name: string) { assert.ok("encode" in m, name + " should contain property encode"); assert.ok("calculate" in m, name + " should contain property calculate"); assert.ok("decode" in m, name + " should contain property decode"); - + assertIsNamespace(m, name); } } @@ -316,22 +316,22 @@ function assertIsMessage(m: ProtoBuf.ReflectMessage, name: string) { function assertIsEnum(e: ProtoBuf.ReflectEnum, name: string) { assert.ok("object" in e, name + " should contain property object"); assert.ok("build" in e, name + " should contain property build"); - + assertIsNamespace(e, name); } function assertIsExtension(e: ProtoBuf.ReflectExtension, name: string) { assert.ok("field" in e, name + " should contain property field"); - + assertIsT(e, name); - + assertIsField(e.field, name + ".field"); } function assertIsService(s: ProtoBuf.ReflectService, name: string) { assert.ok("clazz" in s, name + " should contain property clazz"); assert.ok("build" in s, name + " should contain property build"); - + assertIsNamespace(s, name); } @@ -355,9 +355,9 @@ function assertIsField(f: ProtoBuf.ReflectField, name: string) { assert.ok("calculate" in f, name + " should contain property calculate"); assert.ok("calculateValue" in f, name + " should contain property calculateValue"); assert.ok("decode" in f, name + " should contain property decode"); - + assertIsT(f, name); - + assertIsT(f.resolvedType, name + ".resolvedType"); assertIsOneOf(f.oneof, name + ".oneof"); } @@ -370,15 +370,15 @@ function assertIsWireTuple(wt: ProtoBuf.WireTuple, name: string) { function assertIsExtensionField(ef: ProtoBuf.ReflectExtensionField, name: string) { assert.ok("extension" in ef, name + " should contain property extension"); - + assertIsField(ef, name); - + assertIsExtension(ef.extension, name + ".extension"); } function assertIsOneOf(oo: ProtoBuf.ReflectOneOf, name: string) { assert.ok("fields" in oo, name + " should contain property fields"); - + for (var f in oo.fields) { assertIsField(oo.fields[f], name + ".fields." + f); } @@ -387,7 +387,7 @@ function assertIsOneOf(oo: ProtoBuf.ReflectOneOf, name: string) { function assertIsValue(v: ProtoBuf.ReflectValue, name: string) { assert.ok("className" in v, name + " should contain property className"); assert.ok("id" in v, name + " should contain property id"); - + assertIsT(v, name); } @@ -395,7 +395,7 @@ function assertIsMethod(m: ProtoBuf.ReflectMethod, name: string) { assert.ok("className" in m, name + " should contain property className"); assert.ok("options" in m, name + " should contain property options"); assert.ok("buildOpt" in m, name + " should contain property buildOpt"); - + assertIsT(m, name); } @@ -405,9 +405,9 @@ function assertIsRPCMethod(rpc: ProtoBuf.ReflectRPCMethod, name: string) { assert.ok("resolvedRequestType" in rpc, name + " should contain property resolvedRequestType"); assert.ok("resolvedResponseType" in rpc, name + " should contain property resolvedResponseType"); - + assertIsMethod(rpc, name); - + assertIsMessage(rpc.resolvedRequestType, name + ".resolvedRequestType"); assertIsMessage(rpc.resolveResponseType, name + ".resolvedResponsetype"); } @@ -415,4 +415,4 @@ function assertIsRPCMethod(rpc: ProtoBuf.ReflectRPCMethod, name: string) { testProtoBufJs(); testBuilderJs(); testDotProtoJs(); -testReflectJs(); \ No newline at end of file +testReflectJs(); From 772585f53e6f9bba5c0edde47dda3d319891bb0a Mon Sep 17 00:00:00 2001 From: vvakame Date: Sat, 29 Aug 2015 10:52:33 +0900 Subject: [PATCH 055/259] fix stampit/stampit.d.ts and remove legacy definitions --- stampit/stampit-1.2.0.d.ts | 155 ------------------------------ stampit/stampit-tests-1.2.0.ts | 168 --------------------------------- stampit/stampit-tests.ts | 3 +- stampit/stampit.d.ts | 4 +- 4 files changed, 5 insertions(+), 325 deletions(-) delete mode 100644 stampit/stampit-1.2.0.d.ts delete mode 100644 stampit/stampit-tests-1.2.0.ts diff --git a/stampit/stampit-1.2.0.d.ts b/stampit/stampit-1.2.0.d.ts deleted file mode 100644 index 8d46e74778..0000000000 --- a/stampit/stampit-1.2.0.d.ts +++ /dev/null @@ -1,155 +0,0 @@ -// Type definitions for stampit -// Project: https://github.com/ericelliott/stampit -// Definitions by: Vasyl Boroviak -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare var stampit: stampit.Stampit; - -declare module stampit { - interface Stampit { - /** - * Return a factory (akaStamp) function that will produce new objects using the - * prototypes that are passed in or composed. - * @param methods A map of method names and bodies for delegation. - * @param state A map of property names and values to clone for each new object. - * @param enclose A closure (function) used to create private data and privileged methods. - * */ - (methods?:{}, state?:{}, enclose?:{(...encloseArgs:any[]): void}[]):stampit.Stamp; - - /** - * Take two or more Stamps and combine them to produce a new Stamp. - * Combining overrides properties with last-in priority. - * @param stamps Stamps produced by stampit. - * @return A new Stamp made of all the given. - */ - compose(...stamps:Stamp[]): Stamp; - - /** - * Take a destination object followed by one or more source objects, - * and copy the source object properties to the destination object, - * with last in priority overrides. - * @param destination An object to copy properties to. - * @param source Objects to copy properties from. - * @return The destination object. - */ - mixIn(destination:any, ...source:any[]): any; - - /** - * Alias for mixIn. - * Take a destination object followed by one or more source objects, - * and copy the source object properties to the destination object, - * with last in priority overrides. - * @param destination An object to copy properties to. - * @param source Objects to copy properties from. - * @return The destination object. - */ - extend(destination:any, ...source:any[]): any; - - /** - * Check if an object is a Stamp. - * @param obj An object to check. - * @return true if the object is a Stamp; otherwise - false. - */ - isStamp(obj:any): boolean; - - /** - * Take an old-fashioned JS constructor and return a Stamp - * that you can freely compose with other Stamps. - * @param Constructor Old-fashioned constructor function. - * @return A new Stamp based on the given constructor. - */ - convertConstructor(Constructor:any): Stamp; - } - - /** - * A factory function that will produce new objects using the - * prototypes that are passed in or composed. - */ - export interface Stamp { - /** - * Just like calling stamp() invokes the stamp and returns a new object instance. - * @param state Properties you wish to set on the new objects. - * @param encloseArgs The remaining arguments are passed to all .enclose() functions. - * WARNING Avoid using two different .enclose() functions that expect different arguments. - * .enclose() functions that take arguments should not be considered safe to compose - * with other .enclose() functions that also take arguments. Taking arguments with - * an .enclose() function is an anti-pattern that should be avoided, when possible. - * @return A new object composed of the Stamps and prototypes provided. - */ - (state?:{}, ...encloseArgs:any[]): any; - - /** - * Just like calling stamp(), stamp.create() invokes the stamp and returns a new instance. - * @param state Properties you wish to set on the new objects. - * @param encloseArgs The remaining arguments are passed to all .enclose() functions. - * WARNING Avoid using two different .enclose() functions that expect different arguments. - * .enclose() functions that take arguments should not be considered safe to compose - * with other .enclose() functions that also take arguments. Taking arguments with - * an .enclose() function is an anti-pattern that should be avoided, when possible. - * @return A new object composed of the Stamps and prototypes provided. - */ - create(state?:{}, ...encloseArgs:any[]): any; - - /** - * An object map containing the fixed prototypes. - */ - fixed: Fixed; - - /** - * Add methods to the methods prototype. Chainable. - * @param methods Object(s) containing map of method names and bodies for delegation. - * @return Self. - */ - methods(...methods:{}[]): Stamp; - - /** - * Take n objects and add them to the state prototype. Changes `this` object. Chainable. - * @param states Object(s) containing map of property names and values to clone for each new object. - * @return Self. - */ - state(...states:{}[]): Stamp; - - /** - * Take n functions, an array of functions, or n objects and add the functions to the enclose prototype. - * Functions passed into .enclose() are called any time an object is instantiated. - * That happens when the stamp function is invoked, or when the .create() method is called. - * Changes `this` object. Chainable. - * @param functions Closures (functions) used to create private data and privileged methods. - * @return Self. - */ - enclose(...functions:{(...encloseArgs:any[]): void}[]): Stamp; - - /** - * Take n functions, an array of functions, or n objects and add the functions to the enclose prototype. - * Functions passed into .enclose() are called any time an object is instantiated. - * That happens when the stamp function is invoked, or when the .create() method is called. - * Changes `this` object. Chainable. - * @param methods Function properties of these objects will be treated as closure functions. - * @return Self. - */ - enclose(...methods:{}[]): Stamp; - - /** - * Take one or more Stamps and - * combine them with `this` to produce and return a new Stamp. - * Combining overrides properties with last-in priority. - * NOT chainable. - * @param stamps Stampit factories, aka Stamps. - * @return A new Stamp composed from arguments and `this`. - */ - compose(...stamps:Stamp[]): Stamp; - } - - /** - * An object map containing the fixed prototypes. - */ - interface Fixed { - methods: {}; - state: {}; - enclose: {(...encloseArgs:any[]): void}[]; - } -} - -declare module "stampit" { - export = stampit; -} \ No newline at end of file diff --git a/stampit/stampit-tests-1.2.0.ts b/stampit/stampit-tests-1.2.0.ts deleted file mode 100644 index ce404651a1..0000000000 --- a/stampit/stampit-tests-1.2.0.ts +++ /dev/null @@ -1,168 +0,0 @@ -/// - -var a = stampit().enclose(() => { - var a = 'a'; - this.getA = () => { - return a; - }; -}); -a(); // Object -- so far so good. -a().getA(); // "a" - - -var b = stampit().enclose(function () { - var a = 'b'; - this.getB = function () { - return a; - }; -}); - - -var c = stampit.compose(a, b); -var foo = c(); // we won't throw this one away... -foo.getA(); // "a" -foo.getB(); // "b" - - -// Some more privileged methods, with some private data. -// Use stampit.mixIn() to make this feel declarative: -var availability = stampit().enclose(function () { - var isOpen = false; // private - - return stampit.mixIn(this, { - open: function open() { - isOpen = true; - return this; - }, - close: function close() { - isOpen = false; - return this; - }, - isOpen: function isOpenMethod() { - return isOpen; - } - }); -}); -// Hre's a mixin with public methods, and some state: -var membership = stampit({ - members: {}, - add: function (member: any) { - this.members[member.name] = member; - return this; - }, - getMember: function (name: any) { - return this.members[name]; - } - }, - { - members: {} - }); -// Let's set some defaults: -var defaults = stampit().state({ - name: 'The Saloon', - specials: 'Whisky, Gin, Tequila' -}); - -// Classical inheritance has nothing on this. No parent/child coupling. No deep inheritance hierarchies. -// Just good, clean code reusability. -var bar = stampit.compose(defaults, availability, membership); -// Note that you can override state on instantiation: -var myBar = bar({name: 'Moe\'s'}); -// Silly, but proves that everything is as it should be. -myBar.add({name: 'Homer' }).open().getMember('Homer'); - - - -var myStamp = stampit().methods({ - foo: function () { - return 'foo'; - }, - methodOverride: function () { - return false; - } -}).methods({ - bar: function () { - return 'bar' - }, - methodOverride: function () { - return true; - } -}); - -myStamp.state({ - foo: {bar: 'bar'}, - stateOverride: false -}).state({ - bar: 'bar', - stateOverride: true -}); - -myStamp.enclose(function () { - var secret = 'foo'; - - this.getSecret = function () { - return secret; - }; -}).enclose(function () { - this.a = true; -}).enclose({ - bar: function bar() { - this.b = true; - } -}, { - baz: function baz() { - this.c = true; - } -}); - -var obj = myStamp.create(); -obj.getSecret && obj.a && obj.b && obj.c; // true - -var newStamp = stampit(null, { defaultNum: 1 }).compose(myStamp); - - - -var obj1 = stampit().methods({ - a: function () { return 'a'; } -}, { - b: function () { return 'b'; } -}).create(); - -var obj2 = stampit().state({ - a: 'a' -}, { - b: 'b' -}).create(); - -var obj = defaults.compose(newStamp, membership, availability).create(); - - - -// The old constructor / class thing... -var Constructor = function Constructor() { - this.thing = 'initialized'; -}; -Constructor.prototype.foo = function foo() { return 'foo'; }; - -// The conversion -var oldskool = stampit.convertConstructor(Constructor); - -// A new stamp to compose with... -var newskool = stampit().methods({ - bar: function bar() { return 'bar'; } - // your methods here... -}).enclose(function () { - this.baz = 'baz'; -}); - -// Now you can compose those old constructors just like you could -// with any other stamp... -var myThing = stampit.compose(oldskool, newskool); - -var t = myThing(); - -t.thing; // 'initialized', - -t.foo(); // 'foo', - -t.bar(); // 'bar' diff --git a/stampit/stampit-tests.ts b/stampit/stampit-tests.ts index f813482d8f..07d3fe8585 100644 --- a/stampit/stampit-tests.ts +++ b/stampit/stampit-tests.ts @@ -1,5 +1,6 @@ /// -import stampit = require('./stampit.d'); + +import stampit = require('stampit'); var a = stampit().init((options) => { var a = options.args[0]; diff --git a/stampit/stampit.d.ts b/stampit/stampit.d.ts index e56035c4fa..5b03237f2d 100644 --- a/stampit/stampit.d.ts +++ b/stampit/stampit.d.ts @@ -294,4 +294,6 @@ declare module stampit { export function convertConstructor(Constructor:any): Stamp; } -export = stampit; +declare module "stampit" { + export = stampit; +} From b4fdbace3dede99a8acbfbfcfb264da2614f98fd Mon Sep 17 00:00:00 2001 From: James Brantly Date: Sat, 29 Aug 2015 09:48:26 -0400 Subject: [PATCH 056/259] Fix CSSProperties indexer issue (sort of) --- react/react-addons-tests.ts | 9 +++++---- react/react.d.ts | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/react/react-addons-tests.ts b/react/react-addons-tests.ts index f4f6db8e7e..15a31cbe93 100644 --- a/react/react-addons-tests.ts +++ b/react/react-addons-tests.ts @@ -206,15 +206,16 @@ myComponent.reset(); // -------------------------------------------------------------------------- var children: any[] = ["Hello world", [null], React.DOM.span(null)]; +var divStyle: React.CSSProperties = { // CSSProperties + flex: "1 1 main-size", + backgroundImage: "url('hello.png')" +}; var htmlAttr: React.HTMLAttributes = { key: 36, ref: "htmlComponent", children: children, className: "test-attr", - style: { // CSSProperties - flex: "1 1 main-size", - backgroundImage: "url('hello.png')" - }, + style: divStyle, onClick: (event: React.MouseEvent) => { event.preventDefault(); event.stopPropagation(); diff --git a/react/react.d.ts b/react/react.d.ts index 98d19688be..906bc9da15 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -403,7 +403,7 @@ declare namespace __React { strokeOpacity?: number; strokeWidth?: number; - [propertyName: string]: string | number | boolean; + [propertyName: string]: any; } interface HTMLAttributes extends DOMAttributes { @@ -1200,7 +1200,7 @@ declare module "react/addons" { strokeOpacity?: number; strokeWidth?: number; - [propertyName: string]: string | number | boolean; + [propertyName: string]: any; } interface HTMLAttributes extends DOMAttributes { From a132dbfacf6491d421abb213e13cd1fd6f3c222b Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Sat, 29 Aug 2015 18:31:48 -0500 Subject: [PATCH 057/259] Replace Stream#_transform()s with single method with chunk: any --- node/node.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/node/node.d.ts b/node/node.d.ts index 027c654acc..d02311e2f7 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1728,8 +1728,7 @@ declare module "stream" { readable: boolean; writable: boolean; constructor(opts?: TransformOptions); - _transform(chunk: Buffer, encoding: string, callback: Function): void; - _transform(chunk: string, encoding: string, callback: Function): void; + _transform(chunk: any, encoding: string, callback: Function): void; _flush(callback: Function): void; read(size?: number): any; setEncoding(encoding: string): void; From 2c29e389777cb10534252334545d279a1663baa4 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Sun, 30 Aug 2015 00:10:39 -0300 Subject: [PATCH 058/259] add better-curry --- better-curry/better-curry-tests.ts | 25 +++++++++++++++ better-curry/better-curry.d.ts | 50 ++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 better-curry/better-curry-tests.ts create mode 100644 better-curry/better-curry.d.ts diff --git a/better-curry/better-curry-tests.ts b/better-curry/better-curry-tests.ts new file mode 100644 index 0000000000..15213d58b6 --- /dev/null +++ b/better-curry/better-curry-tests.ts @@ -0,0 +1,25 @@ +/// + +import bc = require('better-curry'); +bc.flatten([1,2,3,[1,2],['a']]) === []; +bc.MAX_OPTIMIZED = 5; + +function fn(...args: number[]): number[] { + return [].concat([1]); +} + +function fn2(arg1: string, arg2: any): number { + return parseInt(arg1 + String(arg2)) + 1; +} + +bc.predefine(fn, [1,2])() === []; +bc.predefine(fn, [1,2]).__length === 3; + +var f = bc.wrap(fn2, {}, 10, true); +f('1', 2) === 3; + +var delegate = bc.delegate({}, 'ok'); +delegate.access('ok') === delegate; +delegate.getter('getter').setter('setter') === delegate; +delegate.all(['1','2']); +delegate.revoke('adsf').access('asdf'); \ No newline at end of file diff --git a/better-curry/better-curry.d.ts b/better-curry/better-curry.d.ts new file mode 100644 index 0000000000..59ebe0a37c --- /dev/null +++ b/better-curry/better-curry.d.ts @@ -0,0 +1,50 @@ +// Type definitions for better-curry +// Project: https://github.com/pocesar/js-bettercurry +// Definitions by: Paulo Cesar +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare var BetterCurry: BetterCurryModule.BetterCurry; + +declare module BetterCurryModule { + + export interface DelegateOptions { + as?: string; + len?: number; + args?: any[]; + name?: string; + } + + export class Delegate { + proto: T; + target: string; + methods: any[]; + getters: any[]; + setters: any[]; + all: (skip?: string[]) => void; + method: (name: string|DelegateOptions) => Delegate; + getter: (name: string|DelegateOptions) => Delegate; + setter: (name: string|DelegateOptions) => Delegate; + access: (name: string|DelegateOptions) => Delegate; + revoke: (name: string) => Delegate; + constructor(proto: T, target: string); + } + + export interface OriginalFunctionReminder extends Function { + __length: number; + } + + export interface BetterCurry { + predefine: (fn: T, args: any[], context?: Object, len?: number, checkArguments?: boolean) => OriginalFunctionReminder; + wrap: (fn: T, context?: Object, len?: number, checkArguments?: boolean) => OriginalFunctionReminder; + flatten: (...args: Array|any>) => any[]; + delegate: (proto: T, target: string) => Delegate; + MAX_OPTIMIZED: number; + } + +} + +declare module 'better-curry' { + var bc: BetterCurryModule.BetterCurry; + + export = bc; +} \ No newline at end of file From 10c0f2aadf2255a9f8c14c2cb489c0105c8d5419 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Date: Sun, 30 Aug 2015 00:17:20 -0300 Subject: [PATCH 059/259] add global to tests --- better-curry/better-curry-tests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/better-curry/better-curry-tests.ts b/better-curry/better-curry-tests.ts index 15213d58b6..ba95326f5b 100644 --- a/better-curry/better-curry-tests.ts +++ b/better-curry/better-curry-tests.ts @@ -22,4 +22,6 @@ var delegate = bc.delegate({}, 'ok'); delegate.access('ok') === delegate; delegate.getter('getter').setter('setter') === delegate; delegate.all(['1','2']); -delegate.revoke('adsf').access('asdf'); \ No newline at end of file +delegate.revoke('adsf').access('asdf'); + +BetterCurry.wrap(fn2, {}, -1, false).__length === 10; \ No newline at end of file From 2eb770d6fa20081b30131ad1c90007d1d060f12e Mon Sep 17 00:00:00 2001 From: Jordy Hulck Date: Sun, 30 Aug 2015 22:19:56 +0200 Subject: [PATCH 060/259] Added titlebar api from UWP --- winrt/winrt.d.ts | 240 ++++++++++++++++++++++++++--------------------- 1 file changed, 131 insertions(+), 109 deletions(-) diff --git a/winrt/winrt.d.ts b/winrt/winrt.d.ts index 47aad9302a..b0e32cf9b6 100644 --- a/winrt/winrt.d.ts +++ b/winrt/winrt.d.ts @@ -91,8 +91,8 @@ declare module Windows { every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: T, index: number, array: T[]) => boolean): boolean; some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: T, index: number, array: T[]) => void ): void; - forEach(callbackfn: (value: T, index: number, array: T[]) => void , thisArg: any): void; + forEach(callbackfn: (value: T, index: number, array: T[]) => void): void; + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg: any): void; map(callbackfn: (value: T, index: number, array: T[]) => any): any[]; map(callbackfn: (value: T, index: number, array: T[]) => any, thisArg: any): any[]; filter(callbackfn: (value: T, index: number, array: T[]) => boolean): T[]; @@ -138,8 +138,8 @@ declare module Windows { every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: T, index: number, array: T[]) => boolean): boolean; some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: T, index: number, array: T[]) => void ): void; - forEach(callbackfn: (value: T, index: number, array: T[]) => void , thisArg: any): void; + forEach(callbackfn: (value: T, index: number, array: T[]) => void): void; + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg: any): void; map(callbackfn: (value: T, index: number, array: T[]) => any): any[]; map(callbackfn: (value: T, index: number, array: T[]) => any, thisArg: any): any[]; filter(callbackfn: (value: T, index: number, array: T[]) => boolean): T[]; @@ -238,8 +238,8 @@ declare module Windows { every(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => boolean): boolean; some(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => void ): void; - forEach(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => void): void; + forEach(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => any): any[]; map(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.Foundation.IWwwFormUrlDecoderEntry, index: number, array: Windows.Foundation.IWwwFormUrlDecoderEntry[]) => boolean): Windows.Foundation.IWwwFormUrlDecoderEntry[]; @@ -516,7 +516,7 @@ declare module Windows { then(success?: () => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; then(success?: () => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; then(success?: () => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; - done? (success?: () => any, error?: (error: any) => any, progress?: (progress: any) => void): void; + done?(success?: () => any, error?: (error: any) => any, progress?: (progress: any) => void): void; cancel(): void; @@ -1802,31 +1802,31 @@ declare module Windows { } export interface IPackage { dependencies: Windows.Foundation.Collections.IVectorView; - description: string; - displayName: string; + description: string; + displayName: string; id: Windows.ApplicationModel.PackageId; installedLocation: Windows.Storage.StorageFolder; - isBundle: boolean; - isDevelopmentMode: boolean; + isBundle: boolean; + isDevelopmentMode: boolean; isFramework: boolean; - isResourcePackage: boolean; - logo: Windows.Foundation.Uri; - publisherDisplayName: string; + isResourcePackage: boolean; + logo: Windows.Foundation.Uri; + publisherDisplayName: string; } export class Package implements Windows.ApplicationModel.IPackage { - static current: Windows.ApplicationModel.Package; + static current: Windows.ApplicationModel.Package; dependencies: Windows.Foundation.Collections.IVectorView; - description: string; - displayName: string; + description: string; + displayName: string; id: Windows.ApplicationModel.PackageId; installedLocation: Windows.Storage.StorageFolder; - isBundle: boolean; - isDevelopmentMode: boolean; + isBundle: boolean; + isDevelopmentMode: boolean; isFramework: boolean; - isResourcePackage: boolean; - logo: Windows.Foundation.Uri; - publisherDisplayName: string; + isResourcePackage: boolean; + logo: Windows.Foundation.Uri; + publisherDisplayName: string; } export interface IPackageStatics { current: Windows.ApplicationModel.Package; @@ -2033,8 +2033,8 @@ declare module Windows { every(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => boolean): boolean; some(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => void ): void; - forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => void): void; + forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => any): any[]; map(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceQualifier, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceQualifier[]) => boolean): Windows.ApplicationModel.Resources.Core.ResourceQualifier[]; @@ -2072,8 +2072,8 @@ declare module Windows { every(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => boolean): boolean; some(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => void ): void; - forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => void): void; + forEach(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => any): any[]; map(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.ApplicationModel.Resources.Core.ResourceCandidate, index: number, array: Windows.ApplicationModel.Resources.Core.ResourceCandidate[]) => boolean): Windows.ApplicationModel.Resources.Core.ResourceCandidate[]; @@ -2111,8 +2111,8 @@ declare module Windows { every(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: string, index: number, array: string[]) => boolean): boolean; some(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: string, index: number, array: string[]) => void ): void; - forEach(callbackfn: (value: string, index: number, array: string[]) => void , thisArg: any): void; + forEach(callbackfn: (value: string, index: number, array: string[]) => void): void; + forEach(callbackfn: (value: string, index: number, array: string[]) => void, thisArg: any): void; map(callbackfn: (value: string, index: number, array: string[]) => any): any[]; map(callbackfn: (value: string, index: number, array: string[]) => any, thisArg: any): any[]; filter(callbackfn: (value: string, index: number, array: string[]) => boolean): string[]; @@ -2364,8 +2364,8 @@ declare module Windows { every(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => boolean): boolean; some(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => void ): void; - forEach(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => void): void; + forEach(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => any): any[]; map(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.Data.Json.IJsonValue, index: number, array: Windows.Data.Json.IJsonValue[]) => boolean): Windows.Data.Json.IJsonValue[]; @@ -2510,8 +2510,8 @@ declare module Windows { every(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean): boolean; some(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void ): void; - forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void): void; + forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any): any[]; map(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean): Windows.Data.Xml.Dom.IXmlNode[]; @@ -2556,8 +2556,8 @@ declare module Windows { every(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean): boolean; some(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void ): void; - forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void): void; + forEach(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any): any[]; map(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.Data.Xml.Dom.IXmlNode, index: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => boolean): Windows.Data.Xml.Dom.IXmlNode[]; @@ -2566,7 +2566,7 @@ declare module Windows { reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any, initialValue: any): any; reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any): any; reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: Windows.Data.Xml.Dom.IXmlNode[]) => any, initialValue: any): any; - } + } export class XmlDocument implements Windows.Data.Xml.Dom.IXmlDocument, Windows.Data.Xml.Dom.IXmlNode, Windows.Data.Xml.Dom.IXmlNodeSelector, Windows.Data.Xml.Dom.IXmlNodeSerializer, Windows.Data.Xml.Dom.IXmlDocumentIO { doctype: Windows.Data.Xml.Dom.XmlDocumentType; documentElement: Windows.Data.Xml.Dom.XmlElement; @@ -3248,11 +3248,11 @@ declare module Windows { getResults(): void; cancel(): void; close(): void; - then(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: any) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + then(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: any) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + done(success?: (value: any) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; operation: { completed: Windows.Foundation.AsyncOperationCompletedHandler; getResults(): any; @@ -3266,11 +3266,11 @@ declare module Windows { getResults(): void; cancel(): void; close(): void; - then(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: any) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + then(success?: (value: any) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: any) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: any) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + done(success?: (value: any) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; operation: { completed: Windows.Foundation.AsyncOperationCompletedHandler; getResults(): any; @@ -3284,11 +3284,11 @@ declare module Windows { getResults(): Windows.Devices.Sms.ISmsMessage; cancel(): void; close(): void; - then(success?: (value: Windows.Devices.Sms.ISmsMessage) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.ISmsMessage) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.ISmsMessage) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.ISmsMessage) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: Windows.Devices.Sms.ISmsMessage) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + then(success?: (value: Windows.Devices.Sms.ISmsMessage) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Devices.Sms.ISmsMessage) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Devices.Sms.ISmsMessage) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Devices.Sms.ISmsMessage) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + done(success?: (value: Windows.Devices.Sms.ISmsMessage) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; operation: { completed: Windows.Foundation.AsyncOperationCompletedHandler; getResults(): Windows.Devices.Sms.ISmsMessage; @@ -3303,11 +3303,11 @@ declare module Windows { getResults(): Windows.Foundation.Collections.IVectorView; cancel(): void; close(): void; - then(success?: (value: Windows.Foundation.Collections.IVectorView) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Foundation.Collections.IVectorView) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Foundation.Collections.IVectorView) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Foundation.Collections.IVectorView) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: Windows.Foundation.Collections.IVectorView) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + then(success?: (value: Windows.Foundation.Collections.IVectorView) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Foundation.Collections.IVectorView) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Foundation.Collections.IVectorView) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Foundation.Collections.IVectorView) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + done(success?: (value: Windows.Foundation.Collections.IVectorView) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; operation: { progress: Windows.Foundation.AsyncOperationProgressHandler, number>; completed: Windows.Foundation.AsyncOperationCompletedHandler>; @@ -3362,7 +3362,7 @@ declare module Windows { then(success?: () => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; then(success?: () => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; then(success?: () => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; - done(success?: () => any, error?: (error: any) => any, progress?: (progress: any) => void): void ; + done(success?: () => any, error?: (error: any) => any, progress?: (progress: any) => void): void; operation: { completed: Windows.Foundation.AsyncOperationCompletedHandler; getResults(): any; @@ -3403,11 +3403,11 @@ declare module Windows { getResults(): Windows.Devices.Sms.SmsDevice; cancel(): void; close(): void; - then(success?: (value: Windows.Devices.Sms.SmsDevice) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.SmsDevice) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.SmsDevice) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Devices.Sms.SmsDevice) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: Windows.Devices.Sms.SmsDevice) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + then(success?: (value: Windows.Devices.Sms.SmsDevice) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Devices.Sms.SmsDevice) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Devices.Sms.SmsDevice) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Devices.Sms.SmsDevice) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + done(success?: (value: Windows.Devices.Sms.SmsDevice) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; operation: { completed: Windows.Foundation.AsyncOperationCompletedHandler; getResults(): Windows.Devices.Sms.SmsDevice; @@ -3527,8 +3527,8 @@ declare module Windows { every(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => boolean): boolean; some(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => void ): void; - forEach(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => void): void; + forEach(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => any): any[]; map(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.Devices.Enumeration.DeviceInformation, index: number, array: Windows.Devices.Enumeration.DeviceInformation[]) => boolean): Windows.Devices.Enumeration.DeviceInformation[]; @@ -3654,8 +3654,8 @@ declare module Windows { every(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => boolean): boolean; some(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => void ): void; - forEach(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => void): void; + forEach(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => any): any[]; map(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.Devices.Enumeration.Pnp.PnpObject, index: number, array: Windows.Devices.Enumeration.Pnp.PnpObject[]) => boolean): Windows.Devices.Enumeration.Pnp.PnpObject[]; @@ -4867,8 +4867,8 @@ declare module Windows { every(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => boolean): boolean; some(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => void ): void; - forEach(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => void): void; + forEach(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => any): any[]; map(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.Globalization.Collation.CharacterGrouping, index: number, array: Windows.Globalization.Collation.CharacterGrouping[]) => boolean): Windows.Globalization.Collation.CharacterGrouping[]; @@ -8428,11 +8428,11 @@ declare module Windows { getResults(): Windows.Security.Authentication.OnlineId.UserIdentity; cancel(): void; close(): void; - then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + done(success?: (value: Windows.Security.Authentication.OnlineId.UserIdentity) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; operation: { completed: Windows.Foundation.AsyncOperationCompletedHandler; getResults(): Windows.Security.Authentication.OnlineId.UserIdentity; @@ -9287,11 +9287,11 @@ declare module Windows { getResults(): number; cancel(): void; close(): void; - then(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: number) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + then(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + done(success?: (value: number) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; operation: { completed: Windows.Foundation.AsyncOperationCompletedHandler; getResults(): number; @@ -9367,11 +9367,11 @@ declare module Windows { getResults(): number; cancel(): void; close(): void; - then(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void ): Windows.Foundation.IPromise; - done(success?: (value: number) => any, error?: (error: any) => any, progress?: (progress: any) => void ): void; + then(success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => U, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: number) => U, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + then(success?: (value: number) => Windows.Foundation.IPromise, error?: (error: any) => Windows.Foundation.IPromise, progress?: (progress: any) => void): Windows.Foundation.IPromise; + done(success?: (value: number) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; operation: { completed: Windows.Foundation.AsyncOperationCompletedHandler; getResults(): number; @@ -10613,8 +10613,8 @@ declare module Windows { every(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => boolean): boolean; some(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => void ): void; - forEach(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => void): void; + forEach(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => any): any[]; map(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.Storage.Search.SortEntry, index: number, array: Windows.Storage.Search.SortEntry[]) => boolean): Windows.Storage.Search.SortEntry[]; @@ -10665,8 +10665,8 @@ declare module Windows { every(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => boolean): boolean; some(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => void ): void; - forEach(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => void): void; + forEach(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => any): any[]; map(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.Storage.AccessCache.AccessListEntry, index: number, array: Windows.Storage.AccessCache.AccessListEntry[]) => boolean): Windows.Storage.AccessCache.AccessListEntry[]; @@ -10943,8 +10943,8 @@ declare module Windows { every(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => boolean): boolean; some(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => void ): void; - forEach(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => void , thisArg: any): void; + forEach(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => void): void; + forEach(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => void, thisArg: any): void; map(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => any): any[]; map(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => any, thisArg: any): any[]; filter(callbackfn: (value: Windows.Storage.StorageFile, index: number, array: Windows.Storage.StorageFile[]) => boolean): Windows.Storage.StorageFile[]; @@ -11000,8 +11000,8 @@ declare module Windows { every(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg: any): boolean; some(callbackfn: (value: string, index: number, array: string[]) => boolean): boolean; some(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg: any): boolean; - forEach(callbackfn: (value: string, index: number, array: string[]) => void ): void; - forEach(callbackfn: (value: string, index: number, array: string[]) => void , thisArg: any): void; + forEach(callbackfn: (value: string, index: number, array: string[]) => void): void; + forEach(callbackfn: (value: string, index: number, array: string[]) => void, thisArg: any): void; map(callbackfn: (value: string, index: number, array: string[]) => any): any[]; map(callbackfn: (value: string, index: number, array: string[]) => any, thisArg: any): any[]; filter(callbackfn: (value: string, index: number, array: string[]) => boolean): string[]; @@ -11605,12 +11605,12 @@ declare module Windows { /** * Gets the window (app view) for the current app. **/ - static getForCurrentView(): ApplicationView; + static getForCurrentView(): ApplicationView; /** * Attempts to unsnap a previously snapped app. This call will only succeed when the app is running in the foreground. **/ - static tryUnsnap(): boolean; + static tryUnsnap(): boolean; /** * Gets the state of the current app view. @@ -11620,55 +11620,60 @@ declare module Windows { /** * Indicates whether the app terminates when the last window is closed. **/ - static terminateAppOnFinalViewClose: boolean; + static terminateAppOnFinalViewClose: boolean; /** * Gets the current orientation of the window (app view) with respect to the display. **/ - orientation: ApplicationViewOrientation; + orientation: ApplicationViewOrientation; /** * Gets or sets the displayed title of the window. **/ - title: string; + title: string; /** * Gets or sets whether screen capture is enabled for the window (app view). **/ - isScreenCaptureEnabled: boolean; + isScreenCaptureEnabled: boolean; /** * Gets whether the window (app view) is on the Windows lock screen. **/ - isOnLockScreen: boolean; + isOnLockScreen: boolean; /** * Gets whether the window(app view) is full screen or not. **/ - isFullScreen: boolean; + isFullScreen: boolean; /** * Gets the current ID of the window (app view) . **/ - id: number; + id: number; /** * Gets whether the current window (app view) is adjacent to the right edge of the screen. **/ - adjacentToRightDisplayEdge: boolean; + adjacentToRightDisplayEdge: boolean; /** * Gets whether the current window (app view) is adjacent to the left edge of the screen. **/ - adjacentToLeftDisplayEdge: number; - } + adjacentToLeftDisplayEdge: number; + + /** + * Gets the title bar of the app. + **/ + titleBar: ApplicationViewTitleBar; + } /** * Defines the set of display orientation modes for a window (app view). **/ - export enum ApplicationViewOrientation { - landscape, - portrait + export enum ApplicationViewOrientation { + landscape, + portrait } export interface IInputPaneVisibilityEventArgs { ensuredFocusedElementInView: boolean; @@ -14786,10 +14791,10 @@ declare module Windows { } declare module Windows.Foundation { export interface IPromise { - then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void ): IPromise; - then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void ): IPromise; - then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void ): IPromise; - then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void ): IPromise; + then(success?: (value: T) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; + then(success?: (value: T) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; done(success?: (value: T) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; cancel(): void; @@ -14799,4 +14804,21 @@ declare module Windows.Foundation { dispatchEvent?(type: string, details: any): boolean; removeEventListener?(eventType: string, listener: Function, capture?: boolean): void; } +} + +declare module Windows.UI.ViewManagement { + export class ApplicationViewTitleBar { + backgroundColor: Color; + buttonBackgroundColor: Color; + buttonForegroundColor: Color; + buttonHoverBackgroundColor: Color; + buttonHoverForegroundColor: Color; + buttonInactiveBackgroundColor: Color; + buttonInactiveForegroundColor: Color; + buttonPressedBackgroundColor: Color; + buttonPressedForegroundColor: Color; + foregroundColor: Color; + inactiveBackgroundColor: Color; + inactiveForegroundColor: Color; + } } \ No newline at end of file From caa3a24af79c298e73538854d54ed9015226e991 Mon Sep 17 00:00:00 2001 From: Jordy Hulck Date: Sun, 30 Aug 2015 23:51:58 +0200 Subject: [PATCH 061/259] Added JSDoc for ApplicationViewTitleBar --- winrt/winrt.d.ts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/winrt/winrt.d.ts b/winrt/winrt.d.ts index b0e32cf9b6..63b438fb42 100644 --- a/winrt/winrt.d.ts +++ b/winrt/winrt.d.ts @@ -14808,17 +14808,53 @@ declare module Windows.Foundation { declare module Windows.UI.ViewManagement { export class ApplicationViewTitleBar { + /** + * Gets or sets the color of the title bar background. + **/ backgroundColor: Color; + /** + * Gets or sets the background color of the title bar buttons. + **/ buttonBackgroundColor: Color; + /** + * Gets or sets the foreground color of the title bar buttons. + **/ buttonForegroundColor: Color; + /** + * Gets or sets the background color of a title bar button when the pointer is over it. + **/ buttonHoverBackgroundColor: Color; + /** + * Gets or sets the foreground color of a title bar button when the pointer is over it. + **/ buttonHoverForegroundColor: Color; + /** + * Gets or sets the background color of a title bar button when it's inactive. + **/ buttonInactiveBackgroundColor: Color; + /** + * Gets or sets the foreground color of a title bar button when it's inactive. + **/ buttonInactiveForegroundColor: Color; + /** + * Gets or sets the background color of a title bar button when it's pressed. + **/ buttonPressedBackgroundColor: Color; + /** + * Gets or sets the foreground color of a title bar button when it's pressed. + **/ buttonPressedForegroundColor: Color; + /** + * Gets or sets the color of the title bar foreground. + **/ foregroundColor: Color; + /** + * Gets or sets the color of the title bar background when it's inactive. + **/ inactiveBackgroundColor: Color; + /** + * Gets or sets the color of the title bar foreground when it's inactive. + **/ inactiveForegroundColor: Color; } } \ No newline at end of file From a568ce93455b6fa6d7a229673bd37e801552ccb2 Mon Sep 17 00:00:00 2001 From: Artem Kozlov Date: Mon, 31 Aug 2015 10:42:56 +0200 Subject: [PATCH 062/259] typeahead. Allow funtction as displayKey. --- typeahead/typeahead.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typeahead/typeahead.d.ts b/typeahead/typeahead.d.ts index 159caaacdd..7317aa4c79 100644 --- a/typeahead/typeahead.d.ts +++ b/typeahead/typeahead.d.ts @@ -119,8 +119,8 @@ declare module Twitter.Typeahead { * For a given suggestion object, determines the string representation of it. * This will be used when setting the value of the input control after a suggestion is selected. Can be either a key string or a function that transforms a suggestion object into a string. * Defaults to value. - */ - displayKey?: string; + */ + displayKey?: string | ((obj: any) => string); /** * A hash of templates to be used when rendering the dataset. From dab752b34ffd99eae12701afab4c97130638b03e Mon Sep 17 00:00:00 2001 From: benishouga Date: Tue, 1 Sep 2015 02:16:04 +0900 Subject: [PATCH 063/259] Link inherit HtmlAttribute for use with className and style --- react-router/react-router.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index f43f56484a..cc071506f0 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -114,13 +114,12 @@ declare module ReactRouter { // Components // ---------------------------------------------------------------------- // Link - interface LinkProp { + interface LinkProp extends React.HTMLAttributes { activeClassName?: string; activeStyle?: {}; to: string; params?: {}; query?: {}; - onClick?: Function; } interface Link extends React.ReactElement, Navigation, State { handleClick(event: any): void; From 5075a34165a0d6859a7d7d7b602dfdbf266a74bf Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Tue, 18 Aug 2015 20:56:24 +0500 Subject: [PATCH 064/259] lodash: trim trailing whitespace characters --- lodash/lodash.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 9815f472b4..51a42c8da9 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -694,9 +694,9 @@ declare module _ { takeWhile( array: (Array|List), predicate?: ListIterator, - thisArg?: any + thisArg?: any ): T[]; - + /** * Takes the first items from an array or list based on a predicate * @param array The array or list of items on which the result set will be based @@ -706,7 +706,7 @@ declare module _ { array: (Array|List), pluckValue: string ): any[]; - + /** * Takes the first items from an array or list based on a predicate * @param array The array or list of items on which the result set will be based @@ -1502,7 +1502,7 @@ declare module _ { **/ union(...arrays: List[]): T[]; } - + interface LoDashArrayWrapper { /** * @see _.union @@ -2514,13 +2514,13 @@ declare module _ { /** * Iterates over elements of a collection, returning an array of all elements the * identity function returns truey for. - * + * * @param collection The collection to iterate over. * @return Returns a new array of elements that passed the callback check. **/ filter( collection: (Array|List)): T[]; - + /** * Iterates over elements of a collection, returning an array of all elements the * callback returns truey for. The callback is bound to thisArg and invoked with three @@ -2683,7 +2683,7 @@ declare module _ { * @see _.filter **/ filter(): LoDashArrayWrapper; - + /** * @see _.filter **/ @@ -5096,7 +5096,7 @@ declare module _ { sortBy( collection: List, whereValue: W): T[]; - + /** * Sorts by all the given arguments, using either ListIterator, pluckValue, or whereValue foramts * @param args The rules by which to sort @@ -5126,7 +5126,7 @@ declare module _ { * @param whereValue _.where style callback **/ sortBy(whereValue: W): LoDashArrayWrapper; - + /** * Sorts by all the given arguments, using either ListIterator, pluckValue, or whereValue foramts * @param args The rules by which to sort From 473b16861966e1e79a26615f5c1839203895fa92 Mon Sep 17 00:00:00 2001 From: Michael Wittwer Date: Tue, 1 Sep 2015 11:13:55 +0200 Subject: [PATCH 065/259] =?UTF-8?q?-=20update=20namespace=20of=20angular?= =?UTF-8?q?=20to=20=C2=ABangular=C2=BB=20instead=20of=20=C2=ABng=C2=BB,=20?= =?UTF-8?q?newer=20versions=20don't=20support=20=C2=ABng=C2=BB=20anymore?= =?UTF-8?q?=20-=20include=20static=20interface=20inside=20the=20module=20f?= =?UTF-8?q?ollowing=20the=20style=20how=20angularjs=20does=20it=20-=20refa?= =?UTF-8?q?ctor=20module=20name=20to=20use=20lowercase=20following=20angul?= =?UTF-8?q?arjs=20naming-style?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- angulartics/angulartics-tests.ts | 5 ++--- angulartics/angulartics.d.ts | 15 +++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/angulartics/angulartics-tests.ts b/angulartics/angulartics-tests.ts index cc816a2ab5..af6eb52a36 100644 --- a/angulartics/angulartics-tests.ts +++ b/angulartics/angulartics-tests.ts @@ -3,7 +3,7 @@ module Analytics { angular.module("angulartics.app", ["angulartics"]) - .config(["$analyticsProvider", ($analyticsProvider: Angulartics.IAnalyticsServiceProvider) => { + .config(["$analyticsProvider", ($analyticsProvider:angulartics.IAnalyticsServiceProvider) => { angulartics.waitForVendorApi("location", 1000, (message: string) => { console.log(message); }); @@ -17,9 +17,8 @@ module Analytics { console.log(action); }); - $analyticsProvider.registerPageTrack((path: string, locationObj: ng.ILocationService) => { + $analyticsProvider.registerPageTrack((path:string, locationObj:angular.ILocationService) => { console.log("viewed " + path); }); }]); } - diff --git a/angulartics/angulartics.d.ts b/angulartics/angulartics.d.ts index 8c89575698..706ee6713b 100644 --- a/angulartics/angulartics.d.ts +++ b/angulartics/angulartics.d.ts @@ -4,16 +4,15 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// +declare module angulartics { -interface Angulartics { - waitForVendorApi(objectName: string, delay: number, containsField?: any, registerFn?: any, onTimeout?: boolean): void; -} - -declare module Angulartics { + interface IAngularticsStatic { + waitForVendorApi(objectName:string, delay:number, containsField?:any, registerFn?:any, onTimeout?:boolean): void; + } interface IAnalyticsService { eventTrack(eventName: string, properties?: any): any; - pageTrack(path: string, location?: ng.ILocationService): any; + pageTrack(path:string, location?:angular.ILocationService): any; setAlias(alias: string): any; setUsername(username: string): any; setUserProperties(properties: any): any; @@ -27,7 +26,7 @@ declare module Angulartics { withAutoBase(value: boolean): void; developerMode(value: boolean): void; - registerPageTrack(callback: (path: string, location?: ng.ILocationService) => any): void; + registerPageTrack(callback:(path:string, location?:angular.ILocationService) => any): void; registerEventTrack(callback: (eventName: string, properties?: any) => any): void; registerSetAlias(callback: (alias: string) => any): void registerSetUsername(callback: (username: string) => any): void @@ -36,4 +35,4 @@ declare module Angulartics { } } -declare var angulartics:Angulartics; +declare var angulartics:angulartics.IAngularticsStatic; From 29cb387b6987e8c4dadf1605d827a137a643db94 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Sep 2015 17:48:04 +0200 Subject: [PATCH 066/259] removed ng-dialog from master --- ng-dialog/ng-dialog-tests.ts | 52 ----------------- ng-dialog/ng-dialog.d.ts | 105 ----------------------------------- 2 files changed, 157 deletions(-) delete mode 100644 ng-dialog/ng-dialog-tests.ts delete mode 100644 ng-dialog/ng-dialog.d.ts diff --git a/ng-dialog/ng-dialog-tests.ts b/ng-dialog/ng-dialog-tests.ts deleted file mode 100644 index 52b33212aa..0000000000 --- a/ng-dialog/ng-dialog-tests.ts +++ /dev/null @@ -1,52 +0,0 @@ -/// -/// - -var app = angular.module('testModule', ['ngDialog']); - -class DialogTestController { - - constructor(ngDialog: angular.dialog.IDialogService) { - - ngDialog.close("login-popup", "bye"); - ngDialog.closeAll("bye"); - - var defaults = ngDialog.getDefaults(); - - var dialogs = ngDialog.getOpenDialogs(); - - ngDialog.isOpen("bye"); - - var loginDialog = ngDialog.open({ - template: "login.html", - className: "default flat-ui", - closeByEscape: false, - name: "login-popup" - }); - - if (loginDialog.id === "login-popup") { - loginDialog.close("closing"); - } - - var deleteConfirm = ngDialog.openConfirm({ - template: "confirm.html" - }); - } -} - -class LoginDialogController { - - constructor($scope: angular.dialog.IDialogScope) { - - $scope.closeThisDialog("bye"); - } -} - -app.controller('TestController', DialogTestController); - -app.config((ngDialogProvider: angular.dialog.IDialogProvider) => { - - ngDialogProvider.setDefaults({ - className: "flat-ui" - }) - -}); \ No newline at end of file diff --git a/ng-dialog/ng-dialog.d.ts b/ng-dialog/ng-dialog.d.ts deleted file mode 100644 index a167aee471..0000000000 --- a/ng-dialog/ng-dialog.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -// Type definitions for ngDialog -// Project: https://github.com/likeastore/ngDialog -// Definitions by: Stephen Lautier -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module angular.dialog { - - interface IDialogService { - getDefaults(): IDialogOptions; - open(options: IDialogOpenOptions): IDialogOpenResult; - openConfirm(options: IDialogOpenOptions): IPromise; - - /** - * Determine whether the specified dialog is open or not. - * @param id Dialog id to check for. - * @returns {boolean} Indicating whether it exists or not. - */ - isOpen(id: string): boolean; - close(id: string, value: any); - closeAll(value: any); - getOpenDialogs(); - } - - interface IDialogOpenResult { - id: string; - close: Function; - closePromise: IPromise; - } - - interface IDialogProvider extends angular.IServiceProvider { - /** - * Default options for the dialogs. - * @param defaultOptions - * @returns {} - */ - setDefaults(defaultOptions: IDialogOptions): void; - } - - /** - * Dialog Scope which extends the $scope. - */ - interface IDialogScope extends angular.IScope { - /** - * This allows you to close dialog straight from handler in a popup element. - * @param value Any value passed to this function will be attached to the object which resolves on the close promise for this dialog. - * For dialogs opened with the openConfirm() method the value is used as the reject reason. - */ - closeThisDialog(value: any): void; - } - - interface IDialogOptions { - /** - * This option allows you to control the dialog's look, you can use built-in themes or create your own styled modals. - * It will be appended with the "ngdialog" class e.g. className is "default-theme flat-ui" it will be class="ngdialog default-theme flat-ui". - */ - className?: string; - /** - * If false it allows to hide overlay div behind the modals, default true. - */ - overlay?: boolean; - - /** - * If false it allows to hide close button on modals, default true. - */ - showClose?: boolean; - - /** - * It allows to close modals by clicking Esc button, default true. - * This will close all open modals if there several of them open at the same time. - */ - closeByEscape?: boolean; - - /** - * It allows to close modals by clicking on overlay background, default true. If @see Hammer.js is loaded, it will listen for tap instead of click. - */ - closeByDocument?: boolean; - - /** - * If true allows to use plain string as template, default false. - */ - plain?: boolean; - - /** - * Give a name for a dialog instance. It is useful for identifying specific dialog if there are multiple dialog boxes opened. - */ - name?: string | number; - - preCloseCallback?: string|Function; - } - - /** - * Options which are provided to open a dialog. - */ - interface IDialogOpenOptions extends IDialogOptions { - template: string; - controller?: string|any; - controllerAs?: string; - /** - * Scope object that will be passed to dialog. If you use controller with separate $scope service this object will be passed to $scope.$parent param. - */ - scope?: ng.IScope; - } -} \ No newline at end of file From b59f3d5c363317a0816a31903a83a5abbe19ff59 Mon Sep 17 00:00:00 2001 From: tkQubo Date: Thu, 3 Sep 2015 03:19:04 +0900 Subject: [PATCH 067/259] Add gulp-gzip --- gulp-gzip/gulp-gzip-tests.ts | 27 +++++++++++++++++++++ gulp-gzip/gulp-gzip.d.ts | 47 ++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 gulp-gzip/gulp-gzip-tests.ts create mode 100644 gulp-gzip/gulp-gzip.d.ts diff --git a/gulp-gzip/gulp-gzip-tests.ts b/gulp-gzip/gulp-gzip-tests.ts new file mode 100644 index 0000000000..295e98b7fe --- /dev/null +++ b/gulp-gzip/gulp-gzip-tests.ts @@ -0,0 +1,27 @@ +/// +/// + +import gulp = require('gulp'); +import gzip = require('gulp-gzip'); + +gzip({ append: true }); + +gzip({ extension: 'zip' }); // note that the `.` should not be included in the extension + +gzip({ preExtension: 'gz' }); // note that the `.` should not be included in the extension + +gzip({ threshold: '1kb' }); + +gzip({ threshold: 1024 }); + +gzip({ threshold: true }); + +gzip({ gzipOptions: { level: 9 } }); + +gzip({ gzipOptions: { memLevel: 1 } }); + +gulp.task('compress', function() { + gulp.src('./dev/scripts/*.js') + .pipe(gzip()) + .pipe(gulp.dest('./public/scripts')); +}); diff --git a/gulp-gzip/gulp-gzip.d.ts b/gulp-gzip/gulp-gzip.d.ts new file mode 100644 index 0000000000..8711153eda --- /dev/null +++ b/gulp-gzip/gulp-gzip.d.ts @@ -0,0 +1,47 @@ +// Type definitions for gulp-gzip +// Project: https://github.com/jstuckey/gulp-gzip +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "gulp-gzip" { + import zlib = require('zlib'); + + namespace gzip { + interface Gzip { + (options?: Options): NodeJS.ReadWriteStream; + } + + interface Options { + /** + * Appends .gz file extension if true. + * @default true + */ + append?: boolean; + /** + * Appends an arbitrary extension to the filename. Disables append and preExtension options. + */ + extension?: string; + /** + * Appends an arbitrary pre-extension to the filename. Disables append and extension options. + */ + preExtension?: string; + /** + * Minimum size required to compress a file. + * @default false + */ + threshold?: number|string|boolean; + /** + * Options object to pass through to zlib.Gzip. + * See zlib documentation for more information. + */ + gzipOptions?: zlib.ZlibOptions; + } + } + + var gzip: gzip.Gzip; + + export = gzip; +} + From 9f0231e58e9e1b7b8d2102630c7d688fd1a473bf Mon Sep 17 00:00:00 2001 From: matjos Date: Wed, 2 Sep 2015 21:05:30 +0200 Subject: [PATCH 068/259] added tests to openlayers input --- openlayers/openlayers-tests.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/openlayers/openlayers-tests.ts b/openlayers/openlayers-tests.ts index 3effa928aa..0092737467 100644 --- a/openlayers/openlayers-tests.ts +++ b/openlayers/openlayers-tests.ts @@ -34,6 +34,7 @@ var geometry: ol.geom.Geometry; var loadingstrategy: ol.LoadingStrategy; var tilegrid: ol.tilegrid.TileGrid; var vector: ol.source.Vector; +var projection: ol.proj.Projection; // // ol.Attribution @@ -161,7 +162,9 @@ var tileLayer: ol.layer.Tile = new ol.layer.Tile({ // // ol.proj // -var projection: ol.proj.Projection; +projection = new ol.proj.Projection({ + code:stringValue, +}); // // ol.Map @@ -174,6 +177,21 @@ var map: ol.Map = new ol.Map({ }); map.beforeRender(preRenderFunction); +// +// ol.source.ImageWMS +// +var imageWMS: ol.source.ImageWMS = new ol.source.ImageWMS({ + serverType: stringValue, + url:stringValue +}); +// +// ol.source.TileWMS +// +var tileWMS: ol.source.TileWMS = new ol.source.TileWMS({ + serverType: stringValue, + url:stringValue +}); + // // ol.animation // From c1592cc0ad3e8cc64cb222fa4ad76ad80a42d0a8 Mon Sep 17 00:00:00 2001 From: matjos Date: Wed, 2 Sep 2015 22:07:57 +0200 Subject: [PATCH 069/259] Removed unnecesery any definitions. --- openlayers/openlayers.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index eb51c27a1c..d7099c85f1 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -103,13 +103,13 @@ declare module olx { hidpi?: boolean; /** experimental The type of the remote WMS server: mapserver, geoserver or qgis. Only needed if hidpi is true. Default is undefined. */ - serverType?: any; + serverType?: ol.source.wms.ServerType; /** WMS service URL. */ url?: string; /** Logo. */ - logo?: any; + logo?: olx.LogoOptions; /** experimental Projection. */ projection?: ol.proj.ProjectionLike; From 6612806e0a1be58b4cfe37775c0f48ec3809fcfd Mon Sep 17 00:00:00 2001 From: Paul Spears Date: Wed, 2 Sep 2015 16:01:05 -0500 Subject: [PATCH 070/259] Added missing types, updated tests This is a fix for issue #5652 https://github.com/borisyankov/DefinitelyTyped/issues/5652 --- angular-ui-router/angular-ui-router-tests.ts | 2 ++ angular-ui-router/angular-ui-router.d.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index dccd8f7b19..7a1bc2d006 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -158,7 +158,9 @@ class UrlLocatorTestService implements IUrlLocatorTestService { private stateServiceTest() { this.$state.go("myState"); + this.$state.go(this.$state.current); this.$state.transitionTo("myState"); + this.$state.transitionTo(this.$state.current); if (this.$state.includes("myState") === true) { // } diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index febe1c0907..ff0d6ce7e2 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -228,8 +228,11 @@ declare module angular.ui { * @param options Options object. */ go(to: string, params?: {}, options?: IStateOptions): angular.IPromise; + go(to: IState, params?: {}, options?: IStateOptions): angular.IPromise; transitionTo(state: string, params?: {}, updateLocation?: boolean): void; + transitionTo(state: IState, params?: {}, updateLocation?: boolean): void; transitionTo(state: string, params?: {}, options?: IStateOptions): void; + transitionTo(state: IState, params?: {}, options?: IStateOptions): void; includes(state: string, params?: {}): boolean; is(state:string, params?: {}): boolean; is(state: IState, params?: {}): boolean; From 133698acc7df8b22c43a22a433ab1ea02c0d4fee Mon Sep 17 00:00:00 2001 From: matjos Date: Wed, 2 Sep 2015 23:10:18 +0200 Subject: [PATCH 071/259] Replaced any with correct methods --- openlayers/openlayers.d.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index d7099c85f1..782ecaea0c 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -118,7 +118,7 @@ declare module olx { interface ImageWMSOptions extends BaseWMSOptions { /** experimental Optional function to load an image given a URL. */ - imageLoadFunction?: any; + imageLoadFunction?: ol.ImageLoadFunctionType; /** Ratio. 1 means image requests are the size of the map viewport, 2 means twice the width and height of the map viewport, and so on. Must be 1 or higher. Default is 1.5. */ ratio?: number; @@ -139,7 +139,7 @@ declare module olx { maxZoom?: number; /** experimental Optional function to load a tile given a URL. */ - tileLoadFunction?: any; //todo + tileLoadFunction?: ol.TileLoadFunctionType; /** WMS service urls. Use this instead of url when the WMS supports multiple urls for GetMap requests. */ urls?: Array; @@ -354,7 +354,7 @@ declare module olx { * a {number} view resolution and an {ol.Coordinate} as arguments, and returns the {number} * resolution at the passed coordinate. */ - getPointResolution?: any; + getPointResolution?: (resolution: number, coordinate: ol.Coordinate) => number; } module animation { @@ -951,6 +951,10 @@ declare module olx { */ declare module ol { + interface TileLoadFunctionType{ (image: ol.Image, url: string): void } + + interface ImageLoadFunctionType{ (image: ol.Image, url: string): void } + /** * An attribution for a layer source. */ From fe092ecba93573964c75ed82e786793395e60177 Mon Sep 17 00:00:00 2001 From: Adi Dahiya Date: Wed, 2 Sep 2015 17:46:44 -0400 Subject: [PATCH 072/259] Refactor classnames.d.ts to allow usage in non-external modules --- classnames/classnames.d.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/classnames/classnames.d.ts b/classnames/classnames.d.ts index 8200436860..22ab1858ae 100644 --- a/classnames/classnames.d.ts +++ b/classnames/classnames.d.ts @@ -1,13 +1,18 @@ // Type definitions for classnames // Project: https://github.com/JedWatson/classnames -// Definitions by: Dave Keen +// Definitions by: Dave Keen , Adi Dahiya // Definitions: https://github.com/borisyankov/DefinitelyTyped interface ClassDictionary { [id: string]: boolean; } +interface ClassNamesFn { + (...classes: (string | ClassDictionary)[]): string; +} + +declare var classNames: ClassNamesFn; + declare module "classnames" { - function classNames(...classes: (string|ClassDictionary)[]): string; export = classNames -} \ No newline at end of file +} From 8d071a6ee3c622f19d7e8fb661e269c18359f2b7 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Thu, 3 Sep 2015 12:00:45 +1200 Subject: [PATCH 073/259] Add definition and test for when.iterate --- when/when-tests.ts | 15 +++++++++++++++ when/when.d.ts | 14 ++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/when/when-tests.ts b/when/when-tests.ts index 6ed82dd32d..7cd7e8e45c 100644 --- a/when/when-tests.ts +++ b/when/when-tests.ts @@ -101,6 +101,21 @@ when.settle([when(1), when(2), when.reject(new Error("Foo"))]).then(desc return descriptors.filter(d => d.state === 'rejected').reduce((r, d) => r + d.value, 0); }); +/* when.iterate(f, predicate, handler, seed) */ + +when.iterate(function (x) { + return x + 1; +}, function (x) { + // Stop when x >= 100000000000 + return x >= 100000000000; +}, function (x) { + console.log(x); +}, 0).done(function (x) { + console.log(x === 100000000000); +}, function (err) { + console.log(err); +}); + /* when.promise(resolver) */ promise = when.promise(resolve => resolve(5)); diff --git a/when/when.d.ts b/when/when.d.ts index 7ec7213902..432a76b366 100644 --- a/when/when.d.ts +++ b/when/when.d.ts @@ -127,6 +127,20 @@ declare module When { */ function settle(promisesOrValues: any[]): Promise[]>; + /** + * Generates a potentially infinite stream of promises by repeatedly calling f until predicate becomes true. + * @memberOf when + * @param f function that, given a seed, returns the next value or a promise for it. + * @param predicate function that receives the current iteration value, and should return truthy when the iterating should stop + * @param handler function that receives each value as it is produced by f. It may return a promise to delay the next iteration. + * @param seed initial value provided to the handler, and first f invocation. May be a promise. + */ + function iterate(f: (seed: U) => U | Promise, + predicate: (value: U) => boolean, + handler: (value: U) => Promise | void, + seed: U | Promise): Promise; + + /** * Creates a {promise, resolver} pair, either or both of which * may be given out safely to consumers. From ada9bfca7db827a4d9962a23e7647189cc80370f Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 09:04:55 +0900 Subject: [PATCH 074/259] fix vinyl-fs/vinyl-fs-tests.ts and vinyl-fs/vinyl-fs.d.ts --- vinyl-fs/vinyl-fs-tests.ts | 22 +++++++++++----------- vinyl-fs/vinyl-fs.d.ts | 35 +++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/vinyl-fs/vinyl-fs-tests.ts b/vinyl-fs/vinyl-fs-tests.ts index a29746166e..c8ca090700 100644 --- a/vinyl-fs/vinyl-fs-tests.ts +++ b/vinyl-fs/vinyl-fs-tests.ts @@ -229,7 +229,7 @@ var dataWrap = function (fn: any) { }; var realMode = function (n: any) { - return n & 07777; + return n & parseInt("07777", 8); }; describe('dest stream', function () { @@ -372,7 +372,7 @@ describe('dest stream', function () { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, "./out-fixtures"); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var expectedFile = new File({ base: inputBase, @@ -412,7 +412,7 @@ describe('dest stream', function () { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, "./out-fixtures"); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var contentStream = through.obj(); var expectedFile = new File({ @@ -456,7 +456,7 @@ describe('dest stream', function () { var expectedPath = path.join(__dirname, "./out-fixtures/test"); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, "./out-fixtures"); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var expectedFile = new File({ base: inputBase, @@ -555,7 +555,7 @@ var dataWrap = function (fn: any) { }; var realMode = function (n: any) { - return n & 07777; + return n & parseInt("07777", 8); }; describe('symlink stream', function () { @@ -706,7 +706,7 @@ describe('symlink stream', function () { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, './out-fixtures'); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var expectedFile = new File({ base: inputBase, @@ -746,7 +746,7 @@ describe('symlink stream', function () { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, './out-fixtures'); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var contentStream = through.obj(); var expectedFile = new File({ @@ -790,7 +790,7 @@ describe('symlink stream', function () { var expectedPath = path.join(__dirname, './out-fixtures/wow'); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, './out-fixtures'); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var expectedFile = new File({ base: inputBase, @@ -830,8 +830,8 @@ describe('symlink stream', function () { var inputBase = path.join(__dirname, './fixtures'); var inputPath = path.join(__dirname, './fixtures/wow/suchempty'); var expectedBase = path.join(__dirname, './out-fixtures/wow'); - var expectedDirMode = 0755; - var expectedFileMode = 0655; + var expectedDirMode = parseInt("0755", 8); + var expectedFileMode = parseInt("0655", 8); var firstFile = new File({ base: inputBase, @@ -867,7 +867,7 @@ describe('symlink stream', function () { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, './out-fixtures'); - var expectedMode = 0722; + var expectedMode = parseInt("0722", 8); var expectedFile = new File({ base: inputBase, diff --git a/vinyl-fs/vinyl-fs.d.ts b/vinyl-fs/vinyl-fs.d.ts index 98bb34339b..70fc32abaa 100644 --- a/vinyl-fs/vinyl-fs.d.ts +++ b/vinyl-fs/vinyl-fs.d.ts @@ -21,7 +21,7 @@ declare module "vinyl-fs" { cwd?: string; /** - * Specifies the folder relative to the cwd + * Specifies the folder relative to the cwd * This is used to determine the file names when saving in .dest() * Default is where the glob begins */ @@ -34,16 +34,16 @@ declare module "vinyl-fs" { */ buffer?: boolean; - /** + /** * Setting this to false will ignore the contents of the file and disable writing to disk to speed up operations - * Defaults to true + * Defaults to true */ read?: boolean; /** Only find files that have been modified since the time specified */ since?: Date|number; - /** Setting this to true will create a duplex stream, one that passes through items and emits globbed files. + /** Setting this to true will create a duplex stream, one that passes through items and emits globbed files. * Defaults to false */ passthrough?: boolean; @@ -63,7 +63,7 @@ declare module "vinyl-fs" { /** * This is just a glob-watcher - * + * * @param globs Takes a glob string or an array of glob strings as the first argument * Globs are executed in order, so negations should follow positive globs * fs.src(['!b*.js', '*.js']) would not exclude any files, but this would: fs.src(['*.js', '!b*.js']) @@ -72,7 +72,7 @@ declare module "vinyl-fs" { /** * This is just a glob-watcher - * + * * @param globs Takes a glob string or an array of glob strings as the first argument * Globs are executed in order, so negations should follow positive globs * fs.src(['!b*.js', '*.js']) would not exclude any files, but this would: fs.src(['*.js', '!b*.js']) @@ -89,8 +89,8 @@ declare module "vinyl-fs" { * @param folder destination folder */ function dest(folder: string, opt?: { - /** Specify the working directory the folder is relative to - * Default is process.cwd() + /** Specify the working directory the folder is relative to + * Default is process.cwd() */ cwd?: string; @@ -125,14 +125,17 @@ declare module "vinyl-fs" { * cwd, base, and path will be overwritten to match the folder */ function symlink(folder: string, opts?: { - /** - * Specify the working directory the folder is relative to + /** + * Specify the working directory the folder is relative to * Default is process.cwd() */ cwd?: string; - /** - * Specify the mode the directory should be created with + /** Specify the mode the directory should be created with. Default is the process mode */ + mode?: number|string; + + /** + * Specify the mode the directory should be created with * Default is the process mode */ dirMode?: number @@ -146,14 +149,14 @@ declare module "vinyl-fs" { */ function symlink(getFolderPath: (File: File) => string, opts?: { - /** - * Specify the working directory the folder is relative to + /** + * Specify the working directory the folder is relative to * Default is process.cwd() */ cwd?: string; - /** - * Specify the mode the directory should be created with + /** + * Specify the mode the directory should be created with * Default is the process mode */ dirMode?: number From 62c95cb5f5a51f6875c9fbd8b5e26d2284f024c9 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Wed, 2 Sep 2015 21:59:17 -0500 Subject: [PATCH 075/259] Add object-assign and tests --- object-assign/object-assign-tests.ts | 17 +++++++++++++++++ object-assign/object-assign.d.ts | 9 +++++++++ 2 files changed, 26 insertions(+) create mode 100644 object-assign/object-assign-tests.ts create mode 100644 object-assign/object-assign.d.ts diff --git a/object-assign/object-assign-tests.ts b/object-assign/object-assign-tests.ts new file mode 100644 index 0000000000..53dfd5e707 --- /dev/null +++ b/object-assign/object-assign-tests.ts @@ -0,0 +1,17 @@ +/// +import objectAssign = require("object-assign"); + +function assign1() { + var result = objectAssign({hello: "world"}); + return result; +} + +function assign2() { + var result = objectAssign({hello: "world"}, {hello: "worlds", second: "extra"}); + return result; +} + +function assign3() { + var result = objectAssign({hello: "world"}, {hello: "worlds", second: "extra"}, {hello: "stop", the: "spinning"}); + return result; +} diff --git a/object-assign/object-assign.d.ts b/object-assign/object-assign.d.ts new file mode 100644 index 0000000000..76789d0038 --- /dev/null +++ b/object-assign/object-assign.d.ts @@ -0,0 +1,9 @@ +// Type definitions for object-assign 4.0.1 +// Project: https://github.com/sindresorhus/object-assign +// Definitions by: Christopher Brown +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "object-assign" { + function objectAssign(target: any, ...sources: any[]): any; + export = objectAssign; +} From 1c53afa2378db541fd44370ea4ac5dfde73f6c55 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 13:07:58 +0900 Subject: [PATCH 076/259] suppress error on tspromise/tspromise-tests.ts --- tspromise/tspromise-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tspromise/tspromise-tests.ts b/tspromise/tspromise-tests.ts index fcb52212a6..e1ce0c1d5c 100644 --- a/tspromise/tspromise-tests.ts +++ b/tspromise/tspromise-tests.ts @@ -4,7 +4,7 @@ import Promise = require('tspromise'); var MyFuncFunc = Promise.async((a: boolean, b: number) => { console.log('[a] ' + a); - yield(Promise.waitAsync(1000)); + // NOTE( https://github.com/borisyankov/DefinitelyTyped/pull/5590 ) yield(Promise.waitAsync(1000)); console.log('[b]' + b); }); @@ -18,4 +18,4 @@ Promise.all([Promise.waitAsync(10), Promise.waitAsync(20)]).then(() => { throw (new Error()); }).catch((e) => { console.log(e.message); -}); \ No newline at end of file +}); From 518d31b7cf44b575d2159071c62d6cf3d5e8f37b Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 13:15:46 +0900 Subject: [PATCH 077/259] use typescript@1.6.0-beta --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 854e15f8f3..e82eb15b02 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,6 @@ }, "devDependencies": { "definition-tester": "0.2.0", - "typescript": "https://github.com/Microsoft/TypeScript/tarball/release-1.6" + "typescript": "1.6.0-beta" } } From d5085c2a25b5527a9ada6e2c42d6c4810d9e7b9a Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 13:16:07 +0900 Subject: [PATCH 078/259] suppress error on selectize/selectize-tests.ts --- selectize/selectize-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/selectize/selectize-tests.ts b/selectize/selectize-tests.ts index b5ea65829d..caf0b06e3b 100644 --- a/selectize/selectize-tests.ts +++ b/selectize/selectize-tests.ts @@ -212,7 +212,7 @@ interface Link { } $('#select-links').selectize({ - theme: 'links', + // NOTE ( https://github.com/borisyankov/DefinitelyTyped/pull/5590 ) theme: 'links', maxItems: null, valueField: 'id', searchField: 'title', @@ -418,4 +418,3 @@ $("#select-car").selectize({ plugins: ['optgroup_columns'], openOnFocus: false }); - From ed0f1cce4f6669bdbeb3fac8a5104aea084d5057 Mon Sep 17 00:00:00 2001 From: Olivier CHEVET Date: Thu, 3 Sep 2015 06:24:28 +0200 Subject: [PATCH 079/259] Upgraded to chai 3.2.0 (latest) --- chai/chai-2.0.0.d.ts | 308 +++++++++++++++++++++++++++++++++++++++++++ chai/chai-tests.ts | 290 ++++++++++++++++++++++++++++++++++------ chai/chai.d.ts | 94 ++++++++++++- 3 files changed, 643 insertions(+), 49 deletions(-) create mode 100644 chai/chai-2.0.0.d.ts diff --git a/chai/chai-2.0.0.d.ts b/chai/chai-2.0.0.d.ts new file mode 100644 index 0000000000..f693582c59 --- /dev/null +++ b/chai/chai-2.0.0.d.ts @@ -0,0 +1,308 @@ +// Type definitions for chai 2.0.0 +// Project: http://chaijs.com/ +// Definitions by: Jed Mao , +// Bart van der Schoor , +// Andrew Brown +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Chai { + + interface ChaiStatic { + expect: ExpectStatic; + should(): Should; + /** + * Provides a way to extend the internals of Chai + */ + use(fn: (chai: any, utils: any) => void): any; + assert: AssertStatic; + config: Config; + } + + export interface ExpectStatic extends AssertionStatic { + } + + export interface AssertStatic extends Assert { + } + + export interface AssertionStatic { + (target: any, message?: string): Assertion; + } + + interface ShouldAssertion { + equal(value1: any, value2: any, message?: string): void; + Throw: ShouldThrow; + throw: ShouldThrow; + exist(value: any, message?: string): void; + } + + interface Should extends ShouldAssertion { + not: ShouldAssertion; + fail(actual: any, expected: any, message?: string, operator?: string): void; + } + + interface ShouldThrow { + (actual: Function): void; + (actual: Function, expected: string|RegExp, message?: string): void; + (actual: Function, constructor: Error|Function, expected?: string|RegExp, message?: string): void; + } + + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + not: Assertion; + deep: Deep; + a: TypeComparison; + an: TypeComparison; + include: Include; + contain: Include; + ok: Assertion; + true: Assertion; + false: Assertion; + null: Assertion; + undefined: Assertion; + exist: Assertion; + empty: Assertion; + arguments: Assertion; + Arguments: Assertion; + equal: Equal; + equals: Equal; + eq: Equal; + eql: Equal; + eqls: Equal; + property: Property; + ownProperty: OwnProperty; + haveOwnProperty: OwnProperty; + length: Length; + lengthOf: Length; + match(regexp: RegExp|string, message?: string): Assertion; + string(string: string, message?: string): Assertion; + keys: Keys; + key(string: string): Assertion; + throw: Throw; + throws: Throw; + Throw: Throw; + respondTo(method: string, message?: string): Assertion; + itself: Assertion; + satisfy(matcher: Function, message?: string): Assertion; + closeTo(expected: number, delta: number, message?: string): Assertion; + members: Members; + } + + interface LanguageChains { + to: Assertion; + be: Assertion; + been: Assertion; + is: Assertion; + that: Assertion; + which: Assertion; + and: Assertion; + has: Assertion; + have: Assertion; + with: Assertion; + at: Assertion; + of: Assertion; + same: Assertion; + } + + interface NumericComparison { + above: NumberComparer; + gt: NumberComparer; + greaterThan: NumberComparer; + least: NumberComparer; + gte: NumberComparer; + below: NumberComparer; + lt: NumberComparer; + lessThan: NumberComparer; + most: NumberComparer; + lte: NumberComparer; + within(start: number, finish: number, message?: string): Assertion; + } + + interface NumberComparer { + (value: number, message?: string): Assertion; + } + + interface TypeComparison { + (type: string, message?: string): Assertion; + instanceof: InstanceOf; + instanceOf: InstanceOf; + } + + interface InstanceOf { + (constructor: Object, message?: string): Assertion; + } + + interface Deep { + equal: Equal; + include: Include; + property: Property; + } + + interface Equal { + (value: any, message?: string): Assertion; + } + + interface Property { + (name: string, value?: any, message?: string): Assertion; + } + + interface OwnProperty { + (name: string, message?: string): Assertion; + } + + interface Length extends LanguageChains, NumericComparison { + (length: number, message?: string): Assertion; + } + + interface Include { + (value: Object, message?: string): Assertion; + (value: string, message?: string): Assertion; + (value: number, message?: string): Assertion; + keys: Keys; + members: Members; + } + + interface Keys { + (...keys: string[]): Assertion; + (keys: any[]): Assertion; + } + + interface Throw { + (): Assertion; + (expected: string, message?: string): Assertion; + (expected: RegExp, message?: string): Assertion; + (constructor: Error, expected?: string, message?: string): Assertion; + (constructor: Error, expected?: RegExp, message?: string): Assertion; + (constructor: Function, expected?: string, message?: string): Assertion; + (constructor: Function, expected?: RegExp, message?: string): Assertion; + } + + interface Members { + (set: any[], message?: string): Assertion; + } + + export interface Assert { + /** + * @param expression Expression to test for truthiness. + * @param message Message to display on error. + */ + (expression: any, message?: string): void; + + fail(actual?: any, expected?: any, msg?: string, operator?: string): void; + + ok(val: any, msg?: string): void; + notOk(val: any, msg?: string): void; + + equal(act: any, exp: any, msg?: string): void; + notEqual(act: any, exp: any, msg?: string): void; + + strictEqual(act: any, exp: any, msg?: string): void; + notStrictEqual(act: any, exp: any, msg?: string): void; + + deepEqual(act: any, exp: any, msg?: string): void; + notDeepEqual(act: any, exp: any, msg?: string): void; + + isTrue(val: any, msg?: string): void; + isFalse(val: any, msg?: string): void; + + isNull(val: any, msg?: string): void; + isNotNull(val: any, msg?: string): void; + + isUndefined(val: any, msg?: string): void; + isDefined(val: any, msg?: string): void; + + isFunction(val: any, msg?: string): void; + isNotFunction(val: any, msg?: string): void; + + isObject(val: any, msg?: string): void; + isNotObject(val: any, msg?: string): void; + + isArray(val: any, msg?: string): void; + isNotArray(val: any, msg?: string): void; + + isString(val: any, msg?: string): void; + isNotString(val: any, msg?: string): void; + + isNumber(val: any, msg?: string): void; + isNotNumber(val: any, msg?: string): void; + + isBoolean(val: any, msg?: string): void; + isNotBoolean(val: any, msg?: string): void; + + typeOf(val: any, type: string, msg?: string): void; + notTypeOf(val: any, type: string, msg?: string): void; + + instanceOf(val: any, type: Function, msg?: string): void; + notInstanceOf(val: any, type: Function, msg?: string): void; + + include(exp: string, inc: any, msg?: string): void; + include(exp: any[], inc: any, msg?: string): void; + + notInclude(exp: string, inc: any, msg?: string): void; + notInclude(exp: any[], inc: any, msg?: string): void; + + match(exp: any, re: RegExp, msg?: string): void; + notMatch(exp: any, re: RegExp, msg?: string): void; + + property(obj: Object, prop: string, msg?: string): void; + notProperty(obj: Object, prop: string, msg?: string): void; + deepProperty(obj: Object, prop: string, msg?: string): void; + notDeepProperty(obj: Object, prop: string, msg?: string): void; + + propertyVal(obj: Object, prop: string, val: any, msg?: string): void; + propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void; + + deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void; + deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void; + + lengthOf(exp: any, len: number, msg?: string): void; + //alias frenzy + throw(fn: Function, msg?: string): void; + throw(fn: Function, regExp: RegExp): void; + throw(fn: Function, errType: Function, msg?: string): void; + throw(fn: Function, errType: Function, regExp: RegExp): void; + + throws(fn: Function, msg?: string): void; + throws(fn: Function, regExp: RegExp): void; + throws(fn: Function, errType: Function, msg?: string): void; + throws(fn: Function, errType: Function, regExp: RegExp): void; + + Throw(fn: Function, msg?: string): void; + Throw(fn: Function, regExp: RegExp): void; + Throw(fn: Function, errType: Function, msg?: string): void; + Throw(fn: Function, errType: Function, regExp: RegExp): void; + + doesNotThrow(fn: Function, msg?: string): void; + doesNotThrow(fn: Function, regExp: RegExp): void; + doesNotThrow(fn: Function, errType: Function, msg?: string): void; + doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void; + + operator(val: any, operator: string, val2: any, msg?: string): void; + closeTo(act: number, exp: number, delta: number, msg?: string): void; + + sameMembers(set1: any[], set2: any[], msg?: string): void; + includeMembers(set1: any[], set2: any[], msg?: string): void; + + ifError(val: any, msg?: string): void; + } + + export interface Config { + includeStack: boolean; + } + + export class AssertionError { + constructor(message: string, _props?: any, ssf?: Function); + name: string; + message: string; + showDiff: boolean; + stack: string; + } +} + +declare var chai: Chai.ChaiStatic; + +declare module "chai" { + export = chai; +} + +interface Object { + should: Chai.Assertion; +} diff --git a/chai/chai-tests.ts b/chai/chai-tests.ts index c34b6cdf1d..9b646b1529 100644 --- a/chai/chai-tests.ts +++ b/chai/chai-tests.ts @@ -31,6 +31,16 @@ function fail() { err(() => { should.fail('foo', 'bar', 'should fail', 'equal'); }, 'expected fail to throw an AssertionError'); + + err(() => { + expect.fail('foo', 'bar'); + }, 'expected fail to throw an AssertionError'); + err(() => { + expect.fail('foo', 'bar', 'should fail'); + }, 'expected fail to throw an AssertionError'); + err(() => { + expect.fail('foo', 'bar', 'should fail', 'equal'); + }, 'expected fail to throw an AssertionError'); } // ReSharper disable once InconsistentNaming @@ -107,11 +117,20 @@ function _undefined() { }, 'expected \'\' to be undefined'); } +function _NaN() { + expect(NaN).to.be.NaN; + expect(12).to.be.not.NaN; + expect("NaN").to.be.not.NaN; + (NaN).should.be.NaN; + (12).should.be.not.NaN; + ("NaN").should.be.not.NaN; +} + function exist() { var foo = 'bar'; expect(foo).to.exist; should.exist(foo); - expect(void(0)).to.not.exist; + expect(void (0)).to.not.exist; should.not.exist(void (0)); } @@ -128,8 +147,8 @@ function argumentsTest() { } function equal() { - expect(undefined).to.equal(void(0)); - should.equal(undefined, void(0)); + expect(undefined).to.equal(void (0)); + should.equal(undefined, void (0)); } function _typeof() { @@ -372,6 +391,9 @@ function match() { expect('foobar').to.not.match(/^bar/); 'foobar'.should.not.match(/^bar/); + expect('foobar').matches(/^foo/); + 'foobar'.should.not.matches(/^bar/); + err(() => { expect('foobar').to.match(/^bar/i, 'blah'); 'foobar'.should.match(/^bar/i, 'blah'); @@ -490,8 +512,8 @@ function deepEqual3() { function deepInclude() { expect(['foo', 'bar']).to.deep.include(['bar', 'foo']); ['foo', 'bar'].should.deep.include(['bar', 'foo']); - expect(['foo', 'bar']).not.to.deep.equal(['foo', 'baz' ]); - ['foo', 'bar'].should.not.deep.equal(['foo', 'baz' ]); + expect(['foo', 'bar']).not.to.deep.equal(['foo', 'baz']); + ['foo', 'bar'].should.not.deep.equal(['foo', 'baz']); } class FakeArgs { @@ -670,6 +692,20 @@ function ownProperty() { }, 'blah: expected { length: 12 } to not have own property \'length\''); } +function ownPropertyDescriptor() { + expect('test').to.have.ownPropertyDescriptor('length'); + expect('test').to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 }); + expect('test').not.to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 }); + expect('test').to.haveOwnPropertyDescriptor('length').to.have.property('enumerable', false); + expect('test').to.haveOwnPropertyDescriptor('length').to.contain.keys('value'); + + 'test'.should.have.ownPropertyDescriptor('length'); + 'test'.should.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 }); + 'test'.should.not.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 }); + 'test'.should.haveOwnPropertyDescriptor('length').to.have.property('enumerable', false); + 'test'.should.haveOwnPropertyDescriptor('length').to.contain.keys('value'); +} + function string() { expect('foobar').to.have.string('bar'); 'foobar'.should.have.string('bar'); @@ -707,6 +743,10 @@ function include() { ['foo', 'bar'].should.not.include('baz'); expect(['foo', 'bar']).to.not.include(1); ['foo', 'bar'].should.not.include(1); + // alias + + expect(['foo', 'bar']).includes('foo'); + ['foo', 'bar'].should.includes('foo'); err(() => { expect(['foo']).to.include('bar', 'blah'); @@ -732,6 +772,14 @@ function keys() { ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('bar', 'foo'); expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('baz'); ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('baz'); + // alias + + expect({ foo: 1, bar: 2, baz: 3 }).contains.keys('baz'); + + expect({ foo: 1, bar: 2 }).to.have.all.keys(['foo', 'bar']); + expect({ foo: 1, bar: 2 }).to.have.any.keys(['foo', 'bar']); + ({ foo: 1, bar: 2, baz: 3 }).should.contain.all.keys('baz'); + ({ foo: 1, bar: 2, baz: 3 }).should.contain.any.keys('baz'); expect({ foo: 1, bar: 2 }).to.contain.keys('foo'); ({ foo: 1, bar: 2 }).should.contain.keys('foo'); @@ -830,7 +878,28 @@ function chaining() { tea.should.be.a('object').and.have.property('name', 'chai'); } -class PoorlyConstructedError {} +function exxtensible() { + expect({}).to.be.extensible; + expect(Object.preventExtensions({})).to.be.not.extensible; + ({}).should.be.extensible; + Object.preventExtensions({}).should.not.be.extensible; +} +function sealed() { + expect({}).to.be.not.sealed; + expect(Object.seal({})).to.be.sealed; + ({}).should.be.not.sealed; + Object.seal({}).should.be.sealed; +} + +function frozen() { + expect({}).to.be.not.frozen; + expect(Object.freeze({})).to.be.frozen; + ({}).should.be.not.frozen; + Object.freeze({}).should.be.frozen; +} + + +class PoorlyConstructedError { } function _throw() { // See GH-45: some poorly-constructed custom errors don't have useful names // on either their constructor or their constructor prototype, but instead @@ -1023,34 +1092,44 @@ function _throw() { }, 'blah: expected [Function] to throw error including \'hello\' but got \'testing\''); } -function use(){ +function use() { // ReSharper disable once InconsistentNaming chai.use((_chai) => { - _chai.can.use.any(); + _chai.can.use.any(); }); } +class Klass { + val: number; + constructor() { this.val = 0; } + bar() { } + + static baz() { } +} + function respondTo() { - var bar = {}; + var obj = new Klass(); - expect(Foo).to.respondTo('bar'); - Foo.should.respondTo('bar'); - expect(Foo).to.not.respondTo('foo'); - Foo.should.not.respondTo('foo'); - expect(Foo).itself.to.respondTo('func'); - expect(Foo).itself.not.to.respondTo('bar'); + expect(Klass).to.respondTo('bar'); + expect(obj).respondsTo('bar'); + Klass.should.respondTo('bar'); + Klass.should.respondsTo('bar'); + expect(Klass).to.not.respondTo('foo'); + Klass.should.not.respondTo('foo'); + expect(Klass).itself.to.respondTo('func'); + expect(Klass).itself.not.to.respondTo('bar'); - expect(bar).to.respondTo('foo'); - bar.should.respondTo('foo'); + expect(obj).not.to.respondTo('foo'); + obj.should.not.respondTo('foo'); err(() => { - expect(Foo).to.respondTo('baz', 'constructor'); - Foo.should.respondTo('baz', 'constructor'); - }, /^(constructor: expected)(.*)(\[Function: Foo\])(.*)(to respond to \'baz\')$/); + expect(Klass).to.respondTo('baz', 'constructor'); + Klass.should.respondTo('baz', 'constructor'); + }, /^(constructor: expected)(.*)(\[Function: Klass\])(.*)(to respond to \'baz\')$/); err(() => { - expect(bar).to.respondTo('baz', 'object'); - bar.should.respondTo('baz', 'object'); + expect(obj).to.respondTo('baz', 'object'); + obj.should.respondTo('baz', 'object'); }, /^(object: expected)(.*)(\{ foo: \[Function\] \}|\{ Object \()(.*)(to respond to \'baz\')$/); } @@ -1116,6 +1195,23 @@ function sameMembers() { [5, 4].should.not.have.same.members([6, 3]); expect([5, 4]).to.not.have.same.members([5, 4, 2]); [5, 4].should.not.have.same.members([5, 4, 2]); + + assert.sameMembers([5, 4], [4, 5]); +} +function sameDeepMembers() { + expect([{ id: 5 }, { id: 4 }]).to.have.same.deep.members([{ id: 4 }, { id: 5 }]); + [{ id: 5 }, { id: 4 }].should.have.same.deep.members([{ id: 4 }, { id: 5 }]); + expect([{ id: 5 }, { id: 4 }]).to.have.same.members([{ id: 5 }, { id: 4 }]); + [{ id: 5 }, { id: 4 }].should.have.same.members([{ id: 5 }, { id: 4 }]); + + expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([]); + [{ id: 5 }, { id: 4 }].should.not.have.same.members([]); + expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([{ id: 6 }, { id: 3 }]); + [{ id: 5 }, { id: 4 }].should.not.have.same.members([{ id: 6 }, { id: 3 }]); + expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([{ id: 5 }, { id: 4 }, { id: 2 }]); + [{ id: 5 }, { id: 4 }].should.not.have.same.members([{ id: 5 }, { id: 4 }, { id: 2 }]); + + assert.sameDeepMembers([{ id: 5 }, { id: 4 }], [{ id: 4 }, { id: 5 }]); } function members() { @@ -1127,16 +1223,48 @@ function members() { expect([5, 4]).not.members([5, 4, 2]); } +function increaseDecreaseChange() { + var obj = { val: 10 }; + var inc = () => { obj.val++; }; + var dec = () => { obj.val--; }; + var same = () => { }; + + expect(inc).to.increase(obj, "val"); + expect(inc).increases(obj, "val"); + expect(inc).to.change(obj, "val"); + + expect(dec).to.decrease(obj, "val"); + expect(dec).decreases(obj, "val"); + expect(dec).to.change(obj, "val"); + expect(dec).changes(obj, "val"); + + expect(inc).to.not.decrease(obj, "val"); + expect(dec).to.not.increase(obj, "val"); + expect(same).to.not.increase(obj, "val"); + expect(same).to.not.decrease(obj, "val"); + expect(same).to.not.change(obj, "val"); + + inc.should.increase(obj, "val"); + inc.should.change(obj, "val"); + + dec.should.decrease(obj, "val"); + dec.should.change(obj, "val"); + + inc.should.not.decrease(obj, "val"); + dec.should.not.increase(obj, "val"); + same.should.not.change(obj, "val"); +} + //tdd -declare function suite(description: string, action: Function):void; -declare function test(description: string, action: Function):void; +declare function suite(description: string, action: Function): void; +declare function test(description: string, action: Function): void; interface FieldObj { field: any; } class CrashyObject { - inspect (): void { + inspect(): void { throw new Error('Arg\'s inspect() called even though the test passed'); } } @@ -1172,6 +1300,9 @@ suite('assert', () => { assert.ok(true); assert.ok(1); assert.ok('test'); + assert.isOk(true); + assert.isOk(1); + assert.isOk('test'); err(() => { assert.ok(false); @@ -1186,6 +1317,27 @@ suite('assert', () => { }, 'expected \'\' to be truthy'); }); + test('notOk', () => { + assert.notOk(false); + assert.notOk(0); + assert.notOk(''); + assert.isNotOk(false); + assert.isNotOk(0); + assert.isNotOk(''); + + err(() => { + assert.notOk(true); + }, 'expected true to be falsy'); + + err(() => { + assert.notOk(1); + }, 'expected 1 to be falsy'); + + err(() => { + assert.notOk('test'); + }, 'expected \'test\' to be falsy'); + }); + test('isFalse', () => { assert.isFalse(false); @@ -1199,7 +1351,7 @@ suite('assert', () => { }); test('equal', () => { - assert.equal(void(0), undefined); + assert.equal(void (0), undefined); }); test('typeof / notTypeOf', () => { @@ -1288,19 +1440,19 @@ suite('assert', () => { }); test('deepEqual', () => { - assert.deepEqual({tea: 'chai'}, {tea: 'chai'}); + assert.deepEqual({ tea: 'chai' }, { tea: 'chai' }); err(() => { - assert.deepEqual({tea: 'chai'}, {tea: 'black'}); + assert.deepEqual({ tea: 'chai' }, { tea: 'black' }); }, 'expected { tea: \'chai\' } to deeply equal { tea: \'black\' }'); var obja = Object.create({ tea: 'chai' }) - , objb = Object.create({ tea: 'chai' }); + , objb = Object.create({ tea: 'chai' }); assert.deepEqual(obja, objb); - var obj1 = Object.create({tea: 'chai'}) - , obj2 = Object.create({tea: 'black'}); + var obj1 = Object.create({ tea: 'chai' }) + , obj2 = Object.create({ tea: 'black' }); err(() => { assert.deepEqual(obj1, obj2); @@ -1309,13 +1461,13 @@ suite('assert', () => { test('deepEqual (ordering)', () => { var a = { a: 'b', c: 'd' } - , b = { c: 'd', a: 'b' }; + , b = { c: 'd', a: 'b' }; assert.deepEqual(a, b); }); test('deepEqual (circular)', () => { - var circularObject:any = {} - , secondCircularObject:any = {}; + var circularObject: any = {} + , secondCircularObject: any = {}; circularObject.field = circularObject; secondCircularObject.field = secondCircularObject; @@ -1328,15 +1480,15 @@ suite('assert', () => { }); test('notDeepEqual', () => { - assert.notDeepEqual({tea: 'jasmine'}, {tea: 'chai'}); + assert.notDeepEqual({ tea: 'jasmine' }, { tea: 'chai' }); err(() => { - assert.notDeepEqual({tea: 'chai'}, {tea: 'chai'}); + assert.notDeepEqual({ tea: 'chai' }, { tea: 'chai' }); }, 'expected { tea: \'chai\' } to not deeply equal { tea: \'chai\' }'); }); test('notDeepEqual (circular)', () => { - var circularObject:any = {} - , secondCircularObject:any = { tea: 'jasmine' }; + var circularObject: any = {} + , secondCircularObject: any = { tea: 'jasmine' }; circularObject.field = circularObject; secondCircularObject.field = secondCircularObject; @@ -1380,6 +1532,22 @@ suite('assert', () => { }, 'expected undefined to not equal undefined'); }); + test('isNaN', () => { + assert.isNaN(NaN); + + err(() => { + assert.isNaN(12); + }, 'expected 12 to be NaN'); + }); + + test('isNotNaN', () => { + assert.isNotNaN(12); + + err(() => { + assert.isNotNaN(NaN); + }, 'expected NaN to not NaN'); + }); + test('isFunction', () => { var func = () => { }; @@ -1431,7 +1599,7 @@ suite('assert', () => { test('isNotString', () => { assert.isNotString(3); - assert.isNotString([ 'hello' ]); + assert.isNotString(['hello']); err(() => { assert.isNotString('hello'); @@ -1449,7 +1617,7 @@ suite('assert', () => { test('isNotNumber', () => { assert.isNotNumber('hello'); - assert.isNotNumber([ 5 ]); + assert.isNotNumber([5]); err(() => { assert.isNotNumber(4); @@ -1479,7 +1647,7 @@ suite('assert', () => { test('include', () => { assert.include('foobar', 'bar'); - assert.include([ 1, 2, 3], 3); + assert.include([1, 2, 3], 3); err(() => { assert.include('foobar', 'baz'); @@ -1492,7 +1660,7 @@ suite('assert', () => { test('notInclude', () => { assert.notInclude('foobar', 'baz'); - assert.notInclude([ 1, 2, 3 ], 4); + assert.notInclude([1, 2, 3], 4); err(() => { assert.notInclude('foobar', 'bar'); @@ -1739,4 +1907,42 @@ suite('assert', () => { }, 'expected [ 1, 54 ] to have the same members as [ 6, 1, 54 ]'); }); + + test('isAbove', () => { + assert.isAbove(10, 5); + + err(() => { + assert.isAbove(1, 5); + }, 'expected 1 to be above 5'); + err(() => { + assert.isAbove(5, 5); + }, 'expected 5 to be above 5'); + }); + + test('isBelow', () => { + assert.isBelow(5, 10); + + err(() => { + assert.isBelow(5, 1); + }, 'expected 5 to be above 1'); + err(() => { + assert.isBelow(5, 5); + }, 'expected 5 to be below 5'); + }); + + test('extensible', () => { assert.extensible({}); }); + test('isExtensible', () => { assert.isExtensible({}); }); + test('notExtensible', () => { assert.notExtensible(Object.preventExtensions({})); }); + test('isNotExtensible', () => { assert.isNotExtensible(Object.preventExtensions({})); }); + + test('sealed', () => { assert.sealed(Object.seal({})); }); + test('isSealed', () => { assert.isSealed(Object.seal({})); }); + test('notSealed', () => { assert.notSealed({}); }); + test('isNotSealed', () => { assert.isNotSealed({}); }); + + test('frozen', () => { assert.frozen(Object.freeze({})); }); + test('isFrozen', () => { assert.isFrozen(Object.freeze({})); }); + test('notFrozen', () => { assert.notFrozen({}); }); + test('isNotFrozen', () => { assert.isNotFrozen({}); }); + }); diff --git a/chai/chai.d.ts b/chai/chai.d.ts index f693582c59..da4d718e1b 100644 --- a/chai/chai.d.ts +++ b/chai/chai.d.ts @@ -1,10 +1,13 @@ -// Type definitions for chai 2.0.0 +// Type definitions for chai 3.2.0 // Project: http://chaijs.com/ // Definitions by: Jed Mao , // Bart van der Schoor , -// Andrew Brown +// Andrew Brown , +// Olivier Chevet // Definitions: https://github.com/borisyankov/DefinitelyTyped +// + declare module Chai { interface ChaiStatic { @@ -16,9 +19,11 @@ declare module Chai { use(fn: (chai: any, utils: any) => void): any; assert: AssertStatic; config: Config; + AssertionError: AssertionError; } export interface ExpectStatic extends AssertionStatic { + fail(actual?: any, expected?: any, message?: string, operator?: string): void; } export interface AssertStatic extends Assert { @@ -49,15 +54,20 @@ declare module Chai { interface Assertion extends LanguageChains, NumericComparison, TypeComparison { not: Assertion; deep: Deep; + any: KeyFilter; + all: KeyFilter; a: TypeComparison; an: TypeComparison; include: Include; + includes: Include; contain: Include; + contains: Include; ok: Assertion; true: Assertion; false: Assertion; null: Assertion; undefined: Assertion; + NaN: Assertion; exist: Assertion; empty: Assertion; arguments: Assertion; @@ -70,20 +80,35 @@ declare module Chai { property: Property; ownProperty: OwnProperty; haveOwnProperty: OwnProperty; + ownPropertyDescriptor: OwnPropertyDescriptor; + haveOwnPropertyDescriptor: OwnPropertyDescriptor; length: Length; lengthOf: Length; - match(regexp: RegExp|string, message?: string): Assertion; + match: Match; + matches: Match; string(string: string, message?: string): Assertion; keys: Keys; key(string: string): Assertion; throw: Throw; throws: Throw; Throw: Throw; - respondTo(method: string, message?: string): Assertion; + respondTo: RespondTo; + respondsTo: RespondTo; itself: Assertion; - satisfy(matcher: Function, message?: string): Assertion; + satisfy: Satisfy; + satisfies: Satisfy; closeTo(expected: number, delta: number, message?: string): Assertion; members: Members; + increase: PropertyChange; + increases: PropertyChange; + decrease: PropertyChange; + decreases: PropertyChange; + change: PropertyChange; + changes: PropertyChange; + extensible: Assertion; + sealed: Assertion; + frozen: Assertion; + } interface LanguageChains { @@ -134,6 +159,11 @@ declare module Chai { equal: Equal; include: Include; property: Property; + members: Members; + } + + interface KeyFilter { + keys: Keys; } interface Equal { @@ -148,6 +178,11 @@ declare module Chai { (name: string, message?: string): Assertion; } + interface OwnPropertyDescriptor { + (name: string, descriptor: PropertyDescriptor, message?: string): Assertion; + (name: string, message?: string): Assertion; + } + interface Length extends LanguageChains, NumericComparison { (length: number, message?: string): Assertion; } @@ -158,11 +193,18 @@ declare module Chai { (value: number, message?: string): Assertion; keys: Keys; members: Members; + any: KeyFilter; + all: KeyFilter; + } + + interface Match { + (regexp: RegExp|string, message?: string): Assertion; } interface Keys { (...keys: string[]): Assertion; (keys: any[]): Assertion; + (keys: Object): Assertion; } interface Throw { @@ -175,10 +217,22 @@ declare module Chai { (constructor: Function, expected?: RegExp, message?: string): Assertion; } + interface RespondTo { + (method: string, message?: string): Assertion; + } + + interface Satisfy { + (matcher: Function, message?: string): Assertion; + } + interface Members { (set: any[], message?: string): Assertion; } + interface PropertyChange { + (object: Object, prop: string, msg?: string): Assertion; + } + export interface Assert { /** * @param expression Expression to test for truthiness. @@ -189,7 +243,9 @@ declare module Chai { fail(actual?: any, expected?: any, msg?: string, operator?: string): void; ok(val: any, msg?: string): void; + isOk(val: any, msg?: string): void; notOk(val: any, msg?: string): void; + isNotOk(val: any, msg?: string): void; equal(act: any, exp: any, msg?: string): void; notEqual(act: any, exp: any, msg?: string): void; @@ -209,6 +265,12 @@ declare module Chai { isUndefined(val: any, msg?: string): void; isDefined(val: any, msg?: string): void; + isNaN(val: any, msg?: string): void; + isNotNaN(val: any, msg?: string): void; + + isAbove(val: number, abv: number, msg?: string): void; + isBelow(val: number, blw: number, msg?: string): void; + isFunction(val: any, msg?: string): void; isNotFunction(val: any, msg?: string): void; @@ -279,9 +341,27 @@ declare module Chai { closeTo(act: number, exp: number, delta: number, msg?: string): void; sameMembers(set1: any[], set2: any[], msg?: string): void; - includeMembers(set1: any[], set2: any[], msg?: string): void; + sameDeepMembers(set1: any[], set2: any[], msg?: string): void; + includeMembers(superset: any[], subset: any[], msg?: string): void; ifError(val: any, msg?: string): void; + + isExtensible(obj: {}, msg?: string): void; + extensible(obj: {}, msg?: string): void; + isNotExtensible(obj: {}, msg?: string): void; + notExtensible(obj: {}, msg?: string): void; + + isSealed(obj: {}, msg?: string): void; + sealed(obj: {}, msg?: string): void; + isNotSealed(obj: {}, msg?: string): void; + notSealed(obj: {}, msg?: string): void; + + isFrozen(obj: Object, msg?: string): void; + frozen(obj: Object, msg?: string): void; + isNotFrozen(obj: Object, msg?: string): void; + notFrozen(obj: Object, msg?: string): void; + + } export interface Config { @@ -305,4 +385,4 @@ declare module "chai" { interface Object { should: Chai.Assertion; -} +} From b366162ae8eb6db0758e6a923e11a7104775461e Mon Sep 17 00:00:00 2001 From: Paul Jolly Date: Wed, 2 Sep 2015 18:34:14 +0100 Subject: [PATCH 080/259] Add definition of Slider constructor --- bootstrap-slider/bootstrap-slider.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bootstrap-slider/bootstrap-slider.d.ts b/bootstrap-slider/bootstrap-slider.d.ts index 78aeb645ce..d66c85ab10 100644 --- a/bootstrap-slider/bootstrap-slider.d.ts +++ b/bootstrap-slider/bootstrap-slider.d.ts @@ -137,6 +137,13 @@ interface JQueryEventObject { value: number|ChangeValue; } +interface SliderStatics { + new (selector: string, opts: SliderOptions): Slider; + prototype: Slider; +} + +declare var Slider: SliderStatics; + /** * This class is actually not used when using the jQuery version of bootstrap-slider * The method documentation is still here thouh. From 79050a8c4754155658990c81d712799c413ef982 Mon Sep 17 00:00:00 2001 From: Ritzlgrmft Date: Thu, 3 Sep 2015 10:03:11 +0200 Subject: [PATCH 081/259] Additions added which are needed for writing an own appender --- log4javascript/log4javascript.d.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/log4javascript/log4javascript.d.ts b/log4javascript/log4javascript.d.ts index 0a4026c85d..98f23d1f72 100644 --- a/log4javascript/log4javascript.d.ts +++ b/log4javascript/log4javascript.d.ts @@ -253,6 +253,8 @@ declare module log4javascript { * Asserts the given expression is true or evaluates to true. If so, nothing is logged. If not, an error is logged at the ERROR level. */ assert(expr: any): void; + + name: string; } // #endregion @@ -262,7 +264,20 @@ declare module log4javascript { /** * Logging event. */ - export class LoggingEvent { } + export class LoggingEvent { + logger: Logger; + timeStamp: Date; + timeStampInMilliseconds: number; + timeStampInSeconds: number; + milliseconds: number; + level: Level; + messages: any[]; + exception: Error; + + getThrowableStrRep: () => string; + getCombinedMessages: () => string; + toString: () => string; + } /** * There are methods common to all appenders, as listed below. @@ -920,6 +935,8 @@ declare module log4javascript { * Returns whether the layout has any custom fields. */ hasCustomFields(): boolean; + + formatWithException(loggingEvent: LoggingEvent): string; } /** From 3cb092884b27264e900c4d0e94c3d8e74cfc548d Mon Sep 17 00:00:00 2001 From: wanwan31 Date: Thu, 3 Sep 2015 10:27:46 +0200 Subject: [PATCH 082/259] fix comma Im getting this error with gulp: highcharts-ng/higcharts-ng-d.ts(27,6) : error TS1005: ';' expected. --- highcharts-ng/highcharts-ng.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/highcharts-ng/highcharts-ng.d.ts b/highcharts-ng/highcharts-ng.d.ts index d0a3405594..ea7caa883f 100644 --- a/highcharts-ng/highcharts-ng.d.ts +++ b/highcharts-ng/highcharts-ng.d.ts @@ -24,7 +24,7 @@ interface HighChartsNGConfig { currentMin?: number; currentMax?: number; title?: { text?: string } - }, + }; //Whether to use HighStocks instead of HighCharts (optional). Defaults to false. useHighStocks?: boolean; //size (optional) if left out the chart will default to size of the div or something sensible. @@ -40,4 +40,4 @@ interface HighChartsNGConfig { interface HighChartsNGChart extends HighChartsNGConfig { //This is a simple way to access all the Highcharts API that is not currently managed by this directive. getHighcharts(): HighchartsChartObject; -} \ No newline at end of file +} From bf9051cac2f09a25952fafbda97a95b2f39e9eae Mon Sep 17 00:00:00 2001 From: Igor Kriklivetc Date: Thu, 3 Sep 2015 11:51:26 +0300 Subject: [PATCH 083/259] Tests updated --- devextreme/dx.devextreme-tests.ts | 123 +++++++++++++----------------- 1 file changed, 54 insertions(+), 69 deletions(-) diff --git a/devextreme/dx.devextreme-tests.ts b/devextreme/dx.devextreme-tests.ts index ef147c2c6e..2aad878f11 100644 --- a/devextreme/dx.devextreme-tests.ts +++ b/devextreme/dx.devextreme-tests.ts @@ -2,12 +2,12 @@ module Tests.ui { var dataGridOptions: DevExpress.ui.dxDataGridOptions = { - activeStateEnabled: true, - allowColumnReordering: true, - allowColumnResizing: true, - onCellClick: function () { }, - cellHintEnabled: true, - columnAutoWidth: true, + activeStateEnabled: true, + allowColumnReordering: true, + allowColumnResizing: true, + onCellClick: function () { }, + cellHintEnabled: true, + columnAutoWidth: true, columnChooser: { emptyPanelText: "Nothing is here", enabled: true, @@ -17,66 +17,51 @@ module Tests.ui { }, columns: [ { - text: '5 columns with custom css class', value: [ - { dataField: 'Processed', dataType: 'boolean', allowSorting: false }, - { dataField: 'CustomerID', cssClass: 'customCssClass' }, - 'OrderDate', - { dataField: 'Freight', validationRules: [{ type: "range", min: 1, max: 100 }] }, - { dataField: 'ShipName', validationRules: [{ type: 'required' }] }, - 'ShipCity'] - }, - { - text: 'with show editor always', value: [ - { dataField: 'Processed', dataType: 'boolean', allowSorting: false, showEditorAlways: true }, - { dataField: 'OrderDate', dataType: 'date', showEditorAlways: true }, - { dataField: 'CustomerID', showEditorAlways: true }, - { dataField: 'Freight', showEditorAlways: true }, - { dataField: 'ShipName', showEditorAlways: true }] - }, - { - text: 'custom template/edit/header template', value: [ - 'CustomerID', - 'OrderDate', - 'Freight', - { - dataField: 'ShipVia', - editCellTemplate: function (container: JQuery, options: { value: number }) { - container.addClass('dx-editor-cell'); - container.append($('

').dxSelectBox({ - value: options.value, - dataSource: [ - { ShipperID: 1, CompanyName: 'Speedy Express' }, - { ShipperID: 2, CompanyName: 'United Package' }, - { ShipperID: 3, CompanyName: 'Federal Shipping' } - ], - valueExpr: 'ShipperID', - displayExpr: 'CompanyName' - })); - }, - cellTemplate: function (container: JQuery, options: { value: number }) { - container.text(String(options.value)); - }, - headerCellTemplate: function (container: JQuery, options: { headerCaption: string }) { - container.append($('
').css({ border: '1px solid red' }).text(options.headerCaption)); - } - }, - 'ShipName', - 'ShipCity'] - }, - { text: 'none', value: '' }, - { - text: 'custom template/header hogan template', value: [ - 'CustomerID', - 'OrderDate', - 'Freight', - { - dataField: 'ShipVia', - cellTemplate: '#hoganColumnTemplate', - headerCellTemplate: $('#hoganHeaderColumnTemplate') - }, - 'ShipName', - 'ShipCity'] - }], + alignment: "center", + allowFixing: true, + allowEditing: true, + allowFiltering: true, + allowGrouping: true, + allowHiding: true, + allowReordering: true, + allowResizing: true, + allowSearch: true, + allowSorting: true, + autoExpandGroup: true, + calculateCellValue: function(rowData: Object) { return "test-value"; }, + calculateFilterExpression: function(filterValue: any, selectedFilterOperation: string) { return []; }, + caption: "Test column", + cellTemplate: function(container: JQuery, options: Object) { $("Template").appendTo(container); }, + cssClass: "test-ccs-class-name", + customizeText: function(cellInfo: { value: any, valueText: string; }) { return "New text" }, + dataField: "Test", + dataType: "string", + encodeHtml: true, + falseText: "FALSE", + filterOperations: ["contains", "notcontains"], + filterType: "exclude", + filterValue: "Test-filter-value", + fixed: true, + fixedPosition: "right", + groupIndex: 0, + lookup: { + allowClearing: true, + dataSource: ["first", "second"], + displayExpr: "this", + valueExpr: "this" + }, + name: "test-column-name", + showEditorAlways: true, + showInColumnChooser: true, + showWhenGrouped:true, + sortIndex: 1, + sortOrder: "desc", + trueText: "TRUE", + visible: true, + visibleIndex: 0, + width: "100%" + } + ], customizeColumns: function (columns) { var i: number; for (i = 0; i < columns.length; i++) { @@ -118,10 +103,10 @@ module Tests.ui { if (columns[i].dataField === 'ShipCity') { columns[i].editCellTemplate = function (container: JQuery, options: { value: string; setValue: Function }) { $('
').dxAutocomplete({ - items: ["Bern", "Lyon", "Lander"], + dataSource: ["Bern", "Lyon", "Lander"], value: options.value, - onValueChange: function (e:{ value: string }) { - options.setValue(e.value); + onValueChanged: function () { + options.setValue("test-value"); } }).appendTo(container); } From f91384300695af40e9764ad907bcd24ea743cd91 Mon Sep 17 00:00:00 2001 From: Alain Sahli Date: Thu, 3 Sep 2015 10:54:06 +0200 Subject: [PATCH 084/259] add support for AMD require --- angular-ui-bootstrap/angular-ui-bootstrap.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts index 1a36d21a2d..8ebfdb6c24 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts @@ -5,6 +5,9 @@ /// +// Support for AMD require +declare module 'angular-bootstrap' {} + declare module angular.ui.bootstrap { interface IAccordionConfig { From 29bb04657e87372d94b749c32b9f208245e45024 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 20:30:51 +0900 Subject: [PATCH 085/259] partially fixed sequelize/sequelize.d.ts --- sequelize/sequelize.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sequelize/sequelize.d.ts b/sequelize/sequelize.d.ts index 41e8410aec..ba465db5e7 100644 --- a/sequelize/sequelize.d.ts +++ b/sequelize/sequelize.d.ts @@ -2034,6 +2034,7 @@ declare module "sequelize" { */ logging? : boolean | Function; + transaction?: Transaction; } /** @@ -2085,6 +2086,9 @@ declare module "sequelize" { */ logging? : boolean | Function; + silent? : boolean; + + returning? : boolean; } /** @@ -4878,4 +4882,3 @@ declare module "sequelize" { export = sequelize; } - From 486828c97de8c080ac2b610ab22414336803ca45 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 20:36:09 +0900 Subject: [PATCH 086/259] adhoc fix rest/rest-tests.ts --- rest/rest-tests.ts | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/rest/rest-tests.ts b/rest/rest-tests.ts index 6d267c7926..cedc11b003 100644 --- a/rest/rest-tests.ts +++ b/rest/rest-tests.ts @@ -117,24 +117,24 @@ var promiseOrResponse = interceptor({ }); client = rest - .wrap(defaultRequest) - .wrap(hateoas) - .wrap(location) - .wrap(mime) - .wrap(pathPrefix) - .wrap(basicAuth) - .wrap(oAuth) - .wrap(csrf) - .wrap(errorCode) - .wrap(retry) - .wrap(timeout) - .wrap(jsonp) - .wrap(xdomain) - .wrap(xhr) - .wrap(noop) - .wrap(fail) - .wrap(knownConfig, { prop: 'value' }) - .wrap(transformedConfig, { prop: 'value' }); + .wrap(defaultRequest) + .wrap(hateoas) + .wrap(location) + .wrap(mime) + .wrap(pathPrefix) + .wrap(basicAuth) + .wrap(oAuth) + .wrap(csrf) + .wrap(errorCode) + .wrap(retry) + .wrap(timeout) + .wrap(jsonp) + .wrap(xdomain) + .wrap(xhr) + .wrap(noop) + .wrap(fail) + .wrap(knownConfig, { prop: 'value' }) + .wrap(transformedConfig, { prop: 'value' }); import xhrClient = require('rest/client/xhr'); import nodeClient = require('rest/client/node'); From 79ca1235f8bae7e85204b4460f1af0b6c10b1f12 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 20:46:01 +0900 Subject: [PATCH 087/259] adhoc fix react/react-addons-tests.ts --- react/react-addons-tests.ts | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/react/react-addons-tests.ts b/react/react-addons-tests.ts index 6976d9959d..ff01806c54 100644 --- a/react/react-addons-tests.ts +++ b/react/react-addons-tests.ts @@ -57,9 +57,10 @@ var ClassicComponent: React.ClassicComponentClass = seconds: this.props.foo }; }, - reset: () => { - this.replaceState(this.getInitialState()); - }, + // NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590 + // reset: () => { + // this.replaceState(this.getInitialState()); + // }, render: () => { return React.DOM.div(null, React.DOM.input({ @@ -71,32 +72,32 @@ var ClassicComponent: React.ClassicComponentClass = class ModernComponent extends React.Component implements React.ChildContextProvider { - + static propTypes: React.ValidationMap = { foo: React.PropTypes.number } - + static contextTypes: React.ValidationMap = { someValue: React.PropTypes.string } - + static childContextTypes: React.ValidationMap = { someOtherValue: React.PropTypes.string } - + context: Context; - + getChildContext() { return { someOtherValue: 'foo' } } - + state = { inputValue: this.context.someValue, seconds: this.props.foo } - + reset() { this.setState({ inputValue: this.context.someValue, @@ -105,7 +106,7 @@ class ModernComponent extends React.Component } private _input: React.HTMLComponent; - + render() { return React.DOM.div(null, React.DOM.input({ From ddd6e9a85527baf7ca57f53971bc48a1e1ee8cdb Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 20:47:18 +0900 Subject: [PATCH 088/259] fix project-oxford/project-oxford-tests.ts --- project-oxford/project-oxford-tests.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/project-oxford/project-oxford-tests.ts b/project-oxford/project-oxford-tests.ts index 3d662d5040..896d407b8d 100644 --- a/project-oxford/project-oxford-tests.ts +++ b/project-oxford/project-oxford-tests.ts @@ -16,7 +16,7 @@ var billFaces = []; var personGroupId = "uuid.v4()"; var personGroupId2 = "uuid.v4()"; var billPersonId: string; - + describe('Project Oxford Face API Test', function () { afterEach(function() { // delay after each test to prevent throttling @@ -82,7 +82,7 @@ describe('Project Oxford Face API Test', function () { }); }); }); - + describe('#similar()', function () { it('detects similar faces', function (done) { var detects = []; @@ -148,7 +148,7 @@ describe('Project Oxford Face API Test', function () { }); }); }); - + describe('#PersonGroup', function () { before(function(done) { this.timeout(5000); @@ -199,7 +199,7 @@ describe('Project Oxford Face API Test', function () { done(); }); }); - + it('updates a PersonGroup', function (done) { client.face.personGroup.update(personGroupId, 'po-node-test-group2', 'test-data2').then(function (response) { assert.ok(true, "void response expected");; @@ -364,7 +364,7 @@ describe('Project Oxford Vision API Test', function () { before(function() { // ensure the output directory exists if(!fs.existsSync('./test/output')){ - fs.mkdirSync('./test/output', 0766); + fs.mkdirSync('./test/output', parseInt("0766", 8)); } }); @@ -417,7 +417,7 @@ describe('Project Oxford Vision API Test', function () { done(); }); }); - + it('creates a thumbnail for a local image', function (done) { this.timeout(10000); client.vision.thumbnail({ @@ -449,7 +449,7 @@ describe('Project Oxford Vision API Test', function () { done(); }); }); - + it('runs OCR on a local image', function (done) { this.timeout(10000); client.vision.ocr({ @@ -477,4 +477,4 @@ describe('Project Oxford Vision API Test', function () { done(); }); }); -}); \ No newline at end of file +}); From eb6ccff48ce4b6991e11e060a8233c152fcc15f9 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 20:51:27 +0900 Subject: [PATCH 089/259] fix phantom/phantom-tests.ts --- phantom/phantom-tests.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/phantom/phantom-tests.ts b/phantom/phantom-tests.ts index bd12a5e6e1..d18168827d 100644 --- a/phantom/phantom-tests.ts +++ b/phantom/phantom-tests.ts @@ -117,7 +117,7 @@ phantom.create((ph) => { var finishedFunc = (result: any) => { ph.exit(); }; - page.evaluate(someFunc, finishedFunc, 'div', {wahtt: 111}); + page.evaluate(someFunc, finishedFunc, 'div', {wahtt: 111}); }); }); @@ -164,5 +164,3 @@ phantom.create((ph) => { }); }); }); - - From e66a2960695a0bea224a0f96b24b9966dc3d6fad Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 20:56:43 +0900 Subject: [PATCH 090/259] fix physijs/tests/jenga.ts --- physijs/tests/jenga.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physijs/tests/jenga.ts b/physijs/tests/jenga.ts index e2eeecc94e..77b9c6cd6a 100644 --- a/physijs/tests/jenga.ts +++ b/physijs/tests/jenga.ts @@ -85,7 +85,7 @@ initScene = function() { // Materials table_material = Physijs.createMaterial( - new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/wood.jpg' ), ambient: 0xFFFFFF }), + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/wood.jpg' ) }), .9, // high friction .2 // low restitution ); @@ -93,7 +93,7 @@ initScene = function() { table_material.map.repeat.set( 5, 5 ); block_material = Physijs.createMaterial( - new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/plywood.jpg' ), ambient: 0xFFFFFF }), + new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/plywood.jpg' ) }), .4, // medium friction .4 // medium restitution ); From 3bd9307bcfd9d63962487bf34f6775131cff202c Mon Sep 17 00:00:00 2001 From: Igor Kriklivetc Date: Thu, 3 Sep 2015 14:56:54 +0300 Subject: [PATCH 091/259] Fix after merge --- devextreme/dx.devextreme-tests.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/devextreme/dx.devextreme-tests.ts b/devextreme/dx.devextreme-tests.ts index 31dfd35937..2aad878f11 100644 --- a/devextreme/dx.devextreme-tests.ts +++ b/devextreme/dx.devextreme-tests.ts @@ -105,13 +105,8 @@ module Tests.ui { $('
').dxAutocomplete({ dataSource: ["Bern", "Lyon", "Lander"], value: options.value, -<<<<<<< HEAD onValueChanged: function () { options.setValue("test-value"); -======= - onValueChanged: function (e:{ value: string }) { - options.setValue(e.value); ->>>>>>> upstream/master } }).appendTo(container); } From 35da2f0db2bb70cb5e161482227e61d7d8edef78 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 20:59:37 +0900 Subject: [PATCH 092/259] fix papaparse/papaparse-tests.ts --- papaparse/papaparse-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/papaparse/papaparse-tests.ts b/papaparse/papaparse-tests.ts index 14cc40bb30..8ae3f91672 100644 --- a/papaparse/papaparse-tests.ts +++ b/papaparse/papaparse-tests.ts @@ -12,14 +12,14 @@ res.errors[0].code; Papa.parse("3,3,3", { delimiter: ';', comments: false, - + step: function(results, p) { p.abort(); results.data.length; } }); -var file = new File(); +var file = new File(null, null, null); Papa.parse(file, { complete: function(a, b) { @@ -52,4 +52,4 @@ Papa.LocalChunkSize; var parser = new Papa.Parser({}) parser.getCharIndex(); parser.abort(); -parser.parse("", 0, false); \ No newline at end of file +parser.parse("", 0, false); From 48f9efdd93a9a6a11ca07e74dc90f6910537c79d Mon Sep 17 00:00:00 2001 From: Igor Kriklivetc Date: Thu, 3 Sep 2015 15:01:59 +0300 Subject: [PATCH 093/259] Formatting --- devextreme/dx.devextreme-tests.ts | 38 ++++---- devextreme/dx.devextreme.d.ts | 142 +++++++++++++++--------------- 2 files changed, 90 insertions(+), 90 deletions(-) diff --git a/devextreme/dx.devextreme-tests.ts b/devextreme/dx.devextreme-tests.ts index 2aad878f11..78b09d15ae 100644 --- a/devextreme/dx.devextreme-tests.ts +++ b/devextreme/dx.devextreme-tests.ts @@ -2,12 +2,12 @@ module Tests.ui { var dataGridOptions: DevExpress.ui.dxDataGridOptions = { - activeStateEnabled: true, - allowColumnReordering: true, - allowColumnResizing: true, - onCellClick: function () { }, - cellHintEnabled: true, - columnAutoWidth: true, + activeStateEnabled: true, + allowColumnReordering: true, + allowColumnResizing: true, + onCellClick: function() { }, + cellHintEnabled: true, + columnAutoWidth: true, columnChooser: { emptyPanelText: "Nothing is here", enabled: true, @@ -53,7 +53,7 @@ module Tests.ui { name: "test-column-name", showEditorAlways: true, showInColumnChooser: true, - showWhenGrouped:true, + showWhenGrouped: true, sortIndex: 1, sortOrder: "desc", trueText: "TRUE", @@ -62,7 +62,7 @@ module Tests.ui { width: "100%" } ], - customizeColumns: function (columns) { + customizeColumns: function(columns) { var i: number; for (i = 0; i < columns.length; i++) { if (columns[i].dataField.indexOf('Date') > 0) { @@ -79,16 +79,16 @@ module Tests.ui { valueExpr: 'CustomerID', displayExpr: 'ContactName' } - } + } if (columns[i].dataField === 'EmployeeID') { columns[i].lookup = { dataSource: { store: [], sort: 'LastName' }, valueExpr: 'EmployeeID', - displayExpr: function (data: any) { + displayExpr: function(data: any) { return data.LastName + ' ' + data.FirstName; } } - } + } if (columns[i].dataField === 'ShipVia') { columns[i].lookup = { dataSource: [ @@ -99,13 +99,13 @@ module Tests.ui { valueExpr: 'ShipperID', displayExpr: 'CompanyName' } - } + } if (columns[i].dataField === 'ShipCity') { - columns[i].editCellTemplate = function (container: JQuery, options: { value: string; setValue: Function }) { + columns[i].editCellTemplate = function(container: JQuery, options: { value: string; setValue: Function }) { $('
').dxAutocomplete({ dataSource: ["Bern", "Lyon", "Lander"], value: options.value, - onValueChanged: function () { + onValueChanged: function() { options.setValue("test-value"); } }).appendTo(container); @@ -227,10 +227,10 @@ module Tests.viz { { valueField: 's8' } ], title: 'Long Chart\'s Title', - onPointClick: function (arg: any) { + onPointClick: function(arg: any) { arg.target.isSelected() ? arg.target.clearSelection() : arg.target.select(); }, - onSeriesClick: function (arg: any) { + onSeriesClick: function(arg: any) { arg.target.isVisible() ? arg.target.hide() : arg.target.show(); } }; @@ -298,8 +298,8 @@ module Tests.data { pageSize: 25, paginate: true, - map: function (item) { return item; }, - postProcess: function (data) { return data; }, + map: function(item) { return item; }, + postProcess: function(data) { return data; }, searchExpr: "expr", searchOperation: "contains", searchValue: "somevalue", @@ -313,7 +313,7 @@ module Tests.data { }); new DevExpress.data.CustomStore({ - load: function () { + load: function() { return $.Deferred().promise(); } }); diff --git a/devextreme/dx.devextreme.d.ts b/devextreme/dx.devextreme.d.ts index ac0639b0a5..fdb7df96ca 100644 --- a/devextreme/dx.devextreme.d.ts +++ b/devextreme/dx.devextreme.d.ts @@ -35,7 +35,7 @@ declare module DevExpress { brokenRules: any[]; validators: IValidator[]; } - export interface GroupConfig extends EventsMixin { + export interface GroupConfig extends EventsMixin { group: any; validators: IValidator[]; validate(): ValidationGroupValidationResult; @@ -56,7 +56,7 @@ declare module DevExpress { /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ export function validateModel(model: Object): ValidationGroupValidationResult; /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ - export function registerModelForValidation(model: Object) : void; + export function registerModelForValidation(model: Object): void; } export var hardwareBackButton: JQueryCallback; /** Processes the hardware back button click. */ @@ -1789,7 +1789,7 @@ declare module DevExpress.ui { interval?: number; /** Specifies the maximum zoom level of a calendar, which is used to pick the date. */ maxZoomLevel?: string; - /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ + /** Specifies the minimal zoom level of a calendar, which is used to pick the date. */ minZoomLevel?: string; /** Specifies the type of date/time picker. */ pickerType?: string; @@ -1869,7 +1869,7 @@ declare module DevExpress.ui { /** A container widget used to arrange inner elements. */ export class dxBox extends CollectionWidget { constructor(element: JQuery, options?: dxBoxOptions); - constructor(element: Element, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); } export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { /** Specifies the collection of rows for the grid used to position layout elements. */ @@ -4332,16 +4332,16 @@ declare module DevExpress.viz.core { }) => void; /** A handler for the incidentOccurred event. */ onIncidentOccurred?: ( - component: BaseWidget, - element: Element, - target: { - id: string; - type: string; - args: any; - text: string; - widget: string; - version: string; - } + component: BaseWidget, + element: Element, + target: { + id: string; + type: string; + args: any; + text: string; + widget: string; + version: string; + } ) => void; /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ pathModified?: boolean; @@ -4656,59 +4656,59 @@ declare module DevExpress.viz.charts { }; } export interface CommonPointOptions { - /** Specifies border options for points in the line and area series. */ + /** Specifies border options for points in the line and area series. */ + border?: viz.core.Border; + /** Specifies the points color. */ + color?: string; + /** Specifies what series points to highlight when a point is hovered over. */ + hoverMode?: string; + /** An object defining configuration options for a hovered point. */ + hoverStyle?: { + /** An object defining the border options for a hovered point. */ border?: viz.core.Border; - /** Specifies the points color. */ + /** Sets a color for a point when it is hovered over. */ color?: string; - /** Specifies what series points to highlight when a point is hovered over. */ - hoverMode?: string; - /** An object defining configuration options for a hovered point. */ - hoverStyle?: { - /** An object defining the border options for a hovered point. */ - border?: viz.core.Border; - /** Sets a color for a point when it is hovered over. */ - color?: string; - /** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */ - size?: number; - }; - /** Specifies what series points to highlight when a point is selected. */ - selectionMode?: string; - /** An object defining configuration options for a selected point. */ - selectionStyle?: { - /** An object defining the border options for a selected point. */ - border?: viz.core.Border; - /**

Sets a color for a point when it is selected.

*/ - color?: string; - /** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */ - size?: number; - }; - /** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */ + /** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */ size?: number; - /** Specifies a symbol for presenting points of the line and area series. */ - symbol?: string; - visible?: boolean; + }; + /** Specifies what series points to highlight when a point is selected. */ + selectionMode?: string; + /** An object defining configuration options for a selected point. */ + selectionStyle?: { + /** An object defining the border options for a selected point. */ + border?: viz.core.Border; + /**

Sets a color for a point when it is selected.

*/ + color?: string; + /** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */ + size?: number; + }; + /** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */ + size?: number; + /** Specifies a symbol for presenting points of the line and area series. */ + symbol?: string; + visible?: boolean; } export interface ChartCommonPointOptions extends CommonPointOptions { - /** An object specifying the parameters of an image that is used as a point marker. */ - image?: { - /** Specifies the height of an image that is used as a point marker. */ - height?: any; - /** Specifies a URL leading to the image to be used as a point marker. */ - url?: any; - /** Specifies the width of an image that is used as a point marker. */ - width?: any; - }; + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: any; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: any; + /** Specifies the width of an image that is used as a point marker. */ + width?: any; + }; } export interface PolarCommonPointOptions extends CommonPointOptions { - /** An object specifying the parameters of an image that is used as a point marker. */ - image?: { - /** Specifies the height of an image that is used as a point marker. */ - height?: number; - /** Specifies a URL leading to the image to be used as a point marker. */ - url?: string; - /** Specifies the width of an image that is used as a point marker. */ - width?: number; - }; + /** An object specifying the parameters of an image that is used as a point marker. */ + image?: { + /** Specifies the height of an image that is used as a point marker. */ + height?: number; + /** Specifies a URL leading to the image to be used as a point marker. */ + url?: string; + /** Specifies the width of an image that is used as a point marker. */ + width?: number; + }; } /** An object that defines configuration options for chart series. */ export interface CommonSeriesConfig extends BaseCommonSeriesConfig { @@ -5091,17 +5091,17 @@ declare module DevExpress.viz.charts { text?: string; } export interface AxisLabel { - /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */ + /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */ customizeHint?: (argument: { value: any; valueText: string }) => string; - /** Specifies a callback function that returns the text to be displayed in value axis labels. */ + /** Specifies a callback function that returns the text to be displayed in value axis labels. */ customizeText?: (argument: { value: any; valueText: string }) => string; - /** Specifies a format for the text displayed by axis labels. */ + /** Specifies a format for the text displayed by axis labels. */ format?: string; - /** Specifies a precision for the formatted value displayed in the axis labels. */ + /** Specifies a precision for the formatted value displayed in the axis labels. */ precision?: number; } - export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel {} - export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel {} + export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } + export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } export interface AxisTitle extends CommonAxisTitle { /** Specifies the text for the value axis title. */ text?: string; @@ -5117,7 +5117,7 @@ declare module DevExpress.viz.charts { value?: any; } export interface PolarConstantLine extends PolarCommonConstantLineStyle { - /** An object defining constant line label options. */ + /** An object defining constant line label options. */ label?: PolarConstantLineLabel; /** Specifies a value to be displayed by a constant line. */ value?: any; @@ -5170,7 +5170,7 @@ declare module DevExpress.viz.charts { /** Specifies the elements that will be highlighted when the argument axis is hovered over. */ hoverMode?: string; } - export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis {} + export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { /** Specifies a start angle for the argument axis in degrees. */ startAngle?: number; @@ -5186,7 +5186,7 @@ declare module DevExpress.viz.charts { showZero?: boolean; /** Specifies the desired type of axis values. */ valueType?: string; - } + } export interface ChartValueAxis extends ChartAxis, ValueAxis { /** Specifies the spacing, in pixels, between multiple value axes in a chart. */ multipleAxesSpacing?: number; @@ -5385,7 +5385,7 @@ declare module DevExpress.viz.charts { /** Specifies whether a single series or multiple series can be selected in the chart. */ seriesSelectionMode?: string; /** Specifies how the chart must behave when series point labels overlap. */ - resolveLabelOverlapping?: string; + resolveLabelOverlapping?: string; } export interface Legend extends AdvancedLegend { /** Specifies whether the legend is located outside or inside the chart's plot. */ @@ -5580,7 +5580,7 @@ declare module DevExpress.viz.charts { onLegendClick?: any; legendClick?: any; /** Specifies how the chart must behave when series point labels overlap. */ - resolveLabelOverlapping?: string; + resolveLabelOverlapping?: string; } /** A circular chart widget for HTML JS applications. */ export class dxPieChart extends BaseChart { From e02dc634d68d6087f4c3c149cbf5cc5fed03e60d Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 21:10:37 +0900 Subject: [PATCH 094/259] adhoc fix js-data/js-data.d.ts and js-data-http/js-data-http-tests.ts --- js-data-http/js-data-http-tests.ts | 6 +++--- js-data/js-data.d.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js-data-http/js-data-http-tests.ts b/js-data-http/js-data-http-tests.ts index d7c07d654e..00457d7142 100644 --- a/js-data-http/js-data-http-tests.ts +++ b/js-data-http/js-data-http-tests.ts @@ -28,7 +28,7 @@ ADocument.inject({ id: 5, author: 'John' }); ADocument.inject({ id: 6, author: 'John' }); // bypass the data store -adapter.updateAll(ADocument, { author: 'Johnny' }, { author: 'John' }).then(function (documents) { +adapter.updateAll<{ id?: number; author: string; }>(ADocument, { author: 'Johnny' }, { author: 'John' }).then(function (documents) { documents[0]; // { id: 5, author: 'Johnny' } // The updated documents have NOT been injected into the data store because we bypassed the data store @@ -37,7 +37,7 @@ adapter.updateAll(ADocument, { author: 'Johnny' }, { author: 'John' }).then(func }); // Normally you would just go through the data store -ADocument.updateAll({ author: 'Johnny' }, { author: 'John' }).then(function (documents) { +ADocument.updateAll<{ id?: number; author: string; }>({ author: 'Johnny' }, { author: 'John' }).then(function (documents) { documents[0]; // { id: 5, author: 'Johnny' } // the updated documents have been injected into the data store @@ -164,4 +164,4 @@ ADocument.create({ author: 'John' }).then(function (document:any) { // the new document has been injected into the data store ADocument.get(document.id); // { id: 5, author: 'John' } -}); \ No newline at end of file +}); diff --git a/js-data/js-data.d.ts b/js-data/js-data.d.ts index e17c4ae0d4..604b70e6c4 100644 --- a/js-data/js-data.d.ts +++ b/js-data/js-data.d.ts @@ -153,7 +153,7 @@ declare module JSData { findAll(params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise>; loadRelations(idOrInstance:string | number | Object, relations:string | Array, options?:DSAdapterOperationConfiguration):JSDataPromise; update(id:string | number, attrs:Object, options?:DSSaveConfiguration):JSDataPromise; - updateAll(attrs:Object, params?:DSFilterParams, options?:DSAdapterOperationConfiguration):JSDataPromise>; + updateAll(attrs:Object, params?:DSFilterParams & T, options?:DSAdapterOperationConfiguration):JSDataPromise>; reap(resourceNametions?:DSConfiguration):JSDataPromise; refresh(id:string | number, options?:DSAdapterOperationConfiguration):JSDataPromise; save(id:string | number, options?:DSSaveConfiguration):JSDataPromise; @@ -283,7 +283,7 @@ declare module JSData { update(config:DSResourceDefinition, id:string | number, attrs:Object, options?:DSConfiguration):JSDataPromise; - updateAll(config:DSResourceDefinition, attrs:Object, params?:DSFilterParams, options?:DSConfiguration):JSDataPromise; + updateAll(config:DSResourceDefinition, attrs:Object, params?:DSFilterParams & T, options?:DSConfiguration):JSDataPromise; } } @@ -297,4 +297,4 @@ declare var JSData:{ declare module 'js-data' { export = JSData; -} \ No newline at end of file +} From 833252b73554e9d267c2987ffefe3b1fd15785e2 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 21:21:18 +0900 Subject: [PATCH 095/259] adhoc fix i18next/i18next.d.ts --- i18next/i18next.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/i18next/i18next.d.ts b/i18next/i18next.d.ts index feb6658c83..38d91b603e 100644 --- a/i18next/i18next.d.ts +++ b/i18next/i18next.d.ts @@ -19,6 +19,12 @@ interface IResourceStoreKey { interface I18nTranslateOptions extends I18nextOptions { defaultValue?: any; // normally a string + // NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590 + toAdd?: any; + child?: any; + sprintf?: any; + count?: any; + context?: any; } interface I18nextOptions { @@ -66,6 +72,9 @@ interface I18nextOptions { cookieName?: string; // Default value: 'i18next' postProcess?: string; // Default value: undefined + + // NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590 + replace?: any; } interface I18nextStatic { From d075fd542fd6dc5dec5222262c7f9ceb29cdd2ff Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 21:23:05 +0900 Subject: [PATCH 096/259] fix i18n-node/i18n-node.d.ts --- i18n-node/i18n-node.d.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/i18n-node/i18n-node.d.ts b/i18n-node/i18n-node.d.ts index 348c2f2689..79dda8b758 100644 --- a/i18n-node/i18n-node.d.ts +++ b/i18n-node/i18n-node.d.ts @@ -22,29 +22,34 @@ declare module i18n { */ directory?: string; - /** + /** * whether to write new locale information to disk * @default true */ updateFiles?: boolean; - /** + /** * What to use as the indentation unit * @default "\t" */ indent?: string; - /** + /** * Setting extension of json files (you might want to set this to '.js' according to webtranslateit) * @default ".json" */ extension?: string; - /** + /** * Enable object notation * @default false */ objectNotation?: boolean; + + /** + * json files prefix + */ + prefix?: string; } export interface TranslateOptions { phrase: string; From 134052c72d84e2d7e13264864cd5a4becf63c459 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 21:42:04 +0900 Subject: [PATCH 097/259] adhoc fix highcharts-ng/highcharts-ng-tests.ts and highcharts/highcharts.d.ts --- highcharts-ng/highcharts-ng-tests.ts | 2 +- highcharts-ng/highcharts-ng.d.ts | 6 +++--- highcharts/highcharts.d.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/highcharts-ng/highcharts-ng-tests.ts b/highcharts-ng/highcharts-ng-tests.ts index 5f05b33731..493d0f94ff 100644 --- a/highcharts-ng/highcharts-ng-tests.ts +++ b/highcharts-ng/highcharts-ng-tests.ts @@ -37,4 +37,4 @@ class AppController { } } -app.controller("AppController", AppController); \ No newline at end of file +app.controller("AppController", AppController); diff --git a/highcharts-ng/highcharts-ng.d.ts b/highcharts-ng/highcharts-ng.d.ts index d0a3405594..dd15fd4769 100644 --- a/highcharts-ng/highcharts-ng.d.ts +++ b/highcharts-ng/highcharts-ng.d.ts @@ -6,11 +6,11 @@ /// interface HighChartsNGConfig { - options: HighchartsChartOptions; + options: HighchartsOptions; //The below properties are watched separately for changes. //Series object (optional) - a list of series using normal highcharts series options. - series?: number[]|[number, number][]| HighchartsDataPoint[]; + series?: number[]|[number, number][]| HighchartsDataPoint[] | {data:number[];}[]; //Title configuration (optional) title?: { text?: string; @@ -40,4 +40,4 @@ interface HighChartsNGConfig { interface HighChartsNGChart extends HighChartsNGConfig { //This is a simple way to access all the Highcharts API that is not currently managed by this directive. getHighcharts(): HighchartsChartObject; -} \ No newline at end of file +} diff --git a/highcharts/highcharts.d.ts b/highcharts/highcharts.d.ts index 2341f87693..f654b97496 100644 --- a/highcharts/highcharts.d.ts +++ b/highcharts/highcharts.d.ts @@ -249,7 +249,7 @@ interface HighchartsCSSObject { fontWeight?: string; left?: string; opacity?: number; - padding?: string; + padding?: string | number; position?: string; top?: string; } From 3933f040ef054ea34531e756c7e7f31840afd38c Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 21:49:02 +0900 Subject: [PATCH 098/259] disable fhir/fhir-tests.ts X( --- fhir/{fhir-tests.ts => fhir-tests.disabled.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename fhir/{fhir-tests.ts => fhir-tests.disabled.ts} (100%) diff --git a/fhir/fhir-tests.ts b/fhir/fhir-tests.disabled.ts similarity index 100% rename from fhir/fhir-tests.ts rename to fhir/fhir-tests.disabled.ts From 43da925b57fc780c743d8e8f707fed1a122618de Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 21:53:46 +0900 Subject: [PATCH 099/259] adhoc fix devextreme/dx.devextreme.d.ts --- devextreme/dx.devextreme.d.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/devextreme/dx.devextreme.d.ts b/devextreme/dx.devextreme.d.ts index ac0639b0a5..00f2d340b5 100644 --- a/devextreme/dx.devextreme.d.ts +++ b/devextreme/dx.devextreme.d.ts @@ -1869,7 +1869,7 @@ declare module DevExpress.ui { /** A container widget used to arrange inner elements. */ export class dxBox extends CollectionWidget { constructor(element: JQuery, options?: dxBoxOptions); - constructor(element: Element, options?: dxBoxOptions); + constructor(element: Element, options?: dxBoxOptions); } export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { /** Specifies the collection of rows for the grid used to position layout elements. */ @@ -3041,7 +3041,7 @@ declare module DevExpress.ui { lookup?: { /** Specifies whether or not a user can nullify values of a lookup column. */ allowClearing?: boolean; - /** + /** * Specifies the data source providing data for a lookup column. */ dataSource?: any; @@ -3076,6 +3076,9 @@ declare module DevExpress.ui { showInColumnChooser?: boolean; /** Specifies the identifier of the column. */ name?: string; + // NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590 + text?: string; + value?: any; } export interface dxDataGridOptions extends WidgetOptions { /** Specifies whether the outer borders of the grid are visible or not. */ @@ -3171,7 +3174,7 @@ declare module DevExpress.ui { cancel?: string; } }; - /** + /** * An array of grid columns. */ columns?: dxDataGridColumn[]; @@ -3271,7 +3274,7 @@ declare module DevExpress.ui { autoExpandAll?: boolean; /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ groupContinuedMessage?: string; - /** + /** * Specifies the message displayed in a group row when the corresponding group continues on the next page. */ groupContinuesMessage?: string; @@ -3653,7 +3656,7 @@ declare module DevExpress.ui { removeRow(rowIndex: number): void; /** Saves changes made in a grid. */ saveEditData(): void; - /** + /** * Searches grid records by a search string. */ searchByText(text: string): void; @@ -5385,7 +5388,7 @@ declare module DevExpress.viz.charts { /** Specifies whether a single series or multiple series can be selected in the chart. */ seriesSelectionMode?: string; /** Specifies how the chart must behave when series point labels overlap. */ - resolveLabelOverlapping?: string; + resolveLabelOverlapping?: string; } export interface Legend extends AdvancedLegend { /** Specifies whether the legend is located outside or inside the chart's plot. */ @@ -5580,7 +5583,7 @@ declare module DevExpress.viz.charts { onLegendClick?: any; legendClick?: any; /** Specifies how the chart must behave when series point labels overlap. */ - resolveLabelOverlapping?: string; + resolveLabelOverlapping?: string; } /** A circular chart widget for HTML JS applications. */ export class dxPieChart extends BaseChart { @@ -5952,7 +5955,7 @@ declare module DevExpress.viz.rangeSelector { behavior?: { /** Indicates whether or not you can swap sliders. */ allowSlidersSwap?: boolean; - /** + /** Indicates whether or not animation is enabled. */ animationEnabled?: boolean; @@ -6067,7 +6070,7 @@ Indicates whether or not animation is enabled. maxRange?: any; /** Specifies the number of minor ticks between neighboring major ticks. */ minorTickCount?: number; - /** + /** Specifies an interval between minor ticks. */ minorTickInterval?: any; From 9960f3c35363fa05a35384a0303f307fcb442026 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 21:56:56 +0900 Subject: [PATCH 100/259] fix cheerio/cheerio-tests.ts --- cheerio/cheerio-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cheerio/cheerio-tests.ts b/cheerio/cheerio-tests.ts index c41939a301..2f7b9f9483 100644 --- a/cheerio/cheerio-tests.ts +++ b/cheerio/cheerio-tests.ts @@ -29,7 +29,7 @@ $ = cheerio.load(html, { normalizeWhitespace: true, xmlMode: true, decodeEntities: true, - lowercaseTags: true, + lowerCaseTags: true, lowerCaseAttributeNames: true, recognizeCDATA: true, recognizeSelfClosing: true From 6585641c803b29043ea32924601533a5c8a052df Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 22:05:33 +0900 Subject: [PATCH 101/259] adhoc fix breeze/breeze-tests.ts --- breeze/breeze-tests.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/breeze/breeze-tests.ts b/breeze/breeze-tests.ts index f309462afa..1f9c87dfa9 100644 --- a/breeze/breeze-tests.ts +++ b/breeze/breeze-tests.ts @@ -11,7 +11,7 @@ function test_dataType() { var x = typ.parentEnum === breeze.DataType; var isFalse = breeze.DataType.contains(breeze.DataType.Double); var dt = breeze.DataType.fromName("Decimal"); - + } function test_dataProperty() { @@ -33,7 +33,7 @@ function test_dataService() { var em = new breeze.EntityManager({ dataService: ds }); - + } function test_entityAspect() { @@ -69,7 +69,7 @@ function test_entityAspect() { var errorsAdded = validationChangeArgs.added; var errorsCleared = validationChangeArgs.removed; }); - + } function test_entityKey() { @@ -132,7 +132,7 @@ function test_entityManager() { serviceName: "breeze/NorthwindIBModel", metadataStore: metadataStore }); - + return new breeze.QueryOptions({ mergeStrategy: null, fetchStrategy: this.fetchStrategy @@ -157,7 +157,7 @@ function test_entityManager() { var cust2 = em1.createEntity("Customer", { companyName: "foo" }); var cust3 = em1.createEntity("foo", { xxx: 3 }, breeze.EntityState.Added); - + em1.attachEntity(cust1, breeze.EntityState.Added); em1.clear(); var em2 = em1.createEmptyCopy(); @@ -246,7 +246,7 @@ function test_entityManager() { var custType = em1.metadataStore.getEntityType("Customer"); var orderType = em1.metadataStore.getEntityType("Order"); if (em1.hasChanges([custType, orderType])) { }; - + var bundle = em1.exportEntities(); window.localStorage.setItem("myEntityManager", bundle); var bundleFromStorage = window.localStorage.getItem("myEntityManager"); @@ -434,7 +434,7 @@ function test_entityState() { return es === breeze.EntityState.Unchanged; var es = anEntity.entityAspect.entityState; return es.isUnchangedOrModified(); - + return es === breeze.EntityState.Unchanged || es === breeze.EntityState.Modified; } @@ -443,12 +443,14 @@ function test_entityType() { var myEntityType: breeze.EntityType; var dataProperty1: breeze.DataProperty, dataProperty2: breeze.DataProperty, navigationProperty1: breeze.DataProperty; var em1: breeze.EntityManager; + /* NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590 var entityManager = new breeze.EntityType({ metadataStore: myMetadataStore, serviceName: "breeze/NorthwindIBModel", name: "person", namespace: "myAppNamespace" }); + */ myEntityType.addProperty(dataProperty1); myEntityType.addProperty(dataProperty2); myEntityType.addProperty(navigationProperty1); @@ -759,9 +761,11 @@ function test_validator() { orderType = em1.metadataStore.getEntityType("Order"); var orderDateProperty = orderType.getProperty("OrderDate"); orderDateProperty.validators.push(breeze.Validator.date()); + /* NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590 var v0 = breeze.Validator.maxLength({ maxLength: 5, displayName: "City" }); v0.validate("adasdfasdf"); var errMessage = v0.getMessage(); + */ custType = em1.metadataStore.getEntityType("Customer"); var customerIdProperty = custType.getProperty("CustomerID"); customerIdProperty.validators.push(breeze.Validator.guid()); @@ -788,6 +792,7 @@ function test_validator() { regionProperty.validators.push(breeze.Validator.string()); custType = em1.metadataStore.getEntityType("Customer"); regionProperty = custType.getProperty("Region"); + /* NOTE https://github.com/borisyankov/DefinitelyTyped/pull/5590 regionProperty.validators.push(breeze.Validator.stringLength({ minLength: 2, maxLength: 5 })); var validator = breeze.Validator.maxLength({ maxLength: 5, displayName: "City" }); var result = validator.validate("asdf"); @@ -796,6 +801,7 @@ function test_validator() { var errMsg = result.errorMessage; var context = result.context; var sameValidator = result.validator; + */ var valFn = function (v: any) { if (v == null) return true; return (v.substr(0,2) === "US"); From 9c6b48468edc9e74e1e2c438278677a30bf56cc5 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 3 Sep 2015 22:11:19 +0900 Subject: [PATCH 102/259] adhoc fix angular2/angular2.d.ts --- angular2/angular2-tests.ts.tscparams | 2 +- angular2/angular2.d.ts | 2846 +++++++++++++------------- 2 files changed, 1425 insertions(+), 1423 deletions(-) diff --git a/angular2/angular2-tests.ts.tscparams b/angular2/angular2-tests.ts.tscparams index cfedaf1984..3f0863ac67 100644 --- a/angular2/angular2-tests.ts.tscparams +++ b/angular2/angular2-tests.ts.tscparams @@ -1 +1 @@ ---experimentalDecorators --target ES5 \ No newline at end of file +--experimentalDecorators --noImplicitAny --target ES5 diff --git a/angular2/angular2.d.ts b/angular2/angular2.d.ts index 0c7b8609ef..15d7f14615 100644 --- a/angular2/angular2.d.ts +++ b/angular2/angular2.d.ts @@ -41,23 +41,23 @@ declare module ng { /** * Declare reusable UI building blocks for an application. - * + * * Each Angular component requires a single `@Component` and at least one `@View` annotation. The * `@Component` * annotation specifies when a component is instantiated, and which properties and hostListeners it * binds to. - * + * * When a component is instantiated, Angular * - creates a shadow DOM for the component. * - loads the selected template into the shadow DOM. * - creates all the injectable objects configured with `bindings` and `viewBindings`. - * + * * All template expressions and statements are then evaluated against the component instance. - * + * * For details on the `@View` annotation, see {@link ViewMetadata}. - * + * * ## Example - * + * * ``` * @Component({ * selector: 'greet' @@ -67,7 +67,7 @@ declare module ng { * }) * class Greet { * name: string; - * + * * constructor() { * this.name = 'World'; * } @@ -75,47 +75,47 @@ declare module ng { * ``` */ class ComponentMetadata extends DirectiveMetadata { - + /** * Defines the used change detection strategy. - * + * * When a component is instantiated, Angular creates a change detector, which is responsible for * propagating * the component's bindings. - * + * * The `changeDetection` property defines, whether the change detection will be checked every time * or only when the component * tells it to do so. */ changeDetection: string; - + /** * Defines the set of injectable objects that are visible to its view dom children. - * + * * ## Simple Example - * + * * Here is an example of a class that can be injected: - * + * * ``` * class Greeter { * greet(name:string) { * return 'Hello ' + name + '!'; * } * } - * + * * @Directive({ * selector: 'needs-greeter' * }) * class NeedsGreeter { * greeter:Greeter; - * + * * constructor(greeter:Greeter) { * this.greeter = greeter; * } * } - * + * * @Component({ * selector: 'greet', * viewBindings: [ @@ -128,30 +128,30 @@ declare module ng { * }) * class HelloWorld { * } - * + * * ``` */ viewBindings: List; } - + /** * Directives allow you to attach behavior to elements in the DOM. - * + * * {@link DirectiveMetadata}s with an embedded view are called {@link ComponentMetadata}s. - * + * * A directive consists of a single directive annotation and a controller class. When the * directive's `selector` matches * elements in the DOM, the following steps occur: - * + * * 1. For each directive, the `ElementInjector` attempts to resolve the directive's constructor * arguments. * 2. Angular instantiates directives for each matched element using `ElementInjector` in a * depth-first order, * as declared in the HTML. - * + * * ## Understanding How Injection Works - * + * * There are three stages of injection resolution. * - *Pre-existing Injectors*: * - The terminal {@link Injector} cannot resolve dependencies. It either throws an error or, if @@ -165,24 +165,24 @@ declare module ng { * - *Element Injectors*: Each component instance has a Shadow DOM. Within the Shadow DOM each * element has an `ElementInjector` * which follow the same parent-child hierarchy as the DOM elements themselves. - * + * * When a template is instantiated, it also must instantiate the corresponding directives in a * depth-first order. The * current `ElementInjector` resolves the constructor dependencies for each directive. - * + * * Angular then resolves dependencies as follows, according to the order in which they appear in the * {@link ViewMetadata}: - * + * * 1. Dependencies on the current element * 2. Dependencies on element injectors and their parents until it encounters a Shadow DOM boundary * 3. Dependencies on component injectors and their parents until it encounters the root component * 4. Dependencies on pre-existing injectors - * - * + * + * * The `ElementInjector` can inject other directives, element-specific special objects, or it can * delegate to the parent * injector. - * + * * To inject other directives, declare the constructor parameter as: * - `directive:DirectiveType`: a directive on the current element only * - `@Host() directive:DirectiveType`: any directive that matches the type between the current @@ -192,21 +192,21 @@ declare module ng { * directives. * - `@QueryDescendants(DirectiveType) query:QueryList`: A live collection of any * child directives. - * + * * To inject element-specific special objects, declare the constructor parameter as: * - `element: ElementRef` to obtain a reference to logical element in the view. * - `viewContainer: ViewContainerRef` to control child template instantiation, for * {@link DirectiveMetadata} directives only * - `bindingPropagation: BindingPropagation` to control change detection in a more granular way. - * + * * ## Example - * + * * The following example demonstrates how dependency injection resolves constructor arguments in * practice. - * - * + * + * * Assume this HTML template: - * + * * ``` *
*
@@ -219,14 +219,14 @@ declare module ng { *
*
* ``` - * + * * With the following `dependency` decorator and `SomeService` injectable class. - * + * * ``` * @Injectable() * class SomeService { * } - * + * * @Directive({ * selector: '[dependency]', * properties: [ @@ -237,15 +237,15 @@ declare module ng { * id:string; * } * ``` - * + * * Let's step through the different ways in which `MyDirective` could be declared... - * - * + * + * * ### No injection - * + * * Here the constructor is declared with no arguments, therefore nothing is injected into * `MyDirective`. - * + * * ``` * @Directive({ selector: '[my-directive]' }) * class MyDirective { @@ -253,15 +253,15 @@ declare module ng { * } * } * ``` - * + * * This directive would be instantiated with no dependencies. - * - * + * + * * ### Component-level injection - * + * * Directives can inject any injectable instance from the closest component injector or any of its * parents. - * + * * Here, the constructor declares a parameter, `someService`, and injects the `SomeService` type * from the parent * component's injector. @@ -272,14 +272,14 @@ declare module ng { * } * } * ``` - * + * * This directive would be instantiated with a dependency on `SomeService`. - * - * + * + * * ### Injecting a directive from the current element - * + * * Directives can inject other directives declared on the current element. - * + * * ``` * @Directive({ selector: '[my-directive]' }) * class MyDirective { @@ -290,9 +290,9 @@ declare module ng { * ``` * This directive would be instantiated with `Dependency` declared at the same element, in this case * `dependency="3"`. - * + * * ### Injecting a directive from any ancestor elements - * + * * Directives can inject other directives declared on any ancestor element (in the current Shadow * DOM), i.e. on the current element, the * parent element, or its parents. @@ -304,23 +304,23 @@ declare module ng { * } * } * ``` - * + * * `@Host` checks the current element, the parent, as well as its parents recursively. If * `dependency="2"` didn't * exist on the direct parent, this injection would * have returned * `dependency="1"`. - * - * + * + * * ### Injecting a live collection of direct child directives - * - * + * + * * A directive can also query for other child directives. Since parent directives are instantiated * before child directives, a directive can't simply inject the list of child directives. Instead, * the directive injects a {@link QueryList}, which updates its contents as children are added, * removed, or moved by a directive that uses a {@link ViewContainerRef} such as a `ng-for`, an * `ng-if`, or an `ng-switch`. - * + * * ``` * @Directive({ selector: '[my-directive]' }) * class MyDirective { @@ -328,15 +328,15 @@ declare module ng { * } * } * ``` - * + * * This directive would be instantiated with a {@link QueryList} which contains `Dependency` 4 and * 6. Here, `Dependency` 5 would not be included, because it is not a direct child. - * + * * ### Injecting a live collection of descendant directives - * + * * By passing the descendant flag to `@Query` above, we can include the children of the child * elements. - * + * * ``` * @Directive({ selector: '[my-directive]' }) * class MyDirective { @@ -344,18 +344,18 @@ declare module ng { * } * } * ``` - * + * * This directive would be instantiated with a Query which would contain `Dependency` 4, 5 and 6. - * + * * ### Optional injection - * + * * The normal behavior of directives is to return an error when a specified dependency cannot be * resolved. If you * would like to inject `null` on unresolved dependency instead, you can annotate that dependency * with `@Optional()`. * This explicitly permits the author of a template to treat some of the surrounding directives as * optional. - * + * * ``` * @Directive({ selector: '[my-directive]' }) * class MyDirective { @@ -363,15 +363,15 @@ declare module ng { * } * } * ``` - * + * * This directive would be instantiated with a `Dependency` directive found on the current element. * If none can be * found, the injector supplies `null` instead of throwing an error. - * + * * ## Example - * + * * Here we use a decorator directive to simply define basic tool-tip behavior. - * + * * ``` * @Directive({ * selector: '[tooltip]', @@ -387,16 +387,16 @@ declare module ng { * text:string; * overlay:Overlay; // NOT YET IMPLEMENTED * overlayManager:OverlayManager; // NOT YET IMPLEMENTED - * + * * constructor(overlayManager:OverlayManager) { * this.overlay = overlay; * } - * + * * onMouseEnter() { * // exact signature to be determined * this.overlay = this.overlayManager.open(text, ...); * } - * + * * onMouseLeave() { * this.overlay.close(); * this.overlay = null; @@ -406,39 +406,39 @@ declare module ng { * In our HTML template, we can then add this behavior to a `
` or any other element with the * `tooltip` selector, * like so: - * + * * ``` *
* ``` - * + * * Directives can also control the instantiation, destruction, and positioning of inline template * elements: - * + * * A directive uses a {@link ViewContainerRef} to instantiate, insert, move, and destroy views at * runtime. * The {@link ViewContainerRef} is created as a result of `