1 Star 0 Fork 4K

Feng Lin/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.bundle.d.ts 37.72 KB
一键复制 编辑 原始数据 按行查看 历史
sunjiakun 提交于 2024-07-13 15:07 +08:00 . API Lint
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
/*
* 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.
*/
/**
* @file
* @kit AbilityKit
*/
import { AsyncCallback } from './@ohos.base';
import { ApplicationInfo } from './bundle/applicationInfo';
import { AbilityInfo } from './bundle/abilityInfo';
import { PermissionDef } from './bundle/PermissionDef';
import Want from './@ohos.app.ability.Want';
import image from './@ohos.multimedia.image';
import { BundleInfo } from './bundle/bundleInfo';
import { BundleInstaller } from './bundle/bundleInstaller';
/**
* bundle.
*
* @namespace bundle
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager
*/
declare namespace bundle {
/**
* BundleFlag
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager.BundleFlag
*/
enum BundleFlag {
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
GET_BUNDLE_DEFAULT = 0x00000000,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
GET_BUNDLE_WITH_ABILITIES = 0x00000001,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
GET_ABILITY_INFO_WITH_PERMISSION = 0x00000002,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
GET_ABILITY_INFO_WITH_APPLICATION = 0x00000004,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
GET_APPLICATION_INFO_WITH_PERMISSION = 0x00000008,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
GET_BUNDLE_WITH_REQUESTED_PERMISSION = 0x00000010,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
GET_ALL_APPLICATION_INFO = 0xFFFF0000,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
GET_ABILITY_INFO_WITH_METADATA = 0x00000020,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
GET_APPLICATION_INFO_WITH_METADATA = 0x00000040,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
GET_ABILITY_INFO_SYSTEMAPP_ONLY = 0x00000080,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
GET_ABILITY_INFO_WITH_DISABLE = 0x00000100,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
GET_APPLICATION_INFO_WITH_DISABLE = 0x00000200
}
/**
* ColorMode
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
export enum ColorMode {
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
AUTO_MODE = -1,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
DARK_MODE = 0,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
LIGHT_MODE = 1
}
/**
* GrantStatus
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager.PermissionGrantState
*/
export enum GrantStatus {
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
PERMISSION_DENIED = -1,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
PERMISSION_GRANTED = 0
}
/**
* AbilityType
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager.AbilityType
*/
export enum AbilityType {
/**
* Indicates an unknown ability type
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
UNKNOWN,
/**
* Indicates that the ability has a UI
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
PAGE,
/**
* Indicates that the ability does not have a UI
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
SERVICE,
/**
* Indicates that the ability is used to provide data access services
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
DATA
}
/**
* AbilitySubType
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
export enum AbilitySubType {
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
UNSPECIFIED = 0,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
CA = 1
}
/**
* DisplayOrientation
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager.DisplayOrientation
*/
export enum DisplayOrientation {
/**
* Indicates that the system automatically determines the display orientation
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
UNSPECIFIED,
/**
* Indicates the landscape orientation
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
LANDSCAPE,
/**
* Indicates the portrait orientation
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
PORTRAIT,
/**
* 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
*/
FOLLOW_RECENT
}
/**
* LaunchMode
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
* @useinstead ohos.bundle.bundleManager.LaunchType
*/
export enum LaunchMode {
/**
* Indicates that the ability has only one instance
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
SINGLETON = 0,
/**
* Indicates that the ability can have multiple instances
*
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STANDARD = 1
}
/**
* BundleOptions
*
* @typedef BundleOptions
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
export interface BundleOptions {
/**
* Indicates the user id
*
* @type { ?number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
userId?: number;
}
/**
* InstallErrorCode
*
* @enum { number }
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
export enum InstallErrorCode {
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
SUCCESS = 0,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_INSTALL_FAILURE = 1,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_INSTALL_FAILURE_ABORTED = 2,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_INSTALL_FAILURE_INVALID = 3,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_INSTALL_FAILURE_CONFLICT = 4,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_INSTALL_FAILURE_STORAGE = 5,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_INSTALL_FAILURE_INCOMPATIBLE = 6,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_UNINSTALL_FAILURE = 7,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_UNINSTALL_FAILURE_BLOCKED = 8,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_UNINSTALL_FAILURE_ABORTED = 9,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_UNINSTALL_FAILURE_CONFLICT = 10,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT = 0x0B,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED = 0x0C,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
STATUS_RECOVER_FAILURE_INVALID = 0x0D,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_ABILITY_NOT_FOUND = 0x40,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
STATUS_BMS_SERVICE_ERROR = 0x41,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
STATUS_FAILED_NO_SPACE_LEFT = 0x42,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
STATUS_GRANT_REQUEST_PERMISSIONS_FAILED = 0x43,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
STATUS_INSTALL_PERMISSION_DENIED = 0x44,
/**
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
STATUS_UNINSTALL_PERMISSION_DENIED = 0x45
}
/**
* 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.
* @param { AsyncCallback<BundleInfo> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
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
*/
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
*/
function getBundleInfo(bundleName: string, bundleFlags: number, options?: BundleOptions): Promise<BundleInfo>;
/**
* Obtains the interface used to install bundles.
*
* @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.
*
* @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
*/
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
*/
function getAbilityInfo(bundleName: string, abilityName: string): Promise<AbilityInfo>;
/**
* 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.
* @param { AsyncCallback<ApplicationInfo> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
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
*/
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
*/
function getApplicationInfo(bundleName: string, bundleFlags: number, userId?: number): Promise<ApplicationInfo>;
/**
* 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.
* @param { AsyncCallback<Array<AbilityInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
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
*/
function queryAbilityByWant(want: Want, bundleFlags: 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 { 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
*/
function queryAbilityByWant(want: Want, bundleFlags: number, userId?: number): Promise<Array<AbilityInfo>>;
/**
* 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.
* @param { AsyncCallback<Array<BundleInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
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
*/
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
*/
function getAllBundleInfo(bundleFlag: BundleFlag, userId?: number): Promise<Array<BundleInfo>>;
/**
* 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.
* @param { AsyncCallback<Array<ApplicationInfo>> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
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
*/
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
*/
function getAllApplicationInfo(bundleFlags: number, userId?: number): Promise<Array<ApplicationInfo>>;
/**
* Obtains bundle name by the given uid.
*
* @param { number } uid - Indicates the UID of an application.
* @param { AsyncCallback<string> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
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
*/
function getNameForUid(uid: number): Promise<string>;
/**
* 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.
* @param { AsyncCallback<BundleInfo> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
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
*/
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number): Promise<BundleInfo>;
/**
* 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.
* @param { AsyncCallback<Want> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 7
* @deprecated since 9
*/
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
*/
function getLaunchWantForBundle(bundleName: string): Promise<Want>;
/**
* 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.
* @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.
*
* @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.
*
* @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.
*
* @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.
*
* @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<string> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
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
*/
function getAbilityLabel(bundleName: string, abilityName: string): Promise<string>;
/**
* 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.
*
* @param { AbilityInfo } info - Indicates information about the ability to check.
* @param { AsyncCallback<boolean> } callback
* @syscap SystemCapability.BundleManager.BundleFramework
* @since 8
* @deprecated since 9
*/
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
*/
function isAbilityEnabled(info: AbilityInfo): Promise<boolean>;
/**
* 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
*/
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
*/
function isApplicationEnabled(bundleName: string): Promise<boolean>;
}
export default bundle;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lffl8796/interface_sdk-js.git
git@gitee.com:lffl8796/interface_sdk-js.git
lffl8796
interface_sdk-js
interface_sdk-js
master

搜索帮助