| type | boolean | Yes| Must enter the string **change**.|
| type | boolean | Yes | Must enter the string **change**. |
| callback | Callback<MediaQueryResult> | No| Callback to be unregistered. If the default value is used, all callbacks of the handle are unregistered.|
| callback | Callback<MediaQueryResult> | No | Callback to be unregistered. If the default value is used, all callbacks of the handle are unregistered.|
- Example
**Example**
```
```js
importmediaqueryfrom'@ohos.mediaquery'
importmediaqueryfrom'@ohos.mediaquery'
listener=mediaquery.matchMediaSync('(orientation: landscape)');// Listen for landscape events.
listener=mediaquery.matchMediaSync('(orientation: landscape)');// Listen for landscape events.
...
@@ -90,8 +91,8 @@ Unregisters a callback with the corresponding query condition by using the handl
...
@@ -90,8 +91,8 @@ Unregisters a callback with the corresponding query condition by using the handl
> - The APIs of this module are no longer maintained since API version 8. You are advised to use ['@ohos.prompt](js-apis-prompt.md)' instead.
> - The APIs of this module are no longer maintained since API version 8. You are advised to use [`@ohos.prompt`](js-apis-prompt.md) instead.
>
>
>
>
> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
| duration | number | No | Duration that the toast will remain on the screen. The default value is 1500 ms. The recommended value range is 1500 ms to 10000 ms. If a value less than 1500 ms is set, the default value is used. |
| duration | number | No | Duration that the toast will remain on the screen. The default value is 1500 ms. The recommended value range is 1500 ms to 10000 ms. If a value less than 1500 ms is set, the default value is used.|
| bottom<sup>5+</sup> | string\|number | No | Distance between the toast frame and the bottom of the screen. |
| bottom<sup>5+</sup> | string\|number | No | Distance between the toast border and the bottom of the screen. |
## Button
## Button
...
@@ -143,10 +143,10 @@ Defines the prompt information of a button.
...
@@ -143,10 +143,10 @@ Defines the prompt information of a button.
| title | string | No | Title of the text to display. |
| title | string | No | Title of the text to display. |
| message | string | No | Text body. |
| message | string | No | Text body. |
| buttons | [[Button](#button), [Button](#button)?, [Button](#button)?] | No | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. One to six buttons are supported. If there are more than six buttons, extra buttons will not be displayed. |
| buttons | [[Button](#button), [Button](#button)?, [Button](#button)?] | No | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. One to six buttons are supported. If there are more than six buttons, extra buttons will not be displayed.|
| success | (data: [ShowDialogSuccessResponse](#showdialogsuccessresponse)) => void | No | Callback upon success. |
| success | (data: [ShowDialogSuccessResponse](#showdialogsuccessresponse)) => void | No | Callback upon success. |
| cancel | (data: string, code: string) => void | No | Callback upon failure. |
| cancel | (data: string, code: string) => void | No | Callback upon failure. |
| complete | (data: string) => void | No | Called when the API call is complete. |
| complete | (data: string) => void | No | Called when the API call is complete. |
## ShowActionMenuOptions<sup>6+</sup>
## ShowActionMenuOptions<sup>6+</sup>
...
@@ -179,10 +179,10 @@ Describes the options for showing the action menu.
...
@@ -179,10 +179,10 @@ Describes the options for showing the action menu.
| title | string | No | Title of the text to display. |
| title | string | No | Title of the text to display. |
| buttons | [[Button](#button), [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?] | Yes | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. One to six buttons are supported. |
| buttons | [[Button](#button), [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?, [Button](#button)?] | Yes | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. One to six buttons are supported.|
| success | (tapIndex: number, errMsg: string) => void | No | Invoked when a dialog box is displayed. |
| success | (tapIndex: number, errMsg: string) => void | No | Invoked when a dialog box is displayed. |
| fail | (errMsg: string) => void | No | Callback upon failure. |
| fail | (errMsg: string) => void | No | Callback upon failure. |
| complete | (data: string) => void | No | Invoked when a dialog box is closed. |
| complete | (data: string) => void | No | Invoked when a dialog box is closed. |