@camera.ui/browser 0.0.66 → 0.0.67
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Manager, type Socket } from 'socket.io-client';
|
|
2
|
-
import type { WebsocketClientRequest } from '../../../../shared/types';
|
|
2
|
+
import type { ManagerNames, WebsocketClientRequest } from '../../../../shared/types';
|
|
3
3
|
export declare class SocketService {
|
|
4
4
|
manager: Manager;
|
|
5
5
|
private token;
|
|
6
6
|
get socket(): Socket;
|
|
7
7
|
constructor(endpoint: string, token: string);
|
|
8
|
-
sendRequest(data: WebsocketClientRequest): Promise<any>;
|
|
8
|
+
sendRequest<T extends ManagerNames>(data: WebsocketClientRequest<T>): Promise<any>;
|
|
9
9
|
close(): void;
|
|
10
10
|
}
|
|
@@ -38,21 +38,17 @@ export interface ProxyAuth {
|
|
|
38
38
|
user: string;
|
|
39
39
|
pass: string;
|
|
40
40
|
};
|
|
41
|
-
websocket: {
|
|
42
|
-
user: string;
|
|
43
|
-
pass: string;
|
|
44
|
-
};
|
|
45
41
|
}
|
|
46
42
|
export interface MethodNamesByManager {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
systemManager: SystemManagerBrowserProxyMethodNames;
|
|
44
|
+
deviceManager: DeviceManagerBrowserProxyMethodNames;
|
|
45
|
+
pluginsManager: PluginsManagerBrowserProxyMethodNames;
|
|
46
|
+
cameraDevice: CameraDeviceProxyMethodNames;
|
|
51
47
|
}
|
|
52
48
|
export type ManagerNames = keyof MethodNamesByManager;
|
|
53
|
-
export interface WebsocketClientRequest {
|
|
54
|
-
name:
|
|
55
|
-
method: MethodNamesByManager[
|
|
49
|
+
export interface WebsocketClientRequest<T extends keyof MethodNamesByManager> {
|
|
50
|
+
name: T;
|
|
51
|
+
method: MethodNamesByManager[T];
|
|
56
52
|
args: any[];
|
|
57
53
|
}
|
|
58
54
|
export type WebsocketClientProxyEvent = 'updateDevice' | 'updateState';
|