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 16export const MILLISECOND = { 17 ONE_MILLISECOND: 1, 18 ONE_SECOND: 1000, 19 ONE_MINUTE: 60 * 1000, 20 ONE_HOUR: 60 * 60 * 1000, 21 ONE_DAY: 24 * 60 * 60 * 1000, 22 ONE_MONTH: 30 * 24 * 60 * 60 * 1000 23} 24 25export const BYTE = { 26 ONE_KB: 1024, 27 ONE_MB: 1024 * 1024, 28 ONE_GB: 1024 * 1024 * 1024, 29 ONE_TB: 1024 * 1024 * 1024 * 1024 30} 31 32export const FILENAME_REGEXP = /^[^\\/:*?<>\"|]+$/ 33 34export const FILENAME_MAX_LENGTH = 225 35 36/** 37 * 重命名连接符 38 */ 39export const RENAME_CONNECT_CHARACTER = ' '; 40 41export const DOCS_FOLDER = 'Docs' 42 43export const DESKTOP_FOLDER = 'Desktop' 44 45export const DOCUMENTS_FOLDER = 'Documents' 46 47/** 48 * 内部存储根目录Uri 49 */ 50export const INTERNAL_STORAGE_ROOT_URI: string = 'file://media/root'; 51 52/** 53 * picker支持的文件选择模式 54 */ 55export const SELECT_MODE = { 56 FILE: 0, 57 FOLDER: 1, 58 MIX: 2 59} 60 61/** 62 * 文件后缀相关常量定义 63 */ 64export const FILE_SUFFIX = { 65 SUFFIX_SPLIT: ',', 66 SUFFIX_START: '.' 67} 68 69/** 70 * 目录层级定义 71 */ 72export const FOLDER_LEVEL = { 73 MIN_LEVEL: 1, 74 MAX_LEVEL: 21 75} 76 77/** 78 * 页面类型 79 */ 80export const PAGE_TYPE = { 81 MY_PHONE : 'myPhone' 82} 83 84export const FILE_MANAGER_PREFERENCES = { 85 name: 'FileManagerPreferences', 86 lastSelectPath: { 87 key: 'lastSelectPath', 88 defaultValue: '' 89 } 90} 91