Files
SnowLuma/.pnpm-store/v11/files/6d/d1da3d3a1609267cd47b945c58c9c255b23c58446e04318b90c99ad820b9762dfc291a793cbfabcb1d11b908d03df77dad6c9c490268ca907e7f855fdca693
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

17 lines
556 B
Plaintext

type Measurable = {
getBoundingClientRect(): DOMRect;
};
/**
* 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: DOMRect) => void;
export { type Measurable, observeElementRect };