@cloudcome/utils-core
Version:
cloudcome core utils
6 lines (5 loc) • 299 B
TypeScript
import { FlattenReturn } from './types';
export type SyncFunction<T> = () => T;
export declare function trySync<T>(syncFn: SyncFunction<T>): FlattenReturn<T>;
export type AsyncFunction<T> = () => Promise<T>;
export declare function tryAsync<T>(asyncFn: AsyncFunction<T>): Promise<FlattenReturn<T>>;