API Reference

rs-x-core-injection-tokens

Current rs-x-core.injection-tokens implementation

RsXCoreInjectionTokens contains token keys for core services.

Tokens such as IEqualityService, IErrorLog, IDeepClone let you resolve a service from the container or inject it into a constructor.

Use InjectionContainer.get(token) to resolve a service, or @Inject(token) to inject it into a class constructor.

Example: resolve and inject by token keys

import {
  Inject,
  InjectionContainer,
  RsXCoreInjectionTokens,
  RsXCoreModule,
  type IEqualityService,
  type IErrorLog,
} from '@rs-x/core';

await InjectionContainer.load(RsXCoreModule);

// Resolve by token key from the token object.
const equality = InjectionContainer.get<IEqualityService>(
  RsXCoreInjectionTokens.IEqualityService,
);
const errorLog = InjectionContainer.get<IErrorLog>(
  RsXCoreInjectionTokens.IErrorLog,
);

class Consumer {
  constructor(
    @Inject(RsXCoreInjectionTokens.IEqualityService)

Token reference

The table below maps each token key to the service it refers to and describes that service's responsibility.

ArrayMetadataArrayMetadataMetadata service for Array values (applies to arrays, marks them as non-async, and indicates they need proxying).
DateMetadataDateMetadataMetadata service for Date values (applies to Date instances, marks them as non-async, and indicates they need proxying).
DefaultDeepCloneExceptDeepCloneValueExceptHandles special-case value substitutions during deep cloning (for example resolved async values).
DummyMetadataDummyMetadataFallback metadata service that applies to any value when no specialized metadata service matches.
IArrayIndexAccessorIArrayIndexAccessorAccessor service for reading and writing Array values by index.
IDatePropertyAccessorIDatePropertyAccessorAccessor service for reading and writing Date values by DateProperty keys (for example year, utcYear, month, and time).
IDBFactoryIDBFactoryBrowser IndexedDB factory used to open IndexedDB databases (resolved from window.indexedDB in browser runtime).
IDeepCloneIDeepCloneService for creating deep copies of values.
IDeepCloneExceptIDeepCloneExceptService for special-case value substitutions during deep cloning.
IDeepCloneListdefaultDeepCloneListDefault ordered deep-clone implementation list.
IEqualityServiceIEqualityServiceValue equality and comparison services.
IErrorLogIErrorLogService for adding errors, observing the error stream, and clearing output.
IFunctionCallIndexFactoryIFunctionCallIndexFactoryType alias for the factory service used to create, resolve, and release function-call index entries.
IFunctionCallResultCacheIFunctionCallResultCacheService for creating, checking, and reading cached call results by context object and function-call identity (function name + arguments).
IGlobalIndexAccessorIGlobalIndexAccessorAccessor service for reading and writing values on globalThis by key.
IGuidFactoryIGuidFactoryGuid creation services.
IIndexValueAccessorIIndexValueAccessorAccessor service for reading or writing values for a given context and index.
IIndexValueAccessorListdefaultIndexValueAccessorListDefault ordered index-value-accessor implementation list.
IInjectionContainerInjectionContainerShared Inversify container instance used to register and resolve services.
ILodashDeepCloneLodashDeepCloneDeep-clone service implementation that uses lodash to clone values.
IMapKeyAccessorIMapKeyAccessorAccessor service for reading and writing Map values by key.
IMethodAccessorIMethodAccessorAccessor service for method-call contexts using function-name indexes.
IObjectStorageIObjectStorageService for async key/value persistence with get, set, and close operations.
IObservableAccessorIObservableAccessorAccessor service for reading resolved values from observable contexts.
IPromiseAccessorIPromiseAccessorAccessor service for reading resolved values from promise contexts.
IPropertyValueAccessorIPropertyValueAccessorAccessor service for reading and writing object values by property name.
IProxyRegistryIProxyRegistryStores mappings between original objects and proxies, and lets you look up either one from the other.
IResolvedValueCacheIResolvedValueCacheCache service that stores resolved Promise/Observable values for synchronous reads.
ISequenceIdFactoryISequenceIdFactoryService that returns the same id handle for the same sequence in a given context, reuses existing handles for matching input, and releases them when no longer needed. Always dispose/release handles when finished to prevent memory leaks.
ISetKeyAccessorISetKeyAccessorAccessor service for Set contexts, including membership checks and item access.
IStructuredDeepCloneStructuredDeepCloneDeep-clone service implementation that uses native structuredClone.
IValueMetadataIValueMetadataService contract for classifying runtime values: priority, applicability, async behavior, and proxy requirement.
IValueMetadataListdefaultValueMetadataListDefault value-metadata registration list used to wire metadata services into `IValueMetadataList`.
MapMetadataMapMetadataMetadata service for Map values (applies to Map instances, marks them as non-async, and indicates they need proxying).
ObservableMetadataObservableMetadataMetadata service for Observable values (applies to Observable instances, marks them as async, and indicates they need proxying).
PromiseMetadataPromiseMetadataMetadata service for Promise values (applies to Promise instances, marks them as async, and indicates they need proxying).
SetMetadataSetMetadataMetadata service for Set values (applies to Set instances, marks them as non-async, and indicates they need proxying).