import { LitElement, type PropertyValues } from 'lit'; import { type Size } from '@nvidia-elements/core/internal'; export interface JoystickValue { readonly x: number; readonly y: number; } export type JoystickConstraint = 'circle' | 'square' | 'horizontal' | 'vertical'; export type JoystickRelease = 'center' | 'hold'; export interface JoystickInteractionStart { readonly source: 'pointer' | 'keyboard'; } export interface JoystickInteractionEnd extends JoystickInteractionStart { readonly reason: 'release' | 'escape' | 'pointer-cancel' | 'lost-capture' | 'blur' | 'hidden' | 'disabled' | 'readonly' | 'configuration-change' | 'reset' | 'disconnect'; } declare const Joystick_base: import("@nvidia-elements/forms/mixins").FormControlMixinReturn; /** * @element nve-joystick * @description Selects a normalized two-axis vector with pointer or keyboard input. Applications handle physical units, coordinate frames, input shaping, command timing, recording, outcome feedback, and alternative controls. * @documentation https://nvidia.github.io/elements/docs/elements/joystick/ * @since 2.20.0 * @entrypoint \@nvidia-elements/core/joystick * @property {JoystickValue | undefined} value - The normalized vector: positive x points right and positive y points down, independent of text direction. Assign a complete finite object within the selected constraint. Invalid vectors throw TypeError without replacing the previous value. Programmatic writes do not dispatch input or change events. Use undefined for an absent sample and a zero vector for recorded neutral input. Set readOnly before assigning replay ownership. User input can replace external writes during an interaction. * @attribute {string} value - A JSON object containing normalized x and y coordinates. * @event input - Dispatched after user input changes the vector, including a return to neutral. Read .value for the current vector. A held position does not generate repeated events. Publish commands at an application-controlled cadence. * @event change - Dispatched after a normal interaction completes and produces input. Cancellation sends any necessary neutral input without change. * @event interaction-start - Dispatched with the pointer or keyboard source after setting :state(active), including engagement at neutral. * @event interaction-end - Dispatched with the source and terminal reason after clearing :state(active). Interruption first sends any necessary neutral input. Reset restores the declared default without value events. Detached events cannot bubble to former ancestors. * @cssprop --width * @cssprop --height * @cssprop --background * @cssprop --opacity - Background opacity when the opacity flag is present. Defaults to 0.6. The border, crosshair, thumb, and focus indicator keep their opacity. * @cssprop --border * @cssprop --thumb-width * @cssprop --thumb-height * @cssprop --thumb-background * @cssprop --thumb-border * @stable false */ export declare class Joystick extends Joystick_base { #private; static styles: import("lit").CSSResult[]; static readonly metadata: { tag: string; version: string; valueSchema: { type: 'object'; properties: { x: { type: 'number'; minimum: number; maximum: number; }; y: { type: 'number'; minimum: number; maximum: number; }; }; required: string[]; additionalProperties: boolean; }; }; /** * Constrains the movement region or selects one axis. Circle limits vector magnitude to one; * square permits both axes at full scale and a magnitude of up to Math.SQRT2. * With equally scaled planar velocity axes, square corners allow about 41% greater speed. * Mixed forward-velocity and turning-rate axes have no common physical magnitude. * Changing the constraint projects the current value silently and cancels an active interaction. */ constraint: JoystickConstraint; /** Sets surface and thumb size. At the default font size, sm is 104px, md is 130px, and lg is 156px. */ size: Size; /** Enables background transparency using the --opacity CSS custom property. */ opacity: boolean; /** * Determines whether normal release returns to center or holds the final vector. * Interrupted interactions return to neutral in either mode. Form reset restores the declared default instead. */ release: JoystickRelease; /** * Sets the normalized increment for each arrow key press. Repeated presses continue adjusting; * releasing the final arrow applies the release behavior. Escape cancels the interaction. * Invalid steps fall back to 0.1. Modifier shortcuts and locked-axis directions remain available to the browser. */ keyboardStep: number; /** * Controls automatic position announcements. Focused user input produces polite announcements at most every 500 ms. * A quick tap in center mode reports the input coordinates and the return to center. * Escape announces the resulting coordinates without a separate cancellation message. * Programmatic writes and read-only playback update the description without live announcements. * Set `off` when the application supplies spoken output. The focus description remains available. * * Give each joystick an accessible name using a label, `aria-label`, or `aria-labelledby`. * Editable controls use the application role to receive two-axis keyboard input. * An explicit `aria-description` or `aria-describedby` overrides the default focus description through standard * ARIA precedence. Live announcements follow the `announce` setting. */ announce: 'polite' | 'off'; /** * Localizes the position description and keyboard instructions. The default description includes both normalized * coordinates, keyboard instructions, and release behavior. Disabled and read-only controls omit instructions. * A locked axis stays at zero. An absent value reads "No position." * Coordinates use the document language for number formatting and display up to six decimal places. */ i18n: Partial; static get observedAttributes(): string[]; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; get disabled(): boolean; set disabled(value: boolean | unknown); get readOnly(): boolean; set readOnly(value: boolean | unknown); constructor(); connectedCallback(): void; disconnectedCallback(): void; firstUpdated(): void; willUpdate(changes: PropertyValues): void; updated(): void; render(): import("lit-html").TemplateResult<1>; updateValue(value: JoystickValue): void; reset(): void; formStateRestoreCallback(state: unknown, _reason?: string): void; _updateFormState(): void; } export {};