UNPKG

@consolidados/results

Version:
26 lines (23 loc) 877 B
import { N as None$1, S as Some$1 } from '../option-DpT8KCGE.js'; export { O as Option } from '../option-DpT8KCGE.js'; /** * Creates a new `Some` instance, representing an `Option` with a value. * @template T The type of the value contained in the `Some`. * @param value The value to wrap in the `Some` instance. * @returns A `Some` instance containing the given value. * @example * const option = Some(42); * console.log(option.isSome()); // true * console.log(option.unwrap()); // 42 */ declare function Some<T>(value: T): Some$1<T>; /** * Creates a new `None` instance, representing an `Option` with no value. * @returns A `None` instance. * @example * const option = None(); * console.log(option.isNone()); // true * console.log(option.unwrap()); // throws Error: "Called unwrap on a None value" */ declare function None(): None$1; export { None, Some };