Types/lodash-es auto-gen typings (#18725)

* chore(generation): add script to generate typings automatically

* docs: add a readme.md to state unfinished types

* fix: improve generation and tsconfig files

* chore(generate): add prettier to format generated code

* feat(lodash-es): generate files and remove codes

1. noconflict and runincontext aren't inside lodash-es
2. seq-like function are removed temporarily. see readme.md

* feat(lodash): add a bash script to generate all modules

and remove lodash-es related code in lodash/scripts

* fix(lodash-es): apply the new approach to declare types

for default export constraints in typescript v2.6
see
https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#arbitrary-expressions-are-forbidden-in-export-assignments-in-ambient-contexts
This commit is contained in:
Scott 2017-10-24 03:57:17 +08:00 committed by Andy
parent 2091df4cbf
commit a65d75a7cd
43 changed files with 2129 additions and 357 deletions

View File

@ -0,0 +1 @@
TODO: There is not much use cases for `seq`-like functions when using `lodash-es`, So I quit adding types for `seq`-like functions. If someone wants this kink of types, you can setup another PR. Also see Here https://github.com/lodash/lodash/issues/3298.

67
types/lodash-es/array.d.ts vendored Normal file
View File

@ -0,0 +1,67 @@
import { default as chunk } from "./chunk";
import { default as compact } from "./compact";
import { default as concat } from "./concat";
import { default as difference } from "./difference";
import { default as differenceBy } from "./differenceBy";
import { default as differenceWith } from "./differenceWith";
import { default as drop } from "./drop";
import { default as dropRight } from "./dropRight";
import { default as dropRightWhile } from "./dropRightWhile";
import { default as dropWhile } from "./dropWhile";
import { default as fill } from "./fill";
import { default as findIndex } from "./findIndex";
import { default as findLastIndex } from "./findLastIndex";
import { default as first } from "./first";
import { default as flatten } from "./flatten";
import { default as flattenDeep } from "./flattenDeep";
import { default as flattenDepth } from "./flattenDepth";
import { default as fromPairs } from "./fromPairs";
import { default as head } from "./head";
import { default as indexOf } from "./indexOf";
import { default as initial } from "./initial";
import { default as intersection } from "./intersection";
import { default as intersectionBy } from "./intersectionBy";
import { default as intersectionWith } from "./intersectionWith";
import { default as join } from "./join";
import { default as last } from "./last";
import { default as lastIndexOf } from "./lastIndexOf";
import { default as nth } from "./nth";
import { default as pull } from "./pull";
import { default as pullAll } from "./pullAll";
import { default as pullAllBy } from "./pullAllBy";
import { default as pullAllWith } from "./pullAllWith";
import { default as pullAt } from "./pullAt";
import { default as remove } from "./remove";
import { default as reverse } from "./reverse";
import { default as slice } from "./slice";
import { default as sortedIndex } from "./sortedIndex";
import { default as sortedIndexBy } from "./sortedIndexBy";
import { default as sortedIndexOf } from "./sortedIndexOf";
import { default as sortedLastIndex } from "./sortedLastIndex";
import { default as sortedLastIndexBy } from "./sortedLastIndexBy";
import { default as sortedLastIndexOf } from "./sortedLastIndexOf";
import { default as sortedUniq } from "./sortedUniq";
import { default as sortedUniqBy } from "./sortedUniqBy";
import { default as tail } from "./tail";
import { default as take } from "./take";
import { default as takeRight } from "./takeRight";
import { default as takeRightWhile } from "./takeRightWhile";
import { default as takeWhile } from "./takeWhile";
import { default as union } from "./union";
import { default as unionBy } from "./unionBy";
import { default as unionWith } from "./unionWith";
import { default as uniq } from "./uniq";
import { default as uniqBy } from "./uniqBy";
import { default as uniqWith } from "./uniqWith";
import { default as unzip } from "./unzip";
import { default as unzipWith } from "./unzipWith";
import { default as without } from "./without";
import { default as xor } from "./xor";
import { default as xorBy } from "./xorBy";
import { default as xorWith } from "./xorWith";
import { default as zip } from "./zip";
import { default as zipObject } from "./zipObject";
import { default as zipObjectDeep } from "./zipObjectDeep";
import { default as zipWith } from "./zipWith";
export { default } from "./array.default";

134
types/lodash-es/array.default.d.ts vendored Normal file
View File

@ -0,0 +1,134 @@
import chunk from "./chunk";
import compact from "./compact";
import concat from "./concat";
import difference from "./difference";
import differenceBy from "./differenceBy";
import differenceWith from "./differenceWith";
import drop from "./drop";
import dropRight from "./dropRight";
import dropRightWhile from "./dropRightWhile";
import dropWhile from "./dropWhile";
import fill from "./fill";
import findIndex from "./findIndex";
import findLastIndex from "./findLastIndex";
import first from "./first";
import flatten from "./flatten";
import flattenDeep from "./flattenDeep";
import flattenDepth from "./flattenDepth";
import fromPairs from "./fromPairs";
import head from "./head";
import indexOf from "./indexOf";
import initial from "./initial";
import intersection from "./intersection";
import intersectionBy from "./intersectionBy";
import intersectionWith from "./intersectionWith";
import join from "./join";
import last from "./last";
import lastIndexOf from "./lastIndexOf";
import nth from "./nth";
import pull from "./pull";
import pullAll from "./pullAll";
import pullAllBy from "./pullAllBy";
import pullAllWith from "./pullAllWith";
import pullAt from "./pullAt";
import remove from "./remove";
import reverse from "./reverse";
import slice from "./slice";
import sortedIndex from "./sortedIndex";
import sortedIndexBy from "./sortedIndexBy";
import sortedIndexOf from "./sortedIndexOf";
import sortedLastIndex from "./sortedLastIndex";
import sortedLastIndexBy from "./sortedLastIndexBy";
import sortedLastIndexOf from "./sortedLastIndexOf";
import sortedUniq from "./sortedUniq";
import sortedUniqBy from "./sortedUniqBy";
import tail from "./tail";
import take from "./take";
import takeRight from "./takeRight";
import takeRightWhile from "./takeRightWhile";
import takeWhile from "./takeWhile";
import union from "./union";
import unionBy from "./unionBy";
import unionWith from "./unionWith";
import uniq from "./uniq";
import uniqBy from "./uniqBy";
import uniqWith from "./uniqWith";
import unzip from "./unzip";
import unzipWith from "./unzipWith";
import without from "./without";
import xor from "./xor";
import xorBy from "./xorBy";
import xorWith from "./xorWith";
import zip from "./zip";
import zipObject from "./zipObject";
import zipObjectDeep from "./zipObjectDeep";
import zipWith from "./zipWith";
declare const defaultExport: {
chunk: typeof chunk;
compact: typeof compact;
concat: typeof concat;
difference: typeof difference;
differenceBy: typeof differenceBy;
differenceWith: typeof differenceWith;
drop: typeof drop;
dropRight: typeof dropRight;
dropRightWhile: typeof dropRightWhile;
dropWhile: typeof dropWhile;
fill: typeof fill;
findIndex: typeof findIndex;
findLastIndex: typeof findLastIndex;
first: typeof first;
flatten: typeof flatten;
flattenDeep: typeof flattenDeep;
flattenDepth: typeof flattenDepth;
fromPairs: typeof fromPairs;
head: typeof head;
indexOf: typeof indexOf;
initial: typeof initial;
intersection: typeof intersection;
intersectionBy: typeof intersectionBy;
intersectionWith: typeof intersectionWith;
join: typeof join;
last: typeof last;
lastIndexOf: typeof lastIndexOf;
nth: typeof nth;
pull: typeof pull;
pullAll: typeof pullAll;
pullAllBy: typeof pullAllBy;
pullAllWith: typeof pullAllWith;
pullAt: typeof pullAt;
remove: typeof remove;
reverse: typeof reverse;
slice: typeof slice;
sortedIndex: typeof sortedIndex;
sortedIndexBy: typeof sortedIndexBy;
sortedIndexOf: typeof sortedIndexOf;
sortedLastIndex: typeof sortedLastIndex;
sortedLastIndexBy: typeof sortedLastIndexBy;
sortedLastIndexOf: typeof sortedLastIndexOf;
sortedUniq: typeof sortedUniq;
sortedUniqBy: typeof sortedUniqBy;
tail: typeof tail;
take: typeof take;
takeRight: typeof takeRight;
takeRightWhile: typeof takeRightWhile;
takeWhile: typeof takeWhile;
union: typeof union;
unionBy: typeof unionBy;
unionWith: typeof unionWith;
uniq: typeof uniq;
uniqBy: typeof uniqBy;
uniqWith: typeof uniqWith;
unzip: typeof unzip;
unzipWith: typeof unzipWith;
without: typeof without;
xor: typeof xor;
xorBy: typeof xorBy;
xorWith: typeof xorWith;
zip: typeof zip;
zipObject: typeof zipObject;
zipObjectDeep: typeof zipObjectDeep;
zipWith: typeof zipWith;
};
export default defaultExport;

View File

@ -1,2 +0,0 @@
import { chain } from "lodash";
export default chain;

30
types/lodash-es/collection.d.ts vendored Normal file
View File

@ -0,0 +1,30 @@
import { default as countBy } from "./countBy";
import { default as each } from "./each";
import { default as eachRight } from "./eachRight";
import { default as every } from "./every";
import { default as filter } from "./filter";
import { default as find } from "./find";
import { default as findLast } from "./findLast";
import { default as flatMap } from "./flatMap";
import { default as flatMapDeep } from "./flatMapDeep";
import { default as flatMapDepth } from "./flatMapDepth";
import { default as forEach } from "./forEach";
import { default as forEachRight } from "./forEachRight";
import { default as groupBy } from "./groupBy";
import { default as includes } from "./includes";
import { default as invokeMap } from "./invokeMap";
import { default as keyBy } from "./keyBy";
import { default as map } from "./map";
import { default as orderBy } from "./orderBy";
import { default as partition } from "./partition";
import { default as reduce } from "./reduce";
import { default as reduceRight } from "./reduceRight";
import { default as reject } from "./reject";
import { default as sample } from "./sample";
import { default as sampleSize } from "./sampleSize";
import { default as shuffle } from "./shuffle";
import { default as size } from "./size";
import { default as some } from "./some";
import { default as sortBy } from "./sortBy";
export { default } from "./collection.default";

60
types/lodash-es/collection.default.d.ts vendored Normal file
View File

@ -0,0 +1,60 @@
import countBy from "./countBy";
import each from "./each";
import eachRight from "./eachRight";
import every from "./every";
import filter from "./filter";
import find from "./find";
import findLast from "./findLast";
import flatMap from "./flatMap";
import flatMapDeep from "./flatMapDeep";
import flatMapDepth from "./flatMapDepth";
import forEach from "./forEach";
import forEachRight from "./forEachRight";
import groupBy from "./groupBy";
import includes from "./includes";
import invokeMap from "./invokeMap";
import keyBy from "./keyBy";
import map from "./map";
import orderBy from "./orderBy";
import partition from "./partition";
import reduce from "./reduce";
import reduceRight from "./reduceRight";
import reject from "./reject";
import sample from "./sample";
import sampleSize from "./sampleSize";
import shuffle from "./shuffle";
import size from "./size";
import some from "./some";
import sortBy from "./sortBy";
declare const defaultExport: {
countBy: typeof countBy;
each: typeof each;
eachRight: typeof eachRight;
every: typeof every;
filter: typeof filter;
find: typeof find;
findLast: typeof findLast;
flatMap: typeof flatMap;
flatMapDeep: typeof flatMapDeep;
flatMapDepth: typeof flatMapDepth;
forEach: typeof forEach;
forEachRight: typeof forEachRight;
groupBy: typeof groupBy;
includes: typeof includes;
invokeMap: typeof invokeMap;
keyBy: typeof keyBy;
map: typeof map;
orderBy: typeof orderBy;
partition: typeof partition;
reduce: typeof reduce;
reduceRight: typeof reduceRight;
reject: typeof reject;
sample: typeof sample;
sampleSize: typeof sampleSize;
shuffle: typeof shuffle;
size: typeof size;
some: typeof some;
sortBy: typeof sortBy;
};
export default defaultExport;

2
types/lodash-es/conforms.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { conforms } from "lodash";
export default conforms;

2
types/lodash-es/conformsTo.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { conformsTo } from "lodash";
export default conformsTo;

3
types/lodash-es/date.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import { default as now } from "./now";
export { default } from "./date.default";

6
types/lodash-es/date.default.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
import now from "./now";
declare const defaultExport: {
now: typeof now;
};
export default defaultExport;

2
types/lodash-es/defaultTo.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { defaultTo } from "lodash";
export default defaultTo;

25
types/lodash-es/function.d.ts vendored Normal file
View File

@ -0,0 +1,25 @@
import { default as after } from "./after";
import { default as ary } from "./ary";
import { default as before } from "./before";
import { default as bind } from "./bind";
import { default as bindKey } from "./bindKey";
import { default as curry } from "./curry";
import { default as curryRight } from "./curryRight";
import { default as debounce } from "./debounce";
import { default as defer } from "./defer";
import { default as delay } from "./delay";
import { default as flip } from "./flip";
import { default as memoize } from "./memoize";
import { default as negate } from "./negate";
import { default as once } from "./once";
import { default as overArgs } from "./overArgs";
import { default as partial } from "./partial";
import { default as partialRight } from "./partialRight";
import { default as rearg } from "./rearg";
import { default as rest } from "./rest";
import { default as spread } from "./spread";
import { default as throttle } from "./throttle";
import { default as unary } from "./unary";
import { default as wrap } from "./wrap";
export { default } from "./function.default";

50
types/lodash-es/function.default.d.ts vendored Normal file
View File

@ -0,0 +1,50 @@
import after from "./after";
import ary from "./ary";
import before from "./before";
import bind from "./bind";
import bindKey from "./bindKey";
import curry from "./curry";
import curryRight from "./curryRight";
import debounce from "./debounce";
import defer from "./defer";
import delay from "./delay";
import flip from "./flip";
import memoize from "./memoize";
import negate from "./negate";
import once from "./once";
import overArgs from "./overArgs";
import partial from "./partial";
import partialRight from "./partialRight";
import rearg from "./rearg";
import rest from "./rest";
import spread from "./spread";
import throttle from "./throttle";
import unary from "./unary";
import wrap from "./wrap";
declare const defaultExport: {
after: typeof after;
ary: typeof ary;
before: typeof before;
bind: typeof bind;
bindKey: typeof bindKey;
curry: typeof curry;
curryRight: typeof curryRight;
debounce: typeof debounce;
defer: typeof defer;
delay: typeof delay;
flip: typeof flip;
memoize: typeof memoize;
negate: typeof negate;
once: typeof once;
overArgs: typeof overArgs;
partial: typeof partial;
partialRight: typeof partialRight;
rearg: typeof rearg;
rest: typeof rest;
spread: typeof spread;
throttle: typeof throttle;
unary: typeof unary;
wrap: typeof wrap;
};
export default defaultExport;

View File

@ -1,306 +1,307 @@
// Type definitions for lodash-es 4.14
// Type definitions for lodash-es 4.17
// Project: http://lodash.com/
// Definitions by: Stephen Lautier <https://github.com/stephenlautier>
// Definitions by: Stephen Lautier <https://github.com/stephenlautier>, e-cloud <https://github.com/e-cloud>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts
export {
add,
after,
ary,
assign,
assignIn,
assignInWith,
assignWith,
at,
attempt,
before,
bind,
bindAll,
bindKey,
camelCase,
capitalize,
castArray,
ceil,
chain,
chunk,
clamp,
clone,
cloneDeep,
cloneDeepWith,
cloneWith,
compact,
concat,
cond,
constant,
countBy,
create,
curry,
curryRight,
debounce,
deburr,
defaults,
defaultsDeep,
defer,
delay,
difference,
differenceBy,
differenceWith,
divide,
drop,
dropRight,
dropRightWhile,
dropWhile,
each,
eachRight,
endsWith,
entries,
entriesIn,
eq,
escape,
escapeRegExp,
every,
extend,
extendWith,
fill,
filter,
find,
findIndex,
findKey,
findLast,
findLastIndex,
findLastKey,
first,
flatMap,
flatMapDeep,
flatMapDepth,
flatten,
flattenDeep,
flattenDepth,
flip,
floor,
flow,
flowRight,
forEach,
forEachRight,
forIn,
forInRight,
forOwn,
forOwnRight,
fromPairs,
functions,
functionsIn,
get,
groupBy,
gt,
gte,
has,
hasIn,
head,
identity,
includes,
indexOf,
initial,
inRange,
intersection,
intersectionBy,
intersectionWith,
invert,
invertBy,
invoke,
invokeMap,
isArguments,
isArray,
isArrayBuffer,
isArrayLike,
isArrayLikeObject,
isBoolean,
isBuffer,
isDate,
isElement,
isEmpty,
isEqual,
isEqualWith,
isError,
isFinite,
isFunction,
isInteger,
isLength,
isMap,
isMatch,
isMatchWith,
isNaN,
isNative,
isNil,
isNull,
isNumber,
isObject,
isObjectLike,
isPlainObject,
isRegExp,
isSafeInteger,
isSet,
isString,
isSymbol,
isTypedArray,
isUndefined,
isWeakMap,
isWeakSet,
iteratee,
join,
kebabCase,
keyBy,
keys,
keysIn,
last,
lastIndexOf,
lowerCase,
lowerFirst,
lt,
lte,
map,
mapKeys,
mapValues,
matches,
matchesProperty,
max,
maxBy,
mean,
meanBy,
memoize,
merge,
mergeWith,
method,
methodOf,
min,
minBy,
mixin,
negate,
noConflict,
noop,
now,
nth,
nthArg,
omit,
omitBy,
once,
orderBy,
over,
overArgs,
overEvery,
overSome,
pad,
padEnd,
padStart,
parseInt,
partial,
partialRight,
partition,
pick,
pickBy,
property,
propertyOf,
pull,
pullAll,
pullAllBy,
pullAllWith,
pullAt,
random,
range,
rangeRight,
rearg,
reduce,
reduceRight,
reject,
remove,
repeat,
replace,
rest,
result,
reverse,
round,
runInContext,
sample,
sampleSize,
set,
setWith,
shuffle,
size,
slice,
snakeCase,
some,
sortBy,
sortedIndex,
sortedIndexBy,
sortedIndexOf,
sortedLastIndex,
sortedLastIndexBy,
sortedLastIndexOf,
sortedUniq,
sortedUniqBy,
split,
spread,
startCase,
startsWith,
subtract,
sum,
sumBy,
tail,
take,
takeRight,
takeRightWhile,
takeWhile,
tap,
template,
throttle,
thru,
times,
toArray,
toFinite,
toInteger,
toLength,
toLower,
toNumber,
toPairs,
toPairsIn,
toPath,
toPlainObject,
toSafeInteger,
toString,
toUpper,
transform,
trim,
trimEnd,
trimStart,
truncate,
unary,
unescape,
union,
unionBy,
unionWith,
uniq,
uniqBy,
uniqueId,
uniqWith,
unset,
unzip,
unzipWith,
update,
updateWith,
upperCase,
upperFirst,
values,
valuesIn,
without,
words,
wrap,
xor,
xorBy,
xorWith,
zip,
zipObject,
zipObjectDeep,
zipWith
} from "lodash";
export { default as add } from "./add";
export { default as after } from "./after";
export { default as ary } from "./ary";
export { default as assign } from "./assign";
export { default as assignIn } from "./assignIn";
export { default as assignInWith } from "./assignInWith";
export { default as assignWith } from "./assignWith";
export { default as at } from "./at";
export { default as attempt } from "./attempt";
export { default as before } from "./before";
export { default as bind } from "./bind";
export { default as bindAll } from "./bindAll";
export { default as bindKey } from "./bindKey";
export { default as camelCase } from "./camelCase";
export { default as capitalize } from "./capitalize";
export { default as castArray } from "./castArray";
export { default as ceil } from "./ceil";
export { default as chunk } from "./chunk";
export { default as clamp } from "./clamp";
export { default as clone } from "./clone";
export { default as cloneDeep } from "./cloneDeep";
export { default as cloneDeepWith } from "./cloneDeepWith";
export { default as cloneWith } from "./cloneWith";
export { default as compact } from "./compact";
export { default as concat } from "./concat";
export { default as cond } from "./cond";
export { default as conforms } from "./conforms";
export { default as conformsTo } from "./conformsTo";
export { default as constant } from "./constant";
export { default as countBy } from "./countBy";
export { default as create } from "./create";
export { default as curry } from "./curry";
export { default as curryRight } from "./curryRight";
export { default as debounce } from "./debounce";
export { default as deburr } from "./deburr";
export { default as defaultTo } from "./defaultTo";
export { default as defaults } from "./defaults";
export { default as defaultsDeep } from "./defaultsDeep";
export { default as defer } from "./defer";
export { default as delay } from "./delay";
export { default as difference } from "./difference";
export { default as differenceBy } from "./differenceBy";
export { default as differenceWith } from "./differenceWith";
export { default as divide } from "./divide";
export { default as drop } from "./drop";
export { default as dropRight } from "./dropRight";
export { default as dropRightWhile } from "./dropRightWhile";
export { default as dropWhile } from "./dropWhile";
export { default as each } from "./each";
export { default as eachRight } from "./eachRight";
export { default as endsWith } from "./endsWith";
export { default as entries } from "./entries";
export { default as entriesIn } from "./entriesIn";
export { default as eq } from "./eq";
export { default as escape } from "./escape";
export { default as escapeRegExp } from "./escapeRegExp";
export { default as every } from "./every";
export { default as extend } from "./extend";
export { default as extendWith } from "./extendWith";
export { default as fill } from "./fill";
export { default as filter } from "./filter";
export { default as find } from "./find";
export { default as findIndex } from "./findIndex";
export { default as findKey } from "./findKey";
export { default as findLast } from "./findLast";
export { default as findLastIndex } from "./findLastIndex";
export { default as findLastKey } from "./findLastKey";
export { default as first } from "./first";
export { default as flatMap } from "./flatMap";
export { default as flatMapDeep } from "./flatMapDeep";
export { default as flatMapDepth } from "./flatMapDepth";
export { default as flatten } from "./flatten";
export { default as flattenDeep } from "./flattenDeep";
export { default as flattenDepth } from "./flattenDepth";
export { default as flip } from "./flip";
export { default as floor } from "./floor";
export { default as flow } from "./flow";
export { default as flowRight } from "./flowRight";
export { default as forEach } from "./forEach";
export { default as forEachRight } from "./forEachRight";
export { default as forIn } from "./forIn";
export { default as forInRight } from "./forInRight";
export { default as forOwn } from "./forOwn";
export { default as forOwnRight } from "./forOwnRight";
export { default as fromPairs } from "./fromPairs";
export { default as functions } from "./functions";
export { default as functionsIn } from "./functionsIn";
export { default as get } from "./get";
export { default as groupBy } from "./groupBy";
export { default as gt } from "./gt";
export { default as gte } from "./gte";
export { default as has } from "./has";
export { default as hasIn } from "./hasIn";
export { default as head } from "./head";
export { default as identity } from "./identity";
export { default as inRange } from "./inRange";
export { default as includes } from "./includes";
export { default as indexOf } from "./indexOf";
export { default as initial } from "./initial";
export { default as intersection } from "./intersection";
export { default as intersectionBy } from "./intersectionBy";
export { default as intersectionWith } from "./intersectionWith";
export { default as invert } from "./invert";
export { default as invertBy } from "./invertBy";
export { default as invoke } from "./invoke";
export { default as invokeMap } from "./invokeMap";
export { default as isArguments } from "./isArguments";
export { default as isArray } from "./isArray";
export { default as isArrayBuffer } from "./isArrayBuffer";
export { default as isArrayLike } from "./isArrayLike";
export { default as isArrayLikeObject } from "./isArrayLikeObject";
export { default as isBoolean } from "./isBoolean";
export { default as isBuffer } from "./isBuffer";
export { default as isDate } from "./isDate";
export { default as isElement } from "./isElement";
export { default as isEmpty } from "./isEmpty";
export { default as isEqual } from "./isEqual";
export { default as isEqualWith } from "./isEqualWith";
export { default as isError } from "./isError";
export { default as isFinite } from "./isFinite";
export { default as isFunction } from "./isFunction";
export { default as isInteger } from "./isInteger";
export { default as isLength } from "./isLength";
export { default as isMap } from "./isMap";
export { default as isMatch } from "./isMatch";
export { default as isMatchWith } from "./isMatchWith";
export { default as isNaN } from "./isNaN";
export { default as isNative } from "./isNative";
export { default as isNil } from "./isNil";
export { default as isNull } from "./isNull";
export { default as isNumber } from "./isNumber";
export { default as isObject } from "./isObject";
export { default as isObjectLike } from "./isObjectLike";
export { default as isPlainObject } from "./isPlainObject";
export { default as isRegExp } from "./isRegExp";
export { default as isSafeInteger } from "./isSafeInteger";
export { default as isSet } from "./isSet";
export { default as isString } from "./isString";
export { default as isSymbol } from "./isSymbol";
export { default as isTypedArray } from "./isTypedArray";
export { default as isUndefined } from "./isUndefined";
export { default as isWeakMap } from "./isWeakMap";
export { default as isWeakSet } from "./isWeakSet";
export { default as iteratee } from "./iteratee";
export { default as join } from "./join";
export { default as kebabCase } from "./kebabCase";
export { default as keyBy } from "./keyBy";
export { default as keys } from "./keys";
export { default as keysIn } from "./keysIn";
export { default as last } from "./last";
export { default as lastIndexOf } from "./lastIndexOf";
export { default as lowerCase } from "./lowerCase";
export { default as lowerFirst } from "./lowerFirst";
export { default as lt } from "./lt";
export { default as lte } from "./lte";
export { default as map } from "./map";
export { default as mapKeys } from "./mapKeys";
export { default as mapValues } from "./mapValues";
export { default as matches } from "./matches";
export { default as matchesProperty } from "./matchesProperty";
export { default as max } from "./max";
export { default as maxBy } from "./maxBy";
export { default as mean } from "./mean";
export { default as meanBy } from "./meanBy";
export { default as memoize } from "./memoize";
export { default as merge } from "./merge";
export { default as mergeWith } from "./mergeWith";
export { default as method } from "./method";
export { default as methodOf } from "./methodOf";
export { default as min } from "./min";
export { default as minBy } from "./minBy";
export { default as mixin } from "./mixin";
export { default as multiply } from "./multiply";
export { default as negate } from "./negate";
export { default as noop } from "./noop";
export { default as now } from "./now";
export { default as nth } from "./nth";
export { default as nthArg } from "./nthArg";
export { default as omit } from "./omit";
export { default as omitBy } from "./omitBy";
export { default as once } from "./once";
export { default as orderBy } from "./orderBy";
export { default as over } from "./over";
export { default as overArgs } from "./overArgs";
export { default as overEvery } from "./overEvery";
export { default as overSome } from "./overSome";
export { default as pad } from "./pad";
export { default as padEnd } from "./padEnd";
export { default as padStart } from "./padStart";
export { default as parseInt } from "./parseInt";
export { default as partial } from "./partial";
export { default as partialRight } from "./partialRight";
export { default as partition } from "./partition";
export { default as pick } from "./pick";
export { default as pickBy } from "./pickBy";
export { default as property } from "./property";
export { default as propertyOf } from "./propertyOf";
export { default as pull } from "./pull";
export { default as pullAll } from "./pullAll";
export { default as pullAllBy } from "./pullAllBy";
export { default as pullAllWith } from "./pullAllWith";
export { default as pullAt } from "./pullAt";
export { default as random } from "./random";
export { default as range } from "./range";
export { default as rangeRight } from "./rangeRight";
export { default as rearg } from "./rearg";
export { default as reduce } from "./reduce";
export { default as reduceRight } from "./reduceRight";
export { default as reject } from "./reject";
export { default as remove } from "./remove";
export { default as repeat } from "./repeat";
export { default as replace } from "./replace";
export { default as rest } from "./rest";
export { default as result } from "./result";
export { default as reverse } from "./reverse";
export { default as round } from "./round";
export { default as sample } from "./sample";
export { default as sampleSize } from "./sampleSize";
export { default as set } from "./set";
export { default as setWith } from "./setWith";
export { default as shuffle } from "./shuffle";
export { default as size } from "./size";
export { default as slice } from "./slice";
export { default as snakeCase } from "./snakeCase";
export { default as some } from "./some";
export { default as sortBy } from "./sortBy";
export { default as sortedIndex } from "./sortedIndex";
export { default as sortedIndexBy } from "./sortedIndexBy";
export { default as sortedIndexOf } from "./sortedIndexOf";
export { default as sortedLastIndex } from "./sortedLastIndex";
export { default as sortedLastIndexBy } from "./sortedLastIndexBy";
export { default as sortedLastIndexOf } from "./sortedLastIndexOf";
export { default as sortedUniq } from "./sortedUniq";
export { default as sortedUniqBy } from "./sortedUniqBy";
export { default as split } from "./split";
export { default as spread } from "./spread";
export { default as startCase } from "./startCase";
export { default as startsWith } from "./startsWith";
export { default as stubArray } from "./stubArray";
export { default as stubFalse } from "./stubFalse";
export { default as stubObject } from "./stubObject";
export { default as stubString } from "./stubString";
export { default as stubTrue } from "./stubTrue";
export { default as subtract } from "./subtract";
export { default as sum } from "./sum";
export { default as sumBy } from "./sumBy";
export { default as tail } from "./tail";
export { default as take } from "./take";
export { default as takeRight } from "./takeRight";
export { default as takeRightWhile } from "./takeRightWhile";
export { default as takeWhile } from "./takeWhile";
export { default as template } from "./template";
export { default as templateSettings } from "./templateSettings";
export { default as throttle } from "./throttle";
export { default as times } from "./times";
export { default as toArray } from "./toArray";
export { default as toFinite } from "./toFinite";
export { default as toInteger } from "./toInteger";
export { default as toLength } from "./toLength";
export { default as toLower } from "./toLower";
export { default as toNumber } from "./toNumber";
export { default as toPairs } from "./toPairs";
export { default as toPairsIn } from "./toPairsIn";
export { default as toPath } from "./toPath";
export { default as toPlainObject } from "./toPlainObject";
export { default as toSafeInteger } from "./toSafeInteger";
export { default as toString } from "./toString";
export { default as toUpper } from "./toUpper";
export { default as transform } from "./transform";
export { default as trim } from "./trim";
export { default as trimEnd } from "./trimEnd";
export { default as trimStart } from "./trimStart";
export { default as truncate } from "./truncate";
export { default as unary } from "./unary";
export { default as unescape } from "./unescape";
export { default as union } from "./union";
export { default as unionBy } from "./unionBy";
export { default as unionWith } from "./unionWith";
export { default as uniq } from "./uniq";
export { default as uniqBy } from "./uniqBy";
export { default as uniqWith } from "./uniqWith";
export { default as uniqueId } from "./uniqueId";
export { default as unset } from "./unset";
export { default as unzip } from "./unzip";
export { default as unzipWith } from "./unzipWith";
export { default as update } from "./update";
export { default as updateWith } from "./updateWith";
export { default as upperCase } from "./upperCase";
export { default as upperFirst } from "./upperFirst";
export { default as values } from "./values";
export { default as valuesIn } from "./valuesIn";
export { default as without } from "./without";
export { default as words } from "./words";
export { default as wrap } from "./wrap";
export { default as xor } from "./xor";
export { default as xorBy } from "./xorBy";
export { default as xorWith } from "./xorWith";
export { default as zip } from "./zip";
export { default as zipObject } from "./zipObject";
export { default as zipObjectDeep } from "./zipObjectDeep";
export { default as zipWith } from "./zipWith";

58
types/lodash-es/lang.d.ts vendored Normal file
View File

@ -0,0 +1,58 @@
import { default as castArray } from "./castArray";
import { default as clone } from "./clone";
import { default as cloneDeep } from "./cloneDeep";
import { default as cloneDeepWith } from "./cloneDeepWith";
import { default as cloneWith } from "./cloneWith";
import { default as conformsTo } from "./conformsTo";
import { default as eq } from "./eq";
import { default as gt } from "./gt";
import { default as gte } from "./gte";
import { default as isArguments } from "./isArguments";
import { default as isArray } from "./isArray";
import { default as isArrayBuffer } from "./isArrayBuffer";
import { default as isArrayLike } from "./isArrayLike";
import { default as isArrayLikeObject } from "./isArrayLikeObject";
import { default as isBoolean } from "./isBoolean";
import { default as isBuffer } from "./isBuffer";
import { default as isDate } from "./isDate";
import { default as isElement } from "./isElement";
import { default as isEmpty } from "./isEmpty";
import { default as isEqual } from "./isEqual";
import { default as isEqualWith } from "./isEqualWith";
import { default as isError } from "./isError";
import { default as isFinite } from "./isFinite";
import { default as isFunction } from "./isFunction";
import { default as isInteger } from "./isInteger";
import { default as isLength } from "./isLength";
import { default as isMap } from "./isMap";
import { default as isMatch } from "./isMatch";
import { default as isMatchWith } from "./isMatchWith";
import { default as isNaN } from "./isNaN";
import { default as isNative } from "./isNative";
import { default as isNil } from "./isNil";
import { default as isNull } from "./isNull";
import { default as isNumber } from "./isNumber";
import { default as isObject } from "./isObject";
import { default as isObjectLike } from "./isObjectLike";
import { default as isPlainObject } from "./isPlainObject";
import { default as isRegExp } from "./isRegExp";
import { default as isSafeInteger } from "./isSafeInteger";
import { default as isSet } from "./isSet";
import { default as isString } from "./isString";
import { default as isSymbol } from "./isSymbol";
import { default as isTypedArray } from "./isTypedArray";
import { default as isUndefined } from "./isUndefined";
import { default as isWeakMap } from "./isWeakMap";
import { default as isWeakSet } from "./isWeakSet";
import { default as lt } from "./lt";
import { default as lte } from "./lte";
import { default as toArray } from "./toArray";
import { default as toFinite } from "./toFinite";
import { default as toInteger } from "./toInteger";
import { default as toLength } from "./toLength";
import { default as toNumber } from "./toNumber";
import { default as toPlainObject } from "./toPlainObject";
import { default as toSafeInteger } from "./toSafeInteger";
import { default as toString } from "./toString";
export { default } from "./lang.default";

116
types/lodash-es/lang.default.d.ts vendored Normal file
View File

@ -0,0 +1,116 @@
import castArray from "./castArray";
import clone from "./clone";
import cloneDeep from "./cloneDeep";
import cloneDeepWith from "./cloneDeepWith";
import cloneWith from "./cloneWith";
import conformsTo from "./conformsTo";
import eq from "./eq";
import gt from "./gt";
import gte from "./gte";
import isArguments from "./isArguments";
import isArray from "./isArray";
import isArrayBuffer from "./isArrayBuffer";
import isArrayLike from "./isArrayLike";
import isArrayLikeObject from "./isArrayLikeObject";
import isBoolean from "./isBoolean";
import isBuffer from "./isBuffer";
import isDate from "./isDate";
import isElement from "./isElement";
import isEmpty from "./isEmpty";
import isEqual from "./isEqual";
import isEqualWith from "./isEqualWith";
import isError from "./isError";
import isFinite from "./isFinite";
import isFunction from "./isFunction";
import isInteger from "./isInteger";
import isLength from "./isLength";
import isMap from "./isMap";
import isMatch from "./isMatch";
import isMatchWith from "./isMatchWith";
import isNaN from "./isNaN";
import isNative from "./isNative";
import isNil from "./isNil";
import isNull from "./isNull";
import isNumber from "./isNumber";
import isObject from "./isObject";
import isObjectLike from "./isObjectLike";
import isPlainObject from "./isPlainObject";
import isRegExp from "./isRegExp";
import isSafeInteger from "./isSafeInteger";
import isSet from "./isSet";
import isString from "./isString";
import isSymbol from "./isSymbol";
import isTypedArray from "./isTypedArray";
import isUndefined from "./isUndefined";
import isWeakMap from "./isWeakMap";
import isWeakSet from "./isWeakSet";
import lt from "./lt";
import lte from "./lte";
import toArray from "./toArray";
import toFinite from "./toFinite";
import toInteger from "./toInteger";
import toLength from "./toLength";
import toNumber from "./toNumber";
import toPlainObject from "./toPlainObject";
import toSafeInteger from "./toSafeInteger";
import toString from "./toString";
declare const defaultExport: {
castArray: typeof castArray;
clone: typeof clone;
cloneDeep: typeof cloneDeep;
cloneDeepWith: typeof cloneDeepWith;
cloneWith: typeof cloneWith;
conformsTo: typeof conformsTo;
eq: typeof eq;
gt: typeof gt;
gte: typeof gte;
isArguments: typeof isArguments;
isArray: typeof isArray;
isArrayBuffer: typeof isArrayBuffer;
isArrayLike: typeof isArrayLike;
isArrayLikeObject: typeof isArrayLikeObject;
isBoolean: typeof isBoolean;
isBuffer: typeof isBuffer;
isDate: typeof isDate;
isElement: typeof isElement;
isEmpty: typeof isEmpty;
isEqual: typeof isEqual;
isEqualWith: typeof isEqualWith;
isError: typeof isError;
isFinite: typeof isFinite;
isFunction: typeof isFunction;
isInteger: typeof isInteger;
isLength: typeof isLength;
isMap: typeof isMap;
isMatch: typeof isMatch;
isMatchWith: typeof isMatchWith;
isNaN: typeof isNaN;
isNative: typeof isNative;
isNil: typeof isNil;
isNull: typeof isNull;
isNumber: typeof isNumber;
isObject: typeof isObject;
isObjectLike: typeof isObjectLike;
isPlainObject: typeof isPlainObject;
isRegExp: typeof isRegExp;
isSafeInteger: typeof isSafeInteger;
isSet: typeof isSet;
isString: typeof isString;
isSymbol: typeof isSymbol;
isTypedArray: typeof isTypedArray;
isUndefined: typeof isUndefined;
isWeakMap: typeof isWeakMap;
isWeakSet: typeof isWeakSet;
lt: typeof lt;
lte: typeof lte;
toArray: typeof toArray;
toFinite: typeof toFinite;
toInteger: typeof toInteger;
toLength: typeof toLength;
toNumber: typeof toNumber;
toPlainObject: typeof toPlainObject;
toSafeInteger: typeof toSafeInteger;
toString: typeof toString;
};
export default defaultExport;

View File

@ -1,3 +1,605 @@
import add from "lodash-es/add";
import after from "lodash-es/after";
import ary from "lodash-es/ary";
import assign from "lodash-es/assign";
import assignIn from "lodash-es/assignIn";
import assignInWith from "lodash-es/assignInWith";
import assignWith from "lodash-es/assignWith";
import at from "lodash-es/at";
import attempt from "lodash-es/attempt";
import before from "lodash-es/before";
import bind from "lodash-es/bind";
import bindAll from "lodash-es/bindAll";
import bindKey from "lodash-es/bindKey";
import camelCase from "lodash-es/camelCase";
import capitalize from "lodash-es/capitalize";
import castArray from "lodash-es/castArray";
import ceil from "lodash-es/ceil";
import chunk from "lodash-es/chunk";
import clamp from "lodash-es/clamp";
import clone from "lodash-es/clone";
import cloneDeep from "lodash-es/cloneDeep";
import cloneDeepWith from "lodash-es/cloneDeepWith";
import cloneWith from "lodash-es/cloneWith";
import compact from "lodash-es/compact";
import concat from "lodash-es/concat";
import cond from "lodash-es/cond";
import conforms from "lodash-es/conforms";
import conformsTo from "lodash-es/conformsTo";
import constant from "lodash-es/constant";
import countBy from "lodash-es/countBy";
import create from "lodash-es/create";
import curry from "lodash-es/curry";
import curryRight from "lodash-es/curryRight";
import debounce from "lodash-es/debounce";
import deburr from "lodash-es/deburr";
import defaultTo from "lodash-es/defaultTo";
import defaults from "lodash-es/defaults";
import defaultsDeep from "lodash-es/defaultsDeep";
import defer from "lodash-es/defer";
import delay from "lodash-es/delay";
import difference from "lodash-es/difference";
import differenceBy from "lodash-es/differenceBy";
import differenceWith from "lodash-es/differenceWith";
import divide from "lodash-es/divide";
import drop from "lodash-es/drop";
import dropRight from "lodash-es/dropRight";
import dropRightWhile from "lodash-es/dropRightWhile";
import dropWhile from "lodash-es/dropWhile";
import each from "lodash-es/each";
import eachRight from "lodash-es/eachRight";
import endsWith from "lodash-es/endsWith";
import entries from "lodash-es/entries";
import entriesIn from "lodash-es/entriesIn";
import eq from "lodash-es/eq";
import escape from "lodash-es/escape";
import escapeRegExp from "lodash-es/escapeRegExp";
import every from "lodash-es/every";
import extend from "lodash-es/extend";
import extendWith from "lodash-es/extendWith";
import fill from "lodash-es/fill";
import filter from "lodash-es/filter";
import find from "lodash-es/find";
import findIndex from "lodash-es/findIndex";
import findKey from "lodash-es/findKey";
import findLast from "lodash-es/findLast";
import findLastIndex from "lodash-es/findLastIndex";
import findLastKey from "lodash-es/findLastKey";
import first from "lodash-es/first";
import flatMap from "lodash-es/flatMap";
import flatMapDeep from "lodash-es/flatMapDeep";
import flatMapDepth from "lodash-es/flatMapDepth";
import flatten from "lodash-es/flatten";
import flattenDeep from "lodash-es/flattenDeep";
import flattenDepth from "lodash-es/flattenDepth";
import flip from "lodash-es/flip";
import floor from "lodash-es/floor";
import flow from "lodash-es/flow";
import flowRight from "lodash-es/flowRight";
import forEach from "lodash-es/forEach";
import forEachRight from "lodash-es/forEachRight";
import forIn from "lodash-es/forIn";
import forInRight from "lodash-es/forInRight";
import forOwn from "lodash-es/forOwn";
import forOwnRight from "lodash-es/forOwnRight";
import fromPairs from "lodash-es/fromPairs";
import functions from "lodash-es/functions";
import functionsIn from "lodash-es/functionsIn";
import get from "lodash-es/get";
import groupBy from "lodash-es/groupBy";
import gt from "lodash-es/gt";
import gte from "lodash-es/gte";
import has from "lodash-es/has";
import hasIn from "lodash-es/hasIn";
import head from "lodash-es/head";
import identity from "lodash-es/identity";
import inRange from "lodash-es/inRange";
import includes from "lodash-es/includes";
import indexOf from "lodash-es/indexOf";
import initial from "lodash-es/initial";
import intersection from "lodash-es/intersection";
import intersectionBy from "lodash-es/intersectionBy";
import intersectionWith from "lodash-es/intersectionWith";
import invert from "lodash-es/invert";
import invertBy from "lodash-es/invertBy";
import invoke from "lodash-es/invoke";
import invokeMap from "lodash-es/invokeMap";
import isArguments from "lodash-es/isArguments";
import isArray from "lodash-es/isArray";
import isArrayBuffer from "lodash-es/isArrayBuffer";
import isArrayLike from "lodash-es/isArrayLike";
import isArrayLikeObject from "lodash-es/isArrayLikeObject";
import isBoolean from "lodash-es/isBoolean";
import isBuffer from "lodash-es/isBuffer";
import isDate from "lodash-es/isDate";
import isElement from "lodash-es/isElement";
import isEmpty from "lodash-es/isEmpty";
import isEqual from "lodash-es/isEqual";
import isEqualWith from "lodash-es/isEqualWith";
import isError from "lodash-es/isError";
import isFinite from "lodash-es/isFinite";
import isFunction from "lodash-es/isFunction";
import isInteger from "lodash-es/isInteger";
import isLength from "lodash-es/isLength";
import isMap from "lodash-es/isMap";
import isMatch from "lodash-es/isMatch";
import isMatchWith from "lodash-es/isMatchWith";
import isNaN from "lodash-es/isNaN";
import isNative from "lodash-es/isNative";
import isNil from "lodash-es/isNil";
import isNull from "lodash-es/isNull";
import isNumber from "lodash-es/isNumber";
import isObject from "lodash-es/isObject";
import isObjectLike from "lodash-es/isObjectLike";
import isPlainObject from "lodash-es/isPlainObject";
import isRegExp from "lodash-es/isRegExp";
import isSafeInteger from "lodash-es/isSafeInteger";
import isSet from "lodash-es/isSet";
import isString from "lodash-es/isString";
import isSymbol from "lodash-es/isSymbol";
import isTypedArray from "lodash-es/isTypedArray";
import isUndefined from "lodash-es/isUndefined";
import isWeakMap from "lodash-es/isWeakMap";
import isWeakSet from "lodash-es/isWeakSet";
import iteratee from "lodash-es/iteratee";
import join from "lodash-es/join";
import kebabCase from "lodash-es/kebabCase";
import keyBy from "lodash-es/keyBy";
import keys from "lodash-es/keys";
import keysIn from "lodash-es/keysIn";
import last from "lodash-es/last";
import lastIndexOf from "lodash-es/lastIndexOf";
import lowerCase from "lodash-es/lowerCase";
import lowerFirst from "lodash-es/lowerFirst";
import lt from "lodash-es/lt";
import lte from "lodash-es/lte";
import map from "lodash-es/map";
import mapKeys from "lodash-es/mapKeys";
import mapValues from "lodash-es/mapValues";
import matches from "lodash-es/matches";
import matchesProperty from "lodash-es/matchesProperty";
import max from "lodash-es/max";
import maxBy from "lodash-es/maxBy";
import mean from "lodash-es/mean";
import meanBy from "lodash-es/meanBy";
import memoize from "lodash-es/memoize";
import merge from "lodash-es/merge";
import mergeWith from "lodash-es/mergeWith";
import method from "lodash-es/method";
import methodOf from "lodash-es/methodOf";
import min from "lodash-es/min";
import minBy from "lodash-es/minBy";
import mixin from "lodash-es/mixin";
import multiply from "lodash-es/multiply";
import negate from "lodash-es/negate";
import noop from "lodash-es/noop";
import now from "lodash-es/now";
import nth from "lodash-es/nth";
import nthArg from "lodash-es/nthArg";
import omit from "lodash-es/omit";
import omitBy from "lodash-es/omitBy";
import once from "lodash-es/once";
import orderBy from "lodash-es/orderBy";
import over from "lodash-es/over";
import overArgs from "lodash-es/overArgs";
import overEvery from "lodash-es/overEvery";
import overSome from "lodash-es/overSome";
import pad from "lodash-es/pad";
import padEnd from "lodash-es/padEnd";
import padStart from "lodash-es/padStart";
import parseInt from "lodash-es/parseInt";
import partial from "lodash-es/partial";
import partialRight from "lodash-es/partialRight";
import partition from "lodash-es/partition";
import pick from "lodash-es/pick";
import pickBy from "lodash-es/pickBy";
import property from "lodash-es/property";
import propertyOf from "lodash-es/propertyOf";
import pull from "lodash-es/pull";
import pullAll from "lodash-es/pullAll";
import pullAllBy from "lodash-es/pullAllBy";
import pullAllWith from "lodash-es/pullAllWith";
import pullAt from "lodash-es/pullAt";
import random from "lodash-es/random";
import range from "lodash-es/range";
import rangeRight from "lodash-es/rangeRight";
import rearg from "lodash-es/rearg";
import reduce from "lodash-es/reduce";
import reduceRight from "lodash-es/reduceRight";
import reject from "lodash-es/reject";
import remove from "lodash-es/remove";
import repeat from "lodash-es/repeat";
import replace from "lodash-es/replace";
import rest from "lodash-es/rest";
import result from "lodash-es/result";
import reverse from "lodash-es/reverse";
import round from "lodash-es/round";
import sample from "lodash-es/sample";
import sampleSize from "lodash-es/sampleSize";
import set from "lodash-es/set";
import setWith from "lodash-es/setWith";
import shuffle from "lodash-es/shuffle";
import size from "lodash-es/size";
import slice from "lodash-es/slice";
import snakeCase from "lodash-es/snakeCase";
import some from "lodash-es/some";
import sortBy from "lodash-es/sortBy";
import sortedIndex from "lodash-es/sortedIndex";
import sortedIndexBy from "lodash-es/sortedIndexBy";
import sortedIndexOf from "lodash-es/sortedIndexOf";
import sortedLastIndex from "lodash-es/sortedLastIndex";
import sortedLastIndexBy from "lodash-es/sortedLastIndexBy";
import sortedLastIndexOf from "lodash-es/sortedLastIndexOf";
import sortedUniq from "lodash-es/sortedUniq";
import sortedUniqBy from "lodash-es/sortedUniqBy";
import split from "lodash-es/split";
import spread from "lodash-es/spread";
import startCase from "lodash-es/startCase";
import startsWith from "lodash-es/startsWith";
import stubArray from "lodash-es/stubArray";
import stubFalse from "lodash-es/stubFalse";
import stubObject from "lodash-es/stubObject";
import stubString from "lodash-es/stubString";
import stubTrue from "lodash-es/stubTrue";
import subtract from "lodash-es/subtract";
import sum from "lodash-es/sum";
import sumBy from "lodash-es/sumBy";
import tail from "lodash-es/tail";
import take from "lodash-es/take";
import takeRight from "lodash-es/takeRight";
import takeRightWhile from "lodash-es/takeRightWhile";
import takeWhile from "lodash-es/takeWhile";
import template from "lodash-es/template";
import templateSettings from "lodash-es/templateSettings";
import throttle from "lodash-es/throttle";
import times from "lodash-es/times";
import toArray from "lodash-es/toArray";
import toFinite from "lodash-es/toFinite";
import toInteger from "lodash-es/toInteger";
import toLength from "lodash-es/toLength";
import toLower from "lodash-es/toLower";
import toNumber from "lodash-es/toNumber";
import toPairs from "lodash-es/toPairs";
import toPairsIn from "lodash-es/toPairsIn";
import toPath from "lodash-es/toPath";
import toPlainObject from "lodash-es/toPlainObject";
import toSafeInteger from "lodash-es/toSafeInteger";
import toString from "lodash-es/toString";
import toUpper from "lodash-es/toUpper";
import transform from "lodash-es/transform";
import trim from "lodash-es/trim";
import trimEnd from "lodash-es/trimEnd";
import trimStart from "lodash-es/trimStart";
import truncate from "lodash-es/truncate";
import unary from "lodash-es/unary";
import unescape from "lodash-es/unescape";
import union from "lodash-es/union";
import unionBy from "lodash-es/unionBy";
import unionWith from "lodash-es/unionWith";
import uniq from "lodash-es/uniq";
import uniqBy from "lodash-es/uniqBy";
import uniqWith from "lodash-es/uniqWith";
import uniqueId from "lodash-es/uniqueId";
import unset from "lodash-es/unset";
import unzip from "lodash-es/unzip";
import unzipWith from "lodash-es/unzipWith";
import update from "lodash-es/update";
import updateWith from "lodash-es/updateWith";
import upperCase from "lodash-es/upperCase";
import upperFirst from "lodash-es/upperFirst";
import values from "lodash-es/values";
import valuesIn from "lodash-es/valuesIn";
import without from "lodash-es/without";
import words from "lodash-es/words";
import wrap from "lodash-es/wrap";
import xor from "lodash-es/xor";
import xorBy from "lodash-es/xorBy";
import xorWith from "lodash-es/xorWith";
import zip from "lodash-es/zip";
import zipObject from "lodash-es/zipObject";
import zipObjectDeep from "lodash-es/zipObjectDeep";
import zipWith from "lodash-es/zipWith";
kebabCase("chickenWings");
import {
add as add1,
after as after1,
ary as ary1,
assign as assign1,
assignIn as assignIn1,
assignInWith as assignInWith1,
assignWith as assignWith1,
at as at1,
attempt as attempt1,
before as before1,
bind as bind1,
bindAll as bindAll1,
bindKey as bindKey1,
camelCase as camelCase1,
capitalize as capitalize1,
castArray as castArray1,
ceil as ceil1,
chunk as chunk1,
clamp as clamp1,
clone as clone1,
cloneDeep as cloneDeep1,
cloneDeepWith as cloneDeepWith1,
cloneWith as cloneWith1,
compact as compact1,
concat as concat1,
cond as cond1,
conforms as conforms1,
conformsTo as conformsTo1,
constant as constant1,
countBy as countBy1,
create as create1,
curry as curry1,
curryRight as curryRight1,
debounce as debounce1,
deburr as deburr1,
defaultTo as defaultTo1,
defaults as defaults1,
defaultsDeep as defaultsDeep1,
defer as defer1,
delay as delay1,
difference as difference1,
differenceBy as differenceBy1,
differenceWith as differenceWith1,
divide as divide1,
drop as drop1,
dropRight as dropRight1,
dropRightWhile as dropRightWhile1,
dropWhile as dropWhile1,
each as each1,
eachRight as eachRight1,
endsWith as endsWith1,
entries as entries1,
entriesIn as entriesIn1,
eq as eq1,
escape as escape1,
escapeRegExp as escapeRegExp1,
every as every1,
extend as extend1,
extendWith as extendWith1,
fill as fill1,
filter as filter1,
find as find1,
findIndex as findIndex1,
findKey as findKey1,
findLast as findLast1,
findLastIndex as findLastIndex1,
findLastKey as findLastKey1,
first as first1,
flatMap as flatMap1,
flatMapDeep as flatMapDeep1,
flatMapDepth as flatMapDepth1,
flatten as flatten1,
flattenDeep as flattenDeep1,
flattenDepth as flattenDepth1,
flip as flip1,
floor as floor1,
flow as flow1,
flowRight as flowRight1,
forEach as forEach1,
forEachRight as forEachRight1,
forIn as forIn1,
forInRight as forInRight1,
forOwn as forOwn1,
forOwnRight as forOwnRight1,
fromPairs as fromPairs1,
functions as functions1,
functionsIn as functionsIn1,
get as get1,
groupBy as groupBy1,
gt as gt1,
gte as gte1,
has as has1,
hasIn as hasIn1,
head as head1,
identity as identity1,
inRange as inRange1,
includes as includes1,
indexOf as indexOf1,
initial as initial1,
intersection as intersection1,
intersectionBy as intersectionBy1,
intersectionWith as intersectionWith1,
invert as invert1,
invertBy as invertBy1,
invoke as invoke1,
invokeMap as invokeMap1,
isArguments as isArguments1,
isArray as isArray1,
isArrayBuffer as isArrayBuffer1,
isArrayLike as isArrayLike1,
isArrayLikeObject as isArrayLikeObject1,
isBoolean as isBoolean1,
isBuffer as isBuffer1,
isDate as isDate1,
isElement as isElement1,
isEmpty as isEmpty1,
isEqual as isEqual1,
isEqualWith as isEqualWith1,
isError as isError1,
isFinite as isFinite1,
isFunction as isFunction1,
isInteger as isInteger1,
isLength as isLength1,
isMap as isMap1,
isMatch as isMatch1,
isMatchWith as isMatchWith1,
isNaN as isNaN1,
isNative as isNative1,
isNil as isNil1,
isNull as isNull1,
isNumber as isNumber1,
isObject as isObject1,
isObjectLike as isObjectLike1,
isPlainObject as isPlainObject1,
isRegExp as isRegExp1,
isSafeInteger as isSafeInteger1,
isSet as isSet1,
isString as isString1,
isSymbol as isSymbol1,
isTypedArray as isTypedArray1,
isUndefined as isUndefined1,
isWeakMap as isWeakMap1,
isWeakSet as isWeakSet1,
iteratee as iteratee1,
join as join1,
kebabCase as kebabCase1,
keyBy as keyBy1,
keys as keys1,
keysIn as keysIn1,
last as last1,
lastIndexOf as lastIndexOf1,
lowerCase as lowerCase1,
lowerFirst as lowerFirst1,
lt as lt1,
lte as lte1,
map as map1,
mapKeys as mapKeys1,
mapValues as mapValues1,
matches as matches1,
matchesProperty as matchesProperty1,
max as max1,
maxBy as maxBy1,
mean as mean1,
meanBy as meanBy1,
memoize as memoize1,
merge as merge1,
mergeWith as mergeWith1,
method as method1,
methodOf as methodOf1,
min as min1,
minBy as minBy1,
mixin as mixin1,
multiply as multiply1,
negate as negate1,
noop as noop1,
now as now1,
nth as nth1,
nthArg as nthArg1,
omit as omit1,
omitBy as omitBy1,
once as once1,
orderBy as orderBy1,
over as over1,
overArgs as overArgs1,
overEvery as overEvery1,
overSome as overSome1,
pad as pad1,
padEnd as padEnd1,
padStart as padStart1,
parseInt as parseInt1,
partial as partial1,
partialRight as partialRight1,
partition as partition1,
pick as pick1,
pickBy as pickBy1,
property as property1,
propertyOf as propertyOf1,
pull as pull1,
pullAll as pullAll1,
pullAllBy as pullAllBy1,
pullAllWith as pullAllWith1,
pullAt as pullAt1,
random as random1,
range as range1,
rangeRight as rangeRight1,
rearg as rearg1,
reduce as reduce1,
reduceRight as reduceRight1,
reject as reject1,
remove as remove1,
repeat as repeat1,
replace as replace1,
rest as rest1,
result as result1,
reverse as reverse1,
round as round1,
sample as sample1,
sampleSize as sampleSize1,
set as set1,
setWith as setWith1,
shuffle as shuffle1,
size as size1,
slice as slice1,
snakeCase as snakeCase1,
some as some1,
sortBy as sortBy1,
sortedIndex as sortedIndex1,
sortedIndexBy as sortedIndexBy1,
sortedIndexOf as sortedIndexOf1,
sortedLastIndex as sortedLastIndex1,
sortedLastIndexBy as sortedLastIndexBy1,
sortedLastIndexOf as sortedLastIndexOf1,
sortedUniq as sortedUniq1,
sortedUniqBy as sortedUniqBy1,
split as split1,
spread as spread1,
startCase as startCase1,
startsWith as startsWith1,
stubArray as stubArray1,
stubFalse as stubFalse1,
stubObject as stubObject1,
stubString as stubString1,
stubTrue as stubTrue1,
subtract as subtract1,
sum as sum1,
sumBy as sumBy1,
tail as tail1,
take as take1,
takeRight as takeRight1,
takeRightWhile as takeRightWhile1,
takeWhile as takeWhile1,
template as template1,
templateSettings as templateSettings1,
throttle as throttle1,
times as times1,
toArray as toArray1,
toFinite as toFinite1,
toInteger as toInteger1,
toLength as toLength1,
toLower as toLower1,
toNumber as toNumber1,
toPairs as toPairs1,
toPairsIn as toPairsIn1,
toPath as toPath1,
toPlainObject as toPlainObject1,
toSafeInteger as toSafeInteger1,
toString as toString1,
toUpper as toUpper1,
transform as transform1,
trim as trim1,
trimEnd as trimEnd1,
trimStart as trimStart1,
truncate as truncate1,
unary as unary1,
unescape as unescape1,
union as union1,
unionBy as unionBy1,
unionWith as unionWith1,
uniq as uniq1,
uniqBy as uniqBy1,
uniqWith as uniqWith1,
uniqueId as uniqueId1,
unset as unset1,
unzip as unzip1,
unzipWith as unzipWith1,
update as update1,
updateWith as updateWith1,
upperCase as upperCase1,
upperFirst as upperFirst1,
values as values1,
valuesIn as valuesIn1,
without as without1,
words as words1,
wrap as wrap1,
xor as xor1,
xorBy as xorBy1,
xorWith as xorWith1,
zip as zip1,
zipObject as zipObject1,
zipObjectDeep as zipObjectDeep1,
zipWith as zipWith1
} from "lodash-es";

17
types/lodash-es/math.d.ts vendored Normal file
View File

@ -0,0 +1,17 @@
import { default as add } from "./add";
import { default as ceil } from "./ceil";
import { default as divide } from "./divide";
import { default as floor } from "./floor";
import { default as max } from "./max";
import { default as maxBy } from "./maxBy";
import { default as mean } from "./mean";
import { default as meanBy } from "./meanBy";
import { default as min } from "./min";
import { default as minBy } from "./minBy";
import { default as multiply } from "./multiply";
import { default as round } from "./round";
import { default as subtract } from "./subtract";
import { default as sum } from "./sum";
import { default as sumBy } from "./sumBy";
export { default } from "./math.default";

34
types/lodash-es/math.default.d.ts vendored Normal file
View File

@ -0,0 +1,34 @@
import add from "./add";
import ceil from "./ceil";
import divide from "./divide";
import floor from "./floor";
import max from "./max";
import maxBy from "./maxBy";
import mean from "./mean";
import meanBy from "./meanBy";
import min from "./min";
import minBy from "./minBy";
import multiply from "./multiply";
import round from "./round";
import subtract from "./subtract";
import sum from "./sum";
import sumBy from "./sumBy";
declare const defaultExport: {
add: typeof add;
ceil: typeof ceil;
divide: typeof divide;
floor: typeof floor;
max: typeof max;
maxBy: typeof maxBy;
mean: typeof mean;
meanBy: typeof meanBy;
min: typeof min;
minBy: typeof minBy;
multiply: typeof multiply;
round: typeof round;
subtract: typeof subtract;
sum: typeof sum;
sumBy: typeof sumBy;
};
export default defaultExport;

2
types/lodash-es/multiply.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { multiply } from "lodash";
export default multiply;

View File

@ -1,2 +0,0 @@
import { noConflict } from "lodash";
export default noConflict;

5
types/lodash-es/number.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
import { default as clamp } from "./clamp";
import { default as inRange } from "./inRange";
import { default as random } from "./random";
export { default } from "./number.default";

10
types/lodash-es/number.default.d.ts vendored Normal file
View File

@ -0,0 +1,10 @@
import clamp from "./clamp";
import inRange from "./inRange";
import random from "./random";
declare const defaultExport: {
clamp: typeof clamp;
inRange: typeof inRange;
random: typeof random;
};
export default defaultExport;

49
types/lodash-es/object.d.ts vendored Normal file
View File

@ -0,0 +1,49 @@
import { default as assign } from "./assign";
import { default as assignIn } from "./assignIn";
import { default as assignInWith } from "./assignInWith";
import { default as assignWith } from "./assignWith";
import { default as at } from "./at";
import { default as create } from "./create";
import { default as defaults } from "./defaults";
import { default as defaultsDeep } from "./defaultsDeep";
import { default as entries } from "./entries";
import { default as entriesIn } from "./entriesIn";
import { default as extend } from "./extend";
import { default as extendWith } from "./extendWith";
import { default as findKey } from "./findKey";
import { default as findLastKey } from "./findLastKey";
import { default as forIn } from "./forIn";
import { default as forInRight } from "./forInRight";
import { default as forOwn } from "./forOwn";
import { default as forOwnRight } from "./forOwnRight";
import { default as functions } from "./functions";
import { default as functionsIn } from "./functionsIn";
import { default as get } from "./get";
import { default as has } from "./has";
import { default as hasIn } from "./hasIn";
import { default as invert } from "./invert";
import { default as invertBy } from "./invertBy";
import { default as invoke } from "./invoke";
import { default as keys } from "./keys";
import { default as keysIn } from "./keysIn";
import { default as mapKeys } from "./mapKeys";
import { default as mapValues } from "./mapValues";
import { default as merge } from "./merge";
import { default as mergeWith } from "./mergeWith";
import { default as omit } from "./omit";
import { default as omitBy } from "./omitBy";
import { default as pick } from "./pick";
import { default as pickBy } from "./pickBy";
import { default as result } from "./result";
import { default as set } from "./set";
import { default as setWith } from "./setWith";
import { default as toPairs } from "./toPairs";
import { default as toPairsIn } from "./toPairsIn";
import { default as transform } from "./transform";
import { default as unset } from "./unset";
import { default as update } from "./update";
import { default as updateWith } from "./updateWith";
import { default as values } from "./values";
import { default as valuesIn } from "./valuesIn";
export { default } from "./object.default";

98
types/lodash-es/object.default.d.ts vendored Normal file
View File

@ -0,0 +1,98 @@
import assign from "./assign";
import assignIn from "./assignIn";
import assignInWith from "./assignInWith";
import assignWith from "./assignWith";
import at from "./at";
import create from "./create";
import defaults from "./defaults";
import defaultsDeep from "./defaultsDeep";
import entries from "./entries";
import entriesIn from "./entriesIn";
import extend from "./extend";
import extendWith from "./extendWith";
import findKey from "./findKey";
import findLastKey from "./findLastKey";
import forIn from "./forIn";
import forInRight from "./forInRight";
import forOwn from "./forOwn";
import forOwnRight from "./forOwnRight";
import functions from "./functions";
import functionsIn from "./functionsIn";
import get from "./get";
import has from "./has";
import hasIn from "./hasIn";
import invert from "./invert";
import invertBy from "./invertBy";
import invoke from "./invoke";
import keys from "./keys";
import keysIn from "./keysIn";
import mapKeys from "./mapKeys";
import mapValues from "./mapValues";
import merge from "./merge";
import mergeWith from "./mergeWith";
import omit from "./omit";
import omitBy from "./omitBy";
import pick from "./pick";
import pickBy from "./pickBy";
import result from "./result";
import set from "./set";
import setWith from "./setWith";
import toPairs from "./toPairs";
import toPairsIn from "./toPairsIn";
import transform from "./transform";
import unset from "./unset";
import update from "./update";
import updateWith from "./updateWith";
import values from "./values";
import valuesIn from "./valuesIn";
declare const defaultExport: {
assign: typeof assign;
assignIn: typeof assignIn;
assignInWith: typeof assignInWith;
assignWith: typeof assignWith;
at: typeof at;
create: typeof create;
defaults: typeof defaults;
defaultsDeep: typeof defaultsDeep;
entries: typeof entries;
entriesIn: typeof entriesIn;
extend: typeof extend;
extendWith: typeof extendWith;
findKey: typeof findKey;
findLastKey: typeof findLastKey;
forIn: typeof forIn;
forInRight: typeof forInRight;
forOwn: typeof forOwn;
forOwnRight: typeof forOwnRight;
functions: typeof functions;
functionsIn: typeof functionsIn;
get: typeof get;
has: typeof has;
hasIn: typeof hasIn;
invert: typeof invert;
invertBy: typeof invertBy;
invoke: typeof invoke;
keys: typeof keys;
keysIn: typeof keysIn;
mapKeys: typeof mapKeys;
mapValues: typeof mapValues;
merge: typeof merge;
mergeWith: typeof mergeWith;
omit: typeof omit;
omitBy: typeof omitBy;
pick: typeof pick;
pickBy: typeof pickBy;
result: typeof result;
set: typeof set;
setWith: typeof setWith;
toPairs: typeof toPairs;
toPairsIn: typeof toPairsIn;
transform: typeof transform;
unset: typeof unset;
update: typeof update;
updateWith: typeof updateWith;
values: typeof values;
valuesIn: typeof valuesIn;
};
export default defaultExport;

View File

@ -1,2 +0,0 @@
import { runInContext } from "lodash";
export default runInContext;

View File

@ -0,0 +1,180 @@
// Usage: ts-node generate-modules.ts
/// <reference types="node" />
import * as fs from "fs";
import { STATUS_CODES } from "http";
import { get } from "https";
import * as path from "path";
import * as prettier from 'prettier';
const GROUP_WITH_DEFAULTS = [
'array',
'collection',
'function',
'date',
'lang',
'math',
'number',
'object',
'string',
'util',
];
const SPECIAL_DEFAULTS = ['seq'];
const SPECIAL_DEFAULTS_OF_SEQ = [
'at',
'lodash',
'reverse',
'value',
];
const SRC_REGEXP = /default\s\{([^\}]+)}/;
main().catch(console.error);
async function main() {
const versionObject = await getPackageVersion();
const results = await getDefaultsDefinitions(versionObject.fullVersion);
const extractedResults = results.map(extractDefaults).map(arr => arr.sort());
const tsFiles = [];
GROUP_WITH_DEFAULTS.forEach((group, index) => {
console.log(group);
// output per file per module
extractedResults[index].forEach((module) => {
console.log(` ${module}`);
// Generate local module
const moduleFilename = `${module}.d.ts`;
tsFiles.push(moduleFilename);
writeFileSync(path.join("..", moduleFilename), `import { ${module} } from "lodash";\nexport default ${module};\n`);
});
// output default
const defaultModule = `${group}.default.d.ts`;
tsFiles.push(defaultModule);
console.log(' ' + defaultModule);
writeFileSync(path.join("..", defaultModule), `${extractedResults[index].map(val => `import ${val} from "./${val}";`).join('\n')}\n
declare const defaultExport: {\n${extractedResults[index].map(val => `${val}: typeof ${val};`).join('\n')} };
export default defaultExport;\n`);
// output group file
const groupFilename = `${group}.d.ts`;
tsFiles.push(groupFilename);
console.log(' ' + groupFilename);
writeFileSync(path.join("..", groupFilename), `${extractedResults[index].map(val => `import { default as ${val} } from "./${val}";`).join('\n')}\n
export { default } from './${group}.default';\n`);
});
const flattenModules = extractedResults.reduce((acc, cur) => acc.concat(cur), []).sort();
// output full
console.log('index.d.ts');
writeFileSync(path.join('..', 'index.d.ts'), globalDefinitionText('lodash-es', versionObject.majorMinor,
`${flattenModules.map(val => `export { default as ${val} } from "./${val}";`).join('\n')}\n`));
// output test file
console.log('lodash-es-tests.ts');
writeFileSync(path.join('..', 'lodash-es-tests.ts'), `${flattenModules.map(val => `import ${val} from "lodash-es/${val}";`).join('\n')}\n
import { ${flattenModules.map(val => `${val} as ${val}1`).join(',')}} from 'lodash-es';\n`);
// output tsconfig
console.log('tsconfig.json');
tsFiles.sort().unshift('index.d.ts', 'lodash-es-tests.ts');
writeFileSync(path.join('..', 'tsconfig.json'), tsconfig(tsFiles));
}
function formatFile(contents) {
return prettier.format(contents, {
parser: 'typescript'
});
}
function writeFileSync(filePath: string, contents) {
const source = filePath.endsWith('ts') ? formatFile(contents) : contents;
fs.writeFileSync(filePath, source);
}
function extractDefaults(source) {
return SRC_REGEXP.exec(source)[1].split(',').map((val) => val.trim());
}
async function getDefaultsDefinitions(fullVersion) {
return Promise.all(GROUP_WITH_DEFAULTS.map(
(group) => loadString(`https://unpkg.com/lodash-es@${fullVersion}/${group}.default.js`)
));
}
async function getPackageVersion() {
const fullName = "lodash-es";
const url = `https://registry.npmjs.org/${fullName.toLowerCase()}`;
const npmInfo = JSON.parse(await loadString(url));
const fullVersion = npmInfo["dist-tags"].latest;
const majorMinor = fullVersion.split(".").slice(0, 2).join(".");
return {
fullVersion,
majorMinor
};
}
function globalDefinitionText(fullName, majorMinor, allModulesImports): string {
return `
// Type definitions for ${fullName} ${majorMinor}
// Project: http://lodash.com/
// Definitions by: Stephen Lautier <https://github.com/stephenlautier>, e-cloud <https://github.com/e-cloud>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
${allModulesImports}
`.trim() + '\n';
}
function tsconfig(files) {
return JSON.stringify({
compilerOptions: {
module: "commonjs",
lib: [
"es6"
],
noImplicitAny: true,
noImplicitThis: true,
strictNullChecks: true,
strictFunctionTypes: true,
baseUrl: "../",
typeRoots: [
"../"
],
types: [],
noEmit: true,
forceConsistentCasingInFileNames: true
},
files
}, undefined, 4) + '\n';
}
function tslint() {
return `{ "extends": "dtslint/dt.json" }\n`;
}
function loadString(url: string): Promise<string> {
return new Promise((resolve, reject) => {
get(url, (res) => {
if (res.statusCode !== 200) {
return reject(new Error(`HTTP Error ${res.statusCode}: ${STATUS_CODES[res.statusCode || 500]} for ${url}`));
}
let rawData = "";
res.on("data", chunk => rawData += chunk);
res.on("end", () => resolve(rawData));
}).on("error", reject);
});
}

View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "es6",
"baseUrl": "../..",
"typeRoots": [
"../../"
],
"types": []
}
}

33
types/lodash-es/string.d.ts vendored Normal file
View File

@ -0,0 +1,33 @@
import { default as camelCase } from "./camelCase";
import { default as capitalize } from "./capitalize";
import { default as deburr } from "./deburr";
import { default as endsWith } from "./endsWith";
import { default as escape } from "./escape";
import { default as escapeRegExp } from "./escapeRegExp";
import { default as kebabCase } from "./kebabCase";
import { default as lowerCase } from "./lowerCase";
import { default as lowerFirst } from "./lowerFirst";
import { default as pad } from "./pad";
import { default as padEnd } from "./padEnd";
import { default as padStart } from "./padStart";
import { default as parseInt } from "./parseInt";
import { default as repeat } from "./repeat";
import { default as replace } from "./replace";
import { default as snakeCase } from "./snakeCase";
import { default as split } from "./split";
import { default as startCase } from "./startCase";
import { default as startsWith } from "./startsWith";
import { default as template } from "./template";
import { default as templateSettings } from "./templateSettings";
import { default as toLower } from "./toLower";
import { default as toUpper } from "./toUpper";
import { default as trim } from "./trim";
import { default as trimEnd } from "./trimEnd";
import { default as trimStart } from "./trimStart";
import { default as truncate } from "./truncate";
import { default as unescape } from "./unescape";
import { default as upperCase } from "./upperCase";
import { default as upperFirst } from "./upperFirst";
import { default as words } from "./words";
export { default } from "./string.default";

66
types/lodash-es/string.default.d.ts vendored Normal file
View File

@ -0,0 +1,66 @@
import camelCase from "./camelCase";
import capitalize from "./capitalize";
import deburr from "./deburr";
import endsWith from "./endsWith";
import escape from "./escape";
import escapeRegExp from "./escapeRegExp";
import kebabCase from "./kebabCase";
import lowerCase from "./lowerCase";
import lowerFirst from "./lowerFirst";
import pad from "./pad";
import padEnd from "./padEnd";
import padStart from "./padStart";
import parseInt from "./parseInt";
import repeat from "./repeat";
import replace from "./replace";
import snakeCase from "./snakeCase";
import split from "./split";
import startCase from "./startCase";
import startsWith from "./startsWith";
import template from "./template";
import templateSettings from "./templateSettings";
import toLower from "./toLower";
import toUpper from "./toUpper";
import trim from "./trim";
import trimEnd from "./trimEnd";
import trimStart from "./trimStart";
import truncate from "./truncate";
import unescape from "./unescape";
import upperCase from "./upperCase";
import upperFirst from "./upperFirst";
import words from "./words";
declare const defaultExport: {
camelCase: typeof camelCase;
capitalize: typeof capitalize;
deburr: typeof deburr;
endsWith: typeof endsWith;
escape: typeof escape;
escapeRegExp: typeof escapeRegExp;
kebabCase: typeof kebabCase;
lowerCase: typeof lowerCase;
lowerFirst: typeof lowerFirst;
pad: typeof pad;
padEnd: typeof padEnd;
padStart: typeof padStart;
parseInt: typeof parseInt;
repeat: typeof repeat;
replace: typeof replace;
snakeCase: typeof snakeCase;
split: typeof split;
startCase: typeof startCase;
startsWith: typeof startsWith;
template: typeof template;
templateSettings: typeof templateSettings;
toLower: typeof toLower;
toUpper: typeof toUpper;
trim: typeof trim;
trimEnd: typeof trimEnd;
trimStart: typeof trimStart;
truncate: typeof truncate;
unescape: typeof unescape;
upperCase: typeof upperCase;
upperFirst: typeof upperFirst;
words: typeof words;
};
export default defaultExport;

2
types/lodash-es/stubArray.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { stubArray } from "lodash";
export default stubArray;

2
types/lodash-es/stubFalse.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { stubFalse } from "lodash";
export default stubFalse;

2
types/lodash-es/stubObject.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { stubObject } from "lodash";
export default stubObject;

2
types/lodash-es/stubString.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { stubString } from "lodash";
export default stubString;

2
types/lodash-es/stubTrue.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { stubTrue } from "lodash";
export default stubTrue;

View File

@ -1,2 +0,0 @@
import { tap } from "lodash";
export default tap;

2
types/lodash-es/templateSettings.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { templateSettings } from "lodash";
export default templateSettings;

View File

@ -1,2 +0,0 @@
import { thru } from "lodash";
export default thru;

View File

@ -21,6 +21,8 @@
"lodash-es-tests.ts",
"add.d.ts",
"after.d.ts",
"array.d.ts",
"array.default.d.ts",
"ary.d.ts",
"assign.d.ts",
"assignIn.d.ts",
@ -36,23 +38,29 @@
"capitalize.d.ts",
"castArray.d.ts",
"ceil.d.ts",
"chain.d.ts",
"chunk.d.ts",
"clamp.d.ts",
"clone.d.ts",
"cloneDeep.d.ts",
"cloneDeepWith.d.ts",
"cloneWith.d.ts",
"collection.d.ts",
"collection.default.d.ts",
"compact.d.ts",
"concat.d.ts",
"cond.d.ts",
"conforms.d.ts",
"conformsTo.d.ts",
"constant.d.ts",
"countBy.d.ts",
"create.d.ts",
"curry.d.ts",
"curryRight.d.ts",
"date.d.ts",
"date.default.d.ts",
"debounce.d.ts",
"deburr.d.ts",
"defaultTo.d.ts",
"defaults.d.ts",
"defaultsDeep.d.ts",
"defer.d.ts",
@ -102,6 +110,8 @@
"forOwn.d.ts",
"forOwnRight.d.ts",
"fromPairs.d.ts",
"function.d.ts",
"function.default.d.ts",
"functions.d.ts",
"functionsIn.d.ts",
"get.d.ts",
@ -112,10 +122,10 @@
"hasIn.d.ts",
"head.d.ts",
"identity.d.ts",
"inRange.d.ts",
"includes.d.ts",
"indexOf.d.ts",
"initial.d.ts",
"inRange.d.ts",
"intersection.d.ts",
"intersectionBy.d.ts",
"intersectionWith.d.ts",
@ -166,6 +176,8 @@
"keyBy.d.ts",
"keys.d.ts",
"keysIn.d.ts",
"lang.d.ts",
"lang.default.d.ts",
"last.d.ts",
"lastIndexOf.d.ts",
"lowerCase.d.ts",
@ -177,6 +189,8 @@
"mapValues.d.ts",
"matches.d.ts",
"matchesProperty.d.ts",
"math.d.ts",
"math.default.d.ts",
"max.d.ts",
"maxBy.d.ts",
"mean.d.ts",
@ -189,12 +203,16 @@
"min.d.ts",
"minBy.d.ts",
"mixin.d.ts",
"multiply.d.ts",
"negate.d.ts",
"noConflict.d.ts",
"noop.d.ts",
"now.d.ts",
"nth.d.ts",
"nthArg.d.ts",
"number.d.ts",
"number.default.d.ts",
"object.d.ts",
"object.default.d.ts",
"omit.d.ts",
"omitBy.d.ts",
"once.d.ts",
@ -233,7 +251,6 @@
"result.d.ts",
"reverse.d.ts",
"round.d.ts",
"runInContext.d.ts",
"sample.d.ts",
"sampleSize.d.ts",
"set.d.ts",
@ -256,6 +273,13 @@
"spread.d.ts",
"startCase.d.ts",
"startsWith.d.ts",
"string.d.ts",
"string.default.d.ts",
"stubArray.d.ts",
"stubFalse.d.ts",
"stubObject.d.ts",
"stubString.d.ts",
"stubTrue.d.ts",
"subtract.d.ts",
"sum.d.ts",
"sumBy.d.ts",
@ -264,10 +288,9 @@
"takeRight.d.ts",
"takeRightWhile.d.ts",
"takeWhile.d.ts",
"tap.d.ts",
"template.d.ts",
"templateSettings.d.ts",
"throttle.d.ts",
"thru.d.ts",
"times.d.ts",
"toArray.d.ts",
"toFinite.d.ts",
@ -294,8 +317,8 @@
"unionWith.d.ts",
"uniq.d.ts",
"uniqBy.d.ts",
"uniqueId.d.ts",
"uniqWith.d.ts",
"uniqueId.d.ts",
"unset.d.ts",
"unzip.d.ts",
"unzipWith.d.ts",
@ -303,6 +326,8 @@
"updateWith.d.ts",
"upperCase.d.ts",
"upperFirst.d.ts",
"util.d.ts",
"util.default.d.ts",
"values.d.ts",
"valuesIn.d.ts",
"without.d.ts",
@ -316,4 +341,4 @@
"zipObjectDeep.d.ts",
"zipWith.d.ts"
]
}
}

34
types/lodash-es/util.d.ts vendored Normal file
View File

@ -0,0 +1,34 @@
import { default as attempt } from "./attempt";
import { default as bindAll } from "./bindAll";
import { default as cond } from "./cond";
import { default as conforms } from "./conforms";
import { default as constant } from "./constant";
import { default as defaultTo } from "./defaultTo";
import { default as flow } from "./flow";
import { default as flowRight } from "./flowRight";
import { default as identity } from "./identity";
import { default as iteratee } from "./iteratee";
import { default as matches } from "./matches";
import { default as matchesProperty } from "./matchesProperty";
import { default as method } from "./method";
import { default as methodOf } from "./methodOf";
import { default as mixin } from "./mixin";
import { default as noop } from "./noop";
import { default as nthArg } from "./nthArg";
import { default as over } from "./over";
import { default as overEvery } from "./overEvery";
import { default as overSome } from "./overSome";
import { default as property } from "./property";
import { default as propertyOf } from "./propertyOf";
import { default as range } from "./range";
import { default as rangeRight } from "./rangeRight";
import { default as stubArray } from "./stubArray";
import { default as stubFalse } from "./stubFalse";
import { default as stubObject } from "./stubObject";
import { default as stubString } from "./stubString";
import { default as stubTrue } from "./stubTrue";
import { default as times } from "./times";
import { default as toPath } from "./toPath";
import { default as uniqueId } from "./uniqueId";
export { default } from "./util.default";

68
types/lodash-es/util.default.d.ts vendored Normal file
View File

@ -0,0 +1,68 @@
import attempt from "./attempt";
import bindAll from "./bindAll";
import cond from "./cond";
import conforms from "./conforms";
import constant from "./constant";
import defaultTo from "./defaultTo";
import flow from "./flow";
import flowRight from "./flowRight";
import identity from "./identity";
import iteratee from "./iteratee";
import matches from "./matches";
import matchesProperty from "./matchesProperty";
import method from "./method";
import methodOf from "./methodOf";
import mixin from "./mixin";
import noop from "./noop";
import nthArg from "./nthArg";
import over from "./over";
import overEvery from "./overEvery";
import overSome from "./overSome";
import property from "./property";
import propertyOf from "./propertyOf";
import range from "./range";
import rangeRight from "./rangeRight";
import stubArray from "./stubArray";
import stubFalse from "./stubFalse";
import stubObject from "./stubObject";
import stubString from "./stubString";
import stubTrue from "./stubTrue";
import times from "./times";
import toPath from "./toPath";
import uniqueId from "./uniqueId";
declare const defaultExport: {
attempt: typeof attempt;
bindAll: typeof bindAll;
cond: typeof cond;
conforms: typeof conforms;
constant: typeof constant;
defaultTo: typeof defaultTo;
flow: typeof flow;
flowRight: typeof flowRight;
identity: typeof identity;
iteratee: typeof iteratee;
matches: typeof matches;
matchesProperty: typeof matchesProperty;
method: typeof method;
methodOf: typeof methodOf;
mixin: typeof mixin;
noop: typeof noop;
nthArg: typeof nthArg;
over: typeof over;
overEvery: typeof overEvery;
overSome: typeof overSome;
property: typeof property;
propertyOf: typeof propertyOf;
range: typeof range;
rangeRight: typeof rangeRight;
stubArray: typeof stubArray;
stubFalse: typeof stubFalse;
stubObject: typeof stubObject;
stubString: typeof stubString;
stubTrue: typeof stubTrue;
times: typeof times;
toPath: typeof toPath;
uniqueId: typeof uniqueId;
};
export default defaultExport;

View File

@ -0,0 +1,15 @@
# If some one want to update lodash modules, you must run this script under the same dir where it lives.
# Or you can run them(generate-modules.ts) separately by hand
#!/usr/bin/env bash
npm i ts-node -g
ts-node ./generate-modules.ts
cd ../../../
npm i prettier -D
cd types/lodash-es/scripts
ts-node ./generate-modules.ts

View File

@ -18,25 +18,15 @@ async function main(): Promise<void> {
}
}
const lodashEsDir = path.join("..", "..", "lodash-es");
// Generate lodash/tsconfig.json
fs.writeFileSync(path.join("..", "tsconfig.json"), lodashTsconfig(all));
// Generate lodash-es index and tsconfig
fs.writeFileSync(path.join(lodashEsDir, "index.d.ts"), lodashEsIndex(all));
//`export {\n ${all.join(",\n ")}\n} from "lodash";\n`);
fs.writeFileSync(path.join(lodashEsDir, "tsconfig.json"), lodashEsTsconfig(all));
for (const module of all) {
console.log(module);
// Generate local module
fs.writeFileSync(path.join("..", `${module}.d.ts`), `import { ${module} } from "./index";\nexport = ${module};\n`);
// Generate lodash-es module
fs.writeFileSync(path.join(lodashEsDir, `${module}.d.ts`), `import { ${module} } from "lodash";\nexport default ${module};\n`);
// Generate `lodash.foo` module
if (!notOnNpm.has(module)) {
const dir = path.join("..", "..", `lodash.${module.toLowerCase()}`);
@ -84,6 +74,7 @@ function compilerOptions(): object {
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
@ -92,21 +83,6 @@ function compilerOptions(): object {
"noEmit": true,
"forceConsistentCasingInFileNames": true
};
};
function lodashEsIndex(moduleNames: ReadonlyArray<string>): string {
return `// Type definitions for lodash-es 4.14
// Project: http://lodash.com/
// Definitions by: Stephen Lautier <https://github.com/stephenlautier>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts
export {
${moduleNames.join(",\n ")}
} from "lodash";
`;
}
function lodashTsconfig(moduleNames: ReadonlyArray<string>): string {
@ -120,17 +96,6 @@ function lodashTsconfig(moduleNames: ReadonlyArray<string>): string {
}, undefined, 4);
}
function lodashEsTsconfig(moduleNames: ReadonlyArray<string>): string {
return JSON.stringify({
compilerOptions: compilerOptions(),
files: [
"index.d.ts",
"lodash-es-tests.ts",
...moduleNames.map(m => `${m}.d.ts`),
]
}, undefined, 4);
}
function lodashDotFooTsconfig(): string {
return JSON.stringify({
compilerOptions: compilerOptions(),