@3deye-toolkit/react-camera 0.0.1-alpha.26 → 0.0.1-alpha.29

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.
@@ -0,0 +1,972 @@
1
+ /// <reference types="react" />
2
+
3
+ import { BehaviorSubject } from 'rxjs';
4
+ import crossfilter from 'crossfilter2';
5
+ import type { IReactionDisposer } from 'mobx';
6
+ import { Observable } from 'rxjs';
7
+ import { default as React_2 } from 'react';
8
+ import { Subject } from 'rxjs';
9
+ import { Subscription } from 'rxjs';
10
+
11
+ declare class Api<T> {
12
+ [key: string]: any;
13
+ static create<T extends PartialApi>(apiConfig: T | null, authStore: Auth, createConnection: (accessToken: string) => Connection): Api<T> & ExtractHubs<IApi, T>;
14
+ connectionShutdown$: Subject<null>;
15
+ connection$: BehaviorSubject<Connection | null>;
16
+ events: Subject<{
17
+ hub: keyof typeof events;
18
+ event: string;
19
+ data: any;
20
+ }>;
21
+ logging: boolean;
22
+ authStore: Auth;
23
+ createConnection: (accessToken: string) => Connection;
24
+ apiConfig: PartialApi;
25
+ constructor(apiConfig: T, authStore: Auth, createConnection: (accessToken: string) => Connection);
26
+ connect(token: Token): void;
27
+ shutdownConnection(): void;
28
+ private init;
29
+ private createHubMethod;
30
+ private subscribeToEvents;
31
+ }
32
+
33
+ declare type ApiPageResult<T> = {
34
+ success: true;
35
+ resultItems: T[];
36
+ pageInfo: PageInfo;
37
+ } | {
38
+ success: false;
39
+ error: {
40
+ code: number;
41
+ message: string;
42
+ };
43
+ };
44
+
45
+ declare type ApiResult<T> = {
46
+ success: true;
47
+ resultItems: T[];
48
+ } | {
49
+ success: false;
50
+ error: {
51
+ code: number;
52
+ message: string;
53
+ };
54
+ };
55
+
56
+ declare abstract class ApiStore {
57
+ api: Api<IApi> & IApi;
58
+ disposables: (IReactionDisposer | Subscription)[];
59
+ protected afterInit?(): void;
60
+ initWith(api: Api<IApi> & IApi): void;
61
+ dispose(): void;
62
+ }
63
+
64
+ declare type ArchiveChunk = Chunk & {
65
+ isLive: false;
66
+ };
67
+
68
+ declare class ArchiveChunk_2 implements Chunk_2 {
69
+ json?: string;
70
+ startTime: Date;
71
+ endTime: Date;
72
+ streamUrl: string;
73
+ duration?: number;
74
+ isLive: false;
75
+ cameraId: number;
76
+ id: number;
77
+ constructor(raw: any);
78
+ }
79
+
80
+ declare class ArchivesStore extends ApiStore {
81
+ private camerasStore;
82
+ data: crossfilter.Crossfilter<ArchiveChunk_2>;
83
+ chunksByCameraId: crossfilter.Dimension<ArchiveChunk_2, number>;
84
+ chunksByStart: crossfilter.Dimension<ArchiveChunk_2, number>;
85
+ chunksByEnd: crossfilter.Dimension<ArchiveChunk_2, number>;
86
+ chunksById: Map<number, ArchiveChunk_2>;
87
+ private pendingRequests;
88
+ private pendingRequestsByEnd;
89
+ private pendingRequestsByStart;
90
+ private pendingRequestsByCameraId;
91
+ knownIntervals: Map<number, [Date, Date]>;
92
+ updates: number;
93
+ constructor(camerasStore: CamerasStore);
94
+ /**
95
+ * Fetches archive chunks for given camera and period
96
+ * @param cameraId - camera id
97
+ * @param startTime - start of the period
98
+ * @param endTime - end of the period
99
+ * TODO: add support for null endTime in order to remove requestedArchivesSince logic from player controller
100
+ * TODO: add error handling
101
+ */
102
+ fetch(cameraId: number, startTime: Date, endTime: Date): Observable<ArchiveChunk_2[]>;
103
+ extendKnownInterval(cameraId: number, startTime: Date, chunks: ArchiveChunk_2[]): void;
104
+ add(chunks: ArchiveChunk_2[]): void;
105
+ getChunks({ cameraId, from, to }: ChunksQuery): ArchiveChunk_2[];
106
+ /**
107
+ * Returns chunk that either contain the given time or is right adjacent to it
108
+ * @param camera - camera id
109
+ * @param time - time to search for
110
+ * @returns ArchiveChunk or undefined if there is no such chunk in the current archive
111
+ */
112
+ getClosestChunkRight: ({ cameraId, time }: {
113
+ cameraId: number;
114
+ time: Date;
115
+ }) => ArchiveChunk_2;
116
+ /**
117
+ * Return chunks that either contain the given time or is left adjacent to it
118
+ * @param camera - camera id
119
+ * @param time - time to search for
120
+ * @returns ArchiveChunk or undefined if there is no such chunk in the current archive
121
+ */
122
+ getClosestChunkLeft: ({ cameraId, time }: {
123
+ cameraId: number;
124
+ time: Date;
125
+ }) => ArchiveChunk_2;
126
+ fetchNextChunk: ({ cameraId, time }: {
127
+ cameraId: number;
128
+ time: Date;
129
+ }) => Observable<ArchiveChunk_2 | undefined>;
130
+ fetchPrevChunk: ({ cameraId, time }: {
131
+ cameraId: number;
132
+ time: Date;
133
+ }) => Observable<ArchiveChunk_2 | undefined>;
134
+ protected afterInit(): void;
135
+ }
136
+
137
+ declare class Auth {
138
+ token: Token | null;
139
+ isAuthenticating: boolean;
140
+ storage: Storage_2;
141
+ tokenServiceUrl: string;
142
+ tokenStorageKey: string;
143
+ deviceInfo: string | null;
144
+ clientId: string;
145
+ private pendingUpdateTokenRequest;
146
+ get isAuthenticated(): boolean;
147
+ constructor({ tokenServiceUrl, storage, tokenStorageKey, deviceInfo, clientId }: AuthStoreOptions);
148
+ signOut: () => void;
149
+ signIn: (options: {
150
+ username: string;
151
+ password: string;
152
+ replaceToken?: string;
153
+ agreedWithTerms?: boolean;
154
+ code?: string;
155
+ }) => Promise<Token> | undefined;
156
+ invalidateToken: () => void;
157
+ getTokenFromStorage(): Promise<Token | null>;
158
+ private storeToken;
159
+ private getInitialToken;
160
+ private fetchToken;
161
+ private updateToken;
162
+ private fetchWidgetToken;
163
+ }
164
+
165
+ declare interface AuthStoreOptions {
166
+ tokenServiceUrl: string;
167
+ storage: Storage_2;
168
+ tokenStorageKey: string;
169
+ deviceInfo: any;
170
+ clientId: string;
171
+ }
172
+
173
+ declare type BehaviorFactory = (controller: PlayerController) => PlayerBehavior;
174
+
175
+ declare interface Box {
176
+ Top: number;
177
+ Left: number;
178
+ Bottom: number;
179
+ Right: number;
180
+ }
181
+
182
+ export declare const BoxSelector: (({ onSelect, onRequestCancel, onClose }: Props_2) => JSX.Element) & {
183
+ displayName: string;
184
+ };
185
+
186
+ export declare class Camera {
187
+ id: number;
188
+ name: string;
189
+ imageUrl: string;
190
+ streamUrl: string;
191
+ dashStreamUrl: string;
192
+ address: {
193
+ Lat: number;
194
+ Lng: number;
195
+ } | null;
196
+ archiveDuration: number;
197
+ dvrWindowLength: number;
198
+ stateUpdatedAt: Date;
199
+ raw: RawCamera;
200
+ enabled: boolean;
201
+ isMicEnabled: boolean;
202
+ state: string;
203
+ pin: string;
204
+ webRtcUrl: string;
205
+ isPtz: boolean;
206
+ permissions: number;
207
+ get isOnline(): boolean;
208
+ get supportsWebRTC(): boolean;
209
+ constructor(raw: RawCamera);
210
+ update: (raw: RawCamera) => void;
211
+ }
212
+
213
+ declare const Camera_2: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<Pick<Props & React_2.RefAttributes<HTMLDivElement>, "key" | keyof Props> & React_2.RefAttributes<HTMLDivElement>>>;
214
+ export default Camera_2;
215
+
216
+ declare interface Camera_3 {
217
+ id: number;
218
+ name: string;
219
+ streamUrl: string;
220
+ dashStreamUrl: string;
221
+ webRtcUrl: string;
222
+ pin: string;
223
+ dvrWindowLength: number;
224
+ enabled: boolean;
225
+ isOnline: boolean;
226
+ isPtz: boolean;
227
+ isMicEnabled: boolean;
228
+ address?: {
229
+ Lat: number;
230
+ Lng: number;
231
+ } | null;
232
+ archiveDuration: number;
233
+ permissions: number;
234
+ raw: RawCamera;
235
+ }
236
+
237
+ declare class CamerasStore extends ApiStore {
238
+ camerasById: Map<number, Camera>;
239
+ data: Camera[];
240
+ loading: boolean;
241
+ loaded: boolean;
242
+ constructor();
243
+ load: () => Observable<RawCamera[]> | undefined;
244
+ add: (cameras: RawCamera[]) => void;
245
+ sync: () => Observable<RawCamera[]>;
246
+ protected afterInit(): void;
247
+ dispose(): void;
248
+ }
249
+
250
+ declare interface CameraStatistics {
251
+ id: number;
252
+ month: number;
253
+ trafficOutMBytes: number;
254
+ archiveStorageMBytes: number;
255
+ clipStorageMBytes: number;
256
+ }
257
+
258
+ declare interface CamgroupItem {
259
+ id: number;
260
+ order: number;
261
+ }
262
+
263
+ declare interface Chunk {
264
+ startTime: Date;
265
+ endTime: Date;
266
+ streamUrl: string;
267
+ duration?: number;
268
+ cameraId: number;
269
+ }
270
+
271
+ declare interface Chunk_2 {
272
+ json?: string;
273
+ startTime: Date;
274
+ endTime: Date;
275
+ streamUrl: string;
276
+ duration?: number;
277
+ }
278
+
279
+ declare interface ChunksQuery {
280
+ cameraId: number;
281
+ from: Date;
282
+ to: Date;
283
+ }
284
+
285
+ declare interface Clip {
286
+ id: number;
287
+ cameraId: number;
288
+ startTime: Date;
289
+ endTime: Date;
290
+ isTimelapse: boolean;
291
+ duration: number;
292
+ clipUrl?: string;
293
+ name: string;
294
+ }
295
+
296
+ export declare const CloseControl: {
297
+ ({ onClick }: Props_3): JSX.Element | null;
298
+ displayName: string;
299
+ };
300
+
301
+ declare interface Connection {
302
+ state: CONNECTION_STATE;
303
+ stop: () => void;
304
+ start: () => Connection;
305
+ done: (callback: () => void) => Connection;
306
+ fail: (callback: (err: any) => void) => Connection;
307
+ error: (callback: (err: any) => void) => Connection;
308
+ disconnected: (callback: () => void) => Connection;
309
+ reconnecting: (callback: () => void) => Connection;
310
+ reconnected: (callback: () => void) => Connection;
311
+ proxies: {
312
+ [P in keyof typeof FULL_API_CONFIG]: {
313
+ on: (eventName: string, callback: (data: any) => void) => void;
314
+ invoke: any;
315
+ };
316
+ };
317
+ createHubProxy: (hubName: string) => void;
318
+ lastError: any;
319
+ qs: {
320
+ access_token: string;
321
+ };
322
+ }
323
+
324
+ declare enum CONNECTION_STATE {
325
+ CONNECTING = 0,
326
+ CONNECTED = 1,
327
+ RECONNECTING = 2,
328
+ DISCONNECTED = 3
329
+ }
330
+
331
+ export declare const Control: React_2.FC<Props_4>;
332
+
333
+ export declare class Controls extends React_2.Component<Props_5> {
334
+ get player(): PlayerController;
335
+ static contextType: React_2.Context<PlayerController>;
336
+ static Spacer: React_2.FC;
337
+ containerRef: React_2.RefObject<HTMLDivElement>;
338
+ mutationObserver: MutationObserver;
339
+ resizeReactionDisposer: IReactionDisposer;
340
+ componentDidUpdate(): void;
341
+ componentDidMount(): void;
342
+ reflow: () => void;
343
+ componentWillUnmount(): void;
344
+ render(): JSX.Element;
345
+ }
346
+
347
+ declare type DeepPartial<T> = {
348
+ [K in keyof T]?: DeepPartial<T[K]>;
349
+ };
350
+
351
+ export declare const DefaultControls: (({ onRequestClose, fullscreenControl }: Props_7) => JSX.Element) & {
352
+ displayName: string;
353
+ };
354
+
355
+ declare const events: {
356
+ [P in keyof PartialApi]: {
357
+ name: string;
358
+ explicit?: boolean;
359
+ }[];
360
+ };
361
+
362
+ declare type EventType = 'Motion' | 'Tampering' | 'PanTiltZoom' | 'CrossLine' | 'Intrusion' | 'LicensePlate' | 'FaceDetection' | 'Audio' | 'Analytic' | 'SpeedDetection' | 'PeopleCounter' | 'Temperature' | 'PoS' | 'GPS' | 'DigitalInput' | 'Normal' | 'Suspicious' | 'Loitering' | 'Vandalism' | 'Trespass' | 'Emergency' | 'LifeInDanger' | 'ErroneousAlert' | 'Misidentification' | 'Fire' | 'MedicalDuress' | 'HoldUp' | 'CheckIn' | 'CheckOut' | 'ClockIn' | 'ClockOut' | 'ParkingStart' | 'ParkingEnd' | 'ParkingViolation' | 'GateAccess' | 'DoorAccess' | 'TemperatureCheck' | 'IDCheck' | 'PPECheck' | 'WelfareCheck' | 'Uncategorized' | 'Unknown';
363
+
364
+ declare type ExtractHubs<T, K> = {
365
+ [P in keyof ExtractMethods<T, K>]: ExtractMethods<T[P], K[P]>;
366
+ };
367
+
368
+ declare type ExtractMethods<T, K> = Pick<T, Extract<keyof T, keyof K>>;
369
+
370
+ declare const FULL_API_CONFIG: IApi;
371
+
372
+ export declare const FullscreenControl: {
373
+ ({ toggle: toggle, active }: Props_6): JSX.Element;
374
+ displayName: string;
375
+ };
376
+
377
+ declare interface IApi {
378
+ archives: {
379
+ PopulateArchive: (params: {
380
+ cameraId: number;
381
+ endTime: Date;
382
+ startTime: Date;
383
+ }) => Observable<any>;
384
+ GetArchives: (params: Record<string, never>) => Observable<ApiResult<RawClip>>;
385
+ GetClips: () => Observable<any>;
386
+ UpdateClip: (params: any) => Observable<any>;
387
+ DeleteClip: (params: any) => Observable<any>;
388
+ SaveClip: (params: any) => Observable<any>;
389
+ SaveTimelaps: (params: any) => Observable<any>;
390
+ SaveArchive: (params: any) => Observable<any>;
391
+ DeleteArchive: (params: any) => Observable<any>;
392
+ ShareClip: (sharedClip: RawSharedClip) => Observable<ApiResult<RawSharedClip>>;
393
+ GetSharedClips: (recordId: number | null) => Observable<ApiResult<RawSharedClip>>;
394
+ UpdateSharedClip: (sharedClip: RawSharedClip) => Observable<ApiResult<RawSharedClip>>;
395
+ DeleteSharedClip: (recordId: number) => Observable<ApiResult<RawSharedClip>>;
396
+ };
397
+ cameras: {
398
+ GetCameras: (camera: {
399
+ id?: number;
400
+ } | null, since: Date | null) => Observable<ApiResult<RawCamera>>;
401
+ GetSensorDataSchema: (eventType: EventType) => Observable<any>;
402
+ GetSensorEvents: (params: SensorEventsParams, filter: string, box: Box) => Observable<ApiResult<RawSensorEvent>>;
403
+ GetSensorEventsPage: (request: SensorEventsRequest, filter: string | null, searchPolygons: string[]) => Observable<ApiPageResult<RawSensorEvent>>;
404
+ AddUserSensorEvent: (event: PartialExcept<RawSensorEvent, 'id' | 'eventType' | 'message'>) => Observable<ApiResult<RawSensorEvent>>;
405
+ AcknowledgeSensorEvent: (event: PartialExcept<RawSensorEvent, 'id' | 'ackEventType' | 'message'>) => Observable<ApiResult<RawSensorEvent>>;
406
+ MoveCamera: (camera: {
407
+ id: number;
408
+ }, x: number, y: number, zoom: number, moveSpeed: number, zoomSpeed: number) => Observable<any>;
409
+ MoveCameraContinuousStart: ({ id }: {
410
+ id: number;
411
+ }, x: number, y: number, zoom: number, timeout: number) => Observable<any>;
412
+ MoveCameraContinuousStop: ({ id }: {
413
+ id: number;
414
+ }) => Observable<any>;
415
+ GoHomePtzCamera: ({ id }: {
416
+ id: number;
417
+ }) => Observable<any>;
418
+ SetHomePtzCamera: ({ id }: {
419
+ id: number;
420
+ }) => Observable<any>;
421
+ };
422
+ camgroups: {
423
+ GetCamgroups: () => Observable<ApiResult<RawCamgroup>>;
424
+ DeleteCamgroup: (params: any) => Observable<ApiResult<RawCamgroup>>;
425
+ AddCamgroup: (params: any) => Observable<ApiResult<RawCamgroup>>;
426
+ UpdateCamgroup: (params: any) => Observable<ApiResult<RawCamgroup>>;
427
+ };
428
+ sound: {
429
+ GetPushSoundServiceUrl: (id: number) => Observable<any>;
430
+ };
431
+ thumbnails: {
432
+ GetThumbnailsInfo: (params: {
433
+ cameraId: number;
434
+ from: Date;
435
+ to: Date;
436
+ count: number;
437
+ }) => Observable<any>;
438
+ GetThumbnailInfo: (params: {
439
+ cameraId: number;
440
+ from: Date;
441
+ to: Date;
442
+ }) => Observable<any>;
443
+ GetHeatMapsInfo: (params: {
444
+ cameraId: number;
445
+ from: Date;
446
+ to: Date;
447
+ count: number;
448
+ }) => Observable<any>;
449
+ };
450
+ users: {
451
+ GetUser: () => Observable<ApiResult<RawUser>>;
452
+ UserUpdateProfile: (user: Partial<RawUser>) => Observable<ApiResult<RawUser>>;
453
+ };
454
+ }
455
+
456
+ declare class LiveChunk {
457
+ cameraId: number;
458
+ streamUrl: string;
459
+ dashStreamUrl: string;
460
+ startTime: Date;
461
+ endTime: Date;
462
+ length: number;
463
+ isLive: boolean;
464
+ isDvr: boolean;
465
+ hasDvr: boolean;
466
+ rtmpStreamUrl: string;
467
+ managed: boolean;
468
+ constructor(data: {
469
+ cameraId: number;
470
+ endTime: Date;
471
+ startTime: Date;
472
+ streamUrl: string;
473
+ dashStreamUrl: string;
474
+ length: number;
475
+ });
476
+ setBounds: (range: [Date, Date]) => void;
477
+ }
478
+
479
+ declare interface PageInfo {
480
+ isDescending: boolean;
481
+ nextPageToken: number;
482
+ haveMore: boolean;
483
+ }
484
+
485
+ declare type PartialApi = DeepPartial<IApi>;
486
+
487
+ declare type PartialExcept<T, K extends keyof T> = Pick<T, K> & Partial<T>;
488
+
489
+ export declare const PlaybackRateControl: (() => JSX.Element | null) & {
490
+ displayName: string;
491
+ };
492
+
493
+ declare interface PlayerBehavior {
494
+ player: PlayerController;
495
+ delay?: number;
496
+ live?: boolean;
497
+ seek?: (time: Date) => void;
498
+ goLive?: () => void;
499
+ getCurrentTime: () => Date | null;
500
+ getDateRange?: () => [Date, Date] | null;
501
+ dispose: () => Promise<void> | void;
502
+ }
503
+
504
+ export declare const PlayerContext: React_2.Context<PlayerController>;
505
+
506
+ export declare class PlayerController {
507
+ id: number;
508
+ disposables: (IReactionDisposer | Subscription)[];
509
+ liveChunk?: LiveChunk | null;
510
+ currentTime: Date | null;
511
+ targetTime: Date | null;
512
+ chunk: ArchiveChunk | LiveChunk | null;
513
+ paused: boolean;
514
+ loading: boolean;
515
+ error: any;
516
+ playbackRate: number;
517
+ volume: number;
518
+ muted: boolean;
519
+ videoResizeMode: VideoResizeMode;
520
+ camera: Camera_3;
521
+ stats: any;
522
+ mode: 'archive' | 'DVR' | 'WebRTC' | null;
523
+ behavior: PlayerBehavior | null;
524
+ transform: string | null;
525
+ width: number;
526
+ height: number;
527
+ chunkRequest: {
528
+ time: Date;
529
+ backward: boolean;
530
+ } | null;
531
+ video: HTMLVideoElement;
532
+ clip?: Clip;
533
+ startTime: Date | null;
534
+ endTime: Date | null;
535
+ stream: MediaStream | null;
536
+ canSeek: boolean;
537
+ canSeek$: Observable<any>;
538
+ progress$: Observable<any>;
539
+ muted$: Observable<boolean>;
540
+ volume$: Observable<number>;
541
+ ended$: Observable<any>;
542
+ archivesStore: ArchivesStore;
543
+ behaviors: {
544
+ archive: BehaviorFactory;
545
+ DVR: BehaviorFactory;
546
+ WebRTC: BehaviorFactory | null;
547
+ };
548
+ seekTime?: Date | null;
549
+ constructor({ camera, startTime, endTime, clip, archivesStore, behaviors }: {
550
+ camera: Camera_3;
551
+ clip?: Clip;
552
+ startTime?: Date | null;
553
+ endTime?: Date;
554
+ archivesStore: ArchivesStore;
555
+ behaviors: {
556
+ archive: BehaviorFactory;
557
+ DVR: BehaviorFactory;
558
+ WebRTC: BehaviorFactory | null;
559
+ };
560
+ });
561
+ attach(video: HTMLVideoElement, { canSeek$, progress$, muted$, volume$, ended$ }: PlayerEventStreams): void;
562
+ seek: (time: Date) => void;
563
+ seekAfterReady(): void;
564
+ stopLoadingOnError(): void;
565
+ replaceErrorMessageOnOffline(): void;
566
+ changeMedia: ({ time, chunk, backward }: {
567
+ time: Date;
568
+ chunk?: LiveChunk | ArchiveChunk | undefined;
569
+ backward?: boolean | undefined;
570
+ }) => void;
571
+ initCurrentTime(): void;
572
+ /**
573
+ * If the chunk after chunk request is the same as the current chunk,
574
+ * then we can dismiss loading indicator and seek.
575
+ */
576
+ initSameChunkRequestFix(): void;
577
+ initLiveChunkUpdate(): void;
578
+ initChunkRequest(): void;
579
+ setupLiveChunk(): void;
580
+ /**
581
+ * Inits correct behavior for current player mode
582
+ */
583
+ initPlayerBehavior(): void;
584
+ /**
585
+ * Rewind by given amount of milliseconds
586
+ * @param value milliseconds
587
+ * @returns
588
+ */
589
+ seekBackward: (value: number) => void;
590
+ /**
591
+ * Seek forward by given amount of milliseconds
592
+ * @param value
593
+ * @returns
594
+ */
595
+ seekForward: (value: number) => void;
596
+ goLive: () => void;
597
+ fallbackToDVR: () => void;
598
+ setCamera: (camera: Camera_3) => void;
599
+ setCameraAndStartTime: (camera: Camera_3, startTime: Date | null) => void;
600
+ toggleResizeMode: () => void;
601
+ setVideoResizeMode: (mode: VideoResizeMode) => void;
602
+ toggleMute: () => void;
603
+ setStartTime: (time: Date | null) => void;
604
+ setVolume: (volume: number) => void;
605
+ setPlaybackRate: (rate: number) => void;
606
+ reactToVolumeChange(): void;
607
+ togglePlayback: () => void;
608
+ setTransform(transform: string | null): void;
609
+ play: () => void;
610
+ pause: () => void;
611
+ detach: () => void;
612
+ private initUpgradeToWebRtc;
613
+ }
614
+
615
+ declare interface PlayerEventStreams {
616
+ canSeek$: Observable<any>;
617
+ progress$: Observable<any>;
618
+ ended$: Observable<any>;
619
+ volume$: Observable<number>;
620
+ muted$: Observable<boolean>;
621
+ }
622
+
623
+ export declare const PlayPauseControl: (() => JSX.Element) & {
624
+ displayName: string;
625
+ };
626
+
627
+ declare interface Props extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onMouseDown'> {
628
+ cameraId: number;
629
+ startTime?: Date | null;
630
+ controls?: React_2.ReactNode;
631
+ onMouseDown?: (e: MouseEvent) => void;
632
+ onRequestClose?: () => void;
633
+ }
634
+
635
+ declare interface Props_2 {
636
+ onSelect: (box: Box) => void;
637
+ onClose: () => void;
638
+ onRequestCancel: () => void;
639
+ }
640
+
641
+ declare interface Props_3 {
642
+ onClick?: () => void;
643
+ }
644
+
645
+ declare type Props_4 = React_2.HTMLAttributes<HTMLButtonElement> & {
646
+ ref?: React_2.Ref<HTMLButtonElement>;
647
+ };
648
+
649
+ declare interface Props_5 {
650
+ children: React_2.ReactNode;
651
+ style?: React_2.CSSProperties;
652
+ }
653
+
654
+ declare interface Props_6 {
655
+ toggle: (() => void) | null;
656
+ active: boolean;
657
+ }
658
+
659
+ declare interface Props_7 {
660
+ onRequestClose?: () => void;
661
+ fullscreenControl?: React_2.ReactNode;
662
+ }
663
+
664
+ export declare const PtzControls: ((props: PtzControlsProps) => JSX.Element) & {
665
+ displayName: string;
666
+ };
667
+
668
+ declare interface PtzControlsProps {
669
+ cameraId: number;
670
+ style?: React_2.CSSProperties;
671
+ initialZoomSpeed?: number;
672
+ initialMovementSpeed?: number;
673
+ disabled?: boolean;
674
+ disallowHomePositionUpdate?: boolean;
675
+ disallowGoHome?: boolean;
676
+ }
677
+
678
+ declare interface RawCamera {
679
+ id: number;
680
+ customerId: number;
681
+ name: string;
682
+ description: string;
683
+ cameraBrand: string;
684
+ cameraModel: string;
685
+ enabled: boolean;
686
+ cameraUserName: string;
687
+ cameraPassword: null;
688
+ serialNum: string;
689
+ isOnvif: boolean;
690
+ isP2P: boolean;
691
+ p2pRegistrationCode: null;
692
+ planId: null;
693
+ p2pState: string;
694
+ cameraVideoFormat: string;
695
+ cameraState: string;
696
+ cameraStateChangedTime: string;
697
+ cameraError: null;
698
+ cameraAddress: string;
699
+ isMicEnabled: boolean;
700
+ imageQuality: number;
701
+ cameraSourceChannel: string;
702
+ pin: string;
703
+ streamUrl: string;
704
+ dashStreamUrl: string;
705
+ rtmpUrl: string;
706
+ webRtcStreamHost: string;
707
+ webRtcUrl: string;
708
+ cameraHttpSourceUrl: string;
709
+ cameraRtspSourceUrl: string;
710
+ supportedResolutions: string;
711
+ cameraType: string;
712
+ isCloud: boolean;
713
+ generateImageUrl: null;
714
+ imageUrl: string;
715
+ qualityProfile: string;
716
+ encodingProfile: null;
717
+ width: number;
718
+ height: number;
719
+ bitRate: number;
720
+ frameRate: number;
721
+ archiveDuration: number;
722
+ isArchiveByMotionEvent: boolean;
723
+ isAnalyticsEnabled: boolean;
724
+ isTimelapseAvailable: boolean;
725
+ motionEnabled: boolean;
726
+ isPTZ: boolean;
727
+ motionDuration: number;
728
+ dvrWindowLength: number;
729
+ jsonField: string;
730
+ dtUpdUtc: string;
731
+ version: string;
732
+ statistics: CameraStatistics;
733
+ }
734
+
735
+ declare interface RawCamgroup {
736
+ id: number;
737
+ name: string | null;
738
+ text: null;
739
+ description: null;
740
+ iconUrl: null;
741
+ iconCls: null;
742
+ dynamic: boolean;
743
+ allowDuplicates: boolean;
744
+ allowDrop: boolean;
745
+ allowNodeDropInView: boolean;
746
+ visible: boolean;
747
+ layout_id: string;
748
+ contentFilter: null;
749
+ customerWideGroup: boolean;
750
+ cameras: CamgroupItem[];
751
+ camgroups: CamgroupItem[];
752
+ version: string;
753
+ order: number;
754
+ }
755
+
756
+ declare interface RawClip {
757
+ id: number;
758
+ recordType: string;
759
+ isReady: boolean;
760
+ name: string;
761
+ description: string;
762
+ tagName: null;
763
+ cameraId: number;
764
+ clipUrl: string;
765
+ thumbnailUrl: string;
766
+ startTime: string;
767
+ endTime: string;
768
+ duration: number;
769
+ validTo: string;
770
+ timeCreated: string;
771
+ timeUpdated: string;
772
+ version: string;
773
+ }
774
+
775
+ declare interface RawSensorEvent {
776
+ message: string;
777
+ data: string | null;
778
+ id: number;
779
+ customerId: number;
780
+ sensorId: number;
781
+ sensorType: 'CameraSensor' | 'MotionSensor' | 'IntrusionSensor' | 'AudioSensor' | 'TemperatureSensor' | 'SpeedSensor' | 'Unknown';
782
+ eventType: EventType;
783
+ ackEventType: string;
784
+ description?: any;
785
+ tags?: any;
786
+ customerData?: any;
787
+ startTime: string;
788
+ endTime: string;
789
+ userId: string;
790
+ }
791
+
792
+ declare interface RawSharedClip {
793
+ id: number;
794
+ recordId: number;
795
+ creatorUserId: number;
796
+ cameraId: number;
797
+ startTime: string | Date;
798
+ endTime: string | Date;
799
+ duration: number;
800
+ fileSize: number;
801
+ password: string;
802
+ name: string;
803
+ description: string;
804
+ url: string;
805
+ validTo: string | Date;
806
+ }
807
+
808
+ declare type RawToken = {
809
+ accessToken: string;
810
+ accessTokenExpires: string;
811
+ accessTokenIssued: string;
812
+ clientId: string;
813
+ expiresIn: number;
814
+ refreshToken: string;
815
+ refreshTokenExpires: string;
816
+ refreshTokenIssued: string;
817
+ tokenType: string;
818
+ userName: string;
819
+ } & {
820
+ access_token: string;
821
+ access_token_expires: string;
822
+ access_token_issued: string;
823
+ client_id: string;
824
+ expires_in: number;
825
+ refresh_token: string;
826
+ refresh_token_expires: string;
827
+ refresh_token_issued: string;
828
+ token_type: string;
829
+ userName: string;
830
+ } & {
831
+ widgetId?: string;
832
+ widgetToken?: string;
833
+ };
834
+
835
+ declare interface RawUser {
836
+ id: number;
837
+ customerId: number;
838
+ userName: string;
839
+ firstName?: string;
840
+ lastName?: string;
841
+ email: string;
842
+ languageCode: string;
843
+ layoutStartId: number | null;
844
+ layoutStartType: 'camera' | 'camgroup' | '';
845
+ timeZoneOffset: string;
846
+ connectionId: string;
847
+ ipAddress: string;
848
+ userRoles: string[];
849
+ lastLoginAt: Date;
850
+ createdAt: Date;
851
+ jsonField: string;
852
+ imageUrl: null;
853
+ permissions: number;
854
+ version: string;
855
+ }
856
+
857
+ export declare const ResizeModeControl: (() => JSX.Element) & {
858
+ displayName: string;
859
+ };
860
+
861
+ declare interface SensorEventsParams {
862
+ sensorId: number;
863
+ sensorType: 'CameraSensor' | 'MotionSensor' | 'IntrusionSensor' | 'AudioSensor' | 'TemperatureSensor' | 'SpeedSensor' | 'Unknown';
864
+ startTime: Date;
865
+ endTime: Date;
866
+ eventType: EventType;
867
+ }
868
+
869
+ declare interface SensorEventsRequest {
870
+ sensorIds: number[];
871
+ sensorType: string;
872
+ sensorEventTypes: SensorEventType[];
873
+ startTime?: Date;
874
+ endTime?: Date;
875
+ isDescending: boolean;
876
+ rowsLimit: number;
877
+ pageToken?: number;
878
+ }
879
+
880
+ declare enum SensorEventType {
881
+ Motion = 0,
882
+ Tampering = 1,
883
+ PanTiltZoom = 2,
884
+ CrossLine = 3,
885
+ Intrusion = 4,
886
+ LicensePlate = 5,
887
+ FaceDetection = 6,
888
+ Audio = 7,
889
+ Analytic = 8,
890
+ SpeedDetection = 9,
891
+ PeopleCounter = 10,
892
+ Temperature = 11,
893
+ PoS = 12,
894
+ GPS = 13,
895
+ DigitalInput = 14,
896
+ Normal = 15,
897
+ Suspicious = 16,
898
+ Loitering = 17,
899
+ Vandalism = 18,
900
+ Trespass = 19,
901
+ Emergency = 20,
902
+ LifeInDanger = 21,
903
+ ErroneousAlert = 22,
904
+ Misidentification = 23,
905
+ Fire = 24,
906
+ MedicalDuress = 25,
907
+ HoldUp = 26,
908
+ CheckIn = 27,
909
+ CheckOut = 28,
910
+ ClockIn = 29,
911
+ ClockOut = 30,
912
+ ParkingStart = 31,
913
+ ParkingEnd = 32,
914
+ ParkingViolation = 33,
915
+ GateAccess = 34,
916
+ DoorAccess = 35,
917
+ TemperatureCheck = 36,
918
+ IDCheck = 37,
919
+ PPECheck = 38,
920
+ WelfareCheck = 39,
921
+ Uncategorized = 40,
922
+ Unknown = 999
923
+ }
924
+
925
+ export declare class SnapshotControl extends React_2.Component {
926
+ static contextType: React_2.Context<PlayerController>;
927
+ get player(): PlayerController;
928
+ getSnapshot: () => void;
929
+ render(): JSX.Element;
930
+ }
931
+
932
+ declare interface Storage_2 {
933
+ setItem: (key: string, value: string) => void | Promise<undefined>;
934
+ getItem: (key: string) => (string | null) | Promise<string | null>;
935
+ removeItem: (key: string) => void | Promise<undefined>;
936
+ }
937
+
938
+ declare class Token {
939
+ accessToken: string;
940
+ accessTokenExpires: Date;
941
+ accessTokenIssued: Date;
942
+ clientId: string;
943
+ expiresIn: number;
944
+ refreshToken: string;
945
+ refreshTokenExpires: Date;
946
+ refreshTokenIssued: Date;
947
+ tokenType: string;
948
+ userName: string;
949
+ invalid: boolean;
950
+ widgetId?: string;
951
+ widgetToken?: string;
952
+ json: RawToken;
953
+ constructor(raw: RawToken);
954
+ }
955
+
956
+ export declare function useFullscreen(): {
957
+ ref: (node: HTMLElement | null) => void;
958
+ toggle: () => undefined;
959
+ enabled: boolean;
960
+ active: boolean;
961
+ };
962
+
963
+ declare enum VideoResizeMode {
964
+ Fit = "contain",
965
+ Stretch = "fill"
966
+ }
967
+
968
+ export declare const VolumeControl: (() => JSX.Element) & {
969
+ displayName: string;
970
+ };
971
+
972
+ export { }