feat(api): add strict Setting types to helpers

This commit is contained in:
yassinedorbozgithub 2025-06-02 07:17:35 +01:00
parent 4b42c03fb9
commit 801a60b331

View File

@ -6,7 +6,7 @@
* 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). * 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 { SettingCreateDto } from '@/setting/dto/setting.dto'; import { AnySetting, StrictSetting } from '@/setting/schemas/types';
import { HyphenToUnderscore } from '@/utils/types/extension'; import { HyphenToUnderscore } from '@/utils/types/extension';
import BaseHelper from './lib/base-helper'; import BaseHelper from './lib/base-helper';
@ -116,9 +116,9 @@ export type HelperRegistry<H extends BaseHelper = BaseHelper> = Map<
Map<string, H> Map<string, H>
>; >;
export type HelperSetting<N extends HelperName = HelperName> = Omit< export type HelperSetting<N extends HelperName = HelperName> = StrictSetting<
SettingCreateDto, AnySetting,
'group' | 'weight' {
> & { group: HyphenToUnderscore<N>;
group: HyphenToUnderscore<N>; }
}; >;