ResizeObserver.js.flow 656 B

1234567891011121314151617181920212223242526272829303132
  1. // @flow
  2. class DOMRectReadOnly {
  3. +x: number;
  4. +y: number;
  5. +width: number;
  6. +height: number;
  7. +top: number;
  8. +right: number;
  9. +bottom: number;
  10. +left: number;
  11. }
  12. class ResizeObserverEntry {
  13. +target: Element;
  14. +contentRect: DOMRectReadOnly;
  15. }
  16. type Entries = $ReadOnlyArray<ResizeObserverEntry>;
  17. type ResizeObserverCallback = {
  18. (entries: Entries, observer: ResizeObserver): void
  19. };
  20. declare class ResizeObserver {
  21. constructor(ResizeObserverCallback): ResizeObserver;
  22. observe(target: Element): void;
  23. unobserve(target: Element): void;
  24. disconnect(): void;
  25. };
  26. declare export default typeof ResizeObserver;