UNPKG

@sinotron/core

Version:

Simple framework for Typescript Electron projects

60 lines (59 loc) 1.5 kB
import { BrowserWindow, OpenDevToolsOptions } from 'electron'; export declare class WinHelper { private readonly win; constructor(win: BrowserWindow); openDevTools(opts?: OpenDevToolsOptions): void; /** * Set the window width. * * @param width */ setWidth(width: number): this; /** * Set the window height. * * @param height */ setHeight(height: number): this; /** * Set the window size. * * @param width * @param height */ setSize(width: number, height: number): this; /** * Position the window in the center of the screen. */ centerWindow(): this; /** * Set the window size as percentage of screen * * @param widthPercent * @param heightPercent */ setSizePercent(widthPercent: number, heightPercent: number): this; /** * Set window width as percentage of screen * * @param widthPercent */ setWidthPercent(widthPercent: number): this; /** * Set window height as percentage of screen * @param heightPercent */ setHeightPercent(heightPercent: number): this; /** * Broadcast a channel message using webContents.send(...) * * @param channelName * @param args */ sendChannelMessage(channelName: string, ...args: any[]): void; } /** * Get typed property of the global window object. * @param prop */ export declare function _windowProp<T>(prop: string): T | undefined;