DefinitelyTyped/github-electron/github-electron.web-frame.d.ts
2016-03-26 01:56:55 +01:00

71 lines
2.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Type definitions for Electron v0.37.2
// Project: http://electron.atom.io/
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace Electron {
/**
* The web-frame module allows you to customize the rendering of the current web page.
*/
interface WebFrame {
/**
* Changes the zoom factor to the specified factor, zoom factor is
* zoom percent / 100, so 300% = 3.0.
*/
setZoomFactor(factor: number): void;
/**
* @returns The current zoom factor.
*/
getZoomFactor(): number;
/**
* Changes the zoom level to the specified level, 0 is "original size", and each
* increment above or below represents zooming 20% larger or smaller to default
* limits of 300% and 50% of original size, respectively.
*/
setZoomLevel(level: number): void;
/**
* @returns The current zoom level.
*/
getZoomLevel(): number;
/**
* Sets the maximum and minimum zoom level.
*/
setZoomLevelLimits(minimumLevel: number, maximumLevel: number): void;
/**
* Sets a provider for spell checking in input fields and text areas.
*/
setSpellCheckProvider(language: string, autoCorrectWord: boolean, provider: {
/**
* @returns Whether the word passed is correctly spelled.
*/
spellCheck: (text: string) => boolean;
}): void;
/**
* Sets the scheme as secure scheme. Secure schemes do not trigger mixed content
* warnings. For example, https and data are secure schemes because they cannot be
* corrupted by active network attackers.
*/
registerURLSchemeAsSecure(scheme: string): void;
/**
* Resources will be loaded from this scheme regardless of the current pages Content Security Policy.
*/
registerURLSchemeAsBypassingCSP(scheme: string): void;
/**
* Registers the scheme as secure, bypasses content security policy for resources,
* allows registering ServiceWorker and supports fetch API.
*/
registerURLSchemeAsPrivileged(scheme: string): void;
/**
* Inserts text to the focused element.
*/
insertText(text: string): void;
/**
* Evaluates `code` in page.
* In the browser window some HTML APIs like `requestFullScreen` can only be
* invoked by a gesture from the user. Setting `userGesture` to `true` will remove
* this limitation.
*/
executeJavaScript(code: string, userGesture?: boolean, callback?: (result: any) => void): void;
}
}