main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
890 bytes
|
Line | |
---|
1 | import { Key } from '../Any/Key';
|
---|
2 | import { Cast } from '../Any/Cast';
|
---|
3 | import { Extends } from '../Any/Extends';
|
---|
4 | import { Iteration } from '../Iteration/Iteration';
|
---|
5 | import { IterationOf } from '../Iteration/IterationOf';
|
---|
6 | import { Next } from '../Iteration/Next';
|
---|
7 | import { Pos } from '../Iteration/Pos';
|
---|
8 | import { List } from '../List/List';
|
---|
9 | import { Length } from '../List/Length';
|
---|
10 | import { At } from '../Any/At';
|
---|
11 | /**
|
---|
12 | * @ignore
|
---|
13 | */
|
---|
14 | declare type _Path<O, P extends List<Key>, I extends Iteration = IterationOf<0>> = {
|
---|
15 | 0: _Path<At<O, P[Pos<I>]>, P, Next<I>>;
|
---|
16 | 1: O;
|
---|
17 | }[Extends<Pos<I>, Length<P>>];
|
---|
18 | /**
|
---|
19 | * Get in `O` the type of nested properties
|
---|
20 | * @param O to be inspected
|
---|
21 | * @param Path to be followed
|
---|
22 | * @returns [[Any]]
|
---|
23 | * @example
|
---|
24 | * ```ts
|
---|
25 | * ```
|
---|
26 | */
|
---|
27 | export declare type Path<O extends any, P extends List<Key>> = _Path<O & {}, P> extends infer X ? Cast<X, any> : never;
|
---|
28 | export {};
|
---|
Note:
See
TracBrowser
for help on using the repository browser.