Optionalparams: Partial<BasicRuntimeService & BasicSysAbstractionParams>Optional configuration for time, ID, and random modes
BasicSysAbstraction instance for the current runtime
// Production: auto-detect runtime with defaults
const sys = BasicSysAbstractionFactory();
const now = sys.Time().Now();
const id = sys.NextId();
// Testing: deterministic behavior
const testSys = BasicSysAbstractionFactory({
TimeMode: TimeMode.CONST,
IdMode: IDMode.STEP,
RandomMode: RandomMode.CONST
});
const constTime = testSys.Time().Now(); // Always 2021-02-01
const id1 = testSys.NextId(); // "STEPId-0"
const id2 = testSys.NextId(); // "STEPId-1"
Creates a BasicSysAbstraction instance for the current runtime environment.
Automatically detects the JavaScript runtime (Browser, Node.js, Deno, or Cloudflare Workers) and returns the appropriate system abstraction implementation. Supports optional configuration for time, ID, and random number generation modes, useful for testing with deterministic behavior.