1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FACERECOGNITION_USER_AUTH_HELPER_H 17 #define FACERECOGNITION_USER_AUTH_HELPER_H 18 19 #include "napi/native_api.h" 20 #include "napi/native_common.h" 21 22 namespace OHOS { 23 namespace UserIAM { 24 namespace UserAuth { 25 enum AuthMethod { 26 PIN_ONLY = 0xF, 27 FACE_ONLY = 0xF0 28 }; 29 30 enum Module { 31 FACE_AUTH = 1 32 }; 33 34 enum FaceTipsCode { 35 FACE_AUTH_TIP_TOO_BRIGHT = 1, 36 FACE_AUTH_TIP_TOO_DARK = 2, 37 FACE_AUTH_TIP_TOO_CLOSE = 3, 38 FACE_AUTH_TIP_TOO_FAR = 4, 39 FACE_AUTH_TIP_TOO_HIGH = 5, 40 FACE_AUTH_TIP_TOO_LOW = 6, 41 FACE_AUTH_TIP_TOO_RIGHT = 7, 42 FACE_AUTH_TIP_TOO_LEFT = 8, 43 FACE_AUTH_TIP_TOO_MUCH_MOTION = 9, 44 FACE_AUTH_TIP_POOR_GAZE = 10, 45 FACE_AUTH_TIP_NOT_DETECTED = 11, 46 }; 47 48 enum FingerprintTips { 49 FINGERPRINT_AUTH_TIP_GOOD = 0, 50 FINGERPRINT_AUTH_TIP_IMAGER_DIRTY = 1, 51 FINGERPRINT_AUTH_TIP_INSUFFICIENT = 2, 52 FINGERPRINT_AUTH_TIP_PARTIAL = 3, 53 FINGERPRINT_AUTH_TIP_TOO_FAST = 4, 54 FINGERPRINT_AUTH_TIP_TOO_SLOW = 5 55 }; 56 57 napi_value AuthTypeConstructor(napi_env env); 58 napi_value AuthSubTypeConstructor(napi_env env); 59 napi_value AuthTrustLevelConstructor(napi_env env); 60 napi_value GetPropertyTypeConstructor(napi_env env); 61 napi_value SetPropertyTypeConstructor(napi_env env); 62 napi_value AuthMethodConstructor(napi_env env); 63 napi_value ModuleConstructor(napi_env env); 64 napi_value ResultCodeConstructor(napi_env env); 65 napi_value AuthenticationResultConstructor(napi_env env); 66 napi_value FaceTipsCodeConstructor(napi_env env); 67 napi_value FingerprintTipsConstructorForKits(napi_env env); 68 napi_value FingerprintTipsConstructorForInnerkits(napi_env env); 69 napi_value UserAuthTypeConstructor(napi_env env); 70 napi_value UserAuthInit(napi_env env, napi_value exports); 71 napi_value EnumExport(napi_env env, napi_value exports); 72 napi_value GetCtor(napi_env env); 73 napi_value GetCtorForAPI6(napi_env env); 74 napi_value ConstructorForAPI6(napi_env env, napi_callback_info info); 75 napi_value UserAuthServiceConstructor(napi_env env, napi_callback_info info); 76 napi_value GetVersion(napi_env env, napi_callback_info info); 77 napi_value GetAvailableStatus(napi_env env, napi_callback_info info); 78 napi_value GetProperty(napi_env env, napi_callback_info info); 79 napi_value SetProperty(napi_env env, napi_callback_info info); 80 napi_value Auth(napi_env env, napi_callback_info info); 81 napi_value Execute(napi_env env, napi_callback_info info); 82 napi_value AuthUser(napi_env env, napi_callback_info info); 83 napi_value CancelAuth(napi_env env, napi_callback_info info); 84 } // namespace UserAuth 85 } // namespace UserIAM 86 } // namespace OHOS 87 #endif // FACERECOGNITION_USER_AUTH_HELPER_H 88