@omnix-lang/runtime-contract
v0.1.0
Published
Omnix cross-platform runtime contract (types-only)
Readme
@omnix-lang/runtime-contract
Types-only contracts shared by Omnix runtime packages. It defines the cross-platform interfaces for reactive adapters, error boundaries, suspense boundaries, runtime context isolation, and platform capability metadata.
Install
pnpm add @omnix-lang/runtime-contractImport
import type {
ReactiveAdapter,
ErrorBoundaryContract,
SuspenseContract,
RuntimeContextSpec,
PlatformCapability,
} from '@omnix-lang/runtime-contract';Usage
Share Reactive State Across Runtimes
import type { ReactiveAdapter } from '@omnix-lang/runtime-contract';
export function readCurrentValue<T>(source: ReactiveAdapter<T>): T {
return source.get();
}Implement Runtime-Specific Boundaries
import type { ErrorBoundaryContract } from '@omnix-lang/runtime-contract';
export function renderBoundary<TNode>(
boundary: ErrorBoundaryContract<TNode>,
children: () => TNode | TNode[],
) {
return boundary.render(children);
}API Reference
API documentation is generated by TypeDoc. Run pnpm docs to generate locally.
