import * as _angular_core from '@angular/core'; import { Signal, WritableSignal } from '@angular/core'; import * as _angular_cdk_a11y from '@angular/cdk/a11y'; import { FocusOrigin } from '@angular/cdk/a11y'; import { BooleanInput } from '@angular/cdk/coercion'; import { NgpSelectionMode } from 'ng-primitives/common'; import * as ng_primitives_state from 'ng-primitives/state'; import { SetterOptions, StateInjectionOptions } from 'ng-primitives/state'; import * as ng_primitives_a11y from 'ng-primitives/a11y'; import { activeDescendantManager } from 'ng-primitives/a11y'; import { Observable } from 'rxjs'; declare class NgpListboxHeader { /** * The id of the listbox header. */ readonly id: _angular_core.InputSignal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class NgpListboxOption { /** * The id of the listbox. */ readonly id: _angular_core.InputSignal; /** * The value of the option. */ readonly value: _angular_core.InputSignal; /** * Whether the option is disabled. */ readonly disabled: _angular_core.InputSignalWithTransform; protected readonly state: { id: _angular_core.Signal; value: _angular_core.Signal; selected: _angular_core.Signal; disabled: _angular_core.Signal; getLabel: () => string; scrollIntoView: () => void; select: (origin: _angular_cdk_a11y.FocusOrigin) => void; }; /** * Whether the option is selected. */ readonly selected: _angular_core.Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[ngpListboxOption]", ["ngpListboxOption"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "ngpListboxOptionValue"; "required": true; "isSignal": true; }; "disabled": { "alias": "ngpListboxOptionDisabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } declare class NgpListboxSection { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class NgpListboxTrigger { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class NgpListbox { /** * The id of the listbox. */ readonly id: _angular_core.InputSignal; /** * The listbox selection mode. */ readonly mode: _angular_core.InputSignal; /** * The listbox selection. When defined the listbox is controlled. */ readonly value: _angular_core.InputSignal; /** * The default listbox selection for uncontrolled usage. */ readonly defaultValue: _angular_core.InputSignal; /** * Emits when the listbox selection changes. */ readonly valueChange: _angular_core.OutputEmitterRef; /** * The listbox disabled state. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * The comparator function to use when comparing values. * If not provided, strict equality (===) is used. */ readonly compareWith: _angular_core.InputSignal<(a: T, b: T) => boolean>; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[ngpListbox]", ["ngpListbox"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "mode": { "alias": "ngpListboxMode"; "required": false; "isSignal": true; }; "value": { "alias": "ngpListboxValue"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "ngpListboxDefaultValue"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpListboxDisabled"; "required": false; "isSignal": true; }; "compareWith": { "alias": "ngpListboxCompareWith"; "required": false; "isSignal": true; }; }, { "valueChange": "ngpListboxValueChange"; }, never, never, true, never>; } interface NgpListboxTriggerState { } interface NgpListboxTriggerProps { } declare const NgpListboxTriggerStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>; declare const ngpListboxTrigger: () => {}; declare const injectListboxTriggerState: { (): _angular_core.Signal<{}>; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{} | null>; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{}> | _angular_core.Signal<{} | null>; }; declare const provideListboxTriggerState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpListboxSectionState { /** * @internal * Registers the id of the header that labels this section. */ setLabelledBy: (id: string) => void; /** * @internal * Removes the id of the header that labels this section. */ removeLabelledBy: (id: string) => void; } interface NgpListboxSectionProps { } declare const NgpListboxSectionStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{ setLabelledBy: (id: string) => void; removeLabelledBy: (id: string) => void; }>>; declare const ngpListboxSection: () => { setLabelledBy: (id: string) => void; removeLabelledBy: (id: string) => void; }; declare const injectListboxSectionState: { (): _angular_core.Signal<{ setLabelledBy: (id: string) => void; removeLabelledBy: (id: string) => void; }>; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{ setLabelledBy: (id: string) => void; removeLabelledBy: (id: string) => void; } | null>; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{ setLabelledBy: (id: string) => void; removeLabelledBy: (id: string) => void; } | null> | _angular_core.Signal<{ setLabelledBy: (id: string) => void; removeLabelledBy: (id: string) => void; }>; }; declare const provideListboxSectionState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpListboxOptionState { /** * The id of the option. */ readonly id: Signal; /** * The value of the option. */ readonly value: Signal; /** * @internal * Whether the option is selected. */ readonly selected: Signal; /** * @internal * Whether the option is disabled (its own disabled state or the listbox's). */ readonly disabled: Signal; /** * @internal * Gets the label of the option, used for typeahead. */ getLabel: () => string; /** * @internal * Scrolls the option into view when it becomes the active descendant. */ scrollIntoView: () => void; /** * @internal * Selects the option. */ select: (origin: FocusOrigin) => void; } interface NgpListboxOptionProps { /** * The id of the option. */ readonly id?: Signal; /** * The value of the option. */ readonly value: Signal; /** * Whether the option is disabled. */ readonly disabled?: Signal; } declare const NgpListboxOptionStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{ id: Signal; value: Signal; selected: Signal; disabled: Signal; getLabel: () => string; scrollIntoView: () => void; select: (origin: FocusOrigin) => void; }>>; declare const ngpListboxOption: ({ id, value, disabled: _disabled, }: NgpListboxOptionProps) => { id: Signal; value: Signal; selected: Signal; disabled: Signal; getLabel: () => string; scrollIntoView: () => void; select: (origin: FocusOrigin) => void; }; declare const injectListboxOptionState: { (): Signal<{ id: Signal; value: Signal; selected: Signal; disabled: Signal; getLabel: () => string; scrollIntoView: () => void; select: (origin: FocusOrigin) => void; }>; (options: ng_primitives_state.StateInjectionOptions): Signal<{ id: Signal; value: Signal; selected: Signal; disabled: Signal; getLabel: () => string; scrollIntoView: () => void; select: (origin: FocusOrigin) => void; } | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{ id: Signal; value: Signal; selected: Signal; disabled: Signal; getLabel: () => string; scrollIntoView: () => void; select: (origin: FocusOrigin) => void; }> | Signal<{ id: Signal; value: Signal; selected: Signal; disabled: Signal; getLabel: () => string; scrollIntoView: () => void; select: (origin: FocusOrigin) => void; } | null>; }; declare const provideListboxOptionState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpListboxHeaderState { } interface NgpListboxHeaderProps { /** The id of the listbox header. */ readonly id?: Signal; } declare const NgpListboxHeaderStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>; declare const ngpListboxHeader: ({ id }: NgpListboxHeaderProps) => {}; declare const injectListboxHeaderState: { (): Signal<{}>; (options: ng_primitives_state.StateInjectionOptions): Signal<{} | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{}> | Signal<{} | null>; }; declare const provideListboxHeaderState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; interface NgpListboxState { /** * The listbox selection. */ readonly value: WritableSignal; /** * The listbox disabled state. */ readonly disabled: WritableSignal; /** * @internal * Whether the listbox is focused. */ readonly isFocused: Signal; /** * @internal * Manages the active descendant so options can reflect their active state. */ readonly activeDescendantManager: ReturnType; /** * Emits when the listbox selection changes. */ readonly valueChange: Observable; /** * @internal * Selects an option in the listbox. */ selectOption: (value: T, origin: FocusOrigin) => void; /** * @internal * Determine if an option is selected using the compareWith function. */ isSelected: (value: T) => boolean; /** * @internal * Activate an option in the listbox. */ activateOption: (value: T) => void; /** * Registers an option with the listbox. * @internal */ addOption: (option: NgpListboxOptionState) => void; /** * Deregisters an option with the listbox. * @internal */ removeOption: (option: NgpListboxOptionState) => void; /** * Sets the listbox selection. */ setValue: (value: T[], options?: SetterOptions) => void; /** * Sets the default listbox selection used in uncontrolled mode. */ setDefaultValue: (value: T[]) => void; setDisabled: (value: boolean) => void; } interface NgpListboxProps { /** * The id of the listbox. */ readonly id?: Signal; /** * The listbox selection mode. */ readonly mode?: Signal; /** * The listbox selection. When defined the listbox is controlled. */ readonly value?: Signal; /** * The default listbox selection for uncontrolled usage. */ readonly defaultValue?: Signal; /** * The listbox disabled state. */ readonly disabled?: Signal; /** * The comparator function to use when comparing values. * If not provided, strict equality (===) is used. */ readonly compareWith?: Signal<(a: T, b: T) => boolean>; /** * Emits when the listbox selection changes. */ readonly onValueChange?: (value: T[]) => void; } declare const NgpListboxStateToken: _angular_core.InjectionToken; disabled: WritableSignal; isFocused: WritableSignal; activeDescendantManager: { id: Signal; index: WritableSignal; activateByIndex: (index: number, { scroll, origin }?: ng_primitives_a11y.ActivationOptions) => void; activateById: (id: string, options?: ng_primitives_a11y.ActivationOptions) => void; first: (options?: ng_primitives_a11y.ActivationOptions) => void; last: (options?: ng_primitives_a11y.ActivationOptions) => void; next: (options?: ng_primitives_a11y.ActivationOptions) => void; previous: (options?: ng_primitives_a11y.ActivationOptions) => void; reset: ({ scroll, origin }?: ng_primitives_a11y.ActivationOptions) => void; validate: () => void; typeahead: (key: string, options?: ng_primitives_a11y.ActivationOptions) => void; }; valueChange: Observable; selectOption: (val: unknown, origin: FocusOrigin) => void; isSelected: (val: unknown) => boolean; activateOption: (val: unknown) => void; addOption: (option: NgpListboxOptionState) => void; removeOption: (option: NgpListboxOptionState) => void; setValue: (newValue: unknown[], options?: SetterOptions) => void; setDefaultValue: (newValue: unknown[]) => void; setDisabled: (value: boolean) => void; }>>; declare const ngpListbox: ({ id, mode, value: _value, defaultValue: _defaultValue, disabled: _disabled, compareWith, onValueChange, }: NgpListboxProps) => { value: WritableSignal; disabled: WritableSignal; isFocused: WritableSignal; activeDescendantManager: { id: Signal; index: WritableSignal; activateByIndex: (index: number, { scroll, origin }?: ng_primitives_a11y.ActivationOptions) => void; activateById: (id: string, options?: ng_primitives_a11y.ActivationOptions) => void; first: (options?: ng_primitives_a11y.ActivationOptions) => void; last: (options?: ng_primitives_a11y.ActivationOptions) => void; next: (options?: ng_primitives_a11y.ActivationOptions) => void; previous: (options?: ng_primitives_a11y.ActivationOptions) => void; reset: ({ scroll, origin }?: ng_primitives_a11y.ActivationOptions) => void; validate: () => void; typeahead: (key: string, options?: ng_primitives_a11y.ActivationOptions) => void; }; valueChange: Observable; selectOption: (val: T, origin: FocusOrigin) => void; isSelected: (val: T) => boolean; activateOption: (val: T) => void; addOption: (option: NgpListboxOptionState) => void; removeOption: (option: NgpListboxOptionState) => void; setValue: (newValue: T[], options?: SetterOptions) => void; setDefaultValue: (newValue: T[]) => void; setDisabled: (value: boolean) => void; }; declare const provideListboxState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; declare function injectListboxState(options?: StateInjectionOptions): Signal>; export { NgpListbox, NgpListboxHeader, NgpListboxHeaderStateToken, NgpListboxOption, NgpListboxOptionStateToken, NgpListboxSection, NgpListboxSectionStateToken, NgpListboxStateToken, NgpListboxTrigger, NgpListboxTriggerStateToken, injectListboxHeaderState, injectListboxOptionState, injectListboxSectionState, injectListboxState, injectListboxTriggerState, ngpListbox, ngpListboxHeader, ngpListboxOption, ngpListboxSection, ngpListboxTrigger, provideListboxHeaderState, provideListboxOptionState, provideListboxSectionState, provideListboxState, provideListboxTriggerState }; export type { NgpListboxHeaderProps, NgpListboxHeaderState, NgpListboxOptionProps, NgpListboxOptionState, NgpListboxProps, NgpListboxSectionProps, NgpListboxSectionState, NgpListboxState, NgpListboxTriggerProps, NgpListboxTriggerState };