DefinitelyTyped/angular-jwt/angular-jwt.d.ts
adstep f01a67a8f2 authManager update and tests (#10858)
* authManager update and tests

* return type annotation
2016-09-06 22:42:24 +09:00

38 lines
1006 B
TypeScript

// Type definitions for angular-jwt 0.0.8
// Project: https://github.com/auth0/angular-jwt
// Definitions by: Reto Rezzonico <https://github.com/rerezz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare namespace angular.jwt {
interface JwtToken {
iss?: string;
sub?: string;
aud?: string;
exp?: number;
nbf?: number;
iat?: number;
jti?: string;
unique_name?: string;
}
interface IJwtHelper {
decodeToken(token: string): JwtToken;
getTokenExpirationDate(token: any): Date;
isTokenExpired(token: any, offsetSeconds?: number): boolean;
}
interface IJwtInterceptor {
tokenGetter(...params : any[]): string;
}
interface IAuthManagerServiceProvider {
authenticate(): void;
unauthenticate(): void;
checkAuthOnRefresh(): void;
redirectWhenUnauthenticated(): void;
}
}