diff --git a/BUILD.gn b/BUILD.gn index 118fe74e16ef32812c7f41e215f86bb3638cb108..f471b043f89b82d0074af068e51dc437704beda3 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -44,6 +44,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/column.d.ts", "api/@internal/component/ets/column_split.d.ts", "api/@internal/component/ets/common.d.ts", + "api/@internal/component/ets/common_ts_ets_api.d.ts", "api/@internal/component/ets/context_menu.d.ts", "api/@internal/component/ets/counter.d.ts", "api/@internal/component/ets/custom_dialog_controller.d.ts", diff --git a/api/@internal/component/ets/ability_component.d.ts b/api/@internal/component/ets/ability_component.d.ts index 43524e4129ae0b9472a4f6abd95c4f1e001fffab..359bba529746a7a02d5220f5639ddec85edd40b7 100644 --- a/api/@internal/component/ets/ability_component.d.ts +++ b/api/@internal/component/ets/ability_component.d.ts @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Want } from '../../../ability/want'; /** * Provides an interface for the ability component. @@ -44,5 +43,5 @@ declare class AbilityComponentAttribute extends CommonMethod void): AbilityComponentAttribute; } -declare const abilityComponent: AbilityComponentInterface; -declare const abilityComponentInstance: AbilityComponentAttribute; +declare const AbilityComponent: AbilityComponentInterface; +declare const AbilityComponentInstance: AbilityComponentAttribute; diff --git a/api/@internal/component/ets/common_ts_ets_api.d.ts b/api/@internal/component/ets/common_ts_ets_api.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1416b44d7570d2f9fec34036881df542460c28e7 --- /dev/null +++ b/api/@internal/component/ets/common_ts_ets_api.d.ts @@ -0,0 +1,501 @@ +/* + * Copyright (c) 2022 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. + */ + +/** + * Defines the AppStorage interface. + * @since 7 + */ +declare class AppStorage { + /** + * Called when a link is set. + * @since 7 + */ + static Link(propName: string): any; + + /** + * Called when a hyperlink is set. + * @since 7 + */ + static SetAndLink(propName: string, defaultValue: T): SubscribedAbstractProperty; + + /** + * Called when a property is set. + * @since 7 + */ + static Prop(propName: string): any; + + /** + * Called when dynamic properties are set. + * @since 7 + */ + static SetAndProp(propName: string, defaultValue: S): SubscribedAbstractProperty; + + /** + * Called when owning or not. + * @since 7 + */ + static Has(propName: string): boolean; + + /** + * Called when data is obtained. + * @since 7 + */ + static Get(propName: string): T | undefined; + + /** + * Called when setting. + * @since 7 + */ + static Set(propName: string, newValue: T): boolean; + + /** + * Called when setting or creating. + * @since 7 + */ + static SetOrCreate(propName: string, newValue: T): void; + + /** + * Called when a deletion is made. + * @since 7 + */ + static Delete(propName: string): boolean; + + /** + * Called when a dictionary is sorted. + * @since 7 + */ + static Keys(): IterableIterator; + + /** + * Called when a cleanup occurs. + * @since 7 + */ + static staticClear(): boolean; + + /** + * Called when the data can be changed. + * @since 7 + */ + static IsMutable(propName: string): boolean; + + /** + * Called when you check how much data is stored. + * @since 7 + */ + static Size(): number; +} + +/** + * Defines the subscribed abstract property. + * @since 7 + * @systemapi + */ +declare abstract class SubscribedAbstractProperty { + /** + * Setting Subscribers. + * @since 7 + * @systemapi + */ + protected subscribers_: Set; + + /** + * Private user ID. + * @since 7 + * @systemapi + */ + private id_; + + /** + * Private user information. + * @since 7 + * @systemapi + */ + private info_?; + + /** + * @since 7 + * @systemapi + */ + constructor( + /** + * Subscriber IPropertySubscriber. + * @since 7 + * @systemapi + */ + subscribeMe?: IPropertySubscriber, + /** + * Subscriber info. + * @since 7 + * @systemapi + */ + info?: string, + ); + + /** + * Called when the subscriber ID is entered. + * @since 7 + * @systemapi + */ + id(): number; + + /** + * Called when a subscriber information description is entered. + * @since 7 + * @systemapi + */ + info(): string; + + /** + * Called when data is obtained. + * @since 7 + * @systemapi + */ + abstract get(): T; + + /** + * Called when data is created. + * @since 7 + * @systemapi + */ + abstract set(newValue: T): void; + + /** + * Called when a two-way synchronization is created. + * @since 7 + * @systemapi + */ + createTwoWaySync(subscribeMe?: IPropertySubscriber, info?: string): SyncedPropertyTwoWay; + + /** + * Called when a one-way synchronization is created. + * @since 7 + * @systemapi + */ + createOneWaySync(subscribeMe?: IPropertySubscriber, info?: string): SyncedPropertyOneWay; + + /** + * Called when the subscriber is unlinked. + * @since 7 + * @systemapi + */ + unlinkSuscriber(subscriberId: number): void; + + /** + * Called when the notification has changed. + * @since 7 + * @systemapi + */ + protected notifyHasChanged(newValue: T): void; + + /** + * Called when the notification property is read. + * @since 7 + * @systemapi + */ + protected notifyPropertyRead(): void; + + /** + * Called when the number of users is queried. + * @since 7 + * @systemapi + */ + numberOfSubscrbers(): number; +} + +/** + * Provides an interface for attribute subscribers. + * @since 7 + * @systemapi + */ +interface IPropertySubscriber { + /** + * Called when the ID of the property subscriber is queried. + * @since 7 + * @systemapi + */ + id(): number; + + /** + * Provides a single attribute change user interface. + * @since 7 + * @systemapi + */ + aboutToBeDeleted(owningView?: IPropertySubscriber): void; +} + +/** + * Defines the state value. + * @since 7 + * @systemapi + */ +declare class SyncedPropertyTwoWay extends SubscribedAbstractProperty + implements ISinglePropertyChangeSubscriber { + /** + * Sources of synchronization attributes bidirectionally. + * @since 7 + * @systemapi + */ + private source_; + + /** + * constructor parameters. + * @since 7 + * @systemapi + */ + constructor(source: SubscribedAbstractProperty, subscribeMe?: IPropertySubscriber, info?: string); + + /** + * Called when processing information about to be deleted. + * @since 7 + * @systemapi + */ + aboutToBeDeleted(unsubscribeMe?: IPropertySubscriber): void; + + /** + * Information Changed. + * @since 7 + * @systemapi + */ + hasChanged(newValue: T): void; + + /** + * Called when data is obtained. + * @since 7 + * @systemapi + */ + get(): T; + + /** + * Called when data is created. + * @since 7 + * @systemapi + */ + set(newValue: T): void; +} + +/** +* Defines the prop state value. +* @since 7 +* @systemapi +*/ +declare class SyncedPropertyOneWay extends SubscribedAbstractProperty + implements ISinglePropertyChangeSubscriber { + /** + * Pack value for single-item binding. + * @since 7 + * @systemapi + */ + private wrappedValue_; + + /** + * Sources of synchronization attributes bidirectionally. + * @since 7 + * @systemapi + */ + private source_; + + /** + * Constructor parameters. + * @since 7 + * @systemapi + */ + constructor(source: SubscribedAbstractProperty, subscribeMe?: IPropertySubscriber, info?: string); + + /** + * Called when processing information about to be deleted. + * @since 7 + * @systemapi + */ + aboutToBeDeleted(unsubscribeMe?: IPropertySubscriber): void; + + /** + * Information Changed. + * @since 7 + * @systemapi + */ + hasChanged(newValue: T): void; + + /** + * Called when data is obtained. + * @since 7 + * @systemapi + */ + get(): T; + + /** + * Called when data is created. + * @since 7 + * @systemapi + */ + set(newValue: T): void; +} + +/** + * Defines the subscriber. + * @since 7 + * @systemapi + */ +interface ISinglePropertyChangeSubscriber extends IPropertySubscriber { + /** + * Provides a single attribute change user interface. + * @since 7 + * @systemapi + */ + hasChanged(newValue: T): void; +} + +/** + * Defines the Subscribale base class. + * @since 7 + * @systemapi + * @hide + */ +declare abstract class SubscribaleAbstract { + /** + * Returns the ownership attribute set by the. + * @since 7 + * @systemapi + * @hide + */ + private owningProperties_: Set; + + /** + * Constructor. + * @since 7 + * @systemapi + * @hide + */ + constructor(); + + /** + * Called when the notification property has changed. + * @since 7 + * @systemapi + * @hide + */ + protected notifyPropertyHasChanged(propName: string, newValue: any): void; + + /** + * Called when adding an already owned property. + * @since 7 + * @systemapi + * @hide + */ + public addOwningProperty(subscriber: IPropertySubscriber): void; + + /** + * Called when an already owned property is deleted. + * @since 7 + * @systemapi + * @hide + */ + public removeOwningProperty(property: IPropertySubscriber): void; + + /** + * Called when an already owned property is deleted by ID + * @since 7 + * @systemapi + * @hide + */ + public removeOwningPropertyById(subscriberId: number): void; +} + +/** + * Defines the Environment interface. + * @since 7 + */ +declare class Environment { + /** + * Constructor. + * @since 7 + * @systemapi + * @hide + */ + constructor(); + + /** + * Called when a property value is checked. + * @since 7 + */ + static EnvProp(key: string, value: S): boolean; + + /** + * Called when multiple property values are checked. + * @since 7 + */ + static EnvProps( + props: { + key: string; + defaultValue: any; + }[], + ): void; + + /** + * Set the key value. + * @since 7 + */ + static Keys(): Array; +} + +/** + * Defines the PersistentStorage interface. + * @since 7 + */ +declare class PersistentStorage { + /** + * Constructor parameters. + * @since 7 + * @systemapi + * @hide + */ + constructor(appStorage: AppStorage, storage: Storage); + + /** + * Called when a persistence property is stored. + * @since 7 + */ + static PersistProp(key: string, defaultValue: T): void; + + /** + * Called when a property is deleted. + * @since 7 + */ + static DeleteProp(key: string): void; + + /** + * Called when multiple persistence properties are stored. + * @since 7 + */ + static PersistProps( + properties: { + key: string; + defaultValue: any; + }[], + ): void; + + /** + * Set the key value. + * @since 7 + */ + static Keys(): Array; +} + +/** + * Used for ide. + * @since 7 + * @systemapi + * @hide + */ +declare const appStorage: AppStorage; \ No newline at end of file diff --git a/api/@internal/component/ets/state_management.d.ts b/api/@internal/component/ets/state_management.d.ts index 7054019e1aab4c057eb414ec5cd990a9b849a413..fbbbef9b4ecd603f68ed049492c6aa777564f3a1 100644 --- a/api/@internal/component/ets/state_management.d.ts +++ b/api/@internal/component/ets/state_management.d.ts @@ -13,390 +13,6 @@ * limitations under the License. */ -/** - * Provides an interface for attribute subscribers. - * @since 7 - * @systemapi - */ -interface IPropertySubscriber { - /** - * Called when the ID of the property subscriber is queried. - * @since 7 - * @systemapi - */ - id(): number; - - /** - * Provides a single attribute change user interface. - * @since 7 - * @systemapi - */ - aboutToBeDeleted(owningView?: IPropertySubscriber): void; -} - -/** - * Defines the subscriber. - * @since 7 - * @systemapi - */ -interface ISinglePropertyChangeSubscriber extends IPropertySubscriber { - /** - * Provides a single attribute change user interface. - * @since 7 - * @systemapi - */ - hasChanged(newValue: T): void; -} - -/** - * Defines the subscribed abstract property. - * @since 7 - * @systemapi - */ -declare abstract class SubscribedAbstractProperty { - /** - * Setting Subscribers. - * @since 7 - * @systemapi - */ - protected subscribers_: Set; - - /** - * Private user ID. - * @since 7 - * @systemapi - */ - private id_; - - /** - * Private user information. - * @since 7 - * @systemapi - */ - private info_?; - - /** - * @since 7 - * @systemapi - */ - constructor( - /** - * Subscriber IPropertySubscriber. - * @since 7 - * @systemapi - */ - subscribeMe?: IPropertySubscriber, - /** - * Subscriber info. - * @since 7 - * @systemapi - */ - info?: string, - ); - - /** - * Called when the subscriber ID is entered. - * @since 7 - * @systemapi - */ - id(): number; - - /** - * Called when a subscriber information description is entered. - * @since 7 - * @systemapi - */ - info(): string; - - /** - * Called when data is obtained. - * @since 7 - * @systemapi - */ - abstract get(): T; - - /** - * Called when data is created. - * @since 7 - * @systemapi - */ - abstract set(newValue: T): void; - - /** - * Called when a two-way synchronization is created. - * @since 7 - * @systemapi - */ - createTwoWaySync(subscribeMe?: IPropertySubscriber, info?: string): SyncedPropertyTwoWay; - - /** - * Called when a one-way synchronization is created. - * @since 7 - * @systemapi - */ - createOneWaySync(subscribeMe?: IPropertySubscriber, info?: string): SyncedPropertyOneWay; - - /** - * Called when the subscriber is unlinked. - * @since 7 - * @systemapi - */ - unlinkSuscriber(subscriberId: number): void; - - /** - * Called when the notification has changed. - * @since 7 - * @systemapi - */ - protected notifyHasChanged(newValue: T): void; - - /** - * Called when the notification property is read. - * @since 7 - * @systemapi - */ - protected notifyPropertyRead(): void; - - /** - * Called when the number of users is queried. - * @since 7 - * @systemapi - */ - numberOfSubscrbers(): number; -} - -/** - * Defines the state value. - * @since 7 - * @systemapi - */ -declare class SyncedPropertyTwoWay - extends SubscribedAbstractProperty - implements ISinglePropertyChangeSubscriber -{ - /** - * Sources of synchronization attributes bidirectionally. - * @since 7 - * @systemapi - */ - private source_; - - /** - * constructor parameters. - * @since 7 - * @systemapi - */ - constructor(source: SubscribedAbstractProperty, subscribeMe?: IPropertySubscriber, info?: string); - - /** - * Called when processing information about to be deleted. - * @since 7 - * @systemapi - */ - aboutToBeDeleted(unsubscribeMe?: IPropertySubscriber): void; - - /** - * Information Changed. - * @since 7 - * @systemapi - */ - hasChanged(newValue: T): void; - - /** - * Called when data is obtained. - * @since 7 - * @systemapi - */ - get(): T; - - /** - * Called when data is created. - * @since 7 - * @systemapi - */ - set(newValue: T): void; -} - -/** - * Defines the prop state value. - * @since 7 - * @systemapi - */ -declare class SyncedPropertyOneWay - extends SubscribedAbstractProperty - implements ISinglePropertyChangeSubscriber -{ - /** - * Pack value for single-item binding. - * @since 7 - * @systemapi - */ - private wrappedValue_; - - /** - * Sources of synchronization attributes bidirectionally. - * @since 7 - * @systemapi - */ - private source_; - - /** - * Constructor parameters. - * @since 7 - * @systemapi - */ - constructor(source: SubscribedAbstractProperty, subscribeMe?: IPropertySubscriber, info?: string); - - /** - * Called when processing information about to be deleted. - * @since 7 - * @systemapi - */ - aboutToBeDeleted(unsubscribeMe?: IPropertySubscriber): void; - - /** - * Information Changed. - * @since 7 - * @systemapi - */ - hasChanged(newValue: T): void; - - /** - * Called when data is obtained. - * @since 7 - * @systemapi - */ - get(): T; - - /** - * Called when data is created. - * @since 7 - * @systemapi - */ - set(newValue: T): void; -} - -/** - * Defines the AppStorage interface. - * @since 7 - */ -declare class AppStorage { - /** - * Called when a link is set. - * @since 7 - */ - static Link(propName: string): any; - - /** - * Called when a hyperlink is set. - * @since 7 - */ - static SetAndLink(propName: string, defaultValue: T): SubscribedAbstractProperty; - - /** - * Called when a property is set. - * @since 7 - */ - static Prop(propName: string): any; - - /** - * Called when dynamic properties are set. - * @since 7 - */ - static SetAndProp(propName: string, defaultValue: S): SubscribedAbstractProperty; - - /** - * Called when owning or not. - * @since 7 - */ - static Has(propName: string): boolean; - - /** - * Called when data is obtained. - * @since 7 - */ - static Get(propName: string): T | undefined; - - /** - * Called when setting. - * @since 7 - */ - static Set(propName: string, newValue: T): boolean; - - /** - * Called when setting or creating. - * @since 7 - */ - static SetOrCreate(propName: string, newValue: T): void; - - /** - * Called when a deletion is made. - * @since 7 - */ - static Delete(propName: string): boolean; - - /** - * Called when a dictionary is sorted. - * @since 7 - */ - static Keys(): IterableIterator; - - /** - * Called when a cleanup occurs. - * @since 7 - */ - static staticClear(): boolean; - - /** - * Called when the data can be changed. - * @since 7 - */ - static IsMutable(propName: string): boolean; - - /** - * Called when you check how much data is stored. - * @since 7 - */ - static Size(): number; -} - -/** - * Defines the Environment interface. - * @since 7 - */ -declare class Environment { - /** - * Constructor. - * @since 7 - * @systemapi - * @hide - */ - constructor(); - - /** - * Called when a property value is checked. - * @since 7 - */ - static EnvProp(key: string, value: S): boolean; - - /** - * Called when multiple property values are checked. - * @since 7 - */ - static EnvProps( - props: { - key: string; - defaultValue: any; - }[], - ): void; - - /** - * Set the key value. - * @since 7 - */ - static Keys(): Array; -} - /** * Defines the ColorMode of device. * @since 7 @@ -439,49 +55,6 @@ declare enum LayoutDirection { Auto, } -/** - * Defines the PersistentStorage interface. - * @since 7 - */ -declare class PersistentStorage { - /** - * Constructor parameters. - * @since 7 - * @systemapi - * @hide - */ - constructor(appStorage: AppStorage, storage: Storage); - - /** - * Called when a persistence property is stored. - * @since 7 - */ - static PersistProp(key: string, defaultValue: T): void; - - /** - * Called when a property is deleted. - * @since 7 - */ - static DeleteProp(key: string): void; - - /** - * Called when multiple persistence properties are stored. - * @since 7 - */ - static PersistProps( - properties: { - key: string; - defaultValue: any; - }[], - ): void; - - /** - * Set the key value. - * @since 7 - */ - static Keys(): Array; -} - /** * Defines the base class of storage. * @since 7 @@ -529,62 +102,6 @@ declare class Storage { delete(key: string): void; } -/** - * Defines the Subscribale base class. - * @since 7 - * @systemapi - * @hide - */ -declare abstract class SubscribaleAbstract { - /** - * Returns the ownership attribute set by the. - * @since 7 - * @systemapi - * @hide - */ - private owningProperties_: Set; - - /** - * Constructor. - * @since 7 - * @systemapi - * @hide - */ - constructor(); - - /** - * Called when the notification property has changed. - * @since 7 - * @systemapi - * @hide - */ - protected notifyPropertyHasChanged(propName: string, newValue: any): void; - - /** - * Called when adding an already owned property. - * @since 7 - * @systemapi - * @hide - */ - public addOwningProperty(subscriber: IPropertySubscriber): void; - - /** - * Called when an already owned property is deleted. - * @since 7 - * @systemapi - * @hide - */ - public removeOwningProperty(property: IPropertySubscriber): void; - - /** - * Called when an already owned property is deleted by ID - * @since 7 - * @systemapi - * @hide - */ - public removeOwningPropertyById(subscriberId: number): void; -} - /** * Defining LocalStorage. * @since 9 @@ -675,12 +192,4 @@ declare class LocalStorage { * @since 9 */ clear(): boolean; -} - -/** - * Used for ide. - * @since 7 - * @systemapi - * @hide - */ -declare const appStorage: AppStorage; +} \ No newline at end of file diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts index 133cbc64bf8a2c5f60f73c42236e099a92a0c583..2def2921ff3a1310fcf7debf92c7ae355184dd4f 100644 --- a/api/@ohos.bundleState.d.ts +++ b/api/@ohos.bundleState.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback , Callback} from './basic'; /** * Provides methods for managing bundle usage statistics, @@ -174,6 +174,28 @@ declare namespace bundleState { formRecords: Array; } + /** + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + */ + interface BundleActiveEventState { + /** + * the bundle name or system event name. + */ + name: string; + + /** + * the event id. + */ + eventId: number; + + /** + * the the event occurrence number. + */ + count: number; + } + /** * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App @@ -204,6 +226,32 @@ declare namespace bundleState { */ stateType?: number; } + /** + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + */ + interface BundleActiveGroupCallbackInfo { + /* + * the usage old group of the application + */ + appUsageOldGroup: number; + /* + * the usage new group of the application + */ + appUsageNewGroup: number; + /* + * the use id + */ + userId: number; + /* + * the change reason + */ + changeReason: number; + /* + * the bundle name + */ + bundleName: string; + } /** * Checks whether the application with a specified bundle name is in the idle state. @@ -343,6 +391,127 @@ declare namespace bundleState { */ function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; function getRecentlyUsedModules(maxNum?: number): Promise>; + + /** + * Queries the usage priority group of the calling application. + * + *

The priority defined in a priority group restricts the resource usage of an application, + * for example, restricting the running of background tasks.

+ * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param bundleName, name of the application. + * @return Returns the usage priority group of the calling application. + */ + function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; + function queryAppUsagePriorityGroup(bundleName? : string): Promise; + + /** + * Declares group type. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + */ + export enum GroupType { + /** + * Indicates the alive group. + */ + ACTIVE_GROUP_ALIVE = 10, + + /** + * Indicates the daily group. + */ + ACTIVE_GROUP_DAILY = 20, + + /** + * Indicates the fixed group. + */ + ACTIVE_GROUP_FIXED = 30, + + /** + * Indicates the rare group. + */ + ACTIVE_GROUP_RARE = 40, + + /** + * Indicates the limit group. + */ + ACTIVE_GROUP_LIMIT = 50, + + /** + * Indicates the never group. + */ + ACTIVE_GROUP_NEVER = 60 + } + + /** + * set bundle group by bundleName and number. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param bundleName, name of the application. + * @param newGroup,the group of the application whose name is bundleName. + * @return Returns the result of setBundleGroup, true of false. + */ + function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; + function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; + + /** + * register callback to service. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param Callback, callback when application group change,return the BundleActiveGroupCallbackInfo. + * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. the result of AsyncCallback is true or false. + */ + function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; + function registerGroupCallBack(callback: Callback): Promise; + + /** + * unRegister callback from service. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @return Returns the result of unRegisterGroupCallBack, true of false. + */ + function unRegisterGroupCallBack(callback: AsyncCallback): void; + function unRegisterGroupCallBack(): Promise; + + /* + * Queries system event states data within a specified period identified by the start and end time. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. + */ + function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; + function queryBundleActiveEventStates(begin: number, end: number): Promise>; + + /** + * Queries app notification number within a specified period identified by the start and end time. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. + */ + function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; + function queryAppNotificationNumber(begin: number, end: number): Promise>; } export default bundleState;