interface ResultLike { readonly ok: boolean; map(f: (x: T) => U): Result; mapError(f: (x: E) => F): Result; } declare class OkImpl implements ResultLike { readonly value: T; constructor(value: T); get ok(): true; map(f: (x: T) => U): OkImpl; mapError(): this; } declare class ErrImpl implements ResultLike { readonly error: E; constructor(error: E); get ok(): false; map(): this; mapError(f: (x: E) => F): ErrImpl; } export type Ok = OkImpl; export type Err = ErrImpl; export type Result = Ok | Err; export declare const Result: { Ok: typeof OkFactory; Err: typeof ErrFactory; }; declare function OkFactory(a: T): Ok; declare function OkFactory(): Ok; declare function ErrFactory(a: T): Err; declare function ErrFactory(): Err; export {};