diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md
index 3e928b9d241732e333cf3cbb302a39abae30bf1a..5e261f99ad0e2cae3473c8819f10a830fc944954 100644
--- a/en/application-dev/reference/apis/Readme-EN.md
+++ b/en/application-dev/reference/apis/Readme-EN.md
@@ -195,6 +195,10 @@
- [@ohos.multimodalInput.inputEventClient](js-apis-inputeventclient.md)
- [@ohos.multimodalInput.inputMonitor](js-apis-inputmonitor.md)
- [@ohos.multimodalInput.inputEvent](js-apis-inputevent.md)
+ - [@ohos.multimodalInput.keyCode](js-apis-keycode.md)
+ - [@ohos.multimodalInput.keyEvent](js-apis-keyevent.md)
+ - [@ohos.multimodalInput.mouseEvent](js-apis-mouseevent.md)
+ - [@ohos.multimodalInput.ToucEvent](js-apis-touchevent.md)
- [@ohos.power](js-apis-power.md)
- [@ohos.runningLock](js-apis-runninglock.md)
- [@ohos.sensor](js-apis-sensor.md)
diff --git a/en/application-dev/reference/apis/js-apis-keycode.md b/en/application-dev/reference/apis/js-apis-keycode.md
new file mode 100644
index 0000000000000000000000000000000000000000..5bf402c3d736c674c767a915147f2a43c850c23b
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-keycode.md
@@ -0,0 +1,347 @@
+# Keycode
+
+Provides keycodes for a key device.
+
+> **NOTE**
+> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+
+## Modules to Import
+
+```js
+import {KeyCode} from '@ohos.multimodalInput.keyCode'
+```
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| KEYCODE_FN | number | Yes| No| Function (Fn) key|
+| KEYCODE_UNKNOWN | number | Yes| No| Unknown key|
+| KEYCODE_HOME | number | Yes| No| Home key |
+| KEYCODE_BACK | number | Yes| No| Back key|
+| KEYCODE_MEDIA_PLAY_PAUSE | number | Yes| No| Play/Pause key|
+| KEYCODE_MEDIA_STOP | number | Yes| No| Stop key|
+| KEYCODE_MEDIA_NEXT | number | Yes| No| Next key|
+| KEYCODE_MEDIA_PREVIOUS | number | Yes| No| Previous key|
+| KEYCODE_MEDIA_REWIND | number | Yes| No| Rewind key|
+| KEYCODE_MEDIA_FAST_FORWARD | number | Yes| No| Fast Forward key|
+| KEYCODE_VOLUME_UP | number | Yes| No| Volume Up key|
+| KEYCODE_VOLUME_DOWN | number | Yes| No| Volume Down key|
+| KEYCODE_POWER | number | Yes| No| Power key|
+| KEYCODE_CAMERA | number | Yes| No| Camera key|
+| KEYCODE_VOLUME_MUTE | number | Yes| No| Speaker Mute key|
+| KEYCODE_MUTE | number | Yes| No| Mute key|
+| KEYCODE_BRIGHTNESS_UP | number | Yes| No| Brightness Up key|
+| KEYCODE_BRIGHTNESS_DOWN | number | Yes| No| Brightness Down key|
+| KEYCODE_0 | number | Yes| No| Key 0|
+| KEYCODE_1 | number | Yes| No| Key 1|
+| KEYCODE_2 | number | Yes| No| Key 2|
+| KEYCODE_3 | number | Yes| No| Key 3|
+| KEYCODE_4 | number | Yes| No| Key 4|
+| KEYCODE_5 | number | Yes| No| Key 5|
+| KEYCODE_6 | number | Yes| No| Key 6|
+| KEYCODE_7 | number | Yes| No| Key 7|
+| KEYCODE_8 | number | Yes| No| Key 8|
+| KEYCODE_9 | number | Yes| No| Key 9|
+| KEYCODE_STAR | number | Yes| No| Key *|
+| KEYCODE_POUND | number | Yes| No| Key #|
+| KEYCODE_DPAD_UP | number | Yes| No| Up key on D-pad|
+| KEYCODE_DPAD_DOWN | number | Yes| No| Down key on D-pad|
+| KEYCODE_DPAD_LEFT | number | Yes| No| Left key on D-pad|
+| KEYCODE_DPAD_RIGHT | number | Yes| No| Right key on D-pad|
+| KEYCODE_DPAD_CENTER | number | Yes| No| Center key on D-pad|
+| KEYCODE_A | number | Yes| No| Key A|
+| KEYCODE_B | number | Yes| No| Key B|
+| KEYCODE_C | number | Yes| No| Key C|
+| KEYCODE_D | number | Yes| No| Key D|
+| KEYCODE_E | number | Yes| No| Key E|
+| KEYCODE_F | number | Yes| No| Key F|
+| KEYCODE_G | number | Yes| No| Key G|
+| KEYCODE_H | number | Yes| No| Key H|
+| KEYCODE_I | number | Yes| No| Key I|
+| KEYCODE_J | number | Yes| No| Key J|
+| KEYCODE_K | number | Yes| No| Key K|
+| KEYCODE_L | number | Yes| No| Key L|
+| KEYCODE_M | number | Yes| No| Key M|
+| KEYCODE_N | number | Yes| No| Key N|
+| KEYCODE_O | number | Yes| No| Key O|
+| KEYCODE_P | number | Yes| No| Key P|
+| KEYCODE_Q | number | Yes| No| Key Q|
+| KEYCODE_R | number | Yes| No| Key R|
+| KEYCODE_S | number | Yes| No| Key S|
+| KEYCODE_T | number | Yes| No| Key T|
+| KEYCODE_U | number | Yes| No| Key U|
+| KEYCODE_V | number | Yes| No| Key V|
+| KEYCODE_W | number | Yes| No| Key W|
+| KEYCODE_X | number | Yes| No| Key X|
+| KEYCODE_Y | number | Yes| No| Key Y|
+| KEYCODE_Z | number | Yes| No| Key Z|
+| KEYCODE_COMMA | number | Yes| No| Key ,|
+| KEYCODE_PERIOD | number | Yes| No| Key .|
+| KEYCODE_ALT_LEFT | number | Yes| No| Alt+Left key|
+| KEYCODE_ALT_RIGHT | number | Yes| No| Alt+Right key|
+| KEYCODE_SHIFT_LEFT | number | Yes| No| Shift+Left key|
+| KEYCODE_SHIFT_RIGHT | number | Yes| No| Shift+Right key|
+| KEYCODE_TAB | number | Yes| No| Tab key|
+| KEYCODE_SPACE | number | Yes| No| Space key|
+| KEYCODE_SYM | number | Yes| No| Symbol key|
+| KEYCODE_EXPLORER | number | Yes| No| Explorer key, which is used to start the explorer application|
+| KEYCODE_ENVELOPE | number | Yes| No| Email key, which is used to start the email application|
+| KEYCODE_ENTER | number | Yes| No| Enter key|
+| KEYCODE_DEL | number | Yes| No| Delete key|
+| KEYCODE_GRAVE | number | Yes| No| Key `|
+| KEYCODE_MINUS | number | Yes| No| Key -|
+| KEYCODE_EQUALS | number | Yes| No| Key =|
+| KEYCODE_LEFT_BRACKET | number | Yes| No| Key [|
+| KEYCODE_RIGHT_BRACKET | number | Yes| No| Key ]|
+| KEYCODE_BACKSLASH | number | Yes| No| Key \|
+| KEYCODE_SEMICOLON | number | Yes| No| Key ;|
+| KEYCODE_APOSTROPHE | number | Yes| No| Key ' |
+| KEYCODE_SLASH | number | Yes| No| Key /|
+| KEYCODE_AT | number | Yes| No| Key @|
+| KEYCODE_PLUS | number | Yes| No| Key +|
+| KEYCODE_MENU | number | Yes| No| Menu key|
+| KEYCODE_PAGE_UP | number | Yes| No| Page Up key|
+| KEYCODE_PAGE_DOWN | number | Yes| No| Page Down key|
+| KEYCODE_ESCAPE | number | Yes| No| ESC key|
+| KEYCODE_FORWARD_DEL | number | Yes| No| Delete key|
+| KEYCODE_CTRL_LEFT | number | Yes| No| Control+Left |
+| KEYCODE_CTRL_RIGHT | number | Yes| No| Control+Right |
+| KEYCODE_CAPS_LOCK | number | Yes| No| Caps Lock key|
+| KEYCODE_SCROLL_LOCK | number | Yes| No| Scroll Lock key|
+| KEYCODE_META_LEFT | number | Yes| No| Left Meta key|
+| KEYCODE_META_RIGHT | number | Yes| No| Right Meta key|
+| KEYCODE_FUNCTION | number | Yes| No| Function key|
+| KEYCODE_SYSRQ | number | Yes| No| System Request/Print Screen key|
+| KEYCODE_BREAK | number | Yes| No| Break/Pause key|
+| KEYCODE_MOVE_HOME | number | Yes| No| Move to Home key|
+| KEYCODE_MOVE_END | number | Yes| No| Move to End key|
+| KEYCODE_INSERT | number | Yes| No| Insert key|
+| KEYCODE_FORWARD | number | Yes| No| Delete key |
+| KEYCODE_MEDIA_PLAY | number | Yes| No| Play key|
+| KEYCODE_MEDIA_PAUSE | number | Yes| No| Pause key|
+| KEYCODE_MEDIA_CLOSE | number | Yes| No| Close key|
+| KEYCODE_MEDIA_EJECT | number | Yes| No| Eject key|
+| KEYCODE_MEDIA_RECORD | number | Yes| No| Record key|
+| KEYCODE_F1 | number | Yes| No| F1 key|
+| KEYCODE_F2 | number | Yes| No| F2 key|
+| KEYCODE_F3 | number | Yes| No| F3 key|
+| KEYCODE_F4 | number | Yes| No| F4 key|
+| KEYCODE_F5 | number | Yes| No| F5 key|
+| KEYCODE_F6 | number | Yes| No| F6 key|
+| KEYCODE_F7 | number | Yes| No| F7 key|
+| KEYCODE_F8 | number | Yes| No| F8 key|
+| KEYCODE_F9 | number | Yes| No| F9 key|
+| KEYCODE_F10 | number | Yes| No| F10 key|
+| KEYCODE_F11 | number | Yes| No| F11 key|
+| KEYCODE_F12 | number | Yes| No| F12 key|
+| KEYCODE_NUM_LOCK | number | Yes| No| Number Lock key|
+| KEYCODE_NUMPAD_0 | number | Yes| No| Key 0 on numeric keypad|
+| KEYCODE_NUMPAD_1 | number | Yes| No| Key 1 on numeric keypad|
+| KEYCODE_NUMPAD_2 | number | Yes| No| Key 2 on numeric keypad|
+| KEYCODE_NUMPAD_3 | number | Yes| No| Key 3 on numeric keypad|
+| KEYCODE_NUMPAD_4 | number | Yes| No| Key 4 on numeric keypad|
+| KEYCODE_NUMPAD_5 | number | Yes| No| Key 5 on numeric keypad|
+| KEYCODE_NUMPAD_6 | number | Yes| No| Key 6 on numeric keypad|
+| KEYCODE_NUMPAD_7 | number | Yes| No| Key 7 on numeric keypad|
+| KEYCODE_NUMPAD_8 | number | Yes| No| Key 8 on numeric keypad|
+| KEYCODE_NUMPAD_9 | number | Yes| No| Key 9 on numeric keypad|
+| KEYCODE_NUMPAD_DIVIDE | number | Yes| No| Key / on numeric keypad|
+| KEYCODE_NUMPAD_MULTIPLY | number | Yes| No| Key * on numeric keypad|
+| KEYCODE_NUMPAD_SUBTRACT | number | Yes| No| Key - on numeric keypad|
+| KEYCODE_NUMPAD_ADD | number | Yes| No| Key + on numeric keypad|
+| KEYCODE_NUMPAD_DOT | number | Yes| No| Key . on numeric keypad|
+| KEYCODE_NUMPAD_COMMA | number | Yes| No| Key , on numeric keypad|
+| KEYCODE_NUMPAD_ENTER | number | Yes| No| Enter key on numeric keypad|
+| KEYCODE_NUMPAD_EQUALS | number | Yes| No| Key = on numeric keypad|
+| KEYCODE_NUMPAD_LEFT_PAREN | number | Yes| No| Key ( on numeric keypad|
+| KEYCODE_NUMPAD_RIGHT_PAREN | number | Yes| No| Key ) on numeric keypad|
+| KEYCODE_VIRTUAL_MULTITASK | number | Yes| No| Multi-task key|
+| KEYCODE_SLEEP | number | Yes| No| Sleep key|
+| KEYCODE_ZENKAKU_HANKAKU | number | Yes| No| Zenkaku/Hankaku key|
+| KEYCODE_102ND | number | Yes| No| 102nd key|
+| KEYCODE_RO | number | Yes| No| Ro key|
+| KEYCODE_KATAKANA | number | Yes| No| Katakana key|
+| KEYCODE_HIRAGANA | number | Yes| No| Hiragana key|
+| KEYCODE_HENKAN | number | Yes| No| Henkan key|
+| KEYCODE_KATAKANA_HIRAGANA | number | Yes| No| Katakana/Hiragana key|
+| KEYCODE_MUHENKAN | number | Yes| No| Muhenkan key|
+| KEYCODE_LINEFEED | number | Yes| No| Linefeed key|
+| KEYCODE_MACRO | number | Yes| No| Macro key|
+| KEYCODE_NUMPAD_PLUSMINUS | number | Yes| No| Plus/Minus key on the numeric keypad|
+| KEYCODE_SCALE | number | Yes| No| Scale key|
+| KEYCODE_HANGUEL | number | Yes| No| Hanguel key|
+| KEYCODE_HANJA | number | Yes| No| Hanja key|
+| KEYCODE_YEN | number | Yes| No| Yen key|
+| KEYCODE_STOP | number | Yes| No| Stop key|
+| KEYCODE_AGAIN | number | Yes| No| Again key|
+| KEYCODE_PROPS | number | Yes| No| Props key|
+| KEYCODE_UNDO | number | Yes| No| Undo key|
+| KEYCODE_COPY | number | Yes| No| Copy key|
+| KEYCODE_OPEN | number | Yes| No| Open key|
+| KEYCODE_PASTE | number | Yes| No| Paste key|
+| KEYCODE_FIND | number | Yes| No| Find key|
+| KEYCODE_CUT | number | Yes| No| Cut key|
+| KEYCODE_HELP | number | Yes| No| Help key|
+| KEYCODE_CALC | number | Yes| No| Calc key, which is used to start the calculator application|
+| KEYCODE_FILE | number | Yes| No| File key|
+| KEYCODE_BOOKMARKS | number | Yes| No| Bookmarks key|
+| KEYCODE_NEXT | number | Yes| No| Next key|
+| KEYCODE_PLAYPAUSE | number | Yes| No| Play/Pause key|
+| KEYCODE_PREVIOUS | number | Yes| No| Previous key|
+| KEYCODE_STOPCD | number | Yes| No| Stop CD key|
+| KEYCODE_CONFIG | number | Yes| No| Config key|
+| KEYCODE_REFRESH | number | Yes| No| Refresh key|
+| KEYCODE_EXIT | number | Yes| No| Exit key|
+| KEYCODE_EDIT | number | Yes| No| Edit key|
+| KEYCODE_SCROLLUP | number | Yes| No| Scroll Up key|
+| KEYCODE_SCROLLDOWN | number | Yes| No| Scroll Down key|
+| KEYCODE_NEW | number | Yes| No| New key|
+| KEYCODE_REDO | number | Yes| No| Redo key|
+| KEYCODE_CLOSE | number | Yes| No| Close key|
+| KEYCODE_PLAY | number | Yes| No| Play key|
+| KEYCODE_BASSBOOST | number | Yes| No| Bass Boost key|
+| KEYCODE_PRINT | number | Yes| No| Print key|
+| KEYCODE_CHAT | number | Yes| No| Chat key|
+| KEYCODE_FINANCE | number | Yes| No| Finance key|
+| KEYCODE_CANCEL | number | Yes| No| Cancel key|
+| KEYCODE_KBDILLUM_TOGGLE | number | Yes| No| Keyboard Illumination Toggle key|
+| KEYCODE_KBDILLUM_DOWN | number | Yes| No| Keyboard Illumination Up key|
+| KEYCODE_KBDILLUM_UP | number | Yes| No| Keyboard Illumination Down key|
+| KEYCODE_SEND | number | Yes| No| Send key|
+| KEYCODE_REPLY | number | Yes| No| Reply key|
+| KEYCODE_FORWARDMAIL | number | Yes| No| Forward Mail key|
+| KEYCODE_SAVE | number | Yes| No| Save key|
+| KEYCODE_DOCUMENTS | number | Yes| No| Documents key|
+| KEYCODE_VIDEO_NEXT | number | Yes| No| Next Video key|
+| KEYCODE_VIDEO_PREV | number | Yes| No| Previous Video key|
+| KEYCODE_BRIGHTNESS_CYCLE | number | Yes| No| Brightness Cycle key|
+| KEYCODE_BRIGHTNESS_ZERO | number | Yes| No| Brightness Zero key|
+| KEYCODE_DISPLAY_OFF | number | Yes| No| Display Off Key|
+| KEYCODE_BTN_MISC | number | Yes| No| Misc Button key|
+| KEYCODE_GOTO | number | Yes| No| Goto key|
+| KEYCODE_INFO | number | Yes| No| Info key|
+| KEYCODE_PROGRAM | number | Yes| No| Program key|
+| KEYCODE_PVR | number | Yes| No| PVR key|
+| KEYCODE_SUBTITLE | number | Yes| No| Subtitle key|
+| KEYCODE_FULL_SCREEN | number | Yes| No| Full Screen key|
+| KEYCODE_KEYBOARD | number | Yes| No| Keyboard|
+| KEYCODE_ASPECT_RATIO | number | Yes| No| Aspect Ratio key|
+| KEYCODE_PC | number | Yes| No| Port Control key|
+| KEYCODE_TV | number | Yes| No| TV key|
+| KEYCODE_TV2 | number | Yes| No| TV key 2|
+| KEYCODE_VCR | number | Yes| No| VCR key|
+| KEYCODE_VCR2 | number | Yes| No| VCR key 2|
+| KEYCODE_SAT | number | Yes| No| SAT key|
+| KEYCODE_CD | number | Yes| No| CD key|
+| KEYCODE_TAPE | number | Yes| No| Tape key|
+| KEYCODE_TUNER | number | Yes| No| Tuner key|
+| KEYCODE_PLAYER | number | Yes| No| Player key|
+| KEYCODE_DVD | number | Yes| No| DVD key|
+| KEYCODE_AUDIO | number | Yes| No| Audio key|
+| KEYCODE_VIDEO | number | Yes| No| Video key|
+| KEYCODE_MEMO | number | Yes| No| Memo key|
+| KEYCODE_CALENDAR | number | Yes| No| Calendar key|
+| KEYCODE_RED | number | Yes| No| Red indicator|
+| KEYCODE_GREEN | number | Yes| No| Green indicator|
+| KEYCODE_YELLOW | number | Yes| No| Yellow indicator|
+| KEYCODE_BLUE | number | Yes| No| Blue indicator|
+| KEYCODE_CHANNELUP | number | Yes| No| Channel Up key|
+| KEYCODE_CHANNELDOWN | number | Yes| No| Channel Down key|
+| KEYCODE_LAST | number | Yes| No| Last key|
+| KEYCODE_RESTART | number | Yes| No| Restart key|
+| KEYCODE_SLOW | number | Yes| No| Slow key|
+| KEYCODE_SHUFFLE | number | Yes| No| Shuffle key|
+| KEYCODE_VIDEOPHONE | number | Yes| No| Videophone key|
+| KEYCODE_GAMES | number | Yes| No| Games key|
+| KEYCODE_ZOOMIN | number | Yes| No| Zoom-in key|
+| KEYCODE_ZOOMOUT | number | Yes| No| Zoom-out key|
+| KEYCODE_ZOOMRESET | number | Yes| No| Zoom Reset key|
+| KEYCODE_WORDPROCESSOR | number | Yes| No| Word Processor key|
+| KEYCODE_EDITOR | number | Yes| No| Editor key|
+| KEYCODE_SPREADSHEET | number | Yes| No| Spreadsheet key|
+| KEYCODE_GRAPHICSEDITOR | number | Yes| No| Graphics Editor key|
+| KEYCODE_PRESENTATION | number | Yes| No| Presentation key|
+| KEYCODE_DATABASE | number | Yes| No| Database key|
+| KEYCODE_NEWS | number | Yes| No| News key|
+| KEYCODE_VOICEMAIL | number | Yes| No| Voicemail key|
+| KEYCODE_ADDRESSBOOK | number | Yes| No| Addressbook key|
+| KEYCODE_MESSENGER | number | Yes| No| Messenger key|
+| KEYCODE_BRIGHTNESS_TOGGLE | number | Yes| No| Brightness Toggle key|
+| KEYCODE_SPELLCHECK | number | Yes| No| Spell Check key|
+| KEYCODE_COFFEE | number | Yes| No| Coffee key, which is used to launch screen lock or screen saver|
+| KEYCODE_MEDIA_REPEAT | number | Yes| No| Media Repeat key|
+| KEYCODE_IMAGES | number | Yes| No| Images key|
+| KEYCODE_BUTTONCONFIG | number | Yes| No| Button Configuration key|
+| KEYCODE_TASKMANAGER | number | Yes| No| Task Manager key|
+| KEYCODE_JOURNAL | number | Yes| No| Log key|
+| KEYCODE_CONTROLPANEL | number | Yes| No| Control Panel key|
+| KEYCODE_APPSELECT | number | Yes| No| App Select key|
+| KEYCODE_SCREENSAVER | number | Yes| No| Screen Saver key|
+| KEYCODE_ASSISTANT | number | Yes| No| Assistant key|
+| KEYCODE_KBD_LAYOUT_NEXT | number | Yes| No| Next Keyboard Layout key|
+| KEYCODE_BRIGHTNESS_MIN | number | Yes| No| Min Brightness key|
+| KEYCODE_BRIGHTNESS_MAX | number | Yes| No| Max Brightness key|
+| KEYCODE_KBDINPUTASSIST_PREV | number | Yes| No| Keyboard Input-assisted Previous key|
+| KEYCODE_KBDINPUTASSIST_NEXT | number | Yes| No| Keyboard Input-assisted Next key|
+| KEYCODE_KBDINPUTASSIST_PREVGROUP | number | Yes| No| Keyboard Input-assisted Previous Group key|
+| KEYCODE_KBDINPUTASSIST_NEXTGROUP | number | Yes| No| Keyboard Input-assisted Next Group key|
+| KEYCODE_KBDINPUTASSIST_ACCEPT | number | Yes| No| Keyboard Input-assisted Accept key|
+| KEYCODE_KBDINPUTASSIST_CANCEL | number | Yes| No| Keyboard Input-assisted Cancel key|
+| KEYCODE_FRONT | number | Yes| No| Front key, which is used to launch the windshield defogger|
+| KEYCODE_SETUP | number | Yes| No| Setup key|
+| KEYCODE_WAKEUP | number | Yes| No| Wakeup key|
+| KEYCODE_SENDFILE | number | Yes| No| Send File key|
+| KEYCODE_DELETEFILE | number | Yes| No| Delete File key|
+| KEYCODE_XFER | number | Yes| No| XFER key, which is used to start file transfer|
+| KEYCODE_PROG1 | number | Yes| No| Program key 1|
+| KEYCODE_PROG2 | number | Yes| No| Program key 2|
+| KEYCODE_MSDOS | number | Yes| No| MS-DOS key|
+| KEYCODE_SCREENLOCK | number | Yes| No| Screen Lock key|
+| KEYCODE_DIRECTION_ROTATE_DISPLAY | number | Yes| No| Directional Rotation Display key|
+| KEYCODE_CYCLEWINDOWS | number | Yes| No| Windows Cycle key|
+| KEYCODE_COMPUTER | number | Yes| No| Computer key|
+| KEYCODE_EJECTCLOSECD | number | Yes| No| Eject CD key|
+| KEYCODE_ISO | number | Yes| No| ISO key|
+| KEYCODE_MOVE | number | Yes| No| Move key|
+| KEYCODE_F13 | number | Yes| No| F13 key|
+| KEYCODE_F14 | number | Yes| No| F14 key|
+| KEYCODE_F15 | number | Yes| No| F15 key|
+| KEYCODE_F16 | number | Yes| No| F16 key|
+| KEYCODE_F17 | number | Yes| No| F17 key|
+| KEYCODE_F18 | number | Yes| No| F18 key|
+| KEYCODE_F19 | number | Yes| No| F19 key|
+| KEYCODE_F20 | number | Yes| No| F20 key|
+| KEYCODE_F21 | number | Yes| No| F21 key|
+| KEYCODE_F22 | number | Yes| No| F22 key|
+| KEYCODE_F23 | number | Yes| No| F23 key|
+| KEYCODE_F24 | number | Yes| No| F24 key|
+| KEYCODE_PROG3 | number | Yes| No| Program key 3|
+| KEYCODE_PROG4 | number | Yes| No| Program key 4|
+| KEYCODE_DASHBOARD | number | Yes| No| Dashboard|
+| KEYCODE_SUSPEND | number | Yes| No| Suspend key|
+| KEYCODE_HP | number | Yes| No| HP key|
+| KEYCODE_SOUND | number | Yes| No| Sound key|
+| KEYCODE_QUESTION | number | Yes| No| Question key|
+| KEYCODE_CONNECT | number | Yes| No| Connect key|
+| KEYCODE_SPORT | number | Yes| No| Sport key|
+| KEYCODE_SHOP | number | Yes| No| Shop key|
+| KEYCODE_ALTERASE | number | Yes| No| Alternate key|
+| KEYCODE_SWITCHVIDEOMODE | number | Yes| No| Switch Video Mode key (monitor, LCD, and TV, etc.)|
+| KEYCODE_BATTERY | number | Yes| No| Battery key|
+| KEYCODE_BLUETOOTH | number | Yes| No| Bluetooth key|
+| KEYCODE_WLAN | number | Yes| No| WLAN key|
+| KEYCODE_UWB | number | Yes| No| Ultra-wideband key|
+| KEYCODE_WWAN_WIMAX | number | Yes| No| WWAN WiMAX key|
+| KEYCODE_RFKILL | number | Yes| No| RF Kill key|
+| KEYCODE_CHANNEL | number | Yes| No| Channel key|
+| KEYCODE_BTN_0 | number | Yes| No| Key 0|
+| KEYCODE_BTN_1 | number | Yes| No| Button 1|
+| KEYCODE_BTN_2 | number | Yes| No| Button 2|
+| KEYCODE_BTN_3 | number | Yes| No| Button 3|
+| KEYCODE_BTN_4 | number | Yes| No| Button 4|
+| KEYCODE_BTN_5 | number | Yes| No| Button 5|
+| KEYCODE_BTN_6 | number | Yes| No| Button 6|
+| KEYCODE_BTN_7 | number | Yes| No| Button 7|
+| KEYCODE_BTN_8 | number | Yes| No| Button 8|
+| KEYCODE_BTN_9 | number | Yes| No| Button 9|
diff --git a/en/application-dev/reference/apis/js-apis-keyevent.md b/en/application-dev/reference/apis/js-apis-keyevent.md
new file mode 100644
index 0000000000000000000000000000000000000000..085bee426f36b96e2538ab4ad8f13cf5086b5b9c
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-keyevent.md
@@ -0,0 +1,51 @@
+# Key Event
+
+Represents key events reported by an input device.
+
+> **NOTE**
+> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+
+## Modules to Import
+
+```js
+import {Action,Key,KeyEvent} from '@ohos.multimodalInput.keyEvent';
+```
+
+## Action
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| CANCEL | number | Yes| No| Cancellation of a key action.|
+| DOWN | number | Yes| No| Pressing of a key.|
+| UP | number | Yes| No| Release of a key.|
+
+## Key
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| code | KeyCode | Yes| No| Keycode.|
+| pressedTime | number | Yes| No| Time when the key is pressed.|
+| deviceId | number | Yes| No| Device to which the key belongs.|
+
+## KeyEvent
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| action | Action | Yes| No| Key action.|
+| key | Key | Yes| No| Key that has changed.|
+| unicodeChar | number | Yes| No| Unicode character corresponding to the key.|
+| keys | Key[] | Yes| No| List of pressed keys.|
+| ctrlKey | boolean | Yes| No| Whether ctrlKey is being pressed.|
+| altKey | boolean | Yes| No| Whether altKey is being pressed.|
+| shiftKey | boolean | Yes| No| Whether shiftKey is being pressed.|
+| logoKey | boolean | Yes| No| Whether logoKey is being pressed.|
+| fnKey | boolean | Yes| No| Whether fnKey is being pressed.|
+| capsLock | boolean | Yes| No| Whether capsLock is active.|
+| numLock | boolean | Yes| No| Whether numLock is active.|
+| scrollLock | boolean | Yes| No| Whether scrollLock is active.|
diff --git a/en/application-dev/reference/apis/js-apis-mouseevent.md b/en/application-dev/reference/apis/js-apis-mouseevent.md
new file mode 100644
index 0000000000000000000000000000000000000000..86cf6b064028b150ad0ff0313580fa6918903682
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-mouseevent.md
@@ -0,0 +1,89 @@
+# Mouse Event
+
+Represents mouse events reported by an input device.
+
+> **NOTE**
+> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+
+## Modules to Import
+
+```js
+import {Action,Button,Axis,AxisValue,MouseEvent} from '@ohos.multimodalInput.mouseEvent';
+```
+
+## Action
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| CANCEL | number | Yes| No| Cancellation of a mouse action.|
+| MOVE | number | Yes| No| Moving of the mouse pointer.|
+| BUTTON_DOWN | number | Yes| No| Pressing of a mouse button.|
+| BUTTON_UP | number | Yes| No| Release of a mouse button.|
+| AXIS_BEGIN | number | Yes| No| Beginning of the axis event associated with the mouse.|
+| AXIS_UPDATE | number | Yes| No| Updating of the axis event associated with the mouse.|
+| AXIS_END | number | Yes| No| Ending of the axis event associated with the mouse.|
+
+
+## Button
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| LEFT | number | Yes| No| Left button on the mouse.|
+| MIDDLE | number | Yes| No| Middle button on the mouse.|
+| RIGHT | number | Yes| No| Right button on the mouse.|
+| SIDE | number | Yes| No| Side button on the mouse.|
+| EXTRA | number | Yes| No| Extended button on the mouse.|
+| FORWARD | number | Yes| No| Forward button on the mouse.|
+| BACK | number | Yes| No| Back button on the mouse.|
+| TASK | number | Yes| No| Task button on the mouse.|
+
+## Axis
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| SCROLL_VERTICAL | number | Yes| No| Vertical scroll axis.|
+| SCROLL_HORIZONTAL | number | Yes| No| Horizontal scroll axis.|
+| PINCH | number | Yes| No| Pinch axis.|
+
+
+## AxisValue
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| axis | Axis | Yes| No| Axis type.|
+| value | number | Yes| No| Axis value.|
+
+
+## MouseEvent
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| action | Action | Yes| No| Mouse event action.|
+| screenX | number | Yes| No| X coordinate of the mouse pointer on the screen.|
+| screenY | number | Yes| No| Y coordinate of the mouse pointer on the screen.|
+| windowX | number | Yes| No| X coordinate of the mouse pointer in the window.|
+| windowY | number | Yes| No| Y coordinate of the mouse pointer in the window.|
+| rawDeltaX | number | Yes| No| X axis offset relative to the previous reported mouse pointer position. When the mouse pointer is at the edge of the screen, the value may be less than the difference of the X coordinate reported twice.|
+| rawDeltaY | number | Yes| No| Y axis offset relative to the previous reported mouse pointer position.|
+| button | Button | Yes| No| Button that is currently pressed or released.|
+| pressedButtons | Button[] | Yes| No| Button that is being pressed.|
+| axes | AxisValue[] | Yes| No| All axis data contained in the event.|
+| pressedKeys | KeyCode[] | Yes| No| List of pressed keys.|
+| ctrlKey | boolean | Yes| No| Whether ctrlKey is being pressed.|
+| altKey | boolean | Yes| No| Whether altKey is being pressed.|
+| shiftKey | boolean | Yes| No| Whether shiftKey is being pressed.|
+| logoKey | boolean | Yes| No| Whether logoKey is being pressed.|
+| fnKey | boolean | Yes| No| Whether fnKey is being pressed.|
+| capsLock | boolean | Yes| No| Whether capsLock is active.|
+| numLock | boolean | Yes| No| Whether numLock is active.|
+| scrollLock | boolean | Yes| No| Whether scrollLock is active.|
diff --git a/en/application-dev/reference/apis/js-apis-touchevent.md b/en/application-dev/reference/apis/js-apis-touchevent.md
new file mode 100644
index 0000000000000000000000000000000000000000..05a6e52c9d6f1e402dc9a7e3d8d4a19c9a117ec3
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-touchevent.md
@@ -0,0 +1,84 @@
+# Touch Event
+
+Represents touch events reported by an input device.
+
+> **NOTE**
+> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+
+## Modules to Import
+
+```js
+import {Action,ToolType,SourceType,Touch,TouchEvent} from '@ohos.multimodalInput.touchEvent';
+```
+
+## Action
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| CANCEL | number | Yes| No| Cancellation of the touch action.|
+| DOWN | number | Yes| No| Pressing of touch.|
+| MOVE | number | Yes| No| Moving of touch.|
+| UP | number | Yes| No| Lifting of touch.|
+
+## ToolType
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| FINGER | number | Yes| No| Finger|
+| PEN | number | Yes| No| Pen|
+| RUBBER | number | Yes| No| Eraser|
+| BRUSH | number | Yes| No| Brush|
+| PENCIL | number | Yes| No| Pencil|
+| AIRBRUSH | number | Yes| No| Air brush|
+| MOUSE | number | Yes| No| Mouse|
+| LENS | number | Yes| No| Lens|
+
+## SourceType
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| TOUCH_SCREEN | number | Yes| No| Touchscreen|
+| PEN | number | Yes| No| Stylus|
+| TOUCH_PAD | number | Yes| No| Touchpad|
+
+## Touch
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| id | number | Yes| No| Pointer ID.|
+| pressedTime | number | Yes| No| Time stamp when touch is pressed.|
+| screenX | number | Yes| No| X coordinate of the touch position on the screen.|
+| screenY | number | Yes| No| Y coordinate of the touch position on the screen.|
+| windowX | number | Yes| No| X coordinate of the touch position in the window.|
+| windowY | number | Yes| No| Y coordinate of the touch position in the window.|
+| pressure | number | Yes| No| Pressure value. The value range is [0.0, 1.0]. The value 0.0 indicates that the pressure is not supported.|
+| width | number | Yes| No| Width of the contact area where touch is pressed.|
+| height | number | Yes| No| Height of the contact area where touch is pressed.|
+| tiltX | number | Yes| No| Angle relative to the YZ plane. The value range is [-90, 90]. A positive value indicates a rightward tilt.|
+| tiltY | number | Yes| No| Angle relative to the XZ plane. The value range is [-90, 90]. A positive value indicates a downward tilt.|
+| toolX | number | Yes| No| Center point X of the tool area.|
+| toolY | number | Yes| No| Center point Y of the tool area.|
+| toolWidth | number | Yes| No| Width of the tool area.|
+| toolHeight | number | Yes| No| Height of the tool area.|
+| rawX | number | Yes| No| X coordinate of the input device.|
+| rawY | number | Yes| No| Y coordinate of the input device.|
+| toolType | number | Yes| No| Tool type.|
+
+## TouchEvent
+
+**System capability**: SystemCapability.MultimodalInput.Input.Core
+
+| Name| Type| Readable| Writable| Description|
+| -------- | -------- | -------- | -------- | -------- |
+| action | Action | Yes| No| Touch action.|
+| touch | Touch | Yes| No| Current touch point.|
+| touches | Touch[] | Yes| No| All touch points.|
+| sourceType | SourceType | Yes| No| Device type of the touch source.|
diff --git a/zh-cn/application-dev/ability/stage-ability.md b/zh-cn/application-dev/ability/stage-ability.md
index 35afcbc9dc1db61f262580ed5b3ee8994f2b329f..373d4100cca52b8e91707b4f50446fc86d0528a1 100644
--- a/zh-cn/application-dev/ability/stage-ability.md
+++ b/zh-cn/application-dev/ability/stage-ability.md
@@ -78,29 +78,29 @@ Ability功能如下(Ability类,具体的API详见[接口文档](../reference
onCreate(want, launchParam) {
console.log("MainAbility onCreate")
}
-
+
onDestroy() {
console.log("MainAbility onDestroy")
}
-
+
onWindowStageCreate(windowStage) {
console.log("MainAbility onWindowStageCreate")
-
+
windowStage.loadContent("pages/index").then((data) => {
console.log("MainAbility load content succeed with data: " + JSON.stringify(data))
}).catch((error) => {
console.error("MainAbility load content failed with error: " + JSON.stringify(error))
})
}
-
+
onWindowStageDestroy() {
console.log("MainAbility onWindowStageDestroy")
}
-
+
onForeground() {
console.log("MainAbility onForeground")
}
-
+
onBackground() {
console.log("MainAbility onBackground")
}
@@ -210,14 +210,14 @@ Ability类拥有context属性,context属性为AbilityContext类,AbilityConte
**表3** AbilityContext API接口功能介绍
|接口名|描述|
|:------|:------|
-|startAbility(want: Want, callback: AsyncCallback): void|启动Ability。|
-|startAbility(want: Want, options?: StartOptions): Promise|启动Ability。|
-|startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void|带AccountId启动Ability。|
-|startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise|带AccountId启动Ability。|
-|startAbilityForResult(want: Want, callback: AsyncCallback): void|带返回结果启动Ability。|
-|startAbilityForResult(want: Want, options?: StartOptions): Promise|带返回结果启动Ability。|
-|startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void|带返回结果及AccountId启动Ability。|
-|startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise|带返回结果及AccountId启动Ability。|
+|startAbility(want: Want, callback: AsyncCallback\): void|启动Ability。|
+|startAbility(want: Want, options?: StartOptions): Promise\|启动Ability。|
+|startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void|带AccountId启动Ability。|
+|startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\|带AccountId启动Ability。|
+|startAbilityForResult(want: Want, callback: AsyncCallback\): void|带返回结果启动Ability。|
+|startAbilityForResult(want: Want, options?: StartOptions): Promise\|带返回结果启动Ability。|
+|startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void|带返回结果及AccountId启动Ability。|
+|startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\|带返回结果及AccountId启动Ability。|
### 相同设备启动Ability
应用可以通过`this.context`获取Ability实例的上下文,进而使用AbilityContext中的StartAbility相关接口启动Ability。启动Ability可指定Want、StartOptions、accountId,通过callback形式或promise形式实现。具体示例代码如下:
```ts
diff --git a/zh-cn/application-dev/ability/stage-call.md b/zh-cn/application-dev/ability/stage-call.md
index fcd2bd8eaffcc8f17f842e14a793507929468ca0..70a004b2daa190fe18e2de2d43c4ea1101b85075 100644
--- a/zh-cn/application-dev/ability/stage-call.md
+++ b/zh-cn/application-dev/ability/stage-call.md
@@ -18,11 +18,11 @@ Caller及Callee功能如下:具体的API详见[接口文档](../reference/apis
**表1** Call API接口功能介绍
|接口名|描述|
|:------|:------|
-|startAbilityByCall(want: Want): Promise|获取指定通用组件的Caller通信接口,拉起指定通用组件并将其切换到后台。|
+|startAbilityByCall(want: Want): Promise\|获取指定通用组件的Caller通信接口,拉起指定通用组件并将其切换到后台。|
|on(method: string, callback: CaleeCallBack): void|通用组件Callee注册method对应的callback方法。|
|off(method: string): void|通用组件Callee去注册method的callback方法。|
-|call(method: string, data: rpc.Sequenceable): Promise|向通用组件Callee发送约定序列化数据。|
-|callWithResult(method: string, data: rpc.Sequenceable): Promise|向通用组件Callee发送约定序列化数据, 并将返回的约定序列化数据带回。|
+|call(method: string, data: rpc.Sequenceable): Promise\|向通用组件Callee发送约定序列化数据。|
+|callWithResult(method: string, data: rpc.Sequenceable): Promise\|向通用组件Callee发送约定序列化数据, 并将返回的约定序列化数据带回。|
|release(): void|释放通用组件的Caller通信接口。|
|onRelease(callback: OnReleaseCallBack): void|注册通用组件通信断开监听通知。|
diff --git a/zh-cn/application-dev/database/database-distributedobject-guidelines.md b/zh-cn/application-dev/database/database-distributedobject-guidelines.md
index 6b97b3e1de97e5aa48a0df8576311166e415e967..8167c1370b4ee098d35aec95520310aa78260907 100644
--- a/zh-cn/application-dev/database/database-distributedobject-guidelines.md
+++ b/zh-cn/application-dev/database/database-distributedobject-guidelines.md
@@ -71,6 +71,8 @@
| 类名 | 接口名 | 描述 |
| -------- | -------- | -------- |
| DistributedDataObject | save(deviceId: string): Promise<SaveSuccessResponse> | 保存数据对象。 |
+| DistributedDataObject| save(deviceId: string, callback: AsyncCallback<SaveSuccessResponse>): void | 保存数据对象。 |
+| DistributedDataObject | revokeSave(callback: AsyncCallback<RevokeSaveSuccessResponse>): void | 撤回已保存的数据对象。 |
| DistributedDataObject| revokeSave(): Promise<RevokeSaveSuccessResponse> | 撤回已保存的数据对象。 |
## 开发步骤
@@ -201,6 +203,9 @@
```
10. 保存和撤回已保存的数据对象。
+
+ 1.callback方式
+
```js
// 保存数据对象
local_object.save("local", (result, data)=>{
@@ -215,23 +220,31 @@
console.info("revokeSave sessionId " + data.sessionId);
});
```
+ 2.Promise方式
+ ```js
+ // 保存数据对象
+ g_object.save("local").then((result)=>{
+ console.info("save sessionId " + result.sessionId);
+ console.info("save version " + result.version);
+ console.info("save deviceId " + result.deviceId);
+ }, (result)=>{
+ console.info("save local failed.");
+ });
+ // 撤回保存的数据对象
+ g_object.revokeSave().then((result)=>{
+ console.info("revokeSave success.");
+ }, (result)=>{
+ console.info("revokeSave failed.");
+ });
+ ```
11. 删除监听分布式对象的上下线。可以指定删除监听的上下线回调;也可以不指定,这将会删除该分布式数据对象的所有上下线回调。
以下为取消监听数据变更的代码示例:
```js
- // 保存数据对象
- g_object.save("local", (result)=>{
- console.log("save callback");
- console.info("save sessionId " + result.sessionId);
- console.info("save version " + result.version);
- console.info("save deviceId " + result.deviceId);
- });
-
- // 撤回保存的数据对象
- g_object.revokeSave((result, data) =>{
- console.log("revokeSave callback");
- });
-
+ //删除上下线回调statusCallback
+ local_object.off("status", this.statusCallback);
+ //删除所有的上下线回调
+ local_object.off("status");
```
12. 退出同步组网。分布式对象退出组网后,本地的数据变更对端不会同步。
@@ -241,10 +254,10 @@
```
## 开发实例
-针对分布式数据对象,有以下开发实例可供参考:
+针对分布式数据对象,有以下开发实例可供参考:
- [备忘录应用](https://gitee.com/openharmony/distributeddatamgr_objectstore/tree/master/samples/distributedNotepad)
在备忘录应用中,当某一个设备上的备忘录事件发生变更时,通过分布式数据对象将事件变更同步在可信组网内的其他设备上,比如新增备忘录事件、编辑事件标题和内容、清空事件列表等。
-
+
diff --git a/zh-cn/application-dev/database/database-relational-guidelines.md b/zh-cn/application-dev/database/database-relational-guidelines.md
index 22dd9d8a01472af962249c04d62746201f39e28f..5ed616ac6ed73dca02109d68b7be7fd3b381cf9d 100644
--- a/zh-cn/application-dev/database/database-relational-guidelines.md
+++ b/zh-cn/application-dev/database/database-relational-guidelines.md
@@ -186,7 +186,7 @@
| 类名 | 接口名 | 描述 |
| -------- | -------- | -------- |
-| RdbStore |off(event:'dataChange', type: SubscribeType, observer: Callback\>): void| 从数据库中删除指定类型的指定观察者,结果以callback形式返回。
- type:指在{@code SubscribeType}中定义的订阅类型;SUBSCRIBE_TYPE_REMOTE 订阅远程数据更改。
- observer:指已注册的数据更改观察者。 |
+| RdbStore |off(event:'dataChange', type: SubscribeType, observer: Callback\>): void;| 从数据库中删除指定类型的指定观察者,结果以callback形式返回。
- type:指在{@code SubscribeType}中定义的订阅类型;SUBSCRIBE_TYPE_REMOTE 订阅远程数据更改。
- observer:指已注册的数据更改观察者。 |
## 开发步骤
diff --git a/zh-cn/application-dev/notification/Readme-CN.md b/zh-cn/application-dev/notification/Readme-CN.md
index e6770f56e7c2d8a921b5a76f6de65d30387f1626..02b3a06e412f3617b2db876b92bf673e46d4914f 100644
--- a/zh-cn/application-dev/notification/Readme-CN.md
+++ b/zh-cn/application-dev/notification/Readme-CN.md
@@ -2,5 +2,5 @@
- [公共事件与通知概述](notification-brief.md)
- [公共事件开发指导](common-event.md)
-- [通知开发指导](notification.md)
+- [通知开发指导](notification-guidelines.md)
- [调试助手使用指导](assistant-guidelines.md)
\ No newline at end of file
diff --git a/zh-cn/application-dev/notification/notification.md b/zh-cn/application-dev/notification/notification-guidelines.md
similarity index 92%
rename from zh-cn/application-dev/notification/notification.md
rename to zh-cn/application-dev/notification/notification-guidelines.md
index 98e57bbccdd16f372fff09c637e4eb5ac3b3de86..063b0e3cc75e5e092c3f6e79ebddde3ca33e8646 100644
--- a/zh-cn/application-dev/notification/notification.md
+++ b/zh-cn/application-dev/notification/notification-guidelines.md
@@ -1,6 +1,6 @@
-# Notification开发指导
+# 通知开发指导
## 场景简介
@@ -34,8 +34,8 @@ OpenHarmony通过ANS(Advanced Notification Service,通知系统服务)对
| 接口名 | 描述 |
| ------------------------------------------------------------ | ---------------- |
-| isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback): void | 查询通知使能开关 |
-| enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback): void | 设置使能开关 |
+| isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback\): void | 查询通知使能开关 |
+| enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback\): void | 设置使能开关 |
用于查询和设置通知使能开关,若某个应用的通知使能关闭状态,则无法发送通知。
@@ -45,9 +45,9 @@ OpenHarmony通过ANS(Advanced Notification Service,通知系统服务)对
| 接口名 | 描述 |
| ------------------------------------------------------------ | ---------------- |
-| subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback): void | 订阅指定应用通知 |
-| subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void | 订阅所有通知 |
-| unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void | 取消订阅通知 |
+| subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback\): void | 订阅指定应用通知 |
+| subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\): void | 订阅所有通知 |
+| unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\): void | 取消订阅通知 |
订阅接口有支持订阅所有通知、或订阅某些应用的通知。
@@ -69,10 +69,10 @@ OpenHarmony通过ANS(Advanced Notification Service,通知系统服务)对
| 接口名 | 描述 |
| ------------------------------------------------------------ | ------------------------ |
-| publish(request: NotificationRequest, callback: AsyncCallback): void | 发布通知 |
-| publish(request: NotificationRequest, userId: number, callback: AsyncCallback): void | 指定用户发布通知 |
-| cancel(id: number, label: string, callback: AsyncCallback): void | 取消指定的通知 |
-| cancelAll(callback: AsyncCallback): void; | 取消所有该应用发布的通知 |
+| publish(request: NotificationRequest, callback: AsyncCallback\): void | 发布通知 |
+| publish(request: NotificationRequest, userId: number, callback: AsyncCallback\): void | 指定用户发布通知 |
+| cancel(id: number, label: string, callback: AsyncCallback\): void | 取消指定的通知 |
+| cancelAll(callback: AsyncCallback\): void; | 取消所有该应用发布的通知 |
携带userId的publish接口,可以指定向该用户下订阅者发布通知。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md
index 9cdf76b16e32b69d5013e887535f80f8ae39d123..5ff888ae02724e43b90d2f39b52fbb92841b57e7 100755
--- a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md
@@ -495,7 +495,7 @@ bundle.getAllApplicationInfo(bundleFlags, (err, data) => {
## bundle.getBundleArchiveInfo
-getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise
+getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise\
以异步方法获取有关HAP包中包含的应用程序包的信息,使用Promise形式返回结果。
@@ -530,7 +530,7 @@ bundle.getBundleArchiveInfo(hapFilePath, bundleFlags)
## bundle.getBundleArchiveInfo
-getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback) : void
+getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback\) : void
以异步方法获取有关HAP包中包含的应用程序包的信息,使用callback形式返回结果。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-Context.md b/zh-cn/application-dev/reference/apis/js-apis-Context.md
index 102dfcfbfff285f75e47d37cd44713b064c912d4..55a083dbbd6543b1bdb33989c784a165fd2f51f9 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-Context.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-Context.md
@@ -931,9 +931,9 @@ Hap模块信息
| iconId | number | 是 | 否 | 模块图标ID。 |
| backgroundImg | string | 是 | 否 | 模块背景图片。 |
| supportedModes | number | 是 | 否 | 模块支持的模式。 |
-| reqCapabilities | Array | 是 | 否 | 模块运行需要的能力。 |
-| deviceTypes | Array | 是 | 否 | 支持运行的设备类型。 |
-| abilityInfo | Array | 是 | 否 | Ability信息。 |
+| reqCapabilities | Array\ | 是 | 否 | 模块运行需要的能力。 |
+| deviceTypes | Array\ | 是 | 否 | 支持运行的设备类型。 |
+| abilityInfo | Array\ | 是 | 否 | Ability信息。 |
| moduleName | string | 是 | 否 | 模块名。 |
| mainAbilityName | string | 是 | 否 | 入口Ability名称。 |
| installationFree | boolean | 是 | 否 | 是否支持免安装。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-audio.md b/zh-cn/application-dev/reference/apis/js-apis-audio.md
index 36c8c332852f536e9d859e960f2658725d98d648..2dd90c67ae5cf4d1bc9e5e065374212a063c3c12 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-audio.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-audio.md
@@ -542,7 +542,7 @@ audio.createAudioCapturer(audioCapturerOptions).then((data) => {
| ---------- | ------------------------------------------- | ---- | ------------------------------------------------------------ |
| actionType | [InterruptActionType](#interruptactiontype) | 是 | 事件返回类型。TYPE_ACTIVATED为焦点触发事件,TYPE_INTERRUPT为音频打断事件。 |
| type | [InterruptType](#interrupttype) | 否 | 打断事件类型。 |
-| hint | [InterruptHint](interrupthint) | 否 | 打断事件提示。 |
+| hint | [InterruptHint](#interrupthint) | 否 | 打断事件提示。 |
| activated | boolean | 否 | 获得/释放焦点。true表示焦点获取/释放成功,false表示焦点获得/释放失败。 |
## VolumeEvent8+
diff --git a/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md b/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md
index c14aec4b23c265ed94c8d4c7db87251dc515f32f..a0dfb7d2766c1d34da5f149fe63246c383f76656 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md
@@ -720,7 +720,7 @@ bluetooth.off('stateChange', onReceiveEvent);
```
-## bluetooth.sppListen8+
+## bluetooth.sppListen8+
sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void
@@ -1330,7 +1330,7 @@ let ret = a2dpSrc.getDeviceState('XX:XX:XX:XX:XX:XX');
使用A2dpSourceProfile方法之前需要创建该类的实例进行操作,通过getProfile()方法构造此实例。
-### connect8+
+### connect8+
connect(device: string): boolean
@@ -1360,7 +1360,7 @@ let ret = a2dpSrc.connect('XX:XX:XX:XX:XX:XX');
```
-### disconnect8+
+### disconnect8+
disconnect(device: string): boolean
@@ -1484,7 +1484,7 @@ let state = a2dpSrc.getPlayingState('XX:XX:XX:XX:XX:XX');
使用HandsFreeAudioGatewayProfile方法之前需要创建该类的实例进行操作,通过getProfile()方法构造此实例。
-### connect8+
+### connect8+
connect(device: string): boolean
@@ -1514,7 +1514,7 @@ let ret = hfpAg.connect('XX:XX:XX:XX:XX:XX');
```
-### disconnect8+
+### disconnect8+
disconnect(device: string): boolean
diff --git a/zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md b/zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md
index 94eab26a0137bdce712c31d0fbe7e6487540f76a..26d43c37158ab489ad43a28c73d359d923e18dff 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md
@@ -6,7 +6,7 @@
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
-## **导入模块**
+## 导入模块
```
import cardEmulation from '@ohos.nfc.cardEmulation';
diff --git a/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md b/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md
index 6c45b1da71c7966eb4a55e67cab6fd55ab120e7f..a18629eaecd6bcafb67900422c06ccd40ff9c5ca 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md
@@ -891,7 +891,7 @@ call(uri: string, method: string, arg: string, extras: PacMap): Promise\
| 类型 | 说明 |
|------ | ------- |
-|Promise<[PacMap](#pacmap)> | 调用的返回值。 |
+|Promise\<[PacMap](#pacmap)> | 调用的返回值。 |
**示例:**
@@ -922,7 +922,7 @@ call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCa
| method | string | 是 | 被调用的方法名。 |
| arg | string | 是 |需传入的参数。 |
| extras | [PacMap](#pacmap) | 是 | 键值对参数。 |
-| callback | AsyncCallback<[PacMap](#pacmap)> | 是 | 返回值。 |
+| callback | AsyncCallback\<[PacMap](#pacmap)> | 是 | 返回值。 |
**示例:**
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md
index eb03a50e85d1ec930efad52fbae6603077165519..d1b12cce4cf57886c23238fd43ddecf84a868a22 100755
--- a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md
@@ -104,7 +104,7 @@ inputDevice.getDeviceIds((ids)=>{
## inputDevice.getDeviceIds
-function getDeviceIds(): Promise<<Array<number>>
+getDeviceIds(): Promise<Array<number>>
获取所有输入设备的id列表,使用Promise方式作为异步方法。
@@ -150,7 +150,7 @@ inputDevice.getDevice(1, (inputDevice)=>{
## inputDevice.getDevice
-function getDevice(deviceId: number): Promise<InputDeviceData>
+getDevice(deviceId: number): Promise<InputDeviceData>
获取输入设备的描述信息,使用Promise方式作为异步方法。
@@ -333,15 +333,15 @@ inputDevice.getKeyboardType(1).then((ret)=>{
**系统能力**: 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice
-| 名称 | 参数类型 | 说明 |
-| ----------------------- | ------------------------- | -------- |
+| 名称 | 参数类型 | 说明 |
+| ----------------------- | ------------------------- | ---------------- |
| source | [SourceType](#sourcetype) | 轴的输入源类型。 |
-| axis | [AxisType](axistype) | 轴的类型。 |
-| max | number | 轴的最大值。 |
-| min | number | 轴的最小值。 |
-| fuzz9+ | number | 轴的模糊值。 |
-| flat9+ | number | 轴的基准值。 |
-| resolution9+ | number | 轴的分辨率。 |
+| axis | [AxisType](#axistype) | 轴的类型。 |
+| max | number | 轴的最大值。 |
+| min | number | 轴的最小值。 |
+| fuzz9+ | number | 轴的模糊值。 |
+| flat9+ | number | 轴的基准值。 |
+| resolution9+ | number | 轴的分辨率。 |
## SourceType
diff --git a/zh-cn/application-dev/reference/apis/js-apis-media.md b/zh-cn/application-dev/reference/apis/js-apis-media.md
index 0898dfb5987bcc3cb0628e614ed3d1b5478e0682..72ad650db47adfbbf86ba3be0ed423328a9ba49c 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-media.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-media.md
@@ -716,9 +716,9 @@ setDisplaySurface(surfaceId: string): Promise\
**返回值:**
-| 类型 | 说明 |
-| ------------- | ------------------------------ |
-| Promise | 设置SurfaceId的Promise返回值。 |
+| 类型 | 说明 |
+| -------------- | ------------------------------ |
+| Promise\ | 设置SurfaceId的Promise返回值。 |
**示例:**
diff --git a/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md b/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md
index e6cf83e6a4eca2759cd047a2784149511d161b1a..8986ce0dba2718110eb5725411709c113fa076af 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md
@@ -1956,7 +1956,7 @@ async function example() {
实体相册
-### **属性**
+### 属性
**系统能力:** 以下各项对应的系统能力均为SystemCapability.Multimedia.MediaLibrary.Core
diff --git a/zh-cn/application-dev/reference/apis/js-apis-notification.md b/zh-cn/application-dev/reference/apis/js-apis-notification.md
index 3c2e2b3a2fc25192293f5197030cdb3bcb2c7450..2ef2f0ad16dae9864ac13010d917a7a536b454ba 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-notification.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-notification.md
@@ -2354,7 +2354,7 @@ Notification.enableDistributedByBundle(bundle, enable, enableDistributedByBundle
## Notification.enableDistributedByBundle8+
-根据bundleenableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise
+bundleenableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise\
根据应用的包设置应用程序是否支持分布式通知(Promise形式)。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-prompt.md b/zh-cn/application-dev/reference/apis/js-apis-prompt.md
index 1523a09d8b4ad3ec3f9c76387a818d9df12ec130..475fd483adb8d59ee6b39ee809491787e1628f34 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-prompt.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-prompt.md
@@ -208,7 +208,7 @@ showActionMenu(options: ActionMenuOptions, callback: AsyncCallback<ActionMenu
## prompt.showActionMenu
-showActionMenu(options: ActionMenuOptions): Promise
+showActionMenu(options: ActionMenuOptions): Promise\
创建并显示操作菜单,菜单响应后同步返回结果。
diff --git a/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md b/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md
index 13b0eeea162f7c5537a5c5cc0ddaafcce4b27369..8c0e7f91c5f0fb14715c5eb440c819cd4695c834 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md
@@ -14,7 +14,7 @@ import resourceManager from '@ohos.resourceManager';
## 使用说明
-从API Version9开始,Stage模型支持了通过context获取resourceManager对象的方式,再调用其接口,无需再导入包。
+从API Version9开始,Stage模型支持了通过context获取resourceManager对象的方式,再调用其接口,无需再导入包,此方式FA模型不适用。
```
this.context.resourceManager;
@@ -26,6 +26,8 @@ getResourceManager(callback: AsyncCallback<ResourceManager>): void
获取当前应用的资源管理对象,使用callback形式返回ResourceManager对象。
+此接口仅可在FA模型下使用。
+
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
@@ -57,6 +59,8 @@ getResourceManager(bundleName: string, callback: AsyncCallback<ResourceManage
获取指定应用的资源管理对象,使用callback形式返回ResourceManager对象。
+此接口仅可在FA模型下使用。
+
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
@@ -78,6 +82,8 @@ getResourceManager(): Promise<ResourceManager>
获取当前应用的资源管理对象,使用Promise形式返回ResourceManager对象。
+此接口仅可在FA模型下使用。
+
**系统能力**:SystemCapability.Global.ResourceManager
**返回值:**
@@ -107,6 +113,8 @@ getResourceManager(bundleName: string): Promise<ResourceManager>
获取指定应用的资源管理对象,使用Promise形式返回ResourceManager对象。
+此接口仅可在FA模型下使用。
+
**系统能力**:SystemCapability.Global.ResourceManager
**参数:**
@@ -644,7 +652,7 @@ getPluralString(resId: number, num: number): Promise<string>
getRawFile(path: string, callback: AsyncCallback<Uint8Array>): void
-用户获取指定路径对应的rawfile文件内容,使用callback形式返回字节数组。
+用户获取resources/rawfile目录下对应的rawfile文件内容,使用callback形式返回字节数组。
**系统能力**:SystemCapability.Global.ResourceManager
@@ -671,7 +679,7 @@ getRawFile(path: string, callback: AsyncCallback<Uint8Array>): void
getRawFile(path: string): Promise<Uint8Array>
-用户获取指定路径对应的rawfile文件内容,使用Promise形式返回字节数组。
+用户获取resources/rawfile目录下对应的rawfile文件内容,使用Promise形式返回字节数组。
**系统能力**:SystemCapability.Global.ResourceManager
@@ -700,7 +708,7 @@ getRawFile(path: string): Promise<Uint8Array>
getRawFileDescriptor(path: string, callback: AsyncCallback<RawFileDescriptor>): void
-用户获取指定路径对应的rawfile文件的descriptor,使用callback形式返回。
+用户获取resources/rawfile目录下对应rawfile文件的descriptor,使用callback形式返回。
**系统能力**:SystemCapability.Global.ResourceManager
@@ -729,7 +737,7 @@ getRawFileDescriptor(path: string, callback: AsyncCallback<RawFileDescriptor&
getRawFileDescriptor(path: string): Promise<RawFileDescriptor>
-用户获取指定路径对应的rawfile文件的descriptor,使用Promise形式返回。
+用户获取resources/rawfile目录下对应rawfile文件的descriptor,使用Promise形式返回。
**系统能力**:SystemCapability.Global.ResourceManager
@@ -760,7 +768,7 @@ getRawFileDescriptor(path: string): Promise<RawFileDescriptor>
closeRawFileDescriptor(path: string, callback: AsyncCallback<void>): void
-用户关闭指定路径打开的rawfile文件的descriptor,使用callback形式返回。
+用户关闭resources/rawfile目录下rawfile文件的descriptor,使用callback形式返回。
**系统能力**:SystemCapability.Global.ResourceManager
@@ -785,7 +793,7 @@ closeRawFileDescriptor(path: string, callback: AsyncCallback<void>): void
closeRawFileDescriptor(path: string): Promise<void>
-用户关闭指定路径打开的rawfile文件的descriptor,使用Promise形式返回。
+用户关闭resources/rawfile目录下rawfile文件的descriptor,使用Promise形式返回。
**系统能力**:SystemCapability.Global.ResourceManager
@@ -821,11 +829,7 @@ release()
**示例:**
```
resourceManager.getResourceManager((error, mgr) => {
- mgr.release((error, value) => {
- if (error != null) {
- console.log("error is " + error);
- }
- });
+ mgr.release();
});
```
diff --git a/zh-cn/application-dev/ui/js-framework-file.md b/zh-cn/application-dev/ui/js-framework-file.md
index 37a9ceb6e5b4305cbaf88b45f76b9fffef97acd4..983b0f4bf4bf64be037a15fe046ba8d1e420bc3d 100644
--- a/zh-cn/application-dev/ui/js-framework-file.md
+++ b/zh-cn/application-dev/ui/js-framework-file.md
@@ -22,13 +22,13 @@ JS FA应用的JS模块(entry/src/main/js/module)的典型开发目录结构如
各个文件夹的作用:
-- app.js文件用于全局JavaScript逻辑和应用生命周期管理,详见[app.js](../ui/js-framework-js-file.md)。
+- app.js文件用于全局JavaScript逻辑和应用生命周期管理,详见[app.js](js-framework-js-file.md)。
- pages目录用于存放所有组件页面。
- common目录用于存放公共资源文件,比如:媒体资源,自定义组件和JS文件。
-- resources目录用于存放资源配置文件,比如:多分辨率加载等配置文件,详见[资源限定与访问](../ui/js-framework-resource-restriction.md)章节。
+- resources目录用于存放资源配置文件,比如:多分辨率加载等配置文件,详见[资源限定与访问](js-framework-resource-restriction.md)章节。
- share目录用于配置多个实例共享的资源内容,比如:share中的图片和JSON文件可被default1和default2实例共享。
diff --git a/zh-cn/application-dev/work-scheduler/work-scheduler-dev-guide.md b/zh-cn/application-dev/work-scheduler/work-scheduler-dev-guide.md
index 487c4df11b8d8712cb2c9a1853cca07d4e0294e2..37f7435c0ca71607c40883d333a7ef779ab7472d 100644
--- a/zh-cn/application-dev/work-scheduler/work-scheduler-dev-guide.md
+++ b/zh-cn/application-dev/work-scheduler/work-scheduler-dev-guide.md
@@ -22,15 +22,15 @@ import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility';
接口名 | 接口描述
---------------------------------------------------------|-----------------------------------------
-function startWork(work: WorkInfo): boolean; | 延迟调度任务申请
-function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | 延迟调度任务取消
-function getWorkStatus(workId: number, callback: AsyncCallback): void;| 获取延迟调度任务状态(Callback形式)
-function getWorkStatus(workId: number): Promise; | 获取延迟调度任务状态(Promise形式)
-function obtainAllWorks(callback: AsyncCallback): Array;| 获取所有延迟调度任务(Callback形式)
-function obtainAllWorks(): Promise>;| 获取所有延迟调度任务(Promise形式)
-function stopAndClearWorks(): boolean;| 停止并清除任务
-function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean;| 获取上次任务是否超时(针对RepeatWork,Callback形式)
-function isLastWorkTimeOut(workId: number): Promise;| 获取上次任务是否超时(针对RepeatWork,Promise形式)
+startWork(work: WorkInfo): boolean; | 延迟调度任务申请
+stopWork(work: WorkInfo, needCancel?: boolean): boolean; | 延迟调度任务取消
+getWorkStatus(workId: number, callback: AsyncCallback\): void;| 获取延迟调度任务状态(Callback形式)
+getWorkStatus(workId: number): Promise\; | 获取延迟调度任务状态(Promise形式)
+obtainAllWorks(callback: AsyncCallback\): Array\;| 获取所有延迟调度任务(Callback形式)
+obtainAllWorks(): Promise>;| 获取所有延迟调度任务(Promise形式)
+stopAndClearWorks(): boolean;| 停止并清除任务
+isLastWorkTimeOut(workId: number, callback: AsyncCallback\): boolean;| 获取上次任务是否超时(针对RepeatWork,Callback形式)
+isLastWorkTimeOut(workId: number): Promise\;| 获取上次任务是否超时(针对RepeatWork,Promise形式)
**表2** WorkInfo包含参数
@@ -53,15 +53,15 @@ repeatCount |循环次数| number
接口名 | 接口描述
---------------------------------------------------------|-----------------------------------------
-function onWorkStart(work: WorkInfo): void; | 延迟调度任务开始回调
-function onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调
+onWorkStart(work: WorkInfo): void; | 延迟调度任务开始回调
+onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调
### 开发步骤
**开发对应的Extension**
import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility';
-
+
export default class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility {
onWorkStart(workInfo) {
console.log('MyWorkSchedulerExtensionAbility onWorkStart' + JSON.stringify(workInfo));
@@ -74,10 +74,8 @@ function onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调
**注册延迟任务**
-
-
import workScheduler from '@ohos.workScheduler';
-
+
let workInfo = {
workId: 1,
batteryLevel:50,
@@ -95,7 +93,7 @@ function onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调
import workScheduler from '@ohos.workScheduler';
-
+
let workInfo = {
workId: 1,
batteryLevel:50,