openharmony 鸿蒙 js-apidiff-misc

2023-02-03 浏览 (571)

JS API Changes of the Misc Services Subsystem

The table below lists the APIs changes of the Misc services subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.

API Changes

ModuleClassMethod/Attribute/Enumeration/ConstantChange Type
ohos.wallpaperRgbaColoralpha: number;Added
ohos.wallpaperRgbaColorblue: number;Added
ohos.wallpaperRgbaColorgreen: number;Added
ohos.wallpaperRgbaColorred: number;Added
ohos.wallpaperwallpaperfunction off(type: 'colorChange', callback?: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;Added
ohos.wallpaperwallpaperfunction on(type: 'colorChange', callback: (colors: Array<RgbaColor>, wallpaperType: WallpaperType) => void): void;Added
ohos.wallpaperwallpaperfunction setWallpaper(source: string |image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
function setWallpaper(source: string |image.PixelMap, wallpaperType: WallpaperType): Promise<void>;
Added
ohos.wallpaperwallpaperfunction reset(wallpaperType: WallpaperType, callback: AsyncCallback<void>): void;
function reset(wallpaperType: WallpaperType): Promise<void>;
Added
ohos.wallpaperwallpaperfunction isOperationAllowed(callback: AsyncCallback<boolean>): void;
function isOperationAllowed(): Promise<boolean>;
Added
ohos.wallpaperwallpaperfunction isChangePermitted(callback: AsyncCallback<boolean>): void;
function isChangePermitted(): Promise<boolean>;
Added
ohos.wallpaperwallpaperfunction getMinWidth(callback: AsyncCallback<number>): void;
function getMinWidth(): Promise<number>;
Added
ohos.wallpaperwallpaperfunction getMinHeight(callback: AsyncCallback<number>): void;
function getMinHeight(): Promise<number>;
Added
ohos.wallpaperwallpaperfunction getFile(wallpaperType: WallpaperType, callback: AsyncCallback<number>): void;
function getFile(wallpaperType: WallpaperType): Promise<number>;
Added
ohos.wallpaperwallpaperfunction getId(wallpaperType: WallpaperType, callback: AsyncCallback<number>): void;
function getId(wallpaperType: WallpaperType): Promise<number>;
Added
ohos.wallpaperwallpaperfunction getColors(wallpaperType: WallpaperType, callback: AsyncCallback<Array<RgbaColor>>): void;
function getColors(wallpaperType: WallpaperType): Promise<Array<RgbaColor>>;
Added
ohos.wallpaperWallpaperTypeWALLPAPER_LOCKSCREENAdded
ohos.wallpaperWallpaperTypeWALLPAPER_SYSTEMAdded
ohos.systemTimesystemTimefunction getTimezone(callback: AsyncCallback<string>): void;
function getTimezone(): Promise<string>;
Added
ohos.systemTimesystemTimefunction getDate(callback: AsyncCallback<Date>): void;
function getDate(): Promise<Date>;
Added
ohos.systemTimesystemTimefunction getRealTime(isNano?: boolean, callback: AsyncCallback<number>): void;
function getRealTime(isNano?: boolean): Promise<number>;
Added
ohos.systemTimesystemTimefunction getRealActiveTime(isNano?: boolean, callback: AsyncCallback<number>): void;
function getRealActiveTime(isNano?: boolean): Promise<number>;
Added
ohos.systemTimesystemTimefunction getCurrentTime(isNano?: boolean, callback: AsyncCallback<number>): void;
function getCurrentTime(isNano?: boolean): Promise<number>;
Added
ohos.screenLockscreenLockfunction unlockScreen(callback: AsyncCallback<void>): void;
function unlockScreen():Promise<void>;
Added
ohos.screenLockscreenLockfunction isSecureMode(callback: AsyncCallback<boolean>): void;
function isSecureMode(): Promise<boolean>;
Added
ohos.screenLockscreenLockfunction isScreenLocked(callback: AsyncCallback<boolean>): void;
function isScreenLocked(): Promise<boolean>;
Added
ohos.requestUploadTaskremove(callback: AsyncCallback<boolean>): void;
remove(): Promise<boolean>;
Added
ohos.requestUploadTaskoff(type: 'headerReceive', callback?: (header: object) => void): void;Added
ohos.requestUploadTaskon(type: 'headerReceive', callback: (header: object) => void): void;Added
ohos.requestUploadTaskoff(type: 'progress', callback?: (uploadedSize: number, totalSize: number) => void): void;Added
ohos.requestUploadTaskon(type: 'progress', callback: (uploadedSize: number, totalSize: number) => void): void;Added
ohos.requestUploadConfigdata: Array<RequestData>;Added
ohos.requestUploadConfigfiles: Array<File>;Added
ohos.requestUploadConfigmethod: string;Added
ohos.requestUploadConfigheader: Object;Added
ohos.requestUploadConfigurl: string;Added
ohos.requestRequestDatavalue: string;Added
ohos.requestRequestDataname: string;Added
ohos.requestFiletype: string;Added
ohos.requestFileuri: string;Added
ohos.requestFilename: string;Added
ohos.requestFilefilename: string;Added
ohos.requestDownloadTaskqueryMimeType(callback: AsyncCallback<string>): void;
queryMimeType(): Promise<string>;
Added
ohos.requestDownloadTaskquery(callback: AsyncCallback<DownloadInfo>): void;
query(): Promise<DownloadInfo>;
Added
ohos.requestDownloadTaskresume(callback: AsyncCallback<void>): void;
resume(): Promise<void>;
Added
ohos.requestDownloadTaskpause(callback: AsyncCallback<void>): void;
pause(): Promise<void>;
Added
ohos.requestDownloadTaskremove(callback: AsyncCallback<boolean>): void;
remove(): Promise<boolean>;
Added
ohos.requestDownloadTaskoff(type: 'fail', callback?: (err: number) => void): void;Added
ohos.requestDownloadTaskon(type: 'fail', callback: (err: number) => void): void;Added
ohos.requestDownloadTaskoff(type: 'complete' |'pause' |'remove', callback?: () => void): void;Added
ohos.requestDownloadTaskoff(type: 'complete' |'pause' |'remove', callback?: () => void): void;Added
ohos.requestDownloadTaskoff(type: 'complete' |'pause' |'remove', callback?: () => void): void;Added
ohos.requestDownloadTaskon(type: 'complete' |'pause' |'remove', callback: () => void): void;Added
ohos.requestDownloadTaskon(type: 'complete' |'pause' |'remove', callback: () => void): void;Added
ohos.requestDownloadTaskon(type: 'complete' |'pause' |'remove', callback: () => void): void;Added
ohos.requestDownloadTaskoff(type: 'progress', callback?: (receivedSize: number, totalSize: number) => void): void;Added
ohos.requestDownloadTaskon(type: 'progress', callback: (receivedSize: number, totalSize: number) => void): void;Added
ohos.requestDownloadInfodownloadTotalBytes: number;Added
ohos.requestDownloadInfodownloadTitle: string;Added
ohos.requestDownloadInfotargetURI: string;Added
ohos.requestDownloadInfostatus: number;Added
ohos.requestDownloadInfopausedReason: number;Added
ohos.requestDownloadInfofilePath: string;Added
ohos.requestDownloadInfofileName: string;Added
ohos.requestDownloadInfofailedReason: number;Added
ohos.requestDownloadInfodownloadId: number;Added
ohos.requestDownloadInfodownloadedBytes: number;Added
ohos.requestDownloadInfodescription: string;Added
ohos.requestDownloadConfigtitle?: string;Added
ohos.requestDownloadConfigfilePath?: string;Added
ohos.requestDownloadConfignetworkType?: number;Added
ohos.requestDownloadConfigdescription?: string;Added
ohos.requestDownloadConfigenableRoaming?: boolean;Added
ohos.requestDownloadConfigenableMetered?: boolean;Added
ohos.requestDownloadConfigheader?: Object;Added
ohos.requestDownloadConfigurl: string;Added
ohos.requestrequestfunction upload(config: UploadConfig, callback: AsyncCallback<UploadTask>): void;
function upload(config: UploadConfig): Promise<UploadTask>;
Added
ohos.requestrequestfunction download(config: DownloadConfig, callback: AsyncCallback<DownloadTask>): void;
function download(config: DownloadConfig): Promise<DownloadTask>;
Added
ohos.requestrequestconst SESSION_SUCCESSFUL: number;Added
ohos.requestrequestconst SESSION_RUNNING: number;Added
ohos.requestrequestconst SESSION_PENDING: number;Added
ohos.requestrequestconst SESSION_PAUSED: number;Added
ohos.requestrequestconst SESSION_FAILED: number;Added
ohos.requestrequestconst PAUSED_WAITING_TO_RETRY: number;Added
ohos.requestrequestconst PAUSED_WAITING_FOR_NETWORK: number;Added
ohos.requestrequestconst PAUSED_UNKNOWN: number;Added
ohos.requestrequestconst PAUSED_QUEUED_FOR_WIFI: number;Added
ohos.requestrequestconst ERROR_UNKNOWN: number;Added
ohos.requestrequestconst ERROR_UNHANDLED_HTTP_CODE: number;Added
ohos.requestrequestconst ERROR_TOO_MANY_REDIRECTS: number;Added
ohos.requestrequestconst ERROR_INSUFFICIENT_SPACE: number;Added
ohos.requestrequestconst ERROR_HTTP_DATA_ERROR: number;Added
ohos.requestrequestconst ERROR_FILE_ERROR: number;Added
ohos.requestrequestconst ERROR_FILE_ALREADY_EXISTS: number;Added
ohos.requestrequestconst ERROR_DEVICE_NOT_FOUND: number;Added
ohos.requestrequestconst ERROR_CANNOT_RESUME: number;Added
ohos.requestrequestconst NETWORK_WIFI: number;Added
ohos.requestrequestconst NETWORK_MOBILE: number;Added
ohos.pasteboardSystemPasteboardsetPasteData(data: PasteData, callback: AsyncCallback<void>): void;
setPasteData(data: PasteData): Promise<void>;
Added
ohos.pasteboardSystemPasteboardhasPasteData(callback: AsyncCallback<boolean>): void;
hasPasteData(): Promise<boolean>;
Added
ohos.pasteboardSystemPasteboardgetPasteData(callback: AsyncCallback<PasteData>): void;
getPasteData(): Promise<PasteData>;
Added
ohos.pasteboardSystemPasteboardclear(callback: AsyncCallback<void>): void;
clear(): Promise<void>;
Added
ohos.pasteboardSystemPasteboardoff(type: 'update', callback?: () => void): void;Added
ohos.pasteboardSystemPasteboardon(type: 'update', callback: () => void): void;Added
ohos.pasteboardPasteDatareplaceRecordAt(index: number, record: PasteDataRecord): boolean;Added
ohos.pasteboardPasteDataremoveRecordAt(index: number): boolean;Added
ohos.pasteboardPasteDatahasMimeType(mimeType: string): boolean;Added
ohos.pasteboardPasteDatagetTag(): string;Added
ohos.pasteboardPasteDatagetRecordCount(): number;Added
ohos.pasteboardPasteDatagetRecordAt(index: number): PasteDataRecord;Added
ohos.pasteboardPasteDatagetProperty(): PasteDataProperty;Added
ohos.pasteboardPasteDatagetPrimaryUri(): string;Added
ohos.pasteboardPasteDatagetPrimaryText(): string;Added
ohos.pasteboardPasteDatagetPrimaryMimeType(): string;Added
ohos.pasteboardPasteDatagetPrimaryWant(): Want;Added
ohos.pasteboardPasteDatagetPrimaryHtml(): string;Added
ohos.pasteboardPasteDatagetMimeTypes(): Array<string>;Added
ohos.pasteboardPasteDataaddUriRecord(uri: string): void;Added
ohos.pasteboardPasteDataaddTextRecord(text: string): void;Added
ohos.pasteboardPasteDataaddRecord(record: PasteDataRecord): void;Added
ohos.pasteboardPasteDataaddWantRecord(want: Want): void;Added
ohos.pasteboardPasteDataaddHtmlRecord(htmlText: string): void;Added
ohos.pasteboardPasteDataRecordconvertToText(callback: AsyncCallback<string>): void;
convertToText(): Promise<string>;
Added
ohos.pasteboardPasteDataRecorduri: string;Added
ohos.pasteboardPasteDataRecordplainText: string;Added
ohos.pasteboardPasteDataRecordmimeType: string;Added
ohos.pasteboardPasteDataRecordwant: Want;Added
ohos.pasteboardPasteDataRecordhtmlText: string;Added
ohos.pasteboardPasteDataPropertylocalOnly: boolean;Added
ohos.pasteboardPasteDataPropertyreadonly timestamp: number;Added
ohos.pasteboardPasteDataPropertytag: string;Added
ohos.pasteboardPasteDataPropertyreadonly mimeTypes: Array<string>;Added
ohos.pasteboardPasteDataPropertyadditions: { [key: string]: object }Added
ohos.pasteboardpasteboardfunction getSystemPasteboard(): SystemPasteboard;Added
ohos.pasteboardpasteboardfunction createUriRecord(uri: string): PasteDataRecord;Added
ohos.pasteboardpasteboardfunction createPlainTextRecord(text: string): PasteDataRecord;Added
ohos.pasteboardpasteboardfunction createWantRecord(want: Want): PasteDataRecord;Added
ohos.pasteboardpasteboardfunction createHtmlTextRecord(htmlText: string): PasteDataRecord;Added
ohos.pasteboardpasteboardfunction createUriData(uri: string): PasteData;Added
ohos.pasteboardpasteboardfunction createPlainTextData(text: string): PasteData;Added
ohos.pasteboardpasteboardfunction createWantData(want: Want): PasteData;Added
ohos.pasteboardpasteboardfunction createHtmlData(htmlText: string): PasteData;Added
ohos.pasteboardpasteboardconst MIMETYPE_TEXT_URI: string;Added
ohos.pasteboardpasteboardconst MIMETYPE_TEXT_PLAIN: string;Added
ohos.pasteboardpasteboardconst MIMETYPE_TEXT_WANT: string;Added
ohos.pasteboardpasteboardconst MIMETYPE_TEXT_HTML: string;Added
ohos.pasteboardpasteboardconst MAX_RECORD_NUM: number;Added
ohos.inputmethodengineKeyEventreadonly keyAction: number;Added
ohos.inputmethodengineKeyEventreadonly keyCode: number;Added
ohos.inputmethodengineEditorAttributereadonly enterKeyType: number;Added
ohos.inputmethodengineEditorAttributereadonly inputPattern: number;Added
ohos.inputmethodengineKeyboardDelegateoff(type: 'textChange', callback?: (text: string) => void): void;Added
ohos.inputmethodengineKeyboardDelegateon(type: 'textChange', callback: (text: string) => void): void;Added
ohos.inputmethodengineKeyboardDelegateoff(type: 'selectionChange', callback?: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void): void;Added
ohos.inputmethodengineKeyboardDelegateon(type: 'selectionChange', callback: (oldBegin: number, oldEnd: number, newBegin: number, newEnd: number) => void): void;Added
ohos.inputmethodengineKeyboardDelegateoff(type: 'cursorContextChange', callback?: (x: number, y: number, height: number) => void): void;Added
ohos.inputmethodengineKeyboardDelegateon(type: 'cursorContextChange', callback: (x: number, y: number, height: number) => void): void;Added
ohos.inputmethodengineKeyboardDelegateoff(type: 'keyDown'|'keyUp', callback?: (event: KeyEvent) => boolean): void;Added
ohos.inputmethodengineKeyboardDelegateoff(type: 'keyDown'|'keyUp', callback?: (event: KeyEvent) => boolean): void;Added
ohos.inputmethodengineKeyboardDelegateon(type: 'keyDown'|'keyUp', callback: (event: KeyEvent) => boolean): void;Added
ohos.inputmethodengineKeyboardDelegateon(type: 'keyDown'|'keyUp', callback: (event: KeyEvent) => boolean): void;Added
ohos.inputmethodengineTextInputClientgetEditorAttribute(callback: AsyncCallback<EditorAttribute>): void;
getEditorAttribute(): Promise<EditorAttribute>;
Added
ohos.inputmethodengineTextInputClientgetBackward(length: number, callback: AsyncCallback<string>): void;
getBackward(length: number): Promise<string>;
Added
ohos.inputmethodengineTextInputClientgetForward(length: number, callback: AsyncCallback<string>): void;
getForward(length: number): Promise<string>;
Added
ohos.inputmethodengineTextInputClientinsertText(text: string, callback: AsyncCallback<boolean>): void;
insertText(text: string): Promise<boolean>;
Added
ohos.inputmethodengineTextInputClientdeleteBackward(length: number, callback: AsyncCallback<boolean>): void;
deleteBackward(length: number): Promise<boolean>;
Added
ohos.inputmethodengineTextInputClientdeleteForward(length: number, callback: AsyncCallback<boolean>): void;
deleteForward(length: number): Promise<boolean>;
Added
ohos.inputmethodengineTextInputClientsendKeyFunction(action: number, callback: AsyncCallback<boolean>): void;
sendKeyFunction(action: number): Promise<boolean>;
Added
ohos.inputmethodengineInputMethodEngineoff(type: 'keyboardShow'|'keyboardHide', callback?: () => void): void;Added
ohos.inputmethodengineInputMethodEngineoff(type: 'keyboardShow'|'keyboardHide', callback?: () => void): void;Added
ohos.inputmethodengineInputMethodEngineon(type: 'keyboardShow'|'keyboardHide', callback: () => void): void;Added
ohos.inputmethodengineInputMethodEngineon(type: 'keyboardShow'|'keyboardHide', callback: () => void): void;Added
ohos.inputmethodengineInputMethodEngineoff(type: 'inputStart', callback?: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void;Added
ohos.inputmethodengineInputMethodEngineon(type: 'inputStart', callback: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void;Added
ohos.inputmethodengineKeyboardControllerhideKeyboard(callback: AsyncCallback<void>): void;
hideKeyboard(): Promise<void>;
Added
ohos.inputmethodengineinputMethodEnginefunction createKeyboardDelegate(): KeyboardDelegate;Added
ohos.inputmethodengineinputMethodEnginefunction getInputMethodEngine(): InputMethodEngine;Added
ohos.inputmethodengineinputMethodEngineconst OPTION_NO_FULLSCREEN: number;Added
ohos.inputmethodengineinputMethodEngineconst OPTION_MULTI_LINE: number;Added
ohos.inputmethodengineinputMethodEngineconst OPTION_AUTO_WORDS: number;Added
ohos.inputmethodengineinputMethodEngineconst OPTION_AUTO_CAP_SENTENCES: number;Added
ohos.inputmethodengineinputMethodEngineconst OPTION_AUTO_CAP_CHARACTERS: number;Added
ohos.inputmethodengineinputMethodEngineconst OPTION_NONE: number;Added
ohos.inputmethodengineinputMethodEngineconst OPTION_ASCII: number;Added
ohos.inputmethodengineinputMethodEngineconst DISPLAY_MODE_FULL: number;Added
ohos.inputmethodengineinputMethodEngineconst DISPLAY_MODE_PART: number;Added
ohos.inputmethodengineinputMethodEngineconst FLAG_SINGLE_LINE: number;Added
ohos.inputmethodengineinputMethodEngineconst FLAG_SELECTING: number;Added
ohos.inputmethodengineinputMethodEngineconst PATTERN_PASSWORD: number;Added
ohos.inputmethodengineinputMethodEngineconst PATTERN_URI: number;Added
ohos.inputmethodengineinputMethodEngineconst PATTERN_EMAIL: number;Added
ohos.inputmethodengineinputMethodEngineconst PATTERN_DATETIME: number;Added
ohos.inputmethodengineinputMethodEngineconst PATTERN_PHONE: number;Added
ohos.inputmethodengineinputMethodEngineconst PATTERN_NUMBER: number;Added
ohos.inputmethodengineinputMethodEngineconst PATTERN_TEXT: number;Added
ohos.inputmethodengineinputMethodEngineconst PATTERN_NULL: number;Added
ohos.inputmethodengineinputMethodEngineconst ENTER_KEY_TYPE_PREVIOUS: number;Added
ohos.inputmethodengineinputMethodEngineconst ENTER_KEY_TYPE_DONE: number;Added
ohos.inputmethodengineinputMethodEngineconst ENTER_KEY_TYPE_NEXT: number;Added
ohos.inputmethodengineinputMethodEngineconst ENTER_KEY_TYPE_SEND: number;Added
ohos.inputmethodengineinputMethodEngineconst ENTER_KEY_TYPE_SEARCH: number;Added
ohos.inputmethodengineinputMethodEngineconst ENTER_KEY_TYPE_GO: number;Added
ohos.inputmethodengineinputMethodEngineconst ENTER_KEY_TYPE_UNSPECIFIED: number;Added
ohos.inputmethodInputMethodPropertyreadonly methodId: string;Added
ohos.inputmethodInputMethodPropertyreadonly packageName: string;Added
ohos.inputmethodInputMethodControllerstopInput(callback: AsyncCallback<boolean>): void;
stopInput(): Promise<boolean>;
Added
ohos.inputmethodInputMethodSettingdisplayOptionalInputMethod(callback: AsyncCallback<void>): void;
displayOptionalInputMethod(): Promise<void>;
Added
ohos.inputmethodInputMethodSettinglistInputMethod(callback: AsyncCallback<Array<InputMethodProperty>>): void;
listInputMethod(): Promise<Array<InputMethodProperty>>;
Added
ohos.inputmethodinputMethodfunction getInputMethodController(): InputMethodController;Added
ohos.inputmethodinputMethodfunction getInputMethodSetting(): InputMethodSetting;Added
ohos.inputmethodinputMethodconst MAX_TYPE_NUM: numberAdded

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Readme

harmony 鸿蒙JS API Changes of the Ability Framework

harmony 鸿蒙JS API Changes of the Accessibility Subsystem

harmony 鸿蒙JS API Changes of the Account Subsystem

harmony 鸿蒙JS API Changes of the ArkUI Development Framework

harmony 鸿蒙JS API Changes of the Power Management Subsystem

harmony 鸿蒙JS API Changes of the Bundle Management Framework

harmony 鸿蒙JS API Changes of the Communication Subsystem

harmony 鸿蒙JS API Changes of the Compiler and Runtime Subsystem

harmony 鸿蒙JS API Changes of the DFX Subsystem

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/c903a92cbf8c4feb852814268434208d