*.components.ts
Every exported interface or type alias is a component. Unexported ones are shapes the components use.
// types/body/body.components.ts
interface Vec3 {
x: f64
y: f64
z: f64
}
/** Where the body is, and when that was sensed. */
export interface Pose {
position: Vec3
rotation: [f64, f64, f64, f64]
sensed: f64
}
/** The last depth look, as points. */
export interface Cloud {
points: Float32Array
sensed: f64
}
The number types — f64, f32, u32, i32 — are ambient. No import.
| Write | Means |
|---|---|
f64 f32 u32 i32 | numbers (number is f64) |
string boolean | text, a flag |
[f64, f64, f64] | exactly that many |
T[] | a list |
Record<string, T> | a map |
Float64Array Float32Array Int32Array Uint32Array Uint8Array | a large array, held as memory |
field?: T | may be absent |
T | null | may be null |
A file may import type a shape from another types/ file.