import { AnyStore, InferStoreState } from "../../core/store.js"; import { Selector } from "../../core/shallow-equal.js"; import { StoreSource } from "../store-accessor.js"; import { ReactiveController, ReactiveControllerHost } from "@videojs/element"; //#region src/html/controllers/store-controller.d.ts type StoreControllerHost = ReactiveControllerHost & HTMLElement; /** * Access store state and actions. * * Without selector: Returns the store, does NOT subscribe to changes. * With selector: Returns selected state, triggers update when selected state changes (shallowEqual). * * @example * ```ts * // Store access (no subscription) - access actions * class Controls extends LitElement { * #store = new StoreController(this, storeSource); * * handleClick() { * this.#store.value.setVolume(0.5); * } * } * * // Selector-based subscription - re-renders when playback changes * class PlayButton extends LitElement { * #playback = new StoreController(this, storeSource, selectPlayback); * * render() { * const playback = this.#playback.value; * if (!playback) return nothing; * return html``; * } * } * ``` */ declare class StoreController implements ReactiveController { #private; /** * @label Without Selector * @param host - The host element that owns this controller. * @param source - Store instance or context to resolve the store from. */ constructor(host: StoreControllerHost, source: StoreSource); /** * @label With Selector * @param host - The host element that owns this controller. * @param source - Store instance or context to resolve the store from. * @param selector - Derives a value from the store state. */ constructor(host: StoreControllerHost, source: StoreSource, selector: Selector, Result>); get value(): Result; hostConnected(): void; } declare namespace StoreController { type Host = StoreControllerHost; } //#endregion export { StoreController, StoreControllerHost }; //# sourceMappingURL=store-controller.d.ts.map