1/* 2 * Copyright (c) 2021-2023 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 * 19 * @enum { number } 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 7 22 */ 23declare enum ColorMode { 24 /** 25 * Light mode. 26 * 27 * @syscap SystemCapability.ArkUI.ArkUI.Full 28 * @since 7 29 */ 30 LIGHT = 0, 31 32 /** 33 * Dark mode. 34 * 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @since 7 37 */ 38 DARK, 39} 40 41/** 42 * Defines the LayoutDirection of device. 43 * 44 * @enum { number } 45 * @syscap SystemCapability.ArkUI.ArkUI.Full 46 * @since 7 47 */ 48declare enum LayoutDirection { 49 /** 50 * Elements are laid out from left to right. 51 * 52 * @syscap SystemCapability.ArkUI.ArkUI.Full 53 * @since 7 54 */ 55 LTR, 56 57 /** 58 * Elements are laid out from right to left. 59 * 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @since 7 62 */ 63 RTL, 64 65 /** 66 * Elements are laid out from auto. 67 * 68 * @syscap SystemCapability.ArkUI.ArkUI.Full 69 * @since 8 70 */ 71 Auto, 72} 73 74/** 75 * Defines the base class of storage. 76 * 77 * @syscap SystemCapability.ArkUI.ArkUI.Full 78 * @systemapi 79 * @since 7 80 */ 81declare class Storage { 82 /** 83 * Constructor parameters. 84 * 85 * @param { boolean } needCrossThread 86 * @param { string } file 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @systemapi 89 * @since 7 90 */ 91 constructor(needCrossThread?: boolean, file?: string); 92 93 /** 94 * Called when data is obtained. 95 * 96 * @param { string } key 97 * @returns { string | undefined } 98 * @syscap SystemCapability.ArkUI.ArkUI.Full 99 * @systemapi 100 * @since 7 101 */ 102 get(key: string): string | undefined; 103 104 /** 105 * Called when setting. 106 * 107 * @param { string } key 108 * @param { any } val 109 * @syscap SystemCapability.ArkUI.ArkUI.Full 110 * @systemapi 111 * @since 7 112 */ 113 set(key: string, val: any): void; 114 115 /** 116 * Called when data is cleared. 117 * 118 * @syscap SystemCapability.ArkUI.ArkUI.Full 119 * @systemapi 120 * @since 7 121 */ 122 clear(): void; 123 124 /** 125 * Called when data is deleted. 126 * 127 * @param { string } key 128 * @syscap SystemCapability.ArkUI.ArkUI.Full 129 * @systemapi 130 * @since 7 131 */ 132 delete(key: string): void; 133} 134