@empathyco/x-components
Version:
Empathy X Components
122 lines • 4.16 kB
TypeScript
import type { PropType } from 'vue';
import type { XEvent } from '../../wiring/events.types';
/**
* Base scroll component that depending on the user interactivity emits different events for
* knowing when the user scrolls, the direction of scroll and if user reaches the start or end.
*
* @public
*/
declare const _default: import("vue").DefineComponent<{
/**
* Distance to the end of the scroll that when reached will emit the
* `scroll:about-to-end` event.
*
* @public
*/
distanceToBottom: {
type: NumberConstructor;
default: number;
};
/**
* Positive vertical distance to still consider that the element is the first one visible.
* For example, if set to 100, after scrolling 100 pixels, the first rendered element
* will still be considered the first one.
*/
firstElementThresholdPx: {
type: NumberConstructor;
default: number;
};
/**
* Time duration to ignore the subsequent scroll events after an emission.
* Higher values will decrease events precision but can prevent performance issues.
*
* @public
*/
throttleMs: {
type: NumberConstructor;
default: number;
};
/**
* If true (default), sets the scroll position to the top when certain events are emitted.
*
* @public
*/
resetOnChange: {
type: BooleanConstructor;
default: boolean;
};
/**
* List of events that should reset the scroll when emitted.
*
* @public
*/
resetOn: {
type: PropType<XEvent | XEvent[]>;
default: () => string[];
};
}, {
throttledStoreScrollData: import("vue").ComputedRef<import("../..").ThrottleFunction<[]>>;
baseScrollEl: import("vue").Ref<HTMLElement | undefined>;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "scroll:at-start" | "scroll:almost-at-end" | "scroll:at-end" | "scroll:direction-change")[], "scroll" | "scroll:at-start" | "scroll:almost-at-end" | "scroll:at-end" | "scroll:direction-change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
/**
* Distance to the end of the scroll that when reached will emit the
* `scroll:about-to-end` event.
*
* @public
*/
distanceToBottom: {
type: NumberConstructor;
default: number;
};
/**
* Positive vertical distance to still consider that the element is the first one visible.
* For example, if set to 100, after scrolling 100 pixels, the first rendered element
* will still be considered the first one.
*/
firstElementThresholdPx: {
type: NumberConstructor;
default: number;
};
/**
* Time duration to ignore the subsequent scroll events after an emission.
* Higher values will decrease events precision but can prevent performance issues.
*
* @public
*/
throttleMs: {
type: NumberConstructor;
default: number;
};
/**
* If true (default), sets the scroll position to the top when certain events are emitted.
*
* @public
*/
resetOnChange: {
type: BooleanConstructor;
default: boolean;
};
/**
* List of events that should reset the scroll when emitted.
*
* @public
*/
resetOn: {
type: PropType<XEvent | XEvent[]>;
default: () => string[];
};
}>> & {
onScroll?: ((...args: any[]) => any) | undefined;
"onScroll:at-start"?: ((...args: any[]) => any) | undefined;
"onScroll:almost-at-end"?: ((...args: any[]) => any) | undefined;
"onScroll:at-end"?: ((...args: any[]) => any) | undefined;
"onScroll:direction-change"?: ((...args: any[]) => any) | undefined;
}, {
distanceToBottom: number;
firstElementThresholdPx: number;
throttleMs: number;
resetOnChange: boolean;
resetOn: keyof import("../../wiring/events.types").XEventsTypes | (keyof import("../../wiring/events.types").XEventsTypes)[];
}, {}>;
export default _default;
//# sourceMappingURL=base-scroll.vue?vue&type=script&lang.d.ts.map