Created common interface for parsed tokens in typescript declaration file

This commit is contained in:
Dan Hooper 2018-08-23 11:05:01 -04:00 committed by Stan Silvert
parent 3e2e0ac91c
commit 0a8fca7ec4

View file

@ -216,6 +216,16 @@ declare namespace Keycloak {
createdTimestamp?: number;
}
interface KeycloakTokenParsed {
exp?: number;
iat?: number;
nonce?: string;
sub?: string;
session_state?: string;
realm_access?: { roles: string[] };
resource_access?: string[];
}
// export interface KeycloakUserInfo {}
/**
@ -269,15 +279,7 @@ declare namespace Keycloak {
/**
* The parsed token as a JavaScript object.
*/
tokenParsed?: {
exp?: number;
iat?: number;
nonce?: string;
sub?: string;
session_state?: string;
realm_access?: { roles: string[] };
resource_access?: string[];
};
tokenParsed?: KeycloakTokenParsed;
/**
* The base64 encoded refresh token that can be used to retrieve a new token.
@ -287,7 +289,7 @@ declare namespace Keycloak {
/**
* The parsed refresh token as a JavaScript object.
*/
refreshTokenParsed?: { nonce?: string };
refreshTokenParsed?: KeycloakTokenParsed;
/**
* The base64 encoded ID token.
@ -297,7 +299,7 @@ declare namespace Keycloak {
/**
* The parsed id token as a JavaScript object.
*/
idTokenParsed?: { nonce?: string };
idTokenParsed?: KeycloakTokenParsed;
/**
* The estimated time difference between the browser time and the Keycloak