Skip to main content

API reference

This page indexes every export of @oimdb/core: all 243 names that the package entry point exports, and nothing else, plus the 14 deprecated aliases listed at the end. Each entry says what the export is, as read from its source, and links to the section of these docs that explains it. The full typed signatures ship with the package in node_modules/@oimdb/core/llms.txt.

Root and defaults​

ExportKindWhat it isDocumented at
OIMDBclassOIMDB<TSchemas>, the root: the clock, the collector slot and the default channel slot over them, and schemas, what createSchemas returned; flush() flushes the default channel slot; createEffect(body, sourceSlots?, { lazy? }) creates an effect on it and returns the disposer; dispose() drops it: no later flush delivers, its effects stop, its release wheels are cancelled; addSlotReleaseListener(listener) hears every released slot and returns the disposer; claimSlotDataCell() hands out a slot.data cell index of its own. An IOIMChannelMap.The root: OIMDB
TOIMDBOptionstypeOptions of OIMDB: channelScheduler, errorPolicy, onBeforeFlush, getNowMs, releaseTimer, createSchemas.The root: OIMDB
OIMDefaultsclassThe strategies factories fall back on, passed as defaults: slot stamp, release policy, entity writer, entity emptiness, index-keys service, column slot store services, store slot listener. OIMDefaults.INSTANCE is the empty one.Building one
TOIMDefaultsOptionstypeThe options of new OIMDefaults(...), every field optional.Building one
OIMDefaultValueclassOne built-in default: getValue() builds it on first read and hands the same instance back after.Building one
TOIMFactoryOptionstypeThe options shape shared by the collection factories.Building one

Collection services​

ExportKindWhat it isDocumented at
OIMColumnSlotServiceclassAbstract base of both slot services: the column doors getColumnSlot, holdColumnSlot, getAnyColumnSlot, holdAnyColumnSlot, getColumnGroupSlot, holdColumnGroupSlot, unholdColumnSlot, over the column owner it is built with.Every collection is a content service, a collection service and a store slot
OIMSlotCollectionServiceabstract classThe read doors of a keyed collection over a content service: peekSlotByKey, hasSlotContentByKey, getSlotByKey, holdSlotByKey, getSlots, getSlotCount, isSameKey, and the column doors inherited from OIMColumnSlotService; slotContentService is the content service. It builds no store slot in public: each subclass has its own door (createStoreSlot on the writable ones, createStoreSlot / createSortedStoreSlot / createBucketMemoStoreSlot on the computed ones, createIndexStoreSlot on an index).Every collection is a content service, a collection service and a store slot
TOIMSlotCollectionServiceOptionstypeConstructor options of OIMSlotCollectionService: the slot owner, the store service, the content service, the store slot listener.Collection types and store slots
TOIMSlotCollectionServiceFactoryOptionstypeOptions of createOIMSlotCollectionService and createOIMSlotCollectionStoreAggregate: the key, slot and content come from the content service's createSlot and writeSlotContent, so generic callers are checked without a cast.Building one
createOIMSlotCollectionServicefunctionBuilds an OIMWritableSlotCollectionService over a keyed content service (entity or bucket): { slotContentService, slotStoreService?, … }.Building one
OIMWritableSlotCollectionServiceclassWhat createOIMSlotCollectionService returns: an OIMSlotCollectionService plus createStoreSlot(channelMap), createStoreAggregate(storeSlot) and writeSlotContentByKey(storeSlot, key, content, changedSlots?).Every collection is a content service, a collection service and a store slot
OIMSingleSlotServiceclassThe read doors of a single: createStoreSlot(channelMap), peekSingleSlot, hasSingleSlotContent, getSingleSlot, holdSingleSlot, the column doors.The three kinds of slot
TOIMSingleSlotServiceOptionstypeConstructor options of OIMSingleSlotService.Collection types and store slots
createOIMSingleSlotServicefunctionBuilds an OIMWritableSingleSlotService over a content service with createSingleSlot (entity or bucket).Standalone records
OIMWritableSingleSlotServiceclassWhat createOIMSingleSlotService returns: an OIMSingleSlotService plus writeSingleSlotContent(storeSlot, content, changedSlots?) and clearSingleSlotContent(storeSlot).Every collection is a content service, a collection service and a store slot
OIMSlotCollectionStoreAggregateclassA store slot with the store methods of its OIMSlotCollectionService, without the store slot argument; from service.createStoreAggregate(storeSlot).A store aggregate
OIMWritableSlotCollectionStoreAggregateclassThe same over an OIMWritableSlotCollectionService, plus writeSlotContentByKey(key, content, changedSlots?).A store aggregate
OIMSingleSlotStoreAggregateclassA single store slot with peekSingleSlot, hasSingleSlotContent, getSingleSlot, holdSingleSlot.A store aggregate
OIMWritableSingleSlotStoreAggregateclassThe same plus writeSingleSlotContent(content, changedSlots?) and clearSingleSlotContent().A store aggregate
OIMSlotCollectionIndexStoreAggregateclassAn index store slot with the collection reads, the index reads and disposeIndexStoreSlot().A store aggregate
createOIMSlotCollectionStoreAggregatefunction(db, options of createOIMSlotCollectionService): the service, its store slot and an OIMWritableSlotCollectionStoreAggregate in one call.A store aggregate
createOIMSlotCollectionIndexStoreAggregatefunction(collection store aggregate, options of createOIMSlotCollectionIndexService minus entityService): the index service, its index store slot over the aggregate's store slot and an OIMSlotCollectionIndexStoreAggregate in one call; default bucket store.A store aggregate
createOIMEntitySlotCollectionStoreAggregatefunction<TEntity, TColumnName?>(db, options?): createOIMSlotCollectionStoreAggregate over createOIMEntityContentService<TEntity>() in one call; takes the options of both, keys by TOIMStoreKey, columnNames checked against the entity's columns.A store aggregate
OIMEntitySlotCollectionStoreAggregateclassWhat createOIMEntitySlotCollectionStoreAggregate returns: the writable collection aggregate plus getEntities() (no strict order; sort for one) and getEntityCount(), both tracked.A store aggregate
OIMSlotCollectionBucketServiceclassINSTANCE.getBucketSlot(storeSlot): the collection's list of every slot that holds an entity, left to the unused-slot collector when nothing holds it; holdBucketSlot(storeSlot) is getBucketSlot plus holdSlot(); getBucketColumnSlot / holdBucketColumnSlot / getAnyBucketColumnSlot / holdAnyBucketColumnSlot are the list's column slots, released with it. The list does not hold its members. Order: see the linked section; for a strict order, sort.Reading the whole population
TOIMCollectionBucketSlottypeWhat both doors return: a read-only bucket slot with getBucketMemberSlots, getBucketMemberSlotCount, hasBucketMemberSlot, holdSlot, unholdSlot.Reading the whole population
OIMCollectionSetBucketContentServiceclassThe bucket content service of the collection's list, built over a set bucket, not extending one; fills and keeps it in step, and holds no member. Exported as a type only.Reading the whole population
TOIMSlotCollectionStoreSlottypeThe store slot OIMSlotCollectionBucketService.getBucketSlot / holdBucketSlot take: a store slot whose service has getSlots.Reading the whole population
getOIMBucketMemberSlotEntitiesfunction(bucketMemberSlots): the entities of an iterable of member slots (bucketSlot.getBucketMemberSlots(), a sorted slot's value), skipping empty ones.Reading the whole population
createOIMSingleSlotStoreAggregatefunction(db, options of createOIMSingleSlotService): the service, its store slot and an OIMWritableSingleSlotStoreAggregate in one call.A store aggregate
OIMSlotOwnerServicetype onlyThe slot owner of one collection type: holds, subscriptions, columns and release, over its content service, store service, release policy and column owner. Built by the factories.When a slot goes
TOIMSlotOwnerServiceOptionstypeConstructor options of OIMSlotOwnerService.Collection types and store slots
IOIMSlotContentServiceinterfaceWhat a content service answers its slot owner and its column slots: isSlotEmpty, releaseSlotContent, peekColumnValue, peekColumnGroupValue, peekAnyColumnValue.Every collection is a content service, a collection service and a store slot
IOIMSlotContentWriterinterfaceThe content writes a collection drives: insertSlotContent, writeSlotContent, clearSlotContent.Every collection is a content service, a collection service and a store slot
IOIMKeyedSlotCreatorinterfacecreateSlot(key, storeSlot, slotOwner): what makes a content service usable by createOIMSlotCollectionService.Every collection is a content service, a collection service and a store slot
IOIMSingleSlotCreatorinterfacecreateSingleSlot(storeSlot, slotOwner): what makes a content service usable by createOIMSingleSlotService.Every collection is a content service, a collection service and a store slot
IOIMSlotFilingServiceinterfaceFiles a minted slot in its store slot: createStore(), set(store, slot), delete(store, slot); the slot carries its key.Every collection is a content service, a collection service and a store slot
TOIMSlotContentServiceKeytypeThe key type read off a content service; the default of createOIMSlotCollectionService's TKey when it is given type arguments.Every collection is a content service, a collection service and a store slot
TOIMSlotContentServiceSlottypeThe keyed slot type it reads off a content service.Every collection is a content service, a collection service and a store slot
TOIMSlotContentServiceSingleSlottypeThe single slot type createOIMSingleSlotService reads off a content service.Every collection is a content service, a collection service and a store slot
TOIMSlotContentServiceContenttypeThe content type a content service writes.Every collection is a content service, a collection service and a store slot
TOIMSlotContentServicePatchtypeThe patch type of a content service: the content itself for an array, Partial of it otherwise.Every collection is a content service, a collection service and a store slot
OIMSlotContentChangeListenerServiceclassINSTANCE: files and unfiles a content-change listener on a store slot (addContentChangeListener, removeContentChangeListener) and adds reads to a listener it filed (addListenerReadColumn, addListenerReadAnyColumn); addContentChangeListener returns the listener's TOIMSlotContentChangeListenerReadColumns.The content-change hook
markOIMBucketColumnsChangedfunction(bucketSlot, patch, changedColumns): tells a bucket's column slots which member columns moved; the index calls it, and so does whoever changes a bucket's members by hand.Column slots on a single bucket
isOIMAnyAddedColumnReadfunction(listenerReadColumns, changedColumns): whether a write's changed columns hit a column added to that listener.The content-change hook
TOIMSlotContentChangeListenerReadColumnstypeThe columns one content-change listener reads: declaredColumnNames (undefined = every column), addedColumnNames, isAnyColumnAdded; returned by addContentChangeListener.The content-change hook
IOIMSlotContentChangeListenerinterfaceonContentChanged(slot, patch, changedColumns) and onManyContentsChanged(slots, patches, changedColumns), told of every write that changed a store slot's content.The content-change hook

Entities and writers​

ExportKindWhat it isDocumented at
OIMEntityContentServiceclassThe entity content service: the slot writes writeSlotContent, updateEntity, updateEntityColumn, deleteEntityColumns, markEntityChanged, clearSlotContent; createSlot, createSingleSlot, insertSlotContent, isSlotEmpty and releaseSlotContent for the collection service and the slot owner.The writes
TOIMEntityContentServiceOptionstypeConstructor options of OIMEntityContentService: selectKey, entityWriter, slotEmptinessPolicy, slotStamp, slotReleasePolicy, slotStoreService, the column owner options.Building one
TOIMEntitySlotOwnerServicetypeThe slot owner type of an entity collection.Collection types and store slots
createOIMEntityContentServicefunctionBuilds an OIMEntityContentService and its slot owner on an OIMDB; a Map store unless slotStoreService is passed, and no selectKey for a single.Building one
TOIMEntitySlottype<TEntity, TKey, TColumnName>: an indexable slot that carries an entity (or nothing); getColumnSlot / holdColumnSlot take TColumnName (default every column).A slot
OIMEntitySlotclass (type-only export)The engine's entity slot class; the type a custom entity writer or inserter receives, and the only one that carries the stored object content.Writing
OIMSlotclass (type-only export)The base of every slot class: the fields the engine keeps on any slot (subscribers, change stamps, holds, release deadlines, flags, owner, store slot), the consumer's writable data, and holdSlot / unholdSlot.A slot
TOIMEntityContentSlottype<TEntity, TColumnName>: an entity slot without a key: what a single holds and what the writer and content service take.Writing
TOIMColumnNametypeThe string column names of an entity type, or any string when the entity type is a bare object.Writing a standalone record
TOIMEntityColumnValuetypeThe value type of one column of an entity type, or unknown when the entity type is a bare object.useOIMField — one field of one identity
IOIMEntityWriterinterfaceThe six functions that write an entity slot: fill, put, patch, patch one column, delete columns, clear.The two writers
createOIMInPlaceEntityWriterfunctionBuilds an IOIMEntityWriter that applies puts, patches and column deletes onto the stored entity object itself.The two writers
createOIMReplacingEntityWriterfunctionBuilds an IOIMEntityWriter that applies every change to a fresh copy and stores the copy in the slot.The two writers
TOIMEntityWriterOptionstypeOptions of both writer factories: sameValueGuard, entityInserter, and the walks putEntityColumns, patchEntityColumns, patchEntityColumn.Writing your own writer
TOIMEntityInsertertypeThe function that stores a handed entity into an entity slot on fill.The store keeps the object you insert
insertOIMEntityWithoutCopyfunctionInsert strategy that stores the handed entity object itself. The default.The store keeps the object you insert
insertOIMEntityWithCopyfunctionInsert strategy that stores a copy ({ ...entity }).The store keeps the object you insert
insertOIMEntityWithSanitizedCopyfunctionInsert strategy that stores a copy with an own __proto__ key removed; for untrusted JSON.The store keeps the object you insert
patchOIMEntityColumnsfunctionThe PATCH walk, the writers' default patchEntityColumns: writes the moved columns into the object targetOf hands back and returns it, or undefined when nothing moved.Writing your own writer
guardOIMEntityColumnsPatchfunctionThe PATCH walk that skips a __proto__ key and a key the patch does not own.Writing your own writer
patchOIMEntityColumnfunctionThe one-column walk, the writers' default patchEntityColumn.Writing your own writer
guardOIMEntityColumnPatchfunctionThe one-column walk that refuses the column name __proto__.Writing your own writer
putOIMEntityColumnsfunctionThe PUT walk, the writers' default putEntityColumns: the patch walk plus undefined over every column the new value lacks.Writing your own writer
guardOIMEntityColumnsPutfunctionThe PUT walk that skips __proto__ keys and inherited stored columns.Writing your own writer

Buckets and bucket commands​

ExportKindWhat it isDocumented at
OIMBucketContentServiceabstract classThe bucket content service every strategy extends: writeSlotContent, addBucketMemberSlot(s), removeBucketMemberSlot(s), clearSlotContent, fillBucketMemberSlots, markContentChanged, getBucketMemberSlots, getBucketMemberSlotCount, hasBucketMemberSlot.How a bucket holds its slots
OIMSetBucketContentServiceclassBucket content service over a Set; no positions.How a bucket holds its slots
OIMArrayBucketContentServiceabstract classThe array-based bucket content services: the positional reads getBucketMemberSlotAt, getBucketMemberSlotPosition.The doors
OIMPositionalArrayBucketContentServiceclassBucket content service over an array whose positions are the caller's: the five positional writes; one entry per mention.Positions the caller decides
OIMBucketUniqueMemberSlotsArrayServiceclassThe array-driven service with one entry per slot: the list and a Set beside it, both written by every write.And what naming a slot records
OIMSortedArrayBucketContentServiceclassBucket content service whose array is kept sorted; repositionBucketMemberSlot; no positional writes.Sorted at write
TOIMBucketContentServiceOptionstypeOptions of the bucket content services: bucketCommands.The commands, on the bucket slot
TOIMSortedArrayBucketContentServiceOptionstypeOptions of the sorted bucket content service: compareBucketMemberSlots.Sorted at write
TOIMArrayBucketContentServiceOptionstypeOptions of the array bucket content services: bucketCommands?, bucketMemberSlotsArrayService?.Buckets
TOIMBucketSlotOwnerServicetypeThe slot owner type of a bucket collection.Collection types and store slots
OIMBucketCommandsclassRecords ordered-list commands on bucket slots written in the current frame, capped per slot, and clears them after each flush.The commands, on the bucket slot
IOIMBucketMemberSlotsArrayServiceinterfaceThe only writer of an array bucket's member list and the Set beside it.Buckets
OIMBucketMemberSlotsArrayServiceclassKeeps every mention; the default of both array buckets.Buckets
OIMBucketCommandsCursorclasstakeBucketCommands(): the commands of one bucket slot a view has not applied yet; one reset with every member on the first take, after a whole-list record and for a bucket that records none.The commands, on the bucket slot
TOIMBucketCommandsCursorOptionstypeOptions of OIMBucketCommandsCursor: bucketSlot.The commands, on the bucket slot
TOIMBucketCommandsOptionstypeOptions of OIMBucketCommands: maxCommandsPerSlot.The commands, on the bucket slot
IOIMBucketCommandsinterfaceThe recorder a bucket content service reports positional writes to: recordInsert, recordRemove, recordMove, recordWholeList.The commands, on the bucket slot
TOIMOrderedListCommandtypeOne ordered-list command: insert, remove, move, or reset to a whole list.The commands, on the bucket slot
getOIMOrderedListCommandsfunctionComputes the ordered-list commands that turn one slot sequence into another, optionally capped.Rendering an ordered bucket
TOIMBucketSlottypeAn indexable slot that carries a bucket's member store, its owner, the commands recorded on it, and isWholeListRecorded.A slot
TOIMBucketContentSlottypeA bucket slot without a key: what a single bucket holds and what the bucket content services take.Buckets
TOIMBucketSlotsSetStoretypeThe member store of a set-driven bucket.How a bucket holds its slots
TOIMBucketSlotsArrayStoretypeThe member store of an array bucket: { bucketMemberSlots, uniqueBucketMemberSlots, sortedCount }.How a bucket holds its slots

Indexes​

ExportKindWhat it isDocumented at
OIMSlotCollectionIndexServiceclassA collection service of buckets filled from an entity store slot by selectKey: createIndexStoreSlot, disposeIndexStoreSlot, getEntitiesByKey, getSlotsByKeys, holdSlotsByKeys, the bucket column doors; its slotContentService is typed to the reads.How an index files entities
OIMSlotCollectionSortedArrayIndexServiceclassOIMSlotCollectionIndexService over a sorted bucket content service, re-filing a member when one of its sort columns changes.Sorted at write
TOIMSlotCollectionIndexServiceOptionstypeConstructor options of OIMSlotCollectionIndexService: the collection options plus selectKey, columns, sourceSlotCollectionService, indexKeysService.How an index files entities
TOIMIndexStoreSlottypeAn index's store slot: a store slot of buckets with its sourceStoreSlot, its listener, indexKeysPosition and isDisposed.How an index files entities
TOIMSlotCollectionIndexServiceStoreSlottypeThe index store slot type of a given OIMSlotCollectionIndexService.Ordering
TOIMSlotCollectionIndexServiceFactoryOptionstypeThe options every index factory shares: entityService (anything with getSlots), slotReleasePolicy, columnSlotStoreService, columnNames, columnGroups.How an index files entities
createOIMSlotCollectionIndexServicefunctionBuilds an index on an OIMDB over an entity collection service; positional array buckets without commands unless slotContentService is passed; an array key needs a bucketSlotStoreService.How an index files entities
createOIMSlotCollectionSortedArrayIndexServicefunctionBuilds an OIMSlotCollectionSortedArrayIndexService sorted by sortColumns.Sorted at write
TOIMIndexKeyOptionstype{ columns }, { selectKey } or both: where an index key comes from.Where the key comes from
TOIMIndexKeytypeThe key type an index derives from its columns: one column's value, or a tuple of several.A key of several columns
IOIMIndexKeysServiceinterfaceHow the per-index key cells on a slot are allocated, read, written and reclaimed.The content-change hook and indexKeys
TOIMIndexKeysPositionstypeThe positions allocated on one source store slot.The content-change hook and indexKeys
OIMIndexKeysServiceabstract classBase of the two index-keys strategies.The content-change hook and indexKeys
OIMAppendingIndexKeysServiceclassNever reuses a position. The default.The content-change hook and indexKeys
OIMReclaimingIndexKeysServiceclassWipes and reuses a position at disposeIndexStoreSlot.The content-change hook and indexKeys

Computed​

ExportKindWhat it isDocumented at
OIMComputedServiceclassA computed collection type: an OIMSlotCollectionService (pull column owner, own createStoreAggregate) with createStoreSlot(channelMap, derive?, createSources?).One derivation per key
TOIMComputedServiceOptionstypeConstructor options of OIMComputedService.One derivation per key
createOIMComputedServicefunctionBuilds an OIMComputedService; takes no db.One derivation per key
TOIMComputedStoreSlottypeA computed store slot: a store slot with its derive and createSources.One derivation per key
OIMSortedComputedServiceclassPer key of an index store slot, that bucket's entity slots sorted: an OIMSlotCollectionService (pull column owner, own createStoreAggregate) with createSortedStoreSlot(indexStoreSlot).Ordering
TOIMSortedComputedServiceOptionstypeConstructor options of OIMSortedComputedService.Ordering
TOIMSortedComputedSlottypeThe computed slot of a sorted list.Ordering
createOIMSortedCollectionSingleSlotStoreAggregatefunctionSorts a whole entity collection with no index: a single-slot aggregate of a computed whose value is every entity slot in order, by sortColumns or comparator.Reading the whole population
createOIMSortedComputedServicefunctionBuilds an OIMSortedComputedService over an index service; takes no db.Ordering
OIMBucketMemoComputedServiceclassPer key of a bucket store slot, the bucket's member slots as an array kept by identity: an OIMSlotCollectionService (pull column owner, own createStoreAggregate) with createBucketMemoStoreSlot(bucketStoreSlot).The order of a bucket is a derivation
TOIMBucketMemoComputedServiceOptionstypeConstructor options of OIMBucketMemoComputedService.The order of a bucket is a derivation
TOIMBucketMemoComputedSlottypeThe computed slot of a bucket memo.The order of a bucket is a derivation
createOIMBucketMemoComputedServicefunctionBuilds an OIMBucketMemoComputedService over a bucket collection service; takes no db.The order of a bucket is a derivation
OIMSingleComputedServiceclassOne derivation under no key: an OIMSingleSlotService with the pull column owner; createStoreSlot(db, derive?, createSources?), read through its own getSingleSlot / holdSingleSlot.The compute graph
createOIMSingleComputedServicefunctionBuilds an OIMSingleComputedService.The compute graph
OIMSourceTrackingComputedServiceclassKeyed derivations whose derive reads through an OIMSourceTracker.A derivation that finds its sources as it reads
OIMSingleSourceTrackingComputedServiceclassOne derivation whose derive reads through an OIMSourceTracker: an OIMSingleSlotService with the pull column owner; createStoreSlot(db), read through its own getSingleSlot / holdSingleSlot.A derivation that finds its sources as it reads
createOIMSourceTrackingComputedServicefunctionBuilds an OIMSourceTrackingComputedService.A derivation that finds its sources as it reads
createOIMSingleSourceTrackingComputedServicefunctionBuilds an OIMSingleSourceTrackingComputedService.A derivation that finds its sources as it reads
TOIMSourceTrackingComputedSlottypeA keyed source-tracking derivation slot; read only through a source tracker.A derivation that finds its sources as it reads
TOIMSourceTrackingComputedContentSlottypeThe slot of one source-tracking derivation; read only through a source tracker.A derivation that finds its sources as it reads
OIMSourceTrackingComputedContentServicetype onlyThe content service of a source-tracking derivation collection: an OIMComputedContentService that gives each slot its own source tracker.A derivation that finds its sources as it reads
TOIMSourceTrackingComputedDerivationOptionstypeThe derivation options a source-tracking computed service takes: derive, sameValueGuard, releaseValue, initialValue.A derivation that finds its sources as it reads
TOIMComputedServiceFactoryOptionstypeThe options every computed factory shares: sameValueGuard, releaseValue, initialValue, slotReleasePolicy, columnSlotStoreService, columnNames, columnGroups.The compute graph
TOIMSourceTrackingComputedDerivetype(computedSlot) => value, the derive of a source-tracking derivation.A derivation that finds its sources as it reads
TOIMComputedDerivationOptionstypeThe derivation options a computed service takes: createSources, derive, sameValueGuard, initialValue.The compute graph
TOIMComputedSlottypeA slot whose value is derived, with its value service, sources and stamps.A derivation is a slot that nothing marks
TOIMComputedSourcestype{ sourceSlots, sourceComputeds }, what createSources returns.A derivation is a slot that nothing marks
TOIMComputedValueReleasertype(value) => void, the releaseValue option: gives back what a derived value holds.Releasing a computed value
IOIMComputedValueServiceinterfacegetValueForSlot(computedSlot), the one read that settles a computed.A derivation is a slot that nothing marks
OIMComputedValueServiceclassThe value service of a computed collection: holds the sameValueGuard and serves the value.A derivation is a slot that nothing marks
TOIMComputedContentSlottypeA computed slot without a key: what a single computed holds.The compute graph
TOIMComputedCarrierSlottypeTOIMComputedContentSlot plus the six column doors and watch: what a single computed service hands out.Computed columns
OIMComputedContentServicetype onlyThe abstract content service of a computed collection (protected constructor): creates computed slots; OIMExplicitSourceComputedContentService and OIMSourceTrackingComputedContentService extend it.The compute graph
TOIMComputedContentServiceOptionstypeIts options: computedValueService, initialValue?.The compute graph
OIMExplicitSourceComputedContentServiceclassThe content service of a computed whose sources are handed in up front: after creating a slot it fills sourceSlots / sourceComputeds from createSources (the store slot's, else its own). Every built-in computed service (OIMComputedService, OIMSingleComputedService, OIMSortedComputedService, OIMBucketMemoComputedService) builds one.The compute graph
TOIMExplicitSourceComputedContentServiceOptionstypeTOIMComputedContentServiceOptions plus createSources?.The compute graph
TOIMComputedValueServiceOptionstypeConstructor options of OIMComputedValueService.A derivation is a slot that nothing marks
refreshOIMSourceComputedsfunctionBrings every computed of a list current; a binding read outside an effect calls it before its derive.Reading a computed from an effect
TOIMComputedDerivationtypeWhat a computed slot and an effect share: their sources and the stamp of their last run.Why a computed is pulled
TOIMSortColumntype{ columnName, direction }, one sort column.Ordering
TOIMSortableColumnNametypeA column whose values are strings, numbers or bigints.Ordering
createOIMColumnsComparatorfunctionThe comparator over sort columns: each in turn, by its direction, an undefined or null value last.Ordering

Columns​

ExportKindWhat it isDocumented at
TOIMColumnSlottypeA slot for one column of a carrier slot, keyed by the column name, with carrierSlot and value.Column slots
TOIMComputedColumnSlottypeTOIMComputedColumnSlot<TSourceTracker>: the column slot of a computed, a computed itself, carrying its carrier's tracker type.Computed columns
TOIMColumnGrouptypeTOIMColumnGroup<TColumnName>: a named set of columns (key, columnNames) made by createOIMColumnGroup.Column groups
createOIMColumnGroupfunctioncreateOIMColumnGroup(columnNames): a frozen TOIMColumnGroup, names deduplicated and sorted; throws on an empty list. Declare it in a service's columnGroups to hold its slot.Column groups
OIMColumnSlotOwnerabstract classThe owner of a carrier's column slots; an OIMSlotOwner that mints, holds and releases them.Column slots
OIMPushColumnSlotOwnertype onlyColumn owner whose OIMColumnSlots are woken by marks on a write; entity and bucket collections.Column slots
OIMPullColumnSlotOwnerclassColumn owner whose OIMColumnSlots are derived from the carrier when read; computed collections.Computed columns
TOIMColumnSlotOwnerOptionstypeEither columnSlotStoreService or columnNames (the ordinal store over those names), plus columnGroups, the groups the group doors accept.Naming the columns up front

Channel, effects and scheduling​

ExportKindWhat it isDocumented at
OIMChannelServiceclassINSTANCE: runs a channel slot — write, writeWithoutFlushCheck, flush, subscribeAfterEachFrame, subscribeOnceAfterFrame, subscribeAfterEachFlush, isChangedInCurrentFrame, assertNotFlushing, dropChannelSlot.The channel
TOIMChannelSlottypeThe channel's state: clock, frame, effect queue, handlers, collector slot.The channel
TOIMChannelSlotOptionstypeOptions of createOIMChannelSlot.The channel
createOIMChannelSlotfunctionBuilds a channel slot over a clock and a collector slot.The channel
IOIMChannelMapinterface{ defaultChannelSlot }, what createStoreSlot and the effect doors take; OIMDB is one.Every collection has a channel
TOIMChannelFrametypeThe frame of a channel slot: whether it runs, the clock it opened at, the after-frame handlers.The clock
TOIMChannelClocktype{ revision, epoch, unheldSlotWriteCount }.The clock
TOIMChannelSchedulertype(flush) => void, what defers a flush.Schedulers
OIMChannelQueuetype onlyThe reusable queue the channel and the services batch with: getEntryCount, getEntryAt.The content-change hook
isOIMAnySlotChangedAfterfunctionAnswers whether any slot of a list changed after a clock reading, given as a revision and an epoch.The clock
IOIMErrorPolicyinterfaceonErrorCaught(error), what a throw caught during a flush becomes.After the flush has ended
OIMLogAndContinueErrorPolicyclassLogs the throw, hands it to onError, and goes on. The default.After the flush has ended
TOIMLogAndContinueErrorPolicyOptionstype{ onError }.After the flush has ended
OIMThrowAtOnceErrorPolicyclassThrows the first throw out of flush().After the flush has ended
OIMEffectServiceclassINSTANCE: createEffect, createAndRunEffect, subscribeEffect, createSourceTrackingEffect, disposeEffect, each taking the channel map first.Effects
IOIMEffectServiceinterfaceWhat an effect carries as its service.Effects
TOIMEffecttypeA plain effect object; built only by the effect service.Subscribing is building an effect
TOIMEffectBodytype() => (() => void) | void; a returned function is the undo.A body may hand back its own undo
TOIMSourceTrackingEffectBodytypeThe body of a tracked effect, handed an OIMSourceTracker.An effect that finds its sources as it reads
OIMSourceTrackertype onlyThe tracker of a running tracked body; it appears in the computed slot types' generics. A read of slot.entity, slot.getEntity(columnGroup), computed.value or a bucket slot's membership is filed into it.An effect that finds its sources as it reads
IOIMSourceTrackerinterfaceWhat a slot calls on the tracker of the running tracked body: trackSourceSlot(slot, columnGroup?), trackSourceComputed(computedSlot).An effect that finds its sources as it reads
OIMFlushSchedulerServiceabstract classThe base of what a timer fires: the schedule and cancel of one standing callback on a TOIMFlushSchedulerSlot.Source layout
TOIMFlushSchedulerSlottype{ timer, scheduledCallback, timerDisposer }.Source layout
IOIMFlushSchedulerListenerinterfaceWhat a flush scheduler calls when its timer fires.The channel
TOIMTimertype(run, inMs) => TOIMDisposer, how a host schedules a timed run.Controlling the clock
TOIMDisposertype() => void.Giving many handles back at once
OIM_NOOP_DISPOSERconstA TOIMDisposer that does nothing, for a door that had nothing to undo.Giving many handles back at once

Release policies and collectors​

ExportKindWhat it isDocumented at
IOIMSlotReleasePolicyinterfaceWhether and when an unheld slot may go.The question a policy answers
OIMSlotAtEmptyReleasePolicyclassINSTANCE: an empty unheld slot goes; a filled one stays. The default of entity, bucket and index collections.Releasing an identity on a clock
OIMSlotNeverReleasePolicyclassINSTANCE: nothing goes.Releasing an identity on a clock
OIMSlotAtUnholdReleasePolicyclassINSTANCE: an unheld slot goes, value or not. The default of computeds.Releasing an identity on a clock
OIMSlotAfterWriteReleasePolicyclassA slot goes once its last write is older than keepAfterWriteMs.Releasing an identity on a clock
TOIMSlotAfterWriteReleasePolicyOptionstype{ keepAfterWriteMs, slotReleaseDueFramePolicy? }.Releasing an identity on a clock
IOIMSlotReleaseDueFramePolicyinterfaceWhich writes move the after-write deadline: isSlotReleaseDueFrameOpen().Which writes move the deadline
OIMSlotReleaseAutoDueFramePolicyclassEvery write is its own frame; the default.Which writes move the deadline
OIMSlotReleaseManualDueFramePolicyclassOnly writes inside a frame opened by hand move the deadline.Which writes move the deadline
OIMSlotAfterIdleReleasePolicyclassA slot goes once nothing has watched it for keepAfterIdleMs.Releasing an identity on a clock
TOIMSlotAfterIdleReleasePolicyOptionstype{ keepAfterIdleMs }.Releasing an identity on a clock
OIMSlotAfterUnholdReleasePolicyclassA slot goes once keepAfterUnholdMs has passed since its last unhold.Releasing an identity on a clock
TOIMSlotAfterUnholdReleasePolicyOptionstype{ keepAfterUnholdMs }.Releasing an identity on a clock
OIMSlotEarliestReleasePolicyclassAs soon as any of several policies says so.Releasing an identity on a clock
OIMUnusedSlotCollectorServiceclassINSTANCE: holds what a getter minted until the next flush; holdSlotUntilFlush, flush, open, close, run.The unused-slot collector
TOIMUnusedSlotCollectorSlottypeThe unused-slot collector's state.The unused-slot collector
createOIMUnusedSlotCollectorSlotfunctionBuilds an unused-slot collector slot of your own.The unused-slot collector
TOIMCollectorSlottypeThe db's collector slots: the unused-slot collector and the three release collectors.Controlling the clock
TOIMCollectorSlotOptionstype{ getNowMs, releaseTimer, errorPolicy }.Controlling the clock
createOIMCollectorSlotfunctionBuilds a collector slot.Controlling the clock
OIMSlotWheelabstract classA wheel of slots in slices of OIM_SLICE_LENGTH_MS, with its own timer and clock: flush, cancelAllSlots, getNextSliceNumber, sweepUpToSliceNumber.The collectors
TOIMSlotWheelOptionstype{ getNowMs, timer, errorPolicy }.Controlling the clock
OIMSlotReleaseWheelclassThe wheel a release policy files into; reads and writes the marker it was built with. Three per db on collectorSlot.What restarts each window
mintOIMAfterWriteSlotReleaseWheelfunctionThe db's after-write release wheel, created on first use.Controlling the clock
mintOIMAfterIdleSlotReleaseWheelfunctionThe db's after-idle release wheel, created on first use.Controlling the clock
mintOIMAfterUnholdSlotReleaseWheelfunctionThe db's after-unhold release wheel, created on first use.Controlling the clock
TOIMSlotReleaseWheelOptionstypeWheel options plus { getReleaseDueMs, setReleaseDueMs, releaseScheduledSlotFlag }.Controlling the clock
OIMSlotRefetchWheelclassA wheel of slots due a refetch at an explicit time: scheduleSlotRefetchAt(slot, atMs); hands every watched due slot to its listener once per sweep.Refetching on a clock
TOIMSlotRefetchWheelOptionstype{ slotRefetchListener }, the second argument of new OIMSlotRefetchWheel(db, options); the clock, timer and error policy are the db's.Refetching on a clock
IOIMSlotRefetchListenerinterfaceonSlotsRefetchDue(slots).Refetching on a clock
IOIMSlotReleaseListenerinterfaceonSlotReleased(slot): told of every slot and column slot the engine releases, with slot.data still on it. Added with db.addSlotReleaseListener(listener), which returns the disposer.Hearing a release
getOIMSliceOfMsfunctionThe number of the time slice a millisecond timestamp falls in.Controlling the clock
OIM_SLICE_LENGTH_MSconstLength of one release time slice: 1024 ms.Controlling the clock

Slot stores and keys​

ExportKindWhat it isDocumented at
TOIMStoreKeytypeA scalar key: a string or a number.Scalar keys
IOIMSlotStoreServiceinterfaceStateless, Map-like service over a keyed slot store: the filing doors (createStore, set(store, slot), delete(store, slot)) plus ownKey, isSameKey, get(store, key), getSlots, getSlotCount.How a collection is keyed is the store's business
OIMSlotMapStoreServiceclassIOIMSlotStoreService over a Map.Building one
OIMSlotTreeStoreServiceclassIOIMSlotStoreService keyed by a composite key, filed in a tree walked by a key tree walk.Composite keys come in two strategies
OIMSingleSlotStoreServiceclassINSTANCE: keyed by void, files at most one slot; the store service of every single.The three kinds of slot
TOIMSingleSlotStoretypeThe store of a single: { slot }.The three kinds of slot
TOIMDefaultSlotStoretypeThe store a collection gets when its TStore is not named: TOIMSingleSlotStore<TSlot> for a void key, Map<TKey, TSlot> otherwise.The three kinds of slot
TOIMSlotStoreTreetypeThe tree store: a root key node and the set of filed slots.A chain of identities
IOIMKeyTreeWalkinterfaceWalks a composite key through a tree of key nodes: mint the node, find it, prune it.A chain of identities
OIMKeyTreeWalkabstract classBase of the key tree walks.A chain of identities
OIMScalarKeyTreeWalkclassKey tree walk over scalar key parts, which holds nothing.A chain of values
OIMCompositeKeyTreeWalkclassKey tree walk over entity-slot key parts, which holds each part while the edge stands.A chain of identities
TOIMCompositeKeyNodetypeOne node of the key tree.A chain of identities

Slots and owners​

ExportKindWhat it isDocumented at
TOIMSlottypeThe base slot: effects and their edges, change stamps, hold count, three release-due times, slotFlags, column slot store, storeSlot, owner, and data (the consumer's cache, writable; the core never touches it).The three kinds of slot
TOIMKeyedSlottypeTOIMSlot with a key.A slot
TOIMIndexableSlottypeTOIMKeyedSlot with index-key cells.The content-change hook and indexKeys
TOIMEditabletypeThe same type with every field writable.A slot
TOIMStoreSlottypeA store slot: one collection's state — store, channelSlot, listeners, column state, and slotContentChangeListenerReadColumns, what its own listener on a source reads (an index, the collection list). Not a slot.A slot
TOIMSingleSlotStoreSlottypeThe store slot of a single.The three kinds of slot
IOIMStoreSlotListenerinterfaceTold of every store slot a service creates; set as storeSlotListener of the defaults that service is built with.Collection types and store slots
OIMNoStoreSlotListenerclassThe default store slot listener: hears nothing.Collection types and store slots
IOIMSlotSubscriptionListenerinterfaceonSlotFirstSubscribed(slot) and onSlotLastUnsubscribed(slot): a slot of the collection got its first subscriber or lost its last; a column slot is handed over as itself. The slotSubscriptionListener option of the entity, bucket, index and computed factories.Knowing when a slot is watched
OIMNoSlotSubscriptionListenerclassINSTANCE: the default subscription listener, hears nothing.Knowing when a slot is watched
isOIMSlotEmptyfunctionReads the EMPTY bit of slot.slotFlags.A slot
isOIMSlotReleasedfunctionReads the RELEASED bit of slot.slotFlags.A slot
OIMSlotOwnerabstract classBase slot owner: hold and unhold counting, subscribing and unsubscribing an effect, the refusal on a released slot; releaseSlotIfUnheld is abstract; protected hooks onSlotFirstSubscribed / onSlotLastUnsubscribed (call the subscription listener) and onSlotUnheld.Who holds
IOIMSlotOwnerinterfaceWhat every slot's owner answers: hold, unhold, release if unheld, unsafeMutateSlot, subscribe, unsubscribe.A slot goes when nothing refers to it
IOIMSlotEmptinessPolicyinterfaceThe strategy that answers whether a slot counts as empty.Emptiness is a strategy
IOIMSlotStampinterfaceA strategy that stamps a slot each time its emptiness is settled.The root: OIMDB
TOIMSameValueGuardtype(prev, next) => boolean, whether a value moved.sameValueGuard

Utilities and constants​

ExportKindWhat it isDocumented at
isOIMSameValueZerofunctionSame-value guard by SameValueZero.sameValueGuard
isOIMSameSlotSequencefunctionWhether two slot arrays hold the same slots in the same order.Comparing two chains
isOIMSameKeySequencefunctionWhether two key arrays hold the same keys in the same order, by SameValueZero.Comparing two chains
holdOIMSlotsfunctionTakes one hold on each slot of a list, through that slot's owner.Holding what you subscribe to
unholdOIMSlotsIfAlivefunctionGives back one hold on each slot of a list, skipping a slot that was released meanwhile.Who holds
OIM_NOTHING_WAS_INSERTEDconst-1: an insert that inserted nothing.The doors
OIM_NOTHING_WAS_REMOVEDconst-1: a remove that removed nothing.The doors
OIM_REMOVED_WITHOUT_A_POSITIONconst-2: a remove from a store that has no positions.The doors
OIM_FROZEN_EMPTY_SLOTSconstA frozen empty array, the initial value of the bucket memo and sorted computeds.The order of a bucket is a derivation

Deprecated, removed in 5.0​

Renamed in 4.4.0; the old names stay exported as aliases of the new ones: OIMSlotContentEntityService → OIMEntityContentService, createOIMSlotContentEntityService → createOIMEntityContentService, TOIMSlotContentEntityServiceOptions → TOIMEntityContentServiceOptions, OIMSlotContentBucketService → OIMBucketContentService, TOIMSlotContentBucketServiceOptions → TOIMBucketContentServiceOptions, OIMSlotContentSetBucketService → OIMSetBucketContentService, OIMSlotContentArrayBucketService → OIMArrayBucketContentService, TOIMSlotContentArrayBucketServiceOptions → TOIMArrayBucketContentServiceOptions, OIMSlotContentPositionalArrayBucketService → OIMPositionalArrayBucketContentService, OIMSlotContentSortedArrayBucketService → OIMSortedArrayBucketContentService, TOIMSlotContentSortedArrayBucketServiceOptions → TOIMSortedArrayBucketContentServiceOptions, OIMSlotContentComputedService → OIMComputedContentService, TOIMSlotContentComputedServiceOptions → TOIMComputedContentServiceOptions, OIMSlotContentSourceTrackingComputedService → OIMSourceTrackingComputedContentService.