Skip to content

spatial-monorepo


spatial-monorepo / wayfinding/src / LiveAvoidanceController

Class: LiveAvoidanceController

Defined in: packages/wayfinding/src/live-avoidance-controller.ts:42

Constructors

Constructor

new LiveAvoidanceController(opts?): LiveAvoidanceController

Defined in: packages/wayfinding/src/live-avoidance-controller.ts:50

Parameters

opts?

LiveAvoidanceControllerOptions = {}

Returns

LiveAvoidanceController

Methods

destroy()

destroy(): void

Defined in: packages/wayfinding/src/live-avoidance-controller.ts:99

Cancels any pending debounced emission and clears all listeners/state. Call on unmount.

Returns

void


getCurrentZones()

getCurrentZones(): AvoidanceZone[]

Defined in: packages/wayfinding/src/live-avoidance-controller.ts:72

Current AvoidanceZone[] computed from the latest known state, synchronously — unlike onZonesChanged, this is never debounced. Useful for an initial render before the first debounce window elapses.

Returns

AvoidanceZone[]


onZonesChanged()

onZonesChanged(listener): LiveAvoidanceUnsubscribe

Defined in: packages/wayfinding/src/live-avoidance-controller.ts:93

Subscribe to debounced zone-set changes. Returns an unsubscribe function.

Parameters

listener

LiveAvoidanceListener

Returns

LiveAvoidanceUnsubscribe


setPolicy()

setPolicy(policy): void

Defined in: packages/wayfinding/src/live-avoidance-controller.ts:88

Update the venue avoidance policy in place (e.g. a live venue-config change) without discarding accumulated occupancy/reservation state or resetting the debounce timer. Does not itself trigger an emission — the new policy takes effect on the next updateOccupancy/updateReservation call or getCurrentZones() read.

Parameters

policy

VenueAvoidancePolicy

Returns

void


updateOccupancy()

updateOccupancy(unitId, status): void

Defined in: packages/wayfinding/src/live-avoidance-controller.ts:56

Record the latest occupancy-sensor reading for a unit and (re)schedule a debounced notification.

Parameters

unitId

string

status

"in_use" | "vacant"

Returns

void


updateReservation()

updateReservation(unitId, active): void

Defined in: packages/wayfinding/src/live-avoidance-controller.ts:62

Record the latest reservation state for a unit and (re)schedule a debounced notification.

Parameters

unitId

string

active

boolean

Returns

void

Released under commercial licensing.