mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Updated jwt-decode definitions to v2.2.0 (#17049)
This commit is contained in:
parent
380c910b74
commit
96d2d239f8
6
types/jwt-decode/index.d.ts
vendored
6
types/jwt-decode/index.d.ts
vendored
@ -1,12 +1,12 @@
|
||||
// Type definitions for jwt-decode v1.4.0
|
||||
// Type definitions for jwt-decode v2.2.0
|
||||
// Project: https://github.com/auth0/jwt-decode
|
||||
// Definitions by: Giedrius Grabauskas <https://github.com/QuatroDevOfficial/>
|
||||
// Definitions by: Giedrius Grabauskas <https://github.com/QuatroDevOfficial/>, Mads Madsen <https://github.com/madsmadsen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
declare namespace JwtDecode {
|
||||
interface JwtDecodeStatic {
|
||||
(token: string): any;
|
||||
(token: string, options?: { header: boolean }): any;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9,4 +9,10 @@ interface TokenDto {
|
||||
iat: number;
|
||||
}
|
||||
|
||||
let decodedToken = jwtDecode(token) as TokenDto;
|
||||
interface TokenHeaderDto {
|
||||
typ: string;
|
||||
alg: string;
|
||||
}
|
||||
|
||||
let decodedTokenPayload = jwtDecode(token) as TokenDto;
|
||||
let decodedTokenHeader = jwtDecode(token, { header: true }) as TokenHeaderDto;
|
||||
Loading…
Reference in New Issue
Block a user