@toruslabs/openlogin-jrpc
Version:
OpenLogin is a plug & play authentication suite that combines the simplicity of passwordless authentication with the security of non-custodial public key infrastructure (PKI).
23 lines (22 loc) • 873 B
TypeScript
/// <reference types="node" />
import { Duplex } from "readable-stream";
import type { Readable, Writable } from "stream";
import { BufferEncoding } from "./interfaces";
import Substream from "./substream";
export declare const IGNORE_SUBSTREAM: unique symbol;
export type Stream = Readable | Writable;
interface Chunk {
name: string;
data: unknown;
}
export declare class ObjectMultiplex extends Duplex {
_substreams: Record<string, Substream | typeof IGNORE_SUBSTREAM>;
getStream: (name: string) => Substream | symbol;
constructor(opts?: Record<string, unknown>);
createStream(name: string): Substream;
ignoreStream(name: string): void;
_read(): void;
_write(chunk: Chunk, _encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
}
export declare function setupMultiplex(stream: Duplex): ObjectMultiplex;
export {};