1 | import { Modx } from '../_Internal';
|
---|
2 | import { IterationOf } from '../../Iteration/IterationOf';
|
---|
3 | import { Iteration } from '../../Iteration/Iteration';
|
---|
4 | import { Pos } from '../../Iteration/Pos';
|
---|
5 | import { Next } from '../../Iteration/Next';
|
---|
6 | import { Key } from '../../Any/Key';
|
---|
7 | import { LastKey } from '../../List/LastKey';
|
---|
8 | import { List } from '../../List/List';
|
---|
9 | /**
|
---|
10 | * @hidden
|
---|
11 | */
|
---|
12 | declare type Record_RR<Path extends List<Key>, A, I extends Iteration = IterationOf<0>> = {
|
---|
13 | readonly [Key in Path[Pos<I>]]: Pos<I> extends LastKey<Path> ? A : Record_RR<Path, A, Next<I>>;
|
---|
14 | } & {};
|
---|
15 | /**
|
---|
16 | * @hidden
|
---|
17 | */
|
---|
18 | export declare type Record_RW<Path extends List<Key>, A, I extends Iteration = IterationOf<0>> = {
|
---|
19 | [Key in Path[Pos<I>]]: Pos<I> extends LastKey<Path> ? A : Record_RW<Path, A, Next<I>>;
|
---|
20 | } & {};
|
---|
21 | /**
|
---|
22 | * @hidden
|
---|
23 | */
|
---|
24 | declare type Record_OR<Path extends List<Key>, A, I extends Iteration = IterationOf<0>> = {
|
---|
25 | readonly [Key in Path[Pos<I>]]?: Pos<I> extends LastKey<Path> ? A : Record_OR<Path, A, Next<I>>;
|
---|
26 | } & {};
|
---|
27 | /**
|
---|
28 | * @hidden
|
---|
29 | */
|
---|
30 | declare type Record_OW<Path extends List<Key>, A, I extends Iteration = IterationOf<0>> = {
|
---|
31 | [Key in Path[Pos<I>]]?: Pos<I> extends LastKey<Path> ? A : Record_OW<Path, A, Next<I>>;
|
---|
32 | } & {};
|
---|
33 | /**
|
---|
34 | * Create an object filled with `A` for the fields at the end of `Path`
|
---|
35 | * @param Path to choose fields
|
---|
36 | * @param A to fill fields with
|
---|
37 | * @param modx (?=`['!', 'W']`) to set modifiers
|
---|
38 | * @returns [[Object]]
|
---|
39 | * @example
|
---|
40 | * ```ts
|
---|
41 | * ```
|
---|
42 | */
|
---|
43 | export declare type Record<Path extends List<Key>, A, modx extends Modx = ['!', 'W']> = {
|
---|
44 | '!': {
|
---|
45 | 'R': Record_RR<Path, A>;
|
---|
46 | 'W': Record_RW<Path, A>;
|
---|
47 | };
|
---|
48 | '?': {
|
---|
49 | 'R': Record_OR<Path, A>;
|
---|
50 | 'W': Record_OW<Path, A>;
|
---|
51 | };
|
---|
52 | }[modx[0]][modx[1]];
|
---|
53 | export {};
|
---|