1
1
import type { HIDDevice } from './hid-device.js'
2
- import { DeviceModelId } from './id.js'
2
+ import { DeviceModelId , MODEL_NAMES } from './id.js'
3
3
import type { StreamDeck } from './types.js'
4
4
import type { OpenStreamDeckOptions } from './models/base.js'
5
5
import { StreamDeckOriginalFactory } from './models/original.js'
@@ -10,13 +10,17 @@ import { StreamDeckOriginalMK2Factory } from './models/original-mk2.js'
10
10
import { StreamDeckPlusFactory } from './models/plus.js'
11
11
import { StreamDeckPedalFactory } from './models/pedal.js'
12
12
import { StreamDeckNeoFactory } from './models/neo.js'
13
+ import { StreamDeckStudioFactory } from './models/studio.js'
14
+ import type { PropertiesService } from './services/properties/interface.js'
13
15
14
16
export * from './types.js'
15
17
export * from './id.js'
16
18
export * from './controlDefinition.js'
17
- export { HIDDevice , HIDDeviceInfo , HIDDeviceEvents } from './hid-device.js'
18
- export { OpenStreamDeckOptions } from './models/base.js'
19
+ export type { HIDDevice , HIDDeviceInfo , HIDDeviceEvents , ChildHIDDeviceInfo } from './hid-device.js'
20
+ export type { OpenStreamDeckOptions } from './models/base.js'
19
21
export { StreamDeckProxy } from './proxy.js'
22
+ export type { PropertiesService } from './services/properties/interface.js'
23
+ export { uint8ArrayToDataView } from './util.js'
20
24
21
25
/** Elgato vendor id */
22
26
export const VENDOR_ID = 0x0fd9
@@ -30,57 +34,92 @@ export interface DeviceModelSpec {
30
34
id : DeviceModelId
31
35
type : DeviceModelType
32
36
productIds : number [ ]
33
- factory : ( device : HIDDevice , options : Required < OpenStreamDeckOptions > ) => StreamDeck
37
+ productName : string
38
+
39
+ factory : (
40
+ device : HIDDevice ,
41
+ options : Required < OpenStreamDeckOptions > ,
42
+ propertiesService ?: PropertiesService ,
43
+ ) => StreamDeck
44
+
45
+ hasNativeTcp : boolean
34
46
}
35
47
36
48
/** List of all the known models, and the classes to use them */
37
- export const DEVICE_MODELS2 : { [ key in DeviceModelId ] : Omit < DeviceModelSpec , 'id' > } = {
49
+ export const DEVICE_MODELS2 : { [ key in DeviceModelId ] : Omit < DeviceModelSpec , 'id' | 'productName' > } = {
38
50
[ DeviceModelId . ORIGINAL ] : {
39
51
type : DeviceModelType . STREAMDECK ,
40
52
productIds : [ 0x0060 ] ,
41
53
factory : StreamDeckOriginalFactory ,
54
+
55
+ hasNativeTcp : false ,
42
56
} ,
43
57
[ DeviceModelId . MINI ] : {
44
58
type : DeviceModelType . STREAMDECK ,
45
59
productIds : [ 0x0063 , 0x0090 ] ,
46
60
factory : StreamDeckMiniFactory ,
61
+
62
+ hasNativeTcp : false ,
47
63
} ,
48
64
[ DeviceModelId . XL ] : {
49
65
type : DeviceModelType . STREAMDECK ,
50
66
productIds : [ 0x006c , 0x008f ] ,
51
67
factory : StreamDeckXLFactory ,
68
+
69
+ hasNativeTcp : false ,
52
70
} ,
53
71
[ DeviceModelId . ORIGINALV2 ] : {
54
72
type : DeviceModelType . STREAMDECK ,
55
73
productIds : [ 0x006d ] ,
56
74
factory : StreamDeckOriginalV2Factory ,
75
+
76
+ hasNativeTcp : false ,
57
77
} ,
58
78
[ DeviceModelId . ORIGINALMK2 ] : {
59
79
type : DeviceModelType . STREAMDECK ,
60
80
productIds : [ 0x0080 ] ,
61
81
factory : StreamDeckOriginalMK2Factory ,
82
+
83
+ hasNativeTcp : false ,
62
84
} ,
63
85
[ DeviceModelId . PLUS ] : {
64
86
type : DeviceModelType . STREAMDECK ,
65
87
productIds : [ 0x0084 ] ,
66
88
factory : StreamDeckPlusFactory ,
89
+
90
+ hasNativeTcp : false ,
67
91
} ,
68
92
[ DeviceModelId . PEDAL ] : {
69
93
type : DeviceModelType . PEDAL ,
70
94
productIds : [ 0x0086 ] ,
71
95
factory : StreamDeckPedalFactory ,
96
+
97
+ hasNativeTcp : false ,
72
98
} ,
73
99
[ DeviceModelId . NEO ] : {
74
100
type : DeviceModelType . STREAMDECK ,
75
101
productIds : [ 0x009a ] ,
76
102
factory : StreamDeckNeoFactory ,
103
+
104
+ hasNativeTcp : false ,
105
+ } ,
106
+ [ DeviceModelId . STUDIO ] : {
107
+ type : DeviceModelType . STREAMDECK ,
108
+ productIds : [ 0x00aa ] ,
109
+ factory : StreamDeckStudioFactory ,
110
+
111
+ hasNativeTcp : true ,
77
112
} ,
78
113
}
79
114
80
115
/** @deprecated maybe? */
81
- export const DEVICE_MODELS : DeviceModelSpec [ ] = Object . entries < Omit < DeviceModelSpec , 'id' > > ( DEVICE_MODELS2 ) . map (
82
- ( [ id , spec ] ) => ( {
83
- id : id as any as DeviceModelId ,
116
+ export const DEVICE_MODELS : DeviceModelSpec [ ] = Object . entries < Omit < DeviceModelSpec , 'id' | 'productName' > > (
117
+ DEVICE_MODELS2 ,
118
+ ) . map ( ( [ id , spec ] ) => {
119
+ const modelId = id as any as DeviceModelId
120
+ return {
121
+ id : modelId ,
122
+ productName : MODEL_NAMES [ modelId ] ,
84
123
...spec ,
85
- } ) ,
86
- )
124
+ }
125
+ } )
0 commit comments