Skip to content

Commit

Permalink
KEYCLOAK-13739 Add missing type definition for register options
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkoops authored and ssilvert committed Jun 17, 2020
1 parent 3f7ebb2 commit 6dde131
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions adapters/oidc/js/src/main/resources/keycloak.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ declare namespace Keycloak {
redirectUri?: string;
}

interface KeycloakRegisterOptions extends Omit<KeycloakLoginOptions, 'action'> { }

type KeycloakPromiseCallback<T> = (result: T) => void;

class KeycloakPromise<TSuccess, TError> extends Promise<TSuccess> {
Expand All @@ -241,7 +243,7 @@ declare namespace Keycloak {
interface KeycloakAdapter {
login(options?: KeycloakLoginOptions): KeycloakPromise<void, void>;
logout(options?: KeycloakLogoutOptions): KeycloakPromise<void, void>;
register(options?: KeycloakLoginOptions): KeycloakPromise<void, void>;
register(options?: KeycloakRegisterOptions): KeycloakPromise<void, void>;
accountManagement(): KeycloakPromise<void, void>;
redirectUri(options: { redirectUri: string; }, encodeHash: boolean): string;
}
Expand Down Expand Up @@ -466,10 +468,9 @@ declare namespace Keycloak {

/**
* Redirects to registration form.
* @param options Supports same options as Keycloak#login but `action` is
* set to `'register'`.
* @param options The options used for the registration.
*/
register(options?: any): KeycloakPromise<void, void>;
register(options?: KeycloakRegisterOptions): KeycloakPromise<void, void>;

/**
* Redirects to the Account Management Console.
Expand All @@ -490,10 +491,9 @@ declare namespace Keycloak {

/**
* Returns the URL to registration page.
* @param options Supports same options as Keycloak#createLoginUrl but
* `action` is set to `'register'`.
* @param options The options used for creating the registration URL.
*/
createRegisterUrl(options?: KeycloakLoginOptions): string;
createRegisterUrl(options?: KeycloakRegisterOptions): string;

/**
* Returns the URL to the Account Management Console.
Expand Down

0 comments on commit 6dde131

Please sign in to comment.