jsdoc规范整改

Signed-off-by: tangmimi <tangchengkai@huawei.com>
This commit is contained in:
tangmimi 2023-05-04 16:46:15 +08:00
parent 3fe5d002ff
commit 244f6512bd
2 changed files with 322 additions and 115 deletions

View File

@ -195,7 +195,9 @@ declare namespace bundleState {
* Checks whether the application with a specified bundle name is in the idle state.
*
* @param { string } bundleName Indicates the bundle name of the application to query.
* @param { AsyncCallback<boolean> } callback
* @param { AsyncCallback<boolean> } callback - the callback of isIdleState.
* <p> boolean value is true mean the application is idle in a particular period; false mean otherwise.
* The time range of the particular period is defined by the system, which may be hours or days.</p>
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @since 7
* @deprecated since 9
@ -207,9 +209,9 @@ declare namespace bundleState {
* Checks whether the application with a specified bundle name is in the idle state.
*
* @param { string } bundleName Indicates the bundle name of the application to query.
* @returns { Promise<boolean> }
* returns {@code false} otherwise. The time range of the particular period is defined by the system,
* which may be hours or days.
* @returns { Promise<boolean> } the promise returned by isIdleState.
* <p> boolean value is true mean the application is idle in a particular period; false mean otherwise.
* The time range of the particular period is defined by the system, which may be hours or days.</p>
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @since 7
* @deprecated since 9
@ -222,7 +224,8 @@ declare namespace bundleState {
* <p>The priority defined in a priority group restricts the resource usage of an application,
* for example, restricting the running of background tasks. </p>
*
* @param { AsyncCallback<number> } callback
* @param { AsyncCallback<number> } callback - the callback of queryAppUsagePriorityGroup.
* <p> Returns the app group of the calling application.</p>
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @since 7
* @deprecated since 9
@ -235,7 +238,8 @@ declare namespace bundleState {
* <p>The priority defined in a priority group restricts the resource usage of an application,
* for example, restricting the running of background tasks. </p>
*
* @returns { Promise<number> } Returns the usage priority group of the calling application.
* @returns { Promise<number> } the promise returned by queryAppUsagePriorityGroup.
* <p> Returns the app group of the calling application.</p>
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @since 7
* @deprecated since 9
@ -261,7 +265,8 @@ declare namespace bundleState {
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { number } begin Indicates the start time of the query period, in milliseconds.
* @param { number } end Indicates the end time of the query period, in milliseconds.
* @param { AsyncCallback<BundleActiveInfoResponse> } callback
* @param { AsyncCallback<BundleActiveInfoResponse> } callback - the callback of queryBundleStateInfos.
* <p> the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle.</p>
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
* @since 7
@ -277,8 +282,8 @@ declare namespace bundleState {
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { number } begin Indicates the start time of the query period, in milliseconds.
* @param { number } end Indicates the end time of the query period, in milliseconds.
* @returns { Promise<BundleActiveInfoResponse> } Returns the {@link BundleActiveInfoResponse} objects
* containing the usage information about each bundle.
* @returns { Promise<BundleActiveInfoResponse> } the promise returned by queryBundleStatsInfos.
* <p> the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle.</p>
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
* @since 7
@ -348,37 +353,45 @@ declare namespace bundleState {
*
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { IntervalType } byInterval Indicates the interval at which the usage statistics are queried.
* The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY},
* {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}.
* <p>The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY},
* {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}.</p>
* @param { number } begin Indicates the start time of the query period, in milliseconds.
* @param { number } end Indicates the end time of the query period, in milliseconds.
* @param { AsyncCallback<Array<BundleStateInfo>> } callback
* @param { AsyncCallback<Array<BundleStateInfo>> } callback - the callback of usage information about each bundle.
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfoByInterval
*/
function queryBundleStateInfoByInterval(byInterval: IntervalType,
begin: number, end: number, callback: AsyncCallback<Array<BundleStateInfo>>): void;
function queryBundleStateInfoByInterval(
byInterval: IntervalType,
begin: number,
end: number,
callback: AsyncCallback<Array<BundleStateInfo>>
): void;
/**
* Queries usage information about each bundle within a specified period at a specified interval.
*
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { IntervalType } byInterval Indicates the interval at which the usage statistics are queried.
* The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY},
* {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}.
* <p>The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY},
* {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}.</p>
* @param { number } begin Indicates the start time of the query period, in milliseconds.
* @param { number } end Indicates the end time of the query period, in milliseconds.
* @returns { Promise<Array<BundleStateInfo>> }
* @returns { Promise<Array<BundleStateInfo>> } the usage information about each bundle.
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfoByInterval
*/
function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStateInfo>>;
function queryBundleStateInfoByInterval(
byInterval: IntervalType,
begin: number,
end: number
): Promise<Array<BundleStateInfo>>;
/**
* Queries state data of all bundles within a specified period identified by the start and end time.
@ -386,7 +399,7 @@ declare namespace bundleState {
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { number } begin Indicates the start time of the query period, in milliseconds.
* @param { number } end Indicates the end time of the query period, in milliseconds.
* @param { AsyncCallback<Array<BundleActiveState>> } callback
* @param { AsyncCallback<Array<BundleActiveState>> } callback - the state data of all bundles.
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
* @since 7
@ -401,7 +414,7 @@ declare namespace bundleState {
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { number } begin Indicates the start time of the query period, in milliseconds.
* @param { number } end Indicates the end time of the query period, in milliseconds.
* @returns { Promise<Array<BundleActiveState>> }
* @returns { Promise<Array<BundleActiveState>> } the state data of all bundles.
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
* @since 7
@ -415,21 +428,24 @@ declare namespace bundleState {
*
* @param { number } begin Indicates the start time of the query period, in milliseconds.
* @param { number } end Indicates the end time of the query period, in milliseconds.
* @param { AsyncCallback<Array<BundleActiveState>> } callback
* @param { AsyncCallback<Array<BundleActiveState>> } callback - the state data of the current bundle.
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryCurrentBundleEvents
*/
function queryCurrentBundleActiveStates(begin: number,
end: number, callback: AsyncCallback<Array<BundleActiveState>>): void;
function queryCurrentBundleActiveStates(
begin: number,
end: number,
callback: AsyncCallback<Array<BundleActiveState>>
): void;
/**
* Queries state data of the current bundle within a specified period.
*
* @param { number } begin Indicates the start time of the query period, in milliseconds.
* @param { number } end Indicates the end time of the query period, in milliseconds.
* @returns { Promise<Array<BundleActiveState>> }
* @returns { Promise<Array<BundleActiveState>> } the state data of the current bundle.
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9

View File

@ -28,7 +28,6 @@ import { AsyncCallback, Callback } from './@ohos.base';
* @since 9
*/
declare namespace usageStatistics {
/**
* @interface BundleStatsInfo
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
@ -38,44 +37,83 @@ declare namespace usageStatistics {
interface BundleStatsInfo {
/**
* The identifier of BundleStatsInfo.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
id: number;
/**
* The total duration, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
abilityInFgTotalTime?: number;
/**
* The last time when the application was accessed, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
abilityPrevAccessTime?: number;
/**
* The last time when the application was visible in the foreground, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
abilityPrevSeenTime?: number;
/**
* The total duration, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
abilitySeenTotalTime?: number;
/**
* The bundle name of the application.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
bundleName?: string;
/**
* The total duration, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
fgAbilityAccessTotalTime?: number;
/**
* The last time when the foreground application was accessed, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
fgAbilityPrevAccessTime?: number;
/**
* The time of the first bundle usage record in this {@code BundleActiveInfo} object,
* in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
infosBeginTime?: number;
/**
* The time of the last bundle usage record in this {@code BundleActiveInfo} object,
* in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
infosEndTime?: number;
}
@ -89,22 +127,41 @@ declare namespace usageStatistics {
interface HapFormInfo {
/**
* The form name.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
formName: string;
/**
* The form dimension.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
formDimension: number;
/**
* The form id.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
formId: number;
/**
* The last time when the form was accessed, in milliseconds..
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
formLastUsedTime: number;
/**
* The click count of module.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
count: number;
}
@ -118,54 +175,105 @@ declare namespace usageStatistics {
interface HapModuleInfo {
/**
* The device id of module.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
deviceId?: string;
/**
* The bundle name.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
bundleName: string;
/**
* The module name.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
moduleName: string;
/**
* The main ability name of module.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
abilityName?: string;
/**
* The label id of application.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
appLabelId?: number;
/**
* The label id of module.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
labelId?: number;
/**
* The description id of application.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
descriptionId?: number;
/**
* The ability id of main ability.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
abilityLableId?: number;
/**
* The description id of main ability.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
abilityDescriptionId?: number;
/**
* The icon id of main ability.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
abilityIconId?: number;
/**
* The launch count of module.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
launchedCount: number;
/**
* The last time when the module was accessed, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
lastModuleUsedTime: number;
/**
* The form usage record list of current module.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
formRecords: Array<HapFormInfo>;
}
@ -179,16 +287,25 @@ declare namespace usageStatistics {
interface DeviceEventStats {
/**
* The bundle name or system event name.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
name: string;
/**
* The event id.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
eventId: number;
/**
* The the event occurrence number.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
count: number;
}
@ -202,29 +319,53 @@ declare namespace usageStatistics {
interface BundleEvents {
/**
* The usage group of the application.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
appGroup?: number;
/**
* The bundle name.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
bundleName?: string;
/**
* The shortcut ID.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
indexOfLink?: string;
/**
* The class name.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
nameOfClass?: string;
/**
* The time when this state occurred, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
eventOccurredTime?: number;
/**
* The event id.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
eventId?: number;
}
/**
* @interface AppGroupCallbackInfo
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
@ -236,18 +377,22 @@ declare namespace usageStatistics {
* The usage old group of the application
*/
appOldGroup: number;
/*
* The usage new group of the application
*/
appNewGroup: number;
/*
* The use id
*/
userId: number;
/*
* The change reason
*/
changeReason: number;
/*
* The bundle name
*/
@ -262,8 +407,8 @@ declare namespace usageStatistics {
* @param { AsyncCallback<boolean> } callback - the callback of isIdleState.
* <p> boolean value is true mean the application is idle in a particular period; false mean otherwise.
* The time range of the particular period is defined by the system, which may be hours or days.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -281,11 +426,11 @@ declare namespace usageStatistics {
*
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { string } bundleName - Indicates the bundle name of the application to query.
* @returns { Promise<boolean> } the promise returned by queryAppGroup.
* @returns { Promise<boolean> } the promise returned by isIdleState.
* <p> boolean value is true mean the application is idle in a particular period; false mean otherwise.
* The time range of the particular period is defined by the system, which may be hours or days.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -305,9 +450,9 @@ declare namespace usageStatistics {
*
* @param { AsyncCallback<number> } callback - the callback of queryAppGroup.
* <p> Returns the app group of the calling application.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -329,9 +474,9 @@ declare namespace usageStatistics {
*
* @returns { Promise<number> } the promise returned by queryAppGroup.
* <p> Returns the app group of the calling application.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -355,9 +500,9 @@ declare namespace usageStatistics {
* @param { string } bundleName - name of the application.
* @param { AsyncCallback<number> } callback - the callback of queryAppGroup.
* <p> the usage priority group of the calling application.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -373,29 +518,29 @@ declare namespace usageStatistics {
function queryAppGroup(bundleName: string, callback: AsyncCallback<number>): void;
/**
* Queries the usage priority group by bundleName.
* <p>The priority defined in a priority group restricts the resource usage of an application,
* for example, restricting the running of background tasks. </p>
*
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { string } bundleName - name of the application.
* @returns { Promise<number> } the promise returned by queryAppGroup.
* <p> the usage priority group of the calling application.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
* @throws { BusinessError } 10000003 - System service operation failed.
* @throws { BusinessError } 10000004 - IPC failed.
* @throws { BusinessError } 10000005 - Application is not installed.
* @throws { BusinessError } 10000006 - Failed to get the application information.
* @throws { BusinessError } 10100002 - Failed to get the application group information.
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @systemapi Hide this for inner system use.
* @since 9
*/
* Queries the usage priority group by bundleName.
* <p>The priority defined in a priority group restricts the resource usage of an application,
* for example, restricting the running of background tasks. </p>
*
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { string } bundleName - name of the application.
* @returns { Promise<number> } the promise returned by queryAppGroup.
* <p> the usage priority group of the calling application.</p>
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
* @throws { BusinessError } 10000003 - System service operation failed.
* @throws { BusinessError } 10000004 - IPC failed.
* @throws { BusinessError } 10000005 - Application is not installed.
* @throws { BusinessError } 10000006 - Failed to get the application information.
* @throws { BusinessError } 10100002 - Failed to get the application group information.
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @systemapi Hide this for inner system use.
* @since 9
*/
function queryAppGroup(bundleName: string): Promise<number>;
/**
@ -413,13 +558,13 @@ declare namespace usageStatistics {
* <p>This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.</p>
*
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param {number} begin - Indicates the start time of the query period, in milliseconds.
* @param {number} end - Indicates the end time of the query period, in milliseconds.
* @param { number } begin - Indicates the start time of the query period, in milliseconds.
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @param { AsyncCallback<BundleStatsMap> } callback - the callback of queryBundleStatsInfos,
* <p> the {@link BundleStatsMap} objects containing the usage information about each bundle.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -438,13 +583,13 @@ declare namespace usageStatistics {
* <p>This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.</p>
*
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param {number} begin - Indicates the start time of the query period, in milliseconds.
* @param {number} end - Indicates the end time of the query period, in milliseconds.
* @param { number } begin - Indicates the start time of the query period, in milliseconds.
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @returns { Promise<BundleStatsMap> } the promise returned by queryBundleStatsInfos.
* <p> the {@link BundleStatsMap} objects containing the usage information about each bundle.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -469,26 +614,41 @@ declare namespace usageStatistics {
export enum IntervalType {
/**
* Indicates the interval type that will determine the optimal interval based on the start and end time.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
BY_OPTIMIZED = 0,
/**
* Indicates the daily interval.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
BY_DAILY = 1,
/**
* Indicates the weekly interval.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
BY_WEEKLY = 2,
/**
* Indicates the monthly interval.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
BY_MONTHLY = 3,
/**
* Indicates the annually interval.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
*/
BY_ANNUALLY = 4
}
@ -504,9 +664,9 @@ declare namespace usageStatistics {
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @param { AsyncCallback<Array<BundleStatsInfo>> } callback - the callback of queryBundleStatsInfoByInterval.
* <p> the list of {@link BundleStatsInfo} objects containing the usage information about each bundle.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -518,7 +678,12 @@ declare namespace usageStatistics {
* @systemapi Hide this for inner system use.
* @since 9
*/
function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array<BundleStatsInfo>>): void;
function queryBundleStatsInfoByInterval(
byInterval: IntervalType,
begin: number,
end: number,
callback: AsyncCallback<Array<BundleStatsInfo>>
): void;
/**
* Queries usage information about each bundle within a specified period at a specified interval.
@ -531,9 +696,9 @@ declare namespace usageStatistics {
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @returns { Promise<Array<BundleStatsInfo>> } the promise returned by queryBundleStatsInfoByInterval.
* <p> the list of {@link BundleStatsInfo} objects containing the usage information about each bundle.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -545,7 +710,11 @@ declare namespace usageStatistics {
* @systemapi Hide this for inner system use.
* @since 9
*/
function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise<Array<BundleStatsInfo>>;
function queryBundleStatsInfoByInterval(
byInterval: IntervalType,
begin: number,
end: number
): Promise<Array<BundleStatsInfo>>;
/**
* Queries state data of all bundles within a specified period identified by the start and end time.
@ -555,9 +724,9 @@ declare namespace usageStatistics {
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @param { AsyncCallback<Array<BundleEvents>> } callback - the promise returned by queryBundleEvents.
* <p> the list of {@link BundleEvents} objects containing the state data of all bundles.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -579,9 +748,9 @@ declare namespace usageStatistics {
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @returns { Promise<Array<BundleEvents>> } the promise returned by queryBundleEvents.
* <p> the list of {@link BundleEvents} objects containing the state data of all bundles.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -602,9 +771,9 @@ declare namespace usageStatistics {
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @param { AsyncCallback<Array<BundleEvents>> } callback - the callback of queryCurrentBundleEvents.
* <p> the {@link BundleEvents} object Array containing the state data of the current bundle.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -625,9 +794,9 @@ declare namespace usageStatistics {
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @returns { Promise<Array<BundleEvents>> } the promise returned by queryCurrentBundleEvents.
* <p> the {@link BundleEvents} object Array containing the state data of the current bundle.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -648,9 +817,9 @@ declare namespace usageStatistics {
* @param { number } maxNum - Indicates max record number in result, max value is 1000, default value is 1000.
* @param { AsyncCallback<Array<HapModuleInfo>> } callback - the callback of queryModuleUsageRecords.
* <p> the {@link HapModuleInfo} object Array containing the usage data of the modules.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -671,9 +840,9 @@ declare namespace usageStatistics {
* @param { number } maxNum - Indicates max record number in result, max value is 1000, default value is 1000.
* @returns { Promise<Array<HapModuleInfo>> } the promise returned by queryModuleUsageRecords.
* <p> the {@link HapModuleInfo} object Array containing the usage data of the modules.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -693,9 +862,9 @@ declare namespace usageStatistics {
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { AsyncCallback<Array<HapModuleInfo>> } callback - the callback of queryModuleUsageRecords.
* <p> the {@link HapModuleInfo} object Array containing the usage data of the modules.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -715,9 +884,9 @@ declare namespace usageStatistics {
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @returns { Promise<Array<HapModuleInfo>> } the promise returned by queryModuleUsageRecords.
* <p> the {@link HapModuleInfo} object Array containing the usage data of the modules.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -742,32 +911,50 @@ declare namespace usageStatistics {
export enum GroupType {
/**
* Indicates the alive group.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @systemapi Hide this for inner system use.
*/
ALIVE_GROUP = 10,
/**
* Indicates the daily group.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @systemapi Hide this for inner system use.
*/
DAILY_GROUP = 20,
/**
* Indicates the fixed group.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @systemapi Hide this for inner system use.
*/
FIXED_GROUP = 30,
/**
* Indicates the rare group.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @systemapi Hide this for inner system use.
*/
RARE_GROUP = 40,
/**
* Indicates the limit group.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @systemapi Hide this for inner system use.
*/
LIMITED_GROUP = 50,
/**
* Indicates the never group.
*/
* Indicates the never group.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @systemapi Hide this for inner system use.
*/
NEVER_GROUP = 60
}
@ -778,9 +965,9 @@ declare namespace usageStatistics {
* @param { string } bundleName - name of the application.
* @param { GroupType } newGroup - the group of the application whose name is bundleName.
* @param { AsyncCallback<void> } callback - the callback of setAppGroup.
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -801,9 +988,9 @@ declare namespace usageStatistics {
* @param { string } bundleName - name of the application.
* @param { GroupType } newGroup - the group of the application whose name is bundleName.
* @returns { Promise<void> } the promise returned by setAppGroup.
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -822,11 +1009,11 @@ declare namespace usageStatistics {
*
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { Callback<AppGroupCallbackInfo> } groupCallback -
* <p> callback when AppGroupCallbackInfo when the group of app changed.</p>
* <p> callback of AppGroupCallbackInfo when the group of app changed.</p>
* @param { AsyncCallback<void> } callback - the callback of registerAppGroupCallBack.
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -844,11 +1031,11 @@ declare namespace usageStatistics {
*
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { Callback<AppGroupCallbackInfo> } groupCallback -
* <p> callback when AppGroupCallbackInfo when the group of app changed.</p>
* <p> callback of AppGroupCallbackInfo when the group of app changed.</p>
* @returns { Promise<void> } the promise returned by registerAppGroupCallBack.
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -866,9 +1053,9 @@ declare namespace usageStatistics {
*
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @param { AsyncCallback<void> } callback - the callback of unregisterAppGroupCallBack.
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -886,9 +1073,9 @@ declare namespace usageStatistics {
*
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @returns { Promise<void> } the promise returned by unregisterAppGroupCallBack.
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -909,9 +1096,9 @@ declare namespace usageStatistics {
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @param { AsyncCallback<Array<DeviceEventStats>> } callback - the callback of queryDeviceEventStats.
* <p> the {@link DeviceEventStats} object Array containing the event states data.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -933,9 +1120,9 @@ declare namespace usageStatistics {
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @returns { Promise<Array<DeviceEventStats>> } the promise returned by queryDeviceEventStats.
* <p> the {@link DeviceEventStats} object Array containing the event states data.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -957,9 +1144,9 @@ declare namespace usageStatistics {
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @param { AsyncCallback<Array<DeviceEventStats>> } callback - the callback of queryNotificationEventStats.
* <p> the {@link DeviceEventStats} object Array containing the event states data.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -971,7 +1158,11 @@ declare namespace usageStatistics {
* @systemapi Hide this for inner system use.
* @since 9
*/
function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback<Array<DeviceEventStats>>): void;
function queryNotificationEventStats(
begin: number,
end: number,
callback: AsyncCallback<Array<DeviceEventStats>>
): void;
/**
* Queries app notification number within a specified period identified by the start and end time.
@ -981,9 +1172,9 @@ declare namespace usageStatistics {
* @param { number } end - Indicates the end time of the query period, in milliseconds.
* @returns { Promise<Array<DeviceEventStats>> } the promise returned by queryNotificationEventStats.
* <p> the {@link DeviceEventStats} object Array containing the event states data.</p>
* @throws { BusinessError } 201 - Parameter error.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Permission denied.
* @throws { BusinessError } 401 - Parameter error.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 10000001 - Memory operation failed.
* @throws { BusinessError } 10000002 - Parcel operation failed.
@ -998,4 +1189,4 @@ declare namespace usageStatistics {
function queryNotificationEventStats(begin: number, end: number): Promise<Array<DeviceEventStats>>;
}
export default usageStatistics;
export default usageStatistics;