import * as _angular_core from '@angular/core'; import { InjectionToken, Provider, Signal, WritableSignal } from '@angular/core'; import * as ng_primitives_input from 'ng-primitives/input'; import { NgpInputState } from 'ng-primitives/input'; import { BooleanInput } from '@angular/cdk/coercion'; import * as ng_primitives_state from 'ng-primitives/state'; import { SetterOptions } from 'ng-primitives/state'; import * as ng_primitives_password from 'ng-primitives/password'; import { Observable } from 'rxjs'; interface NgpPasswordConfig { /** * The accessible label for the toggle button when the password is hidden. * @default 'Show password' */ showLabel: string; /** * The accessible label for the toggle button when the password is visible. * @default 'Hide password' */ hideLabel: string; /** * The message announced to screen readers when the password becomes visible. * @default 'Your password is shown' */ shownAnnouncement: string; /** * The message announced to screen readers when the password becomes hidden. * @default 'Your password is hidden' */ hiddenAnnouncement: string; /** * Whether to opt the input out of password manager injection by default. * @default false */ ignorePasswordManagers: boolean; } declare const defaultPasswordConfig: NgpPasswordConfig; declare const NgpPasswordConfigToken: InjectionToken; /** * Provide the default Password configuration * @param config The Password configuration * @returns The provider */ declare function providePasswordConfig(config: Partial): Provider[]; /** * Inject the Password configuration * @returns The global Password configuration */ declare function injectPasswordConfig(): NgpPasswordConfig; /** * Apply the `ngpPasswordInput` directive to an `input` element within an `ngpPassword` container. * It is a complete input (form control, interactions, autofill) with password visibility toggling * layered on top, so it does not need to be combined with `ngpInput`. */ declare class NgpPasswordInput { /** * Access the global password configuration. */ private readonly config; /** * The id of the input. */ readonly id: _angular_core.InputSignal; /** * Whether the input is disabled. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Whether to opt the input out of password manager injection * (1Password, LastPass, Bitwarden, etc.). */ readonly ignorePasswordManagers: _angular_core.InputSignalWithTransform; /** * The state for the password input primitive. */ protected readonly state: ng_primitives_input.NgpInputState; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The state for the PasswordInput pattern, extending the Input state. */ type NgpPasswordInputState = NgpInputState; /** * The props interface for the PasswordInput pattern. */ interface NgpPasswordInputProps { /** * The id of the input. */ readonly id?: Signal; /** * Whether the input is disabled. */ readonly disabled?: Signal; /** * Whether to opt the input out of password manager injection. */ readonly ignorePasswordManagers?: Signal; } declare const ngpPasswordInput: ({ id, disabled, ignorePasswordManagers, }: NgpPasswordInputProps) => NgpPasswordInputState; declare const injectPasswordInputState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const providePasswordInputState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpPasswordToggle` directive to a `button` element to toggle the visibility of the * password within an `ngpPassword` container. */ declare class NgpPasswordToggle { /** * Access the global password configuration. */ private readonly config; /** * The accessible label shown when the password is hidden. */ readonly showLabel: _angular_core.InputSignal; /** * The accessible label shown when the password is visible. */ readonly hideLabel: _angular_core.InputSignal; /** * The message announced when the password becomes visible. */ readonly shownAnnouncement: _angular_core.InputSignal; /** * The message announced when the password becomes hidden. */ readonly hiddenAnnouncement: _angular_core.InputSignal; /** * The state for the password toggle primitive. */ protected readonly state: ng_primitives_password.NgpPasswordToggleState; /** * Toggle the visibility of the password. */ toggle(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The state interface for the PasswordToggle pattern. */ interface NgpPasswordToggleState { /** * Toggle the visibility of the password. */ toggle(): void; } /** * The props interface for the PasswordToggle pattern. */ interface NgpPasswordToggleProps { /** * The accessible label shown when the password is hidden. */ readonly showLabel: Signal; /** * The accessible label shown when the password is visible. */ readonly hideLabel: Signal; /** * The message announced when the password becomes visible. */ readonly shownAnnouncement: Signal; /** * The message announced when the password becomes hidden. */ readonly hiddenAnnouncement: Signal; } declare const ngpPasswordToggle: ({ showLabel, hideLabel, shownAnnouncement, hiddenAnnouncement, }: NgpPasswordToggleProps) => NgpPasswordToggleState; declare const injectPasswordToggleState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const providePasswordToggleState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpPassword` directive is a container for a password field and its visibility toggle. */ declare class NgpPassword { /** * Whether the password is visible. */ readonly visible: _angular_core.InputSignalWithTransform; /** * The default visibility state for uncontrolled usage. * @default false */ readonly defaultVisible: _angular_core.InputSignalWithTransform; /** * Emits when the visibility state changes. */ readonly visibleChange: _angular_core.OutputEmitterRef; /** * The state for the password primitive. */ protected readonly state: ng_primitives_password.NgpPasswordState; /** * Whether the password is currently visible. */ readonly isVisible: Signal; /** * Toggle the visibility of the password. */ toggle(): void; /** * Set the visibility of the password. */ setVisible(value: boolean, options?: SetterOptions): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Public state surface for the Password primitive. */ interface NgpPasswordState { /** * Whether the password is currently visible. */ readonly visible: WritableSignal; /** * Emits when the visibility state changes. */ readonly visibleChange: Observable; /** * The id of the registered input, used to wire up `aria-controls`. * @internal */ readonly inputId: Signal; /** * Toggle the visibility state. */ toggle(): void; /** * Set the visibility state. */ setVisible(value: boolean, options?: SetterOptions): void; /** * Set the default visibility state. */ setDefaultVisible(value: boolean): void; /** * Register the password input with the container. * @internal */ registerInput(input: HTMLInputElement, id: Signal): void; /** * Focus the registered input. * @internal */ focusInput(): void; } /** * Inputs for configuring the Password primitive. */ interface NgpPasswordProps { /** * Whether the password is visible. */ readonly visible: Signal; /** * The default visibility state for uncontrolled usage. */ readonly defaultVisible?: Signal; /** * Callback fired when the visibility state changes. */ readonly onVisibleChange?: (visible: boolean) => void; } declare const ngpPassword: ({ visible: _visible, defaultVisible: _defaultVisible, onVisibleChange, }: NgpPasswordProps) => NgpPasswordState; declare const injectPasswordState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const providePasswordState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; export { NgpPassword, NgpPasswordConfigToken, NgpPasswordInput, NgpPasswordToggle, defaultPasswordConfig, injectPasswordConfig, injectPasswordInputState, injectPasswordState, injectPasswordToggleState, ngpPassword, ngpPasswordInput, ngpPasswordToggle, providePasswordConfig, providePasswordInputState, providePasswordState, providePasswordToggleState }; export type { NgpPasswordConfig, NgpPasswordInputProps, NgpPasswordInputState, NgpPasswordProps, NgpPasswordState, NgpPasswordToggleProps, NgpPasswordToggleState };