UNPKG

tickethead-sdk

Version:

SDK for the Tickethead API

14 lines 488 B
type Success<T> = { data: T; error?: never; }; type Failure<E> = { data?: never; error: E; }; type Result<T, E = Error> = Success<T> | Failure<E>; type MaybePromise<T> = T | Promise<T>; /** Utility function which resolves a promise and returns a result type, allowing for cleaner error handling. */ export declare function tryCatch<T, E = Error>(arg: Promise<T> | (() => MaybePromise<T>)): Result<T, E> | Promise<Result<T, E>>; export {}; //# sourceMappingURL=try.d.ts.map