mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-11-27 17:31:12 +00:00
commit
b35f0929f1
53
api/@ohos.app.ability.appManager.d.ts
vendored
53
api/@ohos.app.ability.appManager.d.ts
vendored
@ -25,6 +25,8 @@ import * as _AbilityStateData from './application/AbilityStateData';
|
||||
import * as _AppStateData from './application/AppStateData';
|
||||
import type * as _ProcessData from './application/ProcessData';
|
||||
import { ProcessInformation as _ProcessInformation } from './application/ProcessInformation';
|
||||
import * as _AbilityFirstFrameStateObserver from './application/AbilityFirstFrameStateObserver';
|
||||
import * as _AbilityFirstFrameStateData from './application/AbilityFirstFrameStateData';
|
||||
|
||||
/**
|
||||
* This module provides the function of app manager service.
|
||||
@ -239,6 +241,23 @@ declare namespace appManager {
|
||||
* @since 11
|
||||
*/
|
||||
function on(type: 'appForegroundState', observer: AppForegroundStateObserver): void;
|
||||
|
||||
/**
|
||||
* Register ability first frame state observe.
|
||||
*
|
||||
* @permission ohos.permission.RUNNING_STATE_OBSERVER
|
||||
* @param { 'abilityFirstFrameState' } type - The ability first frame drawing state.
|
||||
* @param { AbilityFirstFrameStateObserver } observer - The ability first frame state observer.
|
||||
* @param { string } [bundleName] - The target bundle name.
|
||||
* @throws { BusinessError } 201 - Permission denied.
|
||||
* @throws { BusinessError } 202 - Not system application.
|
||||
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
|
||||
* @throws { BusinessError } 16000050 - Internal error.
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
function on(type: 'abilityFirstFrameState', observer: AbilityFirstFrameStateObserver, bundleName?: string): void;
|
||||
|
||||
/**
|
||||
* Unregister application state observer.
|
||||
@ -289,6 +308,22 @@ declare namespace appManager {
|
||||
* @since 11
|
||||
*/
|
||||
function off(type: 'appForegroundState', observer?: AppForegroundStateObserver): void;
|
||||
|
||||
/**
|
||||
* Unregister ability first frame state observer.
|
||||
*
|
||||
* @permission ohos.permission.RUNNING_STATE_OBSERVER
|
||||
* @param { 'abilityFirstFrameState' } type - The ability first frame drawing state.
|
||||
* @param { AbilityFirstFrameStateObserver } [observer] - The ability first frame state observer.
|
||||
* @throws { BusinessError } 201 - Permission denied.
|
||||
* @throws { BusinessError } 202 - Not system application.
|
||||
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
|
||||
* @throws { BusinessError } 16000050 - Internal error.
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
function off(type: 'abilityFirstFrameState', observer?: AbilityFirstFrameStateObserver): void;
|
||||
|
||||
/**
|
||||
* getForegroundApplications.
|
||||
@ -794,6 +829,24 @@ declare namespace appManager {
|
||||
* @since 10
|
||||
*/
|
||||
export type ProcessData = _ProcessData.default;
|
||||
|
||||
/**
|
||||
* The ability first frame state observer.
|
||||
*
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
export type AbilityFirstFrameStateObserver = _AbilityFirstFrameStateObserver.default;
|
||||
|
||||
/**
|
||||
* The class of an ability first frame state data.
|
||||
*
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
export type AbilityFirstFrameStateData = _AbilityStateData.default;
|
||||
}
|
||||
|
||||
export default appManager;
|
||||
|
81
api/application/AbilityFirstFrameStateData.d.ts
vendored
Normal file
81
api/application/AbilityFirstFrameStateData.d.ts
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) 2024 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @kit AbilityKit
|
||||
*/
|
||||
|
||||
/**
|
||||
* The ability first frame state data.
|
||||
*
|
||||
* @typedef AbilityFirstFrameStateData
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
export interface AbilityFirstFrameStateData {
|
||||
/**
|
||||
* The bundle name.
|
||||
*
|
||||
* @type { string }
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
bundleName: string;
|
||||
|
||||
/**
|
||||
* The module name.
|
||||
*
|
||||
* @type { string }
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
moduleName: string;
|
||||
|
||||
/**
|
||||
* The ability name.
|
||||
*
|
||||
* @type { string }
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
abilityName: string;
|
||||
|
||||
/**
|
||||
* The index of DLP sandbox.
|
||||
*
|
||||
* @type { number }
|
||||
* @default 0
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
appIndex: number;
|
||||
|
||||
/**
|
||||
* The entry ability of application is cold-start return true, others false.
|
||||
*
|
||||
* @type { boolean }
|
||||
* @default false
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
isColdStart: boolean;
|
||||
}
|
42
api/application/AbilityFirstFrameStateObserver.d.ts
vendored
Normal file
42
api/application/AbilityFirstFrameStateObserver.d.ts
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2024 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 AbilityFirstFrameStateData from './AbilityFirstFrameStateData';
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @kit AbilityKit
|
||||
*/
|
||||
|
||||
/**
|
||||
* The ability first frame state observer.
|
||||
*
|
||||
* @interface AbilityFirstFrameStateObserver
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
export interface AbilityFirstFrameStateObserver {
|
||||
|
||||
/**
|
||||
* Will be called when an ability first frame drawing completed.
|
||||
*
|
||||
* @param { AbilityFirstFrameStateData } data - The ability first frame state data.
|
||||
* @syscap SystemCapability.Ability.AbilityRuntime.Core
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
onAbilityFirstFrameDrawn(data: AbilityFirstFrameStateData): void;
|
||||
}
|
Loading…
Reference in New Issue
Block a user