/**
 * Methods for querying and manipulating elements pertaining to a native
 * ToDesktop window shell.
 *
 * @remarks
 * This package exposes a number of methods for querying and manipulating
 * elements pertaining to a native ToDesktop window shell.
 *
 * @experimental
 * @public
 * @packageDocumentation
 */
import type { BrowserWindow, BrowserWindowConstructorOptions, Rectangle, TitleBarOverlayOptions, WillResizeDetails } from "@todesktop/client-electron-types";
import { type InstanceRefObject } from "@todesktop/client-util";
import { type Ref, type RefOptions } from "./invoke.js";
import { type NamespaceEvents } from "./utils.js";
/**
 * @public
 */
/**
 * Creates a new BrowserWindow.
 *
 * @param options - BrowserWindow constructor options.
 * @returns Identifier for the newly created BrowserWindow.
 * @public
 */
export declare function create(options: BrowserWindowConstructorOptions): Promise<Ref>;
/**
 * Destroys the BrowserWindow corresponding to the `ref`.
 *
 * @param options - ref: Reference for the BrowserWindow to destroy
 * @public
 */
export declare function destroy({ ref }?: RefOptions): Promise<void>;
/**
 * Sets a BrowserView on the reference BrowserWindow. If there are
 * other BrowserViews attached, they will be removed from the window.
 *
 * @param options - ref: Reference for the BrowserWindow; viewRef: Reference for the BrowserView to set.
 * @public
 */
export declare function setBrowserView({ ref, viewRef, }: {
    ref?: Ref;
    viewRef: Ref;
}): Promise<void>;
/**
 * Adds a BrowserView to the reference BrowserWindow.
 *
 * @param options - ref: Reference for the BrowserWindow; viewRef: Reference for the BrowserView to add.
 * @public
 */
export declare function addBrowserView({ ref, viewRef, }: {
    ref?: Ref;
    viewRef: Ref;
}): Promise<void>;
/**
 * Removes a BrowserView from the reference BrowserWindow.
 *
 * @param options - ref: Reference for the BrowserWindow; viewRef: Reference for the BrowserView to remove.
 * @public
 */
export declare function removeBrowserView({ ref, viewRef, }: {
    ref?: Ref;
    viewRef: Ref;
}): Promise<void>;
/**
 * Gets the width and height of the reference browser window
 *
 * @param options - ref: Reference for the BrowserWindow.
 * @public
 */
export declare function getSize({ ref }?: RefOptions): Promise<number[]>;
/**
 * Resizes the window to `width` and `height`. If `width` or `height` are below any
 * set minimum size constraints the window will snap to its minimum size.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @public
 */
export declare function setSize({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setSize"]>): Promise<void>;
/**
 * Resizes and moves the window to the supplied bounds. Any properties that are not
 * supplied will default to their current values.
 *
 * **Note:** On macOS, the y-coordinate value cannot be smaller than the Tray
 * height. The tray height has changed over time and depends on the operating
 * system, but is between 20-40px. Passing a value lower than the tray height will
 * result in a window that is flush to the tray.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @public
 */
export declare function setBounds({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setBounds"]>): Promise<void>;
/**
 * Changes the title of the reference BrowserWindow.
 *
 * @param options - ref: Reference for the BrowserWindow; title: Desired title for the BrowserWindow.
 * @public
 */
export declare function setTitle({ ref, title }: {
    ref?: Ref;
    title: string;
}): Promise<void>;
/**
 * On a Window with Window Controls Overlay already enabled, this method updates
 * the style of the title bar overlay.
 *
 * **Note:** This API does nothing on Mac or Linux.
 *
 * @platform win32
 * @param options - ref: Reference for the BrowserWindow; options: The configuration for the title bar.
 * @public
 */
export declare function setTitleBarOverlay({ ref, options, }: {
    ref?: Ref;
    options: TitleBarOverlayOptions;
}): Promise<void>;
/**
 * Adds a vibrancy effect to the browser window. Passing null or an empty string will remove the vibrancy effect on the window.
 *
 * **Note:** This API does nothing on Windows or Linux.
 *
 * @platform darwin
 */
export declare function setVibrancy({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setVibrancy"]>): Promise<void>;
/**
 * Sets the opacity of the window. Out of bound number values are clamped to the [0, 1] range.
 *
 * **Note:** This API does nothing on Linux.
 *
 * @platform darwin,windows
 */
export declare function setOpacity({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setOpacity"]>): Promise<void>;
/**
 * Sets the background color of the window.
 *
 * @param options - ref: Reference for the BrowserWindow;
 * @param backgroundColor - The following string value patterns are accepted:
 * - Hex, for example: #ffffff (RGB) or #ffffffff (ARGB).
 * - RGB, for example: rgb(255, 255, 255) or rgba(255, 255, 255, 1.0).
 * - HSL, for example: hsl(200, 20%, 50%) or hsla(200, 20%, 50%, 0.5).
 * - Name, for example: red.
 *
 * @public
 */
export declare function setBackgroundColor({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setBackgroundColor"]>): Promise<void>;
/**
 * Minimize the window.
 *
 * @param options - ref: Reference for the BrowserWindow to minimize
 * @public
 */
export declare function minimize({ ref }?: RefOptions): Promise<void>;
/**
 * Restore the window from minimized state.
 *
 * @param options - ref: Reference for the BrowserWindow to restore
 * @public
 */
export declare function restore({ ref }?: RefOptions): Promise<void>;
/**
 * Check if the window is minimized.
 *
 * @param options - ref: Reference for the BrowserWindow to check
 * @public
 */
export declare function isMinimized({ ref }?: RefOptions): Promise<boolean>;
/**
 * Maximize the window.
 *
 * @param options - ref: Reference for the BrowserWindow to maximize
 * @public
 */
export declare function maximize({ ref }?: RefOptions): Promise<void>;
/**
 * Unmaximize the window.
 *
 * @param options - ref: Reference for the BrowserWindow to unmaximize
 * @public
 */
export declare function unmaximize({ ref }?: RefOptions): Promise<void>;
/**
 * Check if the window is maximized.
 *
 * @param options - ref: Reference for the BrowserWindow to check
 * @public
 */
export declare function isMaximized({ ref }?: RefOptions): Promise<boolean>;
/**
 * Enter fullscreen mode.
 *
 * @param options - ref: Reference for the BrowserWindow to enter fullscreen
 * @public
 */
export declare function enterFullscreen({ ref }?: RefOptions): Promise<void>;
/**
 * Exit fullscreen mode.
 *
 * @param options - ref: Reference for the BrowserWindow to exit fullscreen
 * @public
 */
export declare function exitFullscreen({ ref }?: RefOptions): Promise<void>;
/**
 * Check if the window is in fullscreen mode.
 *
 * @param options - ref: Reference for the BrowserWindow to check
 * @public
 */
export declare function isFullscreen({ ref }?: RefOptions): Promise<boolean>;
/**
 * Returns `true` if the current window is set to always be on top of other windows.
 *
 * @param options - ref: Reference for the BrowserWindow to show
 * @public
 */
export declare function isAlwaysOnTop({ ref }?: RefOptions): Promise<boolean>;
/**
 * Causes the referenced window to be focussed on the user's desktop.
 *
 * @param options - ref: Reference for the BrowserWindow to focus
 * @public
 */
export declare function focus({ ref }?: RefOptions): Promise<void>;
/**
 * Removes the referenced window from focus on the user's desktop.
 *
 * @param options - ref: Reference for the BrowserWindow to blur
 * @public
 */
export declare function blur({ ref }?: RefOptions): Promise<void>;
/**
 * @public
 */
export declare function areTabsSupported(): Promise<boolean>;
/**
 * Creates a new tab and loads the pre-defined app URL.
 *
 * @public
 */
export declare function createNewTab(): Promise<void>;
/**
 * @param percent - An float between 0-1 will set the progress bar to a
 * certain percentage. e.g. `0.75` will show a progress bar 75% filled.
 *
 * Values above 1 will enable intermediate mode.
 *
 * Values below 0 will disable the progress bar.
 * @public
 */
export declare function setProgressBar(percent: number): Promise<void>;
/**
 * Returns a boolean indicating whether the window has been destroyed.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @public
 */
export declare function isDestroyed({ ref }?: RefOptions): Promise<boolean>;
/**
 * Returns a boolean indicating whether the window is visible to the user.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @public
 */
export declare function isVisible({ ref }?: RefOptions): Promise<boolean>;
/**
 * Hides the BrowserWindow corresponding to the `ref`.
 *
 * @param options - ref: Reference for the BrowserWindow to hide
 * @public
 */
export declare function hide({ ref }?: RefOptions): Promise<void>;
/**
 * Shows the BrowserWindow corresponding to the `ref`.
 *
 * @param options - ref: Reference for the BrowserWindow to show
 * @public
 */
export declare function show({ ref }?: RefOptions): Promise<void>;
/**
 * Shows the window corresponding to the `ref` but doesn't focus it.
 *
 * @param options - ref: Reference for the BrowserWindow to show
 * @public
 */
export declare function showInactive({ ref }?: RefOptions): Promise<void>;
/**
 * Close the BrowserWindow corresponding to the `ref`.
 *
 * @param options - ref: Reference for the BrowserWindow to close
 * @public
 */
export declare function close({ ref }?: RefOptions): Promise<void>;
/**
 * @param options - ref: Reference for the BrowserWindow to show
 * @returns An array of all opened browser windows.
 * @public
 */
export declare function getAllWindows(): Promise<InstanceRefObject[]>;
/**
 * @param options - ref: Reference for the BrowserWindow
 * @returns `id` of the BrowserWindow.
 * @public
 */
export declare function getId({ ref }?: RefOptions): Promise<number>;
/**
 *
 * Gets the background color of the window in Hex (#RRGGBB) format.
 * Note: The alpha value is not returned alongside the red, green, and blue values.
 *
 * @param options - ref: Reference for the BrowserWindow;
 *
 * @public
 */
export declare function getBackgroundColor({ ref }: RefOptions, ...args: Parameters<BrowserWindow["getBackgroundColor"]>): Promise<string>;
/**
 * The title of the native window.
 *
 * @param options - ref: Reference for the BrowserWindow to show
 * @public
 */
export declare function getTitle({ ref }?: RefOptions): Promise<string>;
/**
 * Reloads the web page.
 *
 * @param options - ref: Reference for the BrowserWindow to show
 * @public
 */
export declare function reload({ ref }?: RefOptions): Promise<void>;
/**
 * Get a WebContents reference for a BrowserWindow. WebContents is responsible
 * for rendering and controlling a web page
 *
 * @param options - ref: Reference for the BrowserWindow to show
 * @public
 */
export declare function getWebContents({ ref }?: RefOptions): Promise<InstanceRefObject>;
/**
 * Sets whether the window should show always on top of other windows. After
 * setting this, the window is still a normal window, not a toolbox window which
 * can not be focused on.
 *
 * @param options - ref: Reference for the BrowserWindow to show
 * @public
 */
export declare function setAlwaysOnTop({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setAlwaysOnTop"]>): Promise<void>;
/**
 * Sets whether the window should be visible on all workspaces.
 *
 * **Note:** This API does nothing on Windows.
 *
 * @platform darwin,linux
 */
export declare function setVisibleOnAllWorkspaces({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setVisibleOnAllWorkspaces"]>): Promise<void>;
/**
 * Changes window icon.
 *
 * @see https://www.electronjs.org/docs/latest/api/browser-window#winseticonicon-windows-linux
 * @public
 */
export declare function setIcon({ ref }: RefOptions, image: InstanceRefObject): Promise<void>;
/**
 * Prevents the window contents from being captured by other apps.
 *
 * @param options - ref: Reference for the BrowserWindow to show
 * @public
 */
export declare function setContentProtection({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setContentProtection"]>): Promise<void>;
/**
 * Moves window to `x` and `y`.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @public
 */
export declare function setPosition({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setPosition"]>): Promise<void>;
/**
 * Returns the window's current position.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @public
 */
export declare function getPosition({ ref }?: RefOptions, ...args: Parameters<BrowserWindow["getPosition"]>): Promise<number[]>;
/**
 * Makes the window ignore all mouse events.
 *
 * All mouse events happened in this window will be passed to the window
 * below this window, but if this window has focus, it will still receive
 * keyboard events.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @public
 */
export declare function setIgnoreMouseEvents({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setIgnoreMouseEvents"]>): Promise<void>;
/**
 * Sets the position of the window buttons.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @public
 */
export declare function setWindowButtonPosition({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setWindowButtonPosition"]>): Promise<void>;
/**
 * Returns the position of the window buttons.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @public
 */
export declare function getWindowButtonPosition({ ref }?: RefOptions): Promise<Electron.Point>;
/**
 * Sets whether the window can be focused.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @public
 */
export declare function setFocusable({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setFocusable"]>): Promise<void>;
/**
 * Sets whether the window can be manually closed by user.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @param closable - Whether the window can be manually closed by the user
 * @platform darwin,win32
 * @public
 */
export declare function setClosable({ ref }: RefOptions, ...args: Parameters<BrowserWindow["setClosable"]>): Promise<void>;
/**
 * Starts or stops flashing the window to attract user's attention.
 *
 * @remarks
 * On macOS, this will flash the dock icon continuously when flag is true.
 * On Windows, this will flash the taskbar button.
 * On Linux, this has no effect.
 *
 * @param options - ref: Reference for the BrowserWindow
 * @param flag - Whether to start or stop flashing the window
 * @platform darwin,win32
 * @public
 */
export declare function flashFrame({ ref }: RefOptions, flag: boolean): Promise<void>;
/**
 * EVENTS
 */
export declare type LegacyNativeWindowEvent = "enterFullscreen" | "exitFullscreen";
/**
 * @public
 */
export declare type NativeWindowEvents = NamespaceEvents<{
    "always-on-top-changed": (isAlwaysOnTop: boolean) => void;
    "app-command": (command: string) => void;
    blur: () => void;
    close: () => void;
    closed: () => void;
    "enter-full-screen": () => void;
    "enter-html-full-screen": () => void;
    focus: () => void;
    hide: () => void;
    "leave-full-screen": () => void;
    "leave-html-full-screen": () => void;
    maximize: () => void;
    minimize: () => void;
    move: () => void;
    moved: () => void;
    "new-window-for-tab": () => void;
    "page-title-updated": (title: string, explicitSet: boolean) => void;
    "ready-to-show": () => void;
    resize: () => void;
    resized: () => void;
    responsive: () => void;
    restore: () => void;
    "rotate-gesture": (rotation: number) => void;
    "scroll-touch-begin": () => void;
    "scroll-touch-edge": () => void;
    "scroll-touch-end": () => void;
    "session-end": () => void;
    "sheet-begin": () => void;
    "sheet-end": () => void;
    show: () => void;
    swipe: (direction: string) => void;
    unmaximize: () => void;
    unresponsive: () => void;
    "will-move": (newBounds: Rectangle) => void;
    "will-resize": (newBounds: Rectangle, details: WillResizeDetails) => void;
}>;
/**
 * @public
 */
export declare const on: <E extends "minimize" | "close" | "hide" | "focus" | "blur" | "maximize" | "restore" | "show" | "unmaximize" | "resize" | "new-window-for-tab" | "always-on-top-changed" | "app-command" | "closed" | "enter-full-screen" | "enter-html-full-screen" | "leave-full-screen" | "leave-html-full-screen" | "move" | "moved" | "page-title-updated" | "ready-to-show" | "resized" | "responsive" | "rotate-gesture" | "scroll-touch-begin" | "scroll-touch-edge" | "scroll-touch-end" | "session-end" | "sheet-begin" | "sheet-end" | "swipe" | "unresponsive" | "will-move" | "will-resize">(eventName: E, callback: NamespaceEvents<{
    "always-on-top-changed": (isAlwaysOnTop: boolean) => void;
    "app-command": (command: string) => void;
    blur: () => void;
    close: () => void;
    closed: () => void;
    "enter-full-screen": () => void;
    "enter-html-full-screen": () => void;
    focus: () => void;
    hide: () => void;
    "leave-full-screen": () => void;
    "leave-html-full-screen": () => void;
    maximize: () => void;
    minimize: () => void;
    move: () => void;
    moved: () => void;
    "new-window-for-tab": () => void;
    "page-title-updated": (title: string, explicitSet: boolean) => void;
    "ready-to-show": () => void;
    resize: () => void;
    resized: () => void;
    responsive: () => void;
    restore: () => void;
    "rotate-gesture": (rotation: number) => void;
    "scroll-touch-begin": () => void;
    "scroll-touch-edge": () => void;
    "scroll-touch-end": () => void;
    "session-end": () => void;
    "sheet-begin": () => void;
    "sheet-end": () => void;
    show: () => void;
    swipe: (direction: string) => void;
    unmaximize: () => void;
    unresponsive: () => void;
    "will-move": (newBounds: Rectangle) => void;
    "will-resize": (newBounds: Rectangle, details: WillResizeDetails) => void;
}>[E], args_0?: {
    ref?: InstanceRefObject;
    preventDefault?: boolean;
}) => Promise<() => Promise<void>>;
/**
 * @public
 */
export declare const removeAllListeners: <E extends "minimize" | "close" | "hide" | "focus" | "blur" | "maximize" | "restore" | "show" | "unmaximize" | "resize" | "new-window-for-tab" | "always-on-top-changed" | "app-command" | "closed" | "enter-full-screen" | "enter-html-full-screen" | "leave-full-screen" | "leave-html-full-screen" | "move" | "moved" | "page-title-updated" | "ready-to-show" | "resized" | "responsive" | "rotate-gesture" | "scroll-touch-begin" | "scroll-touch-edge" | "scroll-touch-end" | "session-end" | "sheet-begin" | "sheet-end" | "swipe" | "unresponsive" | "will-move" | "will-resize">(eventName: E, args_0?: {
    ref?: InstanceRefObject;
}) => Promise<void>;
