export declare class TonicTemplate { rawText: string; unsafe: boolean; templateStrings?: string[] | TemplateStringsArray | null; isTonicTemplate: true; constructor(rawText: any, templateStrings?: string[] | TemplateStringsArray | null, unsafe?: boolean); valueOf(): string; toString(): string; } /** * Class Tonic * * @template {T extends object = Record} T Type of the props */ export declare abstract class Tonic> extends window.HTMLElement { private static _tags; private static _refIds; private static _data; private static _states; private static _children; private static _reg; private static _stylesheetRegistry; private static _index; static get version(): any; static get SPREAD(): RegExp; static get ESC(): RegExp; static get AsyncFunctionGenerator(): AsyncGeneratorFunctionConstructor; static get AsyncFunction(): Function; static get MAP(): { '"': string; '&': string; '\'': string; '<': string; '>': string; '`': string; '/': string; }; static ssr: any; static nonce: any; static _hydrating: boolean; static _ssrState: Record | null; private _state; stylesheet?: () => string; styles?: () => string; props: T; preventRenderOnReconnect: boolean; private _id?; pendingReRender?: Promise | null; updated?: ((props: Record) => any); willRender?: (() => any); root?: ShadowRoot | this; willConnect?: () => any; private _source?; connected?: () => void; disconnected?: () => void; private elements; private nodes; private _props; constructor(); abstract render(): TonicTemplate | Promise; defaults(): Record; get isTonicComponent(): true; /** * Get a namespaced event name, given a non-namespaced string. * * @example * MyElement.event('example') // => my-element:example * * @param {string} type The name of the event * @returns {string} The namespaced event name */ static event(type: string): string; /** * Get the tag name of this component. */ static get TAG(): string; private static _createId; private static _normalizeAttrs; private _checkId; /** * Get the component state property. */ get state(): any; set state(newState: any); private _events; private _prop; private _placehold; static match(el: HTMLElement, s: string): Element | null; static getTagName(camelName: string): string; /** * Add all methods to this._props */ static getPropertyNames(proto: any): string[]; /** * Add a component. Calls `window.customElements.define` with the * component's name. * * @param {Tonic} c Component to add * @param {string} [htmlName] Name of the element, default to the class name * @returns {Tonic} */ static add(c: any, htmlName?: string): any; static registerStyles(stylesheetFn: () => string): void; static escape(s: string): string; static unsafeRawString(s: string, templateStrings: string[]): InstanceType; /** * Emit a regular, non-namespaced event. * * @param {string} eventName Event name as a string. * @param {any} detail Any data to go with the event. */ dispatch(eventName: string, detail?: any): void; /** * Emit a namespaced event, using a convention for event names. * * @example * myComponent.emit('test') // => `my-compnent:test` * * @param {string} type The event type, comes after `:` in event name. * @param {string|object|any[]} detail detail for Event constructor * @param {{ bubbles?:boolean, cancelable?:boolean }} opts `Cancelable` and * `bubbles` * @returns {boolean} */ emit(type: string, detail?: string | object | any[], opts?: Partial<{ bubbles: boolean; cancelable: boolean; }>): boolean; html(strings: string[] | TemplateStringsArray, ...values: any[]): InstanceType; scheduleReRender(oldProps: any): Promise; /** * Update the view */ reRender(o?: T | ((props: T) => T)): Promise; /** * If there is a method with the same name as the event type, * then call the method. * @see {@link https://gomakethings.com/the-handleevent-method-is-the-absolute-best-way-to-handle-events-in-web-components/#what-is-the-handleevent-method What is the handleEvent() method?} */ handleEvent(ev: Event): void; private _drainIterator; /** * _set * @param {Element|InstanceType|ShadowRoot} target * @param {()=>any} render * @param {string} content * @returns {Promise|void} * @private */ private _set; private _apply; connectedCallback(): Promise | undefined; isInDocument(target: HTMLElement | ShadowRoot): boolean; disconnectedCallback(): void; } export default Tonic; //# sourceMappingURL=index.d.ts.map