支持主题卡片

Change-Id: I6b8d7c4211966ad4c606235f5dce5deaca423bc5
Signed-off-by: sunhaiyang <sunhy.sun@huawei.com>
This commit is contained in:
sunhaiyang 2024-02-18 11:52:35 +08:00
parent 4e0d9c39ad
commit 11f2f4397c
2 changed files with 46 additions and 0 deletions

View File

@ -32,6 +32,26 @@ import formInfo from './@ohos.app.form.formInfo';
* @since 9
*/
declare namespace formHost {
/**
* Add a form.
* <p>You can use this method to create a theme form.</p>
*
* @permission ohos.permission.REQUIRE_FORM
* @param { Want } want - Indicates want of the form.
* @returns { Promise<formInfo.RunningFormInfo> } Return the form info.
* @throws { BusinessError } 201 - Permissions denied.
* @throws { BusinessError } 202 - The application is not a system application.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @throws { BusinessError } 16500050 - An IPC connection error happened.
* @throws { BusinessError } 16500060 - A service connection error happened, please try again later.
* @throws { BusinessError } 16501000 - An internal functional error occurred.
* @syscap SystemCapability.Ability.Form
* @systemapi
* @stagemodelonly
* @since 12
*/
function addForm(want: Want): Promise<formInfo.RunningFormInfo>;
/**
* Deletes an obtained form by its ID.
* <p>After this method is called, the form won't be available for use by the application and the Form Manager

View File

@ -874,6 +874,20 @@ declare namespace formInfo {
*/
ABILITY_NAME_KEY = 'ohos.extra.param.key.ability_name',
/**
* Indicates the key specifying whether a form type is theme, which is represented as
* want: {
* "parameters": {
* THEME_KEY: true
* }
* }
*
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 12
*/
THEME_KEY = 'ohos.extra.param.key.form_is_theme',
/**
* Indicates the key specifying the the device ID, which is represented as
* want: {
@ -1528,6 +1542,18 @@ declare namespace formInfo {
* @since 11
*/
readonly formDescription: string;
/**
* Obtains the extra data of the this form.
*
* @type { ?Record<string, Object> }
* @default -
* @readonly
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 12
*/
readonly extraData?: Record<string, Object>;
}
/**