export type int = number; export type float = number; export type str = string; export type bool = boolean; export type unk = unknown; export type Obj = Object; export type Primitive = str | number | bool; export type Key = string | number; export interface Dic { [key: string]: T; } export interface AnyDic { [key: PropertyKey]: T; } /**json array */ export type JsonA = JsonR[]; /**json object */ export type JsonO = { [key: string]: JsonR; }; /**json result */ export type JsonR = str | float | bool | null | JsonA | JsonO; export type falsy = false | 0 | 0n | -0 | "" | undefined | null; export type Pair = [key: K, val: V]; export type Arr = T[] | T; export type Task = T | Promise; /**check if value is instance of type */ export declare const is: (value: unk, type: abstract new (...args: any) => T) => value is T; /**is string */ export declare const isS: (value: unk) => value is string; /**is function */ export declare const isF: (value: unk) => value is Function; /** is object */ export declare const isO: (value: unk) => value is Dic; /**is number */ export declare const isN: (value: unk) => value is number; /** is boolean */ export declare const isB: (value: unk) => value is boolean; /** is undefined */ export declare const isU: (value: unk) => value is undefined; /** is promise like */ export declare const isP: (value: any) => value is PromiseLike; /** is array */ export declare const isA: (value: any) => value is T[]; export declare const wait: (ms?: int) => Promise; export declare const assign: { (t: T, ...s: Partial[]): T; } & typeof Object.assign; export declare const clone: (v: T) => T; /**toString, obs null and undefined return an ""(empty string) */ export declare const toStr: (v: unk) => string; /**return def if value is undefined */ export declare const def: (value: T, def: D) => T | D; /**returns true if value is not false ie.(value===false) t stands for true*/ export declare const t: (value: unknown) => bool; export declare const call: (v: T, cb: (v: T) => any) => T; export declare const sub: (arr: T[], key: K) => T[K][]; export declare const distinct: (arr: T[]) => T[]; /**get last item of array */ export declare const z: (a: ArrayLike) => T; export declare const filter: { (arr: Array, filter: (v: T, i: number) => boolean): T[]; /**filter all truethfull values */ (arr: Array): Exclude[]; }; /**get length of array */ export declare const l: (a: ArrayLike) => number; export declare const arr: (v: T | T[]) => T[]; export declare function iByKey(arr: ArrayLike, name: T[K], key: K, i?: number): number; export declare function byKey(arr: ArrayLike, name: T[K], key: K, i?: number): T | null; export declare const create: (constructor: new (...a: A) => T, obj: Partial, ...a: A) => T; export declare const json: { (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; (value: any, replacer?: (string | number)[], space?: string | number): string; }; export declare function set(o: T, key: K, val: T[K]): T; export declare const notImp: () => Error; export declare const notF: (key: Key, itemTp?: str, src?: any, srcTp?: str) => Error;