forked from karaggeorge/macos-audio-devices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test-d.ts
73 lines (61 loc) · 2.53 KB
/
index.test-d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { expectType, expectError } from 'tsd';
import {
Device,
getAllDevices,
getInputDevices,
getOutputDevices,
getDefaultInputDevice,
getDefaultOutputDevice,
getDefaultSystemDevice,
setDefaultInputDevice,
setDefaultOutputDevice,
setDefaultSystemDevice,
getOutputDeviceVolume,
setOutputDeviceVolume,
createAggregateDevice,
destroyAggregateDevice,
} from '.';
expectType<Device[]>(getAllDevices.sync())
expectType<Promise<Device[]>>(getAllDevices())
expectType<Device[]>(getInputDevices.sync())
expectType<Promise<Device[]>>(getInputDevices())
expectType<Device[]>(getOutputDevices.sync())
expectType<Promise<Device[]>>(getOutputDevices())
expectType<Device>(getDefaultInputDevice.sync())
expectType<Promise<Device>>(getDefaultInputDevice())
expectType<Device>(getDefaultOutputDevice.sync())
expectType<Promise<Device>>(getDefaultOutputDevice())
expectType<Device>(getDefaultSystemDevice.sync())
expectType<Promise<Device>>(getDefaultSystemDevice())
expectType<void>(setDefaultInputDevice.sync(1))
expectType<Promise<void>>(setDefaultInputDevice(1))
expectError(setDefaultInputDevice.sync())
expectError(setDefaultInputDevice.sync('1'))
expectType<void>(setDefaultOutputDevice.sync(1))
expectType<Promise<void>>(setDefaultOutputDevice(1))
expectError(setDefaultOutputDevice.sync())
expectError(setDefaultOutputDevice.sync('1'))
expectType<void>(setDefaultSystemDevice.sync(1))
expectType<Promise<void>>(setDefaultSystemDevice(1))
expectError(setDefaultSystemDevice.sync())
expectError(setDefaultSystemDevice.sync('1'))
expectType<number>(getOutputDeviceVolume.sync(1))
expectType<Promise<number>>(getOutputDeviceVolume(1))
expectError(getOutputDeviceVolume.sync())
expectError(getOutputDeviceVolume.sync('1'))
expectType<void>(setOutputDeviceVolume.sync(1, 0.5))
expectType<Promise<void>>(setOutputDeviceVolume(1, 0.5))
expectError(setOutputDeviceVolume.sync())
expectError(setOutputDeviceVolume.sync(1))
expectError(setOutputDeviceVolume('1', 1))
expectError(setOutputDeviceVolume(1, '1'))
expectType<Device>(createAggregateDevice.sync('name', 74, [32], { multiOutput: true }))
expectType<Device>(createAggregateDevice.sync('name', 74, [32, 72]))
expectType<Promise<Device>>(createAggregateDevice('name', 74, [32, 72]))
expectError(createAggregateDevice.sync())
expectError(createAggregateDevice.sync(74))
expectError(createAggregateDevice.sync('name', 74, 32))
expectType<void>(destroyAggregateDevice.sync(1))
expectType<Promise<void>>(destroyAggregateDevice(1))
expectError(destroyAggregateDevice.sync())
expectError(destroyAggregateDevice.sync('1'))