import * as ng_primitives_number_field from 'ng-primitives/number-field'; import * as _angular_core from '@angular/core'; import { Signal, WritableSignal } from '@angular/core'; import { NumberInput, BooleanInput } from '@angular/cdk/coercion'; import * as ng_primitives_state from 'ng-primitives/state'; import { Observable } from 'rxjs'; /** * Apply the `ngpNumberField` directive to an element that represents the number field * and contains the input, increment, and decrement buttons. */ declare class NgpNumberField { /** * The id of the number field. If not provided, a unique id will be generated. */ readonly id: _angular_core.InputSignal; /** * The value of the number field. When defined the number field is controlled. * A non-finite value (`NaN`, `±Infinity`) is treated as empty. */ readonly value: _angular_core.InputSignalWithTransform; /** * The default value of the number field for uncontrolled usage. * A non-finite value (`NaN`, `±Infinity`) is treated as empty. * @default null */ readonly defaultValue: _angular_core.InputSignalWithTransform; /** * Emits when the value changes. */ readonly valueChange: _angular_core.OutputEmitterRef; /** * The minimum value. A non-finite value (`NaN`, `±Infinity`) is treated as unset, * leaving the field unbounded below. */ readonly min: _angular_core.InputSignalWithTransform; /** * The maximum value. A non-finite value (`NaN`, `±Infinity`) is treated as unset, * leaving the field unbounded above. */ readonly max: _angular_core.InputSignalWithTransform; /** * The step value. A non-finite value (`NaN`, `±Infinity`) falls back to `1`. */ readonly step: _angular_core.InputSignalWithTransform; /** * Whether values should be aligned to the step grid when committed. * @default true */ readonly snap: _angular_core.InputSignalWithTransform; /** * The large step value (used with Shift key). A non-finite value (`NaN`, `±Infinity`) falls back to `10`. */ readonly largeStep: _angular_core.InputSignalWithTransform; /** * The disabled state of the number field. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * The readonly state of the number field. */ readonly readonly: _angular_core.InputSignalWithTransform; /** * @internal */ protected readonly state: ng_primitives_number_field.NgpNumberFieldState; /** * Set the value of the number field. A non-finite value (`NaN`, `±Infinity`) is * rejected - pass `null` to clear the field. */ setValue(value: number | null): void; /** * Increment the value. */ increment(multiplier?: number): void; /** * Decrement the value. */ decrement(multiplier?: number): void; /** * Set the disabled state. */ setDisabled(disabled: boolean): void; /** * Set the readonly state. */ setReadonly(readonly: boolean): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the NumberField primitive. */ interface NgpNumberFieldState { /** * The id of the number field. */ readonly id: Signal; /** * The current value. Always finite or `null`. */ readonly value: WritableSignal; /** * The minimum value. */ readonly min: Signal; /** * The maximum value. */ readonly max: Signal; /** * The step value. */ readonly step: Signal; /** * Whether values are aligned to the step grid when committed. */ readonly snap: Signal; /** * The large step value (used with Shift key). */ readonly largeStep: Signal; /** * Whether the number field is disabled (includes form control state). */ readonly disabled: WritableSignal; /** * Whether the number field is readonly. */ readonly readonly: WritableSignal; /** * Whether the increment button should be disabled. */ readonly canIncrement: Signal; /** * Whether the decrement button should be disabled. */ readonly canDecrement: Signal; /** * Emit when the value changes. */ readonly valueChange: Observable; /** * Set the current value (clamped and, when `snap` is enabled, stepped). A non-finite * value is rejected rather than treated as empty - this is a transition, and `null` * already means empty. */ setValue(value: number | null): void; /** * Set the default value used in uncontrolled mode. Like the binding it mirrors, a * non-finite value is treated as empty. */ setDefaultValue(value: number | null): void; /** * Increment the value by one step. */ increment(multiplier?: number): void; /** * Decrement the value by one step. */ decrement(multiplier?: number): void; /** * Set the disabled state. */ setDisabled(disabled: boolean): void; /** * Set the readonly state. */ setReadonly(readonly: boolean): void; /** @internal */ registerInputCommit(commitFn: () => void): void; } /** * Inputs for configuring the NumberField primitive. */ interface NgpNumberFieldProps { /** * The id of the number field. */ readonly id?: Signal; /** * The current value. When defined the number field is controlled. * A non-finite value (`NaN`, `±Infinity`) is treated as empty. */ readonly value?: Signal; /** * The default value for uncontrolled usage. A non-finite value (`NaN`, `±Infinity`) is treated as empty. */ readonly defaultValue?: Signal; /** * The minimum value. A non-finite value (`NaN`, `±Infinity`) is treated as unset. */ readonly min?: Signal; /** * The maximum value. A non-finite value (`NaN`, `±Infinity`) is treated as unset. */ readonly max?: Signal; /** * The step value. A non-finite value (`NaN`, `±Infinity`) falls back to `1`. */ readonly step?: Signal; /** * Whether values should be aligned to the step grid when committed. * @default true */ readonly snap?: Signal; /** * The large step value (used with Shift key). A non-finite value (`NaN`, `±Infinity`) falls back to `10`. */ readonly largeStep?: Signal; /** * Whether the number field is disabled. */ readonly disabled?: Signal; /** * Whether the number field is readonly. */ readonly readonly?: Signal; /** * Callback fired when the value changes. */ readonly onValueChange?: (value: number | null) => void; } declare const ngpNumberField: ({ id, value: _value, defaultValue: _defaultValue, min: _min, max: _max, step: _step, snap, largeStep: _largeStep, disabled: _disabled, readonly: _readonly, onValueChange, }: NgpNumberFieldProps) => NgpNumberFieldState; declare const injectNumberFieldState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideNumberFieldState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpNumberFieldInput` directive to an input element within a number field. */ declare class NgpNumberFieldInput { /** * Whether mouse wheel changes the value when the input is focused. */ readonly allowWheelScrub: _angular_core.InputSignalWithTransform; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the NumberField Input primitive. */ interface NgpNumberFieldInputState { /** * Focus the input element. */ focus(): void; } /** * Inputs for configuring the NumberField Input primitive. */ interface NgpNumberFieldInputProps { /** * Whether mouse wheel changes the value. */ readonly allowWheelScrub?: Signal; } declare const ngpNumberFieldInput: ({ allowWheelScrub }: NgpNumberFieldInputProps) => NgpNumberFieldInputState; declare const injectNumberFieldInputState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideNumberFieldInputState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpNumberFieldIncrement` directive to a button element that increments the number field value. */ declare class NgpNumberFieldIncrement { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the NumberField Increment primitive. */ interface NgpNumberFieldIncrementState { } /** * Inputs for configuring the NumberField Increment primitive. */ interface NgpNumberFieldIncrementProps { } declare const ngpNumberFieldIncrement: ({}: NgpNumberFieldIncrementProps) => NgpNumberFieldIncrementState; declare const injectNumberFieldIncrementState: { (): _angular_core.Signal; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal | _angular_core.Signal; }; declare const provideNumberFieldIncrementState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpNumberFieldDecrement` directive to a button element that decrements the number field value. */ declare class NgpNumberFieldDecrement { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the NumberField Decrement primitive. */ interface NgpNumberFieldDecrementState { } /** * Inputs for configuring the NumberField Decrement primitive. */ interface NgpNumberFieldDecrementProps { } declare const ngpNumberFieldDecrement: ({}: NgpNumberFieldDecrementProps) => NgpNumberFieldDecrementState; declare const injectNumberFieldDecrementState: { (): _angular_core.Signal; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal | _angular_core.Signal; }; declare const provideNumberFieldDecrementState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; export { NgpNumberField, NgpNumberFieldDecrement, NgpNumberFieldIncrement, NgpNumberFieldInput, injectNumberFieldDecrementState, injectNumberFieldIncrementState, injectNumberFieldInputState, injectNumberFieldState, ngpNumberField, ngpNumberFieldDecrement, ngpNumberFieldIncrement, ngpNumberFieldInput, provideNumberFieldDecrementState, provideNumberFieldIncrementState, provideNumberFieldInputState, provideNumberFieldState }; export type { NgpNumberFieldDecrementProps, NgpNumberFieldDecrementState, NgpNumberFieldIncrementProps, NgpNumberFieldIncrementState, NgpNumberFieldInputProps, NgpNumberFieldInputState, NgpNumberFieldProps, NgpNumberFieldState };