import type { Uint, Float, ErrorNewArg } from './defs'; export declare const currentTimezone: number; export declare function getId(): number; /** * @method clone Clone an Object * @param obj The Object to be cloned */ export declare function clone(obj: any): any; /** * @method extend(obj:any,extd:any,top?:any)any */ export declare function extend(obj: any, extd: any, top?: any): any; /** * Empty function */ export declare function noop(): void; /** * @method isNull(value) */ export declare function isNull(value: any): boolean; /** * EXT class prototype objects * * @method extendClass(cls:Function,extds:Function[]|Function,top?:any)Function */ export declare function extendClass(cls: Function, extds: Function[] | Function, top?: Object): Function; /** * @method scopeLock(mutex:any,cb:Function)Promise */ export declare function scopeLock(mutex: any, cb: () => Promise | R): Promise; /** * Get object value by name */ export declare function getProp(name: string, self: any): any; /** * Setting object value by name */ export declare function setProp(name: string, value: any, self: any): any; /** * Delete object value by name */ export declare function removeProp(name: string, self: any): void; /** * @method random(start?,end?) Creating random numbers * @param start? Numbers of begin * @param end? Numbers of end */ export declare function random(start?: Uint, end?: Uint): Uint; /** * @method randomFloat(start?,end?) Creating random float numbers * @param start? Numbers of begin * @param end? Numbers of end */ export declare function randomFloat(start?: Float, end?: Float): Float; /** * @method fixRandom(arg0,...args)Uint * * * Fixed random value, specified probability to return a constant * * * Get a random number from `0` to the passed probability number `arguments.length` by probability * * * The sum of the passed probabilities cannot be `zero` * * @param arg0:number Enter percentage * @param args:number[] Enter percentage * * Example: * * ```js * // Prints: 3 5 9 * console.log(util.random(0, 10)) * console.log(util.random(0, 10)) * console.log(util.random(0, 10)) * // Prints 0 3 2 * console.log(util.fixRandom(10, 20, 30, 40)) * console.log(util.fixRandom(10, 20, 30, 40)) * console.log(util.fixRandom(10, 20, 30, 40)) * ``` */ export declare function fixRandom(arg: number, ...args: number[]): number; /** * @method filter(obj,exp,non?)any Filter object attrs * @param obj:any * @param exp:string[]|Function filter exp * @param non?:boolean take non */ export declare function filter(obj: any, exp: string[] | ((key: string, value: any) => boolean), non?: boolean): any; /** * @method update(obj,extd)any Update object property value * @param obj:any need to be updated for as * @param extd:any update object */ export declare function update(obj: T, extd: any): T; /** * @method select(default:any,value:any)any */ export declare function select(default_: T, value: any): T; /** * Whether this type of sub-types * * @method equalsClass(baseclass:any,subclass:any)boolean */ export declare function equalsClass(baseclass: any, subclass: any): boolean; /** * @method assert(condition,arg?:number|ErrorNewArg,extMsg?:string) * Asserts that value is not null or undefined. * @param condition The value to check. * @param arg? Optional code or message for the error thrown. * @param extMsg? Optional message for the error thrown. * @returns {void} nothing */ export declare function assert(condition: T, arg?: number | ErrorNewArg, extMsg?: string): asserts condition is NonNullable; export declare function timeout(promise: Promise | T, time: number): Promise; /** * @method promise(executor:Function)Promise */ export declare function promise(executor: (resolve: (value: T) => void, reject: (reason?: any) => void, promise: Promise) => any): Promise;