Updated jwt-decode definitions to v2.2.0 (#17049)

This commit is contained in:
Mads Madsen 2017-06-09 00:08:28 +02:00 committed by Mohamed Hegazy
parent 380c910b74
commit 96d2d239f8
2 changed files with 10 additions and 4 deletions

View File

@ -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;
}
}

View File

@ -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;