import { JWKOptions, JWSAlgorithms, Jwk, JwtOptions } from "./types.mjs"; import { getJwtToken, signJWT } from "./sign.mjs"; import { createJwk, generateExportedKeyPair, toExpJWT } from "./utils.mjs"; import { verifyJWT } from "./verify.mjs"; import * as _better_auth_core0 from "@better-auth/core"; import * as better_call0 from "better-call"; import * as z from "zod"; import { JSONWebKeySet, JWTPayload } from "jose"; //#region src/plugins/jwt/index.d.ts declare module "@better-auth/core" { interface BetterAuthPluginRegistry { jwt: { creator: typeof jwt; }; } } declare const jwt: (options?: O) => { id: "jwt"; version: string; options: NoInfer; endpoints: { getJwks: better_call0.StrictEndpoint; getToken: better_call0.StrictEndpoint<"/token", { method: "GET"; requireHeaders: true; use: ((inputContext: better_call0.MiddlewareInputContext) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>)[]; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { token: { type: string; }; }; }; }; }; }; }; }; }; }, { token: string; }>; signJWT: better_call0.StrictEndpoint; overrideOptions: z.ZodOptional>; }, z.core.$strip>; }, { token: string; }>; verifyJWT: better_call0.StrictEndpoint; }, z.core.$strip>; }, { payload: (JWTPayload & Required>) | null; }>; }; hooks: { after: { matcher(context: _better_auth_core0.HookEndpointContext): boolean; handler: (inputContext: better_call0.MiddlewareInputContext) => Promise; }[]; }; schema: { jwks: { fields: { publicKey: { type: "string"; required: true; }; privateKey: { type: "string"; required: true; }; createdAt: { type: "date"; required: true; }; expiresAt: { type: "date"; required: false; }; }; }; }; }; //#endregion export { JWKOptions, JWSAlgorithms, Jwk, JwtOptions, createJwk, generateExportedKeyPair, getJwtToken, jwt, signJWT, toExpJWT, verifyJWT };