Website Structure

This commit is contained in:
supalerk-ar66 2026-01-13 10:46:40 +07:00
parent 62812f2090
commit 71f0676a62
22365 changed files with 4265753 additions and 791 deletions

View file

@ -0,0 +1,17 @@
import type nodeNet from "node:net";
import { EventEmitter } from "node:events";
// Docs: https://nodejs.org/api/net.html#net_class_net_server
export declare class Server extends EventEmitter implements nodeNet.Server {
readonly __unenv__: true;
maxConnections: number;
connections: number;
readonly listening: boolean;
constructor(arg1?: nodeNet.ServerOpts | ((socket: nodeNet.Socket) => void), arg2?: (socket: nodeNet.Socket) => void);
listen(): this;
close(callback?: (err?: Error) => void): this;
address(): nodeNet.AddressInfo | string | null;
getConnections(cb: (error: Error | null, count: number) => void): void;
ref(): this;
unref(): this;
[Symbol.asyncDispose](): Promise<void>;
}

View file

@ -0,0 +1,33 @@
import { createNotImplementedError } from "../../../_internal/utils.mjs";
import { EventEmitter } from "node:events";
// Docs: https://nodejs.org/api/net.html#net_class_net_server
export class Server extends EventEmitter {
__unenv__ = true;
maxConnections = 1;
connections = 0;
listening = false;
constructor(arg1, arg2) {
super();
}
listen() {
throw createNotImplementedError("node:net.Server.listen()");
}
close(callback) {
throw createNotImplementedError("node:net.Server.close()");
}
address() {
return null;
}
getConnections(cb) {
cb(null, 0);
}
ref() {
return this;
}
unref() {
return this;
}
[Symbol.asyncDispose]() {
return Promise.resolve();
}
}

View file

@ -0,0 +1,45 @@
import type nodeNet from "node:net";
import { type Callback, type BufferEncoding } from "../../../_internal/types.mjs";
// Relative stream import required, see https://github.com/unjs/unenv/issues/353
import { Duplex } from "../stream/duplex.mjs";
// Docs: https://nodejs.org/api/net.html#net_class_net_socket
export declare class Socket extends Duplex implements nodeNet.Socket {
readonly __unenv__: true;
readonly bufferSize: number;
readonly bytesRead: number;
readonly bytesWritten: number;
readonly connecting: boolean;
readonly destroyed: boolean;
readonly pending: boolean;
readonly localAddress: string;
readonly localPort: number;
readonly remoteAddress?: string;
readonly remoteFamily?: string;
readonly remotePort?: number;
readonly autoSelectFamilyAttemptedAddresses: readonly [];
readonly readyState: nodeNet.SocketReadyState;
constructor(_options?: nodeNet.SocketConstructorOpts);
write(_buffer: Uint8Array | string, _arg1?: BufferEncoding | Callback<Error | undefined>, _arg2?: Callback<Error | undefined>): boolean;
connect(_arg1: number | string | nodeNet.SocketConnectOpts, _arg2?: string | Callback, _arg3?: Callback);
end(_arg1?: Callback | Uint8Array | string, _arg2?: BufferEncoding | Callback, _arg3?: Callback);
setEncoding(_encoding?: BufferEncoding): this;
pause();
resume();
setTimeout(_timeout: number, _callback?: Callback): this;
setNoDelay(_noDelay?: boolean): this;
setKeepAlive(_enable?: boolean, _initialDelay?: number): this;
address(): {};
unref();
ref();
destroySoon();
resetAndDestroy();
}
export declare class SocketAddress implements nodeNet.SocketAddress {
readonly __unenv__: true;
address: string;
family: "ipv4" | "ipv6";
port: number;
flowlabel: number;
static parse(_address: string, _port?: number): undefined;
constructor(options: nodeNet.SocketAddress);
}

View file

@ -0,0 +1,83 @@
// Relative stream import required, see https://github.com/unjs/unenv/issues/353
import { Duplex } from "../stream/duplex.mjs";
// Docs: https://nodejs.org/api/net.html#net_class_net_socket
export class Socket extends Duplex {
__unenv__ = true;
bufferSize = 0;
bytesRead = 0;
bytesWritten = 0;
connecting = false;
destroyed = false;
pending = false;
localAddress = "";
localPort = 0;
remoteAddress = "";
remoteFamily = "";
remotePort = 0;
autoSelectFamilyAttemptedAddresses = [];
readyState = "readOnly";
constructor(_options) {
super();
}
write(_buffer, _arg1, _arg2) {
return false;
}
connect(_arg1, _arg2, _arg3) {
return this;
}
end(_arg1, _arg2, _arg3) {
return this;
}
setEncoding(_encoding) {
return this;
}
pause() {
return this;
}
resume() {
return this;
}
setTimeout(_timeout, _callback) {
return this;
}
setNoDelay(_noDelay) {
return this;
}
setKeepAlive(_enable, _initialDelay) {
return this;
}
address() {
return {};
}
unref() {
return this;
}
ref() {
return this;
}
destroySoon() {
this.destroy();
}
resetAndDestroy() {
const err = new Error("ERR_SOCKET_CLOSED");
err.code = "ERR_SOCKET_CLOSED";
this.destroy(err);
return this;
}
}
export class SocketAddress {
__unenv__ = true;
address;
family;
port;
flowlabel;
static parse(_address, _port) {
return undefined;
}
constructor(options) {
this.address = options.address;
this.family = options.family;
this.port = options.port;
this.flowlabel = options.flowlabel;
}
}