From a6319053f741bab04df7ed0e003443d44817f966 Mon Sep 17 00:00:00 2001 From: linjun9528 Date: Wed, 2 Mar 2022 17:32:06 +0800 Subject: [PATCH 1/2] alter js api description Signed-off-by: linjun9528 --- api/common/@system.file.d.ts | 187 ++++++++++++++++++----------------- 1 file changed, 96 insertions(+), 91 deletions(-) diff --git a/api/common/@system.file.d.ts b/api/common/@system.file.d.ts index 7f2424a1f5..e5ef9f3e20 100644 --- a/api/common/@system.file.d.ts +++ b/api/common/@system.file.d.ts @@ -16,6 +16,7 @@ export interface FileResponse { /** * File URI. + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -23,6 +24,7 @@ export interface FileResponse { /** * File size, in bytes. * If type is dir, the length value is fixed to 0. + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ length: number; @@ -30,6 +32,7 @@ export interface FileResponse { /** * Timestamp when the file is stored, which is the number of milliseconds elapsed since 1970/01/01 00:00:00. * For lite wearables, the value is fixed to 0, because this parameter is restricted by the underlying file system. + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ lastModifiedTime: number; @@ -38,6 +41,7 @@ export interface FileResponse { * File type. The values are as follows: * dir: directory * file: file + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ type: "dir" | "file"; @@ -45,13 +49,14 @@ export interface FileResponse { /** * File list. When the recursive value is true and the type is dir, the file information under the subdirectory will be returned. * Otherwise, no value will be returned. + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ subFiles?: Array; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export interface FileMoveOption { /** @@ -59,7 +64,7 @@ export interface FileMoveOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ srcUri: string; @@ -69,7 +74,7 @@ export interface FileMoveOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ dstUri: string; @@ -77,39 +82,39 @@ export interface FileMoveOption { /** * Called when the source file is moved to the specified location successfully. * This function returns the URI of the file moved to the target location. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (uri: string) => void; /** * Called when moving fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export interface FileListResponse { /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fileList: Array; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export interface FileListOption { /** @@ -117,28 +122,28 @@ export interface FileListOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; /** * Called when the list is obtained successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (data: FileListResponse) => void; /** * Called when the list fails to be obtained. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; @@ -150,7 +155,7 @@ export interface FileCopyOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ srcUri: string; @@ -160,7 +165,7 @@ export interface FileCopyOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ dstUri: string; @@ -168,21 +173,21 @@ export interface FileCopyOption { /** * Called when the copy file is saved successful. * This function returns the URI of the file saved to the target location. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (uri: string) => void; /** * Called when the copy or save operation fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; @@ -194,7 +199,7 @@ export interface FileGetOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -202,28 +207,28 @@ export interface FileGetOption { /** * Whether to recursively obtain the file list under a subdirectory. * The default value is false. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ recursive?: boolean; /** * Called when file information is obtained successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (file: FileResponse) => void; /** * Called when file information fails to be obtained. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; @@ -235,35 +240,35 @@ export interface FileDeleteOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; /** * Called when local files are deleted successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when the deletion fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export interface FileWriteTextOption { /** @@ -271,60 +276,60 @@ export interface FileWriteTextOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; /** * Character string to write into the local file. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ text: string; /** * Encoding format. The default format is UTF-8. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ encoding?: string; /** * Whether to enable the append mode. The default value is false. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ append?: boolean; /** * Called when texts are written into a file successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when texts fail to be written into a file. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export interface FileReadTextResponse { /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ text: string; @@ -336,7 +341,7 @@ export interface FileReadTextOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -344,7 +349,7 @@ export interface FileReadTextOption { /** * Encoding format. The default format is UTF-8. * Currently, only UTF-8 is supported. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ encoding?: string; @@ -352,7 +357,7 @@ export interface FileReadTextOption { /** * Position where the reading starts. * The default value is the start position of the file. - * @devices liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ position?: number; @@ -360,35 +365,35 @@ export interface FileReadTextOption { /** * Position where the reading starts. * The default value is the start position of the file. - * @devices liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ length?: number; /** * Called when texts are read successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (data: FileReadTextResponse) => void; /** * Called when texts fail to be read. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export interface FileWriteArrayBufferOption { /** @@ -396,21 +401,21 @@ export interface FileWriteArrayBufferOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; /** * Buffer from which the data is derived. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ buffer: Uint8Array; /** * Offset to the position where the writing starts. The default value is 0. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ position?: number; @@ -418,46 +423,46 @@ export interface FileWriteArrayBufferOption { /** * Whether to enable the append mode. * The default value is false. If the value is true, the position parameter will become invalid. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ append?: boolean; /** * Called when data from a buffer is written into a file successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when data from a buffer fails to be written into a file. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export interface FileReadArrayBufferResponse { /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ buffer: Uint8Array; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export interface FileReadArrayBufferOption { /** @@ -465,7 +470,7 @@ export interface FileReadArrayBufferOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -473,7 +478,7 @@ export interface FileReadArrayBufferOption { /** * Position where the reading starts. * The default value is the start position of the file. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ position?: number; @@ -481,35 +486,35 @@ export interface FileReadArrayBufferOption { /** * Length of the content to read. * If this parameter is not set, all content of the file will be read. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ length?: number; /** * Called when the buffer data is read successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: (data: FileReadArrayBufferResponse) => void; /** * Called when the buffer data fails to be read. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export interface FileAccessOption { /** @@ -517,35 +522,35 @@ export interface FileAccessOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; /** * Called when the check result is obtained successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when the check fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export interface FileMkdirOption { /** @@ -554,7 +559,7 @@ export interface FileMkdirOption { * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. * 3. A maximum of five recursions are allowed for creating the directory. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -562,35 +567,35 @@ export interface FileMkdirOption { /** * Whether to create the directory after creating its upper-level directory recursively. * The default value is false. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ recursive?: boolean; /** * Called when the directory is created successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when the creation fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export interface FileRmdirOption { /** @@ -598,7 +603,7 @@ export interface FileRmdirOption { * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. * 2. The maximum number of characters allowed is 128. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ uri: string; @@ -606,118 +611,118 @@ export interface FileRmdirOption { /** * Whether to delete files and subdirectories recursively. * The default value is false. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ recursive?: boolean; /** * Called when the directory is deleted successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ success?: () => void; /** * Called when the deletion fails. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO * @since 3 */ complete?: () => void; } /** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision + * @syscap SystemCapability.FileManagement.File.FileIO */ export default class File { /** * Moves the source file to a specified location. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static move(options: FileMoveOption): void; /** * Copies a source file and save the copy to a specified location. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static copy(options: FileCopyOption): void; /** * Obtains the list of files in a specified directory. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static list(options: FileListOption): void; /** * Obtains information about a local file. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static get(options: FileGetOption): void; /** * Deletes local files. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static delete(options: FileDeleteOption): void; /** * Writes texts into a file. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static writeText(options: FileWriteTextOption): void; /** * Reads texts from a file. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static readText(options: FileReadTextOption): void; /** * Writes data from a buffer into a file. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static writeArrayBuffer(options: FileWriteArrayBufferOption): void; /** * Reads buffer data from a file. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static readArrayBuffer(options: FileReadArrayBufferOption): void; /** * Checks whether a file or directory exists. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static access(options: FileAccessOption): void; /** * Creates a directory. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static mkdir(options: FileMkdirOption): void; /** * Deletes a directory. + * @syscap SystemCapability.FileManagement.File.FileIO * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision */ static rmdir(options: FileRmdirOption): void; } -- Gitee From 800cb64127ed52e785dd32f3fcb820a9b85839f5 Mon Sep 17 00:00:00 2001 From: linjun9528 Date: Wed, 2 Mar 2022 19:10:04 +0800 Subject: [PATCH 2/2] alter file js api description Signed-off-by: linjun9528 --- api/common/@system.file.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/api/common/@system.file.d.ts b/api/common/@system.file.d.ts index e5ef9f3e20..b65af860dc 100644 --- a/api/common/@system.file.d.ts +++ b/api/common/@system.file.d.ts @@ -452,6 +452,7 @@ export interface FileWriteArrayBufferOption { /** * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileReadArrayBufferResponse { /** @@ -463,6 +464,7 @@ export interface FileReadArrayBufferResponse { /** * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileReadArrayBufferOption { /** @@ -515,6 +517,7 @@ export interface FileReadArrayBufferOption { /** * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileAccessOption { /** @@ -551,6 +554,7 @@ export interface FileAccessOption { /** * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileMkdirOption { /** @@ -596,6 +600,7 @@ export interface FileMkdirOption { /** * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export interface FileRmdirOption { /** @@ -640,11 +645,13 @@ export interface FileRmdirOption { /** * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 */ export default class File { /** * Moves the source file to a specified location. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static move(options: FileMoveOption): void; @@ -652,6 +659,7 @@ export default class File { /** * Copies a source file and save the copy to a specified location. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static copy(options: FileCopyOption): void; @@ -659,6 +667,7 @@ export default class File { /** * Obtains the list of files in a specified directory. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static list(options: FileListOption): void; @@ -666,6 +675,7 @@ export default class File { /** * Obtains information about a local file. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static get(options: FileGetOption): void; @@ -673,6 +683,7 @@ export default class File { /** * Deletes local files. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static delete(options: FileDeleteOption): void; @@ -680,6 +691,7 @@ export default class File { /** * Writes texts into a file. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static writeText(options: FileWriteTextOption): void; @@ -687,6 +699,7 @@ export default class File { /** * Reads texts from a file. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static readText(options: FileReadTextOption): void; @@ -694,6 +707,7 @@ export default class File { /** * Writes data from a buffer into a file. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static writeArrayBuffer(options: FileWriteArrayBufferOption): void; @@ -701,6 +715,7 @@ export default class File { /** * Reads buffer data from a file. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static readArrayBuffer(options: FileReadArrayBufferOption): void; @@ -708,6 +723,7 @@ export default class File { /** * Checks whether a file or directory exists. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static access(options: FileAccessOption): void; @@ -715,6 +731,7 @@ export default class File { /** * Creates a directory. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static mkdir(options: FileMkdirOption): void; @@ -722,6 +739,7 @@ export default class File { /** * Deletes a directory. * @syscap SystemCapability.FileManagement.File.FileIO + * @since 3 * @param options Options. */ static rmdir(options: FileRmdirOption): void; -- Gitee