UNPKG

taro-hooks

Version:
15 lines (14 loc) 707 B
import type { PromiseAction, PromiseOptionalAction, PromiseParamsAction, ExcludeOption } from '../type'; export type ToggleRedDot = PromiseAction<number>; export type Toggle = PromiseOptionalAction<boolean>; export type ToggleBadge = PromiseParamsAction<(index: number, text?: string) => void>; export type SetStyle = PromiseOptionalAction<ExcludeOption<Taro.setTabBarStyle.Option>>; export type SetItem = PromiseParamsAction<(option: Omit<ExcludeOption<Taro.setTabBarItem.Option>, 'index'>, index?: number) => void>; declare function useTabBar(): { toggleRedDot: ToggleRedDot; toggleBadge: ToggleBadge; toggle: Toggle; setStyle: SetStyle; setItem: SetItem; }; export default useTabBar;