import { type Frame, type Rect, type ThirdPartyWidgetSettings, type Widget as IWidget, type WidgetId, type WidgetTriggerPayload } from "../../../gen/types/mod.js"; import { type WebviewWindow } from "@tauri-apps/api/webviewWindow"; import type { InitWidgetOptions, ReadyWidgetOptions, WidgetInformation } from "./interfaces.js"; /** * Represents the widget instance running in the current webview */ export declare class Widget { /** * Alternative accesor for the current running widget.\ * Will throw if the library is being used on a non Seelen UI environment */ static getCurrent(): Widget; /** The current running widget */ static get self(): Widget; /** widget id */ readonly id: WidgetId; /** widget definition */ readonly def: IWidget; /** decoded widget instance information */ readonly decoded: WidgetInformation; /** current webview window */ readonly webview: WebviewWindow; private autoSizer?; private runtimeState; private constructor(); /** Returns the current window id of the widget */ get windowId(): number; /** Returns the current position and size of the widget */ get frame(): Frame; /** Returns the default config of the widget, declared on the widget definition */ getDefaultConfig(): ThirdPartyWidgetSettings; private applyInvisiblePreset; /** Will apply the recommended settings for a desktop widget */ private applyDesktopPreset; /** Will apply the recommended settings for an overlay widget */ private applyOverlayPreset; /** Will apply the recommended settings for a popup widget */ private applyPopupPreset; /** * Will restore the saved position and size of the widget on start, * after that will store the position and size of the widget on change. */ persistPositionAndSize(): Promise; /** * Will initialize the widget based on the preset and mark it as `pending`, this function won't show the widget. * This should be called before any other action on the widget. After this you should call * `ready` to mark the widget as ready and show it. */ init(options?: InitWidgetOptions): Promise; /** * Will mark the widget as `ready` and pool pending triggers. * * If the widget is not lazy this will inmediately show the widget. * Lazy widget should be shown on trigger action. */ ready(options?: ReadyWidgetOptions): Promise; onTrigger(cb: (args: WidgetTriggerPayload) => void): void; /** If animations are enabled this will animate the movement of the widget */ setPosition(rect: Rect): Promise; show(): Promise; /** Will force foreground the widget */ focus(): Promise; hide(closeAfterInactivity?: boolean): void; } export declare const SeelenSettingsWidgetId: WidgetId; export declare const SeelenPopupWidgetId: WidgetId; export declare const SeelenWegWidgetId: WidgetId; export declare const SeelenToolbarWidgetId: WidgetId; export declare const SeelenWindowManagerWidgetId: WidgetId; export declare const SeelenWallWidgetId: WidgetId; //# sourceMappingURL=mod.d.ts.map