mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-10-07 22:24:20 +00:00
strengthen static shortcut
Signed-off-by: zhaogan <zhaogan2@huawei.com>
This commit is contained in:
parent
c745bbf6fa
commit
9b5a20fed6
19
api/@ohos.bundle.launcherBundleManager.d.ts
vendored
19
api/@ohos.bundle.launcherBundleManager.d.ts
vendored
@ -21,6 +21,7 @@
|
||||
import { AsyncCallback } from './@ohos.base';
|
||||
import { LauncherAbilityInfo as _LauncherAbilityInfo } from './bundleManager/LauncherAbilityInfo';
|
||||
import { ShortcutInfo as _ShortcutInfo, ShortcutWant as _ShortcutWant } from './bundleManager/ShortcutInfo';
|
||||
import { StartOptions } from './@ohos.app.ability.StartOptions';
|
||||
|
||||
/**
|
||||
* Launcher bundle manager.
|
||||
@ -174,6 +175,24 @@ declare namespace launcherBundleManager {
|
||||
*/
|
||||
function getShortcutInfoSync(bundleName: string): Array<ShortcutInfo>;
|
||||
|
||||
/**
|
||||
* Starts shortcut.
|
||||
*
|
||||
* @permission ohos.permission.START_SHORTCUT
|
||||
* @param { ShortcutInfo } shortcutInfo - Indicates the shortcut info which contains shortcut want.
|
||||
* @param { StartOptions } [options] - Indicates the start options.
|
||||
* @returns { Promise<void> } the promise returned by the function.
|
||||
* @throws { BusinessError } 201 - Verify permission denied.
|
||||
* @throws { BusinessError } 202 - Permission denied, non-system app called system api.
|
||||
* @throws { BusinessError } 401 - The parameter check failed.
|
||||
* @throws { BusinessError } 801 - Capability not support.
|
||||
* @throws { BusinessError } 17700065 - The specified shortcut want in shortcut info is not supported to be started.
|
||||
* @syscap SystemCapability.BundleManager.BundleFramework.Launcher
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
function startShortcut(shortcutInfo: ShortcutInfo, options?: StartOptions): Promise<void>;
|
||||
|
||||
/**
|
||||
* Contains basic launcher Ability information, which uniquely identifies an LauncherAbilityInfo.
|
||||
*
|
||||
|
43
api/bundleManager/ShortcutInfo.d.ts
vendored
43
api/bundleManager/ShortcutInfo.d.ts
vendored
@ -156,4 +156,47 @@ export interface ShortcutWant {
|
||||
* @since 9
|
||||
*/
|
||||
readonly targetAbility: string;
|
||||
|
||||
/**
|
||||
* Indicates the parameters of the shortcut want
|
||||
*
|
||||
* @type { Array<ParameterItem> }
|
||||
* @readonly
|
||||
* @syscap SystemCapability.BundleManager.BundleFramework.Launcher
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
readonly parameters: Array<ParameterItem>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtains information about the ability that a shortcut will start.
|
||||
*
|
||||
* @typedef ParameterItem
|
||||
* @syscap SystemCapability.BundleManager.BundleFramework.Launcher
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
export interface ParameterItem {
|
||||
/**
|
||||
* Indicates the key of the parameter item.
|
||||
*
|
||||
* @type { string }
|
||||
* @readonly
|
||||
* @syscap SystemCapability.BundleManager.BundleFramework.Launcher
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
readonly key: string;
|
||||
|
||||
/**
|
||||
* Indicates the value of the parameter item.
|
||||
*
|
||||
* @type { string }
|
||||
* @readonly
|
||||
* @syscap SystemCapability.BundleManager.BundleFramework.Launcher
|
||||
* @systemapi
|
||||
* @since 12
|
||||
*/
|
||||
readonly value: string;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user