import { MaybeRefOrGetter, Ref, ShallowRef } from "vue"; //#region src/composables/useLazy/index.d.ts interface LazyOptions { /** * When true, content renders immediately without waiting for activation. * @default false */ eager?: MaybeRefOrGetter; /** * Delay in milliseconds before activation. Prevents flash on quick * hover-throughs by requiring the active state to persist for this * duration before booting content. * @default 0 */ delay?: number; } interface LazyContext { /** * Whether the lazy content has been activated at least once. */ readonly isBooted: Readonly>; /** * Whether content should be rendered. * True when: isBooted OR eager OR active */ readonly hasContent: Readonly>; /** * Reset booted state. Call on leave transition if not eager. */ reset: () => void; /** * Transition callback for after-leave. Resets if not eager. */ onAfterLeave: () => void; } /** * Deferred content rendering for performance optimization. * * @param active Reactive boolean controlling activation state * @param options Configuration options * @returns Lazy context with state refs and control functions * * @see https://0.vuetifyjs.com/composables/system/use-lazy * * @example * ```ts * import { ref } from 'vue' * import { useLazy } from '@vuetify/v0' * * const isOpen = ref(false) * const { hasContent, onAfterLeave } = useLazy(isOpen) * * // In template: * // * //
* // * //
* //
* ``` * * @example * Eager mode (render immediately): * ```ts * const { hasContent } = useLazy(isOpen, { eager: true }) * // hasContent.value is always true * ``` * * @example * With reactive eager prop: * ```ts * const props = defineProps<{ eager: boolean }>() * const { hasContent } = useLazy(isOpen, { * eager: toRef(() => props.eager), * }) * ``` */ declare function useLazy(active: MaybeRefOrGetter, options?: LazyOptions): LazyContext; //#endregion export { LazyContext, LazyOptions, useLazy };