Skip to content

Commit 53b690a

Browse files
committed
docs: fix error callback info
1 parent 8f481d0 commit 53b690a

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

README.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ This native Node.js module allows you to manage an app's access to:
1111
* Calendar
1212
* Reminders
1313
* Photos
14+
* Camera
15+
* Microphone
1416

1517
## API
1618

@@ -35,7 +37,6 @@ Return Value Descriptions:
3537
## `permissions.askForContactsAccess(callback)`
3638

3739
* `callback` Function
38-
* `error` String | null - An error in performing the request, if one occurred.
3940
* `status` String - Whether or not the request succeeded or failed; can be 'authorized' or 'denied'.
4041

4142
Your app’s `Info.plist` file must provide a value for the `NSContactsUsageDescription` key that explains to the user why your app is requesting Contacts access.
@@ -51,40 +52,35 @@ Example:
5152
```js
5253
const { askForContactsAccess } = require('node-mac-permissions')
5354

54-
askForContactsAccess((err, status) => {
55-
if (err) throw new Error(err)
55+
askForContactsAccess((status) => {
5656
console.log(`Access to Contacts is ${status}`)
5757
})
5858
```
5959

6060
## `permissions.askForCalendarAccess(callback)`
6161

6262
* `callback` Function
63-
* `error` String | null - An error in performing the request, if one occurred.
6463
* `status` String - Whether or not the request succeeded or failed; can be 'authorized' or 'denied'.
6564

6665
Example:
6766
```js
6867
const { askForCalendarAccess } = require('node-mac-permissions')
6968

70-
askForCalendarAccess((err, status) => {
71-
if (err) throw new Error(err)
69+
askForCalendarAccess((status) => {
7270
console.log(`Access to Calendar is ${status}`)
7371
})
7472
```
7573

7674
## `permissions.askForRemindersAccess(callback)`
7775

7876
* `callback` Function
79-
* `error` String | null - An error in performing the request, if one occurred.
8077
* `status` String - Whether or not the request succeeded or failed; can be 'authorized' or 'denied'.
8178

8279
Example:
8380
```js
8481
const { askForRemindersAccess } = require('node-mac-permissions')
8582

86-
askForRemindersAccess((err, status) => {
87-
if (err) throw new Error(err)
83+
askForRemindersAccess((status) => {
8884
console.log(`Access to Reminders is ${status}`)
8985
})
9086
```
@@ -105,7 +101,6 @@ askForFullDiskAccess()
105101
* `type` String - The type of media to which you are requesting access. Can be 'microphone' or 'camera'.
106102

107103
* `callback` Function
108-
* `error` String | null - An error in performing the request, if one occurred.
109104
* `status` String - Whether or not the request succeeded or failed; can be 'authorized' or 'denied'.
110105

111106
Your app must provide an explanation for its use of capture devices using the `NSCameraUsageDescription` or `NSMicrophoneUsageDescription` `Info.plist` keys; Calling this method or attempting to start a capture session without a usage description raises an exception.
@@ -124,8 +119,7 @@ Example:
124119
const { askForMediaAccess } = require('node-mac-permissions')
125120

126121
for (const type of ['microphone', 'camera']) {
127-
askForMediaAccess(type, (err, status) => {
128-
if (err) throw new Error(err)
122+
askForMediaAccess(type, (status) => {
129123
console.log(`Access to media type ${type} is ${status}`)
130124
})
131125
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-mac-permissions",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "A native node module to manage system permissions on macOS",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)