typescript: remove `Layout_` naming hack

pull/2851/head
Rob Pilling 2023-05-21 22:20:41 +01:00
parent 5c483bbd88
commit 557b426b63
2 changed files with 4 additions and 4 deletions

View File

@ -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>
&

View File

@ -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;