From 2b89a26bb0978ef4faa8b7eb75ba8abeb63471f0 Mon Sep 17 00:00:00 2001 From: Ben Ripkens Date: Wed, 3 Dec 2014 16:57:08 +0100 Subject: [PATCH 01/22] d3: Transition.call(...) defines wrong signature The D3 definition file contains an error in the signature of Transition.call(...). The callback will be passed the transition object and it supports optional arguments similar to Selection.call(...). --- d3/d3.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 2f439a76f..8ae0c6a7f 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -926,7 +926,7 @@ declare module D3 { (name: string, value: any, priority?: string): Transition; (name: string, valueFunction: (data: any, index: number) => any, priority?: string): Transition; }; - call(callback: (selection: Selection) => void ): Transition; + call(callback: (transition: Transition, ...args: any[]) => void, ...args: any[]): Transition; /** * Select an element from the current document */ From 09b31dbffbe57d523001496aa5e8f43b67db7862 Mon Sep 17 00:00:00 2001 From: Ben Ripkens Date: Wed, 3 Dec 2014 18:45:35 +0100 Subject: [PATCH 02/22] An axis can be applied to transitions This is documented in the D3 API documentation: https://github.com/mbostock/d3/wiki/SVG-Axes#_axis --- d3/d3.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 8ae0c6a7f..15b1375f3 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -1750,6 +1750,8 @@ declare module D3 { export interface Axis { (selection: Selection): void; + (transition: Transition.Transition): void; + scale: { (): any; (scale: any): Axis; From 7c55442aa27d67d58f09810966e7fa3dacff7d69 Mon Sep 17 00:00:00 2001 From: Daniel Heim Date: Thu, 4 Dec 2014 22:33:56 +1100 Subject: [PATCH 03/22] Updated initialize methods. Added initialize methods to View and Collection. Updated initialize method in Model. --- backbone/backbone.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index 8e2637604..0cb827a28 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -109,7 +109,7 @@ declare module Backbone { urlRoot: any; constructor(attributes?: any, options?: any); - initialize(attributes?: any): void; + initialize(attributes?: any, options?: any): void; fetch(options?: ModelFetchOptions): JQueryXHR; @@ -176,6 +176,7 @@ declare module Backbone { length: number; constructor(models?: TModel[], options?: any); + initialize(models?: TModel[], options?: any): void; fetch(options?: CollectionFetchOptions): JQueryXHR; @@ -328,6 +329,7 @@ declare module Backbone { private static extend(properties: any, classProperties?: any): any; constructor(options?: ViewOptions); + initialize(options?: ViewOptions): void; /** * Events hash or a method returning the events hash that maps events/selectors to methods on your View. From 9f813f026554768bb2014cb8e1567482be7fb2f2 Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Fri, 5 Dec 2014 10:59:31 +0100 Subject: [PATCH 04/22] Bugfix: mysql.query.stream returns a stream.Readable. --- mysql/mysql-tests.ts | 7 +++++- mysql/mysql.d.ts | 58 +++++++++++++++++++------------------------- 2 files changed, 31 insertions(+), 34 deletions(-) diff --git a/mysql/mysql-tests.ts b/mysql/mysql-tests.ts index 83fdeb06a..f671a6372 100644 --- a/mysql/mysql-tests.ts +++ b/mysql/mysql-tests.ts @@ -1,6 +1,8 @@ /// +import fs = require('fs'); import mysql = require('mysql'); +import stream = require('stream'); /// Connections var connection = mysql.createConnection({ @@ -119,6 +121,8 @@ connection.config.queryFormat = function (query, values) { connection.query("UPDATE posts SET title = :title", { title: "Hello MySQL" }); +var s: stream.Readable = connection.query("UPDATE posts SET title = :title", { title: "Hello MySQL" }).stream({ highWaterMark: 5 }); + connection.query('INSERT INTO posts SET ?', { title: 'test' }, function (err, result) { if (err) throw err; @@ -243,9 +247,10 @@ query // all rows have been received }); +var writable = fs.createWriteStream('file.txt'); connection.query('SELECT * FROM posts') .stream({ highWaterMark: 5 }) - .pipe(() => { }); + .pipe(writable); connection = mysql.createConnection({ multipleStatements: true }); diff --git a/mysql/mysql.d.ts b/mysql/mysql.d.ts index 479b05266..6299abb67 100644 --- a/mysql/mysql.d.ts +++ b/mysql/mysql.d.ts @@ -3,29 +3,27 @@ // Definitions by: William Johnston // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module mysql { - export interface IMySql { - createConnection(connectionUri: string): IConnection; - createConnection(config: IConnectionConfig): IConnection; +/// - createPool(config: IPoolConfig): IPool; +declare module "mysql" { + import stream = require("stream"); - createPoolCluster(config?: IPoolClusterConfig): IPoolCluster; + function createConnection(connectionUri: string): IConnection; + function createConnection(config: IConnectionConfig): IConnection; + function createPool(config: IPoolConfig): IPool; + function createPoolCluster(config?: IPoolClusterConfig): IPoolCluster; + function escape(value: any): string; + function format(sql: string): string; + function format(sql: string, values: Array): string; - escape(value: any): string; - - format(sql: string): string; - format(sql: string, values: Array): string; - } - - export interface IConnectionStatic { + interface IConnectionStatic { createQuery(sql: string): IQuery; createQuery(sql: string, callback: (err: IError, ...args: any[]) => void): IQuery; createQuery(sql: string, values: Array): IQuery; createQuery(sql: string, values: Array, callback: (err: IError, ...args: any[]) => void): IQuery; } - export interface IConnection { + interface IConnection { config: IConnectionConfig; threadId: number; @@ -68,7 +66,7 @@ declare module mysql { rollback(callback: () => void): void; } - export interface IPool { + interface IPool { config: IPoolConfig; getConnection(callback: (err: IError, connection: IConnection) => void): void; @@ -80,7 +78,7 @@ declare module mysql { on(ev: 'error', callback: (err: IError) => void): IPool; } - export interface IPoolCluster { + interface IPoolCluster { config: IPoolClusterConfig; add(config: IPoolConfig): void; @@ -101,7 +99,7 @@ declare module mysql { on(ev: 'error', callback: (err: IError) => void): IPoolCluster; } - export interface IQuery { + interface IQuery { /** * The SQL for a constructed query */ @@ -125,7 +123,7 @@ declare module mysql { * * @param options The options for the stream. */ - stream(options: IStreamOptions): IQuery; + stream(options: IStreamOptions): stream.Readable; /** * Pipes a stream downstream, providing automatic pause/resume based on the @@ -142,7 +140,7 @@ declare module mysql { on(ev: 'end', callback: () => void): IQuery; } - export interface IQueryFunction { + interface IQueryFunction { (sql: string): IQuery; (sql: string, callback: (err: IError, ...args: any[]) => void): IQuery; (sql: string, values: Array): IQuery; @@ -157,7 +155,7 @@ declare module mysql { (options: IQueryOptions, values: any, callback: (err: IError, ...args: any[]) => void): IQuery; } - export interface IQueryOptions { + interface IQueryOptions { /** * The SQL for the query */ @@ -200,7 +198,7 @@ declare module mysql { typeCast?: any; } - export interface IStreamOptions { + interface IStreamOptions { /** * Sets the max buffer size in objects of a stream */ @@ -212,7 +210,7 @@ declare module mysql { objectMode?: any; } - export interface IConnectionOptions { + interface IConnectionOptions { /** * The MySQL user to authenticate as */ @@ -236,7 +234,7 @@ declare module mysql { charset?: string; } - export interface IConnectionConfig extends IConnectionOptions { + interface IConnectionConfig extends IConnectionOptions { /** * The hostname of the database you are connecting to. (Default: localhost) */ @@ -356,7 +354,7 @@ declare module mysql { ssl?: any; } - export interface IPoolConfig extends IConnectionConfig { + interface IPoolConfig extends IConnectionConfig { /** * The milliseconds before a timeout occurs during the connection acquisition. This is slightly different from connectTimeout, * because acquiring a pool connection does not always involve making a connection. (Default: 10 seconds) @@ -382,7 +380,7 @@ declare module mysql { queueLimit?: number; } - export interface IPoolClusterConfig { + interface IPoolClusterConfig { /** * If true, PoolCluster will attempt to reconnect when connection fails. (Default: true) */ @@ -403,7 +401,7 @@ declare module mysql { defaultSelector?: string; } - export interface ISslCredentials { + interface ISslCredentials { /** * A string or buffer holding the PFX or PKCS12 encoded private key, certificate and CA certificates */ @@ -440,7 +438,7 @@ declare module mysql { ciphers?: string; } - export interface IError extends Error { + interface IError extends Error { /** * Either a MySQL server error (e.g. 'ER_ACCESS_DENIED_ERROR'), * a node.js error (e.g. 'ECONNREFUSED') or an internal error @@ -479,9 +477,3 @@ declare module mysql { fatal: boolean; } } - -declare module 'mysql' { - var mysql: mysql.IMySql; - - export = mysql; -} From 7b222d2d6079a151fcb92a40cc3bb672510c267f Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Fri, 5 Dec 2014 11:46:08 +0100 Subject: [PATCH 05/22] Fix problem in express-myconnection as result of changes. --- mysql/mysql.d.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mysql/mysql.d.ts b/mysql/mysql.d.ts index 6299abb67..4c701b931 100644 --- a/mysql/mysql.d.ts +++ b/mysql/mysql.d.ts @@ -8,14 +8,24 @@ declare module "mysql" { import stream = require("stream"); - function createConnection(connectionUri: string): IConnection; - function createConnection(config: IConnectionConfig): IConnection; + function createConnection(connectionUri: string): IConnection; + function createConnection(config: IConnectionConfig): IConnection; function createPool(config: IPoolConfig): IPool; function createPoolCluster(config?: IPoolClusterConfig): IPoolCluster; function escape(value: any): string; function format(sql: string): string; function format(sql: string, values: Array): string; + interface IMySql { + createConnection(connectionUri: string): IConnection; + createConnection(config: IConnectionConfig): IConnection; + createPool(config: IPoolConfig): IPool; + createPoolCluster(config?: IPoolClusterConfig): IPoolCluster; + escape(value: any): string; + format(sql: string): string; + format(sql: string, values: Array): string; + } + interface IConnectionStatic { createQuery(sql: string): IQuery; createQuery(sql: string, callback: (err: IError, ...args: any[]) => void): IQuery; @@ -477,3 +487,4 @@ declare module "mysql" { fatal: boolean; } } + From b353038db391d6973946ea5def8b6054ff487e09 Mon Sep 17 00:00:00 2001 From: Panu Horsmalahti Date: Mon, 8 Dec 2014 12:02:25 +0200 Subject: [PATCH 06/22] Add .on() function to zeromq and a test for it. --- node_zeromq/zmq-tests.ts | 4 ++++ node_zeromq/zmq.d.ts | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/node_zeromq/zmq-tests.ts b/node_zeromq/zmq-tests.ts index bb97fd2ca..ed0e8a521 100644 --- a/node_zeromq/zmq-tests.ts +++ b/node_zeromq/zmq-tests.ts @@ -1,4 +1,5 @@ /// +/// import zmq = require('zmq'); @@ -18,6 +19,9 @@ function test3() { var sock = zmq.socket('push'); sock.bindSync('tcp://127.0.0.1:3000'); sock.send(['hello', 'world']); + sock.on('message', function (buffer: Buffer) { + // + }); } function test4() { diff --git a/node_zeromq/zmq.d.ts b/node_zeromq/zmq.d.ts index 7e81dd217..8911fa62f 100644 --- a/node_zeromq/zmq.d.ts +++ b/node_zeromq/zmq.d.ts @@ -3,6 +3,8 @@ // Definitions by: Dave McKeown // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + interface EventEmitter {} declare module 'zmq' { @@ -150,6 +152,13 @@ declare module 'zmq' { */ close(): Socket; + /** + * Socket event + * @param eventName {string} + * @param callback {Function} + */ + on(eventName: string, callback: (buffer: Buffer) => void): void; + // Socket Options _fd: any; _ioevents: any; From 5c48aedd1af8c48b301efeb71acedfd230229a4e Mon Sep 17 00:00:00 2001 From: yutopp Date: Tue, 9 Dec 2014 12:44:26 +0900 Subject: [PATCH 07/22] change type of THREE.Quaternion.setFromUnitVectors I think the parameter type should be Vector3. [ref](https://github.com/mrdoob/three.js/blob/master/src/math/Quaternion.js#L257) [ref](http://threejs.org/docs/#Reference/Math/Quaternion) --- threejs/three.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/threejs/three.d.ts b/threejs/three.d.ts index b1660aa7e..39d65da6c 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -3189,7 +3189,7 @@ declare module THREE { * Sets this quaternion from rotation component of m. Adapted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm. */ setFromRotationMatrix(m: Matrix4): Quaternion; - setFromUnitVectors(vFrom: Vector3, vTo: Vector4): Quaternion; + setFromUnitVectors(vFrom: Vector3, vTo: Vector3): Quaternion; /** * Inverts this quaternion. */ From 1c110fcbef3ebd4f12a2bdb1b933faa4b7adf786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommi=20Palom=C3=A4ki?= Date: Tue, 9 Dec 2014 11:08:10 +0000 Subject: [PATCH 08/22] SocketIOClient.Socket.off() arguments are optional --- socket.io-client/socket.io-client.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socket.io-client/socket.io-client.d.ts b/socket.io-client/socket.io-client.d.ts index a3882bbd7..205fb9e9b 100644 --- a/socket.io-client/socket.io-client.d.ts +++ b/socket.io-client/socket.io-client.d.ts @@ -23,7 +23,7 @@ declare module SocketIOClient { interface Socket { on(event: string, fn: Function): Socket; once(event: string, fn: Function): Socket; - off(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; From 8152ee4a973869da2ed2f58b25ff0ed254a3b59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommi=20Palom=C3=A4ki?= Date: Tue, 9 Dec 2014 11:46:29 +0000 Subject: [PATCH 09/22] SocketIOClient.Socket was missing connected property --- socket.io-client/socket.io-client.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/socket.io-client/socket.io-client.d.ts b/socket.io-client/socket.io-client.d.ts index 205fb9e9b..c5d783764 100644 --- a/socket.io-client/socket.io-client.d.ts +++ b/socket.io-client/socket.io-client.d.ts @@ -27,6 +27,7 @@ declare module SocketIOClient { emit(event: string, ...args: any[]): Socket; listeners(event: string): Function[]; hasListeners(event: string): boolean; + connected: boolean; } interface ManagerStatic { From 20fdc302a2f623b242d503618c5e0ac1e2706156 Mon Sep 17 00:00:00 2001 From: Panu Horsmalahti Date: Wed, 10 Dec 2014 13:55:34 +0200 Subject: [PATCH 10/22] Add monitor function interface to node_zeromq --- node_zeromq/zmq-tests.ts | 4 +++- node_zeromq/zmq.d.ts | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/node_zeromq/zmq-tests.ts b/node_zeromq/zmq-tests.ts index bb97fd2ca..a982c60d4 100644 --- a/node_zeromq/zmq-tests.ts +++ b/node_zeromq/zmq-tests.ts @@ -32,4 +32,6 @@ function test5() { sock.bind('tcp://127.0.0.1', err => { sock.send("some work"); }); -} \ No newline at end of file + sock.monitor(); + sock.monitor(10); +} diff --git a/node_zeromq/zmq.d.ts b/node_zeromq/zmq.d.ts index 7e81dd217..8df3ee8c6 100644 --- a/node_zeromq/zmq.d.ts +++ b/node_zeromq/zmq.d.ts @@ -144,6 +144,14 @@ declare module 'zmq' { */ send(msg: any[], flags?: number): Socket; + /** + * Enable monitoring of a Socket + * + * @param {Number} timer interval in ms > 0 or Undefined for default + * @return {Socket} for chaining + */ + monitor(interval?: number): Socket; + /** * Close the socket. * @@ -181,5 +189,4 @@ declare module 'zmq' { function socket(type: number, options?: any): Socket; function createSocket(type: string, options?: any): Socket; - -} \ No newline at end of file +} From d162fc7d9ea5ce7c614d090b6d0c5b136bd89e97 Mon Sep 17 00:00:00 2001 From: Jiawei Li Date: Wed, 10 Dec 2014 20:08:11 -0800 Subject: [PATCH 11/22] marionette: Layout => LayoutView typo --- marionette/marionette.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/marionette/marionette.d.ts b/marionette/marionette.d.ts index 719b3012b..730ba4880 100644 --- a/marionette/marionette.d.ts +++ b/marionette/marionette.d.ts @@ -281,13 +281,13 @@ declare module Marionette { renderModel(): any; } - class Layout extends ItemView { + class LayoutView extends ItemView { constructor(options?: any); addRegion(name: string, definition: any): Region; addRegions(regions: any): any; - render(): Layout; + render(): LayoutView; removeRegion(name: string); } From 10f66a1285418ce3f3742b32b6ce23d93a475e64 Mon Sep 17 00:00:00 2001 From: Steve Ognibene Date: Wed, 10 Dec 2014 23:14:37 -0500 Subject: [PATCH 12/22] Add support for new call in big.js v3.0.0 --- big.js/big.js-tests.ts | 17 +++++++++++++++++ big.js/big.js.d.ts | 3 +++ 2 files changed, 20 insertions(+) diff --git a/big.js/big.js-tests.ts b/big.js/big.js-tests.ts index 6de9ee7cc..df6128314 100644 --- a/big.js/big.js-tests.ts +++ b/big.js/big.js-tests.ts @@ -230,4 +230,21 @@ function propertiesTest3() { y.c // '0' [0].toString() y.e // 0 y.s // -1 +} + +// see http://mikemcl.github.io/big.js/#faq +// "How can I simultaneously use different decimal places and/or rounding mode settings for different Big numbers?" +function testMultipleConstructors() { + + var Big10 = Big(); + + // Set the decimal places of division operations for each constructor. + Big.DP = 3; + Big10.DP = 10; + + var x = Big(5); + var y = Big10(5); + + x.div(3) // 1.667 + y.div(3) // 1.6666666667 } \ No newline at end of file diff --git a/big.js/big.js.d.ts b/big.js/big.js.d.ts index 4f6278a80..0e4ac48be 100644 --- a/big.js/big.js.d.ts +++ b/big.js/big.js.d.ts @@ -42,6 +42,9 @@ declare module BigJsLibrary { (value: string): BigJS; /** A decimal value. */ (value: BigJS): BigJS; + + /** A decimal value. */ + (): BigJS; } /** BigJS instance methods */ From 9f572e72fbc6392f5bfdc879c74c5890e0f08037 Mon Sep 17 00:00:00 2001 From: Toshiya Nakakura Date: Thu, 11 Dec 2014 19:51:28 +0900 Subject: [PATCH 13/22] add sharedworker/SharedWorker.d.ts --- sharedworker/SharedWorker-tests.ts | 9 +++++++++ sharedworker/SharedWorker.d.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 sharedworker/SharedWorker-tests.ts create mode 100644 sharedworker/SharedWorker.d.ts diff --git a/sharedworker/SharedWorker-tests.ts b/sharedworker/SharedWorker-tests.ts new file mode 100644 index 000000000..853daa6b2 --- /dev/null +++ b/sharedworker/SharedWorker-tests.ts @@ -0,0 +1,9 @@ +/// + +var worker_with_name = new SharedWorker('worker.js', "worker"); + +var worker = new SharedWorker('worker.js'); + +worker.port.onmessage = function(e) { + console.log(e); +}; diff --git a/sharedworker/SharedWorker.d.ts b/sharedworker/SharedWorker.d.ts new file mode 100644 index 000000000..b106d1342 --- /dev/null +++ b/sharedworker/SharedWorker.d.ts @@ -0,0 +1,29 @@ +// Type definitions for SharedWorker +// Project: http://www.w3.org/TR/workers/ +// Definitions by: Toshiya Nakakura +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module SharedWorker { + interface AbstractWorker extends EventTarget { + onerror: (ev: ErrorEvent) => any; + } + + export interface SharedWorker extends AbstractWorker { + /** + * the value it was assigned by the object's constructor. + * It represents the MessagePort for communicating with the shared worker. + * @type {MessagePort} + */ + port: MessagePort; + } +} + +declare var SharedWorker: { + prototype: SharedWorker.SharedWorker; + /*** + * + * @param {string} stringUrl Pathname to JavaScript file + * @param {string} name Name of the worker to execute + */ + new (stringUrl: string, name?: string): SharedWorker.SharedWorker; +}; From bc24569b1c2a7d44dd0ff67b4ba480ad40300225 Mon Sep 17 00:00:00 2001 From: kubosho Date: Thu, 11 Dec 2014 21:46:00 +0900 Subject: [PATCH 14/22] Fix parameter type (when -> when?) --- CONTRIBUTORS.md | 2 +- webaudioapi/waa-tests.ts | 13 +++++++++++-- webaudioapi/waa.d.ts | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index becc0e9b3..8f69142ff 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -656,7 +656,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](vinyl-fs/vinyl-fs.d.ts) [vinyl-fs](https://github.com/wearefractal/vinyl-fs) by [vvakame](https://github.com/vvakame) * [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved) -* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net) +* [:link:](webaudioapi/waa.d.ts) [Web Audio API](http://www.w3.org/TR/webaudio) by [Baruch Berger](https://github.com/bbss), [Kon](http://phyzkit.net), [kubosho](https://github.com/kubosho) * [:link:](webaudioapi/waa-nightly.d.ts) [Web Audio API (nightly)](http://www.w3.org/TR/2012/WD-webaudio-20120802) by [Baruch Berger](https://github.com/bbss) * [:link:](webmidi/webmidi.d.ts) [Web MIDI API](http://www.w3.org/TR/webmidi) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](devextreme/dx.webappjs.d.ts) [WebAppJS](http://js.devexpress.com/WebDevelopment) by [DevExpress Inc.](http://devexpress.com) diff --git a/webaudioapi/waa-tests.ts b/webaudioapi/waa-tests.ts index 20e49f8ea..91c611463 100644 --- a/webaudioapi/waa-tests.ts +++ b/webaudioapi/waa-tests.ts @@ -81,11 +81,20 @@ declare var footstepsBuffer: any; panner.connect(wet3); dry3.connect(masterDry); wet3.connect(reverb); - + // Start the sources now. source1.start(0); - source2.start(0); + // MEMO: should be when parameter is 0 + // http://www.w3.org/TR/webaudio/#AudioBufferSourceNode + source2.start(); source3.start(0); + + // Stop the sources are 2 seconds later. + source1.stop(2); + // MEMO: should be when parameter is 0 + // http://www.w3.org/TR/webaudio/#AudioBufferSourceNode + source2.stop(); + source3.stop(2); }; ()=>{ diff --git a/webaudioapi/waa.d.ts b/webaudioapi/waa.d.ts index 43aa8c4ea..d6960bbb3 100644 --- a/webaudioapi/waa.d.ts +++ b/webaudioapi/waa.d.ts @@ -1,6 +1,6 @@ // Type definitions for Web Audio API // Project: http://www.w3.org/TR/webaudio/ -// Definitions by: Baruch Berger , Kon +// Definitions by: Baruch Berger , Kon , kubosho // Definitions: https://github.com/borisyankov/DefinitelyTyped /** @@ -545,14 +545,14 @@ interface AudioBufferSourceNode extends AudioSourceNode { * @param offset the offset time in the buffer (in seconds) where playback will begin. This parameter is optional with a default value of 0 (playing back from the beginning of the buffer). * @param duration the duration of the portion (in seconds) to be played. This parameter is optional, with the default value equal to the total duration of the AudioBuffer minus the offset parameter. Thus if neither offset nor duration are specified then the implied duration is the total duration of the AudioBuffer. */ - start(when: number, offset?: number, duration?: number): void; + start(when?: number, offset?: number, duration?: number): void; /** * Schedules a sound to stop playback at an exact time. Please see deprecation section for the old method name. * * The when parameter describes at what time (in seconds) the sound should stop playing. It is in the same time coordinate system as AudioContext.currentTime. If 0 is passed in for this value or if the value is less than currentTime, then the sound will stop playing immediately. stop must only be called one time and only after a call to start or stop, or an exception will be thrown. */ - stop(when: number): void; + stop(when?: number): void; } /* From 527d6686f5a68ba592a84e1cb99ed9102887ddd1 Mon Sep 17 00:00:00 2001 From: wokim Date: Wed, 10 Dec 2014 03:06:53 +0900 Subject: [PATCH 15/22] Add definitions for rabbit.js --- rabbit.js/rabbit.js-tests.ts | 33 +++++++++++ rabbit.js/rabbit.js.d.ts | 108 +++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 rabbit.js/rabbit.js-tests.ts create mode 100644 rabbit.js/rabbit.js.d.ts diff --git a/rabbit.js/rabbit.js-tests.ts b/rabbit.js/rabbit.js-tests.ts new file mode 100644 index 000000000..3e5a4d6d2 --- /dev/null +++ b/rabbit.js/rabbit.js-tests.ts @@ -0,0 +1,33 @@ +/// + +import rabbit = require('rabbit.js'); +var context = rabbit.createContext(); + +context.on('ready', function () { console.log('ready'); }); + +var pub = context.socket('PUB'); +var sub = context.socket('SUB'); +var push = context.socket('PUSH'); +var pull = context.socket('PULL'); +var req = context.socket('REQ'); +var rep = context.socket('REP'); +var task = context.socket('TASK'); +var worker = context.socket('WORKER'); + +pub.connect('chat'); +pub.write('hello', 'utf8'); +pub.close(); + +sub.connect('chat'); +sub.on('data', function (msg: string) { console.log(msg); }); +sub.close(); + +rep.setEncoding('utf8'); +rep.on('data', function (msg: string) { rep.write('msg', 'utf8'); }); +rep.connect('uppercase'); +req.connect('uppercase', function () { req.pipe(process.stdout); }); + +push.connect('items', function () { pull.pipe(push); }); +push.close(); +pull.connect('items', function () {}); +pull.close(); \ No newline at end of file diff --git a/rabbit.js/rabbit.js.d.ts b/rabbit.js/rabbit.js.d.ts new file mode 100644 index 000000000..98d8172fd --- /dev/null +++ b/rabbit.js/rabbit.js.d.ts @@ -0,0 +1,108 @@ +// Type definitions for rabbit.js v0.4.2 +// Project: https://github.com/squaremo/rabbit.js +// Definitions by: Wonshik Kim +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "rabbit.js" { + import events = require('events'); + import stream = require('stream'); + + export function createContext(url?: string): Context; + + export class Context extends events.EventEmitter { + public socket(type: string, options?: SocketOptions):T; + public close(callback: Function): any; + } + + export interface SocketOptions { + prefetch?: any; + expiration?: any; + persistent?: any; + topic?: any; + task?: any; + } + + export interface Socket { + connect(destination: string, callback?: Function): any; + setsockopt(opt: string, value: string): any; + close(): any; + } + + export class PubSocket extends stream.Writable implements Socket { + constructor(channel: string, opts: SocketOptions); + connect(destination: string, callback?: Function): any; + setsockopt(opt: string, value: string): any; + close(): any; + + publish(topic: string, chunk: string, encoding?: string): any; + publish(topic: string, chunk: Buffer, encoding?: string): any; + } + + export class SubSocket extends stream.Readable implements Socket { + constructor(channel: string, opts: SocketOptions); + connect(source: string, callback?: Function): any; + setsockopt(opt: string, value: string): any; + close(): any; + } + + export class PushSocket extends stream.Writable implements Socket { + constructor(channel: string, opts: SocketOptions); + connect(destination: string, callback?: Function): any; + setsockopt(opt: string, value: string): any; + close(): any; + } + + export class PullSocket extends stream.Readable implements Socket { + constructor(channel: string, opts: SocketOptions); + connect(source: string, callback?: Function): any; + setsockopt(opt: string, value: string): any; + close(): any; + } + + export class WorkerSocket extends stream.Readable implements Socket { + constructor(channel: string, opts: SocketOptions); + connect(source: string, callback?: Function): any; + setsockopt(opt: string, value: string): any; + close(): any; + + ack(): any; + requeue(): any; + discard(): any; + } + + export interface RequestMessage { + properties: { correlationId: number }; + content: any; + } + + export class ReqSocket extends stream.Duplex implements Socket { + constructor(channel: string, opts: SocketOptions); + connect(destination: string, callback?: Function): any; + setsockopt(opt: string, value: string): any; + close(): any; + + handleReply(msg: RequestMessage): any; + } + + export class RepSocket extends stream.Duplex implements Socket { + constructor(channel: string, opts: SocketOptions); + connect(source: string, callback?: Function): any; + setsockopt(opt: string, value: string): any; + close(): any; + + requeue(): any; + discard(): any; + } + + export class TaskSocket extends stream.Writable implements Socket { + constructor(channel: string, opts: SocketOptions); + connect(destination: string, callback?: Function): any; + setsockopt(opt: string, value: string): any; + close(): any; + + post(task: string, chunk: string, encoding?: string): any; + post(task: string, chunk: Buffer, encoding?: string): any; + } +} From 8d6cf93d7569f75a998ce79c9a65306c27c1b0a8 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 11 Dec 2014 23:33:42 +0900 Subject: [PATCH 16/22] reference node/node.d.ts. not node/node-0.11.d.ts --- node_zeromq/zmq-tests.ts | 1 - node_zeromq/zmq.d.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/node_zeromq/zmq-tests.ts b/node_zeromq/zmq-tests.ts index ef7e0f02b..cdc044b07 100644 --- a/node_zeromq/zmq-tests.ts +++ b/node_zeromq/zmq-tests.ts @@ -1,5 +1,4 @@ /// -/// import zmq = require('zmq'); diff --git a/node_zeromq/zmq.d.ts b/node_zeromq/zmq.d.ts index 23e75cc1e..8a375352c 100644 --- a/node_zeromq/zmq.d.ts +++ b/node_zeromq/zmq.d.ts @@ -3,7 +3,7 @@ // Definitions by: Dave McKeown // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// interface EventEmitter {} From 84716eb575a63ca6766668602d02d29b5d26353a Mon Sep 17 00:00:00 2001 From: Ken Fukuyama Date: Thu, 11 Dec 2014 23:40:29 +0900 Subject: [PATCH 17/22] jwt-simple definition file --- jwt-simple/jwt-simple-tests.ts | 12 ++++++++++++ jwt-simple/jwt-simple.d.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 jwt-simple/jwt-simple-tests.ts create mode 100644 jwt-simple/jwt-simple.d.ts diff --git a/jwt-simple/jwt-simple-tests.ts b/jwt-simple/jwt-simple-tests.ts new file mode 100644 index 000000000..8a0cc59c5 --- /dev/null +++ b/jwt-simple/jwt-simple-tests.ts @@ -0,0 +1,12 @@ +/// + +import jwt = require('jwt-simple'); +var payload = { foo: 'bar' }; +var secret:string = 'xxx'; + +// encode +var token = jwt.encode(payload, secret); + +// decode +var decoded = jwt.decode(token, secret); +console.log(decoded); //=> { foo: 'bar' } \ No newline at end of file diff --git a/jwt-simple/jwt-simple.d.ts b/jwt-simple/jwt-simple.d.ts new file mode 100644 index 000000000..74e5d487d --- /dev/null +++ b/jwt-simple/jwt-simple.d.ts @@ -0,0 +1,26 @@ +// Type definitions for jwt-simple v0.2.0 +// Project: https://github.com/hokaccha/node-jwt-simple +// Definitions by: Ken Fukuyama +// Definitions: https://github.com/borisyankov/DefinitelyTyped +declare module "jwt-simple" { + module jwtSimple { + /** + * Decode jwt + * @param token + * @param key + * @param noVerify + * @api public + */ + export function decode(token:any, key:string, noVerify?:boolean):any; + /** + * Encode jwt + * @param payload + * @param key + * @param algorithm default is HS256 + * @api public + */ + export function encode(payload:any, key:string, algorithm?:string):string; + } + + export = jwtSimple; +} \ No newline at end of file From 417aa79b1a51bfe8913c5ef756c739887fb27511 Mon Sep 17 00:00:00 2001 From: wokim Date: Wed, 10 Dec 2014 01:14:55 +0900 Subject: [PATCH 18/22] Make 'opts' to optional parameter --- socket.io/socket.io.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/socket.io/socket.io.d.ts b/socket.io/socket.io.d.ts index b6aad3293..b1db7515f 100644 --- a/socket.io/socket.io.d.ts +++ b/socket.io/socket.io.d.ts @@ -27,10 +27,10 @@ declare module SocketIO { 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; + 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; From d1291bfc3aaa4929bad30b881efb61621ba3aa79 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 11 Dec 2014 23:53:13 +0900 Subject: [PATCH 19/22] simplify jwt-simple/jwt-simple.d.ts --- jwt-simple/jwt-simple.d.ts | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/jwt-simple/jwt-simple.d.ts b/jwt-simple/jwt-simple.d.ts index 74e5d487d..0ee3cc679 100644 --- a/jwt-simple/jwt-simple.d.ts +++ b/jwt-simple/jwt-simple.d.ts @@ -3,24 +3,20 @@ // Definitions by: Ken Fukuyama // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module "jwt-simple" { - module jwtSimple { - /** - * Decode jwt - * @param token - * @param key - * @param noVerify - * @api public - */ - export function decode(token:any, key:string, noVerify?:boolean):any; - /** - * Encode jwt - * @param payload - * @param key - * @param algorithm default is HS256 - * @api public - */ - export function encode(payload:any, key:string, algorithm?:string):string; - } - - export = jwtSimple; -} \ No newline at end of file + /** + * Decode jwt + * @param token + * @param key + * @param noVerify + * @api public + */ + export function decode(token:any, key:string, noVerify?:boolean):any; + /** + * Encode jwt + * @param payload + * @param key + * @param algorithm default is HS256 + * @api public + */ + export function encode(payload:any, key:string, algorithm?:string):string; +} From 8e614160f9ddea13d7b78607df39ac931e233090 Mon Sep 17 00:00:00 2001 From: vvakame Date: Thu, 11 Dec 2014 23:55:52 +0900 Subject: [PATCH 20/22] update CONTRIBUTORS.md --- CONTRIBUTORS.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 8f69142ff..aadc541df 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -345,6 +345,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jstree/jstree.d.ts) [jsTree](http://www.jstree.com) by [Adam Pluciński](https://github.com/adaskothebeast) * [:link:](jszip/jszip.d.ts) [JSZip](http://stuk.github.com/jszip) by [mzeiher](https://github.com/mzeiher) * [:link:](jwplayer/jwplayer.d.ts) [JW Player](http://developer.longtailvideo.com/trac) by [Martin Duparc](https://github.com/martinduparc) +* [:link:](jwt-simple/jwt-simple.d.ts) [jwt-simple](https://github.com/hokaccha/node-jwt-simple) by [Ken Fukuyama](https://github.com/kenfdev) * [:link:](karma-jasmine/karma-jasmine.d.ts) [karma-jasmine plugin](https://github.com/karma-runner/karma-jasmine) by [Michel Salib](https://github.com/michelsalib) * [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone) * [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509) @@ -456,8 +457,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](nodemailer/nodemailer.d.ts) [Nodemailer](https://github.com/andris9/Nodemailer) by [Vincent Bortone](https://github.com/vbortone) * [:link:](nodeunit/nodeunit.d.ts) [nodeunit](https://github.com/caolan/nodeunit) by [Jeff Goddard](https://github.com/jedigo) * [:link:](nomnom/nomnom.d.ts) [nomnom](https://github.com/harthur/nomnom) by [Paul Vick](https://github.com/panopticoncentral) -* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker) * [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar) +* [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker) * [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42) * [:link:](npm/npm.d.ts) [npm](https://github.com/npm/npm) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](nprogress/nprogress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com) @@ -509,6 +510,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](q-retry/q-retry.d.ts) [q-retry](https://github.com/vilic/q-retry) by [VILIC VANE](https://github.com/vilic) * [:link:](qajax/qajax.d.ts) [Qajax](https://github.com/gre/qajax) by [Boltmade](https://github.com/Boltmade) * [:link:](qunit/qunit.d.ts) [QUnit](http://qunitjs.com) by [Diullei Gomes](https://github.com/diullei) +* [:link:](rabbit.js/rabbit.js.d.ts) [rabbit.js](https://github.com/squaremo/rabbit.js) by [Wonshik Kim](https://github.com/wokim) * [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall) * [:link:](ravenjs/ravenjs.d.ts) [Raven.js](https://github.com/getsentry/raven-js) by [Santi Albo](https://github.com/santialbo) * [:link:](react/react.d.ts) [React](http://facebook.github.io/react) by [Asana](https://asana.com) @@ -549,6 +551,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](selenium-webdriver/selenium-webdriver.d.ts) [Selenium WebDriverJS](https://code.google.com/p/selenium) by [Bill Armstrong](https://github.com/BillArmstrong) * [:link:](semver/semver.d.ts) [semver](https://github.com/isaacs/node-semver) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](sendgrid/sendgrid.d.ts) [sendgrid](https://github.com/sendgrid/sendgrid-nodejs) by [Maxime LUCE](https://github.com/SomaticIT) +* [:link:](sharedworker/SharedWorker.d.ts) [SharedWorker](http://www.w3.org/TR/workers) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](shelljs/shelljs.d.ts) [ShellJS](http://shelljs.org) by [Niklas Mollenhauer](https://github.com/nikeee) * [:link:](should/should.d.ts) [should.js](https://github.com/visionmedia/should.js) by [Alex Varju](https://github.com/varju), [Maxime LUCE](https://github.com/SomaticIT) * [:link:](showdown/showdown.d.ts) [Showdown](https://github.com/coreyti/showdown) by [cbowdon](https://github.com/cbowdon) @@ -600,7 +603,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](swiz/swiz.d.ts) [swiz](https://github.com/racker/node-swiz) by [Jeff Goddard](https://github.com/jedigo) * [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](tedious/tedious.d.ts) [tedious](https://github.com/pekim/tedious) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](tedious/tedious.d.ts) [tedious](https://pekim.github.io/tedious) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](teechart/teechart.d.ts) [TeeChart](http://www.steema.com) by [Steema Software](https://steema.com) * [:link:](text-buffer/text-buffer.d.ts) [text-buffer](https://github.com/atom/text-buffer) by [vvakame](https://github.com/vvakame) * [:link:](text-encoding/text-encoding.d.ts) [text-encoding](https://github.com/inexorabletash/text-encoding) by [MIZUNE Pine](https://github.com/pine613) From 30c6fd30ce0ef6b3b97f6da9b512c5badf4bf61d Mon Sep 17 00:00:00 2001 From: Qinfeng Chen Date: Thu, 11 Dec 2014 11:53:26 -0500 Subject: [PATCH 21/22] add custom shape typings --- sigmajs/sigmajs.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sigmajs/sigmajs.d.ts b/sigmajs/sigmajs.d.ts index 7ffe26626..ae2b09816 100644 --- a/sigmajs/sigmajs.d.ts +++ b/sigmajs/sigmajs.d.ts @@ -31,6 +31,10 @@ declare module SigmaJs{ (key: string): string; } + interface CustomShapes { + init(sigma: Sigma): void; + } + interface DragNodes { (sigma: Sigma, renderer: Renderer): DragNodes; } @@ -78,8 +82,10 @@ declare module SigmaJs{ interface Node { color?: string; id: string; + image?: any; label?: string; size?: number; + type?: string; x?: number; y?: number; } @@ -107,6 +113,10 @@ declare module SigmaJs{ type?: string; } + interface ShapeLibrary { + enumerate(): any; + } + interface Sigma { addRenderer(): Renderer; addRenderer(configs: RendererConfigs): Renderer; @@ -253,3 +263,5 @@ declare module SigmaJs{ } declare var sigma: SigmaJs.SigmaFactory; +declare var CustomShapes: SigmaJs.CustomShapes; +declare var ShapeLibrary: SigmaJs.CustomShapes; From 813eb68c6237a633901dd1eb92dbff1dbb81646d Mon Sep 17 00:00:00 2001 From: Adam Babcock Date: Thu, 11 Dec 2014 13:56:47 -0600 Subject: [PATCH 22/22] Add nodemailer module declaration --- nodemailer/nodemailer.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nodemailer/nodemailer.d.ts b/nodemailer/nodemailer.d.ts index c95aee99f..a63479e83 100644 --- a/nodemailer/nodemailer.d.ts +++ b/nodemailer/nodemailer.d.ts @@ -104,3 +104,8 @@ interface Nodemailer { createTransport(type: string, path: string): Transport; createXOAuthGenerator(options: XOAuthGeneratorOptions): XOAuthGenerator; } + +declare module "nodemailer" { + var nodemailer: Nodemailer; + export = nodemailer; +}