1/* 2 * Copyright (c) 2021 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 * Defines the ColorMode of device. 18 * @since 7 19 */ 20declare enum ColorMode { 21 /** 22 * Light mode. 23 * @since 7 24 */ 25 LIGHT = 0, 26 27 /** 28 * Dark mode. 29 * @since 7 30 */ 31 DARK, 32} 33 34/** 35 * Defines the LayoutDirection of device. 36 * @since 7 37 */ 38declare enum LayoutDirection { 39 /** 40 * Elements are laid out from left to right. 41 * @since 7 42 */ 43 LTR, 44 45 /** 46 * Elements are laid out from right to left. 47 * @since 7 48 */ 49 RTL, 50 51 /** 52 * Elements are laid out from auto. 53 * @since 8 54 */ 55 Auto, 56} 57 58/** 59 * Defines the base class of storage. 60 * @since 7 61 * @systemapi 62 */ 63declare class Storage { 64 /** 65 * Constructor parameters. 66 * @since 7 67 * @systemapi 68 */ 69 constructor(needCrossThread?: boolean, file?: string); 70 71 /** 72 * Called when data is obtained. 73 * @since 7 74 * @systemapi 75 */ 76 get(key: string): string | undefined; 77 78 /** 79 * Called when setting. 80 * @since 7 81 * @systemapi 82 */ 83 set(key: string, val: any): void; 84 85 /** 86 * Called when data is cleared. 87 * @since 7 88 * @systemapi 89 */ 90 clear(): void; 91 92 /** 93 * Called when data is deleted. 94 * @since 7 95 * @systemapi 96 */ 97 delete(key: string): void; 98} 99