Merge branch master into listen_bug

This commit is contained in:
John Purcell
2014-04-01 08:21:11 -04:00
60 changed files with 1143 additions and 37 deletions
+6
View File
@@ -58,6 +58,7 @@ List of Definitions
* [CKEditor](https://github.com/ckeditor/ckeditor-dev) (by [Ondrej Sevcik](https://github.com/ondrejsevcik))
* [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon))
* [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem))
* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Couchbase / Couchnode](https://github.com/couchbase/couchnode) (by [Basarat Ali Syed](https://github.com/basarat))
* [Crossfilter](https://github.com/square/crossfilter) (by [Schmulik Raskin](https://github.com/schmuli))
* [crypto-js](https://code.google.com/p/crypto-js/) (by [Gia Bảo @ Sân Đình](https://github.com/giabao)). @see [cryptojs.d.ts repo](https://github.com/giabao/cryptojs.d.ts)
@@ -166,9 +167,11 @@ List of Definitions
* [jQuery.Watermark](http://jquery-watermark.googlecode.com) (by [Anwar Javed](https://github.com/anwarjaved))
* [jQuery.base64](https://github.com/yatt/jquery.base64) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki))
* [js-git](https://github.com/creationix/js-git) (by [Bart van der Schoor](https://github.com/Bartvds))
* [js-yaml](https://github.com/nodeca/js-yaml) (by [Bart van der Schoor](https://github.com/Bartvds/))
* [jScrollPane](http://jscrollpane.kelvinluck.com) (by [Dániel Tar](https://github.com/qcz))
* [JSDeferred](http://cho45.stfuawsc.com/jsdeferred/) (by [Daisuke Mino](https://github.com/minodisk))
* [JSONEditorOnline](https://github.com/josdejong/jsoneditoronline) (by [Vincent Bortone](https://github.com/vbortone/))
* [JSON-Pointer](https://www.npmjs.org/package/json-pointer) (by [Bart van der Schoor](https://github.com/Bartvds))
* [jStorage](http://www.jstorage.info/) (by [Danil Flores](https://github.com/dflor003/))
* [JWPlayer](http://developer.longtailvideo.com/trac/) (by [Martin Duparc](https://github.com/martinduparc/))
* [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) (by [Vincent Bortone](https://github.com/vbortone/))
@@ -199,6 +202,7 @@ List of Definitions
* [mCustomScrollbar](https://github.com/malihu/malihu-custom-scrollbar-plugin) (by [Sarah Williams](https://github.com/flurg))
* [Meteor](https://www.meteor.com) (by [Dave Allen](https://github.com/fullflavedave))
* [Microsoft Live Connect](http://msdn.microsoft.com/en-us/library/live/hh243643.aspx) (by [John Vilk](https://github.com/jvilk))
* [minimist](https://github.com/substack/minimist) (by [Bart van der Schoor](https://github.com/Bartvds))
* [Modernizr](http://modernizr.com/) (by [Boris Yankov](https://github.com/borisyankov) and [Theodore Brown](https://github.com/theodorejb/))
* [Moment.js](https://github.com/timrwood/moment) (by [Michael Lakerveld](https://github.com/Lakerfield))
* [MongoDB](http://mongodb.github.io/node-mongodb-native/) (from TypeScript samples, updated by [Niklas Mollenhauer](https://github.com/nikeee))
@@ -271,6 +275,8 @@ List of Definitions
* [Underscore.js (Typed)](http://underscorejs.org/) (by [Josh Baldwin](https://github.com/jbaldwin/))
* [Underscore-ko.js](https://github.com/kamranayub/UnderscoreKO) (by [Maurits Elbers](https://github.com/MagicMau))
* [universal-analytics](https://github.com/peaksandpies/universal-analytics) (by [Bart van der Schoor](https://github.com/Bartvds))
* [update-notifier](https://github.com/yeoman/update-notifier) (by [vvakame](https://github.com/vvakame))
* [uri-templates](https://github.com/geraintluff/uri-variables) (by [Bart van der Schoor](https://github.com/Bartvds))
* [urlrouter](https://github.com/fengmk2/urlrouter) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
* [UUID.js](https://github.com/LiosK/UUID.js) (by [Jason Jarrett](https://github.com/staxmanade))
* [Valerie](https://github.com/davewatts/valerie) (by [Howard Richards](https://github.com/conficient))
@@ -167,7 +167,7 @@ function TestProtractor() {
var webElement: webdriver.WebElement = ptor.wrapWebElement(new webdriver.WebElement(driver, 'id'));
var locationAbsUrl: string = ptor.getLocationAbsUrl();
var locationAbsUrl: webdriver.promise.Promise = ptor.getLocationAbsUrl();
}
function TestElement() {
@@ -239,4 +239,4 @@ function TestWebElements() {
webElement = webElement.findElement(by.id('id')).$('.class');
promise = webElement.findElement(by.id('id')).$$('.class');
promise = webElement.findElement(by.id('id')).evaluate('something');
}
}
+2 -2
View File
@@ -772,7 +772,7 @@ declare module protractor {
/**
* Returns the current absolute url from AngularJS.
*/
getLocationAbsUrl(): string;
getLocationAbsUrl(): webdriver.promise.Promise;
/**
* Pauses the test and injects some helper functions into the browser, so that
@@ -865,4 +865,4 @@ declare var element: protractor.Element;
declare module 'protractor' {
export = protractor;
}
}
+15
View File
@@ -0,0 +1,15 @@
/// <reference path="assertion-error.d.ts" />
import AssertionError = require('assertion-error');
var e: AssertionError;
var str: string;
function foo () {
}
e = new AssertionError(str);
e = new AssertionError(str, {a:1, b:2});
e = new AssertionError(str, {a:1, b:2}, foo);
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for assertion-error 1.0 0
// Project: https://github.com/chaijs/assertion-error
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'assertion-error' {
class AssertionError implements Error {
constructor(message: string, props?: any, ssf?: Function);
name: string;
message: string;
showDiff: boolean;
stack: string;
}
export = AssertionError;
}
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="buffer-equal.d.ts" />
import bufferEqual = require('buffer-equal');
var bool: boolean;
var buf: NodeBuffer;
bool = bufferEqual(buf, buf);
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for buffer-equal 1.0 0
// Project: https://github.com/chaijs/assertion-error
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'buffer-equal' {
function bufferEqual(actual:NodeBuffer, expected:NodeBuffer): boolean;
export = bufferEqual;
}
+18
View File
@@ -0,0 +1,18 @@
/// <reference path="configstore.d.ts" />
import cs = require('configstore');
var value: any;
var key: string;
var num: number;
var bool: any;
var object:Object;
cs.set(key, value);
value = cs.get(key);
cs.del(key);
object = cs.all;
cs.all = object;
num = cs.size;
key = cs.path;
+38
View File
@@ -0,0 +1,38 @@
// Type definitions for configstore 0.3.0
// Project: https://github.com/yeoman/configstore
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'configstore' {
/*
Set an item
*/
export function set(key: string, val: any): void;
/*
Get an item
*/
export function get(key: string): any;
/*
Delete an item
*/
export function del(key: string): void;
/*
Get all items as an object or replace the current config with an object:
conf.all = {
hello: 'world'
};
*/
export var all: Object;
/*
Get the item count
*/
export var size: number;
/*
Get the path to the config file. Can be used to show the user where the config file is located or even better open it for them.
*/
export var path: string;
}
Vendored
+4
View File
@@ -3172,6 +3172,10 @@ declare module D3 {
(): Array<number>;
(location: Array<number>): Projection;
};
parallels: {
(): Array<number>;
(location: Array<number>): Projection;
};
translate: {
(): Array<number>;
(point: Array<number>): Projection;
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="detect-indent.d.ts" />
import di = require('detect-indent');
var str: string;
str = di(str);
str = di(str, str);
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for detect-indent 0.1.3
// Project: https://github.com/sindresorhus/detect-indent
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'detect-indent' {
function DetectIndent (dir: string, alt?: string): string;
export = DetectIndent;
}
+5
View File
@@ -0,0 +1,5 @@
/// <reference path="exit.d.ts" />
import exit = require('exit');
exit(42);
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for exit 0.1.2
// Project: https://github.com/cowboy/node-exit
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'exit' {
function exit(code: number): void;
export = exit;
}
+86
View File
@@ -0,0 +1,86 @@
/// <reference path="./firebase-simplelogin.d.ts" />
var chatRef: Firebase = new Firebase('https://<YOUR-FIREBASE>.firebaseio.com');
var auth: FirebaseSimpleLogin = new FirebaseSimpleLogin(chatRef, function(error, user) {
if (error) {
// an error occurred while attempting login
switch(error.code) {
case 'INVALID_EMAIL':
case 'INVALID_PASSWORD':
default:
}
} else if (user) {
// user authenticated with Firebase
console.log('User ID: ' + user.id + ', Provider: ' + user.provider);
} else {
// user is logged out
}
});
var email = 'my@email.com';
var password = 'secret';
var oldPassword = 'secret';
var newPassword = 'secret';
auth.login('password', {
email: '<email@domain.com>',
password: '<password>',
rememberMe: true
});
auth.login('facebook', {
rememberMe: true,
scope: 'email,user_likes'
});
auth.login('github', {
rememberMe: true,
scope: 'user,gist'
});
auth.login('google', {
rememberMe: true,
scope: 'https://www.googleapis.com/auth/plus.login'
});
auth.login('persona', {
rememberMe: true
});
auth.login('twitter', {
rememberMe: true
});
auth.login('anonymous');
auth.createUser(email, password, function(error, user) {
if (!error) {
console.log('User Id: ' + user.id + ', Email: ' + user.email);
}
});
auth.createUser(email, password);
auth.changePassword(email, oldPassword, newPassword, function(error, success) {
if (!error) {
console.log('Password changed successfully');
}
});
auth.changePassword(email, oldPassword, newPassword);
auth.sendPasswordResetEmail(email, function(error, success) {
if (!error) {
console.log('Password reset email sent successfully');
}
});
auth.sendPasswordResetEmail(email);
auth.removeUser(email, password, function(error, success) {
if (!error) {
console.log('User deleted successfully');
}
});
auth.removeUser(email, password);
+94
View File
@@ -0,0 +1,94 @@
// Type definitions for Firebase Simple Login
// Project: https://www.firebase.com/docs/security/simple-login-overview.html
// Definitions by: Wilker Lucio <http://github.com/wilkerlucio>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="./firebase.d.ts" />
interface IFirebaseSimpleLoginError {
code: string;
message: string;
}
interface IFirebaseSimpleLoginOptions {
// general options
debug?: boolean
rememberMe?: boolean
// email
email?: string
password?: string
// facebook / github / google / twitter
preferRedirect?: boolean
// facebook / github / google
scope?: string
// facebook
access_token?: string
// twitter
oauth_token?: string
// persona
backgroundColor?: string
privacyPolicy?: string
siteLogo?: string
siteName?: string
termsOfService?: string
}
interface IFirebaseSimpleLoginUser {
// general data
firebaseAuthToken: string;
id: string;
provider: string;
uid: string;
// email / persona
md5_hash?: string;
// email
email?: string;
// facebook / github / google / twitter
accessToken?: string
displayName?: string
thirdPartyUserData?: Object
// github / twitter
username?: string
// twitter
accessTokenSecret?: string
}
declare class FirebaseSimpleLogin {
email: string;
id: string;
provider: string;
uid: string;
username: string;
constructor(firebase: Firebase, callback: (err: IFirebaseSimpleLoginError, user: IFirebaseSimpleLoginUser) => any);
login(loginType: string, options?: IFirebaseSimpleLoginOptions): void;
logout(): void;
createUser(email: string,
password: string,
callback?: (err: IFirebaseSimpleLoginError, user: IFirebaseSimpleLoginUser) => any): void;
changePassword(email: string,
oldPassword: string,
newPassword: string,
callback?: (err: IFirebaseSimpleLoginError, success: boolean) => any): void;
sendPasswordResetEmail(email: string,
callback?: (err: IFirebaseSimpleLoginError, success: boolean) => any): void;
removeUser(email: string,
password: string,
callback?: (err: IFirebaseSimpleLoginError, success: boolean) => any): void;
}
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="graceful-fs.d.ts" />
import fs = require('graceful-fs');
var str: string;
var buf: NodeBuffer;
fs.renameSync(str, str);
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for graceful-fs 2.0.0
// Project: https://github.com/cowboy/graceful-fs
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'graceful-fs' {
import fs = require('fs');
export = fs;
}
+1 -1
View File
@@ -2447,7 +2447,7 @@ interface JQuery {
*/
keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
/**
* Bind an event handler to the keydown"" JavaScript event
* Bind an event handler to the "keydown" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
+84
View File
@@ -0,0 +1,84 @@
/// <reference path="js-yaml.d.ts" />
import yaml = require('js-yaml');
import LoadOptions = yaml.LoadOptions;
import DumpOptions = yaml.DumpOptions;
var bool: boolean;
var num: number;
var str: string;
var obj: Object;
var value: any;
var loadOpts: LoadOptions;
var dumpOpts: DumpOptions;
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
yaml.FAILSAFE_SCHEMA;
yaml.JSON_SCHEMA;
yaml.CORE_SCHEMA;
yaml.DEFAULT_SAFE_SCHEMA;
yaml.DEFAULT_FULL_SCHEMA;
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
loadOpts = {
filename: str
};
loadOpts = {
strict: bool
};
loadOpts = {
schema: bool
};
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
dumpOpts = {
indent: num
};
dumpOpts = {
skipInvalid: bool
};
dumpOpts = {
flowLevel: num
};
dumpOpts = {
styles: obj
};
dumpOpts = {
schema: value
};
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
value = yaml.safeLoad(str);
value = yaml.safeLoad(str, loadOpts);
value = yaml.load(str);
value = yaml.load(str, loadOpts);
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
value = yaml.safeLoadAll(str, (doc) => {
value = doc;
});
value = yaml.safeLoadAll(str, (doc) => {
value = doc;
}, loadOpts);
value = yaml.loadAll(str, (doc) => {
value = doc;
});
value = yaml.loadAll(str, (doc) => {
value = doc;
}, loadOpts);
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
value = yaml.safeDump(str);
value = yaml.safeDump(str, dumpOpts);
value = yaml.dump(str);
value = yaml.dump(str, dumpOpts);
+48
View File
@@ -0,0 +1,48 @@
// Type definitions for js-yaml 3.0.2
// Project: https://github.com/nodeca/js-yaml
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'js-yaml' {
export function safeLoad(str: string, opts?: LoadOptions): any;
export function load(str: string, opts?: LoadOptions): any;
export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any;
export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any;
export function safeDump(obj: any, opts?: DumpOptions): string;
export function dump(obj: any, opts?: DumpOptions): string
export interface LoadOptions {
// string to be used as a file path in error/warning messages.
filename?: string;
// makes the loader to throw errors instead of warnings.
strict?: boolean;
// specifies a schema to use.
schema?: any;
}
export interface DumpOptions {
// indentation width to use (in spaces).
indent?: number;
// do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types.
skipInvalid?: boolean;
// specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere
flowLevel?: number;
// Each tag may have own set of styles. - "tag" => "style" map.
styles?: Object;
// specifies a schema to use.
schema?: any;
}
// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
export var FAILSAFE_SCHEMA: any;
// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
export var JSON_SCHEMA: any;
// same as JSON_SCHEMA: http://www.yaml.org/spec/1.2/spec.html#id2804923
export var CORE_SCHEMA: any;
// all supported YAML types, without unsafe ones (!!js/undefined, !!js/regexp and !!js/function): http://yaml.org/type/
export var DEFAULT_SAFE_SCHEMA: any;
// all supported YAML types.
export var DEFAULT_FULL_SCHEMA: any;
}
+45
View File
@@ -0,0 +1,45 @@
/// <reference path="jsesc.d.ts" />
import jsesc = require('jsesc');
import Opts = jsesc.Opts;
// ---- ---- ---- ---- ---- ---- ----
var num: number;
var str: string;
var bool: boolean;
var opts: Opts;
var opts: Opts;
// ---- ---- ---- ---- ---- ---- ----
str = jsesc.version;
// ---- ---- ---- ---- ---- ---- ----
opts = {
quotes: str
};
opts = {
wrap: bool
};
opts = {
es6: bool
};
opts = {
escapeEverything: bool
};
opts = {
compact: bool
};
opts = {
indent: str
};
opts = {
json: bool
};
// ---- ---- ---- ---- ---- ---- ----
str = jsesc(str);
str = jsesc(str, opts);
+25
View File
@@ -0,0 +1,25 @@
// Type definitions for jsesc 0.4.3
// Project: https://github.com/mathiasbynens/jsesc
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'jsesc' {
function jsesc(str: string, opts?: any): string;
module jsesc {
var version: string;
interface Opts {
quotes?: string;
wrap?: boolean;
es6?: boolean;
escapeEverything?: boolean;
compact?: boolean;
indent?: string;
json?: boolean;
}
}
export = jsesc;
}
+41
View File
@@ -0,0 +1,41 @@
/// <reference path="json-pointer.d.ts" />
import JsonPointer = require('json-pointer');
var value: any;
var str: string;
var strArr: string[];
var pointer: string;
var bool: any;
var object:Object;
bool = JsonPointer.has(object, pointer);
value = JsonPointer.get(object, pointer);
JsonPointer.set(object, pointer, value);
JsonPointer.remove(object, pointer);
object = JsonPointer.dict(object);
JsonPointer.walk(object, (elem) => {
});
str = JsonPointer.escape(str);
str = JsonPointer.unescape(str);
strArr = JsonPointer.parse(str);
str = JsonPointer.compile(strArr);
var wrap = JsonPointer(object);
bool = wrap.has(pointer);
value = wrap.get(pointer);
wrap.set(pointer, value);
wrap.remove(pointer);
object = wrap.dict();
wrap.walk((elem, key) => {
value = elem;
str = key;
});
+83
View File
@@ -0,0 +1,83 @@
// Type definitions for json-pointer 1.0 l
// Project: https://www.npmjs.org/package/json-pointer
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "json-pointer" {
function JSON_Pointer(object: Object): JSON_Pointer.JSON_PointerWrap;
module JSON_Pointer {
/**
* Wrap an object with accessors
*/
/**
* Looks up a JSON pointer in an object.
*/
function get(object: Object, pointer: string): any;
/**
* Set a value for a JSON pointer on object.
*/
function set(object: Object, pointer: string, value: any): void;
/**
* Removes an attribute of object referenced by pointer
*/
function remove(object: Object, pointer: string): void;
/**
* Creates a dictionary object (pointer -> value).
*/
function dict(object: Object): Object;
/**
* Just like: each(pointer.dict(obj), iterator);
*/
function walk(object: Object, iterator: (value: any, key: string) => void): void;
/**
* Tests if an object has a value for a JSON pointer.
*/
function has(object: Object, pointer: string): boolean;
/**
* Escapes a reference token.
*/
function escape(str: string): string;
/**
* Unescape a reference token.
*/
function unescape(str: string): string;
/**
* Converts a JSON pointer into an array of reference tokens.
*/
function parse(str: string): string[];
/**
* Builds a json pointer from an array of reference tokens.
*/
function compile(str: string[]): string;
interface JSON_PointerWrap {
/**
* Looks up a JSON pointer in an object.
*/
get(pointer: string): any;
/**
* Set a value for a JSON pointer on object.
*/
set(pointer: string, value: any): void;
/**
* Removes an attribute of object referenced by pointer
*/
remove(pointer: string): void;
/**
* Creates a dictionary object (pointer -> value).
*/
dict(): Object;
/**
* Just like: each(pointer.dict(obj), iterator);
*/
walk(iterator: (value: any, key: string) => void): void;
/**
* Tests if an object has a value for a JSON pointer.
*/
has(pointer: string): boolean;
}
}
export = JSON_Pointer;
}
+5
View File
@@ -144,3 +144,8 @@ interface KnockoutSubscribableFunctions<T> {
rules: KnockoutObservableArray<KnockoutValidationRule>;
}
declare module "knockout.validation" {
export = validation;
}
declare var validation: KnockoutValidationStatic
+27
View File
@@ -0,0 +1,27 @@
/// <reference path="minimist.d.ts" />
import minimist = require('minimist');
import Opts = minimist.Opts;
var num: string;
var str: string;
var strArr: string[];
var args: string[];
var obj: Object;
var opts: Opts;
opts.string = strArr;
opts.boolean = strArr;
opts.alias = {
foo: strArr
};
opts.default = {
foo: str
};
opts.default = {
foo: num
};
obj = minimist();
obj = minimist(strArr);
obj = minimist(strArr, opts);
+26
View File
@@ -0,0 +1,26 @@
// Type definitions for minimist 0.0.8
// Project: https://github.com/substack/minimist
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'minimist' {
function minimist(args?: string[], opts?: minimist.Opts):Object;
module minimist {
export interface Opts {
// a string or array of strings argument names to always treat as strings
// string?: string;
string?: string[];
// a string or array of strings to always treat as booleans
// boolean?: string;
boolean?: string[];
// an object mapping string names to strings or arrays of string argument names to use
// alias?: {[key:string]: string};
alias?: {[key:string]: string[]};
// an object mapping string argument names to default values
default?: {[key:string]: any};
}
}
export = minimist;
}
+16
View File
@@ -0,0 +1,16 @@
/// <reference path="mkdirp.d.ts" />
import mkdirp = require('mkdirp');
var str: string;
var num: number;
mkdirp(str, num, (err, made) => {
str = made;
});
mkdirp(str, (err, made) => {
str = made;
});
str = mkdirp.sync(str, num);
str = mkdirp.sync(str);
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for mkdirp 0.3.0
// Project: http://github.com/substack/node-mkdirp
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'mkdirp' {
function mkdirp(dir: string, cb: (err: any, made: string) => void): void;
function mkdirp(dir: string, flags: any, cb: (err: any, made: string) => void): void;
module mkdirp {
function sync(dir: string, flags?: any): string;
}
export = mkdirp;
}
+3
View File
@@ -130,6 +130,9 @@ declare module ngGrid {
/** all of the items selected in the grid. In single select mode there will only be one item in the array. */
selectedItems?: any[];
/** Select deselect an item by index. */
selectItem?: (idx:number, state:boolean) =>any;
/** Disable row selections by clicking on the row and only when the checkbox is clicked. */
selectWithCheckboxOnly?: boolean;
+7
View File
@@ -6,6 +6,7 @@ import events = require("events");
import zlib = require("zlib");
import url = require('url');
import util = require("util");
import crypto = require("crypto");
import http = require("http");
import net = require("net");
@@ -83,6 +84,12 @@ function stream_readable_pipe_test() {
r.pipe(z).pipe(w);
}
////////////////////////////////////////////////////
/// Crypto tests : http://nodejs.org/api/crypto.html
////////////////////////////////////////////////////
var hmacResult: string = crypto.createHmac('md5', 'hello').update('world').digest('hex');
////////////////////////////////////////////////////
// Make sure .listen() and .close() retuern a Server instance
+7 -3
View File
@@ -634,6 +634,8 @@ declare module "url" {
search: string;
query: string;
slashes: boolean;
hash?: string;
path?: string;
}
export interface UrlOptions {
@@ -645,6 +647,8 @@ declare module "url" {
pathname?: string;
search?: string;
query?: any;
hash?: string;
path?: string;
}
export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url;
@@ -820,7 +824,7 @@ declare module "fs" {
export function readlinkSync(path: string): string;
export function realpath(path: string, callback?: (err: ErrnoException, resolvedPath: string) => any): void;
export function realpath(path: string, cache: {[path: string]: string}, callback: (err: ErrnoException, resolvedPath: string) =>any): void;
export function realpathSync(path: string, cache?: {[path: string]: string}): void;
export function realpathSync(path: string, cache?: {[path: string]: string}): string;
export function unlink(path: string, callback?: (err?: ErrnoException) => void): void;
export function unlinkSync(path: string): void;
export function rmdir(path: string, callback?: (err?: ErrnoException) => void): void;
@@ -1018,8 +1022,8 @@ declare module "crypto" {
digest(encoding?: string): string;
}
interface Hmac {
update(data: any): void;
digest(encoding?: string): void;
update(data: any, input_encoding?: string): Hmac;
digest(encoding?: string): string;
}
export function createCipher(algorithm: string, password: any): Cipher;
export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
+6
View File
@@ -0,0 +1,6 @@
/// <reference path="open.d.ts" />
import open = require('open');
open('foo');
open('foo', 'bar');
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for open 0.0.3
// Project: https://github.com/jjrdn/node-open
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'open' {
function open(target: string, app?: string): void;
export = open;
}
+7
View File
@@ -72,11 +72,18 @@ declare module createjs {
static version: string;
}
/*
NOTE: It is commented out because it conflicts with SamplePlugin class of TweenJS.
this class is mainly for documentation purposes.
http://www.createjs.com/Docs/PreloadJS/classes/SamplePlugin.html
*/
/*
export class SamplePlugin {
static fileLoadHandler(event: Object): void;
static getPreloadHandlers(): Object;
static preloadHandler(src: string, type: string, id: string, data: any, basePath: string, queue: LoadQueue): any;
}
*/
export class TagLoader extends AbstractLoader {
constructor (item: Object);
+2 -1
View File
@@ -2,7 +2,8 @@
/// <reference path="../rx.js/rx.async.d.ts"/>
/// <reference path="../es6-promises/es6-promises.d.ts"/>
/// <reference path="../q/Q.d.ts"/>
/// <reference path="../when/when.d.ts"/>
import When = require("../when/when");
var thenNum: PromisesAPlus.Thenable<number>;
var thenStr: PromisesAPlus.Thenable<string>;
+6
View File
@@ -109,3 +109,9 @@ Q.allSettled([saveToDisk(), saveToCloud()]).spread(function (disk, cloud) {
}
}).done();
var nodeStyle = (input: string, cb: Function) => {
cb(null, input);
};
Q.nfapply(nodeStyle, ["foo"]).done((result: string) => {});
Q.nfcall(nodeStyle, "foo").done((result: string) => {});
Vendored
+1
View File
@@ -209,6 +209,7 @@ declare module Q {
export function nfbind<T>(nodeFunction: Function, ...args: any[]): (...args: any[]) => Promise<T>;
export function nfcall<T>(nodeFunction: Function, ...args: any[]): Promise<T>;
export function nfapply<T>(nodeFunction: Function, args: any[]): Promise<T>;
export function ninvoke<T>(nodeModule: any, functionName: string, ...args: any[]): Promise<T>;
export function nsend<T>(nodeModule: any, functionName: string, ...args: any[]): Promise<T>;
+18
View File
@@ -45,6 +45,19 @@ declare module Rx {
export var Promise: { new <T>(resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise<T>; };
}
export module helpers {
function noop(): void;
function identity<T>(value: T): T;
function defaultNow(): number;
function defaultComparer(left: any, right: any): boolean;
function defaultSubComparer(left: any, right: any): number;
function defaultKeySerializer(key: any): string;
function defaultError(err: any): void;
function isPromise(p: any): boolean;
function asArray<T>(...args: T[]): T[];
function not(value: any): boolean;
}
export interface IDisposable {
dispose(): void;
}
@@ -307,6 +320,7 @@ declare module Rx {
create<T>(subscribe: (observer: Observer<T>) => IDisposable): Observable<T>;
createWithDisposable<T>(subscribe: (observer: Observer<T>) => IDisposable): Observable<T>;
defer<T>(observableFactory: () => Observable<T>): Observable<T>;
defer<T>(observableFactory: () => IPromise<T>): Observable<T>;
empty<T>(scheduler?: IScheduler): Observable<T>;
fromArray<T>(array: T[], scheduler?: IScheduler): Observable<T>;
fromArray<T>(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): Observable<T>;
@@ -347,9 +361,13 @@ declare module Rx {
throwException<T>(exception: any, scheduler?: IScheduler): Observable<T>; // alias for throw
catch<T>(sources: Observable<T>[]): Observable<T>;
catch<T>(sources: IPromise<T>[]): Observable<T>;
catchException<T>(sources: Observable<T>[]): Observable<T>; // alias for catch
catchException<T>(sources: IPromise<T>[]): Observable<T>; // alias for catch
catch<T>(...sources: Observable<T>[]): Observable<T>;
catch<T>(...sources: IPromise<T>[]): Observable<T>;
catchException<T>(...sources: Observable<T>[]): Observable<T>; // alias for catch
catchException<T>(...sources: IPromise<T>[]): Observable<T>; // alias for catch
concat<T>(...sources: Observable<T>[]): Observable<T>;
concat<T>(...sources: IPromise<T>[]): Observable<T>;
concat<T>(sources: Observable<T>[]): Observable<T>;
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Async v2.2.17
// Type definitions for RxJS-Async v2.2.18
// Project: http://rx.codeplex.com/
// Definitions by: zoetrope <https://github.com/zoetrope>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-BackPressure v2.2.15
// Type definitions for RxJS-BackPressure v2.2.18
// Project: http://rx.codeplex.com/
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Binding v2.2.17
// Type definitions for RxJS-Binding v2.2.18
// Project: http://rx.codeplex.com/
// Definitions by: Carl de Billy <http://carl.debilly.net/>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS v2.2.17
// Type definitions for RxJS v2.2.18
// Project: http://rx.codeplex.com/
// Definitions by: gsino <http://www.codeplex.com/site/users/view/gsino>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+1 -11
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Lite v2.2.17
// Type definitions for RxJS-Lite v2.2.18
// Project: http://rx.codeplex.com/
// Definitions by: gsino <http://www.codeplex.com/site/users/view/gsino>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
@@ -47,14 +47,4 @@ declare module Rx {
export interface Observable<T> {
shareReplay(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable<T>; // same as replayWhileObserved in rx.binding.d.ts
}
export interface ObservableStatic {
generateWithTime<TState, TResult>(
initialState: TState,
condition: (state: TState) => boolean,
iterate: (state: TState) => TState,
resultSelector: (state: TState) => TResult,
timeSelector: (state: TState) => number,
scheduler?: IScheduler): Observable<TResult>;
}
}
+7
View File
@@ -47,5 +47,12 @@ declare module Rx {
interval(dutTime: number, period: number, scheduler?: IScheduler): Observable<number>;
timer(dueTime: number, period: number, scheduler: IScheduler): Observable<number>;
timer(dueTime: number, scheduler: IScheduler): Observable<number>;
generateWithRelativeTime<TState, TResult>(
initialState: TState,
condition: (state: TState) => boolean,
iterate: (state: TState) => TState,
resultSelector: (state: TState) => TResult,
timeSelector: (state: TState) => number,
scheduler?: IScheduler): Observable<TResult>;
}
}
+1 -9
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-Time v2.2.17
// Type definitions for RxJS-Time v2.2.18
// Project: http://rx.codeplex.com/
// Definitions by: Carl de Billy <http://carl.debilly.net/>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
@@ -28,13 +28,5 @@ declare module Rx {
resultSelector: (state: TState) => TResult,
timeSelector: (state: TState) => Date,
scheduler?: IScheduler): Observable<TResult>;
generateWithRelativeTime<TState, TResult>(
initialState: TState,
condition: (state: TState) => boolean,
iterate: (state: TState) => TState,
resultSelector: (state: TState) => TResult,
timeSelector: (state: TState) => number,
scheduler?: IScheduler): Observable<TResult>;
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for RxJS-VirtualTime package 2.2
// Type definitions for RxJS-VirtualTime package 2.2.18
// Project: http://rx.codeplex.com/
// Definitions by: gsino <http://www.codeplex.com/site/users/view/gsino>
// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+5 -3
View File
@@ -87,9 +87,7 @@ interface JQuery {
select2(): JQuery;
select2(it: IdTextPair): JQuery;
select2(options: Select2Options): JQuery;
select2(method: string): any;
select2(method: string, value: any, trigger?: boolean): any;
/**
* Get the id value of the current selection
*/
@@ -144,4 +142,8 @@ interface JQuery {
* Notifies Select2 that a drag and drop sorting operation has finished
*/
select2(method: 'onSortEnd'): void;
select2(method: string): any;
select2(method: string, value: any, trigger?: boolean): any;
select2(options: Select2Options): JQuery;
}
+39
View File
@@ -0,0 +1,39 @@
/// <reference path='signature_pad.d.ts'/>
/* TEST 1 - Basic structure and usage */
function BasicTest() {
var canvas = document.querySelector("canvas");
var signaturePad = new SignaturePad(canvas);
// Returns signature image as data URL
signaturePad.toDataURL();
// Draws signature image from data URL
signaturePad.fromDataURL("data:image/png;base64,iVBORw0K...");
// Clears the canvas
signaturePad.clear();
// Returns true if canvas is empty, otherwise returns false
signaturePad.isEmpty();
}
/* TEST 2 - You can set options during initialization: */
function SetDuringInit() {
var canvas = document.querySelector("canvas");
var signaturePad = new SignaturePad(canvas, {
minWidth: 5,
maxWidth: 10,
penColor: "rgb(66, 133, 244)"
});
}
/* TEST 3 - or during runtime: */
function RuntimeChange() {
var canvas = document.querySelector("canvas");
var signaturePad = new SignaturePad(canvas);
signaturePad.minWidth = 5;
signaturePad.maxWidth = 10;
signaturePad.penColor = "rgb(66, 133, 244)";
}
+122
View File
@@ -0,0 +1,122 @@
// Type definitions for signature_pad
// Project: https://github.com/szimek/signature_pad
// Definitions by: Abubaker Bashir <https://github.com/AbubakerB>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Project by: Szymon Nowak <https://github.com/szimek>
declare module SignaturePad {
class Point {
x: number;
y: number;
time: number;
constructor(x: number, y: number, time: number);
velocityFrom(start: Point): number;
distanceTo(start: Point): number;
}
class CurveControl {
c1: Point;
c2: Point;
constructor(c1: Point, c2: Point);
}
class Bezier {
startPoint: Point;
control1: CurveControl;
control2: CurveControl;
endPoint: Point;
constructor(startPoint: Point, control1: Point, control2: Point, endPoint: Point);
length(): number;
_point(t: number, start: number, c1: number, c2: number, end: number): number;
}
interface SignaturePadOptions {
/**
* (float) Weight used to modify new velocity based on the previous velocity. Defaults to 0.7.
*/
velocityFilterWeight?: number;
/**
* (float) Minimum width of a line. Defaults to 0.5.
*/
minWidth?: number;
/**
* (float) Maximum width of a line. Defaults to 2.5.
*/
maxWidth?: number;
/**
* (float or function) Radius of a single dot.
*/
dotSize?: Function;
/**
* (string) Color used to draw the lines. Can be any color format accepted by context.fillStyle.
* Defaults to "black".
*/
penColor?: string;
/**
* (string) Color used to clear the background. Can be any color format accepted by context.fillStyle.
* Defaults to "rgba(0,0,0,0)" (transparent black). Use a non-transparent color e.g. "rgb(255,255,255)"
* (opaque white) if you'd like to save signatures as JPEG images.
*/
backgroundColor?: string;
/**
* (function) Callback when stroke begin.
*/
onEnd?: Function;
/**
* (function) Callback when stroke end.
*/
onBegin?: Function;
}
}
declare class SignaturePad {
points: Array<SignaturePad.Point>;
_lastVelocity: number;
_lastWidth: number;
_isEmpty: boolean;
_mouseButtonDown: boolean;
_ctx: CanvasRenderingContext2D;
_canvas: HTMLCanvasElement;
velocityFilterWeight: number;
minWidth: number;
maxWidth: number;
dotSize: Function;
penColor: string;
backgroundColor: string;
onEnd: Function;
onBegin: Function;
constructor(canvas: Element, options?: SignaturePad.SignaturePadOptions);
/**
* Clears the canvas
*/
clear(): void;
/**
* Returns true if canvas is empty, otherwise returns false
*/
isEmpty(): boolean;
/**
* Draws signature image from data URL
*/
fromDataURL(dataUrl: string): void;
/**
* Returns signature image as data URL
*/
toDataURL(): string;
_strokeBegin(event: Event): void;
_strokeUpdate(event: Event): void;
_strokeDraw(point: SignaturePad.Point): void;
_strokeEnd(event: Event): void;
_handleMouseEvents(): void;
_handleTouchEvents(): void;
_reset(): void;
_createPoint(event: Event): SignaturePad.Point;
_addPoint(point: SignaturePad.Point): void;
_calculateCurveControlPoints(point1: SignaturePad.Point, point2: SignaturePad.Point, point3: SignaturePad.Point): void;
_addCurve(curve: SignaturePad.Bezier): void;
_drawPoint(x: number, y: number, size: number): void;
_drawCurve(curve: SignaturePad.Bezier, startWidth: number, endWidth: number): void;
_strokeWidth(velocity: number): void;
}
@@ -0,0 +1,5 @@
/// <reference path="source-map-support.d.ts" />
import sms = require('source-map-support');
sms.install();
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for source-map-support 0.2.5
// Project: https://github.com/evanw/source-map-support
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'source-map-support' {
export function install(): any;
}
+7
View File
@@ -75,6 +75,12 @@ declare module createjs {
static install(): Object;
}
/*
NOTE: It is commented out because it conflicts with SamplePlugin Class of PreloadJS.
this class is mainly for documentation purposes.
http://www.createjs.com/Docs/TweenJS/classes/SamplePlugin.html
*/
/*
export class SamplePlugin {
constructor();
@@ -87,6 +93,7 @@ declare module createjs {
static install(): void;
static tween(tween: Tween, prop: string, value: any, startValues: Object, endValues: Object, ratio: number, wait: boolean, end: boolean): any;
}
*/
export class Timeline extends EventDispatcher {
constructor (tweens: Tween[], labels: Object, props: Object);
+19
View File
@@ -0,0 +1,19 @@
/// <reference path="./update-notifier.d.ts" />
import updateNotifier = require('update-notifier');
var notifier = updateNotifier();
if (notifier.update) {
notifier.notify();
}
console.log(notifier.update);
var notifier = updateNotifier({
updateCheckInterval: 1000 * 60 * 60 * 24 * 7 // 1 week
});
if (notifier.update) {
notifier.notify('Update available: ' + notifier.update.latest);
}
+36
View File
@@ -0,0 +1,36 @@
// Type definitions for update-notifier
// Project: https://github.com/yeoman/update-notifier
// Definitions by: vvakame <https://github.com/vvakame>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "update-notifier" {
function t(settings?:t.ISettings):t.IResult;
module t {
export interface IResult {
update: IUpdateInfo;
notify(message?:string):void;
}
export interface ISettings {
callback?:(error:any, update?:IUpdateInfo)=>any; // default null
packagePath?:string; // default 'package.json'
packageName?:string; // default Inferred from packageFile
packageVersion?:string; // default Inferred from packageFile
updateCheckInterval?:number; // default 1000 * 60 * 60 * 24 (1 day)
updateCheckTimeout?:number; // default 20000 (20 secs)
registryUrl?:string; // default 'http://registry.npmjs.org/%s'
}
export interface IUpdateInfo {
latest:string;
current:string;
type:string;
date:string;
name:string;
}
}
export = t;
}
+16
View File
@@ -0,0 +1,16 @@
/// <reference path="uri-templates.d.ts" />
import utmpl = require('uri-templates');
import URITemplate = utmpl.URITemplate;
var str: string;
var u: URITemplate;
var obj: Object;
u = utmpl(str);
str = u.fillFromObject(obj);
str = u.fill((key) => {
return str;
});
obj = u.fromUri(str);
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for uri-templates 0.1.2
// Project: https://github.com/geraintluff/uri-templates
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'uri-templates' {
function utpl(template: string): utpl.URITemplate;
module utpl {
export interface URITemplate {
fillFromObject(vars: Object): string;
fill(callback: (varName: string) => string): string;
fromUri(uri: string): Object;
}
}
export = utpl;
}
+2
View File
@@ -78,3 +78,5 @@ declare module When {
reason?: any;
}
}
export = When;
+21
View File
@@ -448,6 +448,11 @@ interface ZeptoCollection {
* @see ZeptoCollection.after
**/
after(content: HTMLElement[]): ZeptoCollection;
/**
* @see ZeptoCollection.after
**/
after(content: ZeptoCollection): ZeptoCollection;
/**
* Append content to the DOM inside each individual element in the collection. The content can be an HTML string, a DOM node or an array of nodes.
@@ -465,6 +470,11 @@ interface ZeptoCollection {
* @see ZeptoCollection.append
**/
append(content: HTMLElement[]): ZeptoCollection;
/**
* @see ZeptoCollection.append
**/
append(content: ZeptoCollection): ZeptoCollection;
/**
* Append elements from the current collection to the target element. This is like append, but with reversed operands.
@@ -526,6 +536,11 @@ interface ZeptoCollection {
* @see ZeptoCollection.before
**/
before(content: HTMLElement[]): ZeptoCollection;
/**
* @see ZeptoCollection.before
**/
before(content: ZeptoCollection): ZeptoCollection;
/**
* Get immediate children of each element in the current collection. If selector is given, filter the results to only include ones matching the CSS selector.
@@ -948,6 +963,12 @@ interface ZeptoCollection {
**/
prepend(content: HTMLElement[]): ZeptoCollection;
/**
* @see ZeptoCollection.prepend
* @param content
**/
prepend(content: ZeptoCollection): ZeptoCollection;
/**
* Prepend elements of the current collection inside each of the target elements. This is like prepend, only with reversed operands.
* @param content