Skip to content

Commit 054a28e

Browse files
committed
Fix types and example
1 parent 50a8df8 commit 054a28e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

example.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@ import fs from 'node:fs';
22
import timers from 'node:timers/promises';
33
import {
44
recorder,
5-
screens,
6-
audioDevices,
5+
screens as getScreens,
6+
audioDevices as getAudioDevices,
77
videoCodecs,
88
} from './index.js';
99

1010
async function main() {
11-
console.log('Screens:', await screens());
12-
console.log('Audio devices:', await audioDevices());
11+
const screens = await getScreens();
12+
console.log('Screens:', screens);
13+
const audioDevices = await getAudioDevices();
14+
console.log('Audio devices:', audioDevices);
1315
console.log('Video codecs:', videoCodecs);
1416

1517
console.log('Preparing to record for 5 seconds');
16-
await recorder.startRecording();
18+
await recorder.startRecordingScreen({screenId: screens[0].id, audioDeviceId: audioDevices[0].id});
1719
console.log('Recording started');
1820
await recorder.isFileReady;
1921
console.log('File is ready');

index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ Get a list of windows.
245245
[{
246246
id: '69732482',
247247
title: 'Unicorn',
248-
applicationName: 'Safari',
249-
applicationBundleIdentifier: 'com.apple.Safari',
248+
appName: 'Safari',
249+
appBundleIdentifier: 'com.apple.Safari',
250250
isActive: true,
251251
isOnScreen: true,
252252
layer: 0,

0 commit comments

Comments
 (0)