UNPKG

692 BTypeScriptView Raw
1import { Modx } from './_Internal';
2import { Key } from '../Any/Key';
3/**
4 * Create an object filled with `A` for the fields `K`
5 * @param K to choose fields
6 * @param A (?=`unknown`) to fill fields with
7 * @param modx (?=`['!', 'W']`) to set modifiers
8 * @returns [[Object]]
9 * @example
10 * ```ts
11 * ```
12 */
13export declare type Record<K extends Key, A extends any = unknown, modx extends Modx = ['!', 'W']> = {
14 '!': {
15 'R': {
16 readonly [P in K]: A;
17 };
18 'W': {
19 [P in K]: A;
20 };
21 };
22 '?': {
23 'R': {
24 readonly [P in K]?: A;
25 };
26 'W': {
27 [P in K]?: A;
28 };
29 };
30}[modx[0]][modx[1]];