import { AuthResponse, SWRLoginPlugin } from '@swr-login/core'; /** Credentials for password-based login */ interface PasswordCredentials { /** Username, email, or phone number */ username: string; /** User's password */ password: string; /** Optional: remember me flag */ rememberMe?: boolean; } interface PasswordPluginOptions { /** URL of your login API endpoint */ loginUrl: string; /** URL of your logout API endpoint (optional) */ logoutUrl?: string; /** Custom fetch options (e.g., headers) */ fetchOptions?: RequestInit; /** * Transform server response to AuthResponse. * Override if your API has a different response shape. */ transformResponse?: (data: unknown) => AuthResponse; } /** * Password login plugin for username/password authentication. * * @example * ```ts * import { PasswordPlugin } from '@swr-login/plugin-password'; * * const plugin = PasswordPlugin({ * loginUrl: '/api/auth/login', * logoutUrl: '/api/auth/logout', * }); * * // Use with SWRLoginProvider * * ``` */ declare function PasswordPlugin(options: PasswordPluginOptions): SWRLoginPlugin; export { type PasswordCredentials, PasswordPlugin, type PasswordPluginOptions };