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.LynxWindow.md.
  • 简体中文
  • @lynx-js/lynxtron / LynxWindow

    LynxWindow

    继承

    构造函数

    new LynxWindow()

    new LynxWindow(options?: LynxWindowConstructorOptions): LynxWindow

    LynxWindow

    参数

    范围类型
    options?LynxWindowConstructorOptions

    返回

    LynxWindow

    重写了

    BaseWindow.constructor

    定义于

    apis/api/lynx-window.d.ts:268

    属性

    autoHideMenuBar
    Windows

    autoHideMenuBar: boolean;

    A boolean property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single Alt key.

    If the menu bar is already visible, setting this property to true won't hide it immediately.

    继承自

    BaseWindow.autoHideMenuBar

    定义于

    apis/api/base-window.d.ts:1626


    closable

    closable: boolean;

    A boolean property that determines whether the window can be manually closed by user.

    继承自

    BaseWindow.closable

    定义于

    apis/api/base-window.d.ts:1633


    excludedFromShownWindowsMenu
    macOS

    excludedFromShownWindowsMenu: boolean;

    A boolean property that determines whether the window is excluded from the application’s Windows menu. false by default.

    继承自

    BaseWindow.excludedFromShownWindowsMenu

    定义于

    apis/api/base-window.d.ts:1705


    focusable

    focusable: boolean;

    A boolean property that determines whether the window is focusable.

    继承自

    BaseWindow.focusable

    定义于

    apis/api/base-window.d.ts:1639


    fullScreen

    fullScreen: boolean;

    A boolean property that determines whether the window is in fullscreen mode.

    继承自

    BaseWindow.fullScreen

    定义于

    apis/api/base-window.d.ts:1643


    fullScreenable

    fullScreenable: boolean;

    A boolean property that determines whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.

    继承自

    BaseWindow.fullScreenable

    定义于

    apis/api/base-window.d.ts:1648


    id

    readonly id: number;

    A Integer property representing the unique ID of the window. Each ID is unique among all BaseWindow instances of the entire application.

    继承自

    BaseWindow.id

    定义于

    apis/api/base-window.d.ts:1711


    maximizable

    maximizable: boolean;

    A boolean property that determines whether the window can be manually maximized by user.

    继承自

    BaseWindow.maximizable

    定义于

    apis/api/base-window.d.ts:1655


    minimizable

    minimizable: boolean;

    A boolean property that determines whether the window can be manually minimized by user.

    继承自

    BaseWindow.minimizable

    定义于

    apis/api/base-window.d.ts:1662


    movable

    movable: boolean;

    A boolean property that determines Whether the window can be moved by user.

    继承自

    BaseWindow.movable

    定义于

    apis/api/base-window.d.ts:1668


    resizable

    resizable: boolean;

    A boolean property that determines whether the window can be manually resized by user.

    继承自

    BaseWindow.resizable

    定义于

    apis/api/base-window.d.ts:1673


    shadow

    shadow: boolean;

    A boolean property that determines whether the window has a shadow.

    继承自

    BaseWindow.shadow

    定义于

    apis/api/base-window.d.ts:1677


    simpleFullScreen

    simpleFullScreen: boolean;

    A boolean property that determines whether the window is in simple (pre-Lion) fullscreen mode.

    继承自

    BaseWindow.simpleFullScreen

    定义于

    apis/api/base-window.d.ts:1682


    tabbingIdentifier

    tabbingIdentifier: string;

    定义于

    apis/api/lynx-window.d.ts:334


    title

    title: string;

    A string property that determines the title of the native window.

    NOTE

    Application content may present a different title from the native window title.

    继承自

    BaseWindow.title

    定义于

    apis/api/base-window.d.ts:1689


    visibleOnAllWorkspaces
    macOS

    visibleOnAllWorkspaces: boolean;

    A boolean property that determines whether the window is visible on all workspaces.

    NOTE

    Always returns false on Windows.

    继承自

    BaseWindow.visibleOnAllWorkspaces

    定义于

    apis/api/base-window.d.ts:1698

    方法

    addListener()

    event: "app-command"
    Windows

    addListener(event: "app-command", listener: (event: Event, command: string) => void): this

    参数

    范围类型
    event"app-command"
    listener(event: Event, command: string) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:344

    event: "blur"

    addListener(event: "blur", listener: (event: Event) => void): this

    参数

    范围类型
    event"blur"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:361

    event: "close"

    addListener(event: "close", listener: (event: Event) => void): this

    参数

    范围类型
    event"close"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:370

    event: "closed"

    addListener(event: "closed", listener: () => void): this

    参数

    范围类型
    event"closed"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:379

    event: "will-enter-full-screen"

    addListener(event: "will-enter-full-screen", listener: () => void): this

    参数

    范围类型
    event"will-enter-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:387

    event: "enter-full-screen"

    addListener(event: "enter-full-screen", listener: () => void): this

    参数

    范围类型
    event"enter-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:395

    event: "focus"

    addListener(event: "focus", listener: (event: Event) => void): this

    参数

    范围类型
    event"focus"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:403

    event: "hide"

    addListener(event: "hide", listener: () => void): this

    参数

    范围类型
    event"hide"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:411

    event: "will-leave-full-screen"

    addListener(event: "will-leave-full-screen", listener: () => void): this

    参数

    范围类型
    event"will-leave-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:419

    event: "leave-full-screen"

    addListener(event: "leave-full-screen", listener: () => void): this

    参数

    范围类型
    event"leave-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:427

    event: "maximize"

    addListener(event: "maximize", listener: () => void): this

    参数

    范围类型
    event"maximize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:435

    event: "minimize"

    addListener(event: "minimize", listener: () => void): this

    参数

    范围类型
    event"minimize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:443

    event: "move"

    addListener(event: "move", listener: () => void): this

    参数

    范围类型
    event"move"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:451

    event: "moved"

    addListener(event: "moved", listener: () => void): this

    参数

    范围类型
    event"moved"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:472

    event: "resize"

    addListener(event: "resize", listener: () => void): this

    参数

    范围类型
    event"resize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:483

    event: "resized"

    addListener(event: "resized", listener: () => void): this

    参数

    范围类型
    event"resized"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:506

    event: "restore"

    addListener(event: "restore", listener: () => void): this

    参数

    范围类型
    event"restore"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:517

    event: "always-on-top-changed"

    addListener(event: "always-on-top-changed", listener: (event: Event, isAlwaysOnTop: boolean) => void): this

    参数

    范围类型
    event"always-on-top-changed"
    listener(event: Event, isAlwaysOnTop: boolean) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:545

    event: "rotate-gesture"
    macOS

    addListener(event: "rotate-gesture", listener: (event: Event, rotation: number) => void): this

    参数

    范围类型
    event"rotate-gesture"
    listener(event: Event, rotation: number) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:586

    event: "session-end"
    Windows

    addListener(event: "session-end", listener: (event: any) => void): this

    参数

    范围类型
    event"session-end"
    listener(event: any) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:616

    event: "sheet-begin"
    macOS

    addListener(event: "sheet-begin", listener: () => void): this

    参数

    范围类型
    event"sheet-begin"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:638

    event: "sheet-end"
    macOS

    addListener(event: "sheet-end", listener: () => void): this

    参数

    范围类型
    event"sheet-end"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:660

    event: "new-window-for-tab"
    macOS

    addListener(event: "new-window-for-tab", listener: (event: Event) => void): this

    参数

    范围类型
    event"new-window-for-tab"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:683

    event: "show"

    addListener(event: "show", listener: () => void): this

    参数

    范围类型
    event"show"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:700

    event: "swipe"
    macOS

    addListener(event: "swipe", listener: (event: Event, direction: string) => void): this

    参数

    范围类型
    event"swipe"
    listener(event: Event, direction: string) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:733

    event: "system-context-menu"
    Windows

    addListener(event: "system-context-menu", listener: (event: Event, point: Point) => void): this

    参数

    范围类型
    event"system-context-menu"
    listener(event: Event, point: Point) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:795

    event: "unmaximize"

    addListener(event: "unmaximize", listener: () => void): this

    参数

    范围类型
    event"unmaximize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:824

    event: "will-move"

    addListener(event: "will-move", listener: (event: Event, newBounds: Rectangle) => void): this

    参数

    范围类型
    event"will-move"
    listener(event: Event, newBounds: Rectangle) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:874

    event: "will-resize"

    addListener(event: "will-resize", listener: (event: Event, newBounds: Rectangle, details: WillResizeDetails) => void): this

    参数

    范围类型
    event"will-resize"
    listener(event: Event, newBounds: Rectangle, details: WillResizeDetails) => void

    返回

    this

    继承自

    BaseWindow.addListener

    定义于

    apis/api/base-window.d.ts:957


    addTabbedWindow()
    macOS

    addTabbedWindow(window: BaseWindow): void

    Adds window as a tab on this window, after the tab for the current window.

    参数

    范围类型
    windowBaseWindow

    返回

    void

    继承自

    BaseWindow.addTabbedWindow

    定义于

    apis/api/base-window.d.ts:1142


    blur()

    blur(): void

    Removes focus from the window.

    返回

    void

    继承自

    BaseWindow.blur

    定义于

    apis/api/base-window.d.ts:1002


    center()

    center(): void

    Moves window to the center of the screen.

    返回

    void

    继承自

    BaseWindow.center

    定义于

    apis/api/base-window.d.ts:1006


    close()

    close(): void

    Try to close the window. This has the same effect as a user manually clicking the close button of the window. The close may be canceled by a listener on the close event.

    返回

    void

    继承自

    BaseWindow.close

    定义于

    apis/api/base-window.d.ts:1012


    destroy()

    destroy(): void

    Force closing the window. The close event will not be emitted for this window, but it guarantees the closed event will be emitted.

    返回

    void

    继承自

    BaseWindow.destroy

    定义于

    apis/api/base-window.d.ts:1017


    flashFrame()

    flashFrame(flag: boolean): void

    Starts or stops flashing the window to attract user's attention.

    参数

    范围类型
    flagboolean

    返回

    void

    继承自

    BaseWindow.flashFrame

    定义于

    apis/api/base-window.d.ts:1021


    focus()

    focus(): void

    Focuses on the window.

    返回

    void

    继承自

    BaseWindow.focus

    定义于

    apis/api/base-window.d.ts:1025


    fromId()

    static fromId(id: number): null | LynxWindow

    The window with the given id.

    参数

    范围类型
    idnumber

    返回

    null | LynxWindow

    重写了

    BaseWindow.fromId

    定义于

    apis/api/lynx-window.d.ts:325


    getAllWindows()

    static getAllWindows(): LynxWindow[]

    An array of all opened windows.

    返回

    LynxWindow[]

    重写了

    BaseWindow.getAllWindows

    定义于

    apis/api/lynx-window.d.ts:329


    getBackgroundColor()

    getBackgroundColor(): string

    Gets the background color of the window in Hex (#RRGGBB) format.

    See Setting backgroundColor.

    NOTE

    The alpha value is not returned alongside the red, green, and blue values.

    返回

    string

    继承自

    BaseWindow.getBackgroundColor

    定义于

    apis/api/base-window.d.ts:1038


    getBounds()

    getBounds(): Rectangle

    The bounds of the window as Object.

    NOTE

    On macOS, the returned y-coordinate will be at minimum the menu bar height. For example, calling win.setBounds({ x: 25, y: 20, width: 800, height: 600 \}) with a menu bar height of 38 means that win.getBounds() will return { x: 25, y: 38, width: 800, height: 600 }.

    返回

    Rectangle

    继承自

    BaseWindow.getBounds

    定义于

    apis/api/base-window.d.ts:1047


    getChildWindows()

    getChildWindows(): BaseWindow[]

    All child windows.

    返回

    BaseWindow[]

    继承自

    BaseWindow.getChildWindows

    定义于

    apis/api/base-window.d.ts:1051


    getContentBounds()

    getContentBounds(): Rectangle

    Gets the bounds of the content area.

    返回

    Rectangle

    继承自

    BaseWindow.getContentBounds

    定义于

    apis/api/base-window.d.ts:1520


    getContentSize()

    getContentSize(): number[]

    Gets the size of the content area.

    返回

    number[]

    继承自

    BaseWindow.getContentSize

    定义于

    apis/api/base-window.d.ts:1512


    getFocusedWindow()

    static getFocusedWindow(): null | LynxWindow

    The window that is focused in this application, otherwise returns null.

    返回

    null | LynxWindow

    重写了

    BaseWindow.getFocusedWindow

    定义于

    apis/api/lynx-window.d.ts:333


    getMaximumSize()

    getMaximumSize(): number[]

    Contains the window's maximum width and height.

    返回

    number[]

    继承自

    BaseWindow.getMaximumSize

    定义于

    apis/api/base-window.d.ts:1055


    getMinimumSize()

    getMinimumSize(): number[]

    Contains the window's minimum width and height.

    返回

    number[]

    继承自

    BaseWindow.getMinimumSize

    定义于

    apis/api/base-window.d.ts:1059


    getNativeWindowHandle()

    getNativeWindowHandle(): Buffer

    The platform-specific handle of the window.

    The native type of the handle is HWND on Windows, NSView* on macOS.

    返回

    Buffer

    继承自

    BaseWindow.getNativeWindowHandle

    定义于

    apis/api/base-window.d.ts:1065


    getNormalBounds()

    getNormalBounds(): Rectangle

    Contains the window bounds of the normal state

    NOTE

    Whatever the current state of the window : maximized, minimized or in fullscreen, this function always returns the position and size of the window in normal state. In normal state, getBounds and getNormalBounds returns the same Rectangle.

    返回

    Rectangle

    继承自

    BaseWindow.getNormalBounds

    定义于

    apis/api/base-window.d.ts:1074


    getOpacity()

    getOpacity(): number

    between 0.0 (fully transparent) and 1.0 (fully opaque).

    返回

    number

    继承自

    BaseWindow.getOpacity

    定义于

    apis/api/base-window.d.ts:1078


    getParentWindow()

    getParentWindow(): null | BaseWindow

    The parent window or null if there is no parent.

    返回

    null | BaseWindow

    继承自

    BaseWindow.getParentWindow

    定义于

    apis/api/base-window.d.ts:1082


    getPosition()

    getPosition(): number[]

    Contains the window's current position.

    返回

    number[]

    继承自

    BaseWindow.getPosition

    定义于

    apis/api/base-window.d.ts:1086


    getSize()

    getSize()

    getSize(): number[]

    Contains the window's width and height.

    返回

    number[]

    继承自

    BaseWindow.getSize

    定义于

    apis/api/base-window.d.ts:1090

    getSize()

    getSize(): number[]

    Contains the window's width and height.

    返回

    number[]

    继承自

    BaseWindow.getSize

    定义于

    apis/api/base-window.d.ts:1504


    getTitle()

    getTitle(): string

    The title of the native window.

    返回

    string

    继承自

    BaseWindow.getTitle

    定义于

    apis/api/base-window.d.ts:1094


    hasShadow()

    hasShadow(): boolean

    Whether the window has a shadow.

    返回

    boolean

    继承自

    BaseWindow.hasShadow

    定义于

    apis/api/base-window.d.ts:1098


    hide()

    hide(): void

    Hides the window.

    返回

    void

    继承自

    BaseWindow.hide

    定义于

    apis/api/base-window.d.ts:1102


    hookWindowMessage()
    Windows

    hookWindowMessage(message: number, callback: (wParam: Buffer, lParam: Buffer) => void): void

    Hooks a windows message. The callback is called when the message is received in the WndProc.

    参数

    范围类型
    messagenumber
    callback(wParam: Buffer, lParam: Buffer) => void

    返回

    void

    继承自

    BaseWindow.hookWindowMessage

    定义于

    apis/api/base-window.d.ts:1109


    isAlwaysOnTop()

    isAlwaysOnTop(): boolean

    Whether the window is always on top of other windows.

    返回

    boolean

    继承自

    BaseWindow.isAlwaysOnTop

    定义于

    apis/api/base-window.d.ts:1116


    isClosable()

    isClosable(): boolean

    Whether the window can be manually closed by user.

    返回

    boolean

    继承自

    BaseWindow.isClosable

    定义于

    apis/api/base-window.d.ts:1122


    isDestroyed()

    isDestroyed()

    isDestroyed(): boolean

    Whether the window is destroyed.

    返回

    boolean

    继承自

    BaseWindow.isDestroyed

    定义于

    apis/api/base-window.d.ts:1029

    isDestroyed()

    isDestroyed(): boolean

    Whether the window is destroyed.

    返回

    boolean

    继承自

    BaseWindow.isDestroyed

    定义于

    apis/api/base-window.d.ts:1126


    isEnabled()

    isEnabled(): boolean

    whether the window is enabled.

    返回

    boolean

    继承自

    BaseWindow.isEnabled

    定义于

    apis/api/base-window.d.ts:1130


    isFocusable()

    isFocusable(): boolean

    Whether the window can be focused.

    返回

    boolean

    继承自

    BaseWindow.isFocusable

    定义于

    apis/api/base-window.d.ts:1136


    isFocused()

    isFocused(): boolean

    Whether the window is focused.

    返回

    boolean

    继承自

    BaseWindow.isFocused

    定义于

    apis/api/base-window.d.ts:1146


    isFullScreen()

    isFullScreen(): boolean

    Whether the window is in fullscreen mode.

    返回

    boolean

    继承自

    BaseWindow.isFullScreen

    定义于

    apis/api/base-window.d.ts:1150


    isFullScreenable()

    isFullScreenable(): boolean

    Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.

    返回

    boolean

    继承自

    BaseWindow.isFullScreenable

    定义于

    apis/api/base-window.d.ts:1155


    isHiddenInMissionControl()

    isHiddenInMissionControl(): boolean

    返回

    boolean

    继承自

    BaseWindow.isHiddenInMissionControl

    定义于

    apis/api/base-window.d.ts:1156


    isMaximizable()

    isMaximizable(): boolean

    Whether the window can be manually maximized by user.

    返回

    boolean

    继承自

    BaseWindow.isMaximizable

    定义于

    apis/api/base-window.d.ts:1162


    isMaximized()

    isMaximized(): boolean

    Whether the window is maximized.

    返回

    boolean

    继承自

    BaseWindow.isMaximized

    定义于

    apis/api/base-window.d.ts:1166


    isMenuBarAutoHide()
    Windows

    isMenuBarAutoHide(): boolean

    Whether menu bar automatically hides itself.

    返回

    boolean

    继承自

    BaseWindow.isMenuBarAutoHide

    定义于

    apis/api/base-window.d.ts:1172


    isMenuBarVisible()
    Windows

    isMenuBarVisible(): boolean

    Whether the menu bar is visible.

    返回

    boolean

    继承自

    BaseWindow.isMenuBarVisible

    定义于

    apis/api/base-window.d.ts:1178


    isMinimizable()

    isMinimizable(): boolean

    Whether the window can be manually minimized by the user.

    返回

    boolean

    继承自

    BaseWindow.isMinimizable

    定义于

    apis/api/base-window.d.ts:1184


    isMinimized()

    isMinimized(): boolean

    Whether the window is minimized.

    返回

    boolean

    继承自

    BaseWindow.isMinimized

    定义于

    apis/api/base-window.d.ts:1188


    isModal()

    isModal(): boolean

    Whether current window is a modal window.

    返回

    boolean

    继承自

    BaseWindow.isModal

    定义于

    apis/api/base-window.d.ts:1192


    isMovable()

    isMovable(): boolean

    Whether the window can be moved by user.

    返回

    boolean

    继承自

    BaseWindow.isMovable

    定义于

    apis/api/base-window.d.ts:1198


    isNormal()

    isNormal(): boolean

    Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode).

    返回

    boolean

    继承自

    BaseWindow.isNormal

    定义于

    apis/api/base-window.d.ts:1203


    isResizable()

    isResizable(): boolean

    Whether the window can be manually resized by the user.

    返回

    boolean

    继承自

    BaseWindow.isResizable

    定义于

    apis/api/base-window.d.ts:1207


    isSimpleFullScreen()
    macOS

    isSimpleFullScreen(): boolean

    Whether the window is in simple (pre-Lion) fullscreen mode.

    返回

    boolean

    继承自

    BaseWindow.isSimpleFullScreen

    定义于

    apis/api/base-window.d.ts:1213


    isVisible()

    isVisible(): boolean

    Whether the window is visible to the user in the foreground of the app.

    返回

    boolean

    继承自

    BaseWindow.isVisible

    定义于

    apis/api/base-window.d.ts:1217


    isVisibleOnAllWorkspaces()
    macOS

    isVisibleOnAllWorkspaces(): boolean

    Whether the window is visible on all workspaces.

    NOTE

    This API always returns false on Windows.

    返回

    boolean

    继承自

    BaseWindow.isVisibleOnAllWorkspaces

    定义于

    apis/api/base-window.d.ts:1225


    isWindowMessageHooked()
    Windows

    isWindowMessageHooked(message: number): boolean

    true or false depending on whether the message is hooked.

    参数

    范围类型
    messagenumber

    返回

    boolean

    继承自

    BaseWindow.isWindowMessageHooked

    定义于

    apis/api/base-window.d.ts:1231


    loadBundle()

    loadBundle(templateBundle: LynxTemplateBundle, options?: object): boolean

    Load a pre-decoded Lynx template bundle.

    Returns true when the request is accepted synchronously. Final load completion is reported asynchronously via window events such as ready-to-show and --lynx-error.

    参数

    范围类型
    templateBundleLynxTemplateBundle
    options?object
    options.data?Object
    options.globalProps?Object

    返回

    boolean

    定义于

    apis/api/lynx-window.d.ts:373


    loadFile()

    loadFile(filePath: string, options?: object): boolean

    Starts loading a Lynx bundle from a local file path.

    Returns true when the request is accepted synchronously. Final load completion is reported asynchronously via window events such as ready-to-show and --lynx-error.

    参数

    范围类型
    filePathstring
    options?object
    options.data?Object
    options.globalProps?Object

    返回

    boolean

    定义于

    apis/api/lynx-window.d.ts:342


    loadURL()

    loadURL(url: string, options?: object): boolean

    Load a Lynx bundle from a URL.

    Supported URLs include remote URLs such as https://... and local file URLs such as file:///abs/path/to/main.lynx.bundle.

    Returns true when the request is accepted synchronously. Final load completion is reported asynchronously via window events such as ready-to-show and --lynx-error.

    参数

    范围类型
    urlstring
    options?object
    options.data?Object
    options.globalProps?Object

    返回

    boolean

    定义于

    apis/api/lynx-window.d.ts:359


    maximize()

    maximize(): void

    Maximizes the window. This will also show (but not focus) the window if it isn't being displayed already.

    返回

    void

    继承自

    BaseWindow.maximize

    定义于

    apis/api/base-window.d.ts:1236


    mergeAllWindows()
    macOS

    mergeAllWindows(): void

    Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window.

    返回

    void

    继承自

    BaseWindow.mergeAllWindows

    定义于

    apis/api/base-window.d.ts:1406


    minimize()

    minimize(): void

    Minimizes the window. On macOS, the minimized window will be shown in the Dock.

    返回

    void

    继承自

    BaseWindow.minimize

    定义于

    apis/api/base-window.d.ts:1240


    moveTabToNewWindow()
    macOS

    moveTabToNewWindow(): void

    Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window.

    返回

    void

    继承自

    BaseWindow.moveTabToNewWindow

    定义于

    apis/api/base-window.d.ts:1439


    moveTop()

    moveTop(): void

    Moves window to top(z-order) regardless of focus

    返回

    void

    继承自

    BaseWindow.moveTop

    定义于

    apis/api/base-window.d.ts:1244


    off()

    event: "app-command"
    Windows

    off(event: "app-command", listener: (event: Event, command: string) => void): this

    参数

    范围类型
    event"app-command"
    listener(event: Event, command: string) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:330

    event: "blur"

    off(event: "blur", listener: (event: Event) => void): this

    参数

    范围类型
    event"blur"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:359

    event: "close"

    off(event: "close", listener: (event: Event) => void): this

    参数

    范围类型
    event"close"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:368

    event: "closed"

    off(event: "closed", listener: () => void): this

    参数

    范围类型
    event"closed"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:377

    event: "will-enter-full-screen"

    off(event: "will-enter-full-screen", listener: () => void): this

    参数

    范围类型
    event"will-enter-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:385

    event: "enter-full-screen"

    off(event: "enter-full-screen", listener: () => void): this

    参数

    范围类型
    event"enter-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:393

    event: "focus"

    off(event: "focus", listener: (event: Event) => void): this

    参数

    范围类型
    event"focus"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:401

    event: "hide"

    off(event: "hide", listener: () => void): this

    参数

    范围类型
    event"hide"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:409

    event: "will-leave-full-screen"

    off(event: "will-leave-full-screen", listener: () => void): this

    参数

    范围类型
    event"will-leave-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:417

    event: "leave-full-screen"

    off(event: "leave-full-screen", listener: () => void): this

    参数

    范围类型
    event"leave-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:425

    event: "maximize"

    off(event: "maximize", listener: () => void): this

    参数

    范围类型
    event"maximize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:433

    event: "minimize"

    off(event: "minimize", listener: () => void): this

    参数

    范围类型
    event"minimize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:441

    event: "move"

    off(event: "move", listener: () => void): this

    参数

    范围类型
    event"move"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:449

    event: "moved"

    off(event: "moved", listener: () => void): this

    参数

    范围类型
    event"moved"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:464

    event: "resize"

    off(event: "resize", listener: () => void): this

    参数

    范围类型
    event"resize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:481

    event: "resized"

    off(event: "resized", listener: () => void): this

    参数

    范围类型
    event"resized"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:498

    event: "restore"

    off(event: "restore", listener: () => void): this

    参数

    范围类型
    event"restore"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:515

    event: "always-on-top-changed"

    off(event: "always-on-top-changed", listener: (event: Event, isAlwaysOnTop: boolean) => void): this

    参数

    范围类型
    event"always-on-top-changed"
    listener(event: Event, isAlwaysOnTop: boolean) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:531

    event: "rotate-gesture"
    macOS

    off(event: "rotate-gesture", listener: (event: Event, rotation: number) => void): this

    参数

    范围类型
    event"rotate-gesture"
    listener(event: Event, rotation: number) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:572

    event: "session-end"
    Windows

    off(event: "session-end", listener: (event: any) => void): this

    参数

    范围类型
    event"session-end"
    listener(event: any) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:608

    event: "sheet-begin"
    macOS

    off(event: "sheet-begin", listener: () => void): this

    参数

    范围类型
    event"sheet-begin"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:630

    event: "sheet-end"
    macOS

    off(event: "sheet-end", listener: () => void): this

    参数

    范围类型
    event"sheet-end"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:652

    event: "new-window-for-tab"
    macOS

    off(event: "new-window-for-tab", listener: (event: Event) => void): this

    参数

    范围类型
    event"new-window-for-tab"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:675

    event: "show"

    off(event: "show", listener: () => void): this

    参数

    范围类型
    event"show"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:698

    event: "swipe"
    macOS

    off(event: "swipe", listener: (event: Event, direction: string) => void): this

    参数

    范围类型
    event"swipe"
    listener(event: Event, direction: string) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:719

    event: "system-context-menu"
    Windows

    off(event: "system-context-menu", listener: (event: Event, point: Point) => void): this

    参数

    范围类型
    event"system-context-menu"
    listener(event: Event, point: Point) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:769

    event: "unmaximize"

    off(event: "unmaximize", listener: () => void): this

    参数

    范围类型
    event"unmaximize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:822

    event: "will-move"

    off(event: "will-move", listener: (event: Event, newBounds: Rectangle) => void): this

    参数

    范围类型
    event"will-move"
    listener(event: Event, newBounds: Rectangle) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:848

    event: "will-resize"

    off(event: "will-resize", listener: (event: Event, newBounds: Rectangle, details: WillResizeDetails) => void): this

    参数

    范围类型
    event"will-resize"
    listener(event: Event, newBounds: Rectangle, details: WillResizeDetails) => void

    返回

    this

    继承自

    BaseWindow.off

    定义于

    apis/api/base-window.d.ts:929


    on()

    event: "-lynx-invoke"
    Windows

    on(event: "-lynx-invoke", listener: LynxBridgeInvokeListener): this

    Emitted when an App Command is invoked. These are typically related to keyboard media keys or browser commands, as well as the "Back" button built into some mice on Windows.

    Commands are lowercased, underscores are replaced with hyphens, and the APPCOMMAND_ prefix is stripped off. e.g. APPCOMMAND_BROWSER_BACKWARD is emitted as browser-backward.

    参数

    范围类型
    event"-lynx-invoke"
    listenerLynxBridgeInvokeListener

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:269

    event: "-lynx-message"

    on(event: "-lynx-message", listener: LynxBridgeMessageListener): this

    Emitted when the window loses focus.

    参数

    范围类型
    event"-lynx-message"
    listenerLynxBridgeMessageListener

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:270

    event: "app-command"

    on(event: "app-command", listener: (event: Event, command: string) => void): this

    Emitted when the window is going to be closed. Calling event.preventDefault() will cancel the close.

    参数

    范围类型
    event"app-command"
    listener(event: Event, command: string) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:271

    event: "blur"

    on(event: "blur", listener: (event: Event) => void): this

    Emitted when the window is closed. After you have received this event you should remove the reference to the window and avoid using it any more.

    参数

    范围类型
    event"blur"
    listener(event: Event) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:275

    event: "close"

    on(event: "close", listener: (event: Event) => void): this

    Emitted before the window enters a full-screen state.

    参数

    范围类型
    event"close"
    listener(event: Event) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:276

    event: "closed"

    on(event: "closed", listener: () => void): this

    Emitted when the window enters a full-screen state.

    参数

    范围类型
    event"closed"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:277

    event: "will-enter-full-screen"

    on(event: "will-enter-full-screen", listener: () => void): this

    Emitted when the window gains focus.

    参数

    范围类型
    event"will-enter-full-screen"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:278

    event: "enter-full-screen"

    on(event: "enter-full-screen", listener: () => void): this

    Emitted when the window is hidden.

    参数

    范围类型
    event"enter-full-screen"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:279

    event: "focus"

    on(event: "focus", listener: (event: Event) => void): this

    Emitted before the window leaves a full-screen state.

    参数

    范围类型
    event"focus"
    listener(event: Event) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:280

    event: "hide"

    on(event: "hide", listener: () => void): this

    Emitted when the window leaves a full-screen state.

    参数

    范围类型
    event"hide"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:281

    event: "will-leave-full-screen"

    on(event: "will-leave-full-screen", listener: () => void): this

    Emitted when window is maximized.

    参数

    范围类型
    event"will-leave-full-screen"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:282

    event: "leave-full-screen"

    on(event: "leave-full-screen", listener: () => void): this

    Emitted when the window is minimized.

    参数

    范围类型
    event"leave-full-screen"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:283

    event: "maximize"

    on(event: "maximize", listener: () => void): this

    Emitted when the window is being moved to a new position.

    参数

    范围类型
    event"maximize"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:284

    event: "minimize"

    on(event: "minimize", listener: () => void): this

    Emitted once when the window is moved to a new position.

    NOTE

    On macOS, this event is an alias of move.

    参数

    范围类型
    event"minimize"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:285

    event: "move"

    on(event: "move", listener: () => void): this

    Emitted after the window has been resized.

    参数

    范围类型
    event"move"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:286

    event: "moved"

    on(event: "moved", listener: () => void): this

    Emitted once when the window has finished being resized.

    This is usually emitted when the window has been resized manually. On macOS, resizing the window with setBounds/setSize and setting the animate parameter to true will also emit this event once resizing has finished.

    参数

    范围类型
    event"moved"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:287

    event: "resize"

    on(event: "resize", listener: () => void): this

    Emitted when the window is restored from a minimized state.

    参数

    范围类型
    event"resize"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:288

    event: "resized"

    on(event: "resized", listener: () => void): this

    Emitted after the window's always-on-top state changes.

    参数

    范围类型
    event"resized"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:289

    event: "restore"
    macOS

    on(event: "restore", listener: () => void): this

    Emitted on trackpad rotation gesture. Continually emitted until rotation gesture is ended. The rotation value on each emission is the angle in degrees rotated since the last emission. The last emitted event upon a rotation gesture will always be of value 0. Counter-clockwise rotation values are positive, while clockwise ones are negative.

    参数

    范围类型
    event"restore"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:290

    event: "always-on-top-changed"
    Windows

    on(event: "always-on-top-changed", listener: (event: Event, isAlwaysOnTop: boolean) => void): this

    Emitted when a session is about to end due to a shutdown, machine restart, or user log-off. Once this event fires, there is no way to prevent the session from ending.

    参数

    范围类型
    event"always-on-top-changed"
    listener(event: Event, isAlwaysOnTop: boolean) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:291

    event: "rotate-gesture"
    macOS

    on(event: "rotate-gesture", listener: (event: Event, rotation: number) => void): this

    Emitted when the window opens a sheet.

    参数

    范围类型
    event"rotate-gesture"
    listener(event: Event, rotation: number) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:295

    event: "session-end"
    macOS

    on(event: "session-end", listener: (event: any) => void): this

    Emitted when the window has closed a sheet.

    参数

    范围类型
    event"session-end"
    listener(event: any) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:299

    event: "sheet-begin"
    macOS

    on(event: "sheet-begin", listener: () => void): this

    Emitted when the user clicks the native macOS new tab button. The new tab button is only visible if the current window has a tabbingIdentifier.

    参数

    范围类型
    event"sheet-begin"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:300

    event: "sheet-end"

    on(event: "sheet-end", listener: () => void): this

    Emitted when the window is shown.

    参数

    范围类型
    event"sheet-end"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:301

    event: "new-window-for-tab"
    macOS

    on(event: "new-window-for-tab", listener: (event: Event) => void): this

    Emitted on 3-finger swipe. Possible directions are up, right, down, left.

    The method underlying this event is built to handle older macOS-style trackpad swiping, where the content on the screen doesn't move with the swipe. Most macOS trackpads are not configured to allow this kind of swiping anymore, so in order for it to emit properly the 'Swipe between pages' preference in System Preferences > Trackpad > More Gestures must be set to 'Swipe with two or three fingers'.

    参数

    范围类型
    event"new-window-for-tab"
    listener(event: Event) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:302

    event: "show"
    Windows

    on(event: "show", listener: () => void): this

    Emitted when the system context menu is triggered on the window, this is normally only triggered when the user right clicks on the non-client area of your window. This is the window titlebar or any area you have declared as -webkit-app-region: drag in a frameless window.

    Calling event.preventDefault() will prevent the menu from being displayed.

    To convert point to DIP, use screen.screenToDipPoint(point).

    参数

    范围类型
    event"show"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:303

    event: "swipe"

    on(event: "swipe", listener: (event: Event, direction: string) => void): this

    Emitted when the window exits from a maximized state.

    参数

    范围类型
    event"swipe"
    listener(event: Event, direction: string) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:304

    event: "system-context-menu"

    on(event: "system-context-menu", listener: (event: Event, point: Point) => void): this

    Emitted before the window is moved. On Windows, calling event.preventDefault() will prevent the window from being moved.

    Note that this is only emitted when the window is being moved manually. Moving the window with setPosition/setBounds/center will not emit this event.

    参数

    范围类型
    event"system-context-menu"
    listener(event: Event, point: Point) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:305

    event: "unmaximize"

    on(event: "unmaximize", listener: () => void): this

    Emitted before the window is resized. Calling event.preventDefault() will prevent the window from being resized.

    Note that this is only emitted when the window is being resized manually. Resizing the window with setBounds/setSize will not emit this event.

    The possible values and behaviors of the edge option are platform dependent. Possible values are:

    • On Windows, possible values are bottom, top, left, right, top-left, top-right, bottom-left, bottom-right.
    • On macOS, possible values are bottom and right.
      • The value bottom is used to denote vertical resizing.
      • The value right is used to denote horizontal resizing.

    参数

    范围类型
    event"unmaximize"
    listener() => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:309

    event: "will-move"

    on(event: "will-move", listener: (event: Event, newBounds: Rectangle) => void): this

    参数

    范围类型
    event"will-move"
    listener(event: Event, newBounds: Rectangle) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:310

    event: "will-resize"

    on(event: "will-resize", listener: (event: Event, newBounds: Rectangle, details: WillResizeDetails) => void): this

    参数

    范围类型
    event"will-resize"
    listener(event: Event, newBounds: Rectangle, details: WillResizeDetails) => void

    返回

    this

    重写了

    BaseWindow.on

    定义于

    apis/api/lynx-window.d.ts:314


    once()

    event: "app-command"
    Windows

    once(event: "app-command", listener: (event: Event, command: string) => void): this

    参数

    范围类型
    event"app-command"
    listener(event: Event, command: string) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:337

    event: "blur"

    once(event: "blur", listener: (event: Event) => void): this

    参数

    范围类型
    event"blur"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:360

    event: "close"

    once(event: "close", listener: (event: Event) => void): this

    参数

    范围类型
    event"close"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:369

    event: "closed"

    once(event: "closed", listener: () => void): this

    参数

    范围类型
    event"closed"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:378

    event: "will-enter-full-screen"

    once(event: "will-enter-full-screen", listener: () => void): this

    参数

    范围类型
    event"will-enter-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:386

    event: "enter-full-screen"

    once(event: "enter-full-screen", listener: () => void): this

    参数

    范围类型
    event"enter-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:394

    event: "focus"

    once(event: "focus", listener: (event: Event) => void): this

    参数

    范围类型
    event"focus"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:402

    event: "hide"

    once(event: "hide", listener: () => void): this

    参数

    范围类型
    event"hide"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:410

    event: "will-leave-full-screen"

    once(event: "will-leave-full-screen", listener: () => void): this

    参数

    范围类型
    event"will-leave-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:418

    event: "leave-full-screen"

    once(event: "leave-full-screen", listener: () => void): this

    参数

    范围类型
    event"leave-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:426

    event: "maximize"

    once(event: "maximize", listener: () => void): this

    参数

    范围类型
    event"maximize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:434

    event: "minimize"

    once(event: "minimize", listener: () => void): this

    参数

    范围类型
    event"minimize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:442

    event: "move"

    once(event: "move", listener: () => void): this

    参数

    范围类型
    event"move"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:450

    event: "moved"

    once(event: "moved", listener: () => void): this

    参数

    范围类型
    event"moved"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:468

    event: "resize"

    once(event: "resize", listener: () => void): this

    参数

    范围类型
    event"resize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:482

    event: "resized"

    once(event: "resized", listener: () => void): this

    参数

    范围类型
    event"resized"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:502

    event: "restore"

    once(event: "restore", listener: () => void): this

    参数

    范围类型
    event"restore"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:516

    event: "always-on-top-changed"

    once(event: "always-on-top-changed", listener: (event: Event, isAlwaysOnTop: boolean) => void): this

    参数

    范围类型
    event"always-on-top-changed"
    listener(event: Event, isAlwaysOnTop: boolean) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:538

    event: "rotate-gesture"
    macOS

    once(event: "rotate-gesture", listener: (event: Event, rotation: number) => void): this

    参数

    范围类型
    event"rotate-gesture"
    listener(event: Event, rotation: number) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:579

    event: "session-end"
    Windows

    once(event: "session-end", listener: (event: any) => void): this

    参数

    范围类型
    event"session-end"
    listener(event: any) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:612

    event: "sheet-begin"
    macOS

    once(event: "sheet-begin", listener: () => void): this

    参数

    范围类型
    event"sheet-begin"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:634

    event: "sheet-end"
    macOS

    once(event: "sheet-end", listener: () => void): this

    参数

    范围类型
    event"sheet-end"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:656

    event: "new-window-for-tab"
    macOS

    once(event: "new-window-for-tab", listener: (event: Event) => void): this

    参数

    范围类型
    event"new-window-for-tab"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:679

    event: "show"

    once(event: "show", listener: () => void): this

    参数

    范围类型
    event"show"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:699

    event: "swipe"
    macOS

    once(event: "swipe", listener: (event: Event, direction: string) => void): this

    参数

    范围类型
    event"swipe"
    listener(event: Event, direction: string) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:726

    event: "system-context-menu"
    Windows

    once(event: "system-context-menu", listener: (event: Event, point: Point) => void): this

    参数

    范围类型
    event"system-context-menu"
    listener(event: Event, point: Point) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:782

    event: "unmaximize"

    once(event: "unmaximize", listener: () => void): this

    参数

    范围类型
    event"unmaximize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:823

    event: "will-move"

    once(event: "will-move", listener: (event: Event, newBounds: Rectangle) => void): this

    参数

    范围类型
    event"will-move"
    listener(event: Event, newBounds: Rectangle) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:861

    event: "will-resize"

    once(event: "will-resize", listener: (event: Event, newBounds: Rectangle, details: WillResizeDetails) => void): this

    参数

    范围类型
    event"will-resize"
    listener(event: Event, newBounds: Rectangle, details: WillResizeDetails) => void

    返回

    this

    继承自

    BaseWindow.once

    定义于

    apis/api/base-window.d.ts:943


    removeListener()

    event: "app-command"
    Windows

    removeListener(event: "app-command", listener: (event: Event, command: string) => void): this

    参数

    范围类型
    event"app-command"
    listener(event: Event, command: string) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:351

    event: "blur"

    removeListener(event: "blur", listener: (event: Event) => void): this

    参数

    范围类型
    event"blur"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:362

    event: "close"

    removeListener(event: "close", listener: (event: Event) => void): this

    参数

    范围类型
    event"close"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:371

    event: "closed"

    removeListener(event: "closed", listener: () => void): this

    参数

    范围类型
    event"closed"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:380

    event: "will-enter-full-screen"

    removeListener(event: "will-enter-full-screen", listener: () => void): this

    参数

    范围类型
    event"will-enter-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:388

    event: "enter-full-screen"

    removeListener(event: "enter-full-screen", listener: () => void): this

    参数

    范围类型
    event"enter-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:396

    event: "focus"

    removeListener(event: "focus", listener: (event: Event) => void): this

    参数

    范围类型
    event"focus"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:404

    event: "hide"

    removeListener(event: "hide", listener: () => void): this

    参数

    范围类型
    event"hide"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:412

    event: "will-leave-full-screen"

    removeListener(event: "will-leave-full-screen", listener: () => void): this

    参数

    范围类型
    event"will-leave-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:420

    event: "leave-full-screen"

    removeListener(event: "leave-full-screen", listener: () => void): this

    参数

    范围类型
    event"leave-full-screen"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:428

    event: "maximize"

    removeListener(event: "maximize", listener: () => void): this

    参数

    范围类型
    event"maximize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:436

    event: "minimize"

    removeListener(event: "minimize", listener: () => void): this

    参数

    范围类型
    event"minimize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:444

    event: "move"

    removeListener(event: "move", listener: () => void): this

    参数

    范围类型
    event"move"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:452

    event: "moved"

    removeListener(event: "moved", listener: () => void): this

    参数

    范围类型
    event"moved"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:476

    event: "resize"

    removeListener(event: "resize", listener: () => void): this

    参数

    范围类型
    event"resize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:484

    event: "resized"

    removeListener(event: "resized", listener: () => void): this

    参数

    范围类型
    event"resized"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:510

    event: "restore"

    removeListener(event: "restore", listener: () => void): this

    参数

    范围类型
    event"restore"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:518

    event: "always-on-top-changed"

    removeListener(event: "always-on-top-changed", listener: (event: Event, isAlwaysOnTop: boolean) => void): this

    参数

    范围类型
    event"always-on-top-changed"
    listener(event: Event, isAlwaysOnTop: boolean) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:552

    event: "rotate-gesture"
    macOS

    removeListener(event: "rotate-gesture", listener: (event: Event, rotation: number) => void): this

    参数

    范围类型
    event"rotate-gesture"
    listener(event: Event, rotation: number) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:593

    event: "session-end"
    Windows

    removeListener(event: "session-end", listener: (event: any) => void): this

    参数

    范围类型
    event"session-end"
    listener(event: any) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:620

    event: "sheet-begin"
    macOS

    removeListener(event: "sheet-begin", listener: () => void): this

    参数

    范围类型
    event"sheet-begin"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:642

    event: "sheet-end"
    macOS

    removeListener(event: "sheet-end", listener: () => void): this

    参数

    范围类型
    event"sheet-end"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:664

    event: "new-window-for-tab"
    macOS

    removeListener(event: "new-window-for-tab", listener: (event: Event) => void): this

    参数

    范围类型
    event"new-window-for-tab"
    listener(event: Event) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:690

    event: "show"

    removeListener(event: "show", listener: () => void): this

    参数

    范围类型
    event"show"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:701

    event: "swipe"
    macOS

    removeListener(event: "swipe", listener: (event: Event, direction: string) => void): this

    参数

    范围类型
    event"swipe"
    listener(event: Event, direction: string) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:740

    event: "system-context-menu"
    Windows

    removeListener(event: "system-context-menu", listener: (event: Event, point: Point) => void): this

    参数

    范围类型
    event"system-context-menu"
    listener(event: Event, point: Point) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:808

    event: "unmaximize"

    removeListener(event: "unmaximize", listener: () => void): this

    参数

    范围类型
    event"unmaximize"
    listener() => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:825

    event: "will-move"

    removeListener(event: "will-move", listener: (event: Event, newBounds: Rectangle) => void): this

    参数

    范围类型
    event"will-move"
    listener(event: Event, newBounds: Rectangle) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:887

    event: "will-resize"

    removeListener(event: "will-resize", listener: (event: Event, newBounds: Rectangle, details: WillResizeDetails) => void): this

    参数

    范围类型
    event"will-resize"
    listener(event: Event, newBounds: Rectangle, details: WillResizeDetails) => void

    返回

    this

    继承自

    BaseWindow.removeListener

    定义于

    apis/api/base-window.d.ts:971


    restore()

    restore(): void

    Restores the window from minimized state to its previous state.

    返回

    void

    继承自

    BaseWindow.restore

    定义于

    apis/api/base-window.d.ts:1248


    selectNextTab()
    macOS

    selectNextTab(): void

    Selects the next tab when native tabs are enabled and there are other tabs in the window.

    返回

    void

    继承自

    BaseWindow.selectNextTab

    定义于

    apis/api/base-window.d.ts:1309


    selectPreviousTab()
    macOS

    selectPreviousTab(): void

    Selects the previous tab when native tabs are enabled and there are other tabs in the window.

    返回

    void

    继承自

    BaseWindow.selectPreviousTab

    定义于

    apis/api/base-window.d.ts:1302


    sendGlobalEvent()

    sendGlobalEvent(eventName: string, ...args: any[]): boolean

    Send global event to the window. Lynx-side GlobalEventListener signature: (...args) => { }

    参数

    范围类型
    eventNamestring
    ...argsany[]

    返回

    boolean

    定义于

    apis/api/lynx-window.d.ts:404


    setAlwaysOnTop()

    setAlwaysOnTop(
       flag: boolean,
       level?:
      | "normal"
      | "floating"
      | "torn-off-menu"
      | "modal-panel"
      | "main-menu"
      | "status"
      | "pop-up-menu"
      | "screen-saver"
      | "dock",
       relativeLevel?: number): void

    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.

    参数

    范围类型
    flagboolean
    level?| "normal" | "floating" | "torn-off-menu" | "modal-panel" | "main-menu" | "status" | "pop-up-menu" | "screen-saver" | "dock"
    relativeLevel?number

    返回

    void

    继承自

    BaseWindow.setAlwaysOnTop

    定义于

    apis/api/base-window.d.ts:1254


    setAspectRatio()

    setAspectRatio(aspectRatio: number, extraSize?: Size): void

    This will make a window maintain an aspect ratio. The extra size allows a developer to have space, specified in pixels, not included within the aspect ratio calculations. This API already takes into account the difference between a window's size and its content size.

    Consider a normal window with an HD video player and associated controls. Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within the player itself we would call this function with arguments of 16/9 and { width: 40, height: 50 }. The second argument doesn't care where the extra width and height are within the content view--only that they exist. Sum any extra width and height areas you have within the overall content view.

    The aspect ratio is not respected when window is resized programmatically with APIs like win.setSize.

    To reset an aspect ratio, pass 0 as the aspectRatio value: win.setAspectRatio(0).

    参数

    范围类型
    aspectRationumber
    extraSize?Size

    返回

    void

    继承自

    BaseWindow.setAspectRatio

    定义于

    apis/api/base-window.d.ts:1289


    setAutoHideCursor()
    macOS

    setAutoHideCursor(autoHide: boolean): void

    Controls whether to hide cursor when typing.

    参数

    范围类型
    autoHideboolean

    返回

    void

    继承自

    BaseWindow.setAutoHideCursor

    定义于

    apis/api/base-window.d.ts:1295


    setAutoHideMenuBar()
    Windows

    setAutoHideMenuBar(hide: boolean): void

    Sets whether the window menu bar should hide itself automatically. Once set the menu bar will only show when users press the single Alt key.

    If the menu bar is already visible, calling setAutoHideMenuBar(true) won't hide it immediately.

    参数

    范围类型
    hideboolean

    返回

    void

    继承自

    BaseWindow.setAutoHideMenuBar

    定义于

    apis/api/base-window.d.ts:1319


    setBackgroundColor()

    setBackgroundColor(backgroundColor: string): void

    Examples of valid backgroundColor values:

    • Hex
      • #fff (shorthand RGB)
      • #ffff (shorthand ARGB)
      • #ffffff (RGB)
      • #ffffffff (ARGB)
    • RGB
      • rgb\(([^\d]+),\s*([^\d]+),\s*([^\d]+)\)
        • e.g. rgb(255, 255, 255)
    • RGBA
      • rgba\(([^\d]+),\s*([^\d]+),\s*([^\d]+),\s*([^\d.]+)\)
        • e.g. rgba(255, 255, 255, 1.0)
    • HSL
      • hsl\((-?[^\d.]+),\s*([^\d.]+)%,\s*([^\d.]+)%\)
        • e.g. hsl(200, 20%, 50%)
    • HSLA
      • hsla\((-?[^\d.]+),\s*([^\d.]+)%,\s*([^\d.]+)%,\s*([^\d.]+)\)
        • e.g. hsla(200, 20%, 50%, 0.5)
    • Color name
      • Options are listed in SkParseColor.cpp
      • Similar to CSS Color Module Level 3 keywords, but case-sensitive.
        • e.g. blueviolet or red

    Sets the background color of the window. See Setting backgroundColor.

    参数

    范围类型
    backgroundColorstring

    返回

    void

    继承自

    BaseWindow.setBackgroundColor

    定义于

    apis/api/base-window.d.ts:1347


    setBounds()

    setBounds(bounds: Partial<Rectangle>, animate?: boolean): 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 menu bar height. The menu bar height has changed over time and depends on the operating system, but is between 20-40px. Passing a value lower than the menu bar height will result in a window that is flush to the menu bar.

    参数

    范围类型
    boundsPartial<Rectangle>
    animate?boolean

    返回

    void

    继承自

    BaseWindow.setBounds

    定义于

    apis/api/base-window.d.ts:1357


    setClosable()

    setClosable(closable: boolean): void

    Sets whether the window can be manually closed by user.

    参数

    范围类型
    closableboolean

    返回

    void

    继承自

    BaseWindow.setClosable

    定义于

    apis/api/base-window.d.ts:1363


    setContentBounds()

    setContentBounds(bounds: Partial<Rectangle>, animate?: boolean): void

    Resizes and moves the content area to the supplied bounds.

    参数

    范围类型
    boundsPartial<Rectangle>
    animate?boolean

    返回

    void

    继承自

    BaseWindow.setContentBounds

    定义于

    apis/api/base-window.d.ts:1516


    setContentSize()

    setContentSize(
       width: number,
       height: number,
       animate?: boolean): void

    Sets the size of the content area.

    参数

    范围类型
    widthnumber
    heightnumber
    animate?boolean

    返回

    void

    继承自

    BaseWindow.setContentSize

    定义于

    apis/api/base-window.d.ts:1508


    setEnabled()

    setEnabled(enable: boolean): void

    Disable or enable the window.

    参数

    范围类型
    enableboolean

    返回

    void

    继承自

    BaseWindow.setEnabled

    定义于

    apis/api/base-window.d.ts:1367


    setFocusable()

    setFocusable(focusable: boolean): void

    Changes whether the window can be focused.

    On macOS it does not remove the focus from the window.

    参数

    范围类型
    focusableboolean

    返回

    void

    继承自

    BaseWindow.setFocusable

    定义于

    apis/api/base-window.d.ts:1375


    setFullScreen()

    setFullScreen(flag: boolean): void

    Sets whether the window should be in fullscreen mode.

    NOTE

    On macOS, fullscreen transitions take place asynchronously. If further actions depend on the fullscreen state, use the 'enter-full-screen' or > 'leave-full-screen' events.

    参数

    范围类型
    flagboolean

    返回

    void

    继承自

    BaseWindow.setFullScreen

    定义于

    apis/api/base-window.d.ts:1383


    setFullScreenable()

    setFullScreenable(fullscreenable: boolean): void

    Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.

    参数

    范围类型
    fullscreenableboolean

    返回

    void

    继承自

    BaseWindow.setFullScreenable

    定义于

    apis/api/base-window.d.ts:1388


    setGlobalProps()

    setGlobalProps(globalProps: Object): boolean

    Set global props for the Lynx view.

    This is the primary entry point for setting global props on the client side.

    When called before the first template load, updates are cached and applied after the view is created and the first load finishes.

    参数

    范围类型
    globalPropsObject

    返回

    boolean

    定义于

    apis/api/lynx-window.d.ts:398


    setHasShadow()

    setHasShadow(hasShadow: boolean): void

    Sets whether the window should have a shadow.

    参数

    范围类型
    hasShadowboolean

    返回

    void

    继承自

    BaseWindow.setHasShadow

    定义于

    apis/api/base-window.d.ts:1399


    setHiddenInMissionControl()

    setHiddenInMissionControl(hidden: boolean): void

    参数

    范围类型
    hiddenboolean

    返回

    void

    继承自

    BaseWindow.setHiddenInMissionControl

    定义于

    apis/api/base-window.d.ts:1389


    setMaximizable()

    setMaximizable(maximizable: boolean): void

    Sets whether the window can be manually maximized by user.

    参数

    范围类型
    maximizableboolean

    返回

    void

    继承自

    BaseWindow.setMaximizable

    定义于

    apis/api/base-window.d.ts:1412


    setMaximumSize()

    setMaximumSize(width: number, height: number): void

    Sets the maximum size of window to width and height.

    参数

    范围类型
    widthnumber
    heightnumber

    返回

    void

    继承自

    BaseWindow.setMaximumSize

    定义于

    apis/api/base-window.d.ts:1416


    setMinimizable()

    setMinimizable(minimizable: boolean): void

    Sets whether the window can be manually minimized by user.

    参数

    范围类型
    minimizableboolean

    返回

    void

    继承自

    BaseWindow.setMinimizable

    定义于

    apis/api/base-window.d.ts:1422


    setMinimumSize()

    setMinimumSize(width: number, height: number): void

    Sets the minimum size of window to width and height.

    参数

    范围类型
    widthnumber
    heightnumber

    返回

    void

    继承自

    BaseWindow.setMinimumSize

    定义于

    apis/api/base-window.d.ts:1426


    setMovable()

    setMovable(movable: boolean): void

    Sets whether the window can be moved by user.

    参数

    范围类型
    movableboolean

    返回

    void

    继承自

    BaseWindow.setMovable

    定义于

    apis/api/base-window.d.ts:1432


    setOpacity()

    setOpacity(opacity: number): void

    Sets the opacity of the window. Out of bound number values are clamped to the [0, 1] range.

    参数

    范围类型
    opacitynumber

    返回

    void

    继承自

    BaseWindow.setOpacity

    定义于

    apis/api/base-window.d.ts:1446


    setParentWindow()

    setParentWindow(parent: null | BaseWindow): void

    Sets parent as current window's parent window, passing null will turn current window into a top-level window.

    参数

    范围类型
    parentnull | BaseWindow

    返回

    void

    继承自

    BaseWindow.setParentWindow

    定义于

    apis/api/base-window.d.ts:1451


    setPosition()

    setPosition(
       x: number,
       y: number,
       animate?: boolean): void

    Moves window to x and y.

    参数

    范围类型
    xnumber
    ynumber
    animate?boolean

    返回

    void

    继承自

    BaseWindow.setPosition

    定义于

    apis/api/base-window.d.ts:1455


    setProgressBar()

    setProgressBar(progress: number, options?: object): void

    Sets progress value in progress bar. Valid range is [0, 1.0].

    Remove progress bar when progress < 0; Change to indeterminate mode when progress > 1.

    参数

    范围类型描述
    progressnumber-
    options?object-
    options.mode?| "normal" | "error" | "none" | "indeterminate" | "paused"Mode for the progress bar. Can be none, normal, indeterminate, error or paused. Default is normal. Platform win32,darwin

    返回

    void

    继承自

    BaseWindow.setProgressBar

    定义于

    apis/api/base-window.d.ts:1463


    setResizable()

    setResizable(resizable: boolean): void

    Sets whether the window can be manually resized by the user.

    参数

    范围类型
    resizableboolean

    返回

    void

    继承自

    BaseWindow.setResizable

    定义于

    apis/api/base-window.d.ts:1478


    setSheetOffset()
    macOS

    setSheetOffset(offsetY: number, offsetX?: number): void

    Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a custom client-rendered toolbar. For example:

    参数

    范围类型
    offsetYnumber
    offsetX?number

    返回

    void

    继承自

    BaseWindow.setSheetOffset

    定义于

    apis/api/base-window.d.ts:1486


    setSimpleFullScreen()
    macOS

    setSimpleFullScreen(flag: boolean): void

    Enters or leaves simple fullscreen mode.

    Simple fullscreen mode emulates the native fullscreen behavior found in versions of macOS prior to Lion (10.7).

    参数

    范围类型
    flagboolean

    返回

    void

    继承自

    BaseWindow.setSimpleFullScreen

    定义于

    apis/api/base-window.d.ts:1495


    setSize()

    setSize(
       width: number,
       height: number,
       animate?: boolean): void

    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.

    参数

    范围类型
    widthnumber
    heightnumber
    animate?boolean

    返回

    void

    继承自

    BaseWindow.setSize

    定义于

    apis/api/base-window.d.ts:1500


    setSkipTaskbar()

    setSkipTaskbar(skip: boolean): void

    Makes the window not show in the taskbar.

    参数

    范围类型
    skipboolean

    返回

    void

    继承自

    BaseWindow.setSkipTaskbar

    定义于

    apis/api/base-window.d.ts:1526


    setTitle()

    setTitle(title: string): void

    Changes the title of native window to title.

    参数

    范围类型
    titlestring

    返回

    void

    继承自

    BaseWindow.setTitle

    定义于

    apis/api/base-window.d.ts:1530


    setTrafficLightPosition()
    macOS

    setTrafficLightPosition(position: null | Point): void

    Set a custom position for the traffic light buttons in frameless window. Passing null will reset the position to default.

    参数

    范围类型
    positionnull | Point

    返回

    void

    继承自

    BaseWindow.setTrafficLightPosition

    定义于

    apis/api/base-window.d.ts:1585


    setVibrancy()
    macOS

    setVibrancy(type:
      | null
      | "header"
      | "titlebar"
      | "selection"
      | "menu"
      | "popover"
      | "sidebar"
      | "sheet"
      | "window"
      | "hud"
      | "fullscreen-ui"
      | "tooltip"
      | "content"
      | "under-window"
      | "under-page"): void

    Adds a vibrancy effect to the window. Passing null or an empty string will remove the vibrancy effect on the window.

    参数

    范围类型
    type| null | "header" | "titlebar" | "selection" | "menu" | "popover" | "sidebar" | "sheet" | "window" | "hud" | "fullscreen-ui" | "tooltip" | "content" | "under-window" | "under-page"

    返回

    void

    继承自

    BaseWindow.setVibrancy

    定义于

    apis/api/base-window.d.ts:1544


    setVisibleOnAllWorkspaces()
    macOS

    setVisibleOnAllWorkspaces(visible: boolean, options?: VisibleOnAllWorkspacesOptions): void

    Sets whether the window should be visible on all workspaces.

    NOTE

    This API does nothing on Windows. [!NOTE] On macOS, Lynxtron currently applies only the window-level collection behaviors (CanJoinAllSpaces and, if requested, FullScreenAuxiliary). It does not currently implement Electron's Dock / process-type transformation.

    参数

    范围类型
    visibleboolean
    options?VisibleOnAllWorkspacesOptions

    返回

    void

    继承自

    BaseWindow.setVisibleOnAllWorkspaces

    定义于

    apis/api/base-window.d.ts:1575


    setWindowButtonVisibility()
    macOS

    setWindowButtonVisibility(visible: boolean): void

    Sets whether the window traffic light buttons should be visible.

    参数

    范围类型
    visibleboolean

    返回

    void

    继承自

    BaseWindow.setWindowButtonVisibility

    定义于

    apis/api/base-window.d.ts:1591


    show()

    show(): void

    Shows and gives focus to the window.

    返回

    void

    继承自

    BaseWindow.show

    定义于

    apis/api/base-window.d.ts:1595


    showAllTabs()
    macOS

    showAllTabs(): void

    Shows or hides the tab overview when native tabs are enabled.

    返回

    void

    继承自

    BaseWindow.showAllTabs

    定义于

    apis/api/base-window.d.ts:1395


    showInactive()

    showInactive(): void

    Shows the window but doesn't focus on it.

    返回

    void

    继承自

    BaseWindow.showInactive

    定义于

    apis/api/base-window.d.ts:1599


    toggleTabBar()
    macOS

    toggleTabBar(): void

    Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window.

    返回

    void

    继承自

    BaseWindow.toggleTabBar

    定义于

    apis/api/base-window.d.ts:1537


    unhookAllWindowMessages()
    Windows

    unhookAllWindowMessages(): void

    Unhooks all of the window messages.

    返回

    void

    继承自

    BaseWindow.unhookAllWindowMessages

    定义于

    apis/api/base-window.d.ts:1605


    unhookWindowMessage()
    Windows

    unhookWindowMessage(message: number): void

    Unhook the window message.

    参数

    范围类型
    messagenumber

    返回

    void

    继承自

    BaseWindow.unhookWindowMessage

    定义于

    apis/api/base-window.d.ts:1611


    unmaximize()

    unmaximize(): void

    Unmaximizes the window.

    返回

    void

    继承自

    BaseWindow.unmaximize

    定义于

    apis/api/base-window.d.ts:1615


    updateMetaData()

    updateMetaData(meta: LynxUpdateMeta): boolean

    Updates the Lynx view with new template data.

    This is the primary entry point for triggering template data updates on the client side.

    • meta.updateData: Template data content used to update the page.
    • meta.globalProps: Global props content used to update the page.

    When called before the first template load, updates are cached and applied after the view is created and the first load finishes.

    参数

    范围类型
    metaLynxUpdateMeta

    返回

    boolean

    定义于

    apis/api/lynx-window.d.ts:390

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