react-scrollsense
Version:
A lightweight scroll sensor to solve your react scroll into viewport issues.
38 lines (37 loc) • 2.34 kB
TypeScript
import React from "react";
import { ConnectOptionsType } from '../types';
declare function scrollConnectPropMulti(Component: React.ComponentType<any>, options: ConnectOptionsType): {
new (props: any): {
isComplete: boolean;
isRafAvailable: boolean;
config: any;
ioRecords: any[];
onIntersection(el: HTMLElement, fn: (ScrollSensorEvent: any, HTMLElement: any, number?: any) => void, options: ConnectOptionsType): any;
updateIObservers(threshold: any, root: any, rootMargin: any): void;
componentDidUpdate(prevProps: any): void;
componentDidMount(): void;
render(): JSX.Element;
context: any;
setState<K extends never>(state: ((prevState: null, props: Readonly<import("../types").ScrollConnectedComponentProps>) => Pick<null, K>) | Pick<null, K>, callback?: () => void): void;
forceUpdate(callback?: () => void): void;
readonly props: Readonly<import("../types").ScrollConnectedComponentProps> & Readonly<{
children?: React.ReactNode;
}>;
state: null;
refs: {
[key: string]: React.ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly<import("../types").ScrollConnectedComponentProps>, nextState: null, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<import("../types").ScrollConnectedComponentProps>, prevState: null): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<import("../types").ScrollConnectedComponentProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("../types").ScrollConnectedComponentProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<import("../types").ScrollConnectedComponentProps>, nextState: null, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("../types").ScrollConnectedComponentProps>, nextState: null, nextContext: any): void;
};
contextType: React.Context<import("./types").IOScrollContext>;
};
export default scrollConnectPropMulti;