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
| Export | Kind | What it is | Documented at |
|---|---|---|---|
OIMDB | class | OIMDB<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 |
TOIMDBOptions | type | Options of OIMDB: channelScheduler, errorPolicy, onBeforeFlush, getNowMs, releaseTimer, createSchemas. | The root: OIMDB |
OIMDefaults | class | The 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 |
TOIMDefaultsOptions | type | The options of new OIMDefaults(...), every field optional. | Building one |
OIMDefaultValue | class | One built-in default: getValue() builds it on first read and hands the same instance back after. | Building one |
TOIMFactoryOptions | type | The options shape shared by the collection factories. | Building one |
Collection services
| Export | Kind | What it is | Documented at |
|---|---|---|---|
OIMColumnSlotService | class | Abstract 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 |
OIMSlotCollectionService | abstract class | The 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 |
TOIMSlotCollectionServiceOptions | type | Constructor options of OIMSlotCollectionService: the slot owner, the store service, the content service, the store slot listener. | Collection types and store slots |
TOIMSlotCollectionServiceFactoryOptions | type | Options 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 |
createOIMSlotCollectionService | function | Builds an OIMWritableSlotCollectionService over a keyed content service (entity or bucket): { slotContentService, slotStoreService?, … }. | Building one |
OIMWritableSlotCollectionService | class | What 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 |
OIMSingleSlotService | class | The read doors of a single: createStoreSlot(channelMap), peekSingleSlot, hasSingleSlotContent, getSingleSlot, holdSingleSlot, the column doors. | The three kinds of slot |
TOIMSingleSlotServiceOptions | type | Constructor options of OIMSingleSlotService. | Collection types and store slots |
createOIMSingleSlotService | function | Builds an OIMWritableSingleSlotService over a content service with createSingleSlot (entity or bucket). | Standalone records |
OIMWritableSingleSlotService | class | What 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 |
OIMSlotCollectionStoreAggregate | class | A store slot with the store methods of its OIMSlotCollectionService, without the store slot argument; from service.createStoreAggregate(storeSlot). | A store aggregate |
OIMWritableSlotCollectionStoreAggregate | class | The same over an OIMWritableSlotCollectionService, plus writeSlotContentByKey(key, content, changedSlots?). | A store aggregate |
OIMSingleSlotStoreAggregate | class | A single store slot with peekSingleSlot, hasSingleSlotContent, getSingleSlot, holdSingleSlot. | A store aggregate |
OIMWritableSingleSlotStoreAggregate | class | The same plus writeSingleSlotContent(content, changedSlots?) and clearSingleSlotContent(). | A store aggregate |
OIMSlotCollectionIndexStoreAggregate | class | An index store slot with the collection reads, the index reads and disposeIndexStoreSlot(). | A store aggregate |
createOIMSlotCollectionStoreAggregate | function | (db, options of createOIMSlotCollectionService): the service, its store slot and an OIMWritableSlotCollectionStoreAggregate in one call. | A store aggregate |
createOIMSlotCollectionIndexStoreAggregate | function | (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 |
createOIMEntitySlotCollectionStoreAggregate | function | <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 |
OIMEntitySlotCollectionStoreAggregate | class | What createOIMEntitySlotCollectionStoreAggregate returns: the writable collection aggregate plus getEntities() (no strict order; sort for one) and getEntityCount(), both tracked. | A store aggregate |
OIMSlotCollectionBucketService | class | INSTANCE.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 |
TOIMCollectionBucketSlot | type | What both doors return: a read-only bucket slot with getBucketMemberSlots, getBucketMemberSlotCount, hasBucketMemberSlot, holdSlot, unholdSlot. | Reading the whole population |
OIMCollectionSetBucketContentService | class | The 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 |
TOIMSlotCollectionStoreSlot | type | The store slot OIMSlotCollectionBucketService.getBucketSlot / holdBucketSlot take: a store slot whose service has getSlots. | Reading the whole population |
getOIMBucketMemberSlotEntities | function | (bucketMemberSlots): the entities of an iterable of member slots (bucketSlot.getBucketMemberSlots(), a sorted slot's value), skipping empty ones. | Reading the whole population |
createOIMSingleSlotStoreAggregate | function | (db, options of createOIMSingleSlotService): the service, its store slot and an OIMWritableSingleSlotStoreAggregate in one call. | A store aggregate |
OIMSlotOwnerService | type only | The 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 |
TOIMSlotOwnerServiceOptions | type | Constructor options of OIMSlotOwnerService. | Collection types and store slots |
IOIMSlotContentService | interface | What 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 |
IOIMSlotContentWriter | interface | The content writes a collection drives: insertSlotContent, writeSlotContent, clearSlotContent. | Every collection is a content service, a collection service and a store slot |
IOIMKeyedSlotCreator | interface | createSlot(key, storeSlot, slotOwner): what makes a content service usable by createOIMSlotCollectionService. | Every collection is a content service, a collection service and a store slot |
IOIMSingleSlotCreator | interface | createSingleSlot(storeSlot, slotOwner): what makes a content service usable by createOIMSingleSlotService. | Every collection is a content service, a collection service and a store slot |
IOIMSlotFilingService | interface | Files 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 |
TOIMSlotContentServiceKey | type | The 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 |
TOIMSlotContentServiceSlot | type | The keyed slot type it reads off a content service. | Every collection is a content service, a collection service and a store slot |
TOIMSlotContentServiceSingleSlot | type | The single slot type createOIMSingleSlotService reads off a content service. | Every collection is a content service, a collection service and a store slot |
TOIMSlotContentServiceContent | type | The content type a content service writes. | Every collection is a content service, a collection service and a store slot |
TOIMSlotContentServicePatch | type | The 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 |
OIMSlotContentChangeListenerService | class | INSTANCE: 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 |
markOIMBucketColumnsChanged | function | (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 |
isOIMAnyAddedColumnRead | function | (listenerReadColumns, changedColumns): whether a write's changed columns hit a column added to that listener. | The content-change hook |
TOIMSlotContentChangeListenerReadColumns | type | The columns one content-change listener reads: declaredColumnNames (undefined = every column), addedColumnNames, isAnyColumnAdded; returned by addContentChangeListener. | The content-change hook |
IOIMSlotContentChangeListener | interface | onContentChanged(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
| Export | Kind | What it is | Documented at |
|---|---|---|---|
OIMEntityContentService | class | The 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 |
TOIMEntityContentServiceOptions | type | Constructor options of OIMEntityContentService: selectKey, entityWriter, slotEmptinessPolicy, slotStamp, slotReleasePolicy, slotStoreService, the column owner options. | Building one |
TOIMEntitySlotOwnerService | type | The slot owner type of an entity collection. | Collection types and store slots |
createOIMEntityContentService | function | Builds an OIMEntityContentService and its slot owner on an OIMDB; a Map store unless slotStoreService is passed, and no selectKey for a single. | Building one |
TOIMEntitySlot | type | <TEntity, TKey, TColumnName>: an indexable slot that carries an entity (or nothing); getColumnSlot / holdColumnSlot take TColumnName (default every column). | A slot |
OIMEntitySlot | class (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 |
OIMSlot | class (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 |
TOIMEntityContentSlot | type | <TEntity, TColumnName>: an entity slot without a key: what a single holds and what the writer and content service take. | Writing |
TOIMColumnName | type | The string column names of an entity type, or any string when the entity type is a bare object. | Writing a standalone record |
TOIMEntityColumnValue | type | The 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 |
IOIMEntityWriter | interface | The six functions that write an entity slot: fill, put, patch, patch one column, delete columns, clear. | The two writers |
createOIMInPlaceEntityWriter | function | Builds an IOIMEntityWriter that applies puts, patches and column deletes onto the stored entity object itself. | The two writers |
createOIMReplacingEntityWriter | function | Builds an IOIMEntityWriter that applies every change to a fresh copy and stores the copy in the slot. | The two writers |
TOIMEntityWriterOptions | type | Options of both writer factories: sameValueGuard, entityInserter, and the walks putEntityColumns, patchEntityColumns, patchEntityColumn. | Writing your own writer |
TOIMEntityInserter | type | The function that stores a handed entity into an entity slot on fill. | The store keeps the object you insert |
insertOIMEntityWithoutCopy | function | Insert strategy that stores the handed entity object itself. The default. | The store keeps the object you insert |
insertOIMEntityWithCopy | function | Insert strategy that stores a copy ({ ...entity }). | The store keeps the object you insert |
insertOIMEntityWithSanitizedCopy | function | Insert strategy that stores a copy with an own __proto__ key removed; for untrusted JSON. | The store keeps the object you insert |
patchOIMEntityColumns | function | The 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 |
guardOIMEntityColumnsPatch | function | The PATCH walk that skips a __proto__ key and a key the patch does not own. | Writing your own writer |
patchOIMEntityColumn | function | The one-column walk, the writers' default patchEntityColumn. | Writing your own writer |
guardOIMEntityColumnPatch | function | The one-column walk that refuses the column name __proto__. | Writing your own writer |
putOIMEntityColumns | function | The PUT walk, the writers' default putEntityColumns: the patch walk plus undefined over every column the new value lacks. | Writing your own writer |
guardOIMEntityColumnsPut | function | The PUT walk that skips __proto__ keys and inherited stored columns. | Writing your own writer |
Buckets and bucket commands
| Export | Kind | What it is | Documented at |
|---|---|---|---|
OIMBucketContentService | abstract class | The bucket content service every strategy extends: writeSlotContent, addBucketMemberSlot(s), removeBucketMemberSlot(s), clearSlotContent, fillBucketMemberSlots, markContentChanged, getBucketMemberSlots, getBucketMemberSlotCount, hasBucketMemberSlot. | How a bucket holds its slots |
OIMSetBucketContentService | class | Bucket content service over a Set; no positions. | How a bucket holds its slots |
OIMArrayBucketContentService | abstract class | The array-based bucket content services: the positional reads getBucketMemberSlotAt, getBucketMemberSlotPosition. | The doors |
OIMPositionalArrayBucketContentService | class | Bucket content service over an array whose positions are the caller's: the five positional writes; one entry per mention. | Positions the caller decides |
OIMBucketUniqueMemberSlotsArrayService | class | The 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 |
OIMSortedArrayBucketContentService | class | Bucket content service whose array is kept sorted; repositionBucketMemberSlot; no positional writes. | Sorted at write |
TOIMBucketContentServiceOptions | type | Options of the bucket content services: bucketCommands. | The commands, on the bucket slot |
TOIMSortedArrayBucketContentServiceOptions | type | Options of the sorted bucket content service: compareBucketMemberSlots. | Sorted at write |
TOIMArrayBucketContentServiceOptions | type | Options of the array bucket content services: bucketCommands?, bucketMemberSlotsArrayService?. | Buckets |
TOIMBucketSlotOwnerService | type | The slot owner type of a bucket collection. | Collection types and store slots |
OIMBucketCommands | class | Records 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 |
IOIMBucketMemberSlotsArrayService | interface | The only writer of an array bucket's member list and the Set beside it. | Buckets |
OIMBucketMemberSlotsArrayService | class | Keeps every mention; the default of both array buckets. | Buckets |
OIMBucketCommandsCursor | class | takeBucketCommands(): 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 |
TOIMBucketCommandsCursorOptions | type | Options of OIMBucketCommandsCursor: bucketSlot. | The commands, on the bucket slot |
TOIMBucketCommandsOptions | type | Options of OIMBucketCommands: maxCommandsPerSlot. | The commands, on the bucket slot |
IOIMBucketCommands | interface | The recorder a bucket content service reports positional writes to: recordInsert, recordRemove, recordMove, recordWholeList. | The commands, on the bucket slot |
TOIMOrderedListCommand | type | One ordered-list command: insert, remove, move, or reset to a whole list. | The commands, on the bucket slot |
getOIMOrderedListCommands | function | Computes the ordered-list commands that turn one slot sequence into another, optionally capped. | Rendering an ordered bucket |
TOIMBucketSlot | type | An indexable slot that carries a bucket's member store, its owner, the commands recorded on it, and isWholeListRecorded. | A slot |
TOIMBucketContentSlot | type | A bucket slot without a key: what a single bucket holds and what the bucket content services take. | Buckets |
TOIMBucketSlotsSetStore | type | The member store of a set-driven bucket. | How a bucket holds its slots |
TOIMBucketSlotsArrayStore | type | The member store of an array bucket: { bucketMemberSlots, uniqueBucketMemberSlots, sortedCount }. | How a bucket holds its slots |
Indexes
| Export | Kind | What it is | Documented at |
|---|---|---|---|
OIMSlotCollectionIndexService | class | A 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 |
OIMSlotCollectionSortedArrayIndexService | class | OIMSlotCollectionIndexService over a sorted bucket content service, re-filing a member when one of its sort columns changes. | Sorted at write |
TOIMSlotCollectionIndexServiceOptions | type | Constructor options of OIMSlotCollectionIndexService: the collection options plus selectKey, columns, sourceSlotCollectionService, indexKeysService. | How an index files entities |
TOIMIndexStoreSlot | type | An index's store slot: a store slot of buckets with its sourceStoreSlot, its listener, indexKeysPosition and isDisposed. | How an index files entities |
TOIMSlotCollectionIndexServiceStoreSlot | type | The index store slot type of a given OIMSlotCollectionIndexService. | Ordering |
TOIMSlotCollectionIndexServiceFactoryOptions | type | The options every index factory shares: entityService (anything with getSlots), slotReleasePolicy, columnSlotStoreService, columnNames, columnGroups. | How an index files entities |
createOIMSlotCollectionIndexService | function | Builds 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 |
createOIMSlotCollectionSortedArrayIndexService | function | Builds an OIMSlotCollectionSortedArrayIndexService sorted by sortColumns. | Sorted at write |
TOIMIndexKeyOptions | type | { columns }, { selectKey } or both: where an index key comes from. | Where the key comes from |
TOIMIndexKey | type | The key type an index derives from its columns: one column's value, or a tuple of several. | A key of several columns |
IOIMIndexKeysService | interface | How the per-index key cells on a slot are allocated, read, written and reclaimed. | The content-change hook and indexKeys |
TOIMIndexKeysPositions | type | The positions allocated on one source store slot. | The content-change hook and indexKeys |
OIMIndexKeysService | abstract class | Base of the two index-keys strategies. | The content-change hook and indexKeys |
OIMAppendingIndexKeysService | class | Never reuses a position. The default. | The content-change hook and indexKeys |
OIMReclaimingIndexKeysService | class | Wipes and reuses a position at disposeIndexStoreSlot. | The content-change hook and indexKeys |
Computed
| Export | Kind | What it is | Documented at |
|---|---|---|---|
OIMComputedService | class | A computed collection type: an OIMSlotCollectionService (pull column owner, own createStoreAggregate) with createStoreSlot(channelMap, derive?, createSources?). | One derivation per key |
TOIMComputedServiceOptions | type | Constructor options of OIMComputedService. | One derivation per key |
createOIMComputedService | function | Builds an OIMComputedService; takes no db. | One derivation per key |
TOIMComputedStoreSlot | type | A computed store slot: a store slot with its derive and createSources. | One derivation per key |
OIMSortedComputedService | class | Per key of an index store slot, that bucket's entity slots sorted: an OIMSlotCollectionService (pull column owner, own createStoreAggregate) with createSortedStoreSlot(indexStoreSlot). | Ordering |
TOIMSortedComputedServiceOptions | type | Constructor options of OIMSortedComputedService. | Ordering |
TOIMSortedComputedSlot | type | The computed slot of a sorted list. | Ordering |
createOIMSortedCollectionSingleSlotStoreAggregate | function | Sorts 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 |
createOIMSortedComputedService | function | Builds an OIMSortedComputedService over an index service; takes no db. | Ordering |
OIMBucketMemoComputedService | class | Per 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 |
TOIMBucketMemoComputedServiceOptions | type | Constructor options of OIMBucketMemoComputedService. | The order of a bucket is a derivation |
TOIMBucketMemoComputedSlot | type | The computed slot of a bucket memo. | The order of a bucket is a derivation |
createOIMBucketMemoComputedService | function | Builds an OIMBucketMemoComputedService over a bucket collection service; takes no db. | The order of a bucket is a derivation |
OIMSingleComputedService | class | One derivation under no key: an OIMSingleSlotService with the pull column owner; createStoreSlot(db, derive?, createSources?), read through its own getSingleSlot / holdSingleSlot. | The compute graph |
createOIMSingleComputedService | function | Builds an OIMSingleComputedService. | The compute graph |
OIMSourceTrackingComputedService | class | Keyed derivations whose derive reads through an OIMSourceTracker. | A derivation that finds its sources as it reads |
OIMSingleSourceTrackingComputedService | class | One 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 |
createOIMSourceTrackingComputedService | function | Builds an OIMSourceTrackingComputedService. | A derivation that finds its sources as it reads |
createOIMSingleSourceTrackingComputedService | function | Builds an OIMSingleSourceTrackingComputedService. | A derivation that finds its sources as it reads |
TOIMSourceTrackingComputedSlot | type | A keyed source-tracking derivation slot; read only through a source tracker. | A derivation that finds its sources as it reads |
TOIMSourceTrackingComputedContentSlot | type | The slot of one source-tracking derivation; read only through a source tracker. | A derivation that finds its sources as it reads |
OIMSourceTrackingComputedContentService | type only | The 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 |
TOIMSourceTrackingComputedDerivationOptions | type | The derivation options a source-tracking computed service takes: derive, sameValueGuard, releaseValue, initialValue. | A derivation that finds its sources as it reads |
TOIMComputedServiceFactoryOptions | type | The options every computed factory shares: sameValueGuard, releaseValue, initialValue, slotReleasePolicy, columnSlotStoreService, columnNames, columnGroups. | The compute graph |
TOIMSourceTrackingComputedDerive | type | (computedSlot) => value, the derive of a source-tracking derivation. | A derivation that finds its sources as it reads |
TOIMComputedDerivationOptions | type | The derivation options a computed service takes: createSources, derive, sameValueGuard, initialValue. | The compute graph |
TOIMComputedSlot | type | A slot whose value is derived, with its value service, sources and stamps. | A derivation is a slot that nothing marks |
TOIMComputedSources | type | { sourceSlots, sourceComputeds }, what createSources returns. | A derivation is a slot that nothing marks |
TOIMComputedValueReleaser | type | (value) => void, the releaseValue option: gives back what a derived value holds. | Releasing a computed value |
IOIMComputedValueService | interface | getValueForSlot(computedSlot), the one read that settles a computed. | A derivation is a slot that nothing marks |
OIMComputedValueService | class | The value service of a computed collection: holds the sameValueGuard and serves the value. | A derivation is a slot that nothing marks |
TOIMComputedContentSlot | type | A computed slot without a key: what a single computed holds. | The compute graph |
TOIMComputedCarrierSlot | type | TOIMComputedContentSlot plus the six column doors and watch: what a single computed service hands out. | Computed columns |
OIMComputedContentService | type only | The abstract content service of a computed collection (protected constructor): creates computed slots; OIMExplicitSourceComputedContentService and OIMSourceTrackingComputedContentService extend it. | The compute graph |
TOIMComputedContentServiceOptions | type | Its options: computedValueService, initialValue?. | The compute graph |
OIMExplicitSourceComputedContentService | class | The 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 |
TOIMExplicitSourceComputedContentServiceOptions | type | TOIMComputedContentServiceOptions plus createSources?. | The compute graph |
TOIMComputedValueServiceOptions | type | Constructor options of OIMComputedValueService. | A derivation is a slot that nothing marks |
refreshOIMSourceComputeds | function | Brings every computed of a list current; a binding read outside an effect calls it before its derive. | Reading a computed from an effect |
TOIMComputedDerivation | type | What a computed slot and an effect share: their sources and the stamp of their last run. | Why a computed is pulled |
TOIMSortColumn | type | { columnName, direction }, one sort column. | Ordering |
TOIMSortableColumnName | type | A column whose values are strings, numbers or bigints. | Ordering |
createOIMColumnsComparator | function | The comparator over sort columns: each in turn, by its direction, an undefined or null value last. | Ordering |
Columns
| Export | Kind | What it is | Documented at |
|---|---|---|---|
TOIMColumnSlot | type | A slot for one column of a carrier slot, keyed by the column name, with carrierSlot and value. | Column slots |
TOIMComputedColumnSlot | type | TOIMComputedColumnSlot<TSourceTracker>: the column slot of a computed, a computed itself, carrying its carrier's tracker type. | Computed columns |
TOIMColumnGroup | type | TOIMColumnGroup<TColumnName>: a named set of columns (key, columnNames) made by createOIMColumnGroup. | Column groups |
createOIMColumnGroup | function | createOIMColumnGroup(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 |
OIMColumnSlotOwner | abstract class | The owner of a carrier's column slots; an OIMSlotOwner that mints, holds and releases them. | Column slots |
OIMPushColumnSlotOwner | type only | Column owner whose OIMColumnSlots are woken by marks on a write; entity and bucket collections. | Column slots |
OIMPullColumnSlotOwner | class | Column owner whose OIMColumnSlots are derived from the carrier when read; computed collections. | Computed columns |
TOIMColumnSlotOwnerOptions | type | Either 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
| Export | Kind | What it is | Documented at |
|---|---|---|---|
OIMChannelService | class | INSTANCE: runs a channel slot — write, writeWithoutFlushCheck, flush, subscribeAfterEachFrame, subscribeOnceAfterFrame, subscribeAfterEachFlush, isChangedInCurrentFrame, assertNotFlushing, dropChannelSlot. | The channel |
TOIMChannelSlot | type | The channel's state: clock, frame, effect queue, handlers, collector slot. | The channel |
TOIMChannelSlotOptions | type | Options of createOIMChannelSlot. | The channel |
createOIMChannelSlot | function | Builds a channel slot over a clock and a collector slot. | The channel |
IOIMChannelMap | interface | { defaultChannelSlot }, what createStoreSlot and the effect doors take; OIMDB is one. | Every collection has a channel |
TOIMChannelFrame | type | The frame of a channel slot: whether it runs, the clock it opened at, the after-frame handlers. | The clock |
TOIMChannelClock | type | { revision, epoch, unheldSlotWriteCount }. | The clock |
TOIMChannelScheduler | type | (flush) => void, what defers a flush. | Schedulers |
OIMChannelQueue | type only | The reusable queue the channel and the services batch with: getEntryCount, getEntryAt. | The content-change hook |
isOIMAnySlotChangedAfter | function | Answers whether any slot of a list changed after a clock reading, given as a revision and an epoch. | The clock |
IOIMErrorPolicy | interface | onErrorCaught(error), what a throw caught during a flush becomes. | After the flush has ended |
OIMLogAndContinueErrorPolicy | class | Logs the throw, hands it to onError, and goes on. The default. | After the flush has ended |
TOIMLogAndContinueErrorPolicyOptions | type | { onError }. | After the flush has ended |
OIMThrowAtOnceErrorPolicy | class | Throws the first throw out of flush(). | After the flush has ended |
OIMEffectService | class | INSTANCE: createEffect, createAndRunEffect, subscribeEffect, createSourceTrackingEffect, disposeEffect, each taking the channel map first. | Effects |
IOIMEffectService | interface | What an effect carries as its service. | Effects |
TOIMEffect | type | A plain effect object; built only by the effect service. | Subscribing is building an effect |
TOIMEffectBody | type | () => (() => void) | void; a returned function is the undo. | A body may hand back its own undo |
TOIMSourceTrackingEffectBody | type | The body of a tracked effect, handed an OIMSourceTracker. | An effect that finds its sources as it reads |
OIMSourceTracker | type only | The 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 |
IOIMSourceTracker | interface | What 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 |
OIMFlushSchedulerService | abstract class | The base of what a timer fires: the schedule and cancel of one standing callback on a TOIMFlushSchedulerSlot. | Source layout |
TOIMFlushSchedulerSlot | type | { timer, scheduledCallback, timerDisposer }. | Source layout |
IOIMFlushSchedulerListener | interface | What a flush scheduler calls when its timer fires. | The channel |
TOIMTimer | type | (run, inMs) => TOIMDisposer, how a host schedules a timed run. | Controlling the clock |
TOIMDisposer | type | () => void. | Giving many handles back at once |
OIM_NOOP_DISPOSER | const | A TOIMDisposer that does nothing, for a door that had nothing to undo. | Giving many handles back at once |
Release policies and collectors
| Export | Kind | What it is | Documented at |
|---|---|---|---|
IOIMSlotReleasePolicy | interface | Whether and when an unheld slot may go. | The question a policy answers |
OIMSlotAtEmptyReleasePolicy | class | INSTANCE: an empty unheld slot goes; a filled one stays. The default of entity, bucket and index collections. | Releasing an identity on a clock |
OIMSlotNeverReleasePolicy | class | INSTANCE: nothing goes. | Releasing an identity on a clock |
OIMSlotAtUnholdReleasePolicy | class | INSTANCE: an unheld slot goes, value or not. The default of computeds. | Releasing an identity on a clock |
OIMSlotAfterWriteReleasePolicy | class | A slot goes once its last write is older than keepAfterWriteMs. | Releasing an identity on a clock |
TOIMSlotAfterWriteReleasePolicyOptions | type | { keepAfterWriteMs, slotReleaseDueFramePolicy? }. | Releasing an identity on a clock |
IOIMSlotReleaseDueFramePolicy | interface | Which writes move the after-write deadline: isSlotReleaseDueFrameOpen(). | Which writes move the deadline |
OIMSlotReleaseAutoDueFramePolicy | class | Every write is its own frame; the default. | Which writes move the deadline |
OIMSlotReleaseManualDueFramePolicy | class | Only writes inside a frame opened by hand move the deadline. | Which writes move the deadline |
OIMSlotAfterIdleReleasePolicy | class | A slot goes once nothing has watched it for keepAfterIdleMs. | Releasing an identity on a clock |
TOIMSlotAfterIdleReleasePolicyOptions | type | { keepAfterIdleMs }. | Releasing an identity on a clock |
OIMSlotAfterUnholdReleasePolicy | class | A slot goes once keepAfterUnholdMs has passed since its last unhold. | Releasing an identity on a clock |
TOIMSlotAfterUnholdReleasePolicyOptions | type | { keepAfterUnholdMs }. | Releasing an identity on a clock |
OIMSlotEarliestReleasePolicy | class | As soon as any of several policies says so. | Releasing an identity on a clock |
OIMUnusedSlotCollectorService | class | INSTANCE: holds what a getter minted until the next flush; holdSlotUntilFlush, flush, open, close, run. | The unused-slot collector |
TOIMUnusedSlotCollectorSlot | type | The unused-slot collector's state. | The unused-slot collector |
createOIMUnusedSlotCollectorSlot | function | Builds an unused-slot collector slot of your own. | The unused-slot collector |
TOIMCollectorSlot | type | The db's collector slots: the unused-slot collector and the three release collectors. | Controlling the clock |
TOIMCollectorSlotOptions | type | { getNowMs, releaseTimer, errorPolicy }. | Controlling the clock |
createOIMCollectorSlot | function | Builds a collector slot. | Controlling the clock |
OIMSlotWheel | abstract class | A wheel of slots in slices of OIM_SLICE_LENGTH_MS, with its own timer and clock: flush, cancelAllSlots, getNextSliceNumber, sweepUpToSliceNumber. | The collectors |
TOIMSlotWheelOptions | type | { getNowMs, timer, errorPolicy }. | Controlling the clock |
OIMSlotReleaseWheel | class | The wheel a release policy files into; reads and writes the marker it was built with. Three per db on collectorSlot. | What restarts each window |
mintOIMAfterWriteSlotReleaseWheel | function | The db's after-write release wheel, created on first use. | Controlling the clock |
mintOIMAfterIdleSlotReleaseWheel | function | The db's after-idle release wheel, created on first use. | Controlling the clock |
mintOIMAfterUnholdSlotReleaseWheel | function | The db's after-unhold release wheel, created on first use. | Controlling the clock |
TOIMSlotReleaseWheelOptions | type | Wheel options plus { getReleaseDueMs, setReleaseDueMs, releaseScheduledSlotFlag }. | Controlling the clock |
OIMSlotRefetchWheel | class | A 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 |
TOIMSlotRefetchWheelOptions | type | { slotRefetchListener }, the second argument of new OIMSlotRefetchWheel(db, options); the clock, timer and error policy are the db's. | Refetching on a clock |
IOIMSlotRefetchListener | interface | onSlotsRefetchDue(slots). | Refetching on a clock |
IOIMSlotReleaseListener | interface | onSlotReleased(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 |
getOIMSliceOfMs | function | The number of the time slice a millisecond timestamp falls in. | Controlling the clock |
OIM_SLICE_LENGTH_MS | const | Length of one release time slice: 1024 ms. | Controlling the clock |
Slot stores and keys
| Export | Kind | What it is | Documented at |
|---|---|---|---|
TOIMStoreKey | type | A scalar key: a string or a number. | Scalar keys |
IOIMSlotStoreService | interface | Stateless, 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 |
OIMSlotMapStoreService | class | IOIMSlotStoreService over a Map. | Building one |
OIMSlotTreeStoreService | class | IOIMSlotStoreService keyed by a composite key, filed in a tree walked by a key tree walk. | Composite keys come in two strategies |
OIMSingleSlotStoreService | class | INSTANCE: keyed by void, files at most one slot; the store service of every single. | The three kinds of slot |
TOIMSingleSlotStore | type | The store of a single: { slot }. | The three kinds of slot |
TOIMDefaultSlotStore | type | The 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 |
TOIMSlotStoreTree | type | The tree store: a root key node and the set of filed slots. | A chain of identities |
IOIMKeyTreeWalk | interface | Walks a composite key through a tree of key nodes: mint the node, find it, prune it. | A chain of identities |
OIMKeyTreeWalk | abstract class | Base of the key tree walks. | A chain of identities |
OIMScalarKeyTreeWalk | class | Key tree walk over scalar key parts, which holds nothing. | A chain of values |
OIMCompositeKeyTreeWalk | class | Key tree walk over entity-slot key parts, which holds each part while the edge stands. | A chain of identities |
TOIMCompositeKeyNode | type | One node of the key tree. | A chain of identities |
Slots and owners
| Export | Kind | What it is | Documented at |
|---|---|---|---|
TOIMSlot | type | The 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 |
TOIMKeyedSlot | type | TOIMSlot with a key. | A slot |
TOIMIndexableSlot | type | TOIMKeyedSlot with index-key cells. | The content-change hook and indexKeys |
TOIMEditable | type | The same type with every field writable. | A slot |
TOIMStoreSlot | type | A 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 |
TOIMSingleSlotStoreSlot | type | The store slot of a single. | The three kinds of slot |
IOIMStoreSlotListener | interface | Told of every store slot a service creates; set as storeSlotListener of the defaults that service is built with. | Collection types and store slots |
OIMNoStoreSlotListener | class | The default store slot listener: hears nothing. | Collection types and store slots |
IOIMSlotSubscriptionListener | interface | onSlotFirstSubscribed(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 |
OIMNoSlotSubscriptionListener | class | INSTANCE: the default subscription listener, hears nothing. | Knowing when a slot is watched |
isOIMSlotEmpty | function | Reads the EMPTY bit of slot.slotFlags. | A slot |
isOIMSlotReleased | function | Reads the RELEASED bit of slot.slotFlags. | A slot |
OIMSlotOwner | abstract class | Base 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 |
IOIMSlotOwner | interface | What every slot's owner answers: hold, unhold, release if unheld, unsafeMutateSlot, subscribe, unsubscribe. | A slot goes when nothing refers to it |
IOIMSlotEmptinessPolicy | interface | The strategy that answers whether a slot counts as empty. | Emptiness is a strategy |
IOIMSlotStamp | interface | A strategy that stamps a slot each time its emptiness is settled. | The root: OIMDB |
TOIMSameValueGuard | type | (prev, next) => boolean, whether a value moved. | sameValueGuard |
Utilities and constants
| Export | Kind | What it is | Documented at |
|---|---|---|---|
isOIMSameValueZero | function | Same-value guard by SameValueZero. | sameValueGuard |
isOIMSameSlotSequence | function | Whether two slot arrays hold the same slots in the same order. | Comparing two chains |
isOIMSameKeySequence | function | Whether two key arrays hold the same keys in the same order, by SameValueZero. | Comparing two chains |
holdOIMSlots | function | Takes one hold on each slot of a list, through that slot's owner. | Holding what you subscribe to |
unholdOIMSlotsIfAlive | function | Gives back one hold on each slot of a list, skipping a slot that was released meanwhile. | Who holds |
OIM_NOTHING_WAS_INSERTED | const | -1: an insert that inserted nothing. | The doors |
OIM_NOTHING_WAS_REMOVED | const | -1: a remove that removed nothing. | The doors |
OIM_REMOVED_WITHOUT_A_POSITION | const | -2: a remove from a store that has no positions. | The doors |
OIM_FROZEN_EMPTY_SLOTS | const | A 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.