password-manager-autofill-utilities
Version:
TypeScript utilities to control password manager autofill behavior across different password managers
32 lines • 1.39 kB
TypeScript
import { PasswordManager, PasswordManagerBehavior, PasswordManagerProvider, HtmlAttributes } from '../types';
/**
* Abstract base class for password manager providers
* Provides common functionality and enforces the interface contract
*/
export declare abstract class BasePasswordManagerProvider implements PasswordManagerProvider {
abstract readonly manager: PasswordManager;
/**
* Get attributes for the specified behavior
* @param behavior - The desired behavior
* @returns HTML attributes to apply
*/
getAttributes(behavior: PasswordManagerBehavior): HtmlAttributes;
/**
* Check if this provider supports the given behavior
* @param behavior - The behavior to check
* @returns true if supported
*/
supportsBehavior(behavior: PasswordManagerBehavior): boolean;
/**
* Get attributes that prevent the password manager from interacting with the field
* Must be implemented by each provider
*/
protected abstract getIgnoreAttributes(): HtmlAttributes;
/**
* Get attributes that explicitly allow the password manager to interact with the field
* Default implementation returns empty object (no special attributes needed)
* Can be overridden by providers that have specific allow attributes
*/
protected getAllowAttributes(): HtmlAttributes;
}
//# sourceMappingURL=base.d.ts.map