@nopwdio/sdk-js
Version:
Nopwd JS SDK
50 lines (49 loc) • 1.8 kB
TypeScript
import { LitElement } from "lit";
export declare enum State {
OPERATIONAL = "operational",
DISRUPTED = "disrupted",
DOWN = "down",
UNKNOWN = "unknown",
NODATA = "nodata",
OFFLINE = "offline"
}
/**
* @summary `np-status` is a custom element that displays the current health status of the nopwd API.
*
* @description
* This component connects to a WebSocket to receive real-time status updates and displays
* the current state of the nopwd API.
* The possible states are:
* - `operational`: All systems are functioning correctly.
* - `disrupted`: Some errors occurred in the last 24 hours.
* - `down`: No successful responses in the last hour.
* - `nodata`: Insufficient data to determine status.
* - `offline`: Unable to connect to the service.
* - `unknown`: The status is currently unknown.
*
* @slot - The default slot for the label.
* @slot operational - Content displayed when all services are operational.
* @slot disrupted - Content displayed when some errors occurred in the last 24 hours.
* @slot down - Content displayed when no successful responses in the last hour.
* @slot nodata - Content displayed when there is insufficient data to determine status.
* @slot offline - Content displayed when unable to connect to the service.
*
* @csspart link - The component's link wrapper.
*/
export declare class NpStatus extends LitElement {
state: State;
private ws?;
private updateTimeoutId?;
constructor();
connectedCallback(): Promise<void>;
disconnectedCallback(): Promise<void>;
private connect;
private disconnect;
render(): import("lit-html").TemplateResult<1>;
static styles: import("lit").CSSResult[];
}
declare global {
interface HTMLElementTagNameMap {
"np-status": NpStatus;
}
}