import { type UserRole } from './config'; /** * Does this email have a pending, unexpired team invitation waiting? * * Used by the signup `after` hook to skip auto-creating a personal team — * closes the gap where skipTeamCreation (auth-context.ts) is only set by * the dedicated signup-with-invite route: a person who signs up on their * own, unaware they already have a pending invitation, would otherwise * still get an orphan personal team created first. * * No userId passed to queryOne → runs on the service (RLS-bypass) pool, * same reasoning as the TEAM_NOT_FOUND check in dual-auth.ts: this has to * see invitations regardless of whether anyone is "logged in" yet during * signup, not a user-scoped read. */ export declare function hasPendingInvitationForEmail(email: string): Promise; /** * Should this signup skip automatic team creation? * * True if either the request came through the dedicated invite-flow context * (shouldSkipTeamCreation(), set by signup-with-invite), OR this email * already has a pending, unexpired invitation waiting from any other signup * path (hasPendingInvitationForEmail — see its own doc comment for why this * second check exists). Short-circuits on the first true so a signup that's * already known to be invite-flow never pays for the extra query. */ export declare function shouldSkipTeamCreationForUser(email: string): Promise; export interface UserWithEmail { email: string; id?: string; firstName?: string; } export declare const auth: { handler: (request: Request) => Promise; api: import("better-auth").InferAPI<{ ok: { (inputCtx_0?: ({ body?: undefined; } & { method?: "GET" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { ok: boolean; }; } : { ok: boolean; }>; options: { method: "GET"; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { ok: { type: string; description: string; }; }; required: string[]; }; }; }; }; }; }; isAction: false; }; } & { use: any[]; }; path: "/ok"; }; error: { (inputCtx_0?: ({ body?: undefined; } & { method?: "GET" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: Response; } : Response>; options: { method: "GET"; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "text/html": { schema: { type: "string"; description: string; }; }; }; }; }; }; isAction: false; }; } & { use: any[]; }; path: "/error"; }; signInSocial: { (inputCtx_0: { body: { provider: unknown; callbackURL?: string | undefined; newUserCallbackURL?: string | undefined; errorCallbackURL?: string | undefined; disableRedirect?: boolean | undefined; idToken?: { token: string; nonce?: string | undefined; accessToken?: string | undefined; refreshToken?: string | undefined; expiresAt?: number | undefined; } | undefined; scopes?: string[] | undefined; requestSignUp?: boolean | undefined; loginHint?: string | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { redirect: boolean; token: string; url: undefined; user: { id: string; email: string; name: string; image: string | null | undefined; emailVerified: boolean; createdAt: Date; updatedAt: Date; }; } | { url: string; redirect: boolean; }; } : { redirect: boolean; token: string; url: undefined; user: { id: string; email: string; name: string; image: string | null | undefined; emailVerified: boolean; createdAt: Date; updatedAt: Date; }; } | { url: string; redirect: boolean; }>; options: { method: "POST"; body: import("zod").ZodObject<{ callbackURL: import("zod").ZodOptional; newUserCallbackURL: import("zod").ZodOptional; errorCallbackURL: import("zod").ZodOptional; provider: import("zod").ZodType<"apple" | (string & {}) | "discord" | "facebook" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "notion", unknown, import("better-auth").$ZodTypeInternals<"apple" | (string & {}) | "discord" | "facebook" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "notion", unknown>>; disableRedirect: import("zod").ZodOptional; idToken: import("zod").ZodOptional; accessToken: import("zod").ZodOptional; refreshToken: import("zod").ZodOptional; expiresAt: import("zod").ZodOptional; }, import("better-auth").$strip>>; scopes: import("zod").ZodOptional>; requestSignUp: import("zod").ZodOptional; loginHint: import("zod").ZodOptional; }, import("better-auth").$strip>; metadata: { openapi: { description: string; operationId: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; properties: { redirect: { type: string; enum: boolean[]; }; token: { type: string; description: string; url: { type: string; nullable: boolean; }; user: { type: string; properties: { id: { type: string; }; email: { type: string; }; name: { type: string; nullable: boolean; }; image: { type: string; nullable: boolean; }; emailVerified: { type: string; }; createdAt: { type: string; format: string; }; updatedAt: { type: string; format: string; }; }; required: string[]; }; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/sign-in/social"; }; callbackOAuth: { (inputCtx_0: { body?: { code?: string | undefined; error?: string | undefined; device_id?: string | undefined; error_description?: string | undefined; state?: string | undefined; user?: string | undefined; } | undefined; } & { method: "GET" | "POST"; } & { query?: { code?: string | undefined; error?: string | undefined; device_id?: string | undefined; error_description?: string | undefined; state?: string | undefined; user?: string | undefined; } | undefined; } & { params: { id: string; }; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: void; } : void>; options: { method: ("GET" | "POST")[]; body: import("zod").ZodOptional; error: import("zod").ZodOptional; device_id: import("zod").ZodOptional; error_description: import("zod").ZodOptional; state: import("zod").ZodOptional; user: import("zod").ZodOptional; }, import("better-auth").$strip>>; query: import("zod").ZodOptional; error: import("zod").ZodOptional; device_id: import("zod").ZodOptional; error_description: import("zod").ZodOptional; state: import("zod").ZodOptional; user: import("zod").ZodOptional; }, import("better-auth").$strip>>; metadata: { isAction: false; }; } & { use: any[]; }; path: "/callback/:id"; }; getSession: { (inputCtx_0: { body?: undefined; } & { method?: "GET" | undefined; } & { query?: { disableCookieCache?: unknown; disableRefresh?: unknown; } | undefined; } & { params?: Record; } & { request?: Request; } & { headers: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse; returnHeaders?: ReturnHeaders; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { session: { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; } : { session: { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }>; options: { method: "GET"; query: import("zod").ZodOptional>; disableRefresh: import("zod").ZodOptional>; }, import("better-auth").$strip>>; requireHeaders: true; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { session: { $ref: string; }; user: { $ref: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/get-session"; }; signOut: { (inputCtx_0: { body?: undefined; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { success: boolean; }; } : { success: boolean; }>; options: { method: "POST"; requireHeaders: true; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/sign-out"; }; signUpEmail: { (inputCtx_0?: { body?: { name: string; email: string; password: string; image?: string; callbackURL?: string; rememberMe?: boolean; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse; returnHeaders?: ReturnHeaders; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { token: null; user: { id: string; email: string; name: string; image: string | null | undefined; emailVerified: boolean; createdAt: Date; updatedAt: Date; }; } | { token: string; user: { id: string; email: string; name: string; image: string | null | undefined; emailVerified: boolean; createdAt: Date; updatedAt: Date; }; }; } : { token: null; user: { id: string; email: string; name: string; image: string | null | undefined; emailVerified: boolean; createdAt: Date; updatedAt: Date; }; } | { token: string; user: { id: string; email: string; name: string; image: string | null | undefined; emailVerified: boolean; createdAt: Date; updatedAt: Date; }; }>; options: { method: "POST"; body: import("zod").ZodRecord; metadata: { $Infer: { body: { name: string; email: string; password: string; image?: string; callbackURL?: string; rememberMe?: boolean; }; }; openapi: { description: string; requestBody: { content: { "application/json": { schema: { type: "object"; properties: { name: { type: string; description: string; }; email: { type: string; description: string; }; password: { type: string; description: string; }; image: { type: string; description: string; }; callbackURL: { type: string; description: string; }; rememberMe: { type: string; description: string; }; }; required: string[]; }; }; }; }; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { token: { type: string; nullable: boolean; description: string; }; user: { type: string; properties: { id: { type: string; description: string; }; email: { type: string; format: string; description: string; }; name: { type: string; description: string; }; image: { type: string; format: string; nullable: boolean; description: string; }; emailVerified: { type: string; description: string; }; createdAt: { type: string; format: string; description: string; }; updatedAt: { type: string; format: string; description: string; }; }; required: string[]; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/sign-up/email"; }; signInEmail: { (inputCtx_0: { body: { email: string; password: string; callbackURL?: string | undefined; rememberMe?: boolean | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { redirect: boolean; token: string; url: string | undefined; user: { id: string; email: string; name: string; image: string | null | undefined; emailVerified: boolean; createdAt: Date; updatedAt: Date; }; }; } : { redirect: boolean; token: string; url: string | undefined; user: { id: string; email: string; name: string; image: string | null | undefined; emailVerified: boolean; createdAt: Date; updatedAt: Date; }; }>; options: { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; password: import("zod").ZodString; callbackURL: import("zod").ZodOptional; rememberMe: import("zod").ZodOptional>; }, import("better-auth").$strip>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; properties: { redirect: { type: string; enum: boolean[]; }; token: { type: string; description: string; }; url: { type: string; nullable: boolean; }; user: { type: string; properties: { id: { type: string; }; email: { type: string; }; name: { type: string; nullable: boolean; }; image: { type: string; nullable: boolean; }; emailVerified: { type: string; }; createdAt: { type: string; format: string; }; updatedAt: { type: string; format: string; }; }; required: string[]; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/sign-in/email"; }; forgetPassword: { (inputCtx_0: { body: { email: string; redirectTo?: string | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; }; } : { status: boolean; }>; options: { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodString; redirectTo: import("zod").ZodOptional; }, import("better-auth").$strip>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; }; message: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/forget-password"; }; resetPassword: { (inputCtx_0: { body: { newPassword: string; token?: string | undefined; }; } & { method?: "POST" | undefined; } & { query?: { token?: string | undefined; } | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; }; } : { status: boolean; }>; options: { method: "POST"; query: import("zod").ZodOptional; }, import("better-auth").$strip>>; body: import("zod").ZodObject<{ newPassword: import("zod").ZodString; token: import("zod").ZodOptional; }, import("better-auth").$strip>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/reset-password"; }; verifyEmail: { (inputCtx_0: { body?: undefined; } & { method?: "GET" | undefined; } & { query: { token: string; callbackURL?: string | undefined; }; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: void | { status: boolean; user: { id: any; email: any; name: any; image: any; emailVerified: any; createdAt: any; updatedAt: any; }; } | { status: boolean; user: null; }; } : void | { status: boolean; user: { id: any; email: any; name: any; image: any; emailVerified: any; createdAt: any; updatedAt: any; }; } | { status: boolean; user: null; }>; options: { method: "GET"; query: import("zod").ZodObject<{ token: import("zod").ZodString; callbackURL: import("zod").ZodOptional; }, import("better-auth").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise)[]; metadata: { openapi: { description: string; parameters: ({ name: string; in: "query"; description: string; required: true; schema: { type: "string"; }; } | { name: string; in: "query"; description: string; required: false; schema: { type: "string"; }; })[]; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { type: string; properties: { id: { type: string; description: string; }; email: { type: string; description: string; }; name: { type: string; description: string; }; image: { type: string; description: string; }; emailVerified: { type: string; description: string; }; createdAt: { type: string; description: string; }; updatedAt: { type: string; description: string; }; }; required: string[]; }; status: { type: string; description: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/verify-email"; }; sendVerificationEmail: { (inputCtx_0: { body: { email: string; callbackURL?: string | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; }; } : { status: boolean; }>; options: { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodEmail; callbackURL: import("zod").ZodOptional; }, import("better-auth").$strip>; metadata: { openapi: { description: string; requestBody: { content: { "application/json": { schema: { type: "object"; properties: { email: { type: string; description: string; example: string; }; callbackURL: { type: string; description: string; example: string; nullable: boolean; }; }; required: string[]; }; }; }; }; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; description: string; example: boolean; }; }; }; }; }; }; "400": { description: string; content: { "application/json": { schema: { type: "object"; properties: { message: { type: string; description: string; example: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/send-verification-email"; }; changeEmail: { (inputCtx_0: { body: { newEmail: string; callbackURL?: string | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; }; } : { status: boolean; }>; options: { method: "POST"; body: import("zod").ZodObject<{ newEmail: import("zod").ZodEmail; callbackURL: import("zod").ZodOptional; }, import("better-auth").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; description: string; }; message: { type: string; enum: string[]; description: string; nullable: boolean; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/change-email"; }; changePassword: { (inputCtx_0: { body: { newPassword: string; currentPassword: string; revokeOtherSessions?: boolean | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { token: string | null; user: { id: string; email: string; name: string; image: string | null | undefined; emailVerified: boolean; createdAt: Date; updatedAt: Date; }; }; } : { token: string | null; user: { id: string; email: string; name: string; image: string | null | undefined; emailVerified: boolean; createdAt: Date; updatedAt: Date; }; }>; options: { method: "POST"; body: import("zod").ZodObject<{ newPassword: import("zod").ZodString; currentPassword: import("zod").ZodString; revokeOtherSessions: import("zod").ZodOptional; }, import("better-auth").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { token: { type: string; nullable: boolean; description: string; }; user: { type: string; properties: { id: { type: string; description: string; }; email: { type: string; format: string; description: string; }; name: { type: string; description: string; }; image: { type: string; format: string; nullable: boolean; description: string; }; emailVerified: { type: string; description: string; }; createdAt: { type: string; format: string; description: string; }; updatedAt: { type: string; format: string; description: string; }; }; required: string[]; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/change-password"; }; setPassword: { (inputCtx_0: { body: { newPassword: string; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; }; } : { status: boolean; }>; options: { method: "POST"; body: import("zod").ZodObject<{ newPassword: import("zod").ZodString; }, import("better-auth").$strip>; metadata: { SERVER_ONLY: true; }; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; } & { use: any[]; }; path: "/set-password"; }; updateUser: { (inputCtx_0?: { body?: Partial<{}> & { name?: string; image?: string; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse; returnHeaders?: ReturnHeaders; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; }; } : { status: boolean; }>; options: { method: "POST"; body: import("zod").ZodRecord; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; metadata: { $Infer: { body: Partial<{}> & { name?: string; image?: string; }; }; openapi: { description: string; requestBody: { content: { "application/json": { schema: { type: "object"; properties: { name: { type: string; description: string; }; image: { type: string; description: string; }; }; }; }; }; }; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; description: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/update-user"; }; deleteUser: { (inputCtx_0: { body: { callbackURL?: string | undefined; password?: string | undefined; token?: string | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { success: boolean; message: string; }; } : { success: boolean; message: string; }>; options: { method: "POST"; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; body: import("zod").ZodObject<{ callbackURL: import("zod").ZodOptional; password: import("zod").ZodOptional; token: import("zod").ZodOptional; }, import("better-auth").$strip>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; description: string; }; message: { type: string; enum: string[]; description: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/delete-user"; }; forgetPasswordCallback: { (inputCtx_0: { body?: undefined; } & { method?: "GET" | undefined; } & { query: { callbackURL: string; }; } & { params: { token: string; }; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: never; } : never>; options: { method: "GET"; query: import("zod").ZodObject<{ callbackURL: import("zod").ZodString; }, import("better-auth").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { token: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/reset-password/:token"; }; requestPasswordReset: { (inputCtx_0: { body: { email: string; redirectTo?: string | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; }; } : { status: boolean; }>; options: { method: "POST"; body: import("zod").ZodObject<{ email: import("zod").ZodEmail; redirectTo: import("zod").ZodOptional; }, import("better-auth").$strip>; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; }; message: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/request-password-reset"; }; requestPasswordResetCallback: { (inputCtx_0: { body?: undefined; } & { method?: "GET" | undefined; } & { query: { callbackURL: string; }; } & { params: { token: string; }; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: never; } : never>; options: { method: "GET"; query: import("zod").ZodObject<{ callbackURL: import("zod").ZodString; }, import("better-auth").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { token: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/reset-password/:token"; }; listSessions: { (inputCtx_0: { body?: undefined; } & { method?: "GET" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse; returnHeaders?: ReturnHeaders; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: import("better-auth").Prettify<{ id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }>[]; } : import("better-auth").Prettify<{ id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }>[]>; options: { method: "GET"; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; requireHeaders: true; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "array"; items: { $ref: string; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/list-sessions"; }; revokeSession: { (inputCtx_0: { body: { token: string; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; }; } : { status: boolean; }>; options: { method: "POST"; body: import("zod").ZodObject<{ token: import("zod").ZodString; }, import("better-auth").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; requireHeaders: true; metadata: { openapi: { description: string; requestBody: { content: { "application/json": { schema: { type: "object"; properties: { token: { type: string; description: string; }; }; required: string[]; }; }; }; }; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; description: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/revoke-session"; }; revokeSessions: { (inputCtx_0: { body?: undefined; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; }; } : { status: boolean; }>; options: { method: "POST"; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; requireHeaders: true; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; description: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/revoke-sessions"; }; revokeOtherSessions: { (inputCtx_0: { body?: undefined; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; }; } : { status: boolean; }>; options: { method: "POST"; requireHeaders: true; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; description: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/revoke-other-sessions"; }; linkSocialAccount: { (inputCtx_0: { body: { provider: unknown; callbackURL?: string | undefined; idToken?: { token: string; nonce?: string | undefined; accessToken?: string | undefined; refreshToken?: string | undefined; scopes?: string[] | undefined; } | undefined; requestSignUp?: boolean | undefined; scopes?: string[] | undefined; errorCallbackURL?: string | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { url: string; redirect: boolean; }; } : { url: string; redirect: boolean; }>; options: { method: "POST"; requireHeaders: true; body: import("zod").ZodObject<{ callbackURL: import("zod").ZodOptional; provider: import("zod").ZodType<"apple" | (string & {}) | "discord" | "facebook" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "notion", unknown, import("better-auth").$ZodTypeInternals<"apple" | (string & {}) | "discord" | "facebook" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "vk" | "zoom" | "notion", unknown>>; idToken: import("zod").ZodOptional; accessToken: import("zod").ZodOptional; refreshToken: import("zod").ZodOptional; scopes: import("zod").ZodOptional>; }, import("better-auth").$strip>>; requestSignUp: import("zod").ZodOptional; scopes: import("zod").ZodOptional>; errorCallbackURL: import("zod").ZodOptional; }, import("better-auth").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { url: { type: string; description: string; }; redirect: { type: string; description: string; }; status: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/link-social"; }; listUserAccounts: { (inputCtx_0?: ({ body?: undefined; } & { method?: "GET" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { id: string; provider: string; createdAt: Date; updatedAt: Date; accountId: string; scopes: string[]; }[]; } : { id: string; provider: string; createdAt: Date; updatedAt: Date; accountId: string; scopes: string[]; }[]>; options: { method: "GET"; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "array"; items: { type: string; properties: { id: { type: string; }; provider: { type: string; }; createdAt: { type: string; format: string; }; updatedAt: { type: string; format: string; }; }; accountId: { type: string; }; scopes: { type: string; items: { type: string; }; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/list-accounts"; }; deleteUserCallback: { (inputCtx_0: { body?: undefined; } & { method?: "GET" | undefined; } & { query: { token: string; callbackURL?: string | undefined; }; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { success: boolean; message: string; }; } : { success: boolean; message: string; }>; options: { method: "GET"; query: import("zod").ZodObject<{ token: import("zod").ZodString; callbackURL: import("zod").ZodOptional; }, import("better-auth").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; description: string; }; message: { type: string; enum: string[]; description: string; }; }; required: string[]; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/delete-user/callback"; }; unlinkAccount: { (inputCtx_0: { body: { providerId: string; accountId?: string | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { status: boolean; }; } : { status: boolean; }>; options: { method: "POST"; body: import("zod").ZodObject<{ providerId: import("zod").ZodString; accountId: import("zod").ZodOptional; }, import("better-auth").$strip>; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { status: { type: string; }; }; }; }; }; }; }; }; }; } & { use: any[]; }; path: "/unlink-account"; }; refreshToken: { (inputCtx_0: { body: { providerId: string; accountId?: string | undefined; userId?: string | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: import("better-auth").OAuth2Tokens; } : import("better-auth").OAuth2Tokens>; options: { method: "POST"; body: import("zod").ZodObject<{ providerId: import("zod").ZodString; accountId: import("zod").ZodOptional; userId: import("zod").ZodOptional; }, import("better-auth").$strip>; metadata: { openapi: { description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { tokenType: { type: string; }; idToken: { type: string; }; accessToken: { type: string; }; refreshToken: { type: string; }; accessTokenExpiresAt: { type: string; format: string; }; refreshTokenExpiresAt: { type: string; format: string; }; }; }; }; }; }; 400: { description: string; }; }; }; }; } & { use: any[]; }; path: "/refresh-token"; }; getAccessToken: { (inputCtx_0: { body: { providerId: string; accountId?: string | undefined; userId?: string | undefined; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { accessToken: string; accessTokenExpiresAt: Date | undefined; scopes: string[]; idToken: string | undefined; }; } : { accessToken: string; accessTokenExpiresAt: Date | undefined; scopes: string[]; idToken: string | undefined; }>; options: { method: "POST"; body: import("zod").ZodObject<{ providerId: import("zod").ZodString; accountId: import("zod").ZodOptional; userId: import("zod").ZodOptional; }, import("better-auth").$strip>; metadata: { openapi: { description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { tokenType: { type: string; }; idToken: { type: string; }; accessToken: { type: string; }; refreshToken: { type: string; }; accessTokenExpiresAt: { type: string; format: string; }; refreshTokenExpiresAt: { type: string; format: string; }; }; }; }; }; }; 400: { description: string; }; }; }; }; } & { use: any[]; }; path: "/get-access-token"; }; accountInfo: { (inputCtx_0: { body: { accountId: string; }; } & { method?: "POST" | undefined; } & { query?: Record | undefined; } & { params?: Record; } & { request?: Request; } & { headers?: HeadersInit; } & { asResponse?: boolean; returnHeaders?: boolean; use?: import("better-auth").Middleware[]; path?: string; } & { asResponse?: AsResponse | undefined; returnHeaders?: ReturnHeaders | undefined; }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? { headers: Headers; response: { user: { id: string | number; name?: string; email?: string | null; image?: string; emailVerified: boolean; }; data: Record; } | null; } : { user: { id: string | number; name?: string; email?: string | null; image?: string; emailVerified: boolean; }; data: Record; } | null>; options: { method: "POST"; use: ((inputContext: import("better-auth").MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; email: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { user: { type: string; properties: { id: { type: string; }; name: { type: string; }; email: { type: string; }; image: { type: string; }; emailVerified: { type: string; }; }; required: string[]; }; data: { type: string; properties: {}; additionalProperties: boolean; }; }; required: string[]; additionalProperties: boolean; }; }; }; }; }; }; }; body: import("zod").ZodObject<{ accountId: import("zod").ZodString; }, import("better-auth").$strip>; } & { use: any[]; }; path: "/account-info"; }; }>; options: import("better-auth").BetterAuthOptions; $context: Promise; $Infer: { Session: { session: { id: string; userId: string; expiresAt: Date; createdAt: Date; updatedAt: Date; token: string; ipAddress?: string; userAgent?: string; }; user: { id: string; emailVerified: boolean; name: string; createdAt: Date; updatedAt: Date; email?: string; image?: string; }; }; } & Record; $ERROR_CODES: Record & { USER_NOT_FOUND: string; FAILED_TO_CREATE_USER: string; FAILED_TO_CREATE_SESSION: string; FAILED_TO_UPDATE_USER: string; FAILED_TO_GET_SESSION: string; INVALID_PASSWORD: string; INVALID_EMAIL: string; INVALID_EMAIL_OR_PASSWORD: string; SOCIAL_ACCOUNT_ALREADY_LINKED: string; PROVIDER_NOT_FOUND: string; INVALID_TOKEN: string; ID_TOKEN_NOT_SUPPORTED: string; FAILED_TO_GET_USER_INFO: string; USER_EMAIL_NOT_FOUND: string; EMAIL_NOT_VERIFIED: string; PASSWORD_TOO_SHORT: string; PASSWORD_TOO_LONG: string; USER_ALREADY_EXISTS: string; EMAIL_CAN_NOT_BE_UPDATED: string; CREDENTIAL_ACCOUNT_NOT_FOUND: string; SESSION_EXPIRED: string; FAILED_TO_UNLINK_LAST_ACCOUNT: string; ACCOUNT_NOT_FOUND: string; USER_ALREADY_HAS_PASSWORD: string; }; }; export type Session = typeof auth.$Infer.Session; export type SessionUser = typeof auth.$Infer.Session.user & { name?: string; firstName?: string; lastName?: string; country?: string; timezone?: string; language?: string; role?: UserRole; flags?: import('./entities/types').UserFlag[]; }; /** * Typed session with extended user properties * Use this type when working with sessions that include additionalFields */ export interface TypedSession { session: Session['session']; user: SessionUser; } /** * Get session with properly typed user object * * Better-auth's getSession doesn't infer additionalFields types correctly. * This helper wraps the call and provides the correct TypeScript types. * * @param headers - Request headers containing session cookie * @returns Typed session or null if not authenticated * * @example * ```ts * const session = await getTypedSession(request.headers); * if (session?.user.role === 'admin') { * // TypeScript knows about role * } * ``` */ export declare function getTypedSession(headers: Headers): Promise; //# sourceMappingURL=auth.d.ts.map