@auth0/auth0-spa-js
Version:
Auth0 SDK for Single Page Applications using Authorization Code Grant Flow with PKCE
14 lines (13 loc) • 716 B
TypeScript
import { WorkerRefreshTokenMessage, WorkerRevokeTokenMessage } from './worker.types';
/**
* Sends a message to a Web Worker and returns a Promise that resolves with
* the worker's response, or rejects if the worker replies with an error.
*
* Uses a {@link MessageChannel} so each call gets its own private reply port,
* making concurrent calls safe without shared state.
*
* @param message - The typed message to send (`refresh` or `revoke`).
* @param to - The target {@link Worker} instance.
* @returns A Promise that resolves with the worker's response payload.
*/
export declare const sendMessage: <T = any>(message: WorkerRefreshTokenMessage | WorkerRevokeTokenMessage, to: Worker) => Promise<T>;