From f72991cf3ac67c3ecebd7ab5b6c0fc8fb71832dd Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 6 Oct 2016 19:08:56 +0200 Subject: [PATCH] Update to Electron 1.4.3 --- electron/github-electron.d.ts | 43 ++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/electron/github-electron.d.ts b/electron/github-electron.d.ts index db11d88ea7..ca073ebf58 100644 --- a/electron/github-electron.d.ts +++ b/electron/github-electron.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Electron v1.4.2 +// Type definitions for Electron v1.4.3 // Project: http://electron.atom.io/ // Definitions by: jedmao , rhysd , Milan Burda // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -2655,6 +2655,28 @@ declare namespace Electron { * Returns a boolean whether the image is a template image. */ isTemplateImage(): boolean; + /** + * @param rect The area of the image to crop + * @returns The cropped image. + */ + crop(rect: Rectangle): NativeImage; + /** + * @returns The resized image. + * If only the height or the width are specified then the current aspect ratio will be preserved in the resized image. + */ + resize(options: { + width?: number; + height?: number; + /** + * The desired quality of the resized image. + * Default: best. + */ + quality?: 'good' | 'better' | 'best'; + }): NativeImage; + /** + * @returns The image's aspect ratio. + */ + getAspectRatio(): number; } // https://github.com/electron/electron/blob/master/docs/api/power-monitor.md @@ -3831,12 +3853,21 @@ declare namespace Electron { * By default a new BrowserWindow will be created for the url. * * Calling event.preventDefault() will prevent creating new windows. + * In such case, the event.newGuest may be set with a reference + * to a BrowserWindow instance to make it used by the Electron's runtime. */ - on(event: 'new-window', listener: (event: Event, + on(event: 'new-window', listener: (event: WebContents.NewWindowEvent, url: string, frameName: string, disposition: NewWindowDisposition, - options: BrowserWindowOptions + /** + * The options which will be used for creating the new BrowserWindow. + */ + options: BrowserWindowOptions, + /** + * The non-standard features (features not handled by Chromium or Electron) given to window.open(). + */ + additionalFeatures: string[] ) => void): this; /** * Emitted when a user or the page wants to start navigation. @@ -4324,6 +4355,12 @@ declare namespace Electron { debugger: Debugger; } + namespace WebContents { + interface NewWindowEvent extends Event { + newGuest?: BrowserWindow; + } + } + interface BeginFrameSubscriptionCallback { ( /**