Merge branch 'master' of gitee.com:openharmony/interface_sdk-js into master

Signed-off-by: xuzhihao <xuzhihao16@huawei.com>
This commit is contained in:
xuzhihao 2023-04-18 06:47:04 +00:00 committed by Gitee
commit 8f79fa872f
271 changed files with 12378 additions and 7263 deletions

View File

@ -1139,6 +1139,20 @@ declare class CanvasRenderer extends CanvasPath {
* @form
* @since 9
*/
/**
* Creates a template object using the specified image
* @param image Objects as duplicate image sources
* @param repetition Specifies how to repeat images. The following four modes are supported:
* "repeat": Repeated images in both X and Y directions
* "repeat-x": Repeated images in the X-axis direction but not in the Y-axis direction
* "repeat-y": The image is repeated in the Y axis direction, and the image is not repeated in the X axis direction.
* "no-repeat": Non-repeating images in both X and Y directions
* "clamp": Replicate the edge color if the shader draws outside of its original bounds.
* "mirror": Repeat the shader's image horizontally and vertically, alternating mirror images so that adjacent images always seam.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @form
* @since 10
*/
createPattern(image: ImageBitmap, repetition: string | null): CanvasPattern | null;
/**
@ -1164,6 +1178,22 @@ declare class CanvasRenderer extends CanvasPath {
*/
createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
/**
* Creates a gradient around a point with given coordinates.
* @param startAngle The angle at which to begin the gradient, in radians.
* Angle measurements start horizontally the right of the center and move around clockwise.
* @param x The x-axis coordinate of the center of the gradient.
* @param y The y-axis coordinate of the center of the gradient.
* @returns CanvasGradient A CanvasGradient object that draws a conic gradient around the given coordinates.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
createConicGradient(
startAngle: number,
x: number,
y: number
): CanvasGradient;
/**
* Provides filter effects such as blur and grayscale. You can set the following filter effects:
* blur(<length>): Adds a Gaussian blur effect to the drawing

View File

@ -2146,28 +2146,60 @@ declare interface CustomPopupOptions {
}
/**
* Defines the menu options.
* Defines the context menu options.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
declare interface MenuOptions {
declare interface ContextMenuOptions {
/**
* Sets the title of the menu window.
* @type { ResourceStr }
* @default -
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
title?: ResourceStr;
/**
* Sets the position offset of the menu window.
* @type { Position }
* Sets the position offset of the context menu window.
* @type { ?Position }
* @default -
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
offset?: Position;
/**
* Sets the placement of the context menu window.
* @type { ?Placement }
* @default -
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
placement?: Placement;
/**s
* Callback function when the context menu appears.
* @type { ?() => void }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
onAppear?: () => void;
/**
* Callback function when the context menu disappear.
* @type { ?() => void }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
onDisappear?: () => void;
}
/**
* Defines the menu options.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
declare interface MenuOptions extends ContextMenuOptions {
/**
* Sets the title of the menu window.
* @type { ?ResourceStr }
* @default -
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
title?: ResourceStr;
}
/**
@ -3328,7 +3360,15 @@ declare class CommonMethod<T> {
* ContextMenu control
* @since 8
*/
bindContextMenu(content: CustomBuilder, responseType: ResponseType): T;
/**
* ContextMenu control
* @param { CustomBuilder } content - Indicates the content of context menu.
* @param { responseType } responseType - Indicates response type of context menu.
* @param { ContextMenuOptions } options - Indicates the options of context menu.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
bindContextMenu(content: CustomBuilder, responseType: ResponseType, options?: ContextMenuOptions): T;
/**
* Bind content cover

View File

@ -66,6 +66,24 @@ declare class CounterAttribute extends CommonMethod<CounterAttribute> {
* @since 9
*/
onDec(event: () => void): CounterAttribute;
/**
* Indicates whether the decrease button of counter component is available or not.
* @param { boolean } value - If true, the decrease button is available and can respond to operations such as clicking. If false, click operations are not responded.
* @returns { CounterAttribute } The attribute of the counter.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
enableDec(value: boolean): CounterAttribute;
/**
* Indicates whether the increase button of counter component is available or not.
* @param { boolean } value - If true, the increase button is available and can respond to operations such as clicking. If false, click operations are not responded.
* @returns { CounterAttribute } The attribute of the counter.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
enableInc(value: boolean): CounterAttribute;
}
/**
@ -88,4 +106,4 @@ declare const CounterInstance: CounterAttribute;
* @form
* @since 9
*/
declare const Counter: CounterInterface;
declare const Counter: CounterInterface;

View File

@ -2781,3 +2781,38 @@ declare enum CtrlKey {
*/
ALT = 2,
}
/**
* The alignment of ImageSpan
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
declare enum ImageSpanAlignment {
/**
* Indicating that the bottom of the ImageSpan should be aligned with the baseline of the surrounding text.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
BASELINE,
/**
* Indicating that the bottom of the ImageSpan should be aligned with the bottom of the surrounding text.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
BOTTOM,
/**
* Indicating that the center of the ImageSpan should be aligned with the center of the surrounding text.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
CENTER,
/**
* Indicating that the top of the ImageSpan should be aligned with the top of the surrounding text.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
TOP,
}

View File

@ -186,6 +186,16 @@ declare class GridAttribute extends CommonMethod<GridAttribute> {
onItemDrop(
event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void,
): GridAttribute;
/**
* Called when the sliding effect is set.
* @param { EdgeEffect } value - Scroll effect. For details, see EdgeEffect.
* @default EdgeEffect.None
* @returns { GridAttribute } The attribute of the grid
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
edgeEffect(value: EdgeEffect): GridAttribute;
}
/**
@ -198,4 +208,4 @@ declare const Grid: GridInterface;
* Defines Grid Component instance.
* @since 7
*/
declare const GridInstance: GridAttribute;
declare const GridInstance: GridAttribute;

View File

@ -0,0 +1,71 @@
/*
* Copyright (c) 2023 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.
*/
/**
* Provide image decoration in the text component.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
interface ImageSpanInterface {
/**
* Called when image is entered in span.
* @param { ResourceStr | PixelMap } - The image resource.
* @returns { ImageSpanAttribute } The attribute of the image span.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
(value: ResourceStr | PixelMap): ImageSpanAttribute;
}
/**
* Define the ImageSpan attribute functions.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
declare class ImageSpanAttribute extends CommonMethod<ImageSpanAttribute> {
/**
* Called when the alignment of image span is set.
* @param { ImageSpanAlignment } value - The alignment type of image span.
* @default ImageSpanAlignment.BOTTOM
* @returns { ImageSpanAttribute } The attribute of the image span.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
verticalAlign(value: ImageSpanAlignment): ImageSpanAttribute;
/**
* Sets the zoom type of an image.
* @param { ImageFit } value - Image display mode.
* @default ImageFit.Cover
* @returns { ImageSpanAttribute } The attribute of the image span.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
objectFit(value: ImageFit): ImageSpanAttribute;
}
/**
* Defines ImageSpan Component instance.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
declare const ImageSpan: ImageSpanInterface;
/**
* Defines ImageSpan Component.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
declare const ImageSpanInstance: ImageSpanAttribute;

View File

@ -239,6 +239,15 @@ declare class TextAttribute extends CommonMethod<TextAttribute> {
* @since 10
*/
heightAdaptivePolicy(value: TextHeightAdaptivePolicy): TextAttribute;
/**
* Specify the indentation of the first line in a text-block.
* @param { Length } value - The length of text indent.
* @returns { TextAttribute } The attribute of the text.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
textIndent(value: Length): TextAttribute;
}
/**

View File

@ -146,6 +146,14 @@ declare class TextAreaAttribute extends CommonMethod<TextAreaAttribute> {
*/
onChange(callback: (value: string) => void): TextAreaAttribute;
/**
* Called when judging whether the text editing change finished.
* @param {boolean} isEditing - Triggered when the text area status changes. If the value of isEditing is true, text area is in progress.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 10
*/
onEditChange(callback: (isEditing: boolean) => void): TextAreaAttribute;
/**
* Called when using the Clipboard menu
* @since 7

View File

@ -93,6 +93,132 @@ export declare class console {
* @since 9
*/
static error(message: string, ...arguments: any[]): void;
/**
* Prints a message if value is false or omitted.
* @param { Object } value The value tested for being truthy.
* @param { Object[] } arguments Used as error message to print.
* @static
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static assert(value?: Object, ...arguments: Object[]): void;
/**
* Maintains an internal counter specific to label and print the number of times
* console.count() has been called with the given label.
* @param { string } label Counter name. Default: "default".
* @static
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static count(label?: string): void;
/**
* Reset the internal counter specific to label.
* @param { string } label Counter name. Default: "default".
* @static
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static countReset(label?: string): void;
/**
* Prints properties of the specified JavaScript object.
* @param { Object } dir A JavaScript object whose properties should be output.
* @static
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static dir(dir?: Object): void;
/**
* This method calls console.log() passing it the arguments received.
* This method does not produce any XML formatting.
* @param { Object[] } arguments Text to print.
* @static
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static dirxml(...arguments: Object[]): void;
/**
* Creates a new inline group, causing any subsequent console messages to be indented by an additional level.
* @param { Object[] } arguments messages to print first.
* @static
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static group(...arguments: Object[]): void;
/**
* Same as console.group()
* @param { Object[] } arguments messages to print first.
* @static
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static groupCollapsed(...arguments: Object[]): void;
/**
* Exit current inline group.
* @static
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static groupEnd(): void;
/**
* Prints tabular data as a table.
* @param { Object } tableData tabular data.
* @static
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static table(tableData?: Object): void;
/**
* Start a timer.
* @param { string } label Timer name. Default: "default".
* @static
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static time(label?: string): void;
/**
* End a timer and print time duration.
* @param { string } label Timer name. Default: "default".
* @static
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static timeEnd(label?: string): void;
/**
* Print the elapsed time and other data arguments.
* @param { string } label Timer name. Default: "default".
* @param { Object[] } arguments Text to print.
* @static
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static timeLog(label?: string, ...arguments: Object[]): void;
/**
* Prints stack information for the current code location.
* @param { Object[] } arguments message to print.
* @static
* @syscap SystemCapability.Utils.Lang
* @since 10
*/
static trace(...arguments: Object[]): void;
}
/**

View File

@ -25,7 +25,7 @@ import rdb from "../../@ohos.data.rdb";
import rpc from "../../@ohos.rpc";
import resourceManager from "../../@ohos.resourceManager";
import { PacMap } from "../../ability/dataAbilityHelper";
import { AsyncCallback } from "../../basic";
import { AsyncCallback } from "../../@ohos.base";
/**
* interface of form lifecycle.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import ExtensionContext from './application/ExtensionContext';
/**

View File

@ -29,6 +29,14 @@ export default interface InputMethodSubtype {
*/
readonly label?: string;
/**
* The label id of input method subtype.
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 10
*/
readonly labelId?: number;
/**
* The name of input method.
*
@ -88,8 +96,16 @@ export default interface InputMethodSubtype {
/**
* The extra info of input method subtype.
*
* @type { object }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
extra: object;
/**
* The extra info of input method subtype.
*
* @type { ?object }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 10
*/
extra?: object;
}

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { Callback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { Callback } from './@ohos.base';
import Want from './@ohos.app.ability.Want';
import { StartAbilityParameter } from './ability/startAbilityParameter';
import { AbilityResult } from './ability/abilityResult';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { StartAbilityParameter } from './ability/startAbilityParameter';
import { DataAbilityHelper } from './ability/dataAbilityHelper';
import { NotificationRequest } from './notification/notificationRequest';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
import { Permissions } from './permissions';
import { Context } from './application/Context';
import { PermissionRequestResult } from './security/PermissionRequestResult';

View File

@ -13,23 +13,30 @@
* limitations under the License.
*/
import { GesturePoint } from "./@ohos.accessibility.GesturePoint";
import type { GesturePoint } from './@ohos.accessibility.GesturePoint';
/**
* Indicates the path of the gesture.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
export declare class GesturePath {
constructor(durationTime: number);
/**
* Indicates the position of the points that make up the gesture.
* @type {Array<GesturePoint>}
*/
points: Array<GesturePoint>;
/**
* Indicates the duration of the gesture.
* @type {number}
*/
durationTime: number;
}
constructor(durationTime: number);
/**
* Indicates the position of the points that make up the gesture.
*
* @type { Array<GesturePoint> }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
points: Array<GesturePoint>;
/**
* Indicates the duration of the gesture.
*
* @type { number }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
durationTime: number;
}

View File

@ -15,19 +15,26 @@
/**
* Indicates the point of the gesture.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
export declare class GesturePoint {
constructor(positionX: number, positionY: number);
/**
* Indicates the X coordinate of point.
* @type {number}
*/
positionX: number;
/**
* Indicates the Y coordinate of point.
* @type {number}
*/
positionY: number;
}
constructor(positionX: number, positionY: number);
/**
* Indicates the X coordinate of point.
*
* @type { number }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
positionX: number;
/**
* Indicates the Y coordinate of point.
*
* @type { number }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
positionY: number;
}

View File

@ -13,140 +13,300 @@
* limitations under the License.
*/
import accessibility from './@ohos.accessibility';
import { AsyncCallback, Callback } from './basic';
import type accessibility from './@ohos.accessibility';
import type { AsyncCallback, Callback } from './@ohos.base';
/**
* Configuration of the accessibility.
*
* @since 9
* @namespace config
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
declare namespace config {
/**
* Indicates the configuration of high-contrast text.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var highContrastText: Config<boolean>;
/**
* Indicates the configuration of invert color.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var invertColor: Config<boolean>;
/**
* Indicates the configuration of daltonization color filter.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var daltonizationColorFilter: Config<DaltonizationColorFilter>;
/**
* Indicates the configuration of content timeout.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var contentTimeout: Config<number>;
/**
* Indicates the configuration of animation state.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var animationOff: Config<boolean>;
/**
* Indicates the configuration of brightness discount.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var brightnessDiscount: Config<number>;
/**
* Indicates the configuration of mouse key state.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var mouseKey: Config<boolean>;
/**
* Indicates the configuration of mouse auto click.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var mouseAutoClick: Config<number>;
/**
* Indicates the configuration of short key state.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var shortkey: Config<boolean>;
/**
* Indicates the configuration of short key target.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var shortkeyTarget: Config<string>;
/**
* Indicates the configuration of captions state.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var captions: Config<boolean>;
/**
* Indicates the configuration of captions style.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
var captionsStyle: Config<accessibility.CaptionsStyle>;
/**
* Enable the accessibility extension ability.
* @param name Indicates the accessibility extension name, in "bundleName/abilityName" format.
* @param capability Indicates the ability.
*
* @param { string } name Indicates the accessibility extension name, in "bundleName/abilityName" format.
* @param { Array<accessibility.Capability> } capability Indicates the ability.
* @returns { Promise<void> }
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system App.
* @throws { BusinessError } 401 - Input parameter error.
* @throws { BusinessError } 9300001 - Invalid bundle name or ability name.
* @throws { BusinessError } 9300002 - Target ability already enabled.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
function enableAbility(name: string, capability: Array<accessibility.Capability>): Promise<void>;
function enableAbility(name: string, capability: Array<accessibility.Capability>, callback: AsyncCallback<void>): void;
/**
* Enable the accessibility extension ability.
*
* @param { string } name Indicates the accessibility extension name, in "bundleName/abilityName" format.
* @param { Array<accessibility.Capability> } capability Indicates the ability.
* @param { AsyncCallback<void> } callback
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system App.
* @throws { BusinessError } 401 - Input parameter error.
* @throws { BusinessError } 9300001 - Invalid bundle name or ability name.
* @throws { BusinessError } 9300002 - Target ability already enabled.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
function enableAbility(
name: string,
capability: Array<accessibility.Capability>,
callback: AsyncCallback<void>
): void;
/**
* Disable the accessibility extension ability.
* @param name Indicates the accessibility extension name, in "bundleName/abilityName" format.
*
* @param { string } name Indicates the accessibility extension name, in "bundleName/abilityName" format.
* @returns { Promise<void> }
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system App.
* @throws { BusinessError } 401 - Input parameter error.
* @throws { BusinessError } 9300001 - Invalid bundle name or ability name.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
function disableAbility(name: string): Promise<void>;
/**
* Disable the accessibility extension ability.
*
* @param { string } name Indicates the accessibility extension name, in "bundleName/abilityName" format.
* @param { AsyncCallback<void> } callback
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system App.
* @throws { BusinessError } 401 - Input parameter error.
* @throws { BusinessError } 9300001 - Invalid bundle name or ability name.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
function disableAbility(name: string, callback: AsyncCallback<void>): void;
/**
* Register the listener that watches for changes in the enabled status of accessibility extensions.
* @param type Indicates the type of event.
* @param callback Indicates the listener.
*
* @param { 'enabledAccessibilityExtensionListChange' } type Indicates the type of event.
* @param { Callback<void> } callback Indicates the listener.
* @throws { BusinessError } 202 - Not system App.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
function on(type: 'enabledAccessibilityExtensionListChange', callback: Callback<void>): void;
/**
* Unregister listener that watches for changes in the enabled status of accessibility extensions.
* @param type Indicates the type of event.
* @param callback Indicates the listener.
*
* @param { 'enabledAccessibilityExtensionListChange' } type Indicates the type of event.
* @param { Callback<void> } callback Indicates the listener.
* @throws { BusinessError } 202 - Not system App.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
function off(type: 'enabledAccessibilityExtensionListChange', callback?: Callback<void>): void;
/**
* Indicates setting, getting, and listening to changes in configuration.
*
* @typedef Config
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
interface Config<T> {
/**
* Setting configuration value.
* @param value Indicates the value.
*
* @param { T } value Indicates the value.
* @returns { Promise<void> }
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system App.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
set(value: T): Promise<void>;
/**
* Setting configuration value.
*
* @param { T } value Indicates the value.
* @param { AsyncCallback<void> } callback
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system App.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
set(value: T, callback: AsyncCallback<void>): void;
/**
* Getting configuration value.
*
* @returns { Promise<T> }
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system App.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
get(): Promise<T>;
/**
* Getting configuration value.
*
* @param { AsyncCallback<T> } callback
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system App.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
get(callback: AsyncCallback<T>): void;
/**
* Register the listener to listen for configuration changes.
* @param callback Indicates the listener.
*
* @param { Callback<T> } callback Indicates the listener.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system App.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
on(callback: Callback<T>): void;
/**
* Unregister the listener to listen for configuration changes.
* @param callback Indicates the listener.
*
* @param { Callback<T> } callback Indicates the listener.
* @throws { BusinessError } 202 - Not system App.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @systemapi
* @since 9
*/
off(callback?: Callback<T>): void;
}
/**
* Indicates the type of daltonization color filter.
*
* @systemapi
*/
type DaltonizationColorFilter = 'Normal' | 'Protanomaly' | 'Deuteranomaly' | 'Tritanomaly';
}
export default config;
export default config;

View File

@ -13,25 +13,28 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { Callback } from './basic';
import type { AsyncCallback } from './@ohos.base';
import type { Callback } from './@ohos.base';
/**
* Accessibility
* @name Accessibility
* @since 7
*
* @namespace accessibility
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
declare namespace accessibility {
/**
* The type of the Ability app.
*
* @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
/**
* The type of the Ability app.
* @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all' }
*
* @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all' }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
@ -39,6 +42,7 @@ declare namespace accessibility {
/**
* The action that the ability can execute.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
@ -48,6 +52,8 @@ declare namespace accessibility {
/**
* The type of the accessibility event.
* windowsChange/windowContentChange/windowStateChange/announcement/notificationChange/textTraversedAtMove
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
@ -57,6 +63,8 @@ declare namespace accessibility {
/**
* The change type of the windowsChange event.
* It's used when received the {@code windowsChange} event.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
@ -64,6 +72,7 @@ declare namespace accessibility {
/**
* The type of the ability state.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
@ -71,6 +80,13 @@ declare namespace accessibility {
/**
* The ability that accessibility subsystem support.
* touchExplorer: Describes the capability to talkback.
* magnification: Describes the capability to request to control the display magnification.
* gesturesSimulation: Describes the capability to request to simulate the gesture.
* windowContent: Describes the capability to search for the content of the active window.
* filterKeyEvents: Describes the capability to request to filter key events.
* fingerprintGesture: Describes the capability to request to fingerprint gesture.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
@ -78,6 +94,7 @@ declare namespace accessibility {
/**
* The granularity of text move.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
@ -85,221 +102,349 @@ declare namespace accessibility {
/**
* Checks whether accessibility ability is enabled.
* @since 7
* @param callback Asynchronous callback interface.
*
* @param { AsyncCallback<boolean> } callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @returns Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise.
* @since 7
*/
function isOpenAccessibility(callback: AsyncCallback<boolean>): void;
/**
* Checks whether accessibility ability is enabled.
*
* @param { AsyncCallback<boolean> } callback Asynchronous callback interface.
* @returns { Promise<boolean> } Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
function isOpenAccessibility(): Promise<boolean>;
/**
* Checks touch browser ability (which is used by talkback) is enabled.
* @since 7
* @param callback Asynchronous callback interface.
*
* @param { AsyncCallback<boolean> } callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Vision
* @returns Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise.
* @since 7
*/
function isOpenTouchGuide(callback: AsyncCallback<boolean>): void;
/**
* Checks touch browser ability (which is used by talkback) is enabled.
*
* @param { AsyncCallback<boolean> } callback Asynchronous callback interface.
* @returns { Promise<boolean> } Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise.
* @syscap SystemCapability.BarrierFree.Accessibility.Vision
* @since 7
*/
function isOpenTouchGuide(): Promise<boolean>;
/**
* Queries the list of accessibility abilities.
* @since 7
* @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken
* @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed
*
* @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken
* @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed
* @param { AsyncCallback<Array<AccessibilityAbilityInfo>> } callback
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @returns Returns the list of abilityInfos.
* @since 7
* @deprecated since 9
* @useinstead ohos.accessibility#getAccessibilityExtensionList
*/
function getAbilityLists(abilityType: AbilityType, stateType: AbilityState,
callback: AsyncCallback<Array<AccessibilityAbilityInfo>>): void;
function getAbilityLists(abilityType: AbilityType,
stateType: AbilityState): Promise<Array<AccessibilityAbilityInfo>>;
function getAbilityLists(
abilityType: AbilityType,
stateType: AbilityState,
callback: AsyncCallback<Array<AccessibilityAbilityInfo>>
): void;
/**
* Queries the list of accessibility abilities.
* @since 9
* @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken
* @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed
*
* @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken
* @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed
* @returns { Promise<Array<AccessibilityAbilityInfo>> } Returns the list of abilityInfos.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @returns Returns the list of abilityInfos.
* @throws { BusinessError } 401 - Input parameter error.
* @since 7
* @deprecated since 9
* @useinstead ohos.accessibility#getAccessibilityExtensionList
*/
function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState): Promise<Array<AccessibilityAbilityInfo>>;
function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback<Array<AccessibilityAbilityInfo>>): void;
function getAbilityLists(abilityType: AbilityType, stateType: AbilityState): Promise<Array<AccessibilityAbilityInfo>>;
/**
* Queries the list of accessibility abilities.
*
* @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken
* @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed
* @returns { Promise<Array<AccessibilityAbilityInfo>> } Returns the list of abilityInfos.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
function getAccessibilityExtensionList(
abilityType: AbilityType,
stateType: AbilityState
): Promise<Array<AccessibilityAbilityInfo>>;
/**
* Queries the list of accessibility abilities.
*
* @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken
* @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed
* @param { AsyncCallback<Array<AccessibilityAbilityInfo>> } callback
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
function getAccessibilityExtensionList(
abilityType: AbilityType,
stateType: AbilityState,
callback: AsyncCallback<Array<AccessibilityAbilityInfo>>
): void;
/**
* Send accessibility Event.
* @since 7
* @param event The object of the accessibility {@code EventInfo} .
* @param callback Asynchronous callback interface.
*
* @param { EventInfo } event The object of the accessibility {@code EventInfo} .
* @param { AsyncCallback<void> } callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @returns Returns {@code true} if success ; returns {@code false} otherwise.
* @since 7
* @deprecated since 9
* @useinstead ohos.accessibility#sendAccessibilityEvent
*/
function sendEvent(event: EventInfo, callback: AsyncCallback<void>): void;
/**
* Send accessibility Event.
*
* @param { EventInfo } event The object of the accessibility {@code EventInfo} .
* @returns { Promise<void> } Returns {@code true} if success ; returns {@code false} otherwise.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
* @deprecated since 9
* @useinstead ohos.accessibility#sendAccessibilityEvent
*/
function sendEvent(event: EventInfo): Promise<void>;
/**
* Send accessibility event.
* @since 9
* @param event The object of the accessibility {@code EventInfo} .
* @param callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @returns Returns {@code true} if success ; returns {@code false} otherwise.
*
* @param { EventInfo } event The object of the accessibility {@code EventInfo} .
* @param { AsyncCallback<void> } callback Asynchronous callback interface.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
function sendAccessibilityEvent(event: EventInfo, callback: AsyncCallback<void>): void;
/**
* Send accessibility event.
*
* @param { EventInfo } event The object of the accessibility {@code EventInfo} .
* @returns { Promise<void> } Returns {@code true} if success ; returns {@code false} otherwise.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
function sendAccessibilityEvent(event: EventInfo): Promise<void>;
/**
* Register the observer of the accessibility state changed.
* @since 7
* @param type state event type.
* @param callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @returns Returns {@code true} if the register is success ; returns {@code false} otherwise.
* Register the observe of the accessibility state changed.
*
* @param { 'accessibilityStateChange' } type state event type.
* @param { Callback<boolean> } callback Asynchronous callback interface.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
function on(type: 'accessibilityStateChange', callback: Callback<boolean>): void;
/**
* Register the observer of the touchGuide state changed.
* @since 7
* @param type state event type.
* @param callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Vision
* @returns Returns {@code true} if the register is success ; returns {@code false} otherwise.
* Register the observe of the touchGuide state changed.
*
* @param { 'touchGuideStateChange' } type state event type.
* @param { Callback<boolean> } callback Asynchronous callback interface.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Vision
* @since 7
*/
function on(type: 'touchGuideStateChange', callback: Callback<boolean>): void;
/**
* Unregister the observer of the accessibility state changed.
* @since 7
* @param type state event type
* @param callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @returns Returns {@code true} if the Unregister is success ; returns {@code false} otherwise.
* Unregister the observe of the accessibility state changed.
*
* @param { 'accessibilityStateChange' } type state event type
* @param { Callback<boolean> } callback Asynchronous callback interface.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
function off(type: 'accessibilityStateChange', callback?: Callback<boolean>): void;
/**
* Unregister the observer of the touchGuide state changed.
* @since 7
* @param type state event type
* @param callback Asynchronous callback interface.
* @returns Returns {@code true} if the Unregister is success ; returns {@code false} otherwise.
* Unregister the observe of the touchGuide state changed.
*
* @param { 'touchGuideStateChange' } type state event type
* @param { Callback<boolean> } callback Asynchronous callback interface.
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
function off(type: 'touchGuideStateChange', callback?: Callback<boolean>): void;
function off(type: 'touchGuideStateChange', callback?: Callback<boolean>): void;
/**
* Get the captions manager.
*
* @returns { CaptionsManager } Returns the captions manager.
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
* @returns Returns the captions manager.
*/
function getCaptionsManager(): CaptionsManager;
function getCaptionsManager(): CaptionsManager;
/**
* Indicates the captions manager.
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
interface CaptionsManager {
/**
* Indicates whether captions are enabled.
*/
enabled: boolean;
/**
* Indicates the style of captions.
*/
style: CaptionsStyle;
/**
* Register the observer of the enable state.
* @throws { BusinessError } 401 - Input parameter error.
*/
on(type: 'enableChange', callback: Callback<boolean>): void;
/**
* Indicates the captions manager.
*
* @typedef CaptionsManager
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
interface CaptionsManager {
/**
* Indicates whether captions are enabled.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
enabled: boolean;
/**
* Indicates the style of captions.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
style: CaptionsStyle;
/**
* Register the observer of the style.
* @throws { BusinessError } 401 - Input parameter error.
*/
on(type: 'styleChange', callback: Callback<CaptionsStyle>): void;
/**
* Register the observe of the enable state.
*
* @param { 'enableChange' } type
* @param { Callback<boolean> } callback
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
on(type: 'enableChange', callback: Callback<boolean>): void;
/**
* Unregister the observer of the enable state.
* @throws { BusinessError } 401 - Input parameter error.
*/
off(type: 'enableChange', callback?: Callback<boolean>): void;
/**
* Register the observer of the style.
*
* @param { 'styleChange' } type
* @param { Callback<CaptionsStyle> } callback
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
on(type: 'styleChange', callback: Callback<CaptionsStyle>): void;
/**
* Unregister the observer of the style.
* @throws { BusinessError } 401 - Input parameter error.
*/
off(type: 'styleChange', callback?: Callback<CaptionsStyle>): void;
}
/**
* Indicates the edge type of the captions font.
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
type CaptionsFontEdgeType = 'none' | 'raised' | 'depressed' | 'uniform' | 'dropShadow';
/**
* Indicates the font family of captions.
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
type CaptionsFontFamily = 'default' | 'monospacedSerif' | 'serif' |
'monospacedSansSerif' | 'sansSerif' | 'casual' | 'cursive' | 'smallCapitals';
/**
* Indicates the style of captions.
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
interface CaptionsStyle {
/**
* Indicates the font family of captions.
*/
fontFamily: CaptionsFontFamily;
/**
* Indicates the font scaling of captions.
*/
fontScale: number;
/**
* Indicates the font color of captions.
*/
fontColor: number | string;
/**
* Indicates the edge type of the captions font.
*/
fontEdgeType: CaptionsFontEdgeType;
/**
* Indicates the background color of captions.
*/
backgroundColor: number | string;
/**
* Indicates the window color of captions.
*/
windowColor: number | string;
}
/**
* Unregister the observe of the enable state.
*
* @param { 'enableChange' } type
* @param { Callback<boolean> } callback
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
off(type: 'enableChange', callback?: Callback<boolean>): void;
/**
* Indicates the info of accessibility.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
/**
* Unregister the observer of the style.
*
* @param { 'styleChange' } type
* @param { Callback<CaptionsStyle> } callback
* @throws { BusinessError } 401 - Input parameter error.
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
off(type: 'styleChange', callback?: Callback<CaptionsStyle>): void;
}
/**
* Indicates the edge type of the captions font.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
type CaptionsFontEdgeType = 'none' | 'raised' | 'depressed' | 'uniform' | 'dropShadow';
/**
* Indicates the font family of captions.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
type CaptionsFontFamily = 'default' | 'monospacedSerif' | 'serif' |
'monospacedSansSerif' | 'sansSerif' | 'casual' | 'cursive' | 'smallCapitals';
/**
* Indicates the style of captions.
*
* @typedef CaptionsStyle
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
interface CaptionsStyle {
/**
* Indicates the font family of captions.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
fontFamily: CaptionsFontFamily;
/**
* Indicates the font scaling of captions.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
fontScale: number;
/**
* Indicates the font color of captions.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
fontColor: number | string;
/**
* Indicates the edge type of the captions font.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
fontEdgeType: CaptionsFontEdgeType;
/**
* Indicates the background color of captions.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
backgroundColor: number | string;
/**
* Indicates the window color of captions.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
*/
windowColor: number | string;
}
/**
* Indicates the info of accessibility.
*
* @typedef AccessibilityAbilityInfo
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
interface AccessibilityAbilityInfo {
/**
* The ability id.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
readonly id: string;
@ -321,119 +466,156 @@ declare namespace accessibility {
/**
* The type of the ability.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
readonly abilityTypes: Array<AbilityType>;
/**
* The capabilities of the ability.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
readonly capabilities: Array<Capability>;
/**
* The description of the ability.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
readonly description: string;
/**
* The events which the accessibility ability wants to observe.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
readonly eventTypes: Array<EventType>;
}
/**
* Indicates the info of events.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
* Indicates the info of events.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
class EventInfo {
constructor(jsonObject);
/**
* The type of an accessibility event.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
type: EventType;
/**
* The type of the window change event.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
windowUpdateType?: WindowUpdateType;
/**
* The bundle name of the target application.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
bundleName: string;
/**
* The type of the event source component,such as button, chart.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
componentType?: string;
/** The page id of the event source.
/**
* The page id of the event source.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
pageId ?: number;
pageId?: number;
/**
* The accessibility event description.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
description?: string;
/**
* The action that triggers the accessibility event, for example, clicking or focusing a view.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
triggerAction: Action;
/**
* The movement step used for reading texts.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
textMoveUnit?: TextMoveUnit;
/**
* The content list.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
contents?: Array<string>;
/**
* The content changed before.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
lastContent?: string;
/**
* The start index of listed items on the screen.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
beginIndex?: number;
/**
* The index of the current item on the screen.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
currentIndex?: number;
/**
* The end index of listed items on the screen.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
endIndex?: number;
/**
* The total of the items.
* The total of the items, talkback used it when scroll.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
itemCount?: number;
}
}
export default accessibility;
export default accessibility;

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
import Want from './@ohos.app.ability.Want';
import rpc from './@ohos.rpc';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
/**
* This module provides the capability to manage distributed accounts.

View File

@ -14,7 +14,7 @@
*/
import distributedAccount from './@ohos.account.distributedAccount';
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
/**
* This module provides the capability to manage os accounts.
@ -2074,6 +2074,56 @@ declare namespace osAccount {
freezingTime: number;
}
/**
* Provides the GetDomainAccessTokenOptions type.
*
* @typedef GetDomainAccessTokenOptions
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
interface GetDomainAccessTokenOptions {
/**
* Indicates the domain account information.
*
* @type { DomainAccountInfo }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
domainAccountInfo: DomainAccountInfo;
/**
* Indicates the domain account token.
*
* @type { Uint8Array }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
domainAccountToken: Uint8Array;
/**
* Indicates the business parameters.
*
* @type { object }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
businessParams: { [key: string]: object };
/**
* Indicates caller UID.
*
* @type { number }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
callerUid: number;
}
/**
* Provides the definition of domain plugin.
*
@ -2163,6 +2213,33 @@ declare namespace osAccount {
* @since 10
*/
unbindAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback<void>): void;
/**
* Checks whether the token of specified domain account is valid.
*
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information.
* @param { Uint8Array } token - Indicates the account token.
* @param { AsyncCallback<boolean> } callback - Indicates the callback for notifying the checking result.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
isAccountTokenValid(
domainAccountInfo: DomainAccountInfo,
token: Uint8Array,
callback: AsyncCallback<boolean>
): void;
/**
* Gets the access token based on the specified options.
*
* @param { GetDomainAccessTokenOptions } options - Indicates the options for getting th access token.
* @param { AsyncCallback<Uint8Array> } callback - Indicates the callback for returning the access token.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
getAccessToken(options: GetDomainAccessTokenOptions, callback: AsyncCallback<Uint8Array>): void;
}
/**
@ -2318,6 +2395,54 @@ declare namespace osAccount {
* @since 10
*/
static hasAccount(domainAccountInfo: DomainAccountInfo): Promise<boolean>;
/**
* Updates the token for the specified domain account.
* <p>Only the registered domain plugin has the permission to call this function.<br/>
* An empty token indicates the token of the target domain account is invalid.</p>
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information.
* @param { Uint8Array } token - Indicates the domain account token.
* @param { AsyncCallback<void> } callback - Indicates the result callback.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid token.
* @throws { BusinessError } 12300003 - Account not found.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
static updateAccountToken(
domainAccountInfo: DomainAccountInfo,
token: Uint8Array,
callback: AsyncCallback<void>
): void;
/**
* Updates the token for the specified domain account.
* <p>Only the registered domain plugin has the permission to call this function.<br/>
* An empty token indicates the token of the target domain account is invalid.</p>
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information.
* @param { Uint8Array } token - Indicates the domain account token.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid token.
* @throws { BusinessError } 12300003 - Account not found.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
static updateAccountToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array): Promise<void>;
}
/**

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import {AsyncCallback} from "./basic";
import {AsyncCallback} from "./@ohos.base";
/**
* Window animation manager.

View File

@ -18,6 +18,7 @@
* @namespace AbilityConstant
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @crossplatform
* @since 9
*/
declare namespace AbilityConstant {
@ -26,6 +27,7 @@ declare namespace AbilityConstant {
* @typedef LaunchParam
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @crossplatform
* @since 9
*/
export interface LaunchParam {
@ -33,6 +35,7 @@ declare namespace AbilityConstant {
* Indicates launch reason.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @crossplatform
* @since 9
*/
launchReason: LaunchReason;
@ -41,6 +44,7 @@ declare namespace AbilityConstant {
* Indicates last exit reason.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @crossplatform
* @since 9
*/
lastExitReason: LastExitReason;
@ -51,13 +55,44 @@ declare namespace AbilityConstant {
* @enum { number }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @crossplatform
* @since 9
*/
export enum LaunchReason {
/**
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @crossplatform
* @since 9
*/
UNKNOWN = 0,
/**
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 9
*/
START_ABILITY = 1,
/**
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 9
*/
CALL = 2,
/**
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 9
*/
CONTINUATION = 3,
/**
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 9
*/
APP_RECOVERY = 4,
/**
@ -71,11 +106,30 @@ declare namespace AbilityConstant {
* @enum { number }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @crossplatform
* @since 9
*/
export enum LastExitReason {
/**
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @crossplatform
* @since 9
*/
UNKNOWN = 0,
/**
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 9
*/
ABILITY_NOT_RESPONDING = 1,
/**
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 9
*/
NORMAL = 2,
}

View File

@ -21,6 +21,7 @@ import window from './@ohos.window';
* The ability lifecycle callback.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
export default class AbilityLifecycleCallback {
@ -29,6 +30,7 @@ export default class AbilityLifecycleCallback {
* @param { Ability } ability - Indicates the ability to register for listening.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onAbilityCreate(ability: UIAbility): void;
@ -39,6 +41,7 @@ export default class AbilityLifecycleCallback {
* @param { window.WindowStage } windowStage - window stage to create
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onWindowStageCreate(ability: UIAbility, windowStage: window.WindowStage): void;
@ -69,6 +72,7 @@ export default class AbilityLifecycleCallback {
* @param { window.WindowStage } windowStage - window stage to destroy
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onWindowStageDestroy(ability: UIAbility, windowStage: window.WindowStage): void;
@ -78,6 +82,7 @@ export default class AbilityLifecycleCallback {
* @param { Ability } ability - Indicates the ability to register for listening.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onAbilityDestroy(ability: UIAbility): void;
@ -87,6 +92,7 @@ export default class AbilityLifecycleCallback {
* @param { Ability } ability - Indicates the ability to register for listening.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onAbilityForeground(ability: UIAbility): void;
@ -96,6 +102,7 @@ export default class AbilityLifecycleCallback {
* @param { Ability } ability - Indicates the ability to register for listening.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onAbilityBackground(ability: UIAbility): void;

View File

@ -22,6 +22,7 @@ import { Configuration } from './@ohos.app.ability.Configuration';
* The class of an ability stage.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @crossplatform
* @since 9
*/
export default class AbilityStage {
@ -38,6 +39,7 @@ export default class AbilityStage {
* Called back when an ability stage is started for initialization.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @crossplatform
* @since 9
*/
onCreate(): void;
@ -59,6 +61,7 @@ export default class AbilityStage {
* @param { Configuration } newConfig - Indicates the updated configuration.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @crossplatform
* @since 9
*/
onConfigurationUpdate(newConfig: Configuration): void;

View File

@ -19,6 +19,7 @@ import ConfigurationConstant from "./@ohos.app.ability.ConfigurationConstant";
* configuration item.
* @typedef Configuration
* @syscap SystemCapability.Ability.AbilityBase
* @crossplatform
* @since 9
*/
export interface Configuration {
@ -34,6 +35,7 @@ export interface Configuration {
* Indicates the current colorMode of the application.
* @type { ConfigurationConstant.ColorMode }
* @syscap SystemCapability.Ability.AbilityBase
* @crossplatform
* @since 9
*/
colorMode?: ConfigurationConstant.ColorMode;
@ -42,6 +44,7 @@ export interface Configuration {
* Indicates the screen direction of the current device.
* @type { ConfigurationConstant.Direction }
* @syscap SystemCapability.Ability.AbilityBase
* @crossplatform
* @since 9
*/
direction?: ConfigurationConstant.Direction;

View File

@ -24,6 +24,7 @@
* ColorMode
* @enum { number }
* @syscap SystemCapability.Ability.AbilityBase
* @crossplatform
* @since 9
*/
export enum ColorMode {
@ -36,6 +37,7 @@
* Direction
* @enum { number }
* @syscap SystemCapability.Ability.AbilityBase
* @crossplatform
* @since 9
*/
export enum Direction {

View File

@ -31,6 +31,17 @@ export interface OnReleaseCallback {
(msg: string): void;
}
/**
* The prototype of the listener function interface registered by the Caller.
* @typedef OnRemoteStateChangeCallback
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @since 10
*/
export interface OnRemoteStateChangeCallback {
(msg: string): void;
}
/**
* The prototype of the message listener function interface registered by the Callee.
* @typedef CalleeCallback
@ -92,6 +103,16 @@ export interface Caller {
*/
onRelease(callback: OnReleaseCallback): void;
/**
* Register state changed listener notification callback of remote ability.
* @param { OnRemoteStateChangeCallback } callback - Register a callback function for listening for notifications.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @since 10
*/
onRemoteStateChange(callback: OnRemoteStateChangeCallback): void;
/**
* Register death listener notification callback.
* @param { string } type - release.
@ -159,6 +180,7 @@ export interface Callee {
* The class of a UI ability.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
export default class UIAbility extends Ability {
@ -204,6 +226,7 @@ export default class UIAbility extends Ability {
* @param { AbilityConstant.LaunchParam } param - Indicates the launch param.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onCreate(want: Want, param: AbilityConstant.LaunchParam): void;
@ -213,6 +236,7 @@ export default class UIAbility extends Ability {
* @param { window.WindowStage } windowStage - Indicates the created WindowStage.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onWindowStageCreate(windowStage: window.WindowStage): void;
@ -221,6 +245,7 @@ export default class UIAbility extends Ability {
* Called back when an ability window stage is destroyed.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onWindowStageDestroy(): void;
@ -238,6 +263,7 @@ export default class UIAbility extends Ability {
* Called back before an ability is destroyed.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onDestroy(): void | Promise<void>;
@ -246,6 +272,7 @@ export default class UIAbility extends Ability {
* Called back when the state of an ability changes to foreground.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onForeground(): void;
@ -254,6 +281,7 @@ export default class UIAbility extends Ability {
* Called back when the state of an ability changes to background.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onBackground(): void;
@ -275,6 +303,7 @@ export default class UIAbility extends Ability {
* @param { AbilityConstant.LaunchParam } launchParams - Indicates the launch parameters.
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
* @crossplatform
* @since 9
*/
onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void;

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { Configuration } from './@ohos.app.ability.Configuration';
import { AbilityRunningInfo as _AbilityRunningInfo } from './application/AbilityRunningInfo';
import { ExtensionRunningInfo as _ExtensionRunningInfo } from './application/ExtensionRunningInfo';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import * as _ApplicationStateObserver from './application/ApplicationStateObserver';
import * as _AbilityStateData from './application/AbilityStateData';
import * as _AppStateData from './application/AppStateData';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import * as _ErrorObserver from './application/ErrorObserver';
/**

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { MissionInfo as _MissionInfo } from './application/MissionInfo';
import { MissionListener as _MissionListener } from './application/MissionListener';
import { MissionSnapshot as _MissionSnapshot } from './application/MissionSnapshot';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from "./basic";
import { AsyncCallback } from "./@ohos.base";
/**
* Interface of quickFixManager.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback , Callback} from './basic';
import { AsyncCallback , Callback} from './@ohos.base';
import Want from './@ohos.app.ability.Want';
import { WantAgentInfo as _WantAgentInfo } from './wantAgent/wantAgentInfo';
import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import type { AsyncCallback } from './basic';
import type { AsyncCallback } from './@ohos.base';
import type * as _BusinessAbilityInfo from './bundleManager/BusinessAbilityInfo';
/**

View File

@ -135,4 +135,15 @@ export default class FormExtensionAbility {
* @since 9
*/
onShareForm?(formId: string): { [key: string]: Object };
/**
* Called when the system acquire the form data.
* @param { string } formId - Indicates the ID of the form.
* @returns { { [key: string]: Object } } Returns the wantParams object.
* @syscap SystemCapability.Ability.Form
* @systemapi
* @StageModelOnly
* @since 10
*/
onAcquireFormData?(formId: string): { [key: string]: Object };
}

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { BusinessError } from './basic';
import { BusinessError } from './@ohos.base';
/**
* Interface of formBindingData.

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
import { AsyncCallback } from "./basic";
import { Callback } from "./basic";
import { AsyncCallback } from "./@ohos.base";
import { Callback } from "./@ohos.base";
import Want from './@ohos.app.ability.Want';
import formInfo from './@ohos.app.form.formInfo';
@ -742,7 +742,7 @@ declare namespace formHost {
* @since 9
*/
function notifyFormsPrivacyProtected(formIds: Array<string>, isProtected: boolean): Promise<void>;
/**
* Acquire form data by formId.
* @permission ohos.permission.REQUIRE_FORM
@ -756,17 +756,17 @@ declare namespace formHost {
*/
function acquireFormData(formId: string, callback: AsyncCallback<{[key: string]: Object}>): void;
/**
* Acquire form data by formId.
* @permission ohos.permission.REQUIRE_FORM
* @param { string } formId - Indicates the form ID.
* @returns { Promise<{[key: string]: Object}> } The promise returned by the function.
* @throws { BusinessError } 201 - Permissions denied.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 10
*/
/**
* Acquire form data by formId.
* @permission ohos.permission.REQUIRE_FORM
* @param { string } formId - Indicates the form ID.
* @returns { Promise<{[key: string]: Object}> } The promise returned by the function.
* @throws { BusinessError } 201 - Permissions denied.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 10
*/
function acquireFormData(formId: string): Promise<{[key: string]: Object}>;
}
export default formHost;

View File

@ -389,7 +389,35 @@ declare namespace formInfo {
* @systemapi
* @since 9
*/
DEVICE_ID_KEY = "ohos.extra.param.key.device_id"
DEVICE_ID_KEY = "ohos.extra.param.key.device_id",
/**
* Indicates the key specifying the launch reason of the form to be obtained, which is represented as
* want: {
* "parameters": {
* LAUNCH_REASON_KEY: LaunchReason.FORM_DEFAULT
* }
* }
*
* @syscap SystemCapability.Ability.Form
* @since 10
*/
LAUNCH_REASON_KEY = "ohos.extra.param.key.form_launch_reason",
/**
* Indicates the key specifying the custom data of the form to be obtained, which is represented as
* want: {
* "parameters": {
* PARAM_FORM_CUSTOMIZE_KEY: {
* "key": "userData"
* }
* }
* }
*
* @syscap SystemCapability.Ability.Form
* @since 10
*/
PARAM_FORM_CUSTOMIZE_KEY = "ohos.extra.param.key.form_customize"
}
/**
@ -475,5 +503,26 @@ declare namespace formInfo {
*/
FORM_INVISIBLE,
}
/**
* Indicates the launch reason of a form.
* @enum { number }
* @syscap SystemCapability.Ability.Form
* @since 10
*/
enum LaunchReason {
/**
* Indicates the launch reason of a form is default.
* @syscap SystemCapability.Ability.Form
* @since 10
*/
FORM_DEFAULT = 1,
/**
* Indicates the launch reason of a form is share.
* @syscap SystemCapability.Ability.Form
* @since 10
*/
FORM_SHARE,
}
}
export default formInfo;

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from "./basic";
import { AsyncCallback } from "./@ohos.base";
import formBindingData from "./@ohos.app.form.formBindingData";
import formInfo from "./@ohos.app.form.formInfo";
import Want from "./@ohos.app.ability.Want";

View File

@ -13,79 +13,98 @@
* limitations under the License.
*/
import accessibility from './@ohos.accessibility'
import AccessibilityExtensionContext, { AccessibilityElement } from './application/AccessibilityExtensionContext'
import { KeyEvent } from './@ohos.multimodalInput.keyEvent'
import type accessibility from './@ohos.accessibility';
import type AccessibilityExtensionContext, { AccessibilityElement } from './application/AccessibilityExtensionContext';
import type { KeyEvent } from './@ohos.multimodalInput.keyEvent';
/**
* class of accessibility extension ability.
*
* @since 9
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
export default class AccessibilityExtensionAbility {
/**
* Indicates accessibility extension ability context.
*/
context: AccessibilityExtensionContext;
/**
* Indicates accessibility extension ability context.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
context: AccessibilityExtensionContext;
/**
* Called when extension ability is connected.
*/
onConnect(): void;
/**
* Called when extension ability is connected.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
onConnect(): void;
/**
* Called when extension ability is disconnected.
*/
onDisconnect(): void;
/**
* Called when extension ability is disconnected.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
onDisconnect(): void;
/**
* Called when an accessibility event occurs, such as when the user touches the application interface.
* @param event Indicates an accessibility event.
*/
onAccessibilityEvent(event: AccessibilityEvent): void;
/**
* Called when an accessibility event occurs, such as when the user touches the application interface.
*
* @param { AccessibilityEvent } event Indicates an accessibility event.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
onAccessibilityEvent(event: AccessibilityEvent): void;
/**
* Called when a physical key is pressed, such as when the user presses the volume button .
* @param keyEvent Indicates the physical key event.
*/
onKeyEvent(keyEvent: KeyEvent): boolean;
/**
* Called when a physical key is pressed, such as when the user presses the volume button .
*
* @param { KeyEvent } keyEvent Indicates the physical key event.
* @returns { boolean }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
onKeyEvent(keyEvent: KeyEvent): boolean;
}
/**
* Indicates the accessibility event.
*
* It provides the event type and the target element of the event if any.
* @since 9
*
* @typedef AccessibilityEvent
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
declare interface AccessibilityEvent {
eventType: accessibility.EventType | accessibility.WindowUpdateType |
TouchGuideType | GestureType | PageUpdateType;
target?: AccessibilityElement;
timeStamp?: number;
eventType: accessibility.EventType | accessibility.WindowUpdateType | TouchGuideType | GestureType | PageUpdateType;
target?: AccessibilityElement;
timeStamp?: number;
}
/**
* Indicates the gesture type.
* @since 9
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
type GestureType = 'left' | 'leftThenRight' | 'leftThenUp' | 'leftThenDown' |
'right' | 'rightThenLeft' | 'rightThenUp' | 'rightThenDown' |
'up' | 'upThenLeft' | 'upThenRight' | 'upThenDown' |
'down' | 'downThenLeft' | 'downThenRight' | 'downThenUp';
'right' | 'rightThenLeft' | 'rightThenUp' | 'rightThenDown' |
'up' | 'upThenLeft' | 'upThenRight' | 'upThenDown' |
'down' | 'downThenLeft' | 'downThenRight' | 'downThenUp';
/**
* Indicates the page update type.
* @since 9
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
type PageUpdateType = 'pageContentUpdate' | 'pageStateUpdate';
/**
* Indicates the type of touch event during touch browsing.
* @since 9
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
type TouchGuideType = 'touchBegin' | 'touchEnd';
type TouchGuideType = 'touchBegin' | 'touchEnd';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from "./basic";
import { AsyncCallback } from "./@ohos.base";
import ExtensionContext from "./application/ExtensionContext";
import Want from './@ohos.app.ability.Want';
import dataSharePredicates from './@ohos.data.dataSharePredicates';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { Configuration } from './@ohos.application.Configuration';
import { AbilityRunningInfo } from './application/AbilityRunningInfo';
import { ExtensionRunningInfo } from './application/ExtensionRunningInfo';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import ApplicationStateObserver from './application/ApplicationStateObserver';
import AbilityStateData from './application/AbilityStateData';
import AppStateData from './application/AppStateData';

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
import { AsyncCallback } from "./basic";
import { Callback } from "./basic";
import { AsyncCallback } from "./@ohos.base";
import { Callback } from "./@ohos.base";
import Want from './@ohos.app.ability.Want';
import formInfo from './@ohos.app.form.formInfo'

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from "./basic";
import { AsyncCallback } from "./@ohos.base";
import formBindingData from "./@ohos.application.formBindingData";
import formInfo from "./@ohos.app.form.formInfo";
import Want from './@ohos.app.ability.Want';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { MissionInfo } from './application/MissionInfo';
import { MissionListener } from './application/MissionListener';
import { MissionSnapshot } from './application/MissionSnapshot';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import image from './@ohos.multimedia.image'
/**

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback , Callback} from './basic';
import { AsyncCallback , Callback} from './@ohos.base';
import { WantAgent } from "./@ohos.wantAgent";
import Context from './application/BaseContext';

View File

@ -1,68 +1,81 @@
/*
* 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.
*/
/**
* Defines the basic callback.
* @since 6
*/
export interface Callback<T> {
/**
* Defines the callback info.
* @since 6
*/
(data: T): void;
}
/**
* Defines the basic error callback.
* @since 6
*/
export interface ErrorCallback<T extends Error = BusinessError> {
/**
* Defines the basic error callback.
* @since 6
*/
(err: T): void;
}
/**
* Defines the basic async callback.
* @since 6
*/
export interface AsyncCallback<T, E = void> {
/**
* Defines the callback data.
* @since 6
*/
(err: BusinessError<E>, data: T): void;
}
/**
* Defines the error interface.
* @since 6
*/
export interface BusinessError<T = void> extends Error {
/**
* Defines the basic error code.
* @since 6
*/
code: number;
/**
* Defines the additional information for business
* @type { ?T }
* @since 9
*/
data?: T;
}
/*
* 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.
*/
/**
* Defines the basic callback.
* @syscap SystemCapability.Base
* @typedef Callback
* @since 6
*/
export interface Callback<T> {
/**
* Defines the callback info.
* @param { T } data
* @since 6
*/
(data: T): void;
}
/**
* Defines the basic error callback.
* @syscap SystemCapability.Base
* @typedef ErrorCallback
* @since 6
*/
export interface ErrorCallback<T extends Error = BusinessError> {
/**
* Defines the basic error callback.
* @param { T } err
* @since 6
*/
(err: T): void;
}
/**
* Defines the basic async callback.
* @syscap SystemCapability.Base
* @typedef AsyncCallback
* @since 6
*/
export interface AsyncCallback<T, E = void> {
/**
* Defines the callback data.
* @param { BusinessError<E> } err
* @param { T } data
* @since 6
*/
(err: BusinessError<E>, data: T): void;
}
/**
* Defines the error interface.
* @syscap SystemCapability.Base
* @typedef BusinessError
* @since 6
*/
export interface BusinessError<T = void> extends Error {
/**
* Defines the basic error code.
* @type { number } code
* @since 6
*/
code: number;
/**
* Defines the additional information for business
* @type { ?T } data
* @since 9
*/
data?: T;
}

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, BusinessError } from './basic';
import { AsyncCallback, BusinessError } from './@ohos.base';
/**
* Provides methods to get power consumption information.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
/**
* Provides methods to operate or manage Bluetooth.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
/**
* Provides methods to operate or manage Bluetooth.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { BusinessError } from './basic';
import { BusinessError } from './@ohos.base';
/**
* Provides interfaces to control the power of display.

85
api/@ohos.buffer.d.ts vendored
View File

@ -14,6 +14,7 @@
*/
/**
* The Buffer class is a global type for dealing with binary data directly. It can be constructed in a variety of ways.
* @crossplatform
* @since
* @syscap SystemCapability.Utils.Lang
* @permission N/A
@ -25,6 +26,7 @@ declare namespace buffer {
interface TypedArray extends Int8Array {}
/**
* Allocates a new Buffer for a fixed size bytes. If fill is undefined, the Buffer will be zero-filled.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param size The desired length of the new Buffer
@ -37,6 +39,7 @@ declare namespace buffer {
/**
* Allocates a new Buffer for a fixed size bytes. The Buffer will not be initially filled.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param size The desired length of the new Buffer
@ -47,6 +50,7 @@ declare namespace buffer {
/**
* Allocates a new un-pooled Buffer for a fixed size bytes. The Buffer will not be initially filled.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param size The desired length of the new Buffer
@ -59,6 +63,7 @@ declare namespace buffer {
* Returns the byte length of a string when encoded using `encoding`.
* This is not the same as [`String.prototype.length`], which does not account
* for the encoding that is used to convert the string into bytes.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param string A value to calculate the length of
@ -70,6 +75,7 @@ declare namespace buffer {
/**
* Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param list List of `Buffer` or Uint8Array instances to concatenate
@ -82,6 +88,7 @@ declare namespace buffer {
/**
* Allocates a new Buffer using an array of bytes in the range 0 255. Array entries outside that range will be truncated to fit into it.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param array an array of bytes in the range 0 255
@ -92,6 +99,7 @@ declare namespace buffer {
/**
* This creates a view of the ArrayBuffer without copying the underlying memory.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param arrayBuffer An ArrayBuffer, SharedArrayBuffer, for example the .buffer property of a TypedArray.
@ -105,6 +113,7 @@ declare namespace buffer {
/**
* Copies the passed buffer data onto a new Buffer instance.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param buffer An existing Buffer or Uint8Array from which to copy data
@ -116,6 +125,7 @@ declare namespace buffer {
/**
* For the object whose value returned by valueof() function is strictly equal to object
* or supports symbol To primitive object, a new buffer instance is created.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param object An object supporting Symbol.toPrimitive or valueOf()
@ -129,6 +139,7 @@ declare namespace buffer {
/**
* Creates a new Buffer containing string. The encoding parameter identifies the character encoding
* to be used when converting string into bytes.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param string A string to encode
@ -140,6 +151,7 @@ declare namespace buffer {
/**
* Returns true if obj is a Buffer, false otherwise
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param obj Objects to be judged
@ -149,6 +161,7 @@ declare namespace buffer {
/**
* Returns true if encoding is the name of a supported character encoding, or false otherwise.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param encoding A character encoding name to check
@ -158,6 +171,7 @@ declare namespace buffer {
/**
* Compares buf1 to buf2
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param buf1 A Buffer or Uint8Array instance.
@ -171,6 +185,7 @@ declare namespace buffer {
/**
* Re-encodes the given Buffer or Uint8Array instance from one character encoding to another.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param source A Buffer or Uint8Array instance.
@ -187,6 +202,7 @@ declare namespace buffer {
/**
* Returns the number of bytes in buf
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @throws {BusinessError} 10200013 - Cannot set property length of Buffer which has only a getter
@ -195,6 +211,7 @@ declare namespace buffer {
/**
* The underlying ArrayBuffer object based on which this Buffer object is created.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @throws {BusinessError} 10200013 - Cannot set property buffer of Buffer which has only a getter
@ -203,6 +220,7 @@ declare namespace buffer {
/**
* The byteOffset of the Buffers underlying ArrayBuffer object
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @throws {BusinessError} 10200013 - Cannot set property byteOffset of Buffer which has only a getter
@ -211,6 +229,7 @@ declare namespace buffer {
/**
* Fills buf with the specified value. If the offset and end are not given, the entire buf will be filled.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value The value with which to fill buf
@ -226,6 +245,7 @@ declare namespace buffer {
/**
* Compares buf with target and returns a number indicating whether buf comes before, after,
* or is the same as target in sort order. Comparison is based on the actual sequence of bytes in each Buffer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param target A Buffer or Uint8Array with which to compare buf
@ -245,6 +265,7 @@ declare namespace buffer {
/**
* Copies data from a region of buf to a region in target, even if the target memory region overlaps with buf.
* If sourceEnd is greater than the length of the target, the length of the target shall prevail, and the extra part will not be overwritten.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param target A Buffer or Uint8Array to copy into
@ -260,6 +281,7 @@ declare namespace buffer {
/**
* Returns true if both buf and otherBuffer have exactly the same bytes, false otherwise
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param otherBuffer A Buffer or Uint8Array with which to compare buf
@ -270,6 +292,7 @@ declare namespace buffer {
/**
* Returns true if value was found in buf, false otherwise
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value What to search for
@ -282,6 +305,7 @@ declare namespace buffer {
/**
* The index of the first occurrence of value in buf
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value What to search for
@ -294,6 +318,7 @@ declare namespace buffer {
/**
* Creates and returns an iterator of buf keys (indices).
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
*/
@ -301,6 +326,7 @@ declare namespace buffer {
/**
* Creates and returns an iterator for buf values (bytes).
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
*/
@ -308,6 +334,7 @@ declare namespace buffer {
/**
* Creates and returns an iterator of [index, byte] pairs from the contents of buf.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
*/
@ -315,6 +342,7 @@ declare namespace buffer {
/**
* The index of the last occurrence of value in buf
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value What to search for
@ -327,6 +355,7 @@ declare namespace buffer {
/**
* Reads a signed, big-endian 64-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
@ -338,6 +367,7 @@ declare namespace buffer {
/**
* Reads a signed, little-endian 64-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
@ -349,6 +379,7 @@ declare namespace buffer {
/**
* Reads a unsigned, big-endian 64-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
@ -360,6 +391,7 @@ declare namespace buffer {
/**
* Reads a unsigned, little-endian 64-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
@ -371,6 +403,7 @@ declare namespace buffer {
/**
* Reads a 64-bit, big-endian double from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
@ -382,6 +415,7 @@ declare namespace buffer {
/**
* Reads a 64-bit, little-endian double from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8
@ -393,6 +427,7 @@ declare namespace buffer {
/**
* Reads a 32-bit, big-endian float from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4
@ -404,6 +439,7 @@ declare namespace buffer {
/**
* Reads a 32-bit, little-endian float from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4
@ -415,6 +451,7 @@ declare namespace buffer {
/**
* Reads a signed 8-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 1
@ -426,6 +463,7 @@ declare namespace buffer {
/**
* Reads a signed, big-endian 16-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2
@ -437,6 +475,7 @@ declare namespace buffer {
/**
* Reads a signed, little-endian 16-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2
@ -448,6 +487,7 @@ declare namespace buffer {
/**
* Reads a signed, big-endian 32-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4
@ -459,6 +499,7 @@ declare namespace buffer {
/**
* Reads a signed, little-endian 32-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4
@ -471,6 +512,7 @@ declare namespace buffer {
/**
* Reads byteLength number of bytes from buf at the specified offset and interprets the result as a big-endian,
* two's complement signed value supporting up to 48 bits of accuracy
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength
@ -484,6 +526,7 @@ declare namespace buffer {
/**
* Reads byteLength number of bytes from buf at the specified offset and interprets the result as a little-endian,
* two's complement signed value supporting up to 48 bits of accuracy.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength
@ -496,6 +539,7 @@ declare namespace buffer {
/**
* Reads an unsigned 8-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 1
@ -507,6 +551,7 @@ declare namespace buffer {
/**
* Reads an unsigned, big-endian 16-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2
@ -518,6 +563,7 @@ declare namespace buffer {
/**
* Reads an unsigned, little-endian 16-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2
@ -529,6 +575,7 @@ declare namespace buffer {
/**
* Reads an unsigned, big-endian 32-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4
@ -540,6 +587,7 @@ declare namespace buffer {
/**
* Reads an unsigned, little-endian 32-bit integer from buf at the specified offset
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4
@ -552,6 +600,7 @@ declare namespace buffer {
/**
* Reads byteLength number of bytes from buf at the specified offset and interprets the result as
* an unsigned big-endian integer supporting up to 48 bits of accuracy.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength
@ -565,6 +614,7 @@ declare namespace buffer {
/**
* Reads byteLength number of bytes from buf at the specified offset and interprets the result as an unsigned,
* little-endian integer supporting up to 48 bits of accuracy.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength
@ -577,6 +627,7 @@ declare namespace buffer {
/**
* Returns a new Buffer that references the same memory as the original, but offset and cropped by the start and end indices.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [start = 0] Where the new Buffer will start
@ -587,6 +638,7 @@ declare namespace buffer {
/**
* Interprets buf as an array of unsigned 16-bit integers and swaps the byte order in-place.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns A reference to buf
@ -596,6 +648,7 @@ declare namespace buffer {
/**
* Interprets buf as an array of unsigned 32-bit integers and swaps the byte order in-place.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns A reference to buf
@ -605,6 +658,7 @@ declare namespace buffer {
/**
* Interprets buf as an array of unsigned 64-bit integers and swaps the byte order in-place.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns A reference to buf
@ -614,6 +668,7 @@ declare namespace buffer {
/**
* Returns a JSON representation of buf
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns a JSON
@ -622,6 +677,7 @@ declare namespace buffer {
/**
* Decodes buf to a string according to the specified character encoding in encoding
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param [encoding='utf8'] The character encoding to use
@ -633,6 +689,7 @@ declare namespace buffer {
/**
* Writes string to buf at offset according to the character encoding in encoding
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param str Writes string to buf at offset according to the character encoding in encoding
@ -647,6 +704,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as big-endian.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -659,6 +717,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as little-endian.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -671,6 +730,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as big-endian.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -683,6 +743,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as little-endian.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -695,6 +756,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as big-endian.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -707,6 +769,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as little-endian.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -719,6 +782,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as big-endian.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -731,6 +795,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as little-endian.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -743,6 +808,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset. value must be a valid signed 8-bit integer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -755,6 +821,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as big-endian. The value must be a valid signed 16-bit integer
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -767,6 +834,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as little-endian. The value must be a valid signed 16-bit integer
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -779,6 +847,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as big-endian. The value must be a valid signed 32-bit integer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -791,6 +860,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as little-endian. The value must be a valid signed 32-bit integer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -803,6 +873,7 @@ declare namespace buffer {
/**
* Writes byteLength bytes of value to buf at the specified offset as big-endian
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -816,6 +887,7 @@ declare namespace buffer {
/**
* Writes byteLength bytes of value to buf at the specified offset as little-endian
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -829,6 +901,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset. value must be a valid unsigned 8-bit integer
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -841,6 +914,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as big-endian. The value must be a valid unsigned 16-bit integer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -853,6 +927,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as little-endian. The value must be a valid unsigned 16-bit integer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -865,6 +940,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as big-endian. The value must be a valid unsigned 32-bit integer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -877,6 +953,7 @@ declare namespace buffer {
/**
* Writes value to buf at the specified offset as little-endian. The value must be a valid unsigned 32-bit integer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -889,6 +966,7 @@ declare namespace buffer {
/**
* Writes byteLength bytes of value to buf at the specified offset as big-endian
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -902,6 +980,7 @@ declare namespace buffer {
/**
* Writes byteLength bytes of value to buf at the specified offset as little-endian
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value Number to be written to buf
@ -919,6 +998,7 @@ declare namespace buffer {
/**
* Creates a new Blob object containing a concatenation of the given sources.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param sources An array of string, <ArrayBuffer>, <TypedArray>, <DataView>, or <Blob> objects, or any mix of such objects, that will be stored within the Blob
@ -931,6 +1011,7 @@ declare namespace buffer {
/**
* The total size of the Blob in bytes
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
*/
@ -938,6 +1019,7 @@ declare namespace buffer {
/**
* The content-type of the Blob
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
*/
@ -945,6 +1027,7 @@ declare namespace buffer {
/**
* Returns a promise that fulfills with an <ArrayBuffer> containing a copy of the Blob data.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
*/
@ -952,6 +1035,7 @@ declare namespace buffer {
/**
* Creates and returns a new Blob containing a subset of this Blob objects data. The original Blob is not altered
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param start The starting index
@ -962,6 +1046,7 @@ declare namespace buffer {
/**
* Returns a promise that fulfills with the contents of the Blob decoded as a UTF-8 string.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
*/

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import Want from './@ohos.app.ability.Want';
/**
@ -31,7 +31,7 @@ declare namespace appControl {
* @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS
* @param { string } appId - Indicates the app ID of the application.
* @param { Want } disposedWant - Indicates the disposed want.
* @param { AsyncCallback } callback - The callback of setting the disposed status result.
* @param { AsyncCallback<void> } callback - The callback of setting the disposed status result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { ApplicationInfo as _ApplicationInfo } from './bundleManager/ApplicationInfo';
import { Metadata as _Metadata } from './bundleManager/Metadata';
import { PermissionDef as _PermissionDef } from './bundleManager/PermissionDef';
@ -465,6 +465,7 @@ declare namespace bundleManager {
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @crossplatform
* @since 9
*/
export enum LaunchType {
@ -472,6 +473,7 @@ declare namespace bundleManager {
* Indicates that the ability has only one instance
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @crossplatform
* @since 9
*/
SINGLETON = 0,
@ -480,6 +482,7 @@ declare namespace bundleManager {
* Indicates that the ability can have multiple instances
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @crossplatform
* @since 9
*/
MULTITON = 1,
@ -734,12 +737,31 @@ declare namespace bundleManager {
function getBundleInfoForSelf(bundleFlags: number, callback: AsyncCallback<BundleInfo>): void;
/**
* Obtains bundleInfo based on bundleName, bundleFlags and options. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
* Obtains bundleInfo based on bundleName, bundleFlags. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned.
* @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @throws { BusinessError } 17700026 - The specified bundle is disabled.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void;
/**
* Obtains bundleInfo based on bundleName, bundleFlags and userId. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned.
* @param { number } userId - Indicates the user ID or do not pass user ID.
* @param { AsyncCallback } callback - The callback of getting bundle info result.
* @param { AsyncCallback<BundleInfo> } callback - The callback of getting bundle info result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
@ -750,11 +772,12 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void;
function getBundleInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback<BundleInfo>): void;
function getBundleInfo(bundleName: string,
bundleFlags: number, userId: number, callback: AsyncCallback<BundleInfo>): void;
/**
* Obtains bundleInfo based on bundleName, bundleFlags and options. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
* Obtains bundleInfo based on bundleName, bundleFlags and userId. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned.
@ -774,6 +797,25 @@ declare namespace bundleManager {
/**
* Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned.
* @param { AsyncCallback<ApplicationInfo> } callback - The callback of getting application info result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @throws { BusinessError } 17700026 - The specified bundle is disabled.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
function getApplicationInfo(bundleName: string, appFlags: number, callback: AsyncCallback<ApplicationInfo>): void;
/**
* Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned.
@ -789,11 +831,12 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function getApplicationInfo(bundleName: string, appFlags: number, callback: AsyncCallback<ApplicationInfo>): void;
function getApplicationInfo(bundleName: string, appFlags: number, userId: number, callback: AsyncCallback<ApplicationInfo>): void;
function getApplicationInfo(bundleName: string,
appFlags: number, userId: number, callback: AsyncCallback<ApplicationInfo>): void;
/**
* Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned.
@ -813,10 +856,26 @@ declare namespace bundleManager {
/**
* Obtains BundleInfo of all bundles available in the system.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned.
* @param { AsyncCallback<Array<BundleInfo>> } callback - The callback of getting a list of BundleInfo objects.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
function getAllBundleInfo(bundleFlags: number, callback: AsyncCallback<Array<BundleInfo>>): void;
/**
* Obtains BundleInfo of all bundles available in the system.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned.
* @param { number } userId - Indicates the user id.
* @param { AsyncCallback } callback - The callback of getting a list of BundleInfo objects.
* @param { AsyncCallback<Array<BundleInfo>> } callback - The callback of getting a list of BundleInfo objects.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
@ -825,11 +884,11 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function getAllBundleInfo(bundleFlags: number, callback: AsyncCallback<Array<BundleInfo>>): void;
function getAllBundleInfo(bundleFlags: number, userId: number, callback: AsyncCallback<Array<BundleInfo>>): void;
/**
* Obtains BundleInfo of all bundles available in the system.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned.
* @param { number } userId - Indicates the user id.
@ -846,10 +905,26 @@ declare namespace bundleManager {
/**
* Obtains information about all installed applications of a specified user.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned.
* @param { AsyncCallback<Array<ApplicationInfo>> } callback - The callback of getting a list of ApplicationInfo objects.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
function getAllApplicationInfo(appFlags: number, callback: AsyncCallback<Array<ApplicationInfo>>): void;
/**
* Obtains information about all installed applications of a specified user.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned.
* @param { number } userId - Indicates the user ID or do not pass user ID.
* @param { AsyncCallback } callback - The callback of getting a list of ApplicationInfo objects.
* @param { AsyncCallback<Array<ApplicationInfo>> } callback - The callback of getting a list of ApplicationInfo objects.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
@ -858,11 +933,12 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function getAllApplicationInfo(appFlags: number, callback: AsyncCallback<Array<ApplicationInfo>>): void;
function getAllApplicationInfo(appFlags: number, userId: number, callback: AsyncCallback<Array<ApplicationInfo>>): void;
function getAllApplicationInfo(appFlags: number,
userId: number, callback: AsyncCallback<Array<ApplicationInfo>>): void;
/**
* Obtains information about all installed applications of a specified user.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned.
* @param { number } userId - Indicates the user ID or do not pass user ID.
@ -879,6 +955,27 @@ declare namespace bundleManager {
/**
* Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { Want } want - Indicates the Want containing the application bundle name to be queried.
* @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned.
* @param { AsyncCallback<Array<AbilityInfo>> } callback - The callback of querying ability info result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @throws { BusinessError } 17700003 - The specified ability is not found.
* @throws { BusinessError } 17700026 - The specified bundle is disabled.
* @throws { BusinessError } 17700029 - The specified ability is disabled.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
function queryAbilityInfo(want: Want, abilityFlags: number, callback: AsyncCallback<Array<AbilityInfo>>): void;
/**
* Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { Want } want - Indicates the Want containing the application bundle name to be queried.
* @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned.
@ -896,11 +993,12 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function queryAbilityInfo(want: Want, abilityFlags: number, callback: AsyncCallback<Array<AbilityInfo>>): void;
function queryAbilityInfo(want: Want, abilityFlags: number, userId: number, callback: AsyncCallback<Array<AbilityInfo>>): void;
function queryAbilityInfo(want: Want,
abilityFlags: number, userId: number, callback: AsyncCallback<Array<AbilityInfo>>): void;
/**
* Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { Want } want - Indicates the Want containing the application bundle name to be queried.
* @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned.
@ -922,6 +1020,28 @@ declare namespace bundleManager {
/**
* Query extension info of by utilizing a Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { Want } want - Indicates the Want containing the application bundle name to be queried.
* @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType.
* @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the ExtensionAbilityInfo objects that will be returned.
* @param { AsyncCallback<Array<ExtensionAbilityInfo>> } callback - The callback of querying extension ability info result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @throws { BusinessError } 17700003 - The specified extensionAbility is not found.
* @throws { BusinessError } 17700026 - The specified bundle is disabled.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType,
extensionAbilityFlags: number, callback: AsyncCallback<Array<ExtensionAbilityInfo>>): void;
/**
* Query extension info of by utilizing a Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { Want } want - Indicates the Want containing the application bundle name to be queried.
* @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType.
@ -939,11 +1059,12 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: number, callback: AsyncCallback<Array<ExtensionAbilityInfo>>): void;
function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: number, userId: number, callback: AsyncCallback<Array<ExtensionAbilityInfo>>): void;
function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType,
extensionAbilityFlags: number, userId: number, callback: AsyncCallback<Array<ExtensionAbilityInfo>>): void;
/**
* Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { Want } want - Indicates the Want containing the application bundle name to be queried.
* @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType.
@ -961,10 +1082,12 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: number, userId?: number): Promise<Array<ExtensionAbilityInfo>>;
function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType,
extensionAbilityFlags: number, userId?: number): Promise<Array<ExtensionAbilityInfo>>;
/**
* Obtains bundle name by the given uid.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { number } uid - Indicates the UID of an application.
* @param { AsyncCallback<string> } callback - The callback of getting bundle name.
@ -976,10 +1099,11 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function getBundleNameByUid(uid: number, callback: AsyncCallback<string>): void
function getBundleNameByUid(uid: number, callback: AsyncCallback<string>): void;
/**
* Obtains bundle name by the given uid.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { number } uid - Indicates the UID of an application.
* @returns { Promise<string> } Returns the bundle name.
@ -995,6 +1119,7 @@ declare namespace bundleManager {
/**
* Obtains information about an application bundle contained in an ohos Ability Package (HAP).
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } hapFilePath - Indicates the path storing the HAP. The path should be the relative path to the data directory of the current application.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned.
@ -1007,10 +1132,11 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void;
/**
* Obtains information about an application bundle contained in an ohos Ability Package (HAP).
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } hapFilePath - Indicates the path storing the HAP. The path should be the relative path to the data directory of the current application.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned.
@ -1023,10 +1149,11 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number): Promise<BundleInfo>;
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number): Promise<BundleInfo>;
/**
* Clears cache data of a specified application.
*
* @permission ohos.permission.REMOVE_CACHE_FILES
* @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned.
* @param { AsyncCallback<void> } callback - The callback of cleaning bundle cache files result.
@ -1043,6 +1170,7 @@ declare namespace bundleManager {
/**
* Clears cache data of a specified application.
*
* @permission ohos.permission.REMOVE_CACHE_FILES
* @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned.
* @returns { Promise<void> } Clean bundle cache files result
@ -1059,6 +1187,7 @@ declare namespace bundleManager {
/**
* Sets whether to enable a specified application.
*
* @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it.
@ -1075,6 +1204,7 @@ declare namespace bundleManager {
/**
* Sets whether to enable a specified application.
*
* @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it.
@ -1091,8 +1221,9 @@ declare namespace bundleManager {
/**
* Sets whether to enable a specified ability.
*
* @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE
* @param { AbilityInfo } abilityInfo - Indicates information about the ability to set.
* @param { AbilityInfo } info - Indicates information about the ability to set.
* @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it.
* @param { AsyncCallback<void> } callback - The callback of setting ability enabled result.
* @throws { BusinessError } 201 - Permission denied.
@ -1108,8 +1239,9 @@ declare namespace bundleManager {
/**
* Sets whether to enable a specified ability.
*
* @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE
* @param { AbilityInfo } abilityInfo - Indicates information about the ability to set.
* @param { AbilityInfo } info - Indicates information about the ability to set.
* @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it.
* @returns { Promise<void> } set ability enabled result.
* @throws { BusinessError } 201 - Permission denied.
@ -1125,6 +1257,7 @@ declare namespace bundleManager {
/**
* Checks whether a specified application is enabled.
*
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { AsyncCallback<boolean> } callback - The callback of checking application enabled result. The result is true if enabled, false otherwise.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
@ -1138,8 +1271,9 @@ declare namespace bundleManager {
/**
* Checks whether a specified application is enabled.
*
* @param { string } bundleName - Indicates the bundle name of the application.
* @returns { Promise<boolean> } Returns true if the application is enabled; returns false otherwise.
* @returns { Promise<boolean> } Returns true if the application is enabled; returns false otherwise.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
@ -1151,6 +1285,7 @@ declare namespace bundleManager {
/**
* Checks whether a specified ability is enabled.
*
* @param { AbilityInfo } info - Indicates information about the ability to check.
* @param { AsyncCallback<boolean> } callback - The callback of checking ability enabled result. The result is true if enabled, false otherwise.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
@ -1165,6 +1300,7 @@ declare namespace bundleManager {
/**
* Checks whether a specified ability is enabled.
*
* @param { AbilityInfo } info - Indicates information about the ability to check.
* @returns { Promise<boolean> } Returns true if the ability is enabled; returns false otherwise.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
@ -1177,10 +1313,11 @@ declare namespace bundleManager {
*/
function isAbilityEnabled(info: AbilityInfo): Promise<boolean>;
/**
/**
* Obtains the Want for starting the main ability of an application based on the
* given bundle name. The main ability of an application is the ability that has the
* #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { number } userId - Indicates the user ID or do not pass user ID.
@ -1201,6 +1338,7 @@ declare namespace bundleManager {
* Obtains the Want for starting the main ability of an application based on the
* given bundle name. The main ability of an application is the ability that has the
* #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { AsyncCallback<Want> } callback - The callback for starting the application's main ability.
@ -1208,7 +1346,6 @@ declare namespace bundleManager {
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Input parameters check failed.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @throws { BusinessError } 17700004 - The specified user ID is not found.
* @throws { BusinessError } 17700026 - The specified bundle is disabled.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
@ -1220,6 +1357,7 @@ declare namespace bundleManager {
* Obtains the Want for starting the main ability of an application based on the
* given bundle name. The main ability of an application is the ability that has the
* #ACTION_HOME and #ENTITY_HOME Want filters set in the application's <b>config.json</b> or <b>module.json</b> file.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { number } userId - Indicates the user ID or do not pass user ID.
@ -1238,6 +1376,7 @@ declare namespace bundleManager {
/**
* Obtains the profile designated by metadata name, abilityName and moduleName from the current application.
*
* @param { string } moduleName - Indicates the moduleName of the application.
* @param { string } abilityName - Indicates the abilityName of the application.
* @param { string } metadataName - Indicates the name of metadata in ability.
@ -1255,6 +1394,7 @@ declare namespace bundleManager {
/**
* Obtains the profile designated by metadata name, abilityName and moduleName from the current application.
*
* @param { string } moduleName - Indicates the moduleName of the application.
* @param { string } abilityName - Indicates the abilityName of the application.
* @param { string } metadataName - Indicates the name of metadata in ability.
@ -1272,10 +1412,11 @@ declare namespace bundleManager {
/**
* Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application.
*
* @param { string } moduleName - Indicates the moduleName of the application.
* @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application.
* @param { string } metadataName - Indicates the name of metadata in ability.
* @param { AsyncCallback } callback - The callback of returning string in json-format of the corresponding config file.
* @param { AsyncCallback<Array<string>> } callback - The callback of returning string in json-format of the corresponding config file.
* @throws { BusinessError } 401 - Input parameters check failed.
* @throws { BusinessError } 17700002 - The specified moduleName is not existed.
* @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed.
@ -1288,6 +1429,7 @@ declare namespace bundleManager {
/**
* Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application.
*
* @param { string } moduleName - Indicates the moduleName of the application.
* @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application.
* @param { string } metadataName - Indicates the name of metadata in ability.
@ -1304,6 +1446,7 @@ declare namespace bundleManager {
/**
* Get the permission details by permission name.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } permissionName - Indicates permission name.
* @param { AsyncCallback<PermissionDef> } callback - The callback of get permissionDef object result.
@ -1319,6 +1462,7 @@ declare namespace bundleManager {
/**
* Get the permission details by permission name.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } permissionName - Indicates permission name.
* @returns { Promise<PermissionDef> } Returns permissionDef object.
@ -1334,6 +1478,7 @@ declare namespace bundleManager {
/**
* Obtains the label of a specified ability.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs.
* @param { string } moduleName - Indicates the module name.
@ -1356,6 +1501,7 @@ declare namespace bundleManager {
/**
* Obtains the label of a specified ability.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs.
* @param { string } moduleName - Indicates the module name.
@ -1378,11 +1524,12 @@ declare namespace bundleManager {
/**
* Obtains applicationInfo based on a given bundleName and bundleFlags.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned.
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned.
* @param { number } userId - Indicates the user ID or do not pass user ID.
* @returns Returns the ApplicationInfo object.
* @returns { ApplicationInfo } - Returns the ApplicationInfo object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
@ -1393,14 +1540,15 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: number) : ApplicationInfo;
function getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: number): ApplicationInfo;
/**
* Obtains applicationInfo based on a given bundleName and bundleFlags.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned.
* @returns Returns the ApplicationInfo object.
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned.
* @returns { ApplicationInfo } - Returns the ApplicationInfo object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
@ -1410,15 +1558,16 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function getApplicationInfoSync(bundleName: string, applicationFlags: number) : ApplicationInfo;
function getApplicationInfoSync(bundleName: string, applicationFlags: number): ApplicationInfo;
/**
* Obtains bundleInfo based on bundleName, bundleFlags and options.
* Obtains bundleInfo based on bundleName, bundleFlags and userId.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object that will be returned.
* @param { number } userId - Indicates the user ID or do not pass user ID.
* @returns Returns the BundleInfo object.
* @returns { BundleInfo } - Returns the BundleInfo object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
@ -1429,14 +1578,15 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function getBundleInfoSync(bundleName: string, bundleFlags: number, userId: number): BundleInfo;
function getBundleInfoSync(bundleName: string, bundleFlags: number, userId: number): BundleInfo;
/**
* Obtains bundleInfo based on bundleName, bundleFlags and options.
* Obtains bundleInfo based on bundleName, bundleFlags.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object that will be returned.
* @returns Returns the BundleInfo object.
* @returns { BundleInfo } - Returns the BundleInfo object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
@ -1446,10 +1596,11 @@ declare namespace bundleManager {
* @systemapi
* @since 9
*/
function getBundleInfoSync(bundleName: string, bundleFlags: number): BundleInfo;
function getBundleInfoSync(bundleName: string, bundleFlags: number): BundleInfo;
/**
* Obtains SharedBundleInfo of all shared bundle available in the system.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { AsyncCallback<Array<SharedBundleInfo>> } callback - The callback of getting a list of SharedBundleInfo objects.
* @throws { BusinessError } 201 - Permission denied.
@ -1462,6 +1613,7 @@ declare namespace bundleManager {
/**
* Obtains SharedBundleInfo of all shared bundle available in the system.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @returns { Promise<Array<SharedBundleInfo>> } Returns a list of SharedBundleInfo objects.
* @throws { BusinessError } 201 - Permission denied.
@ -1474,6 +1626,7 @@ declare namespace bundleManager {
/**
* Obtains SharedBundleInfo of shared bundle by bundle name and module name.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the bundleName of the application.
* @param { string } moduleName - Indicates the moduleName of the application.
@ -1491,6 +1644,7 @@ declare namespace bundleManager {
/**
* Obtains SharedBundleInfo of shared bundle by bundle name and module name.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the bundleName of the application.
* @param { string } moduleName - Indicates the moduleName of the application.
@ -1508,6 +1662,7 @@ declare namespace bundleManager {
/**
* Obtains configuration information about an application.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1515,6 +1670,7 @@ declare namespace bundleManager {
/**
* Indicates the Metadata.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1522,6 +1678,7 @@ declare namespace bundleManager {
/**
* Obtains configuration information about a bundle.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1529,6 +1686,7 @@ declare namespace bundleManager {
/**
* The scene which is used.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1536,13 +1694,15 @@ declare namespace bundleManager {
/**
* Indicates the required permissions details defined in file config.json.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
export type ReqPermissionDetail = _BundleInfo.ReqPermissionDetail;
/**
/**
* Indicates the SignatureInfo.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1550,6 +1710,7 @@ declare namespace bundleManager {
/**
* Obtains configuration information about a module.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1557,6 +1718,7 @@ declare namespace bundleManager {
/**
* Obtains preload information about a module.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1564,6 +1726,7 @@ declare namespace bundleManager {
/**
* Obtains dependency information about a module.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1571,6 +1734,7 @@ declare namespace bundleManager {
/**
* Obtains configuration information about an ability.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1578,6 +1742,7 @@ declare namespace bundleManager {
/**
* Contains basic Ability information. Indicates the window size..
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1585,6 +1750,7 @@ declare namespace bundleManager {
/**
* Obtains extension information about a bundle.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1592,6 +1758,7 @@ declare namespace bundleManager {
/**
* Indicates the defined permission details in file config.json.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
@ -1600,6 +1767,7 @@ declare namespace bundleManager {
/**
* Contains basic Ability information, which uniquely identifies an ability.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @since 9
*/
@ -1607,6 +1775,7 @@ declare namespace bundleManager {
/**
* Contains shared bundle info.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 10

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { Callback } from './basic';
import { Callback } from './@ohos.base';
/**
* Bundle monitor

640
api/@ohos.bundle.d.ts vendored
View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { ApplicationInfo } from './bundle/applicationInfo';
import { AbilityInfo } from './bundle/abilityInfo';
import { PermissionDef } from './bundle/PermissionDef';
@ -30,16 +30,16 @@ import { BundleInstaller } from './bundle/bundleInstaller';
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager
* @name bundle
*/
declare namespace bundle {
/**
* BundleFlag
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager.BundleFlag, ohos.bundle.bundleManager.ApplicationFlag or
* ohos.bundle.bundleManager.AbilityFlag
* @name BundleFlag
* @useinstead ohos.bundle.bundleManager.BundleFlag
*/
enum BundleFlag {
GET_BUNDLE_DEFAULT = 0x00000000,
@ -82,10 +82,12 @@ declare namespace bundle {
}
/**
* ColorMode
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @name ColorMode
*/
export enum ColorMode {
AUTO_MODE = -1,
@ -94,11 +96,13 @@ declare namespace bundle {
}
/**
* GrantStatus
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager.PermissionGrantState
* @name GrantStatus
*/
export enum GrantStatus {
PERMISSION_DENIED = -1,
@ -106,15 +110,18 @@ declare namespace bundle {
}
/**
* AbilityType
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager.AbilityType
* @name AbilityType
*/
export enum AbilityType {
/**
* @default Indicates an unknown ability type
* Indicates an unknown ability type
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
@ -122,7 +129,8 @@ declare namespace bundle {
UNKNOWN,
/**
* @default Indicates that the ability has a UI
* Indicates that the ability has a UI
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
@ -130,7 +138,8 @@ declare namespace bundle {
PAGE,
/**
* @default Indicates that the ability does not have a UI
* Indicates that the ability does not have a UI
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
@ -138,7 +147,8 @@ declare namespace bundle {
SERVICE,
/**
* @default Indicates that the ability is used to provide data access services
* Indicates that the ability is used to provide data access services
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
@ -147,10 +157,12 @@ declare namespace bundle {
}
/**
* AbilitySubType
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @name AbilitySubType
*/
export enum AbilitySubType {
UNSPECIFIED = 0,
@ -158,15 +170,18 @@ declare namespace bundle {
}
/**
* DisplayOrientation
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager.DisplayOrientation
* @name DisplayOrientation
*/
export enum DisplayOrientation {
/**
* @default Indicates that the system automatically determines the display orientation
* Indicates that the system automatically determines the display orientation
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
@ -174,7 +189,8 @@ declare namespace bundle {
UNSPECIFIED,
/**
* @default Indicates the landscape orientation
* Indicates the landscape orientation
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
@ -182,7 +198,8 @@ declare namespace bundle {
LANDSCAPE,
/**
* @default Indicates the portrait orientation
* Indicates the portrait orientation
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
@ -190,7 +207,8 @@ declare namespace bundle {
PORTRAIT,
/**
* @default Indicates the page ability orientation is the same as that of the nearest ability in the stack
* Indicates the page ability orientation is the same as that of the nearest ability in the stack
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
@ -199,15 +217,18 @@ declare namespace bundle {
}
/**
* LaunchMode
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager.LaunchType
* @name LaunchMode
*/
export enum LaunchMode {
/**
* @default Indicates that the ability has only one instance
* Indicates that the ability has only one instance
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
@ -215,7 +236,8 @@ declare namespace bundle {
SINGLETON = 0,
/**
* @default Indicates that the ability can have multiple instances
* Indicates that the ability can have multiple instances
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
@ -224,14 +246,17 @@ declare namespace bundle {
}
/**
* BundleOptions
*
* @typedef BundleOptions
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @name BundleOptions
*/
export interface BundleOptions {
/**
* @default Indicates the user id
* Indicates the user id
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
@ -240,10 +265,12 @@ declare namespace bundle {
}
/**
* InstallErrorCode
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @name InstallErrorCode
*/
export enum InstallErrorCode {
SUCCESS = 0,
@ -306,148 +333,343 @@ declare namespace bundle {
/**
* Obtains bundleInfo based on bundleName, bundleFlags and options.
*
* @since 7
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleName Indicates the application bundle name to be queried.
* @param bundleFlags Indicates the application bundle flags to be queried.
* @param options Indicates the bundle options object.
* @returns Returns the BundleInfo object.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } bundleFlags - Indicates the application bundle flags to be queried.
* @param { BundleOptions } options Indicates the bundle options object.
* @param { AsyncCallback<BundleInfo> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getBundleInfo
*/
function getBundleInfo(bundleName: string, bundleFlags: number, options: BundleOptions, callback: AsyncCallback<BundleInfo>): void;
function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void;
function getBundleInfo(bundleName: string, bundleFlags: number, options?: BundleOptions): Promise<BundleInfo>;
function getBundleInfo(bundleName: string,
bundleFlags: number, options: BundleOptions, callback: AsyncCallback<BundleInfo>): void;
/**
* Obtains bundleInfo based on bundleName, bundleFlags and options.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } bundleFlags - Indicates the application bundle flags to be queried.
* @param { AsyncCallback<BundleInfo> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getBundleInfo
*/
function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void;
/**
* Obtains bundleInfo based on bundleName, bundleFlags and options.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } bundleFlags - Indicates the application bundle flags to be queried.
* @param { BundleOptions } options Indicates the bundle options object.
* @returns { Promise<BundleInfo> } Returns the BundleInfo object.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getBundleInfo
*/
function getBundleInfo(bundleName: string, bundleFlags: number, options?: BundleOptions): Promise<BundleInfo>;
/**
* Obtains the interface used to install bundles.
*
* @since 7
* @syscap SystemCapability.BundleManager.BundleFramework
* @returns Returns the IBundleInstaller interface.
* @permission ohos.permission.INSTALL_BUNDLE
* @param { AsyncCallback<BundleInstaller> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.installer#getBundleInstaller
*/
function getBundleInstaller(callback: AsyncCallback<BundleInstaller>): void;
/**
* Obtains the interface used to install bundles.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @returns { Promise<BundleInstaller> } Returns the IBundleInstaller interface.
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.installer#getBundleInstaller
*/
function getBundleInstaller(): Promise<BundleInstaller>;
/**
* Obtains information about the current ability.
*
* @since 7
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleName Indicates the application bundle name to be queried.
* @param abilityName Indicates the ability name.
* @returns Returns the AbilityInfo object for the current ability.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { string } abilityName - Indicates the ability name.
* @param { AsyncCallback<AbilityInfo> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#queryAbilityInfo
*/
function getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback<AbilityInfo>): void;
/**
* Obtains information about the current ability.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { string } abilityName - Indicates the ability name.
* @returns { Promise<AbilityInfo> } Returns the AbilityInfo object for the current ability.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#queryAbilityInfo
*/
function getAbilityInfo(bundleName: string, abilityName: string): Promise<AbilityInfo>;
/**
* Obtains based on a given bundle name.
*
* @since 7
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleName Indicates the application bundle name to be queried.
* @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo object
* that will be returned.
* @param userId Indicates the user ID or do not pass user ID.
* @returns Returns the ApplicationInfo object.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } bundleFlags - Indicates the flag used to specify information contained
* in the ApplicationInfo object that will be returned.
* @param { number } userId - Indicates the user ID or do not pass user ID.
* @param { AsyncCallback<ApplicationInfo> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getApplicationInfo
*/
function getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback<ApplicationInfo>) : void;
function getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback<ApplicationInfo>) : void;
function getApplicationInfo(bundleName: string, bundleFlags: number, userId?: number) : Promise<ApplicationInfo>;
function getApplicationInfo(bundleName: string,
bundleFlags: number, userId: number, callback: AsyncCallback<ApplicationInfo>) : void;
/**
* Obtains based on a given bundle name.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } bundleFlags - Indicates the flag used to specify information contained
* in the ApplicationInfo object that will be returned.
* @param { AsyncCallback<ApplicationInfo> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getApplicationInfo
*/
function getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback<ApplicationInfo>): void;
/**
* Obtains based on a given bundle name.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } bundleFlags - Indicates the flag used to specify information contained
* in the ApplicationInfo object that will be returned.
* @param { number } userId - Indicates the user ID or do not pass user ID.
* @returns { Promise<ApplicationInfo> } Returns the ApplicationInfo object.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getApplicationInfo
*/
function getApplicationInfo(bundleName: string, bundleFlags: number, userId?: number): Promise<ApplicationInfo>;
/**
* Query the AbilityInfo by the given Want.
*
* @since 7
* @syscap SystemCapability.BundleManager.BundleFramework
* @param want Indicates the Want containing the application bundle name to
* be queried.
* @param bundleFlags Indicates the flag used to specify information contained in the AbilityInfo objects that
* will be returned.
* @param userId Indicates the user ID.
* @returns Returns a list of AbilityInfo objects.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { Want } want - Indicates the Want containing the application bundle name
* to be queried.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that
* will be returned.
* @param { number } userId - Indicates the user ID.
* @param { AsyncCallback<Array<AbilityInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#queryAbilityInfo
*/
function queryAbilityByWant(want: Want,
bundleFlags: number, userId: number, callback: AsyncCallback<Array<AbilityInfo>>): void;
/**
* Query the AbilityInfo by the given Want.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { Want } want - Indicates the Want containing the application bundle name
* to be queried.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that
* will be returned.
* @param { AsyncCallback<Array<AbilityInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#queryAbilityInfo
*/
function queryAbilityByWant(want: Want, bundleFlags: number, userId: number, callback: AsyncCallback<Array<AbilityInfo>>): void;
function queryAbilityByWant(want: Want, bundleFlags: number, callback: AsyncCallback<Array<AbilityInfo>>): void;
function queryAbilityByWant(want: Want, bundleFlags: number, userId?:number): Promise<Array<AbilityInfo>>;
/**
* Query the AbilityInfo by the given Want.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { Want } want - Indicates the Want containing the application bundle name
* to be queried.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that
* will be returned.
* @param { number } userId - Indicates the user ID.
* @returns { Promise<Array<AbilityInfo>> } Returns a list of AbilityInfo objects.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#queryAbilityInfo
*/
function queryAbilityByWant(want: Want, bundleFlags: number, userId?: number): Promise<Array<AbilityInfo>>;
/**
* Obtains BundleInfo of all bundles available in the system.
*
* @since 7
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleFlag Indicates the flag used to specify information contained in the BundleInfo that will be
* returned.
* @param userId Indicates the user id.
* @returns Returns a list of BundleInfo objects.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { BundleFlag } bundleFlag - Indicates the flag used to specify information contained
* in the BundleInfo that will be returned.
* @param { number } userId - Indicates the user ID.
* @param { AsyncCallback<Array<BundleInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getAllBundleInfo
*/
function getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback<Array<BundleInfo>>) : void;
function getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback<Array<BundleInfo>>) : void;
function getAllBundleInfo(bundleFlag: BundleFlag, userId?: number) : Promise<Array<BundleInfo>>;
function getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback<Array<BundleInfo>>): void;
/**
* Obtains BundleInfo of all bundles available in the system.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { BundleFlag } bundleFlag - Indicates the flag used to specify information contained
* in the BundleInfo that will be returned.
* @param { AsyncCallback<Array<BundleInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getAllBundleInfo
*/
function getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback<Array<BundleInfo>>): void;
/**
* Obtains BundleInfo of all bundles available in the system.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { BundleFlag } bundleFlag - Indicates the flag used to specify information contained
* in the BundleInfo that will be returned.
* @param { number } userId - Indicates the user ID.
* @returns { Promise<Array<BundleInfo>> } Returns a list of BundleInfo objects.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getAllBundleInfo
*/
function getAllBundleInfo(bundleFlag: BundleFlag, userId?: number): Promise<Array<BundleInfo>>;
/**
* Obtains information about all installed applications of a specified user.
*
* @since 7
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo objects
* that will be returned.
* @param userId Indicates the user ID or do not pass user ID.
* @returns Returns a list of ApplicationInfo objects.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { number } bundleFlags - Indicates the flag used to specify information contained
* in the ApplicationInfo objects that will be returned.
* @param { number } userId - Indicates the user ID.
* @param { AsyncCallback<Array<ApplicationInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getAllApplicationInfo
*/
function getAllApplicationInfo(bundleFlags: number, userId: number, callback: AsyncCallback<Array<ApplicationInfo>>) : void;
function getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback<Array<ApplicationInfo>>) : void;
function getAllApplicationInfo(bundleFlags: number, userId?: number) : Promise<Array<ApplicationInfo>>;
function getAllApplicationInfo(bundleFlags: number,
userId: number, callback: AsyncCallback<Array<ApplicationInfo>>) : void;
/**
* Obtains information about all installed applications of a specified user.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { number } bundleFlags - Indicates the flag used to specify information contained
* in the ApplicationInfo objects that will be returned.
* @param { AsyncCallback<Array<ApplicationInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getAllApplicationInfo
*/
function getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback<Array<ApplicationInfo>>): void;
/**
* Obtains information about all installed applications of a specified user.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { number } bundleFlags - Indicates the flag used to specify information contained
* in the ApplicationInfo objects that will be returned.
* @param { number } userId - Indicates the user ID or do not pass user ID.
* @returns { Promise<Array<ApplicationInfo>> } Returns a list of ApplicationInfo objects.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getAllApplicationInfo
*/
function getAllApplicationInfo(bundleFlags: number, userId?: number): Promise<Array<ApplicationInfo>>;
/**
* Obtains bundle name by the given uid.
*
* @since 8
* @param { number } uid - Indicates the UID of an application.
* @param { AsyncCallback<string> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @param uid Indicates the UID of an application.
* @returns Returns the bundle name.
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getNameForUid
*/
function getNameForUid(uid: number, callback: AsyncCallback<string>) : void
function getNameForUid(uid: number) : Promise<string>;
function getNameForUid(uid: number, callback: AsyncCallback<string>): void;
/**
* Obtains bundle name by the given uid.
*
* @param { number } uid - Indicates the UID of an application.
* @returns { Promise<string> } Returns the bundle name.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getNameForUid
*/
function getNameForUid(uid: number): Promise<string>;
/**
* Obtains information about an application bundle contained in an ohos Ability Package (HAP).
*
* @since 7
* @param { string } hapFilePath - Indicates the path storing the HAP. The path should be the relative path
* to the data directory of the current application.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the
* BundleInfo object to be returned.
* @param { AsyncCallback<BundleInfo> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @param hapFilePath Indicates the path storing the HAP. The path should be the relative path to the data
* directory of the current application.
* @param bundleFlags Indicates the flag used to specify information contained in the BundleInfo object to be
* returned.
* @returns Returns the BundleInfo object.
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getBundleArchiveInfo
*/
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>) : void
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise<BundleInfo>;
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback<BundleInfo>): void;
/**
* Obtains information about an application bundle contained in an ohos Ability Package (HAP).
*
* @param { string } hapFilePath - Indicates the path storing the HAP. The path should be the relative path
* to the data directory of the current application.
* @param { number } bundleFlags - Indicates the flag used to specify information contained in the
* BundleInfo object to be returned.
* @returns { Promise<BundleInfo> } - Returns the BundleInfo object.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getBundleArchiveInfo
*/
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number): Promise<BundleInfo>;
/**
* Obtains the Want for starting the main ability of an application based on the
@ -455,134 +677,254 @@ declare namespace bundle {
* #ACTION_HOME and #ENTITY_HOME Want
* filters set in the application's <b>config.json</b> file.
*
* @since 7
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleName Indicates the bundle name of the application.
* @returns Returns the Want for starting the application's main ability if any; returns null if
* the given bundle does not exist or does not contain any main ability.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { AsyncCallback<Want> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getLaunchWantForBundle
*/
function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback<Want>): void;
/**
* Obtains the Want for starting the main ability of an application based on the
* given bundle name. The main ability of an application is the ability that has the
* #ACTION_HOME and #ENTITY_HOME Want
* filters set in the application's <b>config.json</b> file.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the bundle name of the application.
* @returns { Promise<Want> } Returns the Want for starting the application's main ability if any.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getLaunchWantForBundle
*/
function getLaunchWantForBundle(bundleName: string): Promise<Want>;
/**
* Clears cache data of a specified application.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleName Indicates the bundle name of the application whose cache data is to be cleared.
* @param callback Indicates the callback to be invoked for returning the operation result.
* @permission ohos.permission.REMOVE_CACHE_FILES
* @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleared.
* @param { AsyncCallback<void> } callback Indicates the callback to be invoked for returning the operation result.
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#cleanBundleCacheFiles
*/
function cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback<void>): void;
/**
* Clears cache data of a specified application.
*
* @permission ohos.permission.REMOVE_CACHE_FILES
* @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleared.
* @returns { Promise<void> }
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#cleanBundleCacheFiles
*/
function cleanBundleCacheFiles(bundleName: string): Promise<void>;
/**
* Sets whether to enable a specified application.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleName Indicates the bundle name of the application.
* @param isEnable Specifies whether to enable the application. The value true means to enable it, and the
* value false means to disable it.
* @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { boolean } isEnable - Specifies whether to enable the application. The value true means to enable it,
* and the value false means to disable it.
* @param { AsyncCallback<void> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#setApplicationEnabled
*/
function setApplicationEnabled(bundleName: string, isEnable: boolean, callback: AsyncCallback<void>): void;
/**
* Sets whether to enable a specified application.
*
* @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { boolean } isEnable - Specifies whether to enable the application. The value true means to enable it,
* and the value false means to disable it.
* @returns { Promise<void> }
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#setApplicationEnabled
*/
function setApplicationEnabled(bundleName: string, isEnable: boolean): Promise<void>;
/**
* Sets whether to enable a specified ability.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param abilityInfo Indicates information about the ability to set.
* @param isEnable Specifies whether to enable the ability. The value true means to enable it, and the
* value false means to disable it..
* @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE
* @param { AbilityInfo } info - Indicates information about the ability to set.
* @param { boolean } isEnable - Specifies whether to enable the application. The value true means to enable it,
* and the value false means to disable it.
* @param { AsyncCallback<void> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#setAbilityEnabled
*/
function setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback<void>): void;
/**
* Sets whether to enable a specified ability.
*
* @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE
* @param { AbilityInfo } info - Indicates information about the ability to set.
* @param { boolean } isEnable - Specifies whether to enable the application. The value true means to enable it,
* and the value false means to disable it.
* @returns { Promise<void> }
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#setAbilityEnabled
*/
function setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise<void>;
/**
* Get the permission details by permissionName.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param permissionName Indicates permission name.
* @returns Returns permissionDef object.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } permissionName - Indicates permission name.
* @param { AsyncCallback<PermissionDef> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getPermissionDef
*/
function getPermissionDef(permissionName: string, callback: AsyncCallback<PermissionDef>): void;
/**
* Get the permission details by permissionName.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } permissionName - Indicates permission name.
* @returns { Promise<PermissionDef> } Returns permissionDef object.
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getPermissionDef
*/
function getPermissionDef(permissionName: string): Promise<PermissionDef>;
/**
* Obtains the label of a specified ability.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleName Indicates the bundle name of the application to which the ability belongs.
* @param abilityName Indicates the ability name.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @returns Returns the label representing the label of the specified ability.
* @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs.
* @param { string } abilityName - Indicates the ability name.
* @param { AsyncCallback<string> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getAbilityLabel
*/
function getAbilityLabel(bundleName: string, abilityName: string, callback: AsyncCallback<string>): void;
/**
* Obtains the label of a specified ability.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs.
* @param { string } abilityName - Indicates the ability name.
* @returns { Promise<string> } Returns the label representing the label of the specified ability.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#getAbilityLabel
*/
function getAbilityLabel(bundleName: string, abilityName: string): Promise<string>;
/**
* Obtains the icon of a specified ability.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleName Indicates the bundle name of the application to which the ability belongs.
* @param abilityName Indicates the ability name.
* @returns Returns the PixelMap object representing the icon of the specified ability.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @deprecated since 9
* @useinstead ohos.resourceManager#getMediaContent
*/
* Obtains the icon of a specified ability.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs.
* @param { string } abilityName - Indicates the ability name.
* @param { AsyncCallback<image.PixelMap> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
* @useinstead ohos.resourceManager#getMediaContent
*/
function getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback<image.PixelMap>): void;
/**
* Obtains the icon of a specified ability.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
* @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs.
* @param { string } abilityName - Indicates the ability name.
* @returns { Promise<image.PixelMap> } Returns the PixelMap object representing the icon of the specified ability.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
* @useinstead ohos.resourceManager#getMediaContent
*/
function getAbilityIcon(bundleName: string, abilityName: string): Promise<image.PixelMap>;
/**
* Checks whether a specified ability is enabled.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param info Indicates information about the ability to check.
* @returns Returns true if the ability is enabled; returns false otherwise.
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#isAbilityEnabled
*/
* Checks whether a specified ability is enabled.
*
* @param { AbilityInfo } info - Indicates information about the ability to check.
* @param { AsyncCallback<boolean> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#isAbilityEnabled
*/
function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback<boolean>): void;
/**
* Checks whether a specified ability is enabled.
*
* @param { AbilityInfo } info - Indicates information about the ability to check.
* @returns { Promise<boolean> } Returns true if the ability is enabled; returns false otherwise.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#isAbilityEnabled
*/
function isAbilityEnabled(info: AbilityInfo): Promise<boolean>;
/**
* Checks whether a specified application is enabled.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleName Indicates the bundle name of the application.
* @returns Returns true if the application is enabled; returns false otherwise.
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#isApplicationEnabled
*/
* Checks whether a specified application is enabled.
*
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { AsyncCallback<boolean> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#isApplicationEnabled
*/
function isApplicationEnabled(bundleName: string, callback: AsyncCallback<boolean>): void;
/**
* Checks whether a specified application is enabled.
*
* @param { string } bundleName - Indicates the bundle name of the application.
* @returns { Promise<boolean> } Returns true if the application is enabled; returns false otherwise.
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager#isApplicationEnabled
*/
function isApplicationEnabled(bundleName: string): Promise<boolean>;
}

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { BundleInfo } from './bundleManager/BundleInfo';
import { ElementName } from './bundleManager/ElementName';
@ -133,8 +133,25 @@ declare namespace defaultAppManager {
* @systemapi
* @since 9
*/
function getDefaultApplication(type: string, userId: number, callback: AsyncCallback<BundleInfo>) : void;
function getDefaultApplication(type: string, callback: AsyncCallback<BundleInfo>) : void;
function getDefaultApplication(type: string, userId: number, callback: AsyncCallback<BundleInfo>): void;
/**
* Get default application based on type.
*
* @permission ohos.permission.GET_DEFAULT_APPLICATION
* @param { string } type - Application type or a file type that conforms to media type format.
* @param { AsyncCallback<BundleInfo> } callback - The callback of the BundleInfo object result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 17700023 - The specified default app does not exist.
* @throws { BusinessError } 17700025 - The specified type is invalid.
* @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp
* @systemapi
* @since 9
*/
function getDefaultApplication(type: string, callback: AsyncCallback<BundleInfo>): void;
/**
* Get default application based on type.
@ -177,7 +194,25 @@ declare namespace defaultAppManager {
*/
function setDefaultApplication(type: string,
elementName: ElementName, userId: number, callback: AsyncCallback<void>) : void;
function setDefaultApplication(type: string, elementName: ElementName, callback: AsyncCallback<void>) : void;
/**
* Set default application based on type.
*
* @permission ohos.permission.SET_DEFAULT_APPLICATION
* @param { string } type - Application type or a file type that conforms to media type format.
* @param { ElementName } elementName - Uniquely identifies an ability or extensionAbility.
* @param { AsyncCallback<void> } callback - The callback of setting default application result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 17700025 - The specified type is invalid.
* @throws { BusinessError } 17700028 - The specified ability does not match the type.
* @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp
* @systemapi
* @since 9
*/
function setDefaultApplication(type: string, elementName: ElementName, callback: AsyncCallback<void>): void;
/**
* Set default application based on type.
@ -217,8 +252,24 @@ declare namespace defaultAppManager {
* @systemapi
* @since 9
*/
function resetDefaultApplication(type: string, userId: number, callback: AsyncCallback<void>) : void;
function resetDefaultApplication(type: string, callback: AsyncCallback<void>) : void;
function resetDefaultApplication(type: string, userId: number, callback: AsyncCallback<void>): void;
/**
* Reset default application based on type.
*
* @permission ohos.permission.SET_DEFAULT_APPLICATION
* @param { string } type - Application type or a file type that conforms to media type format.
* @param { AsyncCallback<void> } callback - The callback of resetting default application result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 17700025 - The specified type is invalid.
* @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp
* @systemapi
* @since 9
*/
function resetDefaultApplication(type: string, callback: AsyncCallback<void>): void;
/**
* Reset default application based on type.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { ElementName } from './bundleManager/ElementName';
import { RemoteAbilityInfo as _RemoteAbilityInfo } from './bundleManager/RemoteAbilityInfo';
@ -135,7 +135,7 @@ declare namespace distributedBundleManager {
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { ElementName } elementName - Indicates the elementName.
* @param { string } locale - Indicates the locale info
* @returns { Promise<Array<RemoteAbilityInfo>> } The result of getting the ability info of the remote device.
* @returns { Promise<RemoteAbilityInfo> } The result of getting the ability info of the remote device.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.
@ -156,7 +156,7 @@ declare namespace distributedBundleManager {
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { Array<ElementName> } elementNames - Indicates the elementNames, Maximum array length ten.
* @param { string } locale - Indicates the locale info
* @param { AsyncCallback } callback - Returns the abilities info of the remote device.
* @param { AsyncCallback<Array<RemoteAbilityInfo>> } callback - Returns the abilities info of the remote device.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { DispatchInfo as _DispatchInfo } from './bundleManager/DispatchInfo';
import * as _PackInfo from './bundleManager/BundlePackInfo';
@ -170,7 +170,7 @@ declare namespace freeInstall {
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the bundle name of the application.
* @param { string } moduleName - Indicates the module name of the application.
* @returns { Promise<void> } Returns true if the module is removable; returns false otherwise.
* @returns { Promise<boolean> } Returns true if the module is removable; returns false otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - The parameter check failed.

View File

@ -13,98 +13,167 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { BundleStatusCallback } from './bundle/bundleStatusCallback';
import { LauncherAbilityInfo } from './bundle/launcherAbilityInfo';
import { ShortcutInfo } from './bundle/shortcutInfo';
/**
* inner bundle manager.
* @name innerBundleManager
* @since 8
*
* @namespace innerBundleManager
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.launcherBundleManager
*/
declare namespace innerBundleManager {
/**
* Obtains based on a given bundleName and userId.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleName Indicates the application bundle name to be queried.
* @param userId Indicates the id for the user.
* @returns Returns the LauncherAbilityInfo object.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } userId - Indicates the id for the user.
* @param { AsyncCallback<Array<LauncherAbilityInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.launcherBundleManager#getLauncherAbilityInfo
*/
function getLauncherAbilityInfos(bundleName: string, userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>) : void;
function getLauncherAbilityInfos(bundleName: string, userId: number) : Promise<Array<LauncherAbilityInfo>>;
function getLauncherAbilityInfos(bundleName: string,
userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>) : void;
/**
* Obtains based on a given bundleName and userId.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { number } userId - Indicates the id for the user.
* @returns { Promise<Array<LauncherAbilityInfo>> } Returns the LauncherAbilityInfo array.
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.launcherBundleManager#getLauncherAbilityInfo
*/
function getLauncherAbilityInfos(bundleName: string, userId: number): Promise<Array<LauncherAbilityInfo>>;
/**
* Register Callback.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param type Indicates the command should be implement.
* @param LauncherStatusCallback Indicates the callback to be register.
* @returns { string | Promise<string> } Returns the result of register.
* @permission ohos.permission.LISTEN_BUNDLE_CHANGE
* @param { 'BundleStatusChange' } type - Indicates the command should be implement.
* @param { BundleStatusCallback } bundleStatusCallback - Indicates the callback to be register.
* @param { AsyncCallback<string> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleMonitor#on
*/
function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback<string>) : void;
function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback): Promise<string>;
function on(type:'BundleStatusChange',
bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback<string>) : void;
/**
* Register Callback.
*
* @permission ohos.permission.LISTEN_BUNDLE_CHANGE
* @param { 'BundleStatusChange' } type - Indicates the command should be implement.
* @param { BundleStatusCallback } bundleStatusCallback - Indicates the callback to be register.
* @returns { Promise<string> } - Returns the result of register.
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleMonitor#on
*/
function on(type: 'BundleStatusChange', bundleStatusCallback: BundleStatusCallback): Promise<string>;
/**
* UnRegister Callback.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param type Indicates the command should be implement.
* @returns { string | Promise<string> } Returns the result of unregister.
* @permission ohos.permission.LISTEN_BUNDLE_CHANGE
* @param { 'BundleStatusChange' } type - Indicates the command should be implement.
* @param { AsyncCallback<string> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleMonitor#off
*/
function off(type:"BundleStatusChange", callback: AsyncCallback<string>) : void;
function off(type:"BundleStatusChange"): Promise<string>;
function off(type: 'BundleStatusChange', callback: AsyncCallback<string>): void;
/**
* UnRegister Callback.
*
* @permission ohos.permission.LISTEN_BUNDLE_CHANGE
* @param { 'BundleStatusChange' } type - Indicates the command should be implement.
* @returns { Promise<string> } Returns the result of unregister.
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.bundleMonitor#off
*/
function off(type: 'BundleStatusChange'): Promise<string>;
/**
* Obtains based on a given userId.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param userId Indicates the id for the user.
* @returns Returns the LauncherAbilityInfo object.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { number } userId - Indicates the id for the user.
* @param { AsyncCallback<Array<LauncherAbilityInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.launcherBundleManager#getAllLauncherAbilityInfos
*/
function getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>) : void;
function getAllLauncherAbilityInfos(userId: number) : Promise<Array<LauncherAbilityInfo>>;
function getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback<Array<LauncherAbilityInfo>>): void;
/**
* Obtains based on a given userId.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { number } userId - Indicates the id for the user.
* @returns { Promise<Array<LauncherAbilityInfo>> } Returns the LauncherAbilityInfo array.
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.launcherBundleManager#getAllLauncherAbilityInfos
*/
function getAllLauncherAbilityInfos(userId: number): Promise<Array<LauncherAbilityInfo>>;
/**
* Obtains based on a given bundleName.
*
* @since 8
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleName Indicates the application bundle name to be queried.
* @returns Returns the LauncherShortcutInfo object.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @param { AsyncCallback<Array<ShortcutInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.launcherBundleManager#getShortcutInfo
*/
function getShortcutInfos(bundleName :string, callback: AsyncCallback<Array<ShortcutInfo>>) : void;
function getShortcutInfos(bundleName : string) : Promise<Array<ShortcutInfo>>;
function getShortcutInfos(bundleName: string, callback: AsyncCallback<Array<ShortcutInfo>>): void;
/**
* Obtains based on a given bundleName.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the application bundle name to be queried.
* @returns { Promise<Array<ShortcutInfo>> } Returns the LauncherShortcutInfo array.
* @syscap SystemCapability.BundleManager.BundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.launcherBundleManager#getShortcutInfo
*/
function getShortcutInfos(bundleName: string): Promise<Array<ShortcutInfo>>;
}
export default innerBundleManager;

View File

@ -13,10 +13,11 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
/**
* Support install, upgrade, remove and recover bundles on the devices.
*
* @namespace installer
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
@ -25,20 +26,21 @@ import { AsyncCallback } from './basic';
declare namespace installer {
/**
* Obtains the interface used to install bundle.
* @param { AsyncCallback } callback - The callback of BundleInstaller object.
*
* @param { AsyncCallback<BundleInstaller> } callback - The callback of BundleInstaller object.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Input parameters check failed.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
function getBundleInstaller(callback: AsyncCallback<BundleInstaller>) : void
function getBundleInstaller(callback: AsyncCallback<BundleInstaller>): void;
/**
* Obtains the interface used to install bundle.
* @param { AsyncCallback } callback - The callback of getting a list of BundleInstaller objects.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
*
* @returns { Promise<BundleInstaller> } BundleInstaller object.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
@ -47,6 +49,7 @@ declare namespace installer {
/**
* Bundle installer interface, include install uninstall recover.
*
* @interface BundleInstaller
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
@ -55,10 +58,11 @@ declare namespace installer {
interface BundleInstaller {
/**
* Install haps for an application.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @param { Array<string> } hapFilePaths - Indicates the path where the hap of the application is stored.
* @param { InstallParam } installParam - Indicates other parameters required for the installation.
* @param { AsyncCallback } callback - The callback of installing haps result.
* @param { AsyncCallback<void> } callback - The callback of installing haps result.
* @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Input parameters check failed.
@ -78,15 +82,41 @@ declare namespace installer {
* @systemapi
* @since 9
*/
install(hapFilePaths: Array<string>, installParam: InstallParam, callback: AsyncCallback<void>) : void;
install(hapFilePaths: Array<string>, callback: AsyncCallback<void>) : void;
install(hapFilePaths: Array<string>, installParam: InstallParam, callback: AsyncCallback<void>): void;
/**
* Install haps for an application.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @param { Array<string> } hapFilePaths - Indicates the path where the hap of the application is stored.
* @param { AsyncCallback<void> } callback - The callback of installing haps result.
* @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Input parameters check failed.
* @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed.
* @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified.
* @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large.
* @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information.
* @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space.
* @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early.
* @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist.
* @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed.
* @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions.
* @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths.
* @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
install(hapFilePaths: Array<string>, callback: AsyncCallback<void>): void;
/**
* Install haps for an application.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @param { Array<string> } hapFilePaths - Indicates the path where the hap of the application is stored.
* @param { InstallParam } installParam - Indicates other parameters required for the installation.
* @param { AsyncCallback } callback - The callback of installing haps result.
* @returns { Promise<void> }
* @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Input parameters check failed.
@ -106,14 +136,15 @@ declare namespace installer {
* @systemapi
* @since 9
*/
install(hapFilePaths: Array<string>, installParam?: InstallParam) : Promise<void>;
install(hapFilePaths: Array<string>, installParam?: InstallParam): Promise<void>;
/**
* Uninstall an application.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @param { string } bundleName - Indicates the bundle name of the application to be uninstalled.
* @param { InstallParam } installParam - Indicates other parameters required for the uninstall.
* @param { AsyncCallback } callback - The callback of uninstalling application result.
* @param { AsyncCallback<void> } callback - The callback of uninstalling application result.
* @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Input parameters check failed.
@ -124,15 +155,32 @@ declare namespace installer {
* @systemapi
* @since 9
*/
uninstall(bundleName: string, installParam: InstallParam, callback : AsyncCallback<void>) : void;
uninstall(bundleName: string, callback : AsyncCallback<void>) : void;
uninstall(bundleName: string, installParam: InstallParam, callback: AsyncCallback<void>): void;
/**
* Uninstall an application.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @param { string } bundleName - Indicates the bundle name of the application to be uninstalled.
* @param { AsyncCallback<void> } callback - The callback of uninstalling application result.
* @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Input parameters check failed.
* @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled.
* @throws { BusinessError } 17700040 - The specified bundle is a shared bundle which cannot be uninstalled.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
uninstall(bundleName: string, callback: AsyncCallback<void>): void;
/**
* Uninstall an application.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @param { string } bundleName - Indicates the bundle name of the application to be uninstalled.
* @param { InstallParam } installParam - Indicates other parameters required for the uninstall.
* @param { AsyncCallback } callback - The callback of uninstalling application result.
* @returns { Promise<void> }
* @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Input parameters check failed.
@ -143,14 +191,15 @@ declare namespace installer {
* @systemapi
* @since 9
*/
uninstall(bundleName: string, installParam?: InstallParam) : Promise<void>;
uninstall(bundleName: string, installParam?: InstallParam): Promise<void>;
/**
* Recover an application.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @param { string } bundleName - Indicates the bundle name of the application to be recovered.
* @param { InstallParam } installParam - Indicates other parameters required for the recover.
* @param { AsyncCallback } callback - The callback of recovering application result.
* @param { AsyncCallback<void> } callback - The callback of recovering application result.
* @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Input parameters check failed.
@ -160,14 +209,29 @@ declare namespace installer {
* @since 9
*/
recover(bundleName: string, installParam: InstallParam, callback: AsyncCallback<void>): void;
/**
* Recover an application.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @param { string } bundleName - Indicates the bundle name of the application to be recovered.
* @param { AsyncCallback<void> } callback - The callback of recovering application result.
* @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Input parameters check failed.
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
recover(bundleName: string, callback: AsyncCallback<void>): void;
/**
* Recover an application.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @param { string } bundleName - Indicates the bundle name of the application to be recovered.
* @param { InstallParam } installParam - Indicates other parameters required for the recover.
* @param { AsyncCallback } callback - The callback of recovering application result.
* @returns { Promise<void> }
* @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 401 - Input parameters check failed.
@ -176,13 +240,14 @@ declare namespace installer {
* @systemapi
* @since 9
*/
recover(bundleName: string, installParam?: InstallParam) : Promise<void>;
recover(bundleName: string, installParam?: InstallParam): Promise<void>;
/**
* Uninstall a shared bundle.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @param { UninstallParam } uninstallParam - Indicates parameters required for the uninstall.
* @param { AsyncCallback } callback - The callback of uninstalling shared bundle result.
* @param { AsyncCallback<void> } callback - The callback of uninstalling shared bundle result.
* @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'.
* @throws { BusinessError } 401 - Input parameters check failed.
* @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled.
@ -192,12 +257,14 @@ declare namespace installer {
* @systemapi
* @since 10
*/
uninstall(uninstallParam: UninstallParam, callback : AsyncCallback<void>) : void;
uninstall(uninstallParam: UninstallParam, callback: AsyncCallback<void>): void;
/**
* Uninstall a shared bundle.
*
* @permission ohos.permission.INSTALL_BUNDLE
* @param { UninstallParam } uninstallParam - Indicates parameters required for the uninstall.
* @returns { Promise<void> }
* @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'.
* @throws { BusinessError } 401 - Input parameters check failed.
* @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled.
@ -207,11 +274,12 @@ declare namespace installer {
* @systemapi
* @since 10
*/
uninstall(uninstallParam: UninstallParam) : Promise<void>;
uninstall(uninstallParam: UninstallParam): Promise<void>;
}
/**
* Provides parameters required for hashParam.
*
* @typedef HashParam
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
@ -220,14 +288,18 @@ declare namespace installer {
export interface HashParam {
/**
* Indicates the moduleName
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
moduleName: string;
/**
* Indicates the hash value
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
hashValue: string;
@ -235,6 +307,7 @@ declare namespace installer {
/**
* Provides parameters required for installing or uninstalling an application.
*
* @typedef InstallParam
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
@ -243,42 +316,54 @@ declare namespace installer {
export interface InstallParam {
/**
* Indicates the user id
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
userId?: number;
/**
* Indicates the install flag, which 0x00 for normal, 0x10 for freeInstall
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
installFlag?: number;
/**
* Indicates whether the param has data
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
isKeepData?: boolean;
/**
* Indicates the hash params
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
hashParams?: Array<HashParam>;
/**
* Indicates the deadline of the crowdtesting bundle
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 9
*/
crowdtestDeadline?: number;
/**
* Indicates the shared bundle dir paths.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 10
*/
sharedBundleDirPaths?: Array<String>;
@ -286,6 +371,7 @@ declare namespace installer {
/**
* Provides parameters required for uninstalling shared bundle.
*
* @typedef UninstallParam
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
@ -294,18 +380,22 @@ declare namespace installer {
export interface UninstallParam {
/**
* Indicates the shared bundle name
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 10
*/
bundleName: string;
/**
* Indicates the shared version code. If default, indicates that all version sharing bundles are uninstalled
*
* @syscap SystemCapability.BundleManager.BundleFramework.Core
* @systemapi
* @since 10
*/
versionCode?: number;
}
}
export default installer;
export default installer;

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { LauncherAbilityInfo as _LauncherAbilityInfo } from './bundleManager/LauncherAbilityInfo';
import { ShortcutInfo as _ShortcutInfo, ShortcutWant as _ShortcutWant } from './bundleManager/ShortcutInfo';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import * as _OverlayModuleInfo from './bundleManager/OverlayModuleInfo';
/**
@ -36,11 +36,25 @@ declare namespace overlay {
* @syscap SystemCapability.BundleManager.BundleFramework.Overlay
* @since 10
*/
function setOverlayEnabled(moduleName:string, isEnabled: boolean, callback: AsyncCallback<void>): void;
function setOverlayEnabled(moduleName:string, isEnabled: boolean): Promise<void>;
function setOverlayEnabled(moduleName: string, isEnabled: boolean, callback: AsyncCallback<void>): void;
/**
* Set enabled state of overlay module based on specified moduleName.
*
* @param { string } moduleName - Indicates the module name of the overlay module to be set.
* @param { boolean } isEnabled - The value true means to enable overlay feature, and the value false means to disable overlay feature.
* @returns { Promise<void> }
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 17700002 - The specified module name is not found.
* @throws { BusinessError } 17700033 - The specified module is not an overlay module.
* @syscap SystemCapability.BundleManager.BundleFramework.Overlay
* @since 10
*/
function setOverlayEnabled(moduleName: string, isEnabled: boolean): Promise<void>;
/**
* Set enabled state of overlay module based on specified bundleName and moduleName.
*
* @permission ohos.permission.CHANGE_OVERLAY_ENABLED_STATE
* @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be set.
* @param { string } moduleName - Indicates the module name of the overlay module to be set.
@ -57,11 +71,33 @@ declare namespace overlay {
* @systemapi
* @since 10
*/
function setOverlayEnabledByBundleName(bundleName:string, moduleName:string, isEnabled: boolean, callback: AsyncCallback<void>): void;
function setOverlayEnabledByBundleName(bundleName:string, moduleName:string, isEnabled: boolean): Promise<void>;
function setOverlayEnabledByBundleName(bundleName:string,
moduleName:string, isEnabled: boolean, callback: AsyncCallback<void>): void;
/**
* Set enabled state of overlay module based on specified bundleName and moduleName.
*
* @permission ohos.permission.CHANGE_OVERLAY_ENABLED_STATE
* @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be set.
* @param { string } moduleName - Indicates the module name of the overlay module to be set.
* @param { boolean } isEnabled - The value true means to enable overlay feature, and the value false means to disable overlay feature.
* @returns { Promise<void> }
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @throws { BusinessError } 17700002 - The specified module name is not found.
* @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module.
* @throws { BusinessError } 17700033 - The specified module is not an overlay module.
* @syscap SystemCapability.BundleManager.BundleFramework.Overlay
* @systemapi
* @since 10
*/
function setOverlayEnabledByBundleName(bundleName: string, moduleName: string, isEnabled: boolean): Promise<void>;
/**
* Obtain the OverlayModuleInfo of current application based on moduleName.
*
* @param { string } moduleName - Indicates the module name of the overlay module to be queried.
* @param { AsyncCallback<OverlayModuleInfo> } callback - The callback of getting OverlayModuleInfo object.
* @throws { BusinessError } 401 - The parameter check failed.
@ -71,11 +107,25 @@ declare namespace overlay {
* @syscap SystemCapability.BundleManager.BundleFramework.Overlay
* @since 10
*/
function getOverlayModuleInfo(moduleName: string, callback: AsyncCallback<OverlayModuleInfo>): void;
function getOverlayModuleInfo(moduleName: string): Promise<OverlayModuleInfo>;
function getOverlayModuleInfo(moduleName: string, callback: AsyncCallback<OverlayModuleInfo>): void;
/**
* Obtain the OverlayModuleInfo of current application based on moduleName.
*
* @param { string } moduleName - Indicates the module name of the overlay module to be queried.
* @returns { Promise<OverlayModuleInfo> }
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 17700002 - The specified module name is not found.
* @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module.
* @throws { BusinessError } 17700033 - The specified module is not an overlay module.
* @syscap SystemCapability.BundleManager.BundleFramework.Overlay
* @since 10
*/
function getOverlayModuleInfo(moduleName: string): Promise<OverlayModuleInfo>;
/**
* Obtain the OverlayModuleInfo of current application based on moduleName.
*
* @param { string } targetModuleName - Indicates the target module name of the target module to be queried.
* @param { AsyncCallback<Array<OverlayModuleInfo>> } callback - The callback of getting a list of OverlayModuleInfo object.
* @throws { BusinessError } 401 - The parameter check failed.
@ -84,11 +134,43 @@ declare namespace overlay {
* @syscap SystemCapability.BundleManager.BundleFramework.Overlay
* @since 10
*/
function getTargetOverlayModuleInfos(targetModuleName: string, callback: AsyncCallback<Array<OverlayModuleInfo>>): void;
function getTargetOverlayModuleInfos(targetModuleName: string): Promise<Array<OverlayModuleInfo>>;
function getTargetOverlayModuleInfos(targetModuleName: string,
callback: AsyncCallback<Array<OverlayModuleInfo>>): void;
/**
* Obtain the OverlayModuleInfo of current application based on moduleName.
*
* @param { string } targetModuleName - Indicates the target module name of the target module to be queried.
* @returns { Promise<Array<OverlayModuleInfo>> }
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 17700002 - The specified module name is not found.
* @throws { BusinessError } 17700034 - The specified module is an overlay module.
* @syscap SystemCapability.BundleManager.BundleFramework.Overlay
* @since 10
*/
function getTargetOverlayModuleInfos(targetModuleName: string): Promise<Array<OverlayModuleInfo>>;
/**
* Obtain the OverlayModuleInfo of the specified application based on bundleName.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be quired.
* @param { AsyncCallback<Array<OverlayModuleInfo>> } callback - The callback of getting a list of OverlayModuleInfo object.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module.
* @syscap SystemCapability.BundleManager.BundleFramework.Overlay
* @systemapi
* @since 10
*/
function getOverlayModuleInfoByBundleName(bundleName: string,
callback: AsyncCallback<Array<OverlayModuleInfo>>): void;
/**
* Obtain the OverlayModuleInfo of the specified application based on bundleName.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be quired.
* @param { string } moduleName - Indicates the module name of the overlay module to be queried.
@ -104,11 +186,12 @@ declare namespace overlay {
* @systemapi
* @since 10
*/
function getOverlayModuleInfoByBundleName(bundleName: string, callback: AsyncCallback<Array<OverlayModuleInfo>>): void;
function getOverlayModuleInfoByBundleName(bundleName: string, moduleName: string, callback: AsyncCallback<Array<OverlayModuleInfo>>): void;
function getOverlayModuleInfoByBundleName(bundleName: string,
moduleName: string, callback: AsyncCallback<Array<OverlayModuleInfo>>): void;
/**
* Obtain the OverlayModuleInfo of the specified application based on bundleName and moduleName.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be quired.
* @param { string } moduleName - Indicates the module name of the overlay module to be queried.
@ -124,7 +207,26 @@ declare namespace overlay {
* @systemapi
* @since 10
*/
function getOverlayModuleInfoByBundleName(bundleName: string, moduleName?: string): Promise<Array<OverlayModuleInfo>>;
function getOverlayModuleInfoByBundleName(bundleName: string,
moduleName?: string): Promise<Array<OverlayModuleInfo>>;
/**
* Obtain the OverlayModuleInfo of the specified target application based on bundleName.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } targetBundleName - Indicates the application target bundle name of the overlay bundle to be quired.
* @param { AsyncCallback<Array<OverlayModuleInfo>> } callback - The callback of getting a list of OverlayModuleInfo object.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
* @throws { BusinessError } 17700001 - The specified bundleName is not found.
* @throws { BusinessError } 17700035 - The specified bundle is an overlay bundle.
* @syscap SystemCapability.BundleManager.BundleFramework.Overlay
* @systemapi
* @since 10
*/
function getTargetOverlayModuleInfosByBundleName(targetBundleName: string,
callback: AsyncCallback<Array<OverlayModuleInfo>>): void;
/**
* Obtain the OverlayModuleInfo of the specified target application based on bundleName.
@ -144,11 +246,12 @@ declare namespace overlay {
* @systemapi
* @since 10
*/
function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, callback: AsyncCallback<Array<OverlayModuleInfo>>): void;
function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, moduleName: string, callback: AsyncCallback<Array<OverlayModuleInfo>>): void;
function getTargetOverlayModuleInfosByBundleName(targetBundleName: string,
moduleName: string, callback: AsyncCallback<Array<OverlayModuleInfo>>): void;
/**
* Obtain the OverlayModuleInfo of the specified target application based on bundleName and moduleName.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { string } targetBundleName - Indicates the application target bundle name of the overlay bundle to be quired.
* @param { string } moduleName - Indicates the module name of the overlay module to be queried.
@ -164,14 +267,16 @@ declare namespace overlay {
* @systemapi
* @since 10
*/
function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, moduleName?: string): Promise<Array<OverlayModuleInfo>>;
function getTargetOverlayModuleInfosByBundleName(targetBundleName: string,
moduleName?: string): Promise<Array<OverlayModuleInfo>>;
/**
* Obtains configuration information about a overlay hap module.
*
* @syscap SystemCapability.BundleManager.BundleFramework.Overlay
* @since 10
*/
export type OverlayModuleInfo = _OverlayModuleInfo.OverlayModuleInfo;
export type OverlayModuleInfo = _OverlayModuleInfo.OverlayModuleInfo;
}
export default overlay;
export default overlay;

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
/**
* Provides methods for managing bundle usage statistics,
@ -29,243 +29,413 @@ import { AsyncCallback, Callback } from './basic';
* @useinstead ohos.resourceschedule.usageStatistics
*/
declare namespace bundleState {
/**
* @interface BundleStateInfo
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.BundleStatsInfo
*/
interface BundleStateInfo {
/**
* @since 7
* The identifier of BundleStateInfo.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.BundleStatsInfo
*/
interface BundleStateInfo {
/**
* The identifier of BundleStateInfo.
*/
id: number;
/**
* The total duration, in milliseconds.
*/
abilityInFgTotalTime?: number;
/**
* The last time when the application was accessed, in milliseconds.
*/
abilityPrevAccessTime?: number;
/**
* The last time when the application was visible in the foreground, in milliseconds.
*/
abilityPrevSeenTime?: number;
/**
* The total duration, in milliseconds.
*/
abilitySeenTotalTime?: number;
/**
* The bundle name of the application.
*/
bundleName?: string;
/**
* The total duration, in milliseconds.
*/
fgAbilityAccessTotalTime?: number;
/**
* The last time when the foreground application was accessed, in milliseconds.
*/
fgAbilityPrevAccessTime?: number;
/**
* The time of the first bundle usage record in this {@code BundleActiveInfo} object,
* in milliseconds.
*/
infosBeginTime?: number;
/**
* The time of the last bundle usage record in this {@code BundleActiveInfo} object,
* in milliseconds.
*/
infosEndTime?: number;
/**
* Merges a specified {@link BundleActiveInfo} object with this {@link BundleActiveInfo} object.
* The bundle name of both objects must be the same.
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @param toMerge Indicates the {@link BundleActiveInfo} object to merge.
* If the bundle names of the two {@link BundleActiveInfo} objects are different.
*/
merge(toMerge: BundleStateInfo): void;
}
/**
* @since 7
* @deprecated since 9
*/
id: number;
/**
* The total duration, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.BundleEvents
*/
interface BundleActiveState {
/**
* The usage priority group of the application.
*/
appUsagePriorityGroup?: number;
/**
* The bundle name.
*/
bundleName?: string;
/**
* The shortcut ID.
*/
indexOfLink?: string;
/**
* The class name.
*/
nameOfClass?: string;
/**
* The time when this state occurred, in milliseconds.
*/
stateOccurredTime?: number;
/**
* The state type.
*/
stateType?: number;
}
/**
* Checks whether the application with a specified bundle name is in the idle state.
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @param bundleName Indicates the bundle name of the application to query.
* @returns Returns {@code true} if the application is idle in a particular period;
* returns {@code false} otherwise. The time range of the particular period is defined by the system,
* which may be hours or days.
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.isIdleState
*/
function isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void;
function isIdleState(bundleName: string): Promise<boolean>;
abilityInFgTotalTime?: number;
/**
* Queries the usage priority group of the calling application.
* The last time when the application was accessed, in milliseconds.
*
* <p>The priority defined in a priority group restricts the resource usage of an application,
* for example, restricting the running of background tasks. </p>
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @returns Returns the usage priority group of the calling application.
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryAppGroup
*/
function queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void;
function queryAppUsagePriorityGroup(): Promise<number>;
/**
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.BundleStatsMap
*/
interface BundleActiveInfoResponse {
[key: string]: BundleStateInfo;
}
abilityPrevAccessTime?: number;
/**
* The last time when the application was visible in the foreground, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
abilityPrevSeenTime?: number;
/**
* The total duration, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
abilitySeenTotalTime?: number;
/**
* The bundle name of the application.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
bundleName?: string;
/**
* The total duration, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
fgAbilityAccessTotalTime?: number;
/**
* The last time when the foreground application was accessed, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
fgAbilityPrevAccessTime?: number;
/**
* The time of the first bundle usage record in this {@code BundleActiveInfo} object,
* in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
infosBeginTime?: number;
/**
* The time of the last bundle usage record in this {@code BundleActiveInfo} object,
* in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
infosEndTime?: number;
/**
* Queries usage information about each bundle within a specified period.
* Merges a specified {@link BundleActiveInfo} object with this {@link BundleActiveInfo} object.
* The bundle name of both objects must be the same.
*
* <p>This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.</p>
*
* @since 7
* @param { BundleStateInfo } toMerge Indicates the {@link BundleActiveInfo} object to merge.
* If the bundle names of the two {@link BundleActiveInfo} objects are different.
* @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.
* @returns Returns the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle.
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfos
*/
function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback<BundleActiveInfoResponse>): void;
function queryBundleStateInfos(begin: number, end: number): Promise<BundleActiveInfoResponse>;
merge(toMerge: BundleStateInfo): void;
}
/**
* @typedef BundleActiveState
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.BundleEvents
*/
interface BundleActiveState {
/**
* The usage priority group of the application.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
appUsagePriorityGroup?: number;
/**
* The bundle name.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
bundleName?: string;
/**
* The shortcut ID.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
indexOfLink?: string;
/**
* The class name.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
nameOfClass?: string;
/**
* The time when this state occurred, in milliseconds.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
stateOccurredTime?: number;
/**
* The state type.
*
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
*/
stateType?: number;
}
/**
* 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
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.isIdleState
*/
function isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void;
/**
* 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.
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.isIdleState
*/
function isIdleState(bundleName: string): Promise<boolean>;
/**
* Queries the usage priority group of the calling application.
* <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
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryAppGroup
*/
function queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void;
/**
* Queries the usage priority group of the calling application.
* <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.
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryAppGroup
*/
function queryAppUsagePriorityGroup(): Promise<number>;
/**
* @typedef BundleActiveInfoResponse
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.BundleStatsMap
*/
interface BundleActiveInfoResponse {
[key: string]: BundleStateInfo;
}
/**
* Queries usage information about each bundle within a specified period.
* <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 { AsyncCallback<BundleActiveInfoResponse> } callback
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfos
*/
function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback<BundleActiveInfoResponse>): void;
/**
* Queries usage information about each bundle within a specified period.
* <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.
* @returns { Promise<BundleActiveInfoResponse> } Returns the {@link BundleActiveInfoResponse} objects
* containing 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.queryBundleStatsInfos
*/
function queryBundleStateInfos(begin: number, end: number): Promise<BundleActiveInfoResponse>;
/**
* Declares interval type.
*
* @enum { number }
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.IntervalType
*/
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
* @since 7
* @deprecated since 9
*/
BY_OPTIMIZED = 0,
/**
* Declares interval type.
* Indicates the daily interval.
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.IntervalType
*/
export enum IntervalType {
/**
* Indicates the interval type that will determine the optimal interval based on the start and end time.
*/
BY_OPTIMIZED = 0,
/**
* Indicates the daily interval.
*/
BY_DAILY = 1,
/**
* Indicates the weekly interval.
*/
BY_WEEKLY = 2,
/**
* Indicates the monthly interval.
*/
BY_MONTHLY = 3,
/**
* Indicates the annually interval.
*/
BY_ANNUALLY = 4
}
BY_DAILY = 1,
/**
* Queries usage information about each bundle within a specified period at a specified interval.
* Indicates the weekly interval.
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @permission ohos.permission.BUNDLE_ACTIVE_INFO
* @systemapi Hide this for inner system use.
* @param 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}.
* @param begin Indicates the start time of the query period, in milliseconds.
* @param end Indicates the end time of the query period, in milliseconds.
* @returns Returns the list of {@link BundleStateInfo} objects containing the usage information about each bundle.
* @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): Promise<Array<BundleStateInfo>>;
BY_WEEKLY = 2,
/**
* Queries state data of all bundles within a specified period identified by the start and end time.
* Indicates the monthly interval.
*
* @since 7
* @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.
* @returns Returns the list of {@link BundleActiveState} objects containing the state data of all bundles.
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryBundleEvents
*/
function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void;
function queryBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>;
BY_MONTHLY = 3,
/**
* Queries state data of the current bundle within a specified period.
* Indicates the annually interval.
*
* @since 7
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @param begin Indicates the start time of the query period, in milliseconds.
* @param end Indicates the end time of the query period, in milliseconds.
* @returns Returns the {@link BundleActiveState} object Array containing the state data of the current bundle.
* @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): Promise<Array<BundleActiveState>>;
BY_ANNUALLY = 4
}
/**
* 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}.
* @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
* @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;
/**
* 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}.
* @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>> }
* @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>>;
/**
* Queries state data of all bundles within a specified period identified by the start and end time.
*
* @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
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryBundleEvents
*/
function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void;
/**
* Queries state data of all bundles within a specified period identified by the start and end time.
*
* @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>> }
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @systemapi Hide this for inner system use.
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryBundleEvents
*/
function queryBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>;
/**
* 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.
* @param { AsyncCallback<Array<BundleActiveState>> } callback
* @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;
/**
* 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>> }
* @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
* @since 7
* @deprecated since 9
* @useinstead ohos.resourceschedule.usageStatistics.queryCurrentBundleEvents
*/
function queryCurrentBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>;
}
export default bundleState;

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { CommonEventData } from './commonEvent/commonEventData';
import { CommonEventSubscriber } from './commonEvent/commonEventSubscriber';
import { CommonEventSubscribeInfo } from './commonEvent/commonEventSubscribeInfo';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { CommonEventData } from './commonEvent/commonEventData';
import { CommonEventSubscriber } from './commonEvent/commonEventSubscriber';
import { CommonEventSubscribeInfo } from './commonEvent/commonEventSubscribeInfo';

View File

@ -1,64 +1,97 @@
/*
* 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.
*/
* 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.
*/
import {AsyncCallback} from "./basic";
import { AsyncCallback } from './@ohos.base';
/**
* Provides file path related APIS.
*
* @since 8
* @systemapi
* @namespace configPolicy
* @syscap SystemCapability.Customization.ConfigPolicy
* @systemapi
* @since 8
*/
declare namespace configPolicy {
/**
* Get file from the highest priority config path which contains the given file name.
*
* @since 8
* @systemapi Hide this for inner system use.
* @syscap SystemCapability.Customization.ConfigPolicy
* @param relPath the relative path of the config file.
* @returns Returns the path of the highest priority config file.
* @param { string } relPath the relative path of the config file.
* @param { AsyncCallback<string> } callback contains the path of the highest priority config file.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.ConfigPolicy
* @systemapi Hide this for inner system use.
* @since 8
*/
function getOneCfgFile(relPath: string, callback: AsyncCallback<string>);
/**
* Get file from the highest priority config path which contains the given file name.
*
* @param { string } relPath the relative path of the config file.
* @returns { Promise<string> } the promise returns the path of the highest priority config file.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.ConfigPolicy
* @systemapi Hide this for inner system use.
* @since 8
*/
function getOneCfgFile(relPath: string): Promise<string>;
/**
* Get config files in device architecture, ordered by priority from low to high.
*
* @since 8
* @systemapi Hide this for inner system use.
* @syscap SystemCapability.Customization.ConfigPolicy
* @param relPath the relative path of the config file.
* @returns Returns paths of config files.
* @param { string } relPath the relative path of the config file.
* @param { AsyncCallback<Array<string>> } callback contains paths of config files.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.ConfigPolicy
* @systemapi Hide this for inner system use.
* @since 8
*/
function getCfgFiles(relPath: string, callback: AsyncCallback<Array<string>>);
/**
* Get config files in device architecture, ordered by priority from low to high.
*
* @param { string } relPath the relative path of the config file.
* @returns { Promise<Array<string>> } the promise returns paths of config files.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.ConfigPolicy
* @systemapi Hide this for inner system use.
* @since 8
*/
function getCfgFiles(relPath: string): Promise<Array<string>>;
/**
* Get config directories in device architecture, ordered by priority from low to high.
*
* @since 8
* @systemapi Hide this for inner system use.
* @syscap SystemCapability.Customization.ConfigPolicy
* @returns Returns paths of config directories.
* @param { AsyncCallback<Array<string>> } callback contains paths of config directories.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.ConfigPolicy
* @systemapi Hide this for inner system use.
* @since 8
*/
function getCfgDirList(callback: AsyncCallback<Array<string>>);
/**
* Get config directories in device architecture, ordered by priority from low to high.
*
* @returns { Promise<Array<string>> } the promise returns paths of config directories.
* @throws { BusinessError } 401 - invalid input parameter.
* @syscap SystemCapability.Customization.ConfigPolicy
* @systemapi Hide this for inner system use.
* @since 8
*/
function getCfgDirList(): Promise<Array<string>>;
}

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
/**
* Provides methods to operate or manage Connected Tag.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
/**
* Contains variety of system contact, provides functions for adding, updating and deleting these system contact

View File

@ -12,8 +12,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Callback } from './basic';
import { AsyncCallback } from './basic';
import { Callback } from './@ohos.base';
import { AsyncCallback } from './@ohos.base';
import { ContinuationResult } from './continuation/continuationResult'
import { ContinuationExtraParams } from './continuation/continuationExtraParams'

View File

@ -17,6 +17,7 @@
* Indicates the {@code DataType}.
* <p>{@code DataType} is obtained based on the value.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -77,6 +78,7 @@ export enum DataType {
/**
* Provides methods for accessing a datashare result set generated by querying the database.
*
* @interface DataShareResultSet
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -130,7 +132,7 @@ export default interface DataShareResultSet {
/**
* Go to the first row of the result set.
*
* @returns Returns true if the result set is moved successfully;
* @returns { boolean } Returns true if the result set is moved successfully;
* returns false otherwise, for example, if the result set is empty.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
@ -142,7 +144,7 @@ export default interface DataShareResultSet {
/**
* Go to the last row of the result set.
*
* @returns Returns true if the result set is moved successfully;
* @returns { boolean } Returns true if the result set is moved successfully;
* returns false otherwise, for example, if the result set is empty.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
@ -154,7 +156,7 @@ export default interface DataShareResultSet {
/**
* Go to the next row of the result set.
*
* @returns Returns true if the result set is moved successfully;
* @returns { boolean } Returns true if the result set is moved successfully;
* returns false otherwise, for example, if the result set is already in the last row.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
@ -166,7 +168,7 @@ export default interface DataShareResultSet {
/**
* Go to the previous row of the result set.
*
* @returns Returns true if the result set is moved successfully;
* @returns { boolean } Returns true if the result set is moved successfully;
* returns false otherwise, for example, if the result set is already in the first row.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
@ -179,8 +181,8 @@ export default interface DataShareResultSet {
* Go to the specified row of the result set forwards or backwards by an offset relative to its current position.
* A positive offset indicates moving backwards, and a negative offset indicates moving forwards.
*
* @param offset Indicates the offset relative to the current position.
* @returns Returns true if the result set is moved successfully and does not go beyond the range;
* @param { number } offset - Indicates the offset relative to the current position.
* @returns { boolean } Returns true if the result set is moved successfully and does not go beyond the range;
* returns false otherwise.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
@ -192,8 +194,8 @@ export default interface DataShareResultSet {
/**
* Go to the specified row of the result set.
*
* @param position Indicates the index of the specified row, which starts from 1.
* @returns Returns true if the result set is moved successfully; returns false otherwise.
* @param { number } position - Indicates the index of the specified row, which starts from 1.
* @returns { boolean } Returns true if the result set is moved successfully; returns false otherwise.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -206,8 +208,8 @@ export default interface DataShareResultSet {
* The implementation class determines whether to throw an exception if the value of the specified
* column or key in the current row is null or the specified column or key is not of the Blob type.
*
* @param columnIndex Indicates the specified column index or key index, which starts from 0.
* @returns Returns the value of the specified column or key as a byte array.
* @param { number } columnIndex - Indicates the specified column index or key index, which starts from 0.
* @returns { Uint8Array } Returns the value of the specified column or key as a byte array.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -220,8 +222,8 @@ export default interface DataShareResultSet {
* The implementation class determines whether to throw an exception if the value of the specified
* column or key in the current row is null or the specified column or key is not of the string type.
*
* @param columnIndex Indicates the specified column index or key index, which starts from 0.
* @returns Returns the value of the specified column or key as a string.
* @param { number } columnIndex - Indicates the specified column index or key index, which starts from 0.
* @returns { string } Returns the value of the specified column or key as a string.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -234,8 +236,8 @@ export default interface DataShareResultSet {
* The implementation class determines whether to throw an exception if the value of the specified
* column or key in the current row is null, the specified column or key is not of the long type.
*
* @param columnIndex Indicates the specified column index or key index, which starts from 0.
* @returns Returns the value of the specified column or key as a long.
* @param { number } columnIndex - Indicates the specified column index or key index, which starts from 0.
* @returns { number } Returns the value of the specified column or key as a long.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -248,8 +250,8 @@ export default interface DataShareResultSet {
* The implementation class determines whether to throw an exception if the value of the specified
* column or key in the current row is null, the specified column or key is not of the double type.
*
* @param columnIndex Indicates the specified column index or key index, which starts from 0.
* @returns Returns the value of the specified column or key as a double.
* @param { number } columnIndex - Indicates the specified column index or key index, which starts from 0.
* @returns { number } Returns the value of the specified column or key as a double.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -261,7 +263,6 @@ export default interface DataShareResultSet {
* Closes the result set.
* Calling this method on the result set will release all of its resources and makes it ineffective.
*
* @returns Returns true if the result set is closed; returns false otherwise.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -273,8 +274,8 @@ export default interface DataShareResultSet {
* Obtains the column index or key index based on the specified column name or key name.
* The column name or key name is passed as an input parameter.
*
* @param columnName Indicates the name of the specified column or key in the result set.
* @returns Returns the index of the specified column or key.
* @param { string } columnName - Indicates the name of the specified column or key in the result set.
* @returns { number } Returns the index of the specified column or key.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -286,8 +287,8 @@ export default interface DataShareResultSet {
* Obtains the column name or key name based on the specified column index or key index.
* The column index or key index is passed as an input parameter.
*
* @param columnIndex Indicates the index of the specified column or key in the result set.
* @returns Returns the name of the specified column or key.
* @param { number } columnIndex - Indicates the index of the specified column or key in the result set.
* @returns { string } Returns the name of the specified column or key.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -300,8 +301,8 @@ export default interface DataShareResultSet {
* The implementation class determines whether to throw an exception if the value of the specified
* column or key in the current row is null, the specified column or key is not in the data type.
*
* @param columnIndex Indicates the specified column index or key index, which starts from 0.
* @returns Returns the dataType of the specified column or key.
* @param { number } columnIndex - Indicates the specified column index or key index, which starts from 0.
* @returns { DataType } Returns the dataType of the specified column or key.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import rdb from './@ohos.data.rdb';
/**
@ -28,9 +28,9 @@ declare namespace dataAbility {
* Create an RdbPredicates by table name and DataAbilityPredicates.
* This method is similar to = of the SQL statement.
*
* @param name Indicates the table name.
* @param dataAbilityPredicates Indicates the dataAbility predicates.
* @returns Returns an RdbPredicates.
* @param { string } name - Indicates the table name.
* @param { DataAbilityPredicates } dataAbilityPredicates - Indicates the dataAbility predicates.
* @returns { rdb.RdbPredicates } Returns an RdbPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -48,9 +48,9 @@ declare namespace dataAbility {
* to a specified value.
* This method is similar to = of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataAbilityPredicates.
* @returns Returns the DataAbilityPredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { ValueType } value - Indicates the value to match with the DataAbilityPredicates.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -62,9 +62,9 @@ declare namespace dataAbility {
* Configure the data capability predicate to match a field where the data type is a value type and the value is not equal to the specified value.
* This method is similar to != of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataAbilityPredicates.
* @returns Returns the DataAbilityPredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { ValueType } value - Indicates the value to match with the DataAbilityPredicates.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -74,7 +74,7 @@ declare namespace dataAbility {
* Adds a left parenthesis to the DataAbilityPredicates.
* This method is similar to ( of the SQL statement and needs to be used together with endWrap().
*
* @returns Returns the DataAbilityPredicates with the left parenthesis.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the left parenthesis.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -85,7 +85,7 @@ declare namespace dataAbility {
* This method is similar to ) of the SQL statement and needs to be used together
* with beginWrap().
*
* @returns Returns the DataAbilityPredicates with the right parenthesis.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the right parenthesis.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -95,7 +95,7 @@ declare namespace dataAbility {
* Adds an or condition to the DataAbilityPredicates.
* This method is similar to or of the SQL statement.
*
* @returns Returns the DataAbilityPredicates with the or condition.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the or condition.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -105,7 +105,7 @@ declare namespace dataAbility {
* Adds an and condition to the DataAbilityPredicates.
* This method is similar to and of the SQL statement.
*
* @returns Returns the DataAbilityPredicates with the and condition.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the and condition.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -116,9 +116,9 @@ declare namespace dataAbility {
* contains a specified value.
* This method is similar to contains of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataAbilityPredicates.
* @returns Returns the DataAbilityPredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { string } value - Indicates the value to match with the DataAbilityPredicates.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -129,9 +129,9 @@ declare namespace dataAbility {
* with a specified string.
* This method is similar to value% of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataAbilityPredicates.
* @returns Returns the DataAbilityPredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { string } value - Indicates the value to match with the DataAbilityPredicates.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -142,9 +142,9 @@ declare namespace dataAbility {
* ends with a specified string.
* This method is similar to %value of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataAbilityPredicates.
* @returns Returns the DataAbilityPredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { string } value - Indicates the value to match with the DataAbilityPredicates.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -154,8 +154,8 @@ declare namespace dataAbility {
* Configure the DataAbilityPredicates to match the fields whose value is null.
* This method is similar to is null of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @returns Returns the DataAbilityPredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -165,8 +165,8 @@ declare namespace dataAbility {
* Configure the DataAbilityPredicates to match the specified fields whose value is not null.
* This method is similar to is not null of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @returns Returns the DataAbilityPredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -177,10 +177,10 @@ declare namespace dataAbility {
* similar to a specified string.
* This method is similar to like of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataAbilityPredicates. The percent sign (%) in the value
* @param { string } field - Indicates the column name in the database table.
* @param { string } value - Indicates the value to match with the DataAbilityPredicates. The percent sign (%) in the value
* is a wildcard (like * in a regular expression).
* @returns Returns the DataAbilityPredicates that match the specified field.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -191,9 +191,9 @@ declare namespace dataAbility {
* a wildcard.
* Different from like, the input parameters of this method are case-sensitive.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with DataAbilityPredicates.
* @returns Returns the SQL statement with the specified DataAbilityPredicates.
* @param { string } field - Indicates the column name in the database table.
* @param { string } value - Indicates the value to match with DataAbilityPredicates.
* @returns { DataAbilityPredicates } Returns the SQL statement with the specified DataAbilityPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -202,10 +202,10 @@ declare namespace dataAbility {
/**
* Restricts the value of the field to the range between low value and high value.
*
* @param field Indicates the column name.
* @param low Indicates the minimum value.
* @param high Indicates the maximum value.
* @returns Returns the SQL query statement with the specified DataAbilityPredicates.
* @param { string } field - Indicates the column name.
* @param { ValueType } low - Indicates the minimum value.
* @param { ValueType } high - Indicates the maximum value.
* @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -215,10 +215,10 @@ declare namespace dataAbility {
* Configure DataAbilityPredicates to match the specified field whose data type is int and value is
* out of a given range.
*
* @param field Indicates the column name in the database table.
* @param low Indicates the minimum value to match with DataAbilityPredicates}.
* @param high Indicates the maximum value to match with DataAbilityPredicates}.
* @returns Returns the SQL query statement with the specified DataAbilityPredicates.
* @param { string } field - Indicates the column name in the database table.
* @param { ValueType } low - Indicates the minimum value to match with DataAbilityPredicates}.
* @param { ValueType } high - Indicates the maximum value to match with DataAbilityPredicates}.
* @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -227,9 +227,9 @@ declare namespace dataAbility {
/**
* Restricts the value of the field to be greater than the specified value.
*
* @param field Indicates the column name.
* @param value Indicates the String field.
* @returns Returns the SQL query statement with the specified DataAbilityPredicates.
* @param { string } field - Indicates the column name.
* @param { ValueType } value - Indicates the String field.
* @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -238,9 +238,9 @@ declare namespace dataAbility {
/**
* Restricts the value of the field to be smaller than the specified value.
*
* @param field Indicates the column name.
* @param value Indicates the String field.
* @returns Returns the SQL query statement with the specified DataAbilityPredicates.
* @param { string } field - Indicates the column name.
* @param { ValueType } value - Indicates the String field.
* @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -249,9 +249,9 @@ declare namespace dataAbility {
/**
* Restricts the value of the field to be greater than or equal to the specified value.
*
* @param field Indicates the column name.
* @param value Indicates the String field.
* @returns Returns the SQL query statement with the specified DataAbilityPredicates.
* @param { string } field - Indicates the column name.
* @param { ValueType } value - Indicates the String field.
* @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -260,9 +260,9 @@ declare namespace dataAbility {
/**
* Restricts the value of the field to be smaller than or equal to the specified value.
*
* @param field Indicates the column name.
* @param value Indicates the String field.
* @returns Returns the SQL query statement with the specified DataAbilityPredicates.
* @param { string } field - Indicates the column name.
* @param { ValueType } value - Indicates the String field.
* @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -272,8 +272,8 @@ declare namespace dataAbility {
* Restricts the ascending order of the return list. When there are several orders,
* the one close to the head has the highest priority.
*
* @param field Indicates the column name for sorting the return list.
* @returns Returns the SQL query statement with the specified DataAbilityPredicates.
* @param { string } field - Indicates the column name for sorting the return list.
* @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -283,8 +283,8 @@ declare namespace dataAbility {
* Restricts the descending order of the return list. When there are several orders,
* the one close to the head has the highest priority.
*
* @param field Indicates the column name for sorting the return list.
* @returns Returns the SQL query statement with the specified DataAbilityPredicates.
* @param { string } field - Indicates the column name for sorting the return list.
* @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -293,7 +293,7 @@ declare namespace dataAbility {
/**
* Restricts each row of the query result to be unique.
*
* @returns Returns the SQL query statement with the specified DataAbilityPredicates.
* @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -302,9 +302,9 @@ declare namespace dataAbility {
/**
* Restricts the max number of return records.
*
* @param value Indicates the max length of the return list.
* @returns Returns the SQL query statement with the specified DataAbilityPredicates.
* @throws IllegalPredicateException Throws this exception if DataAbilityPredicates are added to a wrong position.
* @param { number } value - Indicates the max length of the return list.
* @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates.
* @throws { BusinessError } IllegalPredicateException Throws this exception if DataAbilityPredicates are added to a wrong position.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -314,8 +314,8 @@ declare namespace dataAbility {
* Configure DataAbilityPredicates to specify the start position of the returned result.
* Use this method together with limit(int).
*
* @param rowOffset Indicates the start position of the returned result. The value is a positive integer.
* @returns Returns the SQL query statement with the specified AbsPredicates.
* @param { number } rowOffset - Indicates the start position of the returned result. The value is a positive integer.
* @returns { DataAbilityPredicates } Returns the SQL query statement with the specified AbsPredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -324,8 +324,8 @@ declare namespace dataAbility {
/**
* Configure DataAbilityPredicates to group query results by specified columns.
*
* @param fields Indicates the specified columns by which query results are grouped.
* @returns Returns the DataAbilityPredicates with the specified columns by which query results are grouped.
* @param { Array<string> } fields - Indicates the specified columns by which query results are grouped.
* @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the specified columns by which query results are grouped.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -335,8 +335,8 @@ declare namespace dataAbility {
* Configure DataAbilityPredicates to specify the index column.
* Before using this method, you need to create an index column.
*
* @param indexName Indicates the name of the index column.
* @returns Returns DataAbilityPredicates with the specified index column.
* @param { string } field - Indicates the name of the index column.
* @returns { DataAbilityPredicates } Returns DataAbilityPredicates with the specified index column.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -346,9 +346,9 @@ declare namespace dataAbility {
* Configure DataAbilityPredicates to match the specified field whose data type is ValueType array and values
* are within a given range.
*
* @param field Indicates the column name in the database table.
* @param values Indicates the values to match with DataAbilityPredicates.
* @returns Returns DataAbilityPredicates that matches the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { Array<ValueType> } value Indicates the values to match with DataAbilityPredicates.
* @returns { DataAbilityPredicates } Returns DataAbilityPredicates that matches the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/
@ -358,9 +358,9 @@ declare namespace dataAbility {
* Configure {@code DataAbilityPredicates} to match the specified field whose data type is String array and values
* are out of a given range.
*
* @param field Indicates the column name in the database table.
* @param values Indicates the values to match with DataAbilityPredicates.
* @returns Returns DataAbilityPredicates that matches the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { Array<ValueType> } value - Indicates the values to match with DataAbilityPredicates.
* @returns { DataAbilityPredicates } Returns DataAbilityPredicates that matches the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @since 7
*/

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import Context from './application/Context';
import DataShareResultSet from './@ohos.data.DataShareResultSet';
import dataSharePredicates from './@ohos.data.dataSharePredicates';
@ -62,6 +62,7 @@ declare namespace dataShare {
/**
* DataShareHelper
*
* @interface DataShareHelper
* @syscap SystemCapability.DistributedDataManager.DataShare.Consumer
* @systemapi
* @StageModelOnly
@ -71,7 +72,7 @@ declare namespace dataShare {
/**
* Registers an observer to observe data specified by the given uri.
*
* @param { string } type - type must be 'dataChange'.
* @param { 'dataChange' } type - type must be 'dataChange'.
* @param { string } uri - Indicates the path of the data to operate.
* @param { AsyncCallback<void> } callback - the callback of on.
* @syscap SystemCapability.DistributedDataManager.DataShare.Consumer
@ -84,7 +85,7 @@ declare namespace dataShare {
/**
* Deregisters an observer used for monitoring data specified by the given uri.
*
* @param { string } type - type must be 'dataChange'.
* @param { 'dataChange' } type - type must be 'dataChange'.
* @param { string } uri - Indicates the path of the data to operate.
* @param { AsyncCallback<void> } callback - the callback of off.
* @syscap SystemCapability.DistributedDataManager.DataShare.Consumer
@ -98,7 +99,7 @@ declare namespace dataShare {
* Inserts a single data record into the database.
*
* @param { string } uri - Indicates the path of the data to operate.
* @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null,
* @param { ValuesBucket } value - Indicates the data record to insert. If this parameter is null,
* a blank row will be inserted.
* @param { AsyncCallback<number> } callback - {number}: the index of the inserted data record.
* @throws { BusinessError } 401 - the parameter check failed.
@ -113,7 +114,7 @@ declare namespace dataShare {
* Inserts a single data record into the database.
*
* @param { string } uri - Indicates the path of the data to operate.
* @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null,
* @param { ValuesBucket } value - Indicates the data record to insert. If this parameter is null,
* a blank row will be inserted.
* @returns { Promise<number> } {number}: the index of the inserted data record.
* @throws { BusinessError } 401 - the parameter check failed.
@ -203,7 +204,7 @@ declare namespace dataShare {
* @param { string } uri - Indicates the path of data to update.
* @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria.
* You should define the processing logic when this parameter is null.
* @param { ValueBucket } value - Indicates the data to update. This parameter can be null.
* @param { ValuesBucket } value - Indicates the data to update. This parameter can be null.
* @param { AsyncCallback<number> } callback - {number}: the number of data records updated.
* @throws { BusinessError } 401 - the parameter check failed.
* @syscap SystemCapability.DistributedDataManager.DataShare.Consumer
@ -224,7 +225,7 @@ declare namespace dataShare {
* @param { string } uri - Indicates the path of data to update.
* @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria.
* You should define the processing logic when this parameter is null.
* @param { ValueBucket } value - Indicates the data to update. This parameter can be null.
* @param { ValuesBucket } value - Indicates the data to update. This parameter can be null.
* @returns { Promise<number> } {number}: the number of data records updated.
* @throws { BusinessError } 401 - the parameter check failed.
* @syscap SystemCapability.DistributedDataManager.DataShare.Consumer

View File

@ -39,9 +39,9 @@ declare namespace dataSharePredicates {
* to a specified value.
* This method is similar to = of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataSharePredicates.
* @returns Returns the DataSharePredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { ValueType } value - Indicates the value to match with the DataSharePredicates.
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -54,9 +54,9 @@ declare namespace dataSharePredicates {
* a specified value.
* This method is similar to != of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataSharePredicates.
* @returns Returns the DataSharePredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { ValueType } value - Indicates the value to match with the DataSharePredicates.
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -68,7 +68,7 @@ declare namespace dataSharePredicates {
* Adds a left parenthesis to the DataSharePredicates.
* This method is similar to ( of the SQL statement and needs to be used together with endWrap().
*
* @returns Returns the DataSharePredicates with the left parenthesis.
* @returns { DataSharePredicates } Returns the DataSharePredicates with the left parenthesis.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -81,7 +81,7 @@ declare namespace dataSharePredicates {
* This method is similar to ) of the SQL statement and needs to be used together
* with beginWrap().
*
* @returns Returns the DataSharePredicates with the right parenthesis.
* @returns { DataSharePredicates } Returns the DataSharePredicates with the right parenthesis.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -93,7 +93,7 @@ declare namespace dataSharePredicates {
* Adds an or condition to the DataSharePredicates.
* This method is similar to or of the SQL statement.
*
* @returns Returns the DataSharePredicates with the or condition.
* @returns { DataSharePredicates } Returns the DataSharePredicates with the or condition.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -105,7 +105,7 @@ declare namespace dataSharePredicates {
* Adds an and condition to the DataSharePredicates.
* This method is similar to and of the SQL statement.
*
* @returns Returns the DataSharePredicates with the and condition.
* @returns { DataSharePredicates } Returns the DataSharePredicates with the and condition.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -118,9 +118,9 @@ declare namespace dataSharePredicates {
* contains a specified value.
* This method is similar to contains of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataSharePredicates.
* @returns Returns the DataSharePredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { string } value - Indicates the value to match with the DataSharePredicates.
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -133,9 +133,9 @@ declare namespace dataSharePredicates {
* with a specified string.
* This method is similar to value% of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataSharePredicates.
* @returns Returns the DataSharePredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { string } value - Indicates the value to match with the DataSharePredicates.
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -148,9 +148,9 @@ declare namespace dataSharePredicates {
* ends with a specified string.
* This method is similar to %value of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataSharePredicates.
* @returns Returns the DataSharePredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { string } value - Indicates the value to match with the DataSharePredicates.
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -162,8 +162,8 @@ declare namespace dataSharePredicates {
* Configure the DataSharePredicates to match the fields whose value is null.
* This method is similar to is null of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @returns Returns the DataSharePredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -175,8 +175,8 @@ declare namespace dataSharePredicates {
* Configure the DataSharePredicates to match the specified fields whose value is not null.
* This method is similar to is not null of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @returns Returns the DataSharePredicates that match the specified field.
* @param { string } field - Indicates the column name in the database table.
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -189,10 +189,10 @@ declare namespace dataSharePredicates {
* similar to a specified string.
* This method is similar to like of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value
* @param { string } field - Indicates the column name in the database table.
* @param { string } value - Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value
* is a wildcard (like * in a regular expression).
* @returns Returns the DataSharePredicates that match the specified field.
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -205,10 +205,10 @@ declare namespace dataSharePredicates {
* similar to a specified string.
* This method is similar to unlike of the SQL statement.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value
* @param { string } field - Indicates the column name in the database table.
* @param { string } value - Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value
* is a wildcard (like * in a regular expression).
* @returns Returns the DataSharePredicates that match the specified field.
* @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -221,9 +221,9 @@ declare namespace dataSharePredicates {
* a wildcard.
* Different from like, the input parameters of this method are case-sensitive.
*
* @param field Indicates the column name in the database table.
* @param value Indicates the value to match with DataSharePredicates.
* @returns Returns the SQL statement with the specified DataSharePredicates.
* @param { string } field - Indicates the column name in the database table.
* @param { string } value - Indicates the value to match with DataSharePredicates.
* @returns { DataSharePredicates } Returns the SQL statement with the specified DataSharePredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -234,10 +234,10 @@ declare namespace dataSharePredicates {
/**
* Restricts the value of the field to the range between low value and high value.
*
* @param field Indicates the column name.
* @param low Indicates the minimum value.
* @param high Indicates the maximum value.
* @returns Returns the SQL query statement with the specified DataSharePredicates.
* @param { string } field - Indicates the column name.
* @param { ValueType } low - Indicates the minimum value.
* @param { ValueType } high - Indicates the maximum value.
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -249,10 +249,10 @@ declare namespace dataSharePredicates {
* Configure DataSharePredicates to match the specified field whose data type is int and value is
* out of a given range.
*
* @param field Indicates the column name in the database table.
* @param low Indicates the minimum value to match with DataSharePredicates.
* @param high Indicates the maximum value to match with DataSharePredicates.
* @returns Returns the SQL query statement with the specified DataSharePredicates.
* @param { string } field - Indicates the column name in the database table.
* @param { ValueType } low - Indicates the minimum value to match with DataSharePredicates.
* @param { ValueType } high - Indicates the maximum value to match with DataSharePredicates.
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -263,9 +263,9 @@ declare namespace dataSharePredicates {
/**
* Restricts the value of the field to be greater than the specified value.
*
* @param field Indicates the column name.
* @param value Indicates the String field.
* @returns Returns the SQL query statement with the specified DataSharePredicates.
* @param { string } field - Indicates the column name.
* @param { ValueType } value - Indicates the String field.
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -276,9 +276,9 @@ declare namespace dataSharePredicates {
/**
* Restricts the value of the field to be smaller than the specified value.
*
* @param field Indicates the column name.
* @param value Indicates the String field.
* @returns Returns the SQL query statement with the specified DataSharePredicates.
* @param { string } field - Indicates the column name.
* @param { ValueType } value - Indicates the String field.
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -289,9 +289,9 @@ declare namespace dataSharePredicates {
/**
* Restricts the value of the field to be greater than or equal to the specified value.
*
* @param field Indicates the column name.
* @param value Indicates the String field.
* @returns Returns the SQL query statement with the specified DataSharePredicates.
* @param { string } field - Indicates the column name.
* @param { ValueType } value - Indicates the String field.
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -302,9 +302,9 @@ declare namespace dataSharePredicates {
/**
* Restricts the value of the field to be smaller than or equal to the specified value.
*
* @param field Indicates the column name.
* @param value Indicates the String field.
* @returns Returns the SQL query statement with the specified DataSharePredicates.
* @param { string } field - Indicates the column name.
* @param { ValueType } value - Indicates the String field.
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -316,8 +316,8 @@ declare namespace dataSharePredicates {
* Restricts the ascending order of the return list. When there are several orders,
* the one close to the head has the highest priority.
*
* @param field Indicates the column name for sorting the return list.
* @returns Returns the SQL query statement with the specified DataSharePredicates.
* @param { string } field - Indicates the column name for sorting the return list.
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -329,8 +329,8 @@ declare namespace dataSharePredicates {
* Restricts the descending order of the return list. When there are several orders,
* the one close to the head has the highest priority.
*
* @param field Indicates the column name for sorting the return list.
* @returns Returns the SQL query statement with the specified DataSharePredicates.
* @param { string } field - Indicates the column name for sorting the return list.
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -341,7 +341,7 @@ declare namespace dataSharePredicates {
/**
* Restricts each row of the query result to be unique.
*
* @returns Returns the SQL query statement with the specified DataSharePredicates.
* @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -352,9 +352,9 @@ declare namespace dataSharePredicates {
/**
* Construct a query object to specify the number of results and the starting position.
*
* @param total Represents the specified number of results.
* @param offset Indicates the starting position.
* @returns Returns the query object.
* @param { number } total - Represents the specified number of results.
* @param { number } offset - Indicates the starting position.
* @returns { DataSharePredicates } Returns the query object.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -365,8 +365,8 @@ declare namespace dataSharePredicates {
/**
* Configure {@code DataSharePredicates} to group query results by specified columns.
*
* @param fields Indicates the specified columns by which query results are grouped.
* @returns Returns the DataSharePredicates with the specified columns by which query results are grouped.
* @param { Array<string> } fields - Indicates the specified columns by which query results are grouped.
* @returns { DataSharePredicates } Returns the DataSharePredicates with the specified columns by which query results are grouped.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -378,8 +378,8 @@ declare namespace dataSharePredicates {
* Configure {@code DataSharePredicates} to specify the index column.
* Before using this method, you need to create an index column.
*
* @param field Indicates the name of the index column.
* @returns Returns DataSharePredicates with the specified index column.
* @param { string } field - Indicates the name of the index column.
* @returns { DataSharePredicates } Returns DataSharePredicates with the specified index column.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -391,9 +391,9 @@ declare namespace dataSharePredicates {
* Configure {@code DataSharePredicates} to match the specified field whose data type is ValueType array and values
* are within a given range.
*
* @param field Indicates the column name in the database table.
* @param values Indicates the values to match with DataSharePredicates.
* @returns Returns DataSharePredicates that matches the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { Array<ValueType> } value - Indicates the values to match with DataSharePredicates.
* @returns { DataSharePredicates } Returns DataSharePredicates that matches the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -405,9 +405,9 @@ declare namespace dataSharePredicates {
* Configure {@code DataSharePredicates} to match the specified field whose data type is String array and values
* are out of a given range.
*
* @param field Indicates the column name in the database table.
* @param values Indicates the values to match with DataSharePredicates.
* @returns Returns DataSharePredicates that matches the specified field.
* @param { string } field - Indicates the column name in the database table.
* @param { Array<ValueType> } value - Indicates the values to match with DataSharePredicates.
* @returns { DataSharePredicates } Returns DataSharePredicates that matches the specified field.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -418,8 +418,8 @@ declare namespace dataSharePredicates {
/**
* Configure {@code DataSharePredicates} Creates a query condition using the specified key prefix.
*
* @param prefix Represents the specified key prefix.
* @returns Returns the query object.
* @param { string } prefix - Represents the specified key prefix.
* @returns { DataSharePredicates } Returns the query object.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly
@ -430,8 +430,8 @@ declare namespace dataSharePredicates {
/**
* Configure {@code DataSharePredicates} to match the specified value whose key is within a given range.
*
* @param keys Represents the key names.
* @returns Returns the query object.
* @param { Array<string> } keys - Represents the key names.
* @returns { DataSharePredicates } Returns the query object.
* @syscap SystemCapability.DistributedDataManager.DataShare.Core
* @systemapi
* @StageModelOnly

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import {AsyncCallback, Callback} from './basic';
import {AsyncCallback, Callback} from './@ohos.base';
/**
* Providers interfaces to creat a {@link KVManager} instance.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
import Context from './application/Context';
/**
@ -61,6 +61,7 @@ declare namespace distributedDataObject {
* The response of save.
* Contains the parameter information of the save object.
*
* @interface SaveSuccessResponse
* @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject
* @since 9
*/
@ -96,6 +97,7 @@ declare namespace distributedDataObject {
* The response of revokeSave.
* Contains the sessionId of the changed object.
*
* @interface RevokeSaveSuccessResponse
* @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject
* @since 9
*/
@ -112,6 +114,7 @@ declare namespace distributedDataObject {
/**
* Object create by {@link createDistributedObject}.
*
* @interface DistributedObject
* @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject
* @since 8
* @deprecated since 9
@ -134,8 +137,8 @@ declare namespace distributedDataObject {
/**
* On watch of change
*
* @param { string } type - event type, fixed as' change ', indicates data change.
* @param { Callback<{sessionId: string, fields: Array<string>}> } callback
* @param { 'change' } type - event type, fixed as' change ', indicates data change.
* @param { Callback<{ sessionId: string, fields: Array<string> }> } callback
* indicates the observer of object data changed.
* {string} sessionId - the sessionId of the changed object.
* {Array<string>} fields - changed data.
@ -149,8 +152,8 @@ declare namespace distributedDataObject {
/**
* Off watch of change
*
* @param { string } type - event type, fixed as' change ', indicates data change.
* @param { Callback<{sessionId: string, fields: Array<string>}> } callback
* @param { 'change' } type - event type, fixed as' change ', indicates data change.
* @param { Callback<{ sessionId: string, fields: Array<string> }> } callback?
* indicates the observer of object data changed.
* {string} sessionId - the sessionId of the changed object.
* {Array<string>} fields - changed data.
@ -165,8 +168,8 @@ declare namespace distributedDataObject {
/**
* On watch of status
*
* @param { string } type - event type, fixed as' status', indicates the online and offline of the object.
* @param { Callback<{sessionId: string, networkId: string, status: 'online' | 'offline'}> } callback
* @param { 'status' } type - event type, fixed as' status', indicates the online and offline of the object.
* @param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback
* indicates the observer of object status changed.
* {string} sessionId - the sessionId of the changed object.
* {string} networkId - networkId of the changed device.
@ -186,8 +189,8 @@ declare namespace distributedDataObject {
/**
* Off watch of status
*
* @param { string } type - event type, fixed as' status', indicates the online and offline of the object.
* @param { Callback<{sessionId: string, networkId: string, status: 'online' | 'offline'}> } callback
* @param { 'status' } type - event type, fixed as' status', indicates the online and offline of the object.
* @param { Callback<{ sessionId: string, deviceId: string, status: 'online' | 'offline' }> } callback?
* Indicates the observer of object status changed.
* {string} sessionId - the sessionId of the changed object.
* {string} networkId - networkId of the changed device.
@ -209,6 +212,7 @@ declare namespace distributedDataObject {
/**
* Object create by {@link create}.
*
* @interface DataObject
* @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject
* @since 9
*/
@ -258,8 +262,8 @@ declare namespace distributedDataObject {
/**
* On watch of change.
*
* @param { string } type - event type, fixed as' change ', indicates data change.
* @param { Callback<{sessionId: string, fields: Array<string>}> } callback
* @param { 'change' } type - event type, fixed as' change ', indicates data change.
* @param { Callback<{ sessionId: string; fields: Array<string> }> } callback
* indicates the observer of object data changed.
* {string} sessionId - the sessionId of the changed object.
* {Array<string>} fields - changed data.
@ -273,8 +277,8 @@ declare namespace distributedDataObject {
/**
* Off watch of change.
*
* @param { string } type - event type, fixed as' change ', indicates data change.
* @param { Callback<{sessionId: string, fields: Array<string>}> } callback
* @param { 'change' } type - event type, fixed as' change ', indicates data change.
* @param { Callback<{ sessionId: string; fields: Array<string> }> } callback?
* indicates the observer of object data changed.
* {string} sessionId - the sessionId of the changed object.
* {Array<string>} fields - changed data.
@ -288,8 +292,8 @@ declare namespace distributedDataObject {
/**
* On watch of status.
*
* @param { string } type - event type, fixed as' status', indicates the online and offline of the object.
* @param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback
* @param { 'status' } type - event type, fixed as' status', indicates the online and offline of the object.
* @param { Callback<{ sessionId: string; networkId: string; status: 'online' | 'offline' }> } callback
* indicates the observer of object status changed.
* {string} sessionId - the sessionId of the changed object.
* {string} networkId - networkId of the changed device.
@ -309,8 +313,8 @@ declare namespace distributedDataObject {
/**
* Off watch of status.
*
* @param { string } type - event type, fixed as' status', indicates the online and offline of the object.
* @param { Callback<{sessionId: string, networkId: string, status: 'online' | 'offline'}> } callback
* @param { 'status' } type - event type, fixed as' status', indicates the online and offline of the object.
* @param { Callback<{ sessionId: string; deviceId: string; status: 'online' | 'offline' }> } callback?
* Indicates the observer of object status changed.
* {string} sessionId - the sessionId of the changed object.
* {string} networkId - networkId of the changed device.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
import { ValuesBucket } from './@ohos.data.ValuesBucket';
import dataSharePredicates from './@ohos.data.dataSharePredicates';
import BaseContext from './application/BaseContext';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
import Context from './application/BaseContext';
/**
@ -129,6 +129,7 @@ declare namespace preferences {
* the file that stores preferences data, and use movePreferencesFromCache
* to remove the {@link Preferences} instance from the memory.
*
* @interface Preferences
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @since 9
*/
@ -197,7 +198,7 @@ declare namespace preferences {
* Checks whether the {@link Preferences} object contains a preferences matching a specified key.
*
* @param { string } key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty.
* @returns { Promise<void> } {@code true} if the {@link Preferences} object contains
* @returns { Promise<boolean> } {@code true} if the {@link Preferences} object contains
* a preferences with the specified key; returns {@code false} otherwise.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
@ -304,8 +305,8 @@ declare namespace preferences {
/**
* Registers an observer to listen for the change of a {@link Preferences} object.
*
* @param { Callback } callback - indicates the callback when preferences changes.
* @param { Callback<{key: string}> } callback - Indicates the callback function.
* @param { 'change' } type - indicates the callback when preferences changes.
* @param { Callback<{ key: string }> } callback - Indicates the callback function.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @since 9
@ -315,8 +316,8 @@ declare namespace preferences {
/**
* Unregisters an existing observer.
*
* @param { Callback } callback - indicates the callback when preferences changes.
* @param { Callback<{key: string}> } callback - Indicates the callback function.
* @param { 'change' } type - indicates the callback when preferences changes.
* @param { Callback<{ key: string }> } callback? - Indicates the callback function.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @since 9
@ -334,6 +335,7 @@ declare namespace preferences {
*
* @constant
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @since 9
*/
const MAX_KEY_LENGTH: 80;
@ -342,6 +344,7 @@ declare namespace preferences {
*
* @constant
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
* @since 9
*/
const MAX_VALUE_LENGTH: 8192;
}

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
import { ResultSet as _ResultSet } from './data/rdb/resultSet';
import Context from './application/BaseContext';
@ -87,6 +87,7 @@ declare namespace rdb {
/**
* Indicates the database synchronization mode.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 8
* @deprecated since 9
@ -118,6 +119,7 @@ declare namespace rdb {
* Describes the subscription type.
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 8
* @deprecated since 9
@ -127,6 +129,7 @@ declare namespace rdb {
/**
* Subscription to remote data changes
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 8
* @deprecated since 9
@ -139,6 +142,7 @@ declare namespace rdb {
* Provides methods for managing the relational database (RDB).
* This class provides methods for creating, querying, updating, and deleting RDBs.
*
* @interface RdbStore
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 7
* @deprecated since 9
@ -163,7 +167,7 @@ declare namespace rdb {
*
* @param { string } table - Indicates the row of data to be inserted into the table.
* @param { ValuesBucket } values - Indicates the row of data {@link ValuesBucket} to be inserted into the table.
* @returns { Promise<void> } return the row ID if the operation is successful. return -1 otherwise.
* @returns { Promise<number> } return the row ID if the operation is successful. return -1 otherwise.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 7
* @deprecated since 9
@ -189,7 +193,7 @@ declare namespace rdb {
*
* @param { string } table - Indicates the target table.
* @param { Array<ValuesBucket> } values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table.
* @returns { Promise<void> } return the number of values that were inserted if the operation is successful. returns -1 otherwise.
* @returns { Promise<number> } return the number of values that were inserted if the operation is successful. returns -1 otherwise.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 7
* @deprecated since 9
@ -279,7 +283,6 @@ declare namespace rdb {
* @param { string } sql - Indicates the SQL statement to execute.
* @param { Array<ValueType> } bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings.
* @param { AsyncCallback<ResultSet> } callback
* @returns { Promise<ResultSet> } return the {@link ResultSet} object if the operation is successful.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 8
* @deprecated since 9
@ -388,7 +391,7 @@ declare namespace rdb {
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param { string } device - Indicates the remote device.
* @param { AsyncCallback<string> } callback - {string}: the distributed table name.
* @param { string } table - {string}: the distributed table name.
* @param { AsyncCallback<string> } callback
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 8
@ -416,8 +419,8 @@ declare namespace rdb {
* Sync data between devices.
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param { string } device - Indicates the remote device.
* @param { AsyncCallback<Array<[string, number]>> } callback - {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status.
* @param { SyncMode } mode - Indicates the remote device.
* @param { RdbPredicates } predicates - {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status.
* @param { AsyncCallback<Array<[string, number]>> } callback
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 8
@ -430,7 +433,7 @@ declare namespace rdb {
* Sync data between devices.
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param { string } device - Indicates the remote device.
* @param { SyncMode } mode - Indicates the remote device.
* @param { RdbPredicates } predicates
* @returns { Promise<Array<[string, number]>> } {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
@ -444,9 +447,9 @@ declare namespace rdb {
* Registers an observer for the database. When data in the distributed database changes,
* the callback will be invoked.
*
* @param { string } event - Indicates the event must be string 'dataChange'.
* @param { 'dataChange' } event - Indicates the event must be string 'dataChange'.
* @param { SubscribeType } type - Indicates the subscription type, which is defined in {@link SubscribeType}.If its value is SUBSCRIBE_TYPE_REMOTE, ohos.permission.DISTRIBUTED_DATASYNC is required.
* @param { AsyncCallback<Array<string>> } observer - {Array<string>}: the observer of data change events in the distributed database.
* @param { Callback<Array<string>> } observer - {Array<string>}: the observer of data change events in the distributed database.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 8
* @deprecated since 9
@ -457,9 +460,9 @@ declare namespace rdb {
/**
* Remove specified observer of specified type from the database.
*
* @param { string } event - Indicates the event must be string 'dataChange'.
* @param { 'dataChange' } event - Indicates the event must be string 'dataChange'.
* @param { SubscribeType } type - Indicates the subscription type, which is defined in {@link SubscribeType}.If its value is SUBSCRIBE_TYPE_REMOTE, ohos.permission.DISTRIBUTED_DATASYNC is required.
* @param { AsyncCallback<Array<string>> } observer - {Array<string>}: the data change observer already registered.
* @param { Callback<Array<string>> } observer - {Array<string>}: the data change observer already registered.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 8
* @deprecated since 9
@ -491,6 +494,7 @@ declare namespace rdb {
/**
* Manages relational database configurations.
*
* @interface StoreConfig
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 7
* @deprecated since 9
@ -604,7 +608,7 @@ declare namespace rdb {
* Adds an or condition to the RdbPredicates.
* This method is similar to or of the SQL statement.
*
* @returns Returns the {@link RdbPredicates} with the or condition.
* @returns { RdbPredicates } Returns the {@link RdbPredicates} with the or condition.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 7
* @deprecated since 9
@ -616,7 +620,7 @@ declare namespace rdb {
* Adds an and condition to the RdbPredicates.
* This method is similar to or of the SQL statement.
*
* @returns Returns the {@link RdbPredicates} with the or condition.
* @returns { RdbPredicates } Returns the {@link RdbPredicates} with the or condition.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 7
* @deprecated since 9
@ -630,7 +634,7 @@ declare namespace rdb {
* This method is similar to contains of the SQL statement.
*
* @param { string } field - Indicates the column name in the database table.
* @param { ValueType } value - Indicates the value to match with the {@link RdbPredicates}.
* @param { string } value - Indicates the value to match with the {@link RdbPredicates}.
* @returns { RdbPredicates } - the {@link RdbPredicates} self.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 7
@ -645,7 +649,7 @@ declare namespace rdb {
* This method is similar to value% of the SQL statement.
*
* @param { string } field - Indicates the column name in the database table.
* @param { ValueType } value - Indicates the value to match with the {@link RdbPredicates}.
* @param { string } value - Indicates the value to match with the {@link RdbPredicates}.
* @returns { RdbPredicates } - the {@link RdbPredicates} self.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 7
@ -660,7 +664,7 @@ declare namespace rdb {
* This method is similar to %value of the SQL statement.
*
* @param { string } field - Indicates the column name in the database table.
* @param { ValueType } value - Indicates the value to match with the {@link RdbPredicates}.
* @param { string } value - Indicates the value to match with the {@link RdbPredicates}.
* @returns { RdbPredicates } - the {@link RdbPredicates} self.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 7
@ -702,7 +706,7 @@ declare namespace rdb {
* This method is similar to like of the SQL statement.
*
* @param { string } field - Indicates the column name in the database table.
* @param { ValueType } value - Indicates the value to match with the {@link RdbPredicates}.
* @param { string } value - Indicates the value to match with the {@link RdbPredicates}.
* @returns { RdbPredicates } - the {@link RdbPredicates} that match the specified field.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 7
@ -717,7 +721,7 @@ declare namespace rdb {
* Different from like, the input parameters of this method are case-sensitive.
*
* @param { string } field - Indicates the column name in the database table.
* @param { ValueType } value - Indicates the value to match with the {@link RdbPredicates}.
* @param { string } value - Indicates the value to match with the {@link RdbPredicates}.
* @returns { RdbPredicates } - the SQL statement with the specified {@link RdbPredicates}.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 7

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
import Context from './application/BaseContext';
import dataSharePredicates from './@ohos.data.dataSharePredicates';
@ -86,6 +86,7 @@ declare namespace relationalStore {
/**
* Manages relational database configurations.
*
* @interface StoreConfig
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 9
*/
@ -118,6 +119,7 @@ declare namespace relationalStore {
/**
* Describes the {@code RdbStore} type.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 9
*/
@ -178,6 +180,7 @@ declare namespace relationalStore {
/**
* Indicates the database synchronization mode.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 9
*/
@ -203,6 +206,7 @@ declare namespace relationalStore {
* Describes the subscription type.
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 9
*/
@ -210,6 +214,7 @@ declare namespace relationalStore {
/**
* Subscription to remote data changes
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 9
*/
@ -219,6 +224,7 @@ declare namespace relationalStore {
/**
* Describes the conflict resolutions to insert data into the table.
*
* @enum { number }
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 10
*/
@ -276,6 +282,7 @@ declare namespace relationalStore {
* Provides methods for managing the relational database (RDB).
* This class provides methods for creating, querying, updating, and deleting RDBs.
*
* @interface RdbStore
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 9
*/
@ -331,7 +338,7 @@ declare namespace relationalStore {
*
* @param { string } table - indicates the target table.
* @param { ValuesBucket } values - indicates the row of data {@link ValuesBucket} to be inserted into the table.
* @returns { Promise<void> } the row ID if the operation is successful. return -1 otherwise.
* @returns { Promise<number> } the row ID if the operation is successful. return -1 otherwise.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 9
@ -341,7 +348,7 @@ declare namespace relationalStore {
*
* @param { string } table - indicates the target table.
* @param { ValuesBucket } values - indicates the row of data {@link ValuesBucket} to be inserted into the table.
* @returns { Promise<void> } the row ID if the operation is successful. return -1 otherwise.
* @returns { Promise<number> } the row ID if the operation is successful. return -1 otherwise.
* @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
@ -355,7 +362,7 @@ declare namespace relationalStore {
* @param { string } table - indicates the target table.
* @param { ValuesBucket } values - indicates the row of data {@link ValuesBucket} to be inserted into the table.
* @param { ConflictResolution } conflict - indicates the {@link ConflictResolution} to insert data into the table.
* @returns { Promise<void> } the row ID if the operation is successful. return -1 otherwise.
* @returns { Promise<number> } the row ID if the operation is successful. return -1 otherwise.
* @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
@ -391,7 +398,7 @@ declare namespace relationalStore {
*
* @param { string } table - indicates the target table.
* @param { Array<ValuesBucket> } values - indicates the rows of data {@link ValuesBucket} to be inserted into the table.
* @returns { Promise<void> } the number of values that were inserted if the operation is successful. returns -1 otherwise.
* @returns { Promise<number> } the number of values that were inserted if the operation is successful. returns -1 otherwise.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 9
@ -401,7 +408,7 @@ declare namespace relationalStore {
*
* @param { string } table - indicates the target table.
* @param { Array<ValuesBucket> } values - indicates the rows of data {@link ValuesBucket} to be inserted into the table.
* @returns { Promise<void> } the number of values that were inserted if the operation is successful. returns -1 otherwise.
* @returns { Promise<number> } the number of values that were inserted if the operation is successful. returns -1 otherwise.
* @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
@ -493,7 +500,7 @@ declare namespace relationalStore {
*
* @param { string } table - indicates the target table.
* @param { ValuesBucket } values - indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table.
* @param { DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { dataSharePredicates.DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { AsyncCallback<number> } callback - the number of affected rows.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @throws { BusinessError } 202 - if permission verification failed, application which is not a system application uses system API.
@ -507,7 +514,7 @@ declare namespace relationalStore {
*
* @param { string } table - indicates the target table.
* @param { ValuesBucket } values - indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table.
* @param { DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { dataSharePredicates.DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { AsyncCallback<number> } callback - the number of affected rows.
* @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
@ -529,7 +536,7 @@ declare namespace relationalStore {
*
* @param { string } table - indicates the target table.
* @param { ValuesBucket } values - indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table.
* @param { DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { dataSharePredicates.DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @returns { Promise<number> } the number of affected rows.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @throws { BusinessError } 202 - if permission verification failed, application which is not a system application uses system API.
@ -543,7 +550,7 @@ declare namespace relationalStore {
*
* @param { string } table - indicates the target table.
* @param { ValuesBucket } values - indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table.
* @param { DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { dataSharePredicates.DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @returns { Promise<number> } the number of affected rows.
* @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
@ -601,7 +608,7 @@ declare namespace relationalStore {
* Deletes data from the database based on a specified instance object of RdbPredicates.
*
* @param { string } table - indicates the target table.
* @param { DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { dataSharePredicates.DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { AsyncCallback<number> } callback - the number of affected rows.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @throws { BusinessError } 202 - if permission verification failed, application which is not a system application uses system API.
@ -614,7 +621,7 @@ declare namespace relationalStore {
* Deletes data from the database based on a specified instance object of RdbPredicates.
*
* @param { string } table - indicates the target table.
* @param { DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { dataSharePredicates.DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { AsyncCallback<number> } callback - the number of affected rows.
* @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
@ -630,7 +637,7 @@ declare namespace relationalStore {
* Deletes data from the database based on a specified instance object of RdbPredicates.
*
* @param { string } table - indicates the target table.
* @param { DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { dataSharePredicates.DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @returns { Promise<number> } the number of affected rows.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @throws { BusinessError } 202 - if permission verification failed, application which is not a system application uses system API.
@ -643,7 +650,7 @@ declare namespace relationalStore {
* Deletes data from the database based on a specified instance object of RdbPredicates.
*
* @param { string } table - indicates the target table.
* @param { DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @param { dataSharePredicates.DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}.
* @returns { Promise<number> } the number of affected rows.
* @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
@ -901,7 +908,7 @@ declare namespace relationalStore {
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param { string } device - indicates the remote device.
* @param { AsyncCallback<string> } callback - {string}: the distributed table name.
* @param { string } table - {string}: the distributed table name.
* @param { AsyncCallback<string> } callback
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @throws { BusinessError } 801 - Capability not supported.
@ -993,9 +1000,9 @@ declare namespace relationalStore {
* Registers an observer for the database. When data in the distributed database changes,
* the callback will be invoked.
*
* @param { string } event - indicates the event must be string 'dataChange'.
* @param { 'dataChange' } event - indicates the event must be string 'dataChange'.
* @param { SubscribeType } type - indicates the subscription type, which is defined in {@link SubscribeType}.If its value is SUBSCRIBE_TYPE_REMOTE, ohos.permission.DISTRIBUTED_DATASYNC is required.
* @param { AsyncCallback<Array<string>> } observer - {Array<string>}: the observer of data change events in the distributed database.
* @param { Callback<Array<string>> } observer - {Array<string>}: the observer of data change events in the distributed database.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
@ -1006,9 +1013,9 @@ declare namespace relationalStore {
/**
* Remove specified observer of specified type from the database.
*
* @param { string } event - indicates the event must be string 'dataChange'.
* @param { 'dataChange' } event - indicates the event must be string 'dataChange'.
* @param { SubscribeType } type - indicates the subscription type, which is defined in {@link SubscribeType}.If its value is SUBSCRIBE_TYPE_REMOTE, ohos.permission.DISTRIBUTED_DATASYNC is required.
* @param { AsyncCallback<Array<string>> } observer - {Array<string>}: the data change observer already registered.
* @param { Callback<Array<string>> } observer - {Array<string>}: the data change observer already registered.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
@ -1130,7 +1137,7 @@ declare namespace relationalStore {
* This method is similar to contains of the SQL statement.
*
* @param { string } field - indicates the column name in the database table.
* @param { ValueType } value - indicates the value to match with the {@link RdbPredicates}.
* @param { string } value - indicates the value to match with the {@link RdbPredicates}.
* @returns { RdbPredicates } - the {@link RdbPredicates} self.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
@ -1144,7 +1151,7 @@ declare namespace relationalStore {
* This method is similar to value% of the SQL statement.
*
* @param { string } field - indicates the column name in the database table.
* @param { ValueType } value - indicates the value to match with the {@link RdbPredicates}.
* @param { string } value - indicates the value to match with the {@link RdbPredicates}.
* @returns { RdbPredicates } - the {@link RdbPredicates} self.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
@ -1158,7 +1165,7 @@ declare namespace relationalStore {
* This method is similar to %value of the SQL statement.
*
* @param { string } field - indicates the column name in the database table.
* @param { ValueType } value - indicates the value to match with the {@link RdbPredicates}.
* @param { string } value - indicates the value to match with the {@link RdbPredicates}.
* @returns { RdbPredicates } - the {@link RdbPredicates} self.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
@ -1196,7 +1203,7 @@ declare namespace relationalStore {
* This method is similar to like of the SQL statement.
*
* @param { string } field - indicates the column name in the database table.
* @param { ValueType } value - indicates the value to match with the {@link RdbPredicates}.
* @param { string } value - indicates the value to match with the {@link RdbPredicates}.
* @returns { RdbPredicates } - the {@link RdbPredicates} that match the specified field.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
@ -1210,7 +1217,7 @@ declare namespace relationalStore {
* Different from like, the input parameters of this method are case-sensitive.
*
* @param { string } field - indicates the column name in the database table.
* @param { ValueType } value - indicates the value to match with the {@link RdbPredicates}.
* @param { string } value - indicates the value to match with the {@link RdbPredicates}.
* @returns { RdbPredicates } - the SQL statement with the specified {@link RdbPredicates}.
* @throws { BusinessError } 401 - if the parameter type is incorrect.
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
@ -1401,6 +1408,7 @@ declare namespace relationalStore {
/**
* Provides methods for accessing a database result set generated by querying the database.
*
* @interface ResultSet
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @since 9
*/
@ -1514,7 +1522,7 @@ declare namespace relationalStore {
* A positive offset indicates moving backwards, and a negative offset indicates moving forwards.
*
* @param { number } offset - indicates the offset relative to the current position.
* @returns { string } true if the result set is moved successfully and does not go beyond the range;
* @returns { boolean } true if the result set is moved successfully and does not go beyond the range;
* returns false otherwise.
* @throws { BusinessError } 14800012 - the result set is empty or the specified location is invalid.
* @throws { BusinessError } 401 - parameter error.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
/**
* Provides interfaces to obtain and modify storage data.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
/**
* xts_device_attest authResult information

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import type { AsyncCallback, Callback } from './basic';
import type { AsyncCallback, Callback } from './@ohos.base';
/**
* Interface of display manager.

View File

@ -13,48 +13,76 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { ElementName } from './bundle/elementName';
import { AsyncCallback } from './@ohos.base';
import { ElementName } from './bundle/elementName';
import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo';
/**
* distributedBundle.
* @name distributedBundle
* @since 8
*
* @namespace distributedBundle
* @syscap SystemCapability.BundleManager.DistributedBundleFramework
* @systemapi Hide this for inner system use
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.distributedBundleManager
*/
declare namespace distributedBundle {
declare namespace distributedBundle {
/**
* Obtains information about the ability info of the remote device.
*
* @since 8
* @syscap SystemCapability.BundleManager.DistributedBundleFramework
* @param elementName Indicates the elementName.
* @returns Returns the ability info of the remote device.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { ElementName } elementName Indicates the elementName.
* @param { AsyncCallback<RemoteAbilityInfo> } callback
* @syscap SystemCapability.BundleManager.DistributedBundleFramework
* @systemapi
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.distributedBundleManager#getRemoteAbilityInfo
*/
function getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback<RemoteAbilityInfo>): void;
function getRemoteAbilityInfo(elementName: ElementName): Promise<RemoteAbilityInfo>;
function getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback<RemoteAbilityInfo>): void;
/**
* Obtains information about the ability info of the remote device.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { ElementName } elementName Indicates the elementName.
* @returns { Promise<RemoteAbilityInfo> } Returns the ability info of the remote device.
* @syscap SystemCapability.BundleManager.DistributedBundleFramework
* @systemapi
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.distributedBundleManager#getRemoteAbilityInfo
*/
function getRemoteAbilityInfo(elementName: ElementName): Promise<RemoteAbilityInfo>;
/**
* Obtains information about the ability infos of the remote device.
*
* @since 8
* @syscap SystemCapability.BundleManager.DistributedBundleFramework
* @param elementNames Indicates the elementNames, Maximum array length ten.
* @returns Returns the ability infos of the remote device.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { Array<ElementName> } elementNames Indicates the elementNames, Maximum array length ten.
* @param { AsyncCallback<Array<RemoteAbilityInfo>> } callback
* @syscap SystemCapability.BundleManager.DistributedBundleFramework
* @systemapi
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.distributedBundleManager#getRemoteAbilityInfo
*/
function getRemoteAbilityInfos(elementNames: Array<ElementName>, callback: AsyncCallback<Array<RemoteAbilityInfo>>): void;
function getRemoteAbilityInfos(elementNames: Array<ElementName>): Promise<Array<RemoteAbilityInfo>>;
function getRemoteAbilityInfos(elementNames: Array<ElementName>,
callback: AsyncCallback<Array<RemoteAbilityInfo>>): void;
/**
* Obtains information about the ability infos of the remote device.
*
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @param { Array<ElementName> } elementNames Indicates the elementNames, Maximum array length ten.
* @returns { Promise<Array<RemoteAbilityInfo>> } Returns the ability infos of the remote device.
* @syscap SystemCapability.BundleManager.DistributedBundleFramework
* @systemapi
* @since 8
* @deprecated since 9
* @useinstead ohos.bundle.distributedBundleManager#getRemoteAbilityInfo
*/
function getRemoteAbilityInfos(elementNames: Array<ElementName>): Promise<Array<RemoteAbilityInfo>>;
}
export default distributedBundle;
export default distributedBundle;

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from './basic';
import { AsyncCallback, Callback } from './@ohos.base';
/**
* Providers interfaces to create a {@link deviceManager} instances.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import { ContinueCallback } from './application/ContinueCallback';
import { ContinueDeviceInfo } from './application/ContinueDeviceInfo';
import { MissionCallback } from './application/MissionCallbacks';

View File

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AsyncCallback } from './basic'
import { AsyncCallback } from './@ohos.base'
export default document;

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import image from './@ohos.multimedia.image';
/**

View File

@ -13,12 +13,12 @@
* limitations under the License.
*/
import { AsyncCallback } from "./basic";
import Want from "./@ohos.app.ability.Want";
import { AsyncCallback } from "./@ohos.base";
import type Want from './@ohos.app.ability.Want';
/**
* This module provides the capability to manage the accounts of the enterprise devices.
* @namespace accountManager.
* @namespace accountManager
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @since 10

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from "./basic";
import Want from "./@ohos.app.ability.Want";
import { AsyncCallback} from "./@ohos.base";
import type Want from './@ohos.app.ability.Want';
/**
* This module provides the capability to manage the administrator of the enterprise devices.
@ -231,7 +231,7 @@ declare namespace adminManager {
* Disables a current super administrator ability.
* Only the administrator app or apps with the shell uid can call this method.
* @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
* @param { string } bundleName - bundleName indicates the administrator bundle information.
* @param { String } bundleName - bundleName indicates the administrator bundle information.
* @param { AsyncCallback<void> } callback - the callback of disableSuperAdmin.
* @throws { BusinessError } 9200005 - failed to disable the administrator application of the device.
* @throws { BusinessError } 201 - the application does not have permission to call this function.
@ -248,7 +248,7 @@ declare namespace adminManager {
* Disables a current super administrator ability.
* Only the administrator app or apps with the shell uid can call this method.
* @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN
* @param { string } bundleName - bundleName indicates the administrator bundle information.
* @param { String } bundleName - bundleName indicates the administrator bundle information.
* @returns { Promise<void> } the promise returned by the disableSuperAdmin.
* @throws { BusinessError } 9200005 - failed to disable the administrator application of the device.
* @throws { BusinessError } 201 - the application does not have permission to call this function.
@ -368,7 +368,7 @@ declare namespace adminManager {
/**
* Get whether the ability is enabled as super device administrator.
* @param { string } bundleName - bundleName indicates the administrator bundle information.
* @param { String } bundleName - bundleName indicates the administrator bundle information.
* @param { AsyncCallback<boolean> } callback - callback contained true if the administrator is super administrator.
* @throws { BusinessError } 202 - not system application.
* @throws { BusinessError } 401 - invalid input parameter.
@ -381,7 +381,7 @@ declare namespace adminManager {
/**
* Get whether the ability is enabled as super device administrator.
* @param { string } bundleName - bundleName indicates the administrator bundle information.
* @param { String } bundleName - bundleName indicates the administrator bundle information.
* @returns { Promise<boolean> } promise contained true if the administrator is super administrator.
* @throws { BusinessError } 202 - not system application.
* @throws { BusinessError } 401 - invalid input parameter.

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from './@ohos.base';
import type Want from './@ohos.app.ability.Want';
/**

View File

@ -13,12 +13,12 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
import { AsyncCallback } from "./@ohos.base";
import type Want from './@ohos.app.ability.Want';
/**
* This module provides the capability to manage the datetime of the enterprise devices.
* @namespace dateTimeManager.
* @namespace dateTimeManager
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @since 9

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
import { AsyncCallback, Callback } from "./basic";
import Want from "./@ohos.app.ability.Want";
import { AsyncCallback, Callback } from "./@ohos.base";
import type Want from './@ohos.app.ability.Want';
/**
* This module provides the capability to control the enterprise devices.

View File

@ -13,12 +13,12 @@
* limitations under the License.
*/
import { AsyncCallback } from "./basic";
import { AsyncCallback } from "./@ohos.base";
import Want from "./@ohos.app.ability.Want";
/**
* This module provides the capability to manage the device info of the enterprise devices.
* @namespace deviceInfo.
* @namespace deviceInfo
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @since 10

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
import { AsyncCallback } from "./basic";
import Want from "./@ohos.app.ability.Want";
import { AsyncCallback } from "./@ohos.base";
import type Want from './@ohos.app.ability.Want';
/**
* This module offers set network policies on the devices.

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
import { AsyncCallback } from "./basic";
import Want from "./@ohos.app.ability.Want";
import { AsyncCallback } from "./@ohos.base";
import type Want from './@ohos.app.ability.Want';
/**
* This module offers set wifi policies on the devices.
@ -447,7 +447,7 @@ declare namespace wifiManager {
/**
* Wi-Fi bssid(MAC): the length is 6
* @type { string }
* @type { ?string }
* @since 10
*/
bssid?: string;
@ -461,7 +461,7 @@ declare namespace wifiManager {
/**
* Hide SSID or not, false(default): not hide
* @type { boolean }
* @type { ?boolean }
* @since 10
*/
isHiddenSsid?: boolean;
@ -475,56 +475,56 @@ declare namespace wifiManager {
/**
* The UID of the Wi-Fi profile creator
* @type { number }
* @type { ?number }
* @since 10
*/
creatorUid?: number;
/**
* Disable reason
* @type { number }
* @type { ?number }
* @since 10
*/
disableReason?: number;
/**
* Allocated networkId
* @type { number }
* @type { ?number }
* @since 10
*/
netId?: number;
/**
* Random mac type
* @type { number }
* @type { ?number }
* @since 10
*/
randomMacType?: number;
/**
* Random mac address, the length is 6
* @type { string }
* @type { ?string }
* @since 10
*/
randomMacAddr?: string;
/**
* IP Type
* @type { IpType }
* @type { ?IpType }
* @since 10
*/
ipType?: IpType;
/**
* IP profile of static
* @type { IpProfile }
* @type { ?IpProfile }
* @since 10
*/
staticIp?: IpProfile;
/**
* EAP profile info.
* @type { WifiEapProfile }
* @type { ?WifiEapProfile }
* @since 10
*/
eapProfile?: WifiEapProfile;

Some files were not shown because too many files have changed in this diff Show More