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 * @file 18 * @kit ArkUI 19 */ 20 21/** 22 * Defines the ColorMode of device. 23 * 24 * @enum { number } 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 7 27 */ 28/** 29 * Defines the ColorMode of device. 30 * 31 * @enum { number } 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @atomicservice 34 * @since 11 35 */ 36declare enum ColorMode { 37 /** 38 * Light mode. 39 * 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @since 7 42 */ 43 /** 44 * Light mode. 45 * 46 * @syscap SystemCapability.ArkUI.ArkUI.Full 47 * @atomicservice 48 * @since 11 49 */ 50 LIGHT = 0, 51 52 /** 53 * Dark mode. 54 * 55 * @syscap SystemCapability.ArkUI.ArkUI.Full 56 * @since 7 57 */ 58 /** 59 * Dark mode. 60 * 61 * @syscap SystemCapability.ArkUI.ArkUI.Full 62 * @atomicservice 63 * @since 11 64 */ 65 DARK, 66} 67 68/** 69 * Defines the LayoutDirection of device. 70 * 71 * @enum { number } 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @since 7 74 */ 75/** 76 * Defines the LayoutDirection of device. 77 * 78 * @enum { number } 79 * @syscap SystemCapability.ArkUI.ArkUI.Full 80 * @atomicservice 81 * @since 11 82 */ 83declare enum LayoutDirection { 84 /** 85 * Elements are laid out from left to right. 86 * 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @since 7 89 */ 90 /** 91 * Elements are laid out from left to right. 92 * 93 * @syscap SystemCapability.ArkUI.ArkUI.Full 94 * @atomicservice 95 * @since 11 96 */ 97 LTR, 98 99 /** 100 * Elements are laid out from right to left. 101 * 102 * @syscap SystemCapability.ArkUI.ArkUI.Full 103 * @since 7 104 */ 105 /** 106 * Elements are laid out from right to left. 107 * 108 * @syscap SystemCapability.ArkUI.ArkUI.Full 109 * @atomicservice 110 * @since 11 111 */ 112 RTL, 113 114 /** 115 * Elements are laid out from auto. 116 * 117 * @syscap SystemCapability.ArkUI.ArkUI.Full 118 * @since 8 119 */ 120 /** 121 * Elements are laid out from auto. 122 * 123 * @syscap SystemCapability.ArkUI.ArkUI.Full 124 * @atomicservice 125 * @since 11 126 */ 127 Auto, 128} 129 130/** 131 * Defines the base class of storage. 132 * 133 * @syscap SystemCapability.ArkUI.ArkUI.Full 134 * @systemapi 135 * @since 7 136 */ 137declare class Storage { 138 /** 139 * Constructor parameters. 140 * 141 * @param { boolean } needCrossThread 142 * @param { string } file 143 * @syscap SystemCapability.ArkUI.ArkUI.Full 144 * @systemapi 145 * @since 7 146 */ 147 constructor(needCrossThread?: boolean, file?: string); 148 149 /** 150 * Called when data is obtained. 151 * 152 * @param { string } key 153 * @returns { string | undefined } 154 * @syscap SystemCapability.ArkUI.ArkUI.Full 155 * @systemapi 156 * @since 7 157 */ 158 get(key: string): string | undefined; 159 160 /** 161 * Called when setting. 162 * 163 * @param { string } key 164 * @param { any } val 165 * @syscap SystemCapability.ArkUI.ArkUI.Full 166 * @systemapi 167 * @since 7 168 */ 169 set(key: string, val: any): void; 170 171 /** 172 * Called when data is cleared. 173 * 174 * @syscap SystemCapability.ArkUI.ArkUI.Full 175 * @systemapi 176 * @since 7 177 */ 178 clear(): void; 179 180 /** 181 * Called when data is deleted. 182 * 183 * @param { string } key 184 * @syscap SystemCapability.ArkUI.ArkUI.Full 185 * @systemapi 186 * @since 7 187 */ 188 delete(key: string): void; 189} 190