@3deye-toolkit/react-camera 0.0.4 → 0.0.6
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/react-camera.css +1 -914
- package/dist/react-camera.d.ts +39 -83
- package/dist/react-camera.js +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +3 -4
package/dist/react-camera.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IReactionDisposer } from 'mobx';
|
|
2
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
3
|
import { Matrix } from 'transformation-matrix';
|
|
3
4
|
import { Observable } from 'rxjs';
|
|
4
5
|
import { default as React_2 } from 'react';
|
|
@@ -42,7 +43,7 @@ declare interface Box {
|
|
|
42
43
|
Right: number;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
export declare const BoxSelector: (({ onSelect, onRequestCancel, onClose }:
|
|
46
|
+
export declare const BoxSelector: (({ onSelect, onRequestCancel, onClose }: Props_3) => JSX_2.Element) & {
|
|
46
47
|
displayName: string;
|
|
47
48
|
};
|
|
48
49
|
|
|
@@ -68,7 +69,7 @@ export declare class Camera {
|
|
|
68
69
|
get supportsWebRTC(): boolean;
|
|
69
70
|
constructor(raw: RawCamera);
|
|
70
71
|
update: (raw: RawCamera) => void;
|
|
71
|
-
can: (permission: CameraPermissions) =>
|
|
72
|
+
can: (permission: CameraPermissions) => boolean;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
declare interface Camera_2 {
|
|
@@ -90,7 +91,12 @@ declare interface Camera_2 {
|
|
|
90
91
|
archiveDuration: number;
|
|
91
92
|
permissions: number;
|
|
92
93
|
raw: RawCamera;
|
|
93
|
-
|
|
94
|
+
imageUrl: string;
|
|
95
|
+
stateUpdatedAt: Date;
|
|
96
|
+
state: string;
|
|
97
|
+
supportsWebRTC: boolean;
|
|
98
|
+
update: (raw: RawCamera) => void;
|
|
99
|
+
can: (permission: CameraPermissions) => boolean;
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
declare interface CameraAddress {
|
|
@@ -186,31 +192,31 @@ declare class Clip_2 {
|
|
|
186
192
|
}
|
|
187
193
|
|
|
188
194
|
export declare const CloseControl: {
|
|
189
|
-
({ onClick }: Props_4):
|
|
195
|
+
({ onClick }: Props_4): JSX_2.Element | null;
|
|
190
196
|
displayName: string;
|
|
191
197
|
};
|
|
192
198
|
|
|
193
199
|
export declare const Control: React_2.ForwardRefExoticComponent<Omit<Props_5, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
194
200
|
|
|
195
|
-
export declare function Controls({ style, children }: Props_6):
|
|
201
|
+
export declare function Controls({ style, children }: Props_6): JSX_2.Element;
|
|
196
202
|
|
|
197
203
|
export declare namespace Controls {
|
|
198
|
-
var Spacer: () =>
|
|
204
|
+
var Spacer: () => JSX_2.Element;
|
|
199
205
|
}
|
|
200
206
|
|
|
201
|
-
export declare const DefaultControls: (({ onRequestClose, fullscreenControl }: Props_8) =>
|
|
207
|
+
export declare const DefaultControls: (({ onRequestClose, fullscreenControl }: Props_8) => JSX_2.Element) & {
|
|
202
208
|
displayName: string;
|
|
203
209
|
};
|
|
204
210
|
|
|
205
211
|
declare class ErrorBase<T extends string> extends Error {
|
|
206
212
|
name: T;
|
|
207
213
|
message: string;
|
|
208
|
-
cause?:
|
|
209
|
-
constructor(name: T, message: string, cause?:
|
|
214
|
+
cause?: unknown;
|
|
215
|
+
constructor(name: T, message: string, cause?: unknown);
|
|
210
216
|
}
|
|
211
217
|
|
|
212
218
|
export declare const FullscreenControl: {
|
|
213
|
-
({ toggle
|
|
219
|
+
({ toggle, active }: Props_7): JSX_2.Element;
|
|
214
220
|
displayName: string;
|
|
215
221
|
};
|
|
216
222
|
|
|
@@ -237,11 +243,11 @@ declare class LiveChunk {
|
|
|
237
243
|
setBounds: (range: [Date, Date]) => void;
|
|
238
244
|
}
|
|
239
245
|
|
|
240
|
-
export declare const PlaybackRateControl: (() =>
|
|
246
|
+
export declare const PlaybackRateControl: (() => JSX_2.Element | null) & {
|
|
241
247
|
displayName: string;
|
|
242
248
|
};
|
|
243
249
|
|
|
244
|
-
export declare const Player: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<Omit<
|
|
250
|
+
export declare const Player: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<Omit<Props_2 & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>>;
|
|
245
251
|
|
|
246
252
|
declare interface PlayerBehavior {
|
|
247
253
|
state: PlayerState | null;
|
|
@@ -332,8 +338,8 @@ export declare class PlayerController {
|
|
|
332
338
|
private replaceErrorMessageOnOffline;
|
|
333
339
|
changeMedia: ({ time, chunk, backward }: {
|
|
334
340
|
time: Date;
|
|
335
|
-
chunk?:
|
|
336
|
-
backward?: boolean
|
|
341
|
+
chunk?: ArchiveChunk | LiveChunk;
|
|
342
|
+
backward?: boolean;
|
|
337
343
|
}) => void;
|
|
338
344
|
private initCurrentTime;
|
|
339
345
|
private initPlayableRange;
|
|
@@ -404,7 +410,7 @@ declare enum PlayerState {
|
|
|
404
410
|
Failed = "failed"
|
|
405
411
|
}
|
|
406
412
|
|
|
407
|
-
export declare const PlayPauseControl: (() =>
|
|
413
|
+
export declare const PlayPauseControl: (() => JSX_2.Element) & {
|
|
408
414
|
displayName: string;
|
|
409
415
|
};
|
|
410
416
|
|
|
@@ -417,13 +423,7 @@ declare interface Props extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'on
|
|
|
417
423
|
playerRef?: Ref<PlayerController>;
|
|
418
424
|
}
|
|
419
425
|
|
|
420
|
-
declare interface Props_2 {
|
|
421
|
-
onSelect: (box: Box) => void;
|
|
422
|
-
onClose: () => void;
|
|
423
|
-
onRequestCancel: () => void;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
declare interface Props_3 extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onMouseDown'> {
|
|
426
|
+
declare interface Props_2 extends Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onMouseDown'> {
|
|
427
427
|
camera: Camera;
|
|
428
428
|
startTime?: Date | null;
|
|
429
429
|
endTime?: Date | null;
|
|
@@ -434,14 +434,18 @@ declare interface Props_3 extends Omit<React_2.HTMLAttributes<HTMLDivElement>, '
|
|
|
434
434
|
webRtcOptions?: {
|
|
435
435
|
enabled: boolean;
|
|
436
436
|
allowedIceCandidateProtocols?: ('udp' | 'tcp')[];
|
|
437
|
+
iceServers?: RTCIceServer[];
|
|
438
|
+
iceTransportPolicy?: RTCIceTransportPolicy;
|
|
437
439
|
};
|
|
438
440
|
controllerRef?: Ref<PlayerController>;
|
|
439
441
|
videoRef?: Ref<HTMLVideoElement>;
|
|
440
442
|
archivesStore: ArchivesStore;
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
declare interface Props_3 {
|
|
446
|
+
onSelect: (box: Box) => void;
|
|
447
|
+
onClose: () => void;
|
|
448
|
+
onRequestCancel: () => void;
|
|
445
449
|
}
|
|
446
450
|
|
|
447
451
|
declare interface Props_4 {
|
|
@@ -454,8 +458,8 @@ declare type Props_5 = Omit<React_2.HTMLAttributes<HTMLButtonElement>, 'title'>
|
|
|
454
458
|
};
|
|
455
459
|
|
|
456
460
|
declare interface Props_6 {
|
|
457
|
-
children:
|
|
458
|
-
style?:
|
|
461
|
+
children: React.ReactNode;
|
|
462
|
+
style?: React.CSSProperties;
|
|
459
463
|
}
|
|
460
464
|
|
|
461
465
|
declare interface Props_7 {
|
|
@@ -465,16 +469,16 @@ declare interface Props_7 {
|
|
|
465
469
|
|
|
466
470
|
declare interface Props_8 {
|
|
467
471
|
onRequestClose?: () => void;
|
|
468
|
-
fullscreenControl?:
|
|
472
|
+
fullscreenControl?: React.ReactNode;
|
|
469
473
|
}
|
|
470
474
|
|
|
471
|
-
export declare const PtzControls: ((props: PtzControlsProps) =>
|
|
475
|
+
export declare const PtzControls: ((props: PtzControlsProps) => JSX_2.Element) & {
|
|
472
476
|
displayName: string;
|
|
473
477
|
};
|
|
474
478
|
|
|
475
479
|
declare interface PtzControlsProps {
|
|
476
480
|
cameraId: number;
|
|
477
|
-
style?:
|
|
481
|
+
style?: React.CSSProperties;
|
|
478
482
|
initialZoomSpeed?: number;
|
|
479
483
|
initialMovementSpeed?: number;
|
|
480
484
|
disabled?: boolean;
|
|
@@ -558,62 +562,17 @@ declare interface RawClip {
|
|
|
558
562
|
version: string;
|
|
559
563
|
}
|
|
560
564
|
|
|
561
|
-
declare type RawToken = {
|
|
562
|
-
accessToken: string;
|
|
563
|
-
accessTokenExpires: string;
|
|
564
|
-
accessTokenIssued: string;
|
|
565
|
-
clientId: string;
|
|
566
|
-
expiresIn: number;
|
|
567
|
-
refreshToken: string;
|
|
568
|
-
refreshTokenExpires: string;
|
|
569
|
-
refreshTokenIssued: string;
|
|
570
|
-
tokenType: string;
|
|
571
|
-
userName: string;
|
|
572
|
-
} & {
|
|
573
|
-
access_token: string;
|
|
574
|
-
access_token_expires: string;
|
|
575
|
-
access_token_issued: string;
|
|
576
|
-
client_id: string;
|
|
577
|
-
expires_in: number;
|
|
578
|
-
refresh_token: string;
|
|
579
|
-
refresh_token_expires: string;
|
|
580
|
-
refresh_token_issued: string;
|
|
581
|
-
token_type: string;
|
|
582
|
-
userName: string;
|
|
583
|
-
} & {
|
|
584
|
-
widgetId?: string;
|
|
585
|
-
widgetToken?: string;
|
|
586
|
-
};
|
|
587
|
-
|
|
588
565
|
declare type REACT_SRPING_CONTROLLER_TYPE_HACK = any;
|
|
589
566
|
|
|
590
|
-
export declare const ResizeModeControl: (() =>
|
|
567
|
+
export declare const ResizeModeControl: (() => JSX_2.Element) & {
|
|
591
568
|
displayName: string;
|
|
592
569
|
};
|
|
593
570
|
|
|
594
571
|
export declare const SnapshotControl: {
|
|
595
|
-
():
|
|
572
|
+
(): JSX_2.Element;
|
|
596
573
|
displayName: string;
|
|
597
574
|
};
|
|
598
575
|
|
|
599
|
-
declare class Token {
|
|
600
|
-
accessToken: string;
|
|
601
|
-
accessTokenExpires: Date;
|
|
602
|
-
accessTokenIssued: Date;
|
|
603
|
-
clientId: string;
|
|
604
|
-
expiresIn: number;
|
|
605
|
-
refreshToken: string;
|
|
606
|
-
refreshTokenExpires: Date;
|
|
607
|
-
refreshTokenIssued: Date;
|
|
608
|
-
tokenType: string;
|
|
609
|
-
userName: string;
|
|
610
|
-
invalid: boolean;
|
|
611
|
-
widgetId?: string;
|
|
612
|
-
widgetToken?: string;
|
|
613
|
-
json: RawToken;
|
|
614
|
-
constructor(raw: RawToken);
|
|
615
|
-
}
|
|
616
|
-
|
|
617
576
|
export declare function useFullscreen(): {
|
|
618
577
|
ref: (node: HTMLElement | null) => void;
|
|
619
578
|
toggle: () => undefined;
|
|
@@ -637,12 +596,9 @@ export declare function usePlayerRef(): {
|
|
|
637
596
|
player: PlayerController | null;
|
|
638
597
|
};
|
|
639
598
|
|
|
640
|
-
declare
|
|
641
|
-
Fit = "contain",
|
|
642
|
-
Stretch = "fill"
|
|
643
|
-
}
|
|
599
|
+
declare type VideoResizeMode = 'contain' | 'fill';
|
|
644
600
|
|
|
645
|
-
export declare const VolumeControl: (() =>
|
|
601
|
+
export declare const VolumeControl: (() => JSX_2.Element) & {
|
|
646
602
|
displayName: string;
|
|
647
603
|
};
|
|
648
604
|
|