@loadsmart/miranda-wc
Version:
Miranda Web Components component library
62 lines (61 loc) • 2.01 kB
TypeScript
import type { PropertyValues } from 'lit';
import { Component } from '../component';
import type { FormComponentProps } from '../component';
export type SwitchSize = 'default' | 'large';
export interface SwitchProps extends FormComponentProps {
checked?: boolean;
initialChecked?: boolean;
size?: SwitchSize;
onchange?: GlobalEventHandlers['onchange'];
}
declare const Switch_base: import("../../utils/types").Constructor<import("../component/form-component.mixin").WithFormComponentMixinInterface> & typeof Component;
export declare class Switch extends Switch_base implements SwitchProps {
#private;
static shadowRootOptions: {
delegatesFocus: boolean;
mode: ShadowRootMode;
serializable?: boolean;
slotAssignment?: SlotAssignmentMode;
};
static styles: import("lit").CSSResult[][];
static get properties(): {
checked: {
type: BooleanConstructor;
reflect: boolean;
};
initialChecked: {
type: BooleanConstructor;
attribute: string;
};
size: {
type: StringConstructor;
reflect: boolean;
};
};
/**
* Switch size.
*/
size: SwitchProps['size'];
/**
* Should the switch be checked initially or when the form it is in is reset.
*/
initialChecked: SwitchProps['initialChecked'];
static define(): void;
createRenderRoot(): DocumentFragment | HTMLElement;
connectedCallback(): Promise<void>;
disconnectedCallback(): void;
update(changedProperties: PropertyValues<this>): void;
render(): import("lit-html").TemplateResult<1>;
get input(): HTMLInputElement | null;
set checked(checked: boolean);
get checked(): boolean;
formResetCallback(): void;
formStateRestoreCallback(state: unknown): void;
formDisabledCallback(disabled: boolean): void;
}
declare global {
interface HTMLElementTagNameMap {
'm-switch': Switch;
}
}
export {};