diff --git a/api/@ohos.arkui.observer.d.ts b/api/@ohos.arkui.observer.d.ts index 29af3503e28d49e2c453312902b592d5ba136eda..740a6b37cd6c69ed9d03a41523740508ef54dc8b 100644 --- a/api/@ohos.arkui.observer.d.ts +++ b/api/@ohos.arkui.observer.d.ts @@ -1196,6 +1196,61 @@ declare namespace uiObserver { /** * Registers a callback function to be called when the tabContent is showed or hidden. + * Include the cases when the first tab content shows and when the tab changes current index. + * + * @param { 'tabContentChange' } type - The type of event to listen for. Must be 'tabContentChange'. + * @param { ObserverOptions } options - The options object. + * @param { Callback } callback - The callback function to be called when when the tabContent is showed or hidden. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 22 + */ + export function on(type: 'tabContentChange', options: ObserverOptions, callback: Callback): void; + + /** + * Removes a callback function that was previously registered with `on()`. + * + * @param { 'tabContentChange' } type - The type of event to remove the listener for. Must be 'tabContentChange'. + * @param { ObserverOptions } options - The options object. + * @param { Callback } callback - The callback function to remove. If not provided, all callbacks for the given event type and + * Tabs ID will be removed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 22 + */ + export function off(type: 'tabContentChange', options: ObserverOptions, callback?: Callback): void; + + /** + * Registers a callback function to be called when the tabContent is showed or hidden. + * Include the cases when the first tab content shows and when the tab changes current index. + * + * @param { 'tabContentChange' } type - The type of event to listen for. Must be 'tabContentChange'. + * @param { Callback } callback - The callback function to be called when the tabContent is showed or hidden. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 22 + */ + export function on(type: 'tabContentChange', callback: Callback): void; + + /** + * Removes a callback function that was previously registered with `on()`. + * + * @param { 'tabContentChange'} type - The type of event to remove the listener for. Must be 'tabContentChange'. + * @param { Callback } [callback] - The callback function to remove. If not provided, all callbacks for the given event type + * will be removed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 22 + */ + export function off(type: 'tabContentChange', callback?: Callback): void; + + /** + * Registers a callback function to be called when the tabContent is showed or hidden. + * Only calls when the tab changes index. * * @param { 'tabContentUpdate' } type - The type of event to listen for. Must be 'tabContentUpdate'. * @param { ObserverOptions } options - The options object. @@ -1223,6 +1278,7 @@ declare namespace uiObserver { /** * Registers a callback function to be called when the tabContent is showed or hidden. + * Only calls when the tab changes index. * * @param { 'tabContentUpdate' } type - The type of event to listen for. Must be 'tabContentUpdate'. * @param { Callback } callback - The callback function to be called when the tabContent is showed or hidden.