UNPKG

937 BTypeScriptView Raw
1import { IType, IAnyType } from "../../internal";
2/** @hidden */
3export interface IMaybeIType<IT extends IAnyType, C, O> extends IType<IT["CreationType"] | C, IT["SnapshotType"] | O, IT["TypeWithoutSTN"] | O> {
4}
5/** @hidden */
6export interface IMaybe<IT extends IAnyType> extends IMaybeIType<IT, undefined, undefined> {
7}
8/** @hidden */
9export interface IMaybeNull<IT extends IAnyType> extends IMaybeIType<IT, null | undefined, null> {
10}
11/**
12 * `types.maybe` - Maybe will make a type nullable, and also optional.
13 * The value `undefined` will be used to represent nullability.
14 *
15 * @param type
16 * @returns
17 */
18export declare function maybe<IT extends IAnyType>(type: IT): IMaybe<IT>;
19/**
20 * `types.maybeNull` - Maybe will make a type nullable, and also optional.
21 * The value `null` will be used to represent no value.
22 *
23 * @param type
24 * @returns
25 */
26export declare function maybeNull<IT extends IAnyType>(type: IT): IMaybeNull<IT>;