/** * Callback hooks invoked during the transport lifecycle. */ export type TransportCallbacks = { /** Invoked when a transport connection is initialized. */ onInitialize: (message: any) => void; /** Invoked when a transport connection is finalized. */ onFinalize: (message: any) => void; /** Invoked when the transport receives a message. */ onMessage: (message: any) => void; }; /** Helper class for Python / Jupyter integration */ export declare class Transport { /** * Registers lifecycle callbacks shared by all transport instances. * @param callbacks Partial callback set to install. */ static setCallbacks({ onInitialize, onFinalize, onMessage }: Partial): void; /** Human-readable transport name. */ name: string; /** Queue of inbound messages received before callbacks are ready. */ _messageQueue: never[]; /** Arbitrary user data associated with the transport instance. */ userData: {}; /** Whether the transport has been finalized. */ _destroyed: boolean; /** * Creates a transport instance. * @param name Human-readable transport name. */ constructor(name?: string); /** * Return a root DOM element for this transport connection * @returns default implementation returns document.body * Jupyter Notebook transports will return an element associated with the notebook cell */ getRootDOMElement(): HTMLElement | null; /** * Sends a JSON message through the transport back-channel. */ sendJSONMessage(): void; /** * Sends a binary message through the transport back-channel. */ sendBinaryMessage(): void; /** * Marks the transport as initialized and emits the initialize callback. * @param options Additional payload fields merged into the callback message. */ _initialize(options?: {}): void; /** * Marks the transport as finalized and emits the finalize callback. * @param options Additional payload fields merged into the callback message. */ _finalize(options?: {}): void; /** * Delivers a received message to the registered message callback. * @param message Additional payload fields merged into the callback message. */ _messageReceived(message?: {}): void; /** * Serializes an object to JSON while tolerating circular references where possible. * @param v Value to serialize. * @returns A JSON string with cycles removed or deduplicated where possible. */ static _stringifyJSONSafe(v: any): string; } //# sourceMappingURL=transport.d.ts.map