import { z } from 'zod'; import * as better_call from 'better-call'; import { I as InferOptionSchema, H as HookEndpointContext } from '../../shared/better-auth.6fr3ElRe.js'; import '../../shared/better-auth.Bi8FQwDD.js'; import '../../shared/better-auth.BLX8BItA.js'; import 'jose'; import 'kysely'; import 'better-sqlite3'; declare const schema: { user: { fields: { username: { type: "string"; required: false; sortable: true; unique: true; returned: true; transform: { input(value: string | number | boolean | string[] | Date | number[] | null | undefined): string | undefined; }; }; displayUsername: { type: "string"; required: false; }; }; }; }; type UsernameOptions = { schema?: InferOptionSchema; /** * The minimum length of the username * * @default 3 */ minUsernameLength?: number; /** * The maximum length of the username * * @default 30 */ maxUsernameLength?: number; /** * A function to validate the username * * By default, the username should only contain alphanumeric characters and underscores */ usernameValidator?: (username: string) => boolean | Promise; }; declare const username: (options?: UsernameOptions) => { id: "username"; endpoints: { signInUsername: { ; }, "strip", z.ZodTypeAny, { password: string; username: string; rememberMe?: boolean | undefined; }, { password: string; username: string; rememberMe?: boolean | undefined; }>; metadata: { openapi: { summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { $ref: string; }; session: { $ref: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }>]>(...inputCtx: C): Promise; options: { method: "POST"; body: z.ZodObject<{ username: z.ZodString; password: z.ZodString; rememberMe: z.ZodOptional; }, "strip", z.ZodTypeAny, { password: string; username: string; rememberMe?: boolean | undefined; }, { password: string; username: string; rememberMe?: boolean | undefined; }>; metadata: { openapi: { summary: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { $ref: string; }; session: { $ref: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/sign-in/username"; }; }; schema: { user: { fields: { username: { type: "string"; required: false; sortable: true; unique: true; returned: true; transform: { input(value: string | number | boolean | string[] | Date | number[] | null | undefined): string | undefined; }; }; displayUsername: { type: "string"; required: false; }; }; }; }; hooks: { before: { matcher(context: HookEndpointContext): boolean; handler: (inputContext: better_call.MiddlewareInputContext) => Promise; }[]; }; $ERROR_CODES: { readonly OTP_NOT_ENABLED: "OTP not enabled"; readonly OTP_HAS_EXPIRED: "OTP has expired"; readonly TOTP_NOT_ENABLED: "TOTP not enabled"; readonly TWO_FACTOR_NOT_ENABLED: "Two factor isn't enabled"; readonly BACKUP_CODES_NOT_ENABLED: "Backup codes aren't enabled"; readonly INVALID_BACKUP_CODE: "Invalid backup code"; }; }; export { type UsernameOptions, username };