Resolves a Handle into a typed SDK object.
Pass DataModelObject as type when the exact type of the handle is not known
in advance, then use instanceof to branch on the actual type:
const obj = context.getObjectFromHandle(handle, DataModelObject);
if (obj instanceof ClipSlot) {
// ...
}
Objects are cached by handle ID, so the same Live object always returns the same SDK instance.
Throws if the underlying object has been deleted, if it is of a different type
than type, or if its type is not recognised.
Groups mutations into a single undo step.
Individual mutations are already undoable on their own; use this only to roll several changes into one user-facing undo entry. Nested transactions collapse into the outermost one.
The callback must be synchronous — you cannot await inside it — but
returning Promise.all([...]) lets you group multiple async operations
(such as creating tracks) into one undo step:
const tracks = await withinTransaction(() =>
Promise.all([song.createAudioTrack(), song.createAudioTrack()]),
);
Provides access to all SDK functionality. Returned by initialize.