import { type TypeGuard, type Option, } from "@"; /** * ***Brief*** * A type-safety trait, enabling validation and transformation through user-defined type guard functions. * * ***Example*** * ```ts * let foo: Parsable; * foo * .parse((inst): inst is bigint => typeof inst === "bigint") * .map(int => { * /// ... * }); * ``` */ export type Parsable = { /** * ***Brief*** * `parse` validates the value using a provided type guard function. * * ***Example*** * ```ts * let foo: Parsable; * foo * .parse((inst): inst is bigint => typeof inst === "bigint") * .map(int => { * /// ... * }); * ``` */ parse(guard: TypeGuard): Option; };