37 lines
789 B
TypeScript
37 lines
789 B
TypeScript
export interface WidgetData {
|
|
id: string;
|
|
type: WidgetTypes;
|
|
gridX: number;
|
|
gridY: number;
|
|
gridWidth: number;
|
|
gridHeight: number;
|
|
background: boolean;
|
|
[key: string]: any;
|
|
}
|
|
|
|
export interface SearchWidgetData extends WidgetData {
|
|
type: 'search';
|
|
engines: Array<string>;
|
|
}
|
|
|
|
export interface ClockWidgetData extends WidgetData {
|
|
type: 'clock';
|
|
showSeconds: boolean;
|
|
use24Hour: boolean;
|
|
timezone: string;
|
|
}
|
|
|
|
export type WidgetTypes = (SearchWidgetData | ClockWidgetData)['type']
|
|
|
|
export interface GlobalSettings {
|
|
backgroundUrl: string;
|
|
widgets: WidgetData[];
|
|
editEnabled: boolean;
|
|
showGrid: boolean;
|
|
searchEngines: { [key in string]: string}
|
|
}
|
|
|
|
export type WidgetExport<W = React.FC<any>, S = (...a:any[]) =>JSX.Element > = {
|
|
widget: W,
|
|
settings: S
|
|
} |