/** * The resizable-pane half of a surface view, shared by every framework * binding. * * A surface view comes in two shapes. A *passive* one — a dock card, a * switcher preview — is handed a box and asks the server for a fixed * downscale of whatever the surface happens to be; `BlitSurfaceCanvas` * measures that itself. A *resizable* one owns its surface's size: it * reports its box as a display size, which is what puts the view into the * server's size mediation and, incidentally, what every input path is gated * on (`_displaySize`). Without it a view is an inert preview: no pointer, no * wheel, no keyboard, no IME, and a 15 fps thumbnail-grade stream. * * That half used to live in each binding, which is how the React one ended up * never calling {@link SurfaceResizeTarget.setDisplaySize} at all — a * documented, full-window React pane that could not be clicked. One * implementation, two thin call sites. */ /** The part of `BlitSurfaceCanvas` a resize driver needs. */ export interface SurfaceResizeTarget { /** Report the box, in device pixels, this view is rendering into. */ setDisplaySize(width: number | null, height?: number, scale120?: number, cssScale120?: number): void; /** Ask the server to resize the surface to this view's box. */ requestResize(width: number, height: number, scale120: number): void; } export interface SurfaceZoom { /** Zoom factor; see {@link SurfaceZoom.mode}. */ zoom?: number; /** `relative` multiplies the display's DPI by `zoom`; `exact` uses `zoom` * as the absolute surface scale, independent of display DPI. */ mode?: "relative" | "exact"; } /** * Clamp to a range that stays useful at both ends: below 0.25 an app is handed * a logical size most toolkits refuse to lay out, and above 4 one pane's * demand for scale would dominate every co-viewer's stream. */ export declare function clampZoom(zoom: number | undefined): number; /** * Drive `target`'s display size and server-side resizes from `container`'s box. * * `getZoom` is read on every measurement rather than captured, so a binding can * change the zoom without tearing the driver down — rebuilding it would * unsubscribe the view and cost a keyframe. Call {@link reapply} when the zoom * changes: the box has not moved, so the observer will never fire on its own. */ export declare function driveSurfaceResize(target: SurfaceResizeTarget, container: HTMLElement, getZoom?: () => SurfaceZoom): { reapply(): void; dispose(): void; }; //# sourceMappingURL=surfaceResize.d.ts.map