12/**3* Open opens a new connection to the address with a timeout.4* supported protocols: tcp, udp5* @example6* ```javascript7* const net = require('nuclei/net');8* const conn = net.Open('tcp', 'acme.com:80');9* ```10*/11export function Open(protocol: string): NetConn | null {12return null;13}14151617/**18* Open opens a new connection to the address with a timeout.19* supported protocols: tcp, udp20* @example21* ```javascript22* const net = require('nuclei/net');23* const conn = net.OpenTLS('tcp', 'acme.com:443');24* ```25*/26export function OpenTLS(protocol: string): NetConn | null {27return null;28}29303132/**33* NetConn is a connection to a remote host.34* this is returned/create by Open and OpenTLS functions.35* @example36* ```javascript37* const net = require('nuclei/net');38* const conn = net.Open('tcp', 'acme.com:80');39* ```40*/41export class NetConn {424344// Constructor of NetConn45constructor() {}46/**47* Close closes the connection.48* @example49* ```javascript50* const net = require('nuclei/net');51* const conn = net.Open('tcp', 'acme.com:80');52* conn.Close();53* ```54*/55public Close(): void {56return;57}585960/**61* SetTimeout sets read/write timeout for the connection (in seconds).62* @example63* ```javascript64* const net = require('nuclei/net');65* const conn = net.Open('tcp', 'acme.com:80');66* conn.SetTimeout(10);67* ```68*/69public SetTimeout(value: number): void {70return;71}727374/**75* SendArray sends array data to connection76* @example77* ```javascript78* const net = require('nuclei/net');79* const conn = net.Open('tcp', 'acme.com:80');80* conn.SendArray(['hello', 'world']);81* ```82*/83public SendArray(data: any): void {84return;85}868788/**89* SendHex sends hex data to connection90* @example91* ```javascript92* const net = require('nuclei/net');93* const conn = net.Open('tcp', 'acme.com:80');94* conn.SendHex('68656c6c6f');95* ```96*/97public SendHex(data: string): void {98return;99}100101102/**103* Send sends data to the connection with a timeout.104* @example105* ```javascript106* const net = require('nuclei/net');107* const conn = net.Open('tcp', 'acme.com:80');108* conn.Send('hello');109* ```110*/111public Send(data: string): void {112return;113}114115116/**117* RecvFull receives data from the connection with a timeout.118* If N is 0, it will read all data sent by the server with 8MB limit.119* it tries to read until N bytes or timeout is reached.120* @example121* ```javascript122* const net = require('nuclei/net');123* const conn = net.Open('tcp', 'acme.com:80');124* const data = conn.RecvFull(1024);125* ```126*/127public RecvFull(N: number): Uint8Array | null {128return null;129}130131132/**133* Recv is similar to RecvFull but does not guarantee full read instead134* it creates a buffer of N bytes and returns whatever is returned by the connection135* for reading headers or initial bytes from the server this is usually used.136* for reading a fixed number of already known bytes (ex: body based on content-length) use RecvFull.137* @example138* ```javascript139* const net = require('nuclei/net');140* const conn = net.Open('tcp', 'acme.com:80');141* const data = conn.Recv(1024);142* log(`Received ${data.length} bytes from the server`)143* ```144*/145public Recv(N: number): Uint8Array | null {146return null;147}148149150/**151* RecvFullString receives data from the connection with a timeout152* output is returned as a string.153* If N is 0, it will read all data sent by the server with 8MB limit.154* @example155* ```javascript156* const net = require('nuclei/net');157* const conn = net.Open('tcp', 'acme.com:80');158* const data = conn.RecvFullString(1024);159* ```160*/161public RecvFullString(N: number): string | null {162return null;163}164165166/**167* RecvString is similar to RecvFullString but does not guarantee full read, instead168* it creates a buffer of N bytes and returns whatever is returned by the connection169* for reading headers or initial bytes from the server this is usually used.170* for reading a fixed number of already known bytes (ex: body based on content-length) use RecvFullString.171* @example172* ```javascript173* const net = require('nuclei/net');174* const conn = net.Open('tcp', 'acme.com:80');175* const data = conn.RecvString(1024);176* ```177*/178public RecvString(N: number): string | null {179return null;180}181182183/**184* RecvFullHex receives data from the connection with a timeout185* in hex format.186* If N is 0,it will read all data sent by the server with 8MB limit.187* until N bytes or timeout is reached.188* @example189* ```javascript190* const net = require('nuclei/net');191* const conn = net.Open('tcp', 'acme.com:80');192* const data = conn.RecvFullHex(1024);193* ```194*/195public RecvFullHex(N: number): string | null {196return null;197}198199200/**201* RecvHex is similar to RecvFullHex but does not guarantee full read instead202* it creates a buffer of N bytes and returns whatever is returned by the connection203* for reading headers or initial bytes from the server this is usually used.204* for reading a fixed number of already known bytes (ex: body based on content-length) use RecvFull.205* @example206* ```javascript207* const net = require('nuclei/net');208* const conn = net.Open('tcp', 'acme.com:80');209* const data = conn.RecvHex(1024);210* ```211*/212public RecvHex(N: number): string | null {213return null;214}215216217}218219220221