From 84a5a8bb62b78a7269a7bad1032868249caa9ce7 Mon Sep 17 00:00:00 2001 From: "Rosiek.Slawomir YSI" Date: Wed, 20 Jan 2016 15:56:02 +0100 Subject: [PATCH] Another set of fixes for definition --- oidc-token-manager/oidc-token-manager.d.ts | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/oidc-token-manager/oidc-token-manager.d.ts b/oidc-token-manager/oidc-token-manager.d.ts index b1e3f2cea..b744f7885 100644 --- a/oidc-token-manager/oidc-token-manager.d.ts +++ b/oidc-token-manager/oidc-token-manager.d.ts @@ -9,8 +9,8 @@ declare module Oidc { } class DefaultPromise { - constructor(promise); - then(successCallback: () => void, errorCallback: () => void): DefaultPromise; + constructor(promise: any); + then(successCallback: (value?: any) => void, errorCallback: (reason?) => void): DefaultPromise; catch(errorCallback: () => void): DefaultPromise; } @@ -39,7 +39,7 @@ declare module Oidc { loadMetadataAsync(): DefaultPromise; loadX509SigningKeyAsync(): DefaultPromise; - loadUserProfile(access_token: string); + loadUserProfile(access_token: string): DefaultPromise; loadAuthorizationEndpoint(): void; createTokenRequestAsync(): DefaultPromise; createLogoutRequestAsync(id_token_hint: string): DefaultPromise; @@ -74,6 +74,19 @@ declare module Oidc { setPromiseFactory(promiseFactory: DefaultPromiseFactory): void; setHttpRequest(httpRequest: DefaultHttpRequest): void; } + + interface OidcToken { + profile: string; + id_token: string; + access_token: string; + expires_at: number; + scope: string; + scopes: string[]; + session_state: any; + expired: boolean; + expires_in: number; + toJSON(): string; + } interface OidcTokenManager { profile: any; @@ -82,11 +95,11 @@ declare module Oidc { expired: boolean; expires_in: number; expires_at: number; - scope: any; - scopes: any[]; + scope: string; + scopes: string[]; session_state: any; - saveToken(token): void; + saveToken(token: OidcToken): void; addOnTokenRemoved(cb: () => void): void; addOnTokenObtained(cb: () => void): void; addOnTokenExpiring(cb: () => void): void;