/** * Defines a type `T` that can also be `null`. * @category Utils — Options */ export type Nullable = T | null; /** * Defines a type `T` that can also be `null` or `undefined`. * @category Utils — Options */ export type Nullish = T | null | undefined; /** * An implementation of the Rust Option type in JavaScript. * It can be one of the following: * - {@link Some}: Meaning there is a value of type T. * - {@link None}: Meaning there is no value. * * @category Utils — Options */ export type Option = Some | None; /** * Defines a looser type that can be used when serializing an {@link Option}. * This allows us to pass null or the Option value directly whilst still * supporting the Option type for use-cases that need more type safety. * * @category Utils — Options */ export type OptionOrNullable = Option | Nullable; /** * Represents an option of type `T` that has a value. * * @see {@link Option} * @category Utils — Options */ export type Some = { __option: 'Some'; value: T; }; /** * Represents an option of type `T` that has no value. * * @see {@link Option} * @category Utils — Options */ export type None = { __option: 'None'; }; /** * Creates a new {@link Option} of type `T` that has a value. * * @see {@link Option} * @category Utils — Options */ export declare const some: (value: T) => Option; /** * Creates a new {@link Option} of type `T` that has no value. * * @see {@link Option} * @category Utils — Options */ export declare const none: () => Option; /** * Whether the given data is an {@link Option}. * @category Utils — Options */ export declare const isOption: (input: any) => input is Option; /** * Whether the given {@link Option} is a {@link Some}. * @category Utils — Options */ export declare const isSome: (option: Option) => option is Some; /** * Whether the given {@link Option} is a {@link None}. * @category Utils — Options */ export declare const isNone: (option: Option) => option is None;