@cobuildlab/8base-chat
Version:
Chat component that uses 8base
26 lines (25 loc) • 795 B
TypeScript
/**
* Checks if current environment is 'development'
*/
export declare function isDevEnv(): boolean;
/**
* Calls console[type] with provided args
* Useful to distinguish logs that should be in production
* @param type - type of console (e.g. log, error)
* @param args
*/
export declare function log<T extends keyof Console>(type: T, ...args: Parameters<Console[T]>): any;
/**
* Function that calls console[type] only in dev environment
* @param type - type of console (e.g. log, error)
* @param args
*/
export declare function devLog<T extends keyof Console>(type: T, ...args: Parameters<Console[T]>): void;
/**
* Makes promise cancelable
* @author istarkov
*/
export declare function makeCancelable<T = any>(promise: Promise<T>): {
promise: Promise<T>;
cancel(): void;
};