mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-15 01:36:22 +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 React from 'react';
|
||||||
import { BaseTileProps } from '../components/Dashboard/Tiles/type';
|
|
||||||
|
|
||||||
// Type of widgets which are safed to config
|
// Type of widgets which are safed to config
|
||||||
export type IWidget<TKey extends string, TDefinition extends IWidgetDefinition> = {
|
export type IWidget<TKey extends string, TDefinition extends IWidgetDefinition> = {
|
||||||
@@ -32,6 +31,7 @@ export type IWidgetOptionValue =
|
|||||||
| IMultiSelectOptionValue
|
| IMultiSelectOptionValue
|
||||||
| ISwitchOptionValue
|
| ISwitchOptionValue
|
||||||
| ITextInputOptionValue
|
| ITextInputOptionValue
|
||||||
|
| ISliderInputOptionValue
|
||||||
| INumberInputOptionValue;
|
| INumberInputOptionValue;
|
||||||
|
|
||||||
// will show a multi-select with specified data
|
// will show a multi-select with specified data
|
||||||
@@ -56,7 +56,16 @@ export type ITextInputOptionValue = {
|
|||||||
// will show a number-input
|
// will show a number-input
|
||||||
export type INumberInputOptionValue = {
|
export type INumberInputOptionValue = {
|
||||||
type: 'number';
|
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
|
// is used to type the widget definitions which will be used to display all widgets
|
||||||
|
|||||||
Reference in New Issue
Block a user