index.d.ts 429 B

12345678910111213141516171819202122232425
  1. export class InvalidTokenError extends Error {}
  2. export interface JwtDecodeOptions {
  3. header?: boolean;
  4. }
  5. export interface JwtHeader {
  6. type?: string;
  7. alg?: string;
  8. }
  9. export interface JwtPayload {
  10. iss?: string;
  11. sub?: string;
  12. aud?: string[] | string;
  13. exp?: number;
  14. nbf?: number;
  15. iat?: number;
  16. jti?: string;
  17. }
  18. export default function jwtDecode<T = unknown>(
  19. token: string,
  20. options?: JwtDecodeOptions
  21. ): T;