Blame view

天文台pc/tianwentai-ui/node_modules/@radix-ui/rect/dist/index.d.ts 562 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  type Measurable = {
      getBoundingClientRect(): ClientRect;
  };
  /**
   * Observes an element's rectangle on screen (getBoundingClientRect)
   * This is useful to track elements on the screen and attach other elements
   * that might be in different layers, etc.
   */
  declare function observeElementRect(
  /** The element whose rect to observe */
  elementToObserve: Measurable, 
  /** The callback which will be called when the rect changes */
  callback: CallbackFn): () => void;
  type CallbackFn = (rect: ClientRect) => void;
  
  export { type Measurable, observeElementRect };