提交 c44c48f8 编写于 作者: Y yxn

处理接口一致性问题

Signed-off-by: Nyxn <yexinnian2@huawei.com>
上级 d77f5c8d
...@@ -8,8 +8,13 @@ ...@@ -8,8 +8,13 @@
## 导入模块 ## 导入模块
> **说明:**
>
> 示例代码里有使用BusinessError的都需要导入BusinessError模块,没有的话则不需要导入。
```ts ```ts
import picker from '@ohos.file.picker'; import picker from '@ohos.file.picker';
import { BusinessError } from '@ohos.base';
``` ```
## PhotoViewPicker ## PhotoViewPicker
...@@ -47,8 +52,6 @@ select(option?: PhotoSelectOptions) : Promise&lt;PhotoSelectResult&gt; ...@@ -47,8 +52,6 @@ select(option?: PhotoSelectOptions) : Promise&lt;PhotoSelectResult&gt;
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example01() { async example01() {
try { try {
let PhotoSelectOptions = new picker.PhotoSelectOptions(); let PhotoSelectOptions = new picker.PhotoSelectOptions();
...@@ -84,8 +87,6 @@ select(option: PhotoSelectOptions, callback: AsyncCallback&lt;PhotoSelectResult& ...@@ -84,8 +87,6 @@ select(option: PhotoSelectOptions, callback: AsyncCallback&lt;PhotoSelectResult&
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example02() { async example02() {
try { try {
let PhotoSelectOptions = new picker.PhotoSelectOptions(); let PhotoSelectOptions = new picker.PhotoSelectOptions();
...@@ -122,8 +123,6 @@ select(callback: AsyncCallback&lt;PhotoSelectResult&gt;) : void ...@@ -122,8 +123,6 @@ select(callback: AsyncCallback&lt;PhotoSelectResult&gt;) : void
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example03() { async example03() {
try { try {
let photoPicker = new picker.PhotoViewPicker(); let photoPicker = new picker.PhotoViewPicker();
...@@ -163,8 +162,6 @@ save(option?: PhotoSaveOptions) : Promise&lt;Array&lt;string&gt;&gt; ...@@ -163,8 +162,6 @@ save(option?: PhotoSaveOptions) : Promise&lt;Array&lt;string&gt;&gt;
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example04() { async example04() {
try { try {
let PhotoSaveOptions = new picker.PhotoSaveOptions(); let PhotoSaveOptions = new picker.PhotoSaveOptions();
...@@ -199,8 +196,6 @@ save(option: PhotoSaveOptions, callback: AsyncCallback&lt;Array&lt;string&gt;&gt ...@@ -199,8 +196,6 @@ save(option: PhotoSaveOptions, callback: AsyncCallback&lt;Array&lt;string&gt;&gt
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example05() { async example05() {
try { try {
let PhotoSaveOptions = new picker.PhotoSaveOptions(); let PhotoSaveOptions = new picker.PhotoSaveOptions();
...@@ -236,8 +231,6 @@ save(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;) : void ...@@ -236,8 +231,6 @@ save(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;) : void
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example06() { async example06() {
try { try {
let photoPicker = new picker.PhotoViewPicker(); let photoPicker = new picker.PhotoViewPicker();
...@@ -289,8 +282,6 @@ select(option?: DocumentSelectOptions) : Promise&lt;Array&lt;string&gt;&gt; ...@@ -289,8 +282,6 @@ select(option?: DocumentSelectOptions) : Promise&lt;Array&lt;string&gt;&gt;
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example07() { async example07() {
try { try {
let DocumentSelectOptions = new picker.DocumentSelectOptions(); let DocumentSelectOptions = new picker.DocumentSelectOptions();
...@@ -324,8 +315,6 @@ select(option: DocumentSelectOptions, callback: AsyncCallback&lt;Array&lt;string ...@@ -324,8 +315,6 @@ select(option: DocumentSelectOptions, callback: AsyncCallback&lt;Array&lt;string
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example08() { async example08() {
try { try {
let DocumentSelectOptions = new picker.DocumentSelectOptions(); let DocumentSelectOptions = new picker.DocumentSelectOptions();
...@@ -360,8 +349,6 @@ select(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;) : void ...@@ -360,8 +349,6 @@ select(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;) : void
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example09() { async example09() {
try { try {
let documentPicker = new picker.DocumentViewPicker(); let documentPicker = new picker.DocumentViewPicker();
...@@ -402,8 +389,6 @@ save(option?: DocumentSaveOptions) : Promise&lt;Array&lt;string&gt;&gt; ...@@ -402,8 +389,6 @@ save(option?: DocumentSaveOptions) : Promise&lt;Array&lt;string&gt;&gt;
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example10() { async example10() {
try { try {
let DocumentSaveOptions = new picker.DocumentSaveOptions(); let DocumentSaveOptions = new picker.DocumentSaveOptions();
...@@ -438,8 +423,6 @@ save(option: DocumentSaveOptions, callback: AsyncCallback&lt;Array&lt;string&gt; ...@@ -438,8 +423,6 @@ save(option: DocumentSaveOptions, callback: AsyncCallback&lt;Array&lt;string&gt;
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example11() { async example11() {
try { try {
let DocumentSaveOptions = new picker.DocumentSaveOptions(); let DocumentSaveOptions = new picker.DocumentSaveOptions();
...@@ -475,8 +458,6 @@ save(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;) : void ...@@ -475,8 +458,6 @@ save(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;) : void
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example12() { async example12() {
try { try {
let documentPicker = new picker.DocumentViewPicker(); let documentPicker = new picker.DocumentViewPicker();
...@@ -528,8 +509,6 @@ select(option?: AudioSelectOptions) : Promise&lt;Array&lt;string&gt;&gt; ...@@ -528,8 +509,6 @@ select(option?: AudioSelectOptions) : Promise&lt;Array&lt;string&gt;&gt;
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example13() { async example13() {
try { try {
let AudioSelectOptions = new picker.AudioSelectOptions(); let AudioSelectOptions = new picker.AudioSelectOptions();
...@@ -563,8 +542,6 @@ select(option: AudioSelectOptions, callback: AsyncCallback&lt;Array&lt;string&gt ...@@ -563,8 +542,6 @@ select(option: AudioSelectOptions, callback: AsyncCallback&lt;Array&lt;string&gt
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example14() { async example14() {
try { try {
let AudioSelectOptions = new picker.AudioSelectOptions(); let AudioSelectOptions = new picker.AudioSelectOptions();
...@@ -599,8 +576,6 @@ select(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;) : void ...@@ -599,8 +576,6 @@ select(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;) : void
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example15() { async example15() {
try { try {
let audioPicker = new picker.AudioViewPicker(); let audioPicker = new picker.AudioViewPicker();
...@@ -640,8 +615,6 @@ save(option?: AudioSaveOptions) : Promise&lt;Array&lt;string&gt;&gt; ...@@ -640,8 +615,6 @@ save(option?: AudioSaveOptions) : Promise&lt;Array&lt;string&gt;&gt;
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example16() { async example16() {
try { try {
let AudioSaveOptions = new picker.AudioSaveOptions(); let AudioSaveOptions = new picker.AudioSaveOptions();
...@@ -676,8 +649,6 @@ save(option: AudioSaveOptions, callback: AsyncCallback&lt;Array&lt;string&gt;&gt ...@@ -676,8 +649,6 @@ save(option: AudioSaveOptions, callback: AsyncCallback&lt;Array&lt;string&gt;&gt
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example17() { async example17() {
try { try {
let AudioSaveOptions = new picker.AudioSaveOptions(); let AudioSaveOptions = new picker.AudioSaveOptions();
...@@ -713,8 +684,6 @@ save(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;) : void ...@@ -713,8 +684,6 @@ save(callback: AsyncCallback&lt;Array&lt;string&gt;&gt;) : void
**示例:** **示例:**
```ts ```ts
import { BusinessError } from '@ohos.base';
async example18() { async example18() {
try { try {
let audioPicker = new picker.AudioViewPicker(); let audioPicker = new picker.AudioViewPicker();
...@@ -783,9 +752,9 @@ async example18() { ...@@ -783,9 +752,9 @@ async example18() {
| 名称 | 类型 | 必填 | 说明 | | 名称 | 类型 | 必填 | 说明 |
| ----------------------- | ------------------- | ---- | -------------------------------- | | ----------------------- | ------------------- | ---- | -------------------------------- |
| maxSelectNumber | number | 否 | 选择文件/目录最大个数,上限500,有效值范围1-500 | | maxSelectNumber<sup>10+</sup> | number | 否 | 选择文件/目录最大个数,上限500,有效值范围1-500 |
| defaultFilePathUri | string | 否 | 指定选择的文件或者目录路径 | | defaultFilePathUri<sup>10+</sup> | string | 否 | 指定选择的文件或者目录路径 |
| fileSuffixFilters | Array&lt;string&gt; | 否 | 选择文件的后缀类型 | | fileSuffixFilters<sup>10+</sup> | Array&lt;string&gt; | 否 | 选择文件的后缀类型 |
## DocumentSaveOptions ## DocumentSaveOptions
...@@ -796,8 +765,8 @@ async example18() { ...@@ -796,8 +765,8 @@ async example18() {
| 名称 | 类型 | 必填 | 说明 | | 名称 | 类型 | 必填 | 说明 |
| ----------------------- | ------------------- | ---- | ---------------------------- | | ----------------------- | ------------------- | ---- | ---------------------------- |
| newFileNames | Array&lt;string&gt; | 否 | 拉起documentPicker进行保存的文件名,若无此参数,则默认需要用户自行输入 | | newFileNames | Array&lt;string&gt; | 否 | 拉起documentPicker进行保存的文件名,若无此参数,则默认需要用户自行输入 |
| defaultFilePathUri | string | 否 | 指定保存的文件或者目录路径 | | defaultFilePathUri<sup>10+</sup> | string | 否 | 指定保存的文件或者目录路径 |
| fileSuffixChoices | Array&lt;string&gt; | 否 | 保存文件的后缀类型 | | fileSuffixChoices<sup>10+</sup> | Array&lt;string&gt; | 否 | 保存文件的后缀类型 |
## AudioSelectOptions ## AudioSelectOptions
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册