export declare type Result = OkResult | ErrResult; declare type OkResult = { readonly kind: 'ok'; value: T; }; declare type ErrResult = { readonly kind: 'err'; value: E; }; export declare function ok(value: T): Result; export declare function err(value: E): Result; export declare function isOk(result: Result): result is OkResult; export declare function isErr(result: Result): result is ErrResult; export declare function map(result: Result, fn: (value: T1) => T2): Result; export declare function mapErr(result: Result, fn: (value: E1) => E2): Result; export declare function toOutputResult(result: Result): OutputResult; /** A result, which can be in an 'ok' or 'err' state. */ export declare type OutputResult = Result & ResultMethods; interface ResultMethods { /** Is the result an ok value (ie not an error)? */ isOk(this: Result): this is OkResult & ResultMethods; /** Is the result an error? */ isErr(this: Result): this is ErrResult & ResultMethods; } export {};