UNPKG

@kohlmannj/react-scroll-percentage

Version:

Monitor the scroll percentage of a component inside the viewport, using the IntersectionObserver API.

16 lines 632 B
/** * Accepts the rootMargin value from the user configuration object * and returns an array of the four margin values as an object containing * the value and unit properties. If any of the values are not properly * formatted or use a unit other than px or %, and error is thrown. * @private * @param {string=} rootMargin An optional rootMargin value, * defaulting to '0px'. * @return {Array<Object>} An array of margin objects with the keys * value and unit. */ export declare function parseRootMargin(rootMargin?: string): { value: number; unit: string; }[]; //# sourceMappingURL=parseRootMargin.d.ts.map