/** * Public, supported entry point for the OIDC service worker `postMessage` * protocol, available directly from `@axa-fr/oidc-client`. * * The same exports are also published from * `@axa-fr/oidc-client-service-worker/protocol`. The two modules are kept * deliberately in sync (and verified by a unit test) so applications that * depend only on `@axa-fr/oidc-client` can interact with the service worker * without adding a transitive dependency. * * See `packages/oidc-client-service-worker/PROTOCOL.md` for the full * specification. */ /** * Semver-protected version of the service worker `postMessage` protocol. */ export declare const PROTOCOL_VERSION: "1.0.0"; /** * Every supported service worker message type. The values are also the * literal strings used on the wire as `MessageEventData.type` and must * remain stable across patch and minor versions of the protocol. */ export declare const ServiceWorkerMessageType: { readonly SKIP_WAITING: "SKIP_WAITING"; readonly CLAIM: "claim"; readonly CLEAR: "clear"; readonly INIT: "init"; readonly SET_STATE: "setState"; readonly GET_STATE: "getState"; readonly SET_CODE_VERIFIER: "setCodeVerifier"; readonly GET_CODE_VERIFIER: "getCodeVerifier"; readonly SET_SESSION_STATE: "setSessionState"; readonly GET_SESSION_STATE: "getSessionState"; readonly SET_NONCE: "setNonce"; readonly GET_NONCE: "getNonce"; readonly SET_DPOP_NONCE: "setDemonstratingProofOfPossessionNonce"; readonly GET_DPOP_NONCE: "getDemonstratingProofOfPossessionNonce"; readonly SET_DPOP_JWK: "setDemonstratingProofOfPossessionJwk"; readonly GET_DPOP_JWK: "getDemonstratingProofOfPossessionJwk"; }; export type ServiceWorkerMessageTypeKey = keyof typeof ServiceWorkerMessageType; export type ServiceWorkerMessageTypeValue = (typeof ServiceWorkerMessageType)[ServiceWorkerMessageTypeKey]; export interface ServiceWorkerMessage { type: ServiceWorkerMessageTypeValue | 'SKIP_WAITING' | 'claim'; configurationName: string; data: TData; tabId?: string; } export interface ServiceWorkerResponse { configurationName?: string; error?: unknown; [key: string]: unknown; } /** Stable internal token placeholders – matched by the SW request handler. */ export declare const TOKEN_PLACEHOLDERS: { readonly ACCESS_TOKEN: "ACCESS_TOKEN_SECURED_BY_OIDC_SERVICE_WORKER"; readonly REFRESH_TOKEN: "REFRESH_TOKEN_SECURED_BY_OIDC_SERVICE_WORKER"; readonly NONCE_TOKEN: "NONCE_SECURED_BY_OIDC_SERVICE_WORKER"; readonly CODE_VERIFIER: "CODE_VERIFIER_SECURED_BY_OIDC_SERVICE_WORKER"; }; export declare const DPOP_TOKEN_PLACEHOLDER_PREFIX: "DPOP_SECURED_BY_OIDC_SERVICE_WORKER"; export declare const STORAGE_KEY_PREFIX: { readonly TAB_ID: "oidc.tabId."; readonly STATE: "oidc.state."; readonly NONCE: "oidc.nonce."; readonly CODE_VERIFIER: "oidc.code_verifier."; readonly LOGIN_PARAMS: "oidc.login."; readonly SW_VERSION_MISMATCH_RELOAD: "oidc.sw.version_mismatch_reload."; }; export declare const SW_CONTROLLER_CHANGE_RELOAD_COUNT_KEY: "oidc.sw.controllerchange_reload_count"; export declare const buildStorageKey: (prefix: (typeof STORAGE_KEY_PREFIX)[keyof typeof STORAGE_KEY_PREFIX], configurationName: string) => string; export declare const buildSecuredTokenPlaceholder: (placeholder: (typeof TOKEN_PLACEHOLDERS)[keyof typeof TOKEN_PLACEHOLDERS], configurationName: string, tabId?: string) => string; export declare const buildDpopSecuredPlaceholder: (configurationName: string, tabId?: string) => string; export declare const isServiceWorkerMessageType: (value: unknown) => value is ServiceWorkerMessageTypeValue; //# sourceMappingURL=protocol.d.ts.map