diff --git a/@ohos.fileAccess.d.ts b/@ohos.fileAccess.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2f41dcfd999ff89abc6200e901d83d0cfbe9127 --- /dev/null +++ b/@ohos.fileAccess.d.ts @@ -0,0 +1,130 @@ +/* +* Copyright (C) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import {AsyncCallback, Callback} from "./basic"; + +/** + * Provides fileAccess APIs + * + * @since 9 + * @syscap SystemCapability.FileManagement.UserFileService + */ + +declare namespace fileAccess { + +/** + * Open File + * + * @since 9 + * @systemapi + */ +function openFile(sourceFileUri: string, mode: string): Promise; +function openFile(sourceFileUri: string, mode: string, callback: AsyncCallback): void; + +/** + * Create File + * + * @since 9 + * @systemapi + */ +function createFile(parentUri: string, displayName: string, newFileUri: string): Promise; +function createFile(parentUri: string, displayName: string, newFileUri: string, callback: AsyncCallback): void; + +/** + * Mkdir + * + * @since 9 + * @systemapi + */ +function mkdir(parentUri: string, displayName: string, newDirUri: string): Promise; +function mkdir(parentUri: string, displayName: string, newDirUri: string, callback: AsyncCallback): void; + +/** + * Delete + * + * @since 9 + * @systemapi + */ +function delete(selectFileUri: string): Promise; +function delete(selectFileUri: string, callback: AsyncCallback): void; + +/** + * Move + * + * @since 9 + * @systemapi + */ +function move(sourceFileUri: string, targetParentUri: string, newFileUri: string): Promise; +function move(sourceFileUri: string, targetParentUri: string, newFileUri: string, callback: AsyncCallback): void; + +/** + * Rename + * + * @since 9 + * @systemapi + */ +function rename(sourceFileUri: string, displayName: string, newFileUri: string): Promise; +function rename(sourceFileUri: string, displayName: string, newFileUri: string, callback: AsyncCallback): void; + +export interface UnorderedMap { + key : string; + value : string; +} + +/** + * Query + * + * @since 9 + * @systemapi + */ +function query(sourceFileUri: string): Promise>; +function query(sourceFileUri: string, callback: AsyncCallback>): void; + +export interface FileInfo { + uri : string; + name : string; + mode : string; + size : number; + mtime : number; + mimitype : string; +} + +/** + * Query Child File + * + * @since 9 + * @systemapi + */ +function queryChildFile(sourceFileUri: string): Promise>; +function queryChildFile(sourceFileUri: string, callback: AsyncCallback>): void; + +export interface DeviceInfo { + deviceId : string; + uri : string; + title : string; + flags : number; +} + +/** + * Get Roots + * + * @since 9 + * @systemapi + */ +function getRoots(): Promise>; +function getRoots(callback: AsyncCallback>): void; +} + +export default fileAccess; \ No newline at end of file diff --git a/bundle.json b/bundle.json deleted file mode 100644 index 95dbc537d0a3d2fcb80f4ae861bdfb655108e715..0000000000000000000000000000000000000000 --- a/bundle.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "@ohos/user_file_service", - "description": "filemanagement is the module of OpenHarmony that provides storage and file management.", - "version": "3.1", - "license": "Apache License 2.0", - "publishAs": "code-segment", - "segment": { - "destPath": "foundation/filemanagement/user_file_service" - }, - "dirs": {}, - "scripts": {}, - "component": { - "name": "user_file_service", - "subsystem": "filemanagement", - "syscap": [ - "SystemCapability.FileManagement.FileManagerService" - ], - "adapted_system_type": [ - "standard" - ], - "rom": "", - "ram": "", - "deps": { - "components": [ - "ability_base", - "ability_runtime", - "hiviewdfx", - "ipc", - "native_appdatamgr", - "safwk", - "samgr_standard" - ] - }, - "build": { - "sub_component": [ - "//foundation/filemanagement/user_file_service/services:fms", - "//foundation/filemanagement/user_file_service/services/sa_profile:filemanager_service_sa_profile", - "//foundation/filemanagement/user_file_service/interfaces/kits/js:filemanager" - ], - "test": [ - "//foundation/filemanagement/user_file_service/services/test:user_file_manager_test" - ] - } - } -}