Package Exports
- @ui2v/runtime-core
Readme
@ui2v/runtime-core
DOM-free runtime foundation for ui2v compositions.
Runtime Core owns scene graph normalization, timeline evaluation, deterministic frame plans, dependency metadata, adapter routing, multi-adapter coordination, and renderer-neutral draw commands. It does not draw pixels.
Install
npm install @ui2v/runtime-coreFrame Plans
import { createVideoFramePlan } from '@ui2v/runtime-core';
const frames = createVideoFramePlan({ duration: 4, fps: 30 });Exporters should render frame.renderTime and encode with
frame.timestampUs and frame.durationUs.
Adapter Routing
import { createAdapterRoutingPlan, createRenderPlan } from '@ui2v/runtime-core';
const routing = createAdapterRoutingPlan(createRenderPlan(frame));Routing metadata lets Canvas, Three.js, Pixi, Lottie, DOM, and future adapters share one timeline.
Draw Commands
import { createDrawCommandStream } from '@ui2v/runtime-core';
const stream = createDrawCommandStream(routing, {
backgroundColor: composition.backgroundColor,
size: composition.resolution,
});The initial command set includes clear, save, restore, setTransform,
setOpacity, drawLayer, and custom.
License
MIT