|
1 | | -// Type definitions for Electron 4.2.5 |
| 1 | +// Type definitions for Electron 4.2.7 |
2 | 2 | // Project: http://electronjs.org/ |
3 | 3 | // Definitions by: The Electron Team <https://github.com/electron/electron> |
4 | 4 | // Definitions: https://github.com/electron/electron-typescript-definitions |
@@ -3479,14 +3479,14 @@ declare namespace Electron { |
3479 | 3479 | * Creates a new NativeImage instance from the NSImage that maps to the given image |
3480 | 3480 | * name. See NSImageName for a list of possible values. The hslShift is applied to |
3481 | 3481 | * the image with the following rules This means that [-1, 0, 1] will make the |
3482 | | - * image completely white and [-1, 1, 0] will make the image completely black. In |
3483 | | - * some cases, the NSImageName doesn't match its string representation; one example |
3484 | | - * of this is NSFolderImageName, whose string representation would actually be |
3485 | | - * NSFolder. Therefore, you'll need to determine the correct string representation |
3486 | | - * for your image before passing it in. This can be done with the following: echo |
3487 | | - * -e '#import <Cocoa/Cocoa.h>\nint main() { NSLog(@"%@", SYSTEM_IMAGE_NAME); }' | |
3488 | | - * clang -otest -x objective-c -framework Cocoa - && ./test where SYSTEM_IMAGE_NAME |
3489 | | - * should be replaced with any value from this list. |
| 3482 | + * image completely white and [-1, 1, 0] will make the image completely black. In |
| 3483 | + * some cases, the NSImageName doesn't match its string representation; one example |
| 3484 | + * of this is NSFolderImageName, whose string representation would actually be |
| 3485 | + * NSFolder. Therefore, you'll need to determine the correct string representation |
| 3486 | + * for your image before passing it in. This can be done with the following: echo |
| 3487 | + * -e '#import <Cocoa/Cocoa.h>\nint main() { NSLog(@"%@", SYSTEM_IMAGE_NAME); }' | |
| 3488 | + * clang -otest -x objective-c -framework Cocoa - && ./test where SYSTEM_IMAGE_NAME |
| 3489 | + * should be replaced with any value from this list. |
3490 | 3490 | */ |
3491 | 3491 | static createFromNamedImage(imageName: string, hslShift: number[]): NativeImage; |
3492 | 3492 | /** |
@@ -3737,6 +3737,17 @@ declare namespace Electron { |
3737 | 3737 | once(event: 'unlock-screen', listener: Function): this; |
3738 | 3738 | addListener(event: 'unlock-screen', listener: Function): this; |
3739 | 3739 | removeListener(event: 'unlock-screen', listener: Function): this; |
| 3740 | + /** |
| 3741 | + * Calculate the system idle state. idleThreshold is the amount of time (in |
| 3742 | + * seconds) before considered idle. callback will be called synchronously on some |
| 3743 | + * systems and with an idleState argument that describes the system's state. locked |
| 3744 | + * is available on supported systems only. |
| 3745 | + */ |
| 3746 | + querySystemIdleState(idleThreshold: number, callback: (idleState: 'active' | 'idle' | 'locked' | 'unknown') => void): void; |
| 3747 | + /** |
| 3748 | + * Calculate system idle time in seconds. |
| 3749 | + */ |
| 3750 | + querySystemIdleTime(callback: (idleTime: number) => void): void; |
3740 | 3751 | } |
3741 | 3752 |
|
3742 | 3753 | interface PowerSaveBlocker extends EventEmitter { |
@@ -4418,30 +4429,6 @@ declare namespace Electron { |
4418 | 4429 | * The new RGBA color the user assigned to be their system accent color. |
4419 | 4430 | */ |
4420 | 4431 | newColor: string) => void): this; |
4421 | | - /** |
4422 | | - * NOTE: This event is only emitted after you have called |
4423 | | - * startAppLevelAppearanceTrackingOS |
4424 | | - */ |
4425 | | - on(event: 'appearance-changed', listener: ( |
4426 | | - /** |
4427 | | - * Can be `dark` or `light` |
4428 | | - */ |
4429 | | - newAppearance: ('dark' | 'light')) => void): this; |
4430 | | - once(event: 'appearance-changed', listener: ( |
4431 | | - /** |
4432 | | - * Can be `dark` or `light` |
4433 | | - */ |
4434 | | - newAppearance: ('dark' | 'light')) => void): this; |
4435 | | - addListener(event: 'appearance-changed', listener: ( |
4436 | | - /** |
4437 | | - * Can be `dark` or `light` |
4438 | | - */ |
4439 | | - newAppearance: ('dark' | 'light')) => void): this; |
4440 | | - removeListener(event: 'appearance-changed', listener: ( |
4441 | | - /** |
4442 | | - * Can be `dark` or `light` |
4443 | | - */ |
4444 | | - newAppearance: ('dark' | 'light')) => void): this; |
4445 | 4432 | on(event: 'color-changed', listener: (event: Event) => void): this; |
4446 | 4433 | once(event: 'color-changed', listener: (event: Event) => void): this; |
4447 | 4434 | addListener(event: 'color-changed', listener: (event: Event) => void): this; |
@@ -8789,17 +8776,33 @@ declare namespace Electron { |
8789 | 8776 | * The type of media access being requested, can be video, audio or unknown |
8790 | 8777 | */ |
8791 | 8778 | mediaType: ('video' | 'audio' | 'unknown'); |
| 8779 | + /** |
| 8780 | + * The last URL the requesting frame loaded |
| 8781 | + */ |
| 8782 | + requestingUrl: string; |
| 8783 | + /** |
| 8784 | + * Whether the frame making the request is the main frame |
| 8785 | + */ |
| 8786 | + isMainFrame: boolean; |
8792 | 8787 | } |
8793 | 8788 |
|
8794 | 8789 | interface PermissionRequestHandlerDetails { |
8795 | 8790 | /** |
8796 | 8791 | * The url of the openExternal request. |
8797 | 8792 | */ |
8798 | | - externalURL: string; |
| 8793 | + externalURL?: string; |
8799 | 8794 | /** |
8800 | 8795 | * The types of media access being requested, elements can be video or audio |
8801 | 8796 | */ |
8802 | | - mediaTypes: Array<'video' | 'audio'>; |
| 8797 | + mediaTypes?: Array<'video' | 'audio'>; |
| 8798 | + /** |
| 8799 | + * The last URL the requesting frame loaded |
| 8800 | + */ |
| 8801 | + requestingUrl: string; |
| 8802 | + /** |
| 8803 | + * Whether the frame making the request is the main frame |
| 8804 | + */ |
| 8805 | + isMainFrame: boolean; |
8803 | 8806 | } |
8804 | 8807 |
|
8805 | 8808 | interface PluginCrashedEvent extends Event { |
|
0 commit comments