diff --git a/README.md b/README.md index 377dcdd56..30c81dd14 100755 --- a/README.md +++ b/README.md @@ -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)) diff --git a/angular-protractor/angular-protractor-tests.ts b/angular-protractor/angular-protractor-tests.ts index 2c8e72f07..2ed627af8 100644 --- a/angular-protractor/angular-protractor-tests.ts +++ b/angular-protractor/angular-protractor-tests.ts @@ -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'); -} \ No newline at end of file +} diff --git a/angular-protractor/angular-protractor.d.ts b/angular-protractor/angular-protractor.d.ts index 951ba85de..a78fc42f3 100644 --- a/angular-protractor/angular-protractor.d.ts +++ b/angular-protractor/angular-protractor.d.ts @@ -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; -} \ No newline at end of file +} diff --git a/assertion-error/assertion-error-tests.ts b/assertion-error/assertion-error-tests.ts new file mode 100644 index 000000000..f03e9cb52 --- /dev/null +++ b/assertion-error/assertion-error-tests.ts @@ -0,0 +1,15 @@ +/// + +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); + diff --git a/assertion-error/assertion-error.d.ts b/assertion-error/assertion-error.d.ts new file mode 100644 index 000000000..5b63d63cf --- /dev/null +++ b/assertion-error/assertion-error.d.ts @@ -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 +// 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; +} diff --git a/buffer-equal/buffer-equal-tests.ts b/buffer-equal/buffer-equal-tests.ts new file mode 100644 index 000000000..743ed187e --- /dev/null +++ b/buffer-equal/buffer-equal-tests.ts @@ -0,0 +1,8 @@ +/// + +import bufferEqual = require('buffer-equal'); + +var bool: boolean; +var buf: NodeBuffer; + +bool = bufferEqual(buf, buf); diff --git a/buffer-equal/buffer-equal.d.ts b/buffer-equal/buffer-equal.d.ts new file mode 100644 index 000000000..bc8b1ce28 --- /dev/null +++ b/buffer-equal/buffer-equal.d.ts @@ -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 +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'buffer-equal' { + function bufferEqual(actual:NodeBuffer, expected:NodeBuffer): boolean; + export = bufferEqual; +} diff --git a/configstore/configstore-tests.ts b/configstore/configstore-tests.ts new file mode 100644 index 000000000..e616707af --- /dev/null +++ b/configstore/configstore-tests.ts @@ -0,0 +1,18 @@ +/// + +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; \ No newline at end of file diff --git a/configstore/configstore.d.ts b/configstore/configstore.d.ts new file mode 100644 index 000000000..94849d847 --- /dev/null +++ b/configstore/configstore.d.ts @@ -0,0 +1,38 @@ +// Type definitions for configstore 0.3.0 +// Project: https://github.com/yeoman/configstore +// Definitions by: Bart van der Schoor +// 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; +} diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 50d9eb6e6..b5765b70f 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -3172,6 +3172,10 @@ declare module D3 { (): Array; (location: Array): Projection; }; + parallels: { + (): Array; + (location: Array): Projection; + }; translate: { (): Array; (point: Array): Projection; diff --git a/detect-indent/detect-indent-tests.ts b/detect-indent/detect-indent-tests.ts new file mode 100644 index 000000000..4ee02471b --- /dev/null +++ b/detect-indent/detect-indent-tests.ts @@ -0,0 +1,8 @@ +/// + +import di = require('detect-indent'); + +var str: string; + +str = di(str); +str = di(str, str); diff --git a/detect-indent/detect-indent.d.ts b/detect-indent/detect-indent.d.ts new file mode 100644 index 000000000..3ce72401d --- /dev/null +++ b/detect-indent/detect-indent.d.ts @@ -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 +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'detect-indent' { + function DetectIndent (dir: string, alt?: string): string; + export = DetectIndent; +} diff --git a/exit/exit-tests.ts b/exit/exit-tests.ts new file mode 100644 index 000000000..0b5b51dc8 --- /dev/null +++ b/exit/exit-tests.ts @@ -0,0 +1,5 @@ +/// + +import exit = require('exit'); + +exit(42); diff --git a/exit/exit.d.ts b/exit/exit.d.ts new file mode 100644 index 000000000..103984d86 --- /dev/null +++ b/exit/exit.d.ts @@ -0,0 +1,9 @@ +// Type definitions for exit 0.1.2 +// Project: https://github.com/cowboy/node-exit +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'exit' { + function exit(code: number): void; + export = exit; +} diff --git a/firebase/firebase-simplelogin-tests.ts b/firebase/firebase-simplelogin-tests.ts new file mode 100644 index 000000000..e0be13e48 --- /dev/null +++ b/firebase/firebase-simplelogin-tests.ts @@ -0,0 +1,86 @@ +/// + +var chatRef: Firebase = new Firebase('https://.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: '', + 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); \ No newline at end of file diff --git a/firebase/firebase-simplelogin.d.ts b/firebase/firebase-simplelogin.d.ts new file mode 100644 index 000000000..817ec934a --- /dev/null +++ b/firebase/firebase-simplelogin.d.ts @@ -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 +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +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; +} \ No newline at end of file diff --git a/graceful-fs/graceful-fs-tests.ts b/graceful-fs/graceful-fs-tests.ts new file mode 100644 index 000000000..ca0a5e7b8 --- /dev/null +++ b/graceful-fs/graceful-fs-tests.ts @@ -0,0 +1,8 @@ +/// + +import fs = require('graceful-fs'); + +var str: string; +var buf: NodeBuffer; + +fs.renameSync(str, str); \ No newline at end of file diff --git a/graceful-fs/graceful-fs.d.ts b/graceful-fs/graceful-fs.d.ts new file mode 100644 index 000000000..e77dc8893 --- /dev/null +++ b/graceful-fs/graceful-fs.d.ts @@ -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 +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'graceful-fs' { + import fs = require('fs'); + export = fs; +} diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index b42f77aaa..fb0429488 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -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. diff --git a/js-yaml/js-yaml-tests.ts b/js-yaml/js-yaml-tests.ts new file mode 100644 index 000000000..91596b756 --- /dev/null +++ b/js-yaml/js-yaml-tests.ts @@ -0,0 +1,84 @@ +/// + +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); diff --git a/js-yaml/js-yaml.d.ts b/js-yaml/js-yaml.d.ts new file mode 100644 index 000000000..0607b4891 --- /dev/null +++ b/js-yaml/js-yaml.d.ts @@ -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 +// 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; +} diff --git a/jsesc/jsesc-tests.ts b/jsesc/jsesc-tests.ts new file mode 100644 index 000000000..355b2a798 --- /dev/null +++ b/jsesc/jsesc-tests.ts @@ -0,0 +1,45 @@ +/// + +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); diff --git a/jsesc/jsesc.d.ts b/jsesc/jsesc.d.ts new file mode 100644 index 000000000..76b40cf45 --- /dev/null +++ b/jsesc/jsesc.d.ts @@ -0,0 +1,25 @@ +// Type definitions for jsesc 0.4.3 +// Project: https://github.com/mathiasbynens/jsesc +// Definitions by: Bart van der Schoor +// 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; +} diff --git a/json-pointer/json-pointer-tests.ts b/json-pointer/json-pointer-tests.ts new file mode 100644 index 000000000..79297c0f0 --- /dev/null +++ b/json-pointer/json-pointer-tests.ts @@ -0,0 +1,41 @@ +/// + +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; +}); \ No newline at end of file diff --git a/json-pointer/json-pointer.d.ts b/json-pointer/json-pointer.d.ts new file mode 100644 index 000000000..fa8b57f4c --- /dev/null +++ b/json-pointer/json-pointer.d.ts @@ -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 +// 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; +} diff --git a/knockout.validation/knockout.validation.d.ts b/knockout.validation/knockout.validation.d.ts index e65ec6743..d5e23a9ba 100644 --- a/knockout.validation/knockout.validation.d.ts +++ b/knockout.validation/knockout.validation.d.ts @@ -144,3 +144,8 @@ interface KnockoutSubscribableFunctions { rules: KnockoutObservableArray; } +declare module "knockout.validation" { + export = validation; +} + +declare var validation: KnockoutValidationStatic diff --git a/minimist/minimist-tests.ts b/minimist/minimist-tests.ts new file mode 100644 index 000000000..b96b7d13a --- /dev/null +++ b/minimist/minimist-tests.ts @@ -0,0 +1,27 @@ +/// + +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); diff --git a/minimist/minimist.d.ts b/minimist/minimist.d.ts new file mode 100644 index 000000000..2d65e3aac --- /dev/null +++ b/minimist/minimist.d.ts @@ -0,0 +1,26 @@ +// Type definitions for minimist 0.0.8 +// Project: https://github.com/substack/minimist +// Definitions by: Bart van der Schoor +// 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; +} diff --git a/mkdirp/mkdirp-tests.ts b/mkdirp/mkdirp-tests.ts new file mode 100644 index 000000000..e256e61ad --- /dev/null +++ b/mkdirp/mkdirp-tests.ts @@ -0,0 +1,16 @@ +/// + +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); \ No newline at end of file diff --git a/mkdirp/mkdirp.d.ts b/mkdirp/mkdirp.d.ts new file mode 100644 index 000000000..c3fca38a2 --- /dev/null +++ b/mkdirp/mkdirp.d.ts @@ -0,0 +1,15 @@ +// Type definitions for mkdirp 0.3.0 +// Project: http://github.com/substack/node-mkdirp +// Definitions by: Bart van der Schoor +// 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; +} diff --git a/ng-grid/ng-grid.d.ts b/ng-grid/ng-grid.d.ts index e72344d34..70f4f569f 100644 --- a/ng-grid/ng-grid.d.ts +++ b/ng-grid/ng-grid.d.ts @@ -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; diff --git a/node/node-tests.ts b/node/node-tests.ts index 9b896a3ef..a77a4b39b 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -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 diff --git a/node/node.d.ts b/node/node.d.ts index 4a15d4777..42398496e 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -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; diff --git a/open/open-tests.ts b/open/open-tests.ts new file mode 100644 index 000000000..a529fa9cf --- /dev/null +++ b/open/open-tests.ts @@ -0,0 +1,6 @@ +/// + +import open = require('open'); + +open('foo'); +open('foo', 'bar'); diff --git a/open/open.d.ts b/open/open.d.ts new file mode 100644 index 000000000..c32e80bfe --- /dev/null +++ b/open/open.d.ts @@ -0,0 +1,9 @@ +// Type definitions for open 0.0.3 +// Project: https://github.com/jjrdn/node-open +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'open' { + function open(target: string, app?: string): void; + export = open; +} diff --git a/preloadjs/preloadjs.d.ts b/preloadjs/preloadjs.d.ts index f5904fa8c..142e939b6 100644 --- a/preloadjs/preloadjs.d.ts +++ b/preloadjs/preloadjs.d.ts @@ -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); diff --git a/promises-a-plus/promises-a-plus-tests.ts b/promises-a-plus/promises-a-plus-tests.ts index fa1453645..29ca0989b 100644 --- a/promises-a-plus/promises-a-plus-tests.ts +++ b/promises-a-plus/promises-a-plus-tests.ts @@ -2,7 +2,8 @@ /// /// /// -/// +import When = require("../when/when"); + var thenNum: PromisesAPlus.Thenable; var thenStr: PromisesAPlus.Thenable; diff --git a/q/Q-tests.ts b/q/Q-tests.ts index 22f33506e..6b69fb228 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -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) => {}); diff --git a/q/Q.d.ts b/q/Q.d.ts index 85462503a..65b2b8223 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -209,6 +209,7 @@ declare module Q { export function nfbind(nodeFunction: Function, ...args: any[]): (...args: any[]) => Promise; export function nfcall(nodeFunction: Function, ...args: any[]): Promise; + export function nfapply(nodeFunction: Function, args: any[]): Promise; export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; diff --git a/rx.js/rx-lite.ts b/rx.js/rx-lite.ts index 1e387af48..c0a27c3c4 100644 --- a/rx.js/rx-lite.ts +++ b/rx.js/rx-lite.ts @@ -45,6 +45,19 @@ declare module Rx { export var Promise: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise; }; } + export module helpers { + function noop(): void; + function identity(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(...args: T[]): T[]; + function not(value: any): boolean; + } + export interface IDisposable { dispose(): void; } @@ -307,6 +320,7 @@ declare module Rx { create(subscribe: (observer: Observer) => IDisposable): Observable; createWithDisposable(subscribe: (observer: Observer) => IDisposable): Observable; defer(observableFactory: () => Observable): Observable; + defer(observableFactory: () => IPromise): Observable; empty(scheduler?: IScheduler): Observable; fromArray(array: T[], scheduler?: IScheduler): Observable; fromArray(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): Observable; @@ -347,9 +361,13 @@ declare module Rx { throwException(exception: any, scheduler?: IScheduler): Observable; // alias for throw catch(sources: Observable[]): Observable; + catch(sources: IPromise[]): Observable; catchException(sources: Observable[]): Observable; // alias for catch + catchException(sources: IPromise[]): Observable; // alias for catch catch(...sources: Observable[]): Observable; + catch(...sources: IPromise[]): Observable; catchException(...sources: Observable[]): Observable; // alias for catch + catchException(...sources: IPromise[]): Observable; // alias for catch concat(...sources: Observable[]): Observable; concat(...sources: IPromise[]): Observable; concat(sources: Observable[]): Observable; diff --git a/rx.js/rx.async.d.ts b/rx.js/rx.async.d.ts index b24191ae4..ff8b61c49 100644 --- a/rx.js/rx.async.d.ts +++ b/rx.js/rx.async.d.ts @@ -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 // Definitions by: Igor Oleinikov diff --git a/rx.js/rx.backpressure.d.ts b/rx.js/rx.backpressure.d.ts index 7d7b878fd..4c9a9ae7d 100644 --- a/rx.js/rx.backpressure.d.ts +++ b/rx.js/rx.backpressure.d.ts @@ -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 // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/rx.js/rx.binding.d.ts b/rx.js/rx.binding.d.ts index 505522e38..526546353 100644 --- a/rx.js/rx.binding.d.ts +++ b/rx.js/rx.binding.d.ts @@ -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 // Definitions by: Igor Oleinikov diff --git a/rx.js/rx.d.ts b/rx.js/rx.d.ts index 99bec0f3c..3d9c0e0d5 100644 --- a/rx.js/rx.d.ts +++ b/rx.js/rx.d.ts @@ -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 // Definitions by: Igor Oleinikov diff --git a/rx.js/rx.lite.d.ts b/rx.js/rx.lite.d.ts index c8f99ab5b..a50f8c84d 100644 --- a/rx.js/rx.lite.d.ts +++ b/rx.js/rx.lite.d.ts @@ -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 // Definitions by: Igor Oleinikov @@ -47,14 +47,4 @@ declare module Rx { export interface Observable { shareReplay(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; // same as replayWhileObserved in rx.binding.d.ts } - - export interface ObservableStatic { - generateWithTime( - initialState: TState, - condition: (state: TState) => boolean, - iterate: (state: TState) => TState, - resultSelector: (state: TState) => TResult, - timeSelector: (state: TState) => number, - scheduler?: IScheduler): Observable; - } } diff --git a/rx.js/rx.time-lite.ts b/rx.js/rx.time-lite.ts index 1082f1a7b..b79275fe4 100644 --- a/rx.js/rx.time-lite.ts +++ b/rx.js/rx.time-lite.ts @@ -47,5 +47,12 @@ declare module Rx { interval(dutTime: number, period: number, scheduler?: IScheduler): Observable; timer(dueTime: number, period: number, scheduler: IScheduler): Observable; timer(dueTime: number, scheduler: IScheduler): Observable; + generateWithRelativeTime( + initialState: TState, + condition: (state: TState) => boolean, + iterate: (state: TState) => TState, + resultSelector: (state: TState) => TResult, + timeSelector: (state: TState) => number, + scheduler?: IScheduler): Observable; } } diff --git a/rx.js/rx.time.d.ts b/rx.js/rx.time.d.ts index 994d9bf46..925d16220 100644 --- a/rx.js/rx.time.d.ts +++ b/rx.js/rx.time.d.ts @@ -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 // Definitions by: Igor Oleinikov @@ -28,13 +28,5 @@ declare module Rx { resultSelector: (state: TState) => TResult, timeSelector: (state: TState) => Date, scheduler?: IScheduler): Observable; - - generateWithRelativeTime( - initialState: TState, - condition: (state: TState) => boolean, - iterate: (state: TState) => TState, - resultSelector: (state: TState) => TResult, - timeSelector: (state: TState) => number, - scheduler?: IScheduler): Observable; } } diff --git a/rx.js/rx.virtualtime.d.ts b/rx.js/rx.virtualtime.d.ts index afa398264..c57cbd664 100644 --- a/rx.js/rx.virtualtime.d.ts +++ b/rx.js/rx.virtualtime.d.ts @@ -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 // Definitions by: Igor Oleinikov diff --git a/select2/select2.d.ts b/select2/select2.d.ts index 3cf787a95..b719ecfac 100644 --- a/select2/select2.d.ts +++ b/select2/select2.d.ts @@ -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; } diff --git a/signature_pad/signature_pad-tests.ts b/signature_pad/signature_pad-tests.ts new file mode 100644 index 000000000..57c42e7d4 --- /dev/null +++ b/signature_pad/signature_pad-tests.ts @@ -0,0 +1,39 @@ +/// + +/* 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)"; +} diff --git a/signature_pad/signature_pad.d.ts b/signature_pad/signature_pad.d.ts new file mode 100644 index 000000000..10d6a03d6 --- /dev/null +++ b/signature_pad/signature_pad.d.ts @@ -0,0 +1,122 @@ +// Type definitions for signature_pad +// Project: https://github.com/szimek/signature_pad +// Definitions by: Abubaker Bashir +// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Project by: Szymon Nowak + +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; + _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; +} \ No newline at end of file diff --git a/source-map-support/source-map-support-tests.ts b/source-map-support/source-map-support-tests.ts new file mode 100644 index 000000000..ddd6308cc --- /dev/null +++ b/source-map-support/source-map-support-tests.ts @@ -0,0 +1,5 @@ +/// + +import sms = require('source-map-support'); + +sms.install(); diff --git a/source-map-support/source-map-support.d.ts b/source-map-support/source-map-support.d.ts new file mode 100644 index 000000000..8d4e22579 --- /dev/null +++ b/source-map-support/source-map-support.d.ts @@ -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 +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'source-map-support' { + export function install(): any; +} diff --git a/tweenjs/tweenjs.d.ts b/tweenjs/tweenjs.d.ts index a53dd8e20..775a05a20 100644 --- a/tweenjs/tweenjs.d.ts +++ b/tweenjs/tweenjs.d.ts @@ -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); diff --git a/update-notifier/update-notifier-tests.ts b/update-notifier/update-notifier-tests.ts new file mode 100644 index 000000000..58fdbd623 --- /dev/null +++ b/update-notifier/update-notifier-tests.ts @@ -0,0 +1,19 @@ +/// + +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); +} diff --git a/update-notifier/update-notifier.d.ts b/update-notifier/update-notifier.d.ts new file mode 100644 index 000000000..965b3631b --- /dev/null +++ b/update-notifier/update-notifier.d.ts @@ -0,0 +1,36 @@ +// Type definitions for update-notifier +// Project: https://github.com/yeoman/update-notifier +// Definitions by: 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; +} diff --git a/uri-templates/uri-templates-tests.ts b/uri-templates/uri-templates-tests.ts new file mode 100644 index 000000000..4809b7883 --- /dev/null +++ b/uri-templates/uri-templates-tests.ts @@ -0,0 +1,16 @@ +/// + +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); diff --git a/uri-templates/uri-templates.d.ts b/uri-templates/uri-templates.d.ts new file mode 100644 index 000000000..b732ac435 --- /dev/null +++ b/uri-templates/uri-templates.d.ts @@ -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 +// 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; +} diff --git a/when/when.d.ts b/when/when.d.ts index 859618852..2af3fba9d 100644 --- a/when/when.d.ts +++ b/when/when.d.ts @@ -78,3 +78,5 @@ declare module When { reason?: any; } } + +export = When; diff --git a/zepto/zepto.d.ts b/zepto/zepto.d.ts index eb217e5b9..3608ade9f 100644 --- a/zepto/zepto.d.ts +++ b/zepto/zepto.d.ts @@ -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