/** * * Knob is a form component to define number inputs with a dial. * * [Live Demo](https://www.primereact.org/knob/) * * @module KnobRoot * @group components * */ import type { ComponentInstance } from '@primereact/types/core'; import type { UseKnobChangeEvent, UseKnobExposes, UseKnobProps, UseKnobState } from '@primereact/types/headless/knob'; import type { BaseComponentProps, PassThroughType } from '../..'; /** * Defines passthrough(pt) options type in Knob component. */ export type KnobRootPassThroughType = PassThroughType; /** * Defines passthrough(pt) options of Knob component. */ export interface KnobRootPassThrough { /** * Used to pass attributes to the root's DOM element. */ root?: KnobRootPassThroughType>; /** * Used to pass attributes to the svg's DOM element. */ svg?: KnobRootPassThroughType>; /** * Used to pass attributes to the range's DOM element. */ range?: KnobRootPassThroughType>; /** * Used to pass attributes to the value's DOM element. */ value?: KnobRootPassThroughType>; /** * Used to pass attributes to the text's DOM element. */ text?: KnobRootPassThroughType>; } /** * Event fired when the knob's value changes. * @extends UseKnobChangeEvent */ export interface KnobRootChangeEvent extends UseKnobChangeEvent { /** * The value of the knob. */ value: number | undefined | null; } /** * Defines valid properties in Knob component. */ export interface KnobRootProps extends BaseComponentProps, KnobRootPassThrough> { /** * Callback fired when the knob's value changes. * @param event The event that triggered the change. * @param event.originalEvent The original event that triggered the change. * @param event.value The value of the knob. * @returns void */ onValueChange?: (event: KnobRootChangeEvent) => void; } /** * Defines valid state in Knob component. * @extends UseKnobState */ export interface KnobRootState extends UseKnobState { } /** * Defines the methods and properties exposed by Knob component. * @extends UseKnobExposes */ export interface KnobRootExposes extends UseKnobExposes { } /** * Instance of Knob component. */ export type KnobRootInstance = ComponentInstance;