@cmtlyt/base
Version:
854 lines (796 loc) • 48.3 kB
TypeScript
interface AdjustCurry {
<T>(index: number, handle: (item: T, index: number) => T, arr: T[]): T[];
<T>(index: number, handle: (item: T, index: number) => T): (arr: T[]) => T[];
(index: number): <T>(handle: (item: T, index: number) => T, arr: T[]) => T[];
<T>(index: number): (handle: (item: T, index: number) => T) => (arr: T[]) => T[];
}
declare function adjust_<T>(index: number, handle: (item: T, index: number) => T, arr: T[]): T[];
/**
* 修改数组指定位置的元素
*
* @sig adjust :: number -> ((a, number) -> a) -> [a] -> [a]
*/
declare const adjust: AdjustCurry;
declare function aperture_<T>(count: number, arr: T[]): T[][];
interface ApertureCurry {
<T>(count: number, arr: T[]): T[][];
<T>(count: number): (arr: T[]) => T[][];
}
/**
* 数组分片
*
* @sig aperture :: number -> [a] -> [[a]]
*/
declare const aperture: ApertureCurry;
/** 函数类型 */
type TFunc<T extends any[], R = any> = (...args: T) => R;
/** 任意函数 */
type TAnyFunc = TFunc<any[]>;
/** 获取函数的参数类型 */
type TArgsType<F> = F extends (...args: infer T) => any ? T : any[];
/** 获取数组的第一个元素类型 */
type THeadType<A extends any[]> = A extends [infer H] ? H : A extends [infer H, ...any[]] ? H : never;
/** 获取数组的第一个元素类型 */
type TFirstType<A extends any[]> = A[0];
/** 获取数组的最后一个元素类型 */
type TLastType<A extends any[], F = never> = A extends [infer L] ? L : A extends [...any[], infer L] ? L : F;
/** 获取数组的剩余元素类型 */
type TTailTypes<A extends any[]> = A extends [any] ? [] : A extends [any, ...infer T] ? T : [];
/** 获取数组最后一个元素之前的元素类型 */
type TLastBeforeTypes<A extends any[]> = A extends [...infer T, any] ? T : [];
/** 添加类型到数组头部 */
type TPrepend<T, A extends any[]> = [T, ...A];
/** 添加类型到数组末尾 */
type TAppend<T, A extends any[]> = [...A, T];
/** 如果 x 是 y 的子类型, 返回 x, 否则返回 y */
type TCast<X, Y> = X extends Y ? X : Y;
/** 获取数组的长度 */
type TLength<T extends any[]> = T['length'];
/** 移除数组前 N 个元素 */
type TDropHead<N extends number, T extends any[], I extends any[] = []> = TLength<I> extends N ? T : TDropHead<N, TTailTypes<T>, TPrepend<THeadType<T>, I>>;
/** 获取数组的倒数第二个元素的类型 */
type TLastTwoArg<T extends any[]> = T extends [...any, infer I, any] ? I : any;
/** 获取数组的第二个元素的类型 */
type THeadTwoArg<T extends any[]> = T extends [any, infer I, ...any] ? I : any;
/** 对象类型 */
type TObject<T, K extends TObjKeyType = TObjKeyType> = Record<K, T>;
/** 获取数组的元素类型 */
type TArrayItem<T> = T extends [...infer R] ? R : any;
/** 获取数组的类型 */
type TArrayType<T> = T extends any[] ? T[number] : never;
/** Promise 返回值的类型 */
type TUnwrapPromise<T> = T extends Promise<infer R> ? R : T;
/** 指定对象的部分属性可选, 如果不指定属性, 则整个对象可选 */
type TOptional<T, K extends keyof T = keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
/** 获取函数形参类型 */
type TGetArgs<F> = F extends (...args: infer A) => any ? A : [];
/** 获取函数返回值的类型 */
type TGetReturnType<F> = F extends (...args: any[]) => infer R ? R : F;
/** 排除对象中的指定属性 */
type TExclude<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
/** 扁平化 Promise 类型 */
type TFlatPromise<T> = T extends Promise<infer R> ? TFlatPromise<R> : Promise<T>;
/** 反转数组类型 */
type TReverseArray<T extends any[], L = TLength<T>, R extends any[] = []> = L extends TLength<[]> ? R : T extends [infer H, ...infer E] ? TReverseArray<E, TLength<E>, TPrepend<H, R>> : [];
/** 指定对象的部分属性必填, 如果不指定属性, 则整个对象必填 */
type TRequired<T, K extends keyof T = keyof T> = Omit<T, K> & Required<Pick<T, K>>;
/** 构造函数 */
type TConstructor<R, A extends any[] = any[]> = new (...args: A) => R;
/** Promise 构造函数 */
type TPromiseConstructor<T> = TConstructor<Promise<T>, [
func: (resolve: (data: T) => void, reject: TFunc<any, void>) => any
]>;
type ErrorResult<R> = [Error, null] | [null, R];
/** js 支持的所有类型 (滞后) */
type TAllType = 'string' | 'number' | 'boolean' | 'object' | 'array' | 'function' | 'asyncfunction' | 'generatorfunction' | 'promise' | 'symbol' | 'set' | 'map' | 'weakset' | 'weakmap' | 'date' | 'regexp' | 'error' | 'null' | 'undefined' | 'bigint' | 'file' | 'url' | 'urlsearchparams' | 'formdata' | 'arraybuffer' | 'dataview' | 'int8array' | 'uint8array' | 'uint8clampedarray' | 'int16array' | 'uint16array' | 'int32array' | 'uint32array' | 'float32array' | 'float64array' | 'bigint64array' | 'biguint64array' | 'blob';
type TMany<T> = T | T[];
/** 对象 key 支持的类型 */
type TObjKeyType = string | number | symbol;
/** 获取 Promise 返回值的类型 */
type TPromiseValue<T> = Awaited<T>;
/** 深度获取对象属性的类型 */
type TDeepGetPropType<K extends string[], T extends TObject<any>, I = T[K[0]]> = I extends undefined ? undefined : K extends [any] ? I : I extends TObject<any> ? TDeepGetPropType<TTailTypes<K>, I> : never;
/** 获取指定个数的形参类型 */
type TGetArgsWithCount<F extends TAnyFunc, C extends number, A extends any[] = TGetArgs<F>, R extends any[] = []> = A['length'] extends 0 ? R : R['length'] extends C ? R : TGetArgsWithCount<F, C, THeadType<A> extends never ? A : TTailTypes<A>, [
...R,
TFirstType<A>
]>;
/** 获取字符串/数字/布尔值常量的类型 */
type TGetType<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends [...infer R] ? R : any;
declare function append_(item: string, arr: string): string[];
declare function append_<T>(item: T, arr: T[]): T[];
interface AppendCurry {
<T, A extends any[] | string>(item: T, arr: A): A extends any[] ? TArrayType<[...A, T]>[] : string[];
<T>(item: T): <A extends any[] | string>(arr: A | string) => A extends any[] ? TArrayType<[...A, T]>[] : string[];
}
/**
* 向数组中追加元素
*
* @sig append :: a -> [a] -> [a]
*/
declare const append: AppendCurry;
declare function collectBy_<T, F extends TFunc<[T, number], any>>(withFunc: F, arr: T[]): T[][];
interface CollectByCurry {
<T, F extends TFunc<[T, number], any> = TFunc<[T, number], any>>(withFunc: F): (arr: T[]) => T[][];
<T, F extends TFunc<[T, number], any>>(withFunc: F, arr: T[]): T[][];
}
declare const collectBy: CollectByCurry;
interface EveryCurry {
<T>(handle: (item: T, index: number) => boolean, arr: T[]): boolean;
<T>(handle: (item: T, index: number) => boolean): (arr: T[]) => boolean;
}
declare function every_<T>(handle: (item: T, index: number) => boolean, arr: T[]): boolean;
/**
* 检测所有数组是否满足条件
*
* @sig every :: ((a, number) -> boolean) -> [a] -> boolean
*/
declare const every: EveryCurry;
interface FilterCurry {
<T>(handle: (item: T, index: number) => boolean, arr: T[]): T[];
<T>(handle: (item: T, index: number) => boolean): (arr: T[]) => T[];
}
declare function filter_<T>(handle: (item: T, index: number) => boolean, arr: T[]): T[];
/**
* 数组过滤
*
* @sig filter :: ((a, number) -> boolean) -> [a] -> [a]
*/
declare const filter: FilterCurry;
interface FindCurry {
<T>(handle: (item: T, index: number) => boolean, arr: T[]): T | undefined;
<T>(handle: (item: T, index: number) => boolean): (arr: T[]) => T | undefined;
}
declare function find_<T>(handle: (item: T, index: number) => boolean, arr: T[]): T | undefined;
/**
* 查找满足条件的元素
*
* @sig find :: ((a, number) -> boolean) -> [a] -> a
*/
declare const find: FindCurry;
interface FindIndexCurry {
<T>(handle: (item: T, index: number) => boolean, arr: T[]): number;
<T>(handle: (item: T, index: number) => boolean): (arr: T[]) => number;
}
declare function findIndex_<T>(handle: (item: T, index: number) => boolean, arr: T[]): number;
/**
* 查找满足条件的元素索引
*
* @sig findIndex :: ((a, number) -> boolean) -> [a] -> number
*/
declare const findIndex: FindIndexCurry;
declare function groupBy_<T, F extends TFunc<[T], any>>(func: F, arr: T[]): Record<TGetReturnType<F>, T[]>;
interface GroupByCurry {
<T, R, F extends TFunc<[T], any> = TFunc<[T], R>>(func: F): (arr: T[]) => Record<TGetReturnType<F>, T[]>;
<T, F extends TFunc<[T], any>>(func: F, arr: T[]): Record<TGetReturnType<F>, T[]>;
}
/**
* 分组
*
* @sig groupBy :: (a -> b) -> [a] -> {b: [a]}
*/
declare const groupBy: GroupByCurry;
declare function groupWith_<A extends any[] | string, F extends TFunc<[TGetType<TArrayItem<A>>, TGetType<TArrayItem<A>>], boolean>>(func: F, arr: A): A extends string ? string[] : A[];
interface GroupWithCurry {
<A extends any[] | string, F extends TFunc<[TGetType<TArrayItem<A>>, TGetType<TArrayItem<A>>], boolean> = TFunc<[TGetType<TArrayItem<A>>, TGetType<TArrayItem<A>>], boolean>>(func: F): (arr: A) => A extends string ? string[] : A[];
<A extends any[] | string, F extends TFunc<[TGetType<TArrayItem<A>>, TGetType<TArrayItem<A>>], boolean>>(func: F, arr: A): A extends string ? string[] : A[];
}
/**
* 分组
*
* @sig groupWith :: (a -> a -> Boolean) -> [a] -> [[a]]
*/
declare const groupWith: GroupWithCurry;
interface IncludesCurry {
<T>(item: T, arr: T[]): boolean;
<T>(item: T): (arr: T[]) => boolean;
}
declare function includes_<T>(item: T, arr: T[]): boolean;
/**
* 检测数组是否有满足条件的元素
*
* @sig includes :: a -> [a] -> boolean
*/
declare const includes: IncludesCurry;
declare function join_(separator: string, arr: any[]): string;
interface JoinCurry {
(separator: string): TFunc<[any[]], string>;
(separator: string, arr: any[]): string;
}
/**
* 数组连接
*
* @sig join :: string -> [a] -> string
*/
declare const join: JoinCurry;
interface MakeByCurry {
<R>(handle: (index: number) => R, count: number): R[];
<R>(handle: (index: number) => R): (count: number) => R[];
}
declare function makeBy_<R>(handle: (index: number) => R, count: number): R[];
/**
* 数组创建
*
* @sig makeBy :: ((number -> a) -> number -> [a])
*/
declare const makeBy: MakeByCurry;
interface MapCurry {
<T, R = any>(handle: (item: T, index: number) => R, arr: T[]): R[];
<T, R = any>(handle: (item: T, index: number) => R): (arr: T[]) => R[];
}
declare function map_<T, R>(handle: (item: T, index: number) => R, arr: T[]): R[];
/**
* 数组转换
*
* @sig map :: ((a, number) -> b) -> [a] -> [b]
*/
declare const map: MapCurry;
declare function nth_<T extends any[] | string, I extends number = number>(idx: I, arr: T): T[I] | undefined;
interface NthCurry {
<T extends any[] | string, I extends number = number>(idx: I): (arr: T) => T[I] | undefined;
<T extends any[] | string, I extends number = number>(idx: I, arr: T): T[I] | undefined;
}
/**
* 获取数组或字符串的指定元素
*
* @sig nth :: Number -> ([a] | String) -> (a | String | undefined)
*/
declare const nth: NthCurry;
interface Partition {
<R, L = R>(handle: (item: R | L, index: number) => boolean, arr: (R | L)[]): {
left: L[];
right: R[];
};
<R, L = R>(handle: (item: R | L, index: number) => boolean): TFunc<[(R | L)[]], {
left: L[];
right: R[];
}>;
}
declare function partition_<R, L = R>(handle: TFunc<[R | L, number], boolean>, arr: (R | L)[]): {
left: L[];
right: R[];
};
/**
* 数组分区
*
* @sig partition :: ((a, number) -> boolean) -> [a] -> { left: [a], right: [a] }
*/
declare const partition: Partition;
interface ReduceCurry {
<T, R = any>(handle: (acc: R, item: T, index: number) => R, init: R, arr: T[]): R;
<T, R = any>(handle: (acc: R, item: T, index: number) => R, init: R): (arr: T[]) => R;
<T, R = any>(handle: (acc: R, item: T, index: number) => R): (init: R) => (arr: T[]) => R;
}
declare function reduce_<T, R = T>(handle: (acc: R, item: T, index: number) => R, init: R, arr: T[]): R;
/**
* 数组聚合
*
* @sig reduce :: ((a, b, number) -> a) -> a -> [b] -> a
*/
declare const reduce: ReduceCurry;
interface ReplicateCurry {
<T>(item: T, count: number): T[];
<T>(item: T): (count: number) => T[];
}
declare function replicate_<T>(item: T, count: number): T[];
/**
* 数组创建
*
* @sig replicate :: a -> number -> [a]
*
* item 期望是基本数据类型, 否则会导致所有 item 指向同一块内存空间
*/
declare const replicate: ReplicateCurry;
interface SomeCurry {
<T>(handle: (item: T, index: number) => boolean, arr: T[]): boolean;
<T>(handle: (item: T, index: number) => boolean): (arr: T[]) => boolean;
}
declare function some_<T>(handle: (item: T, index: number) => boolean, arr: T[]): boolean;
/**
* 检测数组是否有满足条件的元素
*
* @sig some :: ((a, number) -> boolean) -> [a] -> boolean
*/
declare const some: SomeCurry;
declare function take_<T>(count: number, arr: T[] | string): T[] | string;
interface TakeCurry {
<A extends any[] | string>(count: number, arr: A): TGetType<A>;
<A extends any[] | string>(count: number): (arr: A) => TGetType<A>;
}
/**
* 获取数组前 n 个元素
*
* @sig take :: Number -> [a] -> [a]
*/
declare const take: TakeCurry;
declare function zip_<A, B>(a: A, b: B): [A, B];
interface ZipCurry {
<A, B>(a: A, b: B): [A, B];
(a: any): (b: any) => [any, any];
}
/**
* 将两个元素打包成元组
*
* @sig zip :: a -> b -> (a, b)
*/
declare const zip: ZipCurry;
type BothArgs = [TFunc<any[], boolean>, ...TFunc<any[], boolean>[], any];
declare function both_(...funcs: BothArgs): boolean;
/**
* 判断所有函数都返回 true
*
* @sig both :: (a -> Boolean) -> (a -> Boolean) -> a -> Boolean
*/
declare function both(...funcs: [TFunc<any[], boolean>, ...TFunc<any[], boolean>[]]): (value: any) => boolean;
declare function eq_<T>(target: T, value: T): boolean;
interface EqCurry {
<T>(target: T, value: T): boolean;
<T>(target: T): (value: T) => boolean;
}
/**
* 判断两个值是否相等
*
* @sig eq :: any -> any -> boolean
*/
declare const eq: EqCurry;
declare function gt_(a: any, b: any): boolean;
interface GtCurry {
(a: any, b: any): boolean;
(a: any): (b: any) => boolean;
}
/**
* 大于
*
* @sig gt :: a -> b -> Boolean
*/
declare const gt: GtCurry;
declare function lt_(a: any, b: any): boolean;
interface LtCurry {
(a: any, b: any): boolean;
(a: any): (b: any) => boolean;
}
/**
* 小于
*
* @sig lt :: a -> b -> Boolean
*/
declare const lt: LtCurry;
declare const __: symbol;
/**
* 获取组合函数中间的执行结果
*
* @sig trace :: (T -> void) -> T -> T
*/
declare const trace: <T>(fn: (value: T) => void) => (value: T) => T;
declare function apply_<A extends any[], F extends TFunc<A, any> = TFunc<A, any>>(func: F, args: A): any;
interface ApplyCurry {
<A extends any[], F extends TFunc<A, any> = TFunc<A, any>>(func: F, args: A): ReturnType<F>;
<A extends any[], F extends TFunc<A, any> = TFunc<A, any>>(func: F): (args: A) => ReturnType<F>;
}
/**
* 应用函数
*
* @sig apply :: (a... -> b) -> [a] -> b
*/
declare const apply: ApplyCurry;
declare function applyTo_<V, F extends TFunc<[V], any> = TFunc<[V], any>>(value: V, func: F): any;
interface ApplyToCurry {
<V, F extends TFunc<[V], any> = TFunc<[V], any>>(value: V, func: F): ReturnType<F>;
<V, F extends TFunc<[V], any> = TFunc<[V], any>>(value: V): (func: F) => ReturnType<F>;
}
/**
* 应用函数
*
* @sig applyTo :: a -> (a -> b) -> b
*/
declare const applyTo: ApplyToCurry;
declare function argNumLimit_<N extends number, F extends TAnyFunc>(func: F, limit: N): TFunc<TGetArgsWithCount<F, N>, TGetReturnType<F>>;
interface ArgNumLimitCurry {
<N extends number, F extends TAnyFunc>(func: F, limit: N): TFunc<TGetArgsWithCount<F, N>, TGetReturnType<F>>;
<N extends number, F extends TAnyFunc>(func: F): (limit: N) => TFunc<TGetArgsWithCount<F, N>, TGetReturnType<F>>;
}
/**
* 限制函数参数数量
*
* @sig argNumLimit :: (a... -> b) -> Number -> (a... -> b)
*/
declare const argNumLimit: ArgNumLimitCurry;
type TCurry<P extends any[], R> = <T extends any[]>(...args: TCast<T, Partial<P>>) => TDropHead<TLength<T>, P> extends [any, ...any[]] ? TCurry<TCast<TDropHead<TLength<T>, P>, any[]>, R> : R;
type TCurryFunc = <P extends any[], R>(fn: (...args: P) => R) => TCurry<P, R>;
type TCurryFuncReturnType<F> = F extends TCurry<any, infer R> ? R : F extends TAnyFunc ? ReturnType<F> : F;
/**
* 函数柯里化
*/
declare const curry: TCurryFunc;
type TCompose<T extends TAnyFunc[]> = [...any, TFunc<[TCurryFuncReturnType<TLastType<T>>]>, any];
type TComposeFunc = <F extends TCompose<F>>(...funcs: F) => (...args: Required<TArgsType<TLastType<F>>>) => TCurryFuncReturnType<THeadType<F>>;
/**
* 函数组合
*
* todo: 类型存在缺陷,只能判断最后输入的函数是否满足条件,不能判断中间的函数
*/
declare const compose: TComposeFunc;
type TPipe<T extends TAnyFunc[]> = [...any, any, TFunc<[TCurryFuncReturnType<TLastTwoArg<T>>]>];
type TPipeFunc = <F extends TPipe<F>>(...funcs: F) => (...args: Required<TArgsType<THeadType<F>>>) => TCurryFuncReturnType<TLastType<F>>;
/**
* 函数管道
*
* todo: 类型存在缺陷,只能判断最后输入的函数是否满足条件,不能判断中间的函数
*/
declare const pipe: TPipeFunc;
type PlaceholderSymbol = typeof __;
type PlaceholderFuncArgs<Args extends any[], Ori extends any[], Last extends any[] = []> = Args extends [infer A, ...any] ? PlaceholderFuncArgs<TDropHead<1, Args>, TDropHead<1, Ori>, A extends PlaceholderSymbol ? TAppend<THeadType<Ori>, Last> : Last> : Last;
type PlaceholderArgs<T extends any[], R extends any[] = []> = T extends [infer A, ...any] ? PlaceholderArgs<TDropHead<1, T>, TAppend<A | PlaceholderSymbol, R>> : R;
/**
* 函数支持占位符
*
* 包装并返回一个新函数, 新函数允许使用占位符替代传参, 占位符的位置后续传递即可
*
* 可选参数会被强制要求填写
*
* @warning 占位符只能用于函数参数位置, 函数返回值位置无法使用占位符
* @warning 无法与 curry 函数一起使用 (无法正确推导类型)! 具体看下方示例
* @warning 当前包导出的 fp 相关方法为了更好的类型推导大部分都强制指定了多态类型, 所以无法正确推导形参列表
* 如需要可以使用原始版本 (函数名后加一个下划线 `_`, 例如 `curry 版本[adjust] 原始版本[adjust_]`)
*
* @example
* import { __, placeholderFunc } from '@cmtlyt/base/fp/utils';
* // const { __ } = placeholderFunc; // 也可以使用 placeholderFunc.__
* const add = (a: number, b: string, c: number, d: boolean) => a + b + c + d;
* // const func = curry(placeholderFunc(add)); // 这么使用无法正确推导类型
* // const func = placeholderFunc(curry(add)); // 这个不影响使用
* const func = placeholderFunc(add);
* const f1 = func(1, __, 3, __);
* f1('2', false); // '123false'
* // 占位函数生成后可使用 curry 函数包裹
* const f2 = curry(f1);
* f2('2', false); // '123false'
* f2('2')(false); // '123false'
* f2()('2')(false); // '123false'
*/
declare function placeholderFunc<O extends any[], R>(func: TFunc<O, R>): <A extends PlaceholderArgs<Required<O>>>(...placeArgs: A) => TFunc<PlaceholderFuncArgs<A, Required<O>, []>, TCurryFuncReturnType<R>>;
declare namespace placeholderFunc {
var __: symbol;
}
declare function when_<T, R, WF extends TFunc<[T], boolean>, TF extends TFunc<[T], R>>(whenFunc: WF, thenFunc: TF, arg: T): R | T;
interface WhenCurry {
<T, R, WF extends TFunc<[T], boolean> = TFunc<[T], boolean>, TF extends TFunc<[T], R> = TFunc<[T], R>>(whenFunc: WF, thenFunc: TF): (arg: T) => R | T;
<T, R, WF extends TFunc<[T], boolean> = TFunc<[T], boolean>, TF extends TFunc<[T], R> = TFunc<[T], R>>(whenFunc: WF): (thenFunc: TF) => (arg: T) => R | T;
<T, R, WF extends TFunc<[T], boolean> = TFunc<[T], boolean>, TF extends TFunc<[T], R> = TFunc<[T], R>>(whenFunc: WF, thenFunc: TF, arg: T): R | T;
}
declare const when: WhenCurry;
type Spec = Record<string, TAnyFunc>;
type DeepSpec = Record<string, Spec | TAnyFunc>;
type ApplySpecReturn<O extends DeepSpec> = {
[K in keyof O]: O[K] extends DeepSpec ? ApplySpecReturn<O[K]> : O[K] extends TFunc<any, infer R> ? R : never;
};
declare function applySpec_<O extends DeepSpec>(spec: O, args: any[]): ApplySpecReturn<O>;
interface ApplySpecCurry {
<O extends DeepSpec>(spec: O, args: any[]): ApplySpecReturn<O>;
<O extends DeepSpec>(spec: O): (args: any[]) => ApplySpecReturn<O>;
}
/**
* 给定一个递归映射属性到函数的spec对象,通过将每个属性映射到用提供的参数调用其关联函数的结果,创建一个产生相同结构对象的函数
*
* @sig applySpec :: {k: ([a, b, …, m] → v)} → [a, b, …, m] → {k: v}
*/
declare const applySpec: ApplySpecCurry;
declare function assoc_(path: TMany<string | number>, value: any, source: TObject<any> | Array<any>, sep?: string | RegExp): any[] | {
[x: string]: any;
[x: number]: any;
[x: symbol]: any;
};
interface AssocCurry {
<R>(path: TMany<string | number>, value: any, source: TObject<any>): R;
<R>(path: TMany<string | number>, value: any): (source: TObject<any>) => R;
<R>(path: TMany<string | number>): (value: any) => (source: TObject<any>) => R;
}
/**
* 设置对象属性 (支持点分递归 key)
*
* @sig assoc :: String b -> a -> {k: v} -> {b: a}
*/
declare const assoc: AssocCurry;
type DeepExecResult<F extends TAnyFunc, O extends TObject<any>> = {
[K in keyof O]: O[K] extends TObject<any> ? DeepExecResult<F, O[K]> : TGetReturnType<F>;
};
declare function deepExec_<F extends TFunc<[any, string], any>, O extends TObject<any>>(func: F, specObj: O): DeepExecResult<F, O>;
interface DeepExecCurry {
<F extends TFunc<[any, string], any>, O extends TObject<any>>(func: F, specObj: O): DeepExecResult<F, O>;
<F extends TFunc<[any, string], any>>(func: F): <O extends TObject<any>>(specObj: O) => DeepExecResult<F, O>;
}
/**
* 将对象中每个元素都传入函数执行
*
* @sig deepExec :: (a -> b) -> {a} -> {b}
*/
declare const deepExec: DeepExecCurry;
declare function deepExecWith_(func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>): TObject<any>;
/**
* 根据条件将对象的值传入函数处理
*
* @sig deepExecWith :: (a -> b) -> (a -> Boolean) -> {a} -> {b}
*/
declare const deepExecWith: <T extends any[]>(...args: TCast<T, [func?: TFunc<[any, string], any> | undefined, withFunc?: TFunc<[any, string], boolean> | undefined, specObj?: TObject<any> | undefined]>) => TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []> extends [any, ...any[]] ? <T_1 extends any[]>(...args: TCast<T_1, Partial<TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>>>) => TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []> extends [any, ...any[]] ? <T_2 extends any[]>(...args: TCast<T_2, Partial<TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>>>) => TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []> extends [any, ...any[]] ? <T_3 extends any[]>(...args: TCast<T_3, Partial<TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>>>) => TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []> extends [any, ...any[]] ? <T_4 extends any[]>(...args: TCast<T_4, Partial<TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>>>) => TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []> extends [any, ...any[]] ? <T_5 extends any[]>(...args: TCast<T_5, Partial<TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>>>) => TDropHead<TLength<T_5>, TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []> extends [any, ...any[]] ? <T_6 extends any[]>(...args: TCast<T_6, Partial<TCast<[any, ...any[]] & TDropHead<TLength<T_5>, TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>>>) => TDropHead<TLength<T_6>, TCast<[any, ...any[]] & TDropHead<TLength<T_5>, TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []> extends [any, ...any[]] ? <T_7 extends any[]>(...args: TCast<T_7, Partial<TCast<[any, ...any[]] & TDropHead<TLength<T_6>, TCast<[any, ...any[]] & TDropHead<TLength<T_5>, TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>>>) => TDropHead<TLength<T_7>, TCast<[any, ...any[]] & TDropHead<TLength<T_6>, TCast<[any, ...any[]] & TDropHead<TLength<T_5>, TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []> extends [any, ...any[]] ? <T_8 extends any[]>(...args: TCast<T_8, Partial<TCast<[any, ...any[]] & TDropHead<TLength<T_7>, TCast<[any, ...any[]] & TDropHead<TLength<T_6>, TCast<[any, ...any[]] & TDropHead<TLength<T_5>, TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>>>) => TDropHead<TLength<T_8>, TCast<[any, ...any[]] & TDropHead<TLength<T_7>, TCast<[any, ...any[]] & TDropHead<TLength<T_6>, TCast<[any, ...any[]] & TDropHead<TLength<T_5>, TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []> extends [any, ...any[]] ? <T_9 extends any[]>(...args: TCast<T_9, Partial<TCast<[any, ...any[]] & TDropHead<TLength<T_8>, TCast<[any, ...any[]] & TDropHead<TLength<T_7>, TCast<[any, ...any[]] & TDropHead<TLength<T_6>, TCast<[any, ...any[]] & TDropHead<TLength<T_5>, TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>>>) => TDropHead<TLength<T_9>, TCast<[any, ...any[]] & TDropHead<TLength<T_8>, TCast<[any, ...any[]] & TDropHead<TLength<T_7>, TCast<[any, ...any[]] & TDropHead<TLength<T_6>, TCast<[any, ...any[]] & TDropHead<TLength<T_5>, TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []> extends [any, ...any[]] ? <T_10 extends any[]>(...args: TCast<T_10, Partial<TCast<[any, ...any[]] & TDropHead<TLength<T_9>, TCast<[any, ...any[]] & TDropHead<TLength<T_8>, TCast<[any, ...any[]] & TDropHead<TLength<T_7>, TCast<[any, ...any[]] & TDropHead<TLength<T_6>, TCast<[any, ...any[]] & TDropHead<TLength<T_5>, TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>>>) => TDropHead<TLength<T_10>, TCast<[any, ...any[]] & TDropHead<TLength<T_9>, TCast<[any, ...any[]] & TDropHead<TLength<T_8>, TCast<[any, ...any[]] & TDropHead<TLength<T_7>, TCast<[any, ...any[]] & TDropHead<TLength<T_6>, TCast<[any, ...any[]] & TDropHead<TLength<T_5>, TCast<[any, ...any[]] & TDropHead<TLength<T_4>, TCast<[any, ...any[]] & TDropHead<TLength<T_3>, TCast<[any, ...any[]] & TDropHead<TLength<T_2>, TCast<[any, ...any[]] & TDropHead<TLength<T_1>, TCast<[any, ...any[]] & TDropHead<TLength<T>, [func: TFunc<[any, string], any>, withFunc: TFunc<[any, string], boolean>, specObj: TObject<any>], []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []>, any[]>, []> extends [any, ...any[]] ? /*elided*/ any : TObject<any> : TObject<any> : TObject<any> : TObject<any> : TObject<any> : TObject<any> : TObject<any> : TObject<any> : TObject<any> : TObject<any> : TObject<any>;
/**
* 根据字符串获取对象属性
*
* @sig deepProp_ :: string -> object -> any
* @param keyPath 属性路径
* @param obj 对象
* @param separator 分隔符 (default: '.')
*/
declare function deepProp_<R>(keyPath: TMany<string>, obj: TObject<any>, separator?: string | RegExp): R;
interface DeepPropCurry {
<R>(keyPath: TMany<string>, obj: TObject<any>): R;
<R>(keyPath: TMany<string>): (obj: TObject<any>) => R;
}
/**
* 根据点分字符串获取对象属性
*
* @sig deepProp :: string -> object -> any
*/
declare const deepProp: DeepPropCurry;
declare function deleteProp_<O extends TObject<any>, K extends keyof O>(key: K, source: O): Omit<O, K>;
interface DeletePropCurry {
<O extends TObject<any>, K extends keyof O>(key: K, obj: O): Omit<O, K>;
<R>(key: string): (obj: TObject<any>) => R;
}
/**
* 删除对象属性
*
* @sig deleteProp :: string -> object -> object
*/
declare const deleteProp: DeletePropCurry;
declare function omit_<O extends TObject<any>, K extends keyof O = keyof O>(keys: K[], obj: O): Omit<O, K>;
interface OmitCurry {
<O extends TObject<any>, K extends keyof O = keyof O>(keys: K[], obj: O): Omit<O, K>;
<O extends TObject<any>, K extends keyof O = keyof O>(keys: K[]): (obj: O) => Omit<O, K>;
}
/**
* 删除对象部分属性
*
* @sig omit :: [string] -> object -> object
*/
declare const omit: OmitCurry;
declare function pick_<O extends TObject<any>, K extends keyof O = keyof O>(keys: K[], obj: O): Pick<O, K>;
interface PickCurry {
<O extends TObject<any>, K extends keyof O = keyof O>(keys: K[], obj: O): Pick<O, K>;
<O extends TObject<any>, K extends keyof O = keyof O>(keys: K[]): (obj: O) => Pick<O, K>;
}
/**
* 获取部分对象属性
*
* @sig pick :: [string] -> object -> object
*/
declare const pick: PickCurry;
interface PropCurry {
<O extends TObject<any>, K extends keyof O>(key: K, obj: O): O[K];
<O extends TObject<any>, K extends keyof O>(key: K): (obj: O) => O[K];
}
declare function prop_<O extends TObject<any>, K extends keyof O>(key: K, obj: O): O[K];
/**
* 获取对象属性
*
* @sig prop :: string -> object -> any
*/
declare const prop: PropCurry;
declare function props_(keys: TMany<string>[], source: TObject<any>, sep?: string | RegExp): TObject<any>;
interface PropsCurry {
<R extends TObject<any>>(keys: TMany<string>[], source: TObject<any>): R;
<R extends TObject<any>>(keys: TMany<string>[]): (source: TObject<any>) => R;
}
/**
* 获取对象指定 key 的值
*
* @sig props :: [String] -> Object -> Object
*/
declare const props: PropsCurry;
declare function rename_<O extends TObject<any>>(nameMap: Record<keyof O, string>, source: O): TOptional<O> & TObject<any>;
interface RenameCurry {
<O extends TObject<any>>(nameMap: Record<keyof O, string>, source: O): TOptional<O> & TObject<any>;
(nameMap: Record<string, string>): (source: TObject<any>) => TObject<any>;
}
/**
* 重命名对象属性
*
* @sig rename :: {k: string} -> object -> object
*/
declare const rename: RenameCurry;
interface AddThenCurry {
<T, R>(fn: TFunc<[T], R>, promise: Promise<T>): Promise<R>;
<T, R>(fn: TFunc<[T], R>): (promise: Promise<T>) => Promise<R>;
}
declare function addThen_<T, R>(fn: TFunc<[T], R>, promise: Promise<T>): Promise<R>;
/**
* 添加 then 链
*
* 用于组合函数的话应处于末尾
*
* @sig addThen :: ((a -> b) -> Promise a -> Promise b)
*/
declare const addThen: AddThenCurry;
declare const always_: <T>(value: T, _: any) => T;
interface AlwaysCurry {
<T>(value: T, _: any): T;
<T>(value: T): TFunc<any, T>;
}
/**
* 恒等函数
*
* @sig always :: a -> any -> a
*/
declare const always: AlwaysCurry;
interface DefaultValueCurry {
<T, A>(value: T, input: A): T | A;
<T, A>(value: T): TFunc<[A], T | A>;
}
declare const defaultValue_: <T, A>(value: T, input: A) => T | A;
/**
* 默认值
*
* @sig defaultValue :: a -> b -> a | b
*/
declare const defaultValue: DefaultValueCurry;
/**
* 恒等函数
*
* @sig id :: a -> a
*/
declare const id: <T>(value: T) => T;
declare const id_: <T>(value: T) => T;
/**
* 恒等函数
*
* @sig identity :: a -> a
* @alias id
*/
declare const identity: <T>(value: T) => T;
declare const identity_: <T>(value: T) => T;
/**
* 字符串转驼峰
*
* @sig toCamelCase :: string -> string
*/
declare const toCamelCase: (source: string) => string;
declare const toCamelCase_: (source: string) => string;
/**
* 字符串转中划线
*
* @sig toKebabCase :: string -> string
*/
declare const toKebabCase: (source: string) => string;
declare const toKebabCase_: (source: string) => string;
/**
* 字符串转小写
*
* @sig toLowerCase :: string -> string
*/
declare const toLowerCase: (source: string) => string;
declare const toLowerCase_: (source: string) => string;
/**
* 字符串转下划线
*
* @sig toUnderlineCase :: string -> string
*/
declare const toUnderlineCase: (source: string) => string;
declare const toUnderlineCase_: (source: string) => string;
/**
* 字符串转大写
*
* @sig toUpperCase :: string -> string
*/
declare const toUpperCase: (source: string) => string;
declare const toUpperCase_: (source: string) => string;
type index_ApplyCurry = ApplyCurry;
type index_TakeCurry = TakeCurry;
declare const index___: typeof __;
declare const index_addThen: typeof addThen;
declare const index_addThen_: typeof addThen_;
declare const index_adjust: typeof adjust;
declare const index_adjust_: typeof adjust_;
declare const index_always: typeof always;
declare const index_always_: typeof always_;
declare const index_aperture: typeof aperture;
declare const index_aperture_: typeof aperture_;
declare const index_append: typeof append;
declare const index_append_: typeof append_;
declare const index_apply: typeof apply;
declare const index_applySpec: typeof applySpec;
declare const index_applySpec_: typeof applySpec_;
declare const index_applyTo: typeof applyTo;
declare const index_applyTo_: typeof applyTo_;
declare const index_apply_: typeof apply_;
declare const index_argNumLimit: typeof argNumLimit;
declare const index_argNumLimit_: typeof argNumLimit_;
declare const index_assoc: typeof assoc;
declare const index_assoc_: typeof assoc_;
declare const index_both: typeof both;
declare const index_both_: typeof both_;
declare const index_collectBy: typeof collectBy;
declare const index_collectBy_: typeof collectBy_;
declare const index_compose: typeof compose;
declare const index_curry: typeof curry;
declare const index_deepExec: typeof deepExec;
declare const index_deepExecWith: typeof deepExecWith;
declare const index_deepExecWith_: typeof deepExecWith_;
declare const index_deepExec_: typeof deepExec_;
declare const index_deepProp: typeof deepProp;
declare const index_deepProp_: typeof deepProp_;
declare const index_defaultValue: typeof defaultValue;
declare const index_defaultValue_: typeof defaultValue_;
declare const index_deleteProp: typeof deleteProp;
declare const index_deleteProp_: typeof deleteProp_;
declare const index_eq: typeof eq;
declare const index_eq_: typeof eq_;
declare const index_every: typeof every;
declare const index_every_: typeof every_;
declare const index_filter: typeof filter;
declare const index_filter_: typeof filter_;
declare const index_find: typeof find;
declare const index_findIndex: typeof findIndex;
declare const index_findIndex_: typeof findIndex_;
declare const index_find_: typeof find_;
declare const index_groupBy: typeof groupBy;
declare const index_groupBy_: typeof groupBy_;
declare const index_groupWith: typeof groupWith;
declare const index_groupWith_: typeof groupWith_;
declare const index_gt: typeof gt;
declare const index_gt_: typeof gt_;
declare const index_id: typeof id;
declare const index_id_: typeof id_;
declare const index_identity: typeof identity;
declare const index_identity_: typeof identity_;
declare const index_includes: typeof includes;
declare const index_includes_: typeof includes_;
declare const index_join: typeof join;
declare const index_join_: typeof join_;
declare const index_lt: typeof lt;
declare const index_lt_: typeof lt_;
declare const index_makeBy: typeof makeBy;
declare const index_makeBy_: typeof makeBy_;
declare const index_map: typeof map;
declare const index_map_: typeof map_;
declare const index_nth: typeof nth;
declare const index_nth_: typeof nth_;
declare const index_omit: typeof omit;
declare const index_omit_: typeof omit_;
declare const index_partition: typeof partition;
declare const index_partition_: typeof partition_;
declare const index_pick: typeof pick;
declare const index_pick_: typeof pick_;
declare const index_pipe: typeof pipe;
declare const index_placeholderFunc: typeof placeholderFunc;
declare const index_prop: typeof prop;
declare const index_prop_: typeof prop_;
declare const index_props: typeof props;
declare const index_props_: typeof props_;
declare const index_reduce: typeof reduce;
declare const index_reduce_: typeof reduce_;
declare const index_rename: typeof rename;
declare const index_rename_: typeof rename_;
declare const index_replicate: typeof replicate;
declare const index_replicate_: typeof replicate_;
declare const index_some: typeof some;
declare const index_some_: typeof some_;
declare const index_take: typeof take;
declare const index_take_: typeof take_;
declare const index_toCamelCase: typeof toCamelCase;
declare const index_toCamelCase_: typeof toCamelCase_;
declare const index_toKebabCase: typeof toKebabCase;
declare const index_toKebabCase_: typeof toKebabCase_;
declare const index_toLowerCase: typeof toLowerCase;
declare const index_toLowerCase_: typeof toLowerCase_;
declare const index_toUnderlineCase: typeof toUnderlineCase;
declare const index_toUnderlineCase_: typeof toUnderlineCase_;
declare const index_toUpperCase: typeof toUpperCase;
declare const index_toUpperCase_: typeof toUpperCase_;
declare const index_trace: typeof trace;
declare const index_when: typeof when;
declare const index_when_: typeof when_;
declare const index_zip: typeof zip;
declare const index_zip_: typeof zip_;
declare namespace index {
export { type index_ApplyCurry as ApplyCurry, type index_TakeCurry as TakeCurry, index___ as __, index_addThen as addThen, index_addThen_ as addThen_, index_adjust as adjust, index_adjust_ as adjust_, index_always as always, index_always_ as always_, index_aperture as aperture, index_aperture_ as aperture_, index_append as append, index_append_ as append_, index_apply as apply, index_applySpec as applySpec, index_applySpec_ as applySpec_, index_applyTo as applyTo, index_applyTo_ as applyTo_, index_apply_ as apply_, index_argNumLimit as argNumLimit, index_argNumLimit_ as argNumLimit_, index_assoc as assoc, index_assoc_ as assoc_, index_both as both, index_both_ as both_, index_collectBy as collectBy, index_collectBy_ as collectBy_, index_compose as compose, index_curry as curry, index_deepExec as deepExec, index_deepExecWith as deepExecWith, index_deepExecWith_ as deepExecWith_, index_deepExec_ as deepExec_, index_deepProp as deepProp, index_deepProp_ as deepProp_, index_defaultValue as defaultValue, index_defaultValue_ as defaultValue_, index_deleteProp as deleteProp, index_deleteProp_ as deleteProp_, index_eq as eq, index_eq_ as eq_, index_every as every, index_every_ as every_, index_filter as filter, index_filter_ as filter_, index_find as find, index_findIndex as findIndex, index_findIndex_ as findIndex_, index_find_ as find_, index_groupBy as groupBy, index_groupBy_ as groupBy_, index_groupWith as groupWith, index_groupWith_ as groupWith_, index_gt as gt, index_gt_ as gt_, index_id as id, index_id_ as id_, index_identity as identity, index_identity_ as identity_, index_includes as includes, index_includes_ as includes_, index_join as join, index_join_ as join_, index_lt as lt, index_lt_ as lt_, index_makeBy as makeBy, index_makeBy_ as makeBy_, index_map as map, index_map_ as map_, index_nth as nth, index_nth_ as nth_, index_omit as omit, index_omit_ as omit_, index_partition as partition, index_partition_ as partition_, index_pick as pick, index_pick_ as pick_, index_pipe as pipe, index_placeholderFunc as placeholderFunc, index_prop as prop, index_prop_ as prop_, index_props as props, index_props_ as props_, index_reduce as reduce, index_reduce_ as reduce_, index_rename as rename, index_rename_ as rename_, index_replicate as replicate, index_replicate_ as replicate_, index_some as some, index_some_ as some_, index_take as take, index_take_ as take_, index_toCamelCase as toCamelCase, index_toCamelCase_ as toCamelCase_, index_toKebabCase as toKebabCase, index_toKebabCase_ as toKebabCase_, index_toLowerCase as toLowerCase, index_toLowerCase_ as toLowerCase_, index_toUnderlineCase as toUnderlineCase, index_toUnderlineCase_ as toUnderlineCase_, index_toUpperCase as toUpperCase, index_toUpperCase_ as toUpperCase_, index_trace as trace, index_when as when, index_when_ as when_, index_zip as zip, index_zip_ as zip_ };
}
export { append as $, type TOptional as A, type TRequired as B, type TConstructor as C, type TPromiseConstructor as D, type ErrorResult as E, type TMany as F, type TPromiseValue as G, type TDeepGetPropType as H, type TGetArgsWithCount as I, type TGetType as J, compose as K, curry as L, pipe as M, placeholderFunc as N, apply_ as O, type ApplyCurry as P, apply as Q, applyTo_ as R, applyTo as S, type TObject as T, argNumLimit_ as U, argNumLimit as V, adjust_ as W, adjust as X, aperture_ as Y, aperture as Z, append_ as _, type TObjKeyType as a, pick_ as a$, collectBy_ as a0, collectBy as a1, every_ as a2, every as a3, filter_ as a4, filter as a5, find_ as a6, find as a7, findIndex_ as a8, findIndex as a9, zip as aA, both_ as aB, both as aC, eq_ as aD, eq as aE, gt_ as aF, gt as aG, lt_ as aH, lt as aI, __ as aJ, trace as aK, when_ as aL, when as aM, applySpec_ as aN, applySpec as aO, assoc_ as aP, assoc as aQ, deepExec_ as aR, deepExec as aS, deepExecWith_ as aT, deepExecWith as aU, deepProp_ as aV, deepProp as aW, deleteProp_ as aX, deleteProp as aY, omit_ as aZ, omit as a_, groupBy_ as aa, groupBy as ab, groupWith_ as ac, groupWith as ad, includes_ as ae, includes as af, join_ as ag, join as ah, makeBy_ as ai, makeBy as aj, map_ as ak, map as al, nth_ as am, nth as an, partition_ as ao, partition as ap, reduce_ as aq, reduce as ar, replicate_ as as, replicate as at, some_ as au, some as av, take_ as aw, type TakeCurry as ax, take as ay, zip_ as az, type TAnyFunc as b, pick as b0, prop_ as b1, prop as b2, props_ as b3, props as b4, rename_ as b5, rename as b6, addThen_ as b7, addThen as b8, always_ as b9, always as ba, defaultValue_ as bb, defaultValue as bc, id as bd, id_ as be, identity as bf, identity_ as bg, toCamelCase as bh, toCamelCase_ as bi, toKebabCase as bj, toKebabCase_ as bk, toLowerCase as bl, toLowerCase_ as bm, toUnderlineCase as bn, toUnderlineCase_ as bo, toUpperCase as bp, toUpperCase_ as bq, type TGetArgs as c, type TGetReturnType as d, type TFunc as e, type TArgsType as f, type TFlatPromise as g, type TReverseArray as h, index as i, type TAllType as j, type TExclude as k, type TAppend as l, type TLastBeforeTypes as m, type TLastType as n, type THeadType as o, type TFirstType as p, type TTailTypes as q, type TPrepend as r, type TCast as s, type TLength as t, type TDropHead as u, type TLastTwoArg as v, type THeadTwoArg as w, type TArrayItem as x, type TArrayType as y, type TUnwrapPromise as z };