Restore function declaration for constructing

This commit is contained in:
Jon Koops 2022-02-16 19:47:45 +01:00 committed by Bruno Oliveira da Silva
parent 1372ab82d3
commit 43ef7f1b7e
2 changed files with 16 additions and 2 deletions

View file

@ -87,7 +87,12 @@ export interface ResourcePermission {
*/
export type KeycloakAuthorizationInstance = KeycloakAuthorization;
export default class KeycloakAuthorization {
/**
* @deprecated Construct a KeycloakAuthorization instance using the `new` keyword instead.
*/
declare function KeycloakAuthorization(keycloak: Keycloak): KeycloakAuthorization;
declare class KeycloakAuthorization {
/**
* Creates a new Keycloak client instance.
* @param config Path to a JSON config file or a plain config object.
@ -120,6 +125,8 @@ export default class KeycloakAuthorization {
entitlement(resourceServerId: string, authorizationRequest?: AuthorizationRequest): KeycloakAuthorizationPromise;
}
export default KeycloakAuthorization;
/**
* @deprecated The 'KeycloakAuthorization' namespace is deprecated, use named imports instead.
*/

View file

@ -326,11 +326,16 @@ export interface KeycloakRoles {
*/
export type KeycloakInstance = Keycloak;
/**
* @deprecated Construct a Keycloak instance using the `new` keyword instead.
*/
declare function Keycloak(config?: KeycloakConfig | string): Keycloak;
/**
* A client for the Keycloak authentication server.
* @see {@link https://keycloak.gitbooks.io/securing-client-applications-guide/content/topics/oidc/javascript-adapter.html|Keycloak JS adapter documentation}
*/
export default class Keycloak {
declare class Keycloak {
/**
* Creates a new Keycloak client instance.
* @param config A configuration object or path to a JSON config file.
@ -615,6 +620,8 @@ export default class Keycloak {
loadUserInfo(): KeycloakPromise<{}, void>;
}
export default Keycloak;
/**
* @deprecated The 'Keycloak' namespace is deprecated, use named imports instead.
*/