2022-08-10 09:49:36 +00:00
|
|
|
/*
|
|
|
|
* 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';
|
2022-09-06 08:41:29 +00:00
|
|
|
import Context from './application/Context';
|
2022-08-10 09:49:36 +00:00
|
|
|
import image from './@ohos.multimedia.image';
|
2022-09-06 08:41:29 +00:00
|
|
|
import dataSharePredicates from './@ohos.data.dataSharePredicates';
|
2022-08-10 09:49:36 +00:00
|
|
|
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* @name userFileManager
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @import Import userFileManager from '@ohos.filemanagement.userFileManager'
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
declare namespace userFileManager {
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Returns an instance of UserFileManager
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @StageModelOnly
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param context Hap context information
|
2022-08-10 09:49:36 +00:00
|
|
|
* @return Instance of UserFileManager
|
|
|
|
*/
|
|
|
|
function getUserFileMgr(context: Context): UserFileManager;
|
|
|
|
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Enumeration types for different kinds of Files
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
enum FileType {
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Image file type
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
IMAGE = 1,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Video file type
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
VIDEO,
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Audio file type
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
AUDIO
|
|
|
|
}
|
|
|
|
|
2022-09-06 08:41:29 +00:00
|
|
|
/**
|
|
|
|
* Indicates the type of file asset member.
|
2022-10-21 06:29:24 +00:00
|
|
|
* @since 9
|
|
|
|
* @systemapi
|
2022-09-06 08:41:29 +00:00
|
|
|
*/
|
|
|
|
type MemberType = number | string | boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the type of notify event.
|
2022-10-21 06:29:24 +00:00
|
|
|
* @since 9
|
|
|
|
* @systemapi
|
2022-09-06 08:41:29 +00:00
|
|
|
*/
|
|
|
|
type ChangeEvent = 'deviceChange' | 'albumChange' | 'imageChange' | 'audioChange' | 'videoChange' | 'remoteFileChange';
|
|
|
|
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Provides methods to encapsulate file attributes.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @import Import userFileManager from '@ohos.filemanagement.userFileManager'
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
|
|
|
interface FileAsset {
|
|
|
|
/**
|
|
|
|
* URI of the file.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
readonly uri: string;
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* File type, for example, IMAGE, VIDEO, AUDIO
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
readonly fileType: FileType;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Display name (with a file name extension) of the file.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
displayName: string;
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Return the fileasset member parameter.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param member the name of the parameter. for example : get(ImageVideoKey.URI)
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
get(member: string): MemberType;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Set the fileasset member parameter.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param member The name of the parameter. only TITLE can be changed
|
|
|
|
* @param string The value of the parameter.
|
|
|
|
* @example : Set(ImageVideoKey.TITLE, "newTitle"), call commitModify after set value
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
set(member: string, value: string): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Modify meta data where the file is located.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO
|
|
|
|
* @param callback No value will be returned.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
|
|
|
commitModify(callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Modify meta data where the file is located.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
|
|
|
commitModify(): Promise<void>;
|
|
|
|
/**
|
|
|
|
* Open the file is located.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO or ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO
|
|
|
|
* @param mode Mode for open, for example: rw, r, w.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @param callback Callback return the fd of the file.
|
|
|
|
*/
|
|
|
|
open(mode: string, callback: AsyncCallback<number>): void;
|
|
|
|
/**
|
|
|
|
* Open the file is located.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO or ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO
|
|
|
|
* @param mode Mode for open, for example: rw, r, w.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
|
|
|
open(mode: string): Promise<number>;
|
|
|
|
/**
|
|
|
|
* Close the file is located.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param fd Fd of the file which had been opened
|
|
|
|
* @param callback No value will be returned.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
|
|
|
close(fd: number, callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Close the file is located.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param fd Fd of the file which had been opened
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
|
|
|
close(fd: number): Promise<void>;
|
|
|
|
/**
|
|
|
|
* Get thumbnail of the file when the file is located.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO
|
2022-08-10 09:49:36 +00:00
|
|
|
* @param callback Callback used to return the thumbnail's pixelmap.
|
|
|
|
*/
|
|
|
|
getThumbnail(callback: AsyncCallback<image.PixelMap>): void;
|
|
|
|
/**
|
|
|
|
* Get thumbnail of the file when the file is located.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO
|
|
|
|
* @param size Thumbnail's size
|
2022-08-10 09:49:36 +00:00
|
|
|
* @param callback Callback used to return the thumbnail's pixelmap.
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getThumbnail(size: image.Size, callback: AsyncCallback<image.PixelMap>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Get thumbnail of the file when the file is located.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO
|
|
|
|
* @param size Thumbnail's size
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getThumbnail(size?: image.Size): Promise<image.PixelMap>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Set favorite for the file when the file is located.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO
|
|
|
|
* @param isFavorite True is favorite file, false is not favorite file
|
2022-08-10 09:49:36 +00:00
|
|
|
* @param callback Callback used to return, No value is returned.
|
|
|
|
*/
|
|
|
|
favorite(isFavorite: boolean, callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Set favorite for the file when the file is located.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
** @permission ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO
|
|
|
|
* @param isFavorite True is favorite file, false is not favorite file
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
|
|
|
favorite(isFavorite: boolean): Promise<void>;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Describes AUDIO TYPE FetchOptions's predicate
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
enum AudioKey {
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* File uri
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
URI,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* File name
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
DISPLAY_NAME,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Date of the file creation
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
DATE_ADDED,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Modify date of the file
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
DATE_MODIFIED,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Title of the file
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
TITLE,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Artist of the audio file
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
ARTIST,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Audio album of the audio file
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
AUDIOALBUM,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Duration of the audio file
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
DURATION,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Favorite state of the file
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
FAVORITE,
|
2022-08-10 09:49:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Describes Image, Video TYPE FetchOptions's predicate
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
enum ImageVideoKey {
|
|
|
|
/**
|
|
|
|
* File uri
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
URI,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* File type of the Asset
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
FILE_TYPE,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* File name
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
DISPLAY_NAME,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Date of the file creation
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
DATE_ADDED,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Modify date of the file
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
DATE_MODIFIED,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Title of the file
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
TITLE,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Duration of the audio and video file
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
DURATION,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Width of the image file
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
WIDTH,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Height of the image file
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
HEIGHT,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Date taken of the file
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
DATE_TAKEN,
|
|
|
|
/**
|
|
|
|
* Orientation of the image file
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-09-06 08:41:29 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
ORIENTATION,
|
|
|
|
/**
|
|
|
|
* Favorite state of the file
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-09-06 08:41:29 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
FAVORITE,
|
2022-08-10 09:49:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes Album TYPE predicate
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
enum AlbumKey {
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Album uri
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
URI,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* File type of the Album
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
FILE_TYPE,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Album name
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
ALBUM_NAME,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Date of the Album creation
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
DATE_ADDED,
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Modify date of the Album
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
DATE_MODIFIED,
|
2022-08-10 09:49:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Fetch parameters
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-09-06 08:41:29 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
interface FetchOptions {
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Indicates the columns to query.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param fetchColumns Indicates the columns to query. If this parameter is null, only uri, name, fileType will query.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
fetchColumns: Array<string>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Predicate to query
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param predicates Indicates filter criteria.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
predicates: dataSharePredicates.DataSharePredicates;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fetch parameters
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-09-06 08:41:29 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
interface AlbumFetchOptions {
|
|
|
|
/**
|
|
|
|
* Predicate to query
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-09-06 08:41:29 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @param predicates Indicates filter criteria.
|
|
|
|
*/
|
|
|
|
predicates: dataSharePredicates.DataSharePredicates;
|
2022-08-10 09:49:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements file retrieval.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @import Import userFileManager from '@ohos.filemanagement.userFileManager'
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
interface FetchResult<T> {
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Obtains the total number of files in the file retrieval result.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @return Total number of files.
|
|
|
|
*/
|
|
|
|
getCount(): number;
|
|
|
|
/**
|
|
|
|
* Checks whether the result set points to the last row.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @return Whether the file is the last one.
|
|
|
|
* You need to check whether the file is the last one before calling getNextObject,
|
|
|
|
* which returns the next file only when True is returned for this method.
|
|
|
|
*/
|
|
|
|
isAfterLast(): boolean;
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Releases the FetchResult instance and invalidates it. Other methods cannot be called.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
close(): void;
|
|
|
|
/**
|
|
|
|
* Obtains the first FileAsset in the file retrieval result. This method uses a callback to return the file.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @param callback Callback used to return the file in the format of a FileAsset instance.
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getFirstObject(callback: AsyncCallback<T>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains the first T in the file retrieval result. This method uses a promise to return the file.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @return A Promise instance used to return the file in the format of a T instance.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getFirstObject(): Promise<T>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains the next T in the file retrieval result.
|
2022-08-10 09:49:36 +00:00
|
|
|
* This method uses a callback to return the file.
|
|
|
|
* Before calling this method, you must use isAfterLast() to check whether the result set points to the last row.
|
|
|
|
* This method returns the next file only when True is returned for isAfterLast().
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param callback Callback used to return the file in the format of a T instance.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getNextObject(callback: AsyncCallback<T>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains the next T in the file retrieval result.
|
2022-08-10 09:49:36 +00:00
|
|
|
* This method uses a promise to return the file.
|
|
|
|
* Before calling this method, you must use isAfterLast() to check whether the result set points to the last row.
|
|
|
|
* This method returns the next file only when True is returned for isAfterLast().
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @return A Promise instance used to return the file in the format of a T instance.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getNextObject(): Promise<T>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains the last T in the file retrieval result. This method uses a callback to return the file.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param callback Callback used to return the file in the format of a T instance.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getLastObject(callback: AsyncCallback<T>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains the last T in the file retrieval result. This method uses a promise to return the file.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @return A Promise instance used to return the file in the format of a T instance.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getLastObject(): Promise<T>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains the T with the specified index in the file retrieval result.
|
2022-08-10 09:49:36 +00:00
|
|
|
* This method uses a callback to return the file.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @param index Index of the file to obtain.
|
2022-09-06 08:41:29 +00:00
|
|
|
* @throws {BusinessError} 13900020 - if type index is not number
|
|
|
|
* @param callback Callback used to return the file in the format of a T instance.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getPositionObject(index: number, callback: AsyncCallback<T>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains the T with the specified index in the file retrieval result.
|
2022-08-10 09:49:36 +00:00
|
|
|
* This method uses a promise to return the file.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @param index Index of the file to obtain.
|
2022-09-06 08:41:29 +00:00
|
|
|
* @throws {BusinessError} 13900020 - if type index is not number
|
|
|
|
* @return A Promise instance used to return the file in the format of a T instance.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getPositionObject(index: number): Promise<T>;
|
2022-08-10 09:49:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Defines the AbsAlbum.
|
2022-08-10 09:49:36 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
interface AbsAlbum {
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Album name.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
albumName: string;
|
|
|
|
/**
|
|
|
|
* Album uri.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
readonly albumUri: string;
|
|
|
|
/**
|
|
|
|
* Date (timestamp) when the album was last modified.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
readonly dateModified: number;
|
|
|
|
/**
|
|
|
|
* File count for the album
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
readonly count: number;
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* CoverUri for the album
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
readonly coverUri: string;
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains files in an album. This method uses an asynchronous callback to return the files.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO
|
|
|
|
* @param type Detemined which kinds of asset to retrive.
|
|
|
|
* @param options Retrieval options.
|
|
|
|
* @throws {BusinessError} 13900020 - if type options is not FetchOptions
|
|
|
|
* @param callback Callback used to return the files in the format of a FetchResult instance.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getPhotoAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<FileAsset>>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Obtains files in an album. This method uses a promise to return the files.
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO
|
|
|
|
* @param type Detemined which kinds of asset to retrive.
|
|
|
|
* @param options Retrieval options.
|
|
|
|
* @throws {BusinessError} 13900020 - if type options is not FetchOptions
|
|
|
|
* @return A Promise instance used to return the files in the format of a FetchResult instance.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getPhotoAssets(options: FetchOptions): Promise<FetchResult<FileAsset>>;
|
2022-08-10 09:49:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Defines the album.
|
|
|
|
*
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
interface Album extends AbsAlbum {
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Modify the meta data for the album
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.WRITE_IMAGEVIDEO
|
|
|
|
* @param callback No value will be returned.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
commitModify(callback: AsyncCallback<void>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Modify the meta data for the album
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.WRITE_IMAGEVIDEO
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
commitModify(): Promise<void>;
|
2022-08-10 09:49:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines the UserFileManager class and provides functions to access the data in user file storage.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
|
|
|
interface UserFileManager {
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Query photo, video assets
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO
|
|
|
|
* @param options retrieval options.
|
|
|
|
* @throws {BusinessError} 13900020 - if type options is not FetchOptions
|
|
|
|
* @param callback Callback return the FetchResult.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getPhotoAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<FileAsset>>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Query photo, video assets
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO
|
|
|
|
* @param type Detemined which kinds of asset to retrive.
|
|
|
|
* @param options Retrieval options.
|
|
|
|
* @throws {BusinessError} 13900020 - if type options is not FetchOptions
|
|
|
|
* @return A promise instance used to return the files in the format of a FetchResult instance
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getPhotoAssets(options: FetchOptions): Promise<FetchResult<FileAsset>>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Create Photo Asset
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.WRITE_IMAGEVIDEO
|
|
|
|
* @param displayName File name
|
|
|
|
* @param albumUri Asset will put into the album.
|
|
|
|
* @param callback Callback used to return the FileAsset
|
|
|
|
* @throws {BusinessError} 13900020 - if type displayName or albumUri is not string
|
|
|
|
* @throws {BusinessError} 14000001 - if type displayName invalid
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
createPhotoAsset(displayName: string, albumUri: string, callback: AsyncCallback<FileAsset>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Create Photo Asset
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @permission ohos.permission.WRITE_IMAGEVIDEO
|
|
|
|
* @param displayName File name
|
|
|
|
* @param callback Callback used to return the FileAsset
|
|
|
|
* @throws {BusinessError} 13900020 - if type displayName is not string
|
|
|
|
* @throws {BusinessError} 14000001 - if type displayName invalid
|
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-09-06 08:41:29 +00:00
|
|
|
*/
|
|
|
|
createPhotoAsset(displayName: string, callback: AsyncCallback<FileAsset>): void;
|
|
|
|
/**
|
|
|
|
* Create Photo Asset
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.WRITE_IMAGEVIDEO
|
|
|
|
* @param displayName File name
|
|
|
|
* @param albumUri Album uri is optional, asset will put into the default album without albumUri
|
|
|
|
* @return A Promise instance used to return the FileAsset
|
|
|
|
* @throws {BusinessError} 13900020 - if type displayName or albumUri is not string
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
createPhotoAsset(displayName: string, albumUri?: string): Promise<FileAsset>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains albums based on the retrieval options. This method uses an asynchronous callback to return.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO
|
|
|
|
* @param options Retrieval options.
|
|
|
|
* @param callback Callback used to return an album array.
|
|
|
|
* @throws {BusinessError} 13900020 - if type options is not AlbumFetchOptions
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getPhotoAlbums(options: AlbumFetchOptions, callback: AsyncCallback<FetchResult<Album>>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains albums based on the retrieval options. This method uses a promise to return the albums.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO
|
|
|
|
* @param options Retrieval options.
|
|
|
|
* @return A Promise instance used to return an album array.
|
|
|
|
* @throws {BusinessError} 13900020 - if type options is not AlbumFetchOptions
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getPhotoAlbums(options: AlbumFetchOptions): Promise<FetchResult<Album>>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains system private albums based on the private album type. This method uses an asynchronous callback to return.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO
|
|
|
|
* @param type Private album type
|
|
|
|
* @param callback Used to return a private album FetchResult.
|
|
|
|
* @throws {BusinessError} 13900020 - if type type is not PrivateAlbumType
|
2022-08-10 09:49:36 +00:00
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getPrivateAlbum(type: PrivateAlbumType, callback: AsyncCallback<FetchResult<PrivateAlbum>>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Obtains system private albums based on the private album type. This method uses a promise to return.
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO
|
|
|
|
* @param type Private album type
|
|
|
|
* @return A Promise instance used to return a private album FetchResult.
|
|
|
|
* @throws {BusinessError} 13900020 - if type type is not PrivateAlbumType
|
2022-08-10 09:49:36 +00:00
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getPrivateAlbum(type: PrivateAlbumType): Promise<FetchResult<PrivateAlbum>>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Query audio assets
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_AUDIO
|
|
|
|
* @param options Retrieval options.
|
|
|
|
* @throws {BusinessError} 13900020 - if type options is not FetchOptions
|
|
|
|
* @param callback Callback return the FetchResult.
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getAudioAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<FileAsset>>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Query audio assets
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_AUDIO
|
|
|
|
* @param type Detemined which kinds of asset to retrive.
|
|
|
|
* @param options Retrieval options.
|
|
|
|
* @throws {BusinessError} 13900020 - if type options is not FetchOptions
|
|
|
|
* @return A promise instance used to return the files in the format of a FetchResult instance
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
getAudioAssets(options: FetchOptions): Promise<FetchResult<FileAsset>>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Delete Asset
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-09-06 08:41:29 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.READ_AUDIO and ohos.permission.WRITE_AUDIO
|
|
|
|
* @param uri Uri of asset
|
|
|
|
* @param callback No value returned
|
|
|
|
* @throws {BusinessError} 13900020 - if type uri is not string
|
|
|
|
*/
|
|
|
|
delete(uri: string, callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Delete Asset
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.READ_AUDIO and ohos.permission.WRITE_AUDIO
|
|
|
|
* @param uri Uri of asset
|
|
|
|
* @return A Promise instance, no value returned
|
|
|
|
* @throws {BusinessError} 13900020 - if type uri is not string
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
delete(uri: string): Promise<void>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Turn on mornitor the data changes
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param type One of 'deviceChange','albumChange','imageChange','audioChange','videoChange','remoteFileChange'
|
|
|
|
* @param callback No value returned
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
on(type: ChangeEvent, callback: Callback<void>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Turn off mornitor the data changes
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-09-06 08:41:29 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @param type One of 'deviceChange','albumChange','imageChange','audioChange','videoChange','remoteFileChange'
|
|
|
|
* @param callback No value returned
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
off(type: ChangeEvent, callback?: Callback<void>): void;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* Get Active Peer device information
|
|
|
|
* @since 9
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.DistributedCore
|
|
|
|
* @systemapi
|
|
|
|
* @param callback, Callback return the list of the active peer devices' information
|
|
|
|
*/
|
|
|
|
getActivePeers(callback: AsyncCallback<Array<PeerInfo>>): void;
|
|
|
|
/**
|
|
|
|
* Get Active Peer device information
|
|
|
|
* @since 9
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.DistributedCore
|
|
|
|
* @systemapi
|
|
|
|
* @return Promise used to return the list of the active peer devices' information
|
|
|
|
*/
|
|
|
|
getActivePeers(): Promise<Array<PeerInfo>>;
|
|
|
|
/**
|
|
|
|
* Get all the peer devices' information
|
|
|
|
* @since 9
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.DistributedCore
|
|
|
|
* @systemapi
|
|
|
|
* @param callback Callback return the list of the all the peer devices' information
|
|
|
|
*/
|
|
|
|
getAllPeers(callback: AsyncCallback<Array<PeerInfo>>): void;
|
|
|
|
/**
|
|
|
|
* Get all the peer devices' information
|
|
|
|
* @since 9
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.DistributedCore
|
|
|
|
* @systemapi
|
|
|
|
* @return Promise used to return the list of the all the peer devices' information
|
|
|
|
*/
|
|
|
|
getAllPeers(): Promise<Array<PeerInfo>>;
|
|
|
|
/**
|
|
|
|
* Release UserFileManager instance
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @param callback no value returned
|
|
|
|
*/
|
|
|
|
release(callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Release UserFileManager instance
|
|
|
|
* @since 9
|
2022-10-21 06:29:24 +00:00
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
*/
|
|
|
|
release(): Promise<void>;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Peer devices' information
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.DistributedCore
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
interface PeerInfo {
|
|
|
|
/**
|
|
|
|
* Peer device name
|
|
|
|
* @since 9
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.DistributedCore
|
|
|
|
* @systemapi
|
|
|
|
*/
|
|
|
|
readonly deviceName: string;
|
|
|
|
/**
|
|
|
|
* Peer device network id
|
|
|
|
* @since 9
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.DistributedCore
|
|
|
|
* @systemapi
|
|
|
|
*/
|
|
|
|
readonly networkId: string;
|
|
|
|
/**
|
|
|
|
* Peer device online status
|
|
|
|
* @since 9
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.DistributedCore
|
|
|
|
* @systemapi
|
|
|
|
*/
|
|
|
|
readonly isOnline: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Private album type
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
enum PrivateAlbumType {
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
|
|
|
* System Private Album: Favorite album
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
TYPE_FAVORITE,
|
|
|
|
/**
|
|
|
|
* System Private Album: Trash album
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
TYPE_TRASH,
|
|
|
|
}
|
2022-09-06 08:41:29 +00:00
|
|
|
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Defines the private album
|
2022-08-10 09:49:36 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
interface PrivateAlbum extends AbsAlbum {
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Delete asset permanently from Trash bin, only support the Trash album
|
|
|
|
* @since 9
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param uri uri of asset
|
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.READ_AUDIO and ohos.permission.WRITE_AUDIO
|
|
|
|
* @param callback No value returned
|
2022-08-10 09:49:36 +00:00
|
|
|
* @systemapi
|
2022-09-06 08:41:29 +00:00
|
|
|
*/
|
|
|
|
delete(uri: string, callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Delete asset permanently from Trash bin, only support the Trash album
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-09-06 08:41:29 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @param uri Uri of asset
|
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.READ_AUDIO and ohos.permission.WRITE_AUDIO
|
|
|
|
* @return A Promise instance, no value returned
|
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
delete(uri: string): Promise<void>;
|
2022-08-10 09:49:36 +00:00
|
|
|
/**
|
2022-09-06 08:41:29 +00:00
|
|
|
* Recover asset from Trash bin, only support the Trash album
|
|
|
|
* @since 9
|
2022-08-10 09:49:36 +00:00
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param uri Uri of asset
|
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.READ_AUDIO and ohos.permission.WRITE_AUDIO
|
|
|
|
* @param callback No value returned
|
2022-08-10 09:49:36 +00:00
|
|
|
* @systemapi
|
2022-09-06 08:41:29 +00:00
|
|
|
*/
|
|
|
|
recover(uri: string, callback: AsyncCallback<void>): void;
|
|
|
|
/**
|
|
|
|
* Recover asset from Trash bin, only support the Trash album
|
2022-08-10 09:49:36 +00:00
|
|
|
* @since 9
|
2022-09-06 08:41:29 +00:00
|
|
|
* @param uri Uri of asset
|
|
|
|
* @syscap SystemCapability.FileManagement.UserFileManager.Core
|
|
|
|
* @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.READ_AUDIO and ohos.permission.WRITE_AUDIO
|
|
|
|
* @return A Promise instance, no value returned
|
|
|
|
* @systemapi
|
2022-08-10 09:49:36 +00:00
|
|
|
*/
|
2022-09-06 08:41:29 +00:00
|
|
|
recover(uri: string): Promise<void>;
|
2022-08-10 09:49:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-06 08:41:29 +00:00
|
|
|
export default userFileManager;
|