import { RenderNodeFn, VueNode } from "../type.js"; import * as vue450 from "vue"; import { AriaAttributes, Ref, VNodeChild } from "vue"; //#region src/_util/hooks/useClosable.d.ts interface DataAttributes { [key: `data-${string}`]: string; } type ClosableType = boolean | ({ closeIcon?: VueNode; disabled?: boolean; } & AriaAttributes); interface BaseContextClosable { closable?: ClosableType; closeIcon?: VueNode; } type ContextClosable = Partial>; declare function pickClosable(context: Ref>): Ref | undefined>; /** Collection contains the all the props related with closable. e.g. `closable`, `closeIcon` */ interface ClosableCollection { closable?: ClosableType; closeIcon?: VueNode; } interface FallbackCloseCollection extends ClosableCollection { /** * Some components need to wrap CloseIcon twice, * this method will be executed once after the final CloseIcon is calculated */ closeIconRender?: (closeIcon: VNodeChild) => VNodeChild; } interface UseClosableParams { closable?: ClosableType; closeIcon?: RenderNodeFn; defaultClosable?: boolean; defaultCloseIcon?: RenderNodeFn; customCloseIconRender?: (closeIcon: VNodeChild) => VNodeChild; context?: ContextClosable; } declare function useClosable(propCloseCollection?: Ref, contextCloseCollection?: Ref, fallbackCloseCollection?: Ref): vue450.ComputedRef, boolean, Record] | ({} | null)[] | undefined>; declare function computeClosable(propCloseCollection?: Ref, contextCloseCollection?: Ref, fallbackCloseCollection?: Ref, closeLabel?: string): [closable: boolean, closeIcon: VueNode, closeBtnIsDisabled: boolean, ariaOrDataProps: AriaAttributes & DataAttributes]; //#endregion export { BaseContextClosable, ClosableType, ContextClosable, UseClosableParams, computeClosable, useClosable as default, pickClosable };