@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) • 705 B
TypeScript
import { ReactiveElement } from 'lit';
type Constructor<T = Record<string, unknown>> = {
new (...args: any[]): T;
prototype: T;
};
export type ElementSize = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
export declare const ElementSizes: Record<string, ElementSize>;
export type DefaultElementSize = Exclude<ElementSize, 'xxs' | 'xs' | 'xxl'>;
export interface SizedElementInterface {
size: ElementSize;
}
export declare function SizedMixin<T extends Constructor<ReactiveElement>>(constructor: T, { validSizes, noDefaultSize, defaultSize, }?: {
validSizes?: ElementSize[];
noDefaultSize?: boolean;
defaultSize?: ElementSize;
}): T & Constructor<SizedElementInterface>;
export {};