/** * jwt-simple 的内联替代:与 jwt-simple 0.5.6 保持相同的行为面,包括 * 由 token header 的 alg 决定验证算法、nbf/exp 秒级时间戳检查和错误消息; * 唯一的差异是 HMAC 签名比较使用 timingSafeEqual(结果语义不变)。 * RS256 仅支持验证,与 jwt-simple 相同。 */ declare const algorithmMap: { readonly HS256: 'sha256'; readonly HS384: 'sha384'; readonly HS512: 'sha512'; readonly RS256: 'RSA-SHA256'; }; type Algorithm = keyof typeof algorithmMap; export declare function encode(payload: object, key: string, algorithm?: Algorithm): string; export declare function decode(token: string, key: string): object; export {};