@pagamio/frontend-commons-lib
Version:
Pagamio library for Frontend reusable components like the form engine and table container
28 lines (27 loc) • 892 B
TypeScript
interface LogoutOptions {
clearStorage?: boolean;
invalidateSession?: boolean;
onLogoutSuccess?: () => void;
onLogoutError?: (error: Error) => void;
logoutEndpoint?: string;
storageKeys?: string[];
customCleanup?: () => Promise<void> | void;
}
interface LogoutServiceConfig {
baseUrl: string;
refreshEndpoint: string;
logoutEndpoint?: string;
storageKeys?: string[];
}
export declare class LogoutService {
private readonly tokenManager;
private readonly options;
private readonly baseUrl;
constructor(config: LogoutServiceConfig);
logout(options?: Partial<LogoutOptions>): Promise<boolean>;
private invalidateServerSession;
private clearBrowserCache;
}
declare const createLogoutService: (config: LogoutServiceConfig) => LogoutService;
export { createLogoutService };
export type { LogoutOptions, LogoutServiceConfig };