UNPKG

@cloudcome/utils-core

Version:
6 lines (5 loc) 299 B
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>>;