UNPKG

type-plus

Version:
17 lines 736 B
import type { Widen } from '../utils/index.js'; import type { KeyTypes } from './KeyTypes.js'; /** * Creates a `Record<Key, Value>` or your custom record. * By default, * `record()` will widen the keys (`K`) you specified in the `value` to form `Record<Widen<K>, V>`. * * You can also override it by specifying a custom record, e.g.: * `record<{ a: number }>()` */ export declare function record<K extends KeyTypes, V>(value?: Record<K, V>): Record<Widen<K>, V>; export declare function record<R extends Record<any, any>>(value?: R): R; /** * Gets the value type `T` from `Record<any, T>`. */ export type RecordValue<R extends Record<any, any>> = R extends Record<any, infer T> ? T : never; //# sourceMappingURL=record.d.ts.map