@nonstrict/recordkit 0.51.1 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/README.md +1 -1
- package/bin/recordkit-rpc +0 -0
- package/out/RecordKit.d.ts +174 -1
- package/out/RecordKit.js +108 -2
- package/out/RecordKit.js.map +1 -1
- package/out/Recorder.d.ts +92 -2
- package/out/Recorder.js +93 -0
- package/out/Recorder.js.map +1 -1
- package/out/WebAudioUtils.d.ts +31 -0
- package/out/WebAudioUtils.js +95 -0
- package/out/WebAudioUtils.js.map +1 -0
- package/out/browser.d.ts +2 -0
- package/out/browser.js +4 -0
- package/out/browser.js.map +1 -0
- package/out/index.cjs +201 -2
- package/out/index.cjs.map +1 -1
- package/package.json +6 -3
- package/src/RecordKit.ts +214 -2
- package/src/Recorder.ts +196 -1
- package/src/WebAudioUtils.ts +108 -0
- package/src/browser.ts +7 -0
- package/tsconfig.json +2 -1
package/bin/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# recordkit-rpc 0.
|
|
1
|
+
# recordkit-rpc 0.53.0
|
package/bin/recordkit-rpc
CHANGED
|
Binary file
|
package/out/RecordKit.d.ts
CHANGED
|
@@ -63,53 +63,149 @@ export declare class RecordKit extends EventEmitter {
|
|
|
63
63
|
logLevel?: LogLevel;
|
|
64
64
|
}): Promise<void>;
|
|
65
65
|
/**
|
|
66
|
+
* A list of Mac displays that can be used for screen recording.
|
|
67
|
+
*
|
|
66
68
|
* @group Discovery
|
|
67
69
|
*/
|
|
68
70
|
getDisplays(): Promise<Display[]>;
|
|
69
71
|
/**
|
|
72
|
+
* A list of macOS windows that can be used for screen recording.
|
|
73
|
+
*
|
|
70
74
|
* @group Discovery
|
|
71
75
|
*/
|
|
72
76
|
getWindows(): Promise<Window[]>;
|
|
73
77
|
/**
|
|
78
|
+
* A list of cameras that are connected to the system.
|
|
79
|
+
*
|
|
80
|
+
* @param params.includeDeskView - Whether to include Desk View cameras in the results
|
|
74
81
|
* @group Discovery
|
|
75
82
|
*/
|
|
76
|
-
getCameras(
|
|
83
|
+
getCameras(params?: {
|
|
84
|
+
includeDeskView?: boolean;
|
|
85
|
+
}): Promise<Camera[]>;
|
|
77
86
|
/**
|
|
87
|
+
* A list of microphones that are connected to the system.
|
|
88
|
+
*
|
|
78
89
|
* @group Discovery
|
|
79
90
|
*/
|
|
80
91
|
getMicrophones(): Promise<Microphone[]>;
|
|
81
92
|
/**
|
|
93
|
+
* A list of iOS devices that are connected to the system.
|
|
94
|
+
*
|
|
82
95
|
* @group Discovery
|
|
83
96
|
*/
|
|
84
97
|
getAppleDevices(): Promise<AppleDevice[]>;
|
|
85
98
|
/**
|
|
99
|
+
* A list of currently running applications that can be used for screen or audio recording.
|
|
100
|
+
*
|
|
86
101
|
* @group Discovery
|
|
87
102
|
*/
|
|
88
103
|
getRunningApplications(): Promise<RunningApplication[]>;
|
|
89
104
|
/**
|
|
105
|
+
* Indicates if camera can be used.
|
|
106
|
+
*
|
|
107
|
+
* Authorization status that indicates whether the user grants the app permission to capture video.
|
|
108
|
+
*
|
|
90
109
|
* @group Permissions
|
|
91
110
|
*/
|
|
92
111
|
getCameraAuthorizationStatus(): Promise<AuthorizationStatus>;
|
|
93
112
|
/**
|
|
113
|
+
* Indicates if microphone can be used.
|
|
114
|
+
*
|
|
115
|
+
* Authorization status that indicates whether the user grants the app permission to capture audio.
|
|
116
|
+
*
|
|
94
117
|
* @group Permissions
|
|
95
118
|
*/
|
|
96
119
|
getMicrophoneAuthorizationStatus(): Promise<AuthorizationStatus>;
|
|
97
120
|
/**
|
|
121
|
+
* Indicates if screen can be recorded.
|
|
122
|
+
*
|
|
98
123
|
* @group Permissions
|
|
99
124
|
*/
|
|
100
125
|
getScreenRecordingAccess(): Promise<boolean>;
|
|
101
126
|
/**
|
|
127
|
+
* Indicates if system audio can be recorded.
|
|
128
|
+
*
|
|
129
|
+
* @group Permissions
|
|
130
|
+
*/
|
|
131
|
+
getSystemAudioRecordingAccess(): Promise<boolean>;
|
|
132
|
+
/**
|
|
133
|
+
* Indicates if keystroke events of other apps can be recorded via Input Monitoring.
|
|
134
|
+
*
|
|
135
|
+
* @group Permissions
|
|
136
|
+
*/
|
|
137
|
+
getInputMonitoringAccess(): Promise<boolean>;
|
|
138
|
+
/**
|
|
139
|
+
* Indicates if other apps can be controlled via Accessibility.
|
|
140
|
+
*
|
|
141
|
+
* @group Permissions
|
|
142
|
+
*/
|
|
143
|
+
getAccessibilityControlAccess(): Promise<boolean>;
|
|
144
|
+
/**
|
|
145
|
+
* Requests the user's permission to allow the app to capture the camera.
|
|
146
|
+
*
|
|
147
|
+
* Prompts the users if this is the first time requesting access, otherwise immediately returns.
|
|
148
|
+
*
|
|
149
|
+
* @returns Boolean value that indicates whether the user granted or denied access to your app.
|
|
102
150
|
* @group Permissions
|
|
103
151
|
*/
|
|
104
152
|
requestCameraAccess(): Promise<boolean>;
|
|
105
153
|
/**
|
|
154
|
+
* Requests the user's permission to allow the app to capture the microphone.
|
|
155
|
+
*
|
|
156
|
+
* Prompts the users if this is the first time requesting access, otherwise immediately returns.
|
|
157
|
+
*
|
|
158
|
+
* @returns Boolean value that indicates whether the user granted or denied access to your app.
|
|
106
159
|
* @group Permissions
|
|
107
160
|
*/
|
|
108
161
|
requestMicrophoneAccess(): Promise<boolean>;
|
|
109
162
|
/**
|
|
163
|
+
* Requests the user's permission to allow the app to capture the screen.
|
|
164
|
+
*
|
|
165
|
+
* If this is the first time requesting access, this shows dialog that lets th users open System Settings.
|
|
166
|
+
* In System Settings, the user can allow the app permission to do screen recording.
|
|
167
|
+
*
|
|
168
|
+
* Afterwards, the users needs to restart this app, for the permission to become active in the app.
|
|
169
|
+
*
|
|
110
170
|
* @group Permissions
|
|
111
171
|
*/
|
|
112
172
|
requestScreenRecordingAccess(): Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* Requests the user's permission to allow the app to capture system audio.
|
|
175
|
+
*
|
|
176
|
+
* If this is the first time requesting access, this shows dialog that lets th users open System Settings.
|
|
177
|
+
* In System Settings, the user can allow the app permission to do screen recording.
|
|
178
|
+
*
|
|
179
|
+
* Afterwards, the users needs to restart this app, for the permission to become active in the app.
|
|
180
|
+
*
|
|
181
|
+
* @remarks Currently, system audio recording is currently implemented using ScreenCaptureKit,
|
|
182
|
+
* which means the users needs to grant screen recording access.
|
|
183
|
+
*
|
|
184
|
+
* @group Permissions
|
|
185
|
+
*/
|
|
186
|
+
requestSystemAudioRecordingAccess(): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Requests the users's permission to monitor keystrokes of other apps via Input Monitoring.
|
|
189
|
+
*
|
|
190
|
+
* If this is the first time requesting access, this shows dialog that lets th users open System Settings.
|
|
191
|
+
* In System Settings, the user can allow the app permission to monitor other apps.
|
|
192
|
+
*
|
|
193
|
+
* Afterwards, the users needs to restart this app, for the permission to become active in the app.
|
|
194
|
+
*
|
|
195
|
+
* @group Permissions
|
|
196
|
+
*/
|
|
197
|
+
requestInputMonitoringAccess(): Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* Requests the users's permission to control other apps via Accessibility permissions.
|
|
200
|
+
*
|
|
201
|
+
* If this is the first time requesting access, this shows dialog that lets th users open System Settings.
|
|
202
|
+
* In System Settings, the user can allow the app permission to control apps.
|
|
203
|
+
*
|
|
204
|
+
* Afterwards, the users needs to restart this app, for the permission to become active in the app.
|
|
205
|
+
*
|
|
206
|
+
* @group Permissions
|
|
207
|
+
*/
|
|
208
|
+
requestAccessibilityControlAccess(): Promise<void>;
|
|
113
209
|
createRecorder(schema: {
|
|
114
210
|
output_directory?: string;
|
|
115
211
|
items: RecorderSchemaItem[];
|
|
@@ -133,31 +229,70 @@ export declare let recordkit: RecordKit;
|
|
|
133
229
|
*/
|
|
134
230
|
export type AuthorizationStatus = 'notDetermined' | 'restricted' | 'denied' | 'authorized';
|
|
135
231
|
/**
|
|
232
|
+
* An external iOS device that can be used for screen recording.
|
|
233
|
+
*
|
|
136
234
|
* @group Discovery
|
|
137
235
|
*/
|
|
138
236
|
export interface AppleDevice {
|
|
237
|
+
/** An identifier that uniquely identifies the device. */
|
|
139
238
|
id: string;
|
|
239
|
+
/** A localized device name for display in the user interface. */
|
|
140
240
|
name: string;
|
|
241
|
+
/** The model of this device. */
|
|
141
242
|
model_id?: string;
|
|
243
|
+
/**
|
|
244
|
+
* The current availability state of this device.
|
|
245
|
+
*
|
|
246
|
+
* - `available`: Device can be recorded
|
|
247
|
+
* - `notPaired`: Device cannot be recorded because it is connected but not paired (recovery: "Tap 'Trust' on iPhone")
|
|
248
|
+
* - `notConnected`: Device cannot be recorded because it is currently not connected (recovery: "Connect via cable")
|
|
249
|
+
* - `pairedNeedsConnect`: Device cannot be recorded because it is paired but currently not connected (recovery: "(Re-)connect via cable")
|
|
250
|
+
* - `pairedNeedsReconnect`: Device cannot be recorded because it needs to be reconnected (recovery: "Unplug cable, and reconnect again")
|
|
251
|
+
*/
|
|
142
252
|
availability: 'available' | 'notPaired' | 'notConnected' | 'pairedNeedsConnect' | 'pairedNeedsReconnect';
|
|
143
253
|
}
|
|
144
254
|
/**
|
|
255
|
+
* A running macOS application of which windows or audio can be recorded.
|
|
256
|
+
*
|
|
145
257
|
* @group Discovery
|
|
146
258
|
*/
|
|
147
259
|
export interface RunningApplication {
|
|
260
|
+
/** Identifier for this application (process id). */
|
|
148
261
|
id: number;
|
|
262
|
+
/** Display name of the application. */
|
|
149
263
|
name?: string;
|
|
264
|
+
/** Bundle identifier of the application (e.g., "com.apple.Safari"). */
|
|
150
265
|
bundle_identifier?: string;
|
|
266
|
+
/**
|
|
267
|
+
* The current availability state of this application.
|
|
268
|
+
*
|
|
269
|
+
* - `available`: Application can be recorded
|
|
270
|
+
* - `notRunning`: Application cannot be recorded because it is not (or no longer) running
|
|
271
|
+
*/
|
|
151
272
|
availability: 'available' | 'notRunning';
|
|
152
273
|
}
|
|
153
274
|
/**
|
|
275
|
+
* A camera whose video can be recorded.
|
|
276
|
+
*
|
|
154
277
|
* @group Discovery
|
|
155
278
|
*/
|
|
156
279
|
export interface Camera {
|
|
280
|
+
/** An identifier that uniquely identifies the camera. */
|
|
157
281
|
id: string;
|
|
282
|
+
/** A localized camera name for display in the user interface. */
|
|
158
283
|
name: string;
|
|
284
|
+
/** The model ID of this camera. */
|
|
159
285
|
model_id: string;
|
|
286
|
+
/** The manufacturer of this camera. */
|
|
160
287
|
manufacturer: string;
|
|
288
|
+
/**
|
|
289
|
+
* The current availability state of this camera.
|
|
290
|
+
*
|
|
291
|
+
* - `available`: Camera can be recorded
|
|
292
|
+
* - `lidClosed`: Camera cannot be recorded because the MacBook lid is closed (recovery: "Open MacBook lid")
|
|
293
|
+
* - `unknownSuspended`: Camera cannot be recorded because it is suspended for some unknown reason (recovery: "Unsuspend camera")
|
|
294
|
+
* - `notConnected`: Camera cannot be recorded because it is currently not connected (recovery: "Connect camera")
|
|
295
|
+
*/
|
|
161
296
|
availability: 'available' | 'lidClosed' | 'unknownSuspended' | 'notConnected';
|
|
162
297
|
/**
|
|
163
298
|
* This URL can be used in a `img` tag to display a live preview of the camera feed in your user interface.
|
|
@@ -168,33 +303,71 @@ export interface Camera {
|
|
|
168
303
|
preview_url?: string;
|
|
169
304
|
}
|
|
170
305
|
/**
|
|
306
|
+
* A microphone whose audio can be recorded.
|
|
307
|
+
*
|
|
171
308
|
* @group Discovery
|
|
172
309
|
*/
|
|
173
310
|
export interface Microphone {
|
|
311
|
+
/** An identifier that uniquely identifies the microphone. */
|
|
174
312
|
id: string;
|
|
313
|
+
/** A localized microphone name for display in the user interface. */
|
|
175
314
|
name: string;
|
|
315
|
+
/** The model ID of this microphone. */
|
|
176
316
|
model_id: string;
|
|
317
|
+
/** The manufacturer of this microphone. */
|
|
177
318
|
manufacturer: string;
|
|
319
|
+
/**
|
|
320
|
+
* The current availability state of this microphone.
|
|
321
|
+
*
|
|
322
|
+
* - `available`: Microphone can be recorded
|
|
323
|
+
* - `lidClosed`: Microphone cannot be recorded because the MacBook lid is closed (recovery: "Open MacBook lid")
|
|
324
|
+
* - `unknownSuspended`: Microphone cannot be recorded because it is suspended for some unknown reason (recovery: "Unsuspend microphone")
|
|
325
|
+
* - `notConnected`: Microphone cannot be recorded because it is currently not connected (recovery: "Connect microphone")
|
|
326
|
+
*/
|
|
178
327
|
availability: 'available' | 'lidClosed' | 'unknownSuspended' | 'notConnected';
|
|
179
328
|
}
|
|
180
329
|
/**
|
|
330
|
+
* A Mac display that can be used for screen recording.
|
|
331
|
+
*
|
|
181
332
|
* @group Discovery
|
|
182
333
|
*/
|
|
183
334
|
export interface Display {
|
|
335
|
+
/** An identifier that uniquely identifies this Mac display (CGDirectDisplayID). */
|
|
184
336
|
id: number;
|
|
337
|
+
/** Name of this display. */
|
|
185
338
|
localizedName?: string;
|
|
339
|
+
/** Frame of the display, relative to the main display. Uses top-left coordinate space. */
|
|
186
340
|
frame: Bounds;
|
|
341
|
+
/** Indicates if this is the main display. */
|
|
187
342
|
isMain: boolean;
|
|
343
|
+
/**
|
|
344
|
+
* The current availability state of this display.
|
|
345
|
+
*
|
|
346
|
+
* - `available`: A display can be recorded
|
|
347
|
+
* - `lidClosed`: A display cannot be recorded, because the MacBook lid is closed (recovery: "Open MacBook lid")
|
|
348
|
+
* - `notConnected`: A display cannot be screen recorded, because it is currently not connected (recovery: "Connect display")
|
|
349
|
+
*/
|
|
350
|
+
availability: 'available' | 'lidClosed' | 'notConnected';
|
|
188
351
|
}
|
|
189
352
|
/**
|
|
353
|
+
* A macOS window that can be used for screen recording.
|
|
354
|
+
*
|
|
190
355
|
* @group Discovery
|
|
191
356
|
*/
|
|
192
357
|
export interface Window {
|
|
358
|
+
/** An identifier that uniquely identifies this macOS window (CGWindowID). */
|
|
193
359
|
id: number;
|
|
360
|
+
/** Title of the window. */
|
|
194
361
|
title?: string;
|
|
362
|
+
/** Frame of the window, relative to the main display. Uses top-left coordinate space. */
|
|
195
363
|
frame: Bounds;
|
|
364
|
+
/**
|
|
365
|
+
* The level of the window relative to other windows.
|
|
366
|
+
*/
|
|
196
367
|
level: number;
|
|
368
|
+
/** Process ID of the application that owns this window. */
|
|
197
369
|
application_process_id?: number;
|
|
370
|
+
/** Name of the application that owns this window. */
|
|
198
371
|
application_name?: string;
|
|
199
372
|
}
|
|
200
373
|
/**
|
package/out/RecordKit.js
CHANGED
|
@@ -70,77 +70,183 @@ export class RecordKit extends EventEmitter {
|
|
|
70
70
|
await this.ipcRecordKit.nsrpc.perform({ type: 'Logger', action: 'setLogLevel', params });
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
+
* A list of Mac displays that can be used for screen recording.
|
|
74
|
+
*
|
|
73
75
|
* @group Discovery
|
|
74
76
|
*/
|
|
75
77
|
async getDisplays() {
|
|
76
78
|
return await this.ipcRecordKit.nsrpc.perform({ type: 'Recorder', action: 'getDisplays' });
|
|
77
79
|
}
|
|
78
80
|
/**
|
|
81
|
+
* A list of macOS windows that can be used for screen recording.
|
|
82
|
+
*
|
|
79
83
|
* @group Discovery
|
|
80
84
|
*/
|
|
81
85
|
async getWindows() {
|
|
82
86
|
return await this.ipcRecordKit.nsrpc.perform({ type: 'Recorder', action: 'getWindows' });
|
|
83
87
|
}
|
|
84
88
|
/**
|
|
89
|
+
* A list of cameras that are connected to the system.
|
|
90
|
+
*
|
|
91
|
+
* @param params.includeDeskView - Whether to include Desk View cameras in the results
|
|
85
92
|
* @group Discovery
|
|
86
93
|
*/
|
|
87
|
-
async getCameras() {
|
|
88
|
-
return await this.ipcRecordKit.nsrpc.perform({ type: 'Recorder', action: 'getCameras' });
|
|
94
|
+
async getCameras(params) {
|
|
95
|
+
return await this.ipcRecordKit.nsrpc.perform({ type: 'Recorder', action: 'getCameras', params: { includeDeskView: params?.includeDeskView ?? false } });
|
|
89
96
|
}
|
|
90
97
|
/**
|
|
98
|
+
* A list of microphones that are connected to the system.
|
|
99
|
+
*
|
|
91
100
|
* @group Discovery
|
|
92
101
|
*/
|
|
93
102
|
async getMicrophones() {
|
|
94
103
|
return await this.ipcRecordKit.nsrpc.perform({ type: 'Recorder', action: 'getMicrophones' });
|
|
95
104
|
}
|
|
96
105
|
/**
|
|
106
|
+
* A list of iOS devices that are connected to the system.
|
|
107
|
+
*
|
|
97
108
|
* @group Discovery
|
|
98
109
|
*/
|
|
99
110
|
async getAppleDevices() {
|
|
100
111
|
return await this.ipcRecordKit.nsrpc.perform({ type: 'Recorder', action: 'getAppleDevices' });
|
|
101
112
|
}
|
|
102
113
|
/**
|
|
114
|
+
* A list of currently running applications that can be used for screen or audio recording.
|
|
115
|
+
*
|
|
103
116
|
* @group Discovery
|
|
104
117
|
*/
|
|
105
118
|
async getRunningApplications() {
|
|
106
119
|
return await this.ipcRecordKit.nsrpc.perform({ type: 'Recorder', action: 'getRunningApplications' });
|
|
107
120
|
}
|
|
108
121
|
/**
|
|
122
|
+
* Indicates if camera can be used.
|
|
123
|
+
*
|
|
124
|
+
* Authorization status that indicates whether the user grants the app permission to capture video.
|
|
125
|
+
*
|
|
109
126
|
* @group Permissions
|
|
110
127
|
*/
|
|
111
128
|
async getCameraAuthorizationStatus() {
|
|
112
129
|
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'getCameraAuthorizationStatus' });
|
|
113
130
|
}
|
|
114
131
|
/**
|
|
132
|
+
* Indicates if microphone can be used.
|
|
133
|
+
*
|
|
134
|
+
* Authorization status that indicates whether the user grants the app permission to capture audio.
|
|
135
|
+
*
|
|
115
136
|
* @group Permissions
|
|
116
137
|
*/
|
|
117
138
|
async getMicrophoneAuthorizationStatus() {
|
|
118
139
|
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'getMicrophoneAuthorizationStatus' });
|
|
119
140
|
}
|
|
120
141
|
/**
|
|
142
|
+
* Indicates if screen can be recorded.
|
|
143
|
+
*
|
|
121
144
|
* @group Permissions
|
|
122
145
|
*/
|
|
123
146
|
async getScreenRecordingAccess() {
|
|
124
147
|
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'getScreenRecordingAccess' });
|
|
125
148
|
}
|
|
126
149
|
/**
|
|
150
|
+
* Indicates if system audio can be recorded.
|
|
151
|
+
*
|
|
152
|
+
* @group Permissions
|
|
153
|
+
*/
|
|
154
|
+
async getSystemAudioRecordingAccess() {
|
|
155
|
+
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'getSystemAudioRecordingAccess' });
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Indicates if keystroke events of other apps can be recorded via Input Monitoring.
|
|
159
|
+
*
|
|
160
|
+
* @group Permissions
|
|
161
|
+
*/
|
|
162
|
+
async getInputMonitoringAccess() {
|
|
163
|
+
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'getInputMonitoringAccess' });
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Indicates if other apps can be controlled via Accessibility.
|
|
167
|
+
*
|
|
168
|
+
* @group Permissions
|
|
169
|
+
*/
|
|
170
|
+
async getAccessibilityControlAccess() {
|
|
171
|
+
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'getAccessibilityControlAccess' });
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Requests the user's permission to allow the app to capture the camera.
|
|
175
|
+
*
|
|
176
|
+
* Prompts the users if this is the first time requesting access, otherwise immediately returns.
|
|
177
|
+
*
|
|
178
|
+
* @returns Boolean value that indicates whether the user granted or denied access to your app.
|
|
127
179
|
* @group Permissions
|
|
128
180
|
*/
|
|
129
181
|
async requestCameraAccess() {
|
|
130
182
|
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'requestCameraAccess' });
|
|
131
183
|
}
|
|
132
184
|
/**
|
|
185
|
+
* Requests the user's permission to allow the app to capture the microphone.
|
|
186
|
+
*
|
|
187
|
+
* Prompts the users if this is the first time requesting access, otherwise immediately returns.
|
|
188
|
+
*
|
|
189
|
+
* @returns Boolean value that indicates whether the user granted or denied access to your app.
|
|
133
190
|
* @group Permissions
|
|
134
191
|
*/
|
|
135
192
|
async requestMicrophoneAccess() {
|
|
136
193
|
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'requestMicrophoneAccess' });
|
|
137
194
|
}
|
|
138
195
|
/**
|
|
196
|
+
* Requests the user's permission to allow the app to capture the screen.
|
|
197
|
+
*
|
|
198
|
+
* If this is the first time requesting access, this shows dialog that lets th users open System Settings.
|
|
199
|
+
* In System Settings, the user can allow the app permission to do screen recording.
|
|
200
|
+
*
|
|
201
|
+
* Afterwards, the users needs to restart this app, for the permission to become active in the app.
|
|
202
|
+
*
|
|
139
203
|
* @group Permissions
|
|
140
204
|
*/
|
|
141
205
|
async requestScreenRecordingAccess() {
|
|
142
206
|
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'requestScreenRecordingAccess' });
|
|
143
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* Requests the user's permission to allow the app to capture system audio.
|
|
210
|
+
*
|
|
211
|
+
* If this is the first time requesting access, this shows dialog that lets th users open System Settings.
|
|
212
|
+
* In System Settings, the user can allow the app permission to do screen recording.
|
|
213
|
+
*
|
|
214
|
+
* Afterwards, the users needs to restart this app, for the permission to become active in the app.
|
|
215
|
+
*
|
|
216
|
+
* @remarks Currently, system audio recording is currently implemented using ScreenCaptureKit,
|
|
217
|
+
* which means the users needs to grant screen recording access.
|
|
218
|
+
*
|
|
219
|
+
* @group Permissions
|
|
220
|
+
*/
|
|
221
|
+
async requestSystemAudioRecordingAccess() {
|
|
222
|
+
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'requestSystemAudioRecordingAccess' });
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Requests the users's permission to monitor keystrokes of other apps via Input Monitoring.
|
|
226
|
+
*
|
|
227
|
+
* If this is the first time requesting access, this shows dialog that lets th users open System Settings.
|
|
228
|
+
* In System Settings, the user can allow the app permission to monitor other apps.
|
|
229
|
+
*
|
|
230
|
+
* Afterwards, the users needs to restart this app, for the permission to become active in the app.
|
|
231
|
+
*
|
|
232
|
+
* @group Permissions
|
|
233
|
+
*/
|
|
234
|
+
async requestInputMonitoringAccess() {
|
|
235
|
+
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'requestInputMonitoringAccess' });
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Requests the users's permission to control other apps via Accessibility permissions.
|
|
239
|
+
*
|
|
240
|
+
* If this is the first time requesting access, this shows dialog that lets th users open System Settings.
|
|
241
|
+
* In System Settings, the user can allow the app permission to control apps.
|
|
242
|
+
*
|
|
243
|
+
* Afterwards, the users needs to restart this app, for the permission to become active in the app.
|
|
244
|
+
*
|
|
245
|
+
* @group Permissions
|
|
246
|
+
*/
|
|
247
|
+
async requestAccessibilityControlAccess() {
|
|
248
|
+
return await this.ipcRecordKit.nsrpc.perform({ type: 'AuthorizationStatus', action: 'requestAccessibilityControlAccess' });
|
|
249
|
+
}
|
|
144
250
|
async createRecorder(schema) {
|
|
145
251
|
return Recorder.newInstance(this.ipcRecordKit.nsrpc, schema);
|
|
146
252
|
}
|
package/out/RecordKit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordKit.js","sourceRoot":"","sources":["../src/RecordKit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAsB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,SAAU,SAAQ,YAAY;IACjC,YAAY,GAAG,IAAI,YAAY,EAAE,CAAA;IAEzC,cAAc;IACd;QACE,KAAK,EAAE,CAAA;IACT,CAAC;IAED;;;;;;O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,EAAE,qBAAqB,EAAE,MAAM,EAAE,yBAAyB,EAAE,CAAY,CAAA;IAC7H,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,4BAA4B;QAChC,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,8BAA8B,EAAE,CAAS,CAAA;IAC/H,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,iCAAiC;QACrC,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,mCAAmC,EAAE,CAAS,CAAA;IACpI,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,4BAA4B;QAChC,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,8BAA8B,EAAE,CAAS,CAAA;IAC/H,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,iCAAiC;QACrC,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,mCAAmC,EAAE,CAAS,CAAA;IACpI,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,MAMC;QACD,OAAO,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;CACF;AAED,cAAc;AACd,MAAM,CAAC,IAAI,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC"}
|
package/out/Recorder.d.ts
CHANGED
|
@@ -27,8 +27,10 @@ export declare class Recorder extends EventEmitter {
|
|
|
27
27
|
/**
|
|
28
28
|
* @group Recording
|
|
29
29
|
*/
|
|
30
|
-
export type RecorderSchemaItem = WebcamSchema | DisplaySchema | WindowBasedCropSchema | AppleDeviceStaticOrientationSchema | SystemAudioSchema | ApplicationAudioSchema;
|
|
30
|
+
export type RecorderSchemaItem = WebcamSchema | DisplaySchema | WindowBasedCropSchema | AppleDeviceStaticOrientationSchema | SystemAudioSchema | ApplicationAudioSchema | MicrophoneSchema;
|
|
31
31
|
/**
|
|
32
|
+
* Creates a recorder item for a webcam movie file, using the provided microphone and camera. Output is stored in a RecordKit bundle.
|
|
33
|
+
*
|
|
32
34
|
* @group Recording Schemas
|
|
33
35
|
*/
|
|
34
36
|
export interface WebcamSchema {
|
|
@@ -38,6 +40,8 @@ export interface WebcamSchema {
|
|
|
38
40
|
microphone: Microphone | string;
|
|
39
41
|
}
|
|
40
42
|
/**
|
|
43
|
+
* Creates a recorder item for recording a single display. Output is stored in a RecordKit bundle.
|
|
44
|
+
*
|
|
41
45
|
* @group Recording Schemas
|
|
42
46
|
*/
|
|
43
47
|
export type DisplaySchema = {
|
|
@@ -61,6 +65,8 @@ export type DisplaySchema = {
|
|
|
61
65
|
segmentCallback?: (url: string) => void;
|
|
62
66
|
};
|
|
63
67
|
/**
|
|
68
|
+
* Creates a recorder item for recording the initial crop of a window on a display. Output is stored in a RecordKit bundle.
|
|
69
|
+
*
|
|
64
70
|
* @group Recording Schemas
|
|
65
71
|
*/
|
|
66
72
|
export type WindowBasedCropSchema = {
|
|
@@ -82,6 +88,8 @@ export type WindowBasedCropSchema = {
|
|
|
82
88
|
segmentCallback?: (url: string) => void;
|
|
83
89
|
};
|
|
84
90
|
/**
|
|
91
|
+
* Creates a recorder item for an Apple device screen recording, using the provided deviceID. Output is stored in a RecordKit bundle.
|
|
92
|
+
*
|
|
85
93
|
* @group Recording Schemas
|
|
86
94
|
*/
|
|
87
95
|
export interface AppleDeviceStaticOrientationSchema {
|
|
@@ -94,16 +102,30 @@ export interface AppleDeviceStaticOrientationSchema {
|
|
|
94
102
|
*/
|
|
95
103
|
export type SystemAudioMode = 'exclude' | 'include';
|
|
96
104
|
/**
|
|
105
|
+
* Enumeration specifying the backend to use for system audio recording.
|
|
106
|
+
*
|
|
107
|
+
* - `screenCaptureKit`: Use ScreenCaptureKit for system audio recording.
|
|
108
|
+
* - `_beta_coreAudio`: This a beta feature, it is not fully implemented yet. Do not use in production. Currently only records single files in .caf format.
|
|
109
|
+
*
|
|
97
110
|
* @group Recording Schemas
|
|
98
111
|
*/
|
|
99
112
|
export type SystemAudioBackend = 'screenCaptureKit' | '_beta_coreAudio';
|
|
100
113
|
/**
|
|
101
114
|
* @group Recording Schemas
|
|
102
115
|
*/
|
|
103
|
-
export type AudioOutputOptionsType = 'singleFile' | 'segmented';
|
|
116
|
+
export type AudioOutputOptionsType = 'singleFile' | 'segmented' | 'stream';
|
|
104
117
|
/**
|
|
105
118
|
* @group Recording Schemas
|
|
106
119
|
*/
|
|
120
|
+
export type MicrophoneOutputOptionsType = 'singleFile' | 'segmented' | 'stream';
|
|
121
|
+
/**
|
|
122
|
+
* Creates a recorder item for recording system audio. By default current process audio is excluded. Output is stored in a RecordKit bundle.
|
|
123
|
+
*
|
|
124
|
+
* When using `mode: 'exclude'`, all system audio is recorded except for excluded applications.
|
|
125
|
+
* When using `mode: 'include'`, only audio from specified applications is recorded.
|
|
126
|
+
*
|
|
127
|
+
* @group Recording Schemas
|
|
128
|
+
*/
|
|
107
129
|
export type SystemAudioSchema = {
|
|
108
130
|
type: 'systemAudio';
|
|
109
131
|
mode: 'exclude';
|
|
@@ -121,6 +143,15 @@ export type SystemAudioSchema = {
|
|
|
121
143
|
output: 'segmented';
|
|
122
144
|
filenamePrefix?: string;
|
|
123
145
|
segmentCallback?: (url: string) => void;
|
|
146
|
+
} | {
|
|
147
|
+
type: 'systemAudio';
|
|
148
|
+
mode: 'exclude';
|
|
149
|
+
backend?: SystemAudioBackend;
|
|
150
|
+
excludeOptions?: ('currentProcess')[];
|
|
151
|
+
excludedProcessIDs?: number[];
|
|
152
|
+
output: 'stream';
|
|
153
|
+
/** Called with real-time audio buffer data compatible with Web Audio API. Requires _beta_coreAudio backend and macOS 14.2+ */
|
|
154
|
+
streamCallback?: (audioBuffer: AudioStreamBuffer) => void;
|
|
124
155
|
} | {
|
|
125
156
|
type: 'systemAudio';
|
|
126
157
|
mode: 'include';
|
|
@@ -136,8 +167,18 @@ export type SystemAudioSchema = {
|
|
|
136
167
|
output: 'segmented';
|
|
137
168
|
filenamePrefix?: string;
|
|
138
169
|
segmentCallback?: (url: string) => void;
|
|
170
|
+
} | {
|
|
171
|
+
type: 'systemAudio';
|
|
172
|
+
mode: 'include';
|
|
173
|
+
backend?: SystemAudioBackend;
|
|
174
|
+
includedApplicationIDs?: number[];
|
|
175
|
+
output: 'stream';
|
|
176
|
+
/** Called with real-time audio buffer data compatible with Web Audio API. Requires _beta_coreAudio backend and macOS 14.2+ */
|
|
177
|
+
streamCallback?: (audioBuffer: AudioStreamBuffer) => void;
|
|
139
178
|
};
|
|
140
179
|
/**
|
|
180
|
+
* Creates a recorder item for recording the audio of a single application. Output is stored in a RecordKit bundle.
|
|
181
|
+
*
|
|
141
182
|
* @group Recording Schemas
|
|
142
183
|
*/
|
|
143
184
|
export type ApplicationAudioSchema = {
|
|
@@ -153,7 +194,56 @@ export type ApplicationAudioSchema = {
|
|
|
153
194
|
output: 'segmented';
|
|
154
195
|
filenamePrefix?: string;
|
|
155
196
|
segmentCallback?: (url: string) => void;
|
|
197
|
+
} | {
|
|
198
|
+
type: 'applicationAudio';
|
|
199
|
+
applicationID: number;
|
|
200
|
+
backend?: SystemAudioBackend;
|
|
201
|
+
output: 'stream';
|
|
202
|
+
/** Called with real-time audio buffer data compatible with Web Audio API. Requires _beta_coreAudio backend and macOS 14.2+ */
|
|
203
|
+
streamCallback?: (audioBuffer: AudioStreamBuffer) => void;
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Creates a recorder item for an audio file, using the provided microphone. Output is stored in a RecordKit bundle.
|
|
207
|
+
*
|
|
208
|
+
* @group Recording Schemas
|
|
209
|
+
*/
|
|
210
|
+
export type MicrophoneSchema = {
|
|
211
|
+
type: 'microphone';
|
|
212
|
+
microphone: Microphone | string;
|
|
213
|
+
leftChannelOnly?: boolean;
|
|
214
|
+
audioDelay?: number;
|
|
215
|
+
output?: 'singleFile';
|
|
216
|
+
filename?: string;
|
|
217
|
+
} | {
|
|
218
|
+
type: 'microphone';
|
|
219
|
+
microphone: Microphone | string;
|
|
220
|
+
leftChannelOnly?: boolean;
|
|
221
|
+
audioDelay?: number;
|
|
222
|
+
output: 'segmented';
|
|
223
|
+
filenamePrefix?: string;
|
|
224
|
+
segmentCallback?: (url: string) => void;
|
|
225
|
+
} | {
|
|
226
|
+
type: 'microphone';
|
|
227
|
+
microphone: Microphone | string;
|
|
228
|
+
output: 'stream';
|
|
229
|
+
/** Called with real-time audio buffer data compatible with Web Audio API */
|
|
230
|
+
streamCallback?: (audioBuffer: AudioStreamBuffer) => void;
|
|
156
231
|
};
|
|
232
|
+
/**
|
|
233
|
+
* Audio buffer compatible with Web Audio API
|
|
234
|
+
*
|
|
235
|
+
* @group Recording
|
|
236
|
+
*/
|
|
237
|
+
export interface AudioStreamBuffer {
|
|
238
|
+
/** Sample rate in Hz (e.g., 44100, 48000) */
|
|
239
|
+
sampleRate: number;
|
|
240
|
+
/** Number of audio channels */
|
|
241
|
+
numberOfChannels: number;
|
|
242
|
+
/** Number of frames per channel */
|
|
243
|
+
numberOfFrames: number;
|
|
244
|
+
/** Non-interleaved Float32 audio data - one array per channel */
|
|
245
|
+
channelData: Float32Array[];
|
|
246
|
+
}
|
|
157
247
|
/**
|
|
158
248
|
* @group Recording
|
|
159
249
|
*/
|