Core Types
KernelResult, KernelIssue, WorkerState, and other fundamental type definitions.
Core Types
Use these types when handling kernel operation results, errors, geometry output, and worker state. They form the shared contract between the client and worker runtime.
Result Types
All kernel operations return a discriminated union: KernelSuccessResult<T> | KernelErrorResult. Check the success field to narrow the result.
type KernelResult<T> = KernelSuccessResult<T> | KernelErrorResult;Prop
Type
Prop
Type
Issue and Location Types
Prop
Type
Prop
Type
Prop
Type
Worker State and Render Phase
WorkerState is the worker's current lifecycle state: 'idle', 'rendering', or 'error'. Subscribe via client.on('state', handler).
RenderPhase identifies the current phase of a render: 'resolvingDeps', 'bundling', 'extractingParams', 'computingGeometry', 'postProcessing'. Subscribe via client.on('progress', handler).
Dependency Types
Dependencies represent what a kernel's geometry depends on. The Dependency union type is used for cache key computation, middleware, and change detection:
Prop
Type
Prop
Type
Prop
Type
Prop
Type
Prop
Type
Prop
Type
Dependency is the union: FileDependency | MiddlewareDependency | FrameworkDependency | OptionDependency | ParameterDependency | AssetDependency.
Filesystem Types
Prop
Type
Prop
Type
Kernel Types
Prop
Type
Prop
Type
Bundler Types
Prop
Type
Prop
Type
Prop
Type
Prop
Type
Tracer Types
Prop
Type
Prop
Type
Geometry and Export Types
Prop
Type
Prop
Type
Prop
Type
Prop
Type
Usage
const result = await client.render({ file: 'main.ts' });
if (result.success) {
console.log(result.data.length);
} else {
console.error(result.issues);
}