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)