forked from karaggeorge/mac-screen-capture-permissions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
54 lines (41 loc) · 1.42 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/// <reference lib="dom"/>
/// <reference types="electron"/>
/// <reference types="node"/>
import {openSystemPreferences as electronUtilOpenSystemPreferences} from 'electron-util';
/**
Check whether or not the current app has the required permissions to record the screen
@example
```
const hasPermissions = hasScreenCapturePermission(); // true
```
*/
export const hasScreenCapturePermission: () => boolean;
/**
Check whether or not the current app has already asked for permissions before.
Only works in Electron apps. Otherwise returns `false`.
@example
```
const hasAsked = hasPromptedForPermission(); // true
```
*/
export const hasPromptedForPermission: () => boolean;
/**
Resets ScreenCapture permissions for all applications.
Optionally pass in an object with `bundleId` to only reset permissions for that app
@example
```
resetPermissions({bundleId: 'com.googlecode.iterm2'}); // true
```
@returns A boolean that is true if the permissions were reset successfully and false otherwise
*/
export const resetPermissions: (options?: {bundleId?: string}) => boolean;
/**
Open the System Preferences in the Screen Recording permissions section under the Security pane.
Only available in Electron apps.
@example
```
openSystemPreferences().then(() => console.log('Opened'));
```
@returns A Promise that resolves when the window is open
*/
export const openSystemPreferences: () => ReturnType<typeof electronUtilOpenSystemPreferences>;