import * as _angular_core from '@angular/core'; import { Type, ExistingProvider } from '@angular/core'; import { BooleanInput } from '@angular/cdk/coercion'; import * as _spartan_ng_brain_questionnaire from '@spartan-ng/brain/questionnaire'; import { ControlValueAccessor } from '@angular/forms'; import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms'; type BrnQuestionnaireItemStatus = 'unanswered' | 'answered' | 'skipped'; type BrnQuestionnaireShortcutMode = 'letters' | 'numbers'; type BrnQuestionnaireChoiceDefinition = { disabled?: boolean; value: string; }; type BrnQuestionnaireItemDefinition = { choices?: readonly BrnQuestionnaireChoiceDefinition[]; disabled?: boolean; name: string; required?: boolean; }; type BrnQuestionnaireRootState = { current: number; first: boolean; last: boolean; total: number; }; type BrnQuestionnaireInputType = 'date' | 'datetime-local' | 'email' | 'month' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url' | 'week'; type BrnAnswerControlRegistration = { disabled: boolean; element: HTMLInputElement; id: string; } & ({ ownDisabled: boolean; type: 'choice'; value: string; } | { type: 'input'; }); type BrnChoiceRegistration = { disabled: boolean; value: string; }; type BrnItemRegistration = { choices: readonly BrnChoiceRegistration[]; disabled: boolean; element: HTMLFieldSetElement; focus: () => void; focusInvalid: () => void; getAnswerByElement: (element: Element) => BrnAnswerControlRegistration | null; getAnswerByShortcut: (shortcut: string) => BrnAnswerControlRegistration | null; moveAnswerFocus: (element: Element, direction: 'next' | 'previous') => boolean; name: string; required: boolean; reset: () => void; skip: () => void; status: BrnQuestionnaireItemStatus; validate: () => boolean; }; type BrnPendingFocus = { name: string; target: 'invalid' | 'item'; }; declare class BrnQuestionnaire { private readonly _elementRef; readonly items: _angular_core.InputSignal; readonly defaultItem: _angular_core.InputSignal; readonly item: _angular_core.ModelSignal; readonly shortcuts: _angular_core.InputSignal; readonly noValidate: _angular_core.InputSignalWithTransform; private readonly _registrations; private readonly _domVersion; private readonly _pendingFocus; private readonly _initialized; private readonly _warningsReady; private _previousActiveItemName; private readonly _activeWarnings; private readonly _collection; private readonly _runtimeItems; private readonly _runtimeItemByName; protected readonly _logicalItems: _angular_core.Signal; private readonly _currentIndex; readonly activeItem: _angular_core.Signal; readonly activeItemName: _angular_core.Signal; readonly activeItemRequired: _angular_core.Signal; readonly activeItemStatus: _angular_core.Signal; readonly itemDefinitionByName: _angular_core.Signal | null>; readonly nativeValidation: _angular_core.Signal; readonly total: _angular_core.Signal; readonly current: _angular_core.Signal; readonly first: _angular_core.Signal; readonly last: _angular_core.Signal; readonly domVersion: _angular_core.Signal; private readonly _orderedRegistrations; constructor(); private getRecoveryItemName; registerItem(registration: BrnItemRegistration): () => void; setItem(nextItem: string, focusTarget?: BrnPendingFocus['target']): void; goPrevious(): void; goNext(): void; confirmCurrent(): void; skipCurrent(): void; protected onReset(event: Event): void; protected onSubmit(event: Event): void; protected onKeyDown(event: KeyboardEvent): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireChoice { private readonly _item; private readonly _answerId; readonly value: _angular_core.InputSignal; readonly disabledInput: _angular_core.InputSignalWithTransform; readonly defaultChecked: _angular_core.InputSignalWithTransform; readonly checkedInput: _angular_core.InputSignal; readonly checkedChange: _angular_core.OutputEmitterRef; private readonly _inputElement; readonly disabled: _angular_core.Signal; readonly invalid: _angular_core.Signal; readonly type: _angular_core.Signal<"checkbox" | "radio">; readonly checked: _angular_core.Signal; readonly shortcut: _angular_core.Signal; readonly inputId: _angular_core.Signal; readonly inputName: _angular_core.Signal; readonly inputRequired: _angular_core.Signal; readonly inputAriaKeyShortcuts: _angular_core.Signal; constructor(); setInputElement(element: HTMLInputElement | null): void; onInputChange(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireChoiceInput { protected readonly _choice: _spartan_ng_brain_questionnaire.BrnQuestionnaireChoice; private readonly _elementRef; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireChoiceLabel { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireChoiceShortcut { protected readonly _choice: _spartan_ng_brain_questionnaire.BrnQuestionnaireChoice; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireChoices { protected readonly _item: _spartan_ng_brain_questionnaire.BrnQuestionnaireItem; readonly shortcuts: _angular_core.InputSignal<_spartan_ng_brain_questionnaire.BrnQuestionnaireShortcutMode | null>; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireDescription { private readonly _item; private readonly _generatedId; readonly id: _angular_core.InputSignal; protected readonly _descriptionId: _angular_core.Signal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireError { protected readonly _item: _spartan_ng_brain_questionnaire.BrnQuestionnaireItem; private readonly _generatedId; readonly id: _angular_core.InputSignal; protected readonly _errorId: _angular_core.Signal; readonly requiredMessage: _angular_core.InputSignal; readonly optionalMessage: _angular_core.InputSignal; readonly defaultMessage: _angular_core.Signal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireInput { protected readonly _item: _spartan_ng_brain_questionnaire.BrnQuestionnaireItem; private readonly _elementRef; protected readonly _answerId: string; readonly type: _angular_core.InputSignal; readonly disabledInput: _angular_core.InputSignalWithTransform; readonly value: _angular_core.InputSignal; readonly defaultValue: _angular_core.InputSignal; private readonly _uncontrolledFilled; readonly disabled: _angular_core.Signal; readonly invalid: _angular_core.Signal; readonly filled: _angular_core.Signal; protected readonly _selected: _angular_core.Signal; protected readonly _ariaKeyShortcuts: _angular_core.Signal; constructor(); protected onInput(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } type BrnQuestionnaireItemValue = string | string[]; declare const BRN_QUESTIONNAIRE_ITEM_VALUE_ACCESSOR: { provide: _angular_core.InjectionToken; useExisting: _angular_core.Type; multi: boolean; }; declare class BrnQuestionnaireItem implements ControlValueAccessor { private readonly _questionnaire; private readonly _elementRef; /** * `[formField]` overwrites `name` / `required` / `disabled` with field state. * Prefer the host attributes so questionnaire identity and flow stay stable. */ readonly nameInput: _angular_core.InputSignal; private readonly _hostName; readonly name: _angular_core.Signal; readonly multiple: _angular_core.InputSignalWithTransform; readonly requiredInput: _angular_core.InputSignalWithTransform; private readonly _hostRequired; readonly required: _angular_core.Signal; readonly disabledInput: _angular_core.InputSignalWithTransform; private readonly _hostDisabled; /** * Do not alias this to `invalid` — `[formField]` would bind field.invalid() * and mark empty required items invalid before the user interacts. */ readonly externallyInvalid: _angular_core.InputSignalWithTransform; readonly ariaDescribedBy: _angular_core.InputSignal; readonly ariaKeyShortcuts: _angular_core.InputSignal; private readonly _cvaDisabled; readonly disabled: _angular_core.Signal; protected onChange: ChangeFn; protected onTouched: TouchFn; private _pendingControlValue; private readonly _writtenInputValues; readonly statusChange: _angular_core.OutputEmitterRef; private readonly _answerControlRegistrations; private readonly _validationAttempted; private readonly _selectedAnswerIds; private readonly _skipped; private readonly _resetVersion; private readonly _descriptionIds; private readonly _errorIds; private readonly _defaultSelectedAnswerIds; private _previousStatus; readonly active: _angular_core.Signal; private readonly _answerControls; private readonly _answers; private readonly _answered; readonly status: _angular_core.Signal; private readonly _intentionallySkipped; private readonly _valid; readonly invalid: _angular_core.Signal; readonly hasInputAnswer: _angular_core.Signal; readonly selectedAnswerIds: _angular_core.Signal; readonly resetVersion: _angular_core.Signal; readonly writtenInputValues: _angular_core.Signal>>; readonly shortcuts: _angular_core.InputSignal<_spartan_ng_brain_questionnaire.BrnQuestionnaireShortcutMode | null>; readonly shortcutByChoiceValue: _angular_core.Signal | null>; readonly shortcutByAnswerId: _angular_core.Signal>; protected readonly _describedBy: _angular_core.Signal; protected readonly _keyShortcuts: _angular_core.Signal; constructor(); writeValue(value: BrnQuestionnaireItemValue | null): void; registerOnChange(fn: ChangeFn): void; registerOnTouched(fn: TouchFn): void; setDisabledState(isDisabled: boolean): void; registerAnswerControl(registration: BrnAnswerControlRegistration): () => void; registerAnswerSelection(answerId: string, defaultSelected: boolean): () => void; /** * Registers the bound default for reset and applies the initial-only selection path * in one place so cleanup cannot run before defaults are recorded. */ registerBoundAnswerDefault(answerId: string, defaultSelected: boolean): () => void; setAnswerDefault(answerId: string, defaultSelected: boolean): void; setAnswerSelectionFromInteraction(answerId: string, selected: boolean): void; syncControlledAnswerSelection(answerId: string, selected: boolean): void; registerDescription(descriptionId: string): () => void; registerError(errorId: string): () => void; validate(): boolean; focus(): void; focusInvalid(): void; reset(): void; skip(): void; getAnswerByElement(answerElement: Element): BrnAnswerControlRegistration | null; getAnswerByShortcut(shortcut: string): BrnAnswerControlRegistration | null; moveAnswerFocus(currentElement: Element, direction: 'next' | 'previous'): boolean; private updateAnswerSelected; private applyPendingControlValue; private applyControlValue; private getControlValue; private normalizeControlValue; private emptyControlValue; private emitControlValue; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireNext { private readonly _questionnaire; readonly disabled: _angular_core.InputSignalWithTransform; readonly visible: _angular_core.Signal; readonly status: _angular_core.Signal<_spartan_ng_brain_questionnaire.BrnQuestionnaireItemStatus | null>; readonly shortcut: _angular_core.Signal<"Enter" | null>; protected onClick(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnairePrevious { private readonly _questionnaire; readonly disabled: _angular_core.InputSignalWithTransform; readonly visible: _angular_core.Signal; readonly status: _angular_core.Signal<_spartan_ng_brain_questionnaire.BrnQuestionnaireItemStatus | null>; protected onClick(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireProgress { private readonly _questionnaire; readonly ariaLabel: _angular_core.InputSignal; readonly valueText: _angular_core.InputSignal; protected readonly _current: _angular_core.Signal; protected readonly _total: _angular_core.Signal; readonly first: _angular_core.Signal; readonly last: _angular_core.Signal; readonly current: _angular_core.Signal; readonly total: _angular_core.Signal; protected readonly _label: _angular_core.Signal; readonly label: _angular_core.Signal; /** Boolean flags marking which segments of the progress bar are filled. */ readonly segments: _angular_core.Signal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireSkip { private readonly _questionnaire; readonly disabled: _angular_core.InputSignalWithTransform; readonly visible: _angular_core.Signal; readonly status: _angular_core.Signal<_spartan_ng_brain_questionnaire.BrnQuestionnaireItemStatus | null>; protected onClick(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireSubmit { private readonly _questionnaire; readonly disabled: _angular_core.InputSignalWithTransform; readonly visible: _angular_core.Signal; readonly status: _angular_core.Signal<_spartan_ng_brain_questionnaire.BrnQuestionnaireItemStatus | null>; readonly shortcut: _angular_core.Signal<"Enter" | null>; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class BrnQuestionnaireTitle { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } type BrnQuestionnaireCollection = { enabledItems: readonly BrnQuestionnaireItemDefinition[]; itemByName: ReadonlyMap; items: readonly BrnQuestionnaireItemDefinition[]; }; declare function createQuestionnaireCollection(items: readonly BrnQuestionnaireItemDefinition[] | undefined): BrnQuestionnaireCollection | null; declare function getInitialItemName(collection: BrnQuestionnaireCollection | null, defaultItem: string | undefined): string | null; declare function getShortcutByChoiceValue(item: BrnQuestionnaireItemDefinition | undefined, shortcuts: BrnQuestionnaireShortcutMode | null): Map; declare function getCollectionDefinitionWarnings(collection: BrnQuestionnaireCollection, defaultItem: string | undefined): string[]; declare function getCollectionRegistrationWarnings(collection: BrnQuestionnaireCollection, registrations: readonly BrnItemRegistration[], shortcuts: BrnQuestionnaireShortcutMode | null): string[]; declare function provideBrnQuestionnaire(directive: Type): ExistingProvider; declare function injectBrnQuestionnaire(): BrnQuestionnaire; declare function provideBrnQuestionnaireItem(directive: Type): ExistingProvider; declare function injectBrnQuestionnaireItem(): BrnQuestionnaireItem; declare function provideBrnQuestionnaireChoice(directive: Type): ExistingProvider; declare function injectBrnQuestionnaireChoice(): BrnQuestionnaireChoice; declare function hasInputValue(value: unknown): boolean; declare function getShortcutKeys(shortcuts: BrnQuestionnaireShortcutMode | null): string[]; declare function getShortcutFromKey(key: string, shortcuts: BrnQuestionnaireShortcutMode): string | null; declare function getAnswerKeyShortcuts(shortcut: string | null, filled: boolean): string | undefined; declare function isAnswerFilled(answer: BrnAnswerControlRegistration): boolean; declare function isEmptyNavigableInput(answer: BrnAnswerControlRegistration | null): boolean; declare function isTextEntryTarget(element: Element): boolean; declare function isRadioTarget(element: Element): boolean; declare function compareItemOrder(firstItem: BrnItemRegistration, secondItem: BrnItemRegistration): number; declare function compareAnswerOrder(firstAnswer: BrnAnswerControlRegistration, secondAnswer: BrnAnswerControlRegistration): number; declare const BrnQuestionnaireImports: readonly [typeof BrnQuestionnaire, typeof BrnQuestionnaireProgress, typeof BrnQuestionnaireItem, typeof BrnQuestionnaireTitle, typeof BrnQuestionnaireDescription, typeof BrnQuestionnaireChoices, typeof BrnQuestionnaireChoice, typeof BrnQuestionnaireChoiceInput, typeof BrnQuestionnaireChoiceLabel, typeof BrnQuestionnaireChoiceShortcut, typeof BrnQuestionnaireInput, typeof BrnQuestionnaireError, typeof BrnQuestionnairePrevious, typeof BrnQuestionnaireSkip, typeof BrnQuestionnaireNext, typeof BrnQuestionnaireSubmit]; export { BRN_QUESTIONNAIRE_ITEM_VALUE_ACCESSOR, BrnQuestionnaire, BrnQuestionnaireChoice, BrnQuestionnaireChoiceInput, BrnQuestionnaireChoiceLabel, BrnQuestionnaireChoiceShortcut, BrnQuestionnaireChoices, BrnQuestionnaireDescription, BrnQuestionnaireError, BrnQuestionnaireImports, BrnQuestionnaireInput, BrnQuestionnaireItem, BrnQuestionnaireNext, BrnQuestionnairePrevious, BrnQuestionnaireProgress, BrnQuestionnaireSkip, BrnQuestionnaireSubmit, BrnQuestionnaireTitle, compareAnswerOrder, compareItemOrder, createQuestionnaireCollection, getAnswerKeyShortcuts, getCollectionDefinitionWarnings, getCollectionRegistrationWarnings, getInitialItemName, getShortcutByChoiceValue, getShortcutFromKey, getShortcutKeys, hasInputValue, injectBrnQuestionnaire, injectBrnQuestionnaireChoice, injectBrnQuestionnaireItem, isAnswerFilled, isEmptyNavigableInput, isRadioTarget, isTextEntryTarget, provideBrnQuestionnaire, provideBrnQuestionnaireChoice, provideBrnQuestionnaireItem }; export type { BrnAnswerControlRegistration, BrnChoiceRegistration, BrnItemRegistration, BrnPendingFocus, BrnQuestionnaireChoiceDefinition, BrnQuestionnaireCollection, BrnQuestionnaireInputType, BrnQuestionnaireItemDefinition, BrnQuestionnaireItemStatus, BrnQuestionnaireItemValue, BrnQuestionnaireRootState, BrnQuestionnaireShortcutMode };