mirror of https://github.com/espruino/BangleApps
typescript: remove `Layout_` naming hack
parent
5c483bbd88
commit
557b426b63
|
@ -1,6 +1,6 @@
|
|||
type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
||||
|
||||
type ExtractIds<T extends Layout_.Hierarchy, Depth extends Prev[number] = 9> =
|
||||
type ExtractIds<T extends Layout.Hierarchy, Depth extends Prev[number] = 9> =
|
||||
[Depth] extends [never]
|
||||
? never
|
||||
: (T extends { id: infer Id extends string }
|
||||
|
@ -8,12 +8,12 @@ type ExtractIds<T extends Layout_.Hierarchy, Depth extends Prev[number] = 9> =
|
|||
: never)
|
||||
|
|
||||
(
|
||||
T extends { c: Array<infer Sub extends Layout_.Hierarchy> }
|
||||
T extends { c: Array<infer Sub extends Layout.Hierarchy> }
|
||||
? ExtractIds<Sub, Prev[Depth]>
|
||||
: never
|
||||
);
|
||||
|
||||
declare module Layout_ {
|
||||
declare module Layout {
|
||||
type Layouter<T extends Hierarchy> =
|
||||
ExtractIds<T>
|
||||
&
|
||||
|
|
|
@ -4,4 +4,4 @@ declare function require(moduleName: "sched"): typeof Sched;
|
|||
|
||||
declare function require(moduleName: "ClockFace"): typeof ClockFace_.ClockFace;
|
||||
declare function require(moduleName: "clock_info"): typeof ClockInfo;
|
||||
declare function require(moduleName: "Layout"): typeof Layout_.Layout;
|
||||
declare function require(moduleName: "Layout"): typeof Layout.Layout;
|
||||
|
|
Loading…
Reference in New Issue