mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge branch 'master' of https://github.com/borisyankov/DefinitelyTyped into amqp-rpc
This commit is contained in:
+6
-3
@@ -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)
|
||||
@@ -656,7 +659,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)
|
||||
|
||||
Vendored
+3
-1
@@ -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<TModel>);
|
||||
initialize(options?: ViewOptions<TModel>): void;
|
||||
|
||||
/**
|
||||
* Events hash or a method returning the events hash that maps events/selectors to methods on your View.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Vendored
+3
@@ -42,6 +42,9 @@ declare module BigJsLibrary {
|
||||
(value: string): BigJS;
|
||||
/** A decimal value. */
|
||||
(value: BigJS): BigJS;
|
||||
|
||||
/** A decimal value. */
|
||||
(): BigJS;
|
||||
}
|
||||
|
||||
/** BigJS instance methods */
|
||||
|
||||
Vendored
+3
-1
@@ -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
|
||||
*/
|
||||
@@ -1750,6 +1750,8 @@ declare module D3 {
|
||||
|
||||
export interface Axis {
|
||||
(selection: Selection): void;
|
||||
(transition: Transition.Transition): void;
|
||||
|
||||
scale: {
|
||||
(): any;
|
||||
(scale: any): Axis;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/// <reference path='jwt-simple.d.ts' />
|
||||
|
||||
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' }
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for jwt-simple v0.2.0
|
||||
// Project: https://github.com/hokaccha/node-jwt-simple
|
||||
// Definitions by: Ken Fukuyama <https://github.com/kenfdev>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
declare module "jwt-simple" {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
Vendored
+2
-2
@@ -281,13 +281,13 @@ declare module Marionette {
|
||||
renderModel(): any;
|
||||
}
|
||||
|
||||
class Layout<TModel extends Backbone.Model> extends ItemView<TModel> {
|
||||
class LayoutView<TModel extends Backbone.Model> extends ItemView<TModel> {
|
||||
|
||||
constructor(options?: any);
|
||||
|
||||
addRegion(name: string, definition: any): Region<TModel>;
|
||||
addRegions(regions: any): any;
|
||||
render(): Layout<TModel>;
|
||||
render(): LayoutView<TModel>;
|
||||
removeRegion(name: string);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/// <reference path="mysql.d.ts" />
|
||||
|
||||
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 });
|
||||
|
||||
|
||||
Vendored
+34
-31
@@ -3,29 +3,37 @@
|
||||
// Definitions by: William Johnston <https://github.com/wjohnsto>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module mysql {
|
||||
export interface IMySql {
|
||||
createConnection(connectionUri: string): IConnection;
|
||||
createConnection(config: IConnectionConfig): IConnection;
|
||||
///<reference path='../node/node.d.ts' />
|
||||
|
||||
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<any>): string;
|
||||
|
||||
escape(value: any): 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<any>): string;
|
||||
}
|
||||
|
||||
format(sql: string): string;
|
||||
format(sql: string, values: Array<any>): 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<any>): IQuery;
|
||||
createQuery(sql: string, values: Array<any>, callback: (err: IError, ...args: any[]) => void): IQuery;
|
||||
}
|
||||
|
||||
export interface IConnection {
|
||||
interface IConnection {
|
||||
config: IConnectionConfig;
|
||||
|
||||
threadId: number;
|
||||
@@ -68,7 +76,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 +88,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 +109,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 +133,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 +150,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<any>): IQuery;
|
||||
@@ -157,7 +165,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 +208,7 @@ declare module mysql {
|
||||
typeCast?: any;
|
||||
}
|
||||
|
||||
export interface IStreamOptions {
|
||||
interface IStreamOptions {
|
||||
/**
|
||||
* Sets the max buffer size in objects of a stream
|
||||
*/
|
||||
@@ -212,7 +220,7 @@ declare module mysql {
|
||||
objectMode?: any;
|
||||
}
|
||||
|
||||
export interface IConnectionOptions {
|
||||
interface IConnectionOptions {
|
||||
/**
|
||||
* The MySQL user to authenticate as
|
||||
*/
|
||||
@@ -236,7 +244,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 +364,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 +390,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 +411,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 +448,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
|
||||
@@ -480,8 +488,3 @@ declare module mysql {
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'mysql' {
|
||||
var mysql: mysql.IMySql;
|
||||
|
||||
export = mysql;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,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() {
|
||||
@@ -32,4 +35,6 @@ function test5() {
|
||||
sock.bind('tcp://127.0.0.1', err => {
|
||||
sock.send("some work");
|
||||
});
|
||||
}
|
||||
sock.monitor();
|
||||
sock.monitor(10);
|
||||
}
|
||||
|
||||
Vendored
+18
-2
@@ -3,6 +3,8 @@
|
||||
// Definitions by: Dave McKeown <http://github.com/davemckeown>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path='../node/node.d.ts' />
|
||||
|
||||
interface EventEmitter {}
|
||||
|
||||
declare module 'zmq' {
|
||||
@@ -144,12 +146,27 @@ 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.
|
||||
*
|
||||
*/
|
||||
close(): Socket;
|
||||
|
||||
/**
|
||||
* Socket event
|
||||
* @param eventName {string}
|
||||
* @param callback {Function}
|
||||
*/
|
||||
on(eventName: string, callback: (buffer: Buffer) => void): void;
|
||||
|
||||
// Socket Options
|
||||
_fd: any;
|
||||
_ioevents: any;
|
||||
@@ -181,5 +198,4 @@ declare module 'zmq' {
|
||||
function socket(type: number, options?: any): Socket;
|
||||
function createSocket(type: string, options?: any): Socket;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+5
@@ -104,3 +104,8 @@ interface Nodemailer {
|
||||
createTransport(type: string, path: string): Transport;
|
||||
createXOAuthGenerator(options: XOAuthGeneratorOptions): XOAuthGenerator;
|
||||
}
|
||||
|
||||
declare module "nodemailer" {
|
||||
var nodemailer: Nodemailer;
|
||||
export = nodemailer;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/// <reference path="./rabbit.js.d.ts" />
|
||||
|
||||
import rabbit = require('rabbit.js');
|
||||
var context = rabbit.createContext();
|
||||
|
||||
context.on('ready', function () { console.log('ready'); });
|
||||
|
||||
var pub = context.socket<rabbit.PubSocket>('PUB');
|
||||
var sub = context.socket<rabbit.SubSocket>('SUB');
|
||||
var push = context.socket<rabbit.PushSocket>('PUSH');
|
||||
var pull = context.socket<rabbit.PullSocket>('PULL');
|
||||
var req = context.socket<rabbit.ReqSocket>('REQ');
|
||||
var rep = context.socket<rabbit.RepSocket>('REP');
|
||||
var task = context.socket<rabbit.TaskSocket>('TASK');
|
||||
var worker = context.socket<rabbit.WorkerSocket>('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();
|
||||
Vendored
+108
@@ -0,0 +1,108 @@
|
||||
// Type definitions for rabbit.js v0.4.2
|
||||
// Project: https://github.com/squaremo/rabbit.js
|
||||
// Definitions by: Wonshik Kim <https://github.com/wokim>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
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<T>(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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
///<reference path="SharedWorker.d.ts" />
|
||||
|
||||
var worker_with_name = new SharedWorker('worker.js', "worker");
|
||||
|
||||
var worker = new SharedWorker('worker.js');
|
||||
|
||||
worker.port.onmessage = function(e) {
|
||||
console.log(e);
|
||||
};
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
// Type definitions for SharedWorker
|
||||
// Project: http://www.w3.org/TR/workers/
|
||||
// Definitions by: Toshiya Nakakura <https://github.com/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;
|
||||
};
|
||||
Vendored
+12
@@ -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;
|
||||
|
||||
+2
-1
@@ -23,10 +23,11 @@ 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;
|
||||
connected: boolean;
|
||||
}
|
||||
|
||||
interface ManagerStatic {
|
||||
|
||||
Vendored
+4
-4
@@ -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;
|
||||
|
||||
Vendored
+1
-1
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
()=>{
|
||||
|
||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Web Audio API
|
||||
// Project: http://www.w3.org/TR/webaudio/
|
||||
// Definitions by: Baruch Berger <https://github.com/bbss>, Kon <http://phyzkit.net/>
|
||||
// Definitions by: Baruch Berger <https://github.com/bbss>, Kon <http://phyzkit.net/>, kubosho <https://github.com/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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user