@spectrum-web-components/base
Version:
The `SpectrumElement` base class as created by mixing `SpectrumMixin` onto `LitElement` adopts `dir` values from the `document` at connection time with a fallback to `lrt`. In a TypeScript context, it also enforces the presence of `this.shadowRoot` on ext
18 lines (17 loc) • 628 B
TypeScript
import { LitElement, ReactiveElement } from 'lit';
type Constructor<T = Record<string, unknown>> = {
new (...args: any[]): T;
prototype: T;
};
export interface SpectrumInterface {
shadowRoot: ShadowRoot;
isLTR: boolean;
hasVisibleFocusInTree(): boolean;
dir: 'ltr' | 'rtl';
}
export declare function SpectrumMixin<T extends Constructor<ReactiveElement>>(constructor: T): T & Constructor<SpectrumInterface>;
declare const SpectrumElement_base: typeof LitElement & Constructor<SpectrumInterface>;
export declare class SpectrumElement extends SpectrumElement_base {
static VERSION: string;
}
export {};