From 36a50d1ceec0df236b7c874f61a43c150cb8e726 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 9 Sep 2024 21:43:56 +0100 Subject: [PATCH] Layout: fix differing numeric types With a slight hack --- typescript/types/layout.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/typescript/types/layout.d.ts b/typescript/types/layout.d.ts index 55ddd7135..4329d0831 100644 --- a/typescript/types/layout.d.ts +++ b/typescript/types/layout.d.ts @@ -7,7 +7,16 @@ type ExtractIds = [Depth] extends [never] ? never : (T extends { id?: infer Id extends string } - ? { [k in Id]: { -readonly [P in keyof T]: T[P] extends string ? string : T[P] } } + ? { + [k in Id]: { + -readonly [P in keyof T]: + T[P] extends string + ? string + : T[P] extends number + ? number | undefined + : T[P] + } + } : never) | (