| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938 |
- import _ = require("../index");
- declare module "../index" {
- 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 invoked with one argument: (value).
- *
- * @param collection The collection to iterate over.
- * @param iteratee The function invoked per iteration.
- * @return Returns the composed aggregate object.
- */
- countBy<T>(collection: List<T> | null | undefined, iteratee?: ValueIteratee<T>): Dictionary<number>;
- /**
- * @see _.countBy
- */
- countBy<T extends object>(collection: T | null | undefined, iteratee?: ValueIteratee<T[keyof T]>): Dictionary<number>;
- }
- interface Object<T> {
- /**
- * @see _.countBy
- */
- countBy(iteratee?: ValueIteratee<T[keyof T]>): Object<Dictionary<number>>;
- }
- interface String {
- /**
- * @see _.countBy
- */
- countBy(iteratee?: ValueIteratee<string>): Object<Dictionary<number>>;
- }
- interface Collection<T> {
- /**
- * @see _.countBy
- */
- countBy(iteratee?: ValueIteratee<T>): Object<Dictionary<number>>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.countBy
- */
- countBy(iteratee?: ValueIteratee<T[keyof T]>): ObjectChain<Dictionary<number>>;
- }
- interface StringChain {
- /**
- * @see _.countBy
- */
- countBy(iteratee?: ValueIteratee<string>): ObjectChain<Dictionary<number>>;
- }
- interface StringNullableChain {
- /**
- * @see _.countBy
- */
- countBy(iteratee?: ValueIteratee<string>): ObjectChain<Dictionary<number>>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.countBy
- */
- countBy(iteratee?: ValueIteratee<T>): ObjectChain<Dictionary<number>>;
- }
- interface LoDashStatic {
- /**
- * @see _.forEach
- */
- each: LoDashStatic['forEach'];
- }
- interface String {
- /**
- * @see _.each
- */
- each: String['forEach'];
- }
- interface Collection<T> {
- /**
- * @see _.each
- */
- each: Collection<T>['forEach'];
- }
- interface Object<T> {
- /**
- * @see _.each
- */
- each: Object<T>['forEach'];
- }
- interface StringChain {
- /**
- * @see _.each
- */
- each: StringChain['forEach'];
- }
- interface StringNullableChain {
- /**
- * @see _.each
- */
- each: StringNullableChain['forEach'];
- }
- interface CollectionChain<T> {
- /**
- * @see _.each
- */
- each: CollectionChain<T>['forEach'];
- }
- interface ObjectChain<T> {
- /**
- * @see _.each
- */
- each: ObjectChain<T>['forEach'];
- }
- interface LoDashStatic {
- /**
- * @see _.forEachRight
- */
- eachRight: LoDashStatic["forEachRight"];
- }
- interface String {
- /**
- * @see _.eachRight
- */
- eachRight: String['forEachRight'];
- }
- interface Collection<T> {
- /**
- * @see _.eachRight
- */
- eachRight: Collection<T>['forEachRight'];
- }
- interface Object<T> {
- /**
- * @see _.eachRight
- */
- eachRight: Object<T>['forEachRight'];
- }
- interface StringChain {
- /**
- * @see _.eachRight
- */
- eachRight: StringChain['forEachRight'];
- }
- interface StringNullableChain {
- /**
- * @see _.eachRight
- */
- eachRight: StringNullableChain['forEachRight'];
- }
- interface CollectionChain<T> {
- /**
- * @see _.eachRight
- */
- eachRight: CollectionChain<T>['forEachRight'];
- }
- interface ObjectChain<T> {
- /**
- * @see _.eachRight
- */
- eachRight: ObjectChain<T>['forEachRight'];
- }
- 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<T>(collection: List<T> | null | undefined, predicate?: ListIterateeCustom<T, boolean>): boolean;
- /**
- * @see _.every
- */
- every<T extends object>(collection: T | null | undefined, predicate?: ObjectIterateeCustom<T, boolean>): boolean;
- }
- interface Collection<T> {
- /**
- * @see _.every
- */
- every(predicate?: ListIterateeCustom<T, boolean>): boolean;
- }
- interface Object<T> {
- /**
- * @see _.every
- */
- every(predicate?: ObjectIterateeCustom<T, boolean>): boolean;
- }
- interface CollectionChain<T> {
- /**
- * @see _.every
- */
- every(predicate?: ListIterateeCustom<T, boolean>): PrimitiveChain<boolean>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.every
- */
- every(predicate?: ObjectIterateeCustom<T, boolean>): PrimitiveChain<boolean>;
- }
- interface LoDashStatic {
- /**
- * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. 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 the new filtered array.
- */
- filter(collection: string | null | undefined, predicate?: StringIterator<boolean>): string[];
- /**
- * @see _.filter
- */
- filter<T, S extends T>(collection: List<T> | null | undefined, predicate: ListIteratorTypeGuard<T, S>): S[];
- /**
- * @see _.filter
- */
- filter<T>(collection: List<T> | null | undefined, predicate?: ListIterateeCustom<T, boolean>): T[];
- /**
- * @see _.filter
- */
- filter<T extends object, S extends T[keyof T]>(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard<T, S>): S[];
- /**
- * @see _.filter
- */
- filter<T extends object>(collection: T | null | undefined, predicate?: ObjectIterateeCustom<T, boolean>): Array<T[keyof T]>;
- }
- interface String {
- /**
- * @see _.filter
- */
- filter(predicate?: StringIterator<boolean>): Collection<string>;
- }
- interface Collection<T> {
- /**
- * @see _.filter
- */
- filter<S extends T>(predicate: ListIteratorTypeGuard<T, S>): Collection<S>;
- /**
- * @see _.filter
- */
- filter(predicate?: ListIterateeCustom<T, boolean>): Collection<T>;
- }
- interface Object<T> {
- /**
- * @see _.filter
- */
- filter<S extends T[keyof T]>(predicate: ObjectIteratorTypeGuard<T, S>): Collection<S>;
- /**
- * @see _.filter
- */
- filter(predicate?: ObjectIterateeCustom<T, boolean>): Collection<T[keyof T]>;
- }
- interface StringChain {
- /**
- * @see _.filter
- */
- filter(predicate?: StringIterator<boolean>): CollectionChain<string>;
- }
- interface StringNullableChain {
- /**
- * @see _.filter
- */
- filter(predicate?: StringIterator<boolean>): CollectionChain<string>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.filter
- */
- filter<S extends T>(predicate: ListIteratorTypeGuard<T, S>): CollectionChain<S>;
- /**
- * @see _.filter
- */
- filter(predicate?: ListIterateeCustom<T, boolean>): CollectionChain<T>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.filter
- */
- filter<S extends T[keyof T]>(predicate: ObjectIteratorTypeGuard<T, S>): CollectionChain<S>;
- /**
- * @see _.filter
- */
- filter(predicate?: ObjectIterateeCustom<T, boolean>): CollectionChain<T[keyof T]>;
- }
- interface LoDashStatic {
- /**
- * Iterates over elements of collection, returning the first element predicate returns truthy for.
- * The predicate is invoked with three arguments: (value, index|key, collection).
- *
- * @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<T, S extends T>(collection: List<T> | null | undefined, predicate: ListIteratorTypeGuard<T, S>, fromIndex?: number): S|undefined;
- /**
- * @see _.find
- */
- find<T>(collection: List<T> | null | undefined, predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): T|undefined;
- /**
- * @see _.find
- */
- find<T extends object, S extends T[keyof T]>(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard<T, S>, fromIndex?: number): S|undefined;
- /**
- * @see _.find
- */
- find<T extends object>(collection: T | null | undefined, predicate?: ObjectIterateeCustom<T, boolean>, fromIndex?: number): T[keyof T]|undefined;
- }
- interface Collection<T> {
- /**
- * @see _.find
- */
- find<S extends T>(predicate: ListIteratorTypeGuard<T, S>, fromIndex?: number): S|undefined;
- /**
- * @see _.find
- */
- find(predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): T|undefined;
- }
- interface Object<T> {
- /**
- * @see _.find
- */
- find< S extends T[keyof T]>(predicate: ObjectIteratorTypeGuard<T, S>, fromIndex?: number): S|undefined;
- /**
- * @see _.find
- */
- find(predicate?: ObjectIterateeCustom<T, boolean>, fromIndex?: number): T[keyof T]|undefined;
- }
- interface CollectionChain<T> {
- /**
- * @see _.find
- */
- find< S extends T>(predicate: ListIteratorTypeGuard<T, S>, fromIndex?: number): ExpChain<S|undefined>;
- /**
- * @see _.find
- */
- find(predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): ExpChain<T|undefined>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.find
- */
- find< S extends T[keyof T]>(predicate: ObjectIteratorTypeGuard<T, S>, fromIndex?: number): ExpChain<S|undefined>;
- /**
- * @see _.find
- */
- find(predicate?: ObjectIterateeCustom<T, boolean>, fromIndex?: number): ExpChain<T[keyof T]|undefined>;
- }
- 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 predicate The function called per iteration.
- * @param fromIndex The index to search from.
- * @return The found element, else undefined.
- */
- findLast<T, S extends T>(collection: List<T> | null | undefined, predicate: ListIteratorTypeGuard<T, S>, fromIndex?: number): S|undefined;
- /**
- * @see _.findLast
- */
- findLast<T>(collection: List<T> | null | undefined, predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): T|undefined;
- /**
- * @see _.findLast
- */
- findLast<T extends object, S extends T[keyof T]>(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard<T, S>, fromIndex?: number): S|undefined;
- /**
- * @see _.findLast
- */
- findLast<T extends object>(collection: T | null | undefined, predicate?: ObjectIterateeCustom<T, boolean>, fromIndex?: number): T[keyof T]|undefined;
- }
- interface Collection<T> {
- /**
- * @see _.findLast
- */
- findLast<S extends T>(predicate: ListIteratorTypeGuard<T, S>, fromIndex?: number): S|undefined;
- /**
- * @see _.findLast
- */
- findLast(predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): T|undefined;
- }
- interface Object<T> {
- /**
- * @see _.findLast
- */
- findLast< S extends T[keyof T]>(predicate: ObjectIteratorTypeGuard<T, S>, fromIndex?: number): S|undefined;
- /**
- * @see _.findLast
- */
- findLast(predicate?: ObjectIterateeCustom<T, boolean>, fromIndex?: number): T[keyof T]|undefined;
- }
- interface CollectionChain<T> {
- /**
- * @see _.findLast
- */
- findLast< S extends T>(predicate: ListIteratorTypeGuard<T, S>, fromIndex?: number): ExpChain<S|undefined>;
- /**
- * @see _.findLast
- */
- findLast(predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): ExpChain<T|undefined>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.findLast
- */
- findLast< S extends T[keyof T]>(predicate: ObjectIteratorTypeGuard<T, S>, fromIndex?: number): ExpChain<S|undefined>;
- /**
- * @see _.findLast
- */
- findLast(predicate?: ObjectIterateeCustom<T, boolean>, fromIndex?: number): ExpChain<T[keyof T]|undefined>;
- }
- 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<T>(collection: Dictionary<Many<T>> | NumericDictionary<Many<T>> | null | undefined): T[];
- /**
- * @see _.flatMap
- */
- flatMap(collection: object | null | undefined): any[];
- /**
- * @see _.flatMap
- */
- flatMap<T, TResult>(collection: List<T> | null | undefined, iteratee: ListIterator<T, Many<TResult>>): TResult[];
- /**
- * @see _.flatMap
- */
- flatMap<T extends object, TResult>(collection: T | null | undefined, iteratee: ObjectIterator<T, Many<TResult>>): TResult[];
- /**
- * @see _.flatMap
- */
- flatMap(collection: object | null | undefined, iteratee: string): any[];
- /**
- * @see _.flatMap
- */
- flatMap(collection: object | null | undefined, iteratee: object): boolean[];
- }
- interface String {
- /**
- * @see _.flatMap
- */
- flatMap<TResult>(iteratee: StringIterator<Many<TResult>>): Collection<TResult>;
- /**
- * @see _.flatMap
- */
- flatMap(): Collection<string>;
- }
- interface Collection<T> {
- /**
- * @see _.flatMap
- */
- flatMap<TResult = any>(iteratee: ListIterator<T, Many<TResult>> | PropertyName): Collection<TResult>;
- /**
- * @see _.flatMap
- */
- flatMap(iteratee: [PropertyName, any] | object): Collection<boolean>;
- /**
- * @see _.flatMap
- */
- flatMap(): T extends Many<infer U> ? Collection<U> : Collection<T>;
- }
- interface Object<T> {
- /**
- * @see _.flatMap
- */
- flatMap<TResult = any>(iteratee: ObjectIterator<T, Many<TResult>> | PropertyName): Collection<TResult>;
- /**
- * @see _.flatMap
- */
- flatMap(iteratee: [PropertyName, any] | object): Collection<boolean>;
- /**
- * @see _.flatMap
- */
- flatMap(): Collection<T[keyof T]>;
- }
- interface StringChain {
- /**
- * @see _.flatMap
- */
- flatMap<TResult>(iteratee: StringIterator<Many<TResult>>): CollectionChain<TResult>;
- /**
- * @see _.flatMap
- */
- flatMap(): CollectionChain<string>;
- }
- interface StringNullableChain {
- /**
- * @see _.flatMap
- */
- flatMap<TResult>(iteratee: StringIterator<Many<TResult>>): CollectionChain<TResult>;
- /**
- * @see _.flatMap
- */
- flatMap(): CollectionChain<string>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.flatMap
- */
- flatMap<TResult = any>(iteratee: ListIterator<T, Many<TResult>> | PropertyName): CollectionChain<TResult>;
- /**
- * @see _.flatMap
- */
- flatMap(iteratee: [PropertyName, any] | object): CollectionChain<boolean>;
- /**
- * @see _.flatMap
- */
- flatMap(): T extends Many<infer U> ? CollectionChain<U> : CollectionChain<T>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.flatMap
- */
- flatMap<TResult = any>(iteratee: ObjectIterator<T, Many<TResult>> | PropertyName): CollectionChain<TResult>;
- /**
- * @see _.flatMap
- */
- flatMap(iteratee: [PropertyName, any] | object): CollectionChain<boolean>;
- /**
- * @see _.flatMap
- */
- flatMap(): CollectionChain<T[keyof T]>;
- }
- interface LoDashStatic {
- /**
- * This method is like `_.flatMap` except that it recursively flattens the
- * mapped results.
- *
- * @since 4.7.0
- * @category Collection
- * @param collection The collection to iterate over.
- * @param [iteratee=_.identity] The function invoked per iteration.
- * @returns Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [[[n, n]]];
- * }
- *
- * _.flatMapDeep([1, 2], duplicate);
- * // => [1, 1, 2, 2]
- */
- flatMapDeep<T>(collection: Dictionary<ListOfRecursiveArraysOrValues<T> | T> | NumericDictionary<ListOfRecursiveArraysOrValues<T> | T> | null | undefined): T[];
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep<T, TResult>(collection: List<T> | null | undefined, iteratee: ListIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult>): TResult[];
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep<T extends object, TResult>(collection: T | null | undefined, iteratee: ObjectIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult>): TResult[];
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(collection: object | null | undefined, iteratee: string): any[];
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(collection: object | null | undefined, iteratee: object): boolean[];
- }
- interface String {
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep<TResult>(iteratee: StringIterator<ListOfRecursiveArraysOrValues<TResult> | TResult>): Collection<TResult>;
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(): Collection<string>;
- }
- interface Collection<T> {
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep<TResult = any>(iteratee: ListIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult> | PropertyName): Collection<TResult>;
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(iteratee: [PropertyName, any] | object): Collection<boolean>;
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(): Collection<T>;
- }
- interface Object<T> {
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep<TResult = any>(iteratee: ObjectIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult> | PropertyName): Collection<TResult>;
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(iteratee: [PropertyName, any] | object): Collection<boolean>;
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(): Collection<T[keyof T]>;
- }
- interface StringChain {
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep<TResult>(iteratee: StringIterator<ListOfRecursiveArraysOrValues<TResult> | TResult>): CollectionChain<TResult>;
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(): CollectionChain<string>;
- }
- interface StringNullableChain {
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep<TResult>(iteratee: StringIterator<ListOfRecursiveArraysOrValues<TResult> | TResult>): CollectionChain<TResult>;
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(): CollectionChain<string>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep<TResult = any>(iteratee: ListIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult> | PropertyName): CollectionChain<TResult>;
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(iteratee: [PropertyName, any] | object): CollectionChain<boolean>;
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(): CollectionChain<T>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep<TResult = any>(iteratee: ObjectIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult> | PropertyName): CollectionChain<TResult>;
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(iteratee: [PropertyName, any] | object): CollectionChain<boolean>;
- /**
- * @see _.flatMapDeep
- */
- flatMapDeep(): CollectionChain<T[keyof T]>;
- }
- interface LoDashStatic {
- /**
- * This method is like `_.flatMap` except that it recursively flattens the
- * mapped results up to `depth` times.
- *
- * @since 4.7.0
- * @category Collection
- * @param collection The collection to iterate over.
- * @param [iteratee=_.identity] The function invoked per iteration.
- * @param [depth=1] The maximum recursion depth.
- * @returns Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [[[n, n]]];
- * }
- *
- * _.flatMapDepth([1, 2], duplicate, 2);
- * // => [[1, 1], [2, 2]]
- */
- flatMapDepth<T>(collection: Dictionary<ListOfRecursiveArraysOrValues<T> | T> | NumericDictionary<ListOfRecursiveArraysOrValues<T> | T> | null | undefined): T[];
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth<T, TResult>(collection: List<T> | null | undefined, iteratee: ListIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult>, depth?: number): TResult[];
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth<T extends object, TResult>(collection: T | null | undefined, iteratee: ObjectIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult>, depth?: number): TResult[];
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(collection: object | null | undefined, iteratee: string, depth?: number): any[];
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(collection: object | null | undefined, iteratee: object, depth?: number): boolean[];
- }
- interface String {
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth<TResult>(iteratee: StringIterator<ListOfRecursiveArraysOrValues<TResult> | TResult>, depth?: number): Collection<TResult>;
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(depth?: number): Collection<string>;
- }
- interface Collection<T> {
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth<TResult = any>(iteratee: ListIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult> | PropertyName, depth?: number): Collection<TResult>;
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(iteratee: [PropertyName, any] | object, depth?: number): Collection<boolean>;
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(depth?: number): Collection<T>;
- }
- interface Object<T> {
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth<TResult = any>(iteratee: ObjectIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult> | PropertyName, depth?: number): Collection<TResult>;
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(iteratee: [PropertyName, any] | object, depth?: number): Collection<boolean>;
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(depth?: number): Collection<T[keyof T]>;
- }
- interface StringChain {
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth<TResult>(iteratee: StringIterator<ListOfRecursiveArraysOrValues<TResult> | TResult>, depth?: number): CollectionChain<TResult>;
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(depth?: number): CollectionChain<string>;
- }
- interface StringNullableChain {
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth<TResult>(iteratee: StringIterator<ListOfRecursiveArraysOrValues<TResult> | TResult>, depth?: number): CollectionChain<TResult>;
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(depth?: number): CollectionChain<string>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth<TResult = any>(iteratee: ListIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult> | PropertyName, depth?: number): CollectionChain<TResult>;
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(iteratee: [PropertyName, any] | object, depth?: number): CollectionChain<boolean>;
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(depth?: number): CollectionChain<T>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth<TResult = any>(iteratee: ObjectIterator<T, ListOfRecursiveArraysOrValues<TResult> | TResult> | PropertyName, depth?: number): CollectionChain<TResult>;
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(iteratee: [PropertyName, any] | object, depth?: number): CollectionChain<boolean>;
- /**
- * @see _.flatMapDepth
- */
- flatMapDepth(depth?: number): CollectionChain<T[keyof T]>;
- }
- interface LoDashStatic {
- /**
- * Iterates over elements of collection invoking iteratee for each element. The iteratee is 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.
- */
- forEach<T>(collection: T[], iteratee?: ArrayIterator<T, any>): T[];
- /**
- * @see _.forEach
- */
- forEach(collection: string, iteratee?: StringIterator<any>): string;
- /**
- * @see _.forEach
- */
- forEach<T>(collection: List<T>, iteratee?: ListIterator<T, any>): List<T>;
- /**
- * @see _.forEach
- */
- forEach<T extends object>(collection: T, iteratee?: ObjectIterator<T, any>): T;
- /**
- * @see _.forEach
- */
- forEach<T, TArray extends T[] | null | undefined>(collection: TArray & (T[] | null | undefined), iteratee?: ArrayIterator<T, any>): TArray;
- /**
- * @see _.forEach
- */
- forEach<TString extends string | null | undefined>(collection: TString, iteratee?: StringIterator<any>): TString;
- /**
- * @see _.forEach
- */
- forEach<T, TList extends List<T> | null | undefined>(collection: TList & (List<T> | null | undefined), iteratee?: ListIterator<T, any>): TList;
- /**
- * @see _.forEach
- */
- forEach<T extends object>(collection: T | null | undefined, iteratee?: ObjectIterator<T, any>): T | null | undefined;
- }
- interface String {
- /**
- * @see _.forEach
- */
- forEach(iteratee?: StringIterator<any>): String;
- }
- interface Object<T> {
- /**
- * @see _.forEach
- */
- forEach(iteratee?: ObjectIterator<T, any>): Object<T>;
- }
- interface Collection<T> {
- /**
- * @see _.forEach
- */
- forEach(iteratee?: ListIterator<T, any>): Collection<T>;
- }
- interface StringChain {
- /**
- * @see _.forEach
- */
- forEach(iteratee?: StringIterator<any>): StringChain;
- }
- interface StringNullableChain {
- /**
- * @see _.forEach
- */
- forEach(iteratee?: StringIterator<any>): StringNullableChain;
- }
- interface ObjectChain<T> {
- /**
- * @see _.forEach
- */
- forEach(iteratee?: ObjectIterator<T, any>): ObjectChain<T>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.forEach
- */
- forEach(iteratee?: ListIterator<T, any>): CollectionChain<T>;
- }
- 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.
- */
- forEachRight<T>(collection: T[], iteratee?: ArrayIterator<T, any>): T[];
- /**
- * @see _.forEachRight
- */
- forEachRight(collection: string, iteratee?: StringIterator<any>): string;
- /**
- * @see _.forEachRight
- */
- forEachRight<T>(collection: List<T>, iteratee?: ListIterator<T, any>): List<T>;
- /**
- * @see _.forEachRight
- */
- forEachRight<T extends object>(collection: T, iteratee?: ObjectIterator<T, any>): T;
- /**
- * @see _.forEachRight
- */
- forEachRight<T, TArray extends T[] | null | undefined>(collection: TArray & (T[] | null | undefined), iteratee?: ArrayIterator<T, any>): TArray;
- /**
- * @see _.forEachRight
- */
- forEachRight<TString extends string | null | undefined>(collection: TString, iteratee?: StringIterator<any>): TString;
- /**
- * @see _.forEachRight
- */
- forEachRight<T, TList extends List<T> | null | undefined>(collection: TList & (List<T> | null | undefined), iteratee?: ListIterator<T, any>): TList;
- /**
- * @see _.forEachRight
- */
- forEachRight<T extends object>(collection: T | null | undefined, iteratee?: ObjectIterator<T, any>): T | null | undefined;
- }
- interface String {
- /**
- * @see _.forEachRight
- */
- forEachRight(iteratee?: StringIterator<any>): String;
- }
- interface Object<T> {
- /**
- * @see _.forEachRight
- */
- forEachRight(iteratee?: ObjectIterator<T, any>): Object<T>;
- }
- interface Collection<T> {
- /**
- * @see _.forEachRight
- */
- forEachRight(iteratee?: ListIterator<T, any>): Collection<T>;
- }
- interface StringChain {
- /**
- * @see _.forEachRight
- */
- forEachRight(iteratee?: StringIterator<any>): StringChain;
- }
- interface StringNullableChain {
- /**
- * @see _.forEachRight
- */
- forEachRight(iteratee?: StringIterator<any>): StringNullableChain;
- }
- interface ObjectChain<T> {
- /**
- * @see _.forEachRight
- */
- forEachRight(iteratee?: ObjectIterator<T, any>): ObjectChain<T>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.forEachRight
- */
- forEachRight(iteratee?: ListIterator<T, any>): CollectionChain<T>;
- }
- 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 invoked with one argument: (value).
- *
- * @param collection The collection to iterate over.
- * @param iteratee The function invoked per iteration.
- * @return Returns the composed aggregate object.
- */
- groupBy<T>(collection: List<T> | null | undefined, iteratee?: ValueIteratee<T>): Dictionary<T[]>;
- /**
- * @see _.groupBy
- */
- groupBy<T extends object>(collection: T | null | undefined, iteratee?: ValueIteratee<T[keyof T]>): Dictionary<Array<T[keyof T]>>;
- }
- interface String {
- /**
- * @see _.groupBy
- */
- groupBy(iteratee?: ValueIteratee<string>): Object<Dictionary<string[]>>;
- }
- interface Collection<T> {
- /**
- * @see _.groupBy
- */
- groupBy(iteratee?: ValueIteratee<T>): Object<Dictionary<T[]>>;
- }
- interface Object<T> {
- /**
- * @see _.groupBy
- */
- groupBy(iteratee?: ValueIteratee<T[keyof T]>): Object<Dictionary<Array<T[keyof T]>>>;
- }
- interface StringChain {
- /**
- * @see _.groupBy
- */
- groupBy(iteratee?: ValueIteratee<string>): ObjectChain<Dictionary<string[]>>;
- }
- interface StringNullableChain {
- /**
- * @see _.groupBy
- */
- groupBy(iteratee?: ValueIteratee<string>): ObjectChain<Dictionary<string[]>>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.groupBy
- */
- groupBy(iteratee?: ValueIteratee<T>): ObjectChain<Dictionary<T[]>>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.groupBy
- */
- groupBy(iteratee?: ValueIteratee<T[keyof T]>): ObjectChain<Dictionary<Array<T[keyof T]>>>;
- }
- 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<T>(collection: Dictionary<T> | NumericDictionary<T> | null | undefined, target: T, fromIndex?: number): boolean;
- }
- interface Object<T> {
- /**
- * @see _.includes
- */
- includes(target: T[keyof T], fromIndex?: number): boolean;
- }
- interface Collection<T> {
- /**
- * @see _.includes
- */
- includes(target: T, fromIndex?: number): boolean;
- }
- interface String {
- /**
- * @see _.includes
- */
- includes(target: string, fromIndex?: number): boolean;
- }
- interface ObjectChain<T> {
- /**
- * @see _.includes
- */
- includes(target: T[keyof T], fromIndex?: number): PrimitiveChain<boolean>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.includes
- */
- includes(target: T, fromIndex?: number): PrimitiveChain<boolean>;
- }
- interface StringChain {
- /**
- * @see _.includes
- */
- includes(target: string, fromIndex?: number): PrimitiveChain<boolean>;
- }
- 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: object | null | undefined, methodName: string, ...args: any[]): any[];
- /**
- * @see _.invokeMap
- */
- invokeMap<TResult>(collection: object | null | undefined, method: (...args: any[]) => TResult, ...args: any[]): TResult[];
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.invokeMap
- */
- invokeMap(methodName: string, ...args: any[]): Collection<any>;
- /**
- * @see _.invokeMap
- */
- invokeMap<TResult>(method: (...args: any[]) => TResult, ...args: any[]): Collection<TResult>;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.invokeMap
- */
- invokeMap(methodName: string, ...args: any[]): CollectionChain<any>;
- /**
- * @see _.invokeMap
- */
- invokeMap<TResult>(method: (...args: any[]) => TResult, ...args: any[]): CollectionChain<TResult>;
- }
- 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 invoked with one argument: (value).
- *
- * @param collection The collection to iterate over.
- * @param iteratee The function invoked per iteration.
- * @return Returns the composed aggregate object.
- */
- keyBy<T>(collection: List<T> | null | undefined, iteratee?: ValueIterateeCustom<T, PropertyName>): Dictionary<T>;
- /**
- * @see _.keyBy
- */
- keyBy<T extends object>(collection: T | null | undefined, iteratee?: ValueIterateeCustom<T[keyof T], PropertyName>): Dictionary<T[keyof T]>;
- }
- interface String {
- /**
- * @see _.keyBy
- */
- keyBy(iteratee?: ValueIterateeCustom<string, PropertyName>): Object<Dictionary<string>>;
- }
- interface Collection<T> {
- /**
- * @see _.keyBy
- */
- keyBy(iteratee?: ValueIterateeCustom<T, PropertyName>): Object<Dictionary<T>>;
- }
- interface Object<T> {
- /**
- * @see _.keyBy
- */
- keyBy(iteratee?: ValueIterateeCustom<T[keyof T], PropertyName>): Object<Dictionary<T[keyof T]>>;
- }
- interface StringChain {
- /**
- * @see _.keyBy
- */
- keyBy(iteratee?: ValueIterateeCustom<string, PropertyName>): ObjectChain<Dictionary<string>>;
- }
- interface StringNullableChain {
- /**
- * @see _.keyBy
- */
- keyBy(iteratee?: ValueIterateeCustom<string, PropertyName>): ObjectChain<Dictionary<string>>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.keyBy
- */
- keyBy(iteratee?: ValueIterateeCustom<T, PropertyName>): ObjectChain<Dictionary<T>>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.keyBy
- */
- keyBy(iteratee?: ValueIterateeCustom<T[keyof T], PropertyName>): ObjectChain<Dictionary<T[keyof T]>>;
- }
- interface LoDashStatic {
- /**
- * Creates an array of values by running each element in collection through iteratee. The iteratee is
- * invoked with three arguments: (value, index|key, collection).
- *
- * 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.
- * @return Returns the new mapped array.
- */
- map<T extends readonly [unknown, ...unknown[]], TResult>(collection: T, iteratee: TupleIterator<T, TResult>): { [K in keyof T]: TResult };
- /**
- * @see _.map
- */
- map<T, TResult>(collection: T[] | null | undefined, iteratee: ArrayIterator<T, TResult>): TResult[];
- /**
- * @see _.map
- */
- map<T, TResult>(collection: List<T> | null | undefined, iteratee: ListIterator<T, TResult>): TResult[];
- /**
- * @see _.map
- */
- map<T>(collection: Dictionary<T> | NumericDictionary<T> | null | undefined): T[];
- /**
- * @see _.map
- */
- map<T extends object, TResult>(collection: T | null | undefined, iteratee: ObjectIterator<T, TResult>): TResult[];
- /**
- * @see _.map
- */
- map<T, K extends keyof T>(collection: Dictionary<T> | NumericDictionary<T> | null | undefined, iteratee: K): Array<T[K]>;
- /**
- * @see _.map
- */
- map<T>(collection: Dictionary<T> | NumericDictionary<T> | null | undefined, iteratee?: string): any[];
- /**
- * @see _.map
- */
- map<T>(collection: Dictionary<T> | NumericDictionary<T> | null | undefined, iteratee?: object): boolean[];
- }
- interface String {
- /**
- * @see _.map
- */
- map<TResult>(iteratee: StringIterator<TResult>): Collection<TResult>;
- /**
- * @see _.map
- */
- map(): Collection<string>;
- }
- interface Collection<T> {
- /**
- * @see _.map
- */
- map<K extends keyof T>(key: K): Collection<T[K]>;
- /**
- * @see _.map
- */
- map<TResult>(iteratee: ListIterator<T, TResult>): Collection<TResult>;
- /**
- * @see _.map
- */
- map(iteratee: PropertyName): Collection<any>;
- /**
- * @see _.map
- */
- map(iteratee: [PropertyName, any] | object): Collection<boolean>;
- /**
- * @see _.map
- */
- map(): Collection<T>;
- }
- interface Object<T> {
- /**
- * @see _.map
- */
- map<K extends keyof T[keyof T]>(key: K): Collection<T[keyof T][K]>;
- /**
- * @see _.map
- */
- map<TResult>(iteratee: ObjectIterator<T, TResult>): Collection<TResult>;
- /**
- * @see _.map
- */
- map(iteratee: PropertyName): Collection<any>;
- /**
- * @see _.map
- */
- map(iteratee: [PropertyName, any] | object): Collection<boolean>;
- /**
- * @see _.map
- */
- map(): Collection<T[keyof T]>;
- }
- interface StringChain {
- /**
- * @see _.map
- */
- map<TResult>(iteratee: StringIterator<TResult>): CollectionChain<TResult>;
- /**
- * @see _.map
- */
- map(): CollectionChain<string>;
- }
- interface StringNullableChain {
- /**
- * @see _.map
- */
- map<TResult>(iteratee: StringIterator<TResult>): CollectionChain<TResult>;
- /**
- * @see _.map
- */
- map(): CollectionChain<string>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.map
- */
- map<K extends keyof T>(key: K): CollectionChain<T[K]>;
- /**
- * @see _.map
- */
- map<TResult>(iteratee: ListIterator<T, TResult>): CollectionChain<TResult>;
- /**
- * @see _.map
- */
- map(iteratee: PropertyName): CollectionChain<any>;
- /**
- * @see _.map
- */
- map(iteratee: [PropertyName, any] | object): CollectionChain<boolean>;
- /**
- * @see _.map
- */
- map(): CollectionChain<T>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.map
- */
- map<K extends keyof T[keyof T]>(key: K): CollectionChain<T[keyof T][K]>;
- /**
- * @see _.map
- */
- map<TResult>(iteratee: ObjectIterator<T, TResult>): CollectionChain<TResult>;
- /**
- * @see _.map
- */
- map(iteratee: PropertyName): CollectionChain<any>;
- /**
- * @see _.map
- */
- map(iteratee: [PropertyName, any] | object): CollectionChain<boolean>;
- /**
- * @see _.map
- */
- map(): CollectionChain<T[keyof T]>;
- }
- 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.
- *
- * @category Collection
- * @param collection The collection to iterate over.
- * @param [iteratees=[_.identity]] The iteratees to sort by.
- * @param [orders] The sort orders of `iteratees`.
- * @param [guard] Enables use as an iteratee for functions like `_.reduce`.
- * @returns 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<T>(collection: List<T> | null | undefined, iteratees?: Many<ListIterator<T, NotVoid>>, orders?: Many<boolean|"asc"|"desc">): T[];
- /**
- * @see _.orderBy
- */
- orderBy<T>(collection: List<T> | null | undefined, iteratees?: Many<ListIteratee<T>>, orders?: Many<boolean|"asc"|"desc">): T[];
- /**
- * @see _.orderBy
- */
- orderBy<T extends object>(collection: T | null | undefined, iteratees?: Many<ObjectIterator<T, NotVoid>>, orders?: Many<boolean|"asc"|"desc">): Array<T[keyof T]>;
- /**
- * @see _.orderBy
- */
- orderBy<T extends object>(collection: T | null | undefined, iteratees?: Many<ObjectIteratee<T>>, orders?: Many<boolean|"asc"|"desc">): Array<T[keyof T]>;
- }
- interface Collection<T> {
- /**
- * @see _.orderBy
- */
- orderBy(iteratees?: Many<ListIterator<T, NotVoid> | PropertyName | PartialShallow<T>>, orders?: Many<boolean|"asc"|"desc">): Collection<T>;
- }
- interface Object<T> {
- /**
- * @see _.orderBy
- */
- orderBy(iteratees?: Many<ObjectIterator<T, NotVoid>>, orders?: Many<boolean|"asc"|"desc">): Collection<T[keyof T]>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.orderBy
- */
- orderBy(iteratees?: Many<ListIterator<T, NotVoid> | PropertyName | PartialShallow<T>>, orders?: Many<boolean|"asc"|"desc">): CollectionChain<T>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.orderBy
- */
- orderBy(iteratees?: Many<ObjectIterator<T, NotVoid>>, orders?: Many<boolean|"asc"|"desc">): CollectionChain<T[keyof T]>;
- }
- 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 invoked with three arguments: (value, index|key, collection).
- *
- * @param collection The collection to iterate over.
- * @param callback The function called per iteration.
- * @return Returns the array of grouped elements.
- */
- partition<T, U extends T>(collection: List<T> | null | undefined, callback: ValueIteratorTypeGuard<T, U>): [U[], Array<Exclude<T, U>>];
- /**
- * @see _.partition
- */
- partition<T>(collection: List<T> | null | undefined, callback: ValueIteratee<T>): [T[], T[]];
- /**
- * @see _.partition
- */
- partition<T extends object>(collection: T | null | undefined, callback: ValueIteratee<T[keyof T]>): [Array<T[keyof T]>, Array<T[keyof T]>];
- }
- interface String {
- /**
- * @see _.partition
- */
- partition(callback: StringIterator<NotVoid>): LoDashImplicitWrapper<[string[], string[]]>;
- }
- interface Collection<T> {
- /**
- * @see _.partition
- */
- partition<U extends T>(callback: ValueIteratorTypeGuard<T, U>): LoDashImplicitWrapper<[U[], Array<Exclude<T, U>>]>;
- /**
- * @see _.partition
- */
- partition(callback: ValueIteratee<T>): LoDashImplicitWrapper<[T[], T[]]>;
- }
- interface Object<T> {
- /**
- * @see _.partition
- */
- partition(callback: ValueIteratee<T[keyof T]>): LoDashImplicitWrapper<[Array<T[keyof T]>, Array<T[keyof T]>]>;
- }
- interface StringChain {
- /**
- * @see _.partition
- */
- partition(callback: StringIterator<NotVoid>): LoDashExplicitWrapper<[string[], string[]]>;
- }
- interface StringNullableChain {
- /**
- * @see _.partition
- */
- partition(callback: StringIterator<NotVoid>): LoDashExplicitWrapper<[string[], string[]]>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.partition
- */
- partition<U extends T>(callback: ValueIteratorTypeGuard<T, U>): LoDashExplicitWrapper<[U[], Array<Exclude<T, U>>]>;
- /**
- * @see _.partition
- */
- partition(callback: ValueIteratee<T>): LoDashExplicitWrapper<[T[], T[]]>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.partition
- */
- partition(callback: ValueIteratee<T[keyof T]>): LoDashExplicitWrapper<[Array<T[keyof T]>, Array<T[keyof T]>]>;
- }
- 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 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.
- * @return Returns the accumulated value.
- */
- reduce<T, TResult>(collection: T[] | null | undefined, callback: MemoListIterator<T, TResult, T[]>, accumulator: TResult): TResult;
- /**
- * @see _.reduce
- */
- reduce<T, TResult>(collection: List<T> | null | undefined, callback: MemoListIterator<T, TResult, List<T>>, accumulator: TResult): TResult;
- /**
- * @see _.reduce
- */
- reduce<T extends object, TResult>(collection: T | null | undefined, callback: MemoObjectIterator<T[keyof T], TResult, T>, accumulator: TResult): TResult;
- /**
- * @see _.reduce
- */
- reduce<T>(collection: T[] | null | undefined, callback: MemoListIterator<T, T, T[]>): T | undefined;
- /**
- * @see _.reduce
- */
- reduce<T>(collection: List<T> | null | undefined, callback: MemoListIterator<T, T, List<T>>): T | undefined;
- /**
- * @see _.reduce
- */
- reduce<T extends object>(collection: T | null | undefined, callback: MemoObjectIterator<T[keyof T], T[keyof T], T>): T[keyof T] | undefined;
- }
- interface Collection<T> {
- /**
- * @see _.reduce
- */
- reduce<TResult>(callback: MemoListIterator<T, TResult, List<T>>, accumulator: TResult): TResult;
- /**
- * @see _.reduce
- */
- reduce(callback: MemoListIterator<T, T, List<T>>): T | undefined;
- }
- interface Object<T> {
- /**
- * @see _.reduce
- */
- reduce<TResult>(callback: MemoObjectIterator<T[keyof T], TResult, T>, accumulator: TResult): TResult;
- /**
- * @see _.reduce
- */
- reduce(callback: MemoObjectIterator<T[keyof T], T[keyof T], T>): T[keyof T] | undefined;
- }
- interface CollectionChain<T> {
- /**
- * @see _.reduce
- */
- reduce<TResult>(callback: MemoListIterator<T, TResult, List<T>>, accumulator: TResult): ExpChain<TResult>;
- /**
- * @see _.reduce
- */
- reduce(callback: MemoListIterator<T, T, List<T>>): ExpChain<T | undefined>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.reduce
- */
- reduce<TResult>(callback: MemoObjectIterator<T[keyof T], TResult, T>, accumulator: TResult): ExpChain<TResult>;
- /**
- * @see _.reduce
- */
- reduce(callback: MemoObjectIterator<T[keyof T], T[keyof T], T>): ExpChain<T[keyof T] | undefined>;
- }
- 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.
- * @return The accumulated value.
- */
- reduceRight<T, TResult>(collection: T[] | null | undefined, callback: MemoListIterator<T, TResult, T[]>, accumulator: TResult): TResult;
- /**
- * @see _.reduceRight
- */
- reduceRight<T, TResult>(collection: List<T> | null | undefined, callback: MemoListIterator<T, TResult, List<T>>, accumulator: TResult): TResult;
- /**
- * @see _.reduceRight
- */
- reduceRight<T extends object, TResult>(collection: T | null | undefined, callback: MemoObjectIterator<T[keyof T], TResult, T>, accumulator: TResult): TResult;
- /**
- * @see _.reduceRight
- */
- reduceRight<T>(collection: T[] | null | undefined, callback: MemoListIterator<T, T, T[]>): T | undefined;
- /**
- * @see _.reduceRight
- */
- reduceRight<T>(collection: List<T> | null | undefined, callback: MemoListIterator<T, T, List<T>>): T | undefined;
- /**
- * @see _.reduceRight
- */
- reduceRight<T extends object>(collection: T | null | undefined, callback: MemoObjectIterator<T[keyof T], T[keyof T], T>): T[keyof T] | undefined;
- }
- interface Collection<T> {
- /**
- * @see _.reduceRight
- */
- reduceRight<TResult>(callback: MemoListIterator<T, TResult, List<T>>, accumulator: TResult): TResult;
- /**
- * @see _.reduceRight
- */
- reduceRight(callback: MemoListIterator<T, T, List<T>>): T | undefined;
- }
- interface Object<T> {
- /**
- * @see _.reduceRight
- */
- reduceRight<TResult>(callback: MemoObjectIterator<T[keyof T], TResult, T>, accumulator: TResult): TResult;
- /**
- * @see _.reduceRight
- */
- reduceRight(callback: MemoObjectIterator<T[keyof T], T[keyof T], T>): T[keyof T] | undefined;
- }
- interface CollectionChain<T> {
- /**
- * @see _.reduceRight
- */
- reduceRight<TResult>(callback: MemoListIterator<T, TResult, List<T>>, accumulator: TResult): ExpChain<TResult>;
- /**
- * @see _.reduceRight
- */
- reduceRight(callback: MemoListIterator<T, T, List<T>>): ExpChain<T | undefined>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.reduceRight
- */
- reduceRight<TResult>(callback: MemoObjectIterator<T[keyof T], TResult, T>, accumulator: TResult): ExpChain<TResult>;
- /**
- * @see _.reduceRight
- */
- reduceRight(callback: MemoObjectIterator<T[keyof T], T[keyof T], T>): ExpChain<T[keyof T] | undefined>;
- }
- 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.
- * @return Returns the new filtered array.
- */
- reject(collection: string | null | undefined, predicate?: StringIterator<boolean>): string[];
- /**
- * @see _.reject
- */
- reject<T>(collection: List<T> | null | undefined, predicate?: ListIterateeCustom<T, boolean>): T[];
- /**
- * @see _.reject
- */
- reject<T extends object>(collection: T | null | undefined, predicate?: ObjectIterateeCustom<T, boolean>): Array<T[keyof T]>;
- }
- interface String {
- /**
- * @see _.reject
- */
- reject(predicate?: StringIterator<boolean>): Collection<string>;
- }
- interface Collection<T> {
- /**
- * @see _.reject
- */
- reject(predicate?: ListIterateeCustom<T, boolean>): Collection<T>;
- }
- interface Object<T> {
- /**
- * @see _.reject
- */
- reject(predicate?: ObjectIterateeCustom<T, boolean>): Collection<T[keyof T]>;
- }
- interface StringChain {
- /**
- * @see _.reject
- */
- reject(predicate?: StringIterator<boolean>): CollectionChain<string>;
- }
- interface StringNullableChain {
- /**
- * @see _.reject
- */
- reject(predicate?: StringIterator<boolean>): CollectionChain<string>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.reject
- */
- reject(predicate?: ListIterateeCustom<T, boolean>): CollectionChain<T>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.reject
- */
- reject(predicate?: ObjectIterateeCustom<T, boolean>): CollectionChain<T[keyof T]>;
- }
- interface LoDashStatic {
- /**
- * Gets a random element from collection.
- *
- * @param collection The collection to sample.
- * @return Returns the random element.
- */
- sample<T>(collection: readonly [T, ...T[]]): T;
- /**
- * @see _.sample
- */
- sample<T>(collection: Dictionary<T> | NumericDictionary<T> | null | undefined): T | undefined;
- /**
- * @see _.sample
- */
- sample<T extends object>(collection: T | null | undefined): T[keyof T] | undefined;
- }
- interface String {
- /**
- * @see _.sample
- */
- sample(): string | undefined;
- }
- interface Collection<T> {
- /**
- * @see _.sample
- */
- sample(): T | undefined;
- }
- interface Object<T> {
- /**
- * @see _.sample
- */
- sample(): T[keyof T] | undefined;
- }
- interface StringChain {
- /**
- * @see _.sample
- */
- sample(): StringNullableChain;
- }
- interface StringNullableChain {
- /**
- * @see _.sample
- */
- sample(): StringNullableChain;
- }
- interface CollectionChain<T> {
- /**
- * @see _.sample
- */
- sample(): ExpChain<T | undefined>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.sample
- */
- sample(): ExpChain<T[keyof T] | undefined>;
- }
- 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<T>(collection: Dictionary<T> | NumericDictionary<T> | null | undefined, n?: number): T[];
- /**
- * @see _.sampleSize
- */
- sampleSize<T extends object>(collection: T | null | undefined, n?: number): Array<T[keyof T]>;
- }
- interface String {
- /**
- * @see _.sampleSize
- */
- sampleSize(n?: number): Collection<string>;
- }
- interface Collection<T> {
- /**
- * @see _.sampleSize
- */
- sampleSize(n?: number): Collection<T>;
- }
- interface Object<T> {
- /**
- * @see _.sampleSize
- */
- sampleSize(n?: number): Collection<T[keyof T]>;
- }
- interface StringChain {
- /**
- * @see _.sampleSize
- */
- sampleSize(n?: number): CollectionChain<string>;
- }
- interface StringNullableChain {
- /**
- * @see _.sampleSize
- */
- sampleSize(n?: number): CollectionChain<string>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.sampleSize
- */
- sampleSize(n?: number): CollectionChain<T>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.sampleSize
- */
- sampleSize(n?: number): CollectionChain<T[keyof T]>;
- }
- 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<T>(collection: List<T> | null | undefined): T[];
- /**
- * @see _.shuffle
- */
- shuffle<T extends object>(collection: T | null | undefined): Array<T[keyof T]>;
- }
- interface String {
- /**
- * @see _.shuffle
- */
- shuffle(): Collection<string>;
- }
- interface Collection<T> {
- /**
- * @see _.shuffle
- */
- shuffle(): Collection<T>;
- }
- interface Object<T> {
- /**
- * @see _.shuffle
- */
- shuffle(): Collection<T[keyof T]>;
- }
- interface StringChain {
- /**
- * @see _.shuffle
- */
- shuffle(): CollectionChain<string>;
- }
- interface StringNullableChain {
- /**
- * @see _.shuffle
- */
- shuffle(): CollectionChain<string>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.shuffle
- */
- shuffle(): CollectionChain<T>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.shuffle
- */
- shuffle(): CollectionChain<T[keyof T]>;
- }
- 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: object | string | null | undefined): number;
- }
- interface LoDashImplicitWrapper<TValue> {
- /**
- * @see _.size
- */
- size(): number;
- }
- interface LoDashExplicitWrapper<TValue> {
- /**
- * @see _.size
- */
- size(): PrimitiveChain<number>;
- }
- 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<T>(collection: List<T> | null | undefined, predicate?: ListIterateeCustom<T, boolean>): boolean;
- /**
- * @see _.some
- */
- some<T extends object>(collection: T | null | undefined, predicate?: ObjectIterateeCustom<T, boolean>): boolean;
- }
- interface Collection<T> {
- /**
- * @see _.some
- */
- some(predicate?: ListIterateeCustom<T, boolean>): boolean;
- }
- interface Object<T> {
- /**
- * @see _.some
- */
- some(predicate?: ObjectIterateeCustom<T, boolean>): boolean;
- }
- interface CollectionChain<T> {
- /**
- * @see _.some
- */
- some(predicate?: ListIterateeCustom<T, boolean>): PrimitiveChain<boolean>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.some
- */
- some(predicate?: ObjectIterateeCustom<T, boolean>): PrimitiveChain<boolean>;
- }
- 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).
- *
- * @category Collection
- * @param collection The collection to iterate over.
- * @param [iteratees=[_.identity]]
- * The iteratees to sort by, specified individually or in arrays.
- * @returns 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<T>(collection: List<T> | null | undefined, ...iteratees: Array<Many<ListIteratee<T>>>): T[];
- /**
- * @see _.sortBy
- */
- sortBy<T extends object>(collection: T | null | undefined, ...iteratees: Array<Many<ObjectIteratee<T>>>): Array<T[keyof T]>;
- }
- interface Collection<T> {
- /**
- * @see _.sortBy
- */
- sortBy(...iteratees: Array<Many<ListIteratee<T>>>): Collection<T>;
- }
- interface Object<T> {
- /**
- * @see _.sortBy
- */
- sortBy(...iteratees: Array<Many<ObjectIteratee<T>>>): Collection<T[keyof T]>;
- }
- interface CollectionChain<T> {
- /**
- * @see _.sortBy
- */
- sortBy(...iteratees: Array<Many<ListIteratee<T>>>): CollectionChain<T>;
- }
- interface ObjectChain<T> {
- /**
- * @see _.sortBy
- */
- sortBy(...iteratees: Array<Many<ObjectIteratee<T>>>): CollectionChain<T[keyof T]>;
- }
- }
|