Files
SnowLuma/.pnpm-store/v11/files/9a/d7fa5b34dea9317f1fa8a2239055ed588c0dfe5b57d026d806f81e79856d06782f92610ba221a5b772b2e5c94381dda1a09a1b8ee39388f719091d1fec5143
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

24 lines
911 B
Plaintext

import { AsymmetricAlgorithm, SignatureAlgorithm } from "./jwa.js";
import { HonoJsonWebKey, SignatureKey } from "./jws.js";
import { JWTPayload } from "./types.js";
import { TokenHeader, VerifyOptions, VerifyOptionsWithAlg } from "./jwt.js";
//#region src/utils/jwt/index.d.ts
/**
* @module
* JWT utility.
*/
export declare const Jwt: {
sign: (payload: JWTPayload, privateKey: SignatureKey, alg?: SignatureAlgorithm) => Promise<string>;
verify: (token: string, publicKey: SignatureKey, algOrOptions: SignatureAlgorithm | VerifyOptionsWithAlg) => Promise<JWTPayload>;
decode: (token: string) => {
header: TokenHeader;
payload: JWTPayload;
};
verifyWithJwks: (token: string, options: {
keys?: HonoJsonWebKey[];
jwks_uri?: string;
verification?: VerifyOptions;
allowedAlgorithms: readonly AsymmetricAlgorithm[];
}, init?: RequestInit) => Promise<JWTPayload>;
};
//#endregion