From 81a4ce868bffad3fcfa85b7dd6d551392a1686ed Mon Sep 17 00:00:00 2001 From: zhuhongtao666 Date: Thu, 25 Aug 2022 21:14:41 +0800 Subject: [PATCH 1/2] add_Dir_listFile Signed-off-by: zhuhongtao666 --- api/@ohos.fileio.d.ts | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/api/@ohos.fileio.d.ts b/api/@ohos.fileio.d.ts index d074897db6..88207c5aa8 100644 --- a/api/@ohos.fileio.d.ts +++ b/api/@ohos.fileio.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-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 @@ -1059,6 +1059,39 @@ declare interface Dir { * @returns {void | Promise} close success * @throws {TypedError | Error} close fail */ + /** + * listFile. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + * @function listFile + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} no callback return Promise otherwise return void + * @throws {BusinessError} Parameter check failed if read to end, Error.msg = "NoMore" + */ + listFile(): Promise; + listFile(callback: AsyncCallback): void; + /** + * listFileSync. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + * @function readSync + * @returns {Dirent} Dirent Object + * @throws {BusinessError | Error} read fail if read to end, Error.msg = "NoMore" + */ + listFileSync(): Dirent; + /** + * close. + * @note N/A + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 7 + * @permission N/A + * @function close + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} close success + * @throws {TypedError | Error} close fail + */ + close(): Promise; close(callback: AsyncCallback): void; /** -- Gitee From 8190e6caf4c4a7e79e60fc5d0ce500e003ede129 Mon Sep 17 00:00:00 2001 From: zhuhongtao666 Date: Thu, 25 Aug 2022 21:19:26 +0800 Subject: [PATCH 2/2] add_Dir_listFile Signed-off-by: zhuhongtao666 --- api/@ohos.fileio.d.ts | 54 +++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/api/@ohos.fileio.d.ts b/api/@ohos.fileio.d.ts index 88207c5aa8..b78dc4ddc7 100644 --- a/api/@ohos.fileio.d.ts +++ b/api/@ohos.fileio.d.ts @@ -1048,6 +1048,27 @@ declare interface Dir { * @throws {TypedError | Error} read fail if read to end, Error.msg = "NoMore" */ readSync(): Dirent; + /** + * listFile. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + * @function listFile + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} no callback return Promise otherwise return void + * @throws {BusinessError} Parameter check failed if read to end, Error.msg = "NoMore" + */ + listFile(): Promise; + listFile(callback: AsyncCallback): void; + /** + * listFileSync. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + * @function listFileSync + * @returns {Dirent} Dirent Object + * @throws {BusinessError | Error} read fail if read to end, Error.msg = "NoMore" + */ + listFileSync(): Dirent; /** * close. * @note N/A @@ -1059,39 +1080,6 @@ declare interface Dir { * @returns {void | Promise} close success * @throws {TypedError | Error} close fail */ - /** - * listFile. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - * @function listFile - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws {BusinessError} Parameter check failed if read to end, Error.msg = "NoMore" - */ - listFile(): Promise; - listFile(callback: AsyncCallback): void; - /** - * listFileSync. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 10 - * @function readSync - * @returns {Dirent} Dirent Object - * @throws {BusinessError | Error} read fail if read to end, Error.msg = "NoMore" - */ - listFileSync(): Dirent; - /** - * close. - * @note N/A - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 7 - * @permission N/A - * @function close - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} close success - * @throws {TypedError | Error} close fail - */ - close(): Promise; close(callback: AsyncCallback): void; /** -- Gitee