mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-06 16:20:26 +08:00
Merge pull request #8583 from rhysd/missing-webContents-APIs
github-electron: Added findInPage(), stopFindInPage() and insertText() for WebContents
This commit is contained in:
Vendored
+28
@@ -537,6 +537,14 @@ declare namespace Electron {
|
||||
height?: number;
|
||||
}
|
||||
|
||||
interface FindInPageOptions {
|
||||
forward?: boolean;
|
||||
findNext?: boolean;
|
||||
matchCase?: boolean;
|
||||
wordStart?: boolean;
|
||||
medialCapitalAsWordStart?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* A WebContents is responsible for rendering and controlling a web page.
|
||||
*/
|
||||
@@ -677,6 +685,26 @@ declare namespace Electron {
|
||||
* Executes Edit -> Replace Misspelling command in page.
|
||||
*/
|
||||
replaceMisspelling(text: string): void;
|
||||
/**
|
||||
* Inserts text to the focused element.
|
||||
*/
|
||||
insertText(text: string): void;
|
||||
/**
|
||||
* Starts a request to find all matches for the text in the web page and
|
||||
* returns an Integer representing the request id used for the request.
|
||||
* The result of the request can be obtained by subscribing to
|
||||
* found-in-page event.
|
||||
*/
|
||||
findInPage(text: string, options?: FindInPageOptions): void;
|
||||
/**
|
||||
* Stops any findInPage request for the webContents with the provided
|
||||
* action.
|
||||
* @param action Specifies the action to take place when ending webContents.findInPage request.
|
||||
* 'clearSelection' - Translate the selection into a normal selection.
|
||||
* 'keepSelection' - Clear the selection.
|
||||
* 'activateSelection' - Focus and click the selection node.
|
||||
*/
|
||||
stopFindInPage(action: 'clearSelection' | 'keepSelection' | 'activateSelection'): void;
|
||||
/**
|
||||
* Checks if any serviceworker is registered.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user