import { BetterAuthDBSchema, ModelNames, SecondaryStorage } from "../db/type.mjs"; import { DBAdapter } from "../db/adapter/index.mjs"; import { createLogger } from "../env/logger.mjs"; import { AuthContext } from "../types/context.mjs"; import { OAuthProvider } from "../oauth2/oauth-provider.mjs"; import * as better_call0 from "better-call"; import { EndpointContext, EndpointOptions, StrictEndpoint } from "better-call"; import * as _better_auth_core0 from "@better-auth/core"; //#region src/api/index.d.ts declare const optionsMiddleware: >(inputContext: InputCtx) => Promise; declare const createAuthMiddleware: { (options: Options, handler: (ctx: better_call0.MiddlewareContext & _better_auth_core0.InfoContext & { options: _better_auth_core0.BetterAuthOptions; trustedOrigins: string[]; trustedProviders: string[]; isTrustedOrigin: (url: string, settings?: { allowRelativePaths: boolean; }) => boolean; oauthConfig: { skipStateCookieCheck?: boolean | undefined; storeStateStrategy: "database" | "cookie"; }; newSession: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & Record; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record; } | null; session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & Record; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record; } | null; setNewSession: (session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & Record; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record; } | null) => void; socialProviders: OAuthProvider[]; authCookies: _better_auth_core0.BetterAuthCookies; logger: ReturnType; rateLimit: { enabled: boolean; window: number; max: number; storage: "memory" | "database" | "secondary-storage"; } & Omit<_better_auth_core0.BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">; adapter: DBAdapter<_better_auth_core0.BetterAuthOptions>; internalAdapter: _better_auth_core0.InternalAdapter<_better_auth_core0.BetterAuthOptions>; createAuthCookie: (cookieName: string, overrideAttributes?: Partial | undefined) => _better_auth_core0.BetterAuthCookie; secret: string; secretConfig: string | _better_auth_core0.SecretConfig; sessionConfig: { updateAge: number; expiresIn: number; freshAge: number; cookieRefreshCache: false | { enabled: true; updateAge: number; }; }; generateId: (options: { model: ModelNames; size?: number | undefined; }) => string | false; secondaryStorage: SecondaryStorage | undefined; password: { hash: (password: string) => Promise; verify: (data: { password: string; hash: string; }) => Promise; config: { minPasswordLength: number; maxPasswordLength: number; }; checkPassword: (userId: string, ctx: _better_auth_core0.GenericEndpointContext<_better_auth_core0.BetterAuthOptions>) => Promise; }; tables: BetterAuthDBSchema; runMigrations: () => Promise; publishTelemetry: (event: { type: string; anonymousId?: string | undefined; payload: Record; }) => Promise; skipOriginCheck: boolean | string[]; skipCSRFCheck: boolean; runInBackground: (promise: Promise) => void; runInBackgroundOrAwait: (promise: Promise | void) => _better_auth_core0.Awaitable; }>) => Promise): (inputContext: better_call0.MiddlewareInputContext) => Promise; (handler: (ctx: better_call0.MiddlewareContext & _better_auth_core0.InfoContext & { options: _better_auth_core0.BetterAuthOptions; trustedOrigins: string[]; trustedProviders: string[]; isTrustedOrigin: (url: string, settings?: { allowRelativePaths: boolean; }) => boolean; oauthConfig: { skipStateCookieCheck?: boolean | undefined; storeStateStrategy: "database" | "cookie"; }; newSession: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & Record; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record; } | null; session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & Record; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record; } | null; setNewSession: (session: { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & Record; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; } & Record; } | null) => void; socialProviders: OAuthProvider[]; authCookies: _better_auth_core0.BetterAuthCookies; logger: ReturnType; rateLimit: { enabled: boolean; window: number; max: number; storage: "memory" | "database" | "secondary-storage"; } & Omit<_better_auth_core0.BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">; adapter: DBAdapter<_better_auth_core0.BetterAuthOptions>; internalAdapter: _better_auth_core0.InternalAdapter<_better_auth_core0.BetterAuthOptions>; createAuthCookie: (cookieName: string, overrideAttributes?: Partial | undefined) => _better_auth_core0.BetterAuthCookie; secret: string; secretConfig: string | _better_auth_core0.SecretConfig; sessionConfig: { updateAge: number; expiresIn: number; freshAge: number; cookieRefreshCache: false | { enabled: true; updateAge: number; }; }; generateId: (options: { model: ModelNames; size?: number | undefined; }) => string | false; secondaryStorage: SecondaryStorage | undefined; password: { hash: (password: string) => Promise; verify: (data: { password: string; hash: string; }) => Promise; config: { minPasswordLength: number; maxPasswordLength: number; }; checkPassword: (userId: string, ctx: _better_auth_core0.GenericEndpointContext<_better_auth_core0.BetterAuthOptions>) => Promise; }; tables: BetterAuthDBSchema; runMigrations: () => Promise; publishTelemetry: (event: { type: string; anonymousId?: string | undefined; payload: Record; }) => Promise; skipOriginCheck: boolean | string[]; skipCSRFCheck: boolean; runInBackground: (promise: Promise) => void; runInBackgroundOrAwait: (promise: Promise | void) => _better_auth_core0.Awaitable; }>) => Promise): (inputContext: better_call0.MiddlewareInputContext) => Promise; }; type EndpointHandler = (context: EndpointContext) => Promise; declare function createAuthEndpoint(path: Path, options: Options, handler: EndpointHandler): StrictEndpoint; declare function createAuthEndpoint(options: Options, handler: EndpointHandler): StrictEndpoint; type AuthEndpoint = ReturnType>; type AuthMiddleware = ReturnType; //#endregion export { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware }; //# sourceMappingURL=index.d.mts.map