Interface IndexedEventStoreOptions<K, V>

Options for creating a IndexedEventStore.

interface IndexedEventStoreOptions {
    data?: AppendOnlyAutoKeyMap<K, V> & Partial<AutoKeyMapBatch<K, V>>;
    encodeKey?: ((key) => string);
    eventTypeSeparator?: RegExp;
    getEventMeta?: ((event) => undefined | EventMeta<K>);
    index?: MaybeAsyncMap<string, K> & Partial<MaybeAsyncMapBatch<string, K>> & RangeQueryable<string, K>;
    setEventTime?: ((event, time) => V);
    tick?: ((refTime?) => MaybePromise<number>);
}

Type Parameters

  • K

  • V

Properties

data?: AppendOnlyAutoKeyMap<K, V> & Partial<AutoKeyMapBatch<K, V>>

Backing data store map.

encodeKey?: ((key) => string)

Type declaration

    • (key): string
    • Encoder of event key to bytes.

      Parameters

      • key: K

      Returns string

eventTypeSeparator?: RegExp

Regex to split scoped event type.

getEventMeta?: ((event) => undefined | EventMeta<K>)

Type declaration

    • (event): undefined | EventMeta<K>
    • Function to get given event metadata.

      Parameters

      • event: V

      Returns undefined | EventMeta<K>

index?: MaybeAsyncMap<string, K> & Partial<MaybeAsyncMapBatch<string, K>> & RangeQueryable<string, K>

Backing index store map.

setEventTime?: ((event, time) => V)

Type declaration

    • (event, time): V
    • Function to set event time and return updated event.

      Parameters

      • event: V
      • time: number

      Returns V

tick?: ((refTime?) => MaybePromise<number>)

Type declaration

    • (refTime?): MaybePromise<number>
    • Function to atomically return a logical timestamp used as auto-incremented index of next event.

      Parameters

      • Optional refTime: number

      Returns MaybePromise<number>

Generated using TypeDoc