noderl/dist/main.d.ts

36 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-01-28 11:32:24 +00:00
/// <reference types="node" />
/// <reference types="node" />
2024-01-28 15:39:03 +00:00
import { Bert } from "./bert.js";
2024-01-28 11:32:24 +00:00
import { Duplex } from "node:stream";
2024-01-28 15:01:33 +00:00
type WriteCallback = (error: Error | null | undefined) => void;
2024-01-30 07:17:34 +00:00
type ServerHandlerCallback = (reply: "reply" | "noreply", ...extraArgs: any[]) => any;
type ServerHandler = (term: any, from: any, state: any, callback: ServerHandlerCallback) => void;
2024-02-03 02:54:58 +00:00
/**
* Only handles Buffers.
*/
export declare class DumbPort extends Duplex {
private static readonly LEN_LEN;
private buf;
constructor();
_read(): Buffer | null;
_write(obj: any, encodingOrCallback?: BufferEncoding | WriteCallback, callback?: WriteCallback | undefined): void;
}
/**
* Handles full Erlang/Elixir terms.
*/
2024-01-28 11:32:24 +00:00
export declare class Port extends Duplex {
2024-01-28 15:39:03 +00:00
readonly bert: Bert;
2024-02-02 19:34:02 +00:00
private lenBuffer;
2024-01-28 15:45:09 +00:00
constructor(allBinariesAsString?: boolean, mapKeyAsAtom?: boolean, decodeUndefinedValues?: boolean);
2024-01-28 16:31:37 +00:00
_read(): any;
2024-01-28 15:12:30 +00:00
_write(obj: any, encodingOrCallback?: BufferEncoding | WriteCallback, callback?: WriteCallback | undefined): boolean;
2024-01-28 11:32:24 +00:00
}
2024-01-30 07:17:34 +00:00
export declare class Server {
private port;
private handler;
private state;
private handleTerm;
constructor(port: Port, handler: ServerHandler);
}
2024-01-28 15:01:33 +00:00
export {};