qt-human 2.3.0-alpha.0 → 2.3.1-alpha
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.esm.js +1 -1
- package/dist/bundle.iife.js +1 -1
- package/dist/bundle.umd.js +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/types/modules/camera/index.d.ts +2 -2
- package/dist/types/modules/camera/mediaStream.d.ts +1 -1
- package/dist/types/modules/camera/poseDetector.d.ts +7 -1
- package/dist/types/modules/core/voice-interaction.d.ts +2 -2
- package/dist/types/modules/human.d.ts +1 -0
- package/dist/types/types/enum.d.ts +2 -1
- package/dist/types/types/enum.ts +2 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -273,8 +273,8 @@ declare class VoiceInteraction extends Emittery {
|
|
|
273
273
|
private wakeWordDetection;
|
|
274
274
|
private exitWordDetection;
|
|
275
275
|
private interruptWordDetection;
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
onWakeDetected(): void;
|
|
277
|
+
onSleepDetected(): void;
|
|
278
278
|
private onInterruptDetected;
|
|
279
279
|
destroy(): void;
|
|
280
280
|
}
|
|
@@ -289,18 +289,19 @@ interface CameraConfig {
|
|
|
289
289
|
overlayImage?: HTMLImageElement | null; // 合影 PNG
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
+
type ProximityState = 'near' | 'far' | 'stable';
|
|
293
|
+
|
|
292
294
|
declare class CameraSDK {
|
|
293
295
|
private manager;
|
|
294
296
|
private features;
|
|
295
297
|
private container;
|
|
296
298
|
private video;
|
|
297
|
-
private proximityDetector;
|
|
298
299
|
constructor(config: CameraConfig);
|
|
299
300
|
open(): Promise<void>;
|
|
300
301
|
close(): void;
|
|
301
302
|
takePhoto(): Promise<string>;
|
|
302
303
|
switchCamera(facingMode: "user" | "environment"): Promise<void>;
|
|
303
|
-
detectPose(): Promise<
|
|
304
|
+
detectPose(callback: (stable: ProximityState) => void): Promise<void>;
|
|
304
305
|
destroy(): void;
|
|
305
306
|
}
|
|
306
307
|
|
|
@@ -374,6 +375,7 @@ declare class Human extends Emittery implements QuanTe$1.Human {
|
|
|
374
375
|
closeRecorder(): Promise<boolean>;
|
|
375
376
|
openRecorder(): Promise<QuanTe$1.Result<QuanTe$1.Recorder.PermissionResult>>;
|
|
376
377
|
openCamera(config: CameraConfig$1): Promise<boolean>;
|
|
378
|
+
wakeUp(isWake?: boolean): Promise<void>;
|
|
377
379
|
}
|
|
378
380
|
|
|
379
381
|
declare namespace QuanTe {
|
|
@@ -1071,6 +1073,8 @@ declare enum EmitEvent {
|
|
|
1071
1073
|
AUDIO_PAUSE = 'audio.pause',
|
|
1072
1074
|
// 播放音频
|
|
1073
1075
|
AUDIO_PLAY = 'audio.play',
|
|
1076
|
+
// 摄像机人体检测结果
|
|
1077
|
+
CAMERA_PERSON_TEST_RESULT = 'camera.person.test.result'
|
|
1074
1078
|
}
|
|
1075
1079
|
|
|
1076
1080
|
export { EmitEvent, QuanTe, Human as default };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { CameraConfig } from "../../types/camera";
|
|
2
|
+
import { ProximityState } from './proximityDetector';
|
|
2
3
|
export declare class CameraSDK {
|
|
3
4
|
private manager;
|
|
4
5
|
private features;
|
|
5
6
|
private container;
|
|
6
7
|
private video;
|
|
7
|
-
private proximityDetector;
|
|
8
8
|
constructor(config: CameraConfig);
|
|
9
9
|
open(): Promise<void>;
|
|
10
10
|
close(): void;
|
|
11
11
|
takePhoto(): Promise<string>;
|
|
12
12
|
switchCamera(facingMode: "user" | "environment"): Promise<void>;
|
|
13
|
-
detectPose(): Promise<
|
|
13
|
+
detectPose(callback: (stable: ProximityState) => void): Promise<void>;
|
|
14
14
|
destroy(): void;
|
|
15
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FacingMode, CameraCore } from "../../types/camera";
|
|
2
2
|
export declare class MediaStreamManager implements CameraCore {
|
|
3
|
-
|
|
3
|
+
video: HTMLVideoElement;
|
|
4
4
|
private stream;
|
|
5
5
|
private facingMode;
|
|
6
6
|
constructor(video: HTMLVideoElement, facingMode?: FacingMode);
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import * as posedetection from "@tensorflow-models/pose-detection";
|
|
2
2
|
import "@tensorflow/tfjs-backend-webgl";
|
|
3
|
+
import { MediaStreamManager } from "./mediaStream";
|
|
4
|
+
import { ProximityState } from "./proximityDetector";
|
|
3
5
|
export declare class PoseDetector {
|
|
4
6
|
private detector;
|
|
7
|
+
private mediaStrea;
|
|
8
|
+
private interval;
|
|
9
|
+
private proximityDetector;
|
|
5
10
|
constructor();
|
|
6
|
-
init(): Promise<void>;
|
|
11
|
+
init(mediaStrea: MediaStreamManager): Promise<void>;
|
|
12
|
+
on(callback: (stable: ProximityState) => void): void;
|
|
7
13
|
detect(video: HTMLVideoElement): Promise<posedetection.Pose[]>;
|
|
8
14
|
destroy(): Promise<void>;
|
|
9
15
|
}
|
|
@@ -37,8 +37,8 @@ declare class VoiceInteraction extends Emittery {
|
|
|
37
37
|
private wakeWordDetection;
|
|
38
38
|
private exitWordDetection;
|
|
39
39
|
private interruptWordDetection;
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
onWakeDetected(): void;
|
|
41
|
+
onSleepDetected(): void;
|
|
42
42
|
private onInterruptDetected;
|
|
43
43
|
destroy(): void;
|
|
44
44
|
}
|
|
@@ -78,6 +78,7 @@ declare class Human extends Emittery implements QuanTe.Human {
|
|
|
78
78
|
closeRecorder(): Promise<boolean>;
|
|
79
79
|
openRecorder(): Promise<QuanTe.Result<QuanTe.Recorder.PermissionResult>>;
|
|
80
80
|
openCamera(config: CameraConfig): Promise<boolean>;
|
|
81
|
+
wakeUp(isWake?: boolean): Promise<void>;
|
|
81
82
|
}
|
|
82
83
|
export default Human;
|
|
83
84
|
export type { QuanTe };
|
|
@@ -16,5 +16,6 @@ export declare enum EmitEvent {
|
|
|
16
16
|
WAKE_RECORDER_START = "wake.record.start",
|
|
17
17
|
WAKE_RECORDER_STOP = "wake.record.stop",
|
|
18
18
|
AUDIO_PAUSE = "audio.pause",
|
|
19
|
-
AUDIO_PLAY = "audio.play"
|
|
19
|
+
AUDIO_PLAY = "audio.play",
|
|
20
|
+
CAMERA_PERSON_TEST_RESULT = "camera.person.test.result"
|
|
20
21
|
}
|
package/dist/types/types/enum.ts
CHANGED