import { RouteDescriptor } from "../../route.mjs"; import { Session } from "../../types.mjs"; import { ClientPlugin } from "../../define-plugin.mjs"; import { BearerTokens } from "../bearer/types.mjs"; import { RefreshInput, SessionJwtPluginConfig, SessionJwtTokens } from "./types.mjs"; //#region src/plugins/session-jwt/index.d.ts declare function sessionJwtPlugin(config?: SessionJwtPluginConfig): ClientPlugin<"session-jwt", "", [RouteDescriptor, { readonly method: "POST"; readonly path: "/refresh"; readonly parseSession: true; readonly expose: false; }>], { sessionJwt: { /** * Get the current access token. If the token is expiring, refresh it. * @returns The current access token or null if no token is found. */ getAccessToken: () => Promise; refresh: () => Promise; getTokens: () => BearerTokens | null; setTokens: (tokens: SessionJwtTokens) => void; clear: () => void; }; }, unknown, Record>; //#endregion export { type SessionJwtPluginConfig, type SessionJwtTokens, sessionJwtPlugin };