1# 元能力子系统JS API变更 2 3OpenHarmony 3.2 Beta3版本相较于OpenHarmony 3.2 Beta2版本,元能力子系统的API变更如下: 4 5## 接口变更 6 7| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | 8|---|---|---|---| 9| abilityDelegator | AbilityDelegator | waitAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\<AbilityStage>): void;<br>waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout: number, callback: AsyncCallback\<AbilityStage>): void;<br>waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise\<AbilityStage>; | 新增 | 10| abilityDelegator | AbilityDelegator | removeAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\<void>): void;<br>removeAbilityStageMonitor(monitor: AbilityStageMonitor): Promise\<void>; | 新增 | 11| abilityDelegator | AbilityDelegator | addAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\<void>): void;<br>addAbilityStageMonitor(monitor: AbilityStageMonitor): Promise\<void>; | 新增 | 12| abilityStageMonitor | AbilityStageMonitor | srcEntrance: string; | 新增 | 13| abilityStageMonitor | AbilityStageMonitor | moduleName: string; | 新增 | 14| applicationInfo | ApplicationInfo | readonly iconIndex: number; | 新增 | 15| applicationInfo | ApplicationInfo | readonly labelIndex: number; | 新增 | 16| ApplicationStateObserver | ApplicationStateObserver | onProcessStateChanged(processData: ProcessData): void; | 新增 | 17| context | Context | getExternalCacheDir(callback: AsyncCallback\<string>): void<br>getExternalCacheDir(): Promise\<string>; | 新增 | 18| lifecycle | LifecycleForm | onShare?(formId: string): {[key: string]: any}; | 新增 | 19| MissionListener | MissionListener | onMissionClosed(mission: number): void; | 新增 | 20| ohos.ability.wantConstant | Action | DLP_PARAMS_INDEX = "ohos.dlp.params.index" | 新增 | 21| ohos.ability.wantConstant | Action | DLP_PARAMS_ABILITY_NAME = "ohos.dlp.params.abilityName" | 新增 | 22| ohos.ability.wantConstant | Action | DLP_PARAMS_MODULE_NAME = "ohos.dlp.params.moduleName" | 新增 | 23| ohos.ability.wantConstant | Action | DLP_PARAMS_BUNDLE_NAME = "ohos.dlp.params.bundleName" | 新增 | 24| ohos.ability.wantConstant | Action | DLP_PARAMS_SANDBOX = "ohos.dlp.params.sandbox" | 新增 | 25| ohos.ability.wantConstant | Action | ACTION_MARKET_CROWDTEST = "ohos.want.action.marketCrowdTest" | 新增 | 26| ohos.ability.wantConstant | Action | ACTION_MARKET_DOWNLOAD = "ohos.want.action.marketDownload" | 新增 | 27| ohos.abilityAccessCtrl | PermissionStateChangeInfo | permissionName: string; | 新增 | 28| ohos.abilityAccessCtrl | PermissionStateChangeInfo | tokenID: number; | 新增 | 29| ohos.abilityAccessCtrl | PermissionStateChangeInfo | change: PermissionStateChangeType; | 新增 | 30| ohos.abilityAccessCtrl | PermissionStateChangeType | PERMISSION_GRANTED_OPER = 1 | 新增 | 31| ohos.abilityAccessCtrl | PermissionStateChangeType | PERMISSION_REVOKED_OPER = 0 | 新增 | 32| ohos.abilityAccessCtrl | AtManager | off(type: 'permissionStateChange', tokenIDList: Array\<number>, permissionNameList: Array\<string>, callback?: Callback\<PermissionStateChangeInfo>): void; | 新增 | 33| ohos.abilityAccessCtrl | AtManager | on(type: 'permissionStateChange', tokenIDList: Array\<number>, permissionNameList: Array\<string>, callback: Callback\<PermissionStateChangeInfo>): void; | 新增 | 34| ohos.abilityAccessCtrl | AtManager | getVersion(): Promise\<number>; | 新增 | 35| ohos.application.Ability | Ability | onMemoryLevel(level: AbilityConstant.MemoryLevel): void; | 新增 | 36| ohos.application.AbilityConstant | WindowMode | WINDOW_MODE_FLOATING = 102 | 新增 | 37| ohos.application.AbilityConstant | WindowMode | WINDOW_MODE_SPLIT_SECONDARY = 101 | 新增 | 38| ohos.application.AbilityConstant | WindowMode | WINDOW_MODE_SPLIT_PRIMARY = 100 | 新增 | 39| ohos.application.AbilityConstant | WindowMode | WINDOW_MODE_FULLSCREEN = 1 | 新增 | 40| ohos.application.AbilityConstant | WindowMode | WINDOW_MODE_UNDEFINED = 0 | 新增 | 41| ohos.application.AbilityConstant | MemoryLevel | MEMORY_LEVEL_CRITICAL = 2 | 新增 | 42| ohos.application.AbilityConstant | MemoryLevel | MEMORY_LEVEL_LOW = 1 | 新增 | 43| ohos.application.AbilityConstant | MemoryLevel | MEMORY_LEVEL_MODERATE = 0 | 新增 | 44| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onWindowStageDestroy(ability: Ability, windowStage: window.WindowStage): void; | 新增 | 45| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onWindowStageInactive(ability: Ability, windowStage: window.WindowStage): void; | 新增 | 46| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onWindowStageActive(ability: Ability, windowStage: window.WindowStage): void; | 新增 | 47| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onWindowStageCreate(ability: Ability, windowStage: window.WindowStage): void; | 新增 | 48| ohos.application.AbilityStage | AbilityStage | onMemoryLevel(level: AbilityConstant.MemoryLevel): void; | 新增 | 49| ohos.application.appManager | ProcessState | STATE_DESTROY | 新增 | 50| ohos.application.appManager | ProcessState | STATE_BACKGROUND | 新增 | 51| ohos.application.appManager | ProcessState | STATE_ACTIVE | 新增 | 52| ohos.application.appManager | ProcessState | STATE_FOREGROUND | 新增 | 53| ohos.application.appManager | ProcessState | STATE_CREATE | 新增 | 54| ohos.application.appManager | ApplicationState | STATE_DESTROY | 新增 | 55| ohos.application.appManager | ApplicationState | STATE_BACKGROUND | 新增 | 56| ohos.application.appManager | ApplicationState | STATE_ACTIVE | 新增 | 57| ohos.application.appManager | ApplicationState | STATE_FOREGROUND | 新增 | 58| ohos.application.appManager | ApplicationState | STATE_CREATE | 新增 | 59| ohos.application.Configuration | Configuration | hasPointerDevice?: boolean; | 新增 | 60| ohos.application.context | AreaMode | EL2 = 1 | 新增 | 61| ohos.application.context | AreaMode | EL1 = 0 | 新增 | 62| ohos.application.formError | FormError | ERR_DISTRIBUTED_SCHEDULE_FAILED = 37 | 新增 | 63| ohos.application.FormExtension | FormExtension | onShare?(formId: string): {[key: string]: any}; | 新增 | 64| ohos.application.formHost | formHost | function shareForm(formId: string, deviceId: string, callback: AsyncCallback\<void>): void;<br>function shareForm(formId: string, deviceId: string): Promise\<void>; | 新增 | 65| ohos.application.formInfo | VisibilityType | FORM_INVISIBLE: number | 新增 | 66| ohos.application.formInfo | VisibilityType | FORM_VISIBLE: number, | 新增 | 67| ohos.application.formInfo | FormDimension | Dimension_2_1 | 新增 | 68| ohos.application.formInfo | FormDimension | Dimension_4_4 | 新增 | 69| ohos.application.formInfo | FormDimension | Dimension_2_4 | 新增 | 70| ohos.application.formInfo | FormDimension | Dimension_2_2 | 新增 | 71| ohos.application.formInfo | FormDimension | Dimension_1_2 = 1 | 新增 | 72| ohos.application.formInfo | FormParam | DEVICE_ID_KEY = "ohos.extra.param.key.device_id" | 新增 | 73| ohos.application.formInfo | FormParam | ABILITY_NAME_KEY = "ohos.extra.param.key.ability_name" | 新增 | 74| ohos.application.formInfo | FormParam | BUNDLE_NAME_KEY = "ohos.extra.param.key.bundle_name" | 新增 | 75| ohos.application.quickFixManager | quickFixManager | function getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback\<ApplicationQuickFixInfo>): void;<br>function getApplicationQuickFixInfo(bundleName: string): Promise\<ApplicationQuickFixInfo>; | 新增 | 76| ohos.application.quickFixManager | quickFixManager | function applyQuickFix(hapModuleQuickFixFiles: Array\<string>, callback: AsyncCallback\<void>): void;<br>function applyQuickFix(hapModuleQuickFixFiles: Array\<string>): Promise\<void>; | 新增 | 77| ohos.application.quickFixManager | ApplicationQuickFixInfo | readonly hapModuleQuickFixInfo: Array\<HapModuleQuickFixInfo>; | 新增 | 78| ohos.application.quickFixManager | ApplicationQuickFixInfo | readonly quickFixVersionName: string; | 新增 | 79| ohos.application.quickFixManager | ApplicationQuickFixInfo | readonly quickFixVersionCode: number; | 新增 | 80| ohos.application.quickFixManager | ApplicationQuickFixInfo | readonly bundleVersionName: string; | 新增 | 81| ohos.application.quickFixManager | ApplicationQuickFixInfo | readonly bundleVersionCode: number; | 新增 | 82| ohos.application.quickFixManager | ApplicationQuickFixInfo | readonly bundleName: string; | 新增 | 83| ohos.application.quickFixManager | HapModuleQuickFixInfo | readonly quickFixFilePath: string; | 新增 | 84| ohos.application.quickFixManager | HapModuleQuickFixInfo | readonly originHapHash: string; | 新增 | 85| ohos.application.quickFixManager | HapModuleQuickFixInfo | readonly moduleName: string; | 新增 | 86| ProcessData | ProcessData | isKeepAlive: boolean; | 新增 | 87| ProcessData | ProcessData | isContinuousTask: boolean; | 新增 | 88| ProcessData | ProcessData | state: number; | 新增 | 89| ServiceExtensionContext | ServiceExtensionContext | startAbilityByCall(want: Want): Promise\<Caller>; | 新增 | 90| ohos.ability.wantConstant | Action | ACTION_MARKER_DOWNLOAD = "ohos.want.action.marketDownload" | 删除 | 91| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityWindowStageDestroy(ability: Ability): void; | 删除 | 92| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityWindowStageCreate(ability: Ability): void; | 删除 | 93| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | getType?(uri: string, callback: AsyncCallback\<string>): void; | 删除 | 94| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | openFile?(uri: string, mode: string, callback: AsyncCallback\<number>): void; | 删除 | 95| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback\<Array\<string>>): void; | 删除 | 96| applicationInfo | ApplicationInfo | readonly iconId: string; | 废弃 | 97| applicationInfo | ApplicationInfo | readonly labelId: string; | 废弃 | 98| want | Want | entities?: Array\<string>; | 废弃 | 99| want | Want | parameters?: {[key: string]: any}; | 废弃 | 100| want | Want | action?: string; | 废弃 | 101| want | Want | flags?: number; | 废弃 | 102| want | Want | type?: string; | 废弃 | 103| want | Want | uri?: string; | 废弃 | 104| want | Want | abilityName?: string; | 废弃 | 105| want | Want | bundleName?: string; | 废弃 | 106| want | Want | deviceId?: string; | 废弃 |