mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
feat(api): add strict Setting types to channels
This commit is contained in:
parent
bb5d029e68
commit
4b42c03fb9
@ -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>;
|
||||
}
|
||||
>;
|
||||
|
Loading…
Reference in New Issue
Block a user