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 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: import("better-call").StrictEndpoint; getToken: import("better-call").StrictEndpoint<"/token", { method: "GET"; requireHeaders: true; use: ((inputContext: import("better-call").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: import("better-call").StrictEndpoint; overrideOptions: z.ZodOptional>; }, z.core.$strip>; }, { token: string; }>; verifyJWT: import("better-call").StrictEndpoint; }, z.core.$strip>; }, { payload: (JWTPayload & Required>) | null; }>; }; hooks: { after: { matcher(context: import("@better-auth/core").HookEndpointContext): boolean; handler: (inputContext: import("better-call").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 { type JWKOptions, type JWSAlgorithms, type Jwk, type JwtOptions, createJwk, generateExportedKeyPair, getJwtToken, jwt, signJWT, toExpJWT, verifyJWT };