• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# JS API Changes of the Misc Services Subsystem
2
3The table below lists the APIs changes of the Misc services subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
4
5## API Changes
6
7| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
8|---|---|---|---|
9| ohos.wallpaper | RgbaColor | alpha: number; | Added|
10| ohos.wallpaper | RgbaColor | blue: number; | Added|
11| ohos.wallpaper | RgbaColor | green: number; | Added|
12| ohos.wallpaper | RgbaColor | red: number; | Added|
13| ohos.wallpaper | wallpaper | function off(type: 'colorChange', callback?: (colors: Array\<RgbaColor>, wallpaperType: WallpaperType) => void): void; | Added|
14| ohos.wallpaper | wallpaper | function on(type: 'colorChange', callback: (colors: Array\<RgbaColor>, wallpaperType: WallpaperType) => void): void; | Added|
15| ohos.wallpaper | wallpaper | function setWallpaper(source: string \| image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback\<void>): void;<br>function setWallpaper(source: string \| image.PixelMap, wallpaperType: WallpaperType): Promise\<void>; | Added|
16| ohos.wallpaper | wallpaper | function reset(wallpaperType: WallpaperType, callback: AsyncCallback\<void>): void;<br>function reset(wallpaperType: WallpaperType): Promise\<void>; | Added|
17| ohos.wallpaper | wallpaper | function isOperationAllowed(callback: AsyncCallback\<boolean>): void;<br>function isOperationAllowed(): Promise\<boolean>; | Added|
18| ohos.wallpaper | wallpaper | function isChangePermitted(callback: AsyncCallback\<boolean>): void;<br>function isChangePermitted(): Promise\<boolean>; | Added|
19| ohos.wallpaper | wallpaper | function getMinWidth(callback: AsyncCallback\<number>): void;<br>function getMinWidth(): Promise\<number>; | Added|
20| ohos.wallpaper | wallpaper | function getMinHeight(callback: AsyncCallback\<number>): void;<br>function getMinHeight(): Promise\<number>; | Added|
21| ohos.wallpaper | wallpaper | function getFile(wallpaperType: WallpaperType, callback: AsyncCallback\<number>): void;<br>function getFile(wallpaperType: WallpaperType): Promise\<number>; | Added|
22| ohos.wallpaper | wallpaper | function getId(wallpaperType: WallpaperType, callback: AsyncCallback\<number>): void;<br>function getId(wallpaperType: WallpaperType): Promise\<number>; | Added|
23| ohos.wallpaper | wallpaper | function getColors(wallpaperType: WallpaperType, callback: AsyncCallback\<Array\<RgbaColor>>): void;<br>function getColors(wallpaperType: WallpaperType): Promise\<Array\<RgbaColor>>; | Added|
24| ohos.wallpaper | WallpaperType | WALLPAPER_LOCKSCREEN | Added|
25| ohos.wallpaper | WallpaperType | WALLPAPER_SYSTEM | Added|
26| ohos.systemTime | systemTime | function getTimezone(callback: AsyncCallback\<string>): void;<br>function getTimezone(): Promise\<string>; | Added|
27| ohos.systemTime | systemTime | function getDate(callback: AsyncCallback\<Date>): void;<br>function getDate(): Promise\<Date>; | Added|
28| ohos.systemTime | systemTime | function getRealTime(isNano?: boolean, callback: AsyncCallback\<number>): void;<br>function getRealTime(isNano?: boolean): Promise\<number>; | Added|
29| ohos.systemTime | systemTime | function getRealActiveTime(isNano?: boolean, callback: AsyncCallback\<number>): void;<br>function getRealActiveTime(isNano?: boolean): Promise\<number>; | Added|
30| ohos.systemTime | systemTime | function getCurrentTime(isNano?: boolean, callback: AsyncCallback\<number>): void;<br>function getCurrentTime(isNano?: boolean): Promise\<number>; | Added|
31| ohos.screenLock | screenLock | function unlockScreen(callback: AsyncCallback\<void>): void;<br>function unlockScreen():Promise\<void>; | Added|
32| ohos.screenLock | screenLock | function isSecureMode(callback: AsyncCallback\<boolean>): void;<br>function isSecureMode(): Promise\<boolean>; | Added|
33| ohos.screenLock | screenLock | function isScreenLocked(callback: AsyncCallback\<boolean>): void;<br>function isScreenLocked(): Promise\<boolean>; | Added|
34| ohos.request | UploadTask | remove(callback: AsyncCallback\<boolean>): void;<br>remove(): Promise\<boolean>; | Added|
35| ohos.request | UploadTask | off(type: 'headerReceive', callback?: (header: object) => void): void; | Added|
36| ohos.request | UploadTask | on(type: 'headerReceive', callback: (header: object) => void): void; | Added|
37| ohos.request | UploadTask | off(type: 'progress', callback?: (uploadedSize: number, totalSize: number) => void): void; | Added|
38| ohos.request | UploadTask | on(type: 'progress', callback: (uploadedSize: number, totalSize: number) => void): void; | Added|
39| ohos.request | UploadConfig | data: Array\<RequestData>; | Added|
40| ohos.request | UploadConfig | files: Array\<File>; | Added|
41| ohos.request | UploadConfig | method: string; | Added|
42| ohos.request | UploadConfig | header: Object; | Added|
43| ohos.request | UploadConfig | url: string; | Added|
44| ohos.request | RequestData | value: string; | Added|
45| ohos.request | RequestData | name: string; | Added|
46| ohos.request | File | type: string; | Added|
47| ohos.request | File | uri: string; | Added|
48| ohos.request | File | name: string; | Added|
49| ohos.request | File | filename: string; | Added|
50| ohos.request | DownloadTask | queryMimeType(callback: AsyncCallback\<string>): void;<br>queryMimeType(): Promise\<string>; | Added|
51| ohos.request | DownloadTask | query(callback: AsyncCallback\<DownloadInfo>): void;<br>query(): Promise\<DownloadInfo>; | Added|
52| ohos.request | DownloadTask | resume(callback: AsyncCallback\<void>): void;<br>resume(): Promise\<void>; | Added|
53| ohos.request | DownloadTask | pause(callback: AsyncCallback\<void>): void;<br>pause(): Promise\<void>; | Added|
54| ohos.request | DownloadTask | remove(callback: AsyncCallback\<boolean>): void;<br>remove(): Promise\<boolean>; | Added|
55| ohos.request | DownloadTask | off(type: 'fail', callback?: (err: number) => void): void; | Added|
56| ohos.request | DownloadTask | on(type: 'fail', callback: (err: number) => void): void; | Added|
57| ohos.request | DownloadTask | off(type: 'complete' \| 'pause' \| 'remove', callback?: () => void): void; | Added|
58| ohos.request | DownloadTask | off(type: 'complete' \| 'pause' \| 'remove', callback?: () => void): void; | Added|
59| ohos.request | DownloadTask | off(type: 'complete' \| 'pause' \| 'remove', callback?: () => void): void; | Added|
60| ohos.request | DownloadTask | on(type: 'complete' \| 'pause' \| 'remove', callback: () => void): void; | Added|
61| ohos.request | DownloadTask | on(type: 'complete' \| 'pause' \| 'remove', callback: () => void): void; | Added|
62| ohos.request | DownloadTask | on(type: 'complete' \| 'pause' \| 'remove', callback: () => void): void; | Added|
63| ohos.request | DownloadTask | off(type: 'progress', callback?: (receivedSize: number, totalSize: number) => void): void; | Added|
64| ohos.request | DownloadTask | on(type: 'progress', callback: (receivedSize: number, totalSize: number) => void): void; | Added|
65| ohos.request | DownloadInfo | downloadTotalBytes: number; | Added|
66| ohos.request | DownloadInfo | downloadTitle: string; | Added|
67| ohos.request | DownloadInfo | targetURI: string; | Added|
68| ohos.request | DownloadInfo | status: number; | Added|
69| ohos.request | DownloadInfo | pausedReason: number; | Added|
70| ohos.request | DownloadInfo | filePath: string; | Added|
71| ohos.request | DownloadInfo | fileName: string; | Added|
72| ohos.request | DownloadInfo | failedReason: number; | Added|
73| ohos.request | DownloadInfo | downloadId: number; | Added|
74| ohos.request | DownloadInfo | downloadedBytes: number; | Added|
75| ohos.request | DownloadInfo | description: string; | Added|
76| ohos.request | DownloadConfig | title?: string; | Added|
77| ohos.request | DownloadConfig | filePath?: string; | Added|
78| ohos.request | DownloadConfig | networkType?: number; | Added|
79| ohos.request | DownloadConfig | description?: string; | Added|
80| ohos.request | DownloadConfig | enableRoaming?: boolean; | Added|
81| ohos.request | DownloadConfig | enableMetered?: boolean; | Added|
82| ohos.request | DownloadConfig | header?: Object; | Added|
83| ohos.request | DownloadConfig | url: string; | Added|
84| ohos.request | request | function upload(config: UploadConfig, callback: AsyncCallback\<UploadTask>): void;<br>function upload(config: UploadConfig): Promise\<UploadTask>; | Added|
85| ohos.request | request | function download(config: DownloadConfig, callback: AsyncCallback\<DownloadTask>): void;<br>function download(config: DownloadConfig): Promise\<DownloadTask>; | Added|
86| ohos.request | request | const SESSION_SUCCESSFUL: number; | Added|
87| ohos.request | request | const SESSION_RUNNING: number; | Added|
88| ohos.request | request | const SESSION_PENDING: number; | Added|
89| ohos.request | request | const SESSION_PAUSED: number; | Added|
90| ohos.request | request | const SESSION_FAILED: number; | Added|
91| ohos.request | request | const PAUSED_WAITING_TO_RETRY: number; | Added|
92| ohos.request | request | const PAUSED_WAITING_FOR_NETWORK: number; | Added|
93| ohos.request | request | const PAUSED_UNKNOWN: number; | Added|
94| ohos.request | request | const PAUSED_QUEUED_FOR_WIFI: number; | Added|
95| ohos.request | request | const ERROR_UNKNOWN: number; | Added|
96| ohos.request | request | const ERROR_UNHANDLED_HTTP_CODE: number; | Added|
97| ohos.request | request | const ERROR_TOO_MANY_REDIRECTS: number; | Added|
98| ohos.request | request | const ERROR_INSUFFICIENT_SPACE: number; | Added|
99| ohos.request | request | const ERROR_HTTP_DATA_ERROR: number; | Added|
100| ohos.request | request | const ERROR_FILE_ERROR: number; | Added|
101| ohos.request | request | const ERROR_FILE_ALREADY_EXISTS: number; | Added|
102| ohos.request | request | const ERROR_DEVICE_NOT_FOUND: number; | Added|
103| ohos.request | request | const ERROR_CANNOT_RESUME: number; | Added|
104| ohos.request | request | const NETWORK_WIFI: number; | Added|
105| ohos.request | request | const NETWORK_MOBILE: number; | Added|
106| ohos.pasteboard | SystemPasteboard | setPasteData(data: PasteData, callback: AsyncCallback\<void>): void;<br>setPasteData(data: PasteData): Promise\<void>; | Added|
107| ohos.pasteboard | SystemPasteboard | hasPasteData(callback: AsyncCallback\<boolean>): void;<br>hasPasteData(): Promise\<boolean>; | Added|
108| ohos.pasteboard | SystemPasteboard | getPasteData(callback: AsyncCallback\<PasteData>): void;<br>getPasteData(): Promise\<PasteData>; | Added|
109| ohos.pasteboard | SystemPasteboard | clear(callback: AsyncCallback\<void>): void;<br>clear(): Promise\<void>; | Added|
110| ohos.pasteboard | SystemPasteboard | off(type: 'update', callback?: () => void): void; | Added|
111| ohos.pasteboard | SystemPasteboard | on(type: 'update', callback: () => void): void; | Added|
112| ohos.pasteboard | PasteData | replaceRecordAt(index: number, record: PasteDataRecord): boolean; | Added|
113| ohos.pasteboard | PasteData | removeRecordAt(index: number): boolean; | Added|
114| ohos.pasteboard | PasteData | hasMimeType(mimeType: string): boolean; | Added|
115| ohos.pasteboard | PasteData | getTag(): string; | Added|
116| ohos.pasteboard | PasteData | getRecordCount(): number; | Added|
117| ohos.pasteboard | PasteData | getRecordAt(index: number): PasteDataRecord; | Added|
118| ohos.pasteboard | PasteData | getProperty(): PasteDataProperty; | Added|
119| ohos.pasteboard | PasteData | getPrimaryUri(): string; | Added|
120| ohos.pasteboard | PasteData | getPrimaryText(): string; | Added|
121| ohos.pasteboard | PasteData | getPrimaryMimeType(): string; | Added|
122| ohos.pasteboard | PasteData | getPrimaryWant(): Want; | Added|
123| ohos.pasteboard | PasteData | getPrimaryHtml(): string; | Added|
124| ohos.pasteboard | PasteData | getMimeTypes(): Array\<string>; | Added|
125| ohos.pasteboard | PasteData | addUriRecord(uri: string): void; | Added|
126| ohos.pasteboard | PasteData | addTextRecord(text: string): void; | Added|
127| ohos.pasteboard | PasteData | addRecord(record: PasteDataRecord): void; | Added|
128| ohos.pasteboard | PasteData | addWantRecord(want: Want): void; | Added|
129| ohos.pasteboard | PasteData | addHtmlRecord(htmlText: string): void; | Added|
130| ohos.pasteboard | PasteDataRecord | convertToText(callback: AsyncCallback\<string>): void;<br>convertToText(): Promise\<string>; | Added|
131| ohos.pasteboard | PasteDataRecord | uri: string; | Added|
132| ohos.pasteboard | PasteDataRecord | plainText: string; | Added|
133| ohos.pasteboard | PasteDataRecord | mimeType: string; | Added|
134| ohos.pasteboard | PasteDataRecord | want: Want; | Added|
135| ohos.pasteboard | PasteDataRecord | htmlText: string; | Added|
136| ohos.pasteboard | PasteDataProperty | localOnly: boolean; | Added|
137| ohos.pasteboard | PasteDataProperty | readonly timestamp: number; | Added|
138| ohos.pasteboard | PasteDataProperty | tag: string; | Added|
139| ohos.pasteboard | PasteDataProperty | readonly mimeTypes: Array\<string>; | Added|
140| ohos.pasteboard | PasteDataProperty | additions: {  [key: string]: object } | Added|
141| ohos.pasteboard | pasteboard | function getSystemPasteboard(): SystemPasteboard; | Added|
142| ohos.pasteboard | pasteboard | function createUriRecord(uri: string): PasteDataRecord; | Added|
143| ohos.pasteboard | pasteboard | function createPlainTextRecord(text: string): PasteDataRecord; | Added|
144| ohos.pasteboard | pasteboard | function createWantRecord(want: Want): PasteDataRecord; | Added|
145| ohos.pasteboard | pasteboard | function createHtmlTextRecord(htmlText: string): PasteDataRecord; | Added|
146| ohos.pasteboard | pasteboard | function createUriData(uri: string): PasteData; | Added|
147| ohos.pasteboard | pasteboard | function createPlainTextData(text: string): PasteData; | Added|
148| ohos.pasteboard | pasteboard | function createWantData(want: Want): PasteData; | Added|
149| ohos.pasteboard | pasteboard | function createHtmlData(htmlText: string): PasteData; | Added|
150| ohos.pasteboard | pasteboard | const MIMETYPE_TEXT_URI: string; | Added|
151| ohos.pasteboard | pasteboard | const MIMETYPE_TEXT_PLAIN: string; | Added|
152| ohos.pasteboard | pasteboard | const MIMETYPE_TEXT_WANT: string; | Added|
153| ohos.pasteboard | pasteboard | const MIMETYPE_TEXT_HTML: string; | Added|
154| ohos.pasteboard | pasteboard | const MAX_RECORD_NUM: number; | Added|
155| ohos.inputmethodengine | KeyEvent | readonly keyAction: number; | Added|
156| ohos.inputmethodengine | KeyEvent | readonly keyCode: number; | Added|
157| ohos.inputmethodengine | EditorAttribute | readonly enterKeyType: number; | Added|
158| ohos.inputmethodengine | EditorAttribute | readonly inputPattern: number; | Added|
159| ohos.inputmethodengine | KeyboardDelegate | off(type: 'textChange', callback?: (text: string) => void): void; | Added|
160| ohos.inputmethodengine | KeyboardDelegate | on(type: 'textChange', callback: (text: string) => void): void; | Added|
161| ohos.inputmethodengine | KeyboardDelegate | off(type: 'selectionChange', callback?: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void): void; | Added|
162| ohos.inputmethodengine | KeyboardDelegate | on(type: 'selectionChange', callback: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void): void; | Added|
163| ohos.inputmethodengine | KeyboardDelegate | off(type: 'cursorContextChange', callback?: (x: number, y: number, height: number) => void): void; | Added|
164| ohos.inputmethodengine | KeyboardDelegate | on(type: 'cursorContextChange', callback: (x: number, y: number, height: number) => void): void; | Added|
165| ohos.inputmethodengine | KeyboardDelegate | off(type: 'keyDown'\|'keyUp', callback?: (event: KeyEvent) => boolean): void; | Added|
166| ohos.inputmethodengine | KeyboardDelegate | off(type: 'keyDown'\|'keyUp', callback?: (event: KeyEvent) => boolean): void; | Added|
167| ohos.inputmethodengine | KeyboardDelegate | on(type: 'keyDown'\|'keyUp', callback: (event: KeyEvent) => boolean): void; | Added|
168| ohos.inputmethodengine | KeyboardDelegate | on(type: 'keyDown'\|'keyUp', callback: (event: KeyEvent) => boolean): void; | Added|
169| ohos.inputmethodengine | TextInputClient | getEditorAttribute(callback: AsyncCallback\<EditorAttribute>): void;<br>getEditorAttribute(): Promise\<EditorAttribute>; | Added|
170| ohos.inputmethodengine | TextInputClient | getBackward(length: number, callback: AsyncCallback\<string>): void;<br>getBackward(length: number): Promise\<string>; | Added|
171| ohos.inputmethodengine | TextInputClient | getForward(length: number, callback: AsyncCallback\<string>): void;<br>getForward(length: number): Promise\<string>; | Added|
172| ohos.inputmethodengine | TextInputClient | insertText(text: string, callback: AsyncCallback\<boolean>): void;<br>insertText(text: string): Promise\<boolean>; | Added|
173| ohos.inputmethodengine | TextInputClient | deleteBackward(length: number, callback: AsyncCallback\<boolean>): void;<br>deleteBackward(length: number): Promise\<boolean>; | Added|
174| ohos.inputmethodengine | TextInputClient | deleteForward(length: number, callback: AsyncCallback\<boolean>): void;<br>deleteForward(length: number): Promise\<boolean>; | Added|
175| ohos.inputmethodengine | TextInputClient | sendKeyFunction(action: number, callback: AsyncCallback\<boolean>): void;<br>sendKeyFunction(action: number): Promise\<boolean>; | Added|
176| ohos.inputmethodengine | InputMethodEngine | off(type: 'keyboardShow'\|'keyboardHide', callback?: () => void): void; | Added|
177| ohos.inputmethodengine | InputMethodEngine | off(type: 'keyboardShow'\|'keyboardHide', callback?: () => void): void; | Added|
178| ohos.inputmethodengine | InputMethodEngine | on(type: 'keyboardShow'\|'keyboardHide', callback: () => void): void; | Added|
179| ohos.inputmethodengine | InputMethodEngine | on(type: 'keyboardShow'\|'keyboardHide', callback: () => void): void; | Added|
180| ohos.inputmethodengine | InputMethodEngine | off(type: 'inputStart', callback?: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; | Added|
181| ohos.inputmethodengine | InputMethodEngine | on(type: 'inputStart', callback: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; | Added|
182| ohos.inputmethodengine | KeyboardController | hideKeyboard(callback: AsyncCallback\<void>): void;<br>hideKeyboard(): Promise\<void>; | Added|
183| ohos.inputmethodengine | inputMethodEngine | function createKeyboardDelegate(): KeyboardDelegate; | Added|
184| ohos.inputmethodengine | inputMethodEngine | function getInputMethodEngine(): InputMethodEngine; | Added|
185| ohos.inputmethodengine | inputMethodEngine | const OPTION_NO_FULLSCREEN: number; | Added|
186| ohos.inputmethodengine | inputMethodEngine | const OPTION_MULTI_LINE: number; | Added|
187| ohos.inputmethodengine | inputMethodEngine | const OPTION_AUTO_WORDS: number; | Added|
188| ohos.inputmethodengine | inputMethodEngine | const OPTION_AUTO_CAP_SENTENCES: number; | Added|
189| ohos.inputmethodengine | inputMethodEngine | const OPTION_AUTO_CAP_CHARACTERS: number; | Added|
190| ohos.inputmethodengine | inputMethodEngine | const OPTION_NONE: number; | Added|
191| ohos.inputmethodengine | inputMethodEngine | const OPTION_ASCII: number; | Added|
192| ohos.inputmethodengine | inputMethodEngine | const DISPLAY_MODE_FULL: number; | Added|
193| ohos.inputmethodengine | inputMethodEngine | const DISPLAY_MODE_PART: number; | Added|
194| ohos.inputmethodengine | inputMethodEngine | const FLAG_SINGLE_LINE: number; | Added|
195| ohos.inputmethodengine | inputMethodEngine | const FLAG_SELECTING: number; | Added|
196| ohos.inputmethodengine | inputMethodEngine | const PATTERN_PASSWORD: number; | Added|
197| ohos.inputmethodengine | inputMethodEngine | const PATTERN_URI: number; | Added|
198| ohos.inputmethodengine | inputMethodEngine | const PATTERN_EMAIL: number; | Added|
199| ohos.inputmethodengine | inputMethodEngine | const PATTERN_DATETIME: number; | Added|
200| ohos.inputmethodengine | inputMethodEngine | const PATTERN_PHONE: number; | Added|
201| ohos.inputmethodengine | inputMethodEngine | const PATTERN_NUMBER: number; | Added|
202| ohos.inputmethodengine | inputMethodEngine | const PATTERN_TEXT: number; | Added|
203| ohos.inputmethodengine | inputMethodEngine | const PATTERN_NULL: number; | Added|
204| ohos.inputmethodengine | inputMethodEngine | const ENTER_KEY_TYPE_PREVIOUS: number; | Added|
205| ohos.inputmethodengine | inputMethodEngine | const ENTER_KEY_TYPE_DONE: number; | Added|
206| ohos.inputmethodengine | inputMethodEngine | const ENTER_KEY_TYPE_NEXT: number; | Added|
207| ohos.inputmethodengine | inputMethodEngine | const ENTER_KEY_TYPE_SEND: number; | Added|
208| ohos.inputmethodengine | inputMethodEngine | const ENTER_KEY_TYPE_SEARCH: number; | Added|
209| ohos.inputmethodengine | inputMethodEngine | const ENTER_KEY_TYPE_GO: number; | Added|
210| ohos.inputmethodengine | inputMethodEngine | const ENTER_KEY_TYPE_UNSPECIFIED: number; | Added|
211| ohos.inputmethod | InputMethodProperty | readonly methodId: string; | Added|
212| ohos.inputmethod | InputMethodProperty | readonly packageName: string; | Added|
213| ohos.inputmethod | InputMethodController | stopInput(callback: AsyncCallback\<boolean>): void;<br>stopInput(): Promise\<boolean>; | Added|
214| ohos.inputmethod | InputMethodSetting | displayOptionalInputMethod(callback: AsyncCallback\<void>): void;<br>displayOptionalInputMethod(): Promise\<void>; | Added|
215| ohos.inputmethod | InputMethodSetting | listInputMethod(callback: AsyncCallback\<Array\<InputMethodProperty>>): void;<br>listInputMethod(): Promise\<Array\<InputMethodProperty>>; | Added|
216| ohos.inputmethod | inputMethod | function getInputMethodController(): InputMethodController; | Added|
217| ohos.inputmethod | inputMethod | function getInputMethodSetting(): InputMethodSetting; | Added|
218| ohos.inputmethod | inputMethod | const MAX_TYPE_NUM: number | Added|
219