export declare const OptionType: { Some: symbol; None: symbol; }; export interface Match { some: (val: T) => U; none: (() => U) | U; } export interface Option { type: symbol; is_some(): boolean; is_none(): boolean; match(fn: Match): U; map(fn: (val: T) => U): Option; and_then(fn: (val: T) => Option): Option; or(optb: Option): Option; and(optb: Option): Option; unwrap_or(def: T): T; unwrap(): T | never; } export interface _Some extends Option { unwrap(): T; map(fn: (val: T) => U): _Some; or(optb: Option): Option; and(optb: Option): Option; } export interface _None extends Option { unwrap(): never; map(fn: (val: T) => U): _None; or(optb: Option): Option; and(optb: Option): _None; } export declare function Some(val: T | null | undefined): Option; export declare const None: _None; export declare function some_constructor(val: T): _Some; export declare function none_constructor(): _None; export declare function is_option(val: Option | any): val is Option; export declare function is_some(val: Option): val is _Some; export declare function is_none(val: Option): val is _None; export declare function get_in(obj: Object | undefined | null, key: string): Option;