UNPKG

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