@@ -36,7 +36,7 @@ interface Tree {
36
36
[ k : string ] : AnyType ;
37
37
}
38
38
39
- type AnyType = PrimitiveType | ObjectType | ArrayType | SceneType | SourceType ;
39
+ type AnyType = PrimitiveType | ObjectType | ArrayType | SceneType | SceneItemType | SceneItemTransformType | OBSStatsType ;
40
40
41
41
interface PrimitiveType {
42
42
type : 'string' | 'number' | 'boolean' ;
@@ -51,7 +51,7 @@ interface ObjectType {
51
51
52
52
interface ArrayType {
53
53
type : 'array' ;
54
- items : PrimitiveType | ObjectType | SceneType | SourceType ;
54
+ items : PrimitiveType | ObjectType | SceneType | SceneItemType | SceneItemTransformType ;
55
55
optional : boolean ;
56
56
}
57
57
@@ -60,8 +60,18 @@ interface SceneType {
60
60
optional : boolean ;
61
61
}
62
62
63
- interface SourceType {
64
- type : 'ObsWebSocket.Source' ;
63
+ interface SceneItemType {
64
+ type : 'ObsWebSocket.SceneItem' ;
65
+ optional : boolean ;
66
+ }
67
+
68
+ interface SceneItemTransformType {
69
+ type : 'ObsWebSocket.SceneItemTransform' ;
70
+ optional : boolean ;
71
+ }
72
+
73
+ interface OBSStatsType {
74
+ type : 'ObsWebSocket.OBSStats' ;
65
75
optional : boolean ;
66
76
}
67
77
@@ -147,41 +157,41 @@ declare module 'obs-websocket-js' {
147
157
error?: Error | ObsWebSocket.ObsError,
148
158
response?: RequestMethodReturnMap[K]
149
159
) => void;
150
-
160
+
151
161
interface ObsError {
152
162
messageId: string;
153
163
status: "error";
154
164
error: string;
155
165
}
156
-
166
+
157
167
${ interfaces . join ( '\n\n ' ) }
158
168
}
159
-
169
+
160
170
interface RequestMethodsArgsMap {
161
171
${ requestArgs . join ( '\n\n ' ) }
162
172
}
163
-
173
+
164
174
interface RequestMethodReturnMap {
165
175
${ requestResponses . join ( '\n\n ' ) }
166
176
}
167
-
177
+
168
178
interface EventHandlersDataMap {
169
179
"ConnectionOpened": void;
170
180
"ConnectionClosed": void;
171
181
"AuthenticationSuccess": void;
172
182
"AuthenticationFailure": void;
173
183
${ eventOverloads . join ( '\n\n ' ) }
174
184
}
175
-
176
- class ObsWebSocket extends EventEmitter {
185
+
186
+ class ObsWebSocket extends EventEmitter {
177
187
connect(options?: {address?: string; password?: string}, callback?: (error?: Error) => void): Promise<void>;
178
188
disconnect(): void;
179
-
189
+
180
190
send<K extends keyof RequestMethodsArgsMap>(
181
191
requestType: K,
182
192
...args: (RequestMethodsArgsMap[K] extends object ? [RequestMethodsArgsMap[K]] : [undefined?])
183
193
): Promise<RequestMethodReturnMap[K]>;
184
-
194
+
185
195
sendCallback<K extends keyof RequestMethodsArgsMap>(
186
196
requestType: K,
187
197
...args: RequestMethodsArgsMap[K] extends object
@@ -194,7 +204,7 @@ declare module 'obs-websocket-js' {
194
204
listener: (data: EventHandlersDataMap[K]) => void
195
205
): this;
196
206
}
197
-
207
+
198
208
export = ObsWebSocket;
199
209
}` ;
200
210
/* tslint:enable:no-trailing-whitespace no-dead-reference */
@@ -365,15 +375,34 @@ function resolveType(inType: string): AnyType {
365
375
} ,
366
376
optional : isOptional
367
377
} ;
368
- case 'array<source>' :
378
+ case 'array<sceneitem>' :
379
+ return {
380
+ type : 'array' ,
381
+ items : {
382
+ type : 'ObsWebSocket.SceneItem' ,
383
+ optional : true
384
+ } ,
385
+ optional : isOptional
386
+ } ;
387
+ case 'array<sceneitemtransform>' :
369
388
return {
370
389
type : 'array' ,
371
390
items : {
372
- type : 'ObsWebSocket.Source ' ,
391
+ type : 'ObsWebSocket.SceneItemTransform ' ,
373
392
optional : true
374
393
} ,
375
394
optional : isOptional
376
395
} ;
396
+ case 'sceneitemtransform' :
397
+ return {
398
+ type : 'ObsWebSocket.SceneItemTransform' ,
399
+ optional : isOptional
400
+ } ;
401
+ case 'obsstats' :
402
+ return {
403
+ type : 'ObsWebSocket.OBSStats' ,
404
+ optional : isOptional
405
+ } ;
377
406
case 'object' :
378
407
return {
379
408
type : 'object' ,
@@ -400,7 +429,7 @@ function stringifyTypes(inputTypes: Tree, {terminator = ';', finalTerminator = t
400
429
if ( typeDef . items ) {
401
430
if ( typeDef . items . type === 'object' ) {
402
431
if ( Object . keys ( typeDef . items . properties ) . length > 0 ) {
403
- returnString += `${ stringifyTypes ( typeDef . items . properties as any , { includePrefix : false , terminator : '' } ) } []` ;
432
+ returnString += `${ stringifyTypes ( typeDef . items . properties , { includePrefix : false , terminator : '' } ) } []` ;
404
433
} else {
405
434
returnString += 'Array<{[k: string]: any}>' ;
406
435
}
0 commit comments