@ucanto/core
Version:
27 lines • 693 B
TypeScript
export function ok<T extends string | number | boolean | {}>(value: T): {
ok: T;
error?: undefined;
};
export function error<X extends string | number | boolean | {}>(cause: X): {
ok?: undefined;
error: X;
};
export function panic(message: string): never;
export function fail(message: string): {
error: API.Failure;
ok?: undefined;
};
/**
* @implements {API.Failure}
*/
export class Failure extends Error implements API.Failure {
describe(): string;
get message(): string;
toJSON(): {
name: string;
message: string;
stack: string | undefined;
};
}
import * as API from '@ucanto/interface';
//# sourceMappingURL=result.d.ts.map