//#region src/utils/results.d.ts type Result = { status: "ok"; data: T; } | { status: "error"; error: E; }; type AsyncResult = Result | ({ status: "pending"; } & { progress: P; }); declare const Result: { fromThrowing: typeof fromThrowing; fromThrowingAsync: typeof fromThrowingAsync; fromPromise: typeof promiseToResult; ok(data: T): Result & { status: "ok"; }; error(error: E): Result & { status: "error"; }; map: typeof mapResult; or: (result: Result, fallback: U) => T | U; orThrow: (result: Result) => T; orThrowAsync: (result: Promise>) => Promise; retry: typeof retry; }; declare const AsyncResult: { fromThrowing: typeof fromThrowing; fromPromise: typeof promiseToResult; ok: (data: T) => Result & { status: "ok"; }; error: (error: E) => Result & { status: "error"; }; pending: typeof pending; map: typeof mapResult; or: (result: AsyncResult, fallback: U) => T | U; orThrow: (result: AsyncResult) => T; retry: typeof retry; }; declare function pending(): AsyncResult & { status: "pending"; }; declare function pending

(progress: P): AsyncResult & { status: "pending"; }; declare function promiseToResult(promise: Promise): Promise>; declare function fromThrowing(fn: () => T): Result; declare function fromThrowingAsync(fn: () => Promise): Promise>; declare function mapResult(result: Result, fn: (data: T) => U): Result; declare function mapResult(result: AsyncResult, fn: (data: T) => U): AsyncResult; declare class RetryError extends AggregateError { readonly errors: E[]; constructor(errors: E[]); get attempts(): number; } declare function retry(fn: (attemptIndex: number) => Result | Promise>, totalAttempts: number, { exponentialDelayBase }?: { exponentialDelayBase?: number | undefined; }): Promise> & { attempts: number; }>; //#endregion export { AsyncResult, Result }; //# sourceMappingURL=results.d.ts.map