From c09c3924238d325fa8686ea77f6141c3c14e26fb Mon Sep 17 00:00:00 2001 From: Matthew Amato Date: Tue, 25 Oct 2016 20:23:27 -0400 Subject: [PATCH] Use typings instead of rolling our own TypeScript definition solution This gets rid of the TypeScriptDefinitions directory and associated gulp task. Instead it uses the typings module which is a more standard way to manage TS definitions. This now creates a typings folder at npm install type and WebStorm has been configured to simply point to that. Not only is this cleaner, but the actual intellisense is much better at WebStorm should provide even more help now. Also removed the request dependency because it's no loner used. Also added missing entries to npmignore and gitignore. As part of this change, I also updated all npm modules to there latest version, this is in preparation for turning on greenkeeper. --- .gitignore | 4 + .idea/OBJ2GLTF.iml | 3 +- .idea/jsLibraryMappings.xml | 3 +- .idea/libraries/node_modules.xml | 12 - ...{TypeScriptDefinitions.xml => typings.xml} | 5 +- .npmignore | 5 +- TypeScriptDefinitions/async.d.ts | 165 ------ TypeScriptDefinitions/byline.d.ts | 38 -- TypeScriptDefinitions/fs-extra.d.ts | 95 ---- TypeScriptDefinitions/gulp.d.ts | 290 ---------- TypeScriptDefinitions/istanbul.d.ts | 73 --- TypeScriptDefinitions/jasmine.d.ts | 508 ------------------ TypeScriptDefinitions/open.d.ts | 9 - TypeScriptDefinitions/request.d.ts | 262 --------- TypeScriptDefinitions/yargs.d.ts | 170 ------ gulpfile.js | 26 - package.json | 30 +- typings.json | 16 + 18 files changed, 44 insertions(+), 1670 deletions(-) delete mode 100644 .idea/libraries/node_modules.xml rename .idea/libraries/{TypeScriptDefinitions.xml => typings.xml} (59%) delete mode 100644 TypeScriptDefinitions/async.d.ts delete mode 100644 TypeScriptDefinitions/byline.d.ts delete mode 100644 TypeScriptDefinitions/fs-extra.d.ts delete mode 100644 TypeScriptDefinitions/gulp.d.ts delete mode 100644 TypeScriptDefinitions/istanbul.d.ts delete mode 100644 TypeScriptDefinitions/jasmine.d.ts delete mode 100644 TypeScriptDefinitions/open.d.ts delete mode 100644 TypeScriptDefinitions/request.d.ts delete mode 100644 TypeScriptDefinitions/yargs.d.ts create mode 100644 typings.json diff --git a/.gitignore b/.gitignore index 91f2110..ad27f7b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,10 @@ npm-debug.log .idea/workspace.xml .idea/tasks.xml +# TypeScript definitions +typings + # Generate data test coverage +*.tgz diff --git a/.idea/OBJ2GLTF.iml b/.idea/OBJ2GLTF.iml index 7f09720..cc19882 100644 --- a/.idea/OBJ2GLTF.iml +++ b/.idea/OBJ2GLTF.iml @@ -7,7 +7,6 @@ - - + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml index 09c4a54..45d7418 100644 --- a/.idea/jsLibraryMappings.xml +++ b/.idea/jsLibraryMappings.xml @@ -1,8 +1,7 @@ - - + diff --git a/.idea/libraries/node_modules.xml b/.idea/libraries/node_modules.xml deleted file mode 100644 index c4a1e51..0000000 --- a/.idea/libraries/node_modules.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/TypeScriptDefinitions.xml b/.idea/libraries/typings.xml similarity index 59% rename from .idea/libraries/TypeScriptDefinitions.xml rename to .idea/libraries/typings.xml index 2a75ac2..772980b 100644 --- a/.idea/libraries/TypeScriptDefinitions.xml +++ b/.idea/libraries/typings.xml @@ -1,12 +1,13 @@ - + - + + diff --git a/.npmignore b/.npmignore index ba04ba4..1fe05bd 100644 --- a/.npmignore +++ b/.npmignore @@ -1,9 +1,12 @@ /.idea +/doc /specs /test -/TypeScriptDefinitions +/typings /coverage .jshintrc .npmignore .travis.yml gulpfile.js +typings.json +*.tgz diff --git a/TypeScriptDefinitions/async.d.ts b/TypeScriptDefinitions/async.d.ts deleted file mode 100644 index 6288a26..0000000 --- a/TypeScriptDefinitions/async.d.ts +++ /dev/null @@ -1,165 +0,0 @@ -// Type definitions for Async 1.4.2 -// Project: https://github.com/caolan/async -// Definitions by: Boris Yankov , Arseniy Maximov , Joe Herman -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface Dictionary { [key: string]: T; } - -interface ErrorCallback { (err?: Error): void; } -interface AsyncResultCallback { (err: Error, result: T): void; } -interface AsyncResultArrayCallback { (err: Error, results: T[]): void; } -interface AsyncResultObjectCallback { (err: Error, results: Dictionary): void; } - -interface AsyncFunction { (callback: (err?: Error, result?: T) => void): void; } -interface AsyncIterator { (item: T, callback: ErrorCallback): void; } -interface AsyncForEachOfIterator { (item: T, key: number|string, callback: ErrorCallback): void; } -interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } -interface AsyncMemoIterator { (memo: R, item: T, callback: AsyncResultCallback): void; } -interface AsyncBooleanIterator { (item: T, callback: (err: string, truthValue: boolean) => void): void; } - -interface AsyncWorker { (task: T, callback: ErrorCallback): void; } -interface AsyncVoidFunction { (callback: ErrorCallback): void; } - -interface AsyncQueue { - length(): number; - started: boolean; - running(): number; - idle(): boolean; - concurrency: number; - push(task: T, callback?: ErrorCallback): void; - push(task: T[], callback?: ErrorCallback): void; - unshift(task: T, callback?: ErrorCallback): void; - unshift(task: T[], callback?: ErrorCallback): void; - saturated: () => any; - empty: () => any; - drain: () => any; - paused: boolean; - pause(): void - resume(): void; - kill(): void; -} - -interface AsyncPriorityQueue { - length(): number; - concurrency: number; - started: boolean; - paused: boolean; - push(task: T, priority: number, callback?: AsyncResultArrayCallback): void; - push(task: T[], priority: number, callback?: AsyncResultArrayCallback): void; - saturated: () => any; - empty: () => any; - drain: () => any; - running(): number; - idle(): boolean; - pause(): void; - resume(): void; - kill(): void; -} - -interface AsyncCargo { - length(): number; - payload: number; - push(task: any, callback? : Function): void; - push(task: any[], callback? : Function): void; - saturated(): void; - empty(): void; - drain(): void; - idle(): boolean; - pause(): void; - resume(): void; - kill(): void; -} - -interface Async { - - // Collections - each(arr: T[], iterator: AsyncIterator, callback?: ErrorCallback): void; - eachSeries(arr: T[], iterator: AsyncIterator, callback?: ErrorCallback): void; - eachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; - forEachOf(obj: any, iterator: (item: any, key: string|number, callback?: ErrorCallback) => void, callback: ErrorCallback): void; - forEachOf(obj: T[], iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - forEachOfSeries(obj: any, iterator: (item: any, key: string|number, callback?: ErrorCallback) => void, callback: ErrorCallback): void; - forEachOfSeries(obj: T[], iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - forEachOfLimit(obj: any, limit: number, iterator: (item: any, key: string|number, callback?: ErrorCallback) => void, callback: ErrorCallback): void; - forEachOfLimit(obj: T[], limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; - map(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - mapSeries(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - mapLimit(arr: T[], limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - filter(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - select(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - filterSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - selectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - filterLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - selectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - reject(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - rejectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - rejectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): any; - reduce(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; - inject(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; - foldl(arr: T[], memo: R, iterator: AsyncMemoIterator, callback?: AsyncResultCallback): any; - reduceRight(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any; - foldr(arr: T[], memo: R, iterator: AsyncMemoIterator, callback: AsyncResultCallback): any; - detect(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any; - detectSeries(arr: T[], iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any; - detectLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): any; - sortBy(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - some(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any; - someLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any; - any(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => void): any; - every(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => any): any; - everyLimit(arr: T[], limit: number, iterator: AsyncBooleanIterator, callback?: (result: boolean) => any): any; - all(arr: T[], iterator: AsyncBooleanIterator, callback?: (result: boolean) => any): any; - concat(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - concatSeries(arr: T[], iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): any; - - // Control Flow - series(tasks: AsyncFunction[], callback?: AsyncResultArrayCallback): void; - series(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; - parallel(tasks: Array>, callback?: AsyncResultArrayCallback): void; - parallel(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; - parallelLimit(tasks: Array>, limit: number, callback?: AsyncResultArrayCallback): void; - parallelLimit(tasks: Dictionary>, limit: number, callback?: AsyncResultObjectCallback): void; - whilst(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void; - doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void; - until(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void; - doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void; - during(test: (testCallback : (error: Error, truth: boolean) => void) => void, fn: AsyncVoidFunction, callback: (err: any) => void): void; - doDuring(fn: AsyncVoidFunction, test: (testCallback: (error: Error, truth: boolean) => void) => void, callback: (err: any) => void): void; - forever(next: (errCallback : (err: Error) => void) => void, errBack: (err: Error) => void) : void; - waterfall(tasks: Function[], callback?: (err: Error, results?: any) => void): void; - compose(...fns: Function[]): Function; - seq(...fns: Function[]): Function; - applyEach(fns: Function[], argsAndCallback: any[]): void; // applyEach(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. - applyEachSeries(fns: Function[], argsAndCallback: any[]): void; // applyEachSeries(fns, args..., callback). TS does not support ... for a middle argument. Callback is optional. - queue(worker: AsyncWorker, concurrency?: number): AsyncQueue; - priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; - cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo; - auto(tasks: any, callback?: (error: Error, results: any) => void): void; - retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: (error: Error, results: any) => void): void; - retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: (error: Error, results: any) => void): void; - iterator(tasks: Function[]): Function; - apply(fn: Function, ...arguments: any[]): AsyncFunction; - nextTick(callback: Function): void; - setImmediate(callback: Function): void; - - times (n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; - timesSeries(n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; - timesLimit(n: number, limit: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; - - // Utils - memoize(fn: Function, hasher?: Function): Function; - unmemoize(fn: Function): Function; - ensureAsync(fn: (... argsAndCallback: any[]) => void): Function; - constant(...values: any[]): Function; - asyncify(fn: Function): Function; - wrapSync(fn: Function): Function; - log(fn: Function, ...arguments: any[]): void; - dir(fn: Function, ...arguments: any[]): void; - noConflict(): Async; -} - -declare var async: Async; - -declare module "async" { - export = async; -} diff --git a/TypeScriptDefinitions/byline.d.ts b/TypeScriptDefinitions/byline.d.ts deleted file mode 100644 index 48ddd2d..0000000 --- a/TypeScriptDefinitions/byline.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Type definitions for byline 4.2.1 -// Project: https://github.com/jahewson/node-byline -// Definitions by: Stefan Steinhart -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare module "byline" { - import stream = require("stream"); - - export interface LineStreamOptions extends stream.TransformOptions { - keepEmptyLines?: boolean; - } - - export interface LineStream extends stream.Transform { - } - - export interface LineStreamCreatable extends LineStream { - new (options?:LineStreamOptions):LineStream - } - - //TODO is it possible to declare static factory functions without name (directly on the module) - // - // JS: - // // convinience API - // module.exports = function(readStream, options) { - // return module.exports.createStream(readStream, options); - // }; - // - // TS: - // ():LineStream; // same as createStream():LineStream - // (stream:stream.Stream, options?:LineStreamOptions):LineStream; // same as createStream(stream, options?):LineStream - - export function createStream():LineStream; - export function createStream(stream:NodeJS.ReadableStream, options?:LineStreamOptions):LineStream; - - export var LineStream:LineStreamCreatable; -} diff --git a/TypeScriptDefinitions/fs-extra.d.ts b/TypeScriptDefinitions/fs-extra.d.ts deleted file mode 100644 index 39656ce..0000000 --- a/TypeScriptDefinitions/fs-extra.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -// Type definitions for fs-extra -// Project: https://github.com/jprichardson/node-fs-extra -// Definitions by: midknight41 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Imported from: https://github.com/soywiz/typescript-node-definitions/fs-extra.d.ts - -/// - -declare module "fs-extra" { - export * from "fs"; - - export function copy(src: string, dest: string, callback?: (err: Error) => void): void; - export function copy(src: string, dest: string, filter: CopyFilter, callback?: (err: Error) => void): void; - export function copy(src: string, dest: string, options: CopyOptions, callback?: (err: Error) => void): void; - - export function copySync(src: string, dest: string): void; - export function copySync(src: string, dest: string, filter: CopyFilter): void; - export function copySync(src: string, dest: string, options: CopyOptions): void; - - export function createFile(file: string, callback?: (err: Error) => void): void; - export function createFileSync(file: string): void; - - export function mkdirs(dir: string, callback?: (err: Error) => void): void; - export function mkdirp(dir: string, callback?: (err: Error) => void): void; - export function mkdirs(dir: string, options?: MkdirOptions, callback?: (err: Error) => void): void; - export function mkdirp(dir: string, options?: MkdirOptions, callback?: (err: Error) => void): void; - export function mkdirsSync(dir: string, options?: MkdirOptions): void; - export function mkdirpSync(dir: string, options?: MkdirOptions): void; - - export function outputFile(file: string, data: any, callback?: (err: Error) => void): void; - export function outputFileSync(file: string, data: any): void; - - export function outputJson(file: string, data: any, callback?: (err: Error) => void): void; - export function outputJSON(file: string, data: any, callback?: (err: Error) => void): void; - export function outputJsonSync(file: string, data: any): void; - export function outputJSONSync(file: string, data: any): void; - - export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void; - export function readJson(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void; - export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void; - export function readJSON(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void; - - export function readJsonSync(file: string, options?: OpenOptions): any; - export function readJSONSync(file: string, options?: OpenOptions): any; - - export function remove(dir: string, callback?: (err: Error) => void): void; - export function removeSync(dir: string): void; - - export function writeJson(file: string, object: any, callback?: (err: Error) => void): void; - export function writeJson(file: string, object: any, options?: OpenOptions, callback?: (err: Error) => void): void; - export function writeJSON(file: string, object: any, callback?: (err: Error) => void): void; - export function writeJSON(file: string, object: any, options?: OpenOptions, callback?: (err: Error) => void): void; - - export function writeJsonSync(file: string, object: any, options?: OpenOptions): void; - export function writeJSONSync(file: string, object: any, options?: OpenOptions): void; - - 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 CopyFilterFunction { - (src: string): boolean - } - - export type CopyFilter = CopyFilterFunction | RegExp; - - export interface CopyOptions { - clobber?: boolean - preserveTimestamps?: boolean - dereference?: boolean - filter?: CopyFilter - } - - export interface OpenOptions { - encoding?: string; - flag?: string; - } - - export interface MkdirOptions { - fs?: any; - mode?: number; - } -} diff --git a/TypeScriptDefinitions/gulp.d.ts b/TypeScriptDefinitions/gulp.d.ts deleted file mode 100644 index 43bb5aa..0000000 --- a/TypeScriptDefinitions/gulp.d.ts +++ /dev/null @@ -1,290 +0,0 @@ -// Type definitions for Gulp v3.8.x -// Project: http://gulpjs.com -// Definitions by: Drew Noakes -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -declare module "gulp" { - import Orchestrator = require("orchestrator"); - - namespace gulp { - interface Gulp extends Orchestrator { - /** - * Define a task - * @param name The name of the task. - * @param deps An array of task names to be executed and completed before your task will run. - * @param fn The function that performs the task's operations. For asynchronous tasks, you need to provide a hint when the task is complete: - *
    - *
  • Take in a callback
  • - *
  • Return a stream or a promise
  • - *
- */ - task: Orchestrator.AddMethod; - /** - * Emits files matching provided glob or an array of globs. Returns a stream of Vinyl files that can be piped to plugins. - * @param glob Glob or array of globs to read. - * @param opt Options to pass to node-glob through glob-stream. - */ - src: SrcMethod; - /** - * Can be piped to and it will write files. Re-emits all data passed to it so you can pipe to multiple folders. - * Folders that don't exist will be created. - * - * @param outFolder The path (output folder) to write files to. Or a function that returns it, the function will be provided a vinyl File instance. - * @param opt - */ - dest: DestMethod; - /** - * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. - * - * @param glob a single glob or array of globs that indicate which files to watch for changes. - * @param opt options, that are passed to the gaze library. - * @param fn a callback or array of callbacks to be called on each change, or names of task(s) to run when a file changes, added with task(). - */ - watch: WatchMethod; - } - - interface GulpPlugin { - (...args: any[]): NodeJS.ReadWriteStream; - } - - interface WatchMethod { - /** - * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. - * - * @param glob a single glob or array of globs that indicate which files to watch for changes. - * @param fn a callback or array of callbacks to be called on each change, or names of task(s) to run when a file changes, added with task(). - */ - (glob: string|string[], fn: (WatchCallback|string)): NodeJS.EventEmitter; - /** - * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. - * - * @param glob a single glob or array of globs that indicate which files to watch for changes. - * @param fn a callback or array of callbacks to be called on each change, or names of task(s) to run when a file changes, added with task(). - */ - (glob: string|string[], fn: (WatchCallback|string)[]): NodeJS.EventEmitter; - /** - * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. - * - * @param glob a single glob or array of globs that indicate which files to watch for changes. - * @param opt options, that are passed to the gaze library. - * @param fn a callback or array of callbacks to be called on each change, or names of task(s) to run when a file changes, added with task(). - */ - (glob: string|string[], opt: WatchOptions, fn: (WatchCallback|string)): NodeJS.EventEmitter; - /** - * Watch files and do something when a file changes. This always returns an EventEmitter that emits change events. - * - * @param glob a single glob or array of globs that indicate which files to watch for changes. - * @param opt options, that are passed to the gaze library. - * @param fn a callback or array of callbacks to be called on each change, or names of task(s) to run when a file changes, added with task(). - */ - (glob: string|string[], opt: WatchOptions, fn: (WatchCallback|string)[]): NodeJS.EventEmitter; - - } - - interface DestMethod { - /** - * Can be piped to and it will write files. Re-emits all data passed to it so you can pipe to multiple folders. - * Folders that don't exist will be created. - * - * @param outFolder The path (output folder) to write files to. Or a function that returns it, the function will be provided a vinyl File instance. - * @param opt - */ - (outFolder: string|((file: string) => string), opt?: DestOptions): NodeJS.ReadWriteStream; - } - - interface SrcMethod { - /** - * Emits files matching provided glob or an array of globs. Returns a stream of Vinyl files that can be piped to plugins. - * @param glob Glob or array of globs to read. - * @param opt Options to pass to node-glob through glob-stream. - */ - (glob: string|string[], opt?: SrcOptions): NodeJS.ReadWriteStream; - } - - /** - * Options to pass to node-glob through glob-stream. - * Specifies two options in addition to those used by node-glob: - * https://github.com/isaacs/node-glob#options - */ - interface SrcOptions { - /** - * Setting this to false will return file.contents as null - * and not read the file at all. - * Default: true. - */ - read?: boolean; - - /** - * Setting this to false will return file.contents as a stream and not buffer files. - * This is useful when working with large files. - * Note: Plugins might not implement support for streams. - * Default: true. - */ - buffer?: boolean; - - /** - * The base path of a glob. - * - * Default is everything before a glob starts. - */ - base?: string; - - /** - * The current working directory in which to search. - * Defaults to process.cwd(). - */ - cwd?: string; - - /** - * The place where patterns starting with / will be mounted onto. - * Defaults to path.resolve(options.cwd, "/") (/ on Unix systems, and C:\ or some such on Windows.) - */ - root?: string; - - /** - * Include .dot files in normal matches and globstar matches. - * Note that an explicit dot in a portion of the pattern will always match dot files. - */ - dot?: boolean; - - /** - * By default, a pattern starting with a forward-slash will be "mounted" onto the root setting, so that a valid - * filesystem path is returned. Set this flag to disable that behavior. - */ - nomount?: boolean; - - /** - * Add a / character to directory matches. Note that this requires additional stat calls. - */ - mark?: boolean; - - /** - * Don't sort the results. - */ - nosort?: boolean; - - /** - * Set to true to stat all results. This reduces performance somewhat, and is completely unnecessary, unless - * readdir is presumed to be an untrustworthy indicator of file existence. It will cause ELOOP to be triggered one - * level sooner in the case of cyclical symbolic links. - */ - stat?: boolean; - - /** - * When an unusual error is encountered when attempting to read a directory, a warning will be printed to stderr. - * Set the silent option to true to suppress these warnings. - */ - silent?: boolean; - - /** - * When an unusual error is encountered when attempting to read a directory, the process will just continue on in - * search of other matches. Set the strict option to raise an error in these cases. - */ - strict?: boolean; - - /** - * See cache property above. Pass in a previously generated cache object to save some fs calls. - */ - cache?: boolean; - - /** - * A cache of results of filesystem information, to prevent unnecessary stat calls. - * While it should not normally be necessary to set this, you may pass the statCache from one glob() call to the - * options object of another, if you know that the filesystem will not change between calls. - */ - statCache?: boolean; - - /** - * Perform a synchronous glob search. - */ - sync?: boolean; - - /** - * In some cases, brace-expanded patterns can result in the same file showing up multiple times in the result set. - * By default, this implementation prevents duplicates in the result set. Set this flag to disable that behavior. - */ - nounique?: boolean; - - /** - * Set to never return an empty set, instead returning a set containing the pattern itself. - * This is the default in glob(3). - */ - nonull?: boolean; - - /** - * Perform a case-insensitive match. Note that case-insensitive filesystems will sometimes result in glob returning - * results that are case-insensitively matched anyway, since readdir and stat will not raise an error. - */ - nocase?: boolean; - - /** - * Set to enable debug logging in minimatch and glob. - */ - debug?: boolean; - - /** - * Set to enable debug logging in glob, but not minimatch. - */ - globDebug?: boolean; - } - - interface DestOptions { - /** - * The output folder. Only has an effect if provided output folder is relative. - * Default: process.cwd() - */ - cwd?: string; - - /** - * Octal permission string specifying mode for any folders that need to be created for output folder. - * Default: 0777. - */ - mode?: string; - } - - /** - * Options that are passed to gaze. - * https://github.com/shama/gaze - */ - interface WatchOptions { - /** Interval to pass to fs.watchFile. */ - interval?: number; - /** Delay for events called in succession for the same file/event. */ - debounceDelay?: number; - /** Force the watch mode. Either 'auto' (default), 'watch' (force native events), or 'poll' (force stat polling). */ - mode?: string; - /** The current working directory to base file patterns from. Default is process.cwd().. */ - cwd?: string; - } - - interface WatchEvent { - /** The type of change that occurred, either added, changed or deleted. */ - type: string; - /** The path to the file that triggered the event. */ - path: string; - } - - /** - * Callback to be called on each watched file change. - */ - interface WatchCallback { - (event: WatchEvent): void; - } - - interface TaskCallback { - /** - * Defines a task. - * Tasks may be made asynchronous if they are passing a callback or return a promise or a stream. - * @param cb callback used to signal asynchronous completion. Caller includes err in case of error. - */ - (cb?: (err?: any) => void): any; - } - } - - var gulp: gulp.Gulp; - - export = gulp; -} diff --git a/TypeScriptDefinitions/istanbul.d.ts b/TypeScriptDefinitions/istanbul.d.ts deleted file mode 100644 index 1ccbd14..0000000 --- a/TypeScriptDefinitions/istanbul.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -// Type definitions for Istanbul v0.4.0 -// Project: https://github.com/gotwarlost/istanbul -// Definitions by: Tanguy Krotoff -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module 'istanbul' { - namespace istanbul { - interface Istanbul { - new (options?: any): Istanbul; - Collector: Collector; - config: Config; - ContentWriter: ContentWriter; - FileWriter: FileWriter; - hook: Hook; - Instrumenter: Instrumenter; - Report: Report; - Reporter: Reporter; - Store: Store; - utils: ObjectUtils; - VERSION: string; - Writer: Writer; - } - - interface Collector { - new (options?: any): Collector; - add(coverage: any, testName?: string): void; - } - - interface Config { - } - - interface ContentWriter { - } - - interface FileWriter { - } - - interface Hook { - } - - interface Instrumenter { - new (options?: any): Instrumenter; - instrumentSync(code: string, filename: string): string; - } - - interface Report { - } - - interface Configuration { - new (obj: any, overrides: any): Configuration; - } - - interface Reporter { - new (cfg?: Configuration, dir?: string): Reporter; - add(fmt: string): void; - addAll(fmts: Array): void; - write(collector: Collector, sync: boolean, callback: Function): void; - } - - interface Store { - } - - interface ObjectUtils { - } - - interface Writer { - } - } - - var istanbul: istanbul.Istanbul; - - export = istanbul; -} diff --git a/TypeScriptDefinitions/jasmine.d.ts b/TypeScriptDefinitions/jasmine.d.ts deleted file mode 100644 index 538aca3..0000000 --- a/TypeScriptDefinitions/jasmine.d.ts +++ /dev/null @@ -1,508 +0,0 @@ -// Type definitions for Jasmine 2.2 -// Project: http://jasmine.github.io/ -// Definitions by: Boris Yankov , Theodore Brown , David Pärsson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -// For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts - -declare function describe(description: string, specDefinitions: () => void): void; -declare function fdescribe(description: string, specDefinitions: () => void): void; -declare function xdescribe(description: string, specDefinitions: () => void): void; - -declare function it(expectation: string, assertion?: () => void, timeout?: number): void; -declare function it(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; -declare function fit(expectation: string, assertion?: () => void, timeout?: number): void; -declare function fit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; -declare function xit(expectation: string, assertion?: () => void, timeout?: number): void; -declare function xit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; - -/** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */ -declare function pending(reason?: string): void; - -declare function beforeEach(action: () => void, timeout?: number): void; -declare function beforeEach(action: (done: DoneFn) => void, timeout?: number): void; -declare function afterEach(action: () => void, timeout?: number): void; -declare function afterEach(action: (done: DoneFn) => void, timeout?: number): void; - -declare function beforeAll(action: () => void, timeout?: number): void; -declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): void; -declare function afterAll(action: () => void, timeout?: number): void; -declare function afterAll(action: (done: DoneFn) => void, timeout?: number): void; - -declare function expect(spy: Function): jasmine.Matchers; -declare function expect(actual: any): jasmine.Matchers; - -declare function fail(e?: any): void; -/** Action method that should be called when the async work is complete */ -interface DoneFn extends Function { - (): void; - - /** fails the spec and indicates that it has completed. If the message is an Error, Error.message is used */ - fail: (message?: Error|string) => void; -} - -declare function spyOn(object: any, method: string): jasmine.Spy; - -declare function runs(asyncMethod: Function): void; -declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; -declare function waits(timeout?: number): void; - -declare namespace jasmine { - - var clock: () => Clock; - - function any(aclass: any): Any; - function anything(): Any; - function arrayContaining(sample: any[]): ArrayContaining; - function objectContaining(sample: any): ObjectContaining; - function createSpy(name: string, originalFn?: Function): Spy; - function createSpyObj(baseName: string, methodNames: any[]): any; - function createSpyObj(baseName: string, methodNames: any[]): T; - function pp(value: any): string; - function getEnv(): Env; - function addCustomEqualityTester(equalityTester: CustomEqualityTester): void; - function addMatchers(matchers: CustomMatcherFactories): void; - function stringMatching(str: string): Any; - function stringMatching(str: RegExp): Any; - - interface Any { - - new (expectedClass: any): any; - - jasmineMatches(other: any): boolean; - jasmineToString(): string; - } - - // taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains() - interface ArrayLike { - length: number; - [n: number]: T; - } - - interface ArrayContaining { - new (sample: any[]): any; - - asymmetricMatch(other: any): boolean; - jasmineToString(): string; - } - - interface ObjectContaining { - new (sample: any): any; - - jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; - jasmineToString(): string; - } - - interface Block { - - new (env: Env, func: SpecFunction, spec: Spec): any; - - execute(onComplete: () => void): void; - } - - interface WaitsBlock extends Block { - new (env: Env, timeout: number, spec: Spec): any; - } - - interface WaitsForBlock extends Block { - new (env: Env, timeout: number, latchFunction: SpecFunction, message: string, spec: Spec): any; - } - - interface Clock { - install(): void; - uninstall(): void; - /** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */ - tick(ms: number): void; - mockDate(date?: Date): void; - } - - interface CustomEqualityTester { - (first: any, second: any): boolean; - } - - interface CustomMatcher { - compare(actual: T, expected: T): CustomMatcherResult; - compare(actual: any, expected: any): CustomMatcherResult; - } - - interface CustomMatcherFactory { - (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher; - } - - interface CustomMatcherFactories { - [index: string]: CustomMatcherFactory; - } - - interface CustomMatcherResult { - pass: boolean; - message?: string; - } - - interface MatchersUtil { - equals(a: any, b: any, customTesters?: Array): boolean; - contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean; - buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string; - } - - interface Env { - setTimeout: any; - clearTimeout: void; - setInterval: any; - clearInterval: void; - updateInterval: number; - - currentSpec: Spec; - - matchersClass: Matchers; - - version(): any; - versionString(): string; - nextSpecId(): number; - addReporter(reporter: Reporter): void; - execute(): void; - describe(description: string, specDefinitions: () => void): Suite; - // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these - beforeEach(beforeEachFunction: () => void): void; - beforeAll(beforeAllFunction: () => void): void; - currentRunner(): Runner; - afterEach(afterEachFunction: () => void): void; - afterAll(afterAllFunction: () => void): void; - xdescribe(desc: string, specDefinitions: () => void): XSuite; - it(description: string, func: () => void): Spec; - // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these - xit(desc: string, func: () => void): XSpec; - compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean; - compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; - equals_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; - contains_(haystack: any, needle: any): boolean; - addCustomEqualityTester(equalityTester: CustomEqualityTester): void; - addMatchers(matchers: CustomMatcherFactories): void; - specFilter(spec: Spec): boolean; - throwOnExpectationFailure(value: boolean): void; - } - - interface FakeTimer { - - new (): any; - - reset(): void; - tick(millis: number): void; - runFunctionsWithinRange(oldMillis: number, nowMillis: number): void; - scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void; - } - - interface HtmlReporter { - new (): any; - } - - interface HtmlSpecFilter { - new (): any; - } - - interface Result { - type: string; - } - - interface NestedResults extends Result { - description: string; - - totalCount: number; - passedCount: number; - failedCount: number; - - skipped: boolean; - - rollupCounts(result: NestedResults): void; - log(values: any): void; - getItems(): Result[]; - addResult(result: Result): void; - passed(): boolean; - } - - interface MessageResult extends Result { - values: any; - trace: Trace; - } - - interface ExpectationResult extends Result { - matcherName: string; - passed(): boolean; - expected: any; - actual: any; - message: string; - trace: Trace; - } - - interface Trace { - name: string; - message: string; - stack: any; - } - - interface PrettyPrinter { - - new (): any; - - format(value: any): void; - iterateObject(obj: any, fn: (property: string, isGetter: boolean) => void): void; - emitScalar(value: any): void; - emitString(value: string): void; - emitArray(array: any[]): void; - emitObject(obj: any): void; - append(value: any): void; - } - - interface StringPrettyPrinter extends PrettyPrinter { - } - - interface Queue { - - new (env: any): any; - - env: Env; - ensured: boolean[]; - blocks: Block[]; - running: boolean; - index: number; - offset: number; - abort: boolean; - - addBefore(block: Block, ensure?: boolean): void; - add(block: any, ensure?: boolean): void; - insertNext(block: any, ensure?: boolean): void; - start(onComplete?: () => void): void; - isRunning(): boolean; - next_(): void; - results(): NestedResults; - } - - interface Matchers { - - new (env: Env, actual: any, spec: Env, isNot?: boolean): any; - - env: Env; - actual: any; - spec: Env; - isNot?: boolean; - message(): any; - - toBe(expected: any, expectationFailOutput?: any): boolean; - toEqual(expected: any, expectationFailOutput?: any): boolean; - toMatch(expected: string | RegExp, expectationFailOutput?: any): boolean; - toBeDefined(expectationFailOutput?: any): boolean; - toBeUndefined(expectationFailOutput?: any): boolean; - toBeNull(expectationFailOutput?: any): boolean; - toBeNaN(): boolean; - toBeTruthy(expectationFailOutput?: any): boolean; - toBeFalsy(expectationFailOutput?: any): boolean; - toHaveBeenCalled(): boolean; - toHaveBeenCalledWith(...params: any[]): boolean; - toHaveBeenCalledTimes(expected: number): boolean; - toContain(expected: any, expectationFailOutput?: any): boolean; - toBeLessThan(expected: number, expectationFailOutput?: any): boolean; - toBeGreaterThan(expected: number, expectationFailOutput?: any): boolean; - toBeCloseTo(expected: number, precision?: any, expectationFailOutput?: any): boolean; - toThrow(expected?: any): boolean; - toThrowError(message?: string | RegExp): boolean; - toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean; - not: Matchers; - - Any: Any; - } - - interface Reporter { - reportRunnerStarting(runner: Runner): void; - reportRunnerResults(runner: Runner): void; - reportSuiteResults(suite: Suite): void; - reportSpecStarting(spec: Spec): void; - reportSpecResults(spec: Spec): void; - log(str: string): void; - } - - interface MultiReporter extends Reporter { - addReporter(reporter: Reporter): void; - } - - interface Runner { - - new (env: Env): any; - - execute(): void; - beforeEach(beforeEachFunction: SpecFunction): void; - afterEach(afterEachFunction: SpecFunction): void; - beforeAll(beforeAllFunction: SpecFunction): void; - afterAll(afterAllFunction: SpecFunction): void; - finishCallback(): void; - addSuite(suite: Suite): void; - add(block: Block): void; - specs(): Spec[]; - suites(): Suite[]; - topLevelSuites(): Suite[]; - results(): NestedResults; - } - - interface SpecFunction { - (spec?: Spec): void; - } - - interface SuiteOrSpec { - id: number; - env: Env; - description: string; - queue: Queue; - } - - interface Spec extends SuiteOrSpec { - - new (env: Env, suite: Suite, description: string): any; - - suite: Suite; - - afterCallbacks: SpecFunction[]; - spies_: Spy[]; - - results_: NestedResults; - matchersClass: Matchers; - - getFullName(): string; - results(): NestedResults; - log(arguments: any): any; - runs(func: SpecFunction): Spec; - addToQueue(block: Block): void; - addMatcherResult(result: Result): void; - expect(actual: any): any; - waits(timeout: number): Spec; - waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; - fail(e?: any): void; - getMatchersClass_(): Matchers; - addMatchers(matchersPrototype: CustomMatcherFactories): void; - finishCallback(): void; - finish(onComplete?: () => void): void; - after(doAfter: SpecFunction): void; - execute(onComplete?: () => void): any; - addBeforesAndAftersToQueue(): void; - explodes(): void; - spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy; - removeAllSpies(): void; - } - - interface XSpec { - id: number; - runs(): void; - } - - interface Suite extends SuiteOrSpec { - - new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any; - - parentSuite: Suite; - - getFullName(): string; - finish(onComplete?: () => void): void; - beforeEach(beforeEachFunction: SpecFunction): void; - afterEach(afterEachFunction: SpecFunction): void; - beforeAll(beforeAllFunction: SpecFunction): void; - afterAll(afterAllFunction: SpecFunction): void; - results(): NestedResults; - add(suiteOrSpec: SuiteOrSpec): void; - specs(): Spec[]; - suites(): Suite[]; - children(): any[]; - execute(onComplete?: () => void): void; - } - - interface XSuite { - execute(): void; - } - - interface Spy { - (...params: any[]): any; - - identity: string; - and: SpyAnd; - calls: Calls; - mostRecentCall: { args: any[]; }; - argsForCall: any[]; - wasCalled: boolean; - } - - interface SpyAnd { - /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */ - callThrough(): Spy; - /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ - returnValue(val: any): Spy; - /** By chaining the spy with and.returnValues, all calls to the function will return specific values in order until it reaches the end of the return values list. */ - returnValues(...values: any[]): Spy; - /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */ - callFake(fn: Function): Spy; - /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ - throwError(msg: string): Spy; - /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */ - stub(): Spy; - } - - interface Calls { - /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/ - any(): boolean; - /** By chaining the spy with calls.count(), will return the number of times the spy was called **/ - count(): number; - /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/ - argsFor(index: number): any[]; - /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/ - allArgs(): any[]; - /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/ - all(): CallInfo[]; - /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/ - mostRecent(): CallInfo; - /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/ - first(): CallInfo; - /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/ - reset(): void; - } - - interface CallInfo { - /** The context (the this) for the call */ - object: any; - /** All arguments passed to the call */ - args: any[]; - /** The return value of the call */ - returnValue: any; - } - - interface Util { - inherit(childClass: Function, parentClass: Function): any; - formatException(e: any): any; - htmlEscape(str: string): string; - argsToArray(args: any): any; - extend(destination: any, source: any): any; - } - - interface JsApiReporter extends Reporter { - - started: boolean; - finished: boolean; - result: any; - messages: any; - - new (): any; - - suites(): Suite[]; - summarize_(suiteOrSpec: SuiteOrSpec): any; - results(): any; - resultsForSpec(specId: any): any; - log(str: any): any; - resultsForSpecs(specIds: any): any; - summarizeResult_(result: any): any; - } - - interface Jasmine { - Spec: Spec; - clock: Clock; - util: Util; - } - - export var HtmlReporter: HtmlReporter; - export var HtmlSpecFilter: HtmlSpecFilter; - export var DEFAULT_TIMEOUT_INTERVAL: number; -} diff --git a/TypeScriptDefinitions/open.d.ts b/TypeScriptDefinitions/open.d.ts deleted file mode 100644 index bca02e5..0000000 --- a/TypeScriptDefinitions/open.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -// Type definitions for open 0.0.3 -// Project: https://github.com/jjrdn/node-open -// Definitions by: Bart van der Schoor -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module 'open' { - function open(target: string, app?: string): void; - export = open; -} diff --git a/TypeScriptDefinitions/request.d.ts b/TypeScriptDefinitions/request.d.ts deleted file mode 100644 index 547ee62..0000000 --- a/TypeScriptDefinitions/request.d.ts +++ /dev/null @@ -1,262 +0,0 @@ -// Type definitions for request -// Project: https://github.com/mikeal/request -// Definitions by: Carlos Ballesteros Velasco , bonnici , Bart van der Schoor , Joe Skeen , Christopher Currens -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Imported from: https://github.com/soywiz/typescript-node-definitions/d.ts - -/// -/// - -declare module 'request' { - import stream = require('stream'); - import http = require('http'); - import https = require('https'); - import FormData = require('form-data'); - import url = require('url'); - import fs = require('fs'); - - namespace request { - export interface RequestAPI { - - defaults(options: TOptions): RequestAPI; - defaults(options: RequiredUriUrl & TOptions): DefaultUriUrlRequestApi; - - (uri: string, options?: TOptions, callback?: RequestCallback): TRequest; - (uri: string, callback?: RequestCallback): TRequest; - (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; - - get(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; - get(uri: string, callback?: RequestCallback): TRequest; - get(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; - - post(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; - post(uri: string, callback?: RequestCallback): TRequest; - post(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; - - put(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; - put(uri: string, callback?: RequestCallback): TRequest; - put(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; - - head(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; - head(uri: string, callback?: RequestCallback): TRequest; - head(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; - - patch(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; - patch(uri: string, callback?: RequestCallback): TRequest; - patch(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; - - del(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; - del(uri: string, callback?: RequestCallback): TRequest; - del(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; - - forever(agentOptions: any, optionsArg: any): TRequest; - jar(): CookieJar; - cookie(str: string): Cookie; - - initParams: any; - debug: boolean; - } - - interface DefaultUriUrlRequestApi extends RequestAPI { - - defaults(options: TOptions): DefaultUriUrlRequestApi; - (): TRequest; - get(): TRequest; - post(): TRequest; - put(): TRequest; - head(): TRequest; - patch(): TRequest; - del(): TRequest; - } - - interface CoreOptions { - baseUrl?: string; - callback?: (error: any, response: http.IncomingMessage, body: any) => void; - jar?: any; // CookieJar - formData?: any; // Object - form?: any; // Object or string - auth?: AuthOptions; - oauth?: OAuthOptions; - aws?: AWSOptions; - hawk?: HawkOptions; - qs?: any; - json?: any; - multipart?: RequestPart[] | Multipart; - agent?: http.Agent | https.Agent; - agentOptions?: any; - agentClass?: any; - forever?: any; - host?: string; - port?: number; - method?: string; - headers?: Headers; - body?: any; - followRedirect?: boolean | ((response: http.IncomingMessage) => boolean); - followAllRedirects?: boolean; - maxRedirects?: number; - encoding?: string; - pool?: any; - timeout?: number; - proxy?: any; - strictSSL?: boolean; - gzip?: boolean; - preambleCRLF?: boolean; - postambleCRLF?: boolean; - key?: Buffer; - cert?: Buffer; - passphrase?: string; - ca?: string | Buffer | string[] | Buffer[]; - har?: HttpArchiveRequest; - useQuerystring?: boolean; - } - - interface UriOptions { - uri: string; - } - interface UrlOptions { - url: string; - } - export type RequiredUriUrl = UriOptions | UrlOptions; - - interface OptionalUriUrl { - uri?: string; - url?: string; - } - - export type OptionsWithUri = UriOptions & CoreOptions; - export type OptionsWithUrl = UrlOptions & CoreOptions; - export type Options = OptionsWithUri | OptionsWithUrl; - - export interface RequestCallback { - (error: any, response: http.IncomingMessage, body: any): void; - } - - export interface HttpArchiveRequest { - url?: string; - method?: string; - headers?: NameValuePair[]; - postData?: { - mimeType?: string; - params?: NameValuePair[]; - } - } - - export interface NameValuePair { - name: string; - value: string; - } - - export interface Multipart { - chunked?: boolean; - data?: { - 'content-type'?: string, - body: string - }[]; - } - - export interface RequestPart { - headers?: Headers; - body: any; - } - - export interface Request extends stream.Stream { - readable: boolean; - writable: boolean; - - getAgent(): http.Agent; - //start(): void; - //abort(): void; - pipeDest(dest: any): void; - setHeader(name: string, value: string, clobber?: boolean): Request; - setHeaders(headers: Headers): Request; - qs(q: Object, clobber?: boolean): Request; - form(): FormData.FormData; - form(form: any): Request; - multipart(multipart: RequestPart[]): Request; - json(val: any): Request; - aws(opts: AWSOptions, now?: boolean): Request; - auth(username: string, password: string, sendInmediately?: boolean, bearer?: string): Request; - oauth(oauth: OAuthOptions): Request; - jar(jar: CookieJar): Request; - - on(event: string, listener: Function): this; - on(event: 'request', listener: (req: http.ClientRequest) => void): this; - on(event: 'response', listener: (resp: http.IncomingMessage) => void): this; - on(event: 'data', listener: (data: Buffer | string) => void): this; - on(event: 'error', listener: (e: Error) => void): this; - on(event: 'complete', listener: (resp: http.IncomingMessage, body?: string | Buffer) => void): this; - - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - end(): void; - end(chunk: Buffer, cb?: Function): void; - end(chunk: string, cb?: Function): void; - end(chunk: string, encoding: string, cb?: Function): void; - pause(): void; - resume(): void; - abort(): void; - destroy(): void; - toJSON(): Object; - } - - export interface Headers { - [key: string]: any; - } - - export interface AuthOptions { - user?: string; - username?: string; - pass?: string; - password?: string; - sendImmediately?: boolean; - bearer?: string; - } - - export interface OAuthOptions { - callback?: string; - consumer_key?: string; - consumer_secret?: string; - token?: string; - token_secret?: string; - verifier?: string; - } - - export interface HawkOptions { - credentials: any; - } - - export interface AWSOptions { - secret: string; - bucket?: string; - } - - export interface CookieJar { - setCookie(cookie: Cookie, uri: string | url.Url, options?: any): void - getCookieString(uri: string | url.Url): string - getCookies(uri: string | url.Url): Cookie[] - } - - export interface CookieValue { - name: string; - value: any; - httpOnly: boolean; - } - - export interface Cookie extends Array { - constructor(name: string, req: Request): void; - str: string; - expires: Date; - path: string; - toString(): string; - } - } - var request: request.RequestAPI; - export = request; -} diff --git a/TypeScriptDefinitions/yargs.d.ts b/TypeScriptDefinitions/yargs.d.ts deleted file mode 100644 index 7dc1ef2..0000000 --- a/TypeScriptDefinitions/yargs.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -// Type definitions for yargs -// Project: https://github.com/chevex/yargs -// Definitions by: Martin Poelstra -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module "yargs" { - - namespace yargs { - interface Argv { - argv: any; - (...args: any[]): any; - parse(...args: any[]): any; - - reset(): Argv; - - locale(): string; - locale(loc:string): Argv; - - detectLocale(detect:boolean): Argv; - - alias(shortName: string, longName: string): Argv; - alias(aliases: { [shortName: string]: string }): Argv; - alias(aliases: { [shortName: string]: string[] }): Argv; - - array(key: string): Argv; - array(keys: string[]): Argv; - - default(key: string, value: any): Argv; - default(defaults: { [key: string]: any}): Argv; - - demand(key: string, msg: string): Argv; - demand(key: string, required?: boolean): Argv; - demand(keys: string[], msg: string): Argv; - demand(keys: string[], required?: boolean): Argv; - demand(positionals: number, required?: boolean): Argv; - demand(positionals: number, msg: string): Argv; - - require(key: string, msg: string): Argv; - require(key: string, required: boolean): Argv; - require(keys: number[], msg: string): Argv; - require(keys: number[], required: boolean): Argv; - require(positionals: number, required: boolean): Argv; - require(positionals: number, msg: string): Argv; - - required(key: string, msg: string): Argv; - required(key: string, required: boolean): Argv; - required(keys: number[], msg: string): Argv; - required(keys: number[], required: boolean): Argv; - required(positionals: number, required: boolean): Argv; - required(positionals: number, msg: string): Argv; - - requiresArg(key: string): Argv; - requiresArg(keys: string[]): Argv; - - describe(key: string, description: string): Argv; - describe(descriptions: { [key: string]: string }): Argv; - - option(key: string, options: Options): Argv; - option(options: { [key: string]: Options }): Argv; - options(key: string, options: Options): Argv; - options(options: { [key: string]: Options }): Argv; - - usage(message: string, options?: { [key: string]: Options }): Argv; - usage(options?: { [key: string]: Options }): Argv; - - command(command: string, description: string): Argv; - command(command: string, description: string, handler: (args: Argv) => void): Argv; - command(command: string, description: string, builder: (args: Argv) => Options): Argv; - command(command: string, description: string, builder: { [optionName: string]: Options }): Argv; - command(command: string, description: string, builder: { [optionName: string]: Options }, handler: (args: Argv) => void): Argv; - command(command: string, description: string, builder: (args: Argv) => Options, handler: (args: Argv) => void): Argv; - - completion(cmd: string, fn?: SyncCompletionFunction): Argv; - completion(cmd: string, description?: string, fn?: SyncCompletionFunction): Argv; - completion(cmd: string, fn?: AsyncCompletionFunction): Argv; - completion(cmd: string, description?: string, fn?: AsyncCompletionFunction): Argv; - - example(command: string, description: string): Argv; - - check(func: (argv: any, aliases: { [alias: string]: string }) => any): Argv; - - boolean(key: string): Argv; - boolean(keys: string[]): Argv; - - string(key: string): Argv; - string(keys: string[]): Argv; - - choices(choices: Object): Argv; - choices(key: string, values:any[]): Argv; - - config(key: string): Argv; - config(keys: string[]): Argv; - - wrap(columns: number): Argv; - - strict(): Argv; - - help(): string; - help(option: string, description?: string): Argv; - - env(prefix?: string): Argv; - env(enable: boolean): Argv; - - epilog(msg: string): Argv; - epilogue(msg: string): Argv; - - version(version: string, option?: string, description?: string): Argv; - version(version: () => string, option?: string, description?: string): Argv; - - showHelpOnFail(enable: boolean, message?: string): Argv; - - showHelp(func?: (message: string) => any): Argv; - - exitProcess(enabled:boolean): Argv; - - global(key: string): Argv; - global(keys: string[]): Argv; - - group(key: string, groupName: string): Argv; - group(keys: string[], groupName: string): Argv; - - nargs(key: string, count: number): Argv; - nargs(nargs: { [key: string]: number }): Argv; - - /* Undocumented */ - - normalize(key: string): Argv; - normalize(keys: string[]): Argv; - - implies(key: string, value: string): Argv; - implies(implies: { [key: string]: string }): Argv; - - count(key: string): Argv; - count(keys: string[]): Argv; - - fail(func: (msg: string) => any): void; - } - - interface Options { - type?: string; - group?: string; - alias?: any; - demand?: any; - required?: any; - require?: any; - default?: any; - defaultDescription?: string; - boolean?: boolean; - string?: boolean; - count?: boolean; - describe?: any; - description?: any; - desc?: any; - requiresArg?: any; - choices?:string[]; - global?: boolean; - array?: boolean; - config?: boolean; - number?: boolean; - normalize?: boolean; - nargs?: number; - } - - type SyncCompletionFunction = (current: string, argv: any) => string[]; - type AsyncCompletionFunction = (current: string, argv: any, done: (completion: string[]) => void) => void; - } - - var yargs: yargs.Argv; - export = yargs; -} diff --git a/gulpfile.js b/gulpfile.js index 313aa31..f479227 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,7 +9,6 @@ var Jasmine = require('jasmine'); var JasmineSpecReporter = require('jasmine-spec-reporter'); var open = require('open'); var path = require('path'); -var request = require('request'); var yargs = require('yargs'); var defined = Cesium.defined; @@ -79,28 +78,3 @@ gulp.task('coverage', function () { }); open('coverage/lcov-report/index.html'); }); - -function copyModule(module) { - var tsName = module + '.d.ts'; - var srcUrl = 'https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/' + module + '/' + tsName; - var desPath = path.join('TypeScriptDefinitions', tsName); - - request.get({ - url: srcUrl - }, function (error, response) { - if (error) { - console.log(error); - return; - } - if (response.statusCode >= 200 && response.statusCode < 300) { - fsExtra.outputFileSync(desPath, response.body); - } - }); -} - -gulp.task('update-ts-definitions', function () { - fsExtra.removeSync('TypeScriptDefinitions'); - var packageJson = require('./package.json'); - Object.keys(packageJson.dependencies).forEach(copyModule); - Object.keys(packageJson.devDependencies).forEach(copyModule); -}); diff --git a/package.json b/package.json index 2e22bfb..68971ac 100644 --- a/package.json +++ b/package.json @@ -26,33 +26,33 @@ "node": ">=4.0.0" }, "dependencies": { - "async": "2.0.0-rc.6", - "bluebird": "^3.4.1", - "byline": "4.2.1", - "cesium": "1.23.0", + "async": "2.1.2", + "bluebird": "3.4.6", + "byline": "5.0.0", + "cesium": "1.26.0", "fs-extra": "0.30.0", "gltf-pipeline": "0.1.0-alpha4", - "yargs": "4.7.1" + "yargs": "6.3.0" }, "devDependencies": { "gulp": "3.9.1", - "gulp-jshint": "2.0.1", - "istanbul": "0.4.4", - "jasmine": "2.4.1", - "jasmine-spec-reporter": "2.5.0", - "jshint": "2.9.2", - "jshint-stylish": "2.2.0", + "gulp-jshint": "2.0.2", + "istanbul": "0.4.5", + "jasmine": "2.5.2", + "jasmine-spec-reporter": "2.7.0", + "jshint": "2.9.4", + "jshint-stylish": "2.2.1", "open": "0.0.5", - "request": "2.72.0", - "requirejs": "2.2.0" + "requirejs": "2.3.2", + "typings": "1.4.0" }, "scripts": { + "prepublish": "typings install", "jsHint": "gulp jsHint", "jsHint-watch": "gulp jsHint-watch", "test": "gulp test", "test-watch": "gulp test-watch", - "coverage": "gulp coverage", - "update-ts-definitions": "gulp update-ts-definitions" + "coverage": "gulp coverage" }, "bin": { "obj2gltf": "./bin/obj2gltf.js" diff --git a/typings.json b/typings.json new file mode 100644 index 0000000..1eaaaa8 --- /dev/null +++ b/typings.json @@ -0,0 +1,16 @@ +{ + "dependencies": { + "async": "registry:npm/async#2.0.1+20160815105832", + "bluebird": "registry:npm/bluebird#3.4.1+20160909132857", + "gulp": "registry:npm/gulp#4.0.0-alpha.2+20160817105618", + "requirejs": "registry:npm/requirejs#2.2.0+20160319062357", + "yargs": "registry:npm/yargs#5.0.0+20160907000723" + }, + "globalDependencies": { + "byline": "registry:dt/byline#4.2.1+20161006132146", + "fs-extra": "registry:dt/fs-extra#0.0.0+20161004190449", + "istanbul": "registry:dt/istanbul#0.4.0+20160316155526", + "jasmine": "registry:dt/jasmine#2.5.0+20161003201800", + "open": "registry:dt/open#0.0.3+20160316155526" + } +}