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 16declare namespace pinAuth 17{ 18 /** 19 * constructor. 20 * 21 * @return Constructor to get the userauth class instance 22 */ 23 function constructor() : PINAuth; 24 /** 25 * registerInputer 26 * 27 * @param inputer 28 * @return boolean register success or fail 29 */ 30 function registerInputer(inputer:IInputer) : boolean; 31 32 /** 33 * unregisterInputer 34 */ 35 function unregisterInputer():void; 36 37 /** 38 * Password input box callback 39 */ 40 interface IInputer{ 41 onGetData : (callback:IInputData)=>void 42 } 43 44 /** 45 * Password data callback 46 */ 47 interface IInputData{ 48 onSetData:(pinSubType:AuthSubType, data:Uint8Array)=>void 49 } 50 51 /** 52 * Credential subtype: 6-digit digital password, user-defined digital password, 53 * user-defined mixed password, 2D face, 3D face 54 */ 55 enum AuthSubType{ 56 /** 57 * Authentication sub type six number pin. 58 */ 59 PIN_SIX = 10000, 60 /** 61 * Authentication sub type self defined number pin. 62 */ 63 PIN_NUMBER = 10001, 64 /** 65 * Authentication sub type 2D face. 66 */ 67 PIN_MIXED = 10002, 68 /** 69 * Authentication sub type 2D face. 70 */ 71 FACE_2D = 20000, 72 /** 73 * Authentication sub type 3D face. 74 */ 75 FACE_3D = 20001 76 } 77 78}