From 5281a38cf7f22ecb4f3835c5e40e6a5b299c8bfd Mon Sep 17 00:00:00 2001 From: Jon Koops Date: Sun, 20 Oct 2019 18:03:56 +0200 Subject: [PATCH] [KEYCLOAK-11771] Add missing type definitions for config --- .../oidc/js/src/main/resources/keycloak.d.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/adapters/oidc/js/src/main/resources/keycloak.d.ts b/adapters/oidc/js/src/main/resources/keycloak.d.ts index 515f42f841..ba860c311c 100644 --- a/adapters/oidc/js/src/main/resources/keycloak.d.ts +++ b/adapters/oidc/js/src/main/resources/keycloak.d.ts @@ -24,9 +24,9 @@ export = Keycloak; /** * Creates a new Keycloak client instance. - * @param config Path to a JSON config file or a plain config object. + * @param config A configuration object or path to a JSON config file. */ -declare function Keycloak(config?: string|{}): Keycloak.KeycloakInstance; +declare function Keycloak(config?: Keycloak.KeycloakConfig | string): Keycloak.KeycloakInstance; declare namespace Keycloak { type KeycloakAdapterName = 'cordova' | 'cordova-native' |'default' | any; @@ -37,6 +37,21 @@ declare namespace Keycloak { type KeycloakPromiseType = 'legacy' | 'native'; type KeycloakPkceMethod = 'S256'; + interface KeycloakConfig { + /** + * URL to the Keycloak server, for example: http://keycloak-server/auth + */ + url?: string; + /** + * Name of the realm, for example: 'myrealm' + */ + realm: string; + /** + * Client identifier, example: 'myapp' + */ + clientId: string; + } + interface KeycloakInitOptions { /** * Adds a [cryptographic nonce](https://en.wikipedia.org/wiki/Cryptographic_nonce)