File tree Expand file tree Collapse file tree 2 files changed +4
-82
lines changed Expand file tree Collapse file tree 2 files changed +4
-82
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import {
15
15
Matchers ,
16
16
Variants ,
17
17
CSSProperties ,
18
- Paths ,
19
18
} from './types' ;
20
19
21
20
export type Theme = Partial < ThemeOrAny > ;
@@ -36,13 +35,10 @@ type ResolveAlias<
36
35
37
36
type ScaleKeys < Property > = LiteralUnion <
38
37
Extract <
39
- Paths <
40
- ThemeOrAny [ 'scales' ] [ ThemeOrAny [ 'matchers' ] [ Extract < Property , Matchers > ] ]
41
- > ,
42
- // keyof ThemeOrAny['scales'][ThemeOrAny['matchers'][Extract<
43
- // Property,
44
- // Matchers
45
- // >]],
38
+ keyof ThemeOrAny [ 'scales' ] [ ThemeOrAny [ 'matchers' ] [ Extract <
39
+ Property ,
40
+ Matchers
41
+ > ] ] ,
46
42
ValueOf < ScopedCSSProperties >
47
43
> ,
48
44
ValueOf < ScopedCSSProperties >
Original file line number Diff line number Diff line change @@ -12,77 +12,3 @@ export type Matchers = Tokens<'matchers'>;
12
12
export type Shorthands = Tokens < 'shorthands' > ;
13
13
export type Aliases = Tokens < 'aliases' > ;
14
14
export type Variants = LiteralUnion < Tokens < 'variants' > , string > ;
15
-
16
- export type Join < K , P > = K extends string | number
17
- ? P extends string | number
18
- ? `${K } ${'' extends P ? '' : '.' } ${P } `
19
- : never
20
- : never ;
21
-
22
- type Prev = [
23
- never ,
24
- 0 ,
25
- 1 ,
26
- 2 ,
27
- 3 ,
28
- 4 ,
29
- 5 ,
30
- 6 ,
31
- 7 ,
32
- 8 ,
33
- 9 ,
34
- 10 ,
35
- 11 ,
36
- 12 ,
37
- 13 ,
38
- 14 ,
39
- 15 ,
40
- 16 ,
41
- 17 ,
42
- 18 ,
43
- 19 ,
44
- 20 ,
45
- ...0 [ ]
46
- ] ;
47
-
48
- export type Paths < T , D extends number = 10 > = [ D ] extends [ never ]
49
- ? never
50
- : T extends object // eslint-disable-line @typescript-eslint/ban-types
51
- ? {
52
- [ K in keyof T ] -?: K extends string | number
53
- ? `${K } ` | Join < K , Paths < T [ K ] , Prev [ D ] > >
54
- : never ;
55
- } [ keyof T ]
56
- : '' ;
57
-
58
- // type NestedObjectType = {
59
- // a: string;
60
- // b: string;
61
- // colors: {
62
- // primary: 'tomato';
63
- // secondary: 'cyan';
64
- // gray: [
65
- // '#F8F9F9',
66
- // '#EDEFF1',
67
- // '#DDE0E4',
68
- // '#CBD1D6',
69
- // '#B2BAC2',
70
- // '#939BA3', // base
71
- // '#7A838C',
72
- // '#636d75',
73
- // '#515961',
74
- // '#343b40',
75
- // ];
76
- // };
77
- // nest: {
78
- // c: string;
79
- // };
80
- // otherNest: {
81
- // c: string;
82
- // };
83
- // };
84
- // type NestedObjectPaths1 = Paths<NestedObjectType>;
85
- // type NestedObjectPaths2 = keyof NestedObjectType;
86
- //
87
- // const x: NestedObjectPaths2 = 'nest';
88
- // console.log(x);
You can’t perform that action at this time.
0 commit comments