# 杂散软件服务子系统JS API变更 OpenHarmony 3.2 Beta3版本相较于OpenHarmony 3.2 Beta2版本,杂散软件服务子系统的API变更如下: ## 接口变更 | 模块名 | 方法/事件名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| | ohos.inputmethod | InputMethodController | hideSoftKeyboard(callback: AsyncCallback\): void;
hideSoftKeyboard():Promise\; | 新增 | | ohos.inputmethod | InputMethodController | showSoftKeyboard(callback: AsyncCallback\): void;
showSoftKeyboard():Promise\; | 新增 | | ohos.inputmethod | inputMethod | getCurrentInputMethod(): InputMethodProperty; | 新增 | | ohos.inputmethodengine | TextInputClient | moveCursor(direction: number, callback: AsyncCallback\): void;
moveCursor(direction: number): Promise\; | 新增 | | ohos.inputmethodengine | InputMethodEngine | off(type: 'setCallingWindow', callback: (wid:number) => void): void; | 新增 | | ohos.inputmethodengine | InputMethodEngine | on(type: 'setCallingWindow', callback: (wid:number) => void): void; | 新增 | | ohos.inputmethodengine | InputMethodEngine | off(type: 'inputStop', callback: () => void): void; | 新增 | | ohos.inputmethodengine | InputMethodEngine | on(type: 'inputStop', callback: () => void): void; | 新增 | | ohos.inputmethodengine | inputMethodEngine | const WINDOW_TYPE_INPUT_METHOD_FLOAT: number; | 新增 | | ohos.inputmethodengine | inputMethodEngine | const CURSOR_RIGHT: number; | 新增 | | ohos.inputmethodengine | inputMethodEngine | const CURSOR_LEFT: number; | 新增 | | ohos.inputmethodengine | inputMethodEngine | const CURSOR_DOWN: number; | 新增 | | ohos.inputmethodengine | inputMethodEngine | const CURSOR_UP: number; | 新增 | | ohos.inputmethodextensionability | InputMethodExtensionAbility | onDestroy(): void; | 新增 | | ohos.inputmethodextensionability | InputMethodExtensionAbility | onCreate(want: Want): void; | 新增 | | ohos.inputmethodextensionability | InputMethodExtensionAbility | context: InputMethodExtensionContext; | 新增 | | ohos.inputmethodextensioncontext | InputMethodExtensionContext | terminateSelf(callback: AsyncCallback\): void;
terminateSelf(): Promise\; | 新增 | | ohos.inputmethodextensioncontext | InputMethodExtensionContext | startAbility(want: Want, callback: AsyncCallback\): void;
startAbility(want: Want, options: StartOptions, callback: AsyncCallback\): void;
startAbility(want: Want, options?: StartOptions): Promise\; | 新增 | | ohos.pasteboard | PasteData | setProperty(property: PasteDataProperty): void; | 新增 | | ohos.pasteboard | PasteData | getPrimaryPixelMap(): image.PixelMap; | 新增 | | ohos.pasteboard | PasteData | addPixelMapRecord(pixelMap: image.PixelMap): void; | 新增 | | ohos.pasteboard | PasteDataRecord | data: { [mimeType: string]: ArrayBuffer } | 新增 | | ohos.pasteboard | PasteDataRecord | pixelMap: image.PixelMap; | 新增 | | ohos.pasteboard | PasteDataProperty | shareOption: ShareOption; | 新增 | | ohos.pasteboard | ShareOption | CrossDevice | 新增 | | ohos.pasteboard | ShareOption | LocalDevice | 新增 | | ohos.pasteboard | ShareOption | InApp | 新增 | | ohos.pasteboard | pasteboard | createRecord(mimeType: string, value: ArrayBuffer):PasteDataRecord; | 新增 | | ohos.pasteboard | pasteboard | createPixelMapRecord(pixelMap: image.PixelMap):PasteDataRecord; | 新增 | | ohos.pasteboard | pasteboard | createData(mimeType: string, value: ArrayBuffer): PasteData; | 新增 | | ohos.pasteboard | pasteboard | createPixelMapData(pixelMap: image.PixelMap): PasteData; | 新增 | | ohos.pasteboard | pasteboard | const MIMETYPE_PIXELMAP: string; | 新增 | | ohos.request | UploadTask | off(type:'complete' \| 'fail', callback?: Callback\>): void; | 新增 | | ohos.request | UploadTask | off(type:'complete' \| 'fail', callback?: Callback\>): void; | 新增 | | ohos.request | UploadTask | on(type:'complete' \| 'fail', callback: Callback\>): void; | 新增 | | ohos.request | UploadTask | on(type:'complete' \| 'fail', callback: Callback\>): void; | 新增 | | ohos.request | TaskState | message: string; | 新增 | | ohos.request | TaskState | responseCode: number; | 新增 | | ohos.request | TaskState | path: string; | 新增 | | ohos.request | DownloadConfig | background?: boolean; | 新增 | | ohos.screenLock | screenLock | onSystemEvent(callback: Callback\): boolean; | 新增 | | ohos.screenLock | SystemEvent | params: string | 新增 | | ohos.screenLock | SystemEvent | eventType: EventType, | 新增 | | ohos.screenLock | screenLock | lockScreen(callback: AsyncCallback\): void;
lockScreen():Promise\; | 新增 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'screenlockEnabled', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 删除 | | ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 删除 |