@camera.ui/browser 0.0.64 → 0.0.66
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/dist/bundle.js +1 -1
- package/dist/types/packages/client/browser/src/client.d.ts +3 -2
- package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +7 -28
- package/dist/types/packages/client/browser/src/proxy/deviceManager.d.ts +9 -39
- package/dist/types/packages/client/browser/src/proxy/pluginsManager.d.ts +5 -32
- package/dist/types/packages/client/browser/src/proxy/systemManager.d.ts +5 -32
- package/dist/types/packages/client/browser/src/socket.d.ts +10 -0
- package/dist/types/packages/client/browser/src/types.d.ts +1 -1
- package/dist/types/server/src/api/database/types.d.ts +2 -0
- package/dist/types/server/src/camera/base/cameraDevice.d.ts +18 -0
- package/dist/types/server/src/camera/base/{base.browser.d.ts → cameraDeviceBrowser.d.ts} +2 -2
- package/dist/types/server/src/camera/base/index.d.ts +80 -6
- package/dist/types/server/src/camera/streaming/browser/browser-peer-connection.d.ts +1 -1
- package/dist/types/server/src/camera/streaming/browser/browser-streaming-session.d.ts +1 -1
- package/dist/types/server/src/camera/streaming/browser/webrtc-browser-connection.d.ts +1 -1
- package/dist/types/server/src/camera/streaming/peer-connection.d.ts +1 -1
- package/dist/types/server/src/camera/streaming/streaming-session.d.ts +1 -1
- package/dist/types/server/src/camera/streaming/webrtc-connection.d.ts +1 -1
- package/dist/types/server/src/camera/utils/subscribed.d.ts +4 -4
- package/dist/types/server/src/{detector → decoder}/types.d.ts +1 -4
- package/dist/types/server/src/{proxy → nats}/types.d.ts +126 -130
- package/dist/types/shared/types/index.d.ts +3 -3
- package/package.json +4 -5
- package/dist/types/server/src/camera/base/base.d.ts +0 -79
- package/dist/types/server/src/camera/base/base.server.d.ts +0 -9
- package/dist/types/server/src/plugins/node/proxy/queue.d.ts +0 -28
- package/dist/types/server/src/proxy/constants.d.ts +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Camera } from '../api/database/types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CameraDevice } from '../camera/base/cameraDevice';
|
|
3
|
+
import type { BrowserCameraDevice } from '../camera/base/cameraDeviceBrowser';
|
|
3
4
|
import type { CameraConfig, FfmpegOptions, OnSetEvent, PrebufferType, StateValues, StreamInfo } from '../camera/types';
|
|
4
|
-
import type { FrameMetadata } from '../
|
|
5
|
+
import type { FrameMetadata } from '../decoder/types';
|
|
5
6
|
import type { CameraExtension } from '../plugins/types';
|
|
6
7
|
import type { IceServer } from '../services/config/types';
|
|
7
8
|
export type MethodKeys<T> = {
|
|
@@ -28,12 +29,34 @@ export interface ProxyMessageStructure {
|
|
|
28
29
|
response?: any;
|
|
29
30
|
error?: any;
|
|
30
31
|
}
|
|
31
|
-
export interface
|
|
32
|
-
|
|
32
|
+
export interface ProxyAuth {
|
|
33
|
+
cluster: {
|
|
34
|
+
user: string;
|
|
35
|
+
pass: string;
|
|
36
|
+
};
|
|
37
|
+
server: {
|
|
38
|
+
user: string;
|
|
39
|
+
pass: string;
|
|
40
|
+
};
|
|
41
|
+
websocket: {
|
|
42
|
+
user: string;
|
|
43
|
+
pass: string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface MethodNamesByManager {
|
|
47
|
+
system: SystemManagerBrowserProxyMethodNames;
|
|
48
|
+
device: DeviceManagerBrowserProxyMethodNames;
|
|
49
|
+
plugins: PluginsManagerBrowserProxyMethodNames;
|
|
50
|
+
camera: CameraDeviceProxyMethodNames;
|
|
51
|
+
}
|
|
52
|
+
export type ManagerNames = keyof MethodNamesByManager;
|
|
53
|
+
export interface WebsocketClientRequest {
|
|
54
|
+
name: ManagerNames;
|
|
55
|
+
method: MethodNamesByManager[ManagerNames];
|
|
33
56
|
args: any[];
|
|
34
57
|
}
|
|
35
|
-
export type
|
|
36
|
-
export interface
|
|
58
|
+
export type WebsocketClientProxyEvent = 'updateDevice' | 'updateState';
|
|
59
|
+
export interface DeviceManagerServerProxyMethods {
|
|
37
60
|
createCamera(data: {
|
|
38
61
|
camera: CameraConfig;
|
|
39
62
|
pluginId: string;
|
|
@@ -55,32 +78,101 @@ export interface ApiProxyMethods {
|
|
|
55
78
|
pluginId: string;
|
|
56
79
|
}): Promise<void>;
|
|
57
80
|
}
|
|
58
|
-
export interface
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
81
|
+
export interface SystemManagerServerProxyMethods {
|
|
82
|
+
}
|
|
83
|
+
export interface PluginsManagerServerProxyMethods {
|
|
84
|
+
}
|
|
85
|
+
export interface CameraDeviceProxyMethods {
|
|
86
|
+
connect(data: {
|
|
87
|
+
cameraId: string;
|
|
88
|
+
pluginId: string;
|
|
89
|
+
}): Promise<void>;
|
|
90
|
+
disconnect(data: {
|
|
91
|
+
cameraId: string;
|
|
92
|
+
pluginId: string;
|
|
93
|
+
}): Promise<void>;
|
|
94
|
+
reboot(data: {
|
|
95
|
+
cameraId: string;
|
|
96
|
+
pluginId: string;
|
|
97
|
+
}): Promise<void>;
|
|
98
|
+
isPrebuffering(data: {
|
|
99
|
+
sourceName: string;
|
|
100
|
+
type: PrebufferType;
|
|
101
|
+
cameraId: string;
|
|
102
|
+
pluginId: string;
|
|
103
|
+
}): Promise<boolean>;
|
|
104
|
+
getPrebufferRawUrl(data: {
|
|
105
|
+
sourceName: string;
|
|
106
|
+
type: PrebufferType;
|
|
107
|
+
cameraId: string;
|
|
108
|
+
pluginId: string;
|
|
109
|
+
}): Promise<string | undefined>;
|
|
110
|
+
getStreamInfo(data: {
|
|
111
|
+
sourceName: string;
|
|
112
|
+
cameraId: string;
|
|
113
|
+
pluginId: string;
|
|
114
|
+
}): Promise<StreamInfo | undefined>;
|
|
115
|
+
getFrameMetadata(data: {
|
|
116
|
+
cameraId: string;
|
|
117
|
+
pluginId: string;
|
|
118
|
+
}): Promise<FrameMetadata>;
|
|
119
|
+
getFfmpegPath(data: {
|
|
120
|
+
cameraId: string;
|
|
121
|
+
pluginId: string;
|
|
122
|
+
}): string;
|
|
123
|
+
getIceServers(data: {
|
|
124
|
+
cameraId: string;
|
|
125
|
+
pluginId: string;
|
|
126
|
+
}): IceServer[];
|
|
127
|
+
snapshot(data: {
|
|
128
|
+
forceNew?: boolean;
|
|
129
|
+
cameraId: string;
|
|
130
|
+
pluginId: string;
|
|
131
|
+
}): Promise<ArrayBuffer>;
|
|
132
|
+
streamVideo(data: {
|
|
133
|
+
sourceName: string;
|
|
134
|
+
options: FfmpegOptions;
|
|
135
|
+
cameraId: string;
|
|
136
|
+
pluginId: string;
|
|
137
|
+
}): Promise<void>;
|
|
138
|
+
recordToFile(data: {
|
|
139
|
+
sourceName: string;
|
|
140
|
+
outputPath: string;
|
|
141
|
+
duration?: number;
|
|
142
|
+
cameraId: string;
|
|
143
|
+
pluginId: string;
|
|
144
|
+
}): Promise<void>;
|
|
145
|
+
updateState<T extends keyof StateValues>(data: {
|
|
146
|
+
stateName: T;
|
|
147
|
+
eventData: OnSetEvent<T>;
|
|
148
|
+
cameraId: string;
|
|
149
|
+
pluginId: string;
|
|
150
|
+
}): void;
|
|
151
|
+
refreshStates(data: {
|
|
152
|
+
cameraId: string;
|
|
153
|
+
pluginId: string;
|
|
154
|
+
}): Promise<{
|
|
155
|
+
camera: Camera;
|
|
156
|
+
states: StateValues;
|
|
157
|
+
cameraState: boolean;
|
|
158
|
+
}>;
|
|
71
159
|
}
|
|
160
|
+
export type CameraDeviceProxyMethodNames = MethodKeys<CameraDeviceProxyMethods>;
|
|
72
161
|
export interface DeviceManagerListenerMessagePayload {
|
|
73
162
|
type: keyof DeviceManagerProxyEventCallbacks;
|
|
74
163
|
data: any;
|
|
75
164
|
}
|
|
76
|
-
export interface
|
|
165
|
+
export interface DeviceManagerBrowserProxyMethods {
|
|
166
|
+
getCameraByName(name: string): Promise<CameraDevice | BrowserCameraDevice | undefined>;
|
|
167
|
+
getCameraById(id: string): Promise<CameraDevice | BrowserCameraDevice | undefined>;
|
|
168
|
+
}
|
|
169
|
+
export interface DeviceManagerProxyMethods extends DeviceManagerBrowserProxyMethods {
|
|
77
170
|
createCamera(camera: CameraConfig): Promise<CameraDevice>;
|
|
78
|
-
getCameraByName(name: string): Promise<CameraDevice | undefined>;
|
|
79
|
-
getCameraById(id: string): Promise<CameraDevice | undefined>;
|
|
80
171
|
removeCameraByName(name: string): Promise<void>;
|
|
81
172
|
removeCameraById(id: string): Promise<void>;
|
|
82
173
|
}
|
|
83
174
|
export type DeviceManagerProxyMethodNames = MethodKeys<DeviceManagerProxyMethods>;
|
|
175
|
+
export type DeviceManagerBrowserProxyMethodNames = MethodKeys<DeviceManagerBrowserProxyMethods>;
|
|
84
176
|
export interface DeviceManagerProxyEvents {
|
|
85
177
|
cameraSelected: {
|
|
86
178
|
camera: Camera;
|
|
@@ -95,9 +187,9 @@ export interface DeviceManagerProxyEvents {
|
|
|
95
187
|
};
|
|
96
188
|
}
|
|
97
189
|
export interface DeviceManagerProxyEventCallbacks {
|
|
98
|
-
cameraSelected: ((camera:
|
|
190
|
+
cameraSelected: ((camera: CameraDevice, extension: CameraExtension) => void) | ((camera: BrowserCameraDevice, extension: CameraExtension) => void);
|
|
99
191
|
cameraDeselected: (cameraId: string, extension: CameraExtension) => void;
|
|
100
|
-
cameraUpdated: ((cameraId: string, camera:
|
|
192
|
+
cameraUpdated: ((cameraId: string, camera: CameraDevice) => void) | ((cameraId: string, camera: BrowserCameraDevice) => void);
|
|
101
193
|
}
|
|
102
194
|
export interface DeviceManagerProxyGenericEvent<K extends keyof DeviceManagerProxyEvents> {
|
|
103
195
|
type: K;
|
|
@@ -107,14 +199,17 @@ export interface SystemManagerListenerMessagePayload {
|
|
|
107
199
|
type: keyof SystemManagerProxyEventCallbacks;
|
|
108
200
|
data: any;
|
|
109
201
|
}
|
|
110
|
-
export interface
|
|
202
|
+
export interface SystemManagerBrowserProxyMethods {
|
|
111
203
|
}
|
|
204
|
+
export interface SystemManagerProxyMethods extends SystemManagerBrowserProxyMethods {
|
|
205
|
+
}
|
|
206
|
+
export type SystemManagerProxyMethodNames = MethodKeys<SystemManagerProxyMethods>;
|
|
207
|
+
export type SystemManagerBrowserProxyMethodNames = MethodKeys<SystemManagerBrowserProxyMethods>;
|
|
112
208
|
export interface SystemManagerProxyMethodsListener {
|
|
113
209
|
listen<E extends keyof SystemManagerProxyEventCallbacks>(eventType: E, callback: SystemManagerProxyEventCallbacks[E]): void;
|
|
114
210
|
removeListener<E extends keyof SystemManagerProxyEventCallbacks>(eventType: E, callbackToRemove: SystemManagerProxyEventCallbacks[E]): void;
|
|
115
211
|
removeAllListeners<E extends keyof SystemManagerProxyEventCallbacks>(eventType?: E): void;
|
|
116
212
|
}
|
|
117
|
-
export type SystemManagerProxyMethodNames = MethodKeys<SystemManagerProxyMethods>;
|
|
118
213
|
export interface SystemManagerProxyEvents {
|
|
119
214
|
}
|
|
120
215
|
export type SystemManagerProxyEventCallbacks = {};
|
|
@@ -126,14 +221,17 @@ export interface PluginsManagerListenerMessagePayload {
|
|
|
126
221
|
type: keyof PluginsManagerProxyEventCallbacks;
|
|
127
222
|
data: any;
|
|
128
223
|
}
|
|
129
|
-
export interface
|
|
224
|
+
export interface PluginsManagerBrowserProxyMethods {
|
|
130
225
|
}
|
|
226
|
+
export interface PluginsManagerProxyMethods extends PluginsManagerBrowserProxyMethods {
|
|
227
|
+
}
|
|
228
|
+
export type PluginsManagerProxyMethodNames = MethodKeys<PluginsManagerProxyMethods>;
|
|
229
|
+
export type PluginsManagerBrowserProxyMethodNames = MethodKeys<PluginsManagerBrowserProxyMethods>;
|
|
131
230
|
export interface PluginsManagerProxyMethodsListener {
|
|
132
231
|
listen<E extends keyof PluginsManagerProxyEventCallbacks>(eventType: E, callback: PluginsManagerProxyEventCallbacks[E]): void;
|
|
133
232
|
removeListener<E extends keyof PluginsManagerProxyEventCallbacks>(eventType: E, callbackToRemove: PluginsManagerProxyEventCallbacks[E]): void;
|
|
134
233
|
removeAllListeners<E extends keyof PluginsManagerProxyEventCallbacks>(eventType?: E): void;
|
|
135
234
|
}
|
|
136
|
-
export type PluginsManagerProxyMethodNames = MethodKeys<PluginsManagerProxyMethods>;
|
|
137
235
|
export interface PluginsManagerProxyEvents {
|
|
138
236
|
}
|
|
139
237
|
export type PluginsManagerProxyEventCallbacks = {};
|
|
@@ -141,7 +239,6 @@ export interface PluginsManagerProxyGenericEvent<K extends keyof PluginsManagerP
|
|
|
141
239
|
type: K;
|
|
142
240
|
data: PluginsManagerProxyEvents[K];
|
|
143
241
|
}
|
|
144
|
-
export type CameraDeviceListenerSocketEventType = 'updateDevice' | 'updateState';
|
|
145
242
|
export interface CameraDeviceListenerStatePayload<K extends keyof StateValues> {
|
|
146
243
|
stateName: K;
|
|
147
244
|
data: {
|
|
@@ -153,104 +250,3 @@ export interface CameraDeviceListenerMessagePayload {
|
|
|
153
250
|
type: 'removed' | 'updated' | 'cameraState';
|
|
154
251
|
data?: any;
|
|
155
252
|
}
|
|
156
|
-
export interface CameraDeviceProxyMethods {
|
|
157
|
-
connect(data: {
|
|
158
|
-
cameraId: string;
|
|
159
|
-
pluginId?: string;
|
|
160
|
-
ws?: boolean;
|
|
161
|
-
}): Promise<void>;
|
|
162
|
-
disconnect(data: {
|
|
163
|
-
cameraId: string;
|
|
164
|
-
pluginId?: string;
|
|
165
|
-
ws?: boolean;
|
|
166
|
-
}): Promise<void>;
|
|
167
|
-
reboot(data: {
|
|
168
|
-
cameraId: string;
|
|
169
|
-
pluginId?: string;
|
|
170
|
-
ws?: boolean;
|
|
171
|
-
}): Promise<void>;
|
|
172
|
-
isPrebuffering(data: {
|
|
173
|
-
sourceName: string;
|
|
174
|
-
type: PrebufferType;
|
|
175
|
-
cameraId: string;
|
|
176
|
-
pluginId?: string;
|
|
177
|
-
ws?: boolean;
|
|
178
|
-
}): Promise<boolean>;
|
|
179
|
-
getPrebufferRawUrl(data: {
|
|
180
|
-
sourceName: string;
|
|
181
|
-
type: PrebufferType;
|
|
182
|
-
cameraId: string;
|
|
183
|
-
pluginId?: string;
|
|
184
|
-
ws?: boolean;
|
|
185
|
-
}): Promise<string | undefined>;
|
|
186
|
-
getStreamInfo(data: {
|
|
187
|
-
sourceName: string;
|
|
188
|
-
cameraId: string;
|
|
189
|
-
pluginId?: string;
|
|
190
|
-
ws?: boolean;
|
|
191
|
-
}): Promise<StreamInfo | undefined>;
|
|
192
|
-
getFrameMetadata(data: {
|
|
193
|
-
cameraId: string;
|
|
194
|
-
pluginId?: string;
|
|
195
|
-
ws?: boolean;
|
|
196
|
-
}): Promise<FrameMetadata | undefined>;
|
|
197
|
-
getFffmpegPath(data: {
|
|
198
|
-
cameraId: string;
|
|
199
|
-
pluginId?: string;
|
|
200
|
-
ws?: boolean;
|
|
201
|
-
}): string;
|
|
202
|
-
getIceServers(data: {
|
|
203
|
-
cameraId: string;
|
|
204
|
-
pluginId?: string;
|
|
205
|
-
ws?: boolean;
|
|
206
|
-
}): IceServer[];
|
|
207
|
-
snapshot(data: {
|
|
208
|
-
forceNew?: boolean;
|
|
209
|
-
cameraId: string;
|
|
210
|
-
pluginId?: string;
|
|
211
|
-
ws?: boolean;
|
|
212
|
-
}): Promise<ArrayBuffer>;
|
|
213
|
-
streamVideo(data: {
|
|
214
|
-
sourceName: string;
|
|
215
|
-
options: FfmpegOptions;
|
|
216
|
-
cameraId: string;
|
|
217
|
-
pluginId?: string;
|
|
218
|
-
ws?: boolean;
|
|
219
|
-
}): Promise<void>;
|
|
220
|
-
recordToFile(data: {
|
|
221
|
-
sourceName: string;
|
|
222
|
-
outputPath: string;
|
|
223
|
-
duration?: number;
|
|
224
|
-
cameraId: string;
|
|
225
|
-
pluginId?: string;
|
|
226
|
-
ws?: boolean;
|
|
227
|
-
}): Promise<void>;
|
|
228
|
-
updateState<T extends keyof StateValues>(data: {
|
|
229
|
-
stateName: T;
|
|
230
|
-
eventData: OnSetEvent<T>;
|
|
231
|
-
cameraId: string;
|
|
232
|
-
pluginId?: string;
|
|
233
|
-
ws?: boolean;
|
|
234
|
-
}): void;
|
|
235
|
-
refreshStates(data: {
|
|
236
|
-
cameraId: string;
|
|
237
|
-
pluginId?: string;
|
|
238
|
-
ws?: boolean;
|
|
239
|
-
}): Promise<{
|
|
240
|
-
camera: Camera;
|
|
241
|
-
states: StateValues;
|
|
242
|
-
cameraState: boolean;
|
|
243
|
-
}>;
|
|
244
|
-
}
|
|
245
|
-
export type CameraDeviceProxyMethodNames = MethodKeys<CameraDeviceProxyMethods>;
|
|
246
|
-
export type CameraDeviceProxyEventCallbacks = {
|
|
247
|
-
[K in keyof StateValues]: (newData: StateValues[K], oldData: StateValues[K]) => void;
|
|
248
|
-
};
|
|
249
|
-
export interface CameraDeviceProxyGenericEvent<K extends keyof StateValues> {
|
|
250
|
-
type: K;
|
|
251
|
-
data: StateValues[K];
|
|
252
|
-
}
|
|
253
|
-
export interface WsCameraDeviceClientMessage {
|
|
254
|
-
method: CameraDeviceProxyMethodNames;
|
|
255
|
-
args: any[];
|
|
256
|
-
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export type * from '../../server/src/api/database/types';
|
|
2
2
|
export type * from '../../server/src/api/types';
|
|
3
3
|
export type * from '../../server/src/api/ws/types';
|
|
4
|
-
export * from '../../server/src/camera/base/
|
|
4
|
+
export * from '../../server/src/camera/base/cameraDeviceBrowser';
|
|
5
5
|
export * from '../../server/src/camera/streaming/browser/browser-streaming-session';
|
|
6
6
|
export * from '../../server/src/camera/streaming/browser/webrtc-browser-connection';
|
|
7
7
|
export type * from '../../server/src/camera/types';
|
|
8
|
-
export type * from '../../server/src/
|
|
8
|
+
export type * from '../../server/src/decoder/types';
|
|
9
9
|
export * from '../../server/src/go2rtc/types';
|
|
10
|
+
export type * from '../../server/src/nats/types';
|
|
10
11
|
export * from '../../server/src/plugins/types';
|
|
11
|
-
export type * from '../../server/src/proxy/types';
|
|
12
12
|
export * from '../../server/src/services/config/types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camera.ui/browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.66",
|
|
4
4
|
"description": "camera.ui browser client",
|
|
5
5
|
"author": "seydx (https://github.com/seydx/camera.ui)",
|
|
6
6
|
"module": "./dist/bundle.js",
|
|
@@ -26,9 +26,8 @@
|
|
|
26
26
|
"axios": "^1.6.8",
|
|
27
27
|
"lodash.clonedeep": "^4.5.0",
|
|
28
28
|
"lodash.isequal": "^4.5.0",
|
|
29
|
-
"nats.ws": "^1.25.0",
|
|
30
29
|
"rxjs": "^7.8.1",
|
|
31
|
-
"
|
|
30
|
+
"socket.io-client": "^4.7.5"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
33
|
"@rushstack/eslint-patch": "^1.10.2",
|
|
@@ -41,11 +40,11 @@
|
|
|
41
40
|
"eslint-config-prettier": "^9.1.0",
|
|
42
41
|
"eslint-plugin-prettier": "^5.1.3",
|
|
43
42
|
"prettier": "^3.2.5",
|
|
44
|
-
"rimraf": "^5.0.
|
|
43
|
+
"rimraf": "^5.0.6",
|
|
45
44
|
"ts-loader": "^9.5.1",
|
|
46
45
|
"typescript": "^5.4.5",
|
|
47
46
|
"updates": "^16.0.1",
|
|
48
|
-
"utf-8-validate": "^6.0.
|
|
47
|
+
"utf-8-validate": "^6.0.4",
|
|
49
48
|
"webpack": "^5.91.0",
|
|
50
49
|
"webpack-cli": "^5.1.4"
|
|
51
50
|
},
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { BehaviorSubject, Observable } from 'rxjs';
|
|
2
|
-
import { Subscribed } from '../utils/subscribed';
|
|
3
|
-
import type { Camera, CameraInformation, CameraPublicProperties, CameraType, CameraZone } from '../../api/database/types';
|
|
4
|
-
import type { Frame } from '../../detector/types';
|
|
5
|
-
import type { IceServer } from '../../services/config/types';
|
|
6
|
-
import type { AudioState, BaseLogger, BatteryState, CameraDelegate, CameraPrebufferDelegate, CameraSource, DoorbellState, LightState, MotionState, ObjectState, OnSetEvent, SirenState, StateValues } from '../types';
|
|
7
|
-
export declare abstract class CameraDeviceBase extends Subscribed {
|
|
8
|
-
protected logger: BaseLogger;
|
|
9
|
-
protected cameraSubject: BehaviorSubject<Camera>;
|
|
10
|
-
protected cameraState: BehaviorSubject<boolean>;
|
|
11
|
-
protected lightState: BehaviorSubject<LightState>;
|
|
12
|
-
protected motionState: BehaviorSubject<MotionState>;
|
|
13
|
-
protected audioState: BehaviorSubject<AudioState>;
|
|
14
|
-
protected objectState: BehaviorSubject<ObjectState>;
|
|
15
|
-
protected doorbellState: BehaviorSubject<DoorbellState>;
|
|
16
|
-
protected sirenState: BehaviorSubject<SirenState>;
|
|
17
|
-
protected batteryState: BehaviorSubject<BatteryState>;
|
|
18
|
-
onConnected: Observable<boolean>;
|
|
19
|
-
onLightSwitched: Observable<LightState>;
|
|
20
|
-
onMotionDetected: Observable<MotionState>;
|
|
21
|
-
onAudioDetected: Observable<AudioState>;
|
|
22
|
-
onObjectDetected: Observable<ObjectState>;
|
|
23
|
-
onDoorbellPressed: Observable<DoorbellState>;
|
|
24
|
-
onSirenDetected: Observable<SirenState>;
|
|
25
|
-
onBatteryChanged: Observable<BatteryState>;
|
|
26
|
-
private _delegate?;
|
|
27
|
-
private _prebufferDelegate?;
|
|
28
|
-
get id(): string;
|
|
29
|
-
get nativeId(): string | undefined;
|
|
30
|
-
get pluginId(): string;
|
|
31
|
-
get state(): boolean;
|
|
32
|
-
get disabled(): boolean;
|
|
33
|
-
get name(): string;
|
|
34
|
-
get type(): CameraType;
|
|
35
|
-
get info(): CameraInformation;
|
|
36
|
-
get isCloud(): boolean;
|
|
37
|
-
get hasLight(): boolean;
|
|
38
|
-
get hasSiren(): boolean;
|
|
39
|
-
get hasBinarySensor(): boolean;
|
|
40
|
-
get hasBattery(): boolean;
|
|
41
|
-
get hasMotionDetector(): boolean;
|
|
42
|
-
get hasAudioDetector(): boolean;
|
|
43
|
-
get hasObjectDetector(): boolean;
|
|
44
|
-
get hasPtz(): boolean;
|
|
45
|
-
get motionZones(): CameraZone[];
|
|
46
|
-
get objectZones(): CameraZone[];
|
|
47
|
-
get sources(): CameraSource[];
|
|
48
|
-
get streamSource(): CameraSource;
|
|
49
|
-
get snapshotSource(): CameraSource;
|
|
50
|
-
get recordingSource(): CameraSource;
|
|
51
|
-
get detectionSource(): CameraSource;
|
|
52
|
-
get delegate(): CameraDelegate | undefined;
|
|
53
|
-
set delegate(delegate: CameraDelegate);
|
|
54
|
-
get prebufferDelegate(): CameraPrebufferDelegate | undefined;
|
|
55
|
-
set prebufferDelegate(delegate: CameraPrebufferDelegate);
|
|
56
|
-
constructor(camera: Camera, logger: BaseLogger);
|
|
57
|
-
abstract connect(): Promise<void>;
|
|
58
|
-
abstract disconnect(): Promise<void>;
|
|
59
|
-
abstract reboot(): Promise<void>;
|
|
60
|
-
abstract snapshot(forceNew?: boolean): Promise<ArrayBuffer>;
|
|
61
|
-
abstract generateFrames(): AsyncIterableIterator<Frame>;
|
|
62
|
-
abstract getFfmpegPath(): Promise<string>;
|
|
63
|
-
abstract getIceServers(): Promise<IceServer[]>;
|
|
64
|
-
protected abstract cleanup(): void;
|
|
65
|
-
getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
|
|
66
|
-
updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>): Promise<void>;
|
|
67
|
-
onStateChange<T extends keyof StateValues>(stateName: T): Observable<{
|
|
68
|
-
newState: StateValues[T];
|
|
69
|
-
oldState: StateValues[T];
|
|
70
|
-
}>;
|
|
71
|
-
onPropertyChange<T extends keyof CameraPublicProperties>(property: T): Observable<{
|
|
72
|
-
oldData: Camera[T];
|
|
73
|
-
newData: Camera[T];
|
|
74
|
-
}>;
|
|
75
|
-
removeAllListeners(): void;
|
|
76
|
-
private createStateObservable;
|
|
77
|
-
protected updateCamera(updatedCamera: Camera): void;
|
|
78
|
-
protected updateCameraState(state: boolean): void;
|
|
79
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { StreamingConnectionOptions } from '../streaming/peer-connection';
|
|
2
|
-
import { StreamingSession } from '../streaming/streaming-session';
|
|
3
|
-
import { CameraDeviceBase } from './base';
|
|
4
|
-
import type { FfmpegOptions } from '../types';
|
|
5
|
-
export declare abstract class ServerCameraDeviceBase extends CameraDeviceBase {
|
|
6
|
-
createSession(sourceName: string, options?: StreamingConnectionOptions): Promise<StreamingSession>;
|
|
7
|
-
streamVideo(sourceName: string, options: FfmpegOptions): Promise<StreamingSession>;
|
|
8
|
-
recordToFile(sourceName: string, outputPath: string, duration?: number): Promise<void>;
|
|
9
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { BaseLogger } from '../../../camera/types';
|
|
2
|
-
import type { ProxyMessageStructure } from '../../../proxy/types';
|
|
3
|
-
interface NatsConnection {
|
|
4
|
-
publish(subject: string, data: Uint8Array): void;
|
|
5
|
-
}
|
|
6
|
-
interface Subscription extends AsyncIterable<any> {
|
|
7
|
-
}
|
|
8
|
-
interface JSONCodec<T> {
|
|
9
|
-
encode(d: T): Uint8Array;
|
|
10
|
-
decode(a: Uint8Array): T;
|
|
11
|
-
}
|
|
12
|
-
export declare class ClientMessageQueue {
|
|
13
|
-
private logger;
|
|
14
|
-
private publisher;
|
|
15
|
-
private subscriber;
|
|
16
|
-
private requestHandler;
|
|
17
|
-
private jc;
|
|
18
|
-
private aborted;
|
|
19
|
-
private isProcessing;
|
|
20
|
-
private queue;
|
|
21
|
-
private pendingResponses;
|
|
22
|
-
constructor(logger: BaseLogger, publisher: NatsConnection, subscriber: Subscription, codec: JSONCodec<any>, requestHandler: (message: ProxyMessageStructure) => void);
|
|
23
|
-
abortQueue(): void;
|
|
24
|
-
enqueue(message: ProxyMessageStructure): Promise<any>;
|
|
25
|
-
private processQueue;
|
|
26
|
-
private listenToMessages;
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const NATS_SERVER_SUBJECT = "camera.ui-server";
|