Skip to content

Documentation / @etherfold/processor-entities / EntityProcessor

Type Alias: EntityProcessor<ABI, ProcessorConfig> ​

EntityProcessor<ABI, ProcessorConfig> = EventHandlers<ABI, ProcessorConfig> & object

Defined in: packages/processor-entities/src/types.ts:60

What an author writes: the entity schema, and a handler per event.

The shape deliberately kept the retired free-form JSProcessor's, so that moving a processor from an in-memory object to versioned rows was a change of write calls and nothing else. construct() has no counterpart here: the initial state of a versioned store is an empty set of entities, which migrate creates from entities.

Nothing in this type names a backend, and that is its whole point. The same object runs against @etherfold/state-store-sqlite on a server and against any other StateStore in a browser; where the state lives is a deployment choice the processor neither sees nor encodes.

Type Declaration ​

entities ​

entities: readonly EntityDeclaration[]

{name, id, fields} per entity: the store owns the versions, the layout and the revert.

handleUnparsedEvent()? ​

optional handleUnparsedEvent(state, event): void | Promise<void>

Parameters ​

state ​

MutationContext

event ​

LogEventWithParsingFailure

Returns ​

void | Promise<void>

Type Parameters ​

ABI ​

ABI extends Abi

ProcessorConfig ​

ProcessorConfig = undefined