For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/lynxtron/api/@lynx-js/lynxtron/Class.Dock.md.
  • 简体中文
  • @lynx-js/lynxtron / Dock

    Dock

    构造函数

    new Dock()

    new Dock(): Dock

    返回

    Dock

    方法

    bounce() macOS

    bounce(type?: "critical" | "informational"): number

    an ID representing the request.

    When critical is passed, the dock icon will bounce until either the application becomes active or the request is canceled.

    When informational is passed, the dock icon will bounce for one second. However, the request remains active until either the application becomes active or the request is canceled.

    NOTE

    This method can only be used while the app is not focused; when the app is focused it will return -1.

    参数

    范围类型
    type?"critical" | "informational"

    返回

    number

    定义于

    apis/api/dock.d.ts:24


    cancelBounce() macOS

    cancelBounce(id: number): void

    Cancel the bounce of id.

    参数

    范围类型
    idnumber

    返回

    void

    定义于

    apis/api/dock.d.ts:30


    downloadFinished() macOS

    downloadFinished(filePath: string): void

    Bounces the Downloads stack if the filePath is inside the Downloads folder.

    参数

    范围类型
    filePathstring

    返回

    void

    定义于

    apis/api/dock.d.ts:36


    getBadge() macOS

    getBadge(): string

    The badge string of the dock.

    返回

    string

    定义于

    apis/api/dock.d.ts:42


    getMenu() macOS

    getMenu(): null | Menu

    The application's dock menu.

    返回

    null | Menu

    定义于

    apis/api/dock.d.ts:48


    hide() macOS

    hide(): void

    Hides the dock icon.

    返回

    void

    定义于

    apis/api/dock.d.ts:54


    isVisible() macOS

    isVisible(): boolean

    Whether the dock icon is visible.

    返回

    boolean

    定义于

    apis/api/dock.d.ts:60


    setBadge() macOS

    setBadge(text: string): void

    Sets the string to be displayed in the dock’s badging area.

    IMPORTANT

    You need to ensure that your application has the permission to display notifications for this method to work.

    参数

    范围类型
    textstring

    返回

    void

    定义于

    apis/api/dock.d.ts:69


    setIcon() macOS

    setIcon(image: string | NativeImage): void

    Sets the image associated with this dock icon.

    参数

    范围类型
    imagestring | NativeImage

    返回

    void

    定义于

    apis/api/dock.d.ts:75


    setMenu() macOS

    setMenu(menu: Menu): void

    Sets the application's dock menu.

    参数

    范围类型
    menuMenu

    返回

    void

    定义于

    apis/api/dock.d.ts:81


    show() macOS

    show(): Promise<void>

    Resolves when the dock icon is shown.

    返回

    Promise<void>

    定义于

    apis/api/dock.d.ts:87

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。