@nano-lib/util 1.0.11 → 1.0.13

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,10 +1,11 @@
1
+ import { FaceDetection, WithFaceLandmarks } from 'face-api.js';
1
2
  export type ImgFormat = 'blob' | 'base64';
2
- export type FaceapiGesture = 'nod' | 'shake' | 'mouth' | 'eye';
3
- export declare const faceapiLivingEvent: FaceapiGesture[];
4
- export declare const faceapiLivingEventHint: Record<FaceapiGesture, string>;
5
- export declare function loadFaceModels(modelsPath: string): Promise<void>;
6
- export declare function getFaceLandmarks(video: HTMLVideoElement, score?: number, time?: number): Promise<import('face-api.js').WithFaceLandmarks<{
7
- detection: import('face-api.js').FaceDetection;
3
+ export type FaceGesture = 'nod' | 'shake' | 'mouth' | 'eye';
4
+ type LandmarksFn = (video: HTMLVideoElement, score?: number, time?: number) => Promise<WithFaceLandmarks<{
5
+ detection: FaceDetection;
8
6
  }> | undefined>;
7
+ export declare const faceLivingEvent: FaceGesture[];
8
+ export declare const faceLivingEventHint: Record<FaceGesture, string>;
9
9
  export declare function getFaceVideoFrame(video: HTMLVideoElement, format?: ImgFormat, quality?: number): Promise<string | ArrayBuffer>;
10
- export declare function getFaceGestureResult(video: HTMLVideoElement, gesture: FaceapiGesture, times?: number): Promise<boolean>;
10
+ export declare function getFaceGestureResult(landmarksFn: LandmarksFn, video: HTMLVideoElement, gesture: FaceGesture, times?: number): Promise<boolean>;
11
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nano-lib/util",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Custom utility functions for the nano library",
5
5
  "author": "kevin chen",
6
6
  "license": "MIT",
@@ -26,7 +26,6 @@
26
26
  "lib": "rimraf lib && vite build"
27
27
  },
28
28
  "dependencies": {
29
- "face-api.js": "^0.22.2",
30
29
  "resize-observer-polyfill": "^1.5.1"
31
30
  },
32
31
  "devDependencies": {
@@ -35,6 +34,7 @@
35
34
  "@typescript-eslint/parser": "^8.29.0",
36
35
  "eslint": "^9.23.0",
37
36
  "eslint-config-prettier": "^10.1.1",
37
+ "face-api.js": "^0.22.2",
38
38
  "prettier": "^3.5.3",
39
39
  "typescript": "^5.8.2",
40
40
  "vite": "^6.0.5",