Class: PropertyStore¶
A cache of INDI property vectors plus a subscription registry.
Constructors¶
Constructor¶
new PropertyStore():
PropertyStore
Returns¶
PropertyStore
Methods¶
apply()¶
apply(
message):PropertyEvent|null
Fold one inbound message into the cache.
Returns the change applied, or null if the message did not change the cache
(an unknown set, or a non-property message).
Parameters¶
message¶
Returns¶
PropertyEvent | null
device()¶
device(
name):DeviceSnapshot
Return a stable read-only snapshot of one device's properties.
The returned object identity only changes when that device changes, so it is
safe to use directly as a useSyncExternalStore snapshot.
Parameters¶
name¶
string
Returns¶
devices()¶
devices(): readonly
string[]
Return a stable, sorted list of all known device names.
Returns¶
readonly string[]
get()¶
get(
device,name):Vector|undefined
Return a cached vector, or undefined if it is not present.
Parameters¶
device¶
string
name¶
string
Returns¶
Vector | undefined
matching()¶
matching(
event):Subscriber[]
Return the callbacks whose device/name filters match an event.
A whole-device del reaches every subscriber for that device,
including the name-filtered ones. Its event carries no name because the
deletion names no property - it takes all of them - so matching the filter
against it literally would silence exactly the subscribers with the most to
lose: subscribe(cb, {device: "CCD", name: "EXPOSURE"}) heard nothing when
the CCD's driver died and the whole device went away. Same rule in
client/store.py.
Parameters¶
event¶
Returns¶
subscribe()¶
subscribe(
callback,filter?): () =>void
Register a callback for matching property events; returns an unsubscribe fn.
Parameters¶
callback¶
filter?¶
SubscriptionFilter = {}
Returns¶
() => void