import { CheckSessionIFrame } from './checkSessionIFrame.js'; import { ILOidcLocation } from './location'; import { Tokens } from './parseTokens.js'; import { AuthorityConfiguration, Fetch, OidcConfiguration, StringMap } from './types.js'; export declare const getFetchDefault: () => typeof fetch; export interface OidcAuthorizationServiceConfigurationJson { check_session_iframe?: string; issuer: string; } export declare class OidcAuthorizationServiceConfiguration { private checkSessionIframe; private issuer; private authorizationEndpoint; private tokenEndpoint; private revocationEndpoint; private userInfoEndpoint; private endSessionEndpoint; constructor(request: any); } export type LoginCallback = { callbackPath: string; }; export type InternalLoginCallback = { callbackPath: string; state: string; parsedTokens: Tokens; scope: string; extras: StringMap; }; export declare class Oidc { configuration: OidcConfiguration; userInfo: null; tokens?: Tokens; events: Array; timeoutId: NodeJS.Timeout | number; configurationName: string; checkSessionIFrame: CheckSessionIFrame; getFetch: () => Fetch; location: ILOidcLocation; /** * `true` while {@link logoutAsync} is executing or has scheduled a * navigation to the identity provider's end-session endpoint that has not * yet committed. Consumers (UI guards, silent-renew handlers, 401 retry * interceptors, …) should check this flag and skip starting a new auth * flow when it is set, even if `tokens` is null. */ isLoggingOut: boolean; constructor(configuration: OidcConfiguration, configurationName: string, getFetch: () => Fetch, location?: ILOidcLocation); subscribeEvents(func: any): string; removeEventSubscription(id: any): void; publishEvent(eventName: any, data: any): void; static getOrCreate: (getFetch: () => Fetch, location: ILOidcLocation) => (configuration: any, name?: string) => any; /** * Retrieve an existing OIDC instance previously initialized via * {@link Oidc.getOrCreate}. * * Since issue #1679, this method no longer throws when the requested * configuration has not been initialized; it returns `null` instead. * This makes hooks such as `useOidc`, `useOidcUser` and `useOidcIdToken` * safe to call outside of an `` (e.g. in unit tests or * Storybook stories). * * Use {@link Oidc.getOrThrow} to preserve the previous fail-fast * behaviour. */ static get(name?: string): Oidc | null; /** * Retrieve an existing OIDC instance, throwing an explicit error if it * has not been initialized. This preserves the historical (pre-#1679) * fail-fast behaviour of `Oidc.get`. */ static getOrThrow(name?: string): Oidc; static eventNames: { service_worker_not_supported_by_browser: string; token_acquired: string; logout_from_another_tab: string; logout_from_same_tab: string; token_renewed: string; token_timer: string; loginAsync_begin: string; loginAsync_error: string; loginCallbackAsync_begin: string; loginCallbackAsync_end: string; loginCallbackAsync_error: string; loginCallbackAsync_navigated: string; loginCallbackAsync_navigation_error: string; refreshTokensAsync_begin: string; refreshTokensAsync: string; refreshTokensAsync_end: string; refreshTokensAsync_error: string; refreshTokensAsync_silent_error: string; tryKeepExistingSessionAsync_begin: string; tryKeepExistingSessionAsync_end: string; tryKeepExistingSessionAsync_error: string; silentLoginAsync_begin: string; silentLoginAsync: string; silentLoginAsync_end: string; silentLoginAsync_error: string; syncTokensAsync_begin: string; syncTokensAsync_lock_not_available: string; syncTokensAsync_end: string; syncTokensAsync_error: string; tokensInvalidAndWaitingActionsToRefresh: string; loadingTimeout_error: string; }; _silentLoginCallbackFromIFrame(): void; _silentLoginErrorCallbackFromIFrame(exception?: any): void; silentLoginCallbackAsync(): Promise; initPromise: any; initAsync(authority: string, authorityConfiguration: AuthorityConfiguration): Promise; tryKeepExistingSessionPromise: any; tryKeepExistingSessionAsync(): Promise; startCheckSessionAsync(checkSessionIFrameUri: any, clientId: any, sessionState: any, isSilentSignin?: boolean): Promise; loginPromise: Promise; loginAsync(callbackPath?: string, extras?: StringMap, isSilentSignin?: boolean, scope?: string, silentLoginOnly?: boolean): Promise; loginCallbackPromise: Promise; loginCallbackAsync(isSilenSignin?: boolean): Promise; generateDemonstrationOfProofOfPossessionAsync(accessToken: string, url: string, method: string, extras?: StringMap): Promise; loginCallbackWithAutoTokensRenewPromise: Promise; loginCallbackWithAutoTokensRenewAsync(): Promise; userInfoPromise: Promise; userInfoAsync(noCache?: boolean, demonstrating_proof_of_possession?: boolean): Promise; renewTokensPromise: Promise; renewTokensAsync(extras?: StringMap, scope?: string): Promise; destroyAsync(status: any): Promise; /** * Drops the local OIDC session (tokens, user info, service-worker storage) * and broadcasts `logout_from_same_tab`, without contacting the identity * provider's `end_session_endpoint` and without revoking tokens. * * Use this for SPA-only logouts, service-worker-only flows, or * error-recovery paths where a full IdP logout is not needed or not * desirable. For a standard OIDC RP-initiated logout use * {@link logoutAsync} instead. */ clearSessionPromise: Promise; clearSessionAsync(): Promise; logoutSameTabAsync(clientId: string, sub: any): Promise; logoutOtherTabAsync(clientId: string, sub: any): Promise; logoutPromise: Promise; logoutAsync(callbackPathOrUrl?: string | null | undefined, extras?: StringMap): Promise; } export default Oidc; //# sourceMappingURL=oidc.d.ts.map