import { LitElement, PropertyDeclaration, PropertyValues } from 'lit';

type EventTypeRequiresDetail<T> = T extends keyof GlobalEventHandlersEventMap ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, unknown>> ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, never>> ? never : Partial<GlobalEventHandlersEventMap[T]['detail']> extends GlobalEventHandlersEventMap[T]['detail'] ? never : T : never : never;
type EventTypeDoesNotRequireDetail<T> = T extends keyof GlobalEventHandlersEventMap ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, unknown>> ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, never>> ? T : Partial<GlobalEventHandlersEventMap[T]['detail']> extends GlobalEventHandlersEventMap[T]['detail'] ? T : never : T : T;
type EventTypesWithRequiredDetail = {
    [EventType in keyof GlobalEventHandlersEventMap as EventTypeRequiresDetail<EventType>]: true;
};
type EventTypesWithoutRequiredDetail = {
    [EventType in keyof GlobalEventHandlersEventMap as EventTypeDoesNotRequireDetail<EventType>]: true;
};
type WithRequired<T, K extends keyof T> = T & {
    [P in K]-?: T[P];
};
type CxEventInit<T> = T extends keyof GlobalEventHandlersEventMap ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, unknown>> ? GlobalEventHandlersEventMap[T] extends CustomEvent<Record<PropertyKey, never>> ? CustomEventInit<GlobalEventHandlersEventMap[T]['detail']> : Partial<GlobalEventHandlersEventMap[T]['detail']> extends GlobalEventHandlersEventMap[T]['detail'] ? CustomEventInit<GlobalEventHandlersEventMap[T]['detail']> : WithRequired<CustomEventInit<GlobalEventHandlersEventMap[T]['detail']>, 'detail'> : CustomEventInit : CustomEventInit;
type GetCustomEventType<T> = T extends keyof GlobalEventHandlersEventMap ? GlobalEventHandlersEventMap[T] extends CustomEvent<unknown> ? GlobalEventHandlersEventMap[T] : CustomEvent<unknown> : CustomEvent<unknown>;
export default class CortexElement extends LitElement {
    dir: string;
    lang: string;
    theme: 'light' | 'dark';
    preRender: boolean;
    /** Emits a custom event with more convenient defaults. */
    emit<T extends string & keyof EventTypesWithoutRequiredDetail>(name: EventTypeDoesNotRequireDetail<T>, options?: CxEventInit<T> | undefined): GetCustomEventType<T>;
    emit<T extends string & keyof EventTypesWithRequiredDetail>(name: EventTypeRequiresDetail<T>, options: CxEventInit<T>): GetCustomEventType<T>;
    static version: string;
    static define(name: string, elementConstructor?: typeof CortexElement, options?: ElementDefinitionOptions): void;
    static dependencies: Record<string, typeof CortexElement>;
    static createProperty(name: PropertyKey, options?: PropertyDeclaration): void;
    constructor();
    protected firstUpdated(_changedProperties: PropertyValues): void;
    protected runFirstUpdated(_changedProperties: PropertyValues): void;
    protected connectedUpdatedCallback(): void;
    protected runConnectedCallback(): void;
    adoptedCallback(): void;
    connectedCallback(): void;
    disconnectedCallback(): void;
    private handleThemeChange;
    getTheme(): "light" | "dark";
    getState<K extends keyof this>(key: string): this[K];
}
export interface CortexFormControl extends CortexElement {
    checkValidity: () => boolean;
    defaultChecked?: boolean;
    defaultValue?: unknown;
    disabled?: boolean;
    form?: string | HTMLElement;
    getForm: () => HTMLFormElement | null;
    max?: number | string | Date;
    maxlength?: number;
    min?: number | string | Date;
    minlength?: number;
    name: string;
    pattern?: string;
    reportValidity: () => boolean;
    required?: boolean;
    setCustomValidity: (message: string) => void;
    step?: number | 'any';
    readonly validationMessage: string;
    readonly validity: ValidityState;
    value: unknown;
}
export {};
