@nopwdio/sdk-js
Version:
Nopwd JS SDK
32 lines (31 loc) • 1.13 kB
TypeScript
import { LitElement } from "lit";
export declare enum State {
AUTHENTICATED = "authenticated",
UNAUTHENTICATED = "unauthenticated",
UNKNOWN = "unknown"
}
/**
* @summary Renders different slotted elements based on the authentication state.
*
* @description
* The `np-if` custom element listens to session state changes and renders different slotted elements
* depending on whether the user is authenticated, unauthenticated, or if the session verification is in progress.
*
* @slot authenticated - The slotted elements to render when a user is logged in.
* @slot unauthenticated - The slotted elements to render when no one is logged in.
* @slot unknown - The slotted elements to render when the session verification is in progress.
*/
export declare class NpIf extends LitElement {
state: State;
constructor();
connectedCallback(): Promise<void>;
disconnectedCallback(): Promise<void>;
private sessionStateListener;
render(): import("lit-html").TemplateResult<1>;
static styles: never[];
}
declare global {
interface HTMLElementTagNameMap {
"np-if": NpIf;
}
}