import { LitElement, type PropertyDeclaration } from 'lit';
import { CSSResultGroup } from '../../../Dom/Css';
import { FlowDirection } from '../../Types/FlowDirection';
import { IPropertyChangedEvent, type IPropertyChangedEventDetail } from './Events/IChangedEvent';
import type { ICustomElementEvents } from './ICustomElementEvents';
import type { IConnectedCallback } from './Interfaces/IConnectedCallback';
import type { IDisconnectedCallback } from './Interfaces/IDisconnectedCallback';
import { IEventEmitter, IEventListenerSubscription, IEventDetail } from '@breadstone/mosaik-elements';
export type UnpackCustomEvent<T> = T extends CustomEvent<infer U> ? U : unknown;
/**
 * The base class of all custom components.
 *
 * @fires connected {CustomEvent<IEventDetail>} - Called when the element is connected to the DOM.
 * @fires disconnected {CustomEvent<IEventDetail>} - Called when the element is disconnected from the DOM.
 * @fires changed {IPropertyChangedEvent} - Called when the element will be updated.
 *
 * @public
 */
export declare class CustomElement extends LitElement implements IConnectedCallback, IDisconnectedCallback, ICustomElementEvents {
    private readonly _connected;
    private readonly _disconnected;
    private readonly _changed;
    private readonly _subscriptions;
    private _dir;
    private _lang;
    /**
     * Constructs a new instance of the `CustomElement` class.
     *
     * @public
     */
    constructor();
    /**
     * Gets or sets the `dir` property.
     *
     * @public
     * @override
     * @attr
     */
    get dir(): FlowDirection;
    set dir(value: FlowDirection);
    /**
     * Gets or sets the `lang` property.
     *
     * @public
     * @override
     * @attr
     */
    get lang(): string;
    set lang(value: string);
    /**
     * Called when the element is connected to the DOM.
     * Provides reference to `IEventEmitter` as event argument.
     *
     * @public
     * @eventProperty
     * @readonly
     */
    get connected(): IEventEmitter;
    /**
     * Called when the element is disconnected from the DOM.
     * Provides reference to `IEventEmitter` as event argument.
     *
     * @public
     * @eventProperty
     * @readonly
     */
    get disconnected(): IEventEmitter;
    /**
     * Called when the element will be updated.
     * Provides reference to `IEventEmitter` as event argument.
     *
     * @public
     * @eventProperty
     * @readonly
     */
    get changed(): IEventEmitter<IPropertyChangedEventDetail>;
    /**
     * @public
     * @override
     */
    connectedCallback(): void;
    /**
     * @public
     * @override
     */
    disconnectedCallback(): void;
    /**
     * @public
     * @override
     */
    attributeChangedCallback(name: string, old: string | null, value: string | null): void;
    /**
     * Adopts the specified styles.
     *
     * @public
     * @param styles - The styles to adopt.
     */
    adoptStyle(styles: CSSResultGroup): void;
    /**
     * Adds an event listener.
     * The listener will be removed when the element is disconnected from the DOM.
     *
     * @public
     * @hidden
     */
    on<TEvent extends keyof HTMLElementEventMap>(event: TEvent, listener: (this: HTMLElement, event: HTMLElementEventMap[TEvent]) => unknown, options?: boolean | AddEventListenerOptions): IEventListenerSubscription;
    /**
     * Removes an event listener.
     *
     * @public
     * @hidden
     */
    off(subscription: IEventListenerSubscription): void;
    off<TEvent extends keyof HTMLElementEventMap>(event: TEvent, listener: (this: HTMLElement, event: HTMLElementEventMap[TEvent]) => unknown): void;
    /**
     * Emits a custom event with more convenient defaults.
     *
     * @public
     * @hidden
     */
    emit<TEvent extends Event, TDetail extends UnpackCustomEvent<TEvent>>(event: TEvent, eventInitDict?: CustomEventInit<TDetail>): boolean;
    emit<TEvent extends keyof HTMLElementEventMap, TDetail extends UnpackCustomEvent<HTMLElementEventMap[TEvent]>>(type: keyof HTMLElementEventMap, eventInitDict?: CustomEventInit<TDetail>): boolean;
    /**
     * @public
     * @override
     * @hidden
     */
    requestUpdate(name?: keyof this, oldValue?: unknown, options?: PropertyDeclaration): void;
    /**
     * @protected
     * @override
     */
    protected firstUpdated(changedProperties: Map<keyof this, unknown>): void;
    /**
     * @protected
     * @override
     */
    protected update(changedProperties: Map<keyof this, unknown>): void;
    /**
     * @protected
     * @override
     */
    protected willUpdate(changedProperties: Map<keyof this, unknown>): void;
    /**
     * A method that will be called when the element template is applied.
     * In this method are the element children available.
     *
     * @protected
     * @virtual
     */
    protected onApplyTemplate(): void;
    /**
     * Returns the template part with the specified name.
     * The template child is a child element with the `part` attribute.
     *
     * @protected
     *
     * @param name - a part name.
     */
    protected getTemplatePart<TElement extends Element = Element>(name: string): TElement;
    /**
     * Returns the template parts with the specified name.
     * The template parts are elements with the `part` attribute.
     * If the name is empty, all template parts will be returned.
     *
     * @protected
     *
     * @param name - a part name.
     */
    protected getTemplateParts<TElement extends Element = Element>(name: string): Array<TElement>;
    /**
     * Returns all template parts.
     *
     * @protected
     */
    protected getAllTemplateParts(): Array<Element>;
    /**
     * Renders the element.
     *
     * @protected
     * @virtual
     */
    protected render(): unknown;
    /**
     * Returns the lang attribute of the absolute root node in the DOM.
     *
     * @private
     */
    private getRootLang;
    private registerSubscription;
    private unregisterSubscription;
}
/**
 * @public
 */
declare global {
    interface HTMLElementEventMap {
        connected: CustomEvent<IEventDetail>;
        disconnected: CustomEvent<IEventDetail>;
        changed: IPropertyChangedEvent;
    }
}
//# sourceMappingURL=CustomElement.d.ts.map