Skip to content

Commit 4e02b5b

Browse files
committed
docs: clean up README
1 parent 1d49735 commit 4e02b5b

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed

README.md

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33

44
# node-mac-permissions
55

6+
### Table of Contents
7+
8+
- [Overview](#overview)
9+
- [API](#api)
10+
- [`permissions.getAuthStatus(type)`](#permissionsgetauthstatustype)
11+
- [`permissions.askForContactsAccess()`](#permissionsaskforcontactsaccess)
12+
- [`permissions.askForCalendarAccess()`](#permissionsaskforcalendaraccess)
13+
- [`permissions.askForSpeechRecognitionAccess()`](#permissionsaskforspeechrecognitionaccess)
14+
- [`permissions.askForRemindersAccess()`](#permissionsaskforremindersaccess)
15+
- [`permissions.askForFoldersAccess(folder)`](#permissionsaskforfoldersaccessfolder)
16+
- [`permissions.askForFullDiskAccess()`](#permissionsaskforfulldiskaccess)
17+
- [`permissions.askForCameraAccess()`](#permissionsaskforcameraaccess)
18+
- [`permissions.askForInputMonitoringAccess()`](#permissionsaskforinputmonitoringaccess)
19+
- [`permissions.askForMicrophoneAccess()`](#permissionsaskformicrophoneaccess)
20+
- [`permissions.askForMusicLibraryAccess()`](#permissionsaskformusiclibraryaccess)
21+
- [`permissions.askForPhotosAccess()`](#permissionsaskforphotosaccess)
22+
- [`permissions.askForScreenCaptureAccess()`](#permissionsaskforscreencaptureaccess)
23+
- [`permissions.askForAccessibilityAccess()`](#permissionsaskforaccessibilityaccess)
24+
- [FAQ](#faq)
25+
26+
## Overview
27+
628
```js
729
$ npm i node-mac-permissions
830
```
@@ -32,7 +54,7 @@ If you're using macOS 12.3 or newer, you'll need to ensure you have Python insta
3254

3355
## API
3456

35-
## `permissions.getAuthStatus(type)`
57+
### `permissions.getAuthStatus(type)`
3658

3759
* `type` String - The type of system component to which you are requesting access. Can be one of `accessibility`, `bluetooth`, `calendar`, `camera`, `contacts`, `full-disk-access`, `input-monitoring`, `location`, `microphone`,`photos`, `reminders`, `screen`, or `speech-recognition`.
3860

@@ -81,7 +103,7 @@ for (const type of types) {
81103
}
82104
```
83105

84-
## `permissions.askForContactsAccess()`
106+
### `permissions.askForContactsAccess()`
85107

86108
Returns `Promise<String>` - Whether or not the request succeeded or failed; can be `authorized` or `denied`.
87109

@@ -103,7 +125,7 @@ askForContactsAccess().then(status => {
103125
})
104126
```
105127

106-
## `permissions.askForCalendarAccess()`
128+
### `permissions.askForCalendarAccess()`
107129

108130
Returns `Promise<String>` - Whether or not the request succeeded or failed; can be `authorized` or `denied`.
109131

@@ -116,7 +138,7 @@ askForCalendarAccess().then(status => {
116138
})
117139
```
118140

119-
## `permissions.askForSpeechRecognitionAccess()`
141+
### `permissions.askForSpeechRecognitionAccess()`
120142

121143
Returns `Promise<String>` - Whether or not the request succeeded or failed; can be `authorized` or `denied`.
122144

@@ -143,7 +165,7 @@ askForSpeechRecognitionAccess().then(status => {
143165

144166
**Note:** `status` will be resolved back as `authorized` prior to macOS 10.15, as the underlying API was not introduced until that version.
145167

146-
## `permissions.askForRemindersAccess()`
168+
### `permissions.askForRemindersAccess()`
147169

148170
Returns `Promise<String>` - Whether or not the request succeeded or failed; can be `authorized` or `denied`.
149171

@@ -156,7 +178,7 @@ askForRemindersAccess().then(status => {
156178
})
157179
```
158180

159-
## `permissions.askForFoldersAccess(folder)`
181+
### `permissions.askForFoldersAccess(folder)`
160182

161183
* `type` String - The folder to which you are requesting access. Can be one of `desktop`, `documents`, or `downloads`.
162184

@@ -187,7 +209,7 @@ askForFoldersAccess('desktop').then(status => {
187209
<string>Your reason for wanting to access the Downloads folder</string>
188210
```
189211

190-
## `permissions.askForFullDiskAccess()`
212+
### `permissions.askForFullDiskAccess()`
191213

192214
There is no API for programmatically requesting Full Disk Access on macOS at this time, and so calling this method will trigger opening of System Preferences at the Full Disk pane of Security and Privacy.
193215

@@ -199,7 +221,7 @@ const { askForFullDiskAccess } = require('node-mac-permissions')
199221
askForFullDiskAccess()
200222
```
201223

202-
## `permissions.askForCameraAccess()`
224+
### `permissions.askForCameraAccess()`
203225

204226
Returns `Promise<String>` - Current permission status; can be `authorized`, `denied`, or `restricted`.
205227

@@ -230,7 +252,7 @@ askForCameraAccess().then(status => {
230252
})
231253
```
232254

233-
## `permissions.askForInputMonitoringAccess()`
255+
### `permissions.askForInputMonitoringAccess()`
234256

235257
Returns `Promise<String>` - Current permission status; can be `authorized` or `denied`.
236258

@@ -252,7 +274,7 @@ askForInputMonitoringAccess().then(status => {
252274
})
253275
```
254276

255-
## `permissions.askForMicrophoneAccess()`
277+
### `permissions.askForMicrophoneAccess()`
256278

257279
Returns `Promise<String>` - Current permission status; can be `authorized`, `denied`, or `restricted`.
258280

@@ -283,7 +305,7 @@ askForMicrophoneAccess().then(status => {
283305
})
284306
```
285307

286-
## `permissions.askForMusicLibraryAccess()`
308+
### `permissions.askForMusicLibraryAccess()`
287309

288310
Returns `Promise<String>` - Whether or not the request succeeded or failed; can be `authorized` or `denied`.
289311

@@ -311,7 +333,7 @@ askForMusicLibraryAccess().then(status => {
311333
})
312334
```
313335

314-
## `permissions.askForPhotosAccess()`
336+
### `permissions.askForPhotosAccess()`
315337

316338
Returns `Promise<String>` - Current permission status; can be `authorized`, `denied`, or `restricted`.
317339

@@ -342,7 +364,7 @@ askForPhotosAccess().then(status => {
342364
})
343365
```
344366

345-
## `permissions.askForScreenCaptureAccess()`
367+
### `permissions.askForScreenCaptureAccess()`
346368

347369
There is no API for programmatically requesting Screen Capture on macOS at this time, and so calling this method will trigger opening of System Preferences at the Screen Capture pane of Security and Privacy.
348370

@@ -354,7 +376,7 @@ const { askForScreenCaptureAccess } = require('node-mac-permissions')
354376
askForScreenCaptureAccess()
355377
```
356378

357-
## `permissions.askForAccessibilityAccess()`
379+
### `permissions.askForAccessibilityAccess()`
358380

359381
There is no API for programmatically requesting Accessibility access on macOS at this time, and so calling this method will trigger opening of System Preferences at the Accessibility pane of Security and Privacy.
360382

0 commit comments

Comments
 (0)