/** * Allows to create a union type from a const object. * * Usage: * ```ts * const Values = { * One: 'one', * Two: 'two', * } as const; * type MyUnionValues = UnionOfConst; // will be: 'one' | 'two' * ``` */ export type UnionOfConst = `${T[keyof T]}`; export type ResultOf = { data: { [key: string]: T; }; errors: Error[]; }; /** * The type is T or null. * * - `type NullableString = Nullable`: * - `const nullableString: NullableString = "my string";` * - `const nullableString: NullableString = null;` * - `type NullableMultipleType = Nullable`: */ export type Nullable = T | null;