@nopwdio/sdk-js
Version:
Nopwd JS SDK
43 lines (42 loc) • 1.61 kB
TypeScript
import { LitElement } from "lit";
export declare enum State {
LOGGINGOUT = "loggingout",// Revoking session
LOGGEDOUT = "loggedout",// Session is revoked
ERROR = "error"
}
/**
* @summary `np-logout` is a custom element that handles logging out the authenticated user.
*
* @description
* This component manages the logout process, providing visual feedback during the process.
* It emits events to notify the parent application when the logout is successful or if an error occurs.
*
* @slot - The default slot for the button label.
* @slot loggingout - Content displayed while the user session is being revoked.
* @slot loggedout - Content displayed after the session has been successfully revoked.
* @slot error - Content displayed when an error occurs during logout.
*
* @event np:logout - Emitted when the session has been successfully revoked.
* @event np:error - Emitted when an error occurs during the logout process.
*
* @csspart button - The component's button element.
*/
export declare class NpLogout extends LitElement {
/** The component's current state. */
state?: State;
/** Duration to reset the state after success or error (in milliseconds). */
resetDuration: number;
connectedCallback(): Promise<void>;
disconnectedCallback(): Promise<void>;
logout(): Promise<void>;
private onClick;
private signalSuccess;
private signalError;
render(): import("lit-html").TemplateResult<1>;
static styles: import("lit").CSSResult[];
}
declare global {
interface HTMLElementTagNameMap {
"np-logout": NpLogout;
}
}