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 16/** 17 * @file 18 * @kit CoreFileKit 19 */ 20 21/** 22 * This module provides the capability to parse file or device information. 23 * 24 * @namespace fileExtensionInfo 25 * @syscap SystemCapability.FileManagement.UserFileService 26 * @systemapi 27 * @since 9 28 */ 29declare namespace fileExtensionInfo { 30 /** 31 * DeviceType Indicates the type of device connected to the fileaccess server. 32 * 33 * @enum { number } 34 * @syscap SystemCapability.FileManagement.UserFileService 35 * @systemapi 36 * @stagemodelonly 37 * @since 9 38 */ 39 enum DeviceType { 40 /** 41 * Local c,d... disk. 42 * 43 * @syscap SystemCapability.FileManagement.UserFileService 44 * @systemapi 45 * @stagemodelonly 46 * @since 9 47 */ 48 DEVICE_LOCAL_DISK = 1, 49 50 /** 51 * Multi-user shared disk. 52 * 53 * @syscap SystemCapability.FileManagement.UserFileService 54 * @systemapi 55 * @stagemodelonly 56 * @since 9 57 */ 58 DEVICE_SHARED_DISK, 59 60 /** 61 * Distributed networking terminal device. 62 * 63 * @syscap SystemCapability.FileManagement.UserFileService 64 * @systemapi 65 * @stagemodelonly 66 * @since 9 67 */ 68 DEVICE_SHARED_TERMINAL, 69 70 /** 71 * Network neighbor device. 72 * 73 * @syscap SystemCapability.FileManagement.UserFileService 74 * @systemapi 75 * @stagemodelonly 76 * @since 9 77 */ 78 DEVICE_NETWORK_NEIGHBORHOODS, 79 80 /** 81 * MTP device. 82 * 83 * @syscap SystemCapability.FileManagement.UserFileService 84 * @systemapi 85 * @stagemodelonly 86 * @since 9 87 */ 88 DEVICE_EXTERNAL_MTP, 89 90 /** 91 * USB device. 92 * 93 * @syscap SystemCapability.FileManagement.UserFileService 94 * @systemapi 95 * @stagemodelonly 96 * @since 9 97 */ 98 DEVICE_EXTERNAL_USB, 99 100 /** 101 * Cloud disk device. 102 * 103 * @syscap SystemCapability.FileManagement.UserFileService 104 * @systemapi 105 * @stagemodelonly 106 * @since 9 107 */ 108 DEVICE_EXTERNAL_CLOUD 109 } 110 111 /** 112 * Indicates the supported capabilities of the device. 113 * 114 * @namespace DeviceFlag 115 * @syscap SystemCapability.FileManagement.UserFileService 116 * @systemapi 117 * @stagemodelonly 118 * @since 9 119 */ 120 namespace DeviceFlag { 121 /** 122 * supports read. 123 * 124 * @constant 125 * @syscap SystemCapability.FileManagement.UserFileService 126 * @systemapi 127 * @stagemodelonly 128 * @since 9 129 */ 130 const SUPPORTS_READ = 0b1; 131 132 /** 133 * supports write. 134 * 135 * @constant 136 * @syscap SystemCapability.FileManagement.UserFileService 137 * @systemapi 138 * @stagemodelonly 139 * @since 9 140 */ 141 const SUPPORTS_WRITE = 0b10; 142 } 143 144 /** 145 * Indicate the supported capabilities of the file or directory. 146 * 147 * @namespace DocumentFlag 148 * @syscap SystemCapability.FileManagement.UserFileService 149 * @systemapi 150 * @stagemodelonly 151 * @since 9 152 */ 153 namespace DocumentFlag { 154 /** 155 * represents file. 156 * 157 * @constant 158 * @syscap SystemCapability.FileManagement.UserFileService 159 * @systemapi 160 * @stagemodelonly 161 * @since 9 162 */ 163 const REPRESENTS_FILE = 0b1; 164 165 /** 166 * represents directory. 167 * 168 * @constant 169 * @syscap SystemCapability.FileManagement.UserFileService 170 * @systemapi 171 * @stagemodelonly 172 * @since 9 173 */ 174 const REPRESENTS_DIR = 0b10; 175 176 /** 177 * supports read. 178 * 179 * @constant 180 * @syscap SystemCapability.FileManagement.UserFileService 181 * @systemapi 182 * @stagemodelonly 183 * @since 9 184 */ 185 const SUPPORTS_READ = 0b100; 186 187 /** 188 * supports write. 189 * 190 * @constant 191 * @syscap SystemCapability.FileManagement.UserFileService 192 * @systemapi 193 * @stagemodelonly 194 * @since 9 195 */ 196 const SUPPORTS_WRITE = 0b1000; 197 } 198} 199 200export default fileExtensionInfo;