camstreamerlib 1.7.4 → 1.7.5
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/CamOverlayAPI.d.ts +7 -7
- package/CamOverlayAPI.js +8 -10
- package/package.json +1 -1
package/CamOverlayAPI.d.ts
CHANGED
|
@@ -15,27 +15,27 @@ export declare type Field = {
|
|
|
15
15
|
text: string;
|
|
16
16
|
color?: string;
|
|
17
17
|
};
|
|
18
|
-
declare type Message = {
|
|
18
|
+
export declare type Message = {
|
|
19
19
|
command: string;
|
|
20
20
|
params: any[];
|
|
21
21
|
};
|
|
22
|
-
declare type CairoResponse = {
|
|
22
|
+
export declare type CairoResponse = {
|
|
23
23
|
message: string;
|
|
24
24
|
call_id: number;
|
|
25
25
|
};
|
|
26
|
-
declare type CairoCreateResponse = {
|
|
26
|
+
export declare type CairoCreateResponse = {
|
|
27
27
|
var: string;
|
|
28
28
|
call_id: number;
|
|
29
29
|
};
|
|
30
|
-
declare type UploadImageResponse = {
|
|
30
|
+
export declare type UploadImageResponse = {
|
|
31
31
|
var: string;
|
|
32
32
|
width: number;
|
|
33
33
|
height: number;
|
|
34
34
|
call_id: number;
|
|
35
35
|
};
|
|
36
|
-
declare type Align = 'A_RIGHT' | 'A_LEFT' | 'A_CENTER';
|
|
37
|
-
declare type TextFit = 'TFM_SCALE' | 'TFM_TRUNCATE' | 'TFM_OVERFLOW';
|
|
38
|
-
declare type WriteTextParams = [string, string, number, number, number, number, Align, TextFit?];
|
|
36
|
+
export declare type Align = 'A_RIGHT' | 'A_LEFT' | 'A_CENTER';
|
|
37
|
+
export declare type TextFit = 'TFM_SCALE' | 'TFM_TRUNCATE' | 'TFM_OVERFLOW';
|
|
38
|
+
export declare type WriteTextParams = [string, string, number, number, number, number, Align, TextFit?];
|
|
39
39
|
declare type Service = {
|
|
40
40
|
id: number;
|
|
41
41
|
enabled: number;
|
package/CamOverlayAPI.js
CHANGED
|
@@ -32,18 +32,15 @@ class CamOverlayAPI extends EventEmitter {
|
|
|
32
32
|
}
|
|
33
33
|
connect() {
|
|
34
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
|
|
35
|
+
try {
|
|
36
|
+
if (this.serviceID == -1) {
|
|
37
|
+
this.serviceID = yield this.createService();
|
|
38
|
+
}
|
|
36
39
|
yield this.openWebsocket();
|
|
40
|
+
this.emit('open');
|
|
37
41
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
let id = yield this.createService();
|
|
41
|
-
this.serviceID = id;
|
|
42
|
-
yield this.openWebsocket();
|
|
43
|
-
}
|
|
44
|
-
catch (err) {
|
|
45
|
-
this.reportErr(err);
|
|
46
|
-
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
this.reportErr(err);
|
|
47
44
|
}
|
|
48
45
|
});
|
|
49
46
|
}
|
|
@@ -214,6 +211,7 @@ class CamOverlayAPI extends EventEmitter {
|
|
|
214
211
|
var _a;
|
|
215
212
|
(_a = this.ws) === null || _a === void 0 ? void 0 : _a.terminate();
|
|
216
213
|
this.emit('error', err);
|
|
214
|
+
this.emit('close');
|
|
217
215
|
}
|
|
218
216
|
reportClose() {
|
|
219
217
|
this.emit('close');
|