From 81207f88ff13961413023bb439cd5f05d0e673a6 Mon Sep 17 00:00:00 2001 From: njupthan Date: Tue, 8 Feb 2022 21:11:33 +0800 Subject: [PATCH] update d.ts file Signed-off-by: njupthan --- api/@ohos.application.abilityManager.d.ts | 50 ++++++++++++++- api/@ohos.application.appManager.d.ts | 13 ++++ api/application/AbilityRunningInfo.d.ts | 69 ++++++++++++++++++++ api/application/ExtensionRunningInfo.d.ts | 77 +++++++++++++++++++++++ api/application/ProcessRunningInfo.d.ts | 52 +++++++++++++++ 5 files changed, 259 insertions(+), 2 deletions(-) create mode 100644 api/application/AbilityRunningInfo.d.ts create mode 100644 api/application/ExtensionRunningInfo.d.ts create mode 100644 api/application/ProcessRunningInfo.d.ts diff --git a/api/@ohos.application.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts index 5ced77d93e..5f996d8366 100644 --- a/api/@ohos.application.abilityManager.d.ts +++ b/api/@ohos.application.abilityManager.d.ts @@ -14,7 +14,9 @@ */ import { AsyncCallback } from './basic'; -import Configuration from './@ohos.application.Configuration'; +import { Configuration } from './@ohos.application.Configuration'; +import { AbilityRunningInfo } from './application/AbilityRunningInfo'; +import { ExtensionRunningInfo } from './application/ExtensionRunningInfo'; /** * The class of an ability manager. @@ -25,6 +27,22 @@ import Configuration from './@ohos.application.Configuration'; * @permission N/A */ declare namespace abilityManager { + + /** + * @name AbilityState + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ + export enum AbilityState { + INITIAL = 0, + FOREGROUND = 9, + BACKGROUND = 10, + FOREGROUNDING = 11, + BACKGROUNDING = 12 + } + /** * Updates the configuration by modifying the configuration. * @@ -37,4 +55,32 @@ declare namespace abilityManager { */ function updateConfiguration(config: Configuration, callback: AsyncCallback): void; function updateConfiguration(config: Configuration): Promise; -} \ No newline at end of file + + /** + * Get information about running abilitys + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @SysCap AAFwk + * @param config Indicates the new configuration. + * @systemapi Hide this for inner system use. + * @return - + */ + function getAbilityRunningInfos(): Promise>; + function getAbilityRunningInfos(callback: AsyncCallback>): void; + + /** + * Get information about running extensions + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @SysCap AAFwk + * @param config Indicates the new configuration. + * @systemapi Hide this for inner system use. + * @return - + */ + function getExtensionRunningInfos(upperLimit: number): Promise>; + function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void; +} + +export default abilityManager; \ No newline at end of file diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts index 77b341b2cc..6a1d24787a 100644 --- a/api/@ohos.application.appManager.d.ts +++ b/api/@ohos.application.appManager.d.ts @@ -16,6 +16,7 @@ import { AsyncCallback } from './basic'; import ApplicationStateObserver from './application/ApplicationStateObserver'; import AppStateData from './application/AppStateData'; +import { ProcessRunningInfo } from './application/ProcessRunningInfo'; /** * This module provides the function of app manager service. @@ -86,6 +87,18 @@ declare namespace appManager { */ function isRunningInStabilityTest(callback: AsyncCallback): void; function isRunningInStabilityTest(): Promise; + + /** + * Get information about running processes + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @SysCap appexecfwk + * @systemapi Hide this for inner system use. + * @return - + */ + function getProcessRunningInfos(): Promise>; + function getProcessRunningInfos(callback: AsyncCallback>): void; } export default appManager; diff --git a/api/application/AbilityRunningInfo.d.ts b/api/application/AbilityRunningInfo.d.ts new file mode 100644 index 0000000000..d9aa19f856 --- /dev/null +++ b/api/application/AbilityRunningInfo.d.ts @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ElementName } from '../bundle/elementName'; +import abilityManager from '../@ohos.application.abilityManager'; + +/** + * The class of an ability running information. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export interface AbilityRunningInfo { + /** + * @default ability element name + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + ability: ElementName; + + /** + * @default process id + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + pid: number; + + /** + * @default user id + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + uid: number; + + /** + * @default the name of the process + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + processName: string; + + /** + * @default ability start time + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + startTime: number; + + /** + * @default Enumerates state of the ability state info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + abilityState: abilityManager.AbilityState; +} \ No newline at end of file diff --git a/api/application/ExtensionRunningInfo.d.ts b/api/application/ExtensionRunningInfo.d.ts new file mode 100644 index 0000000000..5cf4804550 --- /dev/null +++ b/api/application/ExtensionRunningInfo.d.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ElementName } from '../bundle/elementName'; +import bundle from '../@ohos.bundle'; + +/** + * The class of an extension running information. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export interface ExtensionRunningInfo { + /** + * @default Indicates the extension of the extension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + extension: ElementName; + + /** + * @default process id + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + pid: number; + + /** + * @default user id + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + uid: number; + + /** + * @default the name of the process + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + processName: string; + + /** + * @default ability start time + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + startTime: number; + + /** + * @default All package names under the current process + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + clientPackage: Array; + + /** + * @default Enumerates types of the entension info + * @since 9 + * @SysCap SystemCapability.Appexecfwk + * @StageModelOnly + */ + type: bundle.ExtensionAbilityType; +} \ No newline at end of file diff --git a/api/application/ProcessRunningInfo.d.ts b/api/application/ProcessRunningInfo.d.ts new file mode 100644 index 0000000000..db9414888a --- /dev/null +++ b/api/application/ProcessRunningInfo.d.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The class of an process running information. + * + * @since 8 + * @sysCap AAFwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export interface ProcessRunningInfo { + /** + * @default process id + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + pid: number; + + /** + * @default user id + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + uid: number; + + /** + * @default the name of the process + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + processName: string; + + /** + * @default an array of the bundleNames running in the process + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + bundleNames: Array; +} \ No newline at end of file -- Gitee