From 9f3b8478174811df22be563441e449256e819623 Mon Sep 17 00:00:00 2001 From: Jon Koops Date: Sat, 4 Apr 2020 16:07:25 +0200 Subject: [PATCH] KEYCLOAK-13714 Add missing type definition for logout options --- adapters/oidc/js/src/main/resources/keycloak.d.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/adapters/oidc/js/src/main/resources/keycloak.d.ts b/adapters/oidc/js/src/main/resources/keycloak.d.ts index b666eb8120..884ab5ca13 100644 --- a/adapters/oidc/js/src/main/resources/keycloak.d.ts +++ b/adapters/oidc/js/src/main/resources/keycloak.d.ts @@ -208,6 +208,13 @@ declare namespace Keycloak { cordovaOptions?: { [optionName: string]: string }; } + interface KeycloakLogoutOptions { + /** + * Specifies the uri to redirect to after logout. + */ + redirectUri?: string; + } + type KeycloakPromiseCallback = (result: T) => void; class KeycloakPromise extends Promise { @@ -233,7 +240,7 @@ declare namespace Keycloak { interface KeycloakAdapter { login(options?: KeycloakLoginOptions): KeycloakPromise; - logout(options?: any): KeycloakPromise; + logout(options?: KeycloakLogoutOptions): KeycloakPromise; register(options?: KeycloakLoginOptions): KeycloakPromise; accountManagement(): KeycloakPromise; redirectUri(options: { redirectUri: string; }, encodeHash: boolean): string; @@ -454,9 +461,8 @@ declare namespace Keycloak { /** * Redirects to logout. * @param options Logout options. - * @param options.redirectUri Specifies the uri to redirect to after logout. */ - logout(options?: any): KeycloakPromise; + logout(options?: KeycloakLogoutOptions): KeycloakPromise; /** * Redirects to registration form. @@ -479,9 +485,8 @@ declare namespace Keycloak { /** * Returns the URL to logout the user. * @param options Logout options. - * @param options.redirectUri Specifies the uri to redirect to after logout. */ - createLogoutUrl(options?: any): string; + createLogoutUrl(options?: KeycloakLogoutOptions): string; /** * Returns the URL to registration page.