Merge pull request #6978 from QuatroDevOfficial/jwt-decode

Add jwt-decode.d.ts
This commit is contained in:
Masahiro Wakame
2015-12-01 23:24:08 +09:00
2 changed files with 28 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
/// <reference path="jwt-decode.d.ts" />
import jwtDecode = require('jwt-decode');
let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIiLCJleHAiOjEzOTMyODY4OTMsImlhdCI6MTM5MzI2ODg5M30.4-iaDojEVl0pJQMjrbM1EzUIfAZgsbK_kgnVyVxFSVo";
interface TokenDto {
foo: string;
exp: number;
iat: number;
}
let decodedToken = jwtDecode(token) as TokenDto;
+16
View File
@@ -0,0 +1,16 @@
// Type definitions for jwt-decode v1.4.0
// Project: https://github.com/auth0/jwt-decode
// Definitions by: Giedrius Grabauskas <https://github.com/QuatroDevOfficial/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module JwtDecode {
interface JwtDecodeStatic {
(token: string): any;
}
}
declare module 'jwt-decode' {
var jwtDecode: JwtDecode.JwtDecodeStatic;
export = jwtDecode;
}