import { AtomExpose, AtomProps } from "../Atom/Atom.vue.mjs"; import "../Atom/index.mjs"; import { ScrollToOptions, VirtualAnchor, VirtualContext, VirtualDirection, VirtualItem } from "../../composables/createVirtual/index.mjs"; import { ShallowRef } from "vue"; //#region src/components/Virtualizer/VirtualizerRoot.vue.d.ts interface VirtualizerRootContext extends VirtualContext { /** True once Root begins unmounting; Items skip their focus hand-off */ closing: Readonly>; } interface VirtualizerRootProps extends AtomProps { /** The items to virtualize */ items?: readonly T[]; /** The height of each item, in pixels (a number or numeric string). Used as the initial estimate for unmeasured items */ itemHeight?: number | `${number}` | null; /** Height of the scroll container; numbers and unitless numeric strings are pixels, other strings pass through as CSS */ height?: number | string; /** Extra items rendered outside the viewport for smoother scrolling (default: 5) */ overscan?: number; /** The direction of scrolling (default: 'forward') */ direction?: VirtualDirection; /** How scroll position is preserved across data changes (default: 'auto') */ anchor?: VirtualAnchor; /** Whether anchor restoration scrolls smoothly (default: true) */ anchorSmooth?: boolean; /** Pixels from the top edge within which `top` fires (default: 0) */ topThreshold?: number; /** Pixels from the bottom edge within which `bottom` fires (default: 0) */ bottomThreshold?: number; /** Enable iOS momentum scrolling (default: auto-detected) */ momentum?: boolean; /** Enable elastic overscroll (default: auto-detected) */ elastic?: boolean; /** Namespace for context provision */ namespace?: string; } interface VirtualizerRootEmits { /** * Scrolled within `topThreshold` pixels of the top edge. Fires on every * throttled scroll frame while inside the threshold, never on mount. * Receives the distance from the top in pixels. */ top: [distance: number]; /** * Scrolled within `bottomThreshold` pixels of the bottom edge. Fires on * every throttled scroll frame while inside the threshold, never on * mount. Receives the distance from the bottom in pixels. */ bottom: [distance: number]; } interface VirtualizerRootExpose extends AtomExpose { /** Scroll to an item by index */ scrollTo: (index: number, options?: ScrollToOptions) => void; /** Reset the virtualizer to its initial scroll state */ reset: () => void; } interface VirtualizerRootSlotProps { /** The currently visible (rendered) items, with overscan applied */ items: readonly VirtualItem[]; /** Scroll to an item by index */ scrollTo: (index: number, options?: ScrollToOptions) => void; /** Reset the virtualizer to its initial scroll state */ reset: () => void; } declare const useVirtualizerRoot: (key: string, defaultValue?: VirtualizerRootContext | undefined) => VirtualizerRootContext, provideVirtualizerRoot: (key: string, context: VirtualizerRootContext, app?: import("vue").App) => VirtualizerRootContext; declare const _default: typeof __VLS_export; declare const __VLS_export: (__VLS_props: NonNullable>["props"], __VLS_ctx?: __VLS_PrettifyLocal>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable>["expose"], __VLS_setup?: Promise<{ props: import("vue").PublicProps & __VLS_PrettifyLocal & { onTop?: ((distance: number) => any) | undefined; onBottom?: ((distance: number) => any) | undefined; }> & (typeof globalThis extends { __VLS_PROPS_FALLBACK: infer P; } ? P : {}); expose: (exposed: import("vue").ShallowUnwrapRef) => void; attrs: any; slots: { default: (props: VirtualizerRootSlotProps) => any; }; emit: ((evt: "top", distance: number) => void) & ((evt: "bottom", distance: number) => void); }>) => import("vue").VNode & { __ctx?: NonNullable>; }; type __VLS_PrettifyLocal = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {}; //#endregion export { VirtualizerRootContext, VirtualizerRootEmits, VirtualizerRootExpose, VirtualizerRootProps, VirtualizerRootSlotProps, _default as default, provideVirtualizerRoot, useVirtualizerRoot };