hacifootprint

ActionRegistry

Class: ActionRegistry

Defined in: src/registry/registry.ts:42

Constructors

Constructor

new ActionRegistry(warn?): ActionRegistry

Defined in: src/registry/registry.ts:46

Parameters

warn?

(message) => void

Returns

ActionRegistry

Methods

busyOf()

busyOf(affordanceId): string | undefined

Defined in: src/registry/registry.ts:109

The app's own busy label for a registered tool, or undefined if it has not said.

Parameters

affordanceId

string

Returns

string | undefined


handlerFor()

handlerFor(affordanceId): ActionHandler | undefined

Defined in: src/registry/registry.ts:125

Parameters

affordanceId

string

Returns

ActionHandler | undefined


hasAny()

hasAny(): boolean

Defined in: src/registry/registry.ts:134

True when anything is registered — the signal that materialization is meaningful.

Returns

boolean


isEnabled()

isEnabled(affordanceId): boolean | undefined

Defined in: src/registry/registry.ts:104

Whether a registered tool is currently clickable. Undefined if not registered.

Parameters

affordanceId

string

Returns

boolean | undefined


isRegistered()

isRegistered(affordanceId): boolean

Defined in: src/registry/registry.ts:129

Parameters

affordanceId

string

Returns

boolean


register()

register(group, affordanceId, handler, enabled?, busy?): void

Defined in: src/registry/registry.ts:50

Parameters

group

string

affordanceId

string

handler

ActionHandler

enabled?

boolean = true

busy?

string

Returns

void


registrations()

registrations(): Registration[]

Defined in: src/registry/registry.ts:138

Returns

Registration[]


setBusy()

setBusy(affordanceId, busy): boolean

Defined in: src/registry/registry.ts:95

Say (or stop saying) that a registered tool is working right now. Same contract as setEnabled: true only on a real change, so the caller bumps the world exactly once. undefined DELETES the key rather than storing one — absence is how this library spells "the app has not said".

Parameters

affordanceId

string

busy

string | undefined

Returns

boolean


setEnabled()

setEnabled(affordanceId, enabled): boolean

Defined in: src/registry/registry.ts:82

Flip a registered tool between clickable and greyed-out. Returns true if the state actually changed (so the caller can bump the version / emit only on a real change). No-op + false if the id isn't registered.

Parameters

affordanceId

string

enabled

boolean

Returns

boolean


unregisterGroup()

unregisterGroup(group): string[]

Defined in: src/registry/registry.ts:114

Remove every registration currently owned by group. Returns the removed ids.

Parameters

group

string

Returns

string[]

On this page