import type { Result } from "./result"; /** Options for safeTry behavior */ type SafeTryOptions = { /** If true, re-throws the error instead of capturing it */ throw?: boolean; }; /** * Wraps a function in try-catch, returns `Result`. * - Always returns a Promise resolving to Ok or Err. * - Internally evaluates return values from Atom, Result, or Option types. * - Use `{ throw: true }` to re-throw errors instead of capturing. * * @param fn - Function to execute (sync or async) * @param options - `{ throw?: boolean }` * @returns Promise of `Result` * * @example * const result = await safeTry(() => "Hello"); * if (result.isOk) println(result.value); * * @example * const result = await safeTry(() => { * throw new Error("Oops!"); * }); * if (result.isErr) println(result.error); */ export declare function safeTry(fn: () => T | Promise, options?: SafeTryOptions): Promise>; export {};