nexwidget
Version:
An ESNext Web Component library.
63 lines (62 loc) • 2.21 kB
TypeScript
import { noChange, nothing, TemplateResult } from 'lit-html/lit-html.js';
export * from 'lit-html/lit-html.js';
export * from './lib/add-pending-task.js';
export * from './lib/css-tag.js';
export declare type Constructor<T = {}> = new (...args: any[]) => T;
export declare type WidgetAnimation = {
readonly keyframes: Keyframe[];
readonly options?: KeyframeAnimationOptions;
} | null;
export declare type WidgetAttributeType = 'string' | 'number' | 'boolean';
export declare type WidgetTemplate =
| TemplateResult
| string
| number
| typeof nothing
| typeof noChange;
export declare type WidgetReactives<T extends typeof Nexwidget> =
(keyof T['prototype'] & string)[];
export declare type WidgetAttributes<T extends typeof Nexwidget> = {
readonly key: keyof T['prototype'] & string;
readonly type: WidgetAttributeType;
}[];
export declare class Nexwidget extends HTMLElement {
#private;
static get styles(): CSSStyleSheet[];
static get reactives(): string[];
static get attributes(): string[];
static get propertyKeysForObservedAttributes(): string[];
static get observedAttributes(): string[];
static registerAs<
T extends typeof Nexwidget,
K extends keyof HTMLElementTagNameMap,
>(this: T & (new () => HTMLElementTagNameMap[K]), tagName: K): void;
static createReactives<T extends typeof Nexwidget>(
this: T,
reactives: WidgetReactives<T>,
): void;
static createAttributes<T extends typeof Nexwidget>(
this: T,
attributes: WidgetAttributes<T>,
): void;
get removedSignal(): AbortSignal | undefined;
get unmountedSignal(): AbortSignal | undefined;
get template(): WidgetTemplate;
get mountAnimation(): WidgetAnimation;
get updateOrSlotChangeAnimation(): WidgetAnimation;
get usesNexwidget(): true;
getCSSProperty(key: string): string;
attributeChangedCallback(
_key: string,
oldValue: string,
newValue: string,
): void;
connectedCallback(): void;
disconnectedCallback(): void;
addedCallback(): void;
updatedCallback(): void;
slotChangedCallback(): void;
mountedCallback(): void;
removedCallback(): void;
unmountedCallback(): void;
}