Files
Homarr/src/widgets/helper.ts
2023-07-21 18:08:40 +09:00

8 lines
342 B
TypeScript

// 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
) => options;