import { SwitchBase } from "./abstractSwitch"; import { InfoBase } from "./abstractInfo"; import { ActionBase } from "./abstractAction"; import { LinkBase } from "./abstractLink"; import { CustomBase } from "./abstractCustom"; import { AdminpanelIcon } from "../../interfaces/adminpanelConfig"; import { Adminizer } from "../Adminizer"; import { UserAP } from "../../models/UserAP"; import { I18n } from "../I18n"; export type WidgetType = (SwitchBase | InfoBase | ActionBase | LinkBase | CustomBase); export interface WidgetConfig { id: string; type: string; api?: string; link?: string; description: string; icon: AdminpanelIcon; name: string; backgroundCSS: string; scriptUrl?: string; linkType?: 'self' | 'blank'; constructorName?: string; constructorOption?: any; size?: { h: number; w: number; }; added?: boolean; hideAdminPanelUI?: boolean; } export interface WidgetLayoutItem { x: number; y: number; w: number; h: number; i: string; id: string; } export interface WidgetsLayouts { lg: WidgetLayoutItem[]; md: WidgetLayoutItem[]; sm: WidgetLayoutItem[]; xs: WidgetLayoutItem[]; xxs: WidgetLayoutItem[]; } export declare class WidgetHandler { private widgets; adminizer: Adminizer; constructor(adminizer: Adminizer); add(widget: WidgetType): void; getById(id: string): WidgetType | undefined; removeById(id: string): void; getAll(user: UserAP, i18n: I18n): Promise; private translateWidgetConfig; getWidgetsDB(id: number, auth: boolean, i18n: I18n): Promise<{ widgets: WidgetConfig[]; layout: WidgetsLayouts; defaultWidgets?: string[]; }>; setWidgetsDB(id: number, body: { widgets: WidgetConfig[]; layout: WidgetLayoutItem[]; }, auth: boolean): Promise; }