import { type Auth } from 'better-auth'; import type { AuthSessionResolver } from './access.js'; import type { BetterAuthConfig } from './config.js'; import type { AnyDb, Dialect } from './dialect.js'; import type { EmailFacade } from './email.js'; /** * Returns better-auth's plain `Auth`, not the plugin-parameterised type its * builder infers: declaration emit would otherwise inline that whole inferred * options object into the published `.d.ts`, where it no longer satisfies * better-auth's own `BetterAuthOptions` constraint. Plugin-specific endpoints * are reached through runtime checks (see the OpenAPI schema lookup in * `index.ts`), so nothing depends on the wider type. */ export declare function createAuth(db: AnyDb, cfg: BetterAuthConfig, dialect: Dialect, userSchema?: Record): Auth; /** * Adapt the raw better-auth instance to our internal {@link AuthSessionResolver} * contract. better-auth's `getSession` has a union return (a bare session, or a * `{ headers, response }` wrapper when `returnHeaders` is set); we only ever * call the bare form, so we narrow on `'user' in result` and map to our shape. * Keeping this adapter here means internal modules never depend on better-auth's * evolving types. */ export declare function toAuthSessionResolver(auth: ReturnType): AuthSessionResolver; /** * Fill better-auth's email hooks from the bunderstack email facade. Only fills * gaps: user-supplied handlers always win, and nothing is injected when email * isn't configured. emailAndPassword is only touched when the user enabled it * (injecting it unasked would enable the feature). */ export declare function withEmailAuthDefaults(cfg: BetterAuthConfig, email: EmailFacade, emailConfigured: boolean): BetterAuthConfig; //# sourceMappingURL=auth.d.ts.map