//#region src/pkce.d.ts interface PKCE { code_verifier: string; code_challenge: string; code_challenge_method: string; } type PKCEPublicPart = Omit; declare function generate(): Promise; type PKCE_STATE = { response_type: "id_token"; redirect_uri: string; pkce_code_verifier: string; }; type RESPONSE_CODE_STATE = { response_type: "code"; redirect_uri: string; }; declare function savePKCEState(store: Storage, input: PKCE_STATE | RESPONSE_CODE_STATE): void; declare function getPKCEState(store: Storage): PKCE_STATE | RESPONSE_CODE_STATE | null; declare function clearPKCEState(store: Storage): void; //#endregion //#region src/types.d.ts type GenericObject = { [key: string]: any; }; type Claims = { iss: string; aud: string; identityscheme: string; authenticationtype: string; sub: string; iat: number; exp: number; [key: string]: string | number; }; type Prompt = undefined | "none" | "login"; type ResponseType = "code" | "id_token"; interface AuthorizeUrlParams { acrValues?: string | string[]; redirectUri: string; responseType: ResponseType; responseMode: string; pkce?: PKCE | PKCEPublicPart; state?: string; loginHint?: string; uiLocales?: string; extraUrlParams?: { [key: string]: string | null; }; scope: string; prompt?: Prompt; nonce?: string; } interface AuthorizeUrlParamsOptional { acrValues?: string | string[]; redirectUri?: string; responseType?: ResponseType; responseMode?: string; pkce?: PKCE | PKCEPublicPart; state?: string; loginHint?: string; uiLocales?: string; extraUrlParams?: { [key: string]: string | null; }; scope?: string; prompt?: Prompt; nonce?: string; } interface AuthorizeResponse extends GenericObject { code?: string; id_token?: string; /** Only available when id_token is */ claims?: Claims; error?: string; error_description?: string; state?: string; traceId?: string; } declare const ALL_VIA: readonly ["redirect", "popup"]; type ViaTuple = typeof ALL_VIA; type Via = ViaTuple[number]; interface AuthorizeParams extends Partial> { via: Via; acrValues?: string | string[]; redirectUri?: string; responseType?: ResponseType; traceParent?: string; } interface RedirectAuthorizeParams extends Partial { acrValues?: string | string[]; redirectUri?: string; } type SilentAuthorizeParams = Partial> & { timeout?: number; }; interface PopupAuthorizeParams extends Partial { acrValues?: string | string[]; redirectUri?: string; width?: number; height?: number; backdrop?: boolean; } interface AuthorizeResponsiveParams { [key: string]: AuthorizeParams | PopupAuthorizeParams; } //#endregion //#region src/errors.d.ts declare class IduraSDKError extends Error {} //#endregion //#region src/OAuth2Error.d.ts declare class OAuth2Error extends IduraSDKError { error: string; error_description?: string; state?: string; constructor(error: string, error_description?: string, state?: string); } //#endregion //#region src/OpenIDConfiguration.d.ts declare class OpenIDMetadata { issuer: string; jwks_uri: string; authorization_endpoint: string; pushed_authorization_request_endpoint: string; token_endpoint: string; userinfo_endpoint: string; end_session_endpoint: string; response_types_supported: string[]; response_modes_supported: string[]; subject_types_supported: string[]; acr_values_supported: string[]; id_token_signing_alg_values_supported: string[]; } declare class OpenIDConfiguration extends OpenIDMetadata { authority: string; clientID: string; constructor(authority: string, clientID: string); fetchMetadata(): Promise; } //#endregion //#region src/CriiptoConfiguration.d.ts declare class IduraSDKConfigurationError extends IduraSDKError {} type CriiptoMetadataClient = { client_id: string; }; declare class CriiptoMetadata { clients: CriiptoMetadataClient[]; } declare class CriiptoConfiguration extends CriiptoMetadata { authority: string; clientID: string; client: CriiptoMetadataClient; constructor(authority: string, clientID: string); fetchMetadata(): Promise; } //#endregion //#region src/Redirect.d.ts declare class CriiptoAuthRedirect { criiptoAuth: CriiptoAuth; store: Storage; constructor(criiptoAuth: CriiptoAuth); /** * Start a redirect based authorize request */ authorize(params: RedirectAuthorizeParams): Promise; match(opts?: { location?: URL; }): Promise; hasMatch(opts?: { location?: Location; }): boolean; } //#endregion //#region src/Popup.d.ts declare class CriiptoAuthPopup { criiptoAuth: CriiptoAuth; _latestParams: PopupAuthorizeParams; _latestUrl: string; backdrop: CriiptoAuthPopupBackdrop; window: Window; checker: number; constructor(criiptoAuth: CriiptoAuth); open(url: string, params: PopupAuthorizeParams): Window; listen(params: PopupAuthorizeParams): Promise; buildAuthorizeUrl(params: PopupAuthorizeParams): Promise<{ url: string; params: AuthorizeUrlParams; traceId: string; }>; trigger(initialParams: PopupAuthorizeParams): Promise; authorize(params: PopupAuthorizeParams): Promise; close(): void; callback(origin: string | "*"): void; } declare class CriiptoAuthPopupBackdrop { popup: CriiptoAuthPopup; enabled: boolean; template: string | null; constructor(popup: CriiptoAuthPopup); render(params: PopupAuthorizeParams): void; handleOpen(): void; handleCancel(): void; remove(): void; } //#endregion //#region src/Silent.d.ts declare class CriiptoAuthSilent { criiptoAuth: CriiptoAuth; iframe: HTMLIFrameElement; constructor(criiptoAuth: CriiptoAuth); open(url: string): HTMLIFrameElement; remove(iframe: HTMLIFrameElement): void; listen(iframe: HTMLIFrameElement): Promise; authorize(params: SilentAuthorizeParams): Promise; } //#endregion //#region src/util.d.ts declare function parseAuthorizeParamsFromUrl(input: string): AuthorizeUrlParamsOptional & { domain: string; clientID: string; }; declare function parseAuthorizeResponseFromLocation(location: Location | URL): AuthorizeResponse; //#endregion //#region src/index.d.ts interface CriiptoAuthOptions { domain: string; clientID: string; store: Storage; redirectUri?: string; responseType?: ResponseType; acrValues?: string | string[]; scope?: string; /** * @deprecated Development use only */ protocol?: "https" | "http"; } declare class CriiptoAuth { #private; _openIdConfiguration: OpenIDConfiguration; options: CriiptoAuthOptions; domain: string; clientID: string; popup: CriiptoAuthPopup; redirect: CriiptoAuthRedirect; silent: CriiptoAuthSilent; store: Storage; scope: string; constructor(options: CriiptoAuthOptions); _setup(): Promise; fetchOpenIDConfiguration(): Promise; fetchCriiptoConfiguration(): Promise; /** * Logout the user, clearing any SSO state * Will redirect the user to clear the session and then redirect back to `redirectUri` */ logout(options: { redirectUri: string; state?: string; }): Promise; /** * Start a redirect based authorize request */ authorize(options: RedirectAuthorizeParams): Promise; checkSession(params: SilentAuthorizeParams): Promise; authorizeResponsive(queries: AuthorizeResponsiveParams): Promise; buildAuthorizeUrlSearchParams(params: AuthorizeUrlParams): Promise; buildAuthorizeUrl(params: AuthorizeUrlParams): Promise; pushAuthorizationRequest(params: AuthorizeUrlParams, traceParent?: string): Promise<{ authorizeUrl: URL; traceId: string; }>; processResponse(params: AuthorizeResponse, pkce?: { code_verifier: string; redirect_uri: string; }): Promise; buildAuthorizeParams(params: AuthorizeUrlParamsOptional): AuthorizeUrlParams; } //#endregion export { AuthorizeResponse, type AuthorizeUrlParams, type AuthorizeUrlParamsOptional, CriiptoAuth, CriiptoAuth as default, type CriiptoConfiguration, IduraSDKConfigurationError, IduraSDKError, OAuth2Error, OpenIDConfiguration, type PKCE, type PKCEPublicPart, type PopupAuthorizeParams, Prompt, type RedirectAuthorizeParams, type ResponseType, clearPKCEState, generate as generatePKCE, getPKCEState, parseAuthorizeParamsFromUrl, parseAuthorizeResponseFromLocation, savePKCEState }; //# sourceMappingURL=index.d.ts.map