type Vars = Record; interface Options { throwErrors?: boolean; throwWarnings?: boolean; variables?: Vars; refs?: Vars; refsVariableName?: string; autoReturn?: boolean; } type RenderingFunction = (result?: any) => void; interface Area { area_id: string; name: string; } interface Device { id: string; name: string | null; area_id: string | null; [key: string]: unknown; } interface State { attributes: Vars; entity_id: string; state: string; } interface Entity { area_id: string | null; device_id: string; [key: string]: unknown; } interface User { name: string; is_admin: boolean; is_owner: boolean; } interface Hass { areas: Record; devices: Record; entities: Record; states: Record; user: User; language: string; formatEntityState: (state: State) => string | undefined; formatEntityAttributeValue: (state: State, attr: string) => string | undefined; } interface HomeAssistant extends HTMLElement { hass: Hass; } type CancelSubscription = () => Promise; interface HassConnection { conn: { subscribeMessage: (callback: (response: T) => void, options: Vars) => Promise; }; } declare global { interface Window { hassConnection: Promise; } } interface Extras { variables?: Vars; refs?: Vars; } declare class HomeAssistantJavaScriptTemplatesRenderer { constructor(ha: HomeAssistant, options: Options); private _throwErrors; private _throwWarnings; private _variables; private _refsVariableName; private _autoReturn; private _clientSideEntitiesRegExp; private _subscriptions; private _scopped; private _executeRenderingFunctions; private _watchForPanelUrlChange; private _panelUrlWatchCallback; private _watchForEntitiesChange; private _watchForLanguageChange; private _entityWatchCallback; private _storeTracked; private _untrackTemplate; renderTemplate(template: string, extras?: Extras): any; trackTemplate(template: string, renderingFunction: RenderingFunction, extras?: Extras): () => void; cleanTracked(entityId?: string): void; get variables(): Vars; set variables(value: Vars); get refs(): Vars; set refs(value: Vars); } declare class HomeAssistantJavaScriptTemplates { constructor(ha: HomeAssistant, options?: Options); private _renderer; getRenderer(): Promise; } export { HomeAssistantJavaScriptTemplatesRenderer, HomeAssistantJavaScriptTemplates as default }; export type { Hass, HassConnection, HomeAssistant };