This file summarizes the public API surface exported by es-ts.
DomainEventEventDescriptor<E, P>defineEvent<P, E>(area: string, discriminator: string)createDomainEvent<T>(discriminator: string, area: string, payload: T)registerEvent(descriptor)serializeEvent(event)deserializeEvent(json)
EntityEventMetadatanewEntity(id, area)newTenantEntity(tenantId, id, area)auditStreamEntity(domain)entityKey(entity)isEmptyEntity(value)Scope
AggregatePendingAuditnewAggregate(area, id)newTenantAggregate(area, tenantId, id)
StoreRepositorynewRepository(store)newInMemoryEventStore()ConcurrencyError
ContextcreateContext(initialValues)mergeContext(base, update)
es-tsis designed as a small core library. It supports typed event dispatch, event metadata stamping, audit stream staging, and a repository/store abstraction.- Use the
registerEvent+serializeEvent/deserializeEventpair for cross-process polymorphic event handling. newAggregateandnewTenantAggregatehelp keep entity scope explicit.