diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md index 0ff5001212bf448678e77412d2cc4fdc9712c735..fdf237a4b1c488e67c674ec0761329d46f043b7d 100644 --- a/en/application-dev/reference/apis/Readme-EN.md +++ b/en/application-dev/reference/apis/Readme-EN.md @@ -118,7 +118,6 @@ - File Management - - [@ohos.document](js-apis-document.md) - [@ohos.environment](js-apis-environment.md) - [@ohos.fileio](js-apis-fileio.md) - [@ohos.fileManager](js-apis-filemanager.md) diff --git a/en/application-dev/reference/apis/js-apis-document.md b/en/application-dev/reference/apis/js-apis-document.md deleted file mode 100644 index 045ee7bb3e858c31437bfeac562b5dd8b1f53e1f..0000000000000000000000000000000000000000 --- a/en/application-dev/reference/apis/js-apis-document.md +++ /dev/null @@ -1,132 +0,0 @@ -# document - -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE:**
-- The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. -- The interface of this module will be discarded later.Calling the following interface throws an exception. It is not recommended to use the following interface in OpenHarmony. - -## Modules to Import - -```js -import document from '@ohos.document'; -``` - -## document.choose - -choose(type:string[]): Promise<string> - -Selects a file using the file manager and returns the file URI asynchronously using a promise. - -**System capability**:SystemCapability.FileManagement.File.FileIO - -- **Parameters** - - | Name | Type | Mandatory| Description | - | ------ | ------ | ---- | ---------------------------- | - | type | string[] | No | Type of the file selected. | - -- Return value - - | Type | Description | - | --------------------- | -------------- | - | Promise<string> | URI of the file(Note: the current returned error code) | - -- Example - - ```js - await document.choose(type); - ``` -## document.choose - -choose(callback:AsyncCallback<string>): void - -Selects a file using the file manager and returns the file URI using an asynchronous callback. - -**System capability**:SystemCapability.FileManagement.File.FileIO - -- **Parameters** - - | Name | Type | Mandatory| Description | - | -------- | --------------------------- | ---- | ---------------------------- | - | callback | AsyncCallback<string> | Yes | Callback used to obtain the URI of the file asynchronously(Note: the current returned error code) | - -- Example - - ```js - await document.choose(function(err, uri) { - //do something with uri - }); - ``` -## document.choose - -choose(type:string[], callback:AsyncCallback<string>): void - -Selects a file using the file manager and returns the file URI using an asynchronous callback. - -**System capability**:SystemCapability.FileManagement.File.FileIO - -- **Parameters** - - | Name | Type | Mandatory| Description | - | -------- | --------------------------- | ---- | ---------------------------- | - | type | string[] | No | Type of the file selected. | - | callback | AsyncCallback<string> | Yes | Callback used to obtain the URI of the file asynchronously(Note: the current returned error code) | - -- Example - - ```js - await document.choose(type, function(err, uri) { - //do something with uri - }); - ``` - -## document.show - -show(url:string, type:string):Promise<number> - -Asynchronously opens the file corresponding to the URI and returns the result using a promise. - -**System capability**:SystemCapability.FileManagement.File.FileIO - -- **Parameters** - - | Name | Type | Mandatory| Description | - | ---- | ------ | ---- | ---------------------------- | - | uri | string | Yes | URI of the file to open | - | type | string | Yes | Type of the file. Currently | - -- Return value - - | Type | Description | - | --------------------- | ------------ | - | Promise<void> | Returns void if the file is open successfully(Note: the current returned error code) | - -- Example - - ```js - await document.show(uri, type); - ``` - -## document.show - -show(url:string, type:string, callback:AsyncCallback<void>): void - -Asynchronously opens the file corresponding to the URI and returns the result using a callback. - -**System capability**:SystemCapability.FileManagement.File.FileIO - -- **Parameters** - - | Name | Type | Mandatory| Description | - | -------- | --------------------------- | ---- | ---------------------------- | - | uri | string | Yes | URI of the file to open| - | type | string | Yes | Type of the file. Currently | - | callback | AsyncCallback<void> | Yes | Asynchronous callback used to open the file corresponding to the URI(Note: the current returned error code) | - -- Example - - ```js - await document.show(uri, type, function(err) { - //do something - }); - ``` - diff --git a/zh-cn/application-dev/reference/apis/js-apis-document.md b/zh-cn/application-dev/reference/apis/js-apis-document.md index 469cd51caa483a597e14d33608412d1a753f94da..6e326bc35d8ee60a1a0f455e00366a11edb0dc3c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-document.md +++ b/zh-cn/application-dev/reference/apis/js-apis-document.md @@ -1,4 +1,4 @@ -# document +# 文件交互 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** - 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。