@nano-lib/util 1.0.7 → 1.0.9

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/lib/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import { default as scrollTo } from './utils/scroll';
2
- import { debounce, creatCancelTask, downloadFile, getGenderByIdNumber, getBirthdayByIdNumber, trimArray } from './utils/common';
3
2
  import { uuid, randomNum } from './utils/random';
4
- import { phoneToAsterisk, idNumberToAsterisk, firstLetterToUpperCase, firstLetterToLowerCase } from './utils/string';
5
3
  import { parseTime, getTimeDistance, getDayRange } from './utils/date';
4
+ import { addResizeListener, removeResizeListener } from './utils/event';
6
5
  import { addClass, removeClass, hasClass, toggleClass, noContextmenu, useRafThrottle } from './utils/element';
7
- import { encodeURIToParams, paramsToQueryString, queryStringToParams, errorCodeToString, YNToString, HNToString, valueToLabel, chargeToLabel, cascaderToLabel, multipleSelectToLabel } from './utils/to';
6
+ import { encodeURIToParams, paramsToQueryString, queryStringToParams, errorCodeToString, YNToString, HNToString, valueToLabel, chargeToLabel, cascaderToLabel, multipleSelectToLabel, phoneToAsterisk, idNumberToAsterisk, firstLetterToUpperCase, firstLetterToLowerCase } from './utils/to';
8
7
  import { validHttp, validExternal, validString, validNumberStr, validEmptyObject, validURL, validPassword, validEmail, validIdNumber, validPhone, validTel } from './utils/valid';
8
+ import { loadModels, getFaceGestureResult, getFaceLandmarks, captureVideoFrame } from './utils/face';
9
+ export { NOOP, debounce, sleep, countdownTimer, creatCancelTask, downloadFile, getRandomItemInArray, getFullUrl, getArrayFullUrl, getGenderByIdNumber, getBirthdayByIdNumber, getPercentage, trimArray, loadCss, loadJs } from './utils/common';
9
10
  export declare const CONSTANTS: {
10
11
  DATE_VALUE_FORMAT: Map<string, "YYYY-MM-DD" | "YYYY-MM-DD HH:mm:ss" | "YYYY-MM" | "YYYY" | "HH:mm:ss">;
11
12
  IMAGE_TYPE: string[];
@@ -13,16 +14,13 @@ export declare const CONSTANTS: {
13
14
  DOC_TYPE: string[];
14
15
  FILE_TYPE: string[];
15
16
  };
16
- export declare const commonUtil: {
17
- NOOP: () => void;
18
- debounce: typeof debounce;
19
- creatCancelTask: typeof creatCancelTask;
20
- downloadFile: typeof downloadFile;
21
- trimArray: typeof trimArray;
22
- getFullUrl: (relativeUrl: string, domain?: string) => string;
23
- getArrayFullUrl: (relativeUrls: string | string[], domain?: string) => string[];
24
- getGenderByIdNumber: typeof getGenderByIdNumber;
25
- getBirthdayByIdNumber: typeof getBirthdayByIdNumber;
17
+ export declare const faceUtil: {
18
+ loadModels: typeof loadModels;
19
+ faceapiLivingEvent: import('./utils/face').FaceapiGesture[];
20
+ faceapiLivingEventHint: Record<import('./utils/face').FaceapiGesture, string>;
21
+ getFaceGestureResult: typeof getFaceGestureResult;
22
+ getFaceLandmarks: typeof getFaceLandmarks;
23
+ captureVideoFrame: typeof captureVideoFrame;
26
24
  };
27
25
  export declare const toUtil: {
28
26
  encodeURIToParams: typeof encodeURIToParams;
@@ -35,6 +33,10 @@ export declare const toUtil: {
35
33
  chargeToLabel: typeof chargeToLabel;
36
34
  cascaderToLabel: typeof cascaderToLabel;
37
35
  multipleSelectToLabel: typeof multipleSelectToLabel;
36
+ phoneToAsterisk: typeof phoneToAsterisk;
37
+ idNumberToAsterisk: typeof idNumberToAsterisk;
38
+ firstLetterToUpperCase: typeof firstLetterToUpperCase;
39
+ firstLetterToLowerCase: typeof firstLetterToLowerCase;
38
40
  };
39
41
  export declare const validUtil: {
40
42
  validHttp: typeof validHttp;
@@ -76,16 +78,14 @@ export declare const cacheUtil: {
76
78
  clear(): void;
77
79
  };
78
80
  };
81
+ export declare const eventUtil: {
82
+ addResizeListener: typeof addResizeListener;
83
+ removeResizeListener: typeof removeResizeListener;
84
+ };
79
85
  export declare const randomUtil: {
80
86
  uuid: typeof uuid;
81
87
  randomNum: typeof randomNum;
82
88
  };
83
- export declare const stringUtil: {
84
- phoneToAsterisk: typeof phoneToAsterisk;
85
- idNumberToAsterisk: typeof idNumberToAsterisk;
86
- firstLetterToUpperCase: typeof firstLetterToUpperCase;
87
- firstLetterToLowerCase: typeof firstLetterToLowerCase;
88
- };
89
89
  export declare const dateUtil: {
90
90
  parseTime: typeof parseTime;
91
91
  getTimeDistance: typeof getTimeDistance;