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