Skip to content

Commit

Permalink
Add a default JWT header export
Browse files Browse the repository at this point in the history
  • Loading branch information
Sambego committed Nov 16, 2020
1 parent 53ab806 commit 8172c82
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ export interface JwtDecodeOptions {
header?: boolean;
}

export interface JwtClaims {
export interface JwtHeader {
type?: string;
alg?: string;
}

export interface JwtPayload {
iss?: string;
sub?: string;
aud?: string[] | string;
Expand All @@ -14,4 +19,7 @@ export interface JwtClaims {
jti?: string;
}

export default function jwtDecode<ReturnType = unknown>(token: string, options?: JwtDecodeOptions): ReturnType;
export default function jwtDecode<T = unknown>(
token: string,
options?: JwtDecodeOptions
): T;

0 comments on commit 8172c82

Please sign in to comment.