import type { Screen } from "./screens.js"; /** * Called from Go when a file drag enters the window on Linux/macOS. */ declare function handleDragEnter(): void; /** * Called from Go when a file drag leaves the window on Linux/macOS. */ declare function handleDragLeave(): void; /** * Called from Go during file drag to update hover state on Linux/macOS. * @param x - X coordinate in CSS pixels * @param y - Y coordinate in CSS pixels */ declare function handleDragOver(x: number, y: number): void; export { handleDragEnter, handleDragLeave, handleDragOver }; /** * A record describing the position of a window. */ interface Position { /** The horizontal position of the window. */ x: number; /** The vertical position of the window. */ y: number; } /** * A record describing the size of a window. */ interface Size { /** The width of the window. */ width: number; /** The height of the window. */ height: number; } declare const callerSym: unique symbol; declare class Window { private [callerSym]; /** * Initialises a window object with the specified name. * * @private * @param name - The name of the target window. */ constructor(name?: string); /** * Gets the specified window. * * @param name - The name of the window to get. * @returns The corresponding window object. */ Get(name: string): Window; /** * Returns the absolute position of the window. * * @returns The current absolute position of the window. */ Position(): Promise; /** * Centers the window on the screen. */ Center(): Promise; /** * Closes the window. */ Close(): Promise; /** * Disables min/max size constraints. */ DisableSizeConstraints(): Promise; /** * Enables min/max size constraints. */ EnableSizeConstraints(): Promise; /** * Focuses the window. */ Focus(): Promise; /** * Forces the window to reload the page assets. */ ForceReload(): Promise; /** * Switches the window to fullscreen mode. */ Fullscreen(): Promise; /** * Returns the screen that the window is on. * * @returns The screen the window is currently on. */ GetScreen(): Promise; /** * Returns the current zoom level of the window. * * @returns The current zoom level. */ GetZoom(): Promise; /** * Returns the height of the window. * * @returns The current height of the window. */ Height(): Promise; /** * Hides the window. */ Hide(): Promise; /** * Returns true if the window is focused. * * @returns Whether the window is currently focused. */ IsFocused(): Promise; /** * Returns true if the window is fullscreen. * * @returns Whether the window is currently fullscreen. */ IsFullscreen(): Promise; /** * Returns true if the window is maximised. * * @returns Whether the window is currently maximised. */ IsMaximised(): Promise; /** * Returns true if the window is minimised. * * @returns Whether the window is currently minimised. */ IsMinimised(): Promise; /** * Maximises the window. */ Maximise(): Promise; /** * Minimises the window. */ Minimise(): Promise; /** * Returns the name of the window. * * @returns The name of the window. */ Name(): Promise; /** * Opens the development tools pane. */ OpenDevTools(): Promise; /** * Returns the relative position of the window to the screen. * * @returns The current relative position of the window. */ RelativePosition(): Promise; /** * Reloads the page assets. */ Reload(): Promise; /** * Returns true if the window is resizable. * * @returns Whether the window is currently resizable. */ Resizable(): Promise; /** * Restores the window to its previous state if it was previously minimised, maximised or fullscreen. */ Restore(): Promise; /** * Sets the absolute position of the window. * * @param x - The desired horizontal absolute position of the window. * @param y - The desired vertical absolute position of the window. */ SetPosition(x: number, y: number): Promise; /** * Sets the window to be always on top. * * @param alwaysOnTop - Whether the window should stay on top. */ SetAlwaysOnTop(alwaysOnTop: boolean): Promise; /** * Sets the background colour of the window. * * @param r - The desired red component of the window background. * @param g - The desired green component of the window background. * @param b - The desired blue component of the window background. * @param a - The desired alpha component of the window background. */ SetBackgroundColour(r: number, g: number, b: number, a: number): Promise; /** * Removes the window frame and title bar. * * @param frameless - Whether the window should be frameless. */ SetFrameless(frameless: boolean): Promise; /** * Disables the system fullscreen button. * * @param enabled - Whether the fullscreen button should be enabled. */ SetFullscreenButtonEnabled(enabled: boolean): Promise; /** * Sets the maximum size of the window. * * @param width - The desired maximum width of the window. * @param height - The desired maximum height of the window. */ SetMaxSize(width: number, height: number): Promise; /** * Sets the minimum size of the window. * * @param width - The desired minimum width of the window. * @param height - The desired minimum height of the window. */ SetMinSize(width: number, height: number): Promise; /** * Sets the relative position of the window to the screen. * * @param x - The desired horizontal relative position of the window. * @param y - The desired vertical relative position of the window. */ SetRelativePosition(x: number, y: number): Promise; /** * Sets whether the window is resizable. * * @param resizable - Whether the window should be resizable. */ SetResizable(resizable: boolean): Promise; /** * Sets the size of the window. * * @param width - The desired width of the window. * @param height - The desired height of the window. */ SetSize(width: number, height: number): Promise; /** * Sets the title of the window. * * @param title - The desired title of the window. */ SetTitle(title: string): Promise; /** * Sets the zoom level of the window. * * @param zoom - The desired zoom level. */ SetZoom(zoom: number): Promise; /** * Shows the window. */ Show(): Promise; /** * Returns the size of the window. * * @returns The current size of the window. */ Size(): Promise; /** * Toggles the window between fullscreen and normal. */ ToggleFullscreen(): Promise; /** * Toggles the window between maximised and normal. */ ToggleMaximise(): Promise; /** * Toggles the window between frameless and normal. */ ToggleFrameless(): Promise; /** * Un-fullscreens the window. */ UnFullscreen(): Promise; /** * Un-maximises the window. */ UnMaximise(): Promise; /** * Un-minimises the window. */ UnMinimise(): Promise; /** * Returns the width of the window. * * @returns The current width of the window. */ Width(): Promise; /** * Zooms the window. */ Zoom(): Promise; /** * Increases the zoom level of the webview content. */ ZoomIn(): Promise; /** * Decreases the zoom level of the webview content. */ ZoomOut(): Promise; /** * Resets the zoom level of the webview content. */ ZoomReset(): Promise; /** * Handles file drops originating from platform-specific code (e.g., macOS/Linux native drag-and-drop). * Gathers information about the drop target element and sends it back to the Go backend. * * @param filenames - An array of file paths (strings) that were dropped. * @param x - The x-coordinate of the drop event (CSS pixels). * @param y - The y-coordinate of the drop event (CSS pixels). */ HandlePlatformFileDrop(filenames: string[], x: number, y: number): void; SnapAssist(): Promise; /** * Opens the print dialog for the window. */ Print(): Promise; } /** * The window within which the script is running. */ declare const thisWindow: Window; export default thisWindow;