prostgles-types
Version:
Shared TypeScript object definitions for prostgles-client and prostgles-server
13 lines • 397 B
TypeScript
export type TryCatchResult<T> = {
data: T;
hasError?: false;
error?: undefined;
duration: number;
} | {
data?: undefined;
hasError: true;
error: unknown;
duration: number;
};
export declare const tryCatchV2: <T>(func: () => T) => T extends Promise<infer R> ? Promise<TryCatchResult<Awaited<Promise<R>>>> : TryCatchResult<T>;
//# sourceMappingURL=tryCatchV2.d.ts.map