Skip to content

Commit 8126bde

Browse files
authored
chore: adds typedefs (#15)
1 parent e6faaa7 commit 8126bde

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

index.d.ts

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Type definitions for node-mac-permissions
2+
// Project: node-mac-permissions
3+
4+
export function askForCalendarAccess(): Promise<'authorized' | 'denied'>
5+
export function askForContactsAccess(): Promise<'authorized' | 'denied'>
6+
export function askForFullDiskAccess(): undefined
7+
export function askForRemindersAccess(): Promise<'authorized' | 'denied'>
8+
export function askForCameraAccess(): Promise<'authorized' | 'denied' | 'restricted'>
9+
export function askForMicrophoneAccess(): Promise<'authorized' | 'denied' | 'restricted'>
10+
export function askForPhotosAccess(): Promise<'authorized' | 'denied' | 'restricted'>
11+
export function askForSpeechRecognitionAccess(): Promise<'authorized' | 'denied'>
12+
export function askForScreenCaptureAccess(): undefined
13+
export function askForAccessibilityAccess(): undefined
14+
export function getAuthStatus(authType: AuthType): PermissionType
15+
16+
export type AuthType =
17+
| 'contacts'
18+
| 'calendar'
19+
| 'reminders'
20+
| 'full-disk-access'
21+
| 'camera'
22+
| 'photos'
23+
| 'speech-recognition'
24+
| 'microphone'
25+
| 'accessibility'
26+
| 'location'
27+
| 'screen'
28+
29+
export type PermissionType = 'not determined' | 'denied' | 'authorized' | 'restricted'

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.1.3",
44
"description": "A native node module to manage system permissions on macOS",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"build": "node-gyp rebuild",
89
"clean": "node-gyp clean",

0 commit comments

Comments
 (0)