IssueNo: #I5RT32

Description: fix import
Sig: SIG_ApplicationFramework
Feature or Bugfix: Feature
Binary Source: No

Signed-off-by: yangzk <yangzhongkai@huawei.com>
Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14
This commit is contained in:
yangzk 2022-10-17 19:30:40 +08:00
parent d409b61bc7
commit 6fdafac6d4
28 changed files with 65 additions and 1248 deletions

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import AbilityConstant from "./@ohos.application.AbilityConstant";
import AbilityConstant from "./@ohos.app.ability.AbilityConstant";
import AbilityContext from "./application/AbilityContext";
import Want from './@ohos.application.Want';
import window from './@ohos.window';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import AbilityConstant from "./@ohos.application.AbilityConstant";
import AbilityConstant from "./@ohos.app.ability.AbilityConstant";
import AbilityStageContext from "./application/AbilityStageContext";
import Want from './@ohos.application.Want';
import { Configuration } from './@ohos.application.Configuration';

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import AbilityConstant from "./@ohos.application.AbilityConstant";
import AbilityConstant from "./@ohos.app.ability.AbilityConstant";
import { Configuration } from './@ohos.application.Configuration';
/**

View File

@ -22,6 +22,9 @@ import * as _ExtensionContext from './application/ExtensionContext';
import * as _FormExtensionContext from './application/FormExtensionContext';
import * as _EventHub from './application/EventHub';
import * as _PermissionRequestResult from './application/PermissionRequestResult';
import { PacMap as _PacMap } from "./ability/dataAbilityHelper";
import { AbilityResult as _AbilityResult } from "./ability/abilityResult";
import { ConnectOptions as _ConnectOptions } from "./ability/connectOptions";
/**
* The context of an application. It allows access to application-specific resources.
@ -120,6 +123,30 @@ declare namespace common {
* @since 9
*/
export type PermissionRequestResult = _PermissionRequestResult.default
/**
* Defines a PacMap object for storing a series of values.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 9
*/
export type PacMap = _PacMap
/**
* Indicates the result of startAbility.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 9
*/
export type AbilityResult = _AbilityResult
/**
* Indicates the callback of connection
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 9
*/
export type ConnectOptions = _ConnectOptions
}
export default common;

View File

@ -17,7 +17,7 @@ import { AsyncCallback } from './basic';
import { MissionInfo as _MissionInfo } from './application/MissionInfo';
import { MissionListener as _MissionListener } from './application/MissionListener';
import { MissionSnapshot as _MissionSnapshot } from './application/MissionSnapshot';
import StartOptions from "./@ohos.application.StartOptions";
import StartOptions from "./@ohos.app.ability.StartOptions";
/**
* This module provides the capability to manage abilities and obtaining system task information.

View File

@ -16,7 +16,7 @@
import { AsyncCallback } from "./basic";
import { Callback } from "./basic";
import Want from './@ohos.application.Want';
import formInfo from './@ohos.application.formInfo'
import formInfo from './@ohos.application.formInfo';
/**
* Interface of formHost.

View File

@ -16,7 +16,7 @@
import { AsyncCallback } from "./basic";
import formBindingData from "./@ohos.app.form.formBindingData";
import formInfo from "./@ohos.application.formInfo";
import Want from "./@ohos.application.Want"
import Want from "./@ohos.application.Want";
/**
* Interface of formProvider.

View File

@ -30,7 +30,7 @@ import rpc from './@ohos.rpc';
* @return -
* @StageModelOnly
* @deprecated since 9
* @useinstead @ohos.app.ability.Ability
* @useinstead ohos.app.ability.Ability
*/
export interface OnReleaseCallBack {
(msg: string): void;
@ -46,7 +46,7 @@ export interface OnReleaseCallBack {
* @return rpc.Sequenceable
* @StageModelOnly
* @deprecated since 9
* @useinstead @ohos.app.ability.Ability
* @useinstead ohos.app.ability.Ability
*/
export interface CalleeCallBack {
(indata: rpc.MessageParcel): rpc.Sequenceable;
@ -60,7 +60,7 @@ export interface CalleeCallBack {
* @permission N/A
* @StageModelOnly
* @deprecated since 9
* @useinstead @ohos.app.ability.Ability
* @useinstead ohos.app.ability.Ability
*/
export interface Caller {
/**
@ -117,7 +117,7 @@ export interface Caller {
* @permission N/A
* @StageModelOnly
* @deprecated since 9
* @useinstead @ohos.app.ability.Ability
* @useinstead ohos.app.ability.Ability
*/
export interface Callee {
@ -153,7 +153,7 @@ export interface Callee {
* @permission N/A
* @StageModelOnly
* @deprecated since 9
* @useinstead @ohos.app.ability.Ability
* @useinstead ohos.app.ability.Ability
*/
export default class Ability {
/**

View File

@ -20,6 +20,8 @@
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
* @StageModelOnly
* @deprecated since 9
* @useinstead ohos.app.ability.AbilityConstant
*/
declare namespace AbilityConstant {
/**

View File

@ -23,6 +23,8 @@ import window from './@ohos.window';
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
* @deprecated since 9
* @useinstead ohos.app.ability.AbilityLifecycleCallback
*/
export default class AbilityLifecycleCallback {
/**

View File

@ -25,6 +25,8 @@ import { Configuration } from './@ohos.application.Configuration';
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
* @StageModelOnly
* @deprecated since 9
* @useinstead ohos.app.ability.AbilityStage
*/
export default class AbilityStage {
/**

View File

@ -21,6 +21,8 @@ import { Configuration } from './@ohos.application.Configuration';
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
* @deprecated since 9
* @useinstead ohos.app.ability.EnvironmentCallback
*/
export default class EnvironmentCallback {
/**

View File

@ -22,6 +22,8 @@ import { Configuration } from './@ohos.application.Configuration';
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @deprecated since 9
* @useinstead ohos.app.ability.ExtensionAbility
*/
export default class ExtensionAbility {
/**

View File

@ -25,6 +25,8 @@ import { Configuration } from './@ohos.application.Configuration';
* @since 9
* @syscap SystemCapability.Ability.Form
* @StageModelOnly
* @deprecated since 9
* @useinstead ohos.app.form.FormExtensionAbility
*/
export default class FormExtension {
/**

View File

@ -25,6 +25,8 @@ import { Configuration } from './@ohos.application.Configuration';
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi hide for inner use.
* @StageModelOnly
* @deprecated since 9
* @useinstead ohos.app.ability.ServiceExtensionAbility
*/
export default class ServiceExtensionAbility {
/**
@ -133,6 +135,6 @@ export default class ServiceExtensionAbility {
* @return The dump info array.
* @StageModelOnly
*/
onDump(params: Array<string>): Array<string>;
dump(params: Array<string>): Array<string>;
}

View File

@ -21,6 +21,8 @@
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
* @StageModelOnly
* @deprecated since 9
* @useinstead ohos.app.ability.StartOptions
*/
export default class StartOptions {
/**

View File

@ -26,6 +26,8 @@ import { ShellCmdResult as _ShellCmdResult } from './application/shellCmdResult'
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @import import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
* @permission N/A
* @deprecated since 9
* @useinstead ohos.app.ability.abilityDelegatorRegistry
*/
declare namespace abilityDelegatorRegistry {
/**

View File

@ -27,7 +27,7 @@ import { ElementName } from './bundle/elementName';
* @systemapi Hide this for inner system use
* @permission N/A
* @deprecated since 9
* @useinstead @ohos.app.ability.abilityManager
* @useinstead ohos.app.ability.abilityManager
*/
declare namespace abilityManager {
/**

View File

@ -27,6 +27,8 @@ import { ProcessRunningInformation as _ProcessRunningInformation } from './appli
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @import import appManager from '@ohos.application.appManager'
* @permission N/A
* @deprecated since 9
* @useinstead ohos.app.ability.appManager
*/
declare namespace appManager {
/**

View File

@ -29,6 +29,8 @@ import * as _PermissionRequestResult from './application/PermissionRequestResul
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @deprecated since 9
* @useinstead ohos.app.ability.common
*/
declare namespace context {

View File

@ -24,7 +24,7 @@ import * as _ErrorObserver from './application/ErrorObserver';
* @import import errorManager from '@ohos.application.errorManager'
* @permission N/A
* @deprecated since 9
* @useinstead @ohos.app.ability.errorManager
* @useinstead ohos.app.ability.errorManager
*/
declare namespace errorManager {
/**

View File

@ -28,7 +28,7 @@ import StartOptions from "./@ohos.application.StartOptions";
* @permission ohos.permission.MANAGE_MISSIONS
* @systemapi hide for inner use.
* @deprecated since 9
* @useinstead @ohos.app.ability.missionManager
* @useinstead ohos.app.ability.missionManager
*/
declare namespace missionManager {
/**

View File

@ -1,155 +0,0 @@
/*
* 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";
/**
* Interface of quickFixManager.
*
* @name quickFixManager
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
* @deprecated since 9
* @useinstead @ohos.app.ability.quickFixManager
*/
declare namespace quickFixManager {
/**
* Quick fix info of hap module.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
*/
export interface HapModuleQuickFixInfo {
/**
* Indicates hap module name.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
*/
readonly moduleName: string;
/**
* Indicates hash value of a hap.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
*/
readonly originHapHash: string;
/**
* Indicates installed path of quick fix file.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
*/
readonly quickFixFilePath: string;
}
/**
* Quick fix info of application.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
*/
export interface ApplicationQuickFixInfo {
/**
* Bundle name.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
*/
readonly bundleName: string;
/**
* The version number of the bundle.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
*/
readonly bundleVersionCode: number;
/**
* The version name of the bundle.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
*/
readonly bundleVersionName: string;
/**
* The version number of the quick fix.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
*/
readonly quickFixVersionCode: number;
/**
* The version name of the quick fix.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
*/
readonly quickFixVersionName: string;
/**
* Hap module quick fix info.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @systemapi Hide this for inner system use.
*/
readonly hapModuleQuickFixInfo: Array<HapModuleQuickFixInfo>;
}
/**
* Apply quick fix files.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @param hapModuleQuickFixFiles Quick fix files need to apply, this value should include file path and file name.
* @systemapi Hide this for inner system use.
* @return -
* @permission ohos.permission.INSTALL_BUNDLE
*/
function applyQuickFix(hapModuleQuickFixFiles: Array<string>, callback: AsyncCallback<void>): void;
function applyQuickFix(hapModuleQuickFixFiles: Array<string>): Promise<void>;
/**
* Get application quick fix info by bundle name.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
* @param bundleName Bundle name wish to query.
* @systemapi Hide this for inner system use.
* @return Returns the {@link ApplicationQuickFixInfo}.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
*/
function getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback<ApplicationQuickFixInfo>): void;
function getApplicationQuickFixInfo(bundleName: string): Promise<ApplicationQuickFixInfo>;
}
export default quickFixManager;

View File

@ -28,7 +28,7 @@ import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo';
* @import import wantAgent from '@ohos.wantAgent';
* @permission N/A
* @deprecated since 9
* @useinstead @ohos.app.wantAgent
* @useinstead ohos.app.ability.wantAgent
*/
declare namespace wantAgent {
/**

View File

@ -26,8 +26,6 @@ import rdb from '../@ohos.data.rdb';
*
* @since 7
* @FAModelOnly
* @deprecated since 9
* @useinstead @ohos.app.ability.dataAbilityHelper
*/
export interface DataAbilityHelper {
/**
@ -243,8 +241,6 @@ export interface DataAbilityHelper {
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @deprecated since 9
* @useinstead @ohos.app.ability.dataAbilityHelper
*/
export interface PacMap {

View File

@ -1,474 +0,0 @@
/*
* 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 { ResultSet } from '../data/rdb/resultSet';
import { DataAbilityOperation } from './dataAbilityOperation';
import { DataAbilityResult } from './dataAbilityResult';
import dataAbility from '../@ohos.data.dataAbility';
import rdb from '../@ohos.data.rdb';
/**
* DataAbilityHelper
* @interface
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
export interface DataAbilityHelper {
/**
* Opens a file in a specified remote path.
* @param { string } uri - Indicates the path of the file to open.
* @param { string } mode - Indicates the file open mode, which can be "r" for read-only access, "w" for write-only
* access (erasing whatever data is currently in the file), "wt" for write access that
* truncates any existing file, "wa" for write-only access to append to any existing data,
* "rw" for read and write access on any existing data, or "rwt" for read and write access
* that truncates any existing file.
* @param { AsyncCallback<number> } callback - The callback is used to return the file descriptor.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
openFile(uri: string, mode: string, callback: AsyncCallback<number>): void;
/**
* Opens a file in a specified remote path.
* @param { string } uri - Indicates the path of the file to open.
* @param { string } mode - Indicates the file open mode, which can be "r" for read-only access, "w" for write-only
* access (erasing whatever data is currently in the file), "wt" for write access that
* truncates any existing file, "wa" for write-only access to append to any existing data,
* "rw" for read and write access on any existing data, or "rwt" for read and write access
* that truncates any existing file.
* @returns { Promise<number> } Returns the promise of file descriptor.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
openFile(uri: string, mode: string): Promise<number>;
/**
* Registers an observer to observe data specified by the given uri.
* @param { string } type - dataChange.
* @param { string } uri - Indicates the path of the data to operate.
* @param { AsyncCallback<void> } callback - The callback when dataChange.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
on(type: 'dataChange', uri: string, callback: AsyncCallback<void>): void;
/**
* Deregisters all observers used for monitoring data specified by the given uri.
* @param { string } type - dataChange.
* @param { string } uri - Indicates the path of the data to operate.
* @param { AsyncCallback<void> } callback - The callback when dataChange.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
off(type: 'dataChange', uri: string, callback?: AsyncCallback<void>): void;
/**
* Obtains the MIME type of the date specified by the given URI.
* @param { string } uri - Indicates the path of the data to operate.
* @param { AsyncCallback<string> } callback - The callback is used to return the MIME type.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
getType(uri: string, callback: AsyncCallback<string>): void;
/**
* Obtains the MIME type of the date specified by the given URI.
* @param { string } uri - Indicates the path of the data to operate.
* @returns { Promise<string> } Returns the promise of MIME type that matches the data specified by uri.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
getType(uri: string): Promise<string>;
/**
* Obtains the MIME types of files supported.
* @param { string } uri - Indicates the path of the files to obtain.
* @param { string } mimeTypeFilter - Indicates the MIME types of the files to obtain.
* @param { AsyncCallback<Array<string>> } callback - The callback is used to return the matched MIME types Array.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback<Array<string>>): void;
/**
* Obtains the MIME types of files supported.
* @param { string } uri - Indicates the path of the files to obtain.
* @param { string } mimeTypeFilter - Indicates the MIME types of the files to obtain.
* @returns { Promise<Array<string>> } Returns the promise of matched MIME types Array.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
getFileTypes(uri: string, mimeTypeFilter: string): Promise<Array<string>>;
/**
* Converts the given uri that refers to the Data ability into a normalized uri.
* @param { string } uri - Indicates the uri object to normalize.
* @param { AsyncCallback<string> } callback - The callback is used to return the normalized uri object.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
normalizeUri(uri: string, callback: AsyncCallback<string>): void;
/**
* Converts the given uri that refers to the Data ability into a normalized uri.
* @param { string } uri - Indicates the uri object to normalize.
* @returns { Promise<string> } Returns the promise of normalized uri object.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
normalizeUri(uri: string): Promise<string>;
/**
* Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one.
* @param { string } uri - Indicates the uri object to normalize.
* @param { AsyncCallback<string> } callback - The callback is used to return the denormalized uri object.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
denormalizeUri(uri: string, callback: AsyncCallback<string>): void;
/**
* Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one.
* @param { string } uri - Indicates the uri object to normalize.
* @returns { Promise<string> } Returns the denormalized uri object.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
denormalizeUri(uri: string): Promise<string>;
/**
* Notifies the registered observers of a change to the data resource specified by uri.
* @param { string } uri - Indicates the path of the data to operate.
* @param { AsyncCallback<void> } callback - The callback of notifyChange.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
notifyChange(uri: string, callback: AsyncCallback<void>): void;
/**
* Notifies the registered observers of a change to the data resource specified by uri.
* @param { string } uri - Indicates the path of the data to operate.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
notifyChange(uri: string): Promise<void>;
/**
* Inserts a single data record into the database.
* @param { string } uri - Indicates the path of the data to insert.
* @param { rdb.ValuesBucket } valuesBucket - Indicates the data record to insert. If this parameter is null,
* a blank row will be inserted.
* @param { AsyncCallback<number> } callback - The callback is used to return the index of the inserted data record.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
insert(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback<number>): void;
/**
* Inserts a single data record into the database.
* @param { string } uri - Indicates the path of the data to insert.
* @param { rdb.ValuesBucket } valuesBucket - Indicates the data record to insert. If this parameter is null,
* a blank row will be inserted.
* @returns { Promise<number> } Returns the index of the inserted data record.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
insert(uri: string, valuesBucket: rdb.ValuesBucket): Promise<number>;
/**
* Inserts multiple data records into the database.
* @param { string } uri - Indicates the path of the data to batchInsert.
* @param { Array<rdb.ValuesBucket> } valuesBuckets - Indicates the data records to insert.
* @param { AsyncCallback<number> } callback - The callback is used to return the number of data records inserted.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
batchInsert(uri: string, valuesBuckets: Array<rdb.ValuesBucket>, callback: AsyncCallback<number>): void;
/**
* Inserts multiple data records into the database.
* @param { string } uri - Indicates the path of the data to batchInsert.
* @param { Array<rdb.ValuesBucket> } valuesBuckets - Indicates the data records to insert.
* @returns { Promise<number> } Returns the number of data records inserted.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
batchInsert(uri: string, valuesBuckets: Array<rdb.ValuesBucket>): Promise<number>;
/**
* Deletes one or more data records from the database.
* @param { string } uri - Indicates the path of the data to delete.
* @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define the
* processing logic when this parameter is null.
* @param { AsyncCallback<number> } callback - The callback is used to return the number of data records deleted.
* @returns { Promise<number> } Returns the number of data records deleted.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback<number>): void;
/**
* Deletes one or more data records from the database.
* @param { string } uri - Indicates the path of the data to delete.
* @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define the
* processing logic when this parameter is null.
* @returns { Promise<number> } Returns the number of data records deleted.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise<number>;
/**
* Deletes one or more data records from the database.
* @param { string } uri - Indicates the path of the data to delete.
* @param { AsyncCallback<number> } callback - The callback is used to return the number of data records deleted.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
delete(uri: string, callback: AsyncCallback<number>): void;
/**
* Updates data records in the database.
* @param { string } uri - Indicates the path of data to update.
* @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update.
* @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define
* the processing logic when this parameter is null.
* @param { AsyncCallback<number> } callback - The callback is used to return the number of data records updated.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback<number>): void;
/**
* Updates data records in the database.
* @param { string } uri - Indicates the path of data to update.
* @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update.
* @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define
* the processing logic when this parameter is null.
* @returns { Promise<number> } Returns the number of data records updated.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.DataAbilityPredicates): Promise<number>;
/**
* Updates data records in the database.
* @param { string } uri - Indicates the path of data to update.
* @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update.
* @param { AsyncCallback<number> } callback - The callback is used to return the number of data records updated.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
update(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback<number>): void;
/**
* Queries data in the database.
* @param { string } uri - Indicates the path of data to query.
* @param { Array<string> } columns - Indicates the columns to query. If this parameter is null, all columns are queried.
* @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define
* the processing logic when this parameter is null.
* @param { AsyncCallback<ResultSet> } callback - The callback is used to return the query result {@link ResultSet}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
query(uri: string, columns: Array<string>, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback<ResultSet>): void;
/**
* Queries data in the database.
* @param { string } uri - Indicates the path of data to query.
* @param { AsyncCallback<ResultSet> } callback - The callback is used to return the query result {@link ResultSet}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
query(uri: string, callback: AsyncCallback<ResultSet>): void;
/**
* Queries data in the database.
* @param { string } uri - Indicates the path of data to query.
* @param { Array<string> } columns - Indicates the columns to query. If this parameter is null, all columns are queried.
* @param { AsyncCallback<ResultSet> } callback - The callback is used to return the query result {@link ResultSet}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
query(uri: string, columns: Array<string>, callback: AsyncCallback<ResultSet>): void;
/**
* Queries data in the database.
* @param { string } uri - Indicates the path of data to query.
* @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define
* the processing logic when this parameter is null.
* @param { AsyncCallback<ResultSet> } callback - The callback is used to return the query result {@link ResultSet}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
query(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback<ResultSet>): void;
/**
* Queries data in the database.
* @param { string } uri - Indicates the path of data to query.
* @param { Array<string> } columns - Indicates the columns to query. If this parameter is null, all columns are queried.
* @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define
* the processing logic when this parameter is null.
* @returns { Promise<ResultSet> } Returns the query result {@link ResultSet}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
query(uri: string, columns?: Array<string>, predicates?: dataAbility.DataAbilityPredicates): Promise<ResultSet>;
/**
* Calls the extended API of the DataAbility. This method uses a promise to return the result.
* @param { string } uri - URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx"
* @param { string } method - Indicates the method to call.
* @param { string } arg - Indicates the parameter of the String type.
* @param { PacMap } extras - Indicates the parameter of the PacMap type.
* If a custom Sequenceable object is put in the PacMap object and will be transferred across processes,
* you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object.
* If the PacMap object is to be transferred to a non-OHOS process,
* values of primitive types are supported, but not custom Sequenceable objects.
* @param { AsyncCallback<PacMap> } callback - The callback is used to return the query result {@link PacMap}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback<PacMap>): void;
/**
* Calls the extended API of the DataAbility. This method uses a promise to return the result.
* @param { string } uri - URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx"
* @param { string } method - Indicates the method to call.
* @param { string } arg - Indicates the parameter of the String type.
* @param { PacMap } extras - Indicates the parameter of the PacMap type.
* If a custom Sequenceable object is put in the PacMap object and will be transferred across processes,
* you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object.
* If the PacMap object is to be transferred to a non-OHOS process,
* values of primitive types are supported, but not custom Sequenceable objects.
* @returns { Promise<PacMap> } Returns the query result {@link PacMap}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
call(uri: string, method: string, arg: string, extras: PacMap): Promise<PacMap>;
/**
* Queries data in the database.
* @param { string } uri - Indicates the path of data to query.
* @param { Array<DataAbilityOperation> } operations - Indicates the data operation list, which can contain
* multiple operations on the database.
* @param { AsyncCallback<Array<DataAbilityResult>> } callback - The callback is used to return the result of each
* operation, in array {@link DataAbilityResult}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
executeBatch(uri: string, operations: Array<DataAbilityOperation>, callback: AsyncCallback<Array<DataAbilityResult>>): void;
/**
* Queries data in the database.
* @param { string } uri - Indicates the path of data to query.
* @param { Array<DataAbilityOperation> } operations - Indicates the data operation list, which can contain
* multiple operations on the database.
* @returns { Promise<Array<DataAbilityResult>> } Returns the result of each operation, in array {@link DataAbilityResult}.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
executeBatch(uri: string, operations: Array<DataAbilityOperation>): Promise<Array<DataAbilityResult>>;
}
/**
* Defines a PacMap object for storing a series of values.
* @typedef PacMap
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
export interface PacMap {
/**
* Indicates the parameter of the PacMap type.
* If a custom Sequenceable object is put in the PacMap object and will be transferred across processes,
* you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object.
* If the PacMap object is to be transferred to a non-OHOS process,
* values of primitive types are supported, but not custom Sequenceable objects.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @famodelonly
* @since 9
*/
[key: string]: number | string | boolean | Array<string | number | boolean> | null;
}

View File

@ -34,8 +34,6 @@ import bundle from '../@ohos.bundle';
* @import import abilityManager from 'app/context'
* @permission N/A
* @FAModelOnly
* @deprecated since 9
* @useinstead @ohos.app.featureAbility.context
*/
export interface Context extends BaseContext {
@ -277,8 +275,6 @@ export interface Context extends BaseContext {
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
* @FAModelOnly
* @deprecated since 9
* @useinstead @ohos.app.featureAbility.context
*/
interface PermissionRequestResult {
/**
@ -312,8 +308,6 @@ interface PermissionRequestResult {
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
* @FAModelOnly
* @deprecated since 9
* @useinstead @ohos.app.featureAbility.context
*/
interface PermissionOptions {
/**

View File

@ -1,593 +0,0 @@
/*
* 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 { ApplicationInfo } from '../bundle/applicationInfo';
import { ProcessInfo } from './processInfo';
import { ElementName } from '../bundle/elementName';
import BaseContext from '../application/BaseContext';
import { HapModuleInfo } from '../bundle/hapModuleInfo';
import { AppVersionInfo } from './appVersionInfo';
import { AbilityInfo } from '../bundle/abilityInfo';
import bundle from '../@ohos.bundle';
/**
* The context of an ability or an application. It allows access to
* application-specific resources, request and verification permissions.
* Can only be obtained through the ability.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
export interface Context extends BaseContext {
/**
* Get the local root dir of an app. If it is the first call, the dir
* will be created.
* @note If in the context of the ability, return the root dir of
* the ability; if in the context of the application, return the
* root dir of the application.
* @returns { Promise<string> } Returns the root dir.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getOrCreateLocalDir(): Promise<string>;
/**
* Get the local root dir of an app. If it is the first call, the dir
* will be created.
* @note If in the context of the ability, return the root dir of
* the ability; if in the context of the application, return the
* root dir of the application.
* @param { AsyncCallback<string> } callback - The callback is used to return the root dir.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getOrCreateLocalDir(callback: AsyncCallback<string>): void;
/**
* Verify whether the specified permission is allowed for a particular
* pid and uid running in the system.
* @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission.
* @param { string } permission - The name of the specified permission.
* @param { PermissionOptions } options - Indicates the permission options.
* @returns { Promise<number> } Returns {@code 0} if the PID and UID have the permission.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
verifyPermission(permission: string, options?: PermissionOptions): Promise<number>;
/**
* Verify whether the specified permission is allowed for a particular
* pid and uid running in the system.
* @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission.
* @param { string } permission - The name of the specified permission.
* @param { PermissionOptions } options - Indicates the permission options.
* @param { AsyncCallback<number> } callback - Returns {@code 0} if the PID and UID have the permission.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
verifyPermission(permission: string, options: PermissionOptions, callback: AsyncCallback<number>): void;
/**
* Verify whether the specified permission is allowed for a particular
* pid and uid running in the system.
* @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission.
* @param { string } permission - The name of the specified permission.
* @param { AsyncCallback<number> } callback - Returns {@code 0} if the PID and UID have the permission.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
verifyPermission(permission: string, callback: AsyncCallback<number>): void;
/**
* Requests certain permissions from the system.
* @param { Array<string> } permissions - Indicates the list of permissions to be requested. This parameter cannot be null.
* @param { number } requestCode - Indicates the request code to be passed to the PermissionRequestResult.
* @param { AsyncCallback<PermissionRequestResult> } resultCallback - The callback is used to return the PermissionRequestResult.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
requestPermissionsFromUser(permissions: Array<string>, requestCode: number, resultCallback: AsyncCallback<PermissionRequestResult>): void;
/**
* Requests certain permissions from the system.
* @param { Array<string> } permissions - Indicates the list of permissions to be requested. This parameter cannot be null.
* @param { number } requestCode - Indicates the request code to be passed to the PermissionRequestResult.
* @returns { Promise<PermissionRequestResult> } Returns the PermissionRequestResult.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
requestPermissionsFromUser(permissions: Array<string>, requestCode: number): Promise<PermissionRequestResult>;
/**
* Obtains information about the current application.
* @param { AsyncCallback<ApplicationInfo> } callback - The callback is used to return the ApplicationInfo.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getApplicationInfo(callback: AsyncCallback<ApplicationInfo>): void
/**
* Obtains information about the current application.
* @returns { Promise<ApplicationInfo> } Returns the ApplicationInfo.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getApplicationInfo(): Promise<ApplicationInfo>;
/**
* Obtains the bundle name of the current ability.
* @param { AsyncCallback<string> } callback - The callback is used to return the bundle name.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getBundleName(callback: AsyncCallback<string>): void
/**
* Obtains the bundle name of the current ability.
* @returns { Promise<string> } Returns the bundle name.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getBundleName(): Promise<string>;
/**
* Obtains the current display orientation of this ability.
* @param { AsyncCallback<bundle.DisplayOrientation> } callback - The callback is used to return the display orientation.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getDisplayOrientation(callback: AsyncCallback<bundle.DisplayOrientation>): void
/**
* Obtains the current display orientation of this ability.
* @returns { Promise<bundle.DisplayOrientation> } Returns the display orientation.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getDisplayOrientation(): Promise<bundle.DisplayOrientation>;
/**
* Sets the display orientation of the current ability.
* @param { bundle.DisplayOrientation } orientation - Indicates the new orientation for the current ability.
* @param { AsyncCallback<void> } callback - The callback of setDisplayOrientation.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
setDisplayOrientation(orientation: bundle.DisplayOrientation, callback: AsyncCallback<void>): void
/**
* Sets the display orientation of the current ability.
* @param { bundle.DisplayOrientation } orientation - Indicates the new orientation for the current ability.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
setDisplayOrientation(orientation: bundle.DisplayOrientation): Promise<void>;
/**
* Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed,
* keeping the ability in the ACTIVE state.
* @param { boolean } show - Specifies whether to show this ability on top of the lock screen. The value true
* means to show it on the lock screen, and the value false means not.
* @param { AsyncCallback<void> } callback - The callback of setShowOnLockScreen.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
setShowOnLockScreen(show: boolean, callback: AsyncCallback<void>): void
/**
* Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed,
* keeping the ability in the ACTIVE state.
* @param { boolean } show - Specifies whether to show this ability on top of the lock screen. The value true
* means to show it on the lock screen, and the value false means not.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
setShowOnLockScreen(show: boolean): Promise<void>;
/**
* Sets whether to wake up the screen when this ability is restored.
* @param { boolean } wakeUp - Specifies whether to wake up the screen. The value true means to wake it up,
* and the value false means not.
* @param { AsyncCallback<void> } callback - The callback of setWakeUpScreen.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback<void>): void
/**
* Sets whether to wake up the screen when this ability is restored.
* @param { boolean } wakeUp - Specifies whether to wake up the screen. The value true means to wake it up,
* and the value false means not.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
setWakeUpScreen(wakeUp: boolean): Promise<void>;
/**
* Obtains information about the current process, including the process ID and name.
* @param { AsyncCallback<ProcessInfo> } callback - The callback is used to return the ProcessInfo.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getProcessInfo(callback: AsyncCallback<ProcessInfo>): void
/**
* Obtains information about the current process, including the process ID and name.
* @returns { Promise<ProcessInfo> } Returns the ProcessInfo.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getProcessInfo(): Promise<ProcessInfo>;
/**
* Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities.
* @param { AsyncCallback<ElementName> } callback - The callback is used to return the ElementName.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getElementName(callback: AsyncCallback<ElementName>): void
/**
* Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities.
* @returns { Promise<ElementName> } Returns the ElementName.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getElementName(): Promise<ElementName>;
/**
* Obtains the name of the current process.
* @param { AsyncCallback<string> } callback - The callback is used to return the process name.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getProcessName(callback: AsyncCallback<string>): void
/**
* Obtains the name of the current process.
* @returns { Promise<string> } Returns the process name.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getProcessName(): Promise<string>;
/**
* Obtains the bundle name of the ability that called the current ability.
* @param { AsyncCallback<string> } callback - The callback is used to return the calling bundle name.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getCallingBundle(callback: AsyncCallback<string>): void
/**
* Obtains the bundle name of the ability that called the current ability.
* @returns { Promise<string> } Returns the calling bundle name.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getCallingBundle(): Promise<string>;
/**
* Obtains the file directory of this application on the internal storage.
* @param { AsyncCallback<string> } callback - The callback is used to return the file directory.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getFilesDir(callback: AsyncCallback<string>): void;
/**
* Obtains the file directory of this application on the internal storage.
* @returns { Promise<string> } Returns the file directory.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getFilesDir(): Promise<string>;
/**
* Obtains the cache directory of this application on the internal storage.
* @param { AsyncCallback<string> } callback - The callback is used to return the cache directory.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getCacheDir(callback: AsyncCallback<string>): void;
/**
* Obtains the cache directory of this application on the internal storage.
* @returns { Promise<string> } Returns the cache directory.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getCacheDir(): Promise<string>;
/**
* Obtains the distributed file path for storing ability or application data files.
* If the distributed file path does not exist, the system will create a path and return the created path.
* @returns { Promise<string> } Returns the distributed file path.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getOrCreateDistributedDir(): Promise<string>;
/**
* Obtains the distributed file path for storing ability or application data files.
* If the distributed file path does not exist, the system will create a path and return the created path.
* @param { AsyncCallback<string> } callback - The callback is used to return the distributed file path.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getOrCreateDistributedDir(callback: AsyncCallback<string>): void;
/**
* Obtains the application type.
* @param { AsyncCallback<string> } callback - The callback is used to return the application type.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getAppType(callback: AsyncCallback<string>): void
/**
* Obtains the application type.
* @returns { Promise<string> } Returns the application type.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getAppType(): Promise<string>;
/**
* Obtains the ModuleInfo object for this application.
* @param { AsyncCallback<HapModuleInfo> } callback - The callback is used to return the HapModuleInfo.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getHapModuleInfo(callback: AsyncCallback<HapModuleInfo>): void
/**
* Obtains the ModuleInfo object for this application.
* @returns { Promise<HapModuleInfo> } Returns the HapModuleInfo.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getHapModuleInfo(): Promise<HapModuleInfo>;
/**
* Obtains the application version information.
* @param { AsyncCallback<AppVersionInfo> } callback - The callback is used to return the application version info.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getAppVersionInfo(callback: AsyncCallback<AppVersionInfo>): void
/**
* Obtains the application version information.
* @returns { Promise<AppVersionInfo> } Returns the application version info.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getAppVersionInfo(): Promise<AppVersionInfo>;
/**
* Obtains the context of this application.
* @returns { Context } Returns the context of this application.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getApplicationContext(): Context;
/**
* Checks the detailed information of this ability.
* @param { AsyncCallback<AbilityInfo> } callback - The callback is used to return the AbilityInfo.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getAbilityInfo(callback: AsyncCallback<AbilityInfo>): void
/**
* Checks the detailed information of this ability.
* @returns { Promise<AbilityInfo> } Returns the AbilityInfo.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
getAbilityInfo(): Promise<AbilityInfo>;
/**
* Checks whether the configuration of this ability is changing.
* @param { AsyncCallback<boolean> } callback - Returns true if the configuration of this ability is changing and false otherwise.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
isUpdatingConfigurations(callback: AsyncCallback<boolean>): void;
/**
* Checks whether the configuration of this ability is changing.
* @returns { Promise<boolean> } Returns true if the configuration of this ability is changing and false otherwise.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
isUpdatingConfigurations(): Promise<boolean>;
/**
* Informs the system of the time required for drawing this Page ability.
* @param { AsyncCallback<void> } callback - The callback of printDrawnCompleted.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
printDrawnCompleted(callback: AsyncCallback<void>): void;
/**
* Informs the system of the time required for drawing this Page ability.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
printDrawnCompleted(): Promise<void>;
}
/**
* the result of requestPermissionsFromUser with asynchronous callback
* @typedef PermissionRequestResult
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
interface PermissionRequestResult {
/**
* The request code passed in by the user
* @type { number }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
requestCode: number;
/**
* The permissions passed in by the user
* @type { Array<string> }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
permissions: Array<string>;
/**
* The results for the corresponding request permissions
* @type { Array<number> }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
authResults: Array<number>;
}
/**
* @typedef PermissionOptions
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
interface PermissionOptions {
/**
* The process id
* @type { number }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
pid?: number;
/**
* The user id
* @type { number }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @famodelonly
* @since 9
*/
uid?: number;
}