Files
Homarr/src/widgets/helper.ts

9 lines
343 B
TypeScript
Raw Normal View History

2022-12-18 21:21:23 +01:00
// Method which allows to define the type verry specific and type checks all
import { IWidgetDefinition } from './widgets';
// The options of IWidgetDefinition are so heavily typed that it even used 'true' as type
export const defineWidget = <TKey extends string, TOptions extends IWidgetDefinition<TKey>>(
options: TOptions
2023-01-06 01:11:02 +09:00
) => options;