feat(api): add strict Setting types to channels

This commit is contained in:
yassinedorbozgithub 2025-06-02 07:17:25 +01:00
parent bb5d029e68
commit 4b42c03fb9

View File

@ -6,14 +6,14 @@
* 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';
export type ChannelName = `${string}-channel`;
export type ChannelSetting<N extends string = string> = Omit<
SettingCreateDto,
'group' | 'weight'
> & {
group: HyphenToUnderscore<N>;
};
export type ChannelSetting<N extends string = string> = StrictSetting<
AnySetting,
{
group: HyphenToUnderscore<N>;
}
>;