From e39fe0a0bf92bacb895b40acfe7421b2eeef4894 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Wed, 22 Jun 2022 15:42:18 +0800 Subject: [PATCH 01/21] add fileaccess.dts Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 165 +++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100755 api/@ohos.data.fileAccess.d.ts diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts new file mode 100755 index 0000000000..ec3cc894e5 --- /dev/null +++ b/api/@ohos.data.fileAccess.d.ts @@ -0,0 +1,165 @@ +/* +* 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"; +import { Want } from './ability/want'; +import Context from './application/Context'; + +declare namespace fileaccess { + /** + * Obtains the fileAccessHelper. + * @since 9 + * @syscap SystemCapability.FileExtension.FileAccessFramework + * @param context Indicates the application context. + * @param want + * @return Returns the fileAccessHelper. + * @systemapi + * @permission + */ + function createFileAccessHelper(context: Context, want: Want, callback: AsyncCallback): void; + function createFileAccessHelper(context: Context, want: Want): Promise; + + /** + * File + * @since 9 + * @syscap SystemCapability.FileExtension.FileAccessFramework + * @StageModelOnly + */ + class File { + uri : string; + fileName : string; + mode : string; + size : number; + mtime : number; + mimitype : string; + next(): File; + listfile() : File + } + + /** + * Root + * @since 9 + * @syscap SystemCapability.FileExtension.FileAccessFramework + * @StageModelOnly + */ + class Root { + deviceId : string; + uri : string; + displayName : string; + flags : number; + listFile() : Array + } + + /** + * FileAccessHelper + * @since 9 + * @syscap SystemCapability.FileExtension.FileAccessFramework + * @StageModelOnly + */ + interface FileAccessHelper { + /** + * Opens a file in a specified remote path. + * + * @since 9 + * @syscap SystemCapability.FileExtension.FileAccessFramework + * @param uri Indicates the path of the file to open. + * @param flags + * @param callback Indicates the callback when openfile success + * @return Returns the file descriptor. + * @StageModelOnly + */ + openFile(uri: string, flags: number): Promise; + openFile(uri: string, flags: number, callback: AsyncCallback): void; + + /** + * + * + * @since 9 + * @syscap SystemCapability.FileExtension.FileAccessFramework + * @param + * @param + * @param + * @return + * @StageModelOnly + */ + createFile(parentUri: string, displayName: string): Promise; + createFile(parentUri: string, displayName: string, callback: AsyncCallback): void; + + /** + * + * + * @since 9 + * @syscap SystemCapability.FileExtension.FileAccessFramework + * @param + * @param + * @param + * @return + * @StageModelOnly + */ + mkdir(parentUri: string, displayName: string): Promise; + mkdir(parentUri: string, displayName: string, callback: AsyncCallback): void; + + /** + * + * + * @since 9 + * @syscap SystemCapability.FileExtension.FileAccessFramework + * @param + * @param + * @param + * @return + * @StageModelOnly + */ + delete(selectFileUri: string): Promise; + delete(selectFileUri: string, callback: AsyncCallback): void; + + /** + * + * + * @since 9 + * @syscap SystemCapability.FileExtension.FileAccessFramework + * @param + * @param + * @return + * @StageModelOnly + */ + move(sourceFileUri: string, targetParentUri: string): Promise; + move(sourceFileUri: string, targetParentUri: string, callback: AsyncCallback): void; + + /** + * + * + * @since 9 + * @syscap SystemCapability.FileExtension.FileAccessFramework + * @param + * @param + * @return + * @StageModelOnly + */ + rename(sourceFileUri: string, displayName: string): Promise; + rename(sourceFileUri: string, displayName: string, callback: AsyncCallback): void; + + /** + * + * + * @since 9 + * @syscap SystemCapability.FileExtension.FileAccessFramework + * @return + * @StageModelOnly + */ + getRoots(): Promise>; + getRoots(callback: AsyncCallback>): void; + } +} -- Gitee From 320bbb222a39e631a1139a6ab77cc94aac2db03e Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Wed, 22 Jun 2022 15:55:49 +0800 Subject: [PATCH 02/21] add Revise Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index ec3cc894e5..46790f57b3 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -45,7 +45,7 @@ declare namespace fileaccess { mtime : number; mimitype : string; next(): File; - listfile() : File + listfile() : Array } /** -- Gitee From 0f40de5347b20ca25ecda753b5af4fd4e56e7766 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Wed, 22 Jun 2022 16:29:05 +0800 Subject: [PATCH 03/21] add Revise Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 46790f57b3..de2f8e2e3d 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -43,7 +43,7 @@ declare namespace fileaccess { mode : string; size : number; mtime : number; - mimitype : string; + mimetype : string; next(): File; listfile() : Array } -- Gitee From 6f30101f988966c486d3a492f54575e71d78ce76 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Mon, 27 Jun 2022 20:26:07 +0800 Subject: [PATCH 04/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9dts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 294 +++++++++++++++------------------ 1 file changed, 137 insertions(+), 157 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index de2f8e2e3d..5264c34316 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -1,165 +1,145 @@ /* -* 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 +*Copyright (c) 2022 Huawei Device Context., 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 +*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. +*Unless required by applicable law or agreed to in writing, software +*distributed under the License is distibuted 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"; -import { Want } from './ability/want'; +import {AsyncCallback , Callback} from "./basic"; +import {Want } from './ability/want'; import Context from './application/Context'; -declare namespace fileaccess { - /** - * Obtains the fileAccessHelper. - * @since 9 - * @syscap SystemCapability.FileExtension.FileAccessFramework - * @param context Indicates the application context. - * @param want - * @return Returns the fileAccessHelper. - * @systemapi - * @permission - */ - function createFileAccessHelper(context: Context, want: Want, callback: AsyncCallback): void; - function createFileAccessHelper(context: Context, want: Want): Promise; +declare namespace fileeaccess{ + /** + * Obtains the fileAccessHelper. + * @since 9 + * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework + * @param context Indicates the application context. + * @param want + * @return Returns the fileAccessHelper. + * @StageModelOnly + * @systemapi + */ + function createFileAccessHelper(Context: Context, want:Want , callback:AsyncCallback) : void ; + function createFileAccessHelper(Context: Context, want:Want ): Promise; + /** + * File Object + * @since 9 + * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework + * @StageModelOnly + * @systemapi + */ + interface FileIterator { + uri : string; + fileName : string; + mode : string; + size : number; + mtime : number; + mimetype : string; + [Symbol.iterator]() : IterableIterator; + listFile() : FileIterator; + } + /** + * Root Object + * @since 9 + * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework + * @StageModelOnly + * @systemapi + */ + interface Root{ + deviceId : string; + uri : string; + displayName :string; + flags : number; + listFile() : FileIterator; + } + /** + * FileAccessHelper + * @since 9 + * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework + * @StageModelOnly + * @systemapi + * @permission ohos.permission.FILE_ACCESS_MANAGER + */ + + interface FileAccessHelper{ + /** + * Opens a file in a specified path. + * + * @since 9 + * @param uri Indicates the path of the file to open. + * @param flags Indicate options of opening a file. The default value is read-only. + * @param callback Indicate the callback when openfile success + * @return Returns the file descriptor + */ + openFile(uri:string, flags:number) : Promise; + openFile(uri:string, flags:number, callback:AsyncCallback) : void; + /** + * Create a file in a specified path + * + * @since 9 + * @param parentUri Represents a specific parent directory. + * @param displayName Indicates the new file name + * @return Returns the new file's URI + */ + createFile(parentUri: string, displayName: string) : Promise; + createFile(parentUri: string, displayName: string ,callback:AsyncCallback) : void; + /** + * + * @since 9 + * @param parentUri parentUri Represents a specific parent directory. + * @param displayName displayName Indicates the new file name + * @return Returns the new directory's URI + */ + mkdir(parentUri: string , displayName: string) : Promise; + mkdir(parentUri: string , displayName: string , callback:AsyncCallback) : void; + /** + * Delete a file or delete a directory recursively + * + * @since 9 + * @param selectFileUri Indicates the file or directory to be deleted. + * @return Returns Exections Success or Failure. + * @StageModelOnly + */ + delete(selectFileUri: string) : Promise; + delete(selectFileUri: string , callback:AsyncCallback) : void; + /** + * Move a file or move a directory recursively + * + * @since 9 + * @param sourceFileUri Indicates the file or directory to be moved. + * @param targetParentUri Represents the destonation folder. + * @return URI of the generated new file or directory. + */ + + move(sourceFileUri: string, targetParentUri: string) : Promise; + move(sourceFileUri: string, targetParentUri: string , callback:AsyncCallback) : void; + /** + * Rname the selected file ot directory. + * + * @since 9 + * @param sourceFileUri Indicates the selected file or directory + * @param displayName Indicates the new directory or file name. + * @return URI of the generated new file or directory + */ - /** - * File - * @since 9 - * @syscap SystemCapability.FileExtension.FileAccessFramework - * @StageModelOnly - */ - class File { - uri : string; - fileName : string; - mode : string; - size : number; - mtime : number; - mimetype : string; - next(): File; - listfile() : Array - } - - /** - * Root - * @since 9 - * @syscap SystemCapability.FileExtension.FileAccessFramework - * @StageModelOnly - */ - class Root { - deviceId : string; - uri : string; - displayName : string; - flags : number; - listFile() : Array - } + rename(sourceFileUri: string , displayName: string) : Promise; + rename(sourceFileUri: string , displayName: string , callback:AsyncCallback) : void; + /** + * Get root object from all data providers + * + * @since 9 + * @return Array of root objects + */ - /** - * FileAccessHelper - * @since 9 - * @syscap SystemCapability.FileExtension.FileAccessFramework - * @StageModelOnly - */ - interface FileAccessHelper { - /** - * Opens a file in a specified remote path. - * - * @since 9 - * @syscap SystemCapability.FileExtension.FileAccessFramework - * @param uri Indicates the path of the file to open. - * @param flags - * @param callback Indicates the callback when openfile success - * @return Returns the file descriptor. - * @StageModelOnly - */ - openFile(uri: string, flags: number): Promise; - openFile(uri: string, flags: number, callback: AsyncCallback): void; - - /** - * - * - * @since 9 - * @syscap SystemCapability.FileExtension.FileAccessFramework - * @param - * @param - * @param - * @return - * @StageModelOnly - */ - createFile(parentUri: string, displayName: string): Promise; - createFile(parentUri: string, displayName: string, callback: AsyncCallback): void; - - /** - * - * - * @since 9 - * @syscap SystemCapability.FileExtension.FileAccessFramework - * @param - * @param - * @param - * @return - * @StageModelOnly - */ - mkdir(parentUri: string, displayName: string): Promise; - mkdir(parentUri: string, displayName: string, callback: AsyncCallback): void; - - /** - * - * - * @since 9 - * @syscap SystemCapability.FileExtension.FileAccessFramework - * @param - * @param - * @param - * @return - * @StageModelOnly - */ - delete(selectFileUri: string): Promise; - delete(selectFileUri: string, callback: AsyncCallback): void; - - /** - * - * - * @since 9 - * @syscap SystemCapability.FileExtension.FileAccessFramework - * @param - * @param - * @return - * @StageModelOnly - */ - move(sourceFileUri: string, targetParentUri: string): Promise; - move(sourceFileUri: string, targetParentUri: string, callback: AsyncCallback): void; - - /** - * - * - * @since 9 - * @syscap SystemCapability.FileExtension.FileAccessFramework - * @param - * @param - * @return - * @StageModelOnly - */ - rename(sourceFileUri: string, displayName: string): Promise; - rename(sourceFileUri: string, displayName: string, callback: AsyncCallback): void; - - /** - * - * - * @since 9 - * @syscap SystemCapability.FileExtension.FileAccessFramework - * @return - * @StageModelOnly - */ - getRoots(): Promise>; - getRoots(callback: AsyncCallback>): void; - } -} + getRoots(): Promise>; + getRoots(callback:AsyncCallback>) : void; + } +} \ No newline at end of file -- Gitee From 4c72e5c95952f497d9a636d6d993ee4740653afb Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Mon, 27 Jun 2022 21:38:36 +0800 Subject: [PATCH 05/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9dts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 5264c34316..7d787578e3 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -12,11 +12,12 @@ *See the License for the specific language governing permissions and *limitations under the License */ + import {AsyncCallback , Callback} from "./basic"; import {Want } from './ability/want'; import Context from './application/Context'; -declare namespace fileeaccess{ +declare namespace fileaccess { /** * Obtains the fileAccessHelper. * @since 9 @@ -27,14 +28,15 @@ declare namespace fileeaccess{ * @StageModelOnly * @systemapi */ - function createFileAccessHelper(Context: Context, want:Want , callback:AsyncCallback) : void ; - function createFileAccessHelper(Context: Context, want:Want ): Promise; + function createFileAccessHelper(context: Context, want: Want, callback: AsyncCallback): void; + function createFileAccessHelper(context: Context, want: Want): Promise; + /** * File Object * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @StageModelOnly - * @systemapi + * @systemapi */ interface FileIterator { uri : string; @@ -46,30 +48,31 @@ declare namespace fileeaccess{ [Symbol.iterator]() : IterableIterator; listFile() : FileIterator; } + /** * Root Object * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @StageModelOnly - * @systemapi + * @systemapi */ - interface Root{ + interface Root { deviceId : string; uri : string; displayName :string; flags : number; listFile() : FileIterator; } + /** * FileAccessHelper * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @StageModelOnly - * @systemapi - * @permission ohos.permission.FILE_ACCESS_MANAGER + * @systemapi + * @permission ohos.permission.FILE_ACCESS_MANAGER */ - - interface FileAccessHelper{ + interface FileAccessHelper { /** * Opens a file in a specified path. * @@ -118,7 +121,7 @@ declare namespace fileeaccess{ * @param targetParentUri Represents the destonation folder. * @return URI of the generated new file or directory. */ - + move(sourceFileUri: string, targetParentUri: string) : Promise; move(sourceFileUri: string, targetParentUri: string , callback:AsyncCallback) : void; /** @@ -138,7 +141,7 @@ declare namespace fileeaccess{ * @since 9 * @return Array of root objects */ - + getRoots(): Promise>; getRoots(callback:AsyncCallback>) : void; } -- Gitee From bdb25e86ac491bb66b1bd91a37602777005c2193 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Mon, 27 Jun 2022 22:01:15 +0800 Subject: [PATCH 06/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9dts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 7d787578e3..0d6b0d2e5c 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -36,7 +36,7 @@ declare namespace fileaccess { * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @StageModelOnly - * @systemapi + * @systemapi */ interface FileIterator { uri : string; @@ -54,7 +54,7 @@ declare namespace fileaccess { * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @StageModelOnly - * @systemapi + * @systemapi */ interface Root { deviceId : string; @@ -63,14 +63,14 @@ declare namespace fileaccess { flags : number; listFile() : FileIterator; } - + /** * FileAccessHelper * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @StageModelOnly - * @systemapi - * @permission ohos.permission.FILE_ACCESS_MANAGER + * @systemapi + * @permission ohos.permission.FILE_ACCESS_MANAGER */ interface FileAccessHelper { /** @@ -84,6 +84,7 @@ declare namespace fileaccess { */ openFile(uri:string, flags:number) : Promise; openFile(uri:string, flags:number, callback:AsyncCallback) : void; + /** * Create a file in a specified path * @@ -94,6 +95,7 @@ declare namespace fileaccess { */ createFile(parentUri: string, displayName: string) : Promise; createFile(parentUri: string, displayName: string ,callback:AsyncCallback) : void; + /** * * @since 9 @@ -103,6 +105,7 @@ declare namespace fileaccess { */ mkdir(parentUri: string , displayName: string) : Promise; mkdir(parentUri: string , displayName: string , callback:AsyncCallback) : void; + /** * Delete a file or delete a directory recursively * @@ -113,6 +116,7 @@ declare namespace fileaccess { */ delete(selectFileUri: string) : Promise; delete(selectFileUri: string , callback:AsyncCallback) : void; + /** * Move a file or move a directory recursively * @@ -121,9 +125,9 @@ declare namespace fileaccess { * @param targetParentUri Represents the destonation folder. * @return URI of the generated new file or directory. */ - move(sourceFileUri: string, targetParentUri: string) : Promise; move(sourceFileUri: string, targetParentUri: string , callback:AsyncCallback) : void; + /** * Rname the selected file ot directory. * @@ -132,16 +136,15 @@ declare namespace fileaccess { * @param displayName Indicates the new directory or file name. * @return URI of the generated new file or directory */ - rename(sourceFileUri: string , displayName: string) : Promise; rename(sourceFileUri: string , displayName: string , callback:AsyncCallback) : void; + /** * Get root object from all data providers * * @since 9 * @return Array of root objects */ - getRoots(): Promise>; getRoots(callback:AsyncCallback>) : void; } -- Gitee From 7d7abbc77090086bcbb13e82f189060dad944443 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Mon, 27 Jun 2022 22:09:26 +0800 Subject: [PATCH 07/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9dts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 0d6b0d2e5c..78e55778aa 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -39,14 +39,14 @@ declare namespace fileaccess { * @systemapi */ interface FileIterator { - uri : string; - fileName : string; - mode : string; - size : number; - mtime : number; - mimetype : string; - [Symbol.iterator]() : IterableIterator; - listFile() : FileIterator; + uri: string; + fileName: string; + mode: string; + size: number; + mtime: number; + mimetype: string; + [Symbol.iterator](): IterableIterator; + listFile(): FileIterator; } /** @@ -57,13 +57,13 @@ declare namespace fileaccess { * @systemapi */ interface Root { - deviceId : string; - uri : string; - displayName :string; - flags : number; - listFile() : FileIterator; + deviceId: string; + uri: string; + displayName: string; + flags: number; + listFile(): FileIterator; } - + /** * FileAccessHelper * @since 9 @@ -82,8 +82,8 @@ declare namespace fileaccess { * @param callback Indicate the callback when openfile success * @return Returns the file descriptor */ - openFile(uri:string, flags:number) : Promise; - openFile(uri:string, flags:number, callback:AsyncCallback) : void; + openFile(uri: string, flags: number) : Promise; + openFile(uri: string, flags: number, callback: AsyncCallback) : void; /** * Create a file in a specified path @@ -94,7 +94,7 @@ declare namespace fileaccess { * @return Returns the new file's URI */ createFile(parentUri: string, displayName: string) : Promise; - createFile(parentUri: string, displayName: string ,callback:AsyncCallback) : void; + createFile(parentUri: string, displayName: string ,callback: AsyncCallback) : void; /** * @@ -104,7 +104,7 @@ declare namespace fileaccess { * @return Returns the new directory's URI */ mkdir(parentUri: string , displayName: string) : Promise; - mkdir(parentUri: string , displayName: string , callback:AsyncCallback) : void; + mkdir(parentUri: string , displayName: string , callback: AsyncCallback) : void; /** * Delete a file or delete a directory recursively @@ -115,7 +115,7 @@ declare namespace fileaccess { * @StageModelOnly */ delete(selectFileUri: string) : Promise; - delete(selectFileUri: string , callback:AsyncCallback) : void; + delete(selectFileUri: string , callback: AsyncCallback) : void; /** * Move a file or move a directory recursively @@ -126,7 +126,7 @@ declare namespace fileaccess { * @return URI of the generated new file or directory. */ move(sourceFileUri: string, targetParentUri: string) : Promise; - move(sourceFileUri: string, targetParentUri: string , callback:AsyncCallback) : void; + move(sourceFileUri: string, targetParentUri: string , callback: AsyncCallback) : void; /** * Rname the selected file ot directory. @@ -137,7 +137,7 @@ declare namespace fileaccess { * @return URI of the generated new file or directory */ rename(sourceFileUri: string , displayName: string) : Promise; - rename(sourceFileUri: string , displayName: string , callback:AsyncCallback) : void; + rename(sourceFileUri: string , displayName: string , callback: AsyncCallback) : void; /** * Get root object from all data providers -- Gitee From 8d77a36c85ac82088fbaf931c1ddeed6e7fa94da Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Mon, 27 Jun 2022 22:13:49 +0800 Subject: [PATCH 08/21] add fileaccess dts Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 78e55778aa..01ee219b4c 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -36,7 +36,7 @@ declare namespace fileaccess { * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @StageModelOnly - * @systemapi + * @systemapi */ interface FileIterator { uri: string; @@ -54,7 +54,7 @@ declare namespace fileaccess { * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @StageModelOnly - * @systemapi + * @systemapi */ interface Root { deviceId: string; @@ -69,8 +69,8 @@ declare namespace fileaccess { * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @StageModelOnly - * @systemapi - * @permission ohos.permission.FILE_ACCESS_MANAGER + * @systemapi + * @permission ohos.permission.FILE_ACCESS_MANAGER */ interface FileAccessHelper { /** -- Gitee From c24ae3b368f9fa813d9101a7e67d3bf2bc2c8214 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Mon, 27 Jun 2022 22:32:31 +0800 Subject: [PATCH 09/21] add fileaccess dts Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 01ee219b4c..e5e3c68813 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -1,20 +1,20 @@ /* -*Copyright (c) 2022 Huawei Device Context., 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 +* Copyright (C) 2021 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 +* http://www.apache.org/licenses/LICENSE-2.0 * -*Unless required by applicable law or agreed to in writing, software -*distributed under the License is distibuted 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 +* 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"; -import {Want } from './ability/want'; +import { AsyncCallback, Callback } from "./basic"; +import { Want } from './ability/want'; import Context from './application/Context'; declare namespace fileaccess { -- Gitee From 43cecc4eac4efc27e7c3f6bf5e02e40ee18295ec Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Mon, 27 Jun 2022 22:35:57 +0800 Subject: [PATCH 10/21] add fileaccess dts Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index e5e3c68813..89a574fc1f 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -23,7 +23,7 @@ declare namespace fileaccess { * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @param context Indicates the application context. - * @param want + * @param want Represents the connected data provider * @return Returns the fileAccessHelper. * @StageModelOnly * @systemapi -- Gitee From f537e15113bf336f8bb196b1b50f16ee81b02425 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Mon, 27 Jun 2022 22:39:28 +0800 Subject: [PATCH 11/21] add fileaccess dts Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 89a574fc1f..608dbf3eb3 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -74,7 +74,7 @@ declare namespace fileaccess { */ interface FileAccessHelper { /** - * Opens a file in a specified path. + * Open a file in a specified path. * * @since 9 * @param uri Indicates the path of the file to open. @@ -97,6 +97,7 @@ declare namespace fileaccess { createFile(parentUri: string, displayName: string ,callback: AsyncCallback) : void; /** + * mkdir a file in a specified path * * @since 9 * @param parentUri parentUri Represents a specific parent directory. @@ -129,7 +130,7 @@ declare namespace fileaccess { move(sourceFileUri: string, targetParentUri: string , callback: AsyncCallback) : void; /** - * Rname the selected file ot directory. + * Rename the selected file or directory. * * @since 9 * @param sourceFileUri Indicates the selected file or directory -- Gitee From 5b008106f1c96fc95d8dff5c7592b56a0e592936 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Mon, 27 Jun 2022 22:40:41 +0800 Subject: [PATCH 12/21] add fileaccess dts Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 608dbf3eb3..1a5daec42b 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -66,6 +66,7 @@ declare namespace fileaccess { /** * FileAccessHelper + * * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @StageModelOnly -- Gitee From 870d5561db660558b4356ffdcc9a7949e8966f79 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Mon, 27 Jun 2022 22:44:15 +0800 Subject: [PATCH 13/21] add fileaccess dts Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 1a5daec42b..0857caeb74 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -80,36 +80,36 @@ declare namespace fileaccess { * @since 9 * @param uri Indicates the path of the file to open. * @param flags Indicate options of opening a file. The default value is read-only. - * @param callback Indicate the callback when openfile success - * @return Returns the file descriptor + * @param callback Indicate the callback when openfile success. + * @return Returns the file descriptor. */ openFile(uri: string, flags: number) : Promise; openFile(uri: string, flags: number, callback: AsyncCallback) : void; /** - * Create a file in a specified path + * Create a file in a specified path. * * @since 9 * @param parentUri Represents a specific parent directory. - * @param displayName Indicates the new file name - * @return Returns the new file's URI + * @param displayName Indicates the new file name. + * @return Returns the new file's URI. */ createFile(parentUri: string, displayName: string) : Promise; createFile(parentUri: string, displayName: string ,callback: AsyncCallback) : void; /** - * mkdir a file in a specified path + * Create a Directory in a specified path. * * @since 9 * @param parentUri parentUri Represents a specific parent directory. - * @param displayName displayName Indicates the new file name - * @return Returns the new directory's URI + * @param displayName displayName Indicates the new file name. + * @return Returns the new directory's URI. */ mkdir(parentUri: string , displayName: string) : Promise; mkdir(parentUri: string , displayName: string , callback: AsyncCallback) : void; /** - * Delete a file or delete a directory recursively + * Delete a file or delete a directory recursively. * * @since 9 * @param selectFileUri Indicates the file or directory to be deleted. @@ -120,7 +120,7 @@ declare namespace fileaccess { delete(selectFileUri: string , callback: AsyncCallback) : void; /** - * Move a file or move a directory recursively + * Move a file or move a directory recursively. * * @since 9 * @param sourceFileUri Indicates the file or directory to be moved. @@ -134,18 +134,18 @@ declare namespace fileaccess { * Rename the selected file or directory. * * @since 9 - * @param sourceFileUri Indicates the selected file or directory + * @param sourceFileUri Indicates the selected file or directory. * @param displayName Indicates the new directory or file name. - * @return URI of the generated new file or directory + * @return URI of the generated new file or directory. */ rename(sourceFileUri: string , displayName: string) : Promise; rename(sourceFileUri: string , displayName: string , callback: AsyncCallback) : void; /** - * Get root object from all data providers + * Get root object from all data providers. * * @since 9 - * @return Array of root objects + * @return Array of root objects. */ getRoots(): Promise>; getRoots(callback:AsyncCallback>) : void; -- Gitee From 6c1ce65ec69554987d4bda2404d05ebe191f5a20 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Mon, 27 Jun 2022 22:48:55 +0800 Subject: [PATCH 14/21] add fileaccess dts Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 0857caeb74..820257406e 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -23,7 +23,7 @@ declare namespace fileaccess { * @since 9 * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework * @param context Indicates the application context. - * @param want Represents the connected data provider + * @param want Represents the connected data provider. * @return Returns the fileAccessHelper. * @StageModelOnly * @systemapi @@ -142,7 +142,7 @@ declare namespace fileaccess { rename(sourceFileUri: string , displayName: string , callback: AsyncCallback) : void; /** - * Get root object from all data providers. + * Get root objects from all data providers. * * @since 9 * @return Array of root objects. -- Gitee From 7f87c09a0cd3d24140095480f53b8a457e2da2aa Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Tue, 28 Jun 2022 10:09:15 +0800 Subject: [PATCH 15/21] add fileaccess dts Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 820257406e..96902c61bf 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -21,7 +21,7 @@ declare namespace fileaccess { /** * Obtains the fileAccessHelper. * @since 9 - * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework + * @syscap SystemCapability.FileManagement.UserFileService * @param context Indicates the application context. * @param want Represents the connected data provider. * @return Returns the fileAccessHelper. @@ -31,10 +31,21 @@ declare namespace fileaccess { function createFileAccessHelper(context: Context, want: Want, callback: AsyncCallback): void; function createFileAccessHelper(context: Context, want: Want): Promise; + /** + * Obtains the HAP Information for Registering FileAccessExtensionAbility in the System. + * @since 9 + * @syscap SystemCapability.FileManagement.UserFileService + * @return Returns the want information of configuring FileAccess in the package. + * @StageModelOnly + * @systemapi + */ + function getFileAccessAbilityInfo(): Promise>; + function getFileAccessAbilityInfo(callback: AsyncCallback>): void; + /** * File Object * @since 9 - * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework + * @syscap SystemCapability.FileManagement.UserFileService * @StageModelOnly * @systemapi */ @@ -52,7 +63,7 @@ declare namespace fileaccess { /** * Root Object * @since 9 - * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework + * @syscap SystemCapability.FileManagement.UserFileService * @StageModelOnly * @systemapi */ @@ -68,7 +79,7 @@ declare namespace fileaccess { * FileAccessHelper * * @since 9 - * @syscap SystemCapability.FileAccessExtensionAbility.FileAccessFramework + * @syscap SystemCapability.FileManagement.UserFileService * @StageModelOnly * @systemapi * @permission ohos.permission.FILE_ACCESS_MANAGER -- Gitee From 13076ef4f718876119678c107dac33611b5e3ead Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Wed, 29 Jun 2022 15:14:48 +0800 Subject: [PATCH 16/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E8=A7=86?= =?UTF-8?q?=E6=84=8F=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 96902c61bf..e2ca0b0e02 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -106,7 +106,7 @@ declare namespace fileaccess { * @return Returns the new file's URI. */ createFile(parentUri: string, displayName: string) : Promise; - createFile(parentUri: string, displayName: string ,callback: AsyncCallback) : void; + createFile(parentUri: string, displayName: string, callback: AsyncCallback) : void; /** * Create a Directory in a specified path. @@ -116,8 +116,8 @@ declare namespace fileaccess { * @param displayName displayName Indicates the new file name. * @return Returns the new directory's URI. */ - mkdir(parentUri: string , displayName: string) : Promise; - mkdir(parentUri: string , displayName: string , callback: AsyncCallback) : void; + mkdir(parentUri: string, displayName: string) : Promise; + mkdir(parentUri: string, displayName: string, callback: AsyncCallback) : void; /** * Delete a file or delete a directory recursively. @@ -128,7 +128,7 @@ declare namespace fileaccess { * @StageModelOnly */ delete(selectFileUri: string) : Promise; - delete(selectFileUri: string , callback: AsyncCallback) : void; + delete(selectFileUri: string, callback: AsyncCallback) : void; /** * Move a file or move a directory recursively. @@ -139,7 +139,7 @@ declare namespace fileaccess { * @return URI of the generated new file or directory. */ move(sourceFileUri: string, targetParentUri: string) : Promise; - move(sourceFileUri: string, targetParentUri: string , callback: AsyncCallback) : void; + move(sourceFileUri: string, targetParentUri: string, callback: AsyncCallback) : void; /** * Rename the selected file or directory. @@ -149,8 +149,8 @@ declare namespace fileaccess { * @param displayName Indicates the new directory or file name. * @return URI of the generated new file or directory. */ - rename(sourceFileUri: string , displayName: string) : Promise; - rename(sourceFileUri: string , displayName: string , callback: AsyncCallback) : void; + rename(sourceFileUri: string, displayName: string) : Promise; + rename(sourceFileUri: string, displayName: string, callback: AsyncCallback) : void; /** * Get root objects from all data providers. -- Gitee From 52d9f20cf39c7af726981881c8c04960760ba404 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Wed, 29 Jun 2022 19:20:38 +0800 Subject: [PATCH 17/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E8=A7=86?= =?UTF-8?q?=E6=84=8F=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index e2ca0b0e02..4823f0cc8b 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -75,6 +75,22 @@ declare namespace fileaccess { listFile(): FileIterator; } + /** + * Flags enum + * @since 9 + * @syscap SystemCapability.FileManagement.UserFileService + * @StageModelOnly + * @systemapi + */ + enum FLAGS { + /** file is opened only_read */ + ONLY_READ = 0, + /** file is opened only_write */ + ONLY_WRITE = 1, + /** file is opened write_read */ + WRITE_READ = 2 + } + /** * FileAccessHelper * @@ -94,8 +110,8 @@ declare namespace fileaccess { * @param callback Indicate the callback when openfile success. * @return Returns the file descriptor. */ - openFile(uri: string, flags: number) : Promise; - openFile(uri: string, flags: number, callback: AsyncCallback) : void; + openFile(uri: string, flags: FLAGS) : Promise; + openFile(uri: string, flags: FLAGS, callback: AsyncCallback) : void; /** * Create a file in a specified path. -- Gitee From 82b443e2fba213f7061af8df50e4426dc778f7dc Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Thu, 30 Jun 2022 11:21:47 +0800 Subject: [PATCH 18/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 4823f0cc8b..92fe75611e 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -84,11 +84,11 @@ declare namespace fileaccess { */ enum FLAGS { /** file is opened only_read */ - ONLY_READ = 0, + ONLY_READ = 0o0, /** file is opened only_write */ - ONLY_WRITE = 1, + ONLY_WRITE = 0o1, /** file is opened write_read */ - WRITE_READ = 2 + WRITE_READ = 0o2 } /** -- Gitee From 52c12f8b7e765309bc7dd8e1525e9581d4b9fb96 Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Thu, 30 Jun 2022 16:14:16 +0800 Subject: [PATCH 19/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E8=A7=86?= =?UTF-8?q?=E6=84=8F=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 92fe75611e..e6c34c405c 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. +* 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 @@ -76,18 +76,18 @@ declare namespace fileaccess { } /** - * Flags enum + * flags is the parameter in openfile * @since 9 * @syscap SystemCapability.FileManagement.UserFileService * @StageModelOnly * @systemapi */ enum FLAGS { - /** file is opened only_read */ - ONLY_READ = 0o0, - /** file is opened only_write */ - ONLY_WRITE = 0o1, - /** file is opened write_read */ + /** file is openFile only_read */ + READ = 0o0, + /** file is openFile only_write */ + WRITE = 0o1, + /** file is openFile write_read */ WRITE_READ = 0o2 } @@ -117,34 +117,34 @@ declare namespace fileaccess { * Create a file in a specified path. * * @since 9 - * @param parentUri Represents a specific parent directory. + * @param uri Represents a specific parent directory. * @param displayName Indicates the new file name. * @return Returns the new file's URI. */ - createFile(parentUri: string, displayName: string) : Promise; - createFile(parentUri: string, displayName: string, callback: AsyncCallback) : void; + createFile(uri: string, displayName: string) : Promise; + createFile(uri: string, displayName: string, callback: AsyncCallback) : void; /** * Create a Directory in a specified path. * * @since 9 - * @param parentUri parentUri Represents a specific parent directory. + * @param uri parentUri Represents a specific parent directory. * @param displayName displayName Indicates the new file name. * @return Returns the new directory's URI. */ - mkdir(parentUri: string, displayName: string) : Promise; - mkdir(parentUri: string, displayName: string, callback: AsyncCallback) : void; + mkdir(uri: string, displayName: string) : Promise; + mkdir(uri: string, displayName: string, callback: AsyncCallback) : void; /** * Delete a file or delete a directory recursively. * * @since 9 - * @param selectFileUri Indicates the file or directory to be deleted. + * @param uri Indicates the file or directory to be deleted. * @return Returns Exections Success or Failure. * @StageModelOnly */ - delete(selectFileUri: string) : Promise; - delete(selectFileUri: string, callback: AsyncCallback) : void; + delete(uri: string) : Promise; + delete(uri: string, callback: AsyncCallback) : void; /** * Move a file or move a directory recursively. @@ -161,12 +161,12 @@ declare namespace fileaccess { * Rename the selected file or directory. * * @since 9 - * @param sourceFileUri Indicates the selected file or directory. + * @param uri Indicates the selected file or directory. * @param displayName Indicates the new directory or file name. * @return URI of the generated new file or directory. */ - rename(sourceFileUri: string, displayName: string) : Promise; - rename(sourceFileUri: string, displayName: string, callback: AsyncCallback) : void; + rename(uri: string, displayName: string) : Promise; + rename(uri: string, displayName: string, callback: AsyncCallback) : void; /** * Get root objects from all data providers. -- Gitee From 17dfe3feaa1bbcf277399c298c9011ae5a2a8b8e Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Thu, 30 Jun 2022 17:58:32 +0800 Subject: [PATCH 20/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A3=80=E8=A7=86?= =?UTF-8?q?=E6=84=8F=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangjianqiang --- api/@ohos.data.fileAccess.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index e6c34c405c..8b059f19d8 100755 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -150,12 +150,12 @@ declare namespace fileaccess { * Move a file or move a directory recursively. * * @since 9 - * @param sourceFileUri Indicates the file or directory to be moved. - * @param targetParentUri Represents the destonation folder. + * @param sourceUri Indicates the file or directory to be moved. + * @param destUri Represents the destonation folder. * @return URI of the generated new file or directory. */ - move(sourceFileUri: string, targetParentUri: string) : Promise; - move(sourceFileUri: string, targetParentUri: string, callback: AsyncCallback) : void; + move(sourceUri: string, destUri: string) : Promise; + move(sourceUri: string, destUri: string, callback: AsyncCallback) : void; /** * Rename the selected file or directory. -- Gitee From e48da7d978e981953ebea3acc0308659f699884b Mon Sep 17 00:00:00 2001 From: wangjianqiang Date: Fri, 1 Jul 2022 09:48:35 +0800 Subject: [PATCH 21/21] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E5=85=88filem?= =?UTF-8?q?anager.d.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangjianqiang --- api/@ohos.fileManager.d.ts | 142 ------------------------------------- 1 file changed, 142 deletions(-) delete mode 100644 api/@ohos.fileManager.d.ts diff --git a/api/@ohos.fileManager.d.ts b/api/@ohos.fileManager.d.ts deleted file mode 100644 index e9676f7e97..0000000000 --- a/api/@ohos.fileManager.d.ts +++ /dev/null @@ -1,142 +0,0 @@ - /* - * Copyright (c) 2021 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 } from './basic' - -export default filemanager; - -declare namespace filemanager { - export { listFile }; - export { getRoot }; - export { createFile }; - export { FileInfo }; - export { DevInfo }; -} - -/** - * listFile. - * - * @note N/A - * @syscap SystemCapability.FileManagement.UserFileService - * @since 9 - * @permission N/A - * @function listFile - * @param {string} path - path. - * @param {string} type - type. - * @param {Object} options - options - * @param {DevInfo} [options.dev = {name: "local"}] - dev name. - * @param {number} [options.offset = 0] - offset. - * @param {number} [options.count = 0] - count. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws {TypedError} Parameter check failed - * @systemapi - */ -declare function listFile(path: string, type: string, options?: {dev?: DevInfo, offset?: number, count?: number}): Promise; -declare function listFile(path: string, type: string, options?: {dev?: DevInfo, offset?: number, count?: number}, callback: AsyncCallback): void; - -/** - * getRoot. - * - * @note N/A - * @syscap SystemCapability.FileManagement.UserFileService - * @since 9 - * @permission N/A - * @function getRoot - * @param {Object} options - options - * @param {DevInfo} [options.dev = {name: "local"}] - dev name. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws {TypedError} Parameter check failed - * @systemapi - */ -declare function getRoot(options?: {dev?: DevInfo}): Promise; -declare function getRoot(options?: {dev?: DevInfo}, callback: AsyncCallback): void; - -/** - * createFile. - * - * @note N/A - * @syscap SystemCapability.FileManagement.UserFileService - * @since 9 - * @permission N/A - * @function createFile - * @param {string} path - album uri. - * @param {string} filename- file name. - * @param {Object} options - options - * @param {DevInfo} [options.dev = {name: "local"}] - dev name. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws {TypedError} Parameter check failed - * @systemapi - */ -declare function createFile(path: string, filename: string, options?: {dev?: DevInfo}): Promise; -declare function createFile(path: string, filename: string, options?: {dev?: DevInfo}, callback: AsyncCallback): void; - -/** - * FileInfo - * @note N/A - * @syscap SystemCapability.FileManagement.UserFileService - * @since 9 - * @permission N/A - * @systemapi - */ -declare interface FileInfo { - /** - * @type {string} - * @readonly - */ - name: string; - /** - * @type {string} - * @readonly - */ - path: string; - /** - * @type {string} - * @readonly - */ - type: string; - /** - * @type {string} - * @readonly - */ - size: number; - /** - * @type {string} - * @readonly - */ - addedTime: number; - /** - * @type {string} - * @readonly - */ - modifiedTime: number; -} - -/** - * DevInfo - * @note N/A - * @syscap SystemCapability.FileManagement.UserFileService - * @since 9 - * @permission N/A - * @systemapi - */ - declare interface DevInfo { - /** - * @type {string} - */ - name: string; - } -- Gitee