From ba517feab5dd80682fc59ed3326ac2d29a773382 Mon Sep 17 00:00:00 2001 From: dswbx Date: Thu, 5 Dec 2024 20:48:49 +0100 Subject: [PATCH] fix typings for initial partial config Signed-off-by: dswbx --- app/src/data/fields/Field.ts | 4 ++-- app/src/modules/ModuleManager.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/data/fields/Field.ts b/app/src/data/fields/Field.ts index b5e332d..5260d61 100644 --- a/app/src/data/fields/Field.ts +++ b/app/src/data/fields/Field.ts @@ -236,8 +236,8 @@ export abstract class Field< toJSON() { return { - //name: this.name, - type: this.type, + // @todo: current workaround because of fixed string type + type: this.type as any, config: this.config }; } diff --git a/app/src/modules/ModuleManager.ts b/app/src/modules/ModuleManager.ts index f0c4013..e43dfa7 100644 --- a/app/src/modules/ModuleManager.ts +++ b/app/src/modules/ModuleManager.ts @@ -56,12 +56,13 @@ export type ModuleSchemas = { export type ModuleConfigs = { [K in keyof ModuleSchemas]: Static; }; +type PartialRec = { [P in keyof T]?: PartialRec }; export type InitialModuleConfigs = | ({ version: number; } & ModuleConfigs) - | Partial; + | PartialRec; export type ModuleManagerOptions = { initial?: InitialModuleConfigs;