diff --git a/api/src/setting/index.d.ts b/api/src/setting/index.d.ts index fab71fb7..1a602c03 100644 --- a/api/src/setting/index.d.ts +++ b/api/src/setting/index.d.ts @@ -1,11 +1,13 @@ /* - * Copyright © 2024 Hexastack. All rights reserved. + * Copyright © 2025 Hexastack. All rights reserved. * * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms: * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission. * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file). */ +import { SettingType } from '@/setting/schemas/types'; + import { SettingByType } from './schemas/types'; import { DEFAULT_SETTINGS } from './seeds/setting.seed-model'; @@ -22,10 +24,14 @@ declare global { ? { [K in keyof T]: TNativeType } : T; + type SettingValue = K['type'] extends SettingType.select + ? K['options'][number] + : TNativeType; + type SettingObject< T extends Omit[], > = { - [K in T[number] as K['label']]: TNativeType; + [K in T[number] as K['label']]: SettingValue; }; type SettingMapByType< @@ -38,7 +44,7 @@ declare global { T extends Omit[], > = { [G in T[number] as G['group']]: { - [K in T[number] as K['label']]: TNativeType; + [K in T[number] as K['label']]: SettingValue; }; };