index.d.mts 556 B

12345678910111213141516
  1. export type Measurable = {
  2. getBoundingClientRect(): ClientRect;
  3. };
  4. /**
  5. * Observes an element's rectangle on screen (getBoundingClientRect)
  6. * This is useful to track elements on the screen and attach other elements
  7. * that might be in different layers, etc.
  8. */
  9. export function observeElementRect(
  10. /** The element whose rect to observe */
  11. elementToObserve: Measurable,
  12. /** The callback which will be called when the rect changes */
  13. callback: CallbackFn): () => void;
  14. type CallbackFn = (rect: ClientRect) => void;
  15. //# sourceMappingURL=index.d.ts.map