23 lines
899 B
TypeScript
23 lines
899 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 lenBuffer;
|
|
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 {};
|