import * as better_call from 'better-call'; import { U as User, S as Session, I as InferOptionSchema, H as HookEndpointContext } from '../../shared/better-auth.DijUyhfq.cjs'; import '../../shared/better-auth.Bi8FQwDD.cjs'; import 'zod'; import '../../shared/better-auth.WtOxsS45.cjs'; import 'jose'; import 'kysely'; import 'better-sqlite3'; interface UserWithAnonymous extends User { isAnonymous: boolean; } interface AnonymousOptions { /** * Configure the domain name of the temporary email * address for anonymous users in the database. * @default "baseURL" */ emailDomainName?: string; /** * A useful hook to run after an anonymous user * is about to link their account. */ onLinkAccount?: (data: { anonymousUser: { user: UserWithAnonymous & Record; session: Session & Record; }; newUser: { user: User & Record; session: Session & Record; }; }) => Promise | void; /** * Disable deleting the anonymous user after linking */ disableDeleteAnonymousUser?: boolean; /** * Custom schema for the anonymous plugin */ schema?: InferOptionSchema; } declare const schema: { user: { fields: { isAnonymous: { type: "boolean"; required: false; }; }; }; }; declare const anonymous: (options?: AnonymousOptions) => { id: "anonymous"; endpoints: { signInAnonymous: { | undefined)?]>(...inputCtx: C): Promise; options: { method: "POST"; metadata: { openapi: { description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { $ref: string; }; session: { $ref: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/sign-in/anonymous"; }; }; hooks: { after: { matcher(ctx: HookEndpointContext): boolean; handler: (inputContext: better_call.MiddlewareInputContext) => Promise; }[]; }; schema: { user: { fields: { isAnonymous: { type: "boolean"; required: false; }; }; }; }; $ERROR_CODES: { readonly FAILED_TO_CREATE_USER: "Failed to create user"; readonly COULD_NOT_CREATE_SESSION: "Could not create session"; readonly ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: "Anonymous users cannot sign in again anonymously"; }; }; export { type AnonymousOptions, type UserWithAnonymous, anonymous };