/** * Base type for a tagged union with type as the tag field */ export declare type Tagged = { readonly type: string; }; /** * Extract a case from a tagged union based on the (singleton) type of the tag */ export declare type SelectTag = T extends { type: Tag; } ? T : never; /** * Type transform that makes a nested type partial, while * leaving alone arrays, readonly arrays, functions and scalars */ export declare type DeepPartial = T extends ReadonlyArray ? T : T extends Function ? T : T extends object ? { [K in keyof T]?: DeepPartial; } : T; export declare const todo: (...args: any[]) => never; export declare const none: () => never; /** * Assert that from the type information, a piece of code can never be reached. * If it’s still reached at runtime, this throws an Error. * @public */ export declare const unreachable: (x?: never) => never; /** * Assert that from the type information, a certain statement can never be reached, * while installing a default value to return in case the type information was wrong * and the statement was in fact reached. * @public */ export declare function unreachableOrElse(_: never, t: T): T; /** * Avoids lint false positives like "Expression is always false. (strict-type-predicates)" */ export declare const lookup: (m: { [k: string]: V; }, k: string) => V | undefined; /** * Helpers for dealing with "type X = { [ key: K]: Y | undefined } */ declare type RecordKey = string | number | symbol; export declare type RWPartialRecord = { [P in K]?: V; }; export declare type PartialRecord = Readonly>; export declare type PartialRecord2 = { readonly [P in K1]?: { readonly [T in K2]?: V; }; }; export declare type RWKeyValueMap = RWPartialRecord; export declare type KeyValueMap = PartialRecord; export declare const isDefined: (v: T) => v is Exclude; export declare const valuesOf: (m: Readonly>) => Exclude[]; export declare const keysOf: (m: Readonly>) => Extract[]; export declare const entriesOf: (obj: Readonly>) => [Extract, V][]; export declare const entriesOf2: (m1: PartialRecord2) => readonly [Extract, Extract, V][]; export declare const toKeyValueMapF: (getKey: (v: T) => string, map: (v: T) => U, xs: readonly T[]) => Readonly>; export declare const toKeyValueMap: (key: K, xs: readonly T[]) => Readonly>; export declare const tuple: (...data: T) => T; export declare const PartialRecord: { get(m: Readonly>, key: K): Readonly>[K]; }; export declare const noop: () => undefined; export {};