openharmony 鸿蒙 js-apidiff-misc

2022-12-22 浏览 (721)

杂散软件服务子系统JS API变更

OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,杂散软件服务子系统的API变更如下:

接口变更

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

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Readme

harmony 鸿蒙元能力子系统JS API变更

harmony 鸿蒙元能力子系统JS API变更

harmony 鸿蒙无障碍子系统JS API变更

harmony 鸿蒙帐号子系统JS API变更

harmony 鸿蒙ArkUI子系统JS API变更

harmony 鸿蒙电源服务子系统JS API变更

harmony 鸿蒙包管理子系统JS API变更

harmony 鸿蒙包管理子系统JS API变更

harmony 鸿蒙基础通信子系统JS API变更

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