1/* 2 * Copyright (c) 2021-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/** 17 * Provides methods for control pattern lock component. 18 * @since 9 19 */ 20declare class PatternLockController { 21 /** 22 * constructor. 23 */ 24 constructor(); 25 26 /** 27 * Reset pattern lock. 28 */ 29 reset(); 30} 31 32/** 33 * Provides an interface for generating PatternLock. 34 * @since 9 35 */ 36interface PatternLockInterface { 37 (controller?: PatternLockController): PatternLockAttribute; 38} 39 40/** 41 * @since 9 42 */ 43declare class PatternLockAttribute extends CommonMethod<PatternLockAttribute> { 44 /** 45 * The square side length of pattern lock component. 46 * @since 9 47 */ 48 sideLength(value: Length): PatternLockAttribute; 49 50 /** 51 * Circle radius. 52 * @since 9 53 */ 54 circleRadius(value: Length): PatternLockAttribute; 55 56 /** 57 * The background color. 58 * @since 9 59 */ 60 backgroundColor(value: ResourceColor): PatternLockAttribute; 61 62 /** 63 * Regular color. 64 * @since 9 65 */ 66 regularColor(value: ResourceColor): PatternLockAttribute; 67 68 /** 69 * The color when cell is selected. 70 * @since 9 71 */ 72 selectedColor(value: ResourceColor): PatternLockAttribute; 73 74 /** 75 * The color when cell is active state. 76 * @since 9 77 */ 78 activeColor(value: ResourceColor): PatternLockAttribute; 79 80 /** 81 * The path line color. 82 * @since 9 83 */ 84 pathColor(value: ResourceColor): PatternLockAttribute; 85 86 /** 87 * The path line stroke width. 88 * @since 9 89 */ 90 pathStrokeWidth(value: number | string): PatternLockAttribute; 91 92 /** 93 * Called when the pattern input completed. 94 * @since 9 95 */ 96 onPatternComplete(callback: (input: Array<number>) => void): PatternLockAttribute; 97 98 /** 99 * Called when judging whether the input state can be reset by touch pattern lock. 100 * @since 9 101 */ 102 autoReset(value: boolean): PatternLockAttribute; 103} 104 105/** 106 * Defines PatternLock Component. 107 * @since 9 108 */ 109declare const PatternLock: PatternLockInterface; 110 111/** 112 * Defines PatternLock Component instance. 113 * @since 9 114 */ 115declare const PatternLockInstance: PatternLockAttribute; 116