import type { RailDeckDirectIntegrationClient as Client } from '@raildeck/frontend-sdk/direct-integration'; /** * Open a locomotive with its driving settings and function definitions. * @param client - Configured client; the caller owns current authority. * @param accountId - Authorised account for this workflow. * @param locomotiveId - Explicitly selected locomotive. * @param signal - Caller-owned cancellation signal. * @returns Editor data whose returned versions belong to any later reviewed save. */ export async function openLocomotiveEditor( client: Client, accountId: string, locomotiveId: string, signal: AbortSignal, ) { const options = { signal, timeoutMs: 15_000 }; const locomotive = await client.locomotives.get(accountId, locomotiveId, options); const settings = await client.locomotives.getDrivingSettings(accountId, locomotiveId, options); const functions = await client.locomotiveFunctions.list(accountId, locomotiveId, options); return { locomotive, settings, functions }; }