24 lines
937 B
TypeScript
24 lines
937 B
TypeScript
/// <reference types="node" />
|
|
/// <reference types="node" />
|
|
import { Bert } from "./bert.js";
|
|
import { Duplex } from "node:stream";
|
|
type WriteCallback = (error: Error | null | undefined) => void;
|
|
type ServerHandlerCallback = (reply: "reply" | "noreply", ...extraArgs: any[]) => any;
|
|
type ServerHandler = (term: any, from: any, state: any, callback: ServerHandlerCallback) => void;
|
|
export declare class Port extends Duplex {
|
|
readonly bert: Bert;
|
|
private originalStdout;
|
|
private readonly fakeStdout;
|
|
constructor(allBinariesAsString?: boolean, mapKeyAsAtom?: boolean, decodeUndefinedValues?: boolean);
|
|
_read(): any;
|
|
_write(obj: any, encodingOrCallback?: BufferEncoding | WriteCallback, callback?: WriteCallback | undefined): boolean;
|
|
}
|
|
export declare class Server {
|
|
private port;
|
|
private handler;
|
|
private state;
|
|
private handleTerm;
|
|
constructor(port: Port, handler: ServerHandler);
|
|
}
|
|
export {};
|