diff --git a/api/@internal/component/ets/action_sheet.d.ts b/api/@internal/component/ets/action_sheet.d.ts index 8f4d561c1..42023c42c 100644 --- a/api/@internal/component/ets/action_sheet.d.ts +++ b/api/@internal/component/ets/action_sheet.d.ts @@ -119,7 +119,16 @@ interface SheetInfo { * @atomicservice * @since 11 */ - action: () => void; + /** + * Callback method after the operation. + * + * @type { VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + action: VoidCallback; } /** @@ -155,6 +164,167 @@ declare interface DismissDialogAction { reason: DismissReason; } +/** + * Base button params used for ActionSheet. + * + * @interface ActionSheetButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +interface ActionSheetButtonOptions { + /** + * Enable switch of confirmation button + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Enable switch of confirmation button + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + enabled?: boolean; + + /** + * Default focus switch of confirmation button + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Default focus switch of confirmation button + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + defaultFocus?: boolean; + + /** + * Style of confirmation button. + * @type { ?DialogButtonStyle } + * @default DialogButtonStyle.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Style of confirmation button. + * @type { ?DialogButtonStyle } + * @default DialogButtonStyle.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + style?: DialogButtonStyle; + + /** + * Text content of the confirmation button. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text content of the confirmation button. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Text content of the confirmation button. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + value: string | Resource; + + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Method executed by the callback. + * + * @type { function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Method executed by the callback. + * + * @type { VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + action: VoidCallback; +} + +/** + * ActionSheet offset. + * + * @interface ActionSheetOffset + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +interface ActionSheetOffset { + /** + * Dx of the pop-up window relative to the alignment position. + * + * @type { number | string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + dx: number | string | Resource; + /** + * Dy of the pop-up window relative to the alignment position. + * + * @type { number | string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + dy: number | string | Resource; +} + /** * The options of ActionSheet. * @@ -274,116 +444,16 @@ interface ActionSheetOptions * @atomicservice * @since 11 */ - confirm?: { - /** - * Enable switch of confirmation button - * @type { ?boolean } - * @default true - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Enable switch of confirmation button - * @type { ?boolean } - * @default true - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - enabled?: boolean; - - /** - * Default focus switch of confirmation button - * @type { ?boolean } - * @default false - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Default focus switch of confirmation button - * @type { ?boolean } - * @default false - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - defaultFocus?: boolean; - - /** - * Style of confirmation button. - * @type { ?DialogButtonStyle } - * @default DialogButtonStyle.DEFAULT - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Style of confirmation button. - * @type { ?DialogButtonStyle } - * @default DialogButtonStyle.DEFAULT - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - style?: DialogButtonStyle; - - /** - * Text content of the confirmation button. - * - * @type { string | Resource } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 8 - */ - /** - * Text content of the confirmation button. - * - * @type { string | Resource } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Text content of the confirmation button. - * - * @type { string | Resource } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - value: string | Resource; - - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 8 - */ - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - action: () => void; - }; + /** + * Invoke the commit function. + * + * @type { ?ActionSheetButtonOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + confirm?: ActionSheetButtonOptions; /** * Execute Cancel Function. @@ -409,7 +479,16 @@ interface ActionSheetOptions * @atomicservice * @since 11 */ - cancel?: () => void; + /** + * Execute Cancel Function. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + cancel?: VoidCallback; /** * The Array of sheets @@ -513,7 +592,16 @@ interface ActionSheetOptions * @atomicservice * @since 11 */ - offset?: { dx: number | string | Resource; dy: number | string | Resource }; + /** + * Offset of the pop-up window relative to the alignment position. + * + * @type { ?ActionSheetOffset } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + offset?: ActionSheetOffset; /** * Mask Region of dialog. The size cannot exceed the main window. diff --git a/api/@internal/component/ets/alert_dialog.d.ts b/api/@internal/component/ets/alert_dialog.d.ts index 53310816b..17e27989f 100644 --- a/api/@internal/component/ets/alert_dialog.d.ts +++ b/api/@internal/component/ets/alert_dialog.d.ts @@ -345,23 +345,15 @@ declare enum DialogButtonDirection { } /** - * Base button param used for AlertDialogParamWithOptions. + * Base button param. * - * @interface AlertDialogButtonOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ -/** - * Base button param used for AlertDialogParamWithOptions. - * - * @interface AlertDialogButtonOptions + * @interface AlertDialogButtonBaseOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 11 + * @since 13 */ -declare interface AlertDialogButtonOptions { +declare interface AlertDialogButtonBaseOptions { /** * Enable switch of button. * @@ -499,7 +491,45 @@ declare interface AlertDialogButtonOptions { * @atomicservice * @since 11 */ - action: () => void; + /** + * Method executed by the callback. + * + * @type { VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + action: VoidCallback; +} + +/** + * Base button param used for AlertDialogParamWithOptions. + * + * @interface AlertDialogButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ +/** + * Base button param used for AlertDialogParamWithOptions. + * + * @interface AlertDialogButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ +/** + * Button param used for AlertDialogParamWithOptions. + * + * @interface AlertDialogButtonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare interface AlertDialogButtonOptions extends AlertDialogButtonBaseOptions { /** * Define whether the button responds to Enter/Space key by default. * @@ -509,7 +539,7 @@ declare interface AlertDialogButtonOptions { * @atomicservice * @since 12 */ - primary?: boolean; + primary?: boolean; } /** @@ -678,7 +708,16 @@ declare interface AlertDialogParam { * @atomicservice * @since 11 */ - cancel?: () => void; + /** + * Execute Cancel Function. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + cancel?: VoidCallback; /** * Alignment in the vertical direction. @@ -1043,168 +1082,16 @@ declare interface AlertDialogParamWithConfirm extends AlertDialogParam { * @atomicservice * @since 11 */ - confirm?: { - /** - * Enable switch of confirmation button - * @type { ?boolean } - * @default true - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Enable switch of confirmation button - * @type { ?boolean } - * @default true - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - enabled?: boolean; - - /** - * Default focus switch of confirmation button - * @type { ?boolean } - * @default false - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Default focus switch of confirmation button - * @type { ?boolean } - * @default false - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - defaultFocus?: boolean; - - /** - * Style of confirmation button. - * @type { ?DialogButtonStyle } - * @default DialogButtonStyle.DEFAULT - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Style of confirmation button. - * @type { ?DialogButtonStyle } - * @default DialogButtonStyle.DEFAULT - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - style?: DialogButtonStyle; - - /** - * Text content of the confirmation button. - * - * @type { ResourceStr } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Text content of the confirmation button. - * - * @type { ResourceStr } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Text content of the confirmation button. - * - * @type { ResourceStr } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - value: ResourceStr; - - /** - * Text color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Text color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Text color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - fontColor?: ResourceColor; - - /** - * Background color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Background color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Background color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - backgroundColor?: ResourceColor; - - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - action: () => void; - }; + /** + * Invoke the commit function. + * + * @type { ?AlertDialogButtonBaseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + confirm?: AlertDialogButtonBaseOptions; } /** @@ -1289,168 +1176,16 @@ declare interface AlertDialogParamWithButtons extends AlertDialogParam { * @atomicservice * @since 11 */ - primaryButton: { - /** - * Enable switch of primaryButton - * @type { ?boolean } - * @default true - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Enable switch of primaryButton - * @type { ?boolean } - * @default true - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - enabled?: boolean; - - /** - * Default focus switch of primaryButton button - * @type { ?boolean } - * @default false - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Default focus switch of primaryButton button - * @type { ?boolean } - * @default false - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - defaultFocus?: boolean; - - /** - * Style of primaryButton button. - * @type { ?DialogButtonStyle } - * @default DialogButtonStyle.DEFAULT - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Style of primaryButton button. - * @type { ?DialogButtonStyle } - * @default DialogButtonStyle.DEFAULT - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - style?: DialogButtonStyle; - - /** - * Text content of the confirmation button. - * - * @type { ResourceStr } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Text content of the confirmation button. - * - * @type { ResourceStr } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Text content of the confirmation button. - * - * @type { ResourceStr } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - value: ResourceStr; - - /** - * Text color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Text color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Text color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - fontColor?: ResourceColor; - - /** - * Background color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Background color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Background color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - backgroundColor?: ResourceColor; - - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - action: () => void; - }; + /** + * First button. + * + * @type { AlertDialogButtonBaseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + primaryButton: AlertDialogButtonBaseOptions; /** * Second button. @@ -1476,168 +1211,16 @@ declare interface AlertDialogParamWithButtons extends AlertDialogParam { * @atomicservice * @since 11 */ - secondaryButton: { - /** - * Enable switch of secondaryButton - * @type { ?boolean } - * @default true - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Enable switch of secondaryButton - * @type { ?boolean } - * @default true - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - enabled?: boolean; - - /** - * Default focus switch of secondaryButton button - * @type { ?boolean } - * @default false - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Default focus switch of secondaryButton button - * @type { ?boolean } - * @default false - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - defaultFocus?: boolean; - - /** - * Style of secondaryButton button. - * @type { ?DialogButtonStyle } - * @default DialogButtonStyle.DEFAULT - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Style of secondaryButton button. - * @type { ?DialogButtonStyle } - * @default DialogButtonStyle.DEFAULT - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - style?: DialogButtonStyle; - - /** - * Text content of the confirmation button. - * - * @type { ResourceStr } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Text content of the confirmation button. - * - * @type { ResourceStr } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Text content of the confirmation button. - * - * @type { ResourceStr } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - value: ResourceStr; - - /** - * Text color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Text color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Text color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - fontColor?: ResourceColor; - - /** - * Background color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Background color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Background color of the confirmation button. - * - * @type { ?ResourceColor } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - backgroundColor?: ResourceColor; - - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Method executed by the callback. - * - * @type { function } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - action: () => void; - }; + /** + * Second button. + * + * @type { AlertDialogButtonBaseOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + secondaryButton: AlertDialogButtonBaseOptions; } /** diff --git a/api/@internal/component/ets/alphabet_indexer.d.ts b/api/@internal/component/ets/alphabet_indexer.d.ts index c5e92087e..4e815a3ef 100644 --- a/api/@internal/component/ets/alphabet_indexer.d.ts +++ b/api/@internal/component/ets/alphabet_indexer.d.ts @@ -110,6 +110,68 @@ declare enum IndexerAlign { END, } +/** + * AlphabetIndexer constructor options. + * + * @interface AlphabetIndexerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +interface AlphabetIndexerOptions { + /** + * Alphabetical index string array. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Alphabetical index string array. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Alphabetical index string array. + * + * @type { Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + arrayValue: Array; + /** + * ID of the selected item. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * ID of the selected item. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * ID of the selected item. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + selected: number; +} + /** * Alphabet index bar. * @@ -165,9 +227,57 @@ interface AlphabetIndexerInterface { * @atomicservice * @since 11 */ - (value: { arrayValue: Array; selected: number }): AlphabetIndexerAttribute; + /** + * Construct the alphabet indexer component. + * Called when the alphabet indexer component is used. + * + * @param { AlphabetIndexerOptions } options - alphabet indexer options + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + (options: AlphabetIndexerOptions): AlphabetIndexerAttribute; } +/** + * Defines an AlphabetIndexer callback when onSelect. + * + * @typedef { function } OnAlphabetIndexerSelectCallback + * @param { number } index - selected index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type OnAlphabetIndexerSelectCallback = (index: number) => void; + +/** + * Defines an AlphabetIndexer callback when onPopupSelect. + * + * @typedef { function } OnAlphabetIndexerPopupSelectCallback + * @param { number } index - selected index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type OnAlphabetIndexerPopupSelectCallback = (index: number) => void; + +/** + * Defines an AlphabetIndexer callback when onRequestPopupData. + * + * @typedef { function } OnAlphabetIndexerRequestPopupDataCallback + * @param { number } index - selected index + * @returns { Array } string array corresponding to the index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type OnAlphabetIndexerRequestPopupDataCallback = (index: number) => Array; + /** * Defines the alphabet index bar attribute functions. * @@ -650,7 +760,17 @@ declare class AlphabetIndexerAttribute extends CommonMethod void): AlphabetIndexerAttribute; + /** + * Index bar selection callback. + * + * @param { OnAlphabetIndexerSelectCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onSelect(callback: OnAlphabetIndexerSelectCallback): AlphabetIndexerAttribute; /** * Index bar selection callback and return the strings which display on pop-up. @@ -679,7 +799,17 @@ declare class AlphabetIndexerAttribute extends CommonMethod Array): AlphabetIndexerAttribute; + /** + * Index bar selection callback and return the strings which display on pop-up. + * + * @param { OnAlphabetIndexerRequestPopupDataCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onRequestPopupData(callback: OnAlphabetIndexerRequestPopupDataCallback): AlphabetIndexerAttribute; /** * Pop-up selection callback. @@ -708,7 +838,17 @@ declare class AlphabetIndexerAttribute extends CommonMethod void): AlphabetIndexerAttribute; + /** + * Pop-up selection callback. + * + * @param { OnAlphabetIndexerPopupSelectCallback } callback + * @returns { AlphabetIndexerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onPopupSelect(callback: OnAlphabetIndexerPopupSelectCallback): AlphabetIndexerAttribute; /** * Sets the selected index. diff --git a/api/@internal/component/ets/calendar_picker.d.ts b/api/@internal/component/ets/calendar_picker.d.ts index 924f1afdb..6c277763f 100644 --- a/api/@internal/component/ets/calendar_picker.d.ts +++ b/api/@internal/component/ets/calendar_picker.d.ts @@ -238,7 +238,16 @@ declare class CalendarPickerAttribute extends CommonMethod void): CalendarPickerAttribute; + /** + * Callback for selected date changed. + * @param { Callback } callback - callback for selected date changed. + * @returns { CalendarPickerAttribute } the attribute of the CalendarPicker. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onChange(callback: Callback): CalendarPickerAttribute; } /** @@ -272,7 +281,15 @@ declare interface CalendarDialogOptions extends CalendarOptions { * @atomicservice * @since 11 */ - onAccept?: (value: Date) => void; + /** + * Called when the OK button in the dialog is clicked. + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onAccept?: Callback; /** * Called when the Cancel button in the dialog is clicked. @@ -289,7 +306,15 @@ declare interface CalendarDialogOptions extends CalendarOptions { * @atomicservice * @since 11 */ - onCancel?: () => void; + /** + * Called when the Cancel button in the dialog is clicked. + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onCancel?: VoidCallback; /** * This event is triggered when a date is selected in dialog. @@ -306,7 +331,15 @@ declare interface CalendarDialogOptions extends CalendarOptions { * @atomicservice * @since 11 */ - onChange?: (value: Date) => void; + /** + * This event is triggered when a date is selected in dialog. + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onChange?: Callback; /** * Defines the calendarPickerDialog's background color @@ -381,7 +414,16 @@ declare interface CalendarDialogOptions extends CalendarOptions { * @atomicservice * @since 12 */ - onDidAppear?: () => void; + /** + * Callback function when the dialog appears. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDidAppear?: VoidCallback; /** * Callback function when the dialog disappears. @@ -392,7 +434,16 @@ declare interface CalendarDialogOptions extends CalendarOptions { * @atomicservice * @since 12 */ - onDidDisappear?: () => void; + /** + * Callback function when the dialog disappears. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDidDisappear?: VoidCallback; /** * Callback function before the dialog openAnimation starts. @@ -403,7 +454,16 @@ declare interface CalendarDialogOptions extends CalendarOptions { * @atomicservice * @since 12 */ - onWillAppear?: () => void; + /** + * Callback function before the dialog openAnimation starts. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onWillAppear?: VoidCallback; /** * Callback function before the dialog closeAnimation starts. @@ -414,7 +474,16 @@ declare interface CalendarDialogOptions extends CalendarOptions { * @atomicservice * @since 12 */ - onWillDisappear?: () => void; + /** + * Callback function before the dialog closeAnimation starts. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onWillDisappear?: VoidCallback; /** * Defines the dialog's shadow. diff --git a/api/@internal/component/ets/canvas.d.ts b/api/@internal/component/ets/canvas.d.ts index 40700a570..a8eba0f8f 100644 --- a/api/@internal/component/ets/canvas.d.ts +++ b/api/@internal/component/ets/canvas.d.ts @@ -421,6 +421,17 @@ declare type CanvasTextBaseline = "alphabetic" | "bottom" | "hanging" | "ideogra */ declare type ImageSmoothingQuality = "high" | "low" | "medium"; +/** + * Import the frame node type object for Canvas. + * + * @typedef { import('../api/arkui/FrameNode').FrameNode } FrameNode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type FrameNode = import('../api/arkui/FrameNode').FrameNode; + /** * Opaque objects that describe gradients, created by createLinearGradient() or createRadialGradient() * @@ -1025,7 +1036,7 @@ declare class Path2D extends CanvasPath { * Adds a path according to the specified path variable. * * @param { Path2D } path - Indicates the path object to be added. - * @param { Matrix2D } transform - Transformation matrix of the new trail + * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ @@ -1033,7 +1044,7 @@ declare class Path2D extends CanvasPath { * Adds a path according to the specified path variable. * * @param { Path2D } path - Indicates the path object to be added. - * @param { Matrix2D } transform - Transformation matrix of the new trail + * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. * @syscap SystemCapability.ArkUI.ArkUI.Full * @form * @since 9 @@ -1042,7 +1053,7 @@ declare class Path2D extends CanvasPath { * Adds a path according to the specified path variable. * * @param { Path2D } path - Indicates the path object to be added. - * @param { Matrix2D } transform - Transformation matrix of the new trail + * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form @@ -1052,7 +1063,7 @@ declare class Path2D extends CanvasPath { * Adds a path according to the specified path variable. * * @param { Path2D } path - Indicates the path object to be added. - * @param { Matrix2D } transform - Transformation matrix of the new trail + * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form @@ -5248,6 +5259,17 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { */ readonly width: number; + /** + * Frame node of the canvas. The default value is null. + * + * @type { FrameNode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + readonly canvas: FrameNode; + /** * Generate a character string in the data url format. * @@ -5365,6 +5387,70 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { * @since 12 */ constructor(settings?: RenderingContextSettings, unit?: LengthMetricsUnit); + + /** + * Register the listener that watches if the canvasrenderingcontext2d attached to the Canvas frameNode. + * + * @param { 'onAttach' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + on(type: 'onAttach', callback: Callback): void; + + /** + * Unregister the listener that watches if the canvasrenderingcontext2d attached to the Canvas frameNode. + * + * @param { 'onAttach' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + off(type: 'onAttach', callback?: Callback): void; + + /** + * Register the listener that watches if the canvasrenderingcontext2d detached from the Canvas frameNode. + * + * @param { 'onDetach' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + on(type: 'onDetach', callback: Callback): void; + + /** + * Unregister the listener that watches if the canvasrenderingcontext2d detached from the Canvas frameNode. + * + * @param { 'onDetach' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + off(type: 'onDetach', callback?: Callback): void; } /** diff --git a/api/@internal/component/ets/checkbox.d.ts b/api/@internal/component/ets/checkbox.d.ts index 677e7306d..e2c534428 100644 --- a/api/@internal/component/ets/checkbox.d.ts +++ b/api/@internal/component/ets/checkbox.d.ts @@ -261,6 +261,19 @@ interface CheckboxInterface { (options?: CheckboxOptions): CheckboxAttribute; } +/** + * Defines a Checkbox callback when onChange. + * + * @typedef { function } OnCheckboxChangeCallback + * @param { boolean } value - selected status + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare type OnCheckboxChangeCallback = (value: boolean) => void; + /** * Defines the attribute functions of Checkbox. * @@ -479,7 +492,18 @@ declare class CheckboxAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onChange(callback: (value: boolean) => void): CheckboxAttribute; + /** + * Called when the selection status changes. + * + * @param { OnCheckboxChangeCallback } callback + * @returns { CheckboxAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + onChange(callback: OnCheckboxChangeCallback): CheckboxAttribute; /** * Set the content modifier of checkbox. diff --git a/api/@internal/component/ets/checkboxgroup.d.ts b/api/@internal/component/ets/checkboxgroup.d.ts index 0311edabb..ab431ffc1 100644 --- a/api/@internal/component/ets/checkboxgroup.d.ts +++ b/api/@internal/component/ets/checkboxgroup.d.ts @@ -403,6 +403,19 @@ interface CheckboxGroupInterface { (options?: CheckboxGroupOptions): CheckboxGroupAttribute; } +/** + * Defines a CheckboxGroup callback when onChange. + * + * @typedef { function } OnCheckboxGroupChangeCallback + * @param { CheckboxGroupResult } value - checkbox group result + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare type OnCheckboxGroupChangeCallback = (value: CheckboxGroupResult) => void; + /** * Defines the attribute functions of CheckboxGroup. * @@ -598,7 +611,18 @@ declare class CheckboxGroupAttribute extends CommonMethod void): CheckboxGroupAttribute; + /** + * Called when the selection status changes. + * + * @param { OnCheckboxGroupChangeCallback } callback + * @returns { CheckboxGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + onChange(callback: OnCheckboxGroupChangeCallback): CheckboxGroupAttribute; /** * Setting the shape of checkbox group. diff --git a/api/@internal/component/ets/column.d.ts b/api/@internal/component/ets/column.d.ts index 5ec6592ae..647effd75 100644 --- a/api/@internal/component/ets/column.d.ts +++ b/api/@internal/component/ets/column.d.ts @@ -18,6 +18,54 @@ * @kit ArkUI */ +/** + * Column constructor options. + * + * @interface ColumnOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +interface ColumnOptions { + /** + * Vertical layout element spacing + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Vertical layout element spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + space?: string | number; +} + /** * Defines the Column Component. * @@ -99,7 +147,18 @@ interface ColumnInterface { * @atomicservice * @since 11 */ - (value?: { space?: string | number }): ColumnAttribute; + /** + * Set the options. + * + * @param { ColumnOptions } [options] - column options + * @returns { ColumnAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options?: ColumnOptions): ColumnAttribute; } /** diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 087b0cd46..07567e682 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -1676,7 +1676,7 @@ declare interface Rectangle { /** * Interface for ExpectedFrameRateRange. * - * @typedef ExpectedFrameRateRange + * @interface ExpectedFrameRateRange * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 12 @@ -2200,14 +2200,14 @@ declare interface AnimateParam { playMode?: PlayMode; /** - * Callback invoked when the animation playback is complete. + * Callback invoked when the animation playback is complete or the ability is about to enter the background. * * @type { ?function } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 */ /** - * Callback invoked when the animation playback is complete. + * Callback invoked when the animation playback is complete or the ability is about to enter the background. * * @type { ?function } * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -2215,7 +2215,7 @@ declare interface AnimateParam { * @since 9 */ /** - * Callback invoked when the animation playback is complete. + * Callback invoked when the animation playback is complete or the ability is about to enter the background. * * @type { ?function } * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -2224,7 +2224,7 @@ declare interface AnimateParam { * @since 10 */ /** - * Callback invoked when the animation playback is complete. + * Callback invoked when the animation playback is complete or the ability is about to enter the background. * * @type { ?function } * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -2305,7 +2305,7 @@ interface ICurve { /** * Get curve value by fraction. * - * @param { number } fraction -Indicates the current normalized time parameter. Value range: [0, 1]. + * @param { number } fraction - Indicates the current normalized time parameter. Value range: [0, 1]. * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. * @returns { number } * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -2315,7 +2315,7 @@ interface ICurve { /** * Get curve value by fraction. * - * @param { number } fraction -Indicates the current normalized time parameter. Value range: [0, 1]. + * @param { number } fraction - Indicates the current normalized time parameter. Value range: [0, 1]. * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. * @returns { number } * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -2326,7 +2326,7 @@ interface ICurve { /** * Get curve value by fraction. * - * @param { number } fraction -Indicates the current normalized time parameter. Value range: [0, 1]. + * @param { number } fraction - Indicates the current normalized time parameter. Value range: [0, 1]. * Note: If the value is less than 0, it will be processed as 0. If the value is greater than 1, 1 is used. * @returns { number } * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -4244,7 +4244,7 @@ declare class TransitionEffect< * -x: Horizontal component of the rotational vector. * -y: Vertical component of the rotational vector. * -z: Vertical component of the rotational vector. - * -centerX, centerY specify the rotation center point, with default values of "50%", + * -centerX, centerY specify the rotation center point, with default values of "50%", * meaning that the default rotation center point is the center point of the component. * -The center point of (0, 0) represents the upper-left corner of the component. * -centerZ refers to the Z-axis anchor point. The default value of centerZ is 0. @@ -4264,7 +4264,7 @@ declare class TransitionEffect< * -x: Horizontal component of the rotational vector. * -y: Vertical component of the rotational vector. * -z: Vertical component of the rotational vector. - * -centerX, centerY specify the rotation center point, with default values of "50%", + * -centerX, centerY specify the rotation center point, with default values of "50%", * meaning that the default rotation center point is the center point of the component. * -The center point of (0, 0) represents the upper-left corner of the component. * -centerZ refers to the Z-axis anchor point. The default value of centerZ is 0. @@ -4818,6 +4818,15 @@ declare enum PreDragStatus { * @atomicservice * @since 11 */ +/** + * DragItemInfo object description + * + * @interface DragItemInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ declare interface DragItemInfo { /** * Uses the pixelMap object for drawing. @@ -4834,6 +4843,15 @@ declare interface DragItemInfo { * @atomicservice * @since 11 */ + /** + * Uses the pixelMap object for drawing. + * + * @type { ?PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ pixelMap?: PixelMap; /** @@ -4851,6 +4869,15 @@ declare interface DragItemInfo { * @atomicservice * @since 11 */ + /** + * Uses the custom builder for drawing, if pixelMap is set, this value is ignored. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ builder?: CustomBuilder; /** @@ -4868,6 +4895,15 @@ declare interface DragItemInfo { * @atomicservice * @since 11 */ + /** + * Sets the extra info for drag event. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ extraInfo?: string; } @@ -6009,7 +6045,7 @@ declare enum BlurStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ declare enum BlurStyleActivePolicy { /** @@ -6018,7 +6054,7 @@ declare enum BlurStyleActivePolicy { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ FOLLOWS_WINDOW_ACTIVE_STATE = 0, @@ -6028,7 +6064,7 @@ declare enum BlurStyleActivePolicy { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ ALWAYS_ACTIVE = 1, @@ -6038,7 +6074,7 @@ declare enum BlurStyleActivePolicy { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ ALWAYS_INACTIVE = 2, } @@ -6050,7 +6086,7 @@ declare enum BlurStyleActivePolicy { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ declare enum BlurType { /** @@ -6059,7 +6095,7 @@ declare enum BlurType { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ WITHIN_WINDOW = 0, /** @@ -6068,7 +6104,7 @@ declare enum BlurType { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ BEHIND_WINDOW = 1 } @@ -6292,7 +6328,7 @@ declare interface BackgroundBlurStyleOptions extends BlurStyleOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ policy?: BlurStyleActivePolicy; @@ -6304,7 +6340,7 @@ declare interface BackgroundBlurStyleOptions extends BlurStyleOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ inactiveColor?: ResourceColor; @@ -6316,7 +6352,7 @@ declare interface BackgroundBlurStyleOptions extends BlurStyleOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ type?: BlurType; } @@ -6621,7 +6657,7 @@ declare interface BackgroundEffectOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ policy?: BlurStyleActivePolicy; @@ -6633,7 +6669,7 @@ declare interface BackgroundEffectOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ inactiveColor?: ResourceColor; @@ -6645,7 +6681,7 @@ declare interface BackgroundEffectOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ type?: BlurType; } @@ -9373,6 +9409,15 @@ declare type UniformDataType = import('../api/@ohos.data.uniformTypeDescriptor') * @atomicservice * @since 11 */ +/** + * Enum for Drag Result. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ declare enum DragResult { /** * If the drag is successful, return DragResult.DRAG_SUCCESSFUL. @@ -9387,6 +9432,14 @@ declare enum DragResult { * @atomicservice * @since 11 */ + /** + * If the drag is successful, return DragResult.DRAG_SUCCESSFUL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ DRAG_SUCCESSFUL = 0, /** * If drag fail, return DragResult.DRAG_FAILED. @@ -9401,6 +9454,14 @@ declare enum DragResult { * @atomicservice * @since 11 */ + /** + * If drag fail, return DragResult.DRAG_FAILED. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ DRAG_FAILED = 1, /** * If drag action cancel, return DragResult.DRAG_CANCELED. @@ -9460,7 +9521,7 @@ declare enum DragResult { */ /** * Enum for BlendMode. - * Blend modes for compositing current component + * Blend modes for compositing current component * with overlapping content. Use overlapping content * as dst, current component as src. * @@ -10094,6 +10155,15 @@ declare enum BlendApplyType { * @atomicservice * @since 11 */ +/** + * DragEvent object description + * + * @interface DragEvent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ declare interface DragEvent { /** * X coordinate of the touch point relative to the left edge of the device screen. @@ -10110,6 +10180,15 @@ declare interface DragEvent { * @atomicservice * @since 11 */ + /** + * X coordinate of the touch point relative to the left edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ getDisplayX(): number; /** @@ -10127,6 +10206,15 @@ declare interface DragEvent { * @atomicservice * @since 11 */ + /** + * Y coordinate of the touch point relative to the upper edge of the device screen. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ getDisplayY(): number; /** @@ -10144,6 +10232,15 @@ declare interface DragEvent { * @atomicservice * @since 11 */ + /** + * X coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ getWindowX(): number; /** @@ -10161,6 +10258,15 @@ declare interface DragEvent { * @atomicservice * @since 11 */ + /** + * Y coordinate of the touch point relative to the left edge of the current window. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ getWindowY(): number; /** @@ -10295,6 +10401,15 @@ declare interface DragEvent { * @atomicservice * @since 11 */ + /** + * Set dragEvent result to DragEvent. + * + * @param { DragResult } dragResult - the return of dragEvent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ setResult(dragResult: DragResult): void; /** @@ -10312,6 +10427,15 @@ declare interface DragEvent { * @atomicservice * @since 11 */ + /** + * Get dragEvent result from DragEvent. + * + * @returns { DragResult } - dragResult Data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ getResult(): DragResult; /** @@ -10329,6 +10453,15 @@ declare interface DragEvent { * @atomicservice * @since 11 */ + /** + * Get the rectangle of drag window. + * + * @returns { Rectangle } - getPreview rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ getPreviewRect(): Rectangle; /** @@ -10396,9 +10529,19 @@ declare interface DragEvent { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform - * @atomicservice * @since 12 */ + /** + * Query the ModifierKey press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the keys of the ModifierKey. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ getModifierKeyState?(keys: Array): boolean; } @@ -10682,9 +10825,19 @@ declare interface KeyEvent { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform - * @atomicservice * @since 12 */ + /** + * Get the modifier keys press state, support 'ctrl'|'alt'|'shift'|'fn' + * + * @param { Array } keys - indicate the modifier keys. + * @returns { boolean } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types. 2. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ getModifierKeyState?(keys: Array): boolean; /** @@ -11080,6 +11233,59 @@ declare enum ScrollSizeMode { CONTINUOUS = 1, } +/** + * Define the mode of sheet how to avoid keyboard. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare enum SheetKeyboardAvoidMode { + /** + * Sheet will not aovid keyboard. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + NONE = 0, + + /** + * Firstly sheet will avoid keyboard by changing its height. + * And then sheet will avoid by resizing after reaching its maximum height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + TRANSLATE_AND_RESIZE = 1, + + /** + * Sheet will only avoid keyboard by resizing the content. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + RESIZE_ONLY = 2, + + /** + * Firstly sheet will avoid keyboard by changing its height. + * And then sheet will avoid keyboard by scrolling after reaching its maximum height. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + TRANSLATE_AND_SCROLL = 3, +} + /** * Component sheet dismiss * @@ -11559,6 +11765,18 @@ declare interface SheetOptions extends BindOptions { * @since 12 */ uiContext?: UIContext; + + /** + * Determine the mode of sheet how to avoid keyboard. + * + * @type { ?SheetKeyboardAvoidMode } + * @default SheetKeyboardAvoidMode.TRANSLATE_AND_SCROLL + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + keyboardAvoidMode?: SheetKeyboardAvoidMode; } /** @@ -13457,6 +13675,17 @@ declare interface ContextMenuOptions { */ aboutToDisappear?: () => void; + /** + * The margin of menu's layoutRegion. + * + * @type { ?Margin } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + layoutRegionMargin?: Margin; + /** * The preview animator options. * @@ -16691,6 +16920,20 @@ declare class CommonMethod { * @since 12 */ focusScopeId(id: string, isGroup?: boolean): T; + /** + * Set container as a focus group with a specific identifier. + * + * @param { string } id - focus scope identifier. + * @param { boolean } [isGroup] - whether this scope is a focus group, the default value is false. + * @param { boolean } [arrowStepOut] - whether the arrow keys can move focus from inside the focus group to outside, + * only effective when isGroup is true, the default value is true. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + focusScopeId(id: string, isGroup?: boolean, arrowStepOut?: boolean): T; /** * Set the focus priority of component in a specific focus scope. @@ -18582,6 +18825,17 @@ declare class CommonMethod { * @atomicservice * @since 11 */ + /** + * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. + * (To be triggered, press and hold for 170 milliseconds (ms)) + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ onDragStart(event: (event: DragEvent, extraParams?: string) => CustomBuilder | DragItemInfo): T; /** @@ -18601,6 +18855,16 @@ declare class CommonMethod { * @atomicservice * @since 11 */ + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ onDragEnter(event: (event: DragEvent, extraParams?: string) => void): T; /** @@ -18620,6 +18884,16 @@ declare class CommonMethod { * @atomicservice * @since 11 */ + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ onDragMove(event: (event: DragEvent, extraParams?: string) => void): T; /** @@ -18639,6 +18913,16 @@ declare class CommonMethod { * @atomicservice * @since 11 */ + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ onDragLeave(event: (event: DragEvent, extraParams?: string) => void): T; /** @@ -18660,6 +18944,17 @@ declare class CommonMethod { * @atomicservice * @since 11 */ + /** + * The component bound to this event can be used as the drag release target. + * This callback is triggered when the drag behavior is stopped within the scope of the component. + * + * @param { function } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ onDrop(event: (event: DragEvent, extraParams?: string) => void): T; /** @@ -18679,6 +18974,16 @@ declare class CommonMethod { * @atomicservice * @since 11 */ + /** + * This function is called when the drag event is end. + * + * @param { function } event - indicates the function to be called. + * @returns { T } property value of type T. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ onDragEnd(event: (event: DragEvent, extraParams?: string) => void): T; /** @@ -19177,7 +19482,7 @@ declare class CommonMethod { */ /** * Add a blendMode effect to the current component - * + * * @param { BlendMode } value - Different hybrid modes * @param { BlendApplyType } [type] - Different blend apply type * @returns { T } @@ -19190,7 +19495,21 @@ declare class CommonMethod { blendMode(value: BlendMode, type?: BlendApplyType): T; /** - * Whether to crop the sub components of the current component. + * Add a blendMode effect to the current component.Cannot be used together with the blendMode interface. + * + * @param { BlendMode | Blender } effect - When the effect type is BlendMode type, define Different hybrid modes. + * When the effect type is Blender type, Define the corresponding blending effect. + * @param { BlendApplyType } [type] - Different blend apply type + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 13 + */ + advancedBlendMode(effect: BlendMode | Blender, type?: BlendApplyType): T; + + /** + * Whether to crop the sub components beyond the current component range. * * @param { boolean } value * @returns { T } @@ -19771,7 +20090,18 @@ declare class CommonMethod { * @atomicservice * @since 11 */ - onVisibleAreaChange(ratios: Array, event: (isVisible: boolean, currentRatio: number) => void): T; + /** + * Trigger a visible area change event. + * + * @param { Array } ratios + * @param { VisibleAreaChangeCallback } event + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onVisibleAreaChange(ratios: Array, event: VisibleAreaChangeCallback): T; /** * Set the spherical effect of the component. @@ -20026,6 +20356,32 @@ declare class CommonMethod { */ accessibilityVirtualNode(builder: CustomBuilder): T; + /** + * Sets accessibilityChecked + * + * @param { boolean } isCheck - set accessibility checked status + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + accessibilityChecked(isCheck: boolean): T; + + /** + * Sets accessibilitySelected + * + * @param { boolean } isSelect - set accessibility selected status + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + accessibilitySelected(isSelect: boolean): T; + /** * Sets obscured * @@ -21896,17 +22252,6 @@ declare interface MeasureResult extends SizeResult { */ declare type NavDestinationInfo = import('../api/@ohos.arkui.observer').default.NavDestinationInfo; -/** - * The router page information. - * - * @typedef {import('../api/@ohos.arkui.observer').default.RouterPageInfo} RouterPageInfo - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - declare type RouterPageInfo = import('../api/@ohos.arkui.observer').default.RouterPageInfo; - /** * The navigation information. * @@ -21918,6 +22263,17 @@ declare type NavDestinationInfo = import('../api/@ohos.arkui.observer').default. */ declare type NavigationInfo = import('../api/@ohos.arkui.observer').default.NavigationInfo; +/** + * The router page information. + * + * @typedef {import('../api/@ohos.arkui.observer').default.RouterPageInfo} RouterPageInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ +declare type RouterPageInfo = import('../api/@ohos.arkui.observer').default.RouterPageInfo; + /** * UIContext * @@ -21970,6 +22326,17 @@ declare type VisualEffect = import('../api/@ohos.graphics.uiEffect').default.Vis */ declare type Filter = import('../api/@ohos.graphics.uiEffect').default.Filter; +/** + * Blender + * + * @typedef { import('../api/@ohos.graphics.uiEffect').default.Blender } Blender + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @form + * @since 13 + */ +declare type Blender = import('../api/@ohos.graphics.uiEffect').default.Blender; + /** * ComponentContent. * @@ -23472,7 +23839,7 @@ declare interface KeyframeAnimateParam { iterations?: number; /** - * Callback invoked when the whole keyframe animation is complete. + * Callback invoked when the whole keyframe animation is complete or the ability is about to enter the background. * * @type { ?function } * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -23480,7 +23847,7 @@ declare interface KeyframeAnimateParam { * @since 11 */ /** - * Callback invoked when the whole keyframe animation is complete. + * Callback invoked when the whole keyframe animation is complete or the ability is about to enter the background. * * @type { ?function } * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -23667,7 +24034,19 @@ declare interface VisibleAreaEventOptions { * @atomicservice * @since 12 */ -declare type VisibleAreaChangeCallback = (isVisible: boolean, currentRatio: number) => void; +/** + * Defines the callback type used in VisibleAreaChange events. + * + * @typedef { function } VisibleAreaChangeCallback + * @param { boolean } isExpanding - Indicates the ratio of the visible area to its own area compared to the last change. + * It is true as the ratio increases and false as the ratio decreases. + * @param { number } currentRatio - The value of currentRatio indicates the visibility ratio of the current component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type VisibleAreaChangeCallback = (isExpanding: boolean, currentRatio: number) => void; /** * Defines a UICommonEvent which is used to set different common event to target component. diff --git a/api/@internal/component/ets/counter.d.ts b/api/@internal/component/ets/counter.d.ts index 619018c6c..0331a32e7 100644 --- a/api/@internal/component/ets/counter.d.ts +++ b/api/@internal/component/ets/counter.d.ts @@ -163,7 +163,18 @@ declare class CounterAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onInc(event: () => void): CounterAttribute; + /** + * Listen to the event that the value increases. + * + * @param { VoidCallback } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + onInc(event: VoidCallback): CounterAttribute; /** * Listens to the number decrease event. @@ -203,7 +214,18 @@ declare class CounterAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onDec(event: () => void): CounterAttribute; + /** + * Listens to the number decrease event. + * + * @param { VoidCallback } event + * @returns { CounterAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + onDec(event: VoidCallback): CounterAttribute; /** * Indicates whether the decrease button of counter component is available or not. diff --git a/api/@internal/component/ets/data_panel.d.ts b/api/@internal/component/ets/data_panel.d.ts index edbef74b0..163bd2801 100644 --- a/api/@internal/component/ets/data_panel.d.ts +++ b/api/@internal/component/ets/data_panel.d.ts @@ -132,7 +132,7 @@ declare enum DataPanelType { * @atomicservice * @since 11 */ -declare type ColorStop = { +declare interface ColorStop { /** * Color property. * @type { ResourceColor } color - the color value. diff --git a/api/@internal/component/ets/date_picker.d.ts b/api/@internal/component/ets/date_picker.d.ts index c7b2a954f..4f2904fbf 100644 --- a/api/@internal/component/ets/date_picker.d.ts +++ b/api/@internal/component/ets/date_picker.d.ts @@ -429,7 +429,61 @@ declare class DatePickerAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onDateChange(callback: (value: Date) => void): DatePickerAttribute; + /** + * This event is triggered when a DatePicker date or time is selected. + * + * @param { Callback } callback + * @returns { DatePickerAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDateChange(callback: Callback): DatePickerAttribute; +} + +/** + * Provide an interface for the lunar switch style of DatePickerDialog + * + * @interface LunarSwitchStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface LunarSwitchStyle { + /** + * Define the selected color of lunar switch. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + selectedColor?: ResourceColor; + + /** + * Define the unselected color of lunar switch. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + unselectedColor?: ResourceColor; + + /** + * Define the stroke color of lunar switch. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + strokeColor?: ResourceColor; } /** @@ -502,6 +556,17 @@ declare interface DatePickerDialogOptions extends DatePickerOptions { */ lunarSwitch?: boolean; + /** + * Describes the lunar switch color. + * + * @type { ?LunarSwitchStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + lunarSwitchStyle?: LunarSwitchStyle; + /** * Indicates whether to show the time selector. * @@ -711,7 +776,16 @@ declare interface DatePickerDialogOptions extends DatePickerOptions { * @atomicservice * @since 11 */ - onCancel?: () => void; + /** + * Called when the Cancel button in the dialog is clicked. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onCancel?: VoidCallback; /** * This event is triggered when a DatePicker date or time is selected in dialog. @@ -741,7 +815,16 @@ declare interface DatePickerDialogOptions extends DatePickerOptions { * @atomicservice * @since 11 */ - onDateAccept?: (value: Date) => void; + /** + * Called when the OK button in the dialog is clicked. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDateAccept?: Callback; /** * This event is triggered when a DatePicker date or time is selected in dialog. @@ -760,7 +843,16 @@ declare interface DatePickerDialogOptions extends DatePickerOptions { * @atomicservice * @since 11 */ - onDateChange?: (value: Date) => void; + /** + * This event is triggered when a DatePicker date or time is selected in dialog. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDateChange?: Callback; /** * Defines the datePickerDialog's background color @@ -813,7 +905,16 @@ declare interface DatePickerDialogOptions extends DatePickerOptions { * @atomicservice * @since 12 */ - onDidAppear?: () => void; + /** + * Callback function when the dialog appears. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDidAppear?: VoidCallback; /** * Callback function when the dialog disappears. @@ -824,7 +925,16 @@ declare interface DatePickerDialogOptions extends DatePickerOptions { * @atomicservice * @since 12 */ - onDidDisappear?: () => void; + /** + * Callback function when the dialog disappears. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onDidDisappear?: VoidCallback; /** * Callback function before the dialog openAnimation starts. @@ -835,7 +945,16 @@ declare interface DatePickerDialogOptions extends DatePickerOptions { * @atomicservice * @since 12 */ - onWillAppear?: () => void; + /** + * Callback function before the dialog openAnimation starts. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onWillAppear?: VoidCallback; /** * Callback function before the dialog closeAnimation starts. @@ -846,7 +965,16 @@ declare interface DatePickerDialogOptions extends DatePickerOptions { * @atomicservice * @since 12 */ - onWillDisappear?: () => void; + /** + * Callback function before the dialog closeAnimation starts. + * + * @type { ?VoidCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onWillDisappear?: VoidCallback; /** * Defines the dialog's shadow. diff --git a/api/@internal/component/ets/enums.d.ts b/api/@internal/component/ets/enums.d.ts index c28798e18..db46717e3 100644 --- a/api/@internal/component/ets/enums.d.ts +++ b/api/@internal/component/ets/enums.d.ts @@ -9728,3 +9728,95 @@ declare enum AccessibilityHoverType { */ HOVER_CANCEL = 3, } + +/** + * Type of window width breakpoint. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +declare enum WidthBreakpoint { + /** + * Window width < 320vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_XS = 0, + + /** + * Window width >= 320vp and < 600vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_SM = 1, + + /** + * Window width >= 600vp and < 840vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_MD = 2, + + /** + * Window width >= 840vp and < 1440vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_LG = 3, + + /** + * Window width >= 1440vp type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + WIDTH_XL = 4, +} + +/** + * Type of window height breakpoint. + * + * @enum {number} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +declare enum HeightBreakpoint { + /** + * Window aspectRatio < 0.8 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_SM = 0, + + /** + * Window aspectRatio >= 0.8 and < 1.2 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_MD = 1, + + /** + * Window aspectRatio >= 1.2 type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + HEIGHT_LG = 2, +} \ No newline at end of file diff --git a/api/@internal/component/ets/folder_stack.d.ts b/api/@internal/component/ets/folder_stack.d.ts index 29db7ebaa..51fa4139b 100644 --- a/api/@internal/component/ets/folder_stack.d.ts +++ b/api/@internal/component/ets/folder_stack.d.ts @@ -28,6 +28,36 @@ */ declare type WindowStatusType = import('../api/@ohos.window').default.WindowStatusType; +/** + * FolderStack constructor options. + * + * @interface FolderStackOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +interface FolderStackOptions { + /** + * Define the IDs of the sub component that will be moved to the upper half screen when hovering. + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Define the IDs of the sub component that will be moved to the upper half screen when hovering. + * + * @type { ?Array } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + upperItems?: Array; +} + /** * Provides ports for stacking containers. * @@ -66,9 +96,72 @@ interface FolderStackInterface { * @atomicservice * @since 12 */ - (value?: { upperItems?: Array }): FolderStackAttribute; + /** + * Defines the constructor of folderStack. + * + * @param { FolderStackOptions } [options] - id of children need to be show in upperItem + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + (options?: FolderStackOptions): FolderStackAttribute; } +/** + * Information when onFolderStateChange. + * + * @interface OnFoldStatusChangeInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +interface OnFoldStatusChangeInfo { + /** + * Folder state. + * + * @type { FoldStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Folder state. + * + * @type { FoldStatus } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + foldStatus: FoldStatus +} + +/** + * Callback when onStateChangeCallback. + * + * @typedef { function } OnFoldStatusChangeCallback + * @param { OnFoldStatusChangeInfo } event - the folding information of the current device + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type OnFoldStatusChangeCallback = (event: OnFoldStatusChangeInfo) => void; + +/** + * Callback when onHoverStatusChange. + * + * @typedef { function } OnHoverStatusChangeCallback + * @param { HoverEventParam } param - hover event param + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +declare type OnHoverStatusChangeCallback = (param: HoverEventParam) => void; + /** /** * @extends CommonMethod @@ -106,47 +199,38 @@ declare class FolderStackAttribute extends CommonMethod { alignContent(value: Alignment): FolderStackAttribute; /** -* Callback folderState when the folderState changes -* -* @param { function } callback - executed when folderStatus changed -* @returns { FolderStackAttribute } -* @syscap SystemCapability.ArkUI.ArkUI.Full -* @crossplatform -* @since 11 -*/ -/** -* Callback folderState when the folderState changes -* -* @param { function } callback - executed when folderStatus changed -* @returns { FolderStackAttribute } -* @syscap SystemCapability.ArkUI.ArkUI.Full -* @crossplatform -* @atomicservice -* @since 12 -*/ - onFolderStateChange(callback: (event: { - /** - * folder state. - * - * @type { FoldStatus } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 11 - */ - /** - * folder state. - * - * @type { FoldStatus } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - foldStatus: FoldStatus - }) => void): FolderStackAttribute; - - + * Callback folderState when the folderState changes + * + * @param { function } callback - executed when folderStatus changed + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ /** + * Callback folderState when the folderState changes + * + * @param { function } callback - executed when folderStatus changed + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + /** + * Callback folderState when the folderState changes + * + * @param { OnFoldStatusChangeCallback } callback - executed when folderStatus changed + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onFolderStateChange(callback: OnFoldStatusChangeCallback): FolderStackAttribute; + + + /** * Callback hoverStatus|folderStatus|rotation|windowMode when the hoverStatus changes * * @param { function } handler - executed when hoverStatus changed @@ -155,7 +239,16 @@ declare class FolderStackAttribute extends CommonMethod { * @atomicservice * @since 12 */ - onHoverStatusChange(handler: (param: HoverEventParam) => void): FolderStackAttribute; + /** + * Callback hoverStatus|folderStatus|rotation|windowMode when the hoverStatus changes + * + * @param { OnHoverStatusChangeCallback } handler - executed when hoverStatus changed + * @returns { FolderStackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + onHoverStatusChange(handler: OnHoverStatusChangeCallback): FolderStackAttribute; /** * Enable the animation of folderStack. diff --git a/api/@internal/component/ets/gauge.d.ts b/api/@internal/component/ets/gauge.d.ts index f80fdb99c..a0205617e 100644 --- a/api/@internal/component/ets/gauge.d.ts +++ b/api/@internal/component/ets/gauge.d.ts @@ -18,6 +18,126 @@ * @kit ArkUI */ +/** + * Defines Gauge constructor options. + * + * @interface GaugeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ +interface GaugeOptions { + /** + * Set current data value. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set current data value. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set current data value. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set current data value. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + value: number; + + /** + * Set current segment minimum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set current segment minimum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set current segment minimum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set current segment minimum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + min?: number; + + /** + * Set current segment maximum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Set current segment maximum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set current segment maximum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set current segment maximum value. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + max?: number; +} + /** * Defines the Gauge component. * @@ -99,7 +219,18 @@ interface GaugeInterface { * @atomicservice * @since 11 */ - (options: { value: number; min?: number; max?: number }): GaugeAttribute; + /** + * Called when the gauge component is used. + * + * @param { GaugeOptions } options - Gauge options. + * @returns { GaugeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + (options: GaugeOptions): GaugeAttribute; } /** diff --git a/api/@internal/component/ets/image.d.ts b/api/@internal/component/ets/image.d.ts index 0ce62843a..613b08086 100644 --- a/api/@internal/component/ets/image.d.ts +++ b/api/@internal/component/ets/image.d.ts @@ -465,6 +465,91 @@ interface ImageInterface { (src: PixelMap | ResourceStr | DrawableDescriptor, imageAIOptions: ImageAIOptions): ImageAttribute; } +/** + * Defines source size of image. + * + * @interface ImageSourceSize + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + +interface ImageSourceSize { + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + width: number; + + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + height: number; +} + /** * @extends CommonMethod * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -916,7 +1001,19 @@ declare class ImageAttribute extends CommonMethod { * @atomicservice * @since 11 */ - sourceSize(value: { width: number; height: number }): ImageAttribute; + /** + * Specifies the picture decoding size. + * The original picture is decoded into a picture of a specified size. The unit of the number type is px. + * + * @param { ImageSourceSize } value - Image source size. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ + sourceSize(value: ImageSourceSize): ImageAttribute; /** * Sets the synchronous or asynchronous mode for image loading. diff --git a/api/@internal/component/ets/list.d.ts b/api/@internal/component/ets/list.d.ts index 5e7c1b7af..e3f5b7c56 100644 --- a/api/@internal/component/ets/list.d.ts +++ b/api/@internal/component/ets/list.d.ts @@ -836,6 +836,124 @@ declare class ListScroller extends Scroller { getVisibleListContentInfo(x: number, y: number): VisibleListContentInfo; } +/** + * Defines List constructor options. + * + * @interface ListOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +interface ListOptions { + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set initialIndex. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + initialIndex?: number; + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + space?: number | string; + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set scroller. + * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + scroller?: Scroller; +} + /** * The list interface is extended. * @@ -909,7 +1027,171 @@ interface ListInterface { * @atomicservice * @since 11 */ - (value?: { initialIndex?: number; space?: number | string; scroller?: Scroller }): ListAttribute; + /** + * Called when interface data is called. + * + * @param { ListOptions } [options] - list options + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options?: ListOptions): ListAttribute; +} + +/** + * Defines List divider opotions. + * + * @interface ListDividerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface ListDividerOptions { + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set strokeWidth. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + strokeWidth: Length; + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set color. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + color?: ResourceColor; + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set startMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + startMargin?: Length; + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set endMargin. + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + endMargin?: Length; } /** @@ -1202,13 +1484,19 @@ declare class ListAttribute extends ScrollableCommonMethod { * @atomicservice * @since 11 */ + /** + * Called when the ListItem split line style is set. + * + * @param { ListDividerOptions | null } value + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ divider( - value: { - strokeWidth: Length; - color?: ResourceColor; - startMargin?: Length; - endMargin?: Length; - } | null, + value: ListDividerOptions | null, ): ListAttribute; /** diff --git a/api/@internal/component/ets/list_item_group.d.ts b/api/@internal/component/ets/list_item_group.d.ts index 333cb7ce5..ffc3d404e 100644 --- a/api/@internal/component/ets/list_item_group.d.ts +++ b/api/@internal/component/ets/list_item_group.d.ts @@ -334,13 +334,18 @@ declare class ListItemGroupAttribute extends CommonMethod | CustomBuilder): NavDestinationAttribute; + /** + * Configure toolbar with default style parameter or custom parameter. + * + * @param { Array | CustomBuilder } toolbarParam - Toolbar configuration parameters. + * @param { NavigationToolbarOptions } [options] - Indicates the options of toolbar. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + toolbarConfiguration(toolbarParam: Array | CustomBuilder, options?: NavigationToolbarOptions): NavDestinationAttribute; + + /** + * Hide tool bar + * + * @param { boolean } hide + * @param { boolean } [animated] + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hideToolBar(hide: boolean, animated?: boolean): NavDestinationAttribute; + /** * Invoked before sub-components of NavDestination are created. * @@ -674,6 +791,29 @@ declare class NavDestinationAttribute extends CommonMethod): NavDestinationAttribute; + + /** + * Set the NavDestination can be restored after the application is terminated. + * To enable this attribute, recoverable and id of Navigation must be set. + * + * @param { boolean } recoverable - set navdestination can be recovered. + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 13 + */ + recoverable(recoverable: Optional): NavDestinationAttribute; + + /** + * Configuration of system transition + * + * @param { NavigationSystemTransitionType } type - Types of system Transition + * @returns { NavDestinationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + systemTransition(type: NavigationSystemTransitionType): NavDestinationAttribute; } /** diff --git a/api/@internal/component/ets/navigation.d.ts b/api/@internal/component/ets/navigation.d.ts index ab189a703..8a718894d 100644 --- a/api/@internal/component/ets/navigation.d.ts +++ b/api/@internal/component/ets/navigation.d.ts @@ -77,7 +77,16 @@ declare interface NavigationCommonTitle { * @atomicservice * @since 11 */ - main: string; + /** + * Sets the main title. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + main: string | Resource; /** * Sets the sub title. @@ -103,7 +112,16 @@ declare interface NavigationCommonTitle { * @atomicservice * @since 11 */ - sub: string; + /** + * Sets the sub title. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + sub: string | Resource; } /** @@ -499,7 +517,16 @@ declare interface NavigationMenuItem { * @atomicservice * @since 11 */ - value: string; + /** + * The value of navigation menu item. + * + * @type { string | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + value: string | Resource; /** * The icon of navigation menu item. @@ -525,7 +552,16 @@ declare interface NavigationMenuItem { * @atomicservice * @since 11 */ - icon?: string; + /** + * The value of navigation menu item. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + icon?: string | Resource; /** * The symbol of navigation menu item. @@ -2038,6 +2074,18 @@ declare interface NavigationTitleOptions { * @since 13 */ subTitleModifier?: TextModifier; + + /** + * Defines whether to respond to the hover mode. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + enableHoverMode?: boolean; } /** @@ -2406,6 +2454,19 @@ declare class NavigationAttribute extends CommonMethod { */ hideTitleBar(value: boolean): NavigationAttribute; + /** + * Hide navigation title bar + * + * @param { boolean } hide + * @param { boolean } animated + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hideTitleBar(hide: boolean, animated: boolean): NavigationAttribute; + /** * Hide navigation back button * @@ -2558,6 +2619,19 @@ declare class NavigationAttribute extends CommonMethod { */ hideToolBar(value: boolean): NavigationAttribute; + /** + * Hide tool bar + * + * @param { boolean } hide + * @param { boolean } animated + * @returns { NavigationAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + hideToolBar(hide: boolean, animated: boolean): NavigationAttribute; + /** * Trigger callback when title mode change finished at free mode. * @@ -2693,6 +2767,17 @@ declare class NavigationAttribute extends CommonMethod { * @since 12 */ systemBarStyle(style: Optional): NavigationAttribute; + + /** + * Set the Navigation can be restored after the application is terminated. + * To enable this attribute, a navigation id must be set. + * + * @param { boolean } recoverable - navigation can be recovered. + * @returns { NavigationAttribute } Returns the instance of the NavigationAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 13 + */ + recoverable(recoverable: Optional): NavigationAttribute; } /** diff --git a/api/@internal/component/ets/particle.d.ts b/api/@internal/component/ets/particle.d.ts index 6052a9f89..e33dc1025 100644 --- a/api/@internal/component/ets/particle.d.ts +++ b/api/@internal/component/ets/particle.d.ts @@ -18,6 +18,110 @@ * @kit ArkUI */ +/** + * Defines a pair of given type for particle. + * + * @typedef { [T1, T2] } ParticleTuple + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type ParticleTuple = [T1, T2]; + +/** + * Defines velocity options. + * + * @typedef VelocityOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface VelocityOptions { + /** + * Particle speed. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Particle speed. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + speed: ParticleTuple; + + /** + * Angle of particle's direction. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Angle of particle's direction. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + angle: ParticleTuple; +} + +/** + * Defines acceleration options. + * + * @typedef AccelerationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface AccelerationOptions< + ACC_SPEED_UPDATER extends ParticleUpdater, + ACC_ANGLE_UPDATER extends ParticleUpdater +> { + /** + * Speed property options. + * @type { ?ParticlePropertyOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Speed property options. + * @type { ?ParticlePropertyOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + speed?: ParticlePropertyOptions; + + /** + * Angle property options. + * @type { ?ParticlePropertyOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Angle property options. + * @type { ?ParticlePropertyOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + angle?: ParticlePropertyOptions; +} + /** * Defines the ParticleOptions Interface. * @interface ParticleOptions @@ -133,10 +237,16 @@ interface ParticleOptions< * @atomicservice * @since 11 */ - velocity?: { - speed: [number, number]; - angle: [number, number]; - }; + /** + * Particle velocity. + * @type { ?VelocityOptions } + * @default {speed:[0,0];angle:[0,0]} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + velocity?: VelocityOptions; /** * Particle acceleration. @@ -155,10 +265,16 @@ interface ParticleOptions< * @atomicservice * @since 11 */ - acceleration?: { - speed?: ParticlePropertyOptions; - angle?: ParticlePropertyOptions; - }; + /** + * Particle acceleration. + * @type { ?AccelerationOptions } + * @default {speed:{range:[0,0]};angle:{range:[0,0]}} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + acceleration?: AccelerationOptions; /** * Particle spin. @@ -262,7 +378,15 @@ interface ImageParticleParameters { * @atomicservice * @since 11 */ - size: [Dimension, Dimension]; + /** + * Particle image size. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + size: ParticleTuple; /** * Image fit. @@ -391,6 +515,98 @@ interface EmitterProperty { size?: SizeT; } +/** + * Defines parameters of particles used by emitters. + * + * @typedef EmitterParticleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface EmitterParticleOptions { + /** + * Particle type. + * @type { PARTICLE } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Particle type. + * @type { PARTICLE } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type: PARTICLE; + /** + * Particle config. + * @type { ParticleConfigs[PARTICLE] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Particle config. + * @type { ParticleConfigs[PARTICLE] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + config: ParticleConfigs[PARTICLE]; + + /** + * Particle count. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Particle count. + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + count: number; + + /** + * Particle lifetime. + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Particle lifetime. + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + lifetime?: number; + + /** + * Particle lifetimeRange,value range [0, ∞). + * when lifetimeRange>lifetime,minimum lifetime is 0. + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lifetimeRange?: number; +} + /** * Defines the emitter Options. * @interface EmitterOptions @@ -422,88 +638,15 @@ interface EmitterOptions { * @atomicservice * @since 11 */ - particle: { - /** - * Particle type. - * @type { PARTICLE } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Particle type. - * @type { PARTICLE } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - type: PARTICLE; - /** - * Particle config. - * @type { ParticleConfigs[PARTICLE] } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Particle config. - * @type { ParticleConfigs[PARTICLE] } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - config: ParticleConfigs[PARTICLE]; - - /** - * Particle count. - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Particle count. - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - count: number; - - /** - * Particle lifetime. - * @type { ?number } - * @default 1000 - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Particle lifetime. - * @type { ?number } - * @default 1000 - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - lifetime?: number; - - /** - * Particle lifetimeRange,value range [0, ∞). - * when lifetimeRange>lifetime,minimum lifetime is 0. - * @type { ?number } - * @default 0 - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - lifetimeRange?: number; - }; + /** + * Set particle config. + * @type { EmitterParticleOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + particle: EmitterParticleOptions; /** * Emitting rate, that is, the number of particles produced per second. @@ -564,7 +707,18 @@ interface EmitterOptions { * @atomicservice * @since 11 */ - position?: [Dimension, Dimension]; + /** + * Position of emitter. + * The first element means X-axis location. + * The second element means the Y-axis location. + * @type { ?ParticleTuple } + * @default [0,0] + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + position?: ParticleTuple; /** * Size of emitter. @@ -587,7 +741,18 @@ interface EmitterOptions { * @atomicservice * @since 11 */ - size?: [Dimension, Dimension]; + /** + * Size of emitter. + * The first element means emitter width. + * The second element means emitter height. + * @type { ?ParticleTuple } + * @default ['100%','100%'] + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + size?: ParticleTuple; } /** @@ -640,7 +805,15 @@ interface ParticlePropertyUpdaterConfigs { * @atomicservice * @since 11 */ - [ParticleUpdater.RANDOM]: [T, T]; + /** + * Random effect of particle updater. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + [ParticleUpdater.RANDOM]: ParticleTuple; /** * Curve effect of particle updater. @@ -660,6 +833,175 @@ interface ParticlePropertyUpdaterConfigs { [ParticleUpdater.CURVE]: Array>; } +/** + * Defines the particle updater options. + * + * @typedef ParticleUpdaterOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface ParticleUpdaterOptions { + /** + * Particle updater type. + * @type { UPDATER } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Particle updater type. + * @type { UPDATER } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type: UPDATER; + + /** + * Particle updater configuration. + * @type { ParticlePropertyUpdaterConfigs[UPDATER] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Particle updater configuration. + * @type { ParticlePropertyUpdaterConfigs[UPDATER] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + config: ParticlePropertyUpdaterConfigs[UPDATER]; +} + +/** + * Defines the particle color options. + * + * @typedef ParticleColorOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface ParticleColorOptions { + /** + * Red component of particle color. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Red component of particle color. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + r: ParticleTuple; + + /** + * Green component of particle color. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Green component of particle color. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + g: ParticleTuple; + + /** + * Blue component of particle color. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Blue component of particle color. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + b: ParticleTuple; + + /** + * Opacity component of particle color. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Opacity component of particle color. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + a: ParticleTuple; +} + +/** + * Defines the particle color updater options. + * + * @typedef ParticleColorUpdaterOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface ParticleColorUpdaterOptions { + /** + * Color updater. + * @type { UPDATER } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Color updater. + * @type { UPDATER } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + type: UPDATER; + + /** + * Color updater configuration. + * @type { ParticleColorPropertyUpdaterConfigs[UPDATER] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Color updater configuration. + * @type { ParticleColorPropertyUpdaterConfigs[UPDATER] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + config: ParticleColorPropertyUpdaterConfigs[UPDATER]; +} + /** * Defines the particle property Options. * @interface ParticlePropertyOptions @@ -691,7 +1033,15 @@ interface ParticlePropertyOptions { * @atomicservice * @since 11 */ - range: [TYPE, TYPE]; + /** + * Initial range, within which the initial value are randomly generated. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + range: ParticleTuple; /** * Particle property updater. @@ -710,10 +1060,16 @@ interface ParticlePropertyOptions { * @atomicservice * @since 11 */ - updater?: { - type: UPDATER; - config: ParticlePropertyUpdaterConfigs[UPDATER]; - }; + /** + * Particle property updater. + * @type { ?ParticleUpdaterOptions } + * @default {type:UPDATER.NONE;config:ParticlePropertyUpdaterConfigs[UPDATER.NONE]} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + updater?: ParticleUpdaterOptions; } /** @@ -766,12 +1122,15 @@ interface ParticleColorPropertyUpdaterConfigs { * @atomicservice * @since 11 */ - [ParticleUpdater.RANDOM]: { - r: [number, number]; - g: [number, number]; - b: [number, number]; - a: [number, number]; - }; + /** + * Random effect of particle color property updater. + * @type { ParticleColorOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + [ParticleUpdater.RANDOM]: ParticleColorOptions; /** * Curve effect of particle color property updater. @@ -824,7 +1183,15 @@ interface ParticleColorPropertyOptions { * @atomicservice * @since 11 */ - range: [ResourceColor, ResourceColor]; + /** + * Initial color range, within which the initial color is randomly generated. + * @type { ParticleTuple } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + range: ParticleTuple; /** * Distribution type of particle color. @@ -854,10 +1221,16 @@ interface ParticleColorPropertyOptions { * @atomicservice * @since 11 */ - updater?: { - type: UPDATER; - config: ParticleColorPropertyUpdaterConfigs[UPDATER]; - }; + /** + * Particle color property updater. + * @type { ?ParticleColorUpdaterOptions } + * @default {type:UPDATER.NONE;config:ParticleColorPropertyUpdaterConfigs[UPDATER.NONE]} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + updater?: ParticleColorUpdaterOptions; } /** @@ -964,6 +1337,52 @@ interface ParticlePropertyAnimation { curve?: Curve | ICurve; } +/** + * Defines the particle array. + * + * @typedef Particles + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface Particles< + PARTICLE extends ParticleType, + COLOR_UPDATER extends ParticleUpdater, + OPACITY_UPDATER extends ParticleUpdater, + SCALE_UPDATER extends ParticleUpdater, + ACC_SPEED_UPDATER extends ParticleUpdater, + ACC_ANGLE_UPDATER extends ParticleUpdater, + SPIN_UPDATER extends ParticleUpdater +> { + /** + * Array of particles. + * @type { Array> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Array of particles. + * @type { Array> } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + particles: Array< + ParticleOptions< + PARTICLE, + COLOR_UPDATER, + OPACITY_UPDATER, + SCALE_UPDATER, + ACC_SPEED_UPDATER, + ACC_ANGLE_UPDATER, + SPIN_UPDATER + > + >; +} + /** * Defines the particle Interface. * @interface ParticleInterface @@ -999,6 +1418,15 @@ interface ParticleInterface { * @atomicservice * @since 11 */ + /** + * create a particle array. + * @param { Particles } particles - Array of particles. + * @returns { ParticleAttribute } Returns the particle attribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ < PARTICLE extends ParticleType, COLOR_UPDATER extends ParticleUpdater, @@ -1007,19 +1435,15 @@ interface ParticleInterface { ACC_SPEED_UPDATER extends ParticleUpdater, ACC_ANGLE_UPDATER extends ParticleUpdater, SPIN_UPDATER extends ParticleUpdater - >(value: { - particles: Array< - ParticleOptions< - PARTICLE, - COLOR_UPDATER, - OPACITY_UPDATER, - SCALE_UPDATER, - ACC_SPEED_UPDATER, - ACC_ANGLE_UPDATER, - SPIN_UPDATER - > - >; - }): ParticleAttribute; + >(particles: Particles< + PARTICLE, + COLOR_UPDATER, + OPACITY_UPDATER, + SCALE_UPDATER, + ACC_SPEED_UPDATER, + ACC_ANGLE_UPDATER, + SPIN_UPDATER + >): ParticleAttribute; } /** diff --git a/api/@internal/component/ets/rating.d.ts b/api/@internal/component/ets/rating.d.ts index ce5499d6a..1e79c9558 100644 --- a/api/@internal/component/ets/rating.d.ts +++ b/api/@internal/component/ets/rating.d.ts @@ -18,6 +18,210 @@ * @kit ArkUI */ +/** + * Define options used to construct a rating. + * + * @interface RatingOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface RatingOptions { + /** + * Rating option. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Rating option. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Rating option. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Rating option. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + rating: number; + + /** + * Indicator option. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Indicator option. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Indicator option. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Indicator option. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + indicator?: boolean +} + +/** + * Define star style options. + * + * @interface StarStyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface StarStyleOptions { + /** + * Background URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Background URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Background URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Background URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + backgroundUri: string; + + /** + * Foreground URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Foreground URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Foreground URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Foreground URI option. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + foregroundUri: string; + + /** + * Secondary URI option. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Secondary URI option. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Secondary URI option. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Secondary URI option. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + secondaryUri?: string +} + /** * Provides the interface for scoring bars. * @@ -91,7 +295,18 @@ interface RatingInterface { * @atomicservice * @since 11 */ - (options?: { rating: number; indicator?: boolean }): RatingAttribute; + /** + * Called when a score bar is created. + * + * @param { RatingOptions } [options] - rating options + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options?: RatingOptions): RatingAttribute; } /** @@ -313,7 +528,18 @@ declare class RatingAttribute extends CommonMethod { * @atomicservice * @since 11 */ - starStyle(value: { backgroundUri: string; foregroundUri: string; secondaryUri?: string }): RatingAttribute; + /** + * Called when a picture is set. + * + * @param { StarStyleOptions } options - star style options + * @returns { RatingAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + starStyle(options: StarStyleOptions): RatingAttribute; /** * Called when the star rating of the operation scoring bar changes. diff --git a/api/@internal/component/ets/rich_editor.d.ts b/api/@internal/component/ets/rich_editor.d.ts index b91f01164..c72bd988b 100644 --- a/api/@internal/component/ets/rich_editor.d.ts +++ b/api/@internal/component/ets/rich_editor.d.ts @@ -2721,6 +2721,17 @@ declare interface SelectionMenuOptions { * @since 12 */ onDisappear?: Callback; + + /** + * Menu type, default value is MenuType.SELECTION_MENU. + * + * @type { ?MenuType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + menuType?: MenuType; } /** @@ -3734,7 +3745,7 @@ declare class RichEditorAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 13 + * @since 12 */ enableKeyboardOnFocus(isEnabled: boolean): RichEditorAttribute; @@ -3749,6 +3760,18 @@ declare class RichEditorAttribute extends CommonMethod { * @since 13 */ enableHapticFeedback(isEnabled: boolean): RichEditorAttribute; + + /** + * Define bar state of the RichEditor. + * + * @param { BarState } state - bar state. + * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + barState(state: BarState): RichEditorAttribute; } /** diff --git a/api/@internal/component/ets/row.d.ts b/api/@internal/component/ets/row.d.ts index 9c890cc47..bf9f13390 100644 --- a/api/@internal/component/ets/row.d.ts +++ b/api/@internal/component/ets/row.d.ts @@ -18,6 +18,54 @@ * @kit ArkUI */ +/** + * Define options used to construct a row. + * + * @interface RowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface RowOptions { + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Row spacing. + * + * @type { ?(string | number) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + space?: string | number; +} + /** * The components are laid out horizontally * @@ -91,7 +139,18 @@ interface RowInterface { * @atomicservice * @since 11 */ - (value?: { space?: string | number }): RowAttribute; + /** + * Called when the layout is set in the horizontal direction. + * + * @param { ?RowOptions } options - row options + * @returns { RowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options?: RowOptions): RowAttribute; } /** diff --git a/api/@internal/component/ets/scroll.d.ts b/api/@internal/component/ets/scroll.d.ts index e8df170a4..da006e5a3 100644 --- a/api/@internal/component/ets/scroll.d.ts +++ b/api/@internal/component/ets/scroll.d.ts @@ -433,76 +433,16 @@ declare class Scroller { * @atomicservice * @since 11 */ - scrollTo(value: { - /** - * The X-axis offset. - * - * @type { number | string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * The X-axis offset. - * - * @type { number | string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - xOffset: number | string; - - /** - * The Y-axis offset. - * - * @type { number | string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * The Y-axis offset. - * - * @type { number | string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - yOffset: number | string; - - /** - * Descriptive animation. - * - * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters - * and the boolean type enables default spring animation. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Descriptive animation. - * - * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters - * and the boolean type enables default spring animation. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - /** - * Descriptive animation. - * - * @type { ?( ScrollAnimationOptions | boolean) } The ScrollAnimationOptions type provides custom animation parameters - * and the boolean type enables default spring animation. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - animation?: ScrollAnimationOptions | boolean; - }); + /** + * Called when the setting slides to the specified position. + * + * @param { ScrollOptions } options - scroll options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + scrollTo(options: ScrollOptions); /** * Called when scrolling to the edge of the container. @@ -580,16 +520,7 @@ declare class Scroller { * @atomicservice * @since 11 */ - /** - * Called when page turning mode is set. - * - * @param { ScrollPageOptions } value - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - scrollPage(value: ScrollPageOptions); + scrollPage(value: { next: boolean }); /** * Called when page turning mode is set. @@ -768,35 +699,83 @@ declare class Scroller { } /** - * Define scroll page options - * @interface ScrollPageOptions + * Define scroll options. + * + * @interface ScrollOptions * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ -declare interface ScrollPageOptions { +declare interface ScrollOptions { /** - * Control whether to scroll to the next page or the previous page. + * The X-axis offset. * - * @type { boolean } + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The X-axis offset. + * + * @type { number | string } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since 12 + * @since 11 */ - next: boolean; + xOffset: number | string; /** - * Set whether the scrollPage have animate. + * The Y-axis offset. * - * @type { ?boolean } - * @default false + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The Y-axis offset. + * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + yOffset: number | string; + + /** + * Descriptive animation. + * + * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters + * and the boolean type enables default spring animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Descriptive animation. + * + * @type { ?({ duration?: number; curve?: Curve | ICurve } | boolean) } The object type provides custom animation parameters + * and the boolean type enables default spring animation. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + /** + * Descriptive animation. + * + * @type { ?( ScrollAnimationOptions | boolean) } The ScrollAnimationOptions type provides custom animation parameters + * and the boolean type enables default spring animation. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice * @since 12 */ - animation?: boolean; + animation?: ScrollAnimationOptions | boolean; } /** @@ -949,6 +928,69 @@ interface ScrollInterface { (scroller?: Scroller): ScrollAttribute; } +/** + * Defines a Scroll onScrollEdge callback. + * + * @typedef { function } OnScrollEdgeCallback + * @param { Edge } side - the edge position scrolled to + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type OnScrollEdgeCallback = (side: Edge) => void; + +/** + * The data returned by the event handler when onScrollFrameBegin. + * + * @interface OnScrollFrameBeginHandlerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +interface OnScrollFrameBeginHandlerResult { + /** + * Actual sliding amount, unit vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Actual sliding amount, unit vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Actual sliding amount, unit vp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + offsetRemain: number; +} + +/** + * Defines a Scroll onScrollFrameBegin callback. + * + * @typedef { function } OnScrollFrameBeginCallback + * @param { number } offset - The upcoming sliding amount, unit vp + * @param { ScrollState } state - current sliding status + * @returns { OnScrollFrameBeginHandlerResult } data - the scroll data return by handler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +declare type OnScrollFrameBeginCallback = (offset: number, state: ScrollState) => OnScrollFrameBeginHandlerResult; + /** * Defines the scroll attribute functions. * @@ -1087,7 +1129,17 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @atomicservice * @since 11 */ - onScrollEdge(event: (side: Edge) => void): ScrollAttribute; + /** + * Called when scrolling to the edge of the container. + * + * @param { OnScrollEdgeCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onScrollEdge(event: OnScrollEdgeCallback): ScrollAttribute; /** * Called when scrolling start. @@ -1116,7 +1168,17 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @atomicservice * @since 11 */ - onScrollStart(event: () => void): ScrollAttribute; + /** + * Called when scrolling start. + * + * @param { VoidCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onScrollStart(event: VoidCallback): ScrollAttribute; /** * Called when scrolling has stopped. @@ -1157,7 +1219,17 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @atomicservice * @since 11 */ - onScrollStop(event: () => void): ScrollAttribute; + /** + * Called when scrolling has stopped. + * + * @param { VoidCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onScrollStop(event: VoidCallback): ScrollAttribute; /** * Called when the status of the scroll bar is set. @@ -1303,7 +1375,17 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @atomicservice * @since 11 */ - onScrollFrameBegin(event: (offset: number, state: ScrollState) => { offsetRemain: number }): ScrollAttribute; + /** + * Called when scrolling begin each frame. + * + * @param { OnScrollFrameBeginCallback } event + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onScrollFrameBegin(event: OnScrollFrameBeginCallback): ScrollAttribute; /** * Called to setting the nested scroll options. diff --git a/api/@internal/component/ets/search.d.ts b/api/@internal/component/ets/search.d.ts index 5752ac3dd..e5cfd8769 100644 --- a/api/@internal/component/ets/search.d.ts +++ b/api/@internal/component/ets/search.d.ts @@ -300,6 +300,92 @@ declare enum SearchType { URL = 13, } +/** + * Options used to construct the search. + * + * @typedef SearchOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface SearchOptions { + /** + * Text input in the search text box. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text input in the search text box. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + value?: string; + + /** + * Text displayed when there is no input. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Text displayed when there is no input. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + /** + * Text displayed when there is no input. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + placeholder?: ResourceStr; + + /** + * Path to the search icon. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Path to the search icon. + * + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + icon?: string; + + /** + * Controller of the component. + * + * @type { ?SearchController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Controller of the component. + * + * @type { ?SearchController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + controller?: SearchController; +} + /** * The construct function of search * @@ -352,82 +438,17 @@ interface SearchInterface { * @atomicservice * @since 11 */ - (options?: { - /** - * Text input in the search text box - * - * @type { ?string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 8 - */ - /** - * Text input in the search text box - * - * @type { ?string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 11 - */ - value?: string; - - /** - * Text displayed when there is no input - * - * @type { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 8 - */ - /** - * Text displayed when there is no input - * - * @type { ?ResourceStr } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - /** - * Text displayed when there is no input - * - * @type { ?ResourceStr } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 11 - */ - placeholder?: ResourceStr; - - /** - * Path to the search icon - * - * @type { ?string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 8 - */ - /** - * Path to the search icon - * - * @type { ?string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 11 - */ - icon?: string; - - /** - * Controller of the component - * - * @type { ?SearchController } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 8 - */ - /** - * Controller of the component - * - * @type { ?SearchController } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 11 - */ - controller?: SearchController - }): SearchAttribute; + /** + * The options of SearchInterface. + * + * @param { SearchOptions } [options] - Search options. + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + (options?: SearchOptions): SearchAttribute; } /** @@ -965,7 +986,17 @@ declare class SearchAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onSubmit(callback: (value: string) => void): SearchAttribute; + /** + * Call the function when clicked the search button. + * + * @param { Callback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSubmit(callback: Callback): SearchAttribute; /** * Call the function when editing the input text @@ -1025,7 +1056,17 @@ declare class SearchAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onTextSelectionChange(callback: (selectionStart: number, selectionEnd: number) => void): SearchAttribute; + /** + * Called when the text selection changes. + * + * @param { OnTextSelectionChangeCallback } callback - Callback of the listened event. + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onTextSelectionChange(callback: OnTextSelectionChangeCallback): SearchAttribute; /** * Called when the content scrolls. @@ -1046,7 +1087,17 @@ declare class SearchAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onContentScroll(callback: (totalOffsetX: number, totalOffsetY: number) => void): SearchAttribute; + /** + * Called when the content scrolls. + * + * @param { OnContentScrollCallback } callback - Callback of the listened event. + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onContentScroll(callback: OnContentScrollCallback): SearchAttribute; /** * Called when using the Clipboard menu @@ -1075,7 +1126,17 @@ declare class SearchAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onCopy(callback: (value: string) => void): SearchAttribute; + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCopy(callback: Callback): SearchAttribute; /** * Called when using the Clipboard menu @@ -1104,7 +1165,17 @@ declare class SearchAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onCut(callback: (value: string) => void): SearchAttribute; + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { SearchAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCut(callback: Callback): SearchAttribute; /** * Called when using the Clipboard menu @@ -1136,7 +1207,17 @@ declare class SearchAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onPaste(callback: (value: string, event: PasteEvent) => void): SearchAttribute; + /** + * Called when using the Clipboard menu. + * + * @param { OnPasteCallback } callback - Executed when a paste operation is performed. + * @returns { SearchAttribute } Returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onPaste(callback: OnPasteCallback): SearchAttribute; /** * Called when the copy option is set. @@ -1458,6 +1539,18 @@ declare class SearchAttribute extends CommonMethod { * @since 12 */ enablePreviewText(enable: boolean): SearchAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { SearchAttribute } returns the instance of the SearchAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): SearchAttribute; } /** diff --git a/api/@internal/component/ets/sidebar.d.ts b/api/@internal/component/ets/sidebar.d.ts index 607d0dbce..c48390db3 100644 --- a/api/@internal/component/ets/sidebar.d.ts +++ b/api/@internal/component/ets/sidebar.d.ts @@ -177,6 +177,95 @@ declare enum SideBarPosition { End, } +/** + * ButtonStyle icons. + * + * @typedef ButtonStyleIcon + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare interface ButtonIconOptions { + /** + * Defines whether an icon is shown. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines whether an icon is shown. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines whether an icon is shown. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + shown: string | PixelMap | Resource; + + /** + * Defines whether an icon is hidden. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines whether an icon is hidden. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines whether an icon is hidden. + * + * @type { string | PixelMap | Resource } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + hidden: string | PixelMap | Resource; + + /** + * Defines whether an icon is switching. + * + * @type { ?(string | PixelMap | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Defines whether an icon is switching. + * + * @type { ?(string | PixelMap | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * Defines whether an icon is switching. + * + * @type { ?(string | PixelMap | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + switching?: string | PixelMap | Resource; +} + /** * Sets the control button style * @@ -342,11 +431,16 @@ declare interface ButtonStyle { * @atomicservice * @since 11 */ - icons?: { - shown: string | PixelMap | Resource; - hidden: string | PixelMap | Resource; - switching?: string | PixelMap | Resource; - }; + /** + * Set the button icon when sidebar status has changed + * + * @type { ?ButtonIconOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + icons?: ButtonIconOptions; } /** diff --git a/api/@internal/component/ets/stack.d.ts b/api/@internal/component/ets/stack.d.ts index 98f6aedcf..d3505d6c5 100644 --- a/api/@internal/component/ets/stack.d.ts +++ b/api/@internal/component/ets/stack.d.ts @@ -18,6 +18,54 @@ * @kit ArkUI */ +/** + * Options used to construct the stack. + * + * @interface StackOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface StackOptions { + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the alignment of sub components within the container. + * + * @type { ?Alignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + alignContent?: Alignment; +} + /** * Provides ports for stacking containers. * @@ -91,7 +139,18 @@ interface StackInterface { * @atomicservice * @since 11 */ - (value?: { alignContent?: Alignment }): StackAttribute; + /** + * Set the options. + * + * @param { ?StackOptions } options - stack options + * @returns { StackAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options?: StackOptions): StackAttribute; } /** diff --git a/api/@internal/component/ets/styled_string.d.ts b/api/@internal/component/ets/styled_string.d.ts index 927d83c66..c7b7a7acf 100644 --- a/api/@internal/component/ets/styled_string.d.ts +++ b/api/@internal/component/ets/styled_string.d.ts @@ -1632,6 +1632,16 @@ declare abstract class CustomSpan { * @since 12 */ abstract onDraw(context: DrawContext, drawInfo: CustomSpanDrawInfo): void; + + /** + * Invalidate all components that use the object, which will cause a re-render of all components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + invalidate(): void; } /** diff --git a/api/@internal/component/ets/text.d.ts b/api/@internal/component/ets/text.d.ts index ce7cd0e7c..071719292 100644 --- a/api/@internal/component/ets/text.d.ts +++ b/api/@internal/component/ets/text.d.ts @@ -18,6 +18,54 @@ * @kit ArkUI */ +/** + * Text overflow options. + * + * @interface TextOverflowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface TextOverflowOptions { + /** + * Text overflow option. + * + * @type { TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Text overflow option. + * + * @type { TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Text overflow option. + * + * @type { TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Text overflow option. + * + * @type { TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + overflow: TextOverflow; +} + /** * Provides an interface for writing texts. * @@ -562,7 +610,18 @@ declare class TextAttribute extends CommonMethod { * @atomicservice * @since 11 */ - textOverflow(value: { overflow: TextOverflow }): TextAttribute; + /** + * Called when the overflow mode of the font is set. + * + * @param { TextOverflowOptions } options - Text overflow options. + * @returns { TextAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + textOverflow(options: TextOverflowOptions): TextAttribute; /** * Called when the font list of text is set. @@ -1152,6 +1211,18 @@ declare class TextAttribute extends CommonMethod { * @since 12 */ halfLeading(halfLeading: boolean): TextAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { TextAttribute } returns the instance of the TextAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): TextAttribute; } /** diff --git a/api/@internal/component/ets/text_area.d.ts b/api/@internal/component/ets/text_area.d.ts index b9a0785e3..f604b30c6 100644 --- a/api/@internal/component/ets/text_area.d.ts +++ b/api/@internal/component/ets/text_area.d.ts @@ -1648,6 +1648,18 @@ declare class TextAreaAttribute extends CommonMethod { * @since 12 */ enablePreviewText(enable: boolean): TextAreaAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): TextAreaAttribute; } /** diff --git a/api/@internal/component/ets/text_clock.d.ts b/api/@internal/component/ets/text_clock.d.ts index 49008c92a..284a6bbe7 100644 --- a/api/@internal/component/ets/text_clock.d.ts +++ b/api/@internal/component/ets/text_clock.d.ts @@ -159,6 +159,72 @@ declare interface TextClockConfiguration extends CommonConfiguration void; + +/** + * Defines a TextInput callback when onTextSelectionChange. + * + * @typedef { function } OnTextSelectionChangeCallback + * @param { number } selectionStart - The starting position of the selected text, the starting position of the text is 0. + * @param { number } selectionEnd - The end location of the selected text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnTextSelectionChangeCallback = (selectionStart: number, selectionEnd: number) => void; + +/** + * Defines a TextInput callback when onContentScroll. + * + * @typedef { function } OnContentScrollCallback + * @param { number } totalOffsetX - The text is offset in px on the horizontal axis of the content area. + * @param { number } totalOffsetY - The text is offset in px on the vertical axis of the content area. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnContentScrollCallback = (totalOffsetX: number, totalOffsetY: number) => void; + + +/** + * Defines a TextInput callback when onPaste. + * + * @typedef { function } OnPasteCallback + * @param { string } content - The text content of the paste. + * @param { PasteEvent } event - User-defined paste event. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +declare type OnPasteCallback = (content: string, event: PasteEvent) => void; + /** * Defines the TextInput attribute functions. * @@ -1345,7 +1398,17 @@ declare class TextInputAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onEditChange(callback: (isEditing: boolean) => void): TextInputAttribute; + /** + * Called when judging whether the text editing change finished. + * + * @param { Callback } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onEditChange(callback: Callback): TextInputAttribute; /** * Called when submitted. @@ -1374,7 +1437,17 @@ declare class TextInputAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onSubmit(callback: (enterKey: EnterKeyType, event: SubmitEvent) => void): TextInputAttribute; + /** + * Called when submitted. + * + * @param { OnSubmitCallback } callback - Callback of the listened event. + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSubmit(callback: OnSubmitCallback): TextInputAttribute; /** * Called when the input of the input box changes. @@ -1434,7 +1507,17 @@ declare class TextInputAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onTextSelectionChange(callback: (selectionStart: number, selectionEnd: number) => void): TextInputAttribute; + /** + * Called when the text selection changes. + * + * @param { OnTextSelectionChangeCallback } callback - Callback of the listened event. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onTextSelectionChange(callback: OnTextSelectionChangeCallback): TextInputAttribute; /** * Called when the content scrolls. @@ -1455,7 +1538,17 @@ declare class TextInputAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onContentScroll(callback: (totalOffsetX: number, totalOffsetY: number) => void): TextInputAttribute; + /** + * Called when the content scrolls. + * + * @param { OnContentScrollCallback } callback - Callback of the listened event. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onContentScroll(callback: OnContentScrollCallback): TextInputAttribute; /** * Called when the input of maximum text length is set. @@ -1661,7 +1754,18 @@ declare class TextInputAttribute extends CommonMethod { * @atomicservice * @since 11 */ - inputFilter(value: ResourceStr, error?: (value: string) => void): TextInputAttribute; + /** + * Called when the inputFilter of text is set. + * + * @param { ResourceStr } value + * @param { Callback } [error] + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + inputFilter(value: ResourceStr, error?: Callback): TextInputAttribute; /** * Called when using the Clipboard menu @@ -1690,7 +1794,17 @@ declare class TextInputAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onCopy(callback: (value: string) => void): TextInputAttribute; + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCopy(callback: Callback): TextInputAttribute; /** * Called when using the Clipboard menu @@ -1719,7 +1833,17 @@ declare class TextInputAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onCut(callback: (value: string) => void): TextInputAttribute; + /** + * Called when using the Clipboard menu. + * + * @param { Callback } callback + * @returns { TextInputAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onCut(callback: Callback): TextInputAttribute; /** * Called when using the Clipboard menu @@ -1751,7 +1875,17 @@ declare class TextInputAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onPaste(callback: (value: string, event: PasteEvent) => void): TextInputAttribute; + /** + * Called when using the Clipboard menu. + * + * @param { OnPasteCallback } callback - Executed when a paste operation is performed. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onPaste(callback: OnPasteCallback): TextInputAttribute; /** * Called when the copy option is set. @@ -2203,7 +2337,17 @@ declare class TextInputAttribute extends CommonMethod { * @atomicservice * @since 12 */ - cancelButton(value: { style?: CancelButtonStyle, icon?: IconOptions }): TextInputAttribute; + /** + * Set the cancel button style. + * + * @param { CancelButtonOptions } options - Indicates the style of the cancel button. + * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + cancelButton(options: CancelButtonOptions): TextInputAttribute; /** * Sets selection when on focus. @@ -2447,6 +2591,18 @@ declare class TextInputAttribute extends CommonMethod { * @since 12 */ enablePreviewText(enable: boolean): TextInputAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. + * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + enableHapticFeedback(isEnabled: boolean): TextInputAttribute; } /** diff --git a/api/@internal/component/ets/toggle.d.ts b/api/@internal/component/ets/toggle.d.ts index 3fa48a2d6..f09c16c1e 100644 --- a/api/@internal/component/ets/toggle.d.ts +++ b/api/@internal/component/ets/toggle.d.ts @@ -250,6 +250,90 @@ declare interface ToggleConfiguration extends CommonConfiguration; } +/** + * Defines the toggle options. + * + * @interface ToggleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ +declare interface ToggleOptions { + /** + * Type of the toggle. + * + * @type { ToggleType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Type of the toggle. + * + * @type { ToggleType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Type of the toggle. + * + * @type { ToggleType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Type of the toggle. + * + * @type { ToggleType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + type: ToggleType; + + /** + * Whether the toggle is on. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Whether the toggle is on. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Whether the toggle is on. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Whether the toggle is on. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + isOn?: boolean +} + /** * Defines the toggle interface. * @@ -323,7 +407,18 @@ interface ToggleInterface { * @atomicservice * @since 11 */ - (options: { type: ToggleType; isOn?: boolean }): ToggleAttribute; + /** + * Set parameters to obtain the toggle. + * + * @param { ToggleOptions } options - toggle options + * @returns { ToggleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 13 + */ + (options: ToggleOptions): ToggleAttribute; } /** diff --git a/api/@internal/component/ets/ui_extension_component.d.ts b/api/@internal/component/ets/ui_extension_component.d.ts index 601901ed1..9f2413fb0 100644 --- a/api/@internal/component/ets/ui_extension_component.d.ts +++ b/api/@internal/component/ets/ui_extension_component.d.ts @@ -78,6 +78,18 @@ declare interface UIExtensionOptions { */ placeholder?: ComponentContent; + /** + * Set Areachange placeholder. + * If the Areachange placeholder ComponentContent is set, the placeholder node is displayed until + * the UIExtensionComponent size change is complete. + * + * @type { ?Record } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 13 + */ + areaChangePlaceholder?: Record; + /** * Set UIExtensionComponent Content Dpi Follow Strategy. * diff --git a/api/@internal/component/ets/video.d.ts b/api/@internal/component/ets/video.d.ts index e7d585a9e..f38f9c45b 100644 --- a/api/@internal/component/ets/video.d.ts +++ b/api/@internal/component/ets/video.d.ts @@ -277,6 +277,93 @@ declare enum PlaybackSpeed { Speed_Forward_2_00_X, } +/** + * Fullscreen information of the video. + * + * @typedef FullscreenInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface FullscreenInfo { + /** + * The flag whether play in full screen. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The flag whether play in full screen. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + fullscreen: boolean; +} + +/** + * Prepared information of the video. + * + * @typedef PreparedInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface PreparedInfo { + /** + * The duration of the current video, in seconds. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The duration of the current video, in seconds. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + duration: number; +} + +/** + * Playback information of the video. + * + * @typedef PlaybackInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ +interface PlaybackInfo { + /** + * The current video playback progress, expressed in seconds. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + */ + /** + * The current video playback progress, expressed in seconds. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + */ + time: number; +} + /** * Defines the video options. * @@ -906,7 +993,17 @@ declare class VideoAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onStart(event: () => void): VideoAttribute; + /** + * Called when the video is played. + * + * @param { VoidCallback } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onStart(event: VoidCallback): VideoAttribute; /** * Called when the video is paused. @@ -935,7 +1032,17 @@ declare class VideoAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onPause(event: () => void): VideoAttribute; + /** + * Called when the video is paused. + * + * @param { VoidCallback } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onPause(event: VoidCallback): VideoAttribute; /** * Called when the video playback ends. @@ -964,7 +1071,17 @@ declare class VideoAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onFinish(event: () => void): VideoAttribute; + /** + * Called when the video playback ends. + * + * @param { VoidCallback } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onFinish(event: VoidCallback): VideoAttribute; /** * Called when the video enters and exits the full screen. @@ -993,24 +1110,17 @@ declare class VideoAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onFullscreenChange(callback: (event: { - /** - * Play the flag in full screen. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Play the flag in full screen. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - fullscreen: boolean - }) => void): VideoAttribute; + /** + * Called when the video enters and exits the full screen. + * + * @param { Callback } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onFullscreenChange(callback: Callback): VideoAttribute; /** * Called when the video preparation is complete. @@ -1039,24 +1149,17 @@ declare class VideoAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onPrepared(callback: (event: { - /** - * Playback duration. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Playback duration. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - duration: number - }) => void): VideoAttribute; + /** + * Called when the video preparation is complete. + * + * @param { Callback } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onPrepared(callback: Callback): VideoAttribute; /** * Called when the time information is reported when the progress bar process is operated. @@ -1085,24 +1188,17 @@ declare class VideoAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onSeeking(callback: (event: { - /** - * Play time. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Play time. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - time: number - }) => void): VideoAttribute; + /** + * Called when the time information is reported when the progress bar process is operated. + * + * @param { Callback } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSeeking(callback: Callback): VideoAttribute; /** * Called when the playback time information is reported after the operation progress bar is completed. @@ -1131,24 +1227,17 @@ declare class VideoAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onSeeked(callback: (event: { - /** - * Play time. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Play time. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - time: number - }) => void): VideoAttribute; + /** + * Called when the playback time information is reported after the operation progress bar is completed. + * + * @param { Callback } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onSeeked(callback: Callback): VideoAttribute; /** * Called when the playback progress changes. @@ -1177,24 +1266,17 @@ declare class VideoAttribute extends CommonMethod { * @atomicservice * @since 11 */ - onUpdate(callback: (event: { - /** - * Play time. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - */ - /** - * Play time. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - */ - time: number - }) => void): VideoAttribute; + /** + * Called when the playback progress changes. + * + * @param { Callback } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + onUpdate(callback: Callback): VideoAttribute; /** * Called when playback fails. diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index 2761d701e..bcab3ce4a 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -3421,6 +3421,19 @@ declare class WebResourceResponse { */ getResponseData(): string; + /** + * Gets the response data. + * + * @returns { string | number | ArrayBuffer | Resource | undefined } Return the response data. + * string type indicate string in HTML format. + * number type indicate file handle. + * Resource type indicate $rawfile resource. + * ArrayBuffer type indicate binary data. + * @syscap SystemCapability.Web.Webview.Core + * @since 13 + */ + getResponseDataEx(): string | number | ArrayBuffer | Resource | undefined; + /** * Gets the response encoding. * @@ -3689,6 +3702,15 @@ declare class WebResourceResponse { * @since 12 */ setResponseIsReady(IsReady: boolean): void; + + /** + * Gets whether the response is ready. + * + * @returns { boolean } True indicates the response data is ready and false is not ready. + * @syscap SystemCapability.Web.Webview.Core + * @since 13 + */ + getResponseIsReady(): boolean; } /** @@ -7862,7 +7884,7 @@ declare class WebAttribute extends CommonMethod { * @returns { WebAttribute } * @syscap SystemCapability.Web.Webview.Core * @atomicservice - * @since 12 + * @since 14 */ forceDisplayScrollBar(enabled: boolean): WebAttribute; @@ -8526,6 +8548,16 @@ declare class WebAttribute extends CommonMethod { * @since 12 */ editMenuOptions(editMenu: EditMenuOptions): WebAttribute; + + /** + * Enable or disable haptic feedback. + * + * @param { boolean } enabled - Default value is true, set false to disable haptic feedback. + * @returns { WebAttribute } + * @syscap SystemCapability.Web.Webview.Core + * @since 13 + */ + enableHapticFeedback(enabled: boolean): WebAttribute; } /** @@ -8724,4 +8756,4 @@ declare interface NestedScrollOptionsExt { * @since 13 */ scrollLeft?: NestedScrollMode; -} \ No newline at end of file +} diff --git a/api/@internal/component/ets/xcomponent.d.ts b/api/@internal/component/ets/xcomponent.d.ts index 92473c4de..f3fe488df 100644 --- a/api/@internal/component/ets/xcomponent.d.ts +++ b/api/@internal/component/ets/xcomponent.d.ts @@ -431,6 +431,17 @@ declare class XComponentAttribute extends CommonMethod { * @since 12 */ enableAnalyzer(enable: boolean): XComponentAttribute; + + /** + * Enable privacy protection for XComponent. + * + * @param { boolean } isSecure + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + enableSecure(isSecure: boolean): XComponentAttribute; } /** diff --git a/api/@ohos.PiPWindow.d.ts b/api/@ohos.PiPWindow.d.ts index 50b2dd161..73286feda 100644 --- a/api/@ohos.PiPWindow.d.ts +++ b/api/@ohos.PiPWindow.d.ts @@ -20,7 +20,7 @@ import type BaseContext from './application/BaseContext'; import type { Callback } from './@ohos.base'; -import { NodeController } from '@kit.ArkUI'; +import { NodeController } from './arkui/NodeController'; import { typeNode } from './arkui/FrameNode'; /** diff --git a/api/@ohos.app.ability.InsightIntentContext.d.ts b/api/@ohos.app.ability.InsightIntentContext.d.ts index 2eb0286ed..94f9f0d66 100644 --- a/api/@ohos.app.ability.InsightIntentContext.d.ts +++ b/api/@ohos.app.ability.InsightIntentContext.d.ts @@ -40,7 +40,7 @@ export default class InsightIntentContext { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -51,7 +51,7 @@ export default class InsightIntentContext { * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. - * @throws { BusinessError } 16000061 - Can not start component belongs to other bundle. + * @throws { BusinessError } 16000061 - Operation not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly @@ -70,7 +70,7 @@ export default class InsightIntentContext { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -81,7 +81,7 @@ export default class InsightIntentContext { * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @throws { BusinessError } 16000055 - Installation-free timed out. - * @throws { BusinessError } 16000061 - Can not start component belongs to other bundle. + * @throws { BusinessError } 16000061 - Operation not supported. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly diff --git a/api/@ohos.app.ability.UIAbility.d.ts b/api/@ohos.app.ability.UIAbility.d.ts index 79bbbb9ad..6cbd74483 100644 --- a/api/@ohos.app.ability.UIAbility.d.ts +++ b/api/@ohos.app.ability.UIAbility.d.ts @@ -104,7 +104,7 @@ export interface Caller { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. * @throws { BusinessError } 16200001 - Caller released. The caller has been released. - * @throws { BusinessError } 16200002 - Callee invalid. The callee does not exist. + * @throws { BusinessError } 16200002 - The callee does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly @@ -121,7 +121,7 @@ export interface Caller { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. * @throws { BusinessError } 16200001 - Caller released. The caller has been released. - * @throws { BusinessError } 16200002 - Callee invalid. The callee does not exist. + * @throws { BusinessError } 16200002 - The callee does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly @@ -133,7 +133,7 @@ export interface Caller { * Register the generic component server Stub (stub) disconnect listening notification. * * @throws { BusinessError } 16200001 - Caller released. The caller has been released. - * @throws { BusinessError } 16200002 - Callee invalid. The callee does not exist. + * @throws { BusinessError } 16200002 - The callee does not exist. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly * @since 9 @@ -222,7 +222,7 @@ export interface Callee { * @param { CalleeCallback } callback - Register a callback function that listens for notification events. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16200004 - Method registered. The method has registered. + * @throws { BusinessError } 16200004 - The method has been registered. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly @@ -236,7 +236,7 @@ export interface Callee { * @param { string } method - A string registered to listen for notification events. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16200005 - Method not registered. The method has not registered. + * @throws { BusinessError } 16200005 - The method has not been registered. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly diff --git a/api/@ohos.app.ability.UIExtensionContentSession.d.ts b/api/@ohos.app.ability.UIExtensionContentSession.d.ts index 988299003..0849c7fc7 100644 --- a/api/@ohos.app.ability.UIExtensionContentSession.d.ts +++ b/api/@ohos.app.ability.UIExtensionContentSession.d.ts @@ -122,7 +122,7 @@ export default class UIExtensionContentSession { * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -158,7 +158,7 @@ export default class UIExtensionContentSession { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -194,7 +194,7 @@ export default class UIExtensionContentSession { * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -230,7 +230,7 @@ export default class UIExtensionContentSession { * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -266,7 +266,7 @@ export default class UIExtensionContentSession { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -302,7 +302,7 @@ export default class UIExtensionContentSession { * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -338,7 +338,7 @@ export default class UIExtensionContentSession { * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -374,7 +374,7 @@ export default class UIExtensionContentSession { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -410,7 +410,7 @@ export default class UIExtensionContentSession { * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -548,6 +548,7 @@ export default class UIExtensionContentSession { */ /** * Starts the UIAbility or UIExtensionAbility by type. + * If the caller application is in the background, it is not allowed to call this interface. * * @param { string } type - The type of target ability. * @param { Record } wantParam - Indicates the want parameter. @@ -586,6 +587,7 @@ export default class UIExtensionContentSession { */ /** * Starts the UIAbility or UIExtensionAbility by type. + * If the caller application is in the background, it is not allowed to call this interface. * * @param { string } type - The type of target ability. * @param { Record } wantParam - Indicates the want parameter. diff --git a/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts index d502327df..73ebf3af7 100644 --- a/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts +++ b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts @@ -21,6 +21,7 @@ import { AbilityDelegator as _AbilityDelegator } from './application/AbilityDelegator'; import { AbilityDelegatorArgs as _AbilityDelegatorArgs } from './application/abilityDelegatorArgs'; import { AbilityMonitor as _AbilityMonitor } from './application/AbilityMonitor'; +import { AbilityStageMonitor as _AbilityStageMonitor } from './application/AbilityStageMonitor'; import { ShellCmdResult as _ShellCmdResult } from './application/shellCmdResult'; /** @@ -334,6 +335,18 @@ declare namespace abilityDelegatorRegistry { * @since 11 */ export type ShellCmdResult = _ShellCmdResult; + + /** + * Provide methods for matching monitored AbilityStage objects that meet specified conditions. + * The most recently matched AbilityStage objects will be saved in the AbilityStageMonitor object. + * + * @typedef { _AbilityStageMonitor } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @crossplatform + * @atomicservice + * @since 14 + */ + export type AbilityStageMonitor = _AbilityStageMonitor; } export default abilityDelegatorRegistry; diff --git a/api/@ohos.app.ability.appManager.d.ts b/api/@ohos.app.ability.appManager.d.ts index 132458cf6..82943757f 100644 --- a/api/@ohos.app.ability.appManager.d.ts +++ b/api/@ohos.app.ability.appManager.d.ts @@ -979,7 +979,7 @@ declare namespace appManager { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. - * @throws { BusinessError } 18500001 - The bundle does not exist. + * @throws { BusinessError } 18500001 - The bundle does not exist or no patch has been applied. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly diff --git a/api/@ohos.app.ability.autoFillManager.d.ts b/api/@ohos.app.ability.autoFillManager.d.ts index 1edbe7fc6..b18eefefd 100644 --- a/api/@ohos.app.ability.autoFillManager.d.ts +++ b/api/@ohos.app.ability.autoFillManager.d.ts @@ -295,7 +295,7 @@ declare namespace autoFillManager { * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @systemapi * @stagemodelonly - * @since 12 + * @since 13 */ export type CustomData = _CustomData.default; diff --git a/api/@ohos.app.ability.autoStartupManager.d.ts b/api/@ohos.app.ability.autoStartupManager.d.ts index 94a697f0b..378143bb2 100644 --- a/api/@ohos.app.ability.autoStartupManager.d.ts +++ b/api/@ohos.app.ability.autoStartupManager.d.ts @@ -80,7 +80,7 @@ declare namespace autoStartupManager { * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameters types. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -101,7 +101,7 @@ declare namespace autoStartupManager { * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameters types. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -122,7 +122,7 @@ declare namespace autoStartupManager { * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameters types. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -143,7 +143,7 @@ declare namespace autoStartupManager { * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameters types. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000013 - The application is controlled by EDM. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core diff --git a/api/@ohos.app.ability.childProcessManager.d.ts b/api/@ohos.app.ability.childProcessManager.d.ts index 64d56eaad..1e5c9ca12 100644 --- a/api/@ohos.app.ability.childProcessManager.d.ts +++ b/api/@ohos.app.ability.childProcessManager.d.ts @@ -71,7 +71,7 @@ declare namespace childProcessManager { * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000061 - Operation not supported. - * @throws { BusinessError } 16000062 - The number of child process exceeds upper bound. + * @throws { BusinessError } 16000062 - The number of child processes exceeds the upper limit. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @stagemodelonly * @since 11 @@ -88,7 +88,7 @@ declare namespace childProcessManager { * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000061 - Operation not supported. - * @throws { BusinessError } 16000062 - The number of child process exceeds upper bound. + * @throws { BusinessError } 16000062 - The number of child processes exceeds the upper limit. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @stagemodelonly * @since 11 @@ -111,23 +111,38 @@ declare namespace childProcessManager { * @stagemodelonly * @since 12 */ + /** + * Start child process with the given args and options. + * + * @param { string } srcEntry - Indicates child process source file entrance to be started. + * @param { ChildProcessArgs } args - Indicates args to pass to child process. + * @param { ChildProcessOptions } [options] - Indicates options for starting child process. + * @returns { Promise } Returns the started child process pid. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000061 - Operation not supported. The API cannot be called in a child process. + * @throws { BusinessError } 16000062 - The number of child processes exceeds the upper limit. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 13 + */ function startArkChildProcess(srcEntry: string, args: ChildProcessArgs, options?: ChildProcessOptions): Promise; /** * Start native child process with the given args and options. * - * @permission ohos.permission.START_NATIVE_CHILD_PROCESS * @param { string } entryPoint - Indicates entry point of child process, consisting of library and entry function, such as "libEntry.so:Main". * @param { ChildProcessArgs } args - Indicates args to pass to child process. * @param { ChildProcessOptions } [options] - Indicates options for starting child process. * @returns { Promise } Returns the started child process pid. - * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000061 - Operation not supported. The API cannot be called in a child process. - * @throws { BusinessError } 16000062 - The number of native child process exceeds upper bound. + * @throws { BusinessError } 16000062 - The number of child processes exceeds the upper limit. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @stagemodelonly * @since 13 diff --git a/api/@ohos.app.ability.errorManager.d.ts b/api/@ohos.app.ability.errorManager.d.ts index 3da6610a5..1c23bfcfc 100644 --- a/api/@ohos.app.ability.errorManager.d.ts +++ b/api/@ohos.app.ability.errorManager.d.ts @@ -58,7 +58,7 @@ declare namespace errorManager { * @returns { number } Returns the number code of the observer. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16000003 - Id does not exist. + * @throws { BusinessError } 16000003 - The specified ID does not exist. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice * @since 11 @@ -85,7 +85,7 @@ declare namespace errorManager { * @param { AsyncCallback } callback - The callback of off. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16000003 - Id does not exist. + * @throws { BusinessError } 16000003 - The specified ID does not exist. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice * @since 11 @@ -112,7 +112,7 @@ declare namespace errorManager { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16000003 - Id does not exist. + * @throws { BusinessError } 16000003 - The specified ID does not exist. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice * @since 11 diff --git a/api/@ohos.app.ability.insightIntentDriver.d.ts b/api/@ohos.app.ability.insightIntentDriver.d.ts index 1d540a8d0..784f6329f 100644 --- a/api/@ohos.app.ability.insightIntentDriver.d.ts +++ b/api/@ohos.app.ability.insightIntentDriver.d.ts @@ -133,7 +133,7 @@ declare namespace insightIntentDriver { * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -166,7 +166,7 @@ declare namespace insightIntentDriver { * 2. Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. diff --git a/api/@ohos.app.ability.missionManager.d.ts b/api/@ohos.app.ability.missionManager.d.ts index 392a20091..d7a1be6b8 100644 --- a/api/@ohos.app.ability.missionManager.d.ts +++ b/api/@ohos.app.ability.missionManager.d.ts @@ -61,7 +61,7 @@ declare namespace missionManager { * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16300002 - Input error. The specified mission listener does not exist. + * @throws { BusinessError } 16300002 - The specified mission listener does not exist. * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @systemapi * @since 9 @@ -79,7 +79,7 @@ declare namespace missionManager { * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. - * @throws { BusinessError } 16300002 - Input error. The specified mission listener does not exist. + * @throws { BusinessError } 16300002 - The specified mission listener does not exist. * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @systemapi * @since 9 diff --git a/api/@ohos.app.ability.quickFixManager.d.ts b/api/@ohos.app.ability.quickFixManager.d.ts index be575642b..f7651669a 100644 --- a/api/@ohos.app.ability.quickFixManager.d.ts +++ b/api/@ohos.app.ability.quickFixManager.d.ts @@ -196,8 +196,8 @@ declare namespace quickFixManager { * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 18500001 - The bundle is not exist or no patch has applied. - * @throws { BusinessError } 18500009 - The application has a apply quick fix task that is being processed. + * @throws { BusinessError } 18500001 - The bundle does not exist or no patch has been applied. + * @throws { BusinessError } 18500009 - The application has an ongoing quick fix task. * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix * @systemapi * @since 10 @@ -214,8 +214,8 @@ declare namespace quickFixManager { * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 18500001 - The bundle is not exist or no patch has applied. - * @throws { BusinessError } 18500009 - The application has a apply quick fix task that is being processed. + * @throws { BusinessError } 18500001 - The bundle does not exist or no patch has been applied. + * @throws { BusinessError } 18500009 - The application has an ongoing quick fix task. * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix * @systemapi * @since 10 @@ -232,7 +232,7 @@ declare namespace quickFixManager { * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 18500001 - The specified bundleName is invalid. + * @throws { BusinessError } 18500001 - The bundle does not exist or no patch has been applied. * @throws { BusinessError } 18500008 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix * @systemapi @@ -250,7 +250,7 @@ declare namespace quickFixManager { * @throws { BusinessError } 202 - Not system application. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 18500001 - The specified bundleName is invalid. + * @throws { BusinessError } 18500001 - The bundle does not exist or no patch has been applied. * @throws { BusinessError } 18500008 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix * @systemapi diff --git a/api/@ohos.app.ability.wantAgent.d.ts b/api/@ohos.app.ability.wantAgent.d.ts index b7a814537..4ecb9dae9 100644 --- a/api/@ohos.app.ability.wantAgent.d.ts +++ b/api/@ohos.app.ability.wantAgent.d.ts @@ -60,7 +60,7 @@ declare namespace wantAgent { * @param { AsyncCallback } callback - The callback is used to return the bundle name. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice @@ -87,7 +87,7 @@ declare namespace wantAgent { * @returns { Promise } Returns the bundle name. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice @@ -114,7 +114,7 @@ declare namespace wantAgent { * @param { AsyncCallback } callback - The callback is used to return the UID. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice @@ -141,7 +141,7 @@ declare namespace wantAgent { * @returns { Promise } Returns the UID. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice @@ -156,7 +156,7 @@ declare namespace wantAgent { * @param { AsyncCallback } callback - The callback is used to return the Want. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000015 - Service timeout. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -172,7 +172,7 @@ declare namespace wantAgent { * @returns { Promise } Returns the Want. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000015 - Service timeout. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -200,7 +200,7 @@ declare namespace wantAgent { * @param { AsyncCallback } callback - The callback of cancel. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice @@ -227,7 +227,7 @@ declare namespace wantAgent { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice @@ -329,7 +329,7 @@ declare namespace wantAgent { * @param { AsyncCallback } callback - The callback is used to return the created WantAgent. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice @@ -356,7 +356,7 @@ declare namespace wantAgent { * @returns { Promise } Returns the created WantAgent. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice @@ -384,7 +384,7 @@ declare namespace wantAgent { * @param { AsyncCallback } callback - The callback is used to return the OperationType of the WantAgent. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000015 - Service timeout. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -413,7 +413,7 @@ declare namespace wantAgent { * @returns { Promise } Returns the OperationType of the WantAgent. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types. - * @throws { BusinessError } 16000007 - Service busy, there are concurrent tasks, waiting for retry. + * @throws { BusinessError } 16000007 - Service busy. There are concurrent tasks. Try again later. * @throws { BusinessError } 16000015 - Service timeout. * @throws { BusinessError } 16000151 - Invalid wantagent object. * @syscap SystemCapability.Ability.AbilityRuntime.Core diff --git a/api/@ohos.app.ability.wantConstant.d.ts b/api/@ohos.app.ability.wantConstant.d.ts index dee43cfa1..f9ffbb0b0 100644 --- a/api/@ohos.app.ability.wantConstant.d.ts +++ b/api/@ohos.app.ability.wantConstant.d.ts @@ -300,6 +300,22 @@ declare namespace wantConstant { * @since 12 */ SUB_PACKAGE_NAME = 'ohos.param.atomicservice.subpackageName', + + /** + * Indicates the param of app instance key. + * + * @syscap SystemCapability.Ability.AbilityBase + * @since 14 + */ + APP_INSTANCE_KEY = 'ohos.extra.param.key.appInstance', + + /** + * Indicates the param of creating a new instance. + * + * @syscap SystemCapability.Ability.AbilityBase + * @since 14 + */ + CREATE_APP_INSTANCE_KEY = 'ohos.extra.param.key.createAppInstance', } /** diff --git a/api/@ohos.application.uriPermissionManager.d.ts b/api/@ohos.application.uriPermissionManager.d.ts index 55296897b..cb78e7279 100644 --- a/api/@ohos.application.uriPermissionManager.d.ts +++ b/api/@ohos.application.uriPermissionManager.d.ts @@ -47,7 +47,7 @@ declare namespace uriPermissionManager { * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000058 - Invalid URI flag. * @throws { BusinessError } 16000059 - Invalid URI type. - * @throws { BusinessError } 16000060 - Sandbox application can not grant URI permission. + * @throws { BusinessError } 16000060 - A sandbox application cannot grant URI permission. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide this for inner system use. * @since 10 @@ -77,7 +77,7 @@ declare namespace uriPermissionManager { * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000058 - Invalid URI flag. * @throws { BusinessError } 16000059 - Invalid URI type. - * @throws { BusinessError } 16000060 - Sandbox application can not grant URI permission. + * @throws { BusinessError } 16000060 - A sandbox application cannot grant URI permission. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide this for inner system use. * @since 10 diff --git a/api/@ohos.arkui.UIContext.d.ts b/api/@ohos.arkui.UIContext.d.ts index 5c8b185a3..bed752411 100644 --- a/api/@ohos.arkui.UIContext.d.ts +++ b/api/@ohos.arkui.UIContext.d.ts @@ -2048,6 +2048,26 @@ export class SwiperDynamicSyncScene extends DynamicSyncScene { readonly type: SwiperDynamicSyncSceneType; } +/** + * Represents a dynamic synchronization scene of Marquee. + * + * @extends DynamicSyncScene + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +export class MarqueeDynamicSyncScene extends DynamicSyncScene { + /** + * Type of the MarqueeDynamicSyncSceneType. + * @type { MarqueeDynamicSyncSceneType } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + readonly type: MarqueeDynamicSyncSceneType; +} + /** * class DragController * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -2242,6 +2262,17 @@ export class FocusController { * @since 12 */ requestFocus(key: string): void; + + /** + * Activate focus style. + * @param { boolean } isActive - activate/deactivate the focus style. + * @param { boolean } [autoInactive] - deactivate the focus style when touch event or mouse event triggers, the default value is true. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + activate(isActive: boolean, autoInactive?: boolean): void; } /** @@ -3110,6 +3141,26 @@ export class UIContext { * @since 12 */ getWindowName(): string | undefined; + + /** + * Get the width breakpoint of current window. + * + * @returns { WidthBreakpoint } The width breakpoint of current window. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + getWindowWidthBreakpoint(): WidthBreakpoint; + + /** + * Get the height breakpoint of current window. + * + * @returns { HeightBreakpoint } The height breakpoint of current window. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + getWindowHeightBreakpoint(): HeightBreakpoint; /** * Open the BindSheet. @@ -3297,3 +3348,22 @@ export const enum SwiperDynamicSyncSceneType { */ ANIMATION = 1 } + +/** + * Enum of scene type for Marquee + * + * @enum { number } MarqueeDynamicSyncSceneType + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ +export const enum MarqueeDynamicSyncSceneType { + /** + * Scene type is ANIMATION. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + ANIMATION = 1 +} diff --git a/api/@ohos.arkui.advanced.Dialog.d.ets b/api/@ohos.arkui.advanced.Dialog.d.ets index 66bcd6733..6c854b97b 100644 --- a/api/@ohos.arkui.advanced.Dialog.d.ets +++ b/api/@ohos.arkui.advanced.Dialog.d.ets @@ -837,3 +837,61 @@ export declare struct CustomContentDialog { */ themeColorMode?: ThemeColorMode; } + +/** + * Declare struct PopoverDialog + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +@Component +export declare struct PopoverDialog { + /** + * Sets the PopoverDialog Visible Status. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + @Link + visible: boolean; + /** + * Sets the PopoverDialog options. + * + * @type { PopoverOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + @Require @Prop + popover: PopoverOptions; + /** + * Sets the targetBuilder content. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + @Require @BuilderParam + targetBuilder: Callback; +} + +/** + * Defines PopoverDialog Options + * + * @typedef PopoverOptions + * @extends CustomPopupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ +export declare interface PopoverOptions extends CustomPopupOptions { +} diff --git a/api/@ohos.arkui.advanced.SegmentButton.d.ets b/api/@ohos.arkui.advanced.SegmentButton.d.ets index 71a9ead28..236835421 100644 --- a/api/@ohos.arkui.advanced.SegmentButton.d.ets +++ b/api/@ohos.arkui.advanced.SegmentButton.d.ets @@ -59,6 +59,30 @@ interface SegmentButtonTextItem { * @since 12 */ text: ResourceStr; + + /** + * The accessibilityLevel of buttonItem. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; + + /** + * The accessibilityDescription of buttonItem. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; } /** @@ -98,6 +122,18 @@ interface SegmentButtonIconItem { */ icon: ResourceStr; + /** + * The accessibilityText of icon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + iconAccessibilityText?: ResourceStr; + /** * The icon of icon only item in the selected state. * @@ -116,6 +152,42 @@ interface SegmentButtonIconItem { * @since 12 */ selectedIcon: ResourceStr; + + /** + * The accessibilityText of selectedIcon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + selectedIconAccessibilityText?: ResourceStr; + + /** + * The accessibilityLevel of buttonItem. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; + + /** + * The accessibilityDescription of buttonItem. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; } /** @@ -155,6 +227,18 @@ interface SegmentButtonIconTextItem { */ icon: ResourceStr; + /** + * The accessibilityText of icon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + iconAccessibilityText?: ResourceStr; + /** * The icon of icon and text item in the selected state. * @@ -174,6 +258,18 @@ interface SegmentButtonIconTextItem { */ selectedIcon: ResourceStr; + /** + * The accessibilityText of selectedIcon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + selectedIconAccessibilityText?: ResourceStr; + /** * The text of icon and text item. * @@ -192,6 +288,30 @@ interface SegmentButtonIconTextItem { * @since 12 */ text: ResourceStr; + + /** + * The accessibilityLevel of buttonItem. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; + + /** + * The accessibilityDescription of buttonItem. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; } /** @@ -780,6 +900,18 @@ interface SegmentButtonItemOptionsConstructorOptions { */ icon?: ResourceStr; + /** + * The accessibilityText of icon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + iconAccessibilityText?: ResourceStr; + /** * The icon of icon and text item in the selected state. * @@ -799,6 +931,18 @@ interface SegmentButtonItemOptionsConstructorOptions { */ selectedIcon?: ResourceStr; + /** + * The accessibilityText of selectedIcon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + selectedIconAccessibilityText?: ResourceStr; + /** * The text of icon and text item. * @@ -817,6 +961,30 @@ interface SegmentButtonItemOptionsConstructorOptions { * @since 12 */ text?: ResourceStr; + + /** + * The accessibilityLevel of buttonItem. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; + + /** + * The accessibilityDescription of buttonItem. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; } /** @@ -855,6 +1023,18 @@ declare class SegmentButtonItemOptions { */ icon?: ResourceStr; + /** + * The accessibilityText of icon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + iconAccessibilityText?: ResourceStr; + /** * The icon of selected item. * @@ -874,6 +1054,18 @@ declare class SegmentButtonItemOptions { */ selectedIcon?: ResourceStr; + /** + * The accessibilityText of selectedIcon. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + selectedIconAccessibilityText?: ResourceStr; + /** * The text of item. * @@ -893,6 +1085,30 @@ declare class SegmentButtonItemOptions { */ text?: ResourceStr; + /** + * The accessibilityLevel of buttonItem. + * + * @type { ?string } + * @default "auto" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityLevel?: string; + + /** + * The accessibilityDescription of buttonItem. + * + * @type { ?ResourceStr } + * @default "" + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + accessibilityDescription?: ResourceStr; + /** * The constructor used to create a SegmentButtonOptionsArray object. * @@ -1535,6 +1751,17 @@ declare struct SegmentButton { */ @Link selectedIndexes: number[]; + + /** + * The click event callback will be triggered when a option button of SegmentButton is clicked. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + onItemClicked?: Callback; } export { diff --git a/api/@ohos.arkui.modifier.d.ts b/api/@ohos.arkui.modifier.d.ts index 4490cd0ae..fe8d49b3c 100644 --- a/api/@ohos.arkui.modifier.d.ts +++ b/api/@ohos.arkui.modifier.d.ts @@ -120,6 +120,7 @@ export { DividerModifier } from './arkui/DividerModifier'; /** * Export FormComponentModifier, which is used to expose applyNormalAttribute function. * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi * @crossplatform * @since 12 */ diff --git a/api/@ohos.arkui.uiExtension.d.ts b/api/@ohos.arkui.uiExtension.d.ts index 3d9d62cc4..e34deb058 100644 --- a/api/@ohos.arkui.uiExtension.d.ts +++ b/api/@ohos.arkui.uiExtension.d.ts @@ -117,13 +117,20 @@ declare namespace uiExtension { /** * Hide the non-secure windows. + * When called by modal UIExtension and shouldHide == false, the "ohos.permission.ALLOW_SHOW_NON_SECURE_WINDOWS" permission is required. * + * @permission ohos.permission.ALLOW_SHOW_NON_SECURE_WINDOWS * @param { boolean } shouldHide - Hide the non-secure windows if true, otherwise means the opposite. * @returns { Promise } - The promise returned by the function. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. + * @throws { BusinessError } 1300002 - Abnormal state. Possible causes: + *
1. Permission denied. Interface caller does not have permission "ohos.permission.ALLOW_SHOW_NON_SECURE_WINDOWS". + *
2. The UIExtension window proxy is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi * @since 12 diff --git a/api/@ohos.atomicservice.NavPushPathHelper.d.ets b/api/@ohos.atomicservice.NavPushPathHelper.d.ets index d4a759167..fb559885e 100644 --- a/api/@ohos.atomicservice.NavPushPathHelper.d.ets +++ b/api/@ohos.atomicservice.NavPushPathHelper.d.ets @@ -111,7 +111,7 @@ export declare class NavPushPathHelper { * * @param { string } moduleName - Module name * @param { string } name - Indicates the name of the route page to be pushed. - * @param { unknown } param - Indicates the detailed parameter of the route page to be pushed. + * @param { Object } param - Indicates the detailed parameter of the route page to be pushed. * @param { boolean } [animated] - Indicates whether the transition is animated. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 300001 - hsp silent install fail. @@ -119,7 +119,7 @@ export declare class NavPushPathHelper { * @atomicservice * @since 12 */ - pushPathByName(moduleName: string, name: string, param: unknown, animated?: boolean): Promise; + pushPathByName(moduleName: string, name: string, param: Object, animated?: boolean): Promise; /** * Pushes the specified route page into the stack. diff --git a/api/@ohos.bluetooth.a2dp.d.ts b/api/@ohos.bluetooth.a2dp.d.ts index 68660ecb8..3f5b8ca4e 100644 --- a/api/@ohos.bluetooth.a2dp.d.ts +++ b/api/@ohos.bluetooth.a2dp.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 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 @@ -28,6 +28,14 @@ import type baseProfile from './@ohos.bluetooth.baseProfile'; * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ +/** + * Provides methods to accessing bluetooth audio related capabilities. + * + * @namespace a2dp + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ declare namespace a2dp { /** * Base interface of profile. @@ -48,6 +56,17 @@ declare namespace a2dp { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * create the instance of a2dp profile. + * + * @returns { A2dpSourceProfile } Returns the instance of profile. + * @throws { BusinessError } 401 - Invalid parameter.Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function createA2dpSrcProfile(): A2dpSourceProfile; /** @@ -57,6 +76,14 @@ declare namespace a2dp { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Manager a2dp source profile. + * + * @typedef A2dpSourceProfile + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ interface A2dpSourceProfile extends BaseProfile { /** * Initiate an A2DP connection to a remote device. @@ -481,7 +508,21 @@ declare namespace a2dp { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ - CODEC_TYPE_L2HC = 2 + CODEC_TYPE_L2HC = 2, + /** + * L2HCST. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 13 + */ + CODEC_TYPE_L2HCST = 3, + /** + * LDAC. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 13 + */ + CODEC_TYPE_LDAC = 4 } /** diff --git a/api/@ohos.bluetooth.access.d.ts b/api/@ohos.bluetooth.access.d.ts index ecc92c579..4b331936c 100644 --- a/api/@ohos.bluetooth.access.d.ts +++ b/api/@ohos.bluetooth.access.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 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 @@ -35,6 +35,15 @@ import type { AsyncCallback, Callback } from './@ohos.base'; * @atomicservice * @since 11 */ +/** + * Provides methods for enabling/disabling bluetooth or monitoring bluetooth state. + * + * @namespace access + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ declare namespace access { /** * Enables Bluetooth on a device. @@ -59,6 +68,19 @@ declare namespace access { * @atomicservice * @since 12 */ + /** + * Enables Bluetooth on a device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function enableBluetooth(): void; /** @@ -84,6 +106,19 @@ declare namespace access { * @atomicservice * @since 12 */ + /** + * Disables Bluetooth on a device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function disableBluetooth(): void; /** @@ -127,6 +162,20 @@ declare namespace access { * @atomicservice * @since 11 */ + /** + * Obtains the Bluetooth status of a device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @returns { BluetoothState } Returns the Bluetooth status. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function getState(): BluetoothState; /** @@ -208,6 +257,22 @@ declare namespace access { * @atomicservice * @since 12 */ + /** + * Subscribe the event reported when the Bluetooth state changes. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for. + * @param { Callback } callback - Callback used to listen for the Bluetooth state event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function on(type: 'stateChange', callback: Callback): void; /** @@ -239,6 +304,22 @@ declare namespace access { * @atomicservice * @since 12 */ + /** + * Unsubscribe the event reported when the Bluetooth state changes. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for. + * @param { Callback } callback - Callback used to listen for the Bluetooth state event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function off(type: 'stateChange', callback?: Callback): void; /** @@ -256,6 +337,15 @@ declare namespace access { * @atomicservice * @since 11 */ + /** + * The enum of bluetooth state. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ export enum BluetoothState { /** * Indicates the local Bluetooth is off @@ -270,6 +360,14 @@ declare namespace access { * @atomicservice * @since 11 */ + /** + * Indicates the local Bluetooth is off + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ STATE_OFF = 0, /** * Indicates the local Bluetooth is turning on @@ -284,6 +382,14 @@ declare namespace access { * @atomicservice * @since 11 */ + /** + * Indicates the local Bluetooth is turning on + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ STATE_TURNING_ON = 1, /** * Indicates the local Bluetooth is on, and ready for use @@ -298,6 +404,14 @@ declare namespace access { * @atomicservice * @since 11 */ + /** + * Indicates the local Bluetooth is on, and ready for use + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ STATE_ON = 2, /** * Indicates the local Bluetooth is turning off @@ -312,6 +426,14 @@ declare namespace access { * @atomicservice * @since 11 */ + /** + * Indicates the local Bluetooth is turning off + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ STATE_TURNING_OFF = 3, /** * Indicates the local Bluetooth is turning LE mode on diff --git a/api/@ohos.bluetooth.baseProfile.d.ts b/api/@ohos.bluetooth.baseProfile.d.ts index 7393ae584..5034765d5 100644 --- a/api/@ohos.bluetooth.baseProfile.d.ts +++ b/api/@ohos.bluetooth.baseProfile.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 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 @@ -28,6 +28,14 @@ import type constant from './@ohos.bluetooth.constant'; * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ +/** + * Provides basic profile methods. + * + * @namespace baseProfile + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ declare namespace baseProfile { /** * Indicate the profile connection state. @@ -36,6 +44,14 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Indicate the profile connection state. + * + * @typedef { constant.ProfileConnectionState } ProfileConnectionState + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ type ProfileConnectionState = constant.ProfileConnectionState; /** @@ -80,6 +96,14 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Enum for cause of disconnect. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ enum DisconnectCause { /** * User disconnect device. @@ -87,6 +111,13 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * User disconnect device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ USER_DISCONNECT = 0, /** * The connection needs to be initiated from the keyboard side. @@ -132,6 +163,14 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Profile state change parameters. + * + * @typedef StateChangeParam + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ export interface StateChangeParam { /** * The address of device @@ -140,6 +179,14 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * The address of device + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ deviceId: string; /** @@ -149,6 +196,14 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Profile state value + * + * @type { ProfileConnectionState } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ state: ProfileConnectionState; /** @@ -158,6 +213,14 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Cause of disconnect + * + * @type { DisconnectCause } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ cause: DisconnectCause; } @@ -168,6 +231,14 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Base interface of profile. + * + * @typedef BaseProfile + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ export interface BaseProfile { /** * Set connection strategy of this profile. @@ -269,6 +340,21 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Obtains the connected devices list of profile. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @returns { Array } Returns the address of connected devices list. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900004 - Profile not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ getConnectedDevices(): Array; /** @@ -288,6 +374,24 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Obtains the profile connection state. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @returns { ProfileConnectionState } Returns the connection state. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900004 - Profile not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ getConnectionState(deviceId: string): ProfileConnectionState; /** @@ -303,6 +407,20 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Subscribe the event reported when the profile connection state changes . + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'connectionStateChange' } type - Type of the profile connection state changes event to listen for. + * @param { Callback } callback - Callback used to listen for event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ on(type: 'connectionStateChange', callback: Callback): void; /** @@ -318,6 +436,20 @@ declare namespace baseProfile { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Unsubscribe the event reported when the profile connection state changes . + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'connectionStateChange' } type - Type of the profile connection state changes event to listen for. + * @param { Callback } callback - Callback used to listen for event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ off(type: 'connectionStateChange', callback?: Callback): void; } } diff --git a/api/@ohos.bluetooth.ble.d.ts b/api/@ohos.bluetooth.ble.d.ts index 2579f91ba..982acc302 100644 --- a/api/@ohos.bluetooth.ble.d.ts +++ b/api/@ohos.bluetooth.ble.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 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 @@ -36,6 +36,15 @@ import type constant from './@ohos.bluetooth.constant'; * @atomicservice * @since 12 */ +/** + * Provides methods to operate or manage Bluetooth. + * + * @namespace ble + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ declare namespace ble { /** * Indicate the profile connection state. @@ -51,6 +60,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicate the profile connection state. + * + * @typedef { constant.ProfileConnectionState } ProfileConnectionState + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ type ProfileConnectionState = constant.ProfileConnectionState; /** @@ -68,6 +86,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * create a Gatt server instance. + * + * @returns { GattServer } Returns a Gatt server instance {@code GattServer}. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function createGattServer(): GattServer; /** @@ -93,6 +120,19 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * create a Gatt client device instance. + * + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @returns { GattClientDevice } Returns a Gatt client device instance {@code GattClientDevice}. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function createGattClientDevice(deviceId: string): GattClientDevice; /** @@ -108,6 +148,20 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Obtains the list of devices in the connected status. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @returns { Array } Returns the list of device address. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function getConnectedBLEDevices(): Array; /** @@ -150,6 +204,28 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Starts scanning for specified BLE devices with filters. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { Array } filters - Indicates the list of filters used to filter out specified devices. + * If you do not want to use filter, set this parameter to {@code null}. + * @param { ScanOptions } options - Indicates the parameters for scanning and if the user does not assign a value, the default value will be used. + * {@link ScanOptions#interval} set to 0, {@link ScanOptions#dutyMode} set to {@link SCAN_MODE_LOW_POWER} + * and {@link ScanOptions#matchMode} set to {@link MATCH_MODE_AGGRESSIVE}. + * and {@link ScanOptions#phyType} set to {@link PHY_LE_ALL_SUPPORTED}. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function startBLEScan(filters: Array, options?: ScanOptions): void; /** @@ -177,6 +253,20 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Stops BLE scanning. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function stopBLEScan(): void; /** @@ -214,6 +304,25 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Starts BLE advertising. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { AdvertiseSetting } setting - Indicates the settings for BLE advertising. + * @param { AdvertiseData } advData - Indicates the advertising data. + * @param { AdvertiseData } advResponse - Indicates the scan response associated with the advertising data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; /** @@ -241,6 +350,20 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Stops BLE advertising. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function stopAdvertising(): void; /** @@ -262,6 +385,26 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Starts BLE advertising. + * The API returns a advertising ID. The ID can be used to temporarily enable or disable this advertising + * using the API {@link enableAdvertising} or {@link disableAdvertising}. + * To completely stop the advertising corresponding to the ID, invoke the API {@link stopAdvertising} with ID. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { AdvertisingParams } advertisingParams - Indicates the params for BLE advertising. + * @param { AsyncCallback } callback - the callback of advertise ID. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function startAdvertising(advertisingParams: AdvertisingParams, callback: AsyncCallback): void; /** @@ -283,6 +426,26 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Starts BLE advertising. + * The API returns a advertising ID. The ID can be used to temporarily enable or disable this advertising + * using the API {@link enableAdvertising} or {@link disableAdvertising}. + * To completely stop the advertising corresponding to the ID, invoke the API {@link stopAdvertising} with ID. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { AdvertisingParams } advertisingParams - Indicates the param for BLE advertising. + * @returns { Promise } Returns the promise object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function startAdvertising(advertisingParams: AdvertisingParams): Promise; /** @@ -374,6 +537,24 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Stops BLE advertising. + * Completely stop the advertising corresponding to the ID. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { number } advertisingId - Indicates the ID for this BLE advertising. + * @param { AsyncCallback } callback - the callback result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function stopAdvertising(advertisingId: number, callback: AsyncCallback): void; /** @@ -393,6 +574,24 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Stops BLE advertising. + * Completely stop the advertising corresponding to the ID. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { number } advertisingId - Indicates the ID for this BLE advertising. + * @returns { Promise } Returns the promise object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function stopAdvertising(advertisingId: number): Promise; /** @@ -409,6 +608,21 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Subscribing to advertising state change event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'advertisingStateChange' } type - Type of the advertising state to listen for. + * @param { Callback } callback - Callback used to listen for the advertising state. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function on(type: 'advertisingStateChange', callback: Callback): void; /** @@ -425,6 +639,21 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Unsubscribe from advertising state change event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'advertisingStateChange' } type - Type of the advertising state to listen for. + * @param { Callback } callback - Callback used to listen for the advertising state. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function off(type: 'advertisingStateChange', callback?: Callback): void; /** @@ -456,6 +685,22 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Subscribe BLE scan result. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'BLEDeviceFind' } type - Type of the scan result event to listen for. + * @param { Callback> } callback - Callback used to listen for the scan result event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function on(type: 'BLEDeviceFind', callback: Callback>): void; /** @@ -487,6 +732,22 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Unsubscribe BLE scan result. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'BLEDeviceFind' } type - Type of the scan result event to listen for. + * @param { Callback> } callback - Callback used to listen for the scan result event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function off(type: 'BLEDeviceFind', callback?: Callback>): void; /** @@ -504,6 +765,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Manages GATT server. Before calling an Gatt server method, you must use {@link createGattServer} to create an GattServer instance. + * + * @typedef GattServer + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface GattServer { /** * Adds a specified service to be hosted. @@ -538,6 +808,24 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Adds a specified service to be hosted. + *

The added service and its characteristics are provided by the local device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { GattService } service - Indicates the service to add. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ addService(service: GattService): void; /** @@ -573,6 +861,24 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Removes a specified service from the list of GATT services provided by this device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } serviceUuid - Indicates the UUID of the service to remove. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900004 - Profile not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ removeService(serviceUuid: string): void; /** @@ -600,6 +906,20 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Closes this {@code GattServer} object and unregisters its callbacks. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ close(): void; /** @@ -639,6 +959,26 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Sends a notification of a change in a specified local characteristic with a asynchronous callback. + *

This method should be called for every BLE peripheral device that has requested notifications. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @param { NotifyCharacteristic } notifyCharacteristic - Indicates the local characteristic that has changed. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ notifyCharacteristicChanged( deviceId: string, notifyCharacteristic: NotifyCharacteristic, @@ -682,6 +1022,26 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Sends a notification of a change in a specified local characteristic with a asynchronous callback. + *

This method should be called for every BLE peripheral device that has requested notifications. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @param { NotifyCharacteristic } notifyCharacteristic - Indicates the local characteristic that has changed. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): Promise; /** @@ -715,6 +1075,23 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Sends a response to a specified read or write request to a given BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { ServerResponse } serverResponse - Indicates the response parameters {@link ServerResponse}. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ sendResponse(serverResponse: ServerResponse): void; /** @@ -744,6 +1121,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Subscribe characteristic read event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'characteristicRead' } type - Type of the characteristic read event to listen for. + * @param { Callback } callback - Callback used to listen for the characteristic read event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ on(type: 'characteristicRead', callback: Callback): void; /** @@ -773,6 +1165,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Unsubscribe characteristic read event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'characteristicRead' } type - Type of the characteristic read event to listen for. + * @param { Callback } callback - Callback used to listen for the characteristic read event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ off(type: 'characteristicRead', callback?: Callback): void; /** @@ -802,6 +1209,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Subscribe characteristic write event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'characteristicWrite' } type - Type of the characteristic write event to listen for. + * @param { Callback } callback - Callback used to listen for the characteristic write event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ on(type: 'characteristicWrite', callback: Callback): void; /** @@ -831,6 +1253,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Unsubscribe characteristic write event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'characteristicWrite' } type - Type of the characteristic write event to listen for. + * @param { Callback } callback - Callback used to listen for the characteristic write event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ off(type: 'characteristicWrite', callback?: Callback): void; /** @@ -860,6 +1297,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Subscribe descriptor read event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'descriptorRead' } type - Type of the descriptor read event to listen for. + * @param { Callback } callback - Callback used to listen for the descriptor read event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ on(type: 'descriptorRead', callback: Callback): void; /** @@ -889,6 +1341,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Unsubscribe descriptor read event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'descriptorRead' } type - Type of the descriptor read event to listen for. + * @param { Callback } callback - Callback used to listen for the descriptor read event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ off(type: 'descriptorRead', callback?: Callback): void; /** @@ -918,6 +1385,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Subscribe descriptor write event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'descriptorWrite' } type - Type of the descriptor write event to listen for. + * @param { Callback } callback - Callback used to listen for the descriptor write event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ on(type: 'descriptorWrite', callback: Callback): void; /** @@ -947,6 +1429,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Unsubscribe descriptor write event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'descriptorWrite' } type - Type of the descriptor write event to listen for. + * @param { Callback } callback - Callback used to listen for the descriptor write event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ off(type: 'descriptorWrite', callback?: Callback): void; /** @@ -976,6 +1473,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Subscribe server connection state changed event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'connectionStateChange' } type - Type of the connection state changed event to listen for. + * @param { Callback } callback - Callback used to listen for the connection state changed event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ on(type: 'connectionStateChange', callback: Callback): void; /** @@ -1005,6 +1517,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Unsubscribe server connection state changed event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'connectionStateChange' } type - Type of the connection state changed event to listen for. + * @param { Callback } callback - Callback used to listen for the connection state changed event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ off(type: 'connectionStateChange', callback?: Callback): void; /** @@ -1020,6 +1547,20 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Subscribe mtu changed event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for. + * @param { Callback } callback - Callback used to listen for the mtu changed event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ on(type: 'BLEMtuChange', callback: Callback): void; /** @@ -1035,6 +1576,20 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Unsubscribe mtu changed event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for. + * @param { Callback } callback - Callback used to listen for the mtu changed event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ off(type: 'BLEMtuChange', callback?: Callback): void; } @@ -1053,6 +1608,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Manages GATT client. Before calling an Gatt client method, you must use {@link createGattClientDevice} to create an GattClientDevice instance. + * + * @typedef GattClientDevice + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface GattClientDevice { /** * Connects to a BLE peripheral device. @@ -1081,6 +1645,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Connects to a BLE peripheral device. + *

The 'BLEConnectionStateChange' event is subscribed to return the connection state. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ connect(): void; /** @@ -1108,6 +1687,20 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Disconnects from or stops an ongoing connection to a BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ disconnect(): void; /** @@ -1137,6 +1730,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Disables a BLE peripheral device. + *

This method unregisters the device and clears the registered callbacks and handles. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ close(): void; /** @@ -1168,6 +1776,22 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Obtains the name of BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { AsyncCallback } callback - Callback used to obtain the device name. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ getDeviceName(callback: AsyncCallback): void; /** @@ -1199,6 +1823,22 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Obtains the name of BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @returns { Promise } Returns a string representation of the name if obtained; + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter.Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ getDeviceName(): Promise; /** @@ -1230,6 +1870,22 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Starts discovering services. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { AsyncCallback> } callback - Callback used to catch the services. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ getServices(callback: AsyncCallback>): void; /** @@ -1261,6 +1917,22 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Starts discovering services. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @returns { Promise> } Returns the list of services {@link GattService} of the BLE peripheral device. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ getServices(): Promise>; /** @@ -1296,6 +1968,24 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Reads the characteristic of a BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { BLECharacteristic } characteristic - Indicates the characteristic to read. + * @param { AsyncCallback } callback - Callback invoked to return the characteristic value read. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2901000 - Read forbidden. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback): void; /** @@ -1331,6 +2021,24 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Reads the characteristic of a BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { BLECharacteristic } characteristic - Indicates the characteristic to read. + * @returns { Promise } - Promise used to return the characteristic value read. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2901000 - Read forbidden. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ readCharacteristicValue(characteristic: BLECharacteristic): Promise; /** @@ -1366,6 +2074,24 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Reads the descriptor of a BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { BLEDescriptor } descriptor - Indicates the descriptor to read. + * @param { AsyncCallback } callback - Callback invoked to return the descriptor read. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2901000 - Read forbidden. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback): void; /** @@ -1401,6 +2127,24 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Reads the descriptor of a BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { BLEDescriptor } descriptor - Indicates the descriptor to read. + * @returns { Promise } - Promise used to return the descriptor read. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2901000 - Read forbidden. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ readDescriptorValue(descriptor: BLEDescriptor): Promise; /** @@ -1438,6 +2182,25 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Writes the characteristic of a BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { BLECharacteristic } characteristic - Indicates the characteristic to write. + * @param { GattWriteType } writeType - Write type of the characteristic. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2901001 - Write forbidden. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ writeCharacteristicValue( characteristic: BLECharacteristic, writeType: GattWriteType, @@ -1479,6 +2242,25 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Writes the characteristic of a BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { BLECharacteristic } characteristic - Indicates the characteristic to write. + * @param { GattWriteType } writeType - Write type of the characteristic. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2901001 - Write forbidden. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ writeCharacteristicValue(characteristic: BLECharacteristic, writeType: GattWriteType): Promise; /** @@ -1514,6 +2296,24 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Writes the descriptor of a BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { BLEDescriptor } descriptor - Indicates the descriptor to write. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2901001 - Write forbidden. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ writeDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback): void; /** @@ -1549,6 +2349,24 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Writes the descriptor of a BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { BLEDescriptor } descriptor - Indicates the descriptor to write. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2901001 - Write forbidden. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ writeDescriptorValue(descriptor: BLEDescriptor): Promise; /** @@ -1638,6 +2456,22 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Set the mtu size of a BLE peripheral device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { number } mtu - The maximum transmission unit. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ setBLEMtuSize(mtu: number): void; /** @@ -1881,6 +2715,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Subscribe client connection state changed event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'BLEConnectionStateChange' } type - Type of the connection state changed event to listen for. + * @param { Callback } callback - Callback used to listen for the connection state changed event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ on(type: 'BLEConnectionStateChange', callback: Callback): void; /** @@ -1910,6 +2759,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Unsubscribe client connection state changed event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'BLEConnectionStateChange' } type - Type of the connection state changed event to listen for. + * @param { Callback } callback - Callback used to listen for the connection state changed event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ off(type: 'BLEConnectionStateChange', callback?: Callback): void; /** @@ -1939,6 +2803,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Subscribe mtu changed event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for. + * @param { Callback } callback - Callback used to listen for the mtu changed event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ on(type: 'BLEMtuChange', callback: Callback): void; /** @@ -1968,6 +2847,21 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Unsubscribe mtu changed event. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for. + * @param { Callback } callback - Callback used to listen for the mtu changed event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ off(type: 'BLEMtuChange', callback?: Callback): void; } @@ -1986,6 +2880,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the Gatt service. + * + * @typedef GattService + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface GattService { /** * The UUID of a GattService instance @@ -2002,6 +2905,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of a GattService instance + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuid: string; /** * Indicates whether the GattService instance is primary or secondary. @@ -2018,6 +2930,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates whether the GattService instance is primary or secondary. + * + * @type { boolean } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ isPrimary: boolean; /** * The {@link BLECharacteristic} list belongs to this GattService instance @@ -2034,6 +2955,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The {@link BLECharacteristic} list belongs to this GattService instance + * + * @type { Array } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ characteristics: Array; /** * The list of GATT services contained in the service @@ -2068,6 +2998,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the Gatt characteristic. + * + * @typedef BLECharacteristic + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface BLECharacteristic { /** * The UUID of the {@link GattService} instance to which the characteristic belongs @@ -2084,6 +3023,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of the {@link GattService} instance to which the characteristic belongs + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuid: string; /** * The UUID of a BLECharacteristic instance @@ -2100,6 +3048,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of a BLECharacteristic instance + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ characteristicUuid: string; /** * The value of a BLECharacteristic instance @@ -2116,6 +3073,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The value of a BLECharacteristic instance + * + * @type { ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ characteristicValue: ArrayBuffer; /** * The list of {@link BLEDescriptor} contained in the characteristic @@ -2132,6 +3098,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The list of {@link BLEDescriptor} contained in the characteristic + * + * @type { Array } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ descriptors: Array; /** * The properties of a BLECharacteristic instance @@ -2148,6 +3123,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The properties of a BLECharacteristic instance + * + * @type { ?GattProperties } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ properties?: GattProperties; } @@ -2166,6 +3150,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the Gatt descriptor. + * + * @typedef BLEDescriptor + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface BLEDescriptor { /** * The UUID of the {@link GattService} instance to which the descriptor belongs @@ -2182,6 +3175,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of the {@link GattService} instance to which the descriptor belongs + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuid: string; /** * The UUID of the {@link BLECharacteristic} instance to which the descriptor belongs @@ -2198,6 +3200,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of the {@link BLECharacteristic} instance to which the descriptor belongs + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ characteristicUuid: string; /** * The UUID of the BLEDescriptor instance @@ -2214,6 +3225,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of the BLEDescriptor instance + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ descriptorUuid: string; /** * The value of the BLEDescriptor instance @@ -2230,6 +3250,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The value of the BLEDescriptor instance + * + * @type { ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ descriptorValue: ArrayBuffer; } @@ -2248,6 +3277,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the value of the indication or notification sent by the Gatt server. + * + * @typedef NotifyCharacteristic + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface NotifyCharacteristic { /** * The UUID of the {@link GattService} instance to which the characteristic belongs @@ -2264,6 +3302,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of the {@link GattService} instance to which the characteristic belongs + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuid: string; /** * The UUID of a NotifyCharacteristic instance @@ -2280,6 +3327,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of a NotifyCharacteristic instance + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ characteristicUuid: string; /** * The value of a NotifyCharacteristic instance @@ -2296,6 +3352,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The value of a NotifyCharacteristic instance + * + * @type { ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ characteristicValue: ArrayBuffer; /** * Specifies whether to request confirmation from the BLE peripheral device (indication) or @@ -2332,6 +3397,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the parameters of the Gatt client's characteristic read request. + * + * @typedef CharacteristicReadRequest + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface CharacteristicReadRequest { /** * Indicates the address of the client that initiates the read request @@ -2348,6 +3422,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the address of the client that initiates the read request + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ deviceId: string; /** * The Id of the read request @@ -2364,6 +3447,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The Id of the read request + * + * @type { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ transId: number; /** * Indicates the byte offset of the start position for reading characteristic value @@ -2396,6 +3488,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of a CharacteristicReadRequest instance + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ characteristicUuid: string; /** * The UUID of the service to which the characteristic belongs @@ -2412,6 +3513,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of the service to which the characteristic belongs + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuid: string; } @@ -2430,6 +3540,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the parameters of the of the Gatt client's characteristic write request. + * + * @typedef CharacteristicWriteRequest + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface CharacteristicWriteRequest { /** * Indicates the address of the client that initiates the write request @@ -2446,6 +3565,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the address of the client that initiates the write request + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ deviceId: string; /** * The Id of the write request @@ -2462,6 +3590,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The Id of the write request + * + * @type { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ transId: number; /** * Indicates the byte offset of the start position for writing characteristic value @@ -2526,6 +3663,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the value to be written + * + * @type { ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ value: ArrayBuffer; /** * The UUID of a CharacteristicWriteRequest instance @@ -2542,6 +3688,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of a CharacteristicWriteRequest instance + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ characteristicUuid: string; /** * The UUID of the service to which the characteristic belongs @@ -2558,6 +3713,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of the service to which the characteristic belongs + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuid: string; } @@ -2576,6 +3740,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the parameters of the Gatt client's descriptor read request. + * + * @typedef DescriptorReadRequest + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface DescriptorReadRequest { /** * Indicates the address of the client that initiates the read request @@ -2592,6 +3765,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the address of the client that initiates the read request + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ deviceId: string; /** * The Id of the read request @@ -2608,6 +3790,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The Id of the read request + * + * @type { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ transId: number; /** * Indicates the byte offset of the start position for reading characteristic value @@ -2640,6 +3831,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of a DescriptorReadRequest instance + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ descriptorUuid: string; /** * The UUID of the characteristic to which the descriptor belongs @@ -2656,6 +3856,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of the characteristic to which the descriptor belongs + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ characteristicUuid: string; /** * The UUID of the service to which the descriptor belongs @@ -2672,6 +3881,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of the service to which the descriptor belongs + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuid: string; } @@ -2690,6 +3908,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the parameters of the Gatt client's characteristic write request. + * + * @typedef DescriptorWriteRequest + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface DescriptorWriteRequest { /** * Indicates the address of the client that initiates the write request @@ -2706,6 +3933,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the address of the client that initiates the write request + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ deviceId: string; /** * The Id of the write request @@ -2722,6 +3958,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The Id of the write request + * + * @type { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ transId: number; /** * Indicates the byte offset of the start position for writing characteristic value @@ -2786,6 +4031,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the value to be written + * + * @type { ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ value: ArrayBuffer; /** * The UUID of a DescriptorWriteRequest instance @@ -2802,6 +4056,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of a DescriptorWriteRequest instance + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ descriptorUuid: string; /** * The UUID of the characteristic to which the descriptor belongs @@ -2818,6 +4081,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of the characteristic to which the descriptor belongs + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ characteristicUuid: string; /** * The UUID of the service to which the descriptor belongs @@ -2834,6 +4106,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The UUID of the service to which the descriptor belongs + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuid: string; } @@ -2852,6 +4133,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the parameters of a response send by the server to a specified read or write request. + * + * @typedef ServerResponse + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface ServerResponse { /** * Indicates the address of the client to which to send the response @@ -2868,6 +4158,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the address of the client to which to send the response + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ deviceId: string; /** * The Id of the write request @@ -2884,6 +4183,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The Id of the write request + * + * @type { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ transId: number; /** * Indicates the status of the read or write request, set this parameter to '0' in normal cases @@ -2900,6 +4208,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the status of the read or write request, set this parameter to '0' in normal cases + * + * @type { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ status: number; /** * Indicates the byte offset of the start position for reading or writing operation @@ -2932,6 +4249,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the value to be sent + * + * @type { ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ value: ArrayBuffer; } @@ -2950,6 +4276,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the Gatt profile connection state. + * + * @typedef BLEConnectionChangeState + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface BLEConnectionChangeState { /** * Indicates the peer device address @@ -2966,6 +4301,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the peer device address + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ deviceId: string; /** * Connection state of the Gatt profile @@ -2982,6 +4326,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Connection state of the Gatt profile + * + * @type { ProfileConnectionState } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ state: ProfileConnectionState; } @@ -3000,6 +4353,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the contents of the scan results. + * + * @typedef ScanResult + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface ScanResult { /** * Address of the scanned device @@ -3016,6 +4378,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Address of the scanned device + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ deviceId: string; /** * RSSI of the remote device @@ -3032,6 +4403,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * RSSI of the remote device + * + * @type { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ rssi: number; /** * The raw data of broadcast packet @@ -3048,6 +4428,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The raw data of broadcast packet + * + * @type { ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ data: ArrayBuffer; /** * The local name of the BLE device @@ -3064,6 +4453,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The local name of the BLE device + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ deviceName: string; /** * Connectable of the remote device @@ -3080,6 +4478,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Connectable of the remote device + * + * @type { boolean } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ connectable: boolean; } @@ -3098,6 +4505,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the settings for BLE advertising. + * + * @typedef AdvertiseSetting + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface AdvertiseSetting { /** * Minimum slot value for the advertising interval, which is {@code 32} (20 ms) @@ -3154,6 +4570,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates whether the BLE is connectable, default is {@code true} + * + * @type { ?boolean } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ connectable?: boolean; } @@ -3172,6 +4597,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the advertising data. + * + * @typedef AdvertiseData + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface AdvertiseData { /** * The specified service UUID list to this advertisement @@ -3188,6 +4622,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The specified service UUID list to this advertisement + * + * @type { Array } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuids: Array; /** * The specified manufacturer data list to this advertisement @@ -3204,6 +4647,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The specified manufacturer data list to this advertisement + * + * @type { Array } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ manufactureData: Array; /** * The specified service data list to this advertisement @@ -3220,6 +4672,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The specified service data list to this advertisement + * + * @type { Array } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceData: Array; /** * Indicates whether the device name will be included in the advertisement packet. @@ -3236,6 +4697,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates whether the device name will be included in the advertisement packet. + * + * @type { ?boolean } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ includeDeviceName?: boolean; } @@ -3246,6 +4716,14 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Describes the advertising parameters. + * + * @typedef AdvertisingParams + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ interface AdvertisingParams { /** * Indicates the advertising settings. @@ -3254,6 +4732,14 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Indicates the advertising settings. + * + * @type { AdvertiseSetting } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ advertisingSettings: AdvertiseSetting; /** * Indicates the advertising data. @@ -3262,6 +4748,14 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Indicates the advertising data. + * + * @type { AdvertiseData } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ advertisingData: AdvertiseData; /** * Indicates the advertising response. @@ -3270,6 +4764,14 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Indicates the advertising response. + * + * @type { ?AdvertiseData } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ advertisingResponse?: AdvertiseData; /** * Indicates the duration for advertising continuously. @@ -3336,6 +4838,14 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Advertising state change information. + * + * @typedef AdvertisingStateChangeInfo + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ interface AdvertisingStateChangeInfo { /** * Indicates the ID of current advertising. @@ -3344,6 +4854,14 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Indicates the ID of current advertising. + * + * @type { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ advertisingId: number; /** * Indicates the advertising state. @@ -3352,6 +4870,14 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Indicates the advertising state. + * + * @type { AdvertisingState } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ state: AdvertisingState; } @@ -3370,6 +4896,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the manufacturer data. + * + * @typedef ManufactureData + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface ManufactureData { /** * Indicates the manufacturer ID assigned by Bluetooth SIG @@ -3386,6 +4921,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the manufacturer ID assigned by Bluetooth SIG + * + * @type { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ manufactureId: number; /** * Indicates the manufacturer data to add @@ -3402,6 +4946,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the manufacturer data to add + * + * @type { ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ manufactureValue: ArrayBuffer; } @@ -3420,6 +4973,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the service data. + * + * @typedef ServiceData + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface ServiceData { /** * Indicates the UUID of the service data to add @@ -3436,6 +4998,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the UUID of the service data to add + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuid: string; /** * Indicates the service data to add @@ -3452,6 +5023,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Indicates the service data to add + * + * @type { ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceValue: ArrayBuffer; } @@ -3470,6 +5050,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the criteria for filtering scanning results can be set. + * + * @typedef ScanFilter + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface ScanFilter { /** * The address of a BLE peripheral device @@ -3486,6 +5075,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The address of a BLE peripheral device + * + * @type { ?string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ deviceId?: string; /** @@ -3503,6 +5101,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The name of a BLE peripheral device + * + * @type { ?string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ name?: string; /** @@ -3520,6 +5127,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The service UUID of a BLE peripheral device + * + * @type { ?string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuid?: string; /** @@ -3537,6 +5153,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Service UUID mask. + * + * @type { ?string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceUuidMask?: string; /** @@ -3554,6 +5179,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Service solicitation UUID. + * + * @type { ?string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceSolicitationUuid?: string; /** @@ -3571,6 +5205,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Service solicitation UUID mask. + * + * @type { ?string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceSolicitationUuidMask?: string; /** @@ -3588,6 +5231,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Service data. + * + * @type { ?ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceData?: ArrayBuffer; /** @@ -3605,6 +5257,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Service data mask. + * + * @type { ?ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ serviceDataMask?: ArrayBuffer; /** @@ -3622,6 +5283,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Manufacture id. + * + * @type { ?number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ manufactureId?: number; /** @@ -3639,6 +5309,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Manufacture data. + * + * @type { ?ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ manufactureData?: ArrayBuffer; /** @@ -3656,6 +5335,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Manufacture data mask. + * + * @type { ?ArrayBuffer } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ manufactureDataMask?: ArrayBuffer; } @@ -3674,6 +5362,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the parameters for scan. + * + * @typedef ScanOptions + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface ScanOptions { /** * Time of delay for reporting the scan result @@ -3690,6 +5387,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Time of delay for reporting the scan result + * + * @type { ?number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interval?: number; /** * Bluetooth LE scan mode @@ -3706,6 +5412,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Bluetooth LE scan mode + * + * @type { ?ScanDuty } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ dutyMode?: ScanDuty; /** * Match mode for Bluetooth LE scan filters hardware match @@ -3731,6 +5446,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Physical Layer used during scan. + * + * @type { ?PhyType } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ phyType?: PhyType; } @@ -3749,6 +5473,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Describes the properties of a gatt characteristic. + * + * @typedef GattProperties + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ interface GattProperties { /** * Support write property of the characteristic. @@ -3765,6 +5498,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Support write property of the characteristic. + * + * @type { ?boolean } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ write?: boolean; /** * Support write no response property of the characteristic. @@ -3781,6 +5523,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Support write no response property of the characteristic. + * + * @type { ?boolean } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ writeNoResponse?: boolean; /** * Support read property of the characteristic. @@ -3797,6 +5548,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Support read property of the characteristic. + * + * @type { ?boolean } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ read?: boolean; /** * Support notify property of the characteristic. @@ -3813,6 +5573,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Support notify property of the characteristic. + * + * @type { ?boolean } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ notify?: boolean; /** * Support indicate property of the characteristic. @@ -3847,6 +5616,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The enum of gatt characteristic write type + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ enum GattWriteType { /** * Write characteristic with response. @@ -3861,6 +5639,14 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Write characteristic with response. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ WRITE = 1, /** * Write characteristic without response. @@ -3875,6 +5661,14 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Write characteristic without response. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ WRITE_NO_RESPONSE = 2 } @@ -3893,6 +5687,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * The enum of scan duty. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ enum ScanDuty { /** * low power mode @@ -3907,6 +5710,14 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * low power mode + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ SCAN_MODE_LOW_POWER = 0, /** * balanced power mode @@ -3921,6 +5732,14 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * balanced power mode + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ SCAN_MODE_BALANCED = 1, /** * Scan using highest duty cycle @@ -3935,6 +5754,14 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Scan using highest duty cycle + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ SCAN_MODE_LOW_LATENCY = 2 } @@ -3991,6 +5818,14 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * The enum of BLE advertising state. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ enum AdvertisingState { /** * advertising started. @@ -3998,6 +5833,13 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * advertising started. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ STARTED = 1, /** * advertising temporarily enabled. @@ -4019,6 +5861,13 @@ declare namespace ble { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * advertising stopped. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ STOPPED = 4 } @@ -4030,6 +5879,15 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Phy type used during scan. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ enum PhyType { /** * Use 1M phy for scanning. @@ -4038,6 +5896,14 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Use 1M phy for scanning. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ PHY_LE_1M = 1, /** * Use all supported Phys for scanning. @@ -4046,6 +5912,14 @@ declare namespace ble { * @atomicservice * @since 12 */ + /** + * Use all supported Phys for scanning. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ PHY_LE_ALL_SUPPORTED = 255 } } diff --git a/api/@ohos.bluetooth.connection.d.ts b/api/@ohos.bluetooth.connection.d.ts index cfeb4e67b..cea133e33 100644 --- a/api/@ohos.bluetooth.connection.d.ts +++ b/api/@ohos.bluetooth.connection.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 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 @@ -36,6 +36,15 @@ import type constant from './@ohos.bluetooth.constant'; * @atomicservice * @since 12 */ +/** + * Provides methods to operate or manage Bluetooth. + * + * @namespace connection + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ declare namespace connection { /** * Indicate the profile connection state. @@ -44,6 +53,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Indicate the profile connection state. + * + * @typedef { constant.ProfileConnectionState } ProfileConnectionState + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ type ProfileConnectionState = constant.ProfileConnectionState; /** @@ -53,6 +70,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Indicate the profile id. + * + * @typedef { constant.ProfileId } ProfileId + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ type ProfileId = constant.ProfileId; /** @@ -70,6 +95,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Indicate the profile uuid. + * + * @typedef { constant.ProfileUuids } ProfileUuids + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ type ProfileUuids = constant.ProfileUuids; /** @@ -79,6 +112,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Indicate the major class of a bluetooth device. + * + * @typedef { constant.MajorClass } MajorClass + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ type MajorClass = constant.MajorClass; /** @@ -88,6 +129,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Indicate the major minor class of a bluetooth device. + * + * @typedef { constant.MajorMinorClass } MajorMinorClass + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ type MajorMinorClass = constant.MajorMinorClass; /** @@ -109,6 +158,26 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Get the profile connection state of the current device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { ProfileId } [profileId] - Indicate the profile id. This is an optional parameter. + * With profileId, returns the current connection state of this profile, {@link ProfileConnectionState}. + * Without profileId, if any profile is connected, {@link ProfileConnectionState#STATE_CONNECTED} is returned. + * Otherwise, {@link ProfileConnectionState#STATE_DISCONNECTED} is returned. + * @returns { ProfileConnectionState } Returns the connection state. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900004 - Profile not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function getProfileConnectionState(profileId?: ProfileId): ProfileConnectionState; /** @@ -144,6 +213,24 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Starts pairing with a remote Bluetooth device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @param { AsyncCallback } callback - the callback of pairDevice. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function pairDevice(deviceId: string, callback: AsyncCallback): void; /** @@ -179,6 +266,24 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Starts pairing with a remote Bluetooth device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @returns { Promise } Returns the promise object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function pairDevice(deviceId: string): Promise; /** @@ -340,6 +445,24 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Obtains the name of a peer Bluetooth device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @returns { string } Returns the device name in character string format. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function getRemoteDeviceName(deviceId: string): string; /** @@ -358,6 +481,23 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Obtains the class of a peer Bluetooth device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @returns { DeviceClass } The class of the remote device. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function getRemoteDeviceClass(deviceId: string): DeviceClass; /** @@ -372,6 +512,19 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Obtains the Bluetooth local name of a device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @returns { string } Returns the name the device. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function getLocalName(): string; /** @@ -401,6 +554,21 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Obtains the list of Bluetooth devices that have been paired with the current device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @returns { Array } Returns a list of paired Bluetooth devices's address. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function getPairedDevices(): Array; /** @@ -436,6 +604,24 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Obtains the pair state of a specified device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @returns { BondState } Returns the pair state. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function getPairState(deviceId: string): BondState; /** @@ -544,6 +730,20 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Obtains the Bluetooth scanning mode of a device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @returns { ScanMode } Returns the Bluetooth scanning mode. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function getBluetoothScanMode(): ScanMode; /** @@ -571,6 +771,20 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Starts scanning Bluetooth devices. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function startBluetoothDiscovery(): void; /** @@ -598,6 +812,20 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Stops Bluetooth device scanning. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function stopBluetoothDiscovery(): void; /** @@ -613,6 +841,20 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 11 */ + /** + * Check if bluetooth is discovering. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @returns { boolean } Returns {@code true} if the local device is discovering; returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function isBluetoothDiscovering(): boolean; /** @@ -686,6 +928,22 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Obtains the profile UUIDs supported by the remote device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @param { AsyncCallback> } callback - the callback of getRemoteProfileUuids. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function getRemoteProfileUuids(deviceId: string, callback: AsyncCallback>): void; /** @@ -721,6 +979,22 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Obtains the profile UUIDs supported by the remote device. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF". + * @returns { Promise> } Returns the promise object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function getRemoteProfileUuids(deviceId: string): Promise>; /** @@ -921,6 +1195,22 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Subscribe the event reported when a remote Bluetooth device is discovered. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'bluetoothDeviceFind' } type - Type of the discovering event to listen for. + * @param { Callback> } callback - Callback used to listen for the discovering event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function on(type: 'bluetoothDeviceFind', callback: Callback>): void; /** @@ -948,6 +1238,20 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Unsubscribe the event reported when a remote Bluetooth device is discovered. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'bluetoothDeviceFind' } type - Type of the discovering event to listen for. + * @param { Callback> } callback - Callback used to listen for the discovering event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ function off(type: 'bluetoothDeviceFind', callback?: Callback>): void; /** @@ -996,6 +1300,21 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Subscribe the event reported when a remote Bluetooth device is bonded. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'bondStateChange' } type - Type of the bond state event to listen for. + * @param { Callback } callback - Callback used to listen for the bond state event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function on(type: 'bondStateChange', callback: Callback): void; /** @@ -1012,6 +1331,21 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Unsubscribe the event reported when a remote Bluetooth device is bonded. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { 'bondStateChange' } type - Type of the bond state event to listen for. + * @param { Callback } callback - Callback used to listen for the bond state event. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ function off(type: 'bondStateChange', callback?: Callback): void; /** @@ -1079,6 +1413,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Describes the class of a bluetooth device. + * + * @typedef BondStateParam + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ interface BondStateParam { /** * Address of a Bluetooth device. @@ -1087,6 +1429,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Address of a Bluetooth device. + * + * @type { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ deviceId: string; /** * Profile connection state of the device. @@ -1095,6 +1445,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Profile connection state of the device. + * + * @type { BondState } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ state: BondState; /** * Cause of unbond. @@ -1103,6 +1461,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Cause of unbond. + * + * @type { UnbondCause } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ cause: UnbondCause; } @@ -1148,6 +1514,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Describes the class of a bluetooth device. + * + * @typedef DeviceClass + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ interface DeviceClass { /** * Major classes of Bluetooth devices. @@ -1156,6 +1530,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Major classes of Bluetooth devices. + * + * @type { MajorClass } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ majorClass: MajorClass; /** * Major and minor classes of Bluetooth devices. @@ -1164,6 +1546,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Major and minor classes of Bluetooth devices. + * + * @type { MajorMinorClass } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ majorMinorClass: MajorMinorClass; /** * Class of the device. @@ -1172,6 +1562,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Class of the device. + * + * @type { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ classOfDevice: number; } @@ -1206,6 +1604,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * The enum of BR scan mode. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ enum ScanMode { /** * Indicates the scan mode is none @@ -1213,6 +1619,13 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Indicates the scan mode is none + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ SCAN_MODE_NONE = 0, /** * Indicates the scan mode is connectable @@ -1220,6 +1633,13 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Indicates the scan mode is connectable + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ SCAN_MODE_CONNECTABLE = 1, /** * Indicates the scan mode is general discoverable @@ -1241,6 +1661,13 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Indicates the scan mode is connectable and general discoverable + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE = 4, /** * Indicates the scan mode is connectable and limited discoverable @@ -1266,6 +1693,15 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * The enum of bond state. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ enum BondState { /** * Indicate the bond state is invalid @@ -1280,6 +1716,14 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Indicate the bond state is invalid + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ BOND_STATE_INVALID = 0, /** * Indicate the bond state is bonding @@ -1294,6 +1738,14 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Indicate the bond state is bonding + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ BOND_STATE_BONDING = 1, /** * Indicate the bond state is bonded @@ -1308,6 +1760,14 @@ declare namespace connection { * @atomicservice * @since 12 */ + /** + * Indicate the bond state is bonded + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ BOND_STATE_BONDED = 2 } @@ -1628,6 +2088,14 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Enum for cause of unbond. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ enum UnbondCause { /** * User proactively removed device. @@ -1635,6 +2103,13 @@ declare namespace connection { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * User proactively removed device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ USER_REMOVED = 0, /** * Remote device shut down. diff --git a/api/@ohos.bluetooth.constant.d.ts b/api/@ohos.bluetooth.constant.d.ts index 5e001baad..5d460b010 100644 --- a/api/@ohos.bluetooth.constant.d.ts +++ b/api/@ohos.bluetooth.constant.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2023 Huawei Device Co., Ltd. + * Copyright (C) 2023-2024 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 @@ -33,6 +33,15 @@ * @atomicservice * @since 12 */ +/** + * The definition of constant. + * + * @namespace constant + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ declare namespace constant { /** * The enum of profile id. @@ -41,6 +50,14 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * The enum of profile id. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ export enum ProfileId { /** * A2DP profile. @@ -48,6 +65,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * A2DP profile. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_A2DP_SOURCE = 1, /** @@ -56,6 +80,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * HFP profile. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_HANDSFREE_AUDIO_GATEWAY = 4, /** @@ -90,6 +121,14 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Enum for the profile's uuid + * + * @enum { string } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ export enum ProfileUuids { /** * Hands-Free Profile: Audio Gateway @@ -104,6 +143,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Hands-Free Profile: Audio Gateway + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_UUID_HFP_AG = '0000111F-0000-1000-8000-00805F9B34FB', /** * Hands-Free Profile: Hands Free @@ -118,6 +164,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Hands-Free Profile: Hands Free + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_UUID_HFP_HF = '0000111E-0000-1000-8000-00805F9B34FB', /** * Headset Profile: Audio Gateway @@ -132,6 +185,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Headset Profile: Audio Gateway + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_UUID_HSP_AG = '00001112-0000-1000-8000-00805F9B34FB', /** * Headset Profile: Headset @@ -146,6 +206,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Headset Profile: Headset + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_UUID_HSP_HS = '00001108-0000-1000-8000-00805F9B34FB', /** * Advanced Audio Distribution Profile: Source @@ -160,6 +227,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Advanced Audio Distribution Profile: Source + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_UUID_A2DP_SRC = '0000110A-0000-1000-8000-00805F9B34FB', /** * Advanced Audio Distribution Profile: Sink @@ -174,6 +248,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Advanced Audio Distribution Profile: Sink + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_UUID_A2DP_SINK = '0000110B-0000-1000-8000-00805F9B34FB', /** * Audio/Video Remote Control Profile: Controller @@ -188,6 +269,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Audio/Video Remote Control Profile: Controller + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_UUID_AVRCP_CT = '0000110E-0000-1000-8000-00805F9B34FB', /** * Audio/Video Remote Control Profile: Target @@ -202,6 +290,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Audio/Video Remote Control Profile: Target + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_UUID_AVRCP_TG = '0000110C-0000-1000-8000-00805F9B34FB', /** * Human Interface Device Profile @@ -216,6 +311,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * Human Interface Device Profile + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_UUID_HID = '00001124-0000-1000-8000-00805F9B34FB', /** * HID over GATT Profile @@ -230,6 +332,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 12 */ + /** + * HID over GATT Profile + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PROFILE_UUID_HOGP = '00001812-0000-1000-8000-00805F9B34FB' } @@ -248,6 +357,15 @@ declare namespace constant { * @atomicservice * @since 12 */ + /** + * The enum of profile connection state. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ export enum ProfileConnectionState { /** * the current profile is disconnected @@ -262,6 +380,14 @@ declare namespace constant { * @atomicservice * @since 12 */ + /** + * the current profile is disconnected + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ STATE_DISCONNECTED = 0, /** * the current profile is being connected @@ -276,6 +402,14 @@ declare namespace constant { * @atomicservice * @since 12 */ + /** + * the current profile is being connected + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ STATE_CONNECTING = 1, /** * the current profile is connected @@ -290,6 +424,14 @@ declare namespace constant { * @atomicservice * @since 12 */ + /** + * the current profile is connected + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ STATE_CONNECTED = 2, /** * the current profile is being disconnected @@ -304,6 +446,14 @@ declare namespace constant { * @atomicservice * @since 12 */ + /** + * the current profile is being disconnected + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @atomicservice + * @since 13 + */ STATE_DISCONNECTING = 3 } @@ -314,6 +464,14 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * The enum of major class of a bluetooth device. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ export enum MajorClass { /** * Miscellaneous device. @@ -349,6 +507,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Audio or video device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ MAJOR_AUDIO_VIDEO = 0x0400, /** * Peripheral device. @@ -384,6 +549,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Health device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ MAJOR_HEALTH = 0x0900, /** * Unclassified device. @@ -401,6 +573,14 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * The enum of major minor class of a bluetooth device. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ export enum MajorMinorClass { /** * The Minor Device Class field @@ -409,6 +589,14 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * The Minor Device Class field + * Computer Major Class + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ COMPUTER_UNCATEGORIZED = 0x0100, /** * Desktop computer. @@ -416,6 +604,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Desktop computer. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ COMPUTER_DESKTOP = 0x0104, /** * Server. @@ -423,6 +618,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Server. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ COMPUTER_SERVER = 0x0108, /** * Laptop. @@ -430,6 +632,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Laptop. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ COMPUTER_LAPTOP = 0x010C, /** * Hand-held computer. @@ -437,6 +646,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Hand-held computer. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ COMPUTER_HANDHELD_PC_PDA = 0x0110, /** * Palmtop computer. @@ -444,6 +660,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Palmtop computer. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ COMPUTER_PALM_SIZE_PC_PDA = 0x0114, /** * Wearable computer. @@ -451,6 +674,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Wearable computer. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ COMPUTER_WEARABLE = 0x0118, /** * Tablet. @@ -466,6 +696,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Phone Major Class + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PHONE_UNCATEGORIZED = 0x0200, /** * Portable phone. @@ -473,6 +710,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Portable phone. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PHONE_CELLULAR = 0x0204, /** * Cordless phone. @@ -480,6 +724,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Cordless phone. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PHONE_CORDLESS = 0x0208, /** * Smartphone. @@ -487,6 +738,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Smartphone. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PHONE_SMART = 0x020C, /** * Modem or gateway phone. @@ -494,6 +752,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Modem or gateway phone. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PHONE_MODEM_OR_GATEWAY = 0x0210, /** * ISDN phone. @@ -501,6 +766,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * ISDN phone. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PHONE_ISDN = 0x0214, /** @@ -573,6 +845,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Wearable audio or video headset. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_WEARABLE_HEADSET = 0x0404, /** * Hands-free audio or video device. @@ -580,6 +859,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Hands-free audio or video device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_HANDSFREE = 0x0408, /** * Audio or video microphone. @@ -587,6 +873,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Audio or video microphone. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_MICROPHONE = 0x0410, /** * Audio or video loudspeaker. @@ -594,6 +887,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Audio or video loudspeaker. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_LOUDSPEAKER = 0x0414, /** * Audio or video headphones. @@ -601,6 +901,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Audio or video headphones. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_HEADPHONES = 0x0418, /** * Portable audio or video device. @@ -608,6 +915,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Portable audio or video device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_PORTABLE_AUDIO = 0x041C, /** * In-vehicle audio or video device. @@ -615,6 +929,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * In-vehicle audio or video device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_CAR_AUDIO = 0x0420, /** * Audio or video STB device. @@ -622,6 +943,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Audio or video STB device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_SET_TOP_BOX = 0x0424, /** * High-fidelity speaker device. @@ -629,6 +957,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * High-fidelity speaker device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_HIFI_AUDIO = 0x0428, /** * Video cassette recording (VCR) device. @@ -636,6 +971,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Video cassette recording (VCR) device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_VCR = 0x042C, /** * Camera. @@ -643,6 +985,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Camera. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_VIDEO_CAMERA = 0x0430, /** * Camcorder. @@ -650,6 +999,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Camcorder. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_CAMCORDER = 0x0434, /** * Audio or video monitor. @@ -657,6 +1013,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Audio or video monitor. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_VIDEO_MONITOR = 0x0438, /** * Video display or loudspeaker. @@ -664,6 +1027,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Video display or loudspeaker. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER = 0x043C, /** * Video conferencing device. @@ -671,6 +1041,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Video conferencing device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_VIDEO_CONFERENCING = 0x0440, /** * Audio or video gaming toy. @@ -678,6 +1055,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Audio or video gaming toy. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ AUDIO_VIDEO_VIDEO_GAMING_TOY = 0x0448, /** @@ -686,6 +1070,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Peripheral Major Class + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PERIPHERAL_NON_KEYBOARD_NON_POINTING = 0x0500, /** * Keyboard device. @@ -693,6 +1084,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Keyboard device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PERIPHERAL_KEYBOARD = 0x0540, /** * Pointing peripheral device. @@ -700,6 +1098,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Pointing peripheral device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PERIPHERAL_POINTING_DEVICE = 0x0580, /** * Keyboard pointing device. @@ -707,6 +1112,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Keyboard pointing device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ PERIPHERAL_KEYBOARD_POINTING = 0x05C0, /** * Unclassified peripheral device. @@ -821,6 +1233,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Wearable Major Class + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ WEARABLE_UNCATEGORIZED = 0x0700, /** * Smart watch. @@ -828,6 +1247,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Smart watch. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ WEARABLE_WRIST_WATCH = 0x0704, /** * Wearable pager. @@ -835,6 +1261,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Wearable pager. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ WEARABLE_PAGER = 0x0708, /** * Smart jacket. @@ -842,6 +1275,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Smart jacket. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ WEARABLE_JACKET = 0x070C, /** * Wearable helmet. @@ -849,6 +1289,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Wearable helmet. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ WEARABLE_HELMET = 0x0710, /** * Wearable glasses. @@ -856,6 +1303,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Wearable glasses. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ WEARABLE_GLASSES = 0x0714, /** @@ -864,6 +1318,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Minor Device Class field - Toy Major Class + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ TOY_UNCATEGORIZED = 0x0800, /** * Toy robot. @@ -871,6 +1332,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Toy robot. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ TOY_ROBOT = 0x0804, /** * Toy vehicle. @@ -878,6 +1346,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Toy vehicle. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ TOY_VEHICLE = 0x0808, /** * Humanoid toy doll. @@ -885,6 +1360,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Humanoid toy doll. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ TOY_DOLL_ACTION_FIGURE = 0x080C, /** * Toy controller. @@ -892,6 +1374,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Toy controller. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ TOY_CONTROLLER = 0x0810, /** * Toy gaming device. @@ -899,6 +1388,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Toy gaming device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ TOY_GAME = 0x0814, /** @@ -914,6 +1410,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Blood pressure device. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ HEALTH_BLOOD_PRESSURE = 0x0904, /** * Thermometer. @@ -921,6 +1424,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Thermometer. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ HEALTH_THERMOMETER = 0x0908, /** * Body scale. @@ -928,6 +1438,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Body scale. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ HEALTH_WEIGHING = 0x090C, /** * Blood glucose monitor. @@ -935,6 +1452,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Blood glucose monitor. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ HEALTH_GLUCOSE = 0x0910, /** * Pulse oximeter. @@ -942,6 +1466,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Pulse oximeter. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ HEALTH_PULSE_OXIMETER = 0x0914, /** * Heart rate monitor. @@ -949,6 +1480,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Heart rate monitor. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ HEALTH_PULSE_RATE = 0x0918, /** * Health data display. @@ -956,6 +1494,13 @@ declare namespace constant { * @syscap SystemCapability.Communication.Bluetooth.Core * @since 10 */ + /** + * Health data display. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @crossplatform + * @since 13 + */ HEALTH_DATA_DISPLAY = 0x091C, /** * Step counter. diff --git a/api/@ohos.bundle.appDomainVerify.d.ts b/api/@ohos.bundle.appDomainVerify.d.ts index 4f2a817cc..972f9cfab 100644 --- a/api/@ohos.bundle.appDomainVerify.d.ts +++ b/api/@ohos.bundle.appDomainVerify.d.ts @@ -13,9 +13,9 @@ * @syscap SystemCapability.BundleManager.AppDomainVerify * @systemapi * @stagemodelonly - * @since 12 + * @since 13 */ - declare namespace appDomainVerify { +declare namespace appDomainVerify { /** @@ -30,7 +30,7 @@ * @syscap SystemCapability.BundleManager.AppDomainVerify * @systemapi * @stagemodelonly - * @since 12 + * @since 13 */ function queryAssociatedDomains(bundleName: string): string[]; @@ -46,7 +46,7 @@ * @syscap SystemCapability.BundleManager.AppDomainVerify * @systemapi * @stagemodelonly - * @since 12 + * @since 13 */ function queryAssociatedBundleNames(domain: string): string[]; } diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index c8e7121d6..6bdb8e280 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -2431,6 +2431,19 @@ declare namespace bundleManager { */ function getLaunchWantForBundleSync(bundleName: string, userId?: number): Want; + /** + * Obtains the Want for starting the main ability of own application. + * The main ability of an application is the ability that has the + * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * + * @returns { Want } the Want for starting the application's main ability. + * @throws { BusinessError } 17700072 - The launch want is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @atomicservice + * @since 13 + */ + function getLaunchWant(): Want; + /** * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. * @@ -3122,6 +3135,21 @@ declare namespace bundleManager { * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 11 */ + /** + * Verifies the validity of .abc files. Only .abc files passed the verification can run on the restricted VM. + * + * @permission ohos.permission.RUN_DYN_CODE + * @param { Array } abcPaths - The abc path. + * @param { boolean } deleteOriginalFiles - Used to decide whether to delete the original files. + * @param { AsyncCallback } callback - Indicates the callback of verifyAbc result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700201 - Failed to verify the abc file. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 12 + */ function verifyAbc(abcPaths: Array, deleteOriginalFiles: boolean, callback: AsyncCallback): void; /** @@ -3137,6 +3165,21 @@ declare namespace bundleManager { * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 11 */ + /** + * Verifies the validity of .abc files. Only .abc files passed the verification can run on the restricted VM. + * + * @permission ohos.permission.RUN_DYN_CODE + * @param { Array } abcPaths - The abc path. + * @param { boolean } deleteOriginalFiles - Used to decide whether to delete the original files. + * @returns { Promise } Returns verifyAbc result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700201 - Failed to verify the abc file. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 12 + */ function verifyAbc(abcPaths: Array, deleteOriginalFiles: boolean): Promise; /** @@ -3195,6 +3238,20 @@ declare namespace bundleManager { * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 11 */ + /** + * Delete the verified .abc file. + * + * @permission ohos.permission.RUN_DYN_CODE + * @param { string } abcPath - The abc path. + * @returns { Promise } Returns deleteAbc result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700202 - Failed to delete the abc file. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 12 + */ function deleteAbc(abcPath: string): Promise; /** diff --git a/api/@ohos.bundle.installer.d.ts b/api/@ohos.bundle.installer.d.ts index 80158761b..6d41a5154 100644 --- a/api/@ohos.bundle.installer.d.ts +++ b/api/@ohos.bundle.installer.d.ts @@ -227,6 +227,49 @@ declare namespace installer { * @systemapi * @since 12 */ + /** + * Install HAPs for an application. + * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. + * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. + * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. + * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. + * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE + * @param { Array } hapFilePaths - Indicates the path where the HAP of the application is stored. + * @param { InstallParam } installParam - Indicates other parameters required for the installation. + * @param { AsyncCallback } callback - The callback of installing HAPs result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or + * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. + * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. + * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. + * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. + * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. + * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. + * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. + * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. + * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. + * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. + * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. + * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. + * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy + * (required APL: system_basic or system_core). + * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. + * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. + * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. + * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. + * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. + * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. + * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. + * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 13 + */ install(hapFilePaths: Array, installParam: InstallParam, callback: AsyncCallback): void; /** @@ -372,6 +415,47 @@ declare namespace installer { * @systemapi * @since 12 */ + /** + * Install HAPs for an application. + * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. + * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. + * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. + * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. + * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE + * @param { Array } hapFilePaths - Indicates the path where the HAP of the application is stored. + * @param { AsyncCallback } callback - The callback of installing HAPs result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or + * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. + * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. + * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. + * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. + * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. + * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. + * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. + * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. + * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. + * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. + * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. + * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. + * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy + * (required APL: system_basic or system_core). + * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. + * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. + * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. + * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. + * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. + * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. + * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. + * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 13 + */ install(hapFilePaths: Array, callback: AsyncCallback): void; /** @@ -529,6 +613,49 @@ declare namespace installer { * @systemapi * @since 12 */ + /** + * Install haps for an application. + * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. + * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. + * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. + * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. + * To install an internal beta application, you must have the permission ohos.permission.INSTALL_INTERNALTESTING_BUNDLE. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE + * @param { Array } hapFilePaths - Indicates the path where the HAP of the application is stored. + * @param { InstallParam } [installParam] - Indicates other parameters required for the installation. + * @returns { Promise } + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or + * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter hapFiles is needed for code signature; 4. The size of specifiedDistributionType is greater than 128; 5. The size of additionalInfo is greater than 3000. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. + * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. + * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. + * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. + * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. + * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. + * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. + * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. + * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. + * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. + * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. + * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. + * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy + * (required APL: system_basic or system_core). + * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. + * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. + * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. + * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. + * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. + * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. + * @throws { BusinessError } 17700058 - Failed to install the HAP because the device has been controlled. + * @throws { BusinessError } 17700066 - Failed to install the HAP because installing the native package failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 13 + */ install(hapFilePaths: Array, installParam?: InstallParam): Promise; /** @@ -727,6 +854,24 @@ declare namespace installer { * @systemapi * @since 9 */ + /** + * Recover an application. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be recovered. + * @param { InstallParam } installParam - Indicates other parameters required for the recover. + * @param { AsyncCallback } callback - The callback of recovering application result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700058 - Failed to install the HAP because this application is prohibited + *
from being installed on this device or by specified users. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 13 + */ recover(bundleName: string, installParam: InstallParam, callback: AsyncCallback): void; /** @@ -743,6 +888,22 @@ declare namespace installer { * @systemapi * @since 9 */ + /** + * Recover an application. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be recovered. + * @param { AsyncCallback } callback - The callback of recovering application result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700058 - Failed to install the HAP because this application is prohibited + *
from being installed on this device or by specified users. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 13 + */ recover(bundleName: string, callback: AsyncCallback): void; /** @@ -761,6 +922,24 @@ declare namespace installer { * @systemapi * @since 9 */ + /** + * Recover an application. + * + * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be recovered. + * @param { InstallParam } installParam - Indicates other parameters required for the recover. + * @returns { Promise } + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700058 - Failed to install the HAP because this application is prohibited + *
from being installed on this device or by specified users. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 13 + */ recover(bundleName: string, installParam?: InstallParam): Promise; /** @@ -1119,6 +1298,25 @@ declare namespace installer { * @systemapi * @since 12 */ + /** + * Install application by bundle name with specified user. + * + * @permission ohos.permission.INSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of application. + * @param { number } [userId] - userId Indicates the user ID. + * @returns { Promise } + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700001 - The specified bundleName cannot be found or the bundle is not installed by the specified user. + * @throws { BusinessError } 17700004 - The userId is invalid. + * @throws { BusinessError } 17700071 - It is not allowed to install the enterprise bundle. + * @throws { BusinessError } 17700058 - Failed to install the HAP because this application is prohibited + *
from being installed on this device or by specified users. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 13 + */ installPreexistingApp(bundleName: string, userId?: number): Promise; } diff --git a/api/@ohos.data.unifiedDataChannel.d.ts b/api/@ohos.data.unifiedDataChannel.d.ts index 33feb2678..d9383673b 100644 --- a/api/@ohos.data.unifiedDataChannel.d.ts +++ b/api/@ohos.data.unifiedDataChannel.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 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 @@ -37,6 +37,15 @@ import Want from "./@ohos.app.ability.Want"; * @atomicservice * @since 11 */ +/** + * Provide methods for sharing data between different applications across unified data channels. + * + * @namespace unifiedDataChannel + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ declare namespace unifiedDataChannel { /** * Types of scope that UnifiedData can be used. @@ -81,6 +90,14 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 12 */ + /** + * Indicates type of value. + * @typedef {number | string | boolean | image.PixelMap | Want | ArrayBuffer | object | null | undefined} + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ type ValueType = number | string | boolean | image.PixelMap | Want | ArrayBuffer | object | null | undefined; /** @@ -150,6 +167,14 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Describe the unified data. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ class UnifiedData { /** * Create unified data with a record @@ -170,6 +195,17 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Create unified data with a record + * + * @param { UnifiedRecord } record - Record will add into unified data. + * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect Parameters types. + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ constructor(record: UnifiedRecord); /** * Create a empty unified data. @@ -178,6 +214,14 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 12 */ + /** + * Create a empty unified data. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ constructor(); /** * Add a record into unified data @@ -198,6 +242,17 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Add a record into unified data + * + * @param { UnifiedRecord } record - Record will add into unified data. + * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect Parameters types. + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ addRecord(record: UnifiedRecord): void; /** * Get all records of unified data @@ -214,6 +269,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Get all records of unified data + * + * @returns { Array } Return the records of unified data + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ getRecords(): Array; /** @@ -226,6 +290,17 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 12 */ + /** + * Checks whether there is a specified type of data in DataProperties. + * @param { string } type - indicates to query data type. + * @returns { boolean } if having mimeType in UnifiedData returns true, else returns false. + * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect Parameters types. + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ hasType(type: string): boolean; /** @@ -235,6 +310,14 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 12 */ + /** + * UTD types of all content in the UnifiedData. + * @returns { Array } type of array + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ getTypes(): Array; /** @@ -306,6 +389,14 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Describe the unified record + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ class UnifiedRecord { /** * Get type of unified record @@ -322,6 +413,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Get type of unified record + * + * @returns { string } Return the type of unified data + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ getType(): string; /** @@ -331,6 +431,14 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 12 */ + /** + * Create unified record. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ constructor(); /** @@ -345,6 +453,19 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 12 */ + /** + * Create unified record by type and value. + * + * @param { string } type - indicates to data type of unified record. It can not be empty. When type of value is object, parameter type must be pixel-map or want UTD type. + * @param { ValueType } value - indicates to value of unified record. + * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; + *
2.Incorrect Parameters types; + *
3.Parameter verification failed. + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ constructor(type: string, value: ValueType); /** @@ -355,6 +476,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 12 */ + /** + * Get the value of unified record. + * + * @returns { ValueType } Return the value of unified record. + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ getValue(): ValueType; } @@ -373,6 +503,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Describe the unified text data + * + * @extends UnifiedRecord + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ class Text extends UnifiedRecord { /** * Indicates the details of unified text @@ -388,6 +527,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the details of unified text + * + * @type { ?Record } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ details?: Record; } @@ -406,6 +554,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Describe the unified plain text data + * + * @extends Text + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ class PlainText extends Text { /** * Indicates the content of text @@ -421,6 +578,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the content of text + * + * @type { string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ textContent: string; /** * Indicates the abstract of text @@ -436,6 +602,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the abstract of text + * + * @type { ?string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ abstract?: string; } @@ -454,6 +629,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Describe the unified link data + * + * @extends Text + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ class Hyperlink extends Text { /** * Indicates the url of a link @@ -469,6 +653,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the url of a link + * + * @type { string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ url: string; /** * Indicates the description of a link @@ -484,6 +677,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the description of a link + * + * @type { ?string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ description?: string; } @@ -502,6 +704,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Describe the unified html data + * + * @extends Text + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ class HTML extends Text { /** * Indicates the content of html, with html tags @@ -517,6 +728,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the content of html, with html tags + * + * @type { string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ htmlContent: string; /** * Indicates the plain content of html @@ -532,6 +752,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the plain content of html + * + * @type { ?string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ plainContent?: string; } @@ -550,6 +779,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Describe the unified file data + * + * @extends UnifiedRecord + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ class File extends UnifiedRecord { /** * Indicates the details of unified File @@ -565,6 +803,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the details of unified File + * + * @type { ?Record } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ details?: Record; /** * Indicates the uri of file @@ -580,6 +827,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the uri of file + * + * @type { string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ uri: string; } @@ -598,6 +854,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Describe the unified image data + * + * @extends File + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ class Image extends File { /** * Indicates the uri of image @@ -613,6 +878,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the uri of image + * + * @type { string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ imageUri: string; } @@ -631,6 +905,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Describe the unified video data + * + * @extends File + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ class Video extends File { /** * Indicates the uri of video @@ -646,6 +929,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the uri of video + * + * @type { string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ videoUri: string; } @@ -664,6 +956,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Describe the unified audio data + * + * @extends File + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ class Audio extends File { /** * Indicates the uri of audio @@ -679,6 +980,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the uri of audio + * + * @type { string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ audioUri: string; } @@ -697,6 +1007,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Describe the unified folder data + * + * @extends File + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ class Folder extends File { /** * Indicates the uri of folder @@ -712,6 +1031,15 @@ declare namespace unifiedDataChannel { * @atomicservice * @since 11 */ + /** + * Indicates the uri of folder + * + * @type { string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ folderUri: string; } diff --git a/api/@ohos.data.uniformTypeDescriptor.d.ts b/api/@ohos.data.uniformTypeDescriptor.d.ts index 07f30a35a..b38c554ec 100644 --- a/api/@ohos.data.uniformTypeDescriptor.d.ts +++ b/api/@ohos.data.uniformTypeDescriptor.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 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 @@ -33,6 +33,15 @@ * @atomicservice * @since 11 */ +/** + * Provides methods for uniform data type definition and query. + * + * @namespace uniformTypeDescriptor + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ declare namespace uniformTypeDescriptor { /** * Uniform data type IDs. @@ -49,6 +58,15 @@ declare namespace uniformTypeDescriptor { * @atomicservice * @since 11 */ + /** + * Uniform data type IDs. + * + * @enum { string } + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ enum UniformDataType { /** * Base data type for physical hierarchy, which identifies the physical representation of the data type. @@ -87,6 +105,14 @@ declare namespace uniformTypeDescriptor { * @atomicservice * @since 11 */ + /** + * Text data type. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ TEXT = 'general.text', /** @@ -102,6 +128,14 @@ declare namespace uniformTypeDescriptor { * @atomicservice * @since 11 */ + /** + * Plain text data type. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ PLAIN_TEXT = 'general.plain-text', /** @@ -117,6 +151,14 @@ declare namespace uniformTypeDescriptor { * @atomicservice * @since 11 */ + /** + * HTML data type. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ HTML = 'general.html', /** @@ -132,6 +174,14 @@ declare namespace uniformTypeDescriptor { * @atomicservice * @since 11 */ + /** + * Hyperlink data type. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ HYPERLINK = 'general.hyperlink', /** @@ -418,7 +468,15 @@ declare namespace uniformTypeDescriptor { * @syscap SystemCapability.DistributedDataManager.UDMF.Core * @atomicservice * @since 11 - */ + */ + /** + * Image data type. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ IMAGE = 'general.image', /** @@ -658,6 +716,14 @@ declare namespace uniformTypeDescriptor { * @atomicservice * @since 11 */ + /** + * Video data type. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ VIDEO = 'general.video', /** @@ -793,6 +859,14 @@ declare namespace uniformTypeDescriptor { * @atomicservice * @since 11 */ + /** + * Audio data type. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ AUDIO = 'general.audio', /** @@ -968,6 +1042,14 @@ declare namespace uniformTypeDescriptor { * @atomicservice * @since 11 */ + /** + * File data type. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ FILE = 'general.file', /** @@ -991,6 +1073,14 @@ declare namespace uniformTypeDescriptor { * @atomicservice * @since 11 */ + /** + * Folder data type. + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ FOLDER = 'general.folder', /** @@ -1452,6 +1542,14 @@ declare namespace uniformTypeDescriptor { * @atomicservice * @since 11 */ + /** + * OpenHarmony system defined pixel map data type(the data is provided and bound to OpenHarmony system). + * + * @syscap SystemCapability.DistributedDataManager.UDMF.Core + * @crossplatform + * @atomicservice + * @since 13 + */ OPENHARMONY_PIXEL_MAP = 'openharmony.pixel-map', /** @@ -1714,7 +1812,7 @@ declare namespace uniformTypeDescriptor { * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect Parameters types. * @syscap SystemCapability.DistributedDataManager.UDMF.Core - * @since 12 + * @since 13 */ function getUniformDataTypesByFilenameExtension(filenameExtension: string, belongsTo?: string): Array; @@ -1728,7 +1826,7 @@ declare namespace uniformTypeDescriptor { * @throws { BusinessError } 401 - Parameter error. Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect Parameters types. * @syscap SystemCapability.DistributedDataManager.UDMF.Core - * @since 12 + * @since 13 */ function getUniformDataTypesByMIMEType(mimeType: string, belongsTo?: string): Array; } diff --git a/api/@ohos.deviceInfo.d.ts b/api/@ohos.deviceInfo.d.ts index 893bb5a00..e769aba8b 100644 --- a/api/@ohos.deviceInfo.d.ts +++ b/api/@ohos.deviceInfo.d.ts @@ -617,6 +617,16 @@ declare namespace deviceInfo { */ const distributionOSApiVersion: number; + /** + * Obtains the Distribution OS api name. + *

Independent Software Vendor (ISV) may distribute OHOS with their own OS api name. + * distributionOSApiName will return the ISV OS api name + * + * @syscap SystemCapability.Startup.SystemInfo + * @since 13 + */ + const distributionOSApiName: string; + /** * Obtains the Distribution OS release type. *

Independent Software Vendor (ISV) may distribute OHOS with their own OS release type. diff --git a/api/@ohos.distributedDeviceManager.d.ts b/api/@ohos.distributedDeviceManager.d.ts index f318eea18..f1d276737 100644 --- a/api/@ohos.distributedDeviceManager.d.ts +++ b/api/@ohos.distributedDeviceManager.d.ts @@ -38,7 +38,9 @@ declare namespace distributedDeviceManager { */ interface DeviceBasicInfo { /** - * Device unique identifier, The actual value is the udid-hash confused with the appid based on sha256. + * Device identifier. The actual value is udid-hash confused with appid and salt value based on sha256. + * This id remains unchanged after application installation. If the application is uninstalled and reinstalled, + * the obtained ID will change. * @type { string } * @syscap SystemCapability.DistributedHardware.DeviceManager * @since 10 @@ -224,7 +226,9 @@ declare namespace distributedDeviceManager { * Get the device id of the local device. * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @returns { string } - Returns local device id. + * @returns { string } - Device identifier. The actual value is udid-hash confused with appid and salt value based on sha256. + * This id remains unchanged after application installation. If the application is uninstalled and reinstalled, + * the obtained ID will change. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 11600101 - Failed to execute the function. * @syscap SystemCapability.DistributedHardware.DeviceManager diff --git a/api/@ohos.effectKit.d.ts b/api/@ohos.effectKit.d.ts index 7e774d007..2c64bc944 100644 --- a/api/@ohos.effectKit.d.ts +++ b/api/@ohos.effectKit.d.ts @@ -31,7 +31,13 @@ import image from './@ohos.multimedia.image'; * @atomicservice * @since 12 */ - +/** + * @namespace effectKit + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ declare namespace effectKit { @@ -49,6 +55,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * The Filter of FilterChain. + * @typedef Filter + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ interface Filter { /** @@ -67,6 +82,16 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * A blur effect is added to the image. + * @param { number } radius - The degree of blur, the value is measured in pixels. + * @returns { Filter } Filters for the current effect have been added. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ blur(radius: number): Filter; /** @@ -85,6 +110,16 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * A Brightness effect is added to the image. + * @param { number } bright - The degree of light and darkness,the value range is 0 to 1. + * @returns { Filter } Filters for the current effect have been added. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ brightness(bright: number): Filter; /** @@ -101,6 +136,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * A Grayscale effect is added to the image. + * @returns { Filter } Filters for the current effect have been added. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ grayscale(): Filter; /** @@ -109,6 +153,13 @@ declare namespace effectKit { * @syscap SystemCapability.Multimedia.Image.Core * @since 12 */ + /** + * A invert effect is added to the image. + * @returns { Filter } Filters for the current effect have been added. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @since 14 + */ invert(): Filter; /** @@ -120,6 +171,16 @@ declare namespace effectKit { * @syscap SystemCapability.Multimedia.Image.Core * @since 12 */ + /** + * A custom effect is added to the image. + * + * @param { Array } colorMatrix - A matrix of 5x4 size for create effect filter. + * @returns { Filter } Filters for the current effect have been added. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @since 14 + */ setColorMatrix(colorMatrix: Array): Filter; /** @@ -146,6 +207,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Gets the PixelMap where all filter effects have been added to the image. + * @returns { Promise } - returns the PixelMap generated. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ getEffectPixelMap(): Promise; } @@ -163,6 +233,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * The color picker of an image. + * @typedef ColorPicker + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ interface ColorPicker { /** @@ -179,6 +258,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * get main color of an image + * @returns { Promise } returns the MainColor generated. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ getMainColor(): Promise; /** @@ -195,6 +283,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * get main color of an image + * @returns { Color } Main color picked in the image. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ getMainColorSync(): Color; /** @@ -211,6 +308,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Get largest proportion color of an image + * @returns { Color } Largest proportion color picked in the image. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ getLargestProportionColor(): Color; /** @@ -223,6 +329,17 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Get top proportion color of an image + * @param { number } colorCount - The number of colors to require, the value is 1 to 10. + * @returns { Array } An array of feature colors sorted by proportion, with a size equal to + * the minimum of colorCount and the actual number of extracted feature colors. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ getTopProportionColors(colorCount: number): Array; /** @@ -239,6 +356,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Get highest saturation color of an image + * @returns { Color } Highest saturation color picked in the image. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ getHighestSaturationColor(): Color; /** @@ -255,6 +381,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Get average color of an image + * @returns { Color } Average color calculated in the image. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ getAverageColor(): Color; /** @@ -273,6 +408,16 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Determine whether the color is black or white or gray + * @param { number } color - The 32 bit ARGB color to discriminate. + * @returns { boolean } Result of judging black, white and gray. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ isBlackOrWhiteOrGrayColor(color: number): boolean; } @@ -290,6 +435,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * The color param. + * @typedef Color + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ interface Color { /** @@ -306,6 +460,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Red + * @type { number } + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ red: number; /** @@ -322,6 +485,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Green + * @type { number } + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ green: number; /** @@ -338,6 +510,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Blue + * @type { number } + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ blue: number; /** @@ -354,6 +535,15 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Alpha + * @type { number } + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ alpha: number; } @@ -373,6 +563,16 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Create a FilterChain to add multiple effects to an image. + * @param { image.PixelMap } source - the source pixelmap. + * @returns { Filter } Returns the head node of FilterChain. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ function createEffect(source: image.PixelMap): Filter; /** @@ -393,6 +593,17 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Create a color picker to get color of an image. + * @param { image.PixelMap } source - the source pixelmap. + * @returns { Promise } - returns the ColorPicker generated. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ function createColorPicker(source: image.PixelMap): Promise; /** @@ -417,6 +628,19 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Create a color picker to get color of an image. + * @param { image.PixelMap } source - the source pixelmap. + * @param { Array } region - contains 4 elements, represents the region's left, top, right, bottom coordinates, + * default is [0, 0, 1, 1], represents the region of color picker is the whole pixelMap. + * @returns { Promise } - returns the ColorPicker generated. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ function createColorPicker(source: image.PixelMap, region: Array): Promise; /** @@ -437,6 +661,17 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Create a color picker to get color of an image. + * @param { image.PixelMap } source - the source pixelmap. + * @param { AsyncCallback } callback - the callback of createColorPicker. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ function createColorPicker(source: image.PixelMap, callback: AsyncCallback): void; /** @@ -461,6 +696,19 @@ declare namespace effectKit { * @atomicservice * @since 12 */ + /** + * Create a color picker to get color of an image. + * @param { image.PixelMap } source - the source pixelmap. + * @param { Array } region - contains 4 elements, represents the region's left, top, right, bottom coordinates, + * default is [0, 0, 1, 1], represents the region of color picker is the whole pixelMap. + * @param { AsyncCallback } callback - the callback of createColorPicker. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.Multimedia.Image.Core + * @crossplatform + * @form + * @atomicservice + * @since 14 + */ function createColorPicker(source: image.PixelMap, region: Array, callback: AsyncCallback): void; } diff --git a/api/@ohos.enterprise.restrictions.d.ts b/api/@ohos.enterprise.restrictions.d.ts index 795ea6a5c..5c862ab6d 100644 --- a/api/@ohos.enterprise.restrictions.d.ts +++ b/api/@ohos.enterprise.restrictions.d.ts @@ -336,7 +336,7 @@ declare namespace restrictions { * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ function setDisallowedPolicyForAccount(admin: Want, feature: string, disallow: boolean, accountId: number): void; @@ -355,9 +355,66 @@ declare namespace restrictions { * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ function getDisallowedPolicyForAccount(admin: Want, feature: string, accountId: number): boolean; + + /** + * Adds applications or bundles or other contents to the list to restrict them from using a specific feature. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } feature - feature indicates the specific feature to be disallowed. + * @param { Array } list - list of restricted applications or bundles or other contents. + * @param { number } accountId - indicates the account ID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 14 + */ + function addDisallowedListForAccount(admin: Want, feature: string, list: Array, accountId: number): void; + + /** + * Removes applications or bundles or other contents from the list to unblock them from using a specific feature. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } feature - feature indicates the specific feature to be disallowed. + * @param { Array } list - list of unblock applications or bundles or other contents. + * @param { number } accountId - indicates the account ID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 14 + */ + function removeDisallowedListForAccount(admin: Want, feature: string, list: Array, accountId: number): void; + + /** + * Gets the list of applications or bundles or other contents that are restrict from using a specific feature. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_RESTRICTIONS + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } feature - feature indicates the specific feature to be disallowed. + * @param { number } accountId - indicates the account ID. + * @returns { Array } list - list of applications or bundles or other contents. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 14 + */ + function getDisallowedListForAccount(admin: Want, feature: string, accountId: number): Array; } export default restrictions; diff --git a/api/@ohos.enterprise.securityManager.d.ts b/api/@ohos.enterprise.securityManager.d.ts index 6f6f6be70..4016e5f57 100644 --- a/api/@ohos.enterprise.securityManager.d.ts +++ b/api/@ohos.enterprise.securityManager.d.ts @@ -19,6 +19,7 @@ */ import type Want from './@ohos.app.ability.Want'; +import type image from './@ohos.multimedia.image'; /** * This module provides the capability to manage the security of the enterprise devices. @@ -270,6 +271,43 @@ declare namespace securityManager { */ function getAppClipboardPolicy(admin: Want, tokenId?: number): string; + /** + * Sets the watermark image displayed during the application running. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_SECURITY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } bundleName - the bundle name of the application to be set watermark. + * @param { string | image.PixelMap } source - watermark's pixelMap or its url. + * @param { number } accountId - indicates the accountID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 14 + */ + function setWatermarkImage(admin: Want, bundleName: string, source: string | image.PixelMap, accountId: number): void; + + /** + * Cancels the watermark image displayed during the application running. + * + * @permission ohos.permission.ENTERPRISE_MANAGE_SECURITY + * @param { Want } admin - admin indicates the administrator ability information. + * @param { string } bundleName - the bundle name of the application to be set watermark. + * @param { number } accountId - indicates the accountID. + * @throws { BusinessError } 9200001 - The application is not an administrator application of the device. + * @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @stagemodelonly + * @since 14 + */ + function cancelWatermarkImage(admin: Want, bundleName: string, accountId: number): void; + /** * Password policy. * diff --git a/api/@ohos.enterprise.usbManager.d.ts b/api/@ohos.enterprise.usbManager.d.ts index 1692b3865..3bd9d03ed 100644 --- a/api/@ohos.enterprise.usbManager.d.ts +++ b/api/@ohos.enterprise.usbManager.d.ts @@ -102,7 +102,7 @@ declare namespace usbManager { * @enum { number } * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ enum Descriptor { /** @@ -110,7 +110,7 @@ declare namespace usbManager { * * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ INTERFACE = 0, @@ -119,7 +119,7 @@ declare namespace usbManager { * * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ DEVICE = 1 } @@ -130,7 +130,7 @@ declare namespace usbManager { * @typedef UsbDeviceType * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ export interface UsbDeviceType { /** @@ -139,7 +139,7 @@ declare namespace usbManager { * @type { number } * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ baseClass: number; @@ -149,7 +149,7 @@ declare namespace usbManager { * @type { number } * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ subClass: number; @@ -159,7 +159,7 @@ declare namespace usbManager { * @type { number } * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ protocol: number; @@ -169,7 +169,7 @@ declare namespace usbManager { * @type { Descriptor } * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ descriptor: Descriptor; } @@ -377,7 +377,7 @@ declare namespace usbManager { * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ function addDisallowedUsbDevices(admin: Want, usbDevices: Array): void; @@ -397,7 +397,7 @@ declare namespace usbManager { * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ function removeDisallowedUsbDevices(admin: Want, usbDevices: Array): void; @@ -416,7 +416,7 @@ declare namespace usbManager { * 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @stagemodelonly - * @since 13 + * @since 14 */ function getDisallowedUsbDevices(admin: Want): Array; } diff --git a/api/@ohos.file.AlbumPickerComponent.d.ets b/api/@ohos.file.AlbumPickerComponent.d.ets index 70fe6530f..1b62ae642 100644 --- a/api/@ohos.file.AlbumPickerComponent.d.ets +++ b/api/@ohos.file.AlbumPickerComponent.d.ets @@ -19,6 +19,7 @@ */ import { PickerColorMode } from '@ohos.file.PhotoPickerComponent'; +import photoAccessHelper from '@ohos.file.photoAccessHelper'; /** * AlbumPickerComponent: can select a certain album and display the images in that album through PhotoPickerComponent @@ -48,8 +49,28 @@ export declare struct AlbumPickerComponent { * @since 12 */ onAlbumClick?: (albumInfo: AlbumInfo) => boolean; + + /** + * Callback when click the empty area of the album component + * + * @type { ?function } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + onEmptyAreaClick?: EmptyAreaClickCallback; } +/** + * The callback of onEmptyAreaClick event + * + * @typedef { function } EmptyAreaClickCallback + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ +export type EmptyAreaClickCallback = () => void + /** * AlbumPickerOptions Object * @@ -67,6 +88,16 @@ export declare class AlbumPickerOptions { * @since 12 */ themeColorMode?: PickerColorMode; + + /** + * The type of the content displayed in the album + * + * @type { ?photoAccessHelper.PhotoViewMIMETypes } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + filterType?: photoAccessHelper.PhotoViewMIMETypes; } diff --git a/api/@ohos.file.PhotoPickerComponent.d.ets b/api/@ohos.file.PhotoPickerComponent.d.ets index 19a7cd061..26587fce7 100644 --- a/api/@ohos.file.PhotoPickerComponent.d.ets +++ b/api/@ohos.file.PhotoPickerComponent.d.ets @@ -110,6 +110,36 @@ export declare struct PhotoPickerComponent { */ onPhotoBrowserChanged?: (browserItemInfo: BaseItemInfo) => boolean; + /** + * Callback when selected items are deleted + * + * @type { ?function } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + onSelectedItemsDeleted?: ItemsDeletedCallback; + + /** + * Callback when exceed max selected + * + * @type { ?function } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + onExceedMaxSelected?: ExceedMaxSelectedCallback; + + /** + * Callback when the current album is deleted + * + * @type { ?function } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + onCurrentAlbumDeleted?: CurrentAlbumDeletedCallback + /** * PickerController * @@ -131,6 +161,39 @@ export declare struct PhotoPickerComponent { build(): void; } + +/** + * The callback of onSelectedItemsDeleted event + * + * @typedef { function } ItemsDeletedCallback + * @param { Array } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ +export type ItemsDeletedCallback = (baseItemInfos: Array) => void; + +/** + * The callback of onExceedMaxSelected event + * + * @typedef { function } ItemsDeletedCallback + * @param { MaxCountType } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ +export type ExceedMaxSelectedCallback = (exceedMaxCountType: MaxCountType) => void; + +/** + * The callback of onCurrentAlbumDeleted event + * + * @typedef { function } CurrentAlbumDeletedCallback + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ +export type CurrentAlbumDeletedCallback = () => void; + /** * The class for PickerController * @@ -171,6 +234,26 @@ export declare class PickerController { * @since 12 */ setPhotoBrowserItem(uri: string, photoBrowserRange?: PhotoBrowserRange): void; + + /** + * Exit photo browser. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + exitPhotoBrowser(): void; + + /** + * Sets whether other elements on the photo browser page are visible. + * + * @param { Array } elements - other elements on the photo browser page + * @param { boolean } isVisible - visible or not + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + setPhotoBrowserUIElementVisibility(elements: Array, isVisible: boolean): void; } /** @@ -280,6 +363,26 @@ export declare class PickerOptions extends photoAccessHelper.BaseSelectOptions { * @since 12 */ maxVideoSelectNumber?: number; + + /** + * Support to set sliding selection + * + * @type { ?boolean } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + isSlidingSelectionSupported?: boolean; + + /** + * Support to set photo browser checkbox position + * + * @type { ?[number, number] } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + photoBrowserCheckboxPosition?: [number, number]; } /** @@ -715,4 +818,32 @@ export declare enum PhotoBrowserRange { * @since 12 */ SELECTED_ONLY = 1, +} + +/** + * PhotoBrowserUIElement. include CHECKBOX and BACK_BUTTON + * + * @enum { number } PhotoBrowserUIElement + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ +export declare enum PhotoBrowserUIElement { + /** + * CHECKBOX. checkbox + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + CHECKBOX = 0, + + /** + * BACK_BUTTON. back button + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + BACK_BUTTON = 1 } \ No newline at end of file diff --git a/api/@ohos.file.RecentPhotoComponent.d.ets b/api/@ohos.file.RecentPhotoComponent.d.ets index ed3123fda..3b7e2c86c 100644 --- a/api/@ohos.file.RecentPhotoComponent.d.ets +++ b/api/@ohos.file.RecentPhotoComponent.d.ets @@ -59,6 +59,16 @@ export declare struct RecentPhotoComponent { * @since 12 */ onRecentPhotoClick: RecentPhotoClickCallback; + + /** + * Callback when check whether photos or videos exists and return the recent photo info + * + * @type { ?function } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + onRecentPhotoCheckInfo?: RecentPhotoCheckInfoCallback; } /** @@ -83,6 +93,18 @@ export type RecentPhotoCheckResultCallback = (recentPhotoExists: boolean) => voi */ export type RecentPhotoClickCallback = (recentPhotoInfo: BaseItemInfo) => boolean; +/** + * The callback of onRecentPhotoCheckInfo event + * + * @typedef { function } RecentPhotoCheckInfoCallback + * @param { boolean } recentPhotoExists - Does the recent photo exist? + * @param { RecentPhotoInfo } info - the recent photo info + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ +export type RecentPhotoCheckInfoCallback = (recentPhotoExists: boolean, info: RecentPhotoInfo) => void; + /** * RecentPhotoOptions Object * @@ -122,6 +144,35 @@ export declare class RecentPhotoOptions { photoSource?: PhotoSource; } +/** + * Recent photo info + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ +export declare class RecentPhotoInfo { + /** + * The dateTaken of photos or videos + * + * @type { ?number } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + dateTaken?: number; + + /** + * The identifier of photos or videos + * + * @type { ?string } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @atomicservice + * @since 13 + */ + identifier?: string; +} + /** * Enumeration of PhotoSource type * diff --git a/api/@ohos.file.cloudSync.d.ts b/api/@ohos.file.cloudSync.d.ts index 4c99549a6..8444f52aa 100644 --- a/api/@ohos.file.cloudSync.d.ts +++ b/api/@ohos.file.cloudSync.d.ts @@ -246,7 +246,7 @@ declare namespace cloudSync { * @throws { BusinessError } 401 - The input parameter is invalid.Possible causes:Incorrect parameter types. * @throws { BusinessError } 22400001 - Cloud status not ready. * @throws { BusinessError } 22400002 - Network unavailable. - * @throws { BusinessError } 22400003 - Battery level warning. + * @throws { BusinessError } 22400003 - Low battery level. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @systemapi * @since 10 @@ -263,7 +263,7 @@ declare namespace cloudSync { *
2.Incorrect parameter types. * @throws { BusinessError } 22400001 - Cloud status not ready. * @throws { BusinessError } 22400002 - Network unavailable. - * @throws { BusinessError } 22400003 - Battery level warning. + * @throws { BusinessError } 22400003 - Low battery level. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @systemapi * @since 10 @@ -625,7 +625,7 @@ declare namespace cloudSync { * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 22400001 - Cloud status not ready. * @throws { BusinessError } 22400002 - Network unavailable. - * @throws { BusinessError } 22400003 - Battery level warning. + * @throws { BusinessError } 22400003 - Low battery level. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @since 12 */ @@ -638,7 +638,7 @@ declare namespace cloudSync { * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 22400001 - Cloud status not ready. * @throws { BusinessError } 22400002 - Network unavailable. - * @throws { BusinessError } 22400003 - Battery level warning. + * @throws { BusinessError } 22400003 - Low battery level. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @since 12 */ @@ -736,7 +736,7 @@ declare namespace cloudSync { * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 13900002 - No such file or directory. * @throws { BusinessError } 13900025 - No space left on device. - * @throws { BusinessError } 14000002 - Invalid uri. + * @throws { BusinessError } 14000002 - Invalid URI. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @since 11 */ @@ -751,7 +751,7 @@ declare namespace cloudSync { * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 13900002 - No such file or directory. * @throws { BusinessError } 13900025 - No space left on device. - * @throws { BusinessError } 14000002 - Invalid uri. + * @throws { BusinessError } 14000002 - Invalid URI. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @since 11 */ @@ -765,7 +765,7 @@ declare namespace cloudSync { *
2.Incorrect parameter types. * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 13900002 - No such file or directory. - * @throws { BusinessError } 14000002 - Invalid uri. + * @throws { BusinessError } 14000002 - Invalid URI. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @since 11 */ @@ -779,7 +779,7 @@ declare namespace cloudSync { *
2.Incorrect parameter types. * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 13900002 - No such file or directory. - * @throws { BusinessError } 14000002 - Invalid uri. + * @throws { BusinessError } 14000002 - Invalid URI. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @since 12 */ @@ -793,7 +793,7 @@ declare namespace cloudSync { *
2.Incorrect parameter types. * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 13900002 - No such file or directory. - * @throws { BusinessError } 14000002 - Invalid uri. + * @throws { BusinessError } 14000002 - Invalid URI. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @since 11 */ @@ -809,7 +809,7 @@ declare namespace cloudSync { *
2.Incorrect parameter types. * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 13900002 - No such file or directory. - * @throws { BusinessError } 14000002 - Invalid uri. + * @throws { BusinessError } 14000002 - Invalid URI. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @systemapi * @since 11 @@ -896,7 +896,7 @@ declare namespace cloudSync { *
2.Incorrect parameter types. * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 13900002 - No such file or directory. - * @throws { BusinessError } 14000002 - Invalid uri. + * @throws { BusinessError } 14000002 - Invalid URI. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @systemapi * @since 11 @@ -914,7 +914,7 @@ declare namespace cloudSync { *
2.Incorrect parameter types. * @throws { BusinessError } 13600001 - IPC error. * @throws { BusinessError } 13900002 - No such file or directory. - * @throws { BusinessError } 14000002 - Invalid uri. + * @throws { BusinessError } 14000002 - Invalid URI. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @systemapi * @since 11 @@ -934,7 +934,7 @@ declare namespace cloudSync { * @throws { BusinessError } 13900012 - Permission denied by the file system * @throws { BusinessError } 13900031 - Function not implemented * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 14000002 - Invalid uri. + * @throws { BusinessError } 14000002 - Invalid URI. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @systemapi * @since 12 @@ -951,7 +951,7 @@ declare namespace cloudSync { * @throws { BusinessError } 13900001 - Operation not permitted * @throws { BusinessError } 13900002 - No such file or directory. * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 14000002 - Invalid uri. + * @throws { BusinessError } 14000002 - Invalid URI. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @since 12 */ @@ -965,7 +965,7 @@ declare namespace cloudSync { * @throws { BusinessError } 13900001 - Operation not permitted * @throws { BusinessError } 13900002 - No such file or directory. * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 14000002 - Invalid uri. + * @throws { BusinessError } 14000002 - Invalid URI. * @syscap SystemCapability.FileManagement.DistributedFileService.CloudSync.Core * @since 12 */ diff --git a/api/@ohos.file.fs.d.ts b/api/@ohos.file.fs.d.ts index 0a1469793..1ef9320c6 100644 --- a/api/@ohos.file.fs.d.ts +++ b/api/@ohos.file.fs.d.ts @@ -6407,7 +6407,7 @@ declare function connectDfs(networkId: string, listeners: DfsListeners): Promise * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed.Possible causes:1.Mandatory parameters are left unspecified; *
2.Incorrect parameter types. - * @throws { BusinessError } 13600004 - Failed to unmount. + * @throws { BusinessError } 13600004 - Unmount failed. * @syscap SystemCapability.FileManagement.File.FileIO * @since 12 */ @@ -6646,7 +6646,7 @@ declare interface File { * @readonly * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 14300002 - Invalid uri + * @throws { BusinessError } 14300002 - Invalid URI * @syscap SystemCapability.FileManagement.File.FileIO * @since 10 */ @@ -6670,7 +6670,7 @@ declare interface File { * @returns { string } Return the parent path of file. * @throws { BusinessError } 13900005 - I/O error * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 14300002 - Invalid uri + * @throws { BusinessError } 14300002 - Invalid URI * @syscap SystemCapability.FileManagement.File.FileIO * @since 11 */ diff --git a/api/@ohos.file.photoAccessHelper.d.ts b/api/@ohos.file.photoAccessHelper.d.ts index 167c0ccee..8e572b571 100644 --- a/api/@ohos.file.photoAccessHelper.d.ts +++ b/api/@ohos.file.photoAccessHelper.d.ts @@ -539,6 +539,49 @@ declare namespace photoAccessHelper { BALANCE_MODE = 2 } + /** + * Enumeration of compatible mode. + * + * @enum { number } CompatibleMode + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + enum CompatibleMode { + /** + * Original format mode + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + ORIGINAL_FORMAT_MODE = 0, + + /** + * Compatible format mode. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + COMPATIBLE_FORMAT_MODE = 1 + } + + /** + * Data handler used to notify the progress of required media asset data + * + * @interface MediaAssetProgressHandler + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + interface MediaAssetProgressHandler { + /** + * Indicates the progress of required media asset data + * + * @param { number } progress - the progress of required media asset data; from 0 to 100. + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + onProgress(progress: number): void; + } + /** * Enumeration of source mode * @@ -640,7 +683,26 @@ declare namespace photoAccessHelper { */ NO_HIDE_SENSITIVE_TYPE = 3 } - + + /** + * Enumeration type of authorization mode. + * + * @enum { number } AuthorizationMode + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 12 + */ + enum AuthorizationMode { + /** + * Short time authorization. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 12 + */ + SHORT_TIME_AUTHORIZATION = 0 + } + /** * Enum: complete button text * @@ -702,7 +764,25 @@ declare namespace photoAccessHelper { * @systemapi * @since 11 */ - sourceMode?: SourceMode + sourceMode?: SourceMode; + + /** + * Indicates the compatible mode + * + * @type { ?CompatibleMode } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + compatibleMode?: CompatibleMode; + + /** + * data handler used to notify the progress of required media asset data + * + * @type { ?MediaAssetProgressHandler } + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + mediaAssetProgressHandler?: MediaAssetProgressHandler; } /** @@ -731,6 +811,26 @@ declare namespace photoAccessHelper { onDataPrepared(data: T, map?: Map): void; } + /** + * Data handler when quick request image is finished + * + * @typedef QuickImageDataHandler + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + interface QuickImageDataHandler { + /** + * Indicates required media asset data quickly is prepared + * + * @param { T } data - the returned data of picture + * @param { image.ImageSource } imageSource - the returned data of imageSource + * @param { Map } map - additional information for the data + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + onDataPrepared(data: T, imageSource: image.ImageSource, map: Map): void; + } + /** * Photo Proxy used to save image data * @@ -772,6 +872,30 @@ declare namespace photoAccessHelper { dataHandler: MediaAssetDataHandler ): Promise; + /** + * Quick request image + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @param { Context } context - Hap context information + * @param { PhotoAsset } asset - the photo asset requested + * @param { RequestOptions } requestOptions - the request options + * @param { QuickImageDataHandler } dataHandler - data handler used to obtain image data quickly when picture is prepared + * @returns { Promise } Returns request id + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 14000011 - Internal system error + * @static + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + static quickRequestImage( + context: Context, + asset: PhotoAsset, + requestOptions: RequestOptions, + dataHandler: QuickImageDataHandler + ): Promise; + /** * Request image data * @@ -1639,7 +1763,7 @@ declare namespace photoAccessHelper { * @throws { BusinessError } 14000011 - Internal system error * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ getKeyFrameThumbnail(beginFrameTimeMs: number, type: ThumbnailType): Promise; } @@ -1977,7 +2101,7 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ THUMBNAIL_READY = 'thumbnail_ready', /** @@ -1993,7 +2117,29 @@ declare namespace photoAccessHelper { * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @since 12 */ - THM_SIZE = 'thm_size' + THM_SIZE = 'thm_size', + /** + * Detail time of the asset, read only + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + DETAIL_TIME = 'detail_time', + /** + * Date taken of the asset in milliseconds, read only + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + DATE_TAKEN_MS = 'date_taken_ms', + /** + * Cloud enhancement status of the asset, read only + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + CE_AVAILABLE = 'ce_available' } /** @@ -2770,6 +2916,14 @@ declare namespace photoAccessHelper { * @since 12 */ IMAGE = 1031, + /** + * Cloud Enhancement album + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + CLOUD_ENHANCEMENT = 1032, /** * Source album * @@ -2823,7 +2977,7 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ GROUP_PHOTO, /** @@ -3070,7 +3224,7 @@ declare namespace photoAccessHelper { * @throws { BusinessError } 14000011 - Internal system error * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ getSharedPhotoAssets(options: FetchOptions): Array; } @@ -4008,6 +4162,48 @@ declare namespace photoAccessHelper { * @since 12 */ createAssetsForApp(bundleName: string, appName: string, appId: string, photoCreationConfigs: Array): Promise>; + /** + * Create asset and grant short term permission to the application. + * + * @permission ohos.permission.SHORT_TERM_WRITE_IMAGEVIDEO + * @param { PhotoCreationConfig } photoCreationConfig - photo asset creation configs + * @returns { Promise } - Returns the media library file uri to application which has been authorized + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 14000011 - Internal system error + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 12 + */ + createAssetWithShortTermPermission(photoCreationConfig: PhotoCreationConfig): Promise; + /** + * Create assets and grant save permission with authorization mode to the app which called the save dialog. + * + * @permission ohos.permission.WRITE_IMAGEVIDEO + * @param { string } bundleName - BundleName of the application which called the save dialog + * @param { string } appName - AppName of the application which called the save dialog + * @param { string } appId - AppId of the application which called the save dialog + * @param { number } tokenId - TokenId of the application which called the save dialog + * @param { AuthorizationMode } authorizationMode - Mode of authorization + * @param { Array } photoCreationConfigs - List of the photo asset creation configs + * @returns { Promise> } - Returns the media library file uri list to application which has been authorized + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 14000011 - Internal system error + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 12 + */ + createAssetsForAppWithMode( + bundleName: string, + appName: string, + appId: string, + tokenId: number, + authorizationMode: AuthorizationMode, + photoCreationConfigs: Array + ): Promise>; /** * Get the index of the asset in the album * @@ -4233,7 +4429,7 @@ declare namespace photoAccessHelper { * @throws { BusinessError } 14000011 - Internal system error * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ startThumbnailCreationTask(predicate: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): number; /** @@ -4248,7 +4444,7 @@ declare namespace photoAccessHelper { * @throws { BusinessError } 14000011 - Internal system error * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ stopThumbnailCreationTask(taskId: number): void; /** @@ -4264,7 +4460,7 @@ declare namespace photoAccessHelper { * @throws { BusinessError } 14000011 - Internal system error * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ getSharedPhotoAssets(options: FetchOptions): Array; } @@ -5087,11 +5283,36 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ PRIVATE_MOVING_PHOTO_RESOURCE = 4 } + /** + * The format in which the image is saved + * + * @enum { number } ImageFileType + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + enum ImageFileType { + /** + * Jpeg type + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + JPEG = 1, + + /** + * Heif type + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + HEIF = 2 + } + /** * Enumeration of moving photo effect mode. * @@ -5151,7 +5372,7 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ CINEMA_GRAPH = 5, @@ -5160,7 +5381,7 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ IMAGE_ONLY = 10 } @@ -5529,6 +5750,17 @@ declare namespace photoAccessHelper { */ saveCameraPhoto(): void; + /** + * Save the photo asset captured by camera with imageFileType. + * + * @param { ImageFileType } imageFileType - Image file type + * @throws { BusinessError } 14000011 - System inner fail + * @throws { BusinessError } 14000016 - Operation Not Support + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + saveCameraPhoto(imageFileType: ImageFileType): void; + /** * Discard the photo asset captured by camera. * @@ -5553,6 +5785,18 @@ declare namespace photoAccessHelper { * @since 12 */ setEffectMode(mode: MovingPhotoEffectMode): void; + + /** + * Set orientation of the asset. + * + * @param { number } orientation - the new orientation of the asset + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 14000011 - Internal system error + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @since 13 + */ + setOrientation(orientation: number): void; } /** @@ -5867,7 +6111,7 @@ declare namespace photoAccessHelper { * @throws { BusinessError } 14000011 - System inner fail * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dismiss(): void; } @@ -5878,7 +6122,7 @@ declare namespace photoAccessHelper { * @interface SharedPhotoAsset * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ interface SharedPhotoAsset { /** @@ -5887,7 +6131,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ fileId: number; /** @@ -5896,7 +6140,7 @@ declare namespace photoAccessHelper { * @type { string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ uri: string; /** @@ -5905,7 +6149,7 @@ declare namespace photoAccessHelper { * @type { string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ data: string; /** @@ -5914,7 +6158,7 @@ declare namespace photoAccessHelper { * @type { PhotoType } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ mediaType: PhotoType; /** @@ -5923,7 +6167,7 @@ declare namespace photoAccessHelper { * @type { string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ displayName: string; /** @@ -5932,7 +6176,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ size: number; /** @@ -5941,7 +6185,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dateAdded: number; /** @@ -5950,7 +6194,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dateModified: number; /** @@ -5959,7 +6203,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ duration: number; /** @@ -5968,7 +6212,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ width: number; /** @@ -5977,7 +6221,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ height: number; /** @@ -5986,7 +6230,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dateTaken: number; /** @@ -5995,7 +6239,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ orientation: number; /** @@ -6004,7 +6248,7 @@ declare namespace photoAccessHelper { * @type { boolean } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ isFavorite: boolean; /** @@ -6013,7 +6257,7 @@ declare namespace photoAccessHelper { * @type { string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ title: string; /** @@ -6022,7 +6266,7 @@ declare namespace photoAccessHelper { * @type { PositionType } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ position: PositionType; /** @@ -6031,7 +6275,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dateTrashed: number; /** @@ -6040,7 +6284,7 @@ declare namespace photoAccessHelper { * @type { boolean } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ hidden: boolean; /** @@ -6049,7 +6293,7 @@ declare namespace photoAccessHelper { * @type { string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ userComment: string; /** @@ -6058,7 +6302,7 @@ declare namespace photoAccessHelper { * @type { string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ cameraShotKey: string; /** @@ -6067,7 +6311,7 @@ declare namespace photoAccessHelper { * @type { string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dateYear: string; /** @@ -6076,7 +6320,7 @@ declare namespace photoAccessHelper { * @type { string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dateMonth: string; /** @@ -6085,7 +6329,7 @@ declare namespace photoAccessHelper { * @type { string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dateDay: string; /** @@ -6094,7 +6338,7 @@ declare namespace photoAccessHelper { * @type { boolean } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ pending: boolean; /** @@ -6103,7 +6347,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dateAddedMs: number; /** @@ -6112,7 +6356,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dateModifiedMs: number; /** @@ -6121,7 +6365,7 @@ declare namespace photoAccessHelper { * @type { number } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dateTrashedMs: number; /** @@ -6130,7 +6374,7 @@ declare namespace photoAccessHelper { * @type { PhotoSubtype } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ subtype: PhotoSubtype; /** @@ -6139,7 +6383,7 @@ declare namespace photoAccessHelper { * @type { MovingPhotoEffectMode } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ movingPhotoEffectMode: MovingPhotoEffectMode; /** @@ -6148,7 +6392,7 @@ declare namespace photoAccessHelper { * @type { DynamicRangeType } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ dynamicRangeType: DynamicRangeType; /** @@ -6157,7 +6401,7 @@ declare namespace photoAccessHelper { * @type { boolean } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ thumbnailReady: boolean; /** @@ -6166,7 +6410,7 @@ declare namespace photoAccessHelper { * @type { string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ lcdSize: string; /** @@ -6175,7 +6419,7 @@ declare namespace photoAccessHelper { * @type { string } * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ thmSize: string; } @@ -6377,7 +6621,7 @@ declare namespace photoAccessHelper { * @enum { number } ThumbnailType * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ enum ThumbnailType { /** @@ -6385,7 +6629,7 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ LCD = 1, /** @@ -6393,7 +6637,7 @@ declare namespace photoAccessHelper { * * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core * @systemapi - * @since 12 + * @since 13 */ THM = 2 } @@ -6472,6 +6716,316 @@ declare namespace photoAccessHelper { */ setHighlightUserActionData(type: HighlightUserActionType, actionData: number): Promise; } + + /** + * Cloud enhancement task stage. + * + * @enum { number } CloudEnhancementTaskStage + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + enum CloudEnhancementTaskStage { + /** + * Cloud enhancement task exception stage. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + TASK_STAGE_EXCEPTION = -1, + /** + * Cloud enhancement task preparing stage. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + TASK_STAGE_PREPARING, + /** + * Cloud enhancement task uploading stage. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + TASK_STAGE_UPLOADING, + /** + * Cloud enhancement task executing stage. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + TASK_STAGE_EXECUTING, + /** + * Cloud enhancement task downloading stage. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + TASK_STAGE_DOWNLOADING, + /** + * Cloud enhancement task failed stage. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + TASK_STAGE_FAILED, + /** + * Cloud enhancement task completed stage. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + TASK_STAGE_COMPLETED + } + + /** + * Task state of cloud enhancement. + * + * @interface CloudEnhancementTaskState + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + interface CloudEnhancementTaskState { + /** + * Indicates the cloud enhancement task stage. + * + * @type { CloudEnhancementTaskStage } + * @readonly + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + readonly taskStage: CloudEnhancementTaskStage; + /** + * Indicates the transferred file size. + * + * @type { ?number } + * @readonly + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + readonly transferredFileSize?: number; + /** + * Indicates the total file size. + * + * @type { ?number } + * @readonly + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + readonly totalFileSize?: number; + /** + * Indicates the expected duration of cloud enhancement queue time. + * + * @type { ?number } + * @readonly + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + readonly expectedDuration?: number; + /** + * Status code when failed in cloud enhancement. + * + * @type { ?number } + * @readonly + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + readonly statusCode?: number; + } + + /** + * Defines the class of cloud enhancement. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + class CloudEnhancement { + /** + * Get cloud enhancement instance. + * + * @param { Context } context - Hap context information + * @returns { CloudEnhancement } Returns cloud enhancement instance + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 14000011 - Internal system error + * @static + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + static getCloudEnhancementInstance(context: Context): CloudEnhancement; + + /** + * Submit cloud enhancement tasks. + * + * @permission ohos.permission.WRITE_IMAGEVIDEO + * @param { Array } photoAssets - The photo assets requested + * @param { boolean } hasCloudWatermark - true: Persistent cloud watermark; false: Not persistent cloud watermark. + * @returns { Promise } Returns void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 14000011 - Internal system error + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + submitCloudEnhancementTasks(photoAssets: Array, hasCloudWatermark: boolean): Promise; + + /** + * Prioritize cloud enhancement task. + * + * @permission ohos.permission.WRITE_IMAGEVIDEO + * @param { PhotoAsset } photoAsset - The photo asset requested + * @returns { Promise } Returns void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 14000011 - Internal system error + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + prioritizeCloudEnhancementTask(photoAsset: PhotoAsset): Promise; + + /** + * Cancel cloud enhancement tasks. + * + * @permission ohos.permission.WRITE_IMAGEVIDEO + * @param { Array } photoAssets - The photo assets requested + * @returns { Promise } Returns void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 14000011 - Internal system error + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + cancelCloudEnhancementTasks(photoAssets: Array): Promise; + + /** + * Cancel all cloud enhancement tasks. + * + * @permission ohos.permission.WRITE_IMAGEVIDEO + * @returns { Promise } Returns void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 14000011 - Internal system error + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + cancelAllCloudEnhancementTasks(): Promise; + + /** + * Query cloud enhancement task state. + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @param { PhotoAsset } photoAsset - The photo asset requested + * @returns { Promise } Returns cloud enhancement task state + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 14000011 - Internal system error + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + queryCloudEnhancementTaskState(photoAsset: PhotoAsset): Promise; + + /** + * Sync cloud enhancement task status. + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @returns { Promise } Returns void + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 14000011 - Internal system error + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + syncCloudEnhancementTaskStatus(): Promise; + + /** + * Get cloud enhancement pair. + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @param { PhotoAsset } asset - The asset requested + * @returns { Promise } Returns cloud-enhanced asset + * @throws { BusinessError } 201 - Permission denied + * @throws { BusinessError } 202 - Called by non-system application + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 14000011 - Internal system error + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + getCloudEnhancementPair(asset: PhotoAsset): Promise; + } + + /** + * Cloud enhancement state. + * + * @enum { number } CloudEnhancementState + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + enum CloudEnhancementState { + /** + * Cloud enhancement unavailable state. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + UNAVAILABLE = 0, + /** + * Cloud enhancement available state. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + AVAILABLE, + /** + * Cloud enhancement executing state. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + EXECUTING, + /** + * Cloud enhancement completed state. + * + * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core + * @systemapi + * @since 13 + */ + COMPLETED + } } export default photoAccessHelper; diff --git a/api/@ohos.file.picker.d.ts b/api/@ohos.file.picker.d.ts index c4fcd1a17..9ed32f70c 100644 --- a/api/@ohos.file.picker.d.ts +++ b/api/@ohos.file.picker.d.ts @@ -20,7 +20,7 @@ import { AsyncCallback, Callback } from './@ohos.base'; import Context from './application/Context'; - +import { window } from '@kit.ArkUI'; /** * Provide the capabilities to use different pickers. * @@ -666,6 +666,16 @@ declare namespace picker { */ constructor(context: Context); + /** + * The constructor used to create a DocumentViewPicker object. + * + * @param { Context } context - represents the context. + * @param { window.Window } window - represents the window. + * @syscap SystemCapability.FileManagement.UserFileService + * @since 13 + */ + constructor(context: Context, window: window.Window); + /** * Pull up the document picker based on the selection mode. * @@ -789,7 +799,7 @@ declare namespace picker { * @syscap SystemCapability.FileManagement.UserFileService * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ getSelectedIndex(): number; } diff --git a/api/@ohos.file.sendablePhotoAccessHelper.d.ets b/api/@ohos.file.sendablePhotoAccessHelper.d.ets index 6a407e796..d9c367d1c 100644 --- a/api/@ohos.file.sendablePhotoAccessHelper.d.ets +++ b/api/@ohos.file.sendablePhotoAccessHelper.d.ets @@ -20,8 +20,8 @@ import type Context from './application/Context'; import type image from './@ohos.multimedia.image'; -import lang from '@arkts.lang'; -import { photoAccessHelper } from '@kit.MediaLibraryKit'; +import lang from '../arkts/@arkts.lang'; +import photoAccessHelper from './@ohos.file.photoAccessHelper'; /** * Helper functions to access image and video assets diff --git a/api/@ohos.graphics.drawing.d.ts b/api/@ohos.graphics.drawing.d.ts index 1f381ddd1..4777a6817 100644 --- a/api/@ohos.graphics.drawing.d.ts +++ b/api/@ohos.graphics.drawing.d.ts @@ -1084,7 +1084,7 @@ declare namespace drawing { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Graphics.Drawing - * @since 12 + * @since 13 */ drawColor(color: number, blendMode?: BlendMode): void; @@ -2491,7 +2491,7 @@ declare namespace drawing { *
2. Incorrect parameter types; 3. Parameter verification failed. * @static * @syscap SystemCapability.Graphics.Drawing - * @since 12 + * @since 13 */ static create(blurRadius: number, x: number, y: number, color: number): ShadowLayer; } @@ -2525,7 +2525,7 @@ declare namespace drawing { *
2. Incorrect parameter types; 3. Parameter verification failed. * @static * @syscap SystemCapability.Graphics.Drawing - * @since 12 + * @since 13 */ static createBlendModeColorFilter(color: number, mode: BlendMode): ColorFilter; @@ -2781,7 +2781,7 @@ declare namespace drawing { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @syscap SystemCapability.Graphics.Drawing - * @since 12 + * @since 13 */ setColor(color: number): void; @@ -3051,7 +3051,7 @@ declare namespace drawing { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Graphics.Drawing - * @since 12 + * @since 13 */ setColor(color: number): void; diff --git a/api/@ohos.graphics.text.d.ts b/api/@ohos.graphics.text.d.ts index ae6506412..ec1d1bb06 100755 --- a/api/@ohos.graphics.text.d.ts +++ b/api/@ohos.graphics.text.d.ts @@ -1217,6 +1217,15 @@ declare namespace text { */ getLongestLine(): number; + /** + * Get the longest line of horizontal space this paragraph occupies, and this horizontal space contains the width + * of indent. + * @returns { number } The longest line with indent of horizontal space this paragraph occupies. + * @syscap SystemCapability.Graphics.Drawing + * @since 13 + */ + getLongestLineWithIndent(): number; + /** * Get the min intrinsic width of horizontal space this paragraph occupies. * @returns { number } The min intrinsic width of horizontal space this paragraph occupies. diff --git a/api/@ohos.graphics.uiEffect.d.ts b/api/@ohos.graphics.uiEffect.d.ts index 4c921f7d4..f3a31c225 100644 --- a/api/@ohos.graphics.uiEffect.d.ts +++ b/api/@ohos.graphics.uiEffect.d.ts @@ -64,7 +64,8 @@ declare namespace uiEffect { * @param { number } waveCount - The number of waves when the water ripples. The maximum count of waves is 3, the minimum value is 1, default is 2. * @param { number } x - Represents the X-axis position of center point where the water ripple first appears on the screen. * @param { number } y - Represents the Y-axis position of center point where the water ripple first appears on the screen. - * @param { WaterRippleMode } rippleMode - Set the mode of water ripple, 0 for mobile to desktop(Receive), 1 for mobile to desktop(Send), 2 for mobile to mobile. + * @param { WaterRippleMode } rippleMode - Set the mode of water ripple, + * 0 for mobile to desktop(Receive), 1 for mobile to desktop(Send), 2 for mobile to mobile. * @returns { Filter } - Returns water ripple Filter. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @syscap SystemCapability.Graphics.Drawing @@ -85,7 +86,7 @@ declare namespace uiEffect { * @systemapi * @since 12 */ - flyInFlyOutEffect(degree: number, flyMode: FlyMode ): Filter; + flyInFlyOutEffect(degree: number, flyMode: FlyMode): Filter; } /** @@ -217,6 +218,15 @@ declare namespace uiEffect { backgroundColorBlender(blender: BrightnessBlender): VisualEffect; } + /** + * Defines the blending effect. + * @typedef Blender + * @syscap SystemCapability.Graphics.Drawing + * @systemapi + * @since 13 + */ + type Blender = BrightnessBlender; + /** * The Blender of backgroundColorEffect. * @typedef BrightnessBlender diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index 8895262c8..aca286b5d 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -3138,6 +3138,51 @@ declare namespace audio { interruptNode: number; } + /** + * Desribes audio device block status. By default, the device is consider as unblocked. + * @enum { number } + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 13 + */ + enum DeviceBlockStatus{ + /** + * Device is unblocked. + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 13 + */ + UNBLOCKED = 0, + /** + * Device is blocked. + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 13 + */ + BLOCKED = 1, + } + + /** + * Desribes audio device block status info. + * @typedef DeviceBlockStatusInfo + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 13 + */ + interface DeviceBlockStatusInfo { + /** + * Device block status. + * @type {DeviceBlockStatus} + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 13 + */ + blockStatus: DeviceBlockStatus; + + /** + * Audio device descriptors whose block status has changed. + * @type {AudioDeviceDescriptors} + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 13 + */ + devices: AudioDeviceDescriptors; + } + /** * Implements audio router management. * @typedef AudioRoutingManager @@ -3772,6 +3817,43 @@ declare namespace audio { * @since 12 */ getPreferredInputDeviceForCapturerInfoSync(capturerInfo: AudioCapturerInfo): AudioDeviceDescriptors; + + /** + * Query whether microphone block detection is supported on current device. + * @returns { Promise } Promise used to return the result. + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 13 + */ + isMicBlockDetectionSupported():Promise; + + /** + * Subscribes microphone blocked events. Before subscribing, users should query whether block detection is supported + * on current device. The caller will receive the callback only when it is recording and the used + * microphones' block status have changed. Currently, block detecting is only support for microphones located on + * the local device. + * @param { 'micBlockStatusChanged' } type - Type of the event to listen for. + * @param { Callback } callback - Callback used to obtain the microphone block status. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @throws { BusinessError } 6800101 - Parameter verification failed. + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 13 + */ + on(type: 'micBlockStatusChanged', callback: Callback): void; + + /** + * Unsubscribes microphone blocked events. + * @param { 'microphoneBlockStatusChanged' } type - Type of the event to listen for. + * @param { Callback } callback - Callback used to obtain the microphone block status. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @throws { BusinessError } 6800101 - Parameter verification failed. + * @syscap SystemCapability.Multimedia.Audio.Device + * @since 13 + */ + off(type: 'micBlockStatusChanged', callback?: Callback): void; } /** @@ -4157,7 +4239,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Core * @crossplatform * @since 12 - */ + */ concurrencyMode: AudioConcurrencyMode; } @@ -4175,9 +4257,9 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Core * @crossplatform * @since 12 - */ + */ reason: AudioSessionDeactivatedReason; - } + } /** * Implements audio session management. @@ -4236,7 +4318,7 @@ declare namespace audio { */ on(type: 'audioSessionDeactivated', callback: Callback): void; - /** + /** * Unsubscribes to audio session deactivated event. * @param { 'audioSessionDeactivated' } type - Type of the event to listen for. Only the audioSessionDeactivated event is supported. * @param { Callback } callback - Callback invoked for the audio session deactivated event. @@ -7404,8 +7486,8 @@ declare namespace audio { * Temporarily changes the current audio device * This function applys on audiorenderers whose StreamUsage are * STREAM_USAGE_VOICE_COMMUNICATIN/STREAM_USAGE_VIDEO_COMMUNICATION/STREAM_USAGE_VOICE_MESSAGE. - * Setting the device will ony takes effect if no other accessory such as headphoes are in use - * @param { DeviceType } devicetype - the available deviceTypes are + * Setting the device will only takes effect if no other accessory such as headphones are in use + * @param { DeviceType } deviceType - the available deviceTypes are * EARPIECE: Built-in earpiece * SPEAKER: Built-in speaker * DEFAULT: System default output device @@ -7418,7 +7500,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer * @since 12 */ - setDefaultOutputDevice(deviceType: DeviceType): Promise + setDefaultOutputDevice(deviceType: DeviceType): Promise; /** * Listens for audio interrupt events. This method uses a callback to get interrupt events. The interrupt event is @@ -7780,6 +7862,13 @@ declare namespace audio { * @since 12 */ SOURCE_TYPE_VOICE_MESSAGE = 10, + + /** + * Camcorder source type. + * @syscap SystemCapability.Multimedia.Audio.Core + * @since 13 + */ + SOURCE_TYPE_CAMCORDER = 13, } /** diff --git a/api/@ohos.multimedia.avsession.d.ts b/api/@ohos.multimedia.avsession.d.ts index e8bb912f7..fcd35786e 100644 --- a/api/@ohos.multimedia.avsession.d.ts +++ b/api/@ohos.multimedia.avsession.d.ts @@ -796,6 +796,91 @@ declare namespace avSession { */ function stopCasting(session: SessionToken): Promise; + /** + * Begin to write device logs into a file descriptor for the purpose of problem locating. + * If the logs exceed max file size, no logs will be written and DEVICE_LOG_FULL event will be omitted. + * @param { string } url - The file descriptor to be written. + * @param { number } maxSize - The max size to be written in kilobyte. + * if not set, then written process will exit when there is no space to write. + * @returns { Promise } Promise for the result + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @systemapi + * @since 13 + */ + function startDeviceLogging(url: string, maxSize?: number): Promise; + + /** + * Stop the current device written even the discovery is ongoing. + * @returns { Promise } Promise for the result + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @systemapi + * @since 13 + */ + function stopDeviceLogging(): Promise; + + /** + * Register log event callback. + * @param { 'deviceLogEvent' } type - Command to register 'deviceLogEvent'. + * @param { Callback } callback - Used to handle ('deviceLogEvent') command + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @systemapi + * @since 13 + */ + function on(type: 'deviceLogEvent', callback: Callback): void; + + /** + * UnRegister log event callback. + * @param { 'deviceLogEvent' } type - Command to register 'deviceLogEvent'. + * @param { Callback } callback - Used to handle ('deviceLogEvent') command + * @throws { BusinessError } 202 - Not System App. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws { BusinessError } 6600101 - Session service exception. + * @throws { BusinessError } 6600102 - The session does not exist. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @systemapi + * @since 13 + */ + function off(type: 'deviceLogEvent', callback?: Callback): void; + + /** + * Enumerates device log event code. + * @enum { number } + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @systemapi + * @since 13 + */ + enum DeviceLogEventCode { + /** + * Log is full. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @systemapi + * @since 13 + */ + DEVICE_LOG_FULL = 1, + + /** + * Log is written with exception, such as the fd cannot be written and so on. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @systemapi + * @since 13 + */ + DEVICE_LOG_EXCEPTION = 2, + } + /** * Session type, support audio & video * @typedef { 'audio' | 'video' } AVSessionType @@ -3265,6 +3350,207 @@ declare namespace avSession { */ off(type: 'error'): void; + /** + * Register listeners for cast control generic error events. + * @param { 'castControlGenericError' } type Type of the 'castControlGenericError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws { BusinessError } 6611000 - The error code for cast control is unspecified. + * @throws { BusinessError } 6611001 - An unspecified error occurs in the remote player. + * @throws { BusinessError } 6611002 - The playback position falls behind the live window. + * @throws { BusinessError } 6611003 - The process of cast control times out. + * @throws { BusinessError } 6611004 - The runtime check failed. + * @throws { BusinessError } 6611100 - Cross-device data transmission is locked. + * @throws { BusinessError } 6611101 - The specified seek mode is not supported. + * @throws { BusinessError } 6611102 - The position to seek to is out of the range of the media asset + * or the specified seek mode is not supported. + * @throws { BusinessError } 6611103 - The specified playback mode is not supported. + * @throws { BusinessError } 6611104 - The specified playback speed is not supported. + * @throws { BusinessError } 6611105 - The action failed because either the media source device or the media sink device has been revoked. + * @throws { BusinessError } 6611106 - The parameter is invalid, for example, the url is illegal to play. + * @throws { BusinessError } 6611107 - Allocation of memory failed. + * @throws { BusinessError } 6611108 - Operation is not allowed. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + on(type: 'castControlGenericError', callback: ErrorCallback): void; + + /** + * Unregister listeners for cast control generic error events. + * @param { 'castControlGenericError' } type Type of the 'castControlGenericError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + off(type: 'castControlGenericError', callback?: ErrorCallback): void; + + /** + * Register listeners for cast control input/output error events. + * @param { 'castControlIoError' } type Type of the 'castControlIoError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws { BusinessError } 6612000 - An unspecified input/output error occurs. + * @throws { BusinessError } 6612001 - Network connection failure. + * @throws { BusinessError } 6612002 - Network timeout. + * @throws { BusinessError } 6612003 - Invalid "Content-Type" HTTP header. + * @throws { BusinessError } 6612004 - The HTTP server returns an unexpected HTTP response status code. + * @throws { BusinessError } 6612005 - The file does not exist. + * @throws { BusinessError } 6612006 - No permission is granted to perform the IO operation. + * @throws { BusinessError } 6612007 - Access to cleartext HTTP traffic is not allowed by the app's network security configuration. + * @throws { BusinessError } 6612008 - Reading data out of the data bound. + * @throws { BusinessError } 6612100 - The media does not contain any contents that can be played. + * @throws { BusinessError } 6612101 - The media cannot be read, for example, because of dust or scratches. + * @throws { BusinessError } 6612102 - This resource is already in use. + * @throws { BusinessError } 6612103 - The content using the validity interval has expired. + * @throws { BusinessError } 6612104 - Using the requested content to play is not allowed. + * @throws { BusinessError } 6612105 - The use of the allowed content cannot be verified. + * @throws { BusinessError } 6612106 - The number of times this content has been used as requested has reached the maximum allowed number of uses. + * @throws { BusinessError } 6612107 - An error occurs when sending packet from source device to sink device. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + on(type: 'castControlIoError', callback: ErrorCallback): void; + + /** + * Unregister listeners for cast control input/output error events. + * @param { 'castControlIoError' } type Type of the 'castControlIoError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + off(type: 'castControlIoError', callback?: ErrorCallback): void; + + /** + * Register listeners for cast control parsing error events. + * @param { 'castControlParsingError' } type Type of the 'castControlParsingError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws { BusinessError } 6613000 - Unspecified error related to content parsing. + * @throws { BusinessError } 6613001 - Parsing error associated with media container format bit streams. + * @throws { BusinessError } 6613002 - Parsing error associated with the media manifest. + * @throws { BusinessError } 6613003 - An error occurs when attempting to extract a file with an unsupported media container format + * or an unsupported media container feature. + * @throws { BusinessError } 6613004 - Unsupported feature in the media manifest. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + on(type: 'castControlParsingError', callback: ErrorCallback): void; + + /** + * Unregister listeners for cast control parsing error events. + * @param { 'castControlParsingError' } type Type of the 'castControlParsingError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + off(type: 'castControlParsingError', callback?: ErrorCallback): void; + + /** + * Register listeners for cast control decoding error events. + * @param { 'castControlDecodingError' } type Type of the 'castControlDecodingError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws { BusinessError } 6614000 - Unspecified decoding error. + * @throws { BusinessError } 6614001 - Decoder initialization failed. + * @throws { BusinessError } 6614002 - Decoder query failed. + * @throws { BusinessError } 6614003 - Decoding the media samples failed. + * @throws { BusinessError } 6614004 - The format of the content to decode exceeds the capabilities of the device. + * @throws { BusinessError } 6614005 - The format of the content to decode is not supported. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + on(type: 'castControlDecodingError', callback: ErrorCallback): void; + + /** + * Unregister listeners for cast control decoding error events. + * @param { 'castControlDecodingError' } type Type of the 'castControlDecodingError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + off(type: 'castControlDecodingError', callback?: ErrorCallback): void; + + /** + * Register listeners for cast control audio renderer error error events. + * @param { 'castControlAudioRendererError' } type Type of the 'castControlAudioRendererError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws { BusinessError } 6615000 - Unspecified errors related to the audio renderer. + * @throws { BusinessError } 6615001 - Initializing the audio renderer failed. + * @throws { BusinessError } 6615002 - The audio renderer fails to write data. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + on(type: 'castControlAudioRendererError', callback: ErrorCallback): void; + + /** + * Unregister listeners for cast control audio renderer error events. + * @param { 'castControlAudioRendererError' } type Type of the 'castControlAudioRendererError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + off(type: 'castControlAudioRendererError', callback?: ErrorCallback): void; + + /** + * Register listeners for cast control drm error events. + * @param { 'castControlDrmError' } type Type of the 'castControlDrmError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws { BusinessError } 6616000 - Unspecified error related to DRM. + * @throws { BusinessError } 6616001 - The chosen DRM protection scheme is not supported by the device. + * @throws { BusinessError } 6616002 - Device provisioning failed. + * @throws { BusinessError } 6616003 - The DRM-protected content to play is incompatible. + * @throws { BusinessError } 6616004 - Failed to obtain a license. + * @throws { BusinessError } 6616005 - The operation is disallowed by the license policy. + * @throws { BusinessError } 6616006 - An error occurs in the DRM system. + * @throws { BusinessError } 6616007 - The device has revoked DRM privileges. + * @throws { BusinessError } 6616008 - The DRM license being loaded into the open DRM session has expired. + * @throws { BusinessError } 6616100 - An error occurs when the DRM processes the key response. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + on(type: 'castControlDrmError', callback: ErrorCallback): void; + + /** + * Unregister listeners for cast control drm error events. + * @param { 'castControlDrmError' } type Type of the 'castControlDrmError' to listen for. + * @param { ErrorCallback } callback Callback used to listen for the cast control error event. + * @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + off(type: 'castControlDrmError', callback?: ErrorCallback): void; + /** * Register listener for drm key request. * @param { 'keyRequest' } type - Type of the 'keyRequest' to listen for. @@ -4835,6 +5121,33 @@ declare namespace avSession { */ deviceType: DeviceType; + /** + * Device manufacturer. + * @type { ?string } + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + manufacturer?: string; + + /** + * Device model name. + * @type { ?string } + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + modelName?: string; + + /** + * Network id. + * @type { ?string } + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @systemapi + * @since 13 + */ + networkId?: string; + /** * device ip address if available. * @type { ?string } @@ -4887,6 +5200,26 @@ declare namespace avSession { * @since 11 */ authenticationStatus?: number; + + /** + * Indicates the current device is legacy or not. + * @type { ?boolean } + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @systemapi + * @since 13 + */ + isLegacy?: boolean; + + /** + * Medium types used to discover devices. + * 1: BLE + * 2: COAP + * @type { ?number } + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @systemapi + * @since 13 + */ + mediumTypes?: number; } /** @@ -6901,6 +7234,447 @@ declare namespace avSession { * @since 12 */ ERR_CODE_REMOTE_CONNECTION_NOT_EXIST = 6600109, + + /** + * The error code for cast control is unspecified. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_UNSPECIFIED = 6611000, + + /** + * An unspecified error occurs in the remote player. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_REMOTE_ERROR = 6611001, + + /** + * The playback position falls behind the live window. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_BEHIND_LIVE_WINDOW = 6611002, + + /** + * The process of cast control times out. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_TIMEOUT = 6611003, + + /** + * The runtime check failed. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_RUNTIME_CHECK_FAILED = 6611004, + + /** + * Cross-device data transmission is locked. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_PLAYER_NOT_WORKING = 6611100, + + /** + * The specified seek mode is not supported. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_SEEK_MODE_UNSUPPORTED = 6611101, + + /** + * The position to seek to is out of the range of the media asset or the specified seek mode is not supported. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_ILLEGAL_SEEK_TARGET = 6611102, + + /** + * The specified playback mode is not supported. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_PLAY_MODE_UNSUPPORTED = 6611103, + + /** + * The specified playback speed is not supported. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_PLAY_SPEED_UNSUPPORTED = 6611104, + + /** + * The action failed because either the media source device or the media sink device has been revoked. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DEVICE_MISSING = 6611105, + + /** + * The parameter is invalid, for example, the url is illegal to play. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_INVALID_PARAM = 6611106, + + /** + * Allocation of memory failed. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_NO_MEMORY = 6611107, + + /** + * Operation is not allowed. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_OPERATION_NOT_ALLOWED = 6611108, + + /** + * An unspecified input/output error occurs. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_UNSPECIFIED = 6612000, + + /** + * Network connection failure. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_NETWORK_CONNECTION_FAILED = 6612001, + + /** + * Network timeout. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_NETWORK_CONNECTION_TIMEOUT = 6612002, + + /** + * Invalid "Content-Type" HTTP header. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_INVALID_HTTP_CONTENT_TYPE = 6612003, + + /** + * The HTTP server returns an unexpected HTTP response status code. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_BAD_HTTP_STATUS = 6612004, + + /** + * The file does not exist. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_FILE_NOT_FOUND = 6612005, + + /** + * No permission is granted to perform the IO operation. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_NO_PERMISSION = 6612006, + + /** + * Access to cleartext HTTP traffic is not allowed by the app's network security configuration. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_CLEARTEXT_NOT_PERMITTED = 6612007, + + /** + * Reading data out of the data bound. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_READ_POSITION_OUT_OF_RANGE = 6612008, + + /** + * The media does not contain any contents that can be played. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_NO_CONTENTS = 6612100, + + /** + * The media cannot be read, for example, because of dust or scratches. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_READ_ERROR = 6612101, + + /** + * This resource is already in use. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_CONTENT_BUSY = 6612102, + + /** + * The content using the validity interval has expired. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_CONTENT_EXPIRED = 6612103, + + /** + * Using the requested content to play is not allowed. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_USE_FORBIDDEN = 6612104, + + /** + * The use of the allowed content cannot be verified. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_NOT_VERIFIED = 6612105, + + /** + * The number of times this content has been used as requested has reached the maximum allowed number of uses. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_EXHAUSTED_ALLOWED_USES = 6612106, + + /** + * An error occurs when sending packet from source device to sink device. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_IO_NETWORK_PACKET_SENDING_FAILED = 6612107, + + /** + * Unspecified error related to content parsing. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_PARSING_UNSPECIFIED = 6613000, + + /** + * Parsing error associated with media container format bit streams. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_PARSING_CONTAINER_MALFORMED = 6613001, + + /** + * Parsing error associated with the media manifest. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_PARSING_MANIFEST_MALFORMED = 6613002, + + /** + * An error occurs when attempting to extract a file with an unsupported media container format + * or an unsupported media container feature. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_PARSING_CONTAINER_UNSUPPORTED = 6613003, + + /** + * Unsupported feature in the media manifest. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_PARSING_MANIFEST_UNSUPPORTED = 6613004, + + /** + * Unspecified decoding error. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DECODING_UNSPECIFIED = 6614000, + + /** + * Decoder initialization failed. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DECODING_INIT_FAILED = 6614001, + + /** + * Decoder query failed. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DECODING_QUERY_FAILED = 6614002, + + /** + * Decoding the media samples failed. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DECODING_FAILED = 6614003, + + /** + * The format of the content to decode exceeds the capabilities of the device. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DECODING_FORMAT_EXCEEDS_CAPABILITIES = 6614004, + + /** + * The format of the content to decode is not supported. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DECODING_FORMAT_UNSUPPORTED = 6614005, + + /** + * Unspecified errors related to the audio renderer. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_UNSPECIFIED = 6615000, + + /** + * Initializing the audio renderer failed. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_INIT_FAILED = 6615001, + + /** + * The audio renderer fails to write data. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_WRITE_FAILED = 6615002, + + /** + * Unspecified error related to DRM. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DRM_UNSPECIFIED = 6616000, + + /** + * The chosen DRM protection scheme is not supported by the device. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DRM_SCHEME_UNSUPPORTED = 6616001, + + /** + * Device provisioning failed. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DRM_PROVISIONING_FAILED = 6616002, + + /** + * The DRM-protected content to play is incompatible. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DRM_CONTENT_ERROR = 6616003, + + /** + * Failed to obtain a license. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DRM_LICENSE_ACQUISITION_FAILED = 6616004, + + /** + * The operation is disallowed by the license policy. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DRM_DISALLOWED_OPERATION = 6616005, + + /** + * An error occurs in the DRM system. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DRM_SYSTEM_ERROR = 6616006, + + /** + * The device has revoked DRM privileges. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DRM_DEVICE_REVOKED = 6616007, + + /** + * The DRM license being loaded into the open DRM session has expired. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DRM_LICENSE_EXPIRED = 6616008, + + /** + * An error occurs when the DRM processes the key response. + * @syscap SystemCapability.Multimedia.AVSession.AVCast + * @atomicservice + * @since 13 + */ + ERR_CODE_CAST_CONTROL_DRM_PROVIDE_KEY_RESPONSE_ERROR = 6616100, } } diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index cf445da58..d21c1cd76 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -1770,6 +1770,15 @@ declare namespace camera { */ PANORAMA_PHOTO = 15, + /** + * Timelapse photo camera mode. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + TIME_LAPSE_PHOTO = 16, + /** * Fluorescence photo mode. * @@ -1835,7 +1844,15 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @since 11 */ - CAMERA_FORMAT_YCRCB_P010 + CAMERA_FORMAT_YCRCB_P010, + + /** + * HEIC Format. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + CAMERA_FORMAT_HEIC = 2003 } /** @@ -1997,6 +2014,18 @@ declare namespace camera { * @since 11 */ setFlashMode(flashMode: FlashMode): void; + + /** + * Enable lcd flash. + * + * @param { boolean } enabled - Target lcd flash status. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enableLcdFlash(enabled: boolean): void; } /** @@ -4437,7 +4466,25 @@ declare namespace camera { * @systemapi * @since 12 */ - MOON_CAPTURE_BOOST = 0 + MOON_CAPTURE_BOOST = 0, + + /** + * Feature for tripod detection. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + TRIPOD_DETECTION = 1, + + /** + * Feature for low light boost. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + LOW_LIGHT_BOOST = 2 } /** @@ -4472,6 +4519,73 @@ declare namespace camera { readonly detected: boolean; } + /** + * Enum for tripod status. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enum TripodStatus { + /** + * Invalid tripod status. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + INVALID = 0, + + /** + * Tripod is active. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + ACTIVE = 1, + + /** + * Enter tripod stabilization state. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + ENTERING = 2, + + /** + * Exit tripod stabilization state. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + EXITING = 3, + } + + /** + * Tripod detection result. + * + * @interface TripodDetectionResult + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface TripodDetectionResult extends SceneFeatureDetectionResult { + /** + * tripod status. + * + * @type { TripodStatus } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly tripodStatus: TripodStatus; + } + /** * Scene detection query. * @@ -4696,6 +4810,30 @@ declare namespace camera { */ off(type: 'effectSuggestionChange', callback?: AsyncCallback): void; + /** + * Subscribes to lcd flash status. + * + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + on(type: 'lcdFlashStatus', callback: AsyncCallback): void; + + /** + * Unsubscribes from lcd flash status. + * + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + off(type: 'lcdFlashStatus', callback?: AsyncCallback): void; + /** * Gets session functions. * @@ -4849,6 +4987,30 @@ declare namespace camera { */ off(type: 'macroStatusChanged', callback?: AsyncCallback): void; + /** + * Subscribes to lcd flash status. + * + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + on(type: 'lcdFlashStatus', callback: AsyncCallback): void; + + /** + * Unsubscribes from lcd flash status. + * + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + off(type: 'lcdFlashStatus', callback?: AsyncCallback): void; + /** * Gets session functions. * @@ -5284,6 +5446,30 @@ declare namespace camera { */ off(type: 'smoothZoomInfoAvailable', callback?: AsyncCallback): void; + /** + * Subscribes to lcd flash status. + * + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + on(type: 'lcdFlashStatus', callback: AsyncCallback): void; + + /** + * Unsubscribes from lcd flash status. + * + * @param { 'lcdFlashStatus' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lcd flash status. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + off(type: 'lcdFlashStatus', callback?: AsyncCallback): void; + /** * Gets session functions. * @@ -5748,98 +5934,98 @@ declare namespace camera { /** * Subscribes ISO info event callback. * - * @param { 'isoInfo' } type - Event type. + * @param { 'isoInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the ISO info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'isoInfo', callback: AsyncCallback): void; + on(type: 'isoInfoChange', callback: AsyncCallback): void; /** * Unsubscribes from ISO info event callback. * - * @param { 'isoInfo' } type - Event type. + * @param { 'isoInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the ISO info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'isoInfo', callback?: AsyncCallback): void; + off(type: 'isoInfoChange', callback?: AsyncCallback): void; /** * Subscribes exposure info event callback. * - * @param { 'exposureInfo' } type - Event type. + * @param { 'exposureInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the exposure info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'exposureInfo', callback: AsyncCallback): void; + on(type: 'exposureInfoChange', callback: AsyncCallback): void; /** * Unsubscribes from exposure info event callback. * - * @param { 'exposureInfo' } type - Event type. + * @param { 'exposureInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the exposure info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'exposureInfo', callback?: AsyncCallback): void; + off(type: 'exposureInfoChange', callback?: AsyncCallback): void; /** * Subscribes aperture info event callback. * - * @param { 'apertureInfo' } type - Event type. + * @param { 'apertureInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the aperture info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'apertureInfo', callback: AsyncCallback): void; + on(type: 'apertureInfoChange', callback: AsyncCallback): void; /** * Unsubscribes from aperture info event callback. * - * @param { 'apertureInfo' } type - Event type. + * @param { 'apertureInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the aperture info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'apertureInfo', callback?: AsyncCallback): void; + off(type: 'apertureInfoChange', callback?: AsyncCallback): void; /** * Subscribes lumination info event callback. * - * @param { 'luminationInfo' } type - Event type. + * @param { 'luminationInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the lumination info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'luminationInfo', callback: AsyncCallback): void; + on(type: 'luminationInfoChange', callback: AsyncCallback): void; /** * Unsubscribes from lumination info event callback. * - * @param { 'luminationInfo' } type - Event type. + * @param { 'luminationInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the lumination info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'luminationInfo', callback?: AsyncCallback): void; + off(type: 'luminationInfoChange', callback?: AsyncCallback): void; } /** @@ -5926,98 +6112,98 @@ declare namespace camera { /** * Subscribes ISO info event callback. * - * @param { 'isoInfo' } type - Event type. + * @param { 'isoInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the ISO info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'isoInfo', callback: AsyncCallback): void; + on(type: 'isoInfoChange', callback: AsyncCallback): void; /** * Unsubscribes from ISO info event callback. * - * @param { 'isoInfo' } type - Event type. + * @param { 'isoInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the ISO info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'isoInfo', callback?: AsyncCallback): void; + off(type: 'isoInfoChange', callback?: AsyncCallback): void; /** * Subscribes exposure info event callback. * - * @param { 'exposureInfo' } type - Event type. + * @param { 'exposureInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the exposure info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'exposureInfo', callback: AsyncCallback): void; + on(type: 'exposureInfoChange', callback: AsyncCallback): void; /** * Unsubscribes from exposure info event callback. * - * @param { 'exposureInfo' } type - Event type. + * @param { 'exposureInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the exposure info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'exposureInfo', callback?: AsyncCallback): void; + off(type: 'exposureInfoChange', callback?: AsyncCallback): void; /** * Subscribes aperture info event callback. * - * @param { 'apertureInfo' } type - Event type. + * @param { 'apertureInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the aperture info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'apertureInfo', callback: AsyncCallback): void; + on(type: 'apertureInfoChange', callback: AsyncCallback): void; /** * Unsubscribes from aperture info event callback. * - * @param { 'apertureInfo' } type - Event type. + * @param { 'apertureInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the aperture info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'apertureInfo', callback?: AsyncCallback): void; + off(type: 'apertureInfoChange', callback?: AsyncCallback): void; /** * Subscribes lumination info event callback. * - * @param { 'luminationInfo' } type - Event type. + * @param { 'luminationInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the lumination info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - on(type: 'luminationInfo', callback: AsyncCallback): void; + on(type: 'luminationInfoChange', callback: AsyncCallback): void; /** * Unsubscribes from lumination info event callback. * - * @param { 'luminationInfo' } type - Event type. + * @param { 'luminationInfoChange' } type - Event type. * @param { AsyncCallback } callback - Callback used to get the lumination info. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ - off(type: 'luminationInfo', callback?: AsyncCallback): void; + off(type: 'luminationInfoChange', callback?: AsyncCallback): void; } /** @@ -7602,6 +7788,30 @@ declare namespace camera { release(): Promise; } + /** + * Enumerates the camera video codec type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + enum VideoCodecType { + /** + * Codec type AVC. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + AVC = 0, + + /** + * Codec type HEVC. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + HEVC = 1 + } /** * Photo output object. @@ -7698,6 +7908,33 @@ declare namespace camera { */ confirmCapture(); + /** + * Confirm if the raw image delivery is supported + * + * @returns { boolean } TRUE if the type of delivery image is support. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + isRawDeliverySupported(): boolean; + + /** + * Enable raw image image delivery. + * + * @param { boolean } enabled - Target state for raw image delivery. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400104 - Session not running. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enableRawDelivery(enabled: boolean): void; + /** * Confirm if the deferred image delivery supported in the specific device. * @@ -7742,6 +7979,26 @@ declare namespace camera { */ deferImageDelivery(type: DeferredDeliveryImageType): void; + /** + * Get supported moving photo video codec types. + * + * @returns { Array } An array of supported video codec types for moving photo. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + getSupportedMovingPhotoVideoCodecTypes(): Array; + + /** + * Sets codec type for moving photo, default to AVC. + * + * @param { VideoCodecType } codecType - Codec type for moving photo. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 13 + */ + setMovingPhotoVideoCodecType(codecType: VideoCodecType): void; + /** * Subscribes photo available event callback. * @@ -8249,6 +8506,37 @@ declare namespace camera { frameCount: number; } + /** + * Deferred video enhancement info. + * + * @typedef DeferredVideoEnhancementInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface DeferredVideoEnhancementInfo { + /** + * Check whether deferred video enhancement available. + * + * @type { boolean } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + * @readonly + */ + readonly isDeferredVideoEnhancementAvailable: boolean; + /** + * Video identifier. + * + * @type { ?string } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + * @readonly + */ + readonly videoId?: string; + } + /** * Video output object. * @@ -8363,6 +8651,67 @@ declare namespace camera { */ getVideoRotation(deviceDegree: number): ImageRotation; + /** + * Confirm if auto deferred video enhancement is supported in the specific device. + * + * @returns { boolean } TRUE if auto deferred video enhancement is supported. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + isAutoDeferredVideoEnhancementSupported(): boolean; + + /** + * Confirm if auto deferred video enhancement is enabled. + * + * @returns { boolean } TRUE if auto deferred video enhancement is enabled. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + isAutoDeferredVideoEnhancementEnabled(): boolean; + + /** + * Enable auto deferred video enhancement if needed. + * + * @param { boolean } enabled - Status of auto deferred video enhancement. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enableAutoDeferredVideoEnhancement(enabled: boolean): void; + + /** + * Subscribes deferred video enhancement info callback. + * + * @param { 'deferredVideoEnhancementInfo' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + on(type: 'deferredVideoEnhancementInfo', callback: AsyncCallback): void; + + /** + * Unsubscribes from deferred video enhancement info callback. + * + * @param { 'deferredVideoEnhancementInfo' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + off(type: 'deferredVideoEnhancementInfo', callback?: AsyncCallback): void; + /** * Subscribes frame start event callback. * @@ -8490,7 +8839,70 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @since 10 */ - FACE_DETECTION = 0 + FACE_DETECTION = 0, + + /** + * Human body detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + HUMAN_BODY = 1, + + /** + * Cat face detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + CAT_FACE = 2, + + /** + * Cat body detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + CAT_BODY = 3, + + /** + * Dog face detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + DOG_FACE = 4, + + /** + * Dog body detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + DOG_BODY = 5, + + /** + * Salient detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + SALIENT_DETECTION = 6, + + /** + * Barcode detection type. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + BAR_CODE_DETECTION = 7 } /** @@ -8581,6 +8993,52 @@ declare namespace camera { height: number; } + /** + * Enum for emotion type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + enum Emotion { + /** + * Emotion type: Neutral. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + NEUTRAL = 0, + + /** + * Emotion type: Sadness. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + SADNESS = 1, + + /** + * Emotion type: Smile. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + SMILE = 2, + + /** + * Emotion type: Surprise. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + SURPRISE = 3 + } + /** * Metadata object basis. * @@ -8616,6 +9074,228 @@ declare namespace camera { * @since 10 */ readonly boundingBox: Rect; + /** + * Metadata object id. + * + * @type { number } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly objectId: number; + /** + * Confidence for the detected type. + * + * @type { number } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly confidence: number; + } + + /** + * Metadata object for face. + * + * @typedef MetadataFaceObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataFaceObject extends MetadataObject { + /** + * Bounding box for left eye. + * + * @type { Rect } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly leftEyeBoundingBox: Rect; + + /** + * Bounding box for right eye. + * + * @type { Rect } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly rightEyeBoundingBox: Rect; + + /** + * Emotion type for face. + * + * @type { Emotion } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly emotion: Emotion; + + /** + * Emotion confidence. + * + * @type { number } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly emotionConfidence: number; + + /** + * Pitch angle for face. + * + * @type { number } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly pitchAngle: number; + + /** + * Yaw angle for face. + * + * @type { number } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly yawAngle: number; + + /** + * Roll angle for face. + * + * @type { number } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly rollAngle: number; + } + + /** + * Metadata object for human body. + * + * @typedef MetadataHumanBodyObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataHumanBodyObject extends MetadataObject { + } + + /** + * Metadata object for cat face. + * + * @typedef MetadataCatFaceObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataCatFaceObject extends MetadataObject { + /** + * Bounding box for left eye. + * + * @type { Rect } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly leftEyeBoundingBox: Rect; + + /** + * Bounding box for right eye. + * + * @type { Rect } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly rightEyeBoundingBox: Rect; + } + + /** + * Metadata object for cat body. + * + * @typedef MetadataCatBodyObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataCatBodyObject extends MetadataObject { + } + + /** + * Metadata object for dog face. + * + * @typedef MetadataDogFaceObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataDogFaceObject extends MetadataObject { + /** + * Bounding box for left eye. + * + * @type { Rect } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly leftEyeBoundingBox: Rect; + + /** + * Bounding box for right eye. + * + * @type { Rect } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly rightEyeBoundingBox: Rect; + } + + /** + * Metadata object for dog body. + * + * @typedef MetadataDogBodyObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataDogBodyObject extends MetadataObject { + } + + /** + * Metadata object for salient detection. + * + * @typedef MetadataSalientDetectionObject + * @extends MetadataObject + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + interface MetadataSalientDetectionObject extends MetadataObject { } /** @@ -8631,11 +9311,23 @@ declare namespace camera { * Check whether camera is occluded. * * @type { boolean } + * @readonly * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 */ readonly isCameraOccluded: boolean; + + /** + * Check whether camera lens is dirty. + * + * @type { boolean } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + readonly isCameraLensDirty: boolean; } /** @@ -8686,6 +9378,34 @@ declare namespace camera { */ stop(): Promise; + /** + * Add metadata object types. + * + * @param { Array } types - Object types to be added. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + addMetadataObjectTypes(types: Array): void; + + /** + * Remove metadata object types. + * + * @param { Array } types - Object types to be removed. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 13 + */ + removeMetadataObjectTypes(types: Array): void; + /** * Subscribes to metadata objects available event callback. * @@ -8726,6 +9446,393 @@ declare namespace camera { */ off(type: 'error', callback?: ErrorCallback): void; } + + /** + * Enumerates the timelapse recording state. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enum TimeLapseRecordState { + /** + * TimeLapse idle state. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + IDLE = 0, + + /** + * TimeLapse recording state. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + RECORDING = 1 + } + + /** + * Enumerates the timelapse preview type. + * + * @enum { number } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + enum TimeLapsePreviewType { + /** + * TimeLapse dark preview. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + DARK = 1, + + /** + * TimeLapse Light preview. + * + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + LIGHT = 2 + } + + /** + * Try AE information. + * + * @typedef TryAEInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface TryAEInfo { + /** + * Determine whether try AE is done. + * + * @type { boolean } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + readonly isTryAEDone: boolean; + + /** + * Determine whether AE hint is needed. + * + * @type { ?boolean } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + readonly isTryAEHintNeeded?: boolean; + + /** + * Timelapse preview type. + * + * @type { ?TimeLapsePreviewType } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + readonly previewType?: TimeLapsePreviewType; + + /** + * Timelapse capture interval. + * + * @type { ?number } + * @readonly + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + readonly captureInterval?: number; + } + + /** + * Timelapse photo session object. + * + * @interface TimeLapsePhotoSession + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + interface TimeLapsePhotoSession extends Session, Focus, ManualFocus, AutoExposure, ManualExposure, ManualIso, WhiteBalance, Zoom, ColorEffect { + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'error', callback?: ErrorCallback): void; + + /** + * Subscribes focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'focusStateChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'focusStateChange', callback?: AsyncCallback): void; + + /** + * Subscribes ISO info event callback. + * + * @param { 'isoInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the ISO info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'isoInfoChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from ISO info event callback. + * + * @param { 'isoInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the ISO info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'isoInfoChange', callback?: AsyncCallback): void; + + /** + * Subscribes exposure info event callback. + * + * @param { 'exposureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the exposure info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'exposureInfoChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from exposure info event callback. + * + * @param { 'exposureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the exposure info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'exposureInfoChange', callback?: AsyncCallback): void; + + /** + * Subscribes lumination info event callback. + * + * @param { 'luminationInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'luminationInfoChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from lumination info event callback. + * + * @param { 'luminationInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'luminationInfoChange', callback?: AsyncCallback): void; + + /** + * Check whether try AE is needed. + * + * @returns { boolean } Is try AE needed. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + isTryAENeeded(): boolean; + + /** + * Start try AE. + * + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + startTryAE(): void; + + /** + * Stop try AE. + * + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @throws { BusinessError } 7400201 - Camera service fatal error. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + stopTryAE(): void; + + /** + * Subscribes try AE info event callback. + * + * @param { 'tryAEInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the try AE info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + on(type: 'tryAEInfoChange', callback: AsyncCallback): void; + + /** + * Unsubscribes from try AE info event callback. + * + * @param { 'tryAEInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the try AE info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + off(type: 'tryAEInfoChange', callback?: AsyncCallback): void; + + /** + * Gets supported timelapse interval range. + * + * @returns { Array } Timelapse interval range. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config, only throw in session usage. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + getSupportedTimeLapseIntervalRange(): Array; + + /** + * Gets the timelapse interval in use. + * + * @returns { number } the timelapse interval in use. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + getTimeLapseInterval(): number; + + /** + * Sets a timelapse interval for a camera device. + * + * @param { number } interval The timelapse interval. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + setTimeLapseInterval(interval: number): void; + + /** + * Gets the timelapse recording state in use. + * + * @returns { TimeLapseRecordState } the timelapse recording state in use. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + getTimeLapseRecordState(): TimeLapseRecordState; + + /** + * Sets a timelapse recording state. + * + * @param { TimeLapseRecordState } state The timelapse recording state. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + setTimeLapseRecordState(state: TimeLapseRecordState): void; + + /** + * Gets the timelapse preview type in use. + * + * @returns { TimeLapsePreviewType } the timelapse preview type in use. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + getTimeLapsePreviewType(): TimeLapsePreviewType; + + /** + * Sets a timelapse preview type. + * + * @param { TimeLapsePreviewType } type The timelapse preview type. + * @throws { BusinessError } 202 - Not System Application. + * @throws { BusinessError } 7400101 - Parameter missing or parameter type incorrect. + * @throws { BusinessError } 7400103 - Session not config. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 12 + */ + setTimeLapsePreviewType(type: TimeLapsePreviewType): void; + } } export default camera; diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index 67024793a..2f0fae2bd 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -3404,7 +3404,7 @@ declare namespace image { * * @typedef PackingOptionsForSequence * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 12 + * @since 13 */ interface PackingOptionsForSequence { /** @@ -3412,7 +3412,7 @@ declare namespace image { * * @type { number } * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 12 + * @since 13 */ frameCount: number; @@ -3422,7 +3422,7 @@ declare namespace image { * * @type { Array } * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 12 + * @since 13 */ delayTimeList: Array; @@ -3431,7 +3431,7 @@ declare namespace image { * * @type { ?Array } * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 12 + * @since 13 */ disposalTypes?: Array; @@ -3441,7 +3441,7 @@ declare namespace image { * * @type { ?number } * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 12 + * @since 13 */ loopCount?: number; } @@ -6722,6 +6722,19 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; /** * Obtains the gain map pixel map. - * @returns { PixelMap|null } Returns the pixel map if the operation is successful; returns null otherwise. + * @returns { PixelMap | null } Returns the pixel map if the operation is successful; returns null otherwise. * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since 13 */ - getGainmapPixelmap(): PixelMap|null; + getGainmapPixelmap(): PixelMap | null; /** * Set auxiliary picture. @@ -6784,7 +6797,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise @@ -6823,7 +6836,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise @@ -6835,14 +6848,14 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; @@ -6918,7 +6931,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; @@ -6927,7 +6940,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise @@ -6956,7 +6969,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise @@ -6966,7 +6979,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } key Name of the properties whose value is to be obtained. - * @returns { Promise> } Array of Records instance used to return the property values. + * @returns { Promise> } Array of Records instance used to return the property values. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. * 2.Incorrect parameter types. 3.Parameter verification failed. * @throws { BusinessError } 7600202 - Unsupported metadata. Possible causes: 1. Unsupported metadata type. 2. The * metadata type does not match the auxiliary picture type. * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since 13 */ - getProperties(key: Array): Promise> + getProperties(key: Array): Promise> /** * Modify the value of properties in an image with the specified keys. * - * @param { Record } records Array of the property Records whose values are to + * @param { Record } records Array of the property Records whose values are to * be modified. * @returns { Promise } A Promise instance used to return the operation result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. @@ -7097,19 +7110,19 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise): Promise + setProperties(records: Record): Promise /** * Obtains the value of all properties in an image. This method uses a promise to return the property values * in array of records. * - * @returns { Promise> } Array of Records instance used to return the property values. + * @returns { Promise> } Array of Records instance used to return the property values. * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since 13 */ - getAllProperties(): Promise> + getAllProperties(): Promise> /** * Obtains a clone of metadata. This method uses a promise to return the metadata. @@ -7118,7 +7131,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } @@ -7128,40 +7141,40 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } * @syscap SystemCapability.Multimedia.Image.Core - * @since 12 + * @since 13 */ desiredAuxiliaryPictures: Array; } @@ -7187,7 +7200,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise @@ -8430,7 +8443,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } A Promise instance used to return the operation result. * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 12 + * @since 13 */ packing(pixelmapSequence: Array, options: PackingOptionsForSequence): Promise; @@ -8494,7 +8507,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } A Promise instance used to return the operation result. * @syscap SystemCapability.Multimedia.Image.ImagePacker - * @since 12 + * @since 13 */ packToFile(pixelmapSequence: Array, fd: number, options: PackingOptionsForSequence): Promise; @@ -8542,7 +8555,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise; @@ -8557,7 +8570,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise @@ -8769,7 +8782,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } callback Callback to be removed. * @syscap SystemCapability.Multimedia.Image.ImageReceiver - * @since 12 + * @since 13 */ off(type: 'imageArrival', callback?: AsyncCallback): void; @@ -8872,7 +8885,7 @@ function createUnpremultipliedPixelMap(src: PixelMap, dst: PixelMap): Promise } callback Callback to be removed. * @syscap SystemCapability.Multimedia.Image.ImageCreator - * @since 12 + * @since 13 */ off(type: 'imageRelease', callback?: AsyncCallback): void; diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index 89d31759c..b56531e19 100755 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -37,7 +37,7 @@ import type drm from './@ohos.multimedia.drm'; */ /** * @namespace media - * @syscap SystemCapability.Multimedia.Media + * @syscap SystemCapability.Multimedia.Media.Core * @crossplatform * @atomicservice * @since 12 diff --git a/api/@ohos.multimedia.systemSoundManager.d.ts b/api/@ohos.multimedia.systemSoundManager.d.ts index 77e37d0a5..cdee26f2d 100644 --- a/api/@ohos.multimedia.systemSoundManager.d.ts +++ b/api/@ohos.multimedia.systemSoundManager.d.ts @@ -318,6 +318,123 @@ declare namespace systemSoundManager { */ GENTLE = 1, } + /** + * Type definition of haptics in tone scenario. + * + * @typedef {RingtoneType | SystemToneType} ToneHapticsType + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + type ToneHapticsType = RingtoneType | SystemToneType; + + /** + * Enum for haptics mode in tone scenario. + * @enum {number} + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + enum ToneHapticsMode { + /** + * None haptics mode. + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + NONE = 0, + /** + * Haptics is synchronized with tone. + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + SYNC = 1, + + /** + * Haptics is out of synchronize with tone. + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + NON_SYNC = 2, + } + /** + * Haptics settings in tone scenario. + * @typedef ToneHapticsSettings + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + interface ToneHapticsSettings { + /** + * Haptics mode. + * @type { ToneHapticsMode } + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + mode: ToneHapticsMode; + /** + * Haptics uri. Users can set/get this parameter when {@link ToneHapticsSettings#mode} is + * {@link ToneHapticsMode#NON_SYC}. In other cases, this uri is useless and should be ignored. + * @type { ?string } + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + hapticsUri?: string; + } + + /** + * Haptics attributes in tone scenario. + * @typedef ToneHapticsAttrs + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + interface ToneHapticsAttrs { + /** + * Get haptics uri. + * @returns { string } Haptics uri. + * @throws { BusinessError } 202 - Caller is not a system application. + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + getUri(): string; + + /** + * Get title of haptics. + * @returns { string } Haptics title. + * @throws { BusinessError } 202 - Caller is not a system application. + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + getTitle(): string; + + /** + * Get file name of haptics. + * @returns { string } Haptics title. + * @throws { BusinessError } 202 - Caller is not a system application. + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + getFileName(): string; + } + + /** + * Type definition of tone haptics array. + * + * @typedef { Array } ToneHapticsAttrsArray + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + type ToneHapticsAttrsArray = Array; + /** * Gets system sound manager for all type sound. @@ -737,6 +854,96 @@ declare namespace systemSoundManager { * @since 12 */ removeCustomizedTone(context: BaseContext, uri:string): Promise; + + /** + * Get haptics settings. + * @param { BaseContext } context - Current application context. + * @param { ToneHapticsType } type - Tone haptics type. + * @returns { Promise } Promise used to return results of this call. + * @throws { BusinessError } 202 - Caller is not a system application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @throws { BusinessError } 5400103 - I/O error. + * @throws { BusinessError } 20700003 - Unsupported operation. + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + getToneHapticsSettings(context: BaseContext, type: ToneHapticsType): Promise; + + /** + * Set haptics settings. + * @param { BaseContext } context - Current application context. + * @param { ToneHapticsType } type - Tone haptics type. + * @param { ToneHapticsSettings } settings - Tone haptics settings. + * @returns { Promise } Promise used to return results of this call. + * @throws { BusinessError } 202 - Caller is not a system application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @throws { BusinessError } 5400102 - Operation not allowed. For example, the input URI is not valid. + * @throws { BusinessError } 5400103 - I/O error. + * @throws { BusinessError } 20700003 - Unsupported operation. + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + setToneHapticsSettings(context: BaseContext, type: ToneHapticsType, settings: ToneHapticsSettings): Promise; + + /** + * Get haptics list. + * @param { BaseContext } context - Current application context. + * @param { boolean } isSynced - The queried haptics is synchronized with tone or not. + * @returns { Promise } Promise used to return ToneHapticsAttrsArray. + * @throws { BusinessError } 202 - Caller is not a system application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @throws { BusinessError } 5400103 - I/O error. + * @throws { BusinessError } 20700003 - Unsupported operation. + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + getToneHapticsList(context: BaseContext, isSynced: boolean): Promise; + + /** + * Get attributes of haptics which is synchronized with one tone. If no haptics is found, then the attributes in + * the returned ToneHapticsAttrs is empty. + * @param { BaseContext } context - Current application context. + * @param { string } toneUri - Uri of tone to query. + * @returns { Promise } Promise used to return ToneHapticsAttrs. + * @throws { BusinessError } 202 - Caller is not a system application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @throws { BusinessError } 5400102 - Operation not allowed. For example, the input URI is not used for tones. + * @throws { BusinessError } 5400103 - I/O error. + * @throws { BusinessError } 20700003 - Unsupported operation. + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + getHapticsAttrsSyncedWithTone(context: BaseContext, toneUri: string): Promise; + + /** + * Open haptics. + * @param { BaseContext } context - Current application context. + * @param { string } hapticsUri - Uri of haptics to open. + * @returns { Promise } Promise used to return fd. + * @throws { BusinessError } 202 - Caller is not a system application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @throws { BusinessError } 5400102 - Operation not allowed. For example, the input URI is not one for haptics. + * @throws { BusinessError } 5400103 - I/O error. + * @throws { BusinessError } 20700003 - Unsupported operation. + * @syscap SystemCapability.Multimedia.SystemSound.Core + * @systemapi + * @since 13 + */ + openToneHaptics(context: BaseContext, hapticsUri: string): Promise; } /** diff --git a/api/@ohos.multimodalInput.gestureEvent.d.ts b/api/@ohos.multimodalInput.gestureEvent.d.ts index d85c332eb..61d0cdfba 100644 --- a/api/@ohos.multimodalInput.gestureEvent.d.ts +++ b/api/@ohos.multimodalInput.gestureEvent.d.ts @@ -190,6 +190,102 @@ export declare interface ThreeFingersTap { */ type: ActionType; } + +/** + * Defines a touchscreen gesture event. + * + * @interface TouchGestureEvent + * @syscap SystemCapability.MultimodalInput.Input.Core + * @systemapi hide for inner use + * @since 13 + */ +export declare interface TouchGestureEvent { + /** + * Gesture action type. + * + * @type { TouchGestureAction } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @systemapi hide for inner use + * @since 13 + */ + action: TouchGestureAction; + /** + * Collection of all touch points upon completion of the gesture. + * + * @type { Touch[] } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @systemapi hide for inner use + * @since 13 + */ + touches: Touch[]; +} + +/** + * Enumerates touchscreen gesture action types. + * + * @enum { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @systemapi hide for inner use + * @since 13 + */ +export declare enum TouchGestureAction { + /** + * Swiping down with multiple fingers. + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @systemapi hide for inner use + * @since 13 + */ + SWIPE_DOWN = 0, + /** + * Swiping up with multiple fingers. + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @systemapi hide for inner use + * @since 13 + */ + SWIPE_UP, + /** + * Swiping left with multiple fingers. + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @systemapi hide for inner use + * @since 13 + */ + SWIPE_LEFT, + /** + * Swiping right with multiple fingers. + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @systemapi hide for inner use + * @since 13 + */ + SWIPE_RIGHT, + /** + * Multi-finger pinching closed. + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @systemapi hide for inner use + * @since 13 + */ + PINCH_CLOSED, + /** + * Multi-finger pinching opened. + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @systemapi hide for inner use + * @since 13 + */ + PINCH_OPENED, + /** + * The gesture ends. + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @systemapi hide for inner use + * @since 13 + */ + GESTURE_END +} /** * Gesture action type diff --git a/api/@ohos.multimodalInput.inputConsumer.d.ts b/api/@ohos.multimodalInput.inputConsumer.d.ts index 6842452b4..57051db9d 100644 --- a/api/@ohos.multimodalInput.inputConsumer.d.ts +++ b/api/@ohos.multimodalInput.inputConsumer.d.ts @@ -25,8 +25,7 @@ import { Callback } from './@ohos.base'; * * @namespace inputConsumer * @syscap SystemCapability.MultimodalInput.Input.InputConsumer - * @systemapi hide for inner use - * @since 8 + * @since 13 */ declare namespace inputConsumer { /** @@ -89,6 +88,42 @@ declare namespace inputConsumer { isRepeat?: boolean; } + /** + * Defines the shortcut key structure. + * + * @typedef HotkeyOptions + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @since 13 + */ + interface HotkeyOptions { + /** + * Defines modifier keys. One or two modifier keys are supported. + * + * @type { Array } + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @since 13 + */ + preKeys: Array; + + /** + * Defines modified keys. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @since 13 + */ + finalKey: number; + + /** + * Whether to report repeated key events. By default, the value is true if it is left unspecified. + * + * @type { ?boolean } + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @since 13 + */ + isRepeat?: boolean; + } + /** * Shield mode. * @@ -194,6 +229,44 @@ declare namespace inputConsumer { * @since 11 */ function getShieldStatus(shieldMode: ShieldMode): boolean; + + /** + * Obtains all system hotkeys. This API uses a promise to return the result. + * + * @Returns { Promise> } All system hotkeys. + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @since 13 + */ + function getAllSystemHotkeys(): Promise>; + + /** + * Listening for hotkey event changes. + * + * @param { 'hotkeyChange' } type - Type of the hotkey events. + * @param { HotkeyOptions } hotkeyOptions - hotkey events. + * @param { Callback } callback - Callback used to return hotkey events. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 4200002 - The hotkey has been used by the system. You can call the {@Link + *
GetAllSystemHotkeys} interface to query all system hotkeys. + * @throws { BusinessError } 4200003 - The hotkey has been subscribed to by another. + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @since 13 + */ + function on(type: 'hotkeyChange', hotkeyOptions: HotkeyOptions, callback: Callback): void + + /** + * Unsubscribe from hotkey event changes. + * + * @param { 'hotkeyChange' } type - Type of the hotkey events. + * @param { HotkeyOptions } hotkeyOptions - Hotkey events. + * @param { Callback } callback - Callback used to return hotkey events. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @since 13 + */ + function off(type: 'hotkeyChange', hotkeyOptions: HotkeyOptions, callback?: Callback): void } export default inputConsumer; \ No newline at end of file diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 23b95de58..782f94d1d 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -627,6 +627,15 @@ declare namespace inputDevice { * @since 10 */ function getKeyboardRepeatRate(): Promise; + + /** + * Obtains the interval since the last input. + * + * @returns { Promise } Promise used to return the interval since the last input. + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 13 + */ + function getIntervalSinceLastInput(): Promise; } export default inputDevice; \ No newline at end of file diff --git a/api/@ohos.multimodalInput.inputMonitor.d.ts b/api/@ohos.multimodalInput.inputMonitor.d.ts index 80723eaa9..afb77bc1c 100644 --- a/api/@ohos.multimodalInput.inputMonitor.d.ts +++ b/api/@ohos.multimodalInput.inputMonitor.d.ts @@ -23,7 +23,7 @@ import { MouseEvent } from './@ohos.multimodalInput.mouseEvent'; import type display from './@ohos.display'; import type { TouchEvent } from './@ohos.multimodalInput.touchEvent'; import type { Rotate, Pinch, ThreeFingersSwipe, FourFingersSwipe, SwipeInward } from './@ohos.multimodalInput.gestureEvent'; -import type { ThreeFingersTap } from './@ohos.multimodalInput.gestureEvent'; +import type { ThreeFingersTap, TouchGestureEvent } from './@ohos.multimodalInput.gestureEvent'; import type { FingerprintEvent } from './@ohos.multimodalInput.shortKey'; /** @@ -462,5 +462,77 @@ declare namespace inputMonitor { * @since 12 */ function off(type: 'swipeInward', receiver?: Callback): void; + + /** + * Enables listening touchscreen swipe gesture events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param { 'touchscreenSwipe' } type - Touchscreen gesture type. + * @param { number } fingers - Number of fingers. + * @param { Callback } receiver - Callback used to receive reported data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Caller is not a system application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.MultimodalInput.Input.InputMonitor + * @systemapi hide for inner use + * @since 13 + */ + function on(type: 'touchscreenSwipe', fingers: number, receiver: Callback): void; + + /** + * Disables listening touchscreen swipe gesture events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param { 'touchscreenSwipe' } type - Touchscreen gesture type. + * @param { number } fingers - Number of fingers. + * @param { Callback } receiver - Callback used to receive reported data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Caller is not a system application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.MultimodalInput.Input.InputMonitor + * @systemapi hide for inner use + * @since 13 + */ + function off(type: 'touchscreenSwipe', fingers: number, receiver?: Callback): void; + + /** + * Enables listening touchscreen pinch gesture events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param { 'touchscreenPinch' } type - Touch screen gesture type. + * @param { number } fingers - Number of fingers. + * @param { Callback } receiver - Callback used to receive reported data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Caller is not a system application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.MultimodalInput.Input.InputMonitor + * @systemapi hide for inner use + * @since 13 + */ + function on(type: 'touchscreenPinch', fingers: number, receiver: Callback): void; + + /** + * Disables listening touchscreen pinch gesture events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param { 'touchscreenPinch' } type - Touchscreen gesture type. + * @param { number } fingers - Number of fingers. + * @param { Callback } receiver - Callback used to receive reported data. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Caller is not a system application. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.MultimodalInput.Input.InputMonitor + * @systemapi hide for inner use + * @since 13 + */ + function off(type: 'touchscreenPinch', fingers: number, receiver?: Callback): void; } export default inputMonitor; diff --git a/api/@ohos.multimodalInput.keyCode.d.ts b/api/@ohos.multimodalInput.keyCode.d.ts index eaa6a151d..ed4f3e1eb 100644 --- a/api/@ohos.multimodalInput.keyCode.d.ts +++ b/api/@ohos.multimodalInput.keyCode.d.ts @@ -66,6 +66,14 @@ export declare enum KeyCode { */ KEYCODE_BACK = 2, + /** + * KEYCODE_SEARCH + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 13 + */ + KEYCODE_SEARCH = 9, + /** * KEYCODE_MEDIA_PLAY_PAUSE * diff --git a/api/@ohos.net.ethernet.d.ts b/api/@ohos.net.ethernet.d.ts index 56051bb10..081ea032c 100644 --- a/api/@ohos.net.ethernet.d.ts +++ b/api/@ohos.net.ethernet.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 Huawei Device Co., Ltd. + * Copyright (C) 2022-2024 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 @@ -235,6 +235,20 @@ declare namespace ethernet { */ function off(type: 'interfaceStateChange', callback?: Callback): void; + /** + * Get the ethernet mac address list. + * @permission ohos.permission.GET_ETHERNET_LOCAL_MAC + * @returns { Promise> } the promise returned by the function. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Non-system applications use system APIs. + * @throws { BusinessError } 2200002 - Operation failed. Cannot connect to service. + * @throws { BusinessError } 2201005 - Device information does not exist. + * @syscap SystemCapability.Communication.NetManager.Ethernet + * @systemapi Hide this for inner system use. + * @since 13 + */ + function getMacAddress(): Promise>; + /** * Defines the network configuration for the Ethernet connection. * @interface InterfaceConfiguration @@ -382,6 +396,33 @@ declare namespace ethernet { */ LAN_DHCP = 3 } + + /** + * Defines the mac address info of the Ethernet. + * @interface MacAddressInfo + * @syscap SystemCapability.Communication.NetManager.Ethernet + * @systemapi Hide this for inner system use. + * @since 13 + */ + export interface MacAddressInfo { + /** + * Ethernet interface name. + * @type { string } + * @syscap SystemCapability.Communication.NetManager.Ethernet + * @systemapi Hide this for inner system use. + * @since 13 + */ + iface: string; + + /** + * Ethernet specific mac address. + * @type { string } + * @syscap SystemCapability.Communication.NetManager.Ethernet + * @systemapi Hide this for inner system use. + * @since 13 + */ + macAddress: string; + } } export default ethernet; \ No newline at end of file diff --git a/api/@ohos.net.webSocket.d.ts b/api/@ohos.net.webSocket.d.ts index fb14dca02..8812ca63e 100644 --- a/api/@ohos.net.webSocket.d.ts +++ b/api/@ohos.net.webSocket.d.ts @@ -410,6 +410,7 @@ declare namespace webSocket { * @param { AsyncCallback } callback - the callback of connect. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 2302999 - Websocket other unknown error. * @syscap SystemCapability.Communication.NetStack * @crossplatform * @since 10 @@ -421,11 +422,28 @@ declare namespace webSocket { * @param { AsyncCallback } callback - the callback of connect. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 2302999 - Websocket other unknown error. * @syscap SystemCapability.Communication.NetStack * @crossplatform * @atomicservice * @since 11 */ + /** + * Initiates a WebSocket request to establish a WebSocket connection to a given URL. + * @permission ohos.permission.INTERNET + * @param { string } url URL for establishing a WebSocket connection. + * @param { AsyncCallback } callback - the callback of connect. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 2302001 - Websocket url error. + * @throws { BusinessError } 2302002 - Websocket certificate file does not exist. + * @throws { BusinessError } 2302003 - Websocket connection already exists. + * @throws { BusinessError } 2302999 - Websocket other unknown error. + * @syscap SystemCapability.Communication.NetStack + * @crossplatform + * @atomicservice + * @since 12 + */ connect(url: string, callback: AsyncCallback): void; /** @@ -447,6 +465,7 @@ declare namespace webSocket { * @param { AsyncCallback } callback - the callback of connect. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 2302999 - Websocket other unknown error. * @syscap SystemCapability.Communication.NetStack * @crossplatform * @since 10 @@ -459,11 +478,29 @@ declare namespace webSocket { * @param { AsyncCallback } callback - the callback of connect. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 2302999 - Websocket other unknown error. * @syscap SystemCapability.Communication.NetStack * @crossplatform * @atomicservice * @since 11 */ + /** + * Initiates a WebSocket request to establish a WebSocket connection to a given URL. + * @permission ohos.permission.INTERNET + * @param { string } url URL for establishing a WebSocket connection. + * @param { WebSocketRequestOptions } options - Optional parameters {@link WebSocketRequestOptions}. + * @param { AsyncCallback } callback - the callback of connect. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 2302001 - Websocket url error. + * @throws { BusinessError } 2302002 - Websocket certificate file does not exist. + * @throws { BusinessError } 2302003 - Websocket connection already exists. + * @throws { BusinessError } 2302999 - Websocket other unknown error. + * @syscap SystemCapability.Communication.NetStack + * @crossplatform + * @atomicservice + * @since 12 + */ connect(url: string, options: WebSocketRequestOptions, callback: AsyncCallback): void; /** @@ -485,6 +522,7 @@ declare namespace webSocket { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 2302999 - Websocket other unknown error. * @syscap SystemCapability.Communication.NetStack * @crossplatform * @since 10 @@ -497,11 +535,29 @@ declare namespace webSocket { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 2302999 - Websocket other unknown error. * @syscap SystemCapability.Communication.NetStack * @crossplatform * @atomicservice * @since 11 */ + /** + * Initiates a WebSocket request to establish a WebSocket connection to a given URL. + * @permission ohos.permission.INTERNET + * @param { string } url URL for establishing a WebSocket connection. + * @param { WebSocketRequestOptions } options - Optional parameters {@link WebSocketRequestOptions}. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 2302001 - Websocket url error. + * @throws { BusinessError } 2302002 - Websocket certificate file does not exist. + * @throws { BusinessError } 2302003 - Websocket connection already exists. + * @throws { BusinessError } 2302999 - Websocket other unknown error. + * @syscap SystemCapability.Communication.NetStack + * @crossplatform + * @atomicservice + * @since 12 + */ connect(url: string, options?: WebSocketRequestOptions): Promise; /** diff --git a/api/@ohos.notificationManager.d.ts b/api/@ohos.notificationManager.d.ts index b057c9295..4fe550e90 100644 --- a/api/@ohos.notificationManager.d.ts +++ b/api/@ohos.notificationManager.d.ts @@ -2164,7 +2164,7 @@ declare namespace notificationManager { * @since 12 */ function setSmartReminderEnabled(deviceType: string, enable: boolean): Promise; - + /** * Obtains whether an application supports smart reminders across devices. * @@ -2186,7 +2186,7 @@ declare namespace notificationManager { * @since 12 */ function isSmartReminderEnabled(deviceType: string): Promise; - + /** * Obtains the remind modes of the notification. * @@ -2767,6 +2767,26 @@ declare namespace notificationManager { */ function openNotificationSettings(context: UIAbilityContext): Promise; + /** + * Get do not disturb profile by id. + * + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @param { number } id - The id of profile. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. 3. Parameter verification failed. + * @throws { BusinessError } 1600001 - Internal error. + * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. + * @throws { BusinessError } 1600003 - Failed to connect to the service. + * @throws { BusinessError } 1600019 - profile not existed. + * @syscap SystemCapability.Notification.Notification + * @systemapi + * @since 13 + */ + function getDoNotDisturbProfile(id: number): Promise; + /** * Describes a button option for a triggering. * diff --git a/api/@ohos.pasteboard.d.ts b/api/@ohos.pasteboard.d.ts index 560cf4237..c6a219b9a 100755 --- a/api/@ohos.pasteboard.d.ts +++ b/api/@ohos.pasteboard.d.ts @@ -343,6 +343,34 @@ declare namespace pasteboard { CROSSDEVICE } + /** + * Enumerates the patterns allowed in the system pasteboard. + * @enum { number } + * @syscap SystemCapability.MiscServices.Pasteboard + * @since 13 + */ + enum Pattern { + /** + * URL pattern. + * @syscap SystemCapability.MiscServices.Pasteboard + * @since 13 + */ + URL = 0, + /** + * Number pattern. + * @syscap SystemCapability.MiscServices.Pasteboard + * @since 13 + */ + NUMBER = 1, + /** + * Email address pattern. + * @syscap SystemCapability.MiscServices.Pasteboard + * @since 13 + */ + EMAIL_ADDRESS = 2, + } + + /** * Paste data property. * @interface PasteDataProperty @@ -1497,6 +1525,19 @@ declare namespace pasteboard { * @since 12 */ removeAppShareOptions(): void; + + /** + * Detects the patterns in the pasteboard. + * + * @param { Array } patterns - Patterns to detect. + * @returns { Promise> } Promise used to return the patterns detected. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.MiscServices.Pasteboard + * @since 13 + */ + detectPatterns(patterns: Array): Promise>; } } diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index 5c8fc1b44..530510e51 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -522,8 +522,7 @@ declare namespace backgroundTaskManager { * Voice over Internet Phone mode * * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - * @systemapi Hide this for inner system use. - * @since 9 + * @since 13 */ VOIP = 8, diff --git a/api/@ohos.screen.d.ts b/api/@ohos.screen.d.ts index 92c0604b1..91e7f8c2c 100644 --- a/api/@ohos.screen.d.ts +++ b/api/@ohos.screen.d.ts @@ -363,6 +363,108 @@ declare namespace screen { */ function setScreenRotationLocked(isLocked: boolean): Promise; + /** + * Set multi screen mode(mirror/extend). + * + * @param { number } primaryScreenId - primary screen id. + * @param { number } secondaryScreenId - secondary screen id. + * @param { MultiScreenMode } secondaryScreenMode - secondary screen mode. + * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws { BusinessError } 1400003 - This display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 13 + */ + function setMultiScreenMode(primaryScreenId: number, secondaryScreenId: number, + secondaryScreenMode: MultiScreenMode): Promise; + + /** + * Set multi screen relative position. + * + * @param { MultiScreenPositionOptions } mainScreenOptions - main screen position. + * @param { MultiScreenPositionOptions } secondaryScreenOptions - secondary screen position. + * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws { BusinessError } 1400003 - This display manager service works abnormally. + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 13 + */ + function setMultiScreenRelativePosition(mainScreenOptions: MultiScreenPositionOptions, + secondaryScreenOptions: MultiScreenPositionOptions): Promise; + + /** + * Indicate the screen mode + * + * @enum { number } + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 13 + */ + enum MultiScreenMode { + + /** + * Indicate that the screen is in mirror mode. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 13 + */ + SCREEN_MIRROR = 0, + + /** + * Indicate that the screen is in extend mode. + * + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 13 + */ + SCREEN_EXTEND = 1 + } + + /** + * The parameter of making extend screen + * + * @interface MultiScreenPositionOptions + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 13 + */ + interface MultiScreenPositionOptions { + /** + * Screen id + * + * @type { number } + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 13 + */ + id: number; + + /** + * The start coordinate X of the screen origin + * + * @type { number } + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 13 + */ + startX: number; + + /** + * The start coordinate Y of the screen origin + * + * @type { number } + * @syscap SystemCapability.WindowManager.WindowManager.Core + * @systemapi Hide this for inner system use. + * @since 13 + */ + startY: number; + } + /** * The parameter of making expand screen * diff --git a/api/@ohos.security.asset.d.ts b/api/@ohos.security.asset.d.ts index 4f7a94bd2..e0f6f3928 100644 --- a/api/@ohos.security.asset.d.ts +++ b/api/@ohos.security.asset.d.ts @@ -943,6 +943,13 @@ declare namespace asset { * @since 12 */ OPERATION_TYPE = TagType.NUMBER | 0x46, + /** + * A tag whose value is a bool indicating whether the attributes of an asset are required to be encrypted. + * + * @syscap SystemCapability.Security.Asset + * @since 13 + */ + REQUIRE_ATTR_ENCRYPTED = TagType.BOOL | 0x47, } /** diff --git a/api/@ohos.uiExtensionHost.d.ts b/api/@ohos.uiExtensionHost.d.ts index 744db9edf..d234c1ddc 100644 --- a/api/@ohos.uiExtensionHost.d.ts +++ b/api/@ohos.uiExtensionHost.d.ts @@ -134,6 +134,26 @@ declare namespace uiExtensionHost { * @systemapi * @since 11 */ + /** + * Hide the non-secure windows. + * When called by modal UIExtension and shouldHide == false, the "ohos.permission.ALLOW_SHOW_NON_SECURE_WINDOWS" permission is required. + * + * @permission ohos.permission.ALLOW_SHOW_NON_SECURE_WINDOWS + * @param { boolean } shouldHide - Hide the non-secure windows if true, otherwise means the opposite. + * @returns { Promise } - The promise returned by the function. + * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 1300002 - Abnormal state. Possible causes: + *
1. Permission denied. Interface caller does not have permission "ohos.permission.ALLOW_SHOW_NON_SECURE_WINDOWS". + *
2. The UIExtension window proxy is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ hideNonSecureWindows(shouldHide: boolean): Promise; /** diff --git a/api/@ohos.util.d.ts b/api/@ohos.util.d.ts index 5deee3f6b..400852172 100644 --- a/api/@ohos.util.d.ts +++ b/api/@ohos.util.d.ts @@ -3643,7 +3643,7 @@ declare namespace util { * * @param { Object } value - A included in the isAnyArrayBuffer value * @returns { boolean } Returns true if the value is an instance of one of the ArrayBuffer views, - * such as typed array objects or DataView. Equivalent to ArrayBuffer.isView(). + * such as typed array objects or DataView. * @syscap SystemCapability.Utils.Lang * @since 8 */ @@ -3652,7 +3652,7 @@ declare namespace util { * * @param { Object } value - A included in the isAnyArrayBuffer value * @returns { boolean } Returns true if the value is an instance of one of the ArrayBuffer views, - * such as typed array objects or DataView. Equivalent to ArrayBuffer.isView(). + * such as typed array objects or DataView. * @syscap SystemCapability.Utils.Lang * @crossplatform * @since 10 @@ -3662,7 +3662,7 @@ declare namespace util { * * @param { Object } value - A included in the isAnyArrayBuffer value * @returns { boolean } Returns true if the value is an instance of one of the ArrayBuffer views, - * such as typed array objects or DataView. Equivalent to ArrayBuffer.isView(). + * such as typed array objects or DataView. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index dc9620e80..07c91ebdc 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -395,14 +395,14 @@ declare namespace webview { * @enum {number} * @syscap SystemCapability.Web.Webview.Core * @atomicservice - * @since 12 + * @since 14 */ enum PressureLevel { /** * Modules are advised to free buffers that are cheap to re-allocate and not immediately needed. * @syscap SystemCapability.Web.Webview.Core * @atomicservice - * @since 12 + * @since 14 */ MEMORY_PRESSURE_LEVEL_MODERATE = 1, @@ -410,7 +410,7 @@ declare namespace webview { * At this level, modules are advised to free all possible memory. * @syscap SystemCapability.Web.Webview.Core * @atomicservice - * @since 12 + * @since 14 */ MEMORY_PRESSURE_LEVEL_CRITICAL = 2 } @@ -612,6 +612,115 @@ declare namespace webview { isCodeCacheSupported?: boolean; } + /** + * Defines the callback of createPdf, related to {@link createPDF} method. + * + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + class PdfData { + /** + * Return the data stream generated by the webpage. + * + * @returns { Uint8Array } return pdf data. + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + pdfArrayBuffer(): Uint8Array; + } + + /** + * Defines the configuration of creating pdf, related to {@Link createPdf} method. + * + * @typedef PdfConfiguration + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + interface PdfConfiguration { + /** + * Number of the width. + * + * @type { number } + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + width: number; + + /** + * Number of the height. + * + * @type { number } + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + height: number; + + /** + * Number of the marginTop. + * + * @type { number } + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + marginTop: number; + + /** + * Number of the marginBottom. + * + * @type { number } + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + marginBottom: number; + + /** + * Number of the marginRight. + * + * @type { number } + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + marginRight: number; + + /** + * Number of the marginLeft. + * + * @type { number } + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + marginLeft: number; + + /** + * Number of the scaling. + * + * @type { ?number } + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + scale?: number; + + /** + * Whether background should be printed when creating pdf. + * + * @type { ?boolean } + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + shouldPrintBackground?: boolean; + } + /** * Provides basic information of web storage. * @@ -727,7 +836,7 @@ declare namespace webview { * @typedef ScrollOffset * @syscap SystemCapability.Web.Webview.Core * @atomicservice - * @since 12 + * @since 13 */ interface ScrollOffset { /** @@ -735,18 +844,18 @@ declare namespace webview { * @type { number } * @syscap SystemCapability.Web.Webview.Core * @atomicservice - * @since 12 + * @since 13 */ - horizontal: number; + x: number; /** * Get the vertical offset. * @type { number } * @syscap SystemCapability.Web.Webview.Core * @atomicservice - * @since 12 + * @since 13 */ - vertical: number; + y: number; } /** @@ -1300,6 +1409,21 @@ declare namespace webview { */ static fetchCookie(url: string): Promise; + /** + * Gets all cookies for the given URL Asynchronously. + * + * @param { string } url - The URL for which the cookies are requested. + * @param { boolean } incognito - {@code true} gets all cookies for the given URL + * in incognito mode; {@code false} otherwise. + * @returns { Promise } - A promise resolved after the cookies of given URL have been gotten. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 17100002 - Invalid url. + * @syscap SystemCapability.Web.Webview.Core + * @since 13 + */ + static fetchCookie(url: string, incognito: boolean): Promise; + /** * Gets all cookies for the given URL Asynchronously. * @@ -1348,6 +1472,24 @@ declare namespace webview { */ static configCookieSync(url: string, value: string, incognito?: boolean): void; + /** + * Set a single cookie (key-value pair) for the given URL. + * + * @param { string } url - The URL for which the cookie is to be set. + * @param { string } value - The cookie as a string, using the format of the 'Set-Cookie' HTTP response header. + * @param { boolean } incognito - {@code true} set a single cookie (key-value pair) for the given URL + * in incognito mode; {@code false} otherwise. + * @param { boolean } includeHttpOnly - {@code true} HTTP-only cookies can also be overwritten; + * {@code false} otherwise. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 17100002 - Invalid url. + * @throws { BusinessError } 17100005 - Invalid cookie value. + * @syscap SystemCapability.Web.Webview.Core + * @since 13 + */ + static configCookieSync(url: string, value: string, incognito: boolean, includeHttpOnly: boolean): void; + /** * Set a single cookie (key-value pair) for the given URL Asynchronously. * @@ -1365,6 +1507,25 @@ declare namespace webview { */ static configCookie(url: string, value: string): Promise; + /** + * Set a single cookie (key-value pair) for the given URL Asynchronously. + * + * @param { string } url - The URL for which the cookie is to be set. + * @param { string } value - The cookie as a string, using the format of the 'Set-Cookie' HTTP response header. + * @param { boolean } incognito - {@code true} set a single cookie (key-value pair) for the given URL + * in incognito mode; {@code false} otherwise. + * @param { boolean } includeHttpOnly - {@code true} HTTP-only cookies can also be overwritten; + * {@code false} otherwise. + * @returns { Promise } - A promise resolved after the cookies of given URL have been set. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 17100002 - Invalid url. + * @throws { BusinessError } 17100005 - Invalid cookie value. + * @syscap SystemCapability.Web.Webview.Core + * @since 13 + */ + static configCookie(url: string, value: string, incognito: boolean, includeHttpOnly: boolean): Promise; + /** * Set a single cookie (key-value pair) for the given URL Asynchronously. * @@ -3867,6 +4028,37 @@ declare namespace webview { */ runJavaScriptExt(script: string | ArrayBuffer, callback: AsyncCallback): void; + /** + * Execute createPdf code in the context of the currently displayed page and return the result. + * + * @param { PdfConfiguration } configuration - createPdf configuration. + * @param { AsyncCallback } callback - Callbacks execute createPdf results. + * @throws { BusinessError } 401 - Invalid input parameter. + * @throws { BusinessError } 17100001 - Init error. + * The WebviewController must be associated with a Web component. + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + createPdf(configuration: PdfConfiguration, callback: AsyncCallback): void; + + /** + * Execute createPdf code in the context of the currently displayed page and return the result. + * + * @param { PdfConfiguration } configuration - createPdf configuration. + * @returns { Promise } A promise is solved after the createPdf is executed. + * This parameter will be the result of createPdf execution. + * If the createPdf fails to execute or has no return value, + * a none type value will be returned. + * @throws { BusinessError } 401 - Invalid input parameter. + * @throws { BusinessError } 17100001 - Init error. + * The WebviewController must be associated with a Web component. + * @syscap SystemCapability.Web.Webview.Core + * @atomicservice + * @since 14 + */ + createPdf(configuration: PdfConfiguration): Promise; + /** * Gets the url of current Web page. * @returns { string } Return the url of the current page. @@ -4139,7 +4331,7 @@ declare namespace webview { * @syscap SystemCapability.Web.Webview.Core * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ scrollTo(x: number, y: number, duration?: number): void; @@ -4181,7 +4373,7 @@ declare namespace webview { * @syscap SystemCapability.Web.Webview.Core * @crossplatform * @atomicservice - * @since 12 + * @since 13 */ scrollBy(deltaX: number, deltaY: number, duration?: number): void; @@ -4582,7 +4774,7 @@ declare namespace webview { * @atomicservice * @since 12 */ - getLastJavascriptProxyCallingFrameUrl(): string + getLastJavascriptProxyCallingFrameUrl(): string; /** * Start current camera. @@ -4805,7 +4997,7 @@ declare namespace webview { * @atomicservice * @since 12 */ - onCreateNativeMediaPlayer(callback: CreateNativeMediaPlayerCallback): void + onCreateNativeMediaPlayer(callback: CreateNativeMediaPlayerCallback): void; /** * Set enable overall web caching @@ -5052,7 +5244,7 @@ declare namespace webview { *
2. Parameter string is too long. 3.Parameter verification failed. * @syscap SystemCapability.Web.Webview.Core * @atomicservice - * @since 12 + * @since 14 */ static trimMemoryByPressureLevel(level: PressureLevel): void; @@ -5084,7 +5276,7 @@ declare namespace webview { * @returns { ScrollOffset } scroll offset * @syscap SystemCapability.Web.Webview.Core * @atomicservice - * @since 12 + * @since 13 */ getScrollOffset(): ScrollOffset; @@ -6992,7 +7184,7 @@ declare namespace webview { * @since 12 */ type CreateNativeMediaPlayerCallback = - (handler: NativeMediaPlayerHandler, mediaInfo: MediaInfo) => NativeMediaPlayerBridge + (handler: NativeMediaPlayerHandler, mediaInfo: MediaInfo) => NativeMediaPlayerBridge; /** * This class is used to set adblock config. diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index cfc94bfd0..da8b96cd9 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -115,6 +115,16 @@ declare namespace wifiManager { * @atomicservice * @since 12 */ + /** + * Query the Wi-Fi status + * @returns { boolean } Returns {@code true} if the Wi-Fi is active, returns {@code false} otherwise. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @crossplatform + * @atomicservice + * @since 13 + */ function isWifiActive(): boolean; /** diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 1ee00f22b..0f2adc590 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -2885,6 +2885,23 @@ declare namespace window { */ function getSnapshot(windowId: number): Promise; + /** + * Get windows by coordinate. + * + * @param { number } displayId - Indicate the id of display. + * @param { number } windowNumber - Indicate the Number of query windows. + * @param { number } x - Indicate the X-coordinate of the window. + * @param { number } y - Indicate the Y-coordinate of the window. + * @returns { Promise> } Promise used to return the window. + * @throws { BusinessError } 401 - Parameter error. Possible cause: Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 14 + */ + function getWindowsByCoordinate(displayId: number, windowNumber?: number, x?: number, y?: number): Promise>; + /** * Register the callback of systemBarTintChange * @@ -6232,6 +6249,23 @@ declare namespace window { */ setWindowFocusable(isFocusable: boolean, callback: AsyncCallback): void; + /** + * Window requests to get focus or lose focus. + * + * @param { boolean } isFocused - Window requests to get focus if true, requests to lose focus if false. + * @returns { Promise } - Promise that returns no value. + * @throws { BusinessError } 202 - Permission verification failed, non-system application uses system API. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. + * @syscap SystemCapability.Window.SessionManager + * @systemapi + * @since 13 + */ + requestFocus(isFocused: boolean): Promise; + /** * Sets whether keep screen on or not. * @@ -7630,6 +7664,22 @@ declare namespace window { */ setTitleButtonVisible(isMaximizeVisible: boolean, isMinimizeVisible: boolean, isSplitVisible: boolean): void; + /** + * Set whether to display the maximize, minimize buttons of main window. + * + * @param { boolean } isMaximizeVisible - Display maximize button if true, or hide maximize button if false. + * @param { boolean } isMinimizeVisible - Display minimize button if true, or hide minimize button if false. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300004 - Unauthorized operation. + * @syscap SystemCapability.Window.SessionManager + * @atomicservice + * @since 14 + */ + setWindowTitleButtonVisible(isMaximizeVisible: boolean, isMinimizeVisible: boolean): void; + /** * Enable landscape multiWindow * @@ -8675,6 +8725,40 @@ declare namespace window { */ off(eventType: 'windowStageEvent', callback?: Callback): void; + /** + * Window stage close callback on. + * + * @param { 'windowStageClose' } eventType The value is fixed at 'windowStageClose', indicating the window stage close event. + * @param { Callback } callback Callback function requires a boolean return value to determine whether to close the current main window. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @stagemodelonly + * @atomicservice + * @since 14 + */ + on(eventType: 'windowStageClose', callback: Callback): void; + + /** + * Window stage close callback off. + * + * @param { 'windowStageClose' } eventType The value is fixed at 'windowStageClose', indicating the window stage close event. + * @param { Callback } callback Callback function requires a boolean return value to determine whether to close the current main window. + * @throws { BusinessError } 401 - Parameter error. Possible cause: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. Failed to call the API due to limited device capabilities. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @syscap SystemCapability.Window.SessionManager + * @stagemodelonly + * @atomicservice + * @since 14 + */ + off(eventType: 'windowStageClose', callback?: Callback): void; + /** * Disable window decoration. It must be called before loadContent. * @@ -8751,7 +8835,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. * @stagemodelonly - * @since 12 + * @since 14 */ enum ExtensionWindowAttribute { /** @@ -8760,7 +8844,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. * @stagemodelonly - * @since 12 + * @since 14 */ SYSTEM_WINDOW, @@ -8770,7 +8854,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. * @stagemodelonly - * @since 12 + * @since 14 */ SUB_WINDOW } @@ -8782,7 +8866,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. * @stagemodelonly - * @since 12 + * @since 14 */ interface SystemWindowOptions { /** @@ -8792,7 +8876,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. * @stagemodelonly - * @since 12 + * @since 14 */ windowType: WindowType; } @@ -8804,7 +8888,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. * @stagemodelonly - * @since 12 + * @since 14 */ interface ExtensionWindowConfig { /** @@ -8814,7 +8898,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. * @stagemodelonly - * @since 12 + * @since 14 */ windowName: string; @@ -8825,7 +8909,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. * @stagemodelonly - * @since 12 + * @since 14 */ windowAttribute: ExtensionWindowAttribute; @@ -8836,7 +8920,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. * @stagemodelonly - * @since 12 + * @since 14 */ windowRect: Rect; @@ -8847,7 +8931,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. * @stagemodelonly - * @since 12 + * @since 14 */ subWindowOptions?: SubWindowOptions; @@ -8858,7 +8942,7 @@ declare namespace window { * @syscap SystemCapability.Window.SessionManager * @systemapi Hide this for inner system use. * @stagemodelonly - * @since 12 + * @since 14 */ systemWindowOptions?: SystemWindowOptions; } diff --git a/api/@ohos.worker.d.ts b/api/@ohos.worker.d.ts index 92a7a2941..bf7c7a511 100644 --- a/api/@ohos.worker.d.ts +++ b/api/@ohos.worker.d.ts @@ -2125,7 +2125,7 @@ declare namespace worker { * * @extends ThreadWorker * @syscap SystemCapability.Utils.Lang - * @atomicservice + * @systemapi * @since 12 */ class RestrictedWorker extends ThreadWorker { @@ -2155,7 +2155,7 @@ declare namespace worker { * @throws { BusinessError } 10200003 - Worker initialization failure. * @throws { BusinessError } 10200007 - The worker file patch is invalid path. * @syscap SystemCapability.Utils.Lang - * @atomicservice + * @systemapi * @since 12 */ constructor(scriptURL: string, options?: WorkerOptions); diff --git a/api/application/AbilityDelegator.d.ts b/api/application/AbilityDelegator.d.ts index 632338881..94c232d72 100644 --- a/api/application/AbilityDelegator.d.ts +++ b/api/application/AbilityDelegator.d.ts @@ -79,7 +79,7 @@ export interface AbilityDelegator { * @param { AbilityMonitor } monitor - AbilityMonitor object * @param { AsyncCallback } callback - The callback of addAbilityMonitor. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - AddAbilityMonitor failed. + * @throws { BusinessError } 16000100 - Calling AddAbilityMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -114,7 +114,7 @@ export interface AbilityDelegator { * @param { AbilityMonitor } monitor - AbilityMonitor object * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - AddAbilityMonitor failed. + * @throws { BusinessError } 16000100 - Calling AddAbilityMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -137,7 +137,7 @@ export interface AbilityDelegator { * * @param { AbilityMonitor } monitor - AbilityMonitor object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - AddAbilityMonitorSync failed. + * @throws { BusinessError } 16000100 - Calling AddAbilityMonitorSync failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -172,7 +172,7 @@ export interface AbilityDelegator { * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. * @param { AsyncCallback } callback - The callback of addAbilityStageMonitor. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - AddAbilityStageMonitor failed. + * @throws { BusinessError } 16000100 - Calling AddAbilityStageMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -207,7 +207,7 @@ export interface AbilityDelegator { * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - AddAbilityStageMonitor failed. + * @throws { BusinessError } 16000100 - Calling AddAbilityStageMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -230,7 +230,7 @@ export interface AbilityDelegator { * * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - AddAbilityStageMonitorSync failed. + * @throws { BusinessError } 16000100 - Calling AddAbilityStageMonitorSync failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -265,7 +265,7 @@ export interface AbilityDelegator { * @param { AbilityMonitor } monitor - AbilityMonitor object. * @param { AsyncCallback } callback - The callback of removeAbilityMonitor. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - RemoveAbilityMonitor failed. + * @throws { BusinessError } 16000100 - Calling RemoveAbilityMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -300,7 +300,7 @@ export interface AbilityDelegator { * @param { AbilityMonitor } monitor - AbilityMonitor object. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - RemoveAbilityMonitor failed. + * @throws { BusinessError } 16000100 - Calling RemoveAbilityMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -323,7 +323,7 @@ export interface AbilityDelegator { * * @param { AbilityMonitor } monitor - AbilityMonitor object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - RemoveAbilityMonitorSync failed. + * @throws { BusinessError } 16000100 - Calling RemoveAbilityMonitorSync failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -358,7 +358,7 @@ export interface AbilityDelegator { * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. * @param { AsyncCallback } callback - The callback of removeAbilityStageMonitor. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - RemoveAbilityStageMonitor failed. + * @throws { BusinessError } 16000100 - Calling RemoveAbilityStageMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -393,7 +393,7 @@ export interface AbilityDelegator { * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - RemoveAbilityStageMonitor failed. + * @throws { BusinessError } 16000100 - Calling RemoveAbilityStageMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -416,7 +416,7 @@ export interface AbilityDelegator { * * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - RemoveAbilityStageMonitorSync failed. + * @throws { BusinessError } 16000100 - Calling RemoveAbilityStageMonitorSync failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -451,7 +451,7 @@ export interface AbilityDelegator { * @param { AbilityMonitor } monitor - AbilityMonitor object. * @param { AsyncCallback } callback - The callback is used to return the Ability object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - WaitAbilityMonitor failed. + * @throws { BusinessError } 16000100 - Calling WaitAbilityMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -489,7 +489,7 @@ export interface AbilityDelegator { * @param { number } timeout - Maximum wait time, in milliseconds. * @param { AsyncCallback } callback - The callback is used to return the Ability object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - WaitAbilityMonitor failed. + * @throws { BusinessError } 16000100 - Calling WaitAbilityMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -527,7 +527,7 @@ export interface AbilityDelegator { * @param { number } [timeout] - Maximum wait time, in milliseconds. * @returns { Promise } Returns the Ability object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - WaitAbilityMonitor failed. + * @throws { BusinessError } 16000100 - Calling WaitAbilityMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -562,7 +562,7 @@ export interface AbilityDelegator { * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. * @param { AsyncCallback } callback - The callback is used to return the AbilityStage object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - WaitAbilityStageMonitor failed. + * @throws { BusinessError } 16000100 - Calling WaitAbilityStageMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -600,7 +600,7 @@ export interface AbilityDelegator { * @param { number } timeout - Maximum wait time, in milliseconds. * @param { AsyncCallback } callback - The callback is used to return the AbilityStage object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - WaitAbilityStageMonitor failed. + * @throws { BusinessError } 16000100 - Calling WaitAbilityStageMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -638,7 +638,7 @@ export interface AbilityDelegator { * @param { number } [timeout] - Maximum wait time, in milliseconds. * @returns { Promise } Returns the AbilityStage object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - WaitAbilityStageMonitor failed. + * @throws { BusinessError } 16000100 - Calling WaitAbilityStageMonitor failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -728,7 +728,7 @@ export interface AbilityDelegator { * * @param { AsyncCallback } callback - The callback is used to return the Ability object. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - GetCurrentTopAbility failed. + * @throws { BusinessError } 16000100 - Calling GetCurrentTopAbility failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -757,7 +757,7 @@ export interface AbilityDelegator { * Obtain the ability that is currently being displayed in this process. * * @returns { Promise } Returns the Ability object. - * @throws { BusinessError } 16000100 - GetCurrentTopAbility failed. + * @throws { BusinessError } 16000100 - Calling GetCurrentTopAbility failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -820,7 +820,7 @@ export interface AbilityDelegator { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -895,7 +895,7 @@ export interface AbilityDelegator { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -942,7 +942,7 @@ export interface AbilityDelegator { * @param { UIAbility } ability - The ability object. * @param { AsyncCallback } callback - The callback of doAbilityForeground. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - DoAbilityForeground failed. + * @throws { BusinessError } 16000100 - Calling DoAbilityForeground failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -977,7 +977,7 @@ export interface AbilityDelegator { * @param { UIAbility } ability - The ability object. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - DoAbilityForeground failed. + * @throws { BusinessError } 16000100 - Calling DoAbilityForeground failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -1012,7 +1012,7 @@ export interface AbilityDelegator { * @param { UIAbility } ability - The ability object. * @param { AsyncCallback } callback - The callback of doAbilityBackground. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - DoAbilityBackground failed. + * @throws { BusinessError } 16000100 - Calling DoAbilityBackground failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -1047,7 +1047,7 @@ export interface AbilityDelegator { * @param { UIAbility } ability - The ability object. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - DoAbilityBackground failed. + * @throws { BusinessError } 16000100 - Calling DoAbilityBackground failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -1245,7 +1245,7 @@ export interface AbilityDelegator { * @param { number } code - Result code. * @param { AsyncCallback } callback - The callback of finishTest. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - FinishTest failed. + * @throws { BusinessError } 16000100 - Calling FinishTest failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice @@ -1286,7 +1286,7 @@ export interface AbilityDelegator { * @param { number } code - Result code. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. - * @throws { BusinessError } 16000100 - FinishTest failed. + * @throws { BusinessError } 16000100 - Calling FinishTest failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @crossplatform * @atomicservice diff --git a/api/application/ApplicationContext.d.ts b/api/application/ApplicationContext.d.ts index a2a9ea06b..de2714379 100644 --- a/api/application/ApplicationContext.d.ts +++ b/api/application/ApplicationContext.d.ts @@ -484,7 +484,7 @@ export default class ApplicationContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. - * @throws { BusinessError } 16000063 - The target to restart does not belong to the current app or is not a UIAbility. + * @throws { BusinessError } 16000063 - The target to restart does not belong to the current application or is not a UIAbility. * @throws { BusinessError } 16000064 - Restart too frequently. Try again at least 10s later. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @stagemodelonly @@ -504,7 +504,7 @@ export default class ApplicationContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -553,4 +553,40 @@ export default class ApplicationContext extends Context { * @since 12 */ getCurrentAppCloneIndex(): number; + + /** + * Set font size scale. + * @param {number} fontSizeScale - Font size scale. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @atomicservice + * @since 13 + */ + setFontSizeScale(fontSizeScale: number): void; + + /** + * Get current app key of current running app instance. + * + * @returns { string } Returns the key of current running app instance. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 14 + */ + getCurrentInstanceKey(): string; + + /** + * Get all running app instance key for current bundle + * + * @returns { Array } Returns the array of all running app instance keys. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 14 + */ + getAllRunningInstanceKeys(): Promise>; } diff --git a/api/application/AutoFillExtensionContext.d.ts b/api/application/AutoFillExtensionContext.d.ts index 7f6331047..6e0677564 100644 --- a/api/application/AutoFillExtensionContext.d.ts +++ b/api/application/AutoFillExtensionContext.d.ts @@ -44,7 +44,7 @@ export default class AutoFillExtensionContext extends ExtensionContext { * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @systemapi * @stagemodelonly - * @since 12 + * @since 13 */ reloadInModal(customData: CustomData): Promise; } \ No newline at end of file diff --git a/api/application/AutoFillRequest.d.ts b/api/application/AutoFillRequest.d.ts index e75010a77..72c433a15 100644 --- a/api/application/AutoFillRequest.d.ts +++ b/api/application/AutoFillRequest.d.ts @@ -62,7 +62,7 @@ export interface FillRequest { * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @systemapi * @stagemodelonly - * @since 12 + * @since 13 */ customData: CustomData; diff --git a/api/application/CustomData.d.ts b/api/application/CustomData.d.ts index f7a22c692..e05cd5db6 100644 --- a/api/application/CustomData.d.ts +++ b/api/application/CustomData.d.ts @@ -27,7 +27,7 @@ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @systemapi * @stagemodelonly - * @since 12 + * @since 13 */ export default interface CustomData { /** @@ -38,7 +38,7 @@ export default interface CustomData { * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @systemapi * @stagemodelonly - * @since 12 + * @since 13 */ data: Record; } \ No newline at end of file diff --git a/api/application/MultiAppMode.d.ts b/api/application/MultiAppMode.d.ts index ec41b44bf..af50f6635 100644 --- a/api/application/MultiAppMode.d.ts +++ b/api/application/MultiAppMode.d.ts @@ -23,7 +23,7 @@ * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @systemapi - * @StageModelOnly + * @stagemodelonly * @since 12 */ export enum MultiAppMode { @@ -32,17 +32,27 @@ export enum MultiAppMode { * * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @systemapi - * @StageModelOnly + * @stagemodelonly * @since 12 */ NOT_SUPPORTED = 0, + /** + * Indicates the type of multi instance. + * + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @systemapi + * @stagemodelonly + * @since 14 + */ + MULTI_INSTANCE = 1, + /** * Indicates the type of app clone. * * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @systemapi - * @StageModelOnly + * @stagemodelonly * @since 12 */ APP_CLONE = 2 diff --git a/api/application/RunningMultiAppInfo.d.ts b/api/application/RunningMultiAppInfo.d.ts index 526d45f3d..29447ea54 100644 --- a/api/application/RunningMultiAppInfo.d.ts +++ b/api/application/RunningMultiAppInfo.d.ts @@ -20,6 +20,7 @@ import { MultiAppMode } from './MultiAppMode'; import { RunningAppClone } from './RunningAppClone'; +import { RunningMultiInstanceInfo } from './RunningMultiInstanceInfo'; /** * The class of running multi app information. @@ -52,6 +53,16 @@ export interface RunningMultiAppInfo { */ mode: MultiAppMode; + /** + * All running instance info for bundle if mode is {@link MULTI_INSTANCE}. + * + * @type { ?Array } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 14 + */ + runningMultiInstances?: Array; + /** * All running app info for bundle if mode is {@link APP_CLONE}. * diff --git a/api/application/RunningMultiInstanceInfo.d.ts b/api/application/RunningMultiInstanceInfo.d.ts new file mode 100644 index 000000000..fc279f303 --- /dev/null +++ b/api/application/RunningMultiInstanceInfo.d.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2024 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 + */ + +/** + * The class of app running instance information. + * + * @typedef RunningMultiInstanceInfo + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 14 + */ +export interface RunningMultiInstanceInfo { + /** + * The index of current instance. + * + * @type { string } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 14 + */ + instanceKey: string; + + /** + * The uid of current app instance. + * + * @type { number } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 14 + */ + uid: number; + + /** + * All pids of current app instance. + * + * @type { Array } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 14 + */ + pids: Array; + } \ No newline at end of file diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index dda7c435f..d5b00a2f8 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -130,6 +130,48 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Service extension uses this method to start a specific ability. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbility(want: Want, callback: AsyncCallback): void; /** @@ -224,6 +266,47 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Service extension uses this method to start a specific ability. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; /** @@ -322,6 +405,49 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Service extension uses this method to start a specific ability. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } [options] - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbility(want: Want, options?: StartOptions): Promise; /** @@ -341,7 +467,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -350,7 +476,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi @@ -428,6 +554,48 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Service extension start an ability using the original caller information. If the caller application is in + * foreground, you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityAsCaller(want: Want, callback: AsyncCallback): void; /** @@ -497,6 +665,47 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Service extension start an ability using the original caller information. If the caller application is in + * foreground, you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityAsCaller(want: Want, options: StartOptions, callback: AsyncCallback): void; /** @@ -570,6 +779,49 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Service extension start an ability using the original caller information. If the caller application is in + * foreground, you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityAsCaller(want: Want, options?: StartOptions): Promise; /** @@ -646,6 +898,51 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the ability to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; /** @@ -750,6 +1047,50 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the ability to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; /** @@ -828,6 +1169,52 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Service extension uses this method to start a specific ability with account. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the ability to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { StartOptions } [options] - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; /** @@ -896,14 +1283,14 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -979,14 +1366,14 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -1068,14 +1455,14 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -1157,14 +1544,14 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -1209,7 +1596,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. @@ -1257,7 +1644,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. @@ -1310,7 +1697,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. @@ -1363,7 +1750,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. @@ -1477,7 +1864,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -1537,7 +1924,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -1624,7 +2011,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. @@ -1655,7 +2042,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -1728,6 +2115,45 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 10 */ + /** + * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. + * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startRecentAbility(want: Want, callback: AsyncCallback): void; /** @@ -1787,6 +2213,44 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 10 */ + /** + * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. + * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; /** @@ -1848,6 +2312,46 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 10 */ + /** + * Service extension uses this method to start a specific ability, if ability is multi instance, will start a recent instance. + * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } [options] - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startRecentAbility(want: Want, options?: StartOptions): Promise; /** @@ -1974,13 +2478,13 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The EDM prohibits the application from launching. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core diff --git a/api/application/UIAbilityContext.d.ts b/api/application/UIAbilityContext.d.ts index 25717dc74..ab246c10e 100644 --- a/api/application/UIAbilityContext.d.ts +++ b/api/application/UIAbilityContext.d.ts @@ -286,6 +286,48 @@ export default class UIAbilityContext extends Context { * @atomicservice * @since 12 */ + /** + * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; + * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @crossplatform + * @atomicservice + * @since 14 + */ startAbility(want: Want, callback: AsyncCallback): void; /** @@ -408,6 +450,50 @@ export default class UIAbilityContext extends Context { * @atomicservice * @since 12 */ + /** + * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; + * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not support. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000067 - The StartOptions check failed. + * @throws { BusinessError } 16000068 - The ability is already running. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @throws { BusinessError } 16300003 - The target application is not self application. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @atomicservice + * @since 14 + */ startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; /** @@ -537,6 +623,52 @@ export default class UIAbilityContext extends Context { * @atomicservice * @since 12 */ + /** + * Starts a new ability. If the caller application is in foreground, you can use this method to start ability; + * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } [options] - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not support. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000067 - The StartOptions check failed. + * @throws { BusinessError } 16000068 - The ability is already running. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @throws { BusinessError } 16300003 - The target application is not self application. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @atomicservice + * @since 14 + */ startAbility(want: Want, options?: StartOptions): Promise; /** @@ -554,7 +686,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -563,7 +695,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16200001 - The caller has been released. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -642,6 +774,48 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * Starts a new ability using the original caller information. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityAsCaller(want: Want, callback: AsyncCallback): void; /** @@ -711,6 +885,47 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * Starts a new ability using the original caller information. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityAsCaller(want: Want, options: StartOptions, callback: AsyncCallback): void; /** @@ -784,6 +999,49 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * Starts a new ability using the original caller information. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityAsCaller(want: Want, options?: StartOptions): Promise; /** @@ -890,6 +1148,42 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * Get the caller object of the startup capability in cross-device. + * + * If the caller application is in foreground, you can use this method to start ability; + * If the caller application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param { Want } want - Indicates the ability to start. + * @returns { Promise } Returns the Caller interface. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 14 + */ startAbilityByCall(want: Want): Promise; /** @@ -957,6 +1251,46 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * Get the caller object that specifies the accountId startup capability + * If the local device starts a new ability, you need to apply for permission:ohos.permission.ABILITY_BACKGROUND_COMMUNICATION + * and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS to use this method. + * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * + * @permission ohos.permission.ABILITY_BACKGROUND_COMMUNICATION and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the ability to start. + * @param { number } accountId - Indicates the account to start. + * @returns { Promise } Returns the Caller interface. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityByCallWithAccount(want: Want, accountId: number): Promise; /** @@ -1031,6 +1365,50 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * Starts a new ability with account. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; /** @@ -1132,6 +1510,49 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * Starts a new ability with account. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; /** @@ -1208,6 +1629,51 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * Starts a new ability with account. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } [options] - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; /** @@ -1331,6 +1797,48 @@ export default class UIAbilityContext extends Context { * @atomicservice * @since 12 */ + /** + * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @atomicservice + * @since 14 + */ startAbilityForResult(want: Want, callback: AsyncCallback): void; /** @@ -1452,6 +1960,47 @@ export default class UIAbilityContext extends Context { * @atomicservice * @since 12 */ + /** + * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @atomicservice + * @since 14 + */ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; /** @@ -1579,6 +2128,49 @@ export default class UIAbilityContext extends Context { * @atomicservice * @since 12 */ + /** + * Starts an ability and returns the execution result when the ability is destroyed. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } [options] - Indicates the start options. + * @returns { Promise } Returns the result of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @atomicservice + * @since 14 + */ startAbilityForResult(want: Want, options?: StartOptions): Promise; /** @@ -1676,6 +2268,45 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; /** @@ -1777,6 +2408,49 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * If the caller application is in foreground, you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityForResultWithAccount( want: Want, accountId: number, @@ -1882,6 +2556,46 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } [options] - Indicates the start options. + * @returns { Promise } Returns the result of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; /** @@ -1947,14 +2661,14 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -2027,14 +2741,14 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -2113,14 +2827,14 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -2199,14 +2913,14 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -2249,7 +2963,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. @@ -2297,7 +3011,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. @@ -2348,7 +3062,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. @@ -2399,7 +3113,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000011 - The context does not exist. @@ -2638,7 +3352,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -2689,7 +3403,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -3037,6 +3751,47 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * If ability is multi instance, will start a recent instance. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startRecentAbility(want: Want, callback: AsyncCallback): void; /** @@ -3131,6 +3886,46 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * If ability is multi instance, will start a recent instance. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; /** @@ -3229,6 +4024,48 @@ export default class UIAbilityContext extends Context { * @stagemodelonly * @since 12 */ + /** + * If ability is multi instance, will start a recent instance. If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } [options] - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startRecentAbility(want: Want, options?: StartOptions): Promise; /** @@ -3268,7 +4105,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -3325,7 +4162,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -3403,6 +4240,7 @@ export default class UIAbilityContext extends Context { */ /** * Starts the UIAbility or UIExtensionAbility by type. + * If the caller application is in the background, it is not allowed to call this interface. * * @param { string } type - The type of target ability. * @param { Record } wantParam - Indicates the want parameter. @@ -3443,6 +4281,7 @@ export default class UIAbilityContext extends Context { */ /** * Starts the UIAbility or UIExtensionAbility by type. + * If the caller application is in the background, it is not allowed to call this interface. * * @param { string } type - The type of target ability. * @param { Record } wantParam - Indicates the want parameter. @@ -3549,7 +4388,7 @@ export default class UIAbilityContext extends Context { * @returns { Promise } Returns the result of openAtomicService. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000003 - The appId does not exist. + * @throws { BusinessError } 16000003 - The specified ID does not exist. * @throws { BusinessError } 16000004 - Can not start invisible component * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. @@ -3571,8 +4410,8 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16000061 - Operation not supported. - * @throws { BusinessError } 16000065 - The interface can be called only when ability is foreground. - * @throws { BusinessError } 16000066 - An ability cannot move to foreground or background in Wukong mode. + * @throws { BusinessError } 16000065 - The API can be called only when the ability is running in the foreground. + * @throws { BusinessError } 16000066 - An ability cannot switch to the foreground or background in Wukong mode. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @stagemodelonly * @atomicservice @@ -3587,7 +4426,7 @@ export default class UIAbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 801 - Capability not support. * @throws { BusinessError } 16000050 - Internal error. - * @throws { BusinessError } 16000067 - Start options check failed. + * @throws { BusinessError } 16000067 - The StartOptions check failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @stagemodelonly * @since 12 @@ -3601,7 +4440,7 @@ export default class UIAbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 801 - Capability not support. * @throws { BusinessError } 16000050 - Internal error. - * @throws { BusinessError } 16000067 - Start options check failed. + * @throws { BusinessError } 16000067 - The StartOptions check failed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @stagemodelonly * @since 12 @@ -3636,13 +4475,13 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The EDM prohibits the application from launching. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -3664,9 +4503,10 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. diff --git a/api/application/UIExtensionContext.d.ts b/api/application/UIExtensionContext.d.ts index 75d0a92ab..969f6aa8b 100755 --- a/api/application/UIExtensionContext.d.ts +++ b/api/application/UIExtensionContext.d.ts @@ -105,6 +105,49 @@ export default class UIExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * UI extension uses this method to start a specific ability.If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000069 - The extension cannot start the third party application. + * @throws { BusinessError } 16000070 - The extension cannot start the service. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 14 + */ startAbility(want: Want, callback: AsyncCallback): void; /** @@ -172,6 +215,48 @@ export default class UIExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * UI extension uses this method to start a specific ability.If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000069 - The extension cannot start the third party application. + * @throws { BusinessError } 16000070 - The extension cannot start the service. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 14 + */ startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; /** @@ -243,6 +328,50 @@ export default class UIExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * UI extension uses this method to start a specific ability.If the caller application is in foreground, + * you can use this method to start ability; If the caller application is in the background, + * you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } [options] - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000069 - The extension cannot start the third party application. + * @throws { BusinessError } 16000070 - The extension cannot start the service. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 14 + */ startAbility(want: Want, options?: StartOptions): Promise; /** @@ -261,7 +390,7 @@ export default class UIExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -270,7 +399,7 @@ export default class UIExtensionContext extends ExtensionContext { * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The application is controlled by EDM. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000069 - The extension cannot start the third party application. * @throws { BusinessError } 16200001 - The caller has been released. * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. @@ -347,6 +476,49 @@ export default class UIExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * If the caller application is in foreground, you can use this method to start ability; If the caller application + * is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000069 - The extension cannot start the third party application. + * @throws { BusinessError } 16000070 - The extension cannot start the service. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 14 + */ startAbilityForResult(want: Want, callback: AsyncCallback): void; /** @@ -414,6 +586,48 @@ export default class UIExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * If the caller application is in foreground, you can use this method to start ability; If the caller application + * is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000069 - The extension cannot start the third party application. + * @throws { BusinessError } 16000070 - The extension cannot start the service. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 14 + */ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; /** @@ -485,6 +699,50 @@ export default class UIExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * If the caller application is in foreground, you can use this method to start ability; If the caller application + * is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the target ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } [options] - Indicates the start options. + * @returns { Promise } Returns the result of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. + * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000018 - Redirection to a third-party application is not allowed in API version 11 or later. + * @throws { BusinessError } 16000019 - No matching ability is found. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. + * @throws { BusinessError } 16000055 - Installation-free timed out. + * @throws { BusinessError } 16000069 - The extension cannot start the third party application. + * @throws { BusinessError } 16000070 - The extension cannot start the service. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 14 + */ startAbilityForResult(want: Want, options?: StartOptions): Promise; /** @@ -512,6 +770,38 @@ export default class UIExtensionContext extends ExtensionContext { * @stagemodelonly * @since 12 */ + /** + * Starts a new ability using the original caller information, and returns the execution result when the ability + * is destroyed. + * If the caller application is in foreground, you can use this method to start ability; If the caller application + * is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND. + * If the target ability is visible, you can start the target ability; If the target ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } [options] - Indicates the start options. + * @returns { Promise } Returns the result of startAbility. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000069 - The extension cannot start the third party application. + * @throws { BusinessError } 16000070 - The extension cannot start the service. + * @throws { BusinessError } 16000071 - App clone is not supported. + * @throws { BusinessError } 16000072 - App clone or multi-instance is not supported. + * @throws { BusinessError } 16000073 - The app clone index is invalid. + * @throws { BusinessError } 16000076 - The app instance key is invalid. + * @throws { BusinessError } 16000077 - The number of app instances reaches the limit. + * @throws { BusinessError } 16000078 - The multi-instance is not supported. + * @throws { BusinessError } 16000079 - The APP_INSTANCE_KEY cannot be specified. + * @throws { BusinessError } 16000080 - Creating a new instance is not supported. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 14 + */ startAbilityForResultAsCaller(want: Want, options?: StartOptions): Promise; /** @@ -528,7 +818,7 @@ export default class UIExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -636,8 +926,8 @@ export default class UIExtensionContext extends ExtensionContext { * @returns { Promise } Returns the result of openAtomicService. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000003 - The appId does not exist. - * @throws { BusinessError } 16000004 - Can not start invisible component + * @throws { BusinessError } 16000003 - The specified ID does not exist. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000050 - Internal error. @@ -663,13 +953,13 @@ export default class UIExtensionContext extends ExtensionContext { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. * @throws { BusinessError } 16000012 - The application is controlled. * @throws { BusinessError } 16000013 - The EDM prohibits the application from launching. - * @throws { BusinessError } 16000019 - Can not match any component. + * @throws { BusinessError } 16000019 - No matching ability is found. * @throws { BusinessError } 16000050 - Internal error. * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core @@ -690,9 +980,10 @@ export default class UIExtensionContext extends ExtensionContext { * @throws { BusinessError } 201 - The application does not have permission to call the interface. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000008 - The crowdtesting application expires. * @throws { BusinessError } 16000011 - The context does not exist. diff --git a/api/application/UIServiceExtensionContext.d.ts b/api/application/UIServiceExtensionContext.d.ts index 214ef3daa..d098f17a9 100644 --- a/api/application/UIServiceExtensionContext.d.ts +++ b/api/application/UIServiceExtensionContext.d.ts @@ -50,7 +50,7 @@ export default class UIServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. @@ -86,6 +86,7 @@ export default class UIServiceExtensionContext extends ExtensionContext { * Starts the UIAbility or UIExtensionAbility by type. * If the target ability is visible, you can start the target ability; If the target ability is invisible, * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible ability. + * If the caller application is in the background, it is not allowed to call this interface. * * @param { string } type - The type of target ability. * @param { Record } wantParam - Indicates the want parameter. @@ -120,7 +121,7 @@ export default class UIServiceExtensionContext extends ExtensionContext { * 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 16000001 - The specified ability does not exist. * @throws { BusinessError } 16000002 - Incorrect ability type. - * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000004 - Failed to start the invisible ability. * @throws { BusinessError } 16000005 - The specified process does not have the permission. * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. * @throws { BusinessError } 16000008 - The crowdtesting application expires. diff --git a/api/application/WorkSchedulerExtensionContext.d.ts b/api/application/WorkSchedulerExtensionContext.d.ts index e472043f9..1f9aa518e 100644 --- a/api/application/WorkSchedulerExtensionContext.d.ts +++ b/api/application/WorkSchedulerExtensionContext.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2024 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 @@ -19,6 +19,7 @@ */ import ExtensionContext from './ExtensionContext'; +import type Want from '../@ohos.app.ability.Want'; /** * The context of work scheduler extension. It allows access to @@ -29,4 +30,63 @@ import ExtensionContext from './ExtensionContext'; * @StageModelOnly * @since 10 */ -export default class WorkSchedulerExtensionContext extends ExtensionContext {} +export default class WorkSchedulerExtensionContext extends ExtensionContext { + /** + * Starts a new service extension ability. + * If the target service extension ability is visible, you can start the target service extension ability; + * If the target service extension ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to start target invisible service extension ability. + * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000008 - The crowdtesting application expires. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000012 - The application is controlled. + * @throws { BusinessError } 16000013 - The application is controlled by EDM. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @systemapi + * @stagemodelonly + * @since 14 + */ + startServiceExtensionAbility(want: Want): Promise; + + /** + * Stops other service extension ability. + * If the target service extension ability is visible, you can stop the target service extension ability; + * If the target service extension ability is invisible, + * you need to apply for permission:ohos.permission.START_INVISIBLE_ABILITY to stop target invisible service extension ability. + * If the target service extension ability is in cross-device, you need to apply for permission:ohos.permission.DISTRIBUTED_DATASYNC. + * + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - The application does not have permission to call the interface. + * @throws { BusinessError } 202 - The application is not system-app, can not use system-api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 16000001 - The specified ability does not exist. + * @throws { BusinessError } 16000002 - Incorrect ability type. + * @throws { BusinessError } 16000004 - Can not start invisible component. + * @throws { BusinessError } 16000005 - The specified process does not have the permission. + * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. + * @throws { BusinessError } 16000011 - The context does not exist. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16200001 - The caller has been released. + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @systemapi + * @stagemodelonly + * @since 14 + */ + stopServiceExtensionAbility(want: Want): Promise; +} diff --git a/api/arkui/FrameNode.d.ts b/api/arkui/FrameNode.d.ts index cccd79281..eb7111b4f 100644 --- a/api/arkui/FrameNode.d.ts +++ b/api/arkui/FrameNode.d.ts @@ -1411,6 +1411,213 @@ export namespace typeNode { * @since 13 */ function createNode(context: UIContext, nodeType: 'Toggle', options?: ToggleOptions): Toggle; + + /** + * Define the FrameNode type for Marquee. + * + * @typedef { TypedFrameNode } Marquee + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + type Marquee = TypedFrameNode; + + /** + * Create a FrameNode of Marquee type. + * + * @param { UIContext } context - uiContext used to create the FrameNode. + * @param { 'Marquee' } nodeType - node type. + * @returns { Marquee } - Return Marquee type FrameNode. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + function createNode(context: UIContext, nodeType: 'Marquee'): Marquee; + + /** + * Define the FrameNode type for TextArea. + * + * @typedef { TypedFrameNode } TextArea + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + type TextArea = TypedFrameNode; + + /** + * Create a FrameNode of TextArea type. + * + * @param { UIContext } context - uiContext used to create the FrameNode. + * @param { 'TextArea' } nodeType - node type. + * @returns { TextArea } - Return TextArea type FrameNode. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + function createNode(context: UIContext, nodeType: 'TextArea'): TextArea; + + /** + * Define the FrameNode type for SymbolGlyph. + * + * @typedef { TypedFrameNode } SymbolGlyph + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + type SymbolGlyph = TypedFrameNode; + + /** + * Create a FrameNode of SymbolGlyph type. + * + * @param { UIContext } context - uiContext used to create the FrameNode. + * @param { 'SymbolGlyph' } nodeType - node type. + * @returns { SymbolGlyph } - Return SymbolGlyph type FrameNode. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + function createNode(context: UIContext, nodeType: 'SymbolGlyph'): SymbolGlyph; + + /** + * Define the FrameNode type for QRCode. + * + * @typedef { TypedFrameNode } QRCode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + type QRCode = TypedFrameNode; + + /** + * Create a FrameNode of QRCode type. + * + * @param { UIContext } context - uiContext used to create the FrameNode. + * @param { 'QRCode' } nodeType - node type. + * @returns { QRCode } - Return QRCode type FrameNode. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + function createNode(context: UIContext, nodeType: 'QRCode'): QRCode; + + /** + * Define the FrameNode type for Badge. + * + * @typedef { TypedFrameNode } Badge + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + type Badge = TypedFrameNode; + + /** + * Create a FrameNode of Badge type. + * + * @param { UIContext } context - uiContext used to create the FrameNode. + * @param { 'Badge' } nodeType - node type. + * @returns { Badge } - Return Badge type FrameNode. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + function createNode(context: UIContext, nodeType: 'Badge'): Badge; + + /** + * Define the FrameNode type for TextClock. + * + * @typedef { TypedFrameNode } TextClock + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + type TextClock = TypedFrameNode; + + /** + * Create a FrameNode of TextClock type. + * + * @param { UIContext } context - uiContext used to create the FrameNode. + * @param { 'TextClock' } nodeType - node type. + * @returns { TextClock } - Return TextClock type FrameNode. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + function createNode(context: UIContext, nodeType: 'TextClock'): TextClock; + + /** + * Define the FrameNode type for TextTimer. + * + * @typedef { TypedFrameNode } TextTimer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + type TextTimer = TypedFrameNode; + + /** + * Create a FrameNode of TextTimer type. + * + * @param { UIContext } context - uiContext used to create the FrameNode. + * @param { 'TextTimer' } nodeType - node type. + * @returns { TextTimer } - Return TextTimer type FrameNode. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + function createNode(context: UIContext, nodeType: 'TextTimer'): TextTimer; + + /** + * Define the FrameNode type for Grid. + * + * @typedef { TypedFrameNode } Grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + type Grid = TypedFrameNode; + + /** + * Create a FrameNode of Grid type. + * + * @param { UIContext } context - uiContext used to create the FrameNode. + * @param { 'Grid' } nodeType - node type. + * @returns { Grid } - Return Grid type FrameNode. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + function createNode(context: UIContext, nodeType: 'Grid'): Grid; + + /** + * Define the FrameNode type for GridItem. + * + * @typedef { TypedFrameNode } GridItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 13 + */ + type GridItem = TypedFrameNode; + + /** + * Create a FrameNode of GridItem type. + * + * @param { UIContext } context - uiContext used to create the FrameNode. + * @param { 'GridItem' } nodeType - node type. + * @returns { GridItem } - Return GridItem type FrameNode. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 13 + */ + function createNode(context: UIContext, nodeType: 'GridItem'): GridItem; } /** diff --git a/api/device-define/wearable.json b/api/device-define/wearable.json index b515c5939..eb415bc32 100644 --- a/api/device-define/wearable.json +++ b/api/device-define/wearable.json @@ -1,5 +1,6 @@ { "SysCaps": [ +"SystemCapability.Utils.Lang", "SystemCapability.ArkUI.ArkUI.Full", "SystemCapability.ArkUI.ArkUI.Napi", "SystemCapability.ArkUI.ArkUI.Libuv", diff --git a/arkts/@arkts.utils.d.ets b/arkts/@arkts.utils.d.ets index de1ba5e30..b5f32cf22 100644 --- a/arkts/@arkts.utils.d.ets +++ b/arkts/@arkts.utils.d.ets @@ -177,7 +177,7 @@ declare namespace utils { enum AsyncLockMode { /** * Shared lock operation. - * The operation could reenter in the same thread if this mode is specified. + * The operation could reenter if this mode is specified. * * @syscap SystemCapability.Utils.Lang * @atomicservice diff --git a/build-tools/api_check_plugin/code_style_rule.json b/build-tools/api_check_plugin/code_style_rule.json index 1e8b8ac74..beda2cf84 100644 --- a/build-tools/api_check_plugin/code_style_rule.json +++ b/build-tools/api_check_plugin/code_style_rule.json @@ -401,6 +401,9 @@ }, { "user": "9917447" + }, + { + "user": "5569491" } ], "ciId":"7387629" diff --git a/build-tools/delete_systemapi_plugin.js b/build-tools/delete_systemapi_plugin.js index e3abbbd07..af4d3c727 100644 --- a/build-tools/delete_systemapi_plugin.js +++ b/build-tools/delete_systemapi_plugin.js @@ -41,8 +41,8 @@ function collectDeclaration(url) { // 入口 try { const utPath = path.resolve(__dirname, url); - const arktsPath = path.resolve(url, '../arkts'); - const kitPath = path.resolve(url, '../kits'); + const arktsPath = path.resolve(utPath, '../arkts'); + const kitPath = path.resolve(utPath, '../kits'); const utFiles = []; readFile(utPath, utFiles); // 读取文件 readFile(arktsPath, utFiles); // 读取文件 diff --git a/build-tools/dts_parser/src/coreImpl/checker/config/permissionConfigFile.json b/build-tools/dts_parser/src/coreImpl/checker/config/permissionConfigFile.json index 7aa9b59e9..6f3b49387 100644 --- a/build-tools/dts_parser/src/coreImpl/checker/config/permissionConfigFile.json +++ b/build-tools/dts_parser/src/coreImpl/checker/config/permissionConfigFile.json @@ -3660,6 +3660,15 @@ "deprecated": "", "provisionEnable": true, "distributedSceneEnable": false + }, + { + "name": "ohos.permission.GET_ETHERNET_LOCAL_MAC", + "grantMode": "system_grant", + "availableLevel": "system_basic", + "since": 13, + "deprecated": "", + "provisionEnable": true, + "distributedSceneEnable": false } ] } diff --git a/kits/@kit.ArkUI.d.ts b/kits/@kit.ArkUI.d.ts index 16688955d..1abdfef07 100644 --- a/kits/@kit.ArkUI.d.ts +++ b/kits/@kit.ArkUI.d.ts @@ -36,7 +36,7 @@ import { import { ComposeTitleBar, ComposeTitleBarMenuItem } from '@ohos.arkui.advanced.ComposeTitleBar'; import { CounterComponent, CounterOptions, CounterType, DateData } from '@ohos.arkui.advanced.Counter'; import { - AlertDialog, ButtonOptions, ConfirmDialog, LoadingDialog, SelectDialog, TipsDialog, CustomContentDialog + AlertDialog, ButtonOptions, ConfirmDialog, LoadingDialog, SelectDialog, TipsDialog, CustomContentDialog, PopoverDialog, PopoverOptions, } from '@ohos.arkui.advanced.Dialog'; import { EditableLeftIconType, EditableTitleBar, EditableTitleBarMenuItem, EditableTitleBarItem, EditableTitleBarOptions, @@ -76,7 +76,7 @@ import inspector from '@ohos.arkui.inspector'; import { NodeRenderType, RenderOptions, BuilderNode, BuildOptions, NodeController, FrameNode, DrawContext, Size, Offset, Position, Pivot, Scale, Translation, Matrix4, Rotation, Frame, RenderNode, XComponentNode, LengthMetrics, LengthMetricsUnit, LengthUnit, ColorMetrics, LayoutConstraint, ComponentContent, NodeContent, Content, typeNode, ShapeMask, ShapeClip, - NodeAdapter, Rect, RoundRect, edgeColors, borderStyles, borderRadiuses + NodeAdapter, Rect, RoundRect, edgeColors, edgeWidths, borderStyles, borderRadiuses } from '@ohos.arkui.node'; import uiObserver from '@ohos.arkui.observer'; import performanceMonitor from '@ohos.arkui.performanceMonitor'; @@ -189,7 +189,7 @@ export { font, inspector, matrix4, mediaquery, performanceMonitor, pluginComponentManager, PluginComponentTemplate, prompt, promptAction, router, AtomicServiceWeb, OnMessageEvent, OnErrorReceiveEvent, OnHttpErrorReceiveEvent, OnPageBeginEvent, OnPageEndEvent, AtomicServiceWebController, OnLoadInterceptEvent, OnProgressChangeEvent, OnLoadInterceptCallback, WebHeader, - screen, screenshot, uiAppearance, uiExtensionHost, uiObserver, window, windowAnimationManager, CustomContentDialog, + screen, screenshot, uiAppearance, uiExtensionHost, uiObserver, window, windowAnimationManager, CustomContentDialog, PopoverDialog, PopoverOptions, AtomicServiceTabs, TabBarOptions, TabBarPosition, TabContentBuilder, OnContentWillChangeCallback, IconOptions, ChipItemLabelOptions, ChipGroupItemOptions, ChipItemStyle, ChipGroupSpaceOptions, IconItemOptions, IconGroupSuffix, ChipGroup, Colors, CustomColors, Theme, ThemeControl, CustomTheme, ChipSymbolGlyphOptions, @@ -213,6 +213,6 @@ export { CommonSegmentButtonOptions, ItemRestriction, SegmentButtonItemTuple, SegmentButtonItemArray, SegmentButtonItemOptionsConstructorOptions, SegmentButtonItemOptions, PixelMapDrawableDescriptor, AnimationOptions, AnimatedDrawableDescriptor, NodeAdapter, DownloadFileButton, DownloadLayoutDirection, DownloadIconStyle, DownloadDescription, DownloadContentOptions, DownloadStyleOptions, - Rect, RoundRect, edgeColors, borderStyles, borderRadiuses, ParticleModifier, + Rect, RoundRect, edgeColors, edgeWidths, borderStyles, borderRadiuses, ParticleModifier, InnerFullScreenLaunchComponent, LaunchController, }; diff --git a/kits/@kit.MediaLibraryKit.d.ts b/kits/@kit.MediaLibraryKit.d.ts index 0c13fb855..ee42e3808 100644 --- a/kits/@kit.MediaLibraryKit.d.ts +++ b/kits/@kit.MediaLibraryKit.d.ts @@ -24,16 +24,22 @@ import { MovingPhotoView, MovingPhotoViewController, MovingPhotoViewAttribute } import { AlbumPickerComponent, AlbumPickerOptions, AlbumInfo } from '@ohos.file.AlbumPickerComponent'; import { PhotoPickerComponent, PickerController, PickerOptions, - DataType, ItemInfo, PhotoBrowserInfo, AnimatorParams, + DataType, BaseItemInfo, ItemInfo, PhotoBrowserInfo, AnimatorParams, MaxSelected, ItemType, ClickType, PickerOrientation, - SelectMode, PickerColorMode, ReminderMode, MaxCountType + SelectMode, PickerColorMode, ReminderMode, MaxCountType, PhotoBrowserRange } from '@ohos.file.PhotoPickerComponent'; +import { + RecentPhotoComponent, RecentPhotoCheckResultCallback, + RecentPhotoClickCallback, RecentPhotoOptions, PhotoSource +} from '@ohos.file.RecentPhotoComponent'; export { photoAccessHelper, sendablePhotoAccessHelper, MovingPhotoView, MovingPhotoViewController, MovingPhotoViewAttribute, PhotoPickerComponent, PickerController, PickerOptions, - DataType, ItemInfo, PhotoBrowserInfo, AnimatorParams, + DataType, BaseItemInfo, ItemInfo, PhotoBrowserInfo, AnimatorParams, MaxSelected, ItemType, ClickType, PickerOrientation, - SelectMode, PickerColorMode, ReminderMode, MaxCountType, - AlbumPickerComponent, AlbumPickerOptions, AlbumInfo + SelectMode, PickerColorMode, ReminderMode, MaxCountType, PhotoBrowserRange, + AlbumPickerComponent, AlbumPickerOptions, AlbumInfo, + RecentPhotoComponent, RecentPhotoCheckResultCallback, + RecentPhotoClickCallback, RecentPhotoOptions, PhotoSource };