import { Range } from './loc.js'; declare type ErrorDetails = { phase: string; range?: Range; message: string; src?: string; hint?: string; }; declare const errorDetails: (phase: string, message: string, range?: Range, src?: string, hint?: string) => { phase: string; range: Range | undefined; message: string; src: string | undefined; hint: string | undefined; }; declare type Error = { tag: 'error'; details: ErrorDetails[]; andThen: (f: (_: T) => Result) => Result; asyncAndThen: (f: (_: T) => Promise>) => Promise>; }; declare function detailsToCompleteString(details: ErrorDetails): string; declare function allDetailsToCompleteString(details: ErrorDetails[]): string; declare function detailsToMsgString(details: ErrorDetails): string; declare function errorToString(err: Error): string; declare type Ok = { tag: 'ok'; value: T; andThen: (f: (_: T) => Result) => Result; asyncAndThen: (f: (_: T) => Promise>) => Promise>; }; declare type Result = Error | Ok; declare function errors(errs: ErrorDetails[]): Error; declare function error(phase: string, message: string, range?: Range, src?: string, hint?: string): Error; declare function ok(x: T): Ok; declare function rethrow(err: Error): Error; declare function join(arr: Result[]): Result; declare function detailsToResult(errs: ErrorDetails[]): Result; declare class ICE extends Error { constructor(fn: string, reason: string, opts?: ErrorOptions); } export { Result, Error, ErrorDetails, errorDetails, error, errors, ok, detailsToCompleteString, allDetailsToCompleteString, detailsToMsgString, errorToString, rethrow, join, detailsToResult, ICE }; //# sourceMappingURL=result.d.ts.map