@tsln/lom-types
Type declarations for the Ableton Live Object Model (LOM), generated from the
LOM reference. They describe every class's children,
properties and functions in a type-only Lom namespace, and resolve literal Live API paths
to their class.
type T = Lom.ClassAtPath<"live_set tracks 0 devices 1">; // "Device"
type N = Lom.PropertyType<"Track", "name">; // string
type S = Lom.MemberWith<"DeviceIO", "set">; // "routing_type" | "routing_channel" | ...
Runtime access with these types is what @tsln/live-object provides.
Install
npm install --save-dev @tsln/lom-types
The declarations are global, so list the package in types rather than importing it:
{
"compilerOptions": {
"types": ["@tsln/max-types", "@tsln/lom-types"]
}
}
Files
index.d.tsis generated bypnpm generate:lomat the root of this repository:Lom.Classesdescribes every class, andLom.ClassAtPath<P>resolves a literal path such as"live_set tracks 0 devices 1"to its class. Corrections to the reference (for exampleChain.devicesbeing a list,this_devicebeing aMaxDevice) live in the generator.access.d.tsis hand-written:Lom.MemberValue,Lom.Accessorsand other helpers for typed access through a wrapper. A wrapper registers itself by merging intoLom.ObjectTypes, which is how@tsln/live-objectmakes children resolve toLiveObjects.