import type { IEdiabas, EdiabasJobResponse, EdiabasResultType, EdiabasState } from "@emdzej/ediabasx-core"; export type EdiabasClientTransport = "tcp" | "websocket"; export interface EdiabasClientOptions { host?: string; port?: number; transport?: EdiabasClientTransport; url?: string; /** Pre-connected WebSocket (e.g. from a Bimmerz Connect relay). Skips internal socket creation. */ socket?: WebSocket; onNotification?: (method: string, params: unknown) => void; } export declare class EdiabasClient implements IEdiabas { private readonly host; private readonly port; private readonly transport; private readonly url?; private readonly externalSocket?; private readonly onNotification?; private connection?; private nextId; private pending; private connectPromise?; private cachedResults; private cachedState; private cachedErrorCode; private cachedErrorText; constructor(options?: EdiabasClientOptions); init(): Promise; end(): Promise; job(ecu: string, jobName: string, params?: string | Uint8Array | (string | Uint8Array)[]): Promise; 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 in-flight job on the server. Sends a `break` JSON-RPC * request which the server dispatches inline (bypassing its * request queue) and forwards to the underlying `Ediabas.break()`. * The server's `job` call then rejects with `EDIABAS_BIP_0008` * once the interpreter reaches its next instruction boundary — * which surfaces here as that same rejection on the pending * `client.job(...)` promise. * * Cooperative cancel: an `xrecv` already in flight on the server * unwinds only when its timeout fires, so there's a worst-case * latency of `interface.timeoutMs` before the break takes effect. */ break(): Promise; errorCode(): number; errorText(): string; info(): Promise<{ connected: boolean; clients: number; host: string; port: number; transport: string; sgbdPath: string; }>; listSgbd(): Promise<{ name: string; ext: string; }[]>; listJobs(ecu: string): Promise<{ jobs: { name: string; comment?: string; argCount: number; resultCount: number; }[]; tableCount: number; }>; getJobMetadata(ecu: string, job: string): Promise<{ name: string; comment?: string; args: { name: string; type: string; comment?: string; }[]; results: { name: string; type: string; comment?: string; }[]; }>; disassembleJob(ecu: string, job: string): Promise<{ lines: string[]; }>; subscribeLogs(level?: string): Promise; unsubscribeLogs(): Promise; private ensureConnection; private connectTcp; private connectWebSocket; private attachExternalSocket; private handleLine; private handleTransportError; private handleTransportClose; private request; } /** * Mirror of `EmbeddedEdiabas`'s `normalizeParams`. Lives here so the * client doesn't pull on `@emdzej/ediabasx-client/embedded-ediabas`'s * inner Ediabas class (and its Node-only `node:fs` deps) when used in * a browser bundle. Exported for the JSON-RPC round-trip test only. */ export declare function normalizeClientParams(params: string | Uint8Array | (string | Uint8Array)[] | undefined): (string | Uint8Array)[]; /** * Encode one param entry for the JSON-RPC wire. Strings pass through * unchanged so a mixed-channel call reads naturally on the server * (`["abc", {binary: "..."}, "xyz"]`); `Uint8Array` becomes a tagged * `{binary: }` object — base64 because JSON has no binary * literal and we don't want to rely on `Buffer` (which doesn't exist * in browsers). Matches the decode in `ediabas-server.ts.handleJob`. * Exported so the symmetry test can drive it directly. */ export declare function encodeParamEntry(entry: string | Uint8Array): string | { binary: string; }; //# sourceMappingURL=ediabas-client.d.ts.map