import { LitElement, type PropertyValues } from 'lit'; import type { ViewportAnimationOptions, ViewportPanBehavior, ViewportPanProposal, ViewportPanSession, ViewportPoint, ViewportRect, ViewportRevealOptions, ViewportTransform, ViewportZoomProposal, ViewportZoomRequestOptions } from './viewport.types.js'; /** * @element nve-viewport * @description A viewport provides a spatial surface for arbitrary content, with optional pan and zoom navigation. * @documentation https://nvidia.github.io/elements/docs/elements/viewport/ * @since 0.0.0 * @entrypoint \@nvidia-elements/core/viewport * @slot - Content positioned in the viewport's infinite content space. * @slot background - Custom content rendered behind viewport content and excluded from content fitting * @slot overlay - Interactive content fixed above the transformed plane and excluded from content fitting * @event panstart - Dispatched when a sustained pointer or control pan begins. Cancel to suppress the default for its session. * @event pan - Dispatched for admitted user pan proposals. Cancel to skip the proposed transform mutation. * @event panend - Dispatched once when a sustained pan ends, including its terminal reason. * @event zoom - Dispatched for admitted user zoom proposals. Cancel to skip the proposed transform mutation. * @event viewportchange - Dispatched once after a render that commits one or more viewport transform changes. * @event capabilitieschange - Dispatched after effective user-input pan or zoom admission changes. * @cssprop --background - Background color of the fixed viewport area. * @cssprop --min-height * @cssprop --pan-cursor - Cursor shown over a background eligible for primary-pointer panning. * @cssprop --panning-cursor - Cursor shown while a pointer pan is active. * @command --pan-left - With behavior-pan enabled, pans left by one discrete step. * @command --pan-right - With behavior-pan enabled, pans right by one discrete step. * @command --pan-up - With behavior-pan enabled, pans up by one discrete step. * @command --pan-down - With behavior-pan enabled, pans down by one discrete step. * @command --zoom-in - With behavior-zoom enabled, animates to the next permitted scale step. * @command --zoom-out - With behavior-zoom enabled, animates to the previous permitted scale step. * @command --zoom-reset - With behavior-zoom enabled, animates to 100% scale. * @command --zoom-to-fit - With behavior-zoom enabled, animates to fit direct default-slot element boxes. * @stable false */ export declare class Viewport extends LitElement { #private; static styles: import("lit").CSSResult[]; static readonly metadata: { tag: string; version: string; }; /** @private */ _internals: ElementInternals; private internalHost; constructor(); /** Horizontal content-space coordinate at the viewport origin. */ get x(): number; set x(value: number); /** Vertical content-space coordinate at the viewport origin. */ get y(): number; set y(value: number); /** Content-to-viewport CSS-pixel scale. */ get scale(): number; set scale(value: number); /** Inclusive lower scale limit. */ get minScale(): number; set minScale(value: number); /** Inclusive upper scale limit. */ get maxScale(): number; set maxScale(value: number); /** Enables panning by pointer, focused wheel, focused keyboard, and Invoker commands; requires Space for primary-pointer dragging when set to space. */ get behaviorPan(): ViewportPanBehavior; set behaviorPan(value: ViewportPanBehavior | null | undefined); /** Enables zooming by pinch, focused modified wheel, focused keyboard, and Invoker commands. */ behaviorZoom: boolean; /** Whether the viewport may admit new user-input panning. */ get pannable(): boolean; /** Whether the viewport may admit new user-input zooming. */ get zoomable(): boolean; /** Fits measurable direct default-slot content once after initial layout. */ autoFit: boolean; /** Default uniform CSS-pixel inset reserved around bounds when fitting content. */ get fitInset(): number; set fitInset(value: number); /** CSS-pixel pointer movement required before a pointer pan begins. */ get dragThreshold(): number; set dragThreshold(value: number); connectedCallback(): void; disconnectedCallback(): void; protected updated(changed: PropertyValues): void; render(): import("lit-html").TemplateResult<1>; /** Converts a content-space point to viewport CSS pixels. */ toViewportCoords(contentX: number, contentY: number): ViewportPoint; /** Converts a viewport CSS-pixel point to content space. */ toContentCoords(viewportX: number, viewportY: number): ViewportPoint; /** Returns the current content-space origin and CSS-pixel scale. */ getTransform(): ViewportTransform; /** Returns the visible content-space rectangle. */ getVisibleRect(): ViewportRect; /** * Requests one discrete user-originated pan. When pannable, the viewport dispatches * a cancelable `pan` and applies the default transform if no listener cancels the event. * Returns true only when that default changes the transform. */ requestPan(proposal: ViewportPanProposal): boolean; /** * Requests one discrete user-originated zoom. When zoomable, the viewport dispatches * a cancelable `zoom` and applies the default transform if no listener cancels the event. * Set `options.animated` to animate the uncanceled default; the option is absent from the `zoom` detail. * Returns true when the default changes or schedules a change to the transform. */ requestZoom(proposal: ViewportZoomProposal, options?: ViewportZoomRequestOptions): boolean; /** * Starts a sustained semantic pan after the caller crosses its activation threshold. * Dispatches `panstart`, performs the initial `pan` update, and returns a session for later updates * and one terminal `panend`. Returns undefined when pannable is false. */ startPan(proposal: ViewportPanProposal): ViewportPanSession | undefined; /** Animates the viewport to the requested partial transform. */ animateTo(target: Partial, options?: ViewportAnimationOptions): void; /** Centers or fits a content-space region within the viewport. */ reveal(region: { x: number; y: number; width?: number; height?: number; }, options?: ViewportRevealOptions): void; /** Fits the union of direct default-slot element boxes within the viewport. */ fitContents(options?: ViewportRevealOptions): void; }