diff --git a/typescript/types/layout.d.ts b/typescript/types/layout.d.ts index 2810026ca..58aa98ecd 100644 --- a/typescript/types/layout.d.ts +++ b/typescript/types/layout.d.ts @@ -7,7 +7,7 @@ type ExtractIds = [Depth] extends [never] ? never : (T extends { id?: infer Id extends string } - ? { [k in Id]: T } + ? { [k in Id]: { -readonly [P in keyof T]: T[P] } } : never) | ( @@ -34,6 +34,7 @@ declare module Layout { setUI(): void; }; + // Note: you must use new Layout({...} as const) to have ids inferred var Layout: { new ( hier: T,