@authup/core
Version:
Package containing global constants, types & interfaces.
24 lines • 1.28 kB
TypeScript
import type { TokenGrantResponse } from '@hapic/oauth2';
import type { Client } from 'hapic';
import { APIClient } from '../api-client';
import type { TokenCreator } from '../token-creator';
import type { ClientResponseErrorTokenHookOptions } from './type';
export declare class ClientResponseErrorTokenHook {
protected client: Client;
protected creator: TokenCreator;
protected creatorClient: APIClient;
protected options: ClientResponseErrorTokenHookOptions;
protected hookId?: number;
protected timer: ReturnType<typeof setTimeout> | undefined;
protected createPromise?: Promise<TokenGrantResponse>;
constructor(client: Client, options: ClientResponseErrorTokenHookOptions);
mount(): void;
unmount(): void;
setTimer(response: Pick<TokenGrantResponse, 'refresh_token' | 'expires_in'>): void;
clearTimer(): void;
create(creator: TokenCreator): Promise<TokenGrantResponse>;
}
export declare function hasClientResponseErrorTokenHook(client: Client): boolean;
export declare function unmountClientResponseErrorTokenHook(client: Client): void;
export declare function mountClientResponseErrorTokenHook(client: Client, options: ClientResponseErrorTokenHookOptions): ClientResponseErrorTokenHook;
//# sourceMappingURL=module.d.ts.map