@react-three/uikit
Version:
Build performant 3D user interfaces with react-three-fiber and yoga.
21 lines (20 loc) • 1.02 kB
TypeScript
import { ReactNode, RefAttributes } from 'react';
import { Vector2Tuple } from 'three';
import { R3FEventMap } from './utils.js';
import { InputProperties as BaseInputProperties, CaretTransformation, SelectionTransformation } from '@pmndrs/uikit/internals';
import { ComponentInternals } from './ref.js';
import { ReadonlySignal } from '@preact/signals-core';
export type InputRef = InputInternals;
export type InputInternals = ComponentInternals<BaseInputProperties<R3FEventMap>> & {
current: ReadonlySignal<string>;
focus: () => void;
blur: () => void;
element: HTMLInputElement | HTMLTextAreaElement;
selectionRange: ReadonlySignal<Vector2Tuple | undefined>;
caretTransformation: ReadonlySignal<CaretTransformation | undefined>;
selectionTransformations: ReadonlySignal<Array<SelectionTransformation>>;
};
export type InputProperties = BaseInputProperties<R3FEventMap> & {
name?: string;
};
export declare const Input: (props: InputProperties & RefAttributes<InputRef>) => ReactNode;