import type { IEdiabas, EdiabasJobResponse, EdiabasResultType, EdiabasState } from "@emdzej/ediabasx-core"; import { type EdiabasConfig } from "@emdzej/ediabasx-ediabas"; import { EdiabasInterface } from "@emdzej/ediabasx-interface-base"; export interface EmbeddedEdiabasOptions { /** Where `loadSgbd(name)` resolves bare ECU names against (Node path lookup). Browser hosts supplying `loadSgbdResolver` can pass any placeholder — the resolver short-circuits the path resolution. */ sgbdPath: string; /** EDIABAS communication interface — built by the caller. Pass `new SimulationInterface()` for a fake. */ interface: EdiabasInterface; /** Default per-job comm timeout in ms (forwarded to inner Ediabas). */ timeout?: number; /** * Browser-side SGBD bytes resolver — same shape as * `EdiabasConfig.loadSgbdResolver`. Required for variant swap on * `.grp` loads in bundles where `node:fs` is stubbed (Vite, etc.). * Forwarded straight through to the inner Ediabas. Node hosts can * leave it unset. */ loadSgbdResolver?: EdiabasConfig["loadSgbdResolver"]; } export declare class EmbeddedEdiabas implements IEdiabas { private readonly sgbdPath; private readonly iface; private readonly timeout; private readonly loadSgbdResolver; private ediabas; /** * Last SGBD path loaded into the shared `Ediabas`. `job()` skips * a redundant `loadSgbd` when the same ECU is targeted again — * without this, every job would reset INITIALISIERUNG / IDENT / * systemResults inside `Ediabas` and re-probe the ECU. */ private loadedSgbdPath; private lastResults; private lastError; private currentState; /** * Single-lane serialiser around the shared `Ediabas`. JS is single- * threaded but `executeJob` / `loadSgbd` are async — interleaving * two `job()` calls would race on loaded-SGBD / INITIALISIERUNG / * parameter-set state and corrupt results. Mirrors the queue in * `EdiabasServer`. */ private queue; constructor(options: EmbeddedEdiabasOptions); /** * Lazily create the inner `Ediabas` once per `EmbeddedEdiabas` * instance, mirroring the original single-instance contract. * Re-calling `init()` is idempotent — it just ensures the * transport is connected; it never replaces the inner `Ediabas` * (doing so would drop loaded-SGBD / INITIALISIERUNG / group-cache * state and leak the previous transport). */ init(): Promise; end(): Promise; job(ecu: string, jobName: string, params?: string | Uint8Array | (string | Uint8Array)[]): Promise; private enqueue; resultSets(): number; resultText(name: string, set: number, _format?: string): string; resultInt(name: string, set: number): number; resultReal(name: string, set: number): number; resultBinary(name: string, set: number): number[]; resultFormat(name: string, set: number): EdiabasResultType | undefined; state(): EdiabasState; /** * Abort the currently-running job by forwarding `Ediabas.break()` * to the underlying interpreter (which throws `EDIABAS_BIP_0008` * at the next instruction boundary). Native EDIABAS `apiBreak` * semantics. * * Critical: this method **bypasses {@link enqueue}**. Routing it * through the same queue as `job()` would mean `break()` only * fires after the job it's trying to interrupt finishes, which * defeats the whole point. Calling `break()` while no job is in * flight is a no-op on the underlying `Ediabas` (the active- * interpreter pointer is null), so the timing race between "job * starting" and "break landing" is benign. */ break(): Promise; errorCode(): number; errorText(): string; private findResult; } /** * Coerce the public {@link IEdiabas.job} params union into the * `(string | Uint8Array)[]` shape `Ediabas.executeJob` expects. String * shorthand is split on `;` to preserve the apiJob convention; bare * `Uint8Array` becomes a single binary entry; arrays are passed * through untouched. The element type carries the channel: string → * indexed-string params (pari/pars), Uint8Array → binary payload * (pary/parb/parw/parl/parr). * * Exported for test reach; not part of the public surface. Callers * should drive `IEdiabas.job(...)` directly rather than reaching for * this helper. */ export declare function normalizeParams(params: string | Uint8Array | (string | Uint8Array)[] | undefined): (string | Uint8Array)[]; //# sourceMappingURL=embedded-ediabas.d.ts.map