/** * Returns a callback that notifies the host of the view's size via * `ui/notifications/size-changed`. * * Pair with `viewConfig.autoResize: false` when the view's height derives from * its width (for example a fixed aspect-ratio container). Ext-apps auto-resize * measures the document under `height: max-content`, which collapses those * layouts; disable it and report `{ width, height }` from a `ResizeObserver` * (or equivalent) instead. * * Returns the runtime-owned `sendSizeChanged` method — referentially stable * for the lifetime of the mounted runtime. * * @example * ```tsx * import { * ThemeProvider, * useSendSizeChanged, * type ViewConfig, * } from "mcp-use/react"; * import { useEffect, useRef } from "react"; * * export const viewConfig = { * autoResize: false, * displayModes: ["inline", "fullscreen"], * } satisfies ViewConfig; * * export default function AspectRatioView() { * return ( * * * * ); * } * * function AspectRatioContent() { * const ref = useRef(null); * const sendSizeChanged = useSendSizeChanged(); * * useEffect(() => { * const element = ref.current; * if (!element) return; * * const observer = new ResizeObserver(([entry]) => { * if (!entry) return; * const { width, height } = entry.contentRect; * void sendSizeChanged({ width, height }); * }); * * observer.observe(element); * return () => observer.disconnect(); * }, [sendSizeChanged]); * * return
; * } * ``` */ export declare function useSendSizeChanged(): (size: { width?: number; height?: number; }) => Promise;