mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-14 17:26:26 +01:00
Add new types of options
This commit is contained in:
15
src/widgets/widgets.d.ts
vendored
15
src/widgets/widgets.d.ts
vendored
@@ -1,6 +1,5 @@
|
||||
import { IconSun, TablerIcon } from '@tabler/icons';
|
||||
import { TablerIcon } from '@tabler/icons';
|
||||
import React from 'react';
|
||||
import { BaseTileProps } from '../components/Dashboard/Tiles/type';
|
||||
|
||||
// Type of widgets which are safed to config
|
||||
export type IWidget<TKey extends string, TDefinition extends IWidgetDefinition> = {
|
||||
@@ -32,6 +31,7 @@ export type IWidgetOptionValue =
|
||||
| IMultiSelectOptionValue
|
||||
| ISwitchOptionValue
|
||||
| ITextInputOptionValue
|
||||
| ISliderInputOptionValue
|
||||
| INumberInputOptionValue;
|
||||
|
||||
// will show a multi-select with specified data
|
||||
@@ -56,7 +56,16 @@ export type ITextInputOptionValue = {
|
||||
// will show a number-input
|
||||
export type INumberInputOptionValue = {
|
||||
type: 'number';
|
||||
defaultValue: string;
|
||||
defaultValue: number;
|
||||
};
|
||||
|
||||
// will show a slider-input
|
||||
export type ISliderInputOptionValue = {
|
||||
type: 'slider';
|
||||
defaultValue: number;
|
||||
min: number;
|
||||
max: number;
|
||||
step: number;
|
||||
};
|
||||
|
||||
// is used to type the widget definitions which will be used to display all widgets
|
||||
|
||||
Reference in New Issue
Block a user