import { Supplier } from './functional/types'; import { F1 } from './typestub-curry'; export declare function deepGetProp(name: string, o: any): A; export declare function hasProp(k: ObjKey, o: Obj): boolean; export declare function checkedGetProp(k: ObjKey, o: Obj): A; export declare function getPropWithDefault(v: A, k: ObjKey, o: Obj): A; export declare function first_non_null(...args: A[]): A | null; export declare function ifNull(a: A, b: A): A; export declare function ifNullF(a: A, f: Supplier): A; /** * @remark won't flatten a * */ export declare function ifNullFAsync(a: A, f: Supplier>): Promise; export declare function bindFunction(f: Function): Function; export declare function caseLookup(cases: Array<[A, B]>, target: A): B; export declare function caseFunctionLookup(cases: Array<[A, () => B]>, target: A): B; /** * @deprecated use compare() or compare_string() instead * */ export declare function compareString(a: string, b: string): -1 | 0 | 1; export declare type deepF = (() => A) | (() => deepF); export declare function deepCall(f: deepF | A): A; export interface Obj { [k: string]: A; [k: number]: A; } export declare type ObjKey = string | number; export declare function objForEach(f: (a?: A, k?: ObjKey, o?: Obj) => void): (o: Obj) => void; export declare function objMap(f: (a?: A, k?: ObjKey, o?: Obj) => B): (o: Obj) => B[]; export declare function objFilter(f: (a?: A, k?: ObjKey, o?: Obj) => boolean): (o: Obj) => A[]; export declare function objToArray(o: Obj): Array<[A, ObjKey]>; export declare function objValues(o: Obj): A[]; export declare function argsToArray(args: IArguments): A[]; /** * take all from as ++ take some from args * */ export declare function concatArgs(as: ArrayLike, args: ArrayLike, offsetArgs?: number, nArgs?: number): A[]; export declare function copyArray(xs: ArrayLike, offset?: number, count?: number): A[]; export declare function copyToArray(dest: A[], destOffset: number | undefined, src: ArrayLike, srcOffset?: number, count?: number): A[]; export declare function genFunction(n: number, f: Function): Function; export declare function isDefined(a: any): boolean; export declare function notDefined(a: any): boolean; export declare function isNumber(i: string | number): boolean; export declare function toNumber(i: string | number): number; /** * @param f: consumer function * @param end: ending (exclusive) * @param start: offset (inclusive) * */ export declare function forI(f: (i: number) => void, end: number, start?: number): void; export declare function mapI(f: (i: number) => A, size: number): A[]; export declare function repeatI(f: () => A, size: number): A[]; /** apply the function without throwing exception */ export declare function tryApply(f: (...args: A[]) => B, args: A[]): B | undefined; /** call the function without throwing exception */ export declare function tryCall(f: (...args: A[]) => B, ...args: A[]): B | undefined; export declare function tryWithDefault(f: (...args: A[]) => B, defaultValue: B, args?: A[]): B; export declare type ChainObject = (f: (a: A) => void) => ChainObject; export declare function chainObject(a: A): ChainObject; export declare type Type = new (...args: any[]) => A; export declare function _if(f: () => any): (b: boolean) => void; export declare function applyIf(a: A | false | 0 | null | void, f: F1): B | void; export { /**@deprecated*/ gen_noop, /**@deprecated*/ noop, } from './noop'; export declare function cast(o: any): any; export declare function equals(a: A, b: A): boolean; export declare function not_equals(a: A, b: A): boolean; export declare function another(a: A, b: A, compare: A): A;