mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
build(store): build26 from 45504a2b
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { State } from "../../core/state.js";
|
||||
import { Selector } from "../../core/shallow-equal.js";
|
||||
import { ReactiveController, ReactiveControllerHost } from "@videojs/element";
|
||||
//#region src/html/controllers/snapshot-controller.d.ts
|
||||
type SnapshotControllerHost = ReactiveControllerHost & HTMLElement;
|
||||
/**
|
||||
* Subscribe to a `State<T>` container with optional selector.
|
||||
*
|
||||
* Without selector: returns full state, re-renders on any state change.
|
||||
* With selector: returns selected slice, re-renders only when the slice changes (shallowEqual).
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* #state = new SnapshotController(this, sliderState, (s) => s.value);
|
||||
* ```
|
||||
*/
|
||||
declare class SnapshotController<T extends object, R = T> implements ReactiveController {
|
||||
#private;
|
||||
/**
|
||||
* @label Without Selector
|
||||
* @param host - The host element that owns this controller.
|
||||
* @param state - The State container to subscribe to.
|
||||
*/
|
||||
constructor(host: ReactiveControllerHost, state: State<T>);
|
||||
/**
|
||||
* @label With Selector
|
||||
* @param host - The host element that owns this controller.
|
||||
* @param state - The State container to subscribe to.
|
||||
* @param selector - Derives a value from the state.
|
||||
*/
|
||||
constructor(host: ReactiveControllerHost, state: State<T>, selector: Selector<T, R>);
|
||||
get value(): R;
|
||||
/** Switch to tracking a different state container. */
|
||||
track(state: State<T>): void;
|
||||
hostConnected(): void;
|
||||
hostDisconnected(): void;
|
||||
}
|
||||
declare namespace SnapshotController {
|
||||
type Host = SnapshotControllerHost;
|
||||
}
|
||||
//#endregion
|
||||
export { SnapshotController, SnapshotControllerHost };
|
||||
//# sourceMappingURL=snapshot-controller.d.ts.map
|
||||
Reference in New Issue
Block a user