UNPKG

node-web-mvc

Version:
23 lines (22 loc) 949 B
import { AddressInfo, Socket } from 'net'; export interface WorkerSocketOptions { address: AddressInfo | {}; } export default class WorkerSocket extends Socket { private readonly myAddress; private invoker; private type; address(): AddressInfo | {}; constructor(port: MessagePort, type: 'requestSocket' | 'responseSocket', address?: AddressInfo | {}); private invoke; write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; end(cb?: () => void): this; end(chunk: Uint8Array | string, cb?: () => void): this; end(chunk: Uint8Array | string, encoding: BufferEncoding, cb?: () => void): this; setKeepAlive(enable?: boolean, initialDelay?: number): this; setNoDelay(noDelay?: boolean): this; setEncoding(encoding?: BufferEncoding): this; pause(): this; resume(): this; }