@3deye-toolkit/react-camera 0.0.3 → 0.0.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.
@@ -1,4 +1,6 @@
1
1
  import type { IReactionDisposer } from 'mobx';
2
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
3
+ import { Matrix } from 'transformation-matrix';
2
4
  import { Observable } from 'rxjs';
3
5
  import { default as React_2 } from 'react';
4
6
  import { Ref } from 'react';
@@ -41,7 +43,7 @@ declare interface Box {
41
43
  Right: number;
42
44
  }
43
45
 
44
- export declare const BoxSelector: (({ onSelect, onRequestCancel, onClose }: Props_2) => React_2.JSX.Element) & {
46
+ export declare const BoxSelector: (({ onSelect, onRequestCancel, onClose }: Props_3) => JSX_2.Element) & {
45
47
  displayName: string;
46
48
  };
47
49
 
@@ -67,7 +69,7 @@ export declare class Camera {
67
69
  get supportsWebRTC(): boolean;
68
70
  constructor(raw: RawCamera);
69
71
  update: (raw: RawCamera) => void;
70
- can: (permission: CameraPermissions) => number;
72
+ can: (permission: CameraPermissions) => boolean;
71
73
  }
72
74
 
73
75
  declare interface Camera_2 {
@@ -89,7 +91,12 @@ declare interface Camera_2 {
89
91
  archiveDuration: number;
90
92
  permissions: number;
91
93
  raw: RawCamera;
92
- can: (permission: CameraPermissions) => number;
94
+ imageUrl: string;
95
+ stateUpdatedAt: Date;
96
+ state: string;
97
+ supportsWebRTC: boolean;
98
+ update: (raw: RawCamera) => void;
99
+ can: (permission: CameraPermissions) => boolean;
93
100
  }
94
101
 
95
102
  declare interface CameraAddress {
@@ -185,31 +192,31 @@ declare class Clip_2 {
185
192
  }
186
193
 
187
194
  export declare const CloseControl: {
188
- ({ onClick }: Props_4): React_2.JSX.Element | null;
195
+ ({ onClick }: Props_4): JSX_2.Element | null;
189
196
  displayName: string;
190
197
  };
191
198
 
192
- export declare const Control: React_2.FC<Props_5>;
199
+ export declare const Control: React_2.ForwardRefExoticComponent<Omit<Props_5, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
193
200
 
194
- export declare function Controls({ style, children }: Props_6): React_2.JSX.Element;
201
+ export declare function Controls({ style, children }: Props_6): JSX_2.Element;
195
202
 
196
203
  export declare namespace Controls {
197
- var Spacer: () => React_2.JSX.Element;
204
+ var Spacer: () => JSX_2.Element;
198
205
  }
199
206
 
200
- export declare const DefaultControls: (({ onRequestClose, fullscreenControl }: Props_8) => React_2.JSX.Element) & {
207
+ export declare const DefaultControls: (({ onRequestClose, fullscreenControl }: Props_8) => JSX_2.Element) & {
201
208
  displayName: string;
202
209
  };
203
210
 
204
211
  declare class ErrorBase<T extends string> extends Error {
205
212
  name: T;
206
213
  message: string;
207
- cause?: any;
208
- constructor(name: T, message: string, cause?: any);
214
+ cause?: unknown;
215
+ constructor(name: T, message: string, cause?: unknown);
209
216
  }
210
217
 
211
218
  export declare const FullscreenControl: {
212
- ({ toggle: toggle, active }: Props_7): React_2.JSX.Element;
219
+ ({ toggle, active }: Props_7): JSX_2.Element;
213
220
  displayName: string;
214
221
  };
215
222
 
@@ -236,11 +243,11 @@ declare class LiveChunk {
236
243
  setBounds: (range: [Date, Date]) => void;
237
244
  }
238
245
 
239
- export declare const PlaybackRateControl: (() => React_2.JSX.Element | null) & {
246
+ export declare const PlaybackRateControl: (() => JSX_2.Element | null) & {
240
247
  displayName: string;
241
248
  };
242
249
 
243
- export declare const Player: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<Omit<Props_3 & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>>;
250
+ export declare const Player: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<Omit<Props_2 & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>>;
244
251
 
245
252
  declare interface PlayerBehavior {
246
253
  state: PlayerState | null;
@@ -276,7 +283,11 @@ export declare class PlayerController {
276
283
  stats: any;
277
284
  mode: 'archive' | 'DVR' | 'WebRTC' | null;
278
285
  behavior: PlayerBehavior | null;
279
- transform: string | null;
286
+ transform: Matrix | null;
287
+ isRotating: boolean;
288
+ setTransform: (matrix: Matrix | null, animate?: boolean) => void;
289
+ resetTransform: () => void;
290
+ animationController: REACT_SRPING_CONTROLLER_TYPE_HACK;
280
291
  width: number;
281
292
  height: number;
282
293
  chunkRequest: {
@@ -327,8 +338,8 @@ export declare class PlayerController {
327
338
  private replaceErrorMessageOnOffline;
328
339
  changeMedia: ({ time, chunk, backward }: {
329
340
  time: Date;
330
- chunk?: LiveChunk | ArchiveChunk | undefined;
331
- backward?: boolean | undefined;
341
+ chunk?: ArchiveChunk | LiveChunk;
342
+ backward?: boolean;
332
343
  }) => void;
333
344
  private initCurrentTime;
334
345
  private initPlayableRange;
@@ -367,7 +378,6 @@ export declare class PlayerController {
367
378
  setPlaybackRate: (rate: number) => void;
368
379
  reactToVolumeChange(): void;
369
380
  togglePlayback: () => void;
370
- setTransform(transform: string | null): void;
371
381
  play: () => void;
372
382
  pause: () => void;
373
383
  detach: () => void;
@@ -379,7 +389,7 @@ export declare class PlayerController {
379
389
  declare class PlayerError extends ErrorBase<PlayerErrorType> {
380
390
  }
381
391
 
382
- declare type PlayerErrorType = 'PLAYER_ERROR' | 'MEDIA_ERROR' | 'STREAMING_ERROR' | 'CAMERA_OFFLINE_ERROR' | 'PLAYBACK_TIMEOUT_ERROR' | 'CONNECTION_TIMEOUT_ERROR' | 'NO_PLAYABLE_STREAM_ERROR' | 'NO_VIDEO_TRACK_ERROR';
392
+ declare type PlayerErrorType = 'PLAYER_ERROR' | 'MEDIA_ERROR' | 'STREAMING_ERROR' | 'CAMERA_OFFLINE_ERROR' | 'PLAYBACK_TIMEOUT_ERROR' | 'CONNECTION_TIMEOUT_ERROR' | 'CONNECTION_FAILED_ERROR' | 'NO_PLAYABLE_STREAM_ERROR' | 'NO_VIDEO_TRACK_ERROR';
383
393
 
384
394
  declare interface PlayerEventStreams {
385
395
  canSeek$: Observable<any>;
@@ -400,7 +410,7 @@ declare enum PlayerState {
400
410
  Failed = "failed"
401
411
  }
402
412
 
403
- export declare const PlayPauseControl: (() => React_2.JSX.Element) & {
413
+ export declare const PlayPauseControl: (() => JSX_2.Element) & {
404
414
  displayName: string;
405
415
  };
406
416
 
@@ -413,13 +423,7 @@ declare interface Props extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'on
413
423
  playerRef?: Ref<PlayerController>;
414
424
  }
415
425
 
416
- declare interface Props_2 {
417
- onSelect: (box: Box) => void;
418
- onClose: () => void;
419
- onRequestCancel: () => void;
420
- }
421
-
422
- declare interface Props_3 extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onMouseDown'> {
426
+ declare interface Props_2 extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onMouseDown'> {
423
427
  camera: Camera;
424
428
  startTime?: Date | null;
425
429
  endTime?: Date | null;
@@ -436,6 +440,12 @@ declare interface Props_3 extends Omit<React_2.HTMLAttributes<HTMLDivElement>, '
436
440
  archivesStore: ArchivesStore;
437
441
  }
438
442
 
443
+ declare interface Props_3 {
444
+ onSelect: (box: Box) => void;
445
+ onClose: () => void;
446
+ onRequestCancel: () => void;
447
+ }
448
+
439
449
  declare interface Props_4 {
440
450
  onClick?: () => void;
441
451
  }
@@ -446,8 +456,8 @@ declare type Props_5 = Omit<React_2.HTMLAttributes<HTMLButtonElement>, 'title'>
446
456
  };
447
457
 
448
458
  declare interface Props_6 {
449
- children: React_2.ReactNode;
450
- style?: React_2.CSSProperties;
459
+ children: React.ReactNode;
460
+ style?: React.CSSProperties;
451
461
  }
452
462
 
453
463
  declare interface Props_7 {
@@ -457,16 +467,16 @@ declare interface Props_7 {
457
467
 
458
468
  declare interface Props_8 {
459
469
  onRequestClose?: () => void;
460
- fullscreenControl?: React_2.ReactNode;
470
+ fullscreenControl?: React.ReactNode;
461
471
  }
462
472
 
463
- export declare const PtzControls: ((props: PtzControlsProps) => React_2.JSX.Element) & {
473
+ export declare const PtzControls: ((props: PtzControlsProps) => JSX_2.Element) & {
464
474
  displayName: string;
465
475
  };
466
476
 
467
477
  declare interface PtzControlsProps {
468
478
  cameraId: number;
469
- style?: React_2.CSSProperties;
479
+ style?: React.CSSProperties;
470
480
  initialZoomSpeed?: number;
471
481
  initialMovementSpeed?: number;
472
482
  disabled?: boolean;
@@ -550,12 +560,14 @@ declare interface RawClip {
550
560
  version: string;
551
561
  }
552
562
 
553
- export declare const ResizeModeControl: (() => React_2.JSX.Element) & {
563
+ declare type REACT_SRPING_CONTROLLER_TYPE_HACK = any;
564
+
565
+ export declare const ResizeModeControl: (() => JSX_2.Element) & {
554
566
  displayName: string;
555
567
  };
556
568
 
557
569
  export declare const SnapshotControl: {
558
- (): React_2.JSX.Element;
570
+ (): JSX_2.Element;
559
571
  displayName: string;
560
572
  };
561
573
 
@@ -582,12 +594,9 @@ export declare function usePlayerRef(): {
582
594
  player: PlayerController | null;
583
595
  };
584
596
 
585
- declare enum VideoResizeMode {
586
- Fit = "contain",
587
- Stretch = "fill"
588
- }
597
+ declare type VideoResizeMode = 'contain' | 'fill';
589
598
 
590
- export declare const VolumeControl: (() => React_2.JSX.Element) & {
599
+ export declare const VolumeControl: (() => JSX_2.Element) & {
591
600
  displayName: string;
592
601
  };
593
602