/**
 * Methods for interacting with a ToDesktop application's tray icon.
 *
 * @remarks
 * This package exposes a number of methods for interacting with a ToDesktop
 * application's tray icon.
 *
 * The tray icon is a part of the operating systems UI, located:
 *
 * - at the right of the Menu Bar on macOS;
 * - in the System Tray on Windows.
 *
 * @experimental
 * @public
 * @packageDocumentation
 */
import { DisplayBalloonOptions, Point } from "@todesktop/client-electron-types";
import { type InstanceRefObject } from "@todesktop/client-util";
import { type Ref } from "./invoke.js";
import { type NamespaceEvents } from "./utils.js";
/**
 * Creates a new Tray.
 *
 * @param options - Tray constructor options.
 * @returns Identifier for the newly created Tray.
 * @public
 */
export declare function create(...args: [image: string | InstanceRefObject, guid?: string | undefined]): Promise<Ref>;
/**
 * Set the title of the app's tray item.
 *
 * @param options - ref: Reference for the Tray; title: title for the tray.
 * @public
 */
export declare function setTitle(title: string): Promise<void>;
export declare function setTitle(options: SetTitleOptions): Promise<void>;
interface SetTitleOptions {
    ref: Ref;
    title: string;
}
/**
 * Remove the app's tray item.
 *
 * @param options - ref: Reference for the Tray;
 * @public
 */
export declare function destroy(): Promise<void>;
export declare function destroy(options: {
    ref: Ref;
}): Promise<void>;
interface SetTitleOptions {
    ref: Ref;
    title: string;
}
/**
 * Sets the image associated with this tray icon.
 *
 * @param options - ref: Reference for the Tray.
 * @public
 */
export declare function setImage({ ref, image, }: {
    ref: Ref;
    image: string | InstanceRefObject;
}): Promise<void>;
/**
 * Sets the image associated with this tray icon when pressed on macOS.
 *
 * @param options - ref: Reference for the Tray.
 * @public
 */
export declare function setPressedImage({ ref, image, }: {
    ref: Ref;
    image: string | InstanceRefObject;
}): Promise<void>;
/**
 * Sets the hover text for this tray icon.
 *
 * @param options - ref: Reference for the Tray; tooltip: hover text to display.
 * @public
 */
export declare function setToolTip({ ref, tooltip, }: {
    ref: Ref;
    tooltip: string;
}): Promise<void>;
/**
 * Gets the title displayed next to the tray icon in the status bar.
 *
 * @param options - ref: Reference for the Tray.
 * @public
 */
export declare function getTitle({ ref }: {
    ref: Ref;
}): Promise<string>;
/**
 * Sets the option to ignore double click events. Ignoring these events allows you to detect every individual click of the tray icon.
 *
 * @param options - ref: Reference for the Tray; ignore: whether to ignore double clicks or not;
 * @public
 */
export declare function setIgnoreDoubleClickEvents({ ref, ignore, }: {
    ref: Ref;
    ignore: boolean;
}): Promise<void>;
/**
 * Whether double click events will be ignored.
 *
 * @param options - ref: Reference for the Tray.
 * @public
 */
export declare function getIgnoreDoubleClickEvents({ ref }: {
    ref: Ref;
}): Promise<boolean>;
/**
 * Displays a tray balloon on windows.
 *
 * @param options - ref: Reference for the Tray.
 * @public
 */
export declare function displayBalloon({ ref, ...options }: {
    ref: Ref;
} & DisplayBalloonOptions): Promise<void>;
/**
 * Removes a tray balloon.
 *
 * @param options - ref: Reference for the Tray.
 * @public
 */
export declare function removeBalloon({ ref }: {
    ref: Ref;
}): Promise<void>;
/**
 * Returns focus to the taskbar notification area. Windows only.
 *
 * @param options - ref: Reference for the Tray.
 * @public
 */
export declare function focus({ ref }: {
    ref: Ref;
}): Promise<void>;
/**
 * Pops up the context menu of the tray icon. When menu is passed, the menu will be shown instead of the tray icon's context menu. MacOS and Windows only.
 *
 * @param options - ref: Reference for the Tray; menu: Reference for the Menu; position: x and y coordinates.
 * @public
 */
export declare function popUpContextMenu({ ref, ...options }: {
    ref: Ref;
    menu?: InstanceRefObject | undefined;
    position?: Electron.Point | undefined;
}): Promise<void>;
/**
 * Closes an open context menu, as set by tray.setContextMenu(). MacOS and Windows only.
 *
 * @param options - ref: Reference for the Tray.
 * @public
 */
export declare function closeContextMenu({ ref }: {
    ref: Ref;
}): Promise<void>;
/**
 * Sets the context menu for this icon.
 *
 * @param options - ref: Reference for the Tray; menu: Reference for the Menu;
 * @public
 */
export declare function setContextMenu({ ref, ...options }: {
    ref: Ref;
    menu?: InstanceRefObject | undefined;
}): Promise<void>;
/**
 * The bounds of this tray icon as Object. MacOS and Windows only.
 *
 * @param options - ref: Reference for the Tray.
 * @public
 */
export declare function getBounds({ ref }: {
    ref: Ref;
}): Promise<Electron.Rectangle>;
/**
 * Whether the tray icon is destroyed.
 *
 * @param options - ref: Reference for the Tray.
 * @public
 */
export declare function isDestroyed({ ref }: {
    ref: Ref;
}): Promise<boolean>;
/**
 * @public
 */
export declare type TrayEvents = NamespaceEvents<{
    "balloon-click": () => void;
    "balloon-closed": () => void;
    "balloon-show": () => void;
    click: () => void;
    "double-click": () => void;
    "drag-end": () => void;
    "drag-enter": () => void;
    "drag-leave": () => void;
    drop: () => void;
    "drop-files": (files: string[]) => void;
    "drop-text": (text: string) => void;
    "mouse-down": (position: Point) => void;
    "mouse-enter": (position: Point) => void;
    "mouse-leave": (position: Point) => void;
    "mouse-move": (position: Point) => void;
    "mouse-up": (position: Point) => void;
    "right-click": () => void;
}>;
/**
 * Subcribes to an event on a tray object.
 *
 * @param eventName - The event name to subscribe to.
 * @param callback - The callback function to execute when the event occurs.
 * @param options - ref: Reference for the Tray.
 * @returns unsubscribe callback.
 * @public
 */
export declare const on: <E extends "click" | "balloon-click" | "balloon-closed" | "balloon-show" | "double-click" | "drag-end" | "drag-enter" | "drag-leave" | "drop" | "drop-files" | "drop-text" | "mouse-down" | "mouse-enter" | "mouse-leave" | "mouse-move" | "mouse-up" | "right-click">(eventName: E, callback: NamespaceEvents<{
    "balloon-click": () => void;
    "balloon-closed": () => void;
    "balloon-show": () => void;
    click: () => void;
    "double-click": () => void;
    "drag-end": () => void;
    "drag-enter": () => void;
    "drag-leave": () => void;
    drop: () => void;
    "drop-files": (files: string[]) => void;
    "drop-text": (text: string) => void;
    "mouse-down": (position: Point) => void;
    "mouse-enter": (position: Point) => void;
    "mouse-leave": (position: Point) => void;
    "mouse-move": (position: Point) => void;
    "mouse-up": (position: Point) => void;
    "right-click": () => void;
}>[E], args_0: {
    ref: InstanceRefObject;
    preventDefault?: boolean;
}) => Promise<() => Promise<void>>;
/**
 * Unsubscribes all tray objects from the event name.
 *
 * @param options - ref: Reference for the Tray; eventName: The event name to unsubscribe from;
 * @returns Reference for the tray.
 * @public
 */
export declare const removeAllListeners: <E extends "click" | "balloon-click" | "balloon-closed" | "balloon-show" | "double-click" | "drag-end" | "drag-enter" | "drag-leave" | "drop" | "drop-files" | "drop-text" | "mouse-down" | "mouse-enter" | "mouse-leave" | "mouse-move" | "mouse-up" | "right-click">(eventName: E, args_0: {
    ref: InstanceRefObject;
}) => Promise<void>;
export {};
