diff --git a/.gitignore b/.gitignore
index 2ea470b9ec..2a52c95e0c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@
*.map
*.swp
.DS_Store
+npm-debug.log
_Resharper.DefinitelyTyped
bin
diff --git a/.travis.yml b/.travis.yml
index f996631624..48704282ad 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
language: node_js
node_js:
- - "iojs-v2"
+ - 4
sudo: false
diff --git a/adm-zip/adm-zip-tests.ts b/adm-zip/adm-zip-tests.ts
index f8583ae617..93f8f2f2d7 100644
--- a/adm-zip/adm-zip-tests.ts
+++ b/adm-zip/adm-zip-tests.ts
@@ -1,10 +1,9 @@
///
import AdmZip = require("adm-zip");
-
// reading archives
var zip = new AdmZip("./my_file.zip");
-var zipEntries = zip.getEntries(); // an array of ZipEntry records
+var zipEntries: AdmZip.IZipEntry[] = zip.getEntries(); // an array of ZipEntry records
zipEntries.forEach(function (zipEntry) {
console.log(zipEntry.toString()); // outputs zip entries information
@@ -31,3 +30,32 @@ zip.addLocalFile("/home/me/some_picture.png");
var willSendthis = zip.toBuffer();
// or write everything to disk
zip.writeZip(/*target file name*/"/home/me/files.zip");
+
+function processZipEntry(zipEntry: AdmZip.IZipEntry) {
+ console.log('comment', zipEntry.comment);
+}
+
+//tests taken from examples at https://github.com/cthackers/adm-zip/wiki/ADM-ZIP
+import Zip = require("adm-zip");
+// loads and parses existing zip file local_file.zip
+var zip = new Zip("local_file.zip");
+// creates new in memory zip
+zip = new Zip();
+// loads and parses existing zip file local_file.zip
+zip = new Zip("local_file.zip");
+// get all entries and iterate them
+zip.getEntries().forEach((entry) => {
+ var entryName = entry.entryName;
+ var decompressedData = zip.readFile(entry); // decompressed buffer of the entry
+ console.log(zip.readAsText(entry)); // outputs the decompressed content of the entry
+});
+
+// will extract the file myfile.txt from the archive to /home/user/folder/subfolder/myfile.txt
+zip.extractEntryTo("folder/subfolder/myfile.txt", "/home/user/", true, true);
+
+// will extract the file myfile.txt from the archive to /home/user/myfile.txt
+zip.extractEntryTo("folder/subfolder/myfile.txt", "/home/user/", false, true);
+
+function isAdmZipEntry(obj: any): obj is AdmZip.IZipEntry {
+ return obj !== null && typeof obj === "object" && typeof obj['entryName'] === 'string';
+}
\ No newline at end of file
diff --git a/adm-zip/adm-zip.d.ts b/adm-zip/adm-zip.d.ts
index 9f2eb7dfdb..208c13b27b 100644
--- a/adm-zip/adm-zip.d.ts
+++ b/adm-zip/adm-zip.d.ts
@@ -5,8 +5,8 @@
///
-declare module AdmZip {
- class ZipFile {
+declare module "adm-zip" {
+ class AdmZip {
/**
* Create a new, empty archive.
*/
@@ -28,7 +28,7 @@ declare module AdmZip {
* @param entry ZipEntry object
* @return Buffer or Null in case of error
*/
- readFile(entry: IZipEntry): Buffer;
+ readFile(entry: AdmZip.IZipEntry): Buffer;
/**
* Asynchronous readFile
* @param entry String with the full path of the entry
@@ -41,7 +41,7 @@ declare module AdmZip {
* @param callback Called with a Buffer or Null in case of error
* @return Buffer or Null in case of error
*/
- readFileAsync(entry: IZipEntry, callback: (data: Buffer, err: string) => any): void;
+ readFileAsync(entry: AdmZip.IZipEntry, callback: (data: Buffer, err: string) => any): void;
/**
* Extracts the given entry from the archive and returns the content as
* plain text in the given encoding
@@ -57,7 +57,7 @@ declare module AdmZip {
* @param encoding Optional. If no encoding is specified utf8 is used
* @return String
*/
- readAsText(fileName: IZipEntry, encoding?: string): string;
+ readAsText(fileName: AdmZip.IZipEntry, encoding?: string): string;
/**
* Asynchronous readAsText
* @param entry String with the full path of the entry
@@ -71,7 +71,7 @@ declare module AdmZip {
* @param callback Called with the resulting string.
* @param encoding Optional. If no encoding is specified utf8 is used
*/
- readAsTextAsync(fileName: IZipEntry, callback: (data: string) => any, encoding?: string): void;
+ readAsTextAsync(fileName: AdmZip.IZipEntry, callback: (data: string) => any, encoding?: string): void;
/**
* Remove the entry from the file or the entry and all its nested directories
* and files if the given entry is a directory
@@ -83,7 +83,7 @@ declare module AdmZip {
* and files if the given entry is a directory
* @param entry A ZipEntry object.
*/
- deleteFile(entry: IZipEntry): void;
+ deleteFile(entry: AdmZip.IZipEntry): void;
/**
* Adds a comment to the zip. The zip must be rewritten after
* adding the comment.
@@ -110,7 +110,7 @@ declare module AdmZip {
* @param entry ZipEntry object.
* @param comment The comment to add to the entry.
*/
- addZipEntryComment(entry: IZipEntry, comment: string): void;
+ addZipEntryComment(entry: AdmZip.IZipEntry, comment: string): void;
/**
* Returns the comment of the specified entry.
* @param entry String with the full path of the entry.
@@ -122,7 +122,7 @@ declare module AdmZip {
* @param entry ZipEntry object.
* @return String The comment of the specified entry.
*/
- getZipEntryComment(entry: IZipEntry): string;
+ getZipEntryComment(entry: AdmZip.IZipEntry): string;
/**
* Updates the content of an existing entry inside the archive. The zip
* must be rewritten after updating the content
@@ -136,7 +136,7 @@ declare module AdmZip {
* @param entry ZipEntry object.
* @param content The entry's new contents.
*/
- updateFile(entry: IZipEntry, content: Buffer): void;
+ updateFile(entry: AdmZip.IZipEntry, content: Buffer): void;
/**
* Adds a file from the disk to the archive.
* @param localPath Path to a file on disk.
@@ -167,14 +167,14 @@ declare module AdmZip {
* Returns an array of ZipEntry objects representing the files and folders
* inside the archive
*/
- getEntries(): IZipEntry[];
+ getEntries(): AdmZip.IZipEntry[];
/**
* Returns a ZipEntry object representing the file or folder specified by
* ``name``.
* @param name Name of the file or folder to retrieve.
* @return ZipEntry The entry corresponding to the name.
*/
- getEntry(name: string): IZipEntry;
+ getEntry(name: string): AdmZip.IZipEntry;
/**
* Extracts the given entry to the given targetPath.
* If the entry is a directory inside the archive, the entire directory and
@@ -203,7 +203,7 @@ declare module AdmZip {
* will be overwriten if this is true. Default is FALSE
* @return Boolean
*/
- extractEntryTo(entryPath: IZipEntry, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean;
+ extractEntryTo(entryPath: AdmZip.IZipEntry, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean;
/**
* Extracts the entire archive to the given location
* @param targetPath Target location
@@ -225,76 +225,75 @@ declare module AdmZip {
toBuffer(): Buffer;
}
- /**
- * The ZipEntry is more than a structure representing the entry inside the
- * zip file. Beside the normal attributes and headers a entry can have, the
- * class contains a reference to the part of the file where the compressed
- * data resides and decompresses it when requested. It also compresses the
- * data and creates the headers required to write in the zip file.
- */
- interface IZipEntry {
+ module AdmZip {
/**
- * Represents the full name and path of the file
+ * The ZipEntry is more than a structure representing the entry inside the
+ * zip file. Beside the normal attributes and headers a entry can have, the
+ * class contains a reference to the part of the file where the compressed
+ * data resides and decompresses it when requested. It also compresses the
+ * data and creates the headers required to write in the zip file.
*/
- entryName: string;
- rawEntryName: Buffer;
- /**
- * Extra data associated with this entry.
- */
- extra: Buffer;
- /**
- * Entry comment.
- */
- comment: string;
- name: string;
- /**
- * Read-Only property that indicates the type of the entry.
- */
- isDirectory: boolean;
- /**
- * Get the header associated with this ZipEntry.
- */
- header: Buffer;
- /**
- * Retrieve the compressed data for this entry. Note that this may trigger
- * compression if any properties were modified.
- */
- getCompressedData(): Buffer;
- /**
- * Asynchronously retrieve the compressed data for this entry. Note that
- * this may trigger compression if any properties were modified.
- */
- getCompressedDataAsync(callback: (data: Buffer) => void): void;
- /**
- * Set the (uncompressed) data to be associated with this entry.
- */
- setData(value: string): void;
- /**
- * Set the (uncompressed) data to be associated with this entry.
- */
- setData(value: Buffer): void;
- /**
- * Get the decompressed data associated with this entry.
- */
- getData(): Buffer;
- /**
- * Asynchronously get the decompressed data associated with this entry.
- */
- getDataAsync(callback: (data: Buffer) => void): void;
- /**
- * Returns the CEN Entry Header to be written to the output zip file, plus
- * the extra data and the entry comment.
- */
- packHeader(): Buffer;
- /**
- * Returns a nicely formatted string with the most important properties of
- * the ZipEntry.
- */
- toString(): string;
+ interface IZipEntry {
+ /**
+ * Represents the full name and path of the file
+ */
+ entryName: string;
+ rawEntryName: Buffer;
+ /**
+ * Extra data associated with this entry.
+ */
+ extra: Buffer;
+ /**
+ * Entry comment.
+ */
+ comment: string;
+ name: string;
+ /**
+ * Read-Only property that indicates the type of the entry.
+ */
+ isDirectory: boolean;
+ /**
+ * Get the header associated with this ZipEntry.
+ */
+ header: Buffer;
+ /**
+ * Retrieve the compressed data for this entry. Note that this may trigger
+ * compression if any properties were modified.
+ */
+ getCompressedData(): Buffer;
+ /**
+ * Asynchronously retrieve the compressed data for this entry. Note that
+ * this may trigger compression if any properties were modified.
+ */
+ getCompressedDataAsync(callback: (data: Buffer) => void): void;
+ /**
+ * Set the (uncompressed) data to be associated with this entry.
+ */
+ setData(value: string): void;
+ /**
+ * Set the (uncompressed) data to be associated with this entry.
+ */
+ setData(value: Buffer): void;
+ /**
+ * Get the decompressed data associated with this entry.
+ */
+ getData(): Buffer;
+ /**
+ * Asynchronously get the decompressed data associated with this entry.
+ */
+ getDataAsync(callback: (data: Buffer) => void): void;
+ /**
+ * Returns the CEN Entry Header to be written to the output zip file, plus
+ * the extra data and the entry comment.
+ */
+ packHeader(): Buffer;
+ /**
+ * Returns a nicely formatted string with the most important properties of
+ * the ZipEntry.
+ */
+ toString(): string;
+ }
}
-}
-declare module "adm-zip" {
- import zipFile = AdmZip.ZipFile;
- export = zipFile;
+ export = AdmZip;
}
diff --git a/angular-jwt/angular-jwt.d.ts b/angular-jwt/angular-jwt.d.ts
index 55bb3e4f6a..620fcc8e4c 100644
--- a/angular-jwt/angular-jwt.d.ts
+++ b/angular-jwt/angular-jwt.d.ts
@@ -25,6 +25,6 @@ declare module angular.jwt {
}
interface IJwtInterceptor {
- tokenGetter(): string;
+ tokenGetter(...params : any[]): string;
}
}
diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts
index a9cd52437a..3c70dd27e8 100644
--- a/angular-material/angular-material-tests.ts
+++ b/angular-material/angular-material-tests.ts
@@ -96,5 +96,5 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia
});
myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => {
- $scope['openToast'] = () => $mdToast.show($mdToast.simple().content('Hello!'));
-});
\ No newline at end of file
+ $scope['openToast'] = () => $mdToast.show($mdToast.simple().textContent('Hello!'));
+});
diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts
index 54ef2507b3..43e0b9f53b 100644
--- a/angular-material/angular-material.d.ts
+++ b/angular-material/angular-material.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Angular Material 0.10.1-rc1+ (angular.material module)
+// Type definitions for Angular Material 1.0.0-rc5+ (angular.material module)
// Project: https://github.com/angular/material
// Definitions by: Matt Traynham
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -116,7 +116,7 @@ declare module angular.material {
}
interface IToastPreset {
- content(content: string): T;
+ textContent(content: string): T;
action(action: string): T;
highlightAction(highlightAction: boolean): T;
capsule(capsule: boolean): T;
diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts
index 048b9cd4a1..a489141d54 100644
--- a/angularjs/angular.d.ts
+++ b/angularjs/angular.d.ts
@@ -165,6 +165,12 @@ declare module angular {
dot: number;
codeName: string;
};
+
+ /**
+ * If window.name contains prefix NG_DEFER_BOOTSTRAP! when angular.bootstrap is called, the bootstrap process will be paused until angular.resumeBootstrap() is called.
+ * @param extraModules An optional array of modules that should be added to the original list of modules that the app was about to be bootstrapped with.
+ */
+ resumeBootstrap?(extraModules?: string[]): ng.auto.IInjectorService;
}
///////////////////////////////////////////////////////////////////////////
diff --git a/browserify/browserify-tests.ts b/browserify/browserify-tests.ts
index 5249015661..b4096a7f98 100644
--- a/browserify/browserify-tests.ts
+++ b/browserify/browserify-tests.ts
@@ -2,11 +2,51 @@
import browserify = require("browserify");
import fs = require("fs");
+import stream = require('stream');
-var b: BrowserifyObject = browserify();
+var bNoArg = browserify();
+
+var b = browserify({
+ baseDir: 'somewhere'
+});
b.add('./browser/main.js');
-b.transform('deamdify');
-b.bundle().pipe(fs.createWriteStream('bundle.js'));
+b.transform('deamdify')
+ .transform(function (file) {
+ return new stream.Transform();
+ }).plugin((b, opts) => { return opts.l; }, {l: 3})
+ .require('foo', { expose: 'bar' })
+ .exclude('baz')
+ .ignore('bat')
+ .reset({ basedir: 'elsewhere' });
-var customBrowsify: Browserify = require("browserify");
+b.on('file', (file) => {
+ file += "";
+});
+
+b.external(bNoArg);
+
+var b2 = new browserify(['/some/File', {file: '/some/file' }, fs.createReadStream('/somewhere')], { builtins: ['buffer']})
+ .reset({
+ builtins: {
+ 'buffer': './customBuffer'
+ }
+ });
+
+var customBrowsify = require("browserify");
customBrowsify({entries: []});
+
+var b = browserify('./browser/main.js', {
+ noParse: ['jquery'],
+ debug: true,
+ foo: 'bar'
+});
+b.add('./browser/other.js');
+b.transform(function(file: string): NodeJS.ReadWriteStream {
+ return new stream.PassThrough();
+});
+
+var record_pipeline = b.pipeline.get('record');
+
+b.bundle().pipe(process.stdout);
+
+
diff --git a/browserify/browserify.d.ts b/browserify/browserify.d.ts
index c301df51eb..1ce6b653d3 100644
--- a/browserify/browserify.d.ts
+++ b/browserify/browserify.d.ts
@@ -1,41 +1,182 @@
-// Type definitions for Browserify
+// Type definitions for Browserify v12.0.1
// Project: http://browserify.org/
-// Definitions by: Andrew Gaspar
+// Definitions by: Andrew Gaspar , John Vilk
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///
-interface BrowserifyObject extends NodeJS.EventEmitter {
- add(file:string, opts?:any): BrowserifyObject;
- require(file:string, opts?:{
- expose: string;
- }): BrowserifyObject;
- bundle(opts?:{
- insertGlobals?: boolean;
- detectGlobals?: boolean;
- debug?: boolean;
- standalone?: string;
- insertGlobalVars?: any;
- }, cb?:(err:any, src:any) => void): NodeJS.ReadableStream;
+declare module Browserify {
+ /**
+ * Options pertaining to an individual file.
+ */
+ interface FileOptions {
+ // If true, this is considered an entry point to your app.
+ entry?: boolean;
+ // Expose this file under a custom dependency name.
+ // require('./vendor/angular/angular.js', {expose: 'angular'}) enables require('angular')
+ expose?: string;
+ // Basedir to use to resolve this file's path.
+ basedir?: string;
+ // The name/path to the file.
+ file?: string;
+ // Forward file to external() to be externalized.
+ external?: boolean;
+ // Disable transforms on file if set to false.
+ transform?: boolean;
+ // The ID to use for require() statements.
+ id?: string;
+ }
- external(file:string, opts?:any): BrowserifyObject;
- ignore(file:string, opts?:any): BrowserifyObject;
- transform(tr:string, opts?:any): BrowserifyObject;
- transform(tr:Function, opts?:any): BrowserifyObject;
- plugin(plugin:string, opts?:any): BrowserifyObject;
- plugin(plugin:Function, opts?:any): BrowserifyObject;
-}
-interface Browserify {
- (): BrowserifyObject;
- (files:string[]): BrowserifyObject;
- (opts:{
- entries?: string[];
+ // Browserify accepts a filename, an input stream for file inputs, or a FileOptions configuration
+ // for each file in a bundle.
+ type InputFile = string | NodeJS.ReadableStream | FileOptions;
+
+ /**
+ * Options pertaining to a Browserify instance.
+ */
+ interface Options {
+ // Custom properties can be defined on Options.
+ // These options are forwarded along to module-deps and browser-pack directly.
+ [propName: string]: any;
+ // String, file object, or array of those types (they may be mixed) specifying entry file(s).
+ entries?: InputFile | InputFile[];
+ // an array which will skip all require() and global parsing for each file in the array.
+ // Use this for giant libs like jquery or threejs that don't have any requires or node-style globals but take forever to parse.
noParse?: string[];
- }): BrowserifyObject;
+ // an array of optional extra extensions for the module lookup machinery to use when the extension has not been specified.
+ // By default Browserify considers only .js and .json files in such cases.
+ extensions?: string[];
+ // the directory that Browserify starts bundling from for filenames that start with ..
+ basedir?: string;
+ // an array of directories that Browserify searches when looking for modules which are not referenced using relative path.
+ // Can be absolute or relative to basedir. Equivalent of setting NODE_PATH environmental variable when calling Browserify command.
+ paths?: string[];
+ // sets the algorithm used to parse out the common paths. Use false to turn this off, otherwise it uses the commondir module.
+ commondir?: boolean;
+ // disables converting module ids into numerical indexes. This is useful for preserving the original paths that a bundle was generated with.
+ fullPaths?: boolean;
+ // sets the list of built-ins to use, which by default is set in lib/builtins.js in this distribution.
+ builtins?: string[] | {[builtinName: string]: string} | boolean;
+ // set if external modules should be bundled. Defaults to true.
+ bundleExternal?: boolean;
+ // When true, always insert process, global, __filename, and __dirname without analyzing the AST for faster builds but larger output bundles. Default false.
+ insertGlobals?: boolean;
+ // When true, scan all files for process, global, __filename, and __dirname, defining as necessary.
+ // With this option npm modules are more likely to work but bundling takes longer. Default true.
+ detectGlobals?: boolean;
+ // When true, add a source map inline to the end of the bundle. This makes debugging easier because you can see all the original files if you are in a modern enough browser.
+ debug?: boolean;
+ // When a non-empty string, a standalone module is created with that name and a umd wrapper.
+ // You can use namespaces in the standalone global export using a . in the string name as a separator, for example 'A.B.C'.
+ // The global export will be sanitized and camel cased.
+ standalone?: string;
+ // will be passed to insert-module-globals as the opts.vars parameter.
+ insertGlobalVars?: {[globalName: string]: (file: string, basedir: string) => any};
+ // defaults to 'require' in expose mode but you can use another name.
+ externalRequireName?: string;
+ }
+
+ interface BrowserifyConstructor {
+ (files: InputFile[], opts?: Options): BrowserifyObject;
+ (file: InputFile, opts?: Options): BrowserifyObject;
+ (opts: Options): BrowserifyObject;
+ (): BrowserifyObject
+ new(files: InputFile[], opts?: Options): BrowserifyObject;
+ new(file: InputFile, opts?: Options): BrowserifyObject;
+ new(opts: Options): BrowserifyObject;
+ new(): BrowserifyObject
+ }
+
+ interface BrowserifyObject extends NodeJS.EventEmitter {
+ /**
+ * Add an entry file from file that will be executed when the bundle loads.
+ * If file is an array, each item in file will be added as an entry file.
+ */
+ add(file: InputFile[], opts?: FileOptions): BrowserifyObject;
+ add(file: InputFile, opts?: FileOptions): BrowserifyObject;
+ /**
+ * Make file available from outside the bundle with require(file).
+ * The file param is anything that can be resolved by require.resolve().
+ * file can also be a stream, but you should also use opts.basedir so that relative requires will be resolvable.
+ * If file is an array, each item in file will be required. In file array form, you can use a string or object for each item. Object items should have a file property and the rest of the parameters will be used for the opts.
+ * Use the expose property of opts to specify a custom dependency name. require('./vendor/angular/angular.js', {expose: 'angular'}) enables require('angular')
+ */
+ require(file: InputFile, opts?: FileOptions): BrowserifyObject;
+ /**
+ * Bundle the files and their dependencies into a single javascript file.
+ * Return a readable stream with the javascript file contents or optionally specify a cb(err, buf) to get the buffered results.
+ */
+ bundle(cb?: (err: any, src: Buffer) => any): NodeJS.ReadableStream;
+ /**
+ * Prevent file from being loaded into the current bundle, instead referencing from another bundle.
+ * If file is an array, each item in file will be externalized.
+ * If file is another bundle, that bundle's contents will be read and excluded from the current bundle as the bundle in file gets bundled.
+ */
+ external(file: string[], opts?: { basedir?: string }): BrowserifyObject;
+ external(file: string, opts?: { basedir?: string }): BrowserifyObject;
+ external(file: BrowserifyObject): BrowserifyObject;
+ /**
+ * Prevent the module name or file at file from showing up in the output bundle.
+ * Instead you will get a file with module.exports = {}.
+ */
+ ignore(file: string, opts?: { basedir?: string }): BrowserifyObject;
+ /**
+ * Prevent the module name or file at file from showing up in the output bundle.
+ * If your code tries to require() that file it will throw unless you've provided another mechanism for loading it.
+ */
+ exclude(file: string, opts?: { basedir?: string }): BrowserifyObject;
+ /**
+ * Transform source code before parsing it for require() calls with the transform function or module name tr.
+ * If tr is a function, it will be called with tr(file) and it should return a through-stream that takes the raw file contents and produces the transformed source.
+ * If tr is a string, it should be a module name or file path of a transform module
+ */
+ transform(tr: string, opts?: T): BrowserifyObject;
+ transform(tr: (file: string, opts: T) => NodeJS.ReadWriteStream, opts?: T): BrowserifyObject;
+ /**
+ * Register a plugin with opts. Plugins can be a string module name or a function the same as transforms.
+ * plugin(b, opts) is called with the Browserify instance b.
+ */
+ plugin(plugin: string, opts?: T): BrowserifyObject;
+ plugin(plugin: (b: BrowserifyObject, opts: T) => any, opts?: T): BrowserifyObject;
+ /**
+ * Reset the pipeline back to a normal state. This function is called automatically when bundle() is called multiple times.
+ * This function triggers a 'reset' event.
+ */
+ reset(opts?: Options): void;
+
+ /**
+ * When a file is resolved for the bundle, the bundle emits a 'file' event with the full file path, the id string passed to require(), and the parent object used by browser-resolve.
+ * You could use the file event to implement a file watcher to regenerate bundles when files change.
+ */
+ on(event: 'file', listener: (file: string, id: string, parent: any) => any): BrowserifyObject;
+ /**
+ * When a package.json file is read, this event fires with the contents.
+ * The package directory is available at pkg.__dirname.
+ */
+ on(event: 'package', listener: (pkg: any) => any): BrowserifyObject;
+ /**
+ * When .bundle() is called, this event fires with the bundle output stream.
+ */
+ on(event: 'bundle', listener: (bundle: NodeJS.ReadableStream) => any): BrowserifyObject;
+ /**
+ * When the .reset() method is called or implicitly called by another call to .bundle(), this event fires.
+ */
+ on(event: 'reset', listener: () => any): BrowserifyObject;
+ /**
+ * When a transform is applied to a file, the 'transform' event fires on the bundle stream with the transform stream tr and the file that the transform is being applied to.
+ */
+ on(event: 'transform', listener: (tr: NodeJS.ReadWriteStream, file: string) => any): BrowserifyObject;
+ on(event: string, listener: Function): BrowserifyObject;
+
+ /**
+ * Set to any until substack/labeled-stream-splicer is defined
+ */
+ pipeline: any;
+ }
}
declare module "browserify" {
- var browserify: Browserify;
+ var browserify: Browserify.BrowserifyConstructor;
export = browserify;
}
diff --git a/buffer-compare/buffer-compare-tests.ts b/buffer-compare/buffer-compare-tests.ts
new file mode 100644
index 0000000000..88e6dddb94
--- /dev/null
+++ b/buffer-compare/buffer-compare-tests.ts
@@ -0,0 +1,27 @@
+///
+///
+
+import compare = require('buffer-compare');
+
+let result: number;
+
+result = compare(new Buffer(''), new Buffer(''));
+result = compare([], []);
+result = compare('', '');
+result = compare(new Buffer(''), []);
+result = compare([], '');
+result = compare('', new Buffer(''));
+
+result = compare(new Buffer(''), new Buffer(''));
+result = compare([], []);
+result = compare('', '');
+result = compare(new Buffer(''), []);
+result = compare([], '');
+result = compare('', new Buffer(''));
+
+result = compare(new Buffer(''), new Buffer(''));
+result = compare([], []);
+result = compare('', '');
+result = compare(new Buffer(''), []);
+result = compare([], '');
+result = compare('', new Buffer(''));
diff --git a/buffer-compare/buffer-compare.d.ts b/buffer-compare/buffer-compare.d.ts
new file mode 100644
index 0000000000..58e4004dcb
--- /dev/null
+++ b/buffer-compare/buffer-compare.d.ts
@@ -0,0 +1,17 @@
+// Type definitions for buffer-compare
+// Project: https://github.com/soldair/node-buffer-compare
+// Definitions by: Ilya Mochalov
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+declare module "buffer-compare" {
+ interface List {
+ [index: number]: any;
+ length: number
+ }
+
+ function compare(cmp: List, to: List): number;
+ function compare(cmp: T, to: T): number;
+ function compare(cmp: C, to: T): number;
+
+ export = compare;
+}
diff --git a/bytebuffer/bytebuffer-tests.ts b/bytebuffer/bytebuffer-tests.ts
new file mode 100644
index 0000000000..34db7368d5
--- /dev/null
+++ b/bytebuffer/bytebuffer-tests.ts
@@ -0,0 +1,8 @@
+///
+
+import ByteBuffer = require("bytebuffer");
+
+var bb = new ByteBuffer()
+ .writeIString("Hello world!")
+ .flip();
+console.log(bb.readIString()+" from bytebuffer.js");
\ No newline at end of file
diff --git a/bytebuffer/bytebuffer.d.ts b/bytebuffer/bytebuffer.d.ts
new file mode 100644
index 0000000000..8f1a800eae
--- /dev/null
+++ b/bytebuffer/bytebuffer.d.ts
@@ -0,0 +1,615 @@
+// Type definitions for bytebuffer.js 5.0.0
+// Project: https://github.com/dcodeIO/bytebuffer.js
+// Definitions by: Denis Cappellin
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+// Definitions by: SINTEF-9012
+
+///
+
+declare class ByteBuffer
+{
+ /**
+ * Constructs a new ByteBuffer.
+ */
+ constructor( capacity?: number, littleEndian?: boolean, noAssert?: boolean );
+
+ /**
+ * Big endian constant that can be used instead of its boolean value. Evaluates to false.
+ */
+ static BIG_ENDIAN: boolean;
+
+ /**
+ * Default initial capacity of 16.
+ */
+ static DEFAULT_CAPACITY: number;
+
+ /**
+ * Default no assertions flag of false.
+ */
+ static DEFAULT_NOASSERT: boolean;
+
+ /**
+ * Little endian constant that can be used instead of its boolean value. Evaluates to true.
+ */
+ static LITTLE_ENDIAN: boolean;
+
+ /**
+ * Maximum number of bytes required to store a 32bit base 128 variable-length integer.
+ */
+ static MAX_VARINT32_BYTES: number;
+
+ /**
+ * Maximum number of bytes required to store a 64bit base 128 variable-length integer.
+ */
+ static MAX_VARINT64_BYTES: number;
+
+ /**
+ * Metrics representing number of bytes.Evaluates to 2.
+ */
+ static METRICS_BYTES: number;
+
+ /**
+ * Metrics representing number of UTF8 characters.Evaluates to 1.
+ */
+ static METRICS_CHARS: number;
+
+ /**
+ * ByteBuffer version.
+ */
+ static VERSION: string;
+
+ /**
+ * Backing buffer.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation.
+ */
+ limit: number;
+
+ /**
+ * Whether to use little endian byte order, defaults to false for big endian.
+ */
+ littleEndian: boolean;
+
+ /**
+ * Marked offset.
+ */
+ markedOffset: number;
+
+ /**
+ * Whether to skip assertions of offsets and values, defaults to false.
+ */
+ noAssert: boolean;
+
+ /**
+ * Absolute read/write offset.
+ */
+ offset: number;
+
+ /**
+ * Data view to manipulate the backing buffer. Becomes null if the backing buffer has a capacity of 0.
+ */
+ view: DataView;
+
+ /**
+ * Allocates a new ByteBuffer backed by a buffer of the specified capacity.
+ */
+ static allocate( capacity?: number, littleEndian?: number, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a base64 encoded string to binary like window.atob does.
+ */
+ static atob( b64: string ): string;
+
+ /**
+ * Encodes a binary string to base64 like window.btoa does.
+ */
+ static btoa( str: string ): string;
+
+ /**
+ * Calculates the number of UTF8 bytes of a string.
+ */
+ static calculateUTF8Byte( str: string ): number;
+
+ /**
+ * Calculates the number of UTF8 characters of a string.JavaScript itself uses UTF- 16, so that a string's length property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF.
+ */
+ static calculateUTF8Char( str: string ): number;
+
+ /**
+ * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer.
+ */
+ static calculateVariant32( value: number ): number;
+
+ /**
+ * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer.
+ */
+ static calculateVariant64( value: number | Long ): number;
+
+ /**
+ * Concatenates multiple ByteBuffers into one.
+ */
+ static concat( buffers: Array, encoding?: string | boolean, litteEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a base64 encoded string to a ByteBuffer.
+ */
+ static fromBase64( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteBuffer.
+ */
+ static fromBinary( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a hex encoded string with marked offsets to a ByteBuffer.
+ */
+ static fromDebug( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a hex encoded string to a ByteBuffer.
+ */
+ static fromHex( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes an UTF8 encoded string to a ByteBuffer.
+ */
+ static fromUTF8( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Gets the backing buffer type.
+ */
+ static isByteBuffer( bb: any ): boolean;
+
+ /**
+ * Wraps a buffer or a string. Sets the allocated ByteBuffer's ByteBuffer#offset to 0 and its ByteBuffer#limit to the length of the wrapped data.
+ * @param buffer Anything that can be wrapped
+ * @param encoding String encoding if buffer is a string ("base64", "hex", "binary", defaults to "utf8")
+ * @param littleEndian Whether to use little or big endian byte order. Defaults to ByteBuffer.DEFAULT_ENDIAN.
+ * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteBuffer.DEFAULT_NOASSERT.
+ */
+ static wrap( buffer: ByteBuffer | ArrayBuffer | Uint8Array | string, enc?: string | boolean, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a zigzag encoded signed 32bit integer.
+ */
+ static zigZagDecode32( n: number ): number;
+
+ /**
+ * Decodes a zigzag encoded signed 64bit integer.
+ */
+ static zigZagDecode64( n: number | Long ): Long;
+
+ /**
+ * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding.
+ */
+ static zigZagEncode32( n: number ): number;
+
+ /**
+ * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding.
+ */
+ static zigZagEncode64( n: number | Long ): Long;
+
+ /**
+ * Switches (to) big endian byte order.
+ */
+ BE( bigEndian?: boolean ): ByteBuffer;
+
+ /**
+ * Switches (to) little endian byte order.
+ */
+ LE( bigEndian?: boolean ): ByteBuffer;
+
+ /**
+ * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended data's length.
+ */
+ append( source: ByteBuffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer;
+
+ /**
+ * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents behind the specified offset up to the length of this ByteBuffer's data.
+ */
+ appendTo( target: ByteBuffer, offset?: number ): ByteBuffer;
+
+ /**
+ * Enables or disables assertions of argument types and offsets. Assertions are enabled by default but you can opt to disable them if your code already makes sure that everything is valid.
+ */
+ assert( assert: boolean ): ByteBuffer;
+
+ /**
+ * Gets the capacity of this ByteBuffer's backing buffer.
+ */
+ capacity(): number;
+
+ /**
+ * Clears this ByteBuffer's offsets by setting ByteBuffer#offset to 0 and
+ * ByteBuffer#limit to the backing buffer's capacity. Discards ByteBuffer#markedOffset.
+ */
+ clear(): ByteBuffer;
+
+ /**
+ * Creates a cloned instance of this ByteBuffer, preset with this ByteBuffer's values for ByteBuffer#offset, ByteBuffer#markedOffset and ByteBuffer#limit.
+ */
+ clone( copy?: boolean ): ByteBuffer;
+
+ /**
+ * Compacts this ByteBuffer to be backed by a ByteBuffer#buffer of its contents' length. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. Will set offset = 0 and limit = capacity and adapt ByteBuffer#markedOffset to the same relative position if set.
+ */
+ compact( begin?: number, end?: number ): ByteBuffer;
+
+ /**
+ * Creates a copy of this ByteBuffer's contents. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit.
+ */
+ copy( begin?: number, end?: number ): ByteBuffer;
+
+ /**
+ * Copies this ByteBuffer's contents to another ByteBuffer. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit.
+ */
+ copyTo( target: ByteBuffer, targetOffset?: number, sourceOffset?: number, sourceLimit?: number ): ByteBuffer;
+
+ /**
+ * Makes sure that this ByteBuffer is backed by a ByteBuffer#buffer of at least the specified capacity. If the current capacity is exceeded, it will be doubled. If double the current capacity is less than the required capacity, the required capacity will be used instead.
+ */
+ ensureCapacity( capacity: number ): ByteBuffer;
+
+ /**
+ * Overwrites this ByteBuffer's contents with the specified value. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit.
+ */
+ fill( value: number | string, begin?: number, end?: number ): ByteBuffer;
+
+ /**
+ * Makes this ByteBuffer ready for a new sequence of write or relative read operations. Sets limit = offset and offset = 0. Make sure always to flip a ByteBuffer when all relative read or write operations are complete.
+ */
+ flip(): ByteBuffer;
+
+ /**
+ * Marks an offset on this ByteBuffer to be used later.
+ */
+ mark( offset?: number ): ByteBuffer;
+
+ /**
+ * Sets the byte order.
+ */
+ order( littleEndian: boolean ): ByteBuffer;
+
+ /**
+ * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the prepended data's length. If there is not enough space available before the specified offset, the backing buffer will be resized and its contents moved accordingly.
+ */
+ prepend( source: ByteBuffer | string | ArrayBuffer, encoding?: string | number, offset?: number ): ByteBuffer;
+
+ /**
+ * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the prepended data's length. If there is not enough space available before the specified offset, the backing buffer will be resized and its contents moved accordingly.
+ */
+ prependTo( target: ByteBuffer, offset?: number ): ByteBuffer;
+
+ /**
+ * Prints debug information about this ByteBuffer's contents.
+ */
+ printDebug( out?: ( text: string ) => void ): void;
+
+ /**
+ * Reads an 8bit signed integer. This is an alias of ByteBuffer#readInt8.
+ */
+ readByte( offset?: number ): number;
+
+ /**
+ * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters itself.
+ */
+ readCString( offset?: number ): string;
+
+ /**
+ * Reads a 64bit float. This is an alias of ByteBuffer#readFloat64.
+ */
+ readDouble( offset?: number ): number;
+
+ /**
+ * Reads a 32bit float. This is an alias of ByteBuffer#readFloat32.
+ */
+ readFloat( offset?: number ): number;
+
+ /**
+ * Reads a 32bit float.
+ */
+ readFloat32( offset?: number ): number;
+
+ /**
+ * Reads a 64bit float.
+ */
+ readFloat64( offset?: number ): number;
+
+ /**
+ * Reads a length as uint32 prefixed UTF8 encoded string.
+ */
+ readIString( offset?: number ): string;
+
+ /**
+ * Reads a 32bit signed integer.This is an alias of ByteBuffer#readInt32.
+ */
+ readInt( offset?: number ): number;
+
+ /**
+ * Reads a 16bit signed integer.
+ */
+ readInt16( offset?: number ): number;
+
+ /**
+ * Reads a 32bit signed integer.
+ */
+ readInt32( offset?: number ): number;
+
+ /**
+ * Reads a 64bit signed integer.
+ */
+ readInt64( offset?: number ): Long;
+
+ /**
+ * Reads an 8bit signed integer.
+ */
+ readInt8( offset?: number ): number;
+
+ /**
+ * Reads a 64bit signed integer. This is an alias of ByteBuffer#readInt64.
+ */
+ readLong( offset?: number ): Long;
+
+ /**
+ * Reads a 16bit signed integer. This is an alias of ByteBuffer#readInt16.
+ */
+ readShort( offset?: number ): number;
+
+ /**
+ * Reads an UTF8 encoded string. This is an alias of ByteBuffer#readUTF8String.
+ */
+ readString( length: number, metrics?: number, offset?: number ): string;
+
+ /**
+ * Reads an UTF8 encoded string.
+ */
+ readUTF8String( chars: number, offset?: number ): string;
+
+ /**
+ * Reads a 16bit unsigned integer.
+ */
+ readUint16( offset?: number ): number;
+
+ /**
+ * Reads a 32bit unsigned integer.
+ */
+ readUint32( offset?: number ): number;
+
+ /**
+ * Reads a 64bit unsigned integer.
+ */
+ readUint64( offset?: number ): Long;
+ /**
+ * Reads an 8bit unsigned integer.
+ */
+ readUint8( offset?: number ): number;
+
+ /**
+ * Reads a length as varint32 prefixed UTF8 encoded string.
+ */
+ readVString( offset?: number ): string;
+
+ /**
+ * Reads a 32bit base 128 variable-length integer.
+ */
+ readVarint32( offset?: number ): number;
+
+ /**
+ * Reads a zig-zag encoded 32bit base 128 variable-length integer.
+ */
+ readVarint32ZiZag( offset?: number ): number;
+
+ /**
+ * Reads a 64bit base 128 variable-length integer. Requires Long.js.
+ */
+ readVarint64( offset?: number ): Long;
+
+ /**
+ * Reads a zig-zag encoded 64bit base 128 variable-length integer. Requires Long.js.
+ */
+ readVarint64ZigZag( offset?: number ): Long;
+
+ /**
+ * Gets the number of remaining readable bytes. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit, so this returns limit - offset.
+ */
+ remaining(): number;
+
+ /**
+ * Resets this ByteBuffer's ByteBuffer#offset. If an offset has been marked through ByteBuffer#mark before, offset will be set to ByteBuffer#markedOffset, which will then be discarded. If no offset has been marked, sets offset = 0.
+ */
+ reset(): ByteBuffer;
+
+ /**
+ * Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that large or larger.
+ */
+ resize( capacity: number ): ByteBuffer;
+
+ /**
+ * Reverses this ByteBuffer's contents
+ */
+ reverse( begin?: number, end?: number ): ByteBuffer;
+
+ /**
+ * Skips the next length bytes. This will just advance
+ */
+ skip( length: number ): ByteBuffer;
+
+ /**
+ * Slices this ByteBuffer by creating a cloned instance with offset = begin and limit = end.
+ */
+ slice( begin?: number, end?: number ): ByteBuffer;
+
+ /**
+ * Returns a raw buffer compacted to contain this ByteBuffer's contents. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. Will transparently ByteBuffer#flip this ByteBuffer if offset > limit but the actual offsets remain untouched. This is an alias of ByteBuffer#toBuffer.
+ */
+ toArrayBuffer( forceCopy?: boolean ): ArrayBuffer;
+
+ /**
+ * Encodes this ByteBuffer's contents to a base64 encoded string.
+ */
+ toBase64( begin?: number, end?: number ): string;
+
+ /**
+ * Encodes this ByteBuffer to a binary encoded string, that is using only characters 0x00-0xFF as bytes.
+ */
+ toBinary( begin?: number, end?: number ): string;
+
+ /**
+ * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. Will transparently ByteBuffer#flip this ByteBuffer if offset > limit but the actual offsets remain untouched.
+ */
+ toBuffer( forceCopy?: boolean ): ArrayBuffer;
+
+ /**
+ *Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are:
+ * < : offset,
+ * ' : markedOffset,
+ * > : limit,
+ * | : offset and limit,
+ * [ : offset and markedOffset,
+ * ] : markedOffset and limit,
+ * ! : offset, markedOffset and limit
+ */
+ toDebug( columns?: boolean ): string | Array
+
+ /**
+ * Encodes this ByteBuffer's contents to a hex encoded string.
+ */
+ toHex( begin?: number, end?: number ): string;
+
+ /**
+ * Converts the ByteBuffer's contents to a string.
+ */
+ toString( encoding?: string ): string;
+
+ /**
+ * Encodes this ByteBuffer's contents between ByteBuffer#offset and ByteBuffer#limit to an UTF8 encoded string.
+ */
+ toUTF8(): string;
+
+ /**
+ * Writes an 8bit signed integer. This is an alias of ByteBuffer#writeInt8.
+ */
+ writeByte( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL characters itself.
+ */
+ writeCString( str: string, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 64bit float. This is an alias of ByteBuffer#writeFloat64.
+ */
+ writeDouble( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 32bit float. This is an alias of ByteBuffer#writeFloat32.
+ */
+ writeFloat( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 32bit float.
+ */
+ writeFloat32( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 64bit float.
+ */
+ writeFloat64( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a length as uint32 prefixed UTF8 encoded string.
+ */
+ writeIString( str: string, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 32bit signed integer. This is an alias of ByteBuffer#writeInt32.
+ */
+ writeInt( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 16bit signed integer.
+ */
+ writeInt16( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 32bit signed integer.
+ */
+ writeInt32( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 64bit signed integer.
+ */
+ writeInt64( value: number | Long, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes an 8bit signed integer.
+ */
+ writeInt8( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 16bit signed integer. This is an alias of ByteBuffer#writeInt16.
+ */
+ writeShort( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes an UTF8 encoded string.This is an alias of ByteBuffer#writeUTF8String.
+ */
+ WriteString( str: string, offset?: number ): ByteBuffer | number;
+
+ /**
+ * Writes an UTF8 encoded string.
+ */
+ writeUTF8String( str: string, offset?: number ): ByteBuffer | number;
+
+ /**
+ * Writes a 16bit unsigned integer.
+ */
+ writeUint16( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 32bit unsigned integer.
+ */
+ writeUint32( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 64bit unsigned integer.
+ */
+ writeUint64( value: number | Long, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes an 8bit unsigned integer.
+ */
+ writeUint8( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a length as varint32 prefixed UTF8 encoded string.
+ */
+ writeVString( str: string, offset?: number ): ByteBuffer | number;
+
+ /**
+ * Writes a 32bit base 128 variable-length integer.
+ */
+ writeVarint32( value: number, offset?: number ): ByteBuffer | number;
+
+ /**
+ * Writes a zig-zag encoded 32bit base 128 variable-length integer.
+ */
+ writeVarint32ZigZag( value: number, offset?: number ): ByteBuffer | number;
+
+ /**
+ * Writes a 64bit base 128 variable-length integer.
+ */
+ writeVarint64( value: number | Long, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a zig-zag encoded 64bit base 128 variable-length integer.
+ */
+ writeVarint64ZigZag( value: number | Long, offset?: number ): ByteBuffer | number;
+}
+
+declare module 'bytebuffer' {
+ export = ByteBuffer;
+}
diff --git a/chartjs/chart-tests.ts b/chartjs/chart-tests.ts
index 4bd8820c6c..452ddbf623 100644
--- a/chartjs/chart-tests.ts
+++ b/chartjs/chart-tests.ts
@@ -325,7 +325,7 @@ var myDoughnutChart = new Chart(ctx).Doughnut(pieData, {
animateRotate: true,
animateScale: false,
legendTemplate: "-legend\"><% for (var i=0; i- \"><%if(segments[i].label){%><%=segments[i].label%><%}%>
<%}%>
"
-});
+});
var myDoughnutChartLegend: string = myDoughnutChart.generateLegend();
var myDoughnutChartImage: string = myDoughnutChart.toBase64Image();
@@ -341,3 +341,32 @@ myDoughnutChart.resize();
myDoughnutChart.update();
myDoughnutChart.stop();
myDoughnutChart.destroy();
+
+// Test using charts with overrides of a subset of global options
+var partialOpts: ChartSettings = {
+ showTooltips: true,
+ tooltipEvents: ["mousemove", "touchstart", "touchmove"],
+ tooltipFillColor: "rgba(0,0,0,0.8)",
+ tooltipFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
+ tooltipFontSize: 14,
+ tooltipFontStyle: "normal",
+ tooltipFontColor: "#fff",
+ tooltipTitleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
+ tooltipTitleFontSize: 14,
+ tooltipTitleFontStyle: "bold",
+ tooltipTitleFontColor: "#fff",
+ tooltipYPadding: 6,
+ tooltipXPadding: 6,
+ tooltipCaretSize: 8,
+ tooltipCornerRadius: 6,
+ tooltipXOffset: 10,
+ tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>"
+};
+
+var my2ndLineChart = new Chart(ctx).Line(lineData, partialOpts);
+var my2ndBarChart = new Chart(ctx).Bar(barData, partialOpts);
+var my2ndRadarChart = new Chart(ctx).Radar(radarData, partialOpts);
+var my2ndPolarAreaChart = new Chart(ctx).PolarArea(polarAreaData, partialOpts);
+var my2ndPieChart = new Chart(ctx).Pie(pieData, partialOpts);
+var my2ndDoughnutChart = new Chart(ctx).Doughnut(pieData, partialOpts);
+
diff --git a/chartjs/chart.d.ts b/chartjs/chart.d.ts
index d337d144a6..62f393b8a1 100644
--- a/chartjs/chart.d.ts
+++ b/chartjs/chart.d.ts
@@ -33,49 +33,49 @@ interface CircularChartData {
}
interface ChartSettings {
- animation: boolean;
- animationSteps: number;
- animationEasing: string;
- showScale: boolean;
- scaleOverride: boolean;
- scaleSteps: number;
- scaleStepWidth: number;
- scaleStartValue: number;
- scaleLineColor: string;
- scaleLineWidth: number;
- scaleShowLabels: boolean;
- scaleLabel: string;
- scaleIntegersOnly: boolean;
- scaleBeginAtZero: boolean;
- scaleFontFamily: string;
- scaleFontSize: number;
- scaleFontStyle: string;
- scaleFontColor: string;
- responsive: boolean;
- maintainAspectRatio: boolean;
- showTooltips: boolean;
- tooltipEvents: string[];
- tooltipFillColor: string;
- tooltipFontFamily: string;
- tooltipFontSize: number;
- tooltipFontStyle: string;
- tooltipFontColor: string;
- tooltipTitleFontFamily: string;
- tooltipTitleFontSize: number;
- tooltipTitleFontStyle: string;
- tooltipTitleFontColor: string;
- tooltipYPadding: number;
- tooltipXPadding: number;
- tooltipCaretSize: number;
- tooltipCornerRadius: number;
- tooltipXOffset: number;
- tooltipTemplate: string;
- multiTooltipTemplate: string;
- onAnimationProgress: () => any;
- onAnimationComplete: () => any;
+ animation?: boolean;
+ animationSteps?: number;
+ animationEasing?: string;
+ showScale?: boolean;
+ scaleOverride?: boolean;
+ scaleSteps?: number;
+ scaleStepWidth?: number;
+ scaleStartValue?: number;
+ scaleLineColor?: string;
+ scaleLineWidth?: number;
+ scaleShowLabels?: boolean;
+ scaleLabel?: string;
+ scaleIntegersOnly?: boolean;
+ scaleBeginAtZero?: boolean;
+ scaleFontFamily?: string;
+ scaleFontSize?: number;
+ scaleFontStyle?: string;
+ scaleFontColor?: string;
+ responsive?: boolean;
+ maintainAspectRatio?: boolean;
+ showTooltips?: boolean;
+ tooltipEvents?: string[];
+ tooltipFillColor?: string;
+ tooltipFontFamily?: string;
+ tooltipFontSize?: number;
+ tooltipFontStyle?: string;
+ tooltipFontColor?: string;
+ tooltipTitleFontFamily?: string;
+ tooltipTitleFontSize?: number;
+ tooltipTitleFontStyle?: string;
+ tooltipTitleFontColor?: string;
+ tooltipYPadding?: number;
+ tooltipXPadding?: number;
+ tooltipCaretSize?: number;
+ tooltipCornerRadius?: number;
+ tooltipXOffset?: number;
+ tooltipTemplate?: string;
+ multiTooltipTemplate?: string;
+ onAnimationProgress?: () => any;
+ onAnimationComplete?: () => any;
}
-interface ChartOptions {
+interface ChartOptions extends ChartSettings {
scaleShowGridLines?: boolean;
scaleGridLineColor?: string;
scaleGridLineWidth?: number;
@@ -138,7 +138,7 @@ interface BarChartOptions extends ChartOptions {
barDatasetSpacing?: number;
}
-interface RadarChartOptions {
+interface RadarChartOptions extends ChartSettings {
scaleShowLine?: boolean;
angleShowLineOut?: boolean;
scaleShowLabels?: boolean;
@@ -159,7 +159,7 @@ interface RadarChartOptions {
legendTemplate?: string;
}
-interface PolarAreaChartOptions {
+interface PolarAreaChartOptions extends ChartSettings {
scaleShowLabelBackdrop?: boolean;
scaleBackdropColor?: string;
scaleBeginAtZero?: boolean;
@@ -176,7 +176,7 @@ interface PolarAreaChartOptions {
legendTemplate?: string;
}
-interface PieChartOptions {
+interface PieChartOptions extends ChartSettings {
segmentShowStroke?: boolean;
segmentStrokeColor?: string;
segmentStrokeWidth?: number;
diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts
index 0164bb09b9..b3c2f45243 100644
--- a/ckeditor/ckeditor.d.ts
+++ b/ckeditor/ckeditor.d.ts
@@ -1139,4 +1139,12 @@ declare module CKEDITOR {
function isTabEnabled(editor: editor, dialogName: string, tabName: string): boolean;
function okButton(): void;
}
-}
+
+ module lang {
+ var languages: any;
+ var rtl: any;
+
+ function load(languageCode: string, defaultLanguage: string, callback: Function): void;
+ function detect(defaultLanguage: string, probeLanguage: string): string;
+ }
+}
\ No newline at end of file
diff --git a/compose-function/compose-function-tests.ts b/compose-function/compose-function-tests.ts
new file mode 100644
index 0000000000..dd0a80feff
--- /dev/null
+++ b/compose-function/compose-function-tests.ts
@@ -0,0 +1,21 @@
+///
+
+const numberToNumber = (a: number): number => a + 2;
+const numberToString = (a: number): string => "foo";
+const stringToNumber = (a: string): number => 5;
+
+import composeFunction = require("compose-function");
+const t1: number = composeFunction(numberToNumber, numberToNumber)(5);
+const t2: string = composeFunction(numberToString, numberToNumber)(5);
+const t3: string = composeFunction(numberToString, stringToNumber)("f");
+const t4: (a: string) => number = composeFunction(
+ (f: (a: string) => number) => ((p: string) => 5),
+ (f: (a: number) => string) => ((p: string) => 4)
+ )(numberToString);
+
+
+const t5: number = composeFunction(stringToNumber, numberToString, numberToNumber)(5);
+const t6: string = composeFunction(numberToString, stringToNumber, numberToString, numberToNumber)(5);
+
+const t7: string = composeFunction(
+ numberToString, numberToNumber, stringToNumber, numberToString, stringToNumber)("fo");
diff --git a/compose-function/compose-function.d.ts b/compose-function/compose-function.d.ts
new file mode 100644
index 0000000000..d4f205fd32
--- /dev/null
+++ b/compose-function/compose-function.d.ts
@@ -0,0 +1,31 @@
+// Type definitions for compose-function
+// Project: https://github.com/stoeffel/compose-function
+// Definitions by: Denis Sokolov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare module "compose-function" {
+ // Hardcoded signatures for 2-4 parameters
+ function f(
+ f1: (b: B) => C,
+ f2: (a: A) => B
+ ): (a: A) => C
+ function f(
+ f1: (b: C) => D,
+ f2: (a: B) => C,
+ f3: (a: A) => B
+ ): (a: A) => D
+ function f(
+ f1: (b: D) => E,
+ f2: (a: C) => D,
+ f3: (a: B) => C,
+ f4: (a: A) => B
+ ): (a: A) => E
+
+ // Minimal typing for more than 4 parameters
+ function f(
+ f1: (a: any) => Result,
+ ...functions: Function[]
+ ): (a: any) => Result
+
+ export = f;
+}
diff --git a/cordova/plugins/Device.d.ts b/cordova/plugins/Device.d.ts
index a25c1aadc8..1abb37596e 100644
--- a/cordova/plugins/Device.d.ts
+++ b/cordova/plugins/Device.d.ts
@@ -26,6 +26,9 @@ interface Device {
version: string;
/** Get the device's manufacturer. */
manufacturer: string;
-}
+ /** Whether the device is running on a simulator. */
+ isVirtual: boolean;
+ /** Get the device hardware serial number. */
+ serial: string;}
declare var device: Device;
\ No newline at end of file
diff --git a/dexie/dexie.d.ts b/dexie/dexie.d.ts
index d6c26283c2..13b9b31e0b 100644
--- a/dexie/dexie.d.ts
+++ b/dexie/dexie.d.ts
@@ -38,7 +38,7 @@ declare class Dexie {
static deepClone(obj: Object): Object;
- version(versionNumber: number): Dexie.Version
+ version(versionNumber: number): Dexie.Version;
on: {
(eventName: string, subscriber: () => any): void;
@@ -48,7 +48,7 @@ declare class Dexie {
populate: Dexie.DexieEvent;
blocked: Dexie.DexieEvent;
versionchange: Dexie.DexieVersionChangeEvent;
- }
+ };
open(): Dexie.Promise;
diff --git a/email-validator/email-validator-tests.ts b/email-validator/email-validator-tests.ts
new file mode 100644
index 0000000000..61d4c6dfa6
--- /dev/null
+++ b/email-validator/email-validator-tests.ts
@@ -0,0 +1,13 @@
+///
+
+import emailValidator = require('email-validator');
+import { validate } from 'email-validator';
+
+var result: boolean;
+
+// Trivial code requires trivial tests
+result = validate('some email');
+result = validate(null);
+
+result = emailValidator.validate('some email');
+result = emailValidator.validate(null);
diff --git a/email-validator/email-validator.d.ts b/email-validator/email-validator.d.ts
new file mode 100644
index 0000000000..299ebb19f6
--- /dev/null
+++ b/email-validator/email-validator.d.ts
@@ -0,0 +1,8 @@
+// Type definitions for email-validator 1.0.3
+// Project: https://github.com/Sembiance/email-validator
+// Definitions by: Paul Lessing
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare module "email-validator" {
+ export function validate(email: String): boolean;
+}
diff --git a/envify/envify.d.ts b/envify/envify.d.ts
index 39479f503f..cc343ad33b 100644
--- a/envify/envify.d.ts
+++ b/envify/envify.d.ts
@@ -3,12 +3,14 @@
// Definitions by: Qubo
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+///
+
declare module "envify" {
- var envify: Function;
+ var envify: (file: string, environment: { [name: string]: any }) => NodeJS.ReadWriteStream;
export = envify;
}
declare module "envify/custom" {
- function envify(environment: { [name: string]: any }): Function;
+ function envify(environment: { [name: string]: any }): (file: string, environment: { [name: string]: any }) => NodeJS.ReadWriteStream;
export = envify;
}
diff --git a/flux/flux-tests.ts b/flux/flux-tests.ts
index f41d15aff1..24369ef2dd 100644
--- a/flux/flux-tests.ts
+++ b/flux/flux-tests.ts
@@ -1,6 +1,12 @@
///
+///
import flux = require('flux')
+import FluxUtils = require('flux/utils')
+import React = require('react')
+
+var Component = React.Component
+var Container = FluxUtils.Container
//
// Basic dispatcher usage
@@ -78,4 +84,46 @@ class CustomDispatcher extends flux.Dispatcher {
var customDispatcher = new CustomDispatcher()
-export = customDispatcher
\ No newline at end of file
+export = customDispatcher
+
+
+// Sample Reduce Store
+class CounterStore extends FluxUtils.ReduceStore {
+ getInitialState(): number {
+ return 0;
+ }
+
+ reduce(state: number, action: any): number {
+ switch (action.type) {
+ case 'increment':
+ return state + 1;
+
+ case 'square':
+ return state * state;
+
+ default:
+ return state;
+ }
+ }
+}
+
+const Store = new CounterStore(basicDispatcher);
+
+// Sample Flux container with CounterStore
+class CounterContainer extends Component {
+ static getStores() {
+ return [Store];
+ }
+
+ static calculateState(prevState: any) {
+ return {
+ counter: Store.getState(),
+ };
+ }
+
+ render() {
+ return this.state.counter;
+ }
+}
+
+const container = Container.create(CounterContainer);
diff --git a/flux/flux.d.ts b/flux/flux.d.ts
index bf5bafac4b..c65892321c 100644
--- a/flux/flux.d.ts
+++ b/flux/flux.d.ts
@@ -1,8 +1,10 @@
// Type definitions for Flux
// Project: http://facebook.github.io/flux/
-// Definitions by: Steve Baker
+// Definitions by: Steve Baker , Giedrius Grabauskas
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+///
+
declare module Flux {
/**
@@ -65,3 +67,127 @@ declare module Flux {
declare module "flux" {
export = Flux;
}
+
+declare module FluxUtils {
+
+ export class Container {
+ constructor();
+ /**
+ * Create is used to transform a react class into a container
+ * that updates its state when relevant stores change.
+ * The provided base class must have static methods getStores() and calculateState().
+ */
+ static create(base: React.ComponentClass, options?: any): React.ComponentClass;
+ }
+
+ /**
+ * This class extends ReduceStore and defines the state as an immutable map.
+ */
+ // TODO: Change to >
+ export class MapStore extends ReduceStore {
+ /**
+ * Access the value at the given key.
+ * Throws an error if the key does not exist in the cache.
+ */
+ at(key: K): V;
+
+ /**
+ * Check if the cache has a particular key
+ */
+ has(key: K): boolean;
+
+ /**
+ * Get the value of a particular key.
+ * Returns undefined if the key does not exist in the cache.
+ */
+ get(key: K): V;
+
+ /**
+ * Gets an array of keys and puts the values in a map if they exist,
+ * it allows providing a previous result to update instead of generating a new map.
+ * Providing a previous result allows the possibility of keeping the same reference if the keys did not change.
+ */
+ // TODO: Update with Immutable interface.
+ // getAll(keys: Immutable.IndexedIterable, prev?: Immutable.Map): Immutable.Map;
+ getAll(keys: any, prev?: any): any;
+ }
+
+ export class ReduceStore extends Store {
+ /**
+ * Getter that exposes the entire state of this store.
+ * If your state is not immutable you should override this and not expose state directly.
+ */
+ getState(): T;
+
+ /**
+ * Constructs the initial state for this store.
+ * This is called once during construction of the store.
+ */
+ getInitialState(): T;
+
+ /**
+ * Reduces the current state, and an action to the new state of this store.
+ * All subclasses must implement this method.
+ * This method should be pure and have no side-effects.
+ */
+ reduce(state: T, action: any): T;
+
+ /**
+ * Checks if two versions of state are the same.
+ * You do not need to override this if your state is immutable.
+ */
+ areEqual(one: T, two: T): boolean;
+
+ }
+
+ export class Store {
+
+ /**
+ * Constructs and registers an instance of this store with the given dispatcher.
+ */
+ constructor(dispatcher: Flux.Dispatcher);
+
+ /**
+ * Adds a listener to the store, when the store changes the given callback will be called.
+ * A token is returned that can be used to remove the listener.
+ * Calling the remove() function on the returned token will remove the listener.
+ */
+ addListener(callback: Function): { remove: Function };
+
+ /**
+ * Returns the dispatcher this store is registered with.
+ */
+ getDispatcher(): Flux.Dispatcher;
+
+ /**
+ * Returns the dispatch token that the dispatcher recognizes this store by.
+ * Can be used to waitFor() this store.
+ */
+ getDispatchToken(): string;
+
+ /**
+ * Ask if a store has changed during the current dispatch.
+ * Can only be invoked while dispatching.
+ * This can be used for constructing derived stores that depend on data from other stores.
+ */
+ hasChanged(): boolean;
+
+ /**
+ *Emit an event notifying all listeners that this store has changed.
+ * This can only be invoked when dispatching.
+ * Changes are de-duplicated and resolved at the end of this store's __onDispatch function.
+ */
+ __emitChange(): void;
+
+ /**
+ * Subclasses must override this method.
+ * This is how the store receives actions from the dispatcher.
+ * All state mutation logic must be done during this method.
+ */
+ __onDispatch(payload: any): void;
+ }
+}
+
+declare module 'flux/utils' {
+ export = FluxUtils;
+}
diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts
index 0919ef1b08..80655ab5b8 100644
--- a/fs-extra/fs-extra-tests.ts
+++ b/fs-extra/fs-extra-tests.ts
@@ -45,6 +45,7 @@ var openOpts: fs.OpenOptions;
var watcher: fs.FSWatcher;
var readStreeam: stream.Readable;
var writeStream: stream.Writable;
+var outputStream: stream.Writable;
fs.copy(src, dest, errorCallback);
fs.copy(src, dest, (src: string) => {
@@ -150,7 +151,7 @@ strArr = fs.readdirSync(path);
fs.close(fd, errorCallback);
fs.closeSync(fd);
fs.open(path, flags, modeStr, (err: Error, fd: number) => {
-
+
});
num = fs.openSync(path, flags, modeStr);
fs.utimes(path, atime, mtime, errorCallback);
@@ -217,6 +218,17 @@ fs.exists(path, (exists: boolean) => {
});
bool = fs.existsSync(path);
+fs.ensureDir(path, errorCallback);
+fs.ensureDirSync(path);
+fs.ensureFile(path, errorCallback);
+fs.ensureFileSync(path);
+fs.ensureLink(path, errorCallback);
+fs.ensureLinkSync(path);
+fs.ensureSymlink(path, errorCallback);
+fs.ensureSymlinkSync(path);
+fs.emptyDir(path, errorCallback);
+fs.emptyDirSync(path);
+
readStreeam = fs.createReadStream(path);
readStreeam = fs.createReadStream(path, {
flags: str,
@@ -231,3 +243,9 @@ writeStream = fs.createWriteStream(path, {
encoding: str,
string: str
});
+outputStream = fs.createOutputStream(path);
+outputStream = fs.createOutputStream(path, {
+ flags: str,
+ encoding: str,
+ string: str
+});
diff --git a/fs-extra/fs-extra.d.ts b/fs-extra/fs-extra.d.ts
index 852956a71b..d997d12a89 100644
--- a/fs-extra/fs-extra.d.ts
+++ b/fs-extra/fs-extra.d.ts
@@ -167,6 +167,15 @@ declare module "fs-extra" {
export function exists(path: string, callback?: (exists: boolean) => void ): void;
export function existsSync(path: string): boolean;
export function ensureDir(path: string, cb: (err: Error) => void): void;
+ export function ensureDirSync(path: string): void;
+ export function ensureFile(path: string, cb: (err: Error) => void): void;
+ export function ensureFileSync(path: string): void;
+ export function ensureLink(path: string, cb: (err: Error) => void): void;
+ export function ensureLinkSync(path: string): void;
+ export function ensureSymlink(path: string, cb: (err: Error) => void): void;
+ export function ensureSymlinkSync(path: string): void;
+ export function emptyDir(path: string, callback?: (err: Error) => void): void;
+ export function emptyDirSync(path: string): boolean;
export interface OpenOptions {
encoding?: string;
@@ -192,4 +201,5 @@ declare module "fs-extra" {
}
export function createReadStream(path: string, options?: ReadStreamOptions): ReadStream;
export function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream;
+ export function createOutputStream(path: string, options?: WriteStreamOptions): WriteStream;
}
diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts
index 298f2f6ea6..3ac35b0482 100644
--- a/googlemaps/google.maps.d.ts
+++ b/googlemaps/google.maps.d.ts
@@ -849,7 +849,7 @@ declare module google.maps {
formatted_address: string;
geometry: GeocoderGeometry;
partial_match: boolean;
- postcode_localities: string[]
+ postcode_localities: string[];
types: string[];
}
@@ -1822,7 +1822,7 @@ declare module google.maps {
matched_substrings: PredictionSubstring[];
place_id: string;
terms: PredictionTerm[];
- types: string[]
+ types: string[];
}
export interface PredictionTerm {
diff --git a/gulp-babel/gulp-babel-tests.ts b/gulp-babel/gulp-babel-tests.ts
index 75175cf6f5..e5daf3617a 100644
--- a/gulp-babel/gulp-babel-tests.ts
+++ b/gulp-babel/gulp-babel-tests.ts
@@ -1,7 +1,7 @@
///
///
-import babel from 'gulp-babel';
+import babel = require('gulp-babel');
var x: NodeJS.ReadWriteStream = babel();
var x: NodeJS.ReadWriteStream = babel({});
diff --git a/gulp-babel/gulp-babel.d.ts b/gulp-babel/gulp-babel.d.ts
index 36846cac43..98d33881cf 100644
--- a/gulp-babel/gulp-babel.d.ts
+++ b/gulp-babel/gulp-babel.d.ts
@@ -6,7 +6,7 @@
///
declare module 'gulp-babel' {
- export default function(options?: {
+ function babel(options?: {
filename?: string,
filenameRelative?: string,
presets?: string[],
@@ -35,4 +35,6 @@ declare module 'gulp-babel' {
env?: any,
retainLines?: boolean
}): NodeJS.ReadWriteStream;
+
+ export = babel;
}
diff --git a/gulp-uglify/gulp-uglify.d.ts b/gulp-uglify/gulp-uglify.d.ts
index 840b5110bd..05eb937ed3 100644
--- a/gulp-uglify/gulp-uglify.d.ts
+++ b/gulp-uglify/gulp-uglify.d.ts
@@ -170,6 +170,6 @@ declare module "gulp-uglify" {
*/
comments_before: string[];
}
-
+ namespace GulpUglify {}
export = GulpUglify;
-}
\ No newline at end of file
+}
diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts
index 7f2fab90e6..b31c24b163 100644
--- a/hapi/hapi.d.ts
+++ b/hapi/hapi.d.ts
@@ -7,10 +7,6 @@
///
-///
-
-
-
declare module "hapi" {
import http = require("http");
@@ -21,6 +17,17 @@ declare module "hapi" {
[key: string]: T;
}
+ interface IThenable {
+ then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => U | IThenable): IThenable;
+ then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => void): IThenable;
+ }
+
+ interface IPromise extends IThenable {
+ then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => U | IThenable): IPromise;
+ then(onFulfilled?: (value: R) => U | IThenable, onRejected?: (error: any) => void): IPromise;
+ catch(onRejected?: (error: any) => U | IThenable): IPromise;
+ }
+
/** Boom Module for errors. https://github.com/hapijs/boom
* boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: */
export interface IBoom extends Error {
@@ -234,12 +241,12 @@ declare module "hapi" {
When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */
export interface IReply {
(err: Error,
- result?: string|number|boolean|Buffer|stream.Stream | Promise | T,
+ result?: string|number|boolean|Buffer|stream.Stream | IPromise | T,
/** Note that when used to return both an error and credentials in the authentication methods, reply() must be called with three arguments function(err, null, data) where data is the additional authentication information. */
credentialData?: any
): IBoom;
/** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */
- (result: string|number|boolean|Buffer|stream.Stream | Promise | T): Response;
+ (result: string|number|boolean|Buffer|stream.Stream | IPromise | T): Response;
/** Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200.
* The data argument is only used for passing back authentication data and is ignored elsewhere. */
@@ -897,22 +904,32 @@ declare module "hapi" {
export interface IServerInject {
- (options: {
+ (options: string | {
/** the request HTTP method (e.g. 'POST'). Defaults to 'GET'.*/
method: string;
/** the request URL. If the URI includes an authority (e.g. 'example.com:8080'), it is used to automatically set an HTTP 'Host' header, unless one was specified in headers.*/
url: string;
/** an object with optional request headers where each key is the header name and the value is the header content. Defaults to no additions to the default Shot headers.*/
- headers: IDictionary;
- /**- an optional string or buffer containing the request payload (object must be manually converted to a string first). Defaults to no payload. Note that payload processing defaults to 'application/json' if no 'Content-Type' header provided.*/
- payload: string|Buffer;
- /**an optional credentials object containing authentication information. The credentials are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Defaults to no credentials.*/
- credentials: any;
+ headers?: IDictionary;
+ /** n optional string, buffer or object containing the request payload. In case of an object it will be converted to a string for you. Defaults to no payload. Note that payload processing defaults to 'application/json' if no 'Content-Type' header provided.*/
+ payload?: string|{}|Buffer;
+ /** an optional credentials object containing authentication information. The credentials are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Defaults to no credentials.*/
+ credentials?: any;
+ /** an optional artifacts object containing authentication artifact information. The artifacts are used to bypass the default authentication strategies, and are validated directly as if they were received via an authentication scheme. Ignored if set without credentials. Defaults to no artifacts.*/
+ artifacts?: any;
+ /** sets the initial value of request.app*/
+ app?: any;
+ /** sets the initial value of request.plugins*/
+ plugins?: any;
+ /** allows access to routes with config.isInternal set to true. Defaults to false.*/
+ allowInternals?: boolean;
+ /** sets the remote address for the incoming connection.*/
+ remoteAddress?: boolean;
/**object with options used to simulate client request stream conditions for testing:
error - if true, emits an 'error' event after payload transmission (if any). Defaults to false.
close - if true, emits a 'close' event after payload transmission (if any). Defaults to false.
end - if false, does not end the stream. Defaults to true.*/
- simulate: {
+ simulate?: {
error: boolean;
close: boolean;
end: boolean;
diff --git a/highcharts/highcharts.d.ts b/highcharts/highcharts.d.ts
index 94277ca252..e86d4b86c4 100644
--- a/highcharts/highcharts.d.ts
+++ b/highcharts/highcharts.d.ts
@@ -1304,7 +1304,7 @@ interface HighchartsChartOptions3dFrame {
* @default 'transparent'
* @since 4.0
*/
- color?: string | HighchartsGradient,
+ color?: string | HighchartsGradient;
/**
* Thickness of the panel.
* @default 1
diff --git a/intro.js/intro.js-tests.ts b/intro.js/intro.js-tests.ts
index b49eb5078e..b8e8126ae9 100644
--- a/intro.js/intro.js-tests.ts
+++ b/intro.js/intro.js-tests.ts
@@ -9,11 +9,11 @@ intro.setOptions({
intro: "Hello world!"
},
{
- element: document.querySelector('#step1'),
+ element: document.querySelector('#step1') as HTMLElement,
intro : "This is a tooltip."
},
{
- element : document.querySelectorAll('#step2')[0],
+ element : document.querySelectorAll('#step2')[0] as HTMLElement,
intro : "Ok, wasn't that fun?",
position: 'right'
},
diff --git a/intro.js/intro.js.d.ts b/intro.js/intro.js.d.ts
index d54a5456ef..15a73f5178 100644
--- a/intro.js/intro.js.d.ts
+++ b/intro.js/intro.js.d.ts
@@ -14,7 +14,7 @@ declare module IntroJs {
interface Step {
intro: string;
element?: string|HTMLElement;
- position?: Positions;
+ position?: string|Positions;
}
interface Options {
diff --git a/ionic/ionic-tests.ts b/ionic/ionic-tests.ts
index ee8647b08c..c68846715e 100644
--- a/ionic/ionic-tests.ts
+++ b/ionic/ionic-tests.ts
@@ -84,13 +84,19 @@ class IonicTestController {
private testActionSheet(): void {
var closeActionSheetFn: ()=>void = this.$ionicActionSheet.show({
- buttons: [],
+ buttons: [{ text: 'A button' }],
titleText: "titleText",
cancelText: "cancelText",
destructiveText: "destructiveText",
cancel: ()=>{ console.log("cancel"); },
- buttonClicked: ()=>{ console.log("buttonClicked"); },
- destructiveButtonClicked: ()=>{ console.log("destructiveButtonClicked"); },
+ buttonClicked: (index)=>{
+ console.log("buttonClicked");
+ return index === 0;
+ },
+ destructiveButtonClicked: ()=>{
+ console.log("destructiveButtonClicked");
+ return false;
+ },
cancelOnStateChange: true,
cssClass: "cssClass"
});
@@ -249,7 +255,7 @@ class IonicTestController {
okType: "okType",
cancelText: "Cancel",
cancelType: "cancelType"
- }).then(() => console.log("popover shown"))
+ }).then((result) => console.log(result === true ? "confirmed": "cancelled"))
this.$ionicPopup.confirm({
title: "title",
subTitle: "subTitle",
diff --git a/ionic/ionic.d.ts b/ionic/ionic.d.ts
index 688a253edd..bb009df513 100644
--- a/ionic/ionic.d.ts
+++ b/ionic/ionic.d.ts
@@ -102,14 +102,17 @@ declare module ionic {
interface IonicActionSheetService {
show(options: IonicActionSheetOptions): ()=>void;
}
+ interface IonicActionSheetButton {
+ text: string;
+ }
interface IonicActionSheetOptions {
- buttons?: Array;
+ buttons?: Array;
titleText?: string;
cancelText?: string;
destructiveText?: string;
cancel?: ()=>any;
- buttonClicked?: (index: any)=>any;
- destructiveButtonClicked?: ()=>any;
+ buttonClicked?: (index: number)=>boolean;
+ destructiveButtonClicked?: ()=>boolean;
cancelOnStateChange?: boolean;
cssClass?: string;
}
@@ -246,10 +249,13 @@ declare module ionic {
interface IonicPopupService {
show(options: IonicPopupFullOptions): IonicPopupPromise;
alert(options: IonicPopupAlertOptions): IonicPopupPromise;
- confirm(options: IonicPopupConfirmOptions): IonicPopupPromise;
+ confirm(options: IonicPopupConfirmOptions): IonicPopupConfirmPromise;
prompt(options: IonicPopupPromptOptions): IonicPopupPromise;
}
+ interface IonicPopupConfirmPromise extends ng.IPromise {
+ close(value?: boolean): void;
+ }
interface IonicPopupPromise extends ng.IPromise {
close(value?: any): any;
}
diff --git a/jake/jake.d.ts b/jake/jake.d.ts
index 1812b818b7..95614374cc 100644
--- a/jake/jake.d.ts
+++ b/jake/jake.d.ts
@@ -40,6 +40,16 @@ declare function fail(...err:any[]): void;
*/
declare function file(name:string, prereqs?:string[], action?:()=>void, opts?:jake.FileTaskOptions): jake.FileTask;
+/**
+ * Creates Jake FileTask from regex patterns
+ * @name name/pattern of the Task
+ * @param source calculated from the name pattern
+ * @param prereqs Prerequisites to be run before this task
+ * @param action The action to perform for this task
+ * @param opts Perform this task asynchronously. If you flag a task with this option, you must call the global `complete` method inside the task's action, for execution to proceed to the next task.
+ */
+declare function rule(pattern: RegExp, source: string | { (name: string): string; }, prereqs?: string[], action?: () => void, opts?: jake.TaskOptions): void;
+
/**
* Creates a namespace which allows logical grouping of tasks, and prevents name-collisions with task-names. Namespaces can be nested inside of other namespaces.
* @param name The name of the namespace
@@ -185,6 +195,11 @@ declare module jake{
* @default false
*/
async?: boolean;
+
+ /**
+ * number of parllel async tasks
+ */
+ parallelLimit?: number;
}
/**
diff --git a/jasmine-matchers/jasmine-matchers-tests.ts b/jasmine-matchers/jasmine-matchers-tests.ts
index d1cbc0f90f..f281b4a830 100644
--- a/jasmine-matchers/jasmine-matchers-tests.ts
+++ b/jasmine-matchers/jasmine-matchers-tests.ts
@@ -27,8 +27,8 @@ describe('toBeArray', function () {
});
it('should pass for [1,"",{}]', function () {
expect([
- 1,
- "",
+ 1,
+ "",
{
}
]).toBeArray();
@@ -115,13 +115,13 @@ describe('toBeOneOf', function () {
describe('matches', function () {
it('should find "a" in ["a", "b"]', function () {
expect('a').toBeOneOf([
- 'a',
+ 'a',
'b'
]);
});
it('should find "uxebu" in ["company", "uxebu"]', function () {
expect('uxebu').toBeOneOf([
- 'company',
+ 'company',
'uxebu'
]);
});
@@ -129,30 +129,30 @@ describe('toBeOneOf', function () {
describe('non-matches', function () {
it('should not find "" in [" ", "0"]', function () {
expect('').not.toBeOneOf([
- ' ',
+ ' ',
'0'
]);
});
it('should not find "a" in ["b", "c"]', function () {
expect('a').not.toBeOneOf([
- 'b',
+ 'b',
'c'
]);
});
});
});
describe('toBeCloseToOneOf', function () {
- function oneDigitOff(actual, expected) {
+ function oneDigitOff(actual: any, expected: any) {
var actualInt = parseInt(actual, 10);
return actualInt - 1 <= expected && actualInt + 1 >= expected;
}
- function tenPercentOff(actual, expected) {
+ function tenPercentOff(actual: any, expected: any) {
return expected * 0.9 <= actual && expected * 1.1 >= actual;
}
- function oneDigitOrTenPercentOff(actual, expected) {
+ function oneDigitOrTenPercentOff(actual: any, expected: any) {
return oneDigitOff(actual, expected) || tenPercentOff(actual, expected);
}
- function twoDecimalsOff(actual, expected) {
+ function twoDecimalsOff(actual: any, expected: any) {
var lower = ((expected * 100) - 2) / 100;
var upper = ((expected * 100) + 2) / 100;
return lower <= actual && upper >= actual;
@@ -160,25 +160,25 @@ describe('toBeCloseToOneOf', function () {
describe('matches', function () {
it('should say 7 is close to one of [8, 9]', function () {
expect(7).toBeCloseToOneOf([
- 8,
+ 8,
9
], oneDigitOff);
});
it('should say 2 is 10% off of one of [2.2, 1.0]', function () {
expect(2).toBeCloseToOneOf([
- 2.2,
+ 2.2,
1.0
], tenPercentOff);
});
it('should say 7 is close to one of [8, 9]', function () {
expect(7).toBeCloseToOneOf([
- 8,
+ 8,
9
], oneDigitOrTenPercentOff);
});
it('should say 1.345 two decimals off of [1.325, 1.365]', function () {
expect(1.345).toBeCloseToOneOf([
- 1.325,
+ 1.325,
1.365
], twoDecimalsOff);
});
@@ -186,26 +186,26 @@ describe('toBeCloseToOneOf', function () {
describe('non-matches', function () {
it('should say 7 is NOT one off of [9, 10, 11]', function () {
expect(7).not.toBeCloseToOneOf([
- 9,
- 10,
+ 9,
+ 10,
11
], oneDigitOff);
});
it('should say 1 is close to one of [8, 9]', function () {
expect(1).not.toBeCloseToOneOf([
- 8,
+ 8,
9
], oneDigitOrTenPercentOff);
});
it('should say 1.9 is NOT 10% off of one of [2.2, 1.0]', function () {
expect(1.9).not.toBeCloseToOneOf([
- 2.2,
+ 2.2,
1.0
], tenPercentOff);
});
it('should say 1.345 two decimals off of [1.325, 1.365]', function () {
expect(1.304).not.toBeCloseToOneOf([
- 1.325,
+ 1.325,
1.365
], twoDecimalsOff);
});
@@ -216,7 +216,7 @@ describe('toContainOnce', function () {
describe('matches', function () {
it('should work for arrays', function () {
expect([
- 1,
+ 1,
2
]).toContainOnce(1);
});
@@ -227,7 +227,7 @@ describe('toContainOnce', function () {
describe('non-matches', function () {
it('should work for arrays', function () {
expect([
- 1,
+ 1,
2
]).not.toContainOnce(3);
});
@@ -257,7 +257,7 @@ describe('toHaveLength', function () {
describe('toHaveProperties', function () {
describe('matches', function () {
it('should work for `{x:0, y:undefined}`', function () {
- var obj = {
+ var obj: any = {
x: 0,
y: undefined
};
@@ -268,7 +268,7 @@ describe('toHaveProperties', function () {
describe('toHavePropertiesWithValues', function () {
describe('matches', function () {
it('should work with a reference object', function () {
- function C() {
+ var C: any = function C() {
this.x = 0;
}
C.prototype.y = 'arbitrary';
@@ -283,7 +283,7 @@ describe('toHavePropertiesWithValues', function () {
describe('toHaveOwnProperties', function () {
describe('matches', function () {
it('should work for `{x:0, y:undefined}`', function () {
- var obj = {
+ var obj: any = {
x: 0,
y: undefined
};
@@ -322,14 +322,14 @@ describe('toHaveBeenCalledXTimes', function () {
describe('toExactlyHaveProperties', function () {
describe('matches', function () {
it('should work for `{x:0, y:undefined}`', function () {
- var obj = {
+ var obj: any = {
x: 0,
y: undefined
};
expect(obj).toExactlyHaveProperties('x', 'y');
});
it('should work in any order', function () {
- var obj = {
+ var obj: any = {
x: 0,
y: undefined
};
@@ -338,14 +338,14 @@ describe('toExactlyHaveProperties', function () {
});
describe('non-matches', function () {
it('should work for too many properties', function () {
- var obj = {
+ var obj: any = {
x: 0,
y: undefined
};
expect(obj).not.toExactlyHaveProperties('x');
});
it('should work for missing properties', function () {
- var obj = {
+ var obj: any = {
x: 0,
y: undefined
};
@@ -375,17 +375,17 @@ describe('toEndWith', function () {
describe('matches', function () {
it('should work for string', function () {
expect([
- '1',
+ '1',
'2'
]).toEndWith('2');
});
it('should work for array', function () {
expect([
- 3,
- 4,
+ 3,
+ 4,
5
]).toEndWith([
- 4,
+ 4,
5
]);
});
@@ -393,17 +393,17 @@ describe('toEndWith', function () {
describe('non-matches', function () {
it('should work for string', function () {
expect([
- '1',
+ '1',
'2'
]).not.toEndWith('3');
});
it('should work for array', function () {
expect([
- 3,
- 4,
+ 3,
+ 4,
5
]).not.toEndWith([
- 3,
+ 3,
4
]);
});
@@ -419,8 +419,8 @@ describe('toEachEndWith', function () {
});
it('should work for array with multiple elements', function () {
expect([
- 'one',
- 'zwee',
+ 'one',
+ 'zwee',
'three'
]).toEachEndWith('e');
});
@@ -433,8 +433,8 @@ describe('toEachEndWith', function () {
});
it('should work for array with multiple elements', function () {
expect([
- 'one',
- 'zwei',
+ 'one',
+ 'zwei',
'three'
]).not.toEachEndWith('e');
});
@@ -449,8 +449,8 @@ describe('toSomeEndWith', function () {
});
it('should work for array with multiple elements', function () {
expect([
- 'one',
- 'zwee',
+ 'one',
+ 'zwee',
'three'
]).toSomeEndWith('ee');
});
@@ -463,8 +463,8 @@ describe('toSomeEndWith', function () {
});
it('should work for array with multiple elements', function () {
expect([
- 'one',
- 'zwei',
+ 'one',
+ 'zwei',
'three'
]).not.toSomeEndWith('a');
});
@@ -491,17 +491,17 @@ describe('toStartWith', function () {
describe('matches', function () {
it('should work for string', function () {
expect([
- '1',
+ '1',
'2'
]).toStartWith('1');
});
it('should work for array', function () {
expect([
- 3,
- 4,
+ 3,
+ 4,
5
]).toStartWith([
- 3,
+ 3,
4
]);
});
@@ -509,17 +509,17 @@ describe('toStartWith', function () {
describe('non-matches', function () {
it('should work for string', function () {
expect([
- '1',
+ '1',
'2'
]).not.toStartWith('3');
});
it('should work for array', function () {
expect([
- 3,
- 4,
+ 3,
+ 4,
5
]).not.toStartWith([
- 4,
+ 4,
5
]);
});
@@ -535,8 +535,8 @@ describe('toEachStartWith', function () {
});
it('should work for array with multiple elements', function () {
expect([
- 'one',
- 'onetwo',
+ 'one',
+ 'onetwo',
'onethree'
]).toEachStartWith('o');
});
@@ -549,8 +549,8 @@ describe('toEachStartWith', function () {
});
it('should work for array with multiple elements', function () {
expect([
- 'one',
- 'two',
+ 'one',
+ 'two',
'onethree'
]).not.toEachStartWith('o');
});
@@ -565,8 +565,8 @@ describe('toSomeStartWith', function () {
});
it('should work for array with multiple elements', function () {
expect([
- 'one',
- 'onetwo',
+ 'one',
+ 'onetwo',
'three'
]).toSomeStartWith('one');
});
@@ -579,8 +579,8 @@ describe('toSomeStartWith', function () {
});
it('should work for array with multiple elements', function () {
expect([
- 'one',
- 'two',
+ 'one',
+ 'two',
'onethree'
]).not.toSomeStartWith('a');
});
@@ -610,19 +610,19 @@ describe('toStartWithEither', function () {
describe('matches', function () {
it('should work for string', function () {
expect([
- '1',
+ '1',
'2'
]).toStartWithEither('1', '2');
});
it('should work for array', function () {
expect([
- 3,
- 4,
+ 3,
+ 4,
5
]).toStartWithEither([
4
], [
- 3,
+ 3,
4
]);
});
@@ -630,20 +630,20 @@ describe('toStartWithEither', function () {
describe('non-matches', function () {
it('should work for string', function () {
expect([
- '1',
+ '1',
'2'
]).not.toStartWithEither('3');
});
it('should work for array', function () {
expect([
- 3,
- 4,
+ 3,
+ 4,
5
]).not.toStartWithEither([
- 5,
+ 5,
6
], [
- 4,
+ 4,
5
]);
});
diff --git a/js-combinatorics/js-combinatorics-global-tests.ts b/js-combinatorics/js-combinatorics-global-tests.ts
new file mode 100644
index 0000000000..e8591fbc20
--- /dev/null
+++ b/js-combinatorics/js-combinatorics-global-tests.ts
@@ -0,0 +1,99 @@
+///
+
+const p:number = Combinatorics.P(1, 2);
+const c:number = Combinatorics.C(1, 2);
+const factorial:number = Combinatorics.factorial(5);
+const factoradic:number[] = Combinatorics.factoradic(5);
+
+const power = Combinatorics.power(["a", "b", "c"]);
+const nextPower:string[] = power.next();
+power.forEach((i:string[]) => console.log(i));
+const powersLengths:number[] = power.map((i:string[]) => i.length);
+const filteredPowers:string[][] = power.filter((i:string[]) => i.length > 0);
+const allPowers:string[][] = power.toArray();
+const powersCount = power.length;
+const nthPower:string[] = power.nth(3);
+
+const limitedCombination = Combinatorics.combination(["a", "b", "c"], 2);
+const combination = Combinatorics.combination(["a", "b", "c"]);
+const nextCombination:string[] = combination.next();
+combination.forEach((i:string[]) => console.log(i));
+const combinationsLengths:number[] = combination.map((i:string[]) => i.length);
+const filteredCombinations:string[][] = combination.filter((i:string[]) => i.length > 0);
+const allCombinations:string[][] = combination.toArray();
+const combinationsCount = combination.length;
+
+const limitedPermutation = Combinatorics.permutation(["a", "b", "c"], 2);
+const permutation = Combinatorics.permutation(["a", "b", "c"]);
+const nextPermutation:string[] = permutation.next();
+permutation.forEach((i:string[]) => console.log(i));
+const permutationsLengths:number[] = permutation.map((i:string[]) => i.length);
+const filteredPermutations:string[][] = permutation.filter((i:string[]) => i.length > 0);
+const allPermutations:string[][] = permutation.toArray();
+const permutationsCount = permutation.length;
+
+const permutationCombination = Combinatorics.permutationCombination(["a", "b", "c"]);
+const nextPermutationCombinations:string[] = permutationCombination.next();
+permutationCombination.forEach((i:string[]) => console.log(i));
+const permutationCombinationsLengths:number[] = permutationCombination.map((i:string[]) => i.length);
+const filteredPermutationCombinationss:string[][] = permutationCombination.filter((i:string[]) => i.length > 0);
+const allPermutationCombinationss:string[][] = permutationCombination.toArray();
+const permutationCombinationsCount = permutationCombination.length;
+
+const limitedBaseN = Combinatorics.baseN(["a", "b", "c"], 2);
+const baseN = Combinatorics.baseN(["a", "b", "c"]);
+const nextbaseN:string[] = baseN.next();
+baseN.forEach((i:string[]) => console.log(i));
+const baseNsLengths:number[] = baseN.map((i:string[]) => i.length);
+const filteredbaseNs:string[][] = baseN.filter((i:string[]) => i.length > 0);
+const allbaseNs:string[][] = baseN.toArray();
+const baseNsCount = baseN.length;
+const nthbaseN:string[] = baseN.nth(3);
+
+const cartesianProduct1 = Combinatorics.cartesianProduct(["a", "b", "c"]);
+const nextCartesianProduct1:[string] = cartesianProduct1.next();
+const nextCartesianProduct1Char = nextCartesianProduct1[0].substr(0, 1);
+cartesianProduct1.forEach((i:[string]) => console.log(i));
+const cartesianProduct1sLengths:number[] = cartesianProduct1.map((i:[string]) => i.length);
+const filteredCartesianProduct1s:[string][] = cartesianProduct1.filter((i:[string]) => i.length > 0);
+const allCartesianProduct1s:[string][] = cartesianProduct1.toArray();
+const cartesianProduct1sCount = cartesianProduct1.length;
+const nthCartesianProduct1:[string] = cartesianProduct1.nth(3);
+const cartesianProduct1ByCoords:[string] = cartesianProduct1.get(1);
+
+const cartesianProduct2 = Combinatorics.cartesianProduct(["a", "b", "c"], [1, 2, 3]);
+const nextCartesianProduct2:[string, number] = cartesianProduct2.next();
+const nextCartesianProduct2Char = nextCartesianProduct2[0].substr(0, 1);
+const nextCartesianProduct2Num = nextCartesianProduct2[1].toFixed(2);
+cartesianProduct2.forEach((i:[string, number]) => console.log(i));
+const cartesianProduct2sLengths:number[] = cartesianProduct2.map((i:[string, number]) => i.length);
+const filteredCartesianProduct2s:[string, number][] = cartesianProduct2.filter((i:[string, number]) => i.length > 0);
+const allCartesianProduct2s:[string, number][] = cartesianProduct2.toArray();
+const cartesianProduct2sCount = cartesianProduct2.length;
+const nthCartesianProduct2:[string, number] = cartesianProduct2.nth(3);
+const cartesianProduct2ByCoords:[string, number] = cartesianProduct2.get(1, 1);
+
+const cartesianProduct3 = Combinatorics.cartesianProduct(["a", "b", "c"], [1, 2, 3], [true, false]);
+const nextCartesianProduct3:[string, number, boolean] = cartesianProduct3.next();
+const nextCartesianProduct3Char = nextCartesianProduct3[0].substr(0, 1);
+const nextCartesianProduct3Num = nextCartesianProduct3[1].toFixed(2);
+const nextCartesianProduct4Cond = nextCartesianProduct3[2] === true;
+cartesianProduct3.forEach((i:[string, number, boolean]) => console.log(i));
+const cartesianProduct3sLengths:number[] = cartesianProduct3.map((i:[string, number, boolean]) => i.length);
+const filteredCartesianProduct3s:[string, number, boolean][] = cartesianProduct3.filter((i:[string, number, boolean]) => i.length > 0);
+const allCartesianProduct3s:[string, number, boolean][] = cartesianProduct3.toArray();
+const cartesianProduct3sCount = cartesianProduct3.length;
+const nthCartesianProduct3:[string, number, boolean] = cartesianProduct3.nth(3);
+const cartesianProduct3ByCoords:[string, number, boolean] = cartesianProduct3.get(1, 1);
+
+const cartesianProductAny = Combinatorics.cartesianProduct(["a", 1, true], [false, 2, "b"]);
+const nextCartesianProductAny:any[] = cartesianProductAny.next();
+cartesianProductAny.forEach((i:any[]) => console.log(i));
+const cartesianProductAnysLengths:number[] = cartesianProductAny.map((i:any[]) => i.length);
+const filteredCartesianProductAnys:any[][] = cartesianProductAny.filter((i:any[]) => i.length > 0);
+const allCartesianProductAnys:any[][] = cartesianProductAny.toArray();
+const cartesianProductAnysCount = cartesianProductAny.length;
+const nthCartesianProductAny:any[] = cartesianProductAny.nth(3);
+const cartesianProductAnyByCoords:any[] = cartesianProductAny.get(1, 1);
+
+const version:string = Combinatorics.VERSION;
diff --git a/js-combinatorics/js-combinatorics-global.d.ts b/js-combinatorics/js-combinatorics-global.d.ts
new file mode 100644
index 0000000000..20c302981c
--- /dev/null
+++ b/js-combinatorics/js-combinatorics-global.d.ts
@@ -0,0 +1,8 @@
+// Type definitions for js-combinatorics v0.5.0 (global)
+// Project: https://github.com/dankogai/js-combinatorics
+// Definitions by: Vasya Aksyonov
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+
+import Combinatorics = __Combinatorics;
diff --git a/js-combinatorics/js-combinatorics-tests.ts b/js-combinatorics/js-combinatorics-tests.ts
new file mode 100644
index 0000000000..08e04c374f
--- /dev/null
+++ b/js-combinatorics/js-combinatorics-tests.ts
@@ -0,0 +1,95 @@
+///
+
+import * as Combinatorics from "js-combinatorics";
+
+const p:number = Combinatorics.P(1, 2);
+const c:number = Combinatorics.C(1, 2);
+const factorial:number = Combinatorics.factorial(5);
+const factoradic:number[] = Combinatorics.factoradic(5);
+
+const power = Combinatorics.power(["a", "b", "c"]);
+const nextPower:string[] = power.next();
+power.forEach((i:string[]) => console.log(i));
+const powersLengths:number[] = power.map((i:string[]) => i.length);
+const filteredPowers:string[][] = power.filter((i:string[]) => i.length > 0);
+const allPowers:string[][] = power.toArray();
+const powersCount = power.length;
+const nthPower:string[] = power.nth(3);
+
+const limitedCombination = Combinatorics.combination(["a", "b", "c"], 2);
+const combination = Combinatorics.combination(["a", "b", "c"]);
+const nextCombination:string[] = combination.next();
+combination.forEach((i:string[]) => console.log(i));
+const combinationsLengths:number[] = combination.map((i:string[]) => i.length);
+const filteredCombinations:string[][] = combination.filter((i:string[]) => i.length > 0);
+const allCombinations:string[][] = combination.toArray();
+const combinationsCount = combination.length;
+
+const limitedPermutation = Combinatorics.permutation(["a", "b", "c"], 2);
+const permutation = Combinatorics.permutation(["a", "b", "c"]);
+const nextPermutation:string[] = permutation.next();
+permutation.forEach((i:string[]) => console.log(i));
+const permutationsLengths:number[] = permutation.map((i:string[]) => i.length);
+const filteredPermutations:string[][] = permutation.filter((i:string[]) => i.length > 0);
+const allPermutations:string[][] = permutation.toArray();
+const permutationsCount = permutation.length;
+
+const permutationCombination = Combinatorics.permutationCombination(["a", "b", "c"]);
+const nextPermutationCombinations:string[] = permutationCombination.next();
+permutationCombination.forEach((i:string[]) => console.log(i));
+const permutationCombinationsLengths:number[] = permutationCombination.map((i:string[]) => i.length);
+const filteredPermutationCombinationss:string[][] = permutationCombination.filter((i:string[]) => i.length > 0);
+const allPermutationCombinationss:string[][] = permutationCombination.toArray();
+const permutationCombinationsCount = permutationCombination.length;
+
+const limitedBaseN = Combinatorics.baseN(["a", "b", "c"], 2);
+const baseN = Combinatorics.baseN(["a", "b", "c"]);
+const nextbaseN:string[] = baseN.next();
+baseN.forEach((i:string[]) => console.log(i));
+const baseNsLengths:number[] = baseN.map((i:string[]) => i.length);
+const filteredbaseNs:string[][] = baseN.filter((i:string[]) => i.length > 0);
+const allbaseNs:string[][] = baseN.toArray();
+const baseNsCount = baseN.length;
+const nthbaseN:string[] = baseN.nth(3);
+
+const cartesianProduct1 = Combinatorics.cartesianProduct(["a", "b", "c"]);
+const nextCartesianProduct1:[string] = cartesianProduct1.next();
+cartesianProduct1.forEach((i:[string]) => console.log(i));
+const cartesianProduct1sLengths:number[] = cartesianProduct1.map((i:[string]) => i.length);
+const filteredCartesianProduct1s:[string][] = cartesianProduct1.filter((i:[string]) => i.length > 0);
+const allCartesianProduct1s:[string][] = cartesianProduct1.toArray();
+const cartesianProduct1sCount = cartesianProduct1.length;
+const nthCartesianProduct1:[string] = cartesianProduct1.nth(3);
+const cartesianProduct1ByCoords:[string] = cartesianProduct1.get(1);
+
+const cartesianProduct2 = Combinatorics.cartesianProduct(["a", "b", "c"], [1, 2, 3]);
+const nextCartesianProduct2:[string, number] = cartesianProduct2.next();
+cartesianProduct2.forEach((i:[string, number]) => console.log(i));
+const cartesianProduct2sLengths:number[] = cartesianProduct2.map((i:[string, number]) => i.length);
+const filteredCartesianProduct2s:[string, number][] = cartesianProduct2.filter((i:[string, number]) => i.length > 0);
+const allCartesianProduct2s:[string, number][] = cartesianProduct2.toArray();
+const cartesianProduct2sCount = cartesianProduct2.length;
+const nthCartesianProduct2:[string, number] = cartesianProduct2.nth(3);
+const cartesianProduct2ByCoords:[string, number] = cartesianProduct2.get(1, 1);
+
+const cartesianProduct3 = Combinatorics.cartesianProduct(["a", "b", "c"], [1, 2, 3], [true, false]);
+const nextCartesianProduct3:[string, number, boolean] = cartesianProduct3.next();
+cartesianProduct3.forEach((i:[string, number, boolean]) => console.log(i));
+const cartesianProduct3sLengths:number[] = cartesianProduct3.map((i:[string, number, boolean]) => i.length);
+const filteredCartesianProduct3s:[string, number, boolean][] = cartesianProduct3.filter((i:[string, number, boolean]) => i.length > 0);
+const allCartesianProduct3s:[string, number, boolean][] = cartesianProduct3.toArray();
+const cartesianProduct3sCount = cartesianProduct3.length;
+const nthCartesianProduct3:[string, number, boolean] = cartesianProduct3.nth(3);
+const cartesianProduct3ByCoords:[string, number, boolean] = cartesianProduct3.get(1, 1);
+
+const cartesianProductAny = Combinatorics.cartesianProduct(["a", 1, true], [false, 2, "b"]);
+const nextCartesianProductAny:any[] = cartesianProductAny.next();
+cartesianProductAny.forEach((i:any[]) => console.log(i));
+const cartesianProductAnysLengths:number[] = cartesianProductAny.map((i:any[]) => i.length);
+const filteredCartesianProductAnys:any[][] = cartesianProductAny.filter((i:any[]) => i.length > 0);
+const allCartesianProductAnys:any[][] = cartesianProductAny.toArray();
+const cartesianProductAnysCount = cartesianProductAny.length;
+const nthCartesianProductAny:any[] = cartesianProductAny.nth(3);
+const cartesianProductAnyByCoords:any[] = cartesianProductAny.get(1, 1);
+
+const version:string = Combinatorics.VERSION;
diff --git a/js-combinatorics/js-combinatorics.d.ts b/js-combinatorics/js-combinatorics.d.ts
new file mode 100644
index 0000000000..270e98b641
--- /dev/null
+++ b/js-combinatorics/js-combinatorics.d.ts
@@ -0,0 +1,135 @@
+// Type definitions for js-combinatorics v0.5.0
+// Project: https://github.com/dankogai/js-combinatorics
+// Definitions by: Vasya Aksyonov
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+declare namespace __Combinatorics {
+
+ interface IGenerator {
+
+ /**
+ * Returns the element or undefined if no more element is available.
+ */
+ next():T;
+
+ /**
+ * Applies the callback function for each element.
+ */
+ forEach(f:(item:T) => void):void;
+
+ /**
+ * All elements at once with function applied to each element.
+ */
+ map(f:(item:T) => TResult):TResult[];
+
+ /**
+ * Returns an array with elements that passes the filter function.
+ */
+ filter(predicate:(item:T) => boolean):T[];
+
+ /**
+ * All elements at once.
+ */
+ toArray():T[];
+
+ /**
+ * Returns the number of elements to be generated which equals to generator.toArray().length
+ * but it is precalculated without actually generating elements.
+ * Handy when you prepare for large iteration.
+ */
+ length:number;
+
+ }
+
+ interface IPredictableGenerator extends IGenerator {
+
+ /**
+ * Returns the nth element (starting 0).
+ */
+ nth(n:number):T;
+
+ }
+
+ interface ICartesianProductGenerator extends IPredictableGenerator {
+
+ /**
+ * Arguments are coordinates in integer.
+ * Arguments can be out of bounds but it returns undefined in such cases.
+ */
+ get(...coordinates:number[]):T;
+
+ }
+
+ /**
+ * Calculates m P n
+ */
+ function P(m:number, n:number):number;
+
+ /**
+ * Calculates m C n
+ */
+ function C(m:number, n:number):number;
+
+ /**
+ * Calculates n!
+ */
+ function factorial(n:number):number;
+
+ /**
+ * Returns the factoradic representation of n in array, in least significant order.
+ * See http://en.wikipedia.org/wiki/Factorial_number_system
+ */
+ function factoradic(n:number):number[];
+
+ /**
+ * Generates the power set of array.
+ */
+ function power(a:T[]):IPredictableGenerator;
+
+ /**
+ * Generates the combination of array with n elements.
+ * When n is ommited, the length of the array is used.
+ */
+ function combination(a:T[], n?:number):IGenerator;
+
+ /**
+ * Generates the permutation of array with n elements.
+ * When n is ommited, the length of the array is used.
+ */
+ function permutation(a:T[], n?:number):IGenerator;
+
+ /**
+ * Generates the permutation of the combination of n.
+ * Equivalent to permutation(combination(a)), but more efficient.
+ */
+ function permutationCombination(a:T[]):IGenerator;
+
+ /**
+ * Generates n-digit "numbers" where each digit is an element in array.
+ * Note this "number" is in the least significant order.
+ * When n is ommited, the length of the array is used.
+ */
+ function baseN(a:T[], n?:number):IPredictableGenerator;
+
+ /**
+ * Generates the cartesian product of the arrays. All arguments must be arrays with more than one element.
+ */
+ function cartesianProduct(a1:T1[]):ICartesianProductGenerator<[T1]>;
+ function cartesianProduct(a1:T1[], a2:T2[]):ICartesianProductGenerator<[T1, T2]>;
+ function cartesianProduct(a1:T1[], a2:T2[], a3:T3[]):ICartesianProductGenerator<[T1, T2, T3]>;
+ function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[]):ICartesianProductGenerator<[T1, T2, T3, T4]>;
+ function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5]>;
+ function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[], a6:T6[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5, T6]>;
+ function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[], a6:T6[], a7:T7[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5, T6, T7]>;
+ function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[], a6:T6[], a7:T7[], a8:T8[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5, T6, T7, T8]>;
+ function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[], a6:T6[], a7:T7[], a8:T8[], a9:T9[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
+ function cartesianProduct(a1:T1[], a2:T2[], a3:T3[], a4:T4[], a5:T5[], a6:T6[], a7:T7[], a8:T8[], a9:T9[], a10:T10[]):ICartesianProductGenerator<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
+ function cartesianProduct(...a:any[][]):ICartesianProductGenerator;
+
+ const VERSION:string;
+
+}
+
+declare module "js-combinatorics" {
+ export = __Combinatorics;
+}
diff --git a/jsonwebtoken/jsonwebtoken.d.ts b/jsonwebtoken/jsonwebtoken.d.ts
index 205970f6a1..bb74aa8538 100644
--- a/jsonwebtoken/jsonwebtoken.d.ts
+++ b/jsonwebtoken/jsonwebtoken.d.ts
@@ -22,8 +22,13 @@ declare module "jsonwebtoken" {
* - none: No digital signature or MAC value included
*/
algorithm?: string;
- /** @member {number} - Lifetime for the token in minutes */
+ /**
+ *@deprecated - see expiresIn
+ *@member {number} - Lifetime for the token in minutes
+ */
expiresInMinutes?: number;
+ /** @member {string} - Lifetime for the token expressed in a string describing a time span [rauchg/ms](https://github.com/rauchg/ms.js). Eg: `60`, `"2 days"`, `"10h"`, `"7d"` */
+ expiresIn?: string;
audience?: string;
subject?: string;
issuer?: string;
@@ -33,6 +38,7 @@ declare module "jsonwebtoken" {
export interface VerifyOptions {
audience?: string;
issuer?: string;
+ maxAge?: string;
}
export interface VerifyCallbak {
diff --git a/jwt-decode/jwt-decode-tests.ts b/jwt-decode/jwt-decode-tests.ts
new file mode 100644
index 0000000000..66d639b409
--- /dev/null
+++ b/jwt-decode/jwt-decode-tests.ts
@@ -0,0 +1,12 @@
+ ///
+import jwtDecode = require('jwt-decode');
+
+let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIiLCJleHAiOjEzOTMyODY4OTMsImlhdCI6MTM5MzI2ODg5M30.4-iaDojEVl0pJQMjrbM1EzUIfAZgsbK_kgnVyVxFSVo";
+
+interface TokenDto {
+ foo: string;
+ exp: number;
+ iat: number;
+}
+
+let decodedToken = jwtDecode(token) as TokenDto;
diff --git a/jwt-decode/jwt-decode.d.ts b/jwt-decode/jwt-decode.d.ts
new file mode 100644
index 0000000000..67d7aac163
--- /dev/null
+++ b/jwt-decode/jwt-decode.d.ts
@@ -0,0 +1,16 @@
+// Type definitions for jwt-decode v1.4.0
+// Project: https://github.com/auth0/jwt-decode
+// Definitions by: Giedrius Grabauskas
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+declare module JwtDecode {
+ interface JwtDecodeStatic {
+ (token: string): any;
+ }
+}
+
+declare module 'jwt-decode' {
+ var jwtDecode: JwtDecode.JwtDecodeStatic;
+ export = jwtDecode;
+}
diff --git a/leaflet-label/leaflet-label.d.ts b/leaflet-label/leaflet-label.d.ts
index a77def73c0..02d94a3214 100644
--- a/leaflet-label/leaflet-label.d.ts
+++ b/leaflet-label/leaflet-label.d.ts
@@ -56,6 +56,7 @@ declare module L {
className?: string;
clickable?: boolean;
direction?: string; // 'left' | 'right' | 'auto';
+ pane?: string;
noHide?: boolean;
offset?: Point;
opacity?: number;
diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts
index bdc08ccdc7..9cae2a8721 100644
--- a/lodash/lodash-tests.ts
+++ b/lodash/lodash-tests.ts
@@ -453,13 +453,58 @@ module TestDropWhile {
}
// _.fill
-var testFillArray = [1, 2, 3];
-var testFillList: _.List = {0: 1, 1: 2, 2: 3, length: 3};
+module TestFill {
+ let array: number[];
+ let list: _.List;
-result = _.fill(testFillArray, 'a', 0, 3);
-result = <_.List>_.fill(testFillList, 'a', 0, 3);
-result = _(testFillArray).fill(0, 0, 3).value();
-result = <_.List>_(testFillList).fill(0, 0, 3).value();
+ {
+ let result: number[];
+
+ result = _.fill(array, 42);
+ result = _.fill(array, 42, 0);
+ result = _.fill(array, 42, 0, 10);
+ }
+
+ {
+ let result: _.List;
+
+ result = _.fill(list, 42);
+ result = _.fill(list, 42, 0);
+ result = _.fill(list, 42, 0, 10);
+ }
+
+ {
+ let result: _.LoDashImplicitArrayWrapper;
+
+ result = _(array).fill(42);
+ result = _(array).fill(42, 0);
+ result = _(array).fill(42, 0, 10);
+ }
+
+ {
+ let result: _.LoDashImplicitObjectWrapper<_.List>;
+
+ result = _(list).fill(42);
+ result = _(list).fill(42, 0);
+ result = _(list).fill(42, 0, 10);
+ }
+
+ {
+ let result: _.LoDashExplicitArrayWrapper;
+
+ result = _(array).chain().fill(42);
+ result = _(array).chain().fill(42, 0);
+ result = _(array).chain().fill(42, 0, 10);
+ }
+
+ {
+ let result: _.LoDashExplicitObjectWrapper<_.List>;
+
+ result = _(list).chain().fill(42);
+ result = _(list).chain().fill(42, 0);
+ result = _(list).chain().fill(42, 0, 10);
+ }
+}
// _.findIndex
module TestFindIndex {
@@ -615,18 +660,40 @@ module TestFlattenDeep {
result = _.flattenDeep(recursiveArray);
result = _.flattenDeep(listOfMaybeRecursiveArraysOrValues);
-
- result = _(recursiveArray).flattenDeep().value();
-
- result = _(listOfMaybeRecursiveArraysOrValues).flattenDeep().value();
}
{
- let result: any;
+ let result: any[];
result = _.flattenDeep(recursiveList);
+ }
- result = _(recursiveList).flattenDeep().value();
+ {
+ let result: _.LoDashImplicitArrayWrapper;
+
+ result = _(recursiveArray).flattenDeep();
+
+ result = _(listOfMaybeRecursiveArraysOrValues).flattenDeep();
+ }
+
+ {
+ let result: _.LoDashImplicitArrayWrapper;
+
+ result = _(recursiveList).flattenDeep();
+ }
+
+ {
+ let result: _.LoDashExplicitArrayWrapper;
+
+ result = _(recursiveArray).chain().flattenDeep();
+
+ result = _(listOfMaybeRecursiveArraysOrValues).chain().flattenDeep();
+ }
+
+ {
+ let result: _.LoDashExplicitArrayWrapper;
+
+ result = _(recursiveList).chain().flattenDeep();
}
}
@@ -1164,17 +1231,86 @@ module TestSlice {
// _.sortedIndex
module TestSortedIndex {
- result = _.sortedIndex([20, 30, 50], 40);
- result = _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
- var sortedIndexDict: { wordToNumber: { [idx: string]: number } } = {
- 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 }
- };
- result = _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function (word: string) {
- return sortedIndexDict.wordToNumber[word];
- });
- result = _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function (word: string) {
- return this.wordToNumber[word];
- }, sortedIndexDict);
+ type SampleType = {a: number; b: string; c: boolean;};
+
+ let array: SampleType[];
+ let list: _.List;
+
+ let value: SampleType;
+
+ let stringIterator: (x: string) => number;
+ let arrayIterator: (x: SampleType) => number;
+ let listIterator: (x: SampleType) => number;
+
+ {
+ let result: number;
+
+ result = _.sortedIndex('', '');
+ result = _.sortedIndex('', '', stringIterator);
+ result = _.sortedIndex('', '', stringIterator, any);
+ result = _.sortedIndex('', '', stringIterator);
+ result = _.sortedIndex('', '', stringIterator, any);
+
+ result = _.sortedIndex(array, value);
+ result = _.sortedIndex(array, value, arrayIterator);
+ result = _.sortedIndex(array, value, arrayIterator, any);
+ result = _.sortedIndex(array, value, '');
+ result = _.sortedIndex(array, value, {a: 42});
+ result = _.sortedIndex(array, value, arrayIterator);
+ result = _.sortedIndex(array, value, arrayIterator, any);
+ result = _.sortedIndex<{a: number}, SampleType>(array, value, {a: 42});
+
+ result = _.sortedIndex(list, value);
+ result = _.sortedIndex(list, value, listIterator);
+ result = _.sortedIndex(list, value, listIterator, any);
+ result = _.sortedIndex(list, value, '');
+ result = _.sortedIndex(list, value, {a: 42});
+ result = _.sortedIndex(list, value, listIterator);
+ result = _.sortedIndex(list, value, listIterator, any);
+ result = _.sortedIndex<{a: number}, SampleType>(list, value, {a: 42});
+
+ result = _('').sortedIndex('');
+ result = _('').sortedIndex('', stringIterator);
+ result = _('').sortedIndex('', stringIterator, any);
+
+ result = _(array).sortedIndex(value);
+ result = _(array).sortedIndex(value, arrayIterator);
+ result = _(array).sortedIndex(value, arrayIterator, any);
+ result = _(array).sortedIndex(value, '');
+ result = _(array).sortedIndex<{a: number}>(value, {a: 42});
+
+ result = _(list).sortedIndex(value);
+ result = _(list).sortedIndex(value, listIterator);
+ result = _(list).sortedIndex(value, listIterator, any);
+ result = _(list).sortedIndex(value, '');
+ result = _(list).sortedIndex(value, {a: 42});
+ result = _(list).sortedIndex(value, listIterator);
+ result = _(list).sortedIndex(value, listIterator, any);
+ result = _(list).sortedIndex<{a: number}, SampleType>(value, {a: 42});
+ }
+
+ {
+ let result: _.LoDashExplicitWrapper;
+
+ result = _('').chain().sortedIndex('');
+ result = _('').chain().sortedIndex('', stringIterator);
+ result = _('').chain().sortedIndex('', stringIterator, any);
+
+ result = _(array).chain().sortedIndex(value);
+ result = _(array).chain().sortedIndex(value, arrayIterator);
+ result = _(array).chain().sortedIndex(value, arrayIterator, any);
+ result = _(array).chain().sortedIndex(value, '');
+ result = _(array).chain().sortedIndex<{a: number}>(value, {a: 42});
+
+ result = _(list).chain().sortedIndex(value);
+ result = _(list).chain().sortedIndex(value, listIterator);
+ result = _(list).chain().sortedIndex(value, listIterator, any);
+ result = _(list).chain().sortedIndex(value, '');
+ result = _(list).chain().sortedIndex(value, {a: 42});
+ result = _(list).chain().sortedIndex(value, listIterator);
+ result = _(list).chain().sortedIndex(value, listIterator, any);
+ result = _(list).chain().sortedIndex<{a: number}, SampleType>(value, {a: 42});
+ }
}
// _.sortedLastIndex
@@ -3396,21 +3532,154 @@ module TestForEachRight {
}
}
-result = <_.Dictionary>_.groupBy([4.2, 6.1, 6.4], function (num) { return Math.floor(num); });
-result = <_.Dictionary>_.groupBy([4.2, 6.1, 6.4], function (num) { return this.floor(num); }, Math);
-result = <_.Dictionary>_.groupBy(['one', 'two', 'three'], 'length');
+// _.groupBy
+module TestGroupBy {
+ type SampleType = {a: number; b: string; c: boolean;};
-result = <_.Dictionary>_.groupBy({ prop1: 4.2, prop2: 6.1, prop3: 6.4}, function (num) { return Math.floor(num); });
-result = <_.Dictionary>_.groupBy({ prop1: 4.2, prop2: 6.1, prop3: 6.4}, function (num) { return this.floor(num); }, Math);
-result = <_.Dictionary>_.groupBy({ prop1: 'one', prop2: 'two', prop3: 'three'}, 'length');
+ let array: SampleType[];
+ let list: _.List;
+ let dictionary: _.Dictionary;
-result = <_.Dictionary>_([4.2, 6.1, 6.4]).groupBy(function (num) { return Math.floor(num); }).value();
-result = <_.Dictionary>_([4.2, 6.1, 6.4]).groupBy(function (num) { return this.floor(num); }, Math).value();
-result = <_.Dictionary>_(['one', 'two', 'three']).groupBy('length').value();
+ let stringIterator: (char: string, index: number, string: string) => number;
+ let listIterator: (value: SampleType, index: number, collection: _.List) => number;
+ let dictionaryIterator: (value: SampleType, key: string, collection: _.Dictionary) => number;
-result = <_.Dictionary>_({ prop1: 4.2, prop2: 6.1, prop3: 6.4}).groupBy(function (num) { return Math.floor(num); }).value();
-result = <_.Dictionary>_({ prop1: 4.2, prop2: 6.1, prop3: 6.4}).groupBy(function (num) { return this.floor(num); }, Math).value();
-result = <_.Dictionary>_({ prop1: 'one', prop2: 'two', prop3: 'three'}).groupBy('length').value();
+ {
+ let result: _.Dictionary;
+
+ result = _.groupBy('');
+ result = _.groupBy('', stringIterator);
+ result = _.groupBy('', stringIterator, any);
+ result = _.groupBy('', stringIterator);
+ result = _.groupBy('', stringIterator, any);
+ }
+
+ {
+ let result: _.Dictionary;
+
+ result = _.groupBy(array);
+ result = _.groupBy(array, listIterator);
+ result = _.groupBy(array, listIterator, any);
+ result = _.groupBy(array, '');
+ result = _.groupBy(array, '', any);
+ result = _.groupBy(array, {a: 42});
+
+ result = _.groupBy(array, listIterator);
+ result = _.groupBy(array, listIterator, any);
+ result = _.groupBy(array, '', true);
+ result = _.groupBy<{a: number}, SampleType>(array, {a: 42});
+
+ result = _.groupBy(list);
+ result = _.groupBy(list, listIterator);
+ result = _.groupBy(list, listIterator, any);
+ result = _.groupBy(list, '');
+ result = _.groupBy(list, '', any);
+ result = _.groupBy(list, {a: 42});
+
+ result = _.groupBy(list, listIterator);
+ result = _.groupBy(list, listIterator, any);
+ result = _.groupBy(list, '', true);
+ result = _.groupBy<{a: number}, SampleType>(list, {a: 42});
+
+ result = _.groupBy(dictionary);
+ result = _.groupBy(dictionary, dictionaryIterator);
+ result = _.groupBy(dictionary, dictionaryIterator, any);
+ result = _.groupBy(dictionary, '');
+ result = _.groupBy(dictionary, '', any);
+ result = _.groupBy(dictionary, {a: 42});
+
+ result = _.groupBy(dictionary, dictionaryIterator);
+ result = _.groupBy