UNPKG

dive-deco

Version:

A TypeScript implementation of decompression calculation algorithms for scuba diving, featuring Bühlmann ZH-L16C algorithm with gradient factors, gas management, and oxygen toxicity tracking.

32 lines (31 loc) 1.1 kB
import { AscentRatePerMinute, CeilingType, MbarPressure, ConfigValidationError, DecoRuntime, Cns, Otu } from './types'; import { Depth } from './depth'; import { Time } from './time'; import { Gas } from './gas'; import { OxTox } from './oxTox'; export interface DiveState { depth: Depth; time: Time; gas: Gas; oxTox: OxTox; } export interface DecoModelConfig { validate(): ConfigValidationError | null; surfacePressure(): MbarPressure; decoAscentRate(): AscentRatePerMinute; ceilingType(): CeilingType; roundCeiling(): boolean; } export declare abstract class DecoModel { abstract config(): DecoModelConfig; abstract diveState(): DiveState; abstract record(depth: Depth, time: Time, gas: Gas): void; abstract recordTravel(targetDepth: Depth, time: Time, gas: Gas): void; abstract recordTravelWithRate(targetDepth: Depth, rate: AscentRatePerMinute, gas: Gas): void; abstract ndl(): Time; abstract ceiling(): Depth; abstract deco(gasMixes: Gas[]): DecoRuntime; abstract cns(): Cns; abstract otu(): Otu; inDeco(): boolean; }