Skip to main content

API Schema

TypeScript type definitions for Jasper.

StreamData

interface StreamData {
id: string;
T: number; // K
P: number; // Pa
flow: number; // mol/s
composition: Record<string, number>;
phase?: 'L' | 'V' | 'VL';
H?: number; // J/mol
}

BlockData

interface BlockData {
id: string;
type: BlockType;
params: Record<string, ParamValue>;
inlet?: string;
outlet?: string;
}

type BlockType =
| 'Feed' | 'Sink'
| 'Mixer' | 'Splitter'
| 'Heater' | 'Cooler'
| 'Pump' | 'Compressor'
| 'Flash' | 'HeatExchanger'
| 'Reactor' | 'DistillationColumn';

SimulationResult

interface SimulationResult {
success: boolean;
streams: Record<string, StreamData>;
blocks: Record<string, BlockResult>;
errors?: string[];
}

Units

PropertyUnits
TemperatureC, K, F
PressurePa, bar, psi, atm
Flowmol/s, kmol/h, kg/h