diff --git a/lib/common/child-process.ts b/lib/common/child-process.ts index 82dd5e1933..f253af2c1a 100644 --- a/lib/common/child-process.ts +++ b/lib/common/child-process.ts @@ -9,7 +9,7 @@ export class ChildProcess extends EventEmitter implements IChildProcess { public async exec(command: string, options?: any, execOptions?: IExecOptions): Promise { return new Promise((resolve, reject) => { - const callback = (error: Error, stdout: NodeBuffer, stderr: NodeBuffer) => { + const callback = (error: Error, stdout: string | NodeBuffer, stderr: string | NodeBuffer) => { this.$logger.trace("Exec %s \n stdout: %s \n stderr: %s", command, stdout.toString(), stderr.toString()); if (error) { @@ -33,7 +33,7 @@ export class ChildProcess extends EventEmitter implements IChildProcess { this.$logger.debug("execFile: %s %s", command, this.getArgumentsAsQuotedString(args)); return new Promise((resolve, reject) => { - child_process.execFile(command, args, (error: any, stdout: NodeBuffer) => { + child_process.execFile(command, args, (error: any, stdout: string | NodeBuffer) => { if (error) { reject(error); } else { diff --git a/lib/common/definitions/cli-global.d.ts b/lib/common/definitions/cli-global.d.ts index 368029f58d..7b4e4074de 100644 --- a/lib/common/definitions/cli-global.d.ts +++ b/lib/common/definitions/cli-global.d.ts @@ -1,3 +1,4 @@ +declare var _: _.LoDashStatic; /** * Defines additional properties added to global object from CLI. */ @@ -5,7 +6,7 @@ interface ICliGlobal extends NodeJS.Global { /** * Lodash instance. */ - _: any; + _: _.LoDashStatic; /** * Global instance of the module used for dependency injection. diff --git a/lib/common/definitions/lodash.d.ts b/lib/common/definitions/lodash.d.ts deleted file mode 100644 index 605dad6a0d..0000000000 --- a/lib/common/definitions/lodash.d.ts +++ /dev/null @@ -1,19404 +0,0 @@ -// Type definitions for Lo-Dash 4.14 -// Project: http://lodash.com/ -// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** -### 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog) - -#### TODO: -removed: -- [x] Removed _.support -- [x] Removed _.findWhere in favor of _.find with iteratee shorthand -- [x] Removed _.where in favor of _.filter with iteratee shorthand -- [x] Removed _.pluck in favor of _.map with iteratee shorthand - -renamed: -- [x] Renamed _.first to _.head -- [x] Renamed _.indexBy to _.keyBy -- [x] Renamed _.invoke to _.invokeMap -- [x] Renamed _.overArgs to _.overArgs -- [x] Renamed _.padLeft & _.padRight to _.padStart & _.padEnd -- [x] Renamed _.pairs to _.toPairs -- [x] Renamed _.rest to _.tail -- [x] Renamed _.restParam to _.rest -- [x] Renamed _.sortByOrder to _.orderBy -- [x] Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd -- [x] Renamed _.trunc to _.truncate - -split: -- [x] Split _.indexOf & _.lastIndexOf into _.sortedIndexOf & _.sortedLastIndexOf -- [x] Split _.max & _.min into _.maxBy & _.minBy -- [x] Split _.omit & _.pick into _.omitBy & _.pickBy -- [x] Split _.sample into _.sampleSize -- [x] Split _.sortedIndex into _.sortedIndexBy -- [x] Split _.sortedLastIndex into _.sortedLastIndexBy -- [x] Split _.uniq into _.sortedUniq, _.sortedUniqBy, & _.uniqBy - -changes: -- [x] Absorbed _.sortByAll into _.sortBy -- [x] Changed the category of _.at to “Object” -- [x] Changed the category of _.bindAll to “Utility” -- [x] Made _.capitalize uppercase the first character & lowercase the rest -- [x] Made _.functions return only own method names - - -added 23 array methods: -- [x] _.concat -- [x] _.differenceBy -- [x] _.differenceWith -- [x] _.flatMap -- [x] _.fromPairs -- [x] _.intersectionBy -- [x] _.intersectionWith -- [x] _.join -- [x] _.pullAll -- [x] _.pullAllBy -- [x] _.reverse -- [x] _.sortedIndexBy -- [x] _.sortedIndexOf -- [x] _.sortedLastIndexBy -- [x] _.sortedLastIndexOf -- [x] _.sortedUniq -- [x] _.sortedUniqBy -- [x] _.unionBy -- [x] _.unionWith -- [x] _.uniqBy -- [x] _.uniqWith -- [x] _.xorBy -- [x] _.xorWith - -added 18 lang methods: -- [x] _.cloneDeepWith -- [x] _.cloneWith -- [x] _.eq -- [x] _.isArrayLike -- [x] _.isArrayLikeObject -- [x] _.isEqualWith -- [x] _.isInteger -- [x] _.isLength -- [x] _.isMatchWith -- [x] _.isNil -- [x] _.isObjectLike -- [x] _.isSafeInteger -- [x] _.isSymbol -- [x] _.toInteger -- [x] _.toLength -- [x] _.toNumber -- [x] _.toSafeInteger -- [x] _.toString - -added 13 object methods: -- [x] _.assignIn -- [x] _.assignInWith -- [x] _.assignWith -- [x] _.functionsIn -- [x] _.hasIn -- [x] _.mergeWith -- [x] _.omitBy -- [x] _.pickBy - - -added 8 string methods: -- [x] _.lowerCase -- [x] _.lowerFirst -- [x] _.upperCase -- [x] _.upperFirst -- [x] _.toLower -- [x] _.toUpper - -added 8 utility methods: -- [x] _.toPath - -added 4 math methods: -- [x] _.maxBy -- [x] _.mean -- [x] _.minBy -- [x] _.sumBy - -added 2 function methods: -- [x] _.flip -- [x] _.unary - -added 2 number methods: -- [x] _.clamp -- [x] _.subtract - -added collection method: -- [x] _.sampleSize - -Added 3 aliases - -- [x] _.first as an alias of _.head - -Removed 17 aliases -- [x] Removed aliase _.all -- [x] Removed aliase _.any -- [x] Removed aliase _.backflow -- [x] Removed aliase _.callback -- [x] Removed aliase _.collect -- [x] Removed aliase _.compose -- [x] Removed aliase _.contains -- [x] Removed aliase _.detect -- [x] Removed aliase _.foldl -- [x] Removed aliase _.foldr -- [x] Removed aliase _.include -- [x] Removed aliase _.inject -- [x] Removed aliase _.methods -- [x] Removed aliase _.object -- [x] Removed aliase _.run -- [x] Removed aliase _.select -- [x] Removed aliase _.unique - -Other changes -- [x] Added support for array buffers to _.isEqual -- [x] Added support for converting iterators to _.toArray -- [x] Added support for deep paths to _.zipObject -- [x] Changed UMD to export to window or self when available regardless of other exports -- [x] Ensured debounce cancel clears args & thisArg references -- [x] Ensured _.add, _.subtract, & _.sum don’t skip NaN values -- [x] Ensured _.clone treats generators like functions -- [x] Ensured _.clone produces clones with the source’s [[Prototype]] -- [x] Ensured _.defaults assigns properties that shadow Object.prototype -- [x] Ensured _.defaultsDeep doesn’t merge a string into an array -- [x] Ensured _.defaultsDeep & _.merge don’t modify sources -- [x] Ensured _.defaultsDeep works with circular references -- [x] Ensured _.keys skips “length” on strict mode arguments objects in Safari 9 -- [x] Ensured _.merge doesn’t convert strings to arrays -- [x] Ensured _.merge merges plain-objects onto non plain-objects -- [x] Ensured _#plant resets iterator data of cloned sequences -- [x] Ensured _.random swaps min & max if min is greater than max -- [x] Ensured _.range preserves the sign of start of -0 -- [x] Ensured _.reduce & _.reduceRight use getIteratee in their array branch -- [x] Fixed rounding issue with the precision param of _.floor -- [x] Added flush method to debounced & throttled functions - -** LATER ** -Misc: -- [ ] Made _.forEach, _.forIn, _.forOwn, & _.times implicitly end a chain sequence -- [ ] Removed thisArg params from most methods -- [ ] Made “By” methods provide a single param to iteratees -- [ ] Made _.words chainable by default -- [ ] Removed isDeep params from _.clone & _.flatten -- [ ] Removed _.bindAll support for binding all methods when no names are provided -- [ ] Removed func-first param signature from _.before & _.after -- [ ] _.extend as an alias of _.assignIn -- [ ] _.extendWith as an alias of _.assignInWith -- [ ] Added clear method to _.memoize.Cache -- [ ] Added support for ES6 maps, sets, & symbols to _.clone, _.isEqual, & _.toArray -- [ ] Enabled _.flow & _.flowRight to accept an array of functions -- [ ] Ensured “Collection” methods treat functions as objects -- [ ] Ensured _.assign, _.defaults, & _.merge coerce object values to objects -- [ ] Ensured _.bindKey bound functions call object[key] when called with the new operator -- [ ] Ensured _.isFunction returns true for generator functions -- [ ] Ensured _.merge assigns typed arrays directly -- [ ] Made _(...) an iterator & iterable -- [ ] Made _.drop, _.take, & right forms coerce n of undefined to 0 - -Methods: -- [ ] _.concat -- [ ] _.differenceBy -- [ ] _.differenceWith -- [ ] _.flatMap -- [ ] _.fromPairs -- [ ] _.intersectionBy -- [ ] _.intersectionWith -- [ ] _.join -- [ ] _.pullAll -- [ ] _.pullAllBy -- [ ] _.reverse -- [ ] _.sortedLastIndexOf -- [ ] _.unionBy -- [ ] _.unionWith -- [ ] _.uniqWith -- [ ] _.xorBy -- [ ] _.xorWith -- [ ] _.toString - -- [ ] _.invoke -- [ ] _.setWith -- [ ] _.toPairs -- [ ] _.toPairsIn -- [ ] _.unset - -- [ ] _.replace -- [ ] _.split - -- [ ] _.cond -- [ ] _.conforms -- [ ] _.nthArg -- [ ] _.over -- [ ] _.overEvery -- [ ] _.overSome -- [ ] _.rangeRight - -- [ ] _.next -*/ -declare var _: _.LoDashStatic; - -declare module _ { - type Many = T | T[]; - - interface LoDashStatic { - /** - * Creates a lodash object which wraps the given value to enable intuitive method chaining. - * - * In addition to Lo-Dash methods, wrappers also have the following Array methods: - * concat, join, pop, push, reverse, shift, slice, sort, splice, and unshift - * - * Chaining is supported in custom builds as long as the value method is implicitly or - * explicitly included in the build. - * - * The chainable wrapper functions are: - * after, assign, bind, bindAll, bindKey, chain, chunk, compact, compose, concat, countBy, - * createCallback, curry, debounce, defaults, defer, delay, difference, filter, flatten, - * forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy, - * keyBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min, - * object, omit, once, pairs, partial, partialRight, pick, pluck, pull, push, range, reject, - * remove, rest, reverse, sample, shuffle, slice, sort, sortBy, splice, tap, throttle, times, - * toArray, transform, union, uniq, unset, unshift, unzip, values, where, without, wrap, and zip - * - * The non-chainable wrapper functions are: - * clone, cloneDeep, contains, escape, every, find, findIndex, findKey, findLast, - * findLastIndex, findLastKey, has, identity, indexOf, isArguments, isArray, isBoolean, - * isDate, isElement, isEmpty, isEqual, isFinite, isFunction, isNaN, isNull, isNumber, - * isObject, isPlainObject, isRegExp, isString, isUndefined, join, lastIndexOf, mixin, - * noConflict, parseInt, pop, random, reduce, reduceRight, result, shift, size, some, - * sortedIndex, runInContext, template, unescape, uniqueId, and value - * - * The wrapper functions first and last return wrapped values when n is provided, otherwise - * they return unwrapped values. - * - * Explicit chaining can be enabled by using the _.chain method. - **/ - (value: number): LoDashImplicitWrapper; - (value: string): LoDashImplicitStringWrapper; - (value: boolean): LoDashImplicitWrapper; - (value: number[]): LoDashImplicitNumberArrayWrapper; - (value: T[]): LoDashImplicitArrayWrapper; - (value: T): LoDashImplicitObjectWrapper; - (value: any): LoDashImplicitWrapper; - - /** - * The semantic version number. - **/ - VERSION: string; - - /** - * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby - * (ERB). Change the following template settings to use alternative delimiters. - **/ - templateSettings: TemplateSettings; - } - - /** - * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby - * (ERB). Change the following template settings to use alternative delimiters. - **/ - interface TemplateSettings { - /** - * The "escape" delimiter. - **/ - escape?: RegExp; - - /** - * The "evaluate" delimiter. - **/ - evaluate?: RegExp; - - /** - * An object to import into the template as local variables. - **/ - imports?: Dictionary; - - /** - * The "interpolate" delimiter. - **/ - interpolate?: RegExp; - - /** - * Used to reference the data object in the template text. - **/ - variable?: string; - } - - /** - * Creates a cache object to store key/value pairs. - */ - interface MapCache { - /** - * Removes `key` and its value from the cache. - * @param key The key of the value to remove. - * @return Returns `true` if the entry was removed successfully, else `false`. - */ - delete(key: string): boolean; - - /** - * Gets the cached value for `key`. - * @param key The key of the value to get. - * @return Returns the cached value. - */ - get(key: string): any; - - /** - * Checks if a cached value for `key` exists. - * @param key The key of the entry to check. - * @return Returns `true` if an entry for `key` exists, else `false`. - */ - has(key: string): boolean; - - /** - * Sets `value` to `key` of the cache. - * @param key The key of the value to cache. - * @param value The value to cache. - * @return Returns the cache object. - */ - set(key: string, value: any): _.Dictionary; - } - interface MapCacheConstructor { - new (): MapCache; - } - - interface LoDashWrapperBase { } - - interface LoDashImplicitWrapperBase extends LoDashWrapperBase { } - - interface LoDashExplicitWrapperBase extends LoDashWrapperBase { } - - interface LoDashImplicitWrapper extends LoDashImplicitWrapperBase> { } - - interface LoDashExplicitWrapper extends LoDashExplicitWrapperBase> { } - - interface LoDashImplicitStringWrapper extends LoDashImplicitWrapper { } - - interface LoDashExplicitStringWrapper extends LoDashExplicitWrapper { } - - interface LoDashImplicitObjectWrapper extends LoDashImplicitWrapperBase> { } - - interface LoDashExplicitObjectWrapper extends LoDashExplicitWrapperBase> { } - - interface LoDashImplicitArrayWrapper extends LoDashImplicitWrapperBase> { - pop(): T; - push(...items: T[]): LoDashImplicitArrayWrapper; - shift(): T; - sort(compareFn?: (a: T, b: T) => number): LoDashImplicitArrayWrapper; - splice(start: number): LoDashImplicitArrayWrapper; - splice(start: number, deleteCount: number, ...items: any[]): LoDashImplicitArrayWrapper; - unshift(...items: T[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper extends LoDashExplicitWrapperBase> { - pop(): LoDashExplicitObjectWrapper; - push(...items: T[]): LoDashExplicitArrayWrapper; - shift(): LoDashExplicitObjectWrapper; - sort(compareFn?: (a: T, b: T) => number): LoDashExplicitArrayWrapper; - splice(start: number): LoDashExplicitArrayWrapper; - splice(start: number, deleteCount: number, ...items: any[]): LoDashExplicitArrayWrapper; - unshift(...items: T[]): LoDashExplicitArrayWrapper; - } - - interface LoDashImplicitNumberArrayWrapper extends LoDashImplicitArrayWrapper { } - - interface LoDashExplicitNumberArrayWrapper extends LoDashExplicitArrayWrapper { } - - /********* - * Array * - *********/ - - //_.chunk - interface LoDashStatic { - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - chunk( - array: List, - size?: number - ): T[][]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.chunk - */ - chunk(size?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.chunk - */ - chunk(size?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.chunk - */ - chunk(size?: number): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.chunk - */ - chunk(size?: number): LoDashExplicitArrayWrapper; - } - - //_.compact - interface LoDashStatic { - /** - * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are - * falsey. - * - * @param array The array to compact. - * @return (Array) Returns the new array of filtered values. - */ - compact(array?: List): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.compact - */ - compact(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.compact - */ - compact(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.compact - */ - compact(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.compact - */ - compact(): LoDashExplicitArrayWrapper; - } - - //_.concat DUMMY - interface LoDashStatic { - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - concat(array: List, ...values: Array>): T[]; - } - - //_.difference - interface LoDashStatic { - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - difference( - array: List, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.difference - */ - difference(...values: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.difference - */ - difference(...values: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.difference - */ - difference(...values: Array>): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.difference - */ - difference(...values: Array>): LoDashExplicitArrayWrapper; - } - - //_.differenceBy - interface LoDashStatic { - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - differenceBy( - array: List, - values?: List, - iteratee?: ((value: T) => any) | string - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List, - values?: List, - iteratee?: W - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List, - values1?: List, - values2?: List, - iteratee?: ((value: T) => any) | string - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List, - values1?: List, - values2?: List, - iteratee?: W - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List, - values1?: List, - values2?: List, - values3?: List, - iteratee?: ((value: T) => any) | string - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List, - values1?: List, - values2?: List, - values3?: List, - iteratee?: W - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List, - values1?: List, - values2?: List, - values3?: List, - values4?: List, - iteratee?: W - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List, - values1?: List, - values2?: List, - values3?: List, - values4?: List, - iteratee?: ((value: T) => any) | string - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List, - values1?: List, - values2?: List, - values3?: List, - values4?: List, - values5?: List, - iteratee?: ((value: T) => any) | string - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List, - values1?: List, - values2?: List, - values3?: List, - values4?: List, - values5?: List, - iteratee?: W - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: List, - ...values: any[] - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - values?: List, - iteratee?: ((value: T) => any) | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values?: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - iteratee?: ((value: T) => any) | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - iteratee?: ((value: T) => any) | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - iteratee?: ((value: T) => any) | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - values5?: List, - iteratee?: ((value: T) => any) | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - values5?: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - ...values: any[] - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - values?: List, - iteratee?: ((value: T) => any) | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values?: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - iteratee?: ((value: T) => any) | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - iteratee?: ((value: T) => any) | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - iteratee?: ((value: T) => any) | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - values5?: List, - iteratee?: ((value: T) => any) | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - values5?: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - ...values: any[] - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - values?: List, - iteratee?: ((value: T) => any) | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values?: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - iteratee?: ((value: T) => any) | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - iteratee?: ((value: T) => any) | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - iteratee?: ((value: T) => any) | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - values5?: List, - iteratee?: ((value: T) => any) | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - values5?: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - ...values: any[] - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - values?: List, - iteratee?: ((value: T) => any) | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values?: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - iteratee?: ((value: T) => any) | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - iteratee?: ((value: T) => any) | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - iteratee?: ((value: T) => any) | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - values5?: List, - iteratee?: ((value: T) => any) | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: List, - values2?: List, - values3?: List, - values4?: List, - values5?: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - ...values: any[] - ): LoDashExplicitArrayWrapper; - } - - //_.differenceWith DUMMY - interface LoDashStatic { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.difference([3, 2, 1], [4, 2]); - * // => [3, 1] - */ - differenceWith( - array: List, - ...values: any[] - ): any[]; - } - - //_.drop - interface LoDashStatic { - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - drop(array: List, n?: number): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.drop - */ - drop(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.drop - */ - drop(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.drop - */ - drop(n?: number): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.drop - */ - drop(n?: number): LoDashExplicitArrayWrapper; - } - - //_.dropRight - interface LoDashStatic { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - dropRight( - array: List, - n?: number - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.dropRight - */ - dropRight(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.dropRight - */ - dropRight(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.dropRight - */ - dropRight(n?: number): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.dropRight - */ - dropRight(n?: number): LoDashExplicitArrayWrapper; - } - - //_.dropRightWhile - interface LoDashStatic { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - dropRightWhile( - array: List, - predicate?: ListIterator - ): TValue[]; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - array: List, - predicate?: string - ): TValue[]; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - array: List, - predicate?: TWhere - ): TValue[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.dropWhile - interface LoDashStatic { - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - dropWhile( - array: List, - predicate?: ListIterator - ): TValue[]; - - /** - * @see _.dropWhile - */ - dropWhile( - array: List, - predicate?: string - ): TValue[]; - - /** - * @see _.dropWhile - */ - dropWhile( - array: List, - predicate?: TWhere - ): TValue[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.fill - interface LoDashStatic { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - fill( - array: any[], - value: T, - start?: number, - end?: number - ): T[]; - - /** - * @see _.fill - */ - fill( - array: List, - value: T, - start?: number, - end?: number - ): List; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.fill - */ - fill( - value: T, - start?: number, - end?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.fill - */ - fill( - value: T, - start?: number, - end?: number - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.fill - */ - fill( - value: T, - start?: number, - end?: number - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.fill - */ - fill( - value: T, - start?: number, - end?: number - ): LoDashExplicitObjectWrapper>; - } - - //_.findIndex - interface LoDashStatic { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - findIndex( - array: List, - predicate?: ListIterator, - fromIndex?: number - ): number; - - /** - * @see _.findIndex - */ - findIndex( - array: List, - predicate?: string, - fromIndex?: number - ): number; - - /** - * @see _.findIndex - */ - findIndex( - array: List, - predicate?: W, - fromIndex?: number - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.findIndex - */ - findIndex( - predicate?: ListIterator, - fromIndex?: number - ): number; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: string, - fromIndex?: number - ): number; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: W, - fromIndex?: number - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.findIndex - */ - findIndex( - predicate?: ListIterator, - fromIndex?: number - ): number; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: string, - fromIndex?: number - ): number; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: W, - fromIndex?: number - ): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.findIndex - */ - findIndex( - predicate?: ListIterator, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: string, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: W, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.findIndex - */ - findIndex( - predicate?: ListIterator, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: string, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: W, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.findLastIndex - interface LoDashStatic { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the index of the found element, else -1. - */ - findLastIndex( - array: List, - predicate?: ListIterator, - fromIndex?: number - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - array: List, - predicate?: string, - fromIndex?: number - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - array: List, - predicate?: W, - fromIndex?: number - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: ListIterator, - fromIndex?: number - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: string, - fromIndex?: number - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: W, - fromIndex?: number - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: ListIterator, - fromIndex?: number - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: string, - fromIndex?: number - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: W, - fromIndex?: number - ): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: ListIterator, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: string, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: W, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: ListIterator, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: string, - fromIndex?: number - ): LoDashExplicitWrapper; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: W, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.first - interface LoDashStatic { - /** - * @see _.head - */ - first(array: List): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.head - */ - first(): string; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.head - */ - first(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.head - */ - first(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.head - */ - first(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.head - */ - first(): T; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.head - */ - first(): T; - } - - interface RecursiveArray extends Array> { } - interface ListOfRecursiveArraysOrValues extends List> { } - - //_.flatten - interface LoDashStatic { - /** - * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it’s only - * flattened a single level. - * - * @param array The array to flatten. - * @param isDeep Specify a deep flatten. - * @return Returns the new flattened array. - */ - flatten(array: ListOfRecursiveArraysOrValues, isDeep: boolean): T[]; - - /** - * @see _.flatten - */ - flatten(array: List>): T[]; - - /** - * @see _.flatten - */ - flatten(array: ListOfRecursiveArraysOrValues): RecursiveArray; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatten - */ - flatten(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.flatten - */ - flatten(isDeep?: boolean): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flatten - */ - flatten(isDeep?: boolean): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatten - */ - flatten(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.flatten - */ - flatten(isDeep?: boolean): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flatten - */ - flatten(isDeep?: boolean): LoDashExplicitArrayWrapper; - } - - //_.flattenDeep - interface LoDashStatic { - /** - * Recursively flattens a nested array. - * - * @param array The array to recursively flatten. - * @return Returns the new flattened array. - */ - flattenDeep(array: ListOfRecursiveArraysOrValues): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashExplicitArrayWrapper; - } - - // _.flattenDepth - interface LoDashStatic { - /** - * Recursively flatten array up to depth times. - * - * @param array The array to recursively flatten. - * @param number The maximum recursion depth. - * @return Returns the new flattened array. - */ - flattenDepth(array: ListOfRecursiveArraysOrValues, depth?: number): T[]; - } - - //_.fromPairs - interface LoDashStatic { - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - */ - fromPairs( - array: List<[_.StringRepresentable, T]> - ): Dictionary; - - /** - @see _.fromPairs - */ - fromPairs( - array: List - ): Dictionary; - } - - //_.fromPairs DUMMY - interface LoDashImplicitArrayWrapper { - /** - * @see _.fromPairs - */ - fromPairs(): LoDashImplicitObjectWrapper; - } - - //_.fromPairs DUMMY - interface LoDashExplicitArrayWrapper { - /** - * @see _.fromPairs - */ - fromPairs(): LoDashExplicitObjectWrapper; - } - - //_.head - interface LoDashStatic { - /** - * Gets the first element of array. - * - * @alias _.first - * - * @param array The array to query. - * @return Returns the first element of array. - */ - head(array: List): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.head - */ - head(): string; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.head - */ - head(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.head - */ - head(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.head - */ - head(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.head - */ - head(): T; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.head - */ - head(): T; - } - - //_.indexOf - interface LoDashStatic { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` - * performs a faster binary search. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - indexOf( - array: List, - value: T, - fromIndex?: boolean | number - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.indexOf - */ - indexOf( - value: T, - fromIndex?: boolean | number - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.indexOf - */ - indexOf( - value: TValue, - fromIndex?: boolean | number - ): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.indexOf - */ - indexOf( - value: T, - fromIndex?: boolean | number - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.indexOf - */ - indexOf( - value: TValue, - fromIndex?: boolean | number - ): LoDashExplicitWrapper; - } - - //_.intersectionBy DUMMY - interface LoDashStatic { - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - intersectionBy( - array: List, - ...values: any[] - ): any[]; - } - - //_.intersectionWith DUMMY - interface LoDashStatic { - /** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - intersectionWith( - array: List, - ...values: any[] - ): any[]; - } - - //_.join - interface LoDashStatic { - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - join( - array: List, - separator?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.join - */ - join(separator?: string): string; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.join - */ - join(separator?: string): string; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.join - */ - join(separator?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.join - */ - join(separator?: string): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.join - */ - join(separator?: string): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.join - */ - join(separator?: string): LoDashExplicitWrapper; - } - - //_.pullAll DUMMY - interface LoDashStatic { - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - pullAll( - array: List, - ...values: any[] - ): any[]; - } - - //_.pullAllBy DUMMY - interface LoDashStatic { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - pullAllBy( - array: List, - ...values: any[] - ): any[]; - } - - //_.reverse DUMMY - interface LoDashStatic { - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @memberOf _ - * @category Array - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - reverse( - array: List, - ...values: any[] - ): any[]; - } - - //_.sortedIndexOf - interface LoDashStatic { - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - sortedIndexOf( - array: List, - value: T - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - value: T - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - value: TValue - ): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - value: T - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - value: TValue - ): LoDashExplicitWrapper; - } - - //_.initial - interface LoDashStatic { - /** - * Gets all but the last element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - initial(array: List): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.initial - */ - initial(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.initial - */ - initial(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.initial - */ - initial(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.initial - */ - initial(): LoDashExplicitArrayWrapper; - } - - //_.intersection - interface LoDashStatic { - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - intersection(...arrays: Array>): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.intersection - */ - intersection(...arrays: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.intersection - */ - intersection(...arrays: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.intersection - */ - intersection(...arrays: Array>): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.intersection - */ - intersection(...arrays: Array>): LoDashExplicitArrayWrapper; - } - - //_.last - interface LoDashStatic { - /** - * Gets the last element of array. - * - * @param array The array to query. - * @return Returns the last element of array. - */ - last(array: List): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.last - */ - last(): string; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.last - */ - last(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.last - */ - last(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.last - */ - last(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.last - */ - last(): T; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.last - */ - last(): T; - } - - //_.lastIndexOf - interface LoDashStatic { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - lastIndexOf( - array: List, - value: T, - fromIndex?: boolean | number - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.lastIndexOf - */ - lastIndexOf( - value: T, - fromIndex?: boolean | number - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.lastIndexOf - */ - lastIndexOf( - value: TResult, - fromIndex?: boolean | number - ): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.lastIndexOf - */ - lastIndexOf( - value: T, - fromIndex?: boolean | number - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.lastIndexOf - */ - lastIndexOf( - value: TResult, - fromIndex?: boolean | number - ): LoDashExplicitWrapper; - } - - //_.pull - interface LoDashStatic { - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - pull( - array: T[], - ...values: T[] - ): T[]; - - /** - * @see _.pull - */ - pull( - array: List, - ...values: T[] - ): List; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.pull - */ - pull(...values: T[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.pull - */ - pull(...values: TValue[]): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.pull - */ - pull(...values: T[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.pull - */ - pull(...values: TValue[]): LoDashExplicitObjectWrapper>; - } - - //_.pullAt - interface LoDashStatic { - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - pullAt( - array: List, - ...indexes: Array> - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.pullAt - */ - pullAt(...indexes: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.pullAt - */ - pullAt(...indexes: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.pullAt - */ - pullAt(...indexes: Array>): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.pullAt - */ - pullAt(...indexes: Array>): LoDashExplicitArrayWrapper; - } - - //_.remove - interface LoDashStatic { - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - remove( - array: List, - predicate?: ListIterator - ): T[]; - - /** - * @see _.remove - */ - remove( - array: List, - predicate?: string - ): T[]; - - /** - * @see _.remove - */ - remove( - array: List, - predicate?: W - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.remove - */ - remove( - predicate?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: W - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.remove - */ - remove( - predicate?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: W - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.remove - */ - remove( - predicate?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: W - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.remove - */ - remove( - predicate?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: W - ): LoDashExplicitArrayWrapper; - } - - //_.tail - interface LoDashStatic { - /** - * Gets all but the first element of array. - * - * @alias _.tail - * - * @param array The array to query. - * @return Returns the slice of array. - */ - tail(array: List): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.tail - */ - tail(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.tail - */ - tail(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.tail - */ - tail(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.tail - */ - tail(): LoDashExplicitArrayWrapper; - } - - //_.slice - interface LoDashStatic { - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - slice( - array: T[], - start?: number, - end?: number - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.slice - */ - slice( - start?: number, - end?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.slice - */ - slice( - start?: number, - end?: number - ): LoDashExplicitArrayWrapper; - } - - //_.sortedIndex - interface LoDashStatic { - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - sortedIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - array: List, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: string - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: string - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - - - } - - //_.sortedIndexBy - interface LoDashStatic { - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - sortedIndexBy( - array: List, - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - array: List, - value: T, - iteratee: (x: T) => any - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - array: List, - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - array: List, - value: T, - iteratee: W - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - array: List, - value: T, - iteratee: Object - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: string, - iteratee: (x: string) => TSort - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: W - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => any - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: W - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: Object - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: string, - iteratee: (x: string) => TSort - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => TSort - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: W - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => TSort - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => any - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: W - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: Object - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndex - interface LoDashStatic { - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - sortedLastIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - array: List, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: string - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: string - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndexBy - interface LoDashStatic { - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - sortedLastIndexBy( - array: List, - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - array: List, - value: T, - iteratee: (x: T) => any - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - array: List, - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - array: List, - value: T, - iteratee: W - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - array: List, - value: T, - iteratee: Object - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: string, - iteratee: (x: string) => TSort - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: W - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => any - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: W - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: Object - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: string, - iteratee: (x: string) => TSort - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => TSort - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: W - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => TSort - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => any - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: W - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: Object - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndexOf DUMMY - interface LoDashStatic { - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - sortedLastIndexOf( - array: List, - ...values: any[] - ): any[]; - } - - //_.tail - interface LoDashStatic { - /** - * @see _.rest - */ - tail(array: List): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.rest - */ - tail(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.rest - */ - tail(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.rest - */ - tail(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.rest - */ - tail(): LoDashExplicitArrayWrapper; - } - - //_.take - interface LoDashStatic { - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - take( - array: List, - n?: number - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.take - */ - take(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.take - */ - take(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.take - */ - take(n?: number): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.take - */ - take(n?: number): LoDashExplicitArrayWrapper; - } - - //_.takeRight - interface LoDashStatic { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - takeRight( - array: List, - n?: number - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.takeRight - */ - takeRight(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.takeRight - */ - takeRight(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.takeRight - */ - takeRight(n?: number): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.takeRight - */ - takeRight(n?: number): LoDashExplicitArrayWrapper; - } - - //_.takeRightWhile - interface LoDashStatic { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - takeRightWhile( - array: List, - predicate?: ListIterator - ): TValue[]; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - array: List, - predicate?: string - ): TValue[]; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - array: List, - predicate?: TWhere - ): TValue[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.takeWhile - interface LoDashStatic { - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - takeWhile( - array: List, - predicate?: ListIterator - ): TValue[]; - - /** - * @see _.takeWhile - */ - takeWhile( - array: List, - predicate?: string - ): TValue[]; - - /** - * @see _.takeWhile - */ - takeWhile( - array: List, - predicate?: TWhere - ): TValue[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.union - interface LoDashStatic { - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - union(...arrays: Array>): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.union - */ - union(...arrays: Array>): LoDashImplicitArrayWrapper; - - /** - * @see _.union - */ - union(...arrays: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.union - */ - union(...arrays: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.union - */ - union(...arrays: Array>): LoDashExplicitArrayWrapper; - - /** - * @see _.union - */ - union(...arrays: Array>): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.union - */ - union(...arrays: Array>): LoDashExplicitArrayWrapper; - } - - //_.unionBy - interface LoDashStatic { - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - unionBy( - arrays: List, - iteratee?: (value: T) => any - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays: List, - iteratee?: W - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List, - arrays2: List, - iteratee?: (value: T) => any - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List, - arrays2: List, - iteratee?: W - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List, - arrays2: List, - arrays3: List, - iteratee?: (value: T) => any - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List, - arrays2: List, - arrays3: List, - iteratee?: W - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List, - arrays2: List, - arrays3: List, - arrays4: List, - iteratee?: (value: T) => any - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List, - arrays2: List, - arrays3: List, - arrays4: List, - iteratee?: W - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List, - arrays2: List, - arrays3: List, - arrays4: List, - arrays5: List, - iteratee?: (value: T) => any - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: List, - arrays2: List, - arrays3: List, - arrays4: List, - arrays5: List, - iteratee?: W - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays: List, - ...iteratee: any[] - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.unionBy - */ - unionBy( - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - arrays5: List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - arrays5: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - ...iteratee: any[] - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.unionBy - */ - unionBy( - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - arrays5: List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - arrays5: List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - ...iteratee: any[] - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.unionBy - */ - unionBy( - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - arrays5: List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - arrays5: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - ...iteratee: any[] - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.unionBy - */ - unionBy( - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - arrays5: List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: List, - arrays3: List, - arrays4: List, - arrays5: List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - ...iteratee: any[] - ): LoDashExplicitArrayWrapper; - } - - //_.uniq - interface LoDashStatic { - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - uniq( - array: List - ): T[]; - - /** - * @see _.uniq - */ - uniq( - array: List - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniq - */ - uniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.uniq - */ - uniq(): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - uniq(): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniq - */ - uniq(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.uniq - */ - uniq(): LoDashExplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.uniq - */ - uniq(): LoDashExplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq(): LoDashExplicitArrayWrapper; - } - - //_.uniqBy - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - uniqBy( - array: List, - iteratee: ListIterator - ): T[]; - - /** - * @see _.uniqBy - */ - uniqBy( - array: List, - iteratee: ListIterator - ): T[]; - - /** - * @see _.uniqBy - */ - uniqBy( - array: List, - iteratee: string - ): T[]; - - /** - * @see _.uniqBy - */ - uniqBy( - array: List, - iteratee: Object - ): T[]; - - /** - * @see _.uniqBy - */ - uniqBy( - array: List, - iteratee: TWhere - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: Object - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: Object - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.sortedUniq - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - sortedUniq( - array: List - ): T[]; - - /** - * @see _.sortedUniq - */ - sortedUniq( - array: List - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - sortedUniq(): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashExplicitArrayWrapper; - } - - //_.sortedUniqBy - interface LoDashStatic { - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - sortedUniqBy( - array: List, - iteratee: ListIterator - ): T[]; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - array: List, - iteratee: ListIterator - ): T[]; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - array: List, - iteratee: string - ): T[]; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - array: List, - iteratee: Object - ): T[]; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - array: List, - iteratee: TWhere - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: Object - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: Object - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.unionWith DUMMY - interface LoDashStatic { - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - unionWith( - array: List, - ...values: any[] - ): any[]; - } - - //_.uniqWith DUMMY - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - uniqWith( - array: List, - ...values: any[] - ): any[]; - } - - //_.unzip - interface LoDashStatic { - /** - * This method is like _.zip except that it accepts an array of grouped elements and creates an array - * regrouping the elements to their pre-zip configuration. - * - * @param array The array of grouped elements to process. - * @return Returns the new array of regrouped elements. - */ - unzip(array: List>): T[][]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.unzip - */ - unzip(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.unzip - */ - unzip(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.unzip - */ - unzip(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.unzip - */ - unzip(): LoDashExplicitArrayWrapper; - } - - //_.unzipWith - interface LoDashStatic { - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - unzipWith( - array: List>, - iteratee?: MemoIterator - ): TResult[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.unzipWith - */ - unzipWith( - iteratee?: MemoIterator - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.unzipWith - */ - unzipWith( - iteratee?: MemoIterator - ): LoDashImplicitArrayWrapper; - } - - //_.without - interface LoDashStatic { - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - without( - array: List, - ...values: T[] - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.without - */ - without(...values: T[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.without - */ - without(...values: T[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.without - */ - without(...values: T[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.without - */ - without(...values: T[]): LoDashExplicitArrayWrapper; - } - - //_.xor - interface LoDashStatic { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - xor(...arrays: Array>): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.xor - */ - xor(...arrays: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.xor - */ - xor(...arrays: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.xor - */ - xor(...arrays: Array>): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.xor - */ - xor(...arrays: Array>): LoDashExplicitArrayWrapper; - } - - //_.xorBy DUMMY - interface LoDashStatic { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - xorBy( - array: List, - ...values: any[] - ): any[]; - } - - //_.xorWith DUMMY - interface LoDashStatic { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - xorWith( - array: List, - ...values: any[] - ): any[]; - } - - //_.zip - interface LoDashStatic { - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - zip(...arrays: Array>): T[][]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.zip - */ - zip(...arrays: Array>): _.LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.zip - */ - zip(...arrays: Array>): _.LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.zip - */ - zip(...arrays: Array>): _.LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.zip - */ - zip(...arrays: Array>): _.LoDashExplicitArrayWrapper; - } - - //_.zipObject - interface LoDashStatic { - /** - * The inverse of _.pairs; this method returns an object composed from arrays of property names and values. - * Provide either a single two dimensional array, e.g. [[key1, value1], [key2, value2]] or two arrays, one of - * property names and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - zipObject( - props: List | List>, - values?: List - ): TResult; - - /** - * @see _.zipObject - */ - zipObject( - props: List | List>, - values?: List - ): TResult; - - /** - * @see _.zipObject - */ - zipObject( - props: List | List>, - values?: List - ): _.Dictionary; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper<_.Dictionary>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper<_.Dictionary>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper<_.Dictionary>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper<_.Dictionary>; - } - - //_.zipWith - interface LoDashStatic { - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee] The function to combine grouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - zipWith(...args: any[]): TResult[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.zipWith - */ - zipWith(...args: any[]): LoDashImplicitArrayWrapper; - } - - /********* - * Chain * - *********/ - - //_.chain - interface LoDashStatic { - /** - * Creates a lodash object that wraps value with explicit method chaining enabled. - * - * @param value The value to wrap. - * @return Returns the new lodash wrapper instance. - */ - chain(value: number): LoDashExplicitWrapper; - chain(value: string): LoDashExplicitWrapper; - chain(value: boolean): LoDashExplicitWrapper; - chain(value: T[]): LoDashExplicitArrayWrapper; - chain(value: T): LoDashExplicitObjectWrapper; - chain(value: any): LoDashExplicitWrapper; - } - - interface LoDashImplicitWrapper { - /** - * @see _.chain - */ - chain(): LoDashExplicitWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.chain - */ - chain(): LoDashExplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.chain - */ - chain(): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.chain - */ - chain(): TWrapper; - } - - //_.tap - interface LoDashStatic { - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - tap( - value: T, - interceptor: (value: T) => void - ): T; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.tap - */ - tap( - interceptor: (value: T) => void - ): TWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.tap - */ - tap( - interceptor: (value: T) => void - ): TWrapper; - } - - //_.thru - interface LoDashStatic { - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - thru( - value: T, - interceptor: (value: T) => TResult - ): TResult; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult): LoDashImplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult): LoDashImplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult): LoDashImplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult): LoDashImplicitObjectWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult - ): LoDashExplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult - ): LoDashExplicitObjectWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult[] - ): LoDashExplicitArrayWrapper; - } - - //_.prototype.commit - interface LoDashImplicitWrapperBase { - /** - * Executes the chained sequence and returns the wrapped result. - * - * @return Returns the new lodash wrapper instance. - */ - commit(): TWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.commit - */ - commit(): TWrapper; - } - - //_.prototype.concat - interface LoDashImplicitWrapperBase { - /** - * Creates a new array joining a wrapped array with any additional arrays and/or values. - * - * @param items - * @return Returns the new concatenated array. - */ - concat(...items: Array>): LoDashImplicitArrayWrapper; - - /** - * @see _.concat - */ - concat(...items: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.concat - */ - concat(...items: Array>): LoDashExplicitArrayWrapper; - - /** - * @see _.concat - */ - concat(...items: Array>): LoDashExplicitArrayWrapper; - } - - //_.prototype.plant - interface LoDashImplicitWrapperBase { - /** - * Creates a clone of the chained sequence planting value as the wrapped value. - * @param value The value to plant as the wrapped value. - * @return Returns the new lodash wrapper instance. - */ - plant(value: number): LoDashImplicitWrapper; - - /** - * @see _.plant - */ - plant(value: string): LoDashImplicitStringWrapper; - - /** - * @see _.plant - */ - plant(value: boolean): LoDashImplicitWrapper; - - /** - * @see _.plant - */ - plant(value: number[]): LoDashImplicitNumberArrayWrapper; - - /** - * @see _.plant - */ - plant(value: T[]): LoDashImplicitArrayWrapper; - - /** - * @see _.plant - */ - plant(value: T): LoDashImplicitObjectWrapper; - - /** - * @see _.plant - */ - plant(value: any): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.plant - */ - plant(value: number): LoDashExplicitWrapper; - - /** - * @see _.plant - */ - plant(value: string): LoDashExplicitStringWrapper; - - /** - * @see _.plant - */ - plant(value: boolean): LoDashExplicitWrapper; - - /** - * @see _.plant - */ - plant(value: number[]): LoDashExplicitNumberArrayWrapper; - - /** - * @see _.plant - */ - plant(value: T[]): LoDashExplicitArrayWrapper; - - /** - * @see _.plant - */ - plant(value: T): LoDashExplicitObjectWrapper; - - /** - * @see _.plant - */ - plant(value: any): LoDashExplicitWrapper; - } - - //_.prototype.reverse - interface LoDashImplicitArrayWrapper { - /** - * Reverses the wrapped array so the first element becomes the last, the second element becomes the second to - * last, and so on. - * - * Note: This method mutates the wrapped array. - * - * @return Returns the new reversed lodash wrapper instance. - */ - reverse(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.reverse - */ - reverse(): LoDashExplicitArrayWrapper; - } - - //_.prototype.toJSON - interface LoDashWrapperBase { - /** - * @see _.value - */ - toJSON(): T; - } - - //_.prototype.toString - interface LoDashWrapperBase { - /** - * Produces the result of coercing the unwrapped value to a string. - * - * @return Returns the coerced string value. - */ - toString(): string; - } - - //_.prototype.value - interface LoDashWrapperBase { - /** - * Executes the chained sequence to extract the unwrapped value. - * - * @alias _.toJSON, _.valueOf - * - * @return Returns the resolved unwrapped value. - */ - value(): T; - } - - //_.valueOf - interface LoDashWrapperBase { - /** - * @see _.value - */ - valueOf(): T; - } - - /************** - * Collection * - **************/ - - //_.at - interface LoDashStatic { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param collection The collection to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - at( - collection: List | Dictionary, - ...props: Array> - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.at - */ - at(...props: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.at - */ - at(...props: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.at - */ - at(...props: Array>): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.at - */ - at(...props: Array>): LoDashExplicitArrayWrapper; - } - - //_.countBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - countBy( - collection: List, - iteratee?: ListIterator - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: NumericDictionary, - iteratee?: NumericDictionaryIterator - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: List | Dictionary | NumericDictionary, - iteratee?: string - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: List | Dictionary | NumericDictionary, - iteratee?: W - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: List | Dictionary | NumericDictionary, - iteratee?: Object - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: string - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: W - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator | DictionaryIterator | NumericDictionaryIterator - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: string - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: W - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: string - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: W - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator | DictionaryIterator | NumericDictionaryIterator - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: string - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: W - ): LoDashExplicitObjectWrapper>; - } - - //_.each - interface LoDashStatic { - /** - * @see _.forEach - */ - each( - collection: T[], - iteratee?: ListIterator - ): T[]; - - /** - * @see _.forEach - */ - each( - collection: List, - iteratee?: ListIterator - ): List; - - /** - * @see _.forEach - */ - each( - collection: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.forEach - */ - each( - collection: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forEach - */ - each( - collection: T, - iteratee?: ObjectIterator - ): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.forEach - */ - each( - iteratee: ListIterator - ): LoDashImplicitWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.forEach - */ - each( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forEach - */ - each( - iteratee?: ListIterator | DictionaryIterator - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.forEach - */ - each( - iteratee: ListIterator - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.forEach - */ - each( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forEach - */ - each( - iteratee?: ListIterator | DictionaryIterator - ): LoDashExplicitObjectWrapper; - } - - //_.eachRight - interface LoDashStatic { - /** - * @see _.forEachRight - */ - eachRight( - collection: T[], - iteratee?: ListIterator - ): T[]; - - /** - * @see _.forEachRight - */ - eachRight( - collection: List, - iteratee?: ListIterator - ): List; - - /** - * @see _.forEachRight - */ - eachRight( - collection: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.forEachRight - */ - eachRight( - collection: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forEachRight - */ - eachRight( - collection: T, - iteratee?: ObjectIterator - ): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee: ListIterator - ): LoDashImplicitWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee?: ListIterator | DictionaryIterator - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee: ListIterator - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee?: ListIterator | DictionaryIterator - ): LoDashExplicitObjectWrapper; - } - - //_.every - interface LoDashStatic { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - every( - collection: List, - predicate?: ListIterator - ): boolean; - - /** - * @see _.every - */ - every( - collection: Dictionary, - predicate?: DictionaryIterator - ): boolean; - - /** - * @see _.every - */ - every( - collection: NumericDictionary, - predicate?: NumericDictionaryIterator - ): boolean; - - /** - * @see _.every - */ - every( - collection: List | Dictionary | NumericDictionary, - predicate?: string | any[] - ): boolean; - - /** - * @see _.every - */ - every( - collection: List | Dictionary | NumericDictionary, - predicate?: TObject - ): boolean; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.every - */ - every( - predicate?: ListIterator | NumericDictionaryIterator - ): boolean; - - /** - * @see _.every - */ - every( - predicate?: string | any[] - ): boolean; - - /** - * @see _.every - */ - every( - predicate?: TObject - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.every - */ - every( - predicate?: ListIterator | DictionaryIterator | NumericDictionaryIterator - ): boolean; - - /** - * @see _.every - */ - every( - predicate?: string | any[] - ): boolean; - - /** - * @see _.every - */ - every( - predicate?: TObject - ): boolean; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.every - */ - every( - predicate?: ListIterator | NumericDictionaryIterator - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - predicate?: string | any[] - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - predicate?: TObject - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.every - */ - every( - predicate?: ListIterator | DictionaryIterator | NumericDictionaryIterator - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - predicate?: string | any[] - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - predicate?: TObject - ): LoDashExplicitWrapper; - } - - //_.filter - interface LoDashStatic { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - filter( - collection: List, - predicate?: ListIterator - ): T[]; - - /** - * @see _.filter - */ - filter( - collection: Dictionary, - predicate?: DictionaryIterator - ): T[]; - - /** - * @see _.filter - */ - filter( - collection: string, - predicate?: StringIterator - ): string[]; - - /** - * @see _.filter - */ - filter( - collection: List | Dictionary, - predicate: string - ): T[]; - - /** - * @see _.filter - */ - filter( - collection: List | Dictionary, - predicate: W - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.filter - */ - filter( - predicate?: StringIterator - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.filter - */ - filter( - predicate: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - filter( - predicate: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - filter(predicate: W): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.filter - */ - filter( - predicate: ListIterator | DictionaryIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - filter( - predicate: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - filter(predicate: W): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.filter - */ - filter( - predicate?: StringIterator - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.filter - */ - filter( - predicate: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - filter( - predicate: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - filter(predicate: W): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.filter - */ - filter( - predicate: ListIterator | DictionaryIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - filter( - predicate: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - filter(predicate: W): LoDashExplicitArrayWrapper; - } - - //_.find - interface LoDashStatic { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param fromIndex The index to search from. - * @return Returns the matched element, else undefined. - */ - find( - collection: List, - predicate?: ListIterator, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - */ - find( - collection: Dictionary, - predicate?: DictionaryIterator, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - */ - find( - collection: List | Dictionary, - predicate?: string, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - */ - find( - collection: List | Dictionary, - predicate?: TObject, - fromIndex?: number - ): T | undefined; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.find - */ - find( - predicate?: ListIterator, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - */ - find( - predicate?: string, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - */ - find( - predicate?: TObject, - fromIndex?: number - ): T | undefined; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.find - */ - find( - predicate?: ListIterator | DictionaryIterator, - fromIndex?: number - ): TResult | undefined; - - /** - * @see _.find - */ - find( - predicate?: string, - fromIndex?: number - ): TResult | undefined; - - /** - * @see _.find - */ - find( - predicate?: TObject, - fromIndex?: number - ): TResult | undefined; - } - - //_.findLast - interface LoDashStatic { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param callback The function called per iteration. - * @param fromIndex The index to search from. - * @return The found element, else undefined. - **/ - findLast( - collection: T[], - callback: ListIterator, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - **/ - findLast( - collection: List, - callback: ListIterator, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - **/ - findLast( - collection: Dictionary, - callback: DictionaryIterator, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - * @param _.pluck style callback - **/ - findLast( - collection: T[], - whereValue: W, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - * @param _.pluck style callback - **/ - findLast( - collection: List, - whereValue: W, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - * @param _.pluck style callback - **/ - findLast( - collection: Dictionary, - whereValue: W, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - * @param _.where style callback - **/ - findLast( - collection: T[], - pluckValue: string, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - * @param _.where style callback - **/ - findLast( - collection: List, - pluckValue: string, - fromIndex?: number - ): T | undefined; - - /** - * @see _.find - * @param _.where style callback - **/ - findLast( - collection: Dictionary, - pluckValue: string, - fromIndex?: number - ): T | undefined; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.findLast - */ - findLast( - callback: ListIterator, - fromIndex?: number - ): T | undefined; - /** - * @see _.findLast - * @param _.where style callback - */ - findLast( - whereValue: W, - fromIndex?: number - ): T | undefined; - - /** - * @see _.findLast - * @param _.where style callback - */ - findLast( - pluckValue: string, - fromIndex?: number - ): T | undefined; - } - - //_.flatMap - interface LoDashStatic { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - flatMap( - collection: List, - iteratee?: ListIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: List, - iteratee?: ListIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: Dictionary, - iteratee?: DictionaryIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: Dictionary, - iteratee?: DictionaryIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: NumericDictionary, - iteratee?: NumericDictionaryIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: NumericDictionary, - iteratee?: NumericDictionaryIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: TObject, - iteratee?: ObjectIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: Object, - iteratee?: ObjectIterator> - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: TObject, - iteratee: TWhere - ): boolean[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: TObject, - iteratee: Object | string - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: TObject, - iteratee: [string, any] - ): boolean[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: string - ): string[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: Object, - iteratee?: Object | string - ): TResult[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator> - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator> | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: [string, any] - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator> | DictionaryIterator> | NumericDictionaryIterator> - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: ObjectIterator> | string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: [string, any] - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator> - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator> | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: [string, any] - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator> | DictionaryIterator> | NumericDictionaryIterator> - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: ObjectIterator> | string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: [string, any] - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashExplicitArrayWrapper; - } - - //_.forEach - interface LoDashStatic { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - forEach( - collection: T[], - iteratee?: ListIterator - ): T[]; - - /** - * @see _.forEach - */ - forEach( - collection: List, - iteratee?: ListIterator - ): List; - - /** - * @see _.forEach - */ - forEach( - collection: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.forEach - */ - forEach( - collection: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forEach - */ - forEach( - collection: T, - iteratee?: ObjectIterator - ): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee: ListIterator - ): LoDashImplicitWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee?: ListIterator | DictionaryIterator - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee: ListIterator - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee?: ListIterator | DictionaryIterator - ): LoDashExplicitObjectWrapper; - } - - //_.forEachRight - interface LoDashStatic { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - forEachRight( - collection: T[], - iteratee?: ListIterator - ): T[]; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: List, - iteratee?: ListIterator - ): List; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: T, - iteratee?: ObjectIterator - ): T; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: T, - iteratee?: ObjectIterator - ): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee: ListIterator - ): LoDashImplicitWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee?: ListIterator | DictionaryIterator - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee: ListIterator - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee?: ListIterator | DictionaryIterator - ): LoDashExplicitObjectWrapper; - } - - //_.groupBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - groupBy( - collection: List, - iteratee?: ListIterator - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List, - iteratee?: ListIterator - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List | Dictionary, - iteratee?: string - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List | Dictionary, - iteratee?: string - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List | Dictionary, - iteratee?: TWhere - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List | Dictionary, - iteratee?: Object - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: TWhere - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator | DictionaryIterator - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator | DictionaryIterator - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: TWhere - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: Object - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: TWhere - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator | DictionaryIterator - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator | DictionaryIterator - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: TWhere - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: Object - ): LoDashExplicitObjectWrapper>; - } - - //_.includes - interface LoDashStatic { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - includes( - collection: List | Dictionary, - target: T, - fromIndex?: number - ): boolean; - - /** - * @see _.includes - */ - includes( - collection: string, - target: string, - fromIndex?: number - ): boolean; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.includes - */ - includes( - target: T, - fromIndex?: number - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.includes - */ - includes( - target: TValue, - fromIndex?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.includes - */ - includes( - target: string, - fromIndex?: number - ): boolean; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.includes - */ - includes( - target: T, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.includes - */ - includes( - target: TValue, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.includes - */ - includes( - target: string, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.keyBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - keyBy( - collection: List, - iteratee?: ListIterator - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: NumericDictionary, - iteratee?: NumericDictionaryIterator - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: List | NumericDictionary | Dictionary, - iteratee?: string - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: List | NumericDictionary | Dictionary, - iteratee?: W - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: List | NumericDictionary | Dictionary, - iteratee?: Object - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: string - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: W - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator | NumericDictionaryIterator | DictionaryIterator - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: string - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: W - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: Object - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: string - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: W - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator | NumericDictionaryIterator | DictionaryIterator - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: string - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: W - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: Object - ): LoDashExplicitObjectWrapper>; - } - - //_.invoke - interface LoDashStatic { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - invoke( - object: TObject, - path: Many, - ...args: any[]): TResult; - - /** - * @see _.invoke - **/ - invoke( - object: Dictionary | TValue[], - path: Many, - ...args: any[]): TResult; - - /** - * @see _.invoke - **/ - invoke( - object: any, - path: Many, - ...args: any[]): TResult; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.invoke - **/ - invoke( - path: Many, - ...args: any[]): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.invoke - **/ - invoke( - path: Many, - ...args: any[]): TResult; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.invoke - **/ - invoke( - path: Many, - ...args: any[]): TResult; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.invoke - **/ - invoke( - path: Many, - ...args: any[]): TResult; - } - - //_.invokeMap - interface LoDashStatic { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - invokeMap( - collection: TValue[], - methodName: string, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: Dictionary, - methodName: string, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: Array<{}>, - methodName: string, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: Dictionary<{}>, - methodName: string, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: TValue[], - method: (...args: any[]) => TResult, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: Dictionary, - method: (...args: any[]) => TResult, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: Array<{}>, - method: (...args: any[]) => TResult, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: Dictionary<{}>, - method: (...args: any[]) => TResult, - ...args: any[]): TResult[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashImplicitArrayWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashImplicitArrayWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashExplicitArrayWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashExplicitArrayWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashExplicitArrayWrapper; - } - - //_.map - interface LoDashStatic { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - map( - collection: List, - iteratee?: ListIterator - ): TResult[]; - - /** - * @see _.map - */ - map( - collection: Dictionary, - iteratee?: DictionaryIterator - ): TResult[]; - - map( - collection: NumericDictionary, - iteratee?: NumericDictionaryIterator - ): TResult[]; - - /** - * @see _.map - */ - map( - collection: List | Dictionary | NumericDictionary, - iteratee?: string - ): TResult[]; - - /** - * @see _.map - */ - map( - collection: List | Dictionary | NumericDictionary, - iteratee?: TObject - ): boolean[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.map - */ - map( - iteratee?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: TObject - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.map - */ - map( - iteratee?: ListIterator | DictionaryIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: TObject - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.map - */ - map( - iteratee?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: TObject - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.map - */ - map( - iteratee?: ListIterator | DictionaryIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: TObject - ): LoDashExplicitArrayWrapper; - } - - //_.partition - interface LoDashStatic { - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - partition( - collection: List, - callback: ListIterator): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: Dictionary, - callback: DictionaryIterator): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: List, - whereValue: W): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: Dictionary, - whereValue: W): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: List, - path: string, - srcValue: any): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: Dictionary, - path: string, - srcValue: any): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: List, - pluckValue: string): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: Dictionary, - pluckValue: string): T[][]; - } - - interface LoDashImplicitStringWrapper { - /** - * @see _.partition - */ - partition( - callback: ListIterator): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.partition - */ - partition( - callback: ListIterator): LoDashImplicitArrayWrapper; - /** - * @see _.partition - */ - partition( - whereValue: W): LoDashImplicitArrayWrapper; - /** - * @see _.partition - */ - partition( - path: string, - srcValue: any): LoDashImplicitArrayWrapper; - /** - * @see _.partition - */ - partition( - pluckValue: string): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.partition - */ - partition( - callback: ListIterator): LoDashImplicitArrayWrapper; - - /** - * @see _.partition - */ - partition( - callback: DictionaryIterator): LoDashImplicitArrayWrapper; - - /** - * @see _.partition - */ - partition( - whereValue: W): LoDashImplicitArrayWrapper; - - /** - * @see _.partition - */ - partition( - path: string, - srcValue: any): LoDashImplicitArrayWrapper; - - /** - * @see _.partition - */ - partition( - pluckValue: string): LoDashImplicitArrayWrapper; - } - - //_.reduce - interface LoDashStatic { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @param thisArg The this binding of callback. - * @return Returns the accumulated value. - **/ - reduce( - collection: T[], - callback: MemoIterator, - accumulator: TResult): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: List, - callback: MemoIterator, - accumulator: TResult): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: Dictionary, - callback: MemoIterator, - accumulator: TResult): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: NumericDictionary, - callback: MemoIterator, - accumulator: TResult): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: T[], - callback: MemoIterator): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: List, - callback: MemoIterator): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: Dictionary, - callback: MemoIterator): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: NumericDictionary, - callback: MemoIterator): TResult; - - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.reduce - **/ - reduce( - callback: MemoIterator, - accumulator: TResult): TResult; - - /** - * @see _.reduce - **/ - reduce( - callback: MemoIterator): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.reduce - **/ - reduce( - callback: MemoIterator, - accumulator: TResult): TResult; - - /** - * @see _.reduce - **/ - reduce( - callback: MemoIterator): TResult; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.reduce - **/ - reduce( - callback: MemoIterator, - accumulator: TResult): LoDashExplicitObjectWrapper; - - /** - * @see _.reduce - **/ - reduce( - callback: MemoIterator): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitArrayWrapper { - /**LoDashExplicitWrapper - * @see _.reduce - */ - reduce( - callback: MemoIterator, - accumulator: TResult): LoDashExplicitWrapper; - - /** - * @see _.reduce - */ - reduce( - callback: MemoIterator): LoDashExplicitWrapper; - } - - //_.reduceRight - interface LoDashStatic { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @param thisArg The this binding of callback. - * @return The accumulated value. - **/ - reduceRight( - collection: T[], - callback: MemoIterator, - accumulator: TResult): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: List, - callback: MemoIterator, - accumulator: TResult): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: Dictionary, - callback: MemoIterator, - accumulator: TResult): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: T[], - callback: MemoIterator): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: List, - callback: MemoIterator): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: Dictionary, - callback: MemoIterator): TResult; - } - - //_.reject - interface LoDashStatic { - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - reject( - collection: List, - predicate?: ListIterator - ): T[]; - - /** - * @see _.reject - */ - reject( - collection: Dictionary, - predicate?: DictionaryIterator - ): T[]; - - /** - * @see _.reject - */ - reject( - collection: string, - predicate?: StringIterator - ): string[]; - - /** - * @see _.reject - */ - reject( - collection: List | Dictionary, - predicate: string - ): T[]; - - /** - * @see _.reject - */ - reject( - collection: List | Dictionary, - predicate: W - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.reject - */ - reject( - predicate?: StringIterator - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.reject - */ - reject( - predicate: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.reject - */ - reject( - predicate: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.reject - */ - reject(predicate: W): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.reject - */ - reject( - predicate: ListIterator | DictionaryIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.reject - */ - reject( - predicate: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.reject - */ - reject(predicate: W): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.reject - */ - reject( - predicate?: StringIterator - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.reject - */ - reject( - predicate: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.reject - */ - reject( - predicate: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.reject - */ - reject(predicate: W): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.reject - */ - reject( - predicate: ListIterator | DictionaryIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.reject - */ - reject( - predicate: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.reject - */ - reject(predicate: W): LoDashExplicitArrayWrapper; - } - - //_.sample - interface LoDashStatic { - /** - * Gets a random element from collection. - * - * @param collection The collection to sample. - * @return Returns the random element. - */ - sample( - collection: List | Dictionary | NumericDictionary - ): T; - - /** - * @see _.sample - */ - sample( - collection: O - ): T; - - /** - * @see _.sample - */ - sample( - collection: Object - ): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sample - */ - sample(): string; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sample - */ - sample(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sample - */ - sample(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sample - */ - sample(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sample - */ - sample(): TWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sample - */ - sample(): TWrapper; - } - - //_.sampleSize - interface LoDashStatic { - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - sampleSize( - collection: List | Dictionary | NumericDictionary, - n?: number - ): T[]; - - /** - * @see _.sampleSize - */ - sampleSize( - collection: O, - n?: number - ): T[]; - - /** - * @see _.sampleSize - */ - sampleSize( - collection: Object, - n?: number - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashExplicitArrayWrapper; - } - - //_.shuffle - interface LoDashStatic { - /** - * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. - * - * @param collection The collection to shuffle. - * @return Returns the new shuffled array. - */ - shuffle(collection: List | Dictionary): T[]; - - /** - * @see _.shuffle - */ - shuffle(collection: string): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashExplicitArrayWrapper; - } - - //_.size - interface LoDashStatic { - /** - * Gets the size of collection by returning its length for array-like values or the number of own enumerable - * properties for objects. - * - * @param collection The collection to inspect. - * @return Returns the size of collection. - */ - size(collection: List | Dictionary): number; - - /** - * @see _.size - */ - size(collection: string): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.size - */ - size(): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.size - */ - size(): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.size - */ - size(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.size - */ - size(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.size - */ - size(): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.size - */ - size(): LoDashExplicitWrapper; - } - - //_.some - interface LoDashStatic { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - some( - collection: List, - predicate?: ListIterator - ): boolean; - - /** - * @see _.some - */ - some( - collection: Dictionary, - predicate?: DictionaryIterator - ): boolean; - - /** - * @see _.some - */ - some( - collection: NumericDictionary, - predicate?: NumericDictionaryIterator - ): boolean; - - /** - * @see _.some - */ - some( - collection: Object, - predicate?: ObjectIterator - ): boolean; - - /** - * @see _.some - */ - some( - collection: List | Dictionary | NumericDictionary, - predicate?: string | [string, any] - ): boolean; - - - /** - * @see _.some - */ - some( - collection: Object, - predicate?: string | [string, any] - ): boolean; - - /** - * @see _.some - */ - some( - collection: List | Dictionary | NumericDictionary, - predicate?: TObject - ): boolean; - - /** - * @see _.some - */ - some( - collection: List | Dictionary | NumericDictionary, - predicate?: Object - ): boolean; - - /** - * @see _.some - */ - some( - collection: Object, - predicate?: TObject - ): boolean; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.some - */ - some( - predicate?: ListIterator | NumericDictionaryIterator - ): boolean; - - /** - * @see _.some - */ - some( - predicate?: string | [string, any] - ): boolean; - - /** - * @see _.some - */ - some( - predicate?: TObject - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.some - */ - some( - predicate?: ListIterator | DictionaryIterator | NumericDictionaryIterator | ObjectIterator - ): boolean; - - /** - * @see _.some - */ - some( - predicate?: string | [string, any] - ): boolean; - - /** - * @see _.some - */ - some( - predicate?: TObject - ): boolean; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.some - */ - some( - predicate?: ListIterator | NumericDictionaryIterator - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - predicate?: string | [string, any] - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - predicate?: TObject - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.some - */ - some( - predicate?: ListIterator | DictionaryIterator | NumericDictionaryIterator | ObjectIterator - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - predicate?: string | [string, any] - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - predicate?: TObject - ): LoDashExplicitWrapper; - } - - //_.sortBy - interface LoDashStatic { - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - sortBy( - collection: List, - iteratee?: ListIterator - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: Dictionary, - iteratee?: DictionaryIterator - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: List | Dictionary, - iteratee: string - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: List | Dictionary, - whereValue: W - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: List | Dictionary - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: List, - iteratees: Array | string | Object>): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: List, - ...iteratees: Array | Object | string>): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortBy - */ - sortBy( - iteratee?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(iteratee: string): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(whereValue: W): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(...iteratees: Array | Object | string>): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - **/ - sortBy(iteratees: Array | string | Object>): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortBy - */ - sortBy( - iteratee?: ListIterator | DictionaryIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(iteratee: string): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(whereValue: W): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortBy - */ - sortBy( - iteratee?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(iteratee: string): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(whereValue: W): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortBy - */ - sortBy( - iteratee?: ListIterator | DictionaryIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(iteratee: string): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(whereValue: W): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(): LoDashExplicitArrayWrapper; - } - - //_.orderBy - interface LoDashStatic { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} [iteratees=[_.identity]] The iteratees to sort by. - * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - orderBy( - collection: List, - iteratees: Many | string | W>, - orders?: Many - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: List, - iteratees: Many | string | Object>, - orders?: Many - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: NumericDictionary, - iteratees: Many | string | W>, - orders?: Many - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: NumericDictionary, - iteratees: Many | string | Object>, - orders?: Many - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: Dictionary, - iteratees: Many | string | W>, - orders?: Many - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: Dictionary, - iteratees: Many | string | Object>, - orders?: Many - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string>, - orders?: Many - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | W>, - orders?: Many - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | W>, - orders?: Many - ): LoDashImplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | Object>, - orders?: Many - ): LoDashImplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | W>, - orders?: Many - ): LoDashImplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | Object>, - orders?: Many - ): LoDashImplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | W>, - orders?: Many - ): LoDashImplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | Object>, - orders?: Many - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string>, - orders?: Many - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | W | (ListIterator | string | W)>, - orders?: Many - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | W>, - orders?: Many - ): LoDashExplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | Object>, - orders?: Many - ): LoDashExplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | W>, - orders?: Many - ): LoDashExplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | Object>, - orders?: Many - ): LoDashExplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | W>, - orders?: Many - ): LoDashExplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: Many | string | Object>, - orders?: Many - ): LoDashExplicitArrayWrapper; - } - - /******** - * Date * - ********/ - - //_.now - interface LoDashStatic { - /** - * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @return The number of milliseconds. - */ - now(): number; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.now - */ - now(): number; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.now - */ - now(): LoDashExplicitWrapper; - } - - /************* - * Functions * - *************/ - - //_.after - interface LoDashStatic { - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - after( - n: number, - func: TFunc - ): TFunc; - } - - interface LoDashImplicitWrapper { - /** - * @see _.after - **/ - after(func: TFunc): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.after - **/ - after(func: TFunc): LoDashExplicitObjectWrapper; - } - - //_.ary - interface LoDashStatic { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - ary( - func: Function, - n?: number - ): TResult; - - ary( - func: T, - n?: number - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.ary - */ - ary(n?: number): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.ary - */ - ary(n?: number): LoDashExplicitObjectWrapper; - } - - //_.before - interface LoDashStatic { - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * it’s called less than n times. Subsequent calls to the created function return the result of the last func - * invocation. - * - * @param n The number of calls at which func is no longer invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - before( - n: number, - func: TFunc - ): TFunc; - } - - interface LoDashImplicitWrapper { - /** - * @see _.before - **/ - before(func: TFunc): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.before - **/ - before(func: TFunc): LoDashExplicitObjectWrapper; - } - - //_.bind - interface FunctionBind { - placeholder: any; - - ( - func: T, - thisArg: any, - ...partials: any[] - ): TResult; - - ( - func: Function, - thisArg: any, - ...partials: any[] - ): TResult; - } - - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - bind: FunctionBind; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.bind - */ - bind( - thisArg: any, - ...partials: any[] - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.bind - */ - bind( - thisArg: any, - ...partials: any[] - ): LoDashExplicitObjectWrapper; - } - - //_.bindAll - interface LoDashStatic { - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - bindAll( - object: T, - ...methodNames: Array> - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.bindAll - */ - bindAll(...methodNames: Array>): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.bindAll - */ - bindAll(...methodNames: Array>): LoDashExplicitObjectWrapper; - } - - //_.bindKey - interface FunctionBindKey { - placeholder: any; - - ( - object: T, - key: any, - ...partials: any[] - ): TResult; - - ( - object: Object, - key: any, - ...partials: any[] - ): TResult; - } - - interface LoDashStatic { - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - bindKey: FunctionBindKey; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.bindKey - */ - bindKey( - key: any, - ...partials: any[] - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.bindKey - */ - bindKey( - key: any, - ...partials: any[] - ): LoDashExplicitObjectWrapper; - } - - //_.createCallback - interface LoDashStatic { - /** - * Produces a callback bound to an optional thisArg. If func is a property name the created - * callback will return the property value for a given element. If func is an object the created - * callback will return true for elements that contain the equivalent object properties, - * otherwise it will return false. - * @param func The value to convert to a callback. - * @param thisArg The this binding of the created callback. - * @param argCount The number of arguments the callback accepts. - * @return A callback function. - **/ - createCallback( - func: string, - argCount?: number): () => any; - - /** - * @see _.createCallback - **/ - createCallback( - func: Dictionary, - argCount?: number): () => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.createCallback - **/ - createCallback( - argCount?: number): LoDashImplicitObjectWrapper<() => any>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.createCallback - **/ - createCallback( - argCount?: number): LoDashImplicitObjectWrapper<() => any>; - } - - //_.curry - interface LoDashStatic { - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curry(func: (t1: T1) => R): - CurriedFunction1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2) => R): - CurriedFunction2; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3) => R): - CurriedFunction3; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): - CurriedFunction4; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): - CurriedFunction5; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry( - func: Function, - arity?: number): TResult; - } - - interface CurriedFunction1 { - (): CurriedFunction1; - (t1: T1): R; - } - - interface CurriedFunction2 { - (): CurriedFunction2; - (t1: T1): CurriedFunction1; - (t1: T1, t2: T2): R; - } - - interface CurriedFunction3 { - (): CurriedFunction3; - (t1: T1): CurriedFunction2; - (t1: T1, t2: T2): CurriedFunction1; - (t1: T1, t2: T2, t3: T3): R; - } - - interface CurriedFunction4 { - (): CurriedFunction4; - (t1: T1): CurriedFunction3; - (t1: T1, t2: T2): CurriedFunction2; - (t1: T1, t2: T2, t3: T3): CurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4): R; - } - - interface CurriedFunction5 { - (): CurriedFunction5; - (t1: T1): CurriedFunction4; - (t1: T1, t2: T2): CurriedFunction3; - (t1: T1, t2: T2, t3: T3): CurriedFunction2; - (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.curry - **/ - curry(arity?: number): LoDashImplicitObjectWrapper; - } - - //_.curryRight - interface LoDashStatic { - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1) => R): - CurriedFunction1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2) => R): - CurriedFunction2; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3) => R): - CurriedFunction3; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): - CurriedFunction4; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): - CurriedFunction5; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight( - func: Function, - arity?: number): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.curryRight - **/ - curryRight(arity?: number): LoDashImplicitObjectWrapper; - } - - //_.debounce - interface DebounceSettings { - /** - * Specify invoking on the leading edge of the timeout. - */ - leading?: boolean; - - /** - * The maximum time func is allowed to be delayed before it’s invoked. - */ - maxWait?: number; - - /** - * Specify invoking on the trailing edge of the timeout. - */ - trailing?: boolean; - } - - interface LoDashStatic { - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to - * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent - * calls to the debounced function return the result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - debounce( - func: T, - wait?: number, - options?: DebounceSettings - ): T & Cancelable; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.debounce - */ - debounce( - wait?: number, - options?: DebounceSettings - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.debounce - */ - debounce( - wait?: number, - options?: DebounceSettings - ): LoDashExplicitObjectWrapper; - } - - //_.defer - interface LoDashStatic { - /** - * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to - * func when it’s invoked. - * - * @param func The function to defer. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - defer( - func: T, - ...args: any[] - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.defer - */ - defer(...args: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.defer - */ - defer(...args: any[]): LoDashExplicitWrapper; - } - - //_.delay - interface LoDashStatic { - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - delay( - func: T, - wait: number, - ...args: any[] - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.delay - */ - delay( - wait: number, - ...args: any[] - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.delay - */ - delay( - wait: number, - ...args: any[] - ): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - flip(func: T): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flip - */ - flip(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flip - */ - flip(): LoDashExplicitObjectWrapper; - } - - //_.flow - interface LoDashStatic { - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - // 1-argument first function - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; - flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; - // 2-argument first function - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; - flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; - // 3-argument first function - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; - flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; - // 4-argument first function - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; - flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; - // generic function - flow(...funcs: Function[]): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flow - */ - flow(...funcs: Function[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flow - */ - flow(...funcs: Function[]): LoDashExplicitObjectWrapper; - } - - //_.flowRight - interface LoDashStatic { - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - flowRight(...funcs: Function[]): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flowRight - */ - flowRight(...funcs: Function[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flowRight - */ - flowRight(...funcs: Function[]): LoDashExplicitObjectWrapper; - } - - - //_.memoize - interface MemoizedFunction extends Function { - cache: MapCache; - } - - interface LoDashStatic { - /** - * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for - * storing the result based on the arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with - * the this binding of the memoized function. - * - * @param func The function to have its output memoized. - * @param resolver The function to resolve the cache key. - * @return Returns the new memoizing function. - */ - memoize: { - (func: T, resolver?: Function): T & MemoizedFunction; - Cache: MapCacheConstructor; - }; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.memoize - */ - memoize(resolver?: Function): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.memoize - */ - memoize(resolver?: Function): LoDashExplicitObjectWrapper; - } - - //_.overArgs (was _.modArgs) - interface LoDashStatic { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - overArgs( - func: T, - ...transforms: Function[] - ): TResult; - - /** - * @see _.overArgs - */ - overArgs( - func: T, - transforms: Function[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.overArgs - */ - overArgs(...transforms: Function[]): LoDashImplicitObjectWrapper; - - /** - * @see _.overArgs - */ - overArgs(transforms: Function[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.overArgs - */ - overArgs(...transforms: Function[]): LoDashExplicitObjectWrapper; - - /** - * @see _.overArgs - */ - overArgs(transforms: Function[]): LoDashExplicitObjectWrapper; - } - - //_.negate - interface LoDashStatic { - /** - * Creates a function that negates the result of the predicate func. The func predicate is invoked with - * the this binding and arguments of the created function. - * - * @param predicate The predicate to negate. - * @return Returns the new function. - */ - negate(predicate: T): (...args: any[]) => boolean; - - /** - * @see _.negate - */ - negate(predicate: T): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.negate - */ - negate(): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; - - /** - * @see _.negate - */ - negate(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.negate - */ - negate(): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; - - /** - * @see _.negate - */ - negate(): LoDashExplicitObjectWrapper; - } - - //_.once - interface LoDashStatic { - /** - * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value - * of the first call. The func is invoked with the this binding and arguments of the created function. - * - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - once(func: T): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.once - */ - once(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.once - */ - once(): LoDashExplicitObjectWrapper; - } - - //_.partial - interface LoDashStatic { - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - partial: Partial; - } - - type PH = LoDashStatic; - - type Function0 = () => R; - type Function1 = (t1: T1) => R; - type Function2 = (t1: T1, t2: T2) => R; - type Function3 = (t1: T1, t2: T2, t3: T3) => R; - type Function4 = (t1: T1, t2: T2, t3: T3, t4: T4) => R; - - interface Partial { - // arity 0 - (func: Function0): Function0; - // arity 1 - (func: Function1): Function1; - (func: Function1, arg1: T1): Function0; - // arity 2 - (func: Function2): Function2; - (func: Function2, arg1: T1): Function1; - (func: Function2, plc1: PH, arg2: T2): Function1; - (func: Function2, arg1: T1, arg2: T2): Function0; - // arity 3 - (func: Function3): Function3; - (func: Function3, arg1: T1): Function2; - (func: Function3, plc1: PH, arg2: T2): Function2; - (func: Function3, arg1: T1, arg2: T2): Function1; - (func: Function3, plc1: PH, plc2: PH, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1; - (func: Function3, plc1: PH, arg2: T2, arg3: T3): Function1; - (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0; - // arity 4 - (func: Function4): Function4; - (func: Function4, arg1: T1): Function3; - (func: Function4, plc1: PH, arg2: T2): Function3; - (func: Function4, arg1: T1, arg2: T2): Function2; - (func: Function4, plc1: PH, plc2: PH, arg3: T3): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3): Function2; - (func: Function4, plc1: PH, arg2: T2, arg3: T3): Function2; - (func: Function4, arg1: T1, arg2: T2, arg3: T3): Function1; - (func: Function4, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2; - (func: Function4, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1; - (func: Function4, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1; - (func: Function4, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0; - // catch-all - (func: Function, ...args: any[]): Function; - } - - //_.partialRight - interface LoDashStatic { - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - partialRight: PartialRight; - } - - interface PartialRight { - // arity 0 - (func: Function0): Function0; - // arity 1 - (func: Function1): Function1; - (func: Function1, arg1: T1): Function0; - // arity 2 - (func: Function2): Function2; - (func: Function2, arg1: T1, plc2: PH): Function1; - (func: Function2, arg2: T2): Function1; - (func: Function2, arg1: T1, arg2: T2): Function0; - // arity 3 - (func: Function3): Function3; - (func: Function3, arg1: T1, plc2: PH, plc3: PH): Function2; - (func: Function3, arg2: T2, plc3: PH): Function2; - (func: Function3, arg1: T1, arg2: T2, plc3: PH): Function1; - (func: Function3, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1; - (func: Function3, arg2: T2, arg3: T3): Function1; - (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0; - // arity 4 - (func: Function4): Function4; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3; - (func: Function4, arg2: T2, plc3: PH, plc4: PH): Function3; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2; - (func: Function4, arg3: T3, plc4: PH): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2; - (func: Function4, arg2: T2, arg3: T3, plc4: PH): Function2; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1; - (func: Function4, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2; - (func: Function4, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1; - (func: Function4, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1; - (func: Function4, arg2: T2, arg3: T3, arg4: T4): Function1; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0; - // catch-all - (func: Function, ...args: any[]): Function; - } - - //_.rearg - interface LoDashStatic { - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - rearg(func: Function, indexes: number[]): TResult; - - /** - * @see _.rearg - */ - rearg(func: Function, ...indexes: number[]): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.rearg - */ - rearg(indexes: number[]): LoDashImplicitObjectWrapper; - - /** - * @see _.rearg - */ - rearg(...indexes: number[]): LoDashImplicitObjectWrapper; - } - - //_.rest - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - rest( - func: Function, - start?: number - ): TResult; - - /** - * @see _.rest - */ - rest( - func: TFunc, - start?: number - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.rest - */ - rest(start?: number): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.rest - */ - rest(start?: number): LoDashExplicitObjectWrapper; - } - - //_.spread - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - spread(func: F): T; - - /** - * @see _.spread - */ - spread(func: Function): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.spread - */ - spread(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.spread - */ - spread(): LoDashExplicitObjectWrapper; - } - - //_.throttle - interface ThrottleSettings { - /** - * If you'd like to disable the leading-edge call, pass this as false. - */ - leading?: boolean; - - /** - * If you'd like to disable the execution on the trailing-edge, pass false. - */ - trailing?: boolean; - } - - interface LoDashStatic { - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke - * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge - * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - throttle( - func: T, - wait?: number, - options?: ThrottleSettings - ): T & Cancelable; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.throttle - */ - throttle( - wait?: number, - options?: ThrottleSettings - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.throttle - */ - throttle( - wait?: number, - options?: ThrottleSettings - ): LoDashExplicitObjectWrapper; - } - - //_.unary - interface LoDashStatic { - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - unary(func: T): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.unary - */ - unary(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.unary - */ - unary(): LoDashExplicitObjectWrapper; - } - - //_.wrap - interface LoDashStatic { - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - wrap( - value: V, - wrapper: W - ): R; - - /** - * @see _.wrap - */ - wrap( - value: V, - wrapper: Function - ): R; - - /** - * @see _.wrap - */ - wrap( - value: any, - wrapper: Function - ): R; - } - - interface LoDashImplicitWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashImplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashImplicitObjectWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashImplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashImplicitObjectWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashImplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashExplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashExplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashExplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashExplicitObjectWrapper; - } - - /******** - * Lang * - ********/ - - //_.castArray - interface LoDashStatic { - /** - * Casts value as an array if it’s not one. - * - * @param value The value to inspect. - * @return Returns the cast array. - */ - castArray(value?: Many): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashExplicitArrayWrapper; - } - - //_.clone - interface LoDashStatic { - /** - * Creates a shallow clone of value. - * - * Note: This method is loosely based on the structured clone algorithm and supports cloning arrays, - * array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols, - * and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty - * object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps. - * - * @param value The value to clone. - * @return Returns the cloned value. - */ - clone(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.clone - */ - clone(): T; - } - - interface LoDashImplicitArrayWrapper { - - /** - * @see _.clone - */ - clone(): T[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.clone - */ - clone(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.clone - */ - clone(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - - /** - * @see _.clone - */ - clone(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.clone - */ - clone(): LoDashExplicitObjectWrapper; - } - - //_.cloneDeep - interface LoDashStatic { - /** - * This method is like _.clone except that it recursively clones value. - * - * @param value The value to recursively clone. - * @return Returns the deep cloned value. - */ - cloneDeep(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): T[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): LoDashExplicitObjectWrapper; - } - - //_.cloneDeepWith - type CloneDeepWithCustomizer = (value: TValue) => TResult; - - interface LoDashStatic { - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - cloneDeepWith( - value: any, - customizer?: CloneDeepWithCustomizer - ): TResult; - - /** - * @see _.clonDeepeWith - */ - cloneDeepWith( - value: T, - customizer?: CloneDeepWithCustomizer - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): TResult; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): TResult; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - //_.cloneWith - type CloneWithCustomizer = (value: TValue) => TResult; - - interface LoDashStatic { - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - cloneWith( - value: any, - customizer?: CloneWithCustomizer - ): TResult; - - /** - * @see _.cloneWith - */ - cloneWith( - value: T, - customizer?: CloneWithCustomizer - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): TResult; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): TResult; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - //_.eq - interface LoDashStatic { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - eq( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isEqual - */ - eq( - other: any - ): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isEqual - */ - eq( - other: any - ): LoDashExplicitWrapper; - } - - //_.gt - interface LoDashStatic { - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - gt( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.gt - */ - gt(other: any): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.gt - */ - gt(other: any): LoDashExplicitWrapper; - } - - //_.gte - interface LoDashStatic { - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - gte( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.gte - */ - gte(other: any): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.gte - */ - gte(other: any): LoDashExplicitWrapper; - } - - //_.isArguments - interface LoDashStatic { - /** - * Checks if value is classified as an arguments object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isArguments(value?: any): value is IArguments; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isArguments - */ - isArguments(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isArguments - */ - isArguments(): LoDashExplicitWrapper; - } - - //_.isArray - interface LoDashStatic { - /** - * Checks if value is classified as an Array object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isArray(value?: any): value is T[]; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isArray - */ - isArray(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isArray - */ - isArray(): LoDashExplicitWrapper; - } - - //_.isArrayBuffer - interface LoDashStatic { - /** - * Checks if value is classified as an ArrayBuffer object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isArrayBuffer(value?: any): value is ArrayBuffer; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isArrayBuffer - */ - isArrayBuffer(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isArrayBuffer - */ - isArrayBuffer(): LoDashExplicitWrapper; - } - - //_.isArrayLike - interface LoDashStatic { - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - isArrayLike(value?: any): value is T[]; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isArrayLike - */ - isArrayLike(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isArrayLike - */ - isArrayLike(): LoDashExplicitWrapper; - } - - //_.isArrayLikeObject - interface LoDashStatic { - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - isArrayLikeObject(value?: any): value is T[]; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isArrayLikeObject - */ - isArrayLikeObject(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isArrayLikeObject - */ - isArrayLikeObject(): LoDashExplicitWrapper; - } - - //_.isBoolean - interface LoDashStatic { - /** - * Checks if value is classified as a boolean primitive or object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isBoolean(value?: any): value is boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isBoolean - */ - isBoolean(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isBoolean - */ - isBoolean(): LoDashExplicitWrapper; - } - - //_.isBuffer - interface LoDashStatic { - /** - * Checks if value is a buffer. - * - * @param value The value to check. - * @return Returns true if value is a buffer, else false. - */ - isBuffer(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isBuffer - */ - isBuffer(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isBuffer - */ - isBuffer(): LoDashExplicitWrapper; - } - - //_.isDate - interface LoDashStatic { - /** - * Checks if value is classified as a Date object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isDate(value?: any): value is Date; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isDate - */ - isDate(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isDate - */ - isDate(): LoDashExplicitWrapper; - } - - //_.isElement - interface LoDashStatic { - /** - * Checks if value is a DOM element. - * - * @param value The value to check. - * @return Returns true if value is a DOM element, else false. - */ - isElement(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isElement - */ - isElement(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isElement - */ - isElement(): LoDashExplicitWrapper; - } - - //_.isEmpty - interface LoDashStatic { - /** - * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or - * jQuery-like collection with a length greater than 0 or an object with own enumerable properties. - * - * @param value The value to inspect. - * @return Returns true if value is empty, else false. - */ - isEmpty(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isEmpty - */ - isEmpty(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isEmpty - */ - isEmpty(): LoDashExplicitWrapper; - } - - //_.isEqual - interface LoDashStatic { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - isEqual( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isEqual - */ - isEqual( - other: any - ): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isEqual - */ - isEqual( - other: any - ): LoDashExplicitWrapper; - } - - // _.isEqualWith - type IsEqualCustomizer = (value: any, other: any, indexOrKey?: number | string) => boolean; - - interface LoDashStatic { - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - isEqualWith( - value: any, - other: any, - customizer: IsEqualCustomizer - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isEqualWith - */ - isEqualWith( - other: any, - customizer: IsEqualCustomizer - ): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isEqualWith - */ - isEqualWith( - other: any, - customizer: IsEqualCustomizer - ): LoDashExplicitWrapper; - } - - //_.isError - interface LoDashStatic { - /** - * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError - * object. - * - * @param value The value to check. - * @return Returns true if value is an error object, else false. - */ - isError(value: any): value is Error; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isError - */ - isError(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isError - */ - isError(): LoDashExplicitWrapper; - } - - //_.isFinite - interface LoDashStatic { - /** - * Checks if value is a finite primitive number. - * - * Note: This method is based on Number.isFinite. - * - * @param value The value to check. - * @return Returns true if value is a finite number, else false. - */ - isFinite(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isFinite - */ - isFinite(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isFinite - */ - isFinite(): LoDashExplicitWrapper; - } - - //_.isFunction - interface LoDashStatic { - /** - * Checks if value is classified as a Function object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isFunction(value?: any): value is Function; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isFunction - */ - isFunction(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isFunction - */ - isFunction(): LoDashExplicitWrapper; - } - - //_.isInteger - interface LoDashStatic { - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - isInteger(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isInteger - */ - isInteger(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isInteger - */ - isInteger(): LoDashExplicitWrapper; - } - - //_.isLength - interface LoDashStatic { - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - isLength(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isLength - */ - isLength(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isLength - */ - isLength(): LoDashExplicitWrapper; - } - - //_.isMap - interface LoDashStatic { - /** - * Checks if value is classified as a Map object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isMap(value?: any): value is Map; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isMap - */ - isMap(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isMap - */ - isMap(): LoDashExplicitWrapper; - } - - //_.isMatch - type isMatchCustomizer = (value: any, other: any, indexOrKey?: number | string) => boolean; - - interface LoDashStatic { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - isMatch(object: Object, source: Object): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.isMatch - */ - isMatch(source: Object): boolean; - } - - //_.isMatchWith - type isMatchWithCustomizer = (value: any, other: any, indexOrKey?: number | string) => boolean; - - interface LoDashStatic { - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - isMatchWith(object: Object, source: Object, customizer: isMatchWithCustomizer): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.isMatchWith - */ - isMatchWith(source: Object, customizer: isMatchWithCustomizer): boolean; - } - - //_.isNaN - interface LoDashStatic { - /** - * Checks if value is NaN. - * - * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values. - * - * @param value The value to check. - * @return Returns true if value is NaN, else false. - */ - isNaN(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isNaN - */ - isNaN(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isNaN - */ - isNaN(): LoDashExplicitWrapper; - } - - //_.isNative - interface LoDashStatic { - /** - * Checks if value is a native function. - * @param value The value to check. - * - * @retrun Returns true if value is a native function, else false. - */ - isNative(value: any): value is Function; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isNative - */ - isNative(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isNative - */ - isNative(): LoDashExplicitWrapper; - } - - //_.isNil - interface LoDashStatic { - /** - * Checks if `value` is `null` or `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - isNil(value: any): value is null | undefined; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isNil - */ - isNil(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isNil - */ - isNil(): LoDashExplicitWrapper; - } - - //_.isNull - interface LoDashStatic { - /** - * Checks if value is null. - * - * @param value The value to check. - * @return Returns true if value is null, else false. - */ - isNull(value: any): value is null; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isNull - */ - isNull(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isNull - */ - isNull(): LoDashExplicitWrapper; - } - - //_.isNumber - interface LoDashStatic { - /** - * Checks if value is classified as a Number primitive or object. - * - * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isNumber(value?: any): value is number; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isNumber - */ - isNumber(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isNumber - */ - isNumber(): LoDashExplicitWrapper; - } - - //_.isObject - interface LoDashStatic { - /** - * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), - * and new String('')) - * - * @param value The value to check. - * @return Returns true if value is an object, else false. - */ - isObject(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isObject - */ - isObject(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isObject - */ - isObject(): LoDashExplicitWrapper; - } - - //_.isObjectLike - interface LoDashStatic { - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - isObjectLike(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isObjectLike - */ - isObjectLike(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isObjectLike - */ - isObjectLike(): LoDashExplicitWrapper; - } - - //_.isPlainObject - interface LoDashStatic { - /** - * Checks if value is a plain object, that is, an object created by the Object constructor or one with a - * [[Prototype]] of null. - * - * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties. - * - * @param value The value to check. - * @return Returns true if value is a plain object, else false. - */ - isPlainObject(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isPlainObject - */ - isPlainObject(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isPlainObject - */ - isPlainObject(): LoDashExplicitWrapper; - } - - //_.isRegExp - interface LoDashStatic { - /** - * Checks if value is classified as a RegExp object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isRegExp(value?: any): value is RegExp; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isRegExp - */ - isRegExp(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isRegExp - */ - isRegExp(): LoDashExplicitWrapper; - } - - //_.isSafeInteger - interface LoDashStatic { - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - isSafeInteger(value: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isSafeInteger - */ - isSafeInteger(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isSafeInteger - */ - isSafeInteger(): LoDashExplicitWrapper; - } - - //_.isSet - interface LoDashStatic { - /** - * Checks if value is classified as a Set object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isSet(value?: any): value is Set; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isSet - */ - isSet(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isSet - */ - isSet(): LoDashExplicitWrapper; - } - - //_.isString - interface LoDashStatic { - /** - * Checks if value is classified as a String primitive or object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isString(value?: any): value is string; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isString - */ - isString(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isString - */ - isString(): LoDashExplicitWrapper; - } - - //_.isSymbol - interface LoDashStatic { - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - isSymbol(value: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isSymbol - */ - isSymbol(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isSymbol - */ - isSymbol(): LoDashExplicitWrapper; - } - - //_.isTypedArray - interface LoDashStatic { - /** - * Checks if value is classified as a typed array. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isTypedArray(value: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isTypedArray - */ - isTypedArray(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isTypedArray - */ - isTypedArray(): LoDashExplicitWrapper; - } - - //_.isUndefined - interface LoDashStatic { - /** - * Checks if value is undefined. - * - * @param value The value to check. - * @return Returns true if value is undefined, else false. - */ - isUndefined(value: any): value is undefined; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isUndefined - */ - isUndefined(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isUndefined - */ - isUndefined(): LoDashExplicitWrapper; - } - - //_.isWeakMap - interface LoDashStatic { - /** - * Checks if value is classified as a WeakMap object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isWeakMap(value?: any): value is WeakMap; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isSet - */ - isWeakMap(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isSet - */ - isWeakMap(): LoDashExplicitWrapper; - } - - //_.isWeakSet - interface LoDashStatic { - /** - * Checks if value is classified as a WeakSet object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isWeakSet(value?: any): value is WeakSet; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isWeakSet - */ - isWeakSet(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isWeakSet - */ - isWeakSet(): LoDashExplicitWrapper; - } - - //_.lt - interface LoDashStatic { - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - lt( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.lt - */ - lt(other: any): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.lt - */ - lt(other: any): LoDashExplicitWrapper; - } - - //_.lte - interface LoDashStatic { - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - lte( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.lte - */ - lte(other: any): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.lte - */ - lte(other: any): LoDashExplicitWrapper; - } - - //_.toArray - interface LoDashStatic { - /** - * Converts value to an array. - * - * @param value The value to convert. - * @return Returns the converted array. - */ - toArray(value: List | Dictionary | NumericDictionary): T[]; - - /** - * @see _.toArray - */ - toArray(value: TValue): TResult[]; - - /** - * @see _.toArray - */ - toArray(value?: any): TResult[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashExplicitArrayWrapper; - } - - //_.toPlainObject - interface LoDashStatic { - /** - * Converts value to a plain object flattening inherited enumerable properties of value to own properties - * of the plain object. - * - * @param value The value to convert. - * @return Returns the converted plain object. - */ - toPlainObject(value?: any): TResult; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toPlainObject - */ - toPlainObject(): LoDashImplicitObjectWrapper; - } - - //_.toInteger - interface LoDashStatic { - /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 - */ - toInteger(value: any): number; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toInteger - */ - toInteger(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.toInteger - */ - toInteger(): LoDashExplicitWrapper; - } - - //_.toLength - interface LoDashStatic { - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @return {number} Returns the converted integer. - * @example - * - * _.toLength(3); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3'); - * // => 3 - */ - toLength(value: any): number; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toLength - */ - toLength(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.toLength - */ - toLength(): LoDashExplicitWrapper; - } - - //_.toNumber - interface LoDashStatic { - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 - */ - toNumber(value: any): number; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toNumber - */ - toNumber(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.toNumber - */ - toNumber(): LoDashExplicitWrapper; - } - - //_.toSafeInteger - interface LoDashStatic { - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toSafeInteger(3); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3'); - * // => 3 - */ - toSafeInteger(value: any): number; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toSafeInteger - */ - toSafeInteger(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.toSafeInteger - */ - toSafeInteger(): LoDashExplicitWrapper; - } - - //_.toString DUMMY - interface LoDashStatic { - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - toString(value: any): string; - } - - /******** - * Math * - ********/ - - //_.add - interface LoDashStatic { - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - add( - augend: number, - addend: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.add - */ - add(addend: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.add - */ - add(addend: number): LoDashExplicitWrapper; - } - - //_.ceil - interface LoDashStatic { - /** - * Calculates n rounded up to precision. - * - * @param n The number to round up. - * @param precision The precision to round up to. - * @return Returns the rounded up number. - */ - ceil( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.ceil - */ - ceil(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.ceil - */ - ceil(precision?: number): LoDashExplicitWrapper; - } - - //_.floor - interface LoDashStatic { - /** - * Calculates n rounded down to precision. - * - * @param n The number to round down. - * @param precision The precision to round down to. - * @return Returns the rounded down number. - */ - floor( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.floor - */ - floor(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.floor - */ - floor(precision?: number): LoDashExplicitWrapper; - } - - //_.max - interface LoDashStatic { - /** - * Computes the maximum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {*} Returns the maximum value. - */ - max( - collection: List - ): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.max - */ - max(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.max - */ - max(): T; - } - - //_.maxBy - interface LoDashStatic { - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {*} Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - maxBy( - collection: List, - iteratee?: ListIterator - ): T; - - /** - * @see _.maxBy - */ - maxBy( - collection: Dictionary, - iteratee?: DictionaryIterator - ): T; - - /** - * @see _.maxBy - */ - maxBy( - collection: List | Dictionary, - iteratee?: string - ): T; - - /** - * @see _.maxBy - */ - maxBy( - collection: List | Dictionary, - whereValue?: TObject - ): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.maxBy - */ - maxBy( - iteratee?: ListIterator - ): T; - - /** - * @see _.maxBy - */ - maxBy( - iteratee?: string - ): T; - - /** - * @see _.maxBy - */ - maxBy( - whereValue?: TObject - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.maxBy - */ - maxBy( - iteratee?: ListIterator | DictionaryIterator - ): T; - - /** - * @see _.maxBy - */ - maxBy( - iteratee?: string - ): T; - - /** - * @see _.maxBy - */ - maxBy( - whereValue?: TObject - ): T; - } - - //_.mean - interface LoDashStatic { - /** - * Computes the mean of the values in `array`. - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {number} Returns the mean. - * @example - * - * _.mean([4, 2, 8, 6]); - * // => 5 - */ - mean( - collection: List - ): number; - } - - //_.meanBy - interface LoDashStatic { - /** - * Computes the mean of the provided propties of the objects in the `array` - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the mean. - * @example - * - * _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); - * // => 5 - */ - meanBy( - collection: List, - iteratee?: DictionaryIterator - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.mean - */ - mean(): number; - - /** - * @see _.mean - */ - mean(): number; - } - - //_.min - interface LoDashStatic { - /** - * Computes the minimum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {*} Returns the minimum value. - */ - min( - collection: List - ): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.min - */ - min(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.min - */ - min(): T; - } - - //_.minBy - interface LoDashStatic { - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {*} Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - minBy( - collection: List, - iteratee?: ListIterator - ): T; - - /** - * @see _.minBy - */ - minBy( - collection: Dictionary, - iteratee?: DictionaryIterator - ): T; - - /** - * @see _.minBy - */ - minBy( - collection: List | Dictionary, - iteratee?: string - ): T; - - /** - * @see _.minBy - */ - minBy( - collection: List | Dictionary, - whereValue?: TObject - ): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.minBy - */ - minBy( - iteratee?: ListIterator - ): T; - - /** - * @see _.minBy - */ - minBy( - iteratee?: string - ): T; - - /** - * @see _.minBy - */ - minBy( - whereValue?: TObject - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.minBy - */ - minBy( - iteratee?: ListIterator | DictionaryIterator - ): T; - - /** - * @see _.minBy - */ - minBy( - iteratee?: string - ): T; - - /** - * @see _.minBy - */ - minBy( - whereValue?: TObject - ): T; - } - - //_.round - interface LoDashStatic { - /** - * Calculates n rounded to precision. - * - * @param n The number to round. - * @param precision The precision to round to. - * @return Returns the rounded number. - */ - round( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.round - */ - round(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.round - */ - round(precision?: number): LoDashExplicitWrapper; - } - - //_.sum - interface LoDashStatic { - /** - * Computes the sum of the values in `array`. - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {number} Returns the sum. - * @example - * - * _.sum([4, 2, 8, 6]); - * // => 20 - */ - sum(collection: List): number; - - /** - * @see _.sum - */ - sum(collection: List | Dictionary): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sum - */ - sum(): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sum - **/ - sum(): number; - - /** - * @see _.sum - */ - sum(): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sum - */ - sum(): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sum - */ - sum(): LoDashExplicitWrapper; - - /** - * @see _.sum - */ - sum(): LoDashExplicitWrapper; - } - - //_.sumBy - interface LoDashStatic { - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - sumBy( - collection: List, - iteratee: ListIterator - ): number; - - /** - * @see _.sumBy - */ - sumBy( - collection: List<{}>, - iteratee: string - ): number; - - /** - * @see _.sumBy - */ - sumBy( - collection: List - ): number; - - /** - * @see _.sumBy - */ - sumBy( - collection: List<{}>, - iteratee: Dictionary<{}> - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sumBy - */ - sumBy( - iteratee: ListIterator - ): number; - - /** - * @see _.sumBy - */ - sumBy(iteratee: string): number; - - /** - * @see _.sumBy - */ - sumBy(iteratee: Dictionary<{}>): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sumBy - */ - sumBy( - iteratee: ListIterator<{}, number> - ): number; - - /** - * @see _.sumBy - */ - sumBy(iteratee: string): number; - - /** - * @see _.sumBy - */ - sumBy(iteratee: Dictionary<{}>): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sumBy - */ - sumBy( - iteratee: ListIterator - ): LoDashExplicitWrapper; - - /** - * @see _.sumBy - */ - sumBy(iteratee: string): LoDashExplicitWrapper; - - /** - * @see _.sumBy - */ - sumBy(): LoDashExplicitWrapper; - - /** - * @see _.sumBy - */ - sumBy(iteratee: Dictionary<{}>): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sumBy - */ - sumBy( - iteratee: ListIterator<{}, number> - ): LoDashExplicitWrapper; - - /** - * @see _.sumBy - */ - sumBy(iteratee: string): LoDashExplicitWrapper; - - /** - * @see _.sumBy - */ - sumBy(iteratee: Dictionary<{}>): LoDashExplicitWrapper; - } - - /********** - * Number * - **********/ - - //_.subtract - interface LoDashStatic { - /** - * Subtract two numbers. - * - * @static - * @memberOf _ - * @category Math - * @param {number} minuend The first number in a subtraction. - * @param {number} subtrahend The second number in a subtraction. - * @returns {number} Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - subtract( - minuend: number, - subtrahend: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.subtract - */ - subtract( - subtrahend: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.subtract - */ - subtract( - subtrahend: number - ): LoDashExplicitWrapper; - } - - //_.clamp - interface LoDashStatic { - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @static - * @memberOf _ - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - clamp( - number: number, - lower: number, - upper: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.clamp - */ - clamp( - lower: number, - upper: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.clamp - */ - clamp( - lower: number, - upper: number - ): LoDashExplicitWrapper; - } - - //_.inRange - interface LoDashStatic { - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - inRange( - n: number, - start: number, - end: number - ): boolean; - - - /** - * @see _.inRange - */ - inRange( - n: number, - end: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.inRange - */ - inRange( - start: number, - end: number - ): boolean; - - /** - * @see _.inRange - */ - inRange(end: number): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.inRange - */ - inRange( - start: number, - end: number - ): LoDashExplicitWrapper; - - /** - * @see _.inRange - */ - inRange(end: number): LoDashExplicitWrapper; - } - - //_.random - interface LoDashStatic { - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - random( - min?: number, - max?: number, - floating?: boolean - ): number; - - /** - * @see _.random - */ - random( - min?: number, - floating?: boolean - ): number; - - /** - * @see _.random - */ - random(floating?: boolean): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.random - */ - random( - max?: number, - floating?: boolean - ): number; - - /** - * @see _.random - */ - random(floating?: boolean): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.random - */ - random( - max?: number, - floating?: boolean - ): LoDashExplicitWrapper; - - /** - * @see _.random - */ - random(floating?: boolean): LoDashExplicitWrapper; - } - - /********** - * Object * - **********/ - - //_.assign - interface LoDashStatic { - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - assign( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see assign - */ - assign( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see assign - */ - assign( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assign - */ - assign( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assign - */ - assign(object: TObject): TObject; - - /** - * @see _.assign - */ - assign( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.assign - */ - assign( - source: TSource - ): LoDashImplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assign - */ - assign(): LoDashImplicitObjectWrapper; - - /** - * @see _.assign - */ - assign(...otherArgs: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.assign - */ - assign( - source: TSource - ): LoDashExplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assign - */ - assign(): LoDashExplicitObjectWrapper; - - /** - * @see _.assign - */ - assign(...otherArgs: any[]): LoDashExplicitObjectWrapper; - } - - interface LoDashStatic { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - assignWith( - object: TObject, - source: TSource, - customizer: AssignCustomizer - ): TObject & TSource; - - /** - * @see assignWith - */ - assignWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see assignWith - */ - assignWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assignWith - */ - assignWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignWith - */ - assignWith(object: TObject): TObject; - - /** - * @see _.assignWith - */ - assignWith( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.assignWith - */ - assignWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignWith - */ - assignWith(): LoDashImplicitObjectWrapper; - - /** - * @see _.assignWith - */ - assignWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.assignWith - */ - assignWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignWith - */ - assignWith(): LoDashExplicitObjectWrapper; - - /** - * @see _.assignWith - */ - assignWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; - } - - //_.assignIn - interface LoDashStatic { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - assignIn( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see assignIn - */ - assignIn( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see assignIn - */ - assignIn( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assignIn - */ - assignIn( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignIn - */ - assignIn(object: TObject): TObject; - - /** - * @see _.assignIn - */ - assignIn( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.assignIn - */ - assignIn( - source: TSource - ): LoDashImplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignIn - */ - assignIn(): LoDashImplicitObjectWrapper; - - /** - * @see _.assignIn - */ - assignIn(...otherArgs: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.assignIn - */ - assignIn( - source: TSource - ): LoDashExplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignIn - */ - assignIn(): LoDashExplicitObjectWrapper; - - /** - * @see _.assignIn - */ - assignIn(...otherArgs: any[]): LoDashExplicitObjectWrapper; - } - - //_.assignInWith - type AssignCustomizer = (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; - - interface LoDashStatic { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - assignInWith( - object: TObject, - source: TSource, - customizer: AssignCustomizer - ): TObject & TSource; - - /** - * @see assignInWith - */ - assignInWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see assignInWith - */ - assignInWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see assignInWith - */ - assignInWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignInWith - */ - assignInWith(object: TObject): TObject; - - /** - * @see _.assignInWith - */ - assignInWith( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.assignInWith - */ - assignInWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(): LoDashImplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.assignInWith - */ - assignInWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(): LoDashExplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; - } - - //_.create - interface LoDashStatic { - /** - * Creates an object that inherits from the given prototype object. If a properties object is provided its own - * enumerable properties are assigned to the created object. - * - * @param prototype The object to inherit from. - * @param properties The properties to assign to the object. - * @return Returns the new object. - */ - create( - prototype: T, - properties?: U - ): T & U; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.create - */ - create(properties?: U): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.create - */ - create(properties?: U): LoDashExplicitObjectWrapper; - } - - - //_.defaults - interface LoDashStatic { - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - defaults( - object: TObject, - source: TSource - ): TSource & TObject; - - /** - * @see _.defaults - */ - defaults( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TSource2 & TSource1 & TObject; - - /** - * @see _.defaults - */ - defaults( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TSource3 & TSource2 & TSource1 & TObject; - - /** - * @see _.defaults - */ - defaults( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TSource4 & TSource3 & TSource2 & TSource1 & TObject; - - /** - * @see _.defaults - */ - defaults(object: TObject): TObject; - - /** - * @see _.defaults - */ - defaults( - object: any, - ...sources: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.defaults - */ - defaults( - source: TSource - ): LoDashImplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults(): LoDashImplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults(...sources: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.defaults - */ - defaults( - source: TSource - ): LoDashExplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults(): LoDashExplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults(...sources: any[]): LoDashExplicitObjectWrapper; - } - - //_.defaultsDeep - interface LoDashStatic { - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - defaultsDeep( - object: T, - ...sources: any[]): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.defaultsDeep - **/ - defaultsDeep(...sources: any[]): LoDashImplicitObjectWrapper; - } - - // _.extend - interface LoDashStatic { - /** - * @see _.assignIn - */ - extend( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see _.assignIn - */ - extend( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see _.assignIn - */ - extend( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.assignIn - */ - extend( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignIn - */ - extend(object: TObject): TObject; - - /** - * @see _.assignIn - */ - extend( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.assignIn - */ - extend( - source: TSource - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignIn - */ - extend(): LoDashImplicitObjectWrapper; - - /** - * @see _.assignIn - */ - extend(...otherArgs: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.assignIn - */ - extend( - source: TSource - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignIn - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignIn - */ - extend(): LoDashExplicitObjectWrapper; - - /** - * @see _.assignIn - */ - extend(...otherArgs: any[]): LoDashExplicitObjectWrapper; - } - - interface LoDashStatic { - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source: TSource, - customizer: AssignCustomizer - ): TObject & TSource; - - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.assignInWith - */ - extendWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.assignInWith - */ - extendWith(object: TObject): TObject; - - /** - * @see _.assignInWith - */ - extendWith( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.assignInWith - */ - extendWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - extendWith(): LoDashImplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - extendWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.assignInWith - */ - extendWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - extendWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - extendWith(): LoDashExplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - extendWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; - } - - //_.findKey - interface LoDashStatic { - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - findKey( - object: TObject, - predicate?: DictionaryIterator - ): string; - - /** - * @see _.findKey - */ - findKey( - object: TObject, - predicate?: ObjectIterator - ): string; - - /** - * @see _.findKey - */ - findKey( - object: TObject, - predicate?: string - ): string; - - /** - * @see _.findKey - */ - findKey, TObject>( - object: TObject, - predicate?: TWhere - ): string; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.findKey - */ - findKey( - predicate?: DictionaryIterator - ): string; - - /** - * @see _.findKey - */ - findKey( - predicate?: ObjectIterator - ): string; - - /** - * @see _.findKey - */ - findKey( - predicate?: string - ): string; - - /** - * @see _.findKey - */ - findKey>( - predicate?: TWhere - ): string; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.findKey - */ - findKey( - predicate?: DictionaryIterator - ): LoDashExplicitWrapper; - - /** - * @see _.findKey - */ - findKey( - predicate?: ObjectIterator - ): LoDashExplicitWrapper; - - /** - * @see _.findKey - */ - findKey( - predicate?: string - ): LoDashExplicitWrapper; - - /** - * @see _.findKey - */ - findKey>( - predicate?: TWhere - ): LoDashExplicitWrapper; - } - - //_.findLastKey - interface LoDashStatic { - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - findLastKey( - object: TObject, - predicate?: DictionaryIterator - ): string; - - /** - * @see _.findLastKey - */ - findLastKey( - object: TObject, - predicate?: ObjectIterator - ): string; - - /** - * @see _.findLastKey - */ - findLastKey( - object: TObject, - predicate?: string - ): string; - - /** - * @see _.findLastKey - */ - findLastKey, TObject>( - object: TObject, - predicate?: TWhere - ): string; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: DictionaryIterator - ): string; - - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: ObjectIterator - ): string; - - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: string - ): string; - - /** - * @see _.findLastKey - */ - findLastKey>( - predicate?: TWhere - ): string; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: DictionaryIterator - ): LoDashExplicitWrapper; - - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: ObjectIterator - ): LoDashExplicitWrapper; - - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: string - ): LoDashExplicitWrapper; - - /** - * @see _.findLastKey - */ - findLastKey>( - predicate?: TWhere - ): LoDashExplicitWrapper; - } - - //_.forIn - interface LoDashStatic { - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forIn( - object: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.forIn - */ - forIn( - object: T, - iteratee?: ObjectIterator - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forIn - */ - forIn( - iteratee?: DictionaryIterator - ): _.LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forIn - */ - forIn( - iteratee?: DictionaryIterator - ): _.LoDashExplicitObjectWrapper; - } - - //_.forInRight - interface LoDashStatic { - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forInRight( - object: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.forInRight - */ - forInRight( - object: T, - iteratee?: ObjectIterator - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forInRight - */ - forInRight( - iteratee?: DictionaryIterator - ): _.LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forInRight - */ - forInRight( - iteratee?: DictionaryIterator - ): _.LoDashExplicitObjectWrapper; - } - - //_.forOwn - interface LoDashStatic { - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forOwn( - object: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.forOwn - */ - forOwn( - object: T, - iteratee?: ObjectIterator - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forOwn - */ - forOwn( - iteratee?: DictionaryIterator - ): _.LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forOwn - */ - forOwn( - iteratee?: DictionaryIterator - ): _.LoDashExplicitObjectWrapper; - } - - //_.forOwnRight - interface LoDashStatic { - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forOwnRight( - object: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.forOwnRight - */ - forOwnRight( - object: T, - iteratee?: ObjectIterator - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forOwnRight - */ - forOwnRight( - iteratee?: DictionaryIterator - ): _.LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forOwnRight - */ - forOwnRight( - iteratee?: DictionaryIterator - ): _.LoDashExplicitObjectWrapper; - } - - //_.functions - interface LoDashStatic { - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - functions(object: any): string[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.functions - */ - functions(): _.LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.functions - */ - functions(): _.LoDashExplicitArrayWrapper; - } - - //_.functionsIn - interface LoDashStatic { - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - functionsIn(object: any): string[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.functionsIn - */ - functionsIn(): _.LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.functionsIn - */ - functionsIn(): _.LoDashExplicitArrayWrapper; - } - - //_.get - interface LoDashStatic { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - get( - object: TObject, - path: Many, - defaultValue?: TResult - ): TResult; - - /** - * @see _.get - */ - get( - object: any, - path: Many, - defaultValue?: TResult - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.get - */ - get( - path: Many, - defaultValue?: TResult - ): TResult; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.get - */ - get( - path: Many, - defaultValue?: TResult - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.get - */ - get( - path: Many, - defaultValue?: TResult - ): TResult; - } - - interface LoDashExplicitWrapper { - /** - * @see _.get - */ - get( - path: Many, - defaultValue?: any - ): TResultWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.get - */ - get( - path: Many, - defaultValue?: any - ): TResultWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.get - */ - get( - path: Many, - defaultValue?: any - ): TResultWrapper; - } - - //_.has - interface LoDashStatic { - /** - * Checks if `path` is a direct property of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - has( - object: T, - path: Many - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.has - */ - has(path: Many): boolean; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.has - */ - has(path: Many): LoDashExplicitWrapper; - } - - //_.hasIn - interface LoDashStatic { - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - hasIn( - object: T, - path: Many - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.hasIn - */ - hasIn(path: Many): boolean; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.hasIn - */ - hasIn(path: Many): LoDashExplicitWrapper; - } - - //_.invert - interface LoDashStatic { - /** - * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, - * subsequent values overwrite property assignments of previous values unless multiValue is true. - * - * @param object The object to invert. - * @param multiValue Allow multiple values per key. - * @return Returns the new inverted object. - */ - invert( - object: T, - multiValue?: boolean - ): TResult; - - /** - * @see _.invert - */ - invert( - object: Object, - multiValue?: boolean - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.invert - */ - invert(multiValue?: boolean): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.invert - */ - invert(multiValue?: boolean): LoDashExplicitObjectWrapper; - } - - //_.inverBy - type InvertByIterator = (value: T) => any; - - interface LoDashStatic { - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - invertBy( - object: Object, - interatee?: InvertByIterator | string - ): Dictionary; - - /** - * @see _.invertBy - */ - invertBy( - object: _.Dictionary | _.NumericDictionary, - interatee?: InvertByIterator | string - ): Dictionary; - - /** - * @see _.invertBy - */ - invertBy( - object: Object, - interatee?: W - ): Dictionary; - - /** - * @see _.invertBy - */ - invertBy( - object: _.Dictionary, - interatee?: W - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator | string - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - interatee?: W - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator | string - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - interatee?: W - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator | string - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - interatee?: W - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator | string - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - interatee?: W - ): LoDashExplicitObjectWrapper>; - } - - //_.keys - interface LoDashStatic { - /** - * Creates an array of the own enumerable property names of object. - * - * Note: Non-object values are coerced to objects. See the ES spec for more details. - * - * @param object The object to query. - * @return Returns the array of property names. - */ - keys(object?: any): string[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.keys - */ - keys(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.keys - */ - keys(): LoDashExplicitArrayWrapper; - } - - //_.keysIn - interface LoDashStatic { - /** - * Creates an array of the own and inherited enumerable property names of object. - * - * Note: Non-object values are coerced to objects. - * - * @param object The object to query. - * @return An array of property names. - */ - keysIn(object?: any): string[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.keysIn - */ - keysIn(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.keysIn - */ - keysIn(): LoDashExplicitArrayWrapper; - } - - //_.mapKeys - interface LoDashStatic { - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - mapKeys( - object: List, - iteratee?: ListIterator - ): Dictionary; - - /** - * @see _.mapKeys - */ - mapKeys( - object: Dictionary, - iteratee?: DictionaryIterator - ): Dictionary; - - /** - * @see _.mapKeys - */ - mapKeys( - object: List | Dictionary, - iteratee?: TObject - ): Dictionary; - - /** - * @see _.mapKeys - */ - mapKeys( - object: List | Dictionary, - iteratee?: string - ): Dictionary; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: ListIterator - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: TObject - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: string - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: ListIterator | DictionaryIterator - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: TObject - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: string - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: ListIterator - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: TObject - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: string - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: ListIterator | DictionaryIterator - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: TObject - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: string - ): LoDashExplicitObjectWrapper>; - } - - //_.mapValues - interface LoDashStatic { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @param {Object} [thisArg] The `this` binding of `iteratee`. - * @return {Object} Returns the new mapped object. - */ - mapValues(obj: Dictionary, callback: ObjectIterator): Dictionary; - mapValues(obj: Dictionary, where: Dictionary): Dictionary; - mapValues(obj: T, pluck: string): TMapped; - mapValues(obj: T, callback: ObjectIterator): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.mapValues - * TValue is the type of the property values of T. - * TResult is the type output by the ObjectIterator function - */ - mapValues(callback: ObjectIterator): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapValues - * TResult is the type of the property specified by pluck. - * T should be a Dictionary> - */ - mapValues(pluck: string): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapValues - * TResult is the type of the properties of each object in the values of T - * T should be a Dictionary> - */ - mapValues(where: Dictionary): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.mapValues - * TValue is the type of the property values of T. - * TResult is the type output by the ObjectIterator function - */ - mapValues(callback: ObjectIterator): LoDashExplicitObjectWrapper>; - - /** - * @see _.mapValues - * TResult is the type of the property specified by pluck. - * T should be a Dictionary> - */ - mapValues(pluck: string): LoDashExplicitObjectWrapper>; - - /** - * @see _.mapValues - * TResult is the type of the properties of each object in the values of T - * T should be a Dictionary> - */ - mapValues(where: Dictionary): LoDashExplicitObjectWrapper; - } - - //_.merge - interface LoDashStatic { - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - merge( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.merge - */ - merge( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.merge - */ - merge( - source: TSource - ): LoDashImplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - ...otherArgs: any[] - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.merge - */ - merge( - source: TSource - ): LoDashExplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - ): LoDashExplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - ...otherArgs: any[] - ): LoDashExplicitObjectWrapper; - } - - //_.mergeWith - type MergeWithCustomizer = (value: any, srcValue: any, key?: string, object?: Object, source?: Object) => any; - - interface LoDashStatic { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - mergeWith( - object: TObject, - source: TSource, - customizer: MergeWithCustomizer - ): TObject & TSource; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.mergeWith - */ - mergeWith( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.mergeWith - */ - mergeWith( - source: TSource, - customizer: MergeWithCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - customizer: MergeWithCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: MergeWithCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: MergeWithCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - ...otherArgs: any[] - ): LoDashImplicitObjectWrapper; - } - - //_.omit - interface LoDashStatic { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to omit, specified - * individually or in arrays.. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - - omit( - object: T, - ...predicate: Array> - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - - /** - * @see _.omit - */ - omit( - ...predicate: Array> - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - - /** - * @see _.omit - */ - omit( - ...predicate: Array> - ): LoDashExplicitObjectWrapper; - } - - //_.omitBy - interface LoDashStatic { - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - omitBy( - object: T, - predicate: ObjectIterator - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.omitBy - */ - omitBy( - predicate: ObjectIterator - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.omitBy - */ - omitBy( - predicate: ObjectIterator - ): LoDashExplicitObjectWrapper; - } - - //_.pick - interface LoDashStatic { - /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to pick, specified - * individually or in arrays. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - pick( - object: T, - ...predicate: Array> - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.pick - */ - pick( - ...predicate: Array> - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.pick - */ - pick( - ...predicate: Array> - ): LoDashExplicitObjectWrapper; - } - - //_.pickBy - interface LoDashStatic { - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - pickBy( - object: T, - predicate?: ObjectIterator - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.pickBy - */ - pickBy( - predicate?: ObjectIterator - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.pickBy - */ - pickBy( - predicate?: ObjectIterator - ): LoDashExplicitObjectWrapper; - } - - //_.result - interface LoDashStatic { - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - result( - object: TObject, - path: Many, - defaultValue?: TResult | ((...args: any[]) => TResult) - ): TResult; - - /** - * @see _.result - */ - result( - object: any, - path: Many, - defaultValue?: TResult | ((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.result - */ - result( - path: Many, - defaultValue?: TResult | ((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.result - */ - result( - path: Many, - defaultValue?: TResult | ((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.result - */ - result( - path: Many, - defaultValue?: TResult | ((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashExplicitWrapper { - /** - * @see _.result - */ - result( - path: Many, - defaultValue?: any - ): TResultWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.result - */ - result( - path: Many, - defaultValue?: any - ): TResultWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.result - */ - result( - path: Many, - defaultValue?: any - ): TResultWrapper; - } - - //_.set - interface LoDashStatic { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - set( - object: Object, - path: Many, - value: any - ): TResult; - - /** - * @see _.set - */ - set( - object: Object, - path: Many, - value: V - ): TResult; - - /** - * @see _.set - */ - set( - object: O, - path: Many, - value: V - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.set - */ - set( - path: Many, - value: any - ): LoDashImplicitObjectWrapper; - - /** - * @see _.set - */ - set( - path: Many, - value: V - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.set - */ - set( - path: Many, - value: any - ): LoDashExplicitObjectWrapper; - - /** - * @see _.set - */ - set( - path: Many, - value: V - ): LoDashExplicitObjectWrapper; - } - - //_.setWith - type SetWithCustomizer = (nsValue: any, key: string, nsObject: T) => any; - - interface LoDashStatic { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - setWith( - object: Object, - path: Many, - value: any, - customizer?: SetWithCustomizer - ): TResult; - - /** - * @see _.setWith - */ - setWith( - object: Object, - path: Many, - value: V, - customizer?: SetWithCustomizer - ): TResult; - - /** - * @see _.setWith - */ - setWith( - object: O, - path: Many, - value: V, - customizer?: SetWithCustomizer - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.setWith - */ - setWith( - path: Many, - value: any, - customizer?: SetWithCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.setWith - */ - setWith( - path: Many, - value: V, - customizer?: SetWithCustomizer - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.setWith - */ - setWith( - path: Many, - value: any, - customizer?: SetWithCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see _.setWith - */ - setWith( - path: Many, - value: V, - customizer?: SetWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - //_.toPairs - interface LoDashStatic { - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - toPairs(object?: T): any[][]; - - toPairs(object?: T): TResult[][]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.toPairs - */ - toPairs(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.toPairs - */ - toPairs(): LoDashExplicitArrayWrapper; - } - - //_.toPairsIn - interface LoDashStatic { - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - toPairsIn(object?: T): any[][]; - - toPairsIn(object?: T): TResult[][]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.toPairsIn - */ - toPairsIn(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.toPairsIn - */ - toPairsIn(): LoDashExplicitArrayWrapper; - } - - //_.transform - interface LoDashStatic { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - transform( - object: T[], - iteratee?: MemoVoidArrayIterator, - accumulator?: TResult[] - ): TResult[]; - - /** - * @see _.transform - */ - transform( - object: T[], - iteratee?: MemoVoidArrayIterator>, - accumulator?: Dictionary - ): Dictionary; - - /** - * @see _.transform - */ - transform( - object: Dictionary, - iteratee?: MemoVoidDictionaryIterator>, - accumulator?: Dictionary - ): Dictionary; - - /** - * @see _.transform - */ - transform( - object: Dictionary, - iteratee?: MemoVoidDictionaryIterator, - accumulator?: TResult[] - ): TResult[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.transform - */ - transform( - iteratee?: MemoVoidArrayIterator, - accumulator?: TResult[] - ): LoDashImplicitArrayWrapper; - - /** - * @see _.transform - */ - transform( - iteratee?: MemoVoidArrayIterator>, - accumulator?: Dictionary - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.transform - */ - transform( - iteratee?: MemoVoidDictionaryIterator>, - accumulator?: Dictionary - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.transform - */ - transform( - iteratee?: MemoVoidDictionaryIterator, - accumulator?: TResult[] - ): LoDashImplicitArrayWrapper; - } - - //_.unset - interface LoDashStatic { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - unset( - object: T, - path: Many - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.unset - */ - unset(path: Many): LoDashImplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.unset - */ - unset(path: Many): LoDashExplicitWrapper; - } - - //_.update - interface LoDashStatic { - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - update( - object: Object, - path: Many, - updater: Function - ): TResult; - - /** - * @see _.update - */ - update( - object: Object, - path: Many, - updater: U - ): TResult; - - /** - * @see _.update - */ - update( - object: O, - path: Many, - updater: Function - ): TResult; - - /** - * @see _.update - */ - update( - object: O, - path: Many, - updater: U - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.update - */ - update( - path: Many, - updater: any - ): LoDashImplicitObjectWrapper; - - /** - * @see _.update - */ - update( - path: Many, - updater: U - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.update - */ - update( - path: Many, - updater: any - ): LoDashExplicitObjectWrapper; - - /** - * @see _.update - */ - update( - path: Many, - updater: U - ): LoDashExplicitObjectWrapper; - } - - //_.values - interface LoDashStatic { - /** - * Creates an array of the own enumerable property values of object. - * - * @param object The object to query. - * @return Returns an array of property values. - */ - values(object?: Dictionary | NumericDictionary | List): T[]; - - /** - * @see _.values - */ - values(object?: any): T[]; - } - - interface LoDashImplicitStringWrapper { - /** - * @see _.values - */ - values(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitWrapper { - /** - * @see _.values - */ - values(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.values - */ - values(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.values - */ - values(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.values - */ - values(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.values - */ - values(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.values - */ - values(): LoDashExplicitArrayWrapper; - } - - //_.valuesIn - interface LoDashStatic { - /** - * Creates an array of the own and inherited enumerable property values of object. - * - * @param object The object to query. - * @return Returns the array of property values. - */ - valuesIn(object?: Dictionary): T[]; - - /** - * @see _.valuesIn - */ - valuesIn(object?: any): T[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.valuesIn - */ - valuesIn(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.valuesIn - */ - valuesIn(): LoDashExplicitArrayWrapper; - } - - /********** - * String * - **********/ - - //_.camelCase - interface LoDashStatic { - /** - * Converts string to camel case. - * - * @param string The string to convert. - * @return Returns the camel cased string. - */ - camelCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.camelCase - */ - camelCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.camelCase - */ - camelCase(): LoDashExplicitWrapper; - } - - //_.capitalize - interface LoDashStatic { - /** - * Converts the first character of string to upper case and the remaining to lower case. - * - * @param string The string to capitalize. - * @return Returns the capitalized string. - */ - capitalize(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.capitalize - */ - capitalize(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.capitalize - */ - capitalize(): LoDashExplicitWrapper; - } - - //_.deburr - interface LoDashStatic { - /** - * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining - * diacritical marks. - * - * @param string The string to deburr. - * @return Returns the deburred string. - */ - deburr(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.deburr - */ - deburr(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.deburr - */ - deburr(): LoDashExplicitWrapper; - } - - //_.endsWith - interface LoDashStatic { - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - endsWith( - string?: string, - target?: string, - position?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.endsWith - */ - endsWith( - target?: string, - position?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.endsWith - */ - endsWith( - target?: string, - position?: number - ): LoDashExplicitWrapper; - } - - // _.escape - interface LoDashStatic { - /** - * Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities. - * - * Note: No other characters are escaped. To escape additional characters use a third-party library like he. - * - * hough the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML - * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s - * article (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59, - * #102, #108, and #133 of the HTML5 Security Cheatsheet for more details. - * - * When working with HTML you should always quote attribute values to reduce XSS vectors. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - escape(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.escape - */ - escape(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.escape - */ - escape(): LoDashExplicitWrapper; - } - - // _.escapeRegExp - interface LoDashStatic { - /** - * Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", - * "{", "}", and "|" in string. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - escapeRegExp(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.escapeRegExp - */ - escapeRegExp(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.escapeRegExp - */ - escapeRegExp(): LoDashExplicitWrapper; - } - - //_.kebabCase - interface LoDashStatic { - /** - * Converts string to kebab case. - * - * @param string The string to convert. - * @return Returns the kebab cased string. - */ - kebabCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.kebabCase - */ - kebabCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.kebabCase - */ - kebabCase(): LoDashExplicitWrapper; - } - - //_.lowerCase - interface LoDashStatic { - /** - * Converts `string`, as space separated words, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - lowerCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lowerCase - */ - lowerCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lowerCase - */ - lowerCase(): LoDashExplicitWrapper; - } - - //_.lowerFirst - interface LoDashStatic { - /** - * Converts the first character of `string` to lower case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - lowerFirst(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lowerFirst - */ - lowerFirst(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lowerFirst - */ - lowerFirst(): LoDashExplicitWrapper; - } - - //_.pad - interface LoDashStatic { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - pad( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pad - */ - pad( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pad - */ - pad( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.padEnd - interface LoDashStatic { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - padEnd( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.padEnd - */ - padEnd( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.padEnd - */ - padEnd( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.padStart - interface LoDashStatic { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - padStart( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.padStart - */ - padStart( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.padStart - */ - padStart( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.parseInt - interface LoDashStatic { - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - parseInt( - string: string, - radix?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.parseInt - */ - parseInt(radix?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.parseInt - */ - parseInt(radix?: number): LoDashExplicitWrapper; - } - - //_.repeat - interface LoDashStatic { - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - repeat( - string?: string, - n?: number - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.repeat - */ - repeat(n?: number): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.repeat - */ - repeat(n?: number): LoDashExplicitWrapper; - } - - //_.replace - interface LoDashStatic { - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @param string - * @param pattern - * @param replacement - * @return Returns the modified string. - */ - replace( - string: string, - pattern: RegExp | string, - replacement: Function | string - ): string; - - /** - * @see _.replace - */ - replace( - pattern?: RegExp | string, - replacement?: Function | string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.replace - */ - replace( - pattern?: RegExp | string, - replacement?: Function | string - ): string; - - /** - * @see _.replace - */ - replace( - replacement?: Function | string - ): string; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.replace - */ - replace( - pattern?: RegExp | string, - replacement?: Function | string - ): string; - - /** - * @see _.replace - */ - replace( - replacement?: Function | string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.replace - */ - replace( - pattern?: RegExp | string, - replacement?: Function | string - ): LoDashExplicitWrapper; - - /** - * @see _.replace - */ - replace( - replacement?: Function | string - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.replace - */ - replace( - pattern?: RegExp | string, - replacement?: Function | string - ): LoDashExplicitWrapper; - - /** - * @see _.replace - */ - replace( - replacement?: Function | string - ): LoDashExplicitWrapper; - } - - //_.snakeCase - interface LoDashStatic { - /** - * Converts string to snake case. - * - * @param string The string to convert. - * @return Returns the snake cased string. - */ - snakeCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.snakeCase - */ - snakeCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.snakeCase - */ - snakeCase(): LoDashExplicitWrapper; - } - - //_.split - interface LoDashStatic { - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string - * @param separator - * @param limit - * @return Returns the new array of string segments. - */ - split( - string: string, - separator?: RegExp | string, - limit?: number - ): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.split - */ - split( - separator?: RegExp | string, - limit?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.split - */ - split( - separator?: RegExp | string, - limit?: number - ): LoDashExplicitArrayWrapper; - } - - //_.startCase - interface LoDashStatic { - /** - * Converts string to start case. - * - * @param string The string to convert. - * @return Returns the start cased string. - */ - startCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.startCase - */ - startCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.startCase - */ - startCase(): LoDashExplicitWrapper; - } - - //_.startsWith - interface LoDashStatic { - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - startsWith( - string?: string, - target?: string, - position?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.startsWith - */ - startsWith( - target?: string, - position?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.startsWith - */ - startsWith( - target?: string, - position?: number - ): LoDashExplicitWrapper; - } - - //_.template - interface TemplateOptions extends TemplateSettings { - /** - * The sourceURL of the template's compiled source. - */ - sourceURL?: string; - } - - interface TemplateExecutor { - (data?: Object): string; - source: string; - } - - interface LoDashStatic { - /** - * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, - * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" - * delimiters. Data properties may be accessed as free variables in the template. If a setting object is - * provided it takes precedence over _.templateSettings values. - * - * Note: In the development build _.template utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier - * debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @param string The template string. - * @param options The options object. - * @param options.escape The HTML "escape" delimiter. - * @param options.evaluate The "evaluate" delimiter. - * @param options.imports An object to import into the template as free variables. - * @param options.interpolate The "interpolate" delimiter. - * @param options.sourceURL The sourceURL of the template's compiled source. - * @param options.variable The data object variable name. - * @return Returns the compiled template function. - */ - template( - string: string, - options?: TemplateOptions - ): TemplateExecutor; - } - - interface LoDashImplicitWrapper { - /** - * @see _.template - */ - template(options?: TemplateOptions): TemplateExecutor; - } - - interface LoDashExplicitWrapper { - /** - * @see _.template - */ - template(options?: TemplateOptions): LoDashExplicitObjectWrapper; - } - - //_.toLower - interface LoDashStatic { - /** - * Converts `string`, as a whole, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - toLower(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toLower - */ - toLower(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toLower - */ - toLower(): LoDashExplicitWrapper; - } - - //_.toUpper - interface LoDashStatic { - /** - * Converts `string`, as a whole, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - toUpper(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toUpper - */ - toUpper(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toUpper - */ - toUpper(): LoDashExplicitWrapper; - } - - //_.trim - interface LoDashStatic { - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trim( - string?: string, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trim - */ - trim(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trim - */ - trim(chars?: string): LoDashExplicitWrapper; - } - - //_.trimEnd - interface LoDashStatic { - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trimEnd( - string?: string, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trimEnd - */ - trimEnd(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trimEnd - */ - trimEnd(chars?: string): LoDashExplicitWrapper; - } - - //_.trimStart - interface LoDashStatic { - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trimStart( - string?: string, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trimStart - */ - trimStart(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trimStart - */ - trimStart(chars?: string): LoDashExplicitWrapper; - } - - //_.truncate - interface TruncateOptions { - /** The maximum string length. */ - length?: number; - /** The string to indicate text is omitted. */ - omission?: string; - /** The separator pattern to truncate to. */ - separator?: string | RegExp; - } - - interface LoDashStatic { - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - truncate( - string?: string, - options?: TruncateOptions - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.truncate - */ - truncate(options?: TruncateOptions): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.truncate - */ - truncate(options?: TruncateOptions): LoDashExplicitWrapper; - } - - //_.unescape - interface LoDashStatic { - /** - * The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` - * in string to their corresponding characters. - * - * Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library - * like he. - * - * @param string The string to unescape. - * @return Returns the unescaped string. - */ - unescape(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unescape - */ - unescape(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unescape - */ - unescape(): LoDashExplicitWrapper; - } - - //_.upperCase - interface LoDashStatic { - /** - * Converts `string`, as space separated words, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - upperCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.upperCase - */ - upperCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.upperCase - */ - upperCase(): LoDashExplicitWrapper; - } - - //_.upperFirst - interface LoDashStatic { - /** - * Converts the first character of `string` to upper case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - upperFirst(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.upperFirst - */ - upperFirst(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.upperFirst - */ - upperFirst(): LoDashExplicitWrapper; - } - - //_.words - interface LoDashStatic { - /** - * Splits `string` into an array of its words. - * - * @param string The string to inspect. - * @param pattern The pattern to match words. - * @return Returns the words of `string`. - */ - words( - string?: string, - pattern?: string | RegExp - ): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.words - */ - words(pattern?: string | RegExp): string[]; - } - - interface LoDashExplicitWrapper { - /** - * @see _.words - */ - words(pattern?: string | RegExp): LoDashExplicitArrayWrapper; - } - - /*********** - * Utility * - ***********/ - - //_.attempt - interface LoDashStatic { - /** - * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments - * are provided to func when it’s invoked. - * - * @param func The function to attempt. - * @return Returns the func result or error object. - */ - attempt(func: (...args: any[]) => TResult, ...args: any[]): TResult | Error; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.attempt - */ - attempt(...args: any[]): TResult | Error; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.attempt - */ - attempt(...args: any[]): LoDashExplicitObjectWrapper; - } - - //_.constant - interface LoDashStatic { - /** - * Creates a function that returns value. - * - * @param value The value to return from the new function. - * @return Returns the new function. - */ - constant(value: T): () => T; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.constant - */ - constant(): LoDashImplicitObjectWrapper<() => TResult>; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.constant - */ - constant(): LoDashExplicitObjectWrapper<() => TResult>; - } - - //_.defaultTo - interface LoDashStatic { - /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. - * - * @param value The value to check. - * @param defaultValue The default value. - * @returns Returns the resolved value. - */ - defaultTo(value: T, defaultValue: T): T; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.defaultTo - */ - defaultTo(value: TResult): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.defaultTo - */ - defaultTo(value: TResult): LoDashExplicitObjectWrapper; - } - - //_.identity - interface LoDashStatic { - /** - * This method returns the first argument provided to it. - * - * @param value Any value. - * @return Returns value. - */ - identity(value?: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.identity - */ - identity(): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.identity - */ - identity(): T[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.identity - */ - identity(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.identity - */ - identity(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.identity - */ - identity(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.identity - */ - identity(): LoDashExplicitObjectWrapper; - } - - //_.iteratee - interface LoDashStatic { - /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. - * - * @static - * @memberOf _ - * @category Util - * @param {*} [func=_.identity] The value to convert to a callback. - * @returns {Function} Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // create custom iteratee shorthands - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); - * }; - * }); - * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] - */ - iteratee( - func: Function - ): (...args: any[]) => TResult; - - /** - * @see _.iteratee - */ - iteratee( - func: string - ): (object: any) => TResult; - - /** - * @see _.iteratee - */ - iteratee( - func: Object - ): (object: any) => boolean; - - /** - * @see _.iteratee - */ - iteratee(): (value: TResult) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.iteratee - */ - iteratee(): LoDashImplicitObjectWrapper<(object: any) => TResult>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.iteratee - */ - iteratee(): LoDashImplicitObjectWrapper<(object: any) => boolean>; - - /** - * @see _.iteratee - */ - iteratee(): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.iteratee - */ - iteratee(): LoDashExplicitObjectWrapper<(object: any) => TResult>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.iteratee - */ - iteratee(): LoDashExplicitObjectWrapper<(object: any) => boolean>; - - /** - * @see _.iteratee - */ - iteratee(): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; - } - - //_.matches - interface LoDashStatic { - /** - * Creates a function that performs a deep comparison between a given object and source, returning true if the - * given object has equivalent property values, else false. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own - * or inherited property value see _.matchesProperty. - * - * @param source The object of property values to match. - * @return Returns the new function. - */ - matches(source: T): (value: any) => boolean; - - /** - * @see _.matches - */ - matches(source: T): (value: V) => boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.matches - */ - matches(): LoDashImplicitObjectWrapper<(value: V) => boolean>; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.matches - */ - matches(): LoDashExplicitObjectWrapper<(value: V) => boolean>; - } - - //_.matchesProperty - interface LoDashStatic { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - matchesProperty( - path: Many, - srcValue: T - ): (value: any) => boolean; - - /** - * @see _.matchesProperty - */ - matchesProperty( - path: Many, - srcValue: T - ): (value: V) => boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashImplicitObjectWrapper<(value: any) => boolean>; - - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashImplicitObjectWrapper<(value: Value) => boolean>; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashExplicitObjectWrapper<(value: any) => boolean>; - - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashExplicitObjectWrapper<(value: Value) => boolean>; - } - - //_.method - interface LoDashStatic { - /** - * Creates a function that invokes the method at path on a given object. Any additional arguments are provided - * to the invoked method. - * - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - method( - path: string | StringRepresentable[], - ...args: any[] - ): (object: TObject) => TResult; - - /** - * @see _.method - */ - method( - path: string | StringRepresentable[], - ...args: any[] - ): (object: any) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>; - - /** - * @see _.method - */ - method(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>; - - /** - * @see _.method - */ - method(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>; - - /** - * @see _.method - */ - method(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>; - - /** - * @see _.method - */ - method(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>; - } - - //_.methodOf - interface LoDashStatic { - /** - * The opposite of _.method; this method creates a function that invokes the method at a given path on object. - * Any additional arguments are provided to the invoked method. - * - * @param object The object to query. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - methodOf( - object: TObject, - ...args: any[] - ): (path: Many) => TResult; - - /** - * @see _.methodOf - */ - methodOf( - object: {}, - ...args: any[] - ): (path: Many) => TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.methodOf - */ - methodOf( - ...args: any[] - ): LoDashImplicitObjectWrapper<(path: Many) => TResult>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.methodOf - */ - methodOf( - ...args: any[] - ): LoDashExplicitObjectWrapper<(path: Many) => TResult>; - } - - //_.mixin - interface MixinOptions { - chain?: boolean; - } - - interface LoDashStatic { - /** - * Adds all own enumerable function properties of a source object to the destination object. If object is a - * function then methods are added to its prototype as well. - * - * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying - * the original. - * - * @param object The destination object. - * @param source The object of functions to add. - * @param options The options object. - * @param options.chain Specify whether the functions added are chainable. - * @return Returns object. - */ - mixin( - object: TObject, - source: Dictionary, - options?: MixinOptions - ): TResult; - - /** - * @see _.mixin - */ - mixin( - source: Dictionary, - options?: MixinOptions - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.mixin - */ - mixin( - source: Dictionary, - options?: MixinOptions - ): LoDashImplicitObjectWrapper; - - /** - * @see _.mixin - */ - mixin( - options?: MixinOptions - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.mixin - */ - mixin( - source: Dictionary, - options?: MixinOptions - ): LoDashExplicitObjectWrapper; - - /** - * @see _.mixin - */ - mixin( - options?: MixinOptions - ): LoDashExplicitObjectWrapper; - } - - //_.noConflict - interface LoDashStatic { - /** - * Reverts the _ variable to its previous value and returns a reference to the lodash function. - * - * @return Returns the lodash function. - */ - noConflict(): typeof _; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.noConflict - */ - noConflict(): typeof _; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.noConflict - */ - noConflict(): LoDashExplicitObjectWrapper; - } - - //_.noop - interface LoDashStatic { - /** - * A no-operation function that returns undefined regardless of the arguments it receives. - * - * @return undefined - */ - noop(...args: any[]): void; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.noop - */ - noop(...args: any[]): void; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.noop - */ - noop(...args: any[]): _.LoDashExplicitWrapper; - } - - //_.nthArg - interface LoDashStatic { - /** - * Creates a function that returns its nth argument. - * - * @param n The index of the argument to return. - * @return Returns the new function. - */ - nthArg(n?: number): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.nthArg - */ - nthArg(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.nthArg - */ - nthArg(): LoDashExplicitObjectWrapper; - } - - //_.over - interface LoDashStatic { - /** - * Creates a function that invokes iteratees with the arguments provided to the created function and returns - * their results. - * - * @param iteratees The iteratees to invoke. - * @return Returns the new function. - */ - over(...iteratees: Array>): (...args: any[]) => TResult[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.over - */ - over(...iteratees: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.over - */ - over(...iteratees: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.over - */ - over(...iteratees: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.over - */ - over(...iteratees: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; - } - - //_.overEvery - interface LoDashStatic { - /** - * Creates a function that checks if all of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - overEvery(...predicates: Array>): (...args: any[]) => boolean; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; - } - - //_.overSome - interface LoDashStatic { - /** - * Creates a function that checks if any of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - overSome(...predicates: Array>): (...args: any[]) => boolean; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; - } - - //_.property - interface LoDashStatic { - /** - * Creates a function that returns the property value at path on a given object. - * - * @param path The path of the property to get. - * @return Returns the new function. - */ - property(path: Many): (obj: TObj) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.property - */ - property(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.property - */ - property(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.property - */ - property(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.property - */ - property(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>; - } - - //_.propertyOf - interface LoDashStatic { - /** - * The opposite of _.property; this method creates a function that returns the property value at a given path - * on object. - * - * @param object The object to query. - * @return Returns the new function. - */ - propertyOf(object: T): (path: Many) => any; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.propertyOf - */ - propertyOf(): LoDashImplicitObjectWrapper<(path: Many) => any>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.propertyOf - */ - propertyOf(): LoDashExplicitObjectWrapper<(path: Many) => any>; - } - - //_.range - interface LoDashStatic { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - range( - start: number, - end: number, - step?: number - ): number[]; - - /** - * @see _.range - */ - range( - end: number, - step?: number - ): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.range - */ - range( - end?: number, - step?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.range - */ - range( - end?: number, - step?: number - ): LoDashExplicitArrayWrapper; - } - - //_.rangeRight - interface LoDashStatic { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @static - * @memberOf _ - * @category Util - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @param {number} [step=1] The value to increment or decrement by. - * @returns {Array} Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - rangeRight( - start: number, - end: number, - step?: number - ): number[]; - - /** - * @see _.rangeRight - */ - rangeRight( - end: number, - step?: number - ): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.rangeRight - */ - rangeRight( - end?: number, - step?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.rangeRight - */ - rangeRight( - end?: number, - step?: number - ): LoDashExplicitArrayWrapper; - } - - //_.runInContext - interface LoDashStatic { - /** - * Create a new pristine lodash function using the given context object. - * - * @param context The context object. - * @return Returns a new lodash function. - */ - runInContext(context?: Object): typeof _; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.runInContext - */ - runInContext(): typeof _; - } - - // _.stubArray - interface LoDashStatic { - /** - * This method returns a new empty array. - * - * @returns Returns the new empty array. - */ - stubArray(): any[]; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.stubArray - */ - stubArray(): any[]; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.stubArray - */ - stubArray(): _.LoDashExplicitArrayWrapper; - } - - // _.stubFalse - interface LoDashStatic { - /** - * This method returns `false`. - * - * @returns Returns `false`. - */ - stubFalse(): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.stubFalse - */ - stubFalse(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.stubFalse - */ - stubFalse(): _.LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * This method returns a new empty object. - * - * @returns Returns the new empty object. - */ - stubObject(): Object; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.stubObject - */ - stubObject(): Object; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.stubObject - */ - stubObject(): _.LoDashExplicitObjectWrapper; - } - - interface LoDashStatic { - /** - * This method returns an empty string. - * - * @returns Returns the empty string. - */ - stubString(): string; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.stubString - */ - stubString(): string; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.stubString - */ - stubString(): _.LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * This method returns `true`. - * - * @returns Returns `true`. - */ - stubTrue(): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.stubTrue - */ - stubTrue(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.stubTrue - */ - stubTrue(): _.LoDashExplicitWrapper; - } - - //_.times - interface LoDashStatic { - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - times( - n: number, - iteratee: (num: number) => TResult - ): TResult[]; - - /** - * @see _.times - */ - times(n: number): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.times - */ - times( - iteratee: (num: number) => TResult - ): TResult[]; - - /** - * @see _.times - */ - times(): number[]; - } - - interface LoDashExplicitWrapper { - /** - * @see _.times - */ - times( - iteratee: (num: number) => TResult - ): LoDashExplicitArrayWrapper; - - /** - * @see _.times - */ - times(): LoDashExplicitArrayWrapper; - } - - //_.toPath - interface LoDashStatic { - /** - * Converts `value` to a property path array. - * - * @static - * @memberOf _ - * @category Util - * @param {*} value The value to convert. - * @returns {Array} Returns the new property path array. - * @example - * - * _.toPath('a.b.c'); - * // => ['a', 'b', 'c'] - * - * _.toPath('a[0].b.c'); - * // => ['a', '0', 'b', 'c'] - * - * var path = ['a', 'b', 'c'], - * newPath = _.toPath(path); - * - * console.log(newPath); - * // => ['a', 'b', 'c'] - * - * console.log(path === newPath); - * // => false - */ - toPath(value: any): string[]; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toPath - */ - toPath(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.toPath - */ - toPath(): LoDashExplicitWrapper; - } - - //_.uniqueId - interface LoDashStatic { - /** - * Generates a unique ID. If prefix is provided the ID is appended to it. - * - * @param prefix The value to prefix the ID with. - * @return Returns the unique ID. - */ - uniqueId(prefix?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniqueId - */ - uniqueId(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniqueId - */ - uniqueId(): LoDashExplicitWrapper; - } - - type ListIterator = (value: T, index: number, collection: List) => TResult; - - type DictionaryIterator = (value: T, key?: string, collection?: Dictionary) => TResult; - - type NumericDictionaryIterator = (value: T, key?: number, collection?: Dictionary) => TResult; - - type ObjectIterator = (element: T, key?: string, collection?: any) => TResult; - - type StringIterator = (char: string, index?: number, string?: string) => TResult; - - type MemoVoidIterator = (prev: TResult, curr: T, indexOrKey?: any, list?: T[]) => void; - - type MemoIterator = (prev: TResult, curr: T, indexOrKey?: any, list?: T[]) => TResult; - - type MemoVoidArrayIterator = (acc: TResult, curr: T, index?: number, arr?: T[]) => void; - type MemoVoidDictionaryIterator = (acc: TResult, curr: T, key?: string, dict?: Dictionary) => void; - - // Common interface between Arrays and jQuery objects - interface List { - [index: number]: T; - length: number; - } - - interface Dictionary { - [index: string]: T; - } - - interface NumericDictionary { - [index: number]: T; - } - - interface StringRepresentable { - toString(): string; - } - - interface Cancelable { - cancel(): void; - flush(): void; - } -} diff --git a/lib/common/file-system.ts b/lib/common/file-system.ts index b69658c19b..0647d986f7 100644 --- a/lib/common/file-system.ts +++ b/lib/common/file-system.ts @@ -1,5 +1,5 @@ import * as fs from "fs"; -import * as path from "path"; +import { join, dirname, basename, resolve as pathResolve, extname, normalize } from "path"; import * as minimatch from "minimatch"; import * as injector from "./yok"; import * as crypto from "crypto"; @@ -74,7 +74,7 @@ export class FileSystem implements IFileSystem { let proc: string; if ($hostInfo.isWindows) { - proc = path.join(__dirname, "resources/platform-tools/unzip/win32/unzip"); + proc = join(__dirname, "resources/platform-tools/unzip/win32/unzip"); } else if ($hostInfo.isDarwin) { proc = "unzip"; // darwin unzip is info-zip } else if ($hostInfo.isLinux) { @@ -98,11 +98,11 @@ export class FileSystem implements IFileSystem { } private findFileCaseInsensitive(file: string): string { - const dir = path.dirname(file); - const basename = path.basename(file); + const dir = dirname(file); + const baseName = basename(file); const entries = this.readDirectory(dir); - const match = minimatch.match(entries, basename, { nocase: true, nonegate: true, nonull: true })[0]; - const result = path.join(dir, match); + const match = minimatch.match(entries, baseName, { nocase: true, nonegate: true, nonull: true })[0]; + const result = join(dir, match); return result; } @@ -204,7 +204,7 @@ export class FileSystem implements IFileSystem { } public writeFile(filename: string, data: string | NodeBuffer, encoding?: string): void { - this.createDirectory(path.dirname(filename)); + this.createDirectory(dirname(filename)); fs.writeFileSync(filename, data, { encoding: encoding }); } @@ -218,7 +218,7 @@ export class FileSystem implements IFileSystem { } let stringifiedData; - if (path.basename(filename) === PACKAGE_JSON_FILE_NAME) { + if (basename(filename) === PACKAGE_JSON_FILE_NAME) { let newline = EOL; if (fs.existsSync(filename)) { const existingFile = this.readText(filename); @@ -233,11 +233,11 @@ export class FileSystem implements IFileSystem { } public copyFile(sourceFileName: string, destinationFileName: string): void { - if (path.resolve(sourceFileName) === path.resolve(destinationFileName)) { + if (pathResolve(sourceFileName) === pathResolve(destinationFileName)) { return; } - this.createDirectory(path.dirname(destinationFileName)); + this.createDirectory(dirname(destinationFileName)); // MobileApplication.app is resolved as a directory on Mac, // therefore we need to copy it recursively as it's not a single file. @@ -284,8 +284,8 @@ export class FileSystem implements IFileSystem { if (!this.exists(baseName)) { return baseName; } - const extension = path.extname(baseName); - const prefix = path.basename(baseName, extension); + const extension = extname(baseName); + const prefix = basename(baseName, extension); for (let i = 2; ; ++i) { const numberedName = prefix + i + extension; @@ -301,8 +301,8 @@ export class FileSystem implements IFileSystem { } public isRelativePath(p: string): boolean { - const normal = path.normalize(p); - const absolute = path.resolve(p); + const normal = normalize(p); + const absolute = pathResolve(p); return normal !== absolute; } @@ -357,7 +357,7 @@ export class FileSystem implements IFileSystem { const contents = this.readDirectory(directoryPath); for (let i = 0; i < contents.length; ++i) { - const file = path.join(directoryPath, contents[i]); + const file = join(directoryPath, contents[i]); let stat: fs.Stats = null; if (this.exists(file)) { stat = this.getFsStats(file); @@ -420,11 +420,11 @@ export class FileSystem implements IFileSystem { } public deleteEmptyParents(directory: string): void { - let parent = this.exists(directory) ? directory : path.dirname(directory); + let parent = this.exists(directory) ? directory : dirname(directory); while (this.isEmptyDir(parent)) { this.deleteDirectory(parent); - parent = path.dirname(parent); + parent = dirname(parent); } } diff --git a/lib/common/helpers.ts b/lib/common/helpers.ts index 784848eb26..f3c22b4430 100644 --- a/lib/common/helpers.ts +++ b/lib/common/helpers.ts @@ -309,8 +309,8 @@ export function versionCompare(version1: string | IVersionData, version2: string } export function isInteractive(): boolean { - const isInteractive = isRunningInTTY() && !isCIEnvironment(); - return isInteractive; + const result = isRunningInTTY() && !isCIEnvironment(); + return result; } /** diff --git a/lib/common/host-info.ts b/lib/common/host-info.ts index 9fcdd5b825..4335829204 100644 --- a/lib/common/host-info.ts +++ b/lib/common/host-info.ts @@ -54,12 +54,13 @@ export class HostInfo implements IHostInfo { const systemProfileCommand = "system_profiler SPSoftwareDataType -detailLevel mini"; this.$logger.trace("Trying to get macOS version."); + let macOSVersion: string; try { const systemProfileOutput = await this.$childProcess.exec(systemProfileCommand); const versionRegExp = /System Version:\s+?macOS\s+?(\d+\.\d+)(\.\d+)?\s+/g; const regExpMatchers = versionRegExp.exec(systemProfileOutput); - const macOSVersion = regExpMatchers && regExpMatchers[1]; + macOSVersion = regExpMatchers && regExpMatchers[1]; if (macOSVersion) { this.$logger.trace(`macOS version based on system_profiler is ${macOSVersion}.`); return macOSVersion; @@ -75,7 +76,7 @@ export class HostInfo implements IHostInfo { // So the version becomes "10.12" in this case. const osRelease = this.$osInfo.release(); const majorVersion = osRelease && _.first(osRelease.split(".")); - const macOSVersion = majorVersion && `10.${+majorVersion - 4}`; + macOSVersion = majorVersion && `10.${+majorVersion - 4}`; this.$logger.trace(`macOS version based on os.release() (${osRelease}) is ${macOSVersion}.`); return macOSVersion; } diff --git a/lib/common/http-client.ts b/lib/common/http-client.ts index bcaf9f3344..902be6e9c7 100644 --- a/lib/common/http-client.ts +++ b/lib/common/http-client.ts @@ -105,7 +105,7 @@ export class HttpClient implements Server.IHttpClient { } const result = new Promise((resolve, reject) => { - let timerId: number; + let timerId: NodeJS.Timer; const cleanupRequestData: ICleanupRequestData = Object.create({ timers: [] }); this.cleanupData.push(cleanupRequestData); @@ -147,7 +147,7 @@ export class HttpClient implements Server.IHttpClient { this.setResponseResult(promiseActions, cleanupRequestData, { err }); }) .on("socket", (s: TLSSocket) => { - let stuckRequestTimerId: number; + let stuckRequestTimerId: NodeJS.Timer; stuckRequestTimerId = setTimeout(() => { this.setResponseResult(promiseActions, cleanupRequestData, { err: new Error(HttpClient.STUCK_REQUEST_ERROR_MESSAGE) }); @@ -160,24 +160,24 @@ export class HttpClient implements Server.IHttpClient { stuckRequestTimerId = null; }); }) - .on("response", (response: Server.IRequestResponseData) => { - cleanupRequestData.res = response; + .on("response", (responseData: Server.IRequestResponseData) => { + cleanupRequestData.res = responseData; let lastChunkTimestamp = Date.now(); cleanupRequestData.stuckResponseIntervalId = setInterval(() => { if (Date.now() - lastChunkTimestamp > HttpClient.STUCK_RESPONSE_CHECK_INTERVAL) { this.setResponseResult(promiseActions, cleanupRequestData, { err: new Error(HttpClient.STUCK_RESPONSE_ERROR_MESSAGE) }); } }, HttpClient.STUCK_RESPONSE_CHECK_INTERVAL); - const successful = helpers.isRequestSuccessful(response); + const successful = helpers.isRequestSuccessful(responseData); if (!successful) { pipeTo = undefined; } - let responseStream = response; + let responseStream = responseData; responseStream.on("data", (chunk: string) => { lastChunkTimestamp = Date.now(); }); - switch (response.headers["content-encoding"]) { + switch (responseData.headers["content-encoding"]) { case "gzip": responseStream = responseStream.pipe(zlib.createGunzip()); break; @@ -188,8 +188,8 @@ export class HttpClient implements Server.IHttpClient { if (pipeTo) { pipeTo.on("finish", () => { - this.$logger.trace("httpRequest: Piping done. code = %d", response.statusCode.toString()); - this.setResponseResult(promiseActions, cleanupRequestData, { response }); + this.$logger.trace("httpRequest: Piping done. code = %d", responseData.statusCode.toString()); + this.setResponseResult(promiseActions, cleanupRequestData, { response: responseData }); }); responseStream.pipe(pipeTo); @@ -201,15 +201,15 @@ export class HttpClient implements Server.IHttpClient { }); responseStream.on("end", () => { - this.$logger.trace("httpRequest: Done. code = %d", response.statusCode.toString()); + this.$logger.trace("httpRequest: Done. code = %d", responseData.statusCode.toString()); const responseBody = data.join(""); if (successful) { - this.setResponseResult(promiseActions, cleanupRequestData, { body: responseBody, response }); + this.setResponseResult(promiseActions, cleanupRequestData, { body: responseBody, response: responseData }); } else { - const errorMessage = this.getErrorMessage(response.statusCode, responseBody); + const errorMessage = this.getErrorMessage(responseData.statusCode, responseBody); const err: any = new Error(errorMessage); - err.response = response; + err.response = responseData; err.body = responseBody; this.setResponseResult(promiseActions, cleanupRequestData, { err }); } @@ -340,7 +340,7 @@ export class HttpClient implements Server.IHttpClient { } interface ICleanupRequestData { - timers: number[]; + timers: NodeJS.Timer[]; stuckResponseIntervalId: NodeJS.Timer; req: request.Request; res: Server.IRequestResponseData; diff --git a/lib/common/mobile/android/android-application-manager.ts b/lib/common/mobile/android/android-application-manager.ts index 8df5b909e7..73e312f3b2 100644 --- a/lib/common/mobile/android/android-application-manager.ts +++ b/lib/common/mobile/android/android-application-manager.ts @@ -1,6 +1,6 @@ import { EOL } from "os"; import { ApplicationManagerBase } from "../application-manager-base"; -import {TARGET_FRAMEWORK_IDENTIFIERS, LiveSyncPaths } from "../../constants"; +import { TARGET_FRAMEWORK_IDENTIFIERS, LiveSyncPaths } from "../../constants"; import { hook, sleep, regExpEscape } from "../../helpers"; import { cache } from "../../decorators"; diff --git a/lib/common/mobile/ios/device/ios-device-operations.ts b/lib/common/mobile/ios/device/ios-device-operations.ts index 6f1a3de4c4..f2d90eafce 100644 --- a/lib/common/mobile/ios/device/ios-device-operations.ts +++ b/lib/common/mobile/ios/device/ios-device-operations.ts @@ -222,7 +222,7 @@ export class IOSDeviceOperations extends EventEmitter implements IIOSDeviceOpera } } - const groupedResults = _.groupBy(result, r => (r).deviceId); + const groupedResults = _.groupBy(result, r => ((r).deviceId)); this.$logger.trace("Received multiple results:"); this.$logger.trace(groupedResults); diff --git a/lib/common/mobile/mobile-core/android-device-discovery.ts b/lib/common/mobile/mobile-core/android-device-discovery.ts index f03cb918bd..35084edb42 100644 --- a/lib/common/mobile/mobile-core/android-device-discovery.ts +++ b/lib/common/mobile/mobile-core/android-device-discovery.ts @@ -57,11 +57,11 @@ export class AndroidDeviceDiscovery extends DeviceDiscovery implements Mobile.IA _(this._devices) .reject(d => _.find(currentDevices, device => device.identifier === d.identifier && device.status === d.status)) - .each(d => this.deleteAndRemoveDevice(d.identifier)); + .each((d: IAdbAndroidDeviceInfo) => this.deleteAndRemoveDevice(d.identifier)); await Promise.all(_(currentDevices) .reject(d => _.find(this._devices, device => device.identifier === d.identifier && device.status === d.status)) - .map(d => this.createAndAddDevice(d)).value()); + .map((d: IAdbAndroidDeviceInfo) => this.createAndAddDevice(d)).value()); } public async ensureAdbServerStarted(): Promise { diff --git a/lib/common/mobile/mobile-core/android-emulator-discovery.ts b/lib/common/mobile/mobile-core/android-emulator-discovery.ts index 406d82361a..f899186a9f 100644 --- a/lib/common/mobile/mobile-core/android-emulator-discovery.ts +++ b/lib/common/mobile/mobile-core/android-emulator-discovery.ts @@ -18,12 +18,12 @@ export class AndroidEmulatorDiscovery extends EventEmitter implements Mobile.IDe // Remove old emulators const lostEmulators = _(cachedEmulators) - .reject(e => _.find(currentEmulators, emulator => emulator && e && emulator.imageIdentifier === e.imageIdentifier)) + .reject(e => _.some(currentEmulators, emulator => emulator && e && emulator.imageIdentifier === e.imageIdentifier)) .value(); // Add new emulators const foundEmulators = _(currentEmulators) - .reject(e => _.find(cachedEmulators, emulator => emulator && e && emulator.imageIdentifier === e.imageIdentifier)) + .reject(e => _.some(cachedEmulators, emulator => emulator && e && emulator.imageIdentifier === e.imageIdentifier)) .value(); if (lostEmulators.length) { diff --git a/lib/common/mobile/mobile-core/devices-service.ts b/lib/common/mobile/mobile-core/devices-service.ts index f91283af99..11efa236ed 100644 --- a/lib/common/mobile/mobile-core/devices-service.ts +++ b/lib/common/mobile/mobile-core/devices-service.ts @@ -658,7 +658,7 @@ export class DevicesService extends EventEmitter implements Mobile.IDevicesServi .map(device => device.deviceInfo.platform) .filter(pl => { try { - return this.$mobileHelper.validatePlatformName(pl); + return !!this.$mobileHelper.validatePlatformName(pl); } catch (err) { this.$logger.warn(err.message); return null; diff --git a/lib/common/mobile/mobile-core/ios-simulator-discovery.ts b/lib/common/mobile/mobile-core/ios-simulator-discovery.ts index e73a9aadff..a59d79b7ce 100644 --- a/lib/common/mobile/mobile-core/ios-simulator-discovery.ts +++ b/lib/common/mobile/mobile-core/ios-simulator-discovery.ts @@ -28,12 +28,12 @@ export class IOSSimulatorDiscovery extends DeviceDiscovery { // Remove old simulators _(this.cachedSimulators) - .reject(s => _.find(currentSimulators, simulator => simulator && s && simulator.id === s.id && simulator.state === s.state)) + .reject(s => _.some(currentSimulators, simulator => simulator && s && simulator.id === s.id && simulator.state === s.state)) .each(s => this.deleteAndRemoveDevice(s)); // Add new simulators _(currentSimulators) - .reject(s => _.find(this.cachedSimulators, simulator => simulator && s && simulator.id === s.id && simulator.state === s.state)) + .reject(s => _.some(this.cachedSimulators, simulator => simulator && s && simulator.id === s.id && simulator.state === s.state)) .each(s => this.createAndAddDevice(s)); } } diff --git a/lib/common/prompter.ts b/lib/common/prompter.ts index 0a712f4b49..cb7388b3b8 100644 --- a/lib/common/prompter.ts +++ b/lib/common/prompter.ts @@ -22,33 +22,33 @@ export class Prompter implements IPrompter { }); }); try { - this.muteStdout(); + this.muteStdout(); - if (!helpers.isInteractive()) { - if (_.some(questions, s => !s.default)) { - throw new Error("Console is not interactive and no default action specified."); - } else { - const result: any = {}; + if (!helpers.isInteractive()) { + if (_.some(questions, s => !s.default)) { + throw new Error("Console is not interactive and no default action specified."); + } else { + const result: any = {}; - _.each(questions, s => { - // Curly brackets needed because s.default() may return false and break the loop - result[s.name] = s.default(); - }); + _.each(questions, s => { + // Curly brackets needed because s.default() may return false and break the loop + result[s.name] = s.default(); + }); - return result; - } - } else { - const result = await prompt.prompt(questions); return result; } + } else { + const result = await prompt.prompt(questions); + return result; + } } finally { this.unmuteStdout(); } } - public async getPassword(prompt: string, options?: IAllowEmpty): Promise { + public async getPassword(message: string, options?: IAllowEmpty): Promise { const schema: prompt.Question = { - message: prompt, + message, type: "password", name: "password", validate: (value: any) => { @@ -61,14 +61,14 @@ export class Prompter implements IPrompter { return result.password; } - public async getString(prompt: string, options?: IPrompterOptions): Promise { + public async getString(message: string, options?: IPrompterOptions): Promise { const schema: prompt.Question = { - message: prompt, + message, type: "input", name: "inputString", validate: (value: any) => { const doesNotAllowEmpty = options && _.has(options, "allowEmpty") && !options.allowEmpty; - return (doesNotAllowEmpty && !value) ? `${prompt} must be non-empty` : true; + return (doesNotAllowEmpty && !value) ? `${message} must be non-empty` : true; }, default: options && options.defaultAction }; @@ -109,12 +109,12 @@ export class Prompter implements IPrompter { return result.userAnswer; } - public async confirm(prompt: string, defaultAction?: () => boolean): Promise { + public async confirm(message: string, defaultAction?: () => boolean): Promise { const schema = { type: "confirm", name: "prompt", default: defaultAction, - message: prompt + message }; const result = await this.get([schema]); diff --git a/lib/common/services/message-contract-generator.ts b/lib/common/services/message-contract-generator.ts index 86952a6146..df03fbbee3 100644 --- a/lib/common/services/message-contract-generator.ts +++ b/lib/common/services/message-contract-generator.ts @@ -2,11 +2,8 @@ import { Block } from "../codeGeneration/code-entity"; import { CodePrinter } from "../codeGeneration/code-printer"; export class MessageContractGenerator implements IServiceContractGenerator { - private pendingModels: any; - constructor(private $fs: IFileSystem, private $messagesService: IMessagesService) { - this.pendingModels = {}; } public async generate(): Promise { diff --git a/lib/common/services/messages-service.ts b/lib/common/services/messages-service.ts index 872ae9b7f3..8c1bd92527 100644 --- a/lib/common/services/messages-service.ts +++ b/lib/common/services/messages-service.ts @@ -1,12 +1,12 @@ import * as util from "util"; -import * as path from "path"; +import { join } from "path"; export class MessagesService implements IMessagesService { private _pathsToMessageJsonFiles: string[] = null; private _messageJsonFilesContentsCache: any[] = null; private get pathToDefaultMessageJson(): string { - return path.join(__dirname, "..", "resources", "messages", "errorMessages.json"); + return join(__dirname, "..", "resources", "messages", "errorMessages.json"); } private get messageJsonFilesContents(): any[] { diff --git a/lib/common/services/net-service.ts b/lib/common/services/net-service.ts index 7fd98bda40..ec377e9702 100644 --- a/lib/common/services/net-service.ts +++ b/lib/common/services/net-service.ts @@ -10,7 +10,7 @@ export class Net implements INet { private $osInfo: IOsInfo) { } public async getFreePort(): Promise { - const server = net.createServer((sock: string) => { /* empty - noone will connect here */ }); + const server = net.createServer((sock: net.Socket) => { /* empty - noone will connect here */ }); return new Promise((resolve, reject) => { let isResolved = false; diff --git a/lib/common/test/unit-tests/android-log-filter.ts b/lib/common/test/unit-tests/android-log-filter.ts index 7f08ae1b2b..a2c96e889c 100644 --- a/lib/common/test/unit-tests/android-log-filter.ts +++ b/lib/common/test/unit-tests/android-log-filter.ts @@ -320,11 +320,11 @@ const androidApiLevel23MapForPid8141 = [ describe("androidLogFilter", () => { - const assertFiltering = (inputData: string, expectedOutput: string, logLevel?: string, pid?: string) => { + const assertFiltering = (inputData: string, expectedOutput: string, _logLevel?: string, _pid?: string) => { const testInjector = new Yok(); testInjector.register("loggingLevels", LoggingLevels); const androidLogFilter = testInjector.resolve(AndroidLogFilter); - const filteredData = androidLogFilter.filterData(inputData, { logLevel, applicationPid: pid }); + const filteredData = androidLogFilter.filterData(inputData, { logLevel: _logLevel, applicationPid: _pid }); assert.deepEqual(filteredData, expectedOutput, `The actual result '${filteredData}' did NOT match expected output '${expectedOutput}'.`); }; diff --git a/lib/common/test/unit-tests/ios-log-filter.ts b/lib/common/test/unit-tests/ios-log-filter.ts index a300ab6d89..4951e149c4 100644 --- a/lib/common/test/unit-tests/ios-log-filter.ts +++ b/lib/common/test/unit-tests/ios-log-filter.ts @@ -109,11 +109,11 @@ const iosTestData = [ describe("iOSLogFilter", () => { - const assertFiltering = (inputData: string, expectedOutput: string, logLevel?: string, pid?: string) => { + const assertFiltering = (inputData: string, expectedOutput: string, _logLevel?: string, _pid?: string) => { const testInjector = new Yok(); testInjector.register("loggingLevels", LoggingLevels); const iOSLogFilter = testInjector.resolve(IOSLogFilter); - const filteredData = iOSLogFilter.filterData(inputData, { logLevel, applicationPid: pid }); + const filteredData = iOSLogFilter.filterData(inputData, { logLevel: _logLevel, applicationPid: _pid }); assert.deepEqual(filteredData, expectedOutput, `The actual result '${filteredData}' did NOT match expected output '${expectedOutput}'.`); }; diff --git a/lib/common/test/unit-tests/mobile/android/logcat-helper.ts b/lib/common/test/unit-tests/mobile/android/logcat-helper.ts index 9420474510..4e8127fde8 100644 --- a/lib/common/test/unit-tests/mobile/android/logcat-helper.ts +++ b/lib/common/test/unit-tests/mobile/android/logcat-helper.ts @@ -53,10 +53,10 @@ function createTestInjector(): IInjector { injector.register("devicesService", { getDevice: (): Mobile.IDevice => { return { - deviceInfo: { - version: "9.0.0" - } - } ; + deviceInfo: { + version: "9.0.0" + } + }; } }); injector.register("devicePlatformsConstants", { Android: "Android" }); @@ -92,12 +92,12 @@ describe("logcat-helper", () => { const validIdentifier = "valid-identifier"; let injector: IInjector; let loggedData: string[]; - let childProcess: ChildProcessStub; + let childProcessStub: ChildProcessStub; beforeEach(() => { injector = createTestInjector(); loggedData = []; - childProcess = injector.resolve("childProcess"); + childProcessStub = injector.resolve("childProcess"); }); describe("start", () => { @@ -121,7 +121,7 @@ describe("logcat-helper", () => { logData(line: string, platform: string, deviceIdentifier: string): void { loggedData.push(line); if (line === "end") { - assert.include(childProcess.adbProcessArgs, `--pid=${expectedPid}`); + assert.include(childProcessStub.adbProcessArgs, `--pid=${expectedPid}`); done(); } } @@ -135,10 +135,10 @@ describe("logcat-helper", () => { injector.register("devicesService", { getDevice: (): Mobile.IDevice => { return { - deviceInfo: { - version: "6.0.0" - } - } ; + deviceInfo: { + version: "6.0.0" + } + }; } }); @@ -146,7 +146,7 @@ describe("logcat-helper", () => { logData(line: string, platform: string, deviceIdentifier: string): void { loggedData.push(line); if (line === "end") { - assert.notInclude(childProcess.adbProcessArgs, `--pid=${expectedPid}`); + assert.notInclude(childProcessStub.adbProcessArgs, `--pid=${expectedPid}`); done(); } } @@ -168,7 +168,7 @@ describe("logcat-helper", () => { deviceIdentifier: validIdentifier }); - assert.equal(childProcess.processSpawnCallCount, 1); + assert.equal(childProcessStub.processSpawnCallCount, 1); }); it("should start multiple logcat processes when called multiple times with different identifiers", async () => { @@ -184,7 +184,7 @@ describe("logcat-helper", () => { deviceIdentifier: `${validIdentifier}3` }); - assert.equal(childProcess.processSpawnCallCount, 3); + assert.equal(childProcessStub.processSpawnCallCount, 3); }); }); describe("stop", () => { @@ -194,13 +194,13 @@ describe("logcat-helper", () => { await logcatHelper.start({ deviceIdentifier: validIdentifier }); - assert.equal(childProcess.processSpawnCallCount, 1); + assert.equal(childProcessStub.processSpawnCallCount, 1); await logcatHelper.stop(validIdentifier); await logcatHelper.start({ deviceIdentifier: validIdentifier }); - assert.equal(childProcess.processSpawnCallCount, 2); + assert.equal(childProcessStub.processSpawnCallCount, 2); }); it("should kill the process just once if called multiple times", async () => { @@ -212,7 +212,7 @@ describe("logcat-helper", () => { await logcatHelper.stop(validIdentifier); await logcatHelper.stop(validIdentifier); - assert.equal(childProcess.processKillCallCount, 1); + assert.equal(childProcessStub.processKillCallCount, 1); }); it("should not kill the process if started with keepSingleProcess", async () => { @@ -225,7 +225,7 @@ describe("logcat-helper", () => { await logcatHelper.stop(validIdentifier); await logcatHelper.stop(validIdentifier); - assert.equal(childProcess.processKillCallCount, 0); + assert.equal(childProcessStub.processKillCallCount, 0); }); it("should do nothing if called without start", async () => { @@ -233,8 +233,8 @@ describe("logcat-helper", () => { await logcatHelper.stop(validIdentifier); - assert.equal(childProcess.processSpawnCallCount, 0); - assert.equal(childProcess.processKillCallCount, 0); + assert.equal(childProcessStub.processSpawnCallCount, 0); + assert.equal(childProcessStub.processKillCallCount, 0); }); }); }); diff --git a/lib/common/test/unit-tests/mobile/devices-service.ts b/lib/common/test/unit-tests/mobile/devices-service.ts index 6008bc6162..37bd61f4bf 100644 --- a/lib/common/test/unit-tests/mobile/devices-service.ts +++ b/lib/common/test/unit-tests/mobile/devices-service.ts @@ -1318,17 +1318,13 @@ describe("devicesService", () => { describe("ios simulator check", () => { let $iOSSimulatorDiscovery: Mobile.IDeviceDiscovery; let $hostInfo: IHostInfo; - let hasCheckedForIosSimulator: boolean; beforeEach(() => { $iOSSimulatorDiscovery = testInjector.resolve("iOSSimulatorDiscovery"); - ($iOSSimulatorDiscovery).checkForDevices = async (): Promise => { - hasCheckedForIosSimulator = true; - }; + ($iOSSimulatorDiscovery).checkForDevices = async (): Promise => { /** */ }; $hostInfo = testInjector.resolve("hostInfo"); $hostInfo.isDarwin = true; - hasCheckedForIosSimulator = false; }); it("should not throw if ios simulator check fails throws an exception.", async () => { diff --git a/lib/common/test/unit-tests/yok.ts b/lib/common/test/unit-tests/yok.ts index cb74502cf8..762ac2832c 100644 --- a/lib/common/test/unit-tests/yok.ts +++ b/lib/common/test/unit-tests/yok.ts @@ -269,7 +269,7 @@ describe("yok", () => { injector.register("foo", obj); class Test { - private foo: any; + public foo: any; constructor(foo: any) { this.foo = foo; @@ -288,8 +288,8 @@ describe("yok", () => { injector.register("foo", obj); class Test { - private foo: any; - private bar: any; + public foo: any; + public bar: any; constructor(foo: any, bar: any) { this.foo = foo; @@ -309,7 +309,7 @@ describe("yok", () => { injector.register("foo", obj); class Test { - private foo: any; + public foo: any; constructor(foo: any) { this.foo = foo; @@ -331,8 +331,8 @@ describe("yok", () => { injector.register("foo", obj); class Test { - private foo: any; - private bar: any; + public foo: any; + public bar: any; constructor(foo: any, bar: any) { this.foo = foo; @@ -354,7 +354,7 @@ describe("yok", () => { injector.register("foo", obj); class Test { - private foo: any; + public foo: any; constructor($foo: any) { this.foo = $foo; } @@ -381,7 +381,7 @@ describe("yok", () => { const injector = new Yok(); class Test { - private foo: any; + public foo: any; constructor() { this.foo = "foo"; } diff --git a/lib/helpers/livesync-command-helper.ts b/lib/helpers/livesync-command-helper.ts index 9a086ed61d..2d061a7c10 100644 --- a/lib/helpers/livesync-command-helper.ts +++ b/lib/helpers/livesync-command-helper.ts @@ -158,10 +158,10 @@ export class LiveSyncCommandHelper implements ILiveSyncCommandHelper { justlaunch: this.$options.justlaunch }; - const deployOptions = _.merge({ + const deployOptions = _.merge(({ projectDir: this.$projectData.projectDir, - clean: true, - }, this.$options.argv); + clean: true + }), this.$options.argv); const availablePlatforms = this.getPlatformsForOperation(platform); for (const currentPlatform of availablePlatforms) { diff --git a/lib/node-package-manager.ts b/lib/node-package-manager.ts index 39d0965661..beb17ae665 100644 --- a/lib/node-package-manager.ts +++ b/lib/node-package-manager.ts @@ -1,4 +1,4 @@ -import * as path from "path"; +import { join, relative } from "path"; import { BasePackageManager } from "./base-package-manager"; import { exported, cache } from "./common/decorators"; import { CACACHE_DIRECTORY_NAME } from "./constants"; @@ -24,7 +24,7 @@ export class NodePackageManager extends BasePackageManager { config["ignore-scripts"] = true; } - const packageJsonPath = path.join(pathToSave, "package.json"); + const packageJsonPath = join(pathToSave, "package.json"); const jsonContentBefore = this.$fs.readJson(packageJsonPath); const flags = this.getFlagsString(config, true); @@ -39,14 +39,14 @@ export class NodePackageManager extends BasePackageManager { // Npm creates `etc` directory in installation dir when --prefix is passed // https://github.com/npm/npm/issues/11486 // we should delete it if it was created because of us - const etcDirectoryLocation = path.join(cwd, "etc"); + const etcDirectoryLocation = join(cwd, "etc"); const etcExistsPriorToInstallation = this.$fs.exists(etcDirectoryLocation); //TODO: plamen5kov: workaround is here for a reason (remove whole file later) if (config.path) { let relativePathFromCwdToSource = ""; if (config.frameworkPath) { - relativePathFromCwdToSource = path.relative(config.frameworkPath, pathToSave); + relativePathFromCwdToSource = relative(config.frameworkPath, pathToSave); if (this.$fs.exists(relativePathFromCwdToSource)) { packageName = relativePathFromCwdToSource; } @@ -121,7 +121,7 @@ export class NodePackageManager extends BasePackageManager { @cache() public async getCachePath(): Promise { const cachePath = await this.$childProcess.exec(`npm config get cache`); - return path.join(cachePath.trim(), CACACHE_DIRECTORY_NAME); + return join(cachePath.trim(), CACACHE_DIRECTORY_NAME); } } diff --git a/lib/services/android-plugin-build-service.ts b/lib/services/android-plugin-build-service.ts index b7254d65f7..d2810a6db0 100644 --- a/lib/services/android-plugin-build-service.ts +++ b/lib/services/android-plugin-build-service.ts @@ -4,13 +4,6 @@ import { getShortPluginName, hook } from "../common/helpers"; import { Builder, parseString } from "xml2js"; export class AndroidPluginBuildService implements IAndroidPluginBuildService { - /** - * Required for hooks execution to work. - */ - private get $hooksService(): IHooksService { - return this.$injector.resolve("hooksService"); - } - private get $platformService(): IPlatformService { return this.$injector.resolve("platformService"); } @@ -25,7 +18,8 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService { private $projectDataService: IProjectDataService, private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, private $errors: IErrors, - private $filesHashService: IFilesHashService) { } + private $filesHashService: IFilesHashService, + public $hooksService: IHooksService) { } private static MANIFEST_ROOT = { $: { diff --git a/lib/services/app-files-updater.ts b/lib/services/app-files-updater.ts index 6a44c2113f..0e14011477 100644 --- a/lib/services/app-files-updater.ts +++ b/lib/services/app-files-updater.ts @@ -1,13 +1,14 @@ import * as path from "path"; import * as minimatch from "minimatch"; import * as constants from "../constants"; +// TODO: ?? import * as fs from "fs"; export class AppFilesUpdater { constructor(private appSourceDirectoryPath: string, private appDestinationDirectoryPath: string, public options: IAppFilesUpdaterOptions, - public fs: IFileSystem + public fileSystem: IFileSystem ) { } @@ -46,21 +47,21 @@ export class AppFilesUpdater { } protected readDestinationDir(): string[] { - if (this.fs.exists(this.appDestinationDirectoryPath)) { - return this.fs.readDirectory(this.appDestinationDirectoryPath); + if (this.fileSystem.exists(this.appDestinationDirectoryPath)) { + return this.fileSystem.readDirectory(this.appDestinationDirectoryPath); } else { return []; } } protected deleteDestinationItem(directoryItem: string): void { - this.fs.deleteDirectory(path.join(this.appDestinationDirectoryPath, directoryItem)); + this.fileSystem.deleteDirectory(path.join(this.appDestinationDirectoryPath, directoryItem)); } protected readSourceDir(projectData: IProjectData): string[] { const tnsDir = path.join(this.appSourceDirectoryPath, constants.TNS_MODULES_FOLDER_NAME); - return this.fs.enumerateFilesInDirectorySync(this.appSourceDirectoryPath, null, { includeEmptyDirectories: true }).filter(dirName => dirName !== tnsDir); + return this.fileSystem.enumerateFilesInDirectorySync(this.appSourceDirectoryPath, null, { includeEmptyDirectories: true }).filter(dirName => dirName !== tnsDir); } protected resolveAppSourceFiles(projectData: IProjectData): string[] { @@ -94,10 +95,10 @@ export class AppFilesUpdater { exists = fs.lstatSync(source); } if (exists.isDirectory()) { - return this.fs.createDirectory(destinationPath); + return this.fileSystem.createDirectory(destinationPath); } - return this.fs.copyFile(source, destinationPath); + return this.fileSystem.copyFile(source, destinationPath); }); } } diff --git a/lib/services/debug-service.ts b/lib/services/debug-service.ts index 0771c77376..3958df4f79 100644 --- a/lib/services/debug-service.ts +++ b/lib/services/debug-service.ts @@ -70,10 +70,10 @@ export class DebugService extends EventEmitter implements IDebugService { protected getDeviceDebugService(device: Mobile.IDevice): IDeviceDebugService { if (!this._platformDebugServices[device.deviceInfo.identifier]) { - const platform = device.deviceInfo.platform; - if (this.$mobileHelper.isiOSPlatform(platform)) { + const devicePlatform = device.deviceInfo.platform; + if (this.$mobileHelper.isiOSPlatform(devicePlatform)) { this._platformDebugServices[device.deviceInfo.identifier] = this.$injector.resolve("iOSDeviceDebugService", { device }); - } else if (this.$mobileHelper.isAndroidPlatform(platform)) { + } else if (this.$mobileHelper.isAndroidPlatform(devicePlatform)) { this._platformDebugServices[device.deviceInfo.identifier] = this.$injector.resolve("androidDeviceDebugService", { device }); } else { this.$errors.failWithoutHelp(DebugCommandErrors.UNSUPPORTED_DEVICE_OS_FOR_DEBUGGING); diff --git a/lib/services/init-service.ts b/lib/services/init-service.ts index 6f9f3dfca4..8a35b0af0f 100644 --- a/lib/services/init-service.ts +++ b/lib/services/init-service.ts @@ -107,7 +107,7 @@ export class InitService implements IInitService { } const allVersions: any = await this.$packageManager.view(packageName, { "versions": true }); - const versions = _.filter(allVersions, (version: string) => semver.gte(version, InitService.MIN_SUPPORTED_FRAMEWORK_VERSIONS[packageName])); + const versions = _.filter(allVersions, (v: string) => semver.gte(v, InitService.MIN_SUPPORTED_FRAMEWORK_VERSIONS[packageName])); if (versions.length === 1) { this.$logger.info(`Only ${versions[0]} version is available for ${packageName}.`); return this.buildVersionData(versions[0]); diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index 3af1eecc29..85960e4ec2 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -12,7 +12,7 @@ import * as temp from "temp"; import * as plist from "plist"; import { IOSProvisionService } from "./ios-provision-service"; import { IOSEntitlementsService } from "./ios-entitlements-service"; -import * as mobileprovision from "ios-mobileprovision-finder"; +import * as mobileProvisionFinder from "ios-mobileprovision-finder"; import { BUILD_XCCONFIG_FILE_NAME, IosProjectConstants } from "../constants"; interface INativeSourceCodeGroup { @@ -73,7 +73,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ appDestinationDirectoryPath: path.join(projectRoot, projectData.projectName), platformProjectService: this, projectRoot: projectRoot, - getBuildOutputPath: (options : IBuildOutputOptions): string => { + getBuildOutputPath: (options: IBuildOutputOptions): string => { const config = getConfigurationName(!options || options.release); return path.join(projectRoot, constants.BUILD_DIR, `${config}-${getPlatformSdkName(!options || options.buildForDevice)}`); }, @@ -387,7 +387,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ }); const instances = this.$devicesService.getDeviceInstances(); const devicesArchitectures = _(instances) - .filter(d => this.$mobileHelper.isiOSPlatform(d.deviceInfo.platform) && d.deviceInfo.activeArchitecture) + .filter(d => this.$mobileHelper.isiOSPlatform(d.deviceInfo.platform) && !!d.deviceInfo.activeArchitecture) .map(d => d.deviceInfo.activeArchitecture) .uniq() .value(); @@ -500,7 +500,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ } } - private async setupSigningFromProvision(projectRoot: string, projectData: IProjectData, provision?: string, mobileProvisionData?: mobileprovision.provision.MobileProvision): Promise { + private async setupSigningFromProvision(projectRoot: string, projectData: IProjectData, provision?: string, mobileProvisionData?: mobileProvisionFinder.provision.MobileProvision): Promise { if (provision) { const xcode = this.$pbxprojDomXcode.Xcode.open(this.getPbxProjPath(projectData)); const signing = xcode.getSigning(projectData.projectName); @@ -939,7 +939,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f } private savePbxProj(project: any, projectData: IProjectData, omitEmptyValues?: boolean): void { - return this.$fs.writeFile(this.getPbxProjPath(projectData), project.writeSync({omitEmptyValues})); + return this.$fs.writeFile(this.getPbxProjPath(projectData), project.writeSync({ omitEmptyValues })); } public async preparePluginNativeCode(pluginData: IPluginData, projectData: IProjectData, opts?: any): Promise { @@ -984,7 +984,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f } const pbxProjPath = this.getPbxProjPath(projectData); - this.$iOSExtensionsService.removeExtensions({pbxProjPath}); + this.$iOSExtensionsService.removeExtensions({ pbxProjPath }); await this.addExtensions(projectData); } public beforePrepareAllPlugins(): Promise { @@ -1108,7 +1108,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f ); const platformData = this.getPlatformData(projectData); const pbxProjPath = this.getPbxProjPath(projectData); - const addedExtensionsFromResources = await this.$iOSExtensionsService.addExtensionsFromPath({extensionsFolderPath: resorcesExtensionsPath, projectData, platformData, pbxProjPath}); + const addedExtensionsFromResources = await this.$iOSExtensionsService.addExtensionsFromPath({ extensionsFolderPath: resorcesExtensionsPath, projectData, platformData, pbxProjPath }); const plugins = await this.getAllInstalledPlugins(projectData); let addedExtensionsFromPlugins = false; for (const pluginIndex in plugins) { @@ -1116,7 +1116,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f const pluginPlatformsFolderPath = pluginData.pluginPlatformsFolderPath(IOSProjectService.IOS_PLATFORM_NAME); const extensionPath = path.join(pluginPlatformsFolderPath, constants.NATIVE_EXTENSION_FOLDER); - const addedExtensionFromPlugin = await this.$iOSExtensionsService.addExtensionsFromPath({extensionsFolderPath: extensionPath, projectData, platformData, pbxProjPath}); + const addedExtensionFromPlugin = await this.$iOSExtensionsService.addExtensionsFromPath({ extensionsFolderPath: extensionPath, projectData, platformData, pbxProjPath }); addedExtensionsFromPlugins = addedExtensionsFromPlugins || addedExtensionFromPlugin; } @@ -1369,7 +1369,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f private getExportOptionsMethod(projectData: IProjectData, archivePath: string): string { const embeddedMobileProvisionPath = path.join(archivePath, 'Products', 'Applications', `${projectData.projectName}.app`, "embedded.mobileprovision"); - const provision = mobileprovision.provision.readFromFile(embeddedMobileProvisionPath); + const provision = mobileProvisionFinder.provision.readFromFile(embeddedMobileProvisionPath); return { "Development": "development", diff --git a/lib/services/livesync/livesync-service.ts b/lib/services/livesync/livesync-service.ts index 6b7061f46b..fa1eb1502b 100644 --- a/lib/services/livesync/livesync-service.ts +++ b/lib/services/livesync/livesync-service.ts @@ -5,7 +5,6 @@ import { EventEmitter } from "events"; import { hook } from "../../common/helpers"; import { PACKAGE_JSON_FILE_NAME, - LiveSyncTrackActionNames, USER_INTERACTION_NEEDED_EVENT_NAME, DEBUGGER_ATTACHED_EVENT_NAME, DEBUGGER_DETACHED_EVENT_NAME, @@ -449,11 +448,9 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi { buildForDevice: !options.device.isEmulator, clean: options.liveSyncData && options.liveSyncData.clean }, options.deviceBuildInfoDescriptor.outputPath); let pathToBuildItem = null; - let action = LiveSyncTrackActionNames.LIVESYNC_OPERATION; if (shouldBuild) { pathToBuildItem = await options.deviceBuildInfoDescriptor.buildAction(); options.rebuiltInformation.push({ isEmulator: options.device.isEmulator, platform, pathToBuildItem }); - action = LiveSyncTrackActionNames.LIVESYNC_OPERATION_BUILD; } else { await this.$analyticsService.trackEventActionInGoogleAnalytics({ action: TrackActionNames.LiveSync, diff --git a/lib/services/livesync/platform-livesync-service-base.ts b/lib/services/livesync/platform-livesync-service-base.ts index f47aebf995..fac12ac588 100644 --- a/lib/services/livesync/platform-livesync-service-base.ts +++ b/lib/services/livesync/platform-livesync-service-base.ts @@ -76,7 +76,7 @@ export abstract class PlatformLiveSyncServiceBase { public async liveSyncWatchAction(device: Mobile.IDevice, liveSyncInfo: ILiveSyncWatchInfo): Promise { const projectData = liveSyncInfo.projectData; const deviceLiveSyncService = this.getDeviceLiveSyncService(device, projectData); - const syncInfo = _.merge({ device, watch: true }, liveSyncInfo); + const syncInfo = _.merge({ device, watch: true }, liveSyncInfo); const deviceAppData = await this.getAppData(syncInfo); if (deviceLiveSyncService.beforeLiveSyncAction) { diff --git a/lib/services/livesync/playground/devices/preview-devices-service.ts b/lib/services/livesync/playground/devices/preview-devices-service.ts index 66f674572e..8a46afb972 100644 --- a/lib/services/livesync/playground/devices/preview-devices-service.ts +++ b/lib/services/livesync/playground/devices/preview-devices-service.ts @@ -8,9 +8,9 @@ export class PreviewDevicesService extends EventEmitter implements IPreviewDevic constructor(private $previewAppLogProvider: IPreviewAppLogProvider, private $previewAppPluginsService: IPreviewAppPluginsService) { - super(); + super(); - this.initialize(); + this.initialize(); } public getConnectedDevices(): Device[] { @@ -19,11 +19,11 @@ export class PreviewDevicesService extends EventEmitter implements IPreviewDevic public updateConnectedDevices(devices: Device[]): void { _(devices) - .reject(d => _.find(this.connectedDevices, device => d.id === device.id)) + .reject(d => _.some(this.connectedDevices, device => d.id === device.id)) .each(device => this.raiseDeviceFound(device)); _(this.connectedDevices) - .reject(d => _.find(devices, device => d.id === device.id)) + .reject(d => _.some(devices, device => d.id === device.id)) .each(device => this.raiseDeviceLostAfterTimeout(device)); } diff --git a/lib/services/pacote-service.ts b/lib/services/pacote-service.ts index e69909931f..212bb706b4 100644 --- a/lib/services/pacote-service.ts +++ b/lib/services/pacote-service.ts @@ -66,8 +66,8 @@ export class PacoteService implements IPacoteService { private async getPacoteBaseOptions(): Promise { // In case `tns create myapp --template https://github.com/NativeScript/template-hello-world.git` command is executed, pacote module throws an error if cache option is not provided. - const cache = await this.$packageManager.getCachePath(); - const pacoteOptions = { cache }; + const cachePath = await this.$packageManager.getCachePath(); + const pacoteOptions = { cache: cachePath }; const proxySettings = await this.$proxyService.getCache(); if (proxySettings) { _.extend(pacoteOptions, proxySettings); diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index 495671210a..e481600407 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -15,12 +15,6 @@ temp.track(); const buildInfoFileName = ".nsbuildinfo"; export class PlatformService extends EventEmitter implements IPlatformService { - // Type with hooks needs to have either $hooksService or $injector injected. - // In order to stop TypeScript from failing for not used $hooksService, use it here. - private get _hooksService(): IHooksService { - return this.$hooksService; - } - constructor(private $devicesService: Mobile.IDevicesService, private $preparePlatformNativeService: IPreparePlatformService, private $preparePlatformJSService: IPreparePlatformService, @@ -31,7 +25,6 @@ export class PlatformService extends EventEmitter implements IPlatformService { private $packageInstallationManager: IPackageInstallationManager, private $platformsData: IPlatformsData, private $projectDataService: IProjectDataService, - private $hooksService: IHooksService, private $pluginsService: IPluginsService, private $projectFilesManager: IProjectFilesManager, private $mobileHelper: Mobile.IMobileHelper, @@ -42,7 +35,8 @@ export class PlatformService extends EventEmitter implements IPlatformService { private $analyticsService: IAnalyticsService, private $terminalSpinnerService: ITerminalSpinnerService, private $pacoteService: IPacoteService, - private $usbLiveSyncService: any + private $usbLiveSyncService: any, + public $hooksService: IHooksService ) { super(); } diff --git a/lib/services/prepare-platform-service.ts b/lib/services/prepare-platform-service.ts index 8f05199c4d..f6553e37b4 100644 --- a/lib/services/prepare-platform-service.ts +++ b/lib/services/prepare-platform-service.ts @@ -3,14 +3,8 @@ import * as path from "path"; import { AppFilesUpdater } from "./app-files-updater"; export class PreparePlatformService { - // Type with hooks needs to have either $hooksService or $injector injected. - // In order to stop TypeScript from failing for not used $hooksService, use it here. - private get _hooksService(): IHooksService { - return this.$hooksService; - } - constructor(protected $fs: IFileSystem, - private $hooksService: IHooksService, + public $hooksService: IHooksService, private $xmlValidator: IXmlValidator) { } diff --git a/lib/services/project-changes-service.ts b/lib/services/project-changes-service.ts index 5ee4b39c08..82d96bd384 100644 --- a/lib/services/project-changes-service.ts +++ b/lib/services/project-changes-service.ts @@ -45,17 +45,13 @@ export class ProjectChangesService implements IProjectChangesService { private _outputProjectMtime: number; private _outputProjectCTime: number; - private get $hooksService(): IHooksService { - return this.$injector.resolve("hooksService"); - } - constructor( private $platformsData: IPlatformsData, private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, private $fs: IFileSystem, private $filesHashService: IFilesHashService, private $logger: ILogger, - private $injector: IInjector) { + public $hooksService: IHooksService) { } public get currentChanges(): IProjectChangesInfo { diff --git a/lib/services/project-service.ts b/lib/services/project-service.ts index 3fc3cfd6cd..d9d1adb3b8 100644 --- a/lib/services/project-service.ts +++ b/lib/services/project-service.ts @@ -232,7 +232,7 @@ export class ProjectService implements IProjectService { const packageJsonData = this.$fs.readJson(projectFilePath); // Remove the metadata keys from the package.json - let updatedPackageJsonData = _.omitBy(packageJsonData, (value: any, key: string) => _.startsWith(key, "_") || TemplatesV2PackageJsonKeysToRemove.indexOf(key) !== -1); + let updatedPackageJsonData = _.omitBy(packageJsonData, (value: any, key: string) => _.startsWith(key, "_") || TemplatesV2PackageJsonKeysToRemove.indexOf(key) !== -1); updatedPackageJsonData = _.merge(updatedPackageJsonData, this.packageJsonDefaultData); if (updatedPackageJsonData.nativescript && updatedPackageJsonData.nativescript.templateVersion) { diff --git a/lib/services/subscription-service.ts b/lib/services/subscription-service.ts index bc35bfc3eb..f0e7893019 100644 --- a/lib/services/subscription-service.ts +++ b/lib/services/subscription-service.ts @@ -31,9 +31,9 @@ export class SubscriptionService implements ISubscriptionService { return helpers.isInteractive() && process.env.CLI_NOPROMPT !== "1" && !(await this.$userSettingsService.getSettingValue("EMAIL_REGISTERED")); } - private async getEmail(prompt: string, options?: IPrompterOptions): Promise { + private async getEmail(message: string, options?: IPrompterOptions): Promise { const schema: prompt.Question = { - message: prompt, + message, type: "input", name: "inputEmail", validate: (value: any) => { diff --git a/lib/yarn-package-manager.ts b/lib/yarn-package-manager.ts index 81bf79ac44..d4c9224e87 100644 --- a/lib/yarn-package-manager.ts +++ b/lib/yarn-package-manager.ts @@ -48,9 +48,9 @@ export class YarnPackageManager extends BasePackageManager { } @exported("yarn") - public uninstall(packageName: string, config?: IDictionary, path?: string): Promise { + public uninstall(packageName: string, config?: IDictionary, cwd?: string): Promise { const flags = this.getFlagsString(config, false); - return this.$childProcess.exec(`yarn remove ${packageName} ${flags}`, { cwd: path }); + return this.$childProcess.exec(`yarn remove ${packageName} ${flags}`, { cwd }); } @exported("yarn") diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 65a6cd21ec..a17b2b510c 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -133,9 +133,9 @@ } }, "@types/lodash": { - "version": "4.14.116", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.116.tgz", - "integrity": "sha512-lRnAtKnxMXcYYXqOiotTmJd74uawNWuPnsnPrrO7HiFuE3npE2iQhfABatbYDyxTNqZNuXzcKGhw37R7RjBFLg==", + "version": "4.14.123", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.123.tgz", + "integrity": "sha512-pQvPkc4Nltyx7G1Ww45OjVqUsJP4UsZm+GWJpigXgkikZqJgRm4c48g027o6tdgubWHwFRF15iFd+Y4Pmqv6+Q==", "dev": true }, "@types/node": { @@ -893,6 +893,12 @@ "resolved": "https://registry.npmjs.org/bufferpack/-/bufferpack-0.0.6.tgz", "integrity": "sha1-+z2HOKDh5OA7z/mfmnX57Bip1z4=" }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, "builtins": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", @@ -1388,15 +1394,15 @@ } }, "csproj2ts": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/csproj2ts/-/csproj2ts-0.0.8.tgz", - "integrity": "sha1-nRxxniDELM6MTeKQCO/DVUn9Em8=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/csproj2ts/-/csproj2ts-1.1.0.tgz", + "integrity": "sha512-sk0RTT51t4lUNQ7UfZrqjQx7q4g0m3iwNA6mvyh7gLsgQYvwKzfdyoAgicC9GqJvkoIkU0UmndV9c7VZ8pJ45Q==", "dev": true, "requires": { - "es6-promise": "^4.0.5", + "es6-promise": "^4.1.1", "lodash": "^4.17.4", - "semver": "^5.3.0", - "xml2js": "^0.4.17" + "semver": "^5.4.1", + "xml2js": "^0.4.19" }, "dependencies": { "es6-promise": { @@ -2143,57 +2149,6 @@ } } }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "^2.1.0" - }, - "dependencies": { - "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", - "dev": true, - "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - } - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -2373,12 +2328,6 @@ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -2501,15 +2450,6 @@ "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -3213,42 +3153,6 @@ } } }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -3604,155 +3508,30 @@ "dev": true }, "grunt-ts": { - "version": "6.0.0-beta.16", - "resolved": "https://registry.npmjs.org/grunt-ts/-/grunt-ts-6.0.0-beta.16.tgz", - "integrity": "sha1-wC9P+cgRAE7suTOJBaBds/hpIMM=", + "version": "6.0.0-beta.22", + "resolved": "https://registry.npmjs.org/grunt-ts/-/grunt-ts-6.0.0-beta.22.tgz", + "integrity": "sha512-g9e+ZImQ7W38dfpwhp0+GUltXWidy3YGPfIA/IyGL5HMv6wmVmMMoSgscI5swhs2HSPf8yAvXAAJbwrouijoRg==", "dev": true, "requires": { - "chokidar": "^1.6.1", - "csproj2ts": "^0.0.8", + "chokidar": "^2.0.4", + "csproj2ts": "^1.1.0", "detect-indent": "^4.0.0", "detect-newline": "^2.1.0", "es6-promise": "~0.1.1", "jsmin2": "^1.2.1", - "lodash": "^4.17.4", + "lodash": "~4.17.10", "ncp": "0.5.1", "rimraf": "2.2.6", "semver": "^5.3.0", "strip-bom": "^2.0.0" }, "dependencies": { - "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", - "dev": true, - "requires": { - "micromatch": "^2.1.5", - "normalize-path": "^2.0.0" - } - }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", - "dev": true, - "requires": { - "anymatch": "^1.3.0", - "async-each": "^1.0.0", - "fsevents": "^1.0.0", - "glob-parent": "^2.0.0", - "inherits": "^2.0.1", - "is-binary-path": "^1.0.0", - "is-glob": "^2.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0" - } - }, "es6-promise": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-0.1.2.tgz", "integrity": "sha1-8RLCn+paCZhTn8tqL9IUQ9KPBfc=", "dev": true }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - }, "rimraf": { "version": "2.2.6", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.6.tgz", @@ -4405,21 +4184,6 @@ } } }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -4514,18 +4278,6 @@ "isobject": "^3.0.1" } }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", @@ -5227,12 +4979,6 @@ } } }, - "math-random": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", - "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", - "dev": true - }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -5641,6 +5387,33 @@ "pubnub": "4.21.2", "shortid": "2.2.12", "tslint": "5.4.3" + }, + "dependencies": { + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "tslint": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.4.3.tgz", + "integrity": "sha1-dhyEArgONHt3M6BDkKdXslNYBGc=", + "requires": { + "babel-code-frame": "^6.22.0", + "colors": "^1.1.2", + "commander": "^2.9.0", + "diff": "^3.2.0", + "glob": "^7.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.7.1", + "tsutils": "^2.3.0" + } + } } }, "natural-compare": { @@ -5847,16 +5620,6 @@ "isobject": "^3.0.0" } }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - } - }, "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -6181,35 +5944,6 @@ "xml2js": "^0.4.5" } }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, "parse-headers": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.2.tgz", @@ -6447,12 +6181,6 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, "process": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", @@ -6639,25 +6367,6 @@ "strict-uri-encode": "^1.0.0" } }, - "randomatic": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", - "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, "raw-body": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", @@ -6802,15 +6511,6 @@ } } }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -7913,36 +7613,70 @@ "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" }, "tslint": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.4.3.tgz", - "integrity": "sha1-dhyEArgONHt3M6BDkKdXslNYBGc=", + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", + "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", + "dev": true, "requires": { "babel-code-frame": "^6.22.0", - "colors": "^1.1.2", - "commander": "^2.9.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", "diff": "^3.2.0", "glob": "^7.1.1", + "js-yaml": "^3.7.0", "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", "resolve": "^1.3.2", "semver": "^5.3.0", - "tslib": "^1.7.1", - "tsutils": "^2.3.0" + "tslib": "^1.8.0", + "tsutils": "^2.29.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { "brace-expansion": "^1.1.7" } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, "tslint-microsoft-contrib": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/tslint-microsoft-contrib/-/tslint-microsoft-contrib-5.2.1.tgz", - "integrity": "sha512-PDYjvpo0gN9IfMULwKk0KpVOPMhU6cNoT9VwCOLeDl/QS8v8W2yspRpFFuUS7/c5EIH/n8ApMi8TxJAz1tfFUA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/tslint-microsoft-contrib/-/tslint-microsoft-contrib-6.1.0.tgz", + "integrity": "sha512-8DgmiPTgNQSYTjrKKv/h1aHnDd7EkGAjTxatrjfSDp5jUXENGI7Qj7qi7T8xBdTZN9Z3nb80u0NhdBBOMcQFHg==", "dev": true, "requires": { "tsutils": "^2.27.2 <2.29.0" @@ -8010,9 +7744,9 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "typescript": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.4.1.tgz", - "integrity": "sha1-w8yxbdqgsjFN4DHn5v7onlujRrw=", + "version": "3.3.4000", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", + "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index ca52a2833a..e5fe2f4fe8 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,9 @@ "postpack": "grunt set_dev_ga_id", "mocha": "mocha", "tsc": "tsc", - "tslint": "tslint -p tsconfig.json --type-check", + "tslint": "tslint -p tsconfig.json", "test-watch": "node ./dev/tsc-to-mocha-watch.js", - "tslint-fix": "tslint -p tsconfig.json --type-check --fix" + "tslint-fix": "tslint -p tsconfig.json --fix" }, "repository": { "type": "git", @@ -96,7 +96,7 @@ "@types/chokidar": "1.6.0", "@types/color": "3.0.0", "@types/inquirer": "0.0.43", - "@types/lodash": "4.14.116", + "@types/lodash": "4.14.123", "@types/node": "8.10.30", "@types/ora": "1.3.3", "@types/proper-lockfile": "3.0.1", @@ -118,16 +118,16 @@ "grunt-contrib-watch": "1.0.0", "grunt-shell": "1.3.0", "grunt-template": "1.0.0", - "grunt-ts": "6.0.0-beta.16", + "grunt-ts": "6.0.0-beta.22", "istanbul": "0.4.5", "latest-version": "4.0.0", "mocha": "3.1.2", "should": "7.0.2", "sinon": "4.1.2", "source-map-support": "0.5.3", - "tslint": "5.4.3", - "tslint-microsoft-contrib": "5.2.1", - "typescript": "2.4.1" + "tslint": "5.14.0", + "tslint-microsoft-contrib": "6.1.0", + "typescript": "3.3.4000" }, "license": "Apache-2.0", "engines": { diff --git a/test/cocoapods-service.ts b/test/cocoapods-service.ts index 1fd9105ee0..03deeef262 100644 --- a/test/cocoapods-service.ts +++ b/test/cocoapods-service.ts @@ -70,7 +70,7 @@ describe("Cocoapods service", () => { newPodfileContent = content; }; - fs.deleteFile = (path: string): void => { + fs.deleteFile = (pathToFile: string): void => { newPodfileContent = null; projectPodfileContent = null; }; diff --git a/test/debug.ts b/test/debug.ts index dea3766f9b..a3de9409d4 100644 --- a/test/debug.ts +++ b/test/debug.ts @@ -100,7 +100,7 @@ describe("debug command tests", () => { const childProcess: stubs.ChildProcessStub = testInjector.resolve("childProcess"); const androidProjectService: IPlatformProjectService = testInjector.resolve("androidProjectService"); - androidProjectService.getPlatformData = (projectData: IProjectData): IPlatformData => { + androidProjectService.getPlatformData = (_projectData: IProjectData): IPlatformData => { return platformData; }; const projectData: IProjectData = testInjector.resolve("projectData"); diff --git a/test/ios-entitlements-service.ts b/test/ios-entitlements-service.ts index 7c2b7314be..95d7c17b6e 100644 --- a/test/ios-entitlements-service.ts +++ b/test/ios-entitlements-service.ts @@ -35,7 +35,6 @@ describe("IOSEntitlements Service Tests", () => { }; let injector: IInjector; - let platformsData: any; let projectData: IProjectData; let fs: IFileSystem; let iOSEntitlementsService: IOSEntitlementsService; @@ -44,7 +43,6 @@ describe("IOSEntitlements Service Tests", () => { beforeEach(() => { injector = createTestInjector(); - platformsData = injector.resolve("platformsData"); projectData = injector.resolve("projectData"); projectData.projectName = 'testApp'; diff --git a/test/ios-project-service.ts b/test/ios-project-service.ts index 62a02b836b..74468e6e6b 100644 --- a/test/ios-project-service.ts +++ b/test/ios-project-service.ts @@ -1,4 +1,4 @@ -import * as path from "path"; +import { join, resolve, dirname, basename, extname } from "path"; import { EOL } from "os"; import * as ChildProcessLib from "../lib/common/child-process"; import * as ConfigLib from "../lib/config"; @@ -49,7 +49,7 @@ class IOSSimulatorDiscoveryMock extends DeviceDiscovery { } } -function createTestInjector(projectPath: string, projectName: string, xcode?: IXcode): IInjector { +function createTestInjector(projectPath: string, projectName: string, xCode?: IXcode): IInjector { const testInjector = new yok.Yok(); testInjector.register("childProcess", ChildProcessLib.ChildProcess); testInjector.register("config", ConfigLib.Configuration); @@ -68,10 +68,10 @@ function createTestInjector(projectPath: string, projectName: string, xcode?: IX testInjector.register("options", OptionsLib.Options); testInjector.register("cocoaPodsPlatformManager", CocoaPodsPlatformManager); const projectData = Object.assign({}, ProjectDataStub, { - platformsDir: path.join(projectPath, "platforms"), + platformsDir: join(projectPath, "platforms"), projectName: projectName, projectPath: projectPath, - projectFilePath: path.join(projectPath, "package.json"), + projectFilePath: join(projectPath, "package.json"), projectId: "", projectIdentifiers: { android: "", ios: "" }, projectDir: "", @@ -80,8 +80,8 @@ function createTestInjector(projectPath: string, projectName: string, xcode?: IX getAppResourcesDirectoryPath: () => "" }); projectData.projectDir = temp.mkdirSync("projectDir"); - projectData.appDirectoryPath = path.join(projectData.projectDir, "app"); - projectData.appResourcesDirectoryPath = path.join(projectData.appDirectoryPath, "App_Resources"); + projectData.appDirectoryPath = join(projectData.projectDir, "app"); + projectData.appResourcesDirectoryPath = join(projectData.appDirectoryPath, "App_Resources"); testInjector.register("projectData", projectData); testInjector.register("projectHelper", {}); testInjector.register("xcodeSelectService", {}); @@ -108,7 +108,7 @@ function createTestInjector(projectPath: string, projectName: string, xcode?: IX }; }, getXcodeprojPath: (projData: IProjectData, platformData: IPlatformData) => { - return path.join(platformData.projectRoot, projData.projectName + ".xcodeproj"); + return join(platformData.projectRoot, projData.projectName + ".xcodeproj"); }, checkIfXcodeprojIsRequired: () => ({}) }); @@ -124,7 +124,7 @@ function createTestInjector(projectPath: string, projectName: string, xcode?: IX getXcodeVersion: async () => "" }); testInjector.register("pbxprojDomXcode", {}); - testInjector.register("xcode", xcode || { + testInjector.register("xcode", xCode || { project: class { constructor() { /* */ } parseSync() { /* */ } @@ -177,7 +177,7 @@ function createPackageJson(testInjector: IInjector, projectPath: string, project } } }; - testInjector.resolve("fs").writeJson(path.join(projectPath, "package.json"), packageJsonData); + testInjector.resolve("fs").writeJson(join(projectPath, "package.json"), packageJsonData); } function expectOption(args: string[], option: string, value: string, message?: string): void { @@ -216,15 +216,15 @@ describe("iOSProjectService", () => { xcodebuildExeced = true; if (hasCustomArchivePath) { - archivePath = path.resolve(options.archivePath); + archivePath = resolve(options.archivePath); } else { - archivePath = path.join(projectPath, "platforms", "ios", "build", "Release-iphoneos", projectName + ".xcarchive"); + archivePath = join(projectPath, "platforms", "ios", "build", "Release-iphoneos", projectName + ".xcarchive"); } assert.ok(args.indexOf("archive") >= 0, "Expected xcodebuild to be executed with archive param."); expectOption(args, "-archivePath", archivePath, hasCustomArchivePath ? "Wrong path passed to xcarchive" : "exports xcodearchive to platforms/ios/build/archive."); - expectOption(args, "-project", path.join(projectPath, "platforms", "ios", projectName + ".xcodeproj"), "Path to Xcode project is wrong."); + expectOption(args, "-project", join(projectPath, "platforms", "ios", projectName + ".xcodeproj"), "Path to Xcode project is wrong."); expectOption(args, "-scheme", projectName, "The provided scheme is wrong."); return Promise.resolve(); @@ -304,7 +304,7 @@ describe("iOSProjectService", () => { const iOSProjectService = testInjector.resolve("iOSProjectService"); const projectData: IProjectData = testInjector.resolve("projectData"); - const archivePath = path.join(projectPath, "platforms", "ios", "build", "archive", projectName + ".xcarchive"); + const archivePath = join(projectPath, "platforms", "ios", "build", "archive", projectName + ".xcarchive"); const childProcess = testInjector.resolve("childProcess"); const fs = testInjector.resolve("fs"); @@ -318,7 +318,7 @@ describe("iOSProjectService", () => { assert.ok(args.indexOf("-exportArchive") >= 0, "Expected -exportArchive to be set on xcodebuild."); expectOption(args, "-archivePath", archivePath, "Expected the -archivePath to be passed to xcodebuild."); - expectOption(args, "-exportPath", path.join(projectPath, "platforms", "ios", "build", "archive"), "Expected the -archivePath to be passed to xcodebuild."); + expectOption(args, "-exportPath", join(projectPath, "platforms", "ios", "build", "archive"), "Expected the -archivePath to be passed to xcodebuild."); const plist = readOption(args, "-exportOptionsPlist"); assert.ok(plist); @@ -331,7 +331,7 @@ describe("iOSProjectService", () => { }; const resultIpa = await iOSProjectService.exportArchive(projectData, { archivePath, teamID: options.teamID }); - const expectedIpa = path.join(projectPath, "platforms", "ios", "build", "archive", projectName + ".ipa"); + const expectedIpa = join(projectPath, "platforms", "ios", "build", "archive", projectName + ".ipa"); assert.equal(resultIpa, expectedIpa, "Expected IPA at the specified location"); @@ -374,9 +374,9 @@ describe("Cocoapods support", () => { } } }; - fs.writeJson(path.join(projectPath, "package.json"), packageJsonData); + fs.writeJson(join(projectPath, "package.json"), packageJsonData); - const platformsFolderPath = path.join(projectPath, "platforms", "ios"); + const platformsFolderPath = join(projectPath, "platforms", "ios"); fs.createDirectory(platformsFolderPath); const iOSProjectService = testInjector.resolve("iOSProjectService"); @@ -391,7 +391,7 @@ describe("Cocoapods support", () => { const projectData: IProjectData = testInjector.resolve("projectData"); const basePodfileModuleName = "BasePodfile"; - const basePodfilePath = path.join(projectData.appDirectoryPath, "App_Resources", "iOS", "Podfile"); + const basePodfilePath = join(projectData.appDirectoryPath, "App_Resources", "iOS", "Podfile"); const pluginPodfileContent = ["source 'https://github.com/CocoaPods/Specs.git'", "platform :ios, '8.1'", "pod 'GoogleMaps'"].join("\n"); fs.writeFile(basePodfilePath, pluginPodfileContent); @@ -399,7 +399,7 @@ describe("Cocoapods support", () => { await cocoapodsService.applyPodfileToProject(basePodfileModuleName, basePodfilePath, projectData, iOSProjectService.getPlatformData(projectData).projectRoot); - const projectPodfilePath = path.join(platformsFolderPath, "Podfile"); + const projectPodfilePath = join(platformsFolderPath, "Podfile"); assert.isTrue(fs.exists(projectPodfilePath), `File ${projectPodfilePath} must exist as we have already applied Podfile to it.`); const actualProjectPodfileContent = fs.readText(projectPodfilePath); @@ -442,9 +442,9 @@ describe("Cocoapods support", () => { } } }; - fs.writeJson(path.join(projectPath, "package.json"), packageJsonData); + fs.writeJson(join(projectPath, "package.json"), packageJsonData); - const platformsFolderPath = path.join(projectPath, "platforms", "ios"); + const platformsFolderPath = join(projectPath, "platforms", "ios"); fs.createDirectory(platformsFolderPath); const iOSProjectService = testInjector.resolve("iOSProjectService"); @@ -463,21 +463,21 @@ describe("Cocoapods support", () => { iOSProjectService.savePbxProj = (): Promise => Promise.resolve(); const pluginPath = temp.mkdirSync("pluginDirectory"); - const pluginPlatformsFolderPath = path.join(pluginPath, "platforms", "ios"); - const pluginPodfilePath = path.join(pluginPlatformsFolderPath, "Podfile"); + const samplePluginPlatformsFolderPath = join(pluginPath, "platforms", "ios"); + const pluginPodfilePath = join(samplePluginPlatformsFolderPath, "Podfile"); const pluginPodfileContent = ["source 'https://github.com/CocoaPods/Specs.git'", "platform :ios, '8.1'", "pod 'GoogleMaps'"].join("\n"); fs.writeFile(pluginPodfilePath, pluginPodfileContent); - const pluginData = { + const samplePluginData = { pluginPlatformsFolderPath(platform: string): string { - return pluginPlatformsFolderPath; + return samplePluginPlatformsFolderPath; } }; const projectData: IProjectData = testInjector.resolve("projectData"); - await iOSProjectService.preparePluginNativeCode(pluginData, projectData); + await iOSProjectService.preparePluginNativeCode(samplePluginData, projectData); - const projectPodfilePath = path.join(platformsFolderPath, "Podfile"); + const projectPodfilePath = join(platformsFolderPath, "Podfile"); assert.isTrue(fs.exists(projectPodfilePath)); const actualProjectPodfileContent = fs.readText(projectPodfilePath); @@ -514,22 +514,22 @@ describe("Cocoapods support", () => { } } }; - fs.writeJson(path.join(projectPath, "package.json"), packageJsonData); + fs.writeJson(join(projectPath, "package.json"), packageJsonData); - const platformsFolderPath = path.join(projectPath, "platforms", "ios"); + const platformsFolderPath = join(projectPath, "platforms", "ios"); fs.createDirectory(platformsFolderPath); const iOSProjectService = testInjector.resolve("iOSProjectService"); - iOSProjectService.prepareFrameworks = (pluginPlatformsFolderPath: string, pluginData: IPluginData): Promise => { + iOSProjectService.prepareFrameworks = (pluginPlatformsPath: string, pluginData: IPluginData): Promise => { return Promise.resolve(); }; - iOSProjectService.prepareStaticLibs = (pluginPlatformsFolderPath: string, pluginData: IPluginData): Promise => { + iOSProjectService.prepareStaticLibs = (pluginPlatformsPath: string, pluginData: IPluginData): Promise => { return Promise.resolve(); }; - iOSProjectService.removeFrameworks = (pluginPlatformsFolderPath: string, pluginData: IPluginData): Promise => { + iOSProjectService.removeFrameworks = (pluginPlatformsPath: string, pluginData: IPluginData): Promise => { return Promise.resolve(); }; - iOSProjectService.removeStaticLibs = (pluginPlatformsFolderPath: string, pluginData: IPluginData): Promise => { + iOSProjectService.removeStaticLibs = (pluginPlatformsPath: string, pluginData: IPluginData): Promise => { return Promise.resolve(); }; iOSProjectService.createPbxProj = () => { @@ -543,23 +543,23 @@ describe("Cocoapods support", () => { iOSProjectService.savePbxProj = (): Promise => Promise.resolve(); const pluginPath = temp.mkdirSync("pluginDirectory"); - const pluginPlatformsFolderPath = path.join(pluginPath, "platforms", "ios"); - const pluginPodfilePath = path.join(pluginPlatformsFolderPath, "Podfile"); + const samplePluginPlatformsFolderPath = join(pluginPath, "platforms", "ios"); + const pluginPodfilePath = join(samplePluginPlatformsFolderPath, "Podfile"); const pluginPodfileContent = ["source 'https://github.com/CocoaPods/Specs.git'", "platform :ios, '8.1'", "pod 'GoogleMaps'"].join("\n"); fs.writeFile(pluginPodfilePath, pluginPodfileContent); - const pluginData = { + const samplePluginData = { pluginPlatformsFolderPath(platform: string): string { - return pluginPlatformsFolderPath; + return samplePluginPlatformsFolderPath; }, name: "pluginName", fullPath: "fullPath" }; const projectData: IProjectData = testInjector.resolve("projectData"); - await iOSProjectService.preparePluginNativeCode(pluginData, projectData); + await iOSProjectService.preparePluginNativeCode(samplePluginData, projectData); - const projectPodfilePath = path.join(platformsFolderPath, "Podfile"); + const projectPodfilePath = join(platformsFolderPath, "Podfile"); assert.isTrue(fs.exists(projectPodfilePath)); const actualProjectPodfileContent = fs.readText(projectPodfilePath); @@ -579,7 +579,7 @@ describe("Cocoapods support", () => { .join("\n"); assert.equal(actualProjectPodfileContent, expectedProjectPodfileContent); - await iOSProjectService.removePluginNativeCode(pluginData, projectData); + await iOSProjectService.removePluginNativeCode(samplePluginData, projectData); assert.isFalse(fs.exists(projectPodfilePath)); }); @@ -608,14 +608,14 @@ describe("Source code support", () => { } } }; - fs.writeJson(path.join(projectPath, "package.json"), packageJsonData); + fs.writeJson(join(projectPath, "package.json"), packageJsonData); - const platformsFolderPath = path.join(projectPath, "platforms", "ios"); + const platformsFolderPath = join(projectPath, "platforms", "ios"); fs.createDirectory(platformsFolderPath); const xcprojService = testInjector.resolve("xcprojService"); xcprojService.getXcodeprojPath = () => { - return path.join(__dirname, "files"); + return join(__dirname, "files"); }; const iOSProjectService = testInjector.resolve("iOSProjectService"); @@ -627,11 +627,11 @@ describe("Source code support", () => { const projectData: IProjectData = testInjector.resolve("projectData"); - const platformSpecificAppResourcesPath = path.join(projectData.appResourcesDirectoryPath, iOSProjectService.getPlatformData(projectData).normalizedPlatformName); + const platformSpecificAppResourcesPath = join(projectData.appResourcesDirectoryPath, iOSProjectService.getPlatformData(projectData).normalizedPlatformName); files.forEach(file => { - const fullPath = path.join(platformSpecificAppResourcesPath, file); - fs.createDirectory(path.dirname(fullPath)); + const fullPath = join(platformSpecificAppResourcesPath, file); + fs.createDirectory(dirname(fullPath)); fs.writeFile(fullPath, ""); }); @@ -657,9 +657,9 @@ describe("Source code support", () => { } } }; - fs.writeJson(path.join(projectPath, "package.json"), packageJsonData); + fs.writeJson(join(projectPath, "package.json"), packageJsonData); - const platformsFolderPath = path.join(projectPath, "platforms", "ios"); + const platformsFolderPath = join(projectPath, "platforms", "ios"); fs.createDirectory(platformsFolderPath); const iOSProjectService = testInjector.resolve("iOSProjectService"); @@ -674,7 +674,7 @@ describe("Source code support", () => { const xcprojService = testInjector.resolve("xcprojService"); xcprojService.getXcodeprojPath = () => { - return path.join(__dirname, "files"); + return join(__dirname, "files"); }; let pbxProj: any; @@ -684,24 +684,24 @@ describe("Source code support", () => { }; const pluginPath = temp.mkdirSync("pluginDirectory"); - const pluginPlatformsFolderPath = path.join(pluginPath, "platforms", "ios"); + const samplePluginPlatformsFolderPath = join(pluginPath, "platforms", "ios"); files.forEach(file => { - const fullPath = path.join(pluginPlatformsFolderPath, file); - fs.createDirectory(path.dirname(fullPath)); + const fullPath = join(samplePluginPlatformsFolderPath, file); + fs.createDirectory(dirname(fullPath)); fs.writeFile(fullPath, ""); }); - const pluginData = { + const samplePluginData = { name: "testPlugin", pluginPlatformsFolderPath(platform: string): string { - return pluginPlatformsFolderPath; + return samplePluginPlatformsFolderPath; } }; const projectData: IProjectData = testInjector.resolve("projectData"); // Act - await iOSProjectService.preparePluginNativeCode(pluginData, projectData); + await iOSProjectService.preparePluginNativeCode(samplePluginData, projectData); return pbxProj; }; @@ -719,7 +719,7 @@ describe("Source code support", () => { const testInjector = createTestInjector(projectPath, projectName, xcode); const fs: IFileSystem = testInjector.resolve("fs"); - const platformsFolderPath = path.join(projectPath, "platforms", "ios"); + const platformsFolderPath = join(projectPath, "platforms", "ios"); fs.createDirectory(platformsFolderPath); const pbxProj = await await getProjectWithoutPlugins(sourceFileNames); @@ -728,17 +728,17 @@ describe("Source code support", () => { const pbxFileReferenceValues = Object.keys(pbxFileReference).map(key => pbxFileReference[key]); const buildPhaseFiles = pbxProj.hash.project.objects.PBXSourcesBuildPhase["858B83F218CA22B800AB12DE"].files; - sourceFileNames.map(file => path.basename(file)).forEach(basename => { - const ext = path.extname(basename); + sourceFileNames.map(file => basename(file)).forEach(baseName => { + const ext = extname(baseName); const shouldBeAdded = ext !== ".donotadd"; - assert.notEqual(pbxFileReferenceValues.indexOf(basename), -1, `${basename} not added to PBXFileRefereces`); + assert.notEqual(pbxFileReferenceValues.indexOf(baseName), -1, `${baseName} not added to PBXFileRefereces`); - const buildPhaseFile = buildPhaseFiles.find((fileObject: any) => fileObject.comment.startsWith(basename)); - if (shouldBeAdded && !path.extname(basename).startsWith(".h")) { - assert.isDefined(buildPhaseFile, `${basename} not added to PBXSourcesBuildPhase`); - assert.include(buildPhaseFile.comment, "in Sources", `${basename} must be added to Sources group`); + const buildPhaseFile = buildPhaseFiles.find((fileObject: any) => fileObject.comment.startsWith(baseName)); + if (shouldBeAdded && !extname(baseName).startsWith(".h")) { + assert.isDefined(buildPhaseFile, `${baseName} not added to PBXSourcesBuildPhase`); + assert.include(buildPhaseFile.comment, "in Sources", `${baseName} must be added to Sources group`); } else { - assert.isUndefined(buildPhaseFile, `${basename} is added to PBXSourcesBuildPhase, but it shouldn't have been.`); + assert.isUndefined(buildPhaseFile, `${baseName} is added to PBXSourcesBuildPhase, but it shouldn't have been.`); } }); }); @@ -757,17 +757,17 @@ describe("Source code support", () => { const pbxFileReferenceValues = Object.keys(pbxFileReference).map(key => pbxFileReference[key]); const buildPhaseFiles = pbxProj.hash.project.objects.PBXSourcesBuildPhase["858B83F218CA22B800AB12DE"].files; - sourceFileNames.map(file => path.basename(file)).forEach(basename => { - const ext = path.extname(basename); + sourceFileNames.map(file => basename(file)).forEach(baseName => { + const ext = extname(baseName); const shouldBeAdded = ext !== ".donotadd"; - assert.notEqual(pbxFileReferenceValues.indexOf(basename), -1, `${basename} not added to PBXFileRefereces`); + assert.notEqual(pbxFileReferenceValues.indexOf(baseName), -1, `${baseName} not added to PBXFileRefereces`); - const buildPhaseFile = buildPhaseFiles.find((fileObject: any) => fileObject.comment.startsWith(basename)); - if (shouldBeAdded && !path.extname(basename).startsWith(".h")) { - assert.isDefined(buildPhaseFile, `${basename} not added to PBXSourcesBuildPhase`); - assert.include(buildPhaseFile.comment, "in Sources", `${basename} must be added to Sources group`); + const buildPhaseFile = buildPhaseFiles.find((fileObject: any) => fileObject.comment.startsWith(baseName)); + if (shouldBeAdded && !extname(baseName).startsWith(".h")) { + assert.isDefined(buildPhaseFile, `${baseName} not added to PBXSourcesBuildPhase`); + assert.include(buildPhaseFile.comment, "in Sources", `${baseName} must be added to Sources group`); } else { - assert.isUndefined(buildPhaseFile, `${basename} was added to PBXSourcesBuildPhase, but it shouldn't have been`); + assert.isUndefined(buildPhaseFile, `${baseName} was added to PBXSourcesBuildPhase, but it shouldn't have been`); } }); }); @@ -785,13 +785,13 @@ describe("Source code support", () => { const buildPhaseFiles = pbxProj.hash.project.objects.PBXResourcesBuildPhase["858B842C18CA22B800AB12DE"].files; resFileNames.forEach(filename => { - const dirName = path.dirname(filename); + const dirName = dirname(filename); const fileToCheck = dirName.endsWith(".bundle") ? dirName : filename; - const basename = path.basename(fileToCheck); + const fileName = basename(fileToCheck); - assert.isTrue(pbxFileReferenceValues.indexOf(basename) !== -1, `Resource ${filename} not added to PBXFileRefereces`); + assert.isTrue(pbxFileReferenceValues.indexOf(fileName) !== -1, `Resource ${filename} not added to PBXFileRefereces`); - const buildPhaseFile = buildPhaseFiles.find((fileObject: any) => fileObject.comment.startsWith(basename)); + const buildPhaseFile = buildPhaseFiles.find((fileObject: any) => fileObject.comment.startsWith(fileName)); assert.isDefined(buildPhaseFile, `${fileToCheck} not added to PBXResourcesBuildPhase`); assert.include(buildPhaseFile.comment, "in Resources", `${fileToCheck} must be added to Resources group`); @@ -812,20 +812,20 @@ describe("Static libraries support", () => { const headers = ["TestHeader1.h", "TestHeader2.h"]; const testInjector = createTestInjector(projectPath, projectName); const fs: IFileSystem = testInjector.resolve("fs"); - const staticLibraryPath = path.join(path.join(temp.mkdirSync("pluginDirectory"), "platforms", "ios")); - const staticLibraryHeadersPath = path.join(staticLibraryPath, "include", libraryName); + const staticLibraryPath = join(join(temp.mkdirSync("pluginDirectory"), "platforms", "ios")); + const staticLibraryHeadersPath = join(staticLibraryPath, "include", libraryName); it("checks validation of header files", async () => { const iOSProjectService = testInjector.resolve("iOSProjectService"); fs.ensureDirectoryExists(staticLibraryHeadersPath); - _.each(headers, header => { fs.writeFile(path.join(staticLibraryHeadersPath, header), ""); }); + _.each(headers, header => { fs.writeFile(join(staticLibraryHeadersPath, header), ""); }); // Add all header files. - fs.writeFile(path.join(staticLibraryHeadersPath, libraryName + ".a"), ""); + fs.writeFile(join(staticLibraryHeadersPath, libraryName + ".a"), ""); let error: any; try { - await iOSProjectService.validateStaticLibrary(path.join(staticLibraryPath, libraryName + ".a")); + await iOSProjectService.validateStaticLibrary(join(staticLibraryPath, libraryName + ".a")); } catch (err) { error = err; } @@ -836,23 +836,23 @@ describe("Static libraries support", () => { it("checks generation of modulemaps", () => { const iOSProjectService = testInjector.resolve("iOSProjectService"); fs.ensureDirectoryExists(staticLibraryHeadersPath); - _.each(headers, header => { fs.writeFile(path.join(staticLibraryHeadersPath, header), ""); }); + _.each(headers, header => { fs.writeFile(join(staticLibraryHeadersPath, header), ""); }); iOSProjectService.generateModulemap(staticLibraryHeadersPath, libraryName); // Read the generated modulemap and verify it. - let modulemap = fs.readFile(path.join(staticLibraryHeadersPath, "module.modulemap")); + let modulemap = fs.readFile(join(staticLibraryHeadersPath, "module.modulemap")); const headerCommands = _.map(headers, value => `header "${value}"`); const modulemapExpectation = `module ${libraryName} { explicit module ${libraryName} { ${headerCommands.join(" ")} } }`; assert.equal(modulemap, modulemapExpectation); // Delete all header files. And try to regenerate modulemap. - _.each(headers, header => { fs.deleteFile(path.join(staticLibraryHeadersPath, header)); }); + _.each(headers, header => { fs.deleteFile(join(staticLibraryHeadersPath, header)); }); iOSProjectService.generateModulemap(staticLibraryHeadersPath, libraryName); let error: any; try { - modulemap = fs.readFile(path.join(staticLibraryHeadersPath, "module.modulemap")); + modulemap = fs.readFile(join(staticLibraryHeadersPath, "module.modulemap")); } catch (err) { error = err; } @@ -865,7 +865,7 @@ describe("Relative paths", () => { it("checks for correct calculation of relative paths", () => { const projectName = "projectDirectory"; const projectPath = temp.mkdirSync(projectName); - const subpath = path.join(projectPath, "sub", "path"); + const subpath = join(projectPath, "sub", "path"); const testInjector = createTestInjector(projectPath, projectName); createPackageJson(testInjector, projectPath, projectName); @@ -873,7 +873,7 @@ describe("Relative paths", () => { const projectData: IProjectData = testInjector.resolve("projectData"); const result = iOSProjectService.getLibSubpathRelativeToProjectPath(subpath, projectData); - assert.equal(result, path.join("..", "..", "sub", "path")); + assert.equal(result, join("..", "..", "sub", "path")); }); }); @@ -909,7 +909,7 @@ describe("iOS Project Service Signing", () => { } }); testInjector.register("pbxprojDomXcode", { Xcode: {} }); - pbxproj = path.join(projectPath, `platforms/ios/${projectDirName}.xcodeproj/project.pbxproj`); + pbxproj = join(projectPath, `platforms/ios/${projectDirName}.xcodeproj/project.pbxproj`); iOSProjectService = testInjector.resolve("iOSProjectService"); iOSProvisionService = testInjector.resolve("iOSProvisionService"); pbxprojDomXcode = testInjector.resolve("pbxprojDomXcode"); @@ -1151,11 +1151,11 @@ describe("Merge Project XCConfig files", () => { iOSProjectService = testInjector.resolve("iOSProjectService"); projectData = testInjector.resolve("projectData"); projectData.projectDir = projectPath; - projectData.appResourcesDirectoryPath = path.join(projectData.projectDir, "app", "App_Resources"); + projectData.appResourcesDirectoryPath = join(projectData.projectDir, "app", "App_Resources"); iOSEntitlementsService = testInjector.resolve("iOSEntitlementsService"); - appResourcesXcconfigPath = path.join(projectData.appResourcesDirectoryPath, "iOS", BUILD_XCCONFIG_FILE_NAME); + appResourcesXcconfigPath = join(projectData.appResourcesDirectoryPath, "iOS", BUILD_XCCONFIG_FILE_NAME); appResourceXCConfigContent = `CODE_SIGN_IDENTITY = iPhone Distribution // To build for device with XCode you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html // DEVELOPMENT_TEAM = YOUR_TEAM_ID; @@ -1167,7 +1167,7 @@ describe("Merge Project XCConfig files", () => { "version": "0.0.1" }; fs = testInjector.resolve("fs"); - fs.writeJson(path.join(projectPath, "package.json"), testPackageJson); + fs.writeJson(join(projectPath, "package.json"), testPackageJson); xcconfigService = testInjector.resolve("xcconfigService"); projectRoot = iOSProjectService.getPlatformData(projectData).projectRoot; }); @@ -1279,7 +1279,7 @@ describe("buildProject", () => { }; const projectData = testInjector.resolve("projectData"); - projectData.appResourcesDirectoryPath = path.join(projectPath, "app", "App_Resources"); + projectData.appResourcesDirectoryPath = join(projectPath, "app", "App_Resources"); const devicesService = testInjector.resolve("devicesService"); devicesService.initialize = () => ({}); diff --git a/test/platform-service.ts b/test/platform-service.ts index 9b85af1675..8503a71a06 100644 --- a/test/platform-service.ts +++ b/test/platform-service.ts @@ -249,13 +249,13 @@ describe('Platform Service Tests', () => { const pacoteService = testInjector.resolve("pacoteService"); let packageNamePassedToPacoteService = ""; - pacoteService.extractPackage = async (packageName: string, destinationDirectory: string, options?: IPacoteExtractOptions): Promise => { - packageNamePassedToPacoteService = packageName; + pacoteService.extractPackage = async (name: string, destinationDirectory: string, options?: IPacoteExtractOptions): Promise => { + packageNamePassedToPacoteService = name; }; const platformsData = testInjector.resolve("platformsData"); const packageName = "packageName"; - platformsData.getPlatformData = (platform: string, projectData: IProjectData): IPlatformData => { + platformsData.getPlatformData = (platform: string, pData: IProjectData): IPlatformData => { return { frameworkPackageName: packageName, platformProjectService: new stubs.PlatformProjectServiceStub(), @@ -482,7 +482,7 @@ describe('Platform Service Tests', () => { createProject: (projectRoot: string, frameworkDir: string) => Promise.resolve(), interpolateData: (projectRoot: string) => Promise.resolve(), afterCreateProject: (projectRoot: string): any => null, - getAppResourcesDestinationDirectoryPath: (projectData: IProjectData, frameworkVersion?: string): string => { + getAppResourcesDestinationDirectoryPath: (pData: IProjectData, frameworkVersion?: string): string => { if (platform.toLowerCase() === "ios") { const dirPath = path.join(testDirData.appDestFolderPath, "Resources"); fs.ensureDirectoryExists(dirPath); @@ -498,7 +498,7 @@ describe('Platform Service Tests', () => { ensureConfigurationFileInAppResources: (): any => null, interpolateConfigurationFile: (): void => undefined, isPlatformPrepared: (projectRoot: string) => false, - prepareAppResources: (appResourcesDirectoryPath: string, projectData: IProjectData): void => undefined, + prepareAppResources: (appResourcesDirectoryPath: string, pData: IProjectData): void => undefined, checkForChanges: () => { /* */ } } }; @@ -1056,7 +1056,6 @@ describe('Platform Service Tests', () => { const platform = "android"; const platformTemplate = "testPlatformTemplate"; const appFilesUpdaterOptions = { bundle: true }; - let isPlatformAdded = false; let areWebpackFilesPersisted = false; let projectData: IProjectData = null; @@ -1066,7 +1065,7 @@ describe('Platform Service Tests', () => { beforeEach(() => { reset(); - (platformService).addPlatform = () => isPlatformAdded = true; + (platformService).addPlatform = () => { /** */ }; (platformService).persistWebpackFiles = () => areWebpackFilesPersisted = true; projectData = testInjector.resolve("projectData"); @@ -1077,7 +1076,6 @@ describe('Platform Service Tests', () => { }); function reset() { - isPlatformAdded = false; areWebpackFilesPersisted = false; } diff --git a/test/plugins-service.ts b/test/plugins-service.ts index 0e9cbf81c5..f2530b2e73 100644 --- a/test/plugins-service.ts +++ b/test/plugins-service.ts @@ -530,7 +530,7 @@ describe("Plugins service", () => { // Mock plugins service const pluginsService: IPluginsService = testInjector.resolve("pluginsService"); - pluginsService.getAllInstalledPlugins = async (projectData: IProjectData) => { + pluginsService.getAllInstalledPlugins = async (pData: IProjectData) => { return [{ name: "" }]; }; @@ -583,7 +583,7 @@ describe("Plugins service", () => { const unitTestsInjector = new Yok(); unitTestsInjector.register("platformsData", { - getPlatformData: (platform: string, projectData: IProjectData) => ({ + getPlatformData: (_platform: string, pData: IProjectData) => ({ projectRoot: "projectRoot", platformProjectService: { preparePluginNativeCode: async (pluginData: IPluginData, projData: IProjectData) => { @@ -594,7 +594,7 @@ describe("Plugins service", () => { }); const pluginHashes = opts.newPluginHashes || { "file1": "hash1" }; - const pluginData: IPluginData = { + const samplePluginData: IPluginData = { fullPath: "plugin_full_path", name: "plugin_name" }; @@ -617,7 +617,7 @@ describe("Plugins service", () => { return true; }, readJson: (file: string) => ({ - [pluginData.name]: pluginHashes + [samplePluginData.name]: pluginHashes }), writeJson: (file: string, json: any) => { testData.dataPassedToWriteJson = json; }, enumerateFilesInDirectorySync: (): string[] => ["some_file"] @@ -631,7 +631,7 @@ describe("Plugins service", () => { const pluginsService: PluginsService = unitTestsInjector.resolve(PluginsService); testData.pluginsService = pluginsService; - testData.pluginData = pluginData; + testData.pluginData = samplePluginData; return testData; }; diff --git a/test/project-templates-service.ts b/test/project-templates-service.ts index 92684158b9..9c32106247 100644 --- a/test/project-templates-service.ts +++ b/test/project-templates-service.ts @@ -160,7 +160,7 @@ describe("project-templates-service", () => { const templateName = "my-own-local-template"; const localTemplatePath = "/Users/username/localtemplate"; const fs = testInjector.resolve("fs"); - fs.exists = (path: string): boolean => true; + fs.exists = (filePath: string): boolean => true; const pacoteService = testInjector.resolve("pacoteService"); pacoteService.manifest = () => Promise.resolve({ name: templateName }); await projectTemplatesService.prepareTemplate(localTemplatePath, "tempFolder"); diff --git a/test/services/debug-service.ts b/test/services/debug-service.ts index dd40a7b836..f839043e28 100644 --- a/test/services/debug-service.ts +++ b/test/services/debug-service.ts @@ -168,7 +168,7 @@ describe("debugService", () => { const testInjector = getTestInjectorForTestConfiguration(testData); const expectedErrorMessage = "Platform specific error"; const platformDebugService = testInjector.resolve(`${platform}DeviceDebugService`); - platformDebugService.debug = async (debugData: IDebugData, debugOptions: IDebugOptions): Promise => { + platformDebugService.debug = async (data: IDebugData, debugOptions: IDebugOptions): Promise => { throw new Error(expectedErrorMessage); }; diff --git a/test/services/ios-debugger-port-service.ts b/test/services/ios-debugger-port-service.ts index 503bfeed1f..6af66967e7 100644 --- a/test/services/ios-debugger-port-service.ts +++ b/test/services/ios-debugger-port-service.ts @@ -11,7 +11,7 @@ import * as sinon from "sinon"; class DeviceApplicationManagerMock extends EventEmitter { } class DeveiceLogProviderMock extends EventEmitter { - public logData(deviceId: string): void { + public logData(id: string): void { // need this to be empty } } diff --git a/test/services/subscription-service.ts b/test/services/subscription-service.ts index 2d04140a6a..c4cbb9b529 100644 --- a/test/services/subscription-service.ts +++ b/test/services/subscription-service.ts @@ -268,9 +268,7 @@ describe("subscriptionService", () => { const testInjector = createTestInjector(); const prompter = testInjector.resolve("prompter"); - let schemasPassedToPromter: prompt.Question[] = null; prompter.get = async (schemas: prompt.Question[]): Promise => { - schemasPassedToPromter = schemas; return { inputEmail: email }; }; diff --git a/test/stubs.ts b/test/stubs.ts index 510b604b2b..3a6e3a0ada 100644 --- a/test/stubs.ts +++ b/test/stubs.ts @@ -3,7 +3,7 @@ import * as util from "util"; import * as chai from "chai"; import { EventEmitter } from "events"; -import * as path from "path"; +import { join } from "path"; import * as constants from "./../lib/constants"; import * as prompt from "inquirer"; import { Yok } from "./../lib/common/yok"; @@ -309,7 +309,7 @@ export class ProjectDataStub implements IProjectData { projectDir: string; projectName: string; get platformsDir(): string { - return this.plafromsDir || (this.projectDir && path.join(this.projectDir, "platforms")) || ""; + return this.plafromsDir || (this.projectDir && join(this.projectDir, "platforms")) || ""; } set platformsDir(value) { this.plafromsDir = value; @@ -348,7 +348,7 @@ export class ProjectDataStub implements IProjectData { } // always return app/App_Resources - return path.join(projectDir, constants.APP_FOLDER_NAME, constants.APP_RESOURCES_FOLDER_NAME); + return join(projectDir, constants.APP_FOLDER_NAME, constants.APP_RESOURCES_FOLDER_NAME); } public getAppResourcesRelativeDirectoryPath(): string { return ""; @@ -358,7 +358,7 @@ export class ProjectDataStub implements IProjectData { projectDir = this.projectDir; } - return path.join(projectDir, "app") || ""; + return join(projectDir, "app") || ""; } public getAppDirectoryRelativePath(): string { return ""; @@ -595,16 +595,16 @@ export class PrompterStub implements IPrompter { async get(schemas: prompt.Question[]): Promise { throw unreachable(); } - async getPassword(prompt: string, options?: IAllowEmpty): Promise { - chai.assert.ok(prompt in this.passwords, `PrompterStub didn't expect to give password for: ${prompt}`); - const result = this.passwords[prompt]; - delete this.passwords[prompt]; + async getPassword(message: string, options?: IAllowEmpty): Promise { + chai.assert.ok(message in this.passwords, `PrompterStub didn't expect to give password for: ${message}`); + const result = this.passwords[message]; + delete this.passwords[message]; return result; } - async getString(prompt: string, options?: IPrompterOptions): Promise { - chai.assert.ok(prompt in this.strings, `PrompterStub didn't expect to be asked for: ${prompt}`); - const result = this.strings[prompt]; - delete this.strings[prompt]; + async getString(message: string, options?: IPrompterOptions): Promise { + chai.assert.ok(message in this.strings, `PrompterStub didn't expect to be asked for: ${message}`); + const result = this.strings[message]; + delete this.strings[message]; return result; } async promptForChoice(promptMessage: string, choices: any[]): Promise { @@ -617,7 +617,7 @@ export class PrompterStub implements IPrompter { delete this.answers[question]; return result; } - async confirm(prompt: string, defaultAction?: () => boolean): Promise { + async confirm(message: string, defaultAction?: () => boolean): Promise { throw unreachable(); } dispose(): void { diff --git a/test/update.ts b/test/update.ts index 5d7be82e04..65b162c48a 100644 --- a/test/update.ts +++ b/test/update.ts @@ -6,7 +6,7 @@ import { assert } from "chai"; import * as sinon from 'sinon'; import { Options } from "../lib/options"; import { AndroidProjectService } from "../lib/services/android-project-service"; -import {StaticConfig } from "../lib/config"; +import { StaticConfig } from "../lib/config"; import { SettingsService } from "../lib/common/test/unit-tests/stubs"; const projectFolder = "test"; @@ -49,10 +49,10 @@ function createTestInjector( }); testInjector.register("pluginVariablesService", {}); testInjector.register("platformService", { - getInstalledPlatforms: function(): string[]{ + getInstalledPlatforms: function(): string[] { return installedPlatforms; }, - getAvailablePlatforms: function(): string[]{ + getAvailablePlatforms: function(): string[] { return availablePlatforms; }, removePlatforms: async (): Promise => undefined, diff --git a/tslint.json b/tslint.json index 03db549b9b..3c69354342 100644 --- a/tslint.json +++ b/tslint.json @@ -56,7 +56,6 @@ true, "allow-null-check" ], - "typeof-compare": true, "use-isnan": true, "variable-name": [ true,