diff --git a/en/application-dev/faqs/faqs-development-board.md b/en/application-dev/faqs/faqs-development-board.md index 79e5fc390f934f82eb3d70468f9ed41faed68947..0a2a29db5ba68e57e2eee790485ae682ac78b6c0 100644 --- a/en/application-dev/faqs/faqs-development-board.md +++ b/en/application-dev/faqs/faqs-development-board.md @@ -9,7 +9,6 @@ Applicable to: OpenHarmony SDK 3.2.2.5, stage model of API version 9 - Method 2: Run the screenshot script. Connect to the development board to a computer running Windows. Create a text file on the computer, copy the following script content to the file, change the file name extension to **.bat** (the HDC environment variables must be configured in advance), and click **Run**. The screenshot is saved to the same directory as the **.bat** script file. Example: - ``` set filepath=/data/%date:~0,4%%date:~5,2%%date:~8,2%%time:~1,1%%time:~3,2%%time:~6,2%.png echo %filepath% @@ -29,10 +28,11 @@ Applicable to: DevEco Studio 3.0.0.991 ![en-us_image_0000001361254285](figures/en-us_image_0000001361254285.png) 2. Set the profile parameters as follows: + Device type : default - + Resolution: 720\*1280 - + DPI: 240 ## What should I do if Device Manager incorrectly identifies a development board as FT232R USB UART even when the development board already has a driver installed? diff --git a/en/application-dev/reference/apis/js-apis-accessibility-GesturePath.md b/en/application-dev/reference/apis/js-apis-accessibility-GesturePath.md index 34d4df8dd99bb528ae79d8d13de74f491f75f3db..8de8db11bbe1705c18b6e58add5631de38bed992 100644 --- a/en/application-dev/reference/apis/js-apis-accessibility-GesturePath.md +++ b/en/application-dev/reference/apis/js-apis-accessibility-GesturePath.md @@ -1,4 +1,4 @@ -# @ohos.accessibility.GesturePath +# @ohos.accessibility.GesturePath (Gesture Path) The **GesturePath** module provides APIs for creating gesture path information required for an accessibility application to inject gestures. diff --git a/en/application-dev/reference/apis/js-apis-accessibility-GesturePoint.md b/en/application-dev/reference/apis/js-apis-accessibility-GesturePoint.md index 5792c44cd9fc89cf495e943a4e40463ce89281c4..f6923044ffcbf763486510364a385f61b9127eab 100644 --- a/en/application-dev/reference/apis/js-apis-accessibility-GesturePoint.md +++ b/en/application-dev/reference/apis/js-apis-accessibility-GesturePoint.md @@ -1,6 +1,6 @@ -# @ohos.accessibility.GesturePoint +# @ohos.accessibility.GesturePoint (Gesture Point) - The **GesturePoint** module provides APIs for creating gesture touch point information required for an accessibility application to inject gestures. +The **GesturePoint** module provides APIs for creating gesture touch point information required for an accessibility application to inject gestures. > **NOTE** > diff --git a/en/application-dev/reference/apis/js-apis-accessibility-config.md b/en/application-dev/reference/apis/js-apis-accessibility-config.md index 33b6f586279309125be085e8a28d5423b271fae3..673d820d17407a35991da01b0b25ee48cd51c7eb 100644 --- a/en/application-dev/reference/apis/js-apis-accessibility-config.md +++ b/en/application-dev/reference/apis/js-apis-accessibility-config.md @@ -1,4 +1,4 @@ -# @ohos.accessibility.config +# @ohos.accessibility.config (System Accessibility Configuration) The System Accessibility Configuration module allows you to configure system accessibility features, including accessibility extension, high-contrast text, mouse buttons, and captions. diff --git a/en/application-dev/reference/apis/js-apis-accessibility.md b/en/application-dev/reference/apis/js-apis-accessibility.md index cf4443c60f4b58a17986bdb7ae5160fd6a95347c..8121b906b88726624f649211a6e82b05bc722023 100644 --- a/en/application-dev/reference/apis/js-apis-accessibility.md +++ b/en/application-dev/reference/apis/js-apis-accessibility.md @@ -1,4 +1,4 @@ -# @ohos.accessibility +# @ohos.accessibility (Accessibility) The **Accessibility** module implements the accessibility functions, including obtaining the accessibility application list, accessibility application enabled status, and captions configuration. diff --git a/en/application-dev/reference/apis/js-apis-animator.md b/en/application-dev/reference/apis/js-apis-animator.md index da7ec7d145779eb5044427fdee758a34f6b33fdc..b0bfec0f18357dd7ce82d36b90d0f159f398c42f 100644 --- a/en/application-dev/reference/apis/js-apis-animator.md +++ b/en/application-dev/reference/apis/js-apis-animator.md @@ -1,6 +1,6 @@ -# @ohos.animator +# @ohos.animator (Animator) -The **animator** module provides APIs for applying animation effects, including defining animations, starting animations, and playing animations in reverse order. +The **Animator** module provides APIs for applying animation effects, including defining animations, starting animations, and playing animations in reverse order. > **NOTE** > diff --git a/en/application-dev/reference/apis/js-apis-curve.md b/en/application-dev/reference/apis/js-apis-curve.md index 2c90472a98a38d74e7211eb8dcef2061082f18c8..cf3067e37fd78e9c9d0f3d701b1fdf30cb79c88f 100644 --- a/en/application-dev/reference/apis/js-apis-curve.md +++ b/en/application-dev/reference/apis/js-apis-curve.md @@ -1,4 +1,4 @@ -# @ohos.curves +# @ohos.curves (Interpolation Calculation) The **Curves** module provides APIs for interpolation calculation to create step, cubic Bezier, and spring curves. diff --git a/en/application-dev/reference/apis/js-apis-device-info.md b/en/application-dev/reference/apis/js-apis-device-info.md index d413556b36e7e8ebaacbe053ffbe0f0c97b98019..2827737f79a76c23b04ecc12233774a30f34b39a 100644 --- a/en/application-dev/reference/apis/js-apis-device-info.md +++ b/en/application-dev/reference/apis/js-apis-device-info.md @@ -1,8 +1,9 @@ -# @ohos.deviceInfo +# @ohos.deviceInfo (Device Information) The **deviceInfo** module provides product information. -> **NOTE**
+> **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. ## Modules to Import diff --git a/en/application-dev/reference/apis/js-apis-enterprise-dateTimeManager.md b/en/application-dev/reference/apis/js-apis-enterprise-dateTimeManager.md index bc28cffaa5844cf46dbf73ffaa198e4b3e89ff7b..009c9ede294f78a6e6ec5f823b52c539ccf53c18 100644 --- a/en/application-dev/reference/apis/js-apis-enterprise-dateTimeManager.md +++ b/en/application-dev/reference/apis/js-apis-enterprise-dateTimeManager.md @@ -1,4 +1,4 @@ -# @ohos.enterprise.dateTimeManager +# @ohos.enterprise.dateTimeManager (System Time Management) The **dateTimeManager** module provides APIs for system time management, which can only be called by device administrator applications. diff --git a/en/application-dev/reference/apis/js-apis-environment.md b/en/application-dev/reference/apis/js-apis-environment.md index 3f879c77b9ef5cc9427ff5ac74b5758769ddb70f..aca809efc243720dfdc7b95c4300ea84aee2f5c8 100644 --- a/en/application-dev/reference/apis/js-apis-environment.md +++ b/en/application-dev/reference/apis/js-apis-environment.md @@ -1,4 +1,4 @@ -# Environment +# @ohos.environment (Directory Environment Capability) The **Environment** module provides APIs for obtaining the root directories of the storage and public files. diff --git a/en/application-dev/reference/apis/js-apis-inputmethod-extension-ability.md b/en/application-dev/reference/apis/js-apis-inputmethod-extension-ability.md index 6a8cabde0302010e3739f298ba03583325491ef8..d96cd241e7e4c198497712f7fa75c6990b847f6e 100644 --- a/en/application-dev/reference/apis/js-apis-inputmethod-extension-ability.md +++ b/en/application-dev/reference/apis/js-apis-inputmethod-extension-ability.md @@ -1,4 +1,4 @@ -# InputMethodExtensionAbility +# @ohos.inputmethodextensionability (InputMethodExtensionAbility) The **InputMethodExtensionAbility** module provides APIs for developing input methods and managing their lifecycles. diff --git a/en/application-dev/reference/apis/js-apis-inputmethod-subtype.md b/en/application-dev/reference/apis/js-apis-inputmethod-subtype.md index 61ec49997ccb35b204f860e57b0985793598e071..1b5f9dfb662145fe2220d1d244cb3ac91dce9698 100644 --- a/en/application-dev/reference/apis/js-apis-inputmethod-subtype.md +++ b/en/application-dev/reference/apis/js-apis-inputmethod-subtype.md @@ -1,4 +1,4 @@ -# @ohos.inputmethodsubtype +# @ohos.inputmethodsubtype (Input Method Subtype) The **inputMethodSubtype** module provides APIs for managing the attributes of input method subtypes. Different attribute settings result in different subtypes. diff --git a/en/application-dev/reference/apis/js-apis-inputmethod.md b/en/application-dev/reference/apis/js-apis-inputmethod.md index 424e48b357711a7ee94eb4b048f107d7ad4c7a3d..e7ff69abcf62ef6957875badde01857b05087659 100644 --- a/en/application-dev/reference/apis/js-apis-inputmethod.md +++ b/en/application-dev/reference/apis/js-apis-inputmethod.md @@ -1,4 +1,4 @@ -# @ohos.inputmethod +# @ohos.inputmethod (Input Method Framework) The **inputMethod** module provides an input method framework, which can be used to hide the keyboard, obtain the list of installed input methods, display the dialog box for input method selection, and more. diff --git a/en/application-dev/reference/apis/js-apis-inputmethodengine.md b/en/application-dev/reference/apis/js-apis-inputmethodengine.md index 2c87f74698434a68279b5e1c627e2a7352819a38..f5becc73ca2132e8864c3bd8b8a9830312b96188 100644 --- a/en/application-dev/reference/apis/js-apis-inputmethodengine.md +++ b/en/application-dev/reference/apis/js-apis-inputmethodengine.md @@ -1,4 +1,4 @@ -# @ohos.inputmethodengine +# @ohos.inputmethodengine (Input Method Service) The **inputMethodEngine** module streamlines the interaction between input methods and applications. By calling APIs of this module, applications can be bound to input method services to accept text input through the input methods, request the keyboard to display or hide, listen for the input method status, and much more. diff --git a/en/application-dev/reference/apis/js-apis-matrix4.md b/en/application-dev/reference/apis/js-apis-matrix4.md index f5b9b27f55ed9d363939bef6f55582423afe4a28..057e05ac3fd59f22e9bcea5b0fd6064142e95602 100644 --- a/en/application-dev/reference/apis/js-apis-matrix4.md +++ b/en/application-dev/reference/apis/js-apis-matrix4.md @@ -1,4 +1,4 @@ -# @ohos.matrix4 +# @ohos.matrix4 (Matrix Transformation) The **matrix4** module provides APIs for matrix transformation. You can use these APIs to translate, rotate, and scale images. diff --git a/en/application-dev/reference/apis/js-apis-mediaquery.md b/en/application-dev/reference/apis/js-apis-mediaquery.md index f44a0801b9ae1d9d4fec2f4485bf848e8595caa5..eb17dcdd6d568a442bae781edbd20bf9c8554c91 100644 --- a/en/application-dev/reference/apis/js-apis-mediaquery.md +++ b/en/application-dev/reference/apis/js-apis-mediaquery.md @@ -1,4 +1,4 @@ -# @ohos.mediaquery +# @ohos.mediaquery (Media Query) The **mediaquery** module provides different styles for different media types. diff --git a/en/application-dev/reference/apis/js-apis-pasteboard.md b/en/application-dev/reference/apis/js-apis-pasteboard.md index ee53667d0158343624ab086abe598a8baa9608c0..d1d554f677aca7fcb21d1e74cd6fb502f6e90032 100644 --- a/en/application-dev/reference/apis/js-apis-pasteboard.md +++ b/en/application-dev/reference/apis/js-apis-pasteboard.md @@ -1,4 +1,4 @@ -# Pasteboard +# @ohos.pasteboard (Pasteboard) The **pasteboard** module provides the copy and paste support for the system pasteboard. You can use the APIs of this module to operate pasteboard content of the plain text, HTML, URI, Want, pixel map, and other types. @@ -120,11 +120,11 @@ Enumerates the paste options of data. **System capability**: SystemCapability.MiscServices.Pasteboard -| Name | Description | -| ----- | ----------------------- | -| InApp |Only intra-application pasting is allowed.| -| LocalDevice |Paste is allowed in any application on the local device.| -| CrossDevice |Paste is allowed in any application across devices.| +| Name| Value| Description | +| ---- |---|-------------------| +| InApp | 0 | Only intra-application pasting is allowed. | +| LocalDevice | 1 | Paste is allowed in any application on the local device.| +| CrossDevice | 2 | Paste is allowed in any application across devices. | ## pasteboard.createHtmlData(deprecated) @@ -418,7 +418,7 @@ Forcibly converts the content in a **PasteData** object to text. This API uses a **Example** ```js -let record = pasteboard.createUriRecord('dataability:///com.example.myapplication1/user.txt'); +let record = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_URI, 'dataability:///com.example.myapplication1/user.txt'); record.convertToTextV9((err, data) => { if (err) { console.error(`Failed to convert to text. Cause: ${err.message}`); @@ -445,7 +445,7 @@ Forcibly converts the content in a **PasteData** object to text. This API uses a **Example** ```js -let record = pasteboard.createUriRecord('dataability:///com.example.myapplication1/user.txt'); +let record = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_URI, 'dataability:///com.example.myapplication1/user.txt'); record.convertToTextV9().then((data) => { console.info(`Succeeded in converting to text. Data: ${data}`); }).catch((err) => { @@ -536,7 +536,7 @@ Obtains the plain text of the primary record. **Example** ```js -let pasteData = pasteboard.createPlainTextData('hello'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, 'hello'); let plainText = pasteData.getPrimaryText(); ``` @@ -558,7 +558,7 @@ Obtains the HTML content of the primary record. ```js let html = "\n" + "\n" + "\n" + "\n" + "HTML-PASTEBOARD_HTML\n" + "\n" + "\n" + "

HEAD

\n" + "

\n" + "\n" + ""; -let pasteData = pasteboard.createHtmlData(html); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_HTML, html); let htmlText = pasteData.getPrimaryHtml(); ``` @@ -583,7 +583,7 @@ let object = { bundleName: "com.example.aafwk.test", abilityName: "com.example.aafwk.test.TwoAbility" }; -let pasteData = pasteboard.createWantData(object); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_WANT, object); let want = pasteData.getPrimaryWant(); ``` @@ -604,7 +604,7 @@ Obtains the URI of the primary record. **Example** ```js -let pasteData = pasteboard.createUriData('dataability:///com.example.myapplication1/user.txt'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_URI, 'dataability:///com.example.myapplication1/user.txt'); let uri = pasteData.getPrimaryUri(); ``` @@ -636,7 +636,7 @@ let opt = { scaleMode: 1 }; image.createPixelMap(buffer, opt).then((pixelMap) => { - let pasteData = pasteboard.createData('app/xml',pixelMap); + let pasteData = pasteboard.createData(MIMETYPE_PIXELMAP, pixelMap); let PixelMap = pasteData.getPrimaryPixelMap(); }); ``` @@ -660,10 +660,10 @@ The pasteboard supports a maximum number of 512 data records. **Example** ```js -let pasteData = pasteboard.createUriData('dataability:///com.example.myapplication1/user.txt'); -let textRecord = pasteboard.createPlainTextRecord('hello'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_URI, 'dataability:///com.example.myapplication1/user.txt'); +let textRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_PLAIN, 'hello'); let html = "\n" + "\n" + "\n" + "\n" + "HTML-PASTEBOARD_HTML\n" + "\n" + "\n" + "

HEAD

\n" + "

\n" + "\n" + ""; -let htmlRecord = pasteboard.createHtmlTextRecord(html); +let htmlRecord = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_HTML, html); pasteData.addRecord(textRecord); pasteData.addRecord(htmlRecord); ``` @@ -695,7 +695,7 @@ For details about the error codes, see [Pasteboard Error Codes](../errorcodes/er **Example** ```js - let pasteData = pasteboard.createUriData('dataability:///com.example.myapplication1/user.txt'); + let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_URI, 'dataability:///com.example.myapplication1/user.txt'); let dataXml = new ArrayBuffer(256); pasteData.addRecord('app/xml', dataXml); ``` @@ -717,7 +717,7 @@ Obtains a list of **mimeTypes** objects in [PasteDataProperty](#pastedatapropert **Example** ```js -let pasteData = pasteboard.createPlainTextData('hello'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, 'hello'); let types = pasteData.getMimeTypes(); ``` @@ -738,7 +738,7 @@ Obtains the data type of the primary record in this pasteboard. **Example** ```js -let pasteData = pasteboard.createPlainTextData('hello'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, 'hello'); let type = pasteData.getPrimaryMimeType(); ``` @@ -759,7 +759,7 @@ Obtains the property of the pasteboard data. **Example** ```js -let pasteData = pasteboard.createPlainTextData('hello'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, 'hello'); let property = pasteData.getProperty(); ``` @@ -780,7 +780,7 @@ Sets the property (attributes) for the pasteboard data. Currently, only the **sh **Example** ```js -let pasteData = pasteboard.createHtmlData('application/xml'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_HTML, 'application/xml'); let prop = pasteData.getProperty(); prop.shareOption = pasteboard.ShareOption.InApp; pasteData.setProperty(prop); @@ -817,7 +817,7 @@ For details about the error codes, see [Pasteboard Error Codes](../errorcodes/er **Example** ```js -let pasteData = pasteboard.createPlainTextData('hello'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, 'hello'); let record = pasteData.getRecord(0); ``` @@ -838,7 +838,7 @@ Obtains the number of records in the pasteboard. **Example** ```js -let pasteData = pasteboard.createPlainTextData('hello'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, 'hello'); let count = pasteData.getRecordCount(); ``` @@ -859,7 +859,7 @@ Obtains the custom tag from the pasteboard. If no custom tag is set, null is ret **Example** ```js -let pasteData = pasteboard.createPlainTextData('hello'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, 'hello'); let tag = pasteData.getTag(); ``` @@ -886,7 +886,7 @@ Checks whether the pasteboard contains data of the specified type. **Example** ```js -let pasteData = pasteboard.createPlainTextData('hello'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, 'hello'); let hasType = pasteData.hasType(pasteboard.MIMETYPE_TEXT_PLAIN); ``` @@ -915,7 +915,7 @@ For details about the error codes, see [Pasteboard Error Codes](../errorcodes/er **Example** ```js -let pasteData = pasteboard.createPlainTextData('hello'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, 'hello'); pasteData.removeRecord(0); ``` @@ -945,8 +945,8 @@ For details about the error codes, see [Pasteboard Error Codes](../errorcodes/er **Example** ```js -let pasteData = pasteboard.createPlainTextData('hello'); -let record = pasteboard.createUriRecord('dataability:///com.example.myapplication1/user.txt'); +let pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, 'hello'); +let record = pasteboard.createRecord(pasteboard.MIMETYPE_TEXT_URI, 'dataability:///com.example.myapplication1/user.txt'); pasteData.replaceRecord(0, record); ``` ### addHtmlRecord(deprecated) diff --git a/en/application-dev/reference/apis/js-apis-prompt.md b/en/application-dev/reference/apis/js-apis-prompt.md index 27a450de58306f1b018468d6f2590778a9f0d484..a7ba5ea9bd9420837a3b204c98aa36835634a681 100644 --- a/en/application-dev/reference/apis/js-apis-prompt.md +++ b/en/application-dev/reference/apis/js-apis-prompt.md @@ -1,4 +1,4 @@ -# @ohos.prompt +# @ohos.prompt (Prompt) The **Prompt** module provides APIs for creating and showing toasts, dialog boxes, and action menus. diff --git a/en/application-dev/reference/apis/js-apis-promptAction.md b/en/application-dev/reference/apis/js-apis-promptAction.md index 0faa9cf211bbd0a673287c34b8d9ad45d34374e6..2d01a8db31a0a0f01f62ce4747ef2d6449b348e3 100644 --- a/en/application-dev/reference/apis/js-apis-promptAction.md +++ b/en/application-dev/reference/apis/js-apis-promptAction.md @@ -1,4 +1,4 @@ -# @ohos.promptAction +# @ohos.promptAction (Prompt) The **PromptAction** module provides APIs for creating and showing toasts, dialog boxes, and action menus. diff --git a/en/application-dev/reference/apis/js-apis-router.md b/en/application-dev/reference/apis/js-apis-router.md index 11bb575b307023f70b92935d98f94cab013998ad..80451d894a244a7cd2c1f91e4d4fed86cf1f898e 100644 --- a/en/application-dev/reference/apis/js-apis-router.md +++ b/en/application-dev/reference/apis/js-apis-router.md @@ -1,4 +1,4 @@ -# @ohos.router +# @ohos.router (Page Routing) The **Router** module provides APIs to access pages through URLs. You can use the APIs to navigate to a specified page in an application, replace the current page with another one in an application, and return to the previous page or a specified page. diff --git a/en/application-dev/reference/apis/js-apis-settings.md b/en/application-dev/reference/apis/js-apis-settings.md index 5972e0cd9a278dcc49b634b6d05e8d76f3fa0a1d..9b846b7edd04be33c3513017821c5977b3fc336b 100644 --- a/en/application-dev/reference/apis/js-apis-settings.md +++ b/en/application-dev/reference/apis/js-apis-settings.md @@ -1,4 +1,4 @@ -# @ohos.settings +# @ohos.settings (Data Item Settings) The **settings** module provides APIs for setting data items. diff --git a/en/application-dev/reference/apis/js-apis-system-date-time.md b/en/application-dev/reference/apis/js-apis-system-date-time.md index 90c915b32ee35f9d09f6fe0453c962b985f914f1..b7ea33fa58a283e44810a1a453dc4a01f44f2678 100644 --- a/en/application-dev/reference/apis/js-apis-system-date-time.md +++ b/en/application-dev/reference/apis/js-apis-system-date-time.md @@ -1,4 +1,4 @@ -# @ohos.systemDateTime +# @ohos.systemDateTime (System Time and Time Zone) The **systemDateTime** module provides system time and time zone features. You can use the APIs of this module to set and obtain the system time and time zone. @@ -35,15 +35,15 @@ Sets the system time. This API uses an asynchronous callback to return the resul // Set the system time to 2021-01-20 02:36:25. let time = 1611081385000; try { - systemDateTime.setTime(time, (error) => { - if (error) { - console.info(`Failed to set time. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in setting time`); - }); + systemDateTime.setTime(time, (error) => { + if (error) { + console.info(`Failed to set time. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in setting time`); + }); } catch(e) { - console.info(`Failed to set time. message:${e.message}, code:${e.code}`); + console.info(`Failed to set time. message: ${e.message}, code: ${e.code}`); } ``` @@ -75,13 +75,13 @@ Sets the system time. This API uses a promise to return the result. // Set the system time to 2021-01-20 02:36:25. let time = 1611081385000; try { - systemDateTime.setTime(time).then(() => { - console.info(`Succeeded in setting time.`); - }).catch((error) => { - console.info(`Failed to set time. message:${error.message}, code:${error.code}`); - }); + systemDateTime.setTime(time).then(() => { + console.info(`Succeeded in setting time.`); + }).catch((error) => { + console.info(`Failed to set time. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to set time. message:${e.message}, code:${e.code}`); + console.info(`Failed to set time. message: ${e.message}, code: ${e.code}`); } ``` @@ -104,15 +104,15 @@ Obtains the time elapsed since the Unix epoch. This API uses an asynchronous cal ```js try { - systemDateTime.getCurrentTime(true, (error, time) => { - if (error) { - console.info(`Failed to get currentTime. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting currentTime : ${time}`); - }); + systemDateTime.getCurrentTime(true, (error, time) => { + if (error) { + console.info(`Failed to get currentTime. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting currentTime : ${time}`); + }); } catch(e) { - console.info(`Failed to get currentTime. message:${e.message}, code:${e.code}`); + console.info(`Failed to get currentTime. message: ${e.message}, code: ${e.code}`); } ``` @@ -134,15 +134,15 @@ Obtains the time elapsed since the Unix epoch. This API uses an asynchronous cal ```js try { - systemDateTime.getCurrentTime((error, time) => { - if (error) { - console.info(`Failed to get currentTime. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting currentTime : ${time}`); - }); + systemDateTime.getCurrentTime((error, time) => { + if (error) { + console.info(`Failed to get currentTime. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting currentTime : ${time}`); + }); } catch(e) { - console.info(`Failed to get currentTime. message:${e.message}, code:${e.code}`); + console.info(`Failed to get currentTime. message: ${e.message}, code: ${e.code}`); } ``` @@ -170,13 +170,13 @@ Obtains the time elapsed since the Unix epoch. This API uses a promise to return ```js try { - systemDateTime.getCurrentTime().then((time) => { - console.info(`Succeeded in getting currentTime : ${time}`); - }).catch((error) => { - console.info(`Failed to get currentTime. message:${error.message}, code:${error.code}`); - }); + systemDateTime.getCurrentTime().then((time) => { + console.info(`Succeeded in getting currentTime : ${time}`); + }).catch((error) => { + console.info(`Failed to get currentTime. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to get currentTime. message:${e.message}, code:${e.code}`); + console.info(`Failed to get currentTime. message: ${e.message}, code: ${e.code}`); } ``` @@ -199,15 +199,15 @@ Obtains the time elapsed since system startup, excluding the deep sleep time. Th ```js try { - systemDateTime.getRealActiveTime(true, (error, time) => { - if (error) { - console.info(`Failed to get real active time. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting real active time : ${time}`); - }); + systemDateTime.getRealActiveTime(true, (error, time) => { + if (error) { + console.info(`Failed to get real active time. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting real active time : ${time}`); + }); } catch(e) { - console.info(`Failed to get real active time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real active time. message: ${e.message}, code: ${e.code}`); } ``` @@ -229,15 +229,15 @@ Obtains the time elapsed since system startup, excluding the deep sleep time. Th ```js try { - systemDateTime.getRealActiveTime((error, time) => { - if (error) { - console.info(`Failed to get real active time. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting real active time : ${time}`); - }); + systemDateTime.getRealActiveTime((error, time) => { + if (error) { + console.info(`Failed to get real active time. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting real active time : ${time}`); + }); } catch(e) { - console.info(`Failed to get real active time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real active time. message: ${e.message}, code: ${e.code}`); } ``` @@ -265,13 +265,13 @@ Obtains the time elapsed since system startup, excluding the deep sleep time. Th ```js try { - systemDateTime.getRealActiveTime().then((time) => { - console.info(`Succeeded in getting real active time : ${time}`); - }).catch((error) => { - console.info(`Failed to get real active time. message:${error.message}, code:${error.code}`); - }); + systemDateTime.getRealActiveTime().then((time) => { + console.info(`Succeeded in getting real active time : ${time}`); + }).catch((error) => { + console.info(`Failed to get real active time. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to get real active time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real active time. message: ${e.message}, code: ${e.code}`); } ``` @@ -294,15 +294,15 @@ Obtains the time elapsed since system startup, including the deep sleep time. Th ```js try { - systemDateTime.getRealTime(true, (error, time) => { - if (error) { - console.info(`Failed to get real time. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting real time : ${time}`); - }); + systemDateTime.getRealTime(true, (error, time) => { + if (error) { + console.info(`Failed to get real time. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting real time : ${time}`); + }); } catch(e) { - console.info(`Failed to get real time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real time. message: ${e.message}, code: ${e.code}`); } ``` @@ -324,15 +324,15 @@ Obtains the time elapsed since system startup, including the deep sleep time. Th ```js try { - systemDateTime.getRealTime((error, time) => { - if (error) { - console.info(`Failed to get real time. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting real time : ${time}`); - }); + systemDateTime.getRealTime((error, time) => { + if (error) { + console.info(`Failed to get real time. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting real time : ${time}`); + }); } catch(e) { - console.info(`Failed to get real time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real time. message: ${e.message}, code: ${e.code}`); } ``` @@ -360,13 +360,13 @@ Obtains the time elapsed since system startup, including the deep sleep time. Th ```js try { - systemDateTime.getRealTime().then((time) => { - console.info(`Succeeded in getting real time : ${time}`); - }).catch((error) => { - console.info(`Failed to get real time. message:${error.message}, code:${error.code}`); - }); + systemDateTime.getRealTime().then((time) => { + console.info(`Succeeded in getting real time : ${time}`); + }).catch((error) => { + console.info(`Failed to get real time. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to get real time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real time. message: ${e.message}, code: ${e.code}`); } ``` @@ -392,15 +392,15 @@ Sets the system date. This API uses an asynchronous callback to return the resul ```js let date = new Date(); try { - systemDateTime.setDate(date, (error) => { - if (error) { - console.info(`Failed to set date. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in setting date.`); - }); + systemDateTime.setDate(date, (error) => { + if (error) { + console.info(`Failed to set date. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in setting date.`); + }); } catch(e) { - console.info(`Failed to set date. message:${e.message}, code:${e.code}`); + console.info(`Failed to set date. message: ${e.message}, code: ${e.code}`); } ``` @@ -431,13 +431,13 @@ Sets the system date. This API uses a promise to return the result. ```js let date = new Date(); try { - systemDateTime.setDate(date).then(() => { - console.info(`Succeeded in setting date.`); - }).catch((error) => { - console.info(`Failed to set date. message:${error.message}, code:${error.code}`); - }); + systemDateTime.setDate(date).then(() => { + console.info(`Succeeded in setting date.`); + }).catch((error) => { + console.info(`Failed to set date. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to set date. message:${e.message}, code:${e.code}`); + console.info(`Failed to set date. message: ${e.message}, code: ${e.code}`); } ``` @@ -459,15 +459,15 @@ Obtains the current system date. This API uses an asynchronous callback to retur ```js try { - systemDateTime.getDate((error, date) => { - if (error) { - console.info(`Failed to get date. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting date : ${date}`);; - }); + systemDateTime.getDate((error, date) => { + if (error) { + console.info(`Failed to get date. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting date : ${date}`);; + }); } catch(e) { - console.info(`Failed to get date. message:${e.message}, code:${e.code}`); + console.info(`Failed to get date. message: ${e.message}, code: ${e.code}`); } ``` @@ -489,13 +489,13 @@ Obtains the current system date. This API uses a promise to return the result. ```js try { - systemDateTime.getDate().then((date) => { - console.info(`Succeeded in getting date : ${date}`); - }).catch((error) => { - console.info(`Failed to get date. message:${error.message}, code:${error.code}`); - }); + systemDateTime.getDate().then((date) => { + console.info(`Succeeded in getting date : ${date}`); + }).catch((error) => { + console.info(`Failed to get date. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to get date. message:${e.message}, code:${e.code}`); + console.info(`Failed to get date. message: ${e.message}, code: ${e.code}`); } ``` @@ -520,15 +520,15 @@ Sets the system time zone. This API uses an asynchronous callback to return the ```js try { - systemDateTime.setTimezone('Asia/Shanghai', (error) => { - if (error) { - console.info(`Failed to set timezone. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in setting timezone.`); - }); + systemDateTime.setTimezone('Asia/Shanghai', (error) => { + if (error) { + console.info(`Failed to set timezone. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in setting timezone.`); + }); } catch(e) { - console.info(`Failed to set timezone. message:${e.message}, code:${e.code}`); + console.info(`Failed to set timezone. message: ${e.message}, code: ${e.code}`); } ``` @@ -558,13 +558,13 @@ Sets the system time zone. This API uses a promise to return the result. ```js try { - systemDateTime.setTimezone('Asia/Shanghai').then(() => { - console.info(`Succeeded in setting timezone.`); - }).catch((error) => { - console.info(`Failed to set timezone. message:${error.message}, code:${error.code}`); - }); + systemDateTime.setTimezone('Asia/Shanghai').then(() => { + console.info(`Succeeded in setting timezone.`); + }).catch((error) => { + console.info(`Failed to set timezone. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to set timezone. message:${e.message}, code:${e.code}`); + console.info(`Failed to set timezone. message: ${e.message}, code: ${e.code}`); } ``` @@ -586,15 +586,15 @@ Obtains the system time zone. This API uses an asynchronous callback to return t ```js try { - systemDateTime.getTimezone((error, data) => { - if (error) { - console.info(`Failed to get timezone. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in get timezone : ${data}`);; - }); + systemDateTime.getTimezone((error, data) => { + if (error) { + console.info(`Failed to get timezone. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in get timezone : ${data}`);; + }); } catch(e) { - console.info(`Failed to get timezone. message:${e.message}, code:${e.code}`); + console.info(`Failed to get timezone. message: ${e.message}, code: ${e.code}`); } ``` @@ -616,13 +616,13 @@ Obtains the system time zone. This API uses a promise to return the result. ```js try { - systemDateTime.getTimezone().then((data) => { - console.info(`Succeeded in getting timezone: ${data}`); - }).catch((error) => { - console.info(`Failed to get timezone. message:${error.message}, code:${error.code}`); - }); + systemDateTime.getTimezone().then((data) => { + console.info(`Succeeded in getting timezone: ${data}`); + }).catch((error) => { + console.info(`Failed to get timezone. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to get timezone. message:${e.message}, code:${e.code}`); + console.info(`Failed to get timezone. message: ${e.message}, code: ${e.code}`); } ``` diff --git a/en/application-dev/reference/apis/js-apis-system-device.md b/en/application-dev/reference/apis/js-apis-system-device.md index 6da9ae481fe8ef4aeb440090f478fb1069596882..bb56a0899e3f3646d6138e8acb21fbae0244070f 100644 --- a/en/application-dev/reference/apis/js-apis-system-device.md +++ b/en/application-dev/reference/apis/js-apis-system-device.md @@ -1,4 +1,4 @@ -# @system.device +# @system.device (Device Information) The **device** module provides APIs for checking information about the current device. diff --git a/en/application-dev/reference/apis/js-apis-system-mediaquery.md b/en/application-dev/reference/apis/js-apis-system-mediaquery.md index 841cebeb1da0380128d3704650a0aaf9ef095d5f..bc415bc3375ebfd278dd218bdec4ab48f0f51694 100644 --- a/en/application-dev/reference/apis/js-apis-system-mediaquery.md +++ b/en/application-dev/reference/apis/js-apis-system-mediaquery.md @@ -1,4 +1,4 @@ -# Media Query +# @system.mediaquery (Media Query) The **mediaquery** module provides different styles for different media types. @@ -12,7 +12,7 @@ The **mediaquery** module provides different styles for different media types. ## Modules to Import -``` +```ts import mediaquery from '@system.mediaquery'; ``` @@ -39,8 +39,8 @@ Creates a **MediaQueryList** object based on the query condition. **Example** -``` -var mMediaQueryList = mediaquery.matchMedia('(max-width: 466)'); +```ts +let mMediaQueryList = mediaquery.matchMedia('(max-width: 466)'); ``` ## MediaQueryEvent @@ -97,7 +97,7 @@ Adds a listener for this **MediaQueryList** object. The listener must be added b **Example** -``` +```ts function maxWidthMatch(e){ if(e.matches){ // do something @@ -123,7 +123,7 @@ Removes the listener for this **MediaQueryList** object. **Example** -``` +```ts function maxWidthMatch(e){ if(e.matches){ // do something diff --git a/en/application-dev/reference/apis/js-apis-system-parameter.md b/en/application-dev/reference/apis/js-apis-system-parameter.md index ab3ae31887d1a2c55eb94c0164573834321e96c0..db74b6b6c4e725c68f47419997bbecb1362da435 100644 --- a/en/application-dev/reference/apis/js-apis-system-parameter.md +++ b/en/application-dev/reference/apis/js-apis-system-parameter.md @@ -1,4 +1,4 @@ -# @ohos.systemParameter +# @ohos.systemParameter (System Parameter) The **SystemParameter** module provides system services with easy access to key-value pairs. You can use the APIs provided by this module to describe the service status and change the service behavior. The basic operation primitives are get and set. You can obtain the values of system parameters through getters and modify the values through setters. For details about the system parameter design principles and definitions, see diff --git a/en/application-dev/reference/apis/js-apis-system-parameterV9.md b/en/application-dev/reference/apis/js-apis-system-parameterV9.md index 23ad27a04596da4b52bc254c931670845f39fb5f..97e9b165f31c640c52593ae8d1c8d8969862b8e8 100644 --- a/en/application-dev/reference/apis/js-apis-system-parameterV9.md +++ b/en/application-dev/reference/apis/js-apis-system-parameterV9.md @@ -1,4 +1,4 @@ -# SystemParameter +# SystemParameter (System Parameter) The **SystemParameter** module provides system services with easy access to key-value pairs. You can use the APIs provided by this module to describe the service status and change the service behavior. The basic operation primitives are get and set. You can obtain the values of system parameters through getters and modify the values through setters. For details about the system parameter design principles and definitions, see diff --git a/en/application-dev/reference/apis/js-apis-system-prompt.md b/en/application-dev/reference/apis/js-apis-system-prompt.md index e37601dbfa3ec72d13a7722fb4dc56a8b3fe6fef..5f33952a9d0d8401ae69f683f0cd4f1eb7dd43f4 100644 --- a/en/application-dev/reference/apis/js-apis-system-prompt.md +++ b/en/application-dev/reference/apis/js-apis-system-prompt.md @@ -1,4 +1,6 @@ -# Prompt +# @system.prompt (Prompt) + +The **PromptAction** module provides APIs for creating and showing toasts, dialog boxes, and action menus. > **NOTE** > diff --git a/en/application-dev/reference/apis/js-apis-system-router.md b/en/application-dev/reference/apis/js-apis-system-router.md index 1d47c8883ae8d3cc4be49d19845ce1b3e3d5bb2a..6e45d6c012ee2ba4ff6664e1f68ffcd38f9d7570 100644 --- a/en/application-dev/reference/apis/js-apis-system-router.md +++ b/en/application-dev/reference/apis/js-apis-system-router.md @@ -1,4 +1,4 @@ -# @system.router +# @system.router (Page Routing) The **Router** module provides APIs to access pages through URIs. diff --git a/en/application-dev/reference/apis/js-apis-system-timer.md b/en/application-dev/reference/apis/js-apis-system-timer.md index fb1f95ce2d8c5003377120d9d28f29f4415d3117..cc15e7f85a4dec87d1d23f0bc10fab0514d7df5d 100644 --- a/en/application-dev/reference/apis/js-apis-system-timer.md +++ b/en/application-dev/reference/apis/js-apis-system-timer.md @@ -1,4 +1,4 @@ -# @ohos.systemTimer +# @ohos.systemTimer (System Timer) The **systemTimer** module provides system timer features. You can use the APIs of this module to implement the alarm clock and other timer services. @@ -63,23 +63,23 @@ Creates a timer. This API uses an asynchronous callback to return the result. ```js export default { - systemTimer () { - let options = { - type: systemTimer.TIMER_TYPE_REALTIME, - repeat: false - }; - try { - systemTimer.createTimer(options, (error) => { - if (error) { - console.info(`Failed to create timer. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in creating timer.`); - }); - } catch(e) { - console.info(`Failed to create timer. message:${e.message}, code:${e.code}`); + systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat: false + }; + try { + systemTimer.createTimer(options, (error, timerId) => { + if (error) { + console.info(`Failed to create timer. message: ${error.message}, code: ${error.code}`); + return; } + console.info(`Succeeded in creating timer. timerId: ${timerId}`); + }); + } catch(e) { + console.info(`Failed to create timer. message: ${e.message}, code: ${e.code}`); } + } } ``` @@ -109,21 +109,21 @@ Creates a timer. This API uses a promise to return the result. ```js export default { - systemTimer () { - let options = { - type: systemTimer.TIMER_TYPE_REALTIME, - repeat:false - }; - try { - systemTimer.createTimer(options).then(() => { - console.info(`Succeeded in creating timer.`); - }).catch((error) => { - console.info(`Failed to create timer. message:${error.message}, code:${error.code}`); - }); - } catch(e) { - console.info(`Failed to create timer. message:${e.message}, code:${e.code}`); - } + systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + }; + try { + systemTimer.createTimer(options).then((timerId) => { + console.info(`Succeeded in creating timer. timerId: ${timerId}`); + }).catch((error) => { + console.info(`Failed to create timer. message: ${error.message}, code: ${error.code}`); + }); + } catch(e) { + console.info(`Failed to create timer. message: ${e.message}, code: ${e.code}`); } + } } ``` @@ -149,26 +149,26 @@ Starts a timer. This API uses an asynchronous callback to return the result. ```js export default { - async systemTimer () { - let options = { - type: systemTimer.TIMER_TYPE_REALTIME, - repeat:false + async systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + try { + systemTimer.startTimer(timerId, triggerTime, (error) => { + if (error) { + console.info(`Failed to start timer. message: ${error.message}, code: ${error.code}`); + return; } - let timerId = await systemTimer.createTimer(options) - let triggerTime = new Date().getTime() - triggerTime += 3000 - try { - systemTimer.startTimer(timerId, triggerTime, (error) => { - if (error) { - console.info(`Failed to start timer. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in starting timer.`); - }); - } catch(e) { - console.info(`Failed to start timer. message:${e.message}, code:${e.code}`); - } + console.info(`Succeeded in starting timer.`); + }); + } catch(e) { + console.info(`Failed to start timer. message: ${e.message}, code: ${e.code}`); } + } } ``` @@ -199,24 +199,24 @@ Starts a timer. This API uses a promise to return the result. ```js export default { - async systemTimer (){ - let options = { - type: systemTimer.TIMER_TYPE_REALTIME, - repeat:false - } - let timerId = await systemTimer.createTimer(options) - let triggerTime = new Date().getTime() - triggerTime += 3000 - try { - systemTimer.startTimer(timerId, triggerTime).then(() => { - console.info(`Succeeded in starting timer.`); - }).catch((error) => { - console.info(`Failed to start timer. message:${error.message}, code:${error.code}`); - }); - } catch(e) { - console.info(`Failed to start timer. message:${e.message}, code:${e.code}`); - } + async systemTimer (){ + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + try { + systemTimer.startTimer(timerId, triggerTime).then(() => { + console.info(`Succeeded in starting timer.`); + }).catch((error) => { + console.info(`Failed to start timer. message: ${error.message}, code: ${error.code}`); + }); + } catch(e) { + console.info(`Failed to start timer. message: ${e.message}, code: ${e.code}`); + } + } } ``` @@ -241,27 +241,27 @@ Stops a timer. This API uses an asynchronous callback to return the result. ```js export default { - async systemTimer () { - let options = { - type: systemTimer.TIMER_TYPE_REALTIME, - repeat:false - } - let timerId = await systemTimer.createTimer(options) - let triggerTime = new Date().getTime() - triggerTime += 3000 - systemTimer.startTimer(timerId, triggerTime) - try { - systemTimer.stopTimer(timerId, (error) => { - if (error) { - console.info(`Failed to stop timer. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in stopping timer.`); - }); - } catch(e) { - console.info(`Failed to stop timer. message:${e.message}, code:${e.code}`); + async systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + try { + systemTimer.stopTimer(timerId, (error) => { + if (error) { + console.info(`Failed to stop timer. message: ${error.message}, code: ${error.code}`); + return; } - } + console.info(`Succeeded in stopping timer.`); + }); + } catch(e) { + console.info(`Failed to stop timer. message: ${e.message}, code: ${e.code}`); + } + } } ``` @@ -291,25 +291,25 @@ Stops a timer. This API uses a promise to return the result. ```js export default { - async systemTimer (){ - let options = { - type: systemTimer.TIMER_TYPE_REALTIME, - repeat:false - } - let timerId = await systemTimer.createTimer(options) - let triggerTime = new Date().getTime() - triggerTime += 3000 - systemTimer.startTimer(timerId, triggerTime) - try { - systemTimer.stopTimer(timerId).then(() => { - console.info(`Succeeded in stopping timer.`); - }).catch((error) => { - console.info(`Failed to stop timer. message:${error.message}, code:${error.code}`); - }); - } catch(e) { - console.info(`Failed to stop timer. message:${e.message}, code:${e.code}`); - } + async systemTimer (){ + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + try { + systemTimer.stopTimer(timerId).then(() => { + console.info(`Succeeded in stopping timer.`); + }).catch((error) => { + console.info(`Failed to stop timer. message: ${error.message}, code: ${error.code}`); + }); + } catch(e) { + console.info(`Failed to stop timer. message: ${e.message}, code: ${e.code}`); } + } } ``` @@ -334,28 +334,28 @@ Destroys a timer. This API uses an asynchronous callback to return the result. ```js export default { - async systemTimer () { - let options = { - type: systemTimer.TIMER_TYPE_REALTIME, - repeat:false - } - let timerId = await systemTimer.createTimer(options) - let triggerTime = new Date().getTime() - triggerTime += 3000 - systemTimer.startTimer(timerId, triggerTime) - systemTimer.stopTimer(timerId) - try { - systemTimer.destroyTimer(timerId, (error) => { - if (error) { - console.info(`Failed to destroy timer. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in destroying timer.`); - }); - } catch(e) { - console.info(`Failed to destroying timer. message:${e.message}, code:${e.code}`); + async systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + systemTimer.stopTimer(timerId); + try { + systemTimer.destroyTimer(timerId, (error) => { + if (error) { + console.info(`Failed to destroy timer. message: ${error.message}, code: ${error.code}`); + return; } + console.info(`Succeeded in destroying timer.`); + }); + } catch(e) { + console.info(`Failed to destroying timer. message: ${e.message}, code: ${e.code}`); } + } } ``` @@ -385,25 +385,25 @@ Destroys a timer. This API uses a promise to return the result. ```js export default { - async systemTimer (){ - let options = { - type: systemTimer.TIMER_TYPE_REALTIME, - repeat:false - } - let timerId = await systemTimer.createTimer(options) - let triggerTime = new Date().getTime() - triggerTime += 3000 - systemTimer.startTimer(timerId, triggerTime) - systemTimer.stopTimer(timerId) - try { - systemTimer.destroyTimer(timerId).then(() => { - console.info(`Succeeded in destroying timer.`); - }).catch((error) => { - console.info(`Failed to destroy timer. message:${error.message}, code:${error.code}`); - }); - } catch(e) { - console.info(`Failed to destroying timer. message:${e.message}, code:${e.code}`); - } + async systemTimer (){ + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + systemTimer.stopTimer(timerId); + try { + systemTimer.destroyTimer(timerId).then(() => { + console.info(`Succeeded in destroying timer.`); + }).catch((error) => { + console.info(`Failed to destroy timer. message: ${error.message}, code: ${error.code}`); + }); + } catch(e) { + console.info(`Failed to destroying timer. message: ${e.message}, code: ${e.code}`); } + } } ``` diff --git a/en/application-dev/reference/apis/js-apis-uitest.md b/en/application-dev/reference/apis/js-apis-uitest.md index d4b84b0d938725bb069cc482b29ce94c9c3c3bd4..8c229cc5ec06e1bef82452420848b8175a02c22c 100644 --- a/en/application-dev/reference/apis/js-apis-uitest.md +++ b/en/application-dev/reference/apis/js-apis-uitest.md @@ -1,4 +1,4 @@ -# @ohos.uitest +# @ohos.uitest (UiTest) The **UiTest** module provides APIs that you can use to simulate UI actions during testing, such as clicks, double-clicks, long-clicks, and swipes. diff --git a/en/application-dev/reference/apis/js-apis-wallpaper.md b/en/application-dev/reference/apis/js-apis-wallpaper.md index c7f4c94d54cc19d3a95ff40784af886d28f1e3ff..e8d51f5b1c24b57ecabb1de9341abdac99200e82 100644 --- a/en/application-dev/reference/apis/js-apis-wallpaper.md +++ b/en/application-dev/reference/apis/js-apis-wallpaper.md @@ -1,4 +1,4 @@ -# @ohos.wallpaper +# @ohos.wallpaper (Wallpaper) The **wallpaper** module is a system service module in OpenHarmony that provides the wallpaper management service. You can use the APIs of this module to show, set, and switch between wallpapers. diff --git a/en/application-dev/reference/apis/js-apis-webview.md b/en/application-dev/reference/apis/js-apis-webview.md index 83d89392cd8ade90901018fbe5721ce53ba54f2e..4a7bee42b6eba3d30626dac89817440efeebff2e 100644 --- a/en/application-dev/reference/apis/js-apis-webview.md +++ b/en/application-dev/reference/apis/js-apis-webview.md @@ -1,6 +1,4 @@ - - -# @ohos.web.webview +# @ohos.web.webview (Webview) The **Webview** module provides APIs for web control.