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,8 @@
import type nodeTty from "node:tty";
export declare class ReadStream implements Partial<nodeTty.ReadStream> {
fd: number;
isRaw: boolean;
isTTY: boolean;
constructor(fd: number);
setRawMode(mode: boolean): nodeTty.ReadStream;
}

View file

@ -0,0 +1,12 @@
export class ReadStream {
fd;
isRaw = false;
isTTY = false;
constructor(fd) {
this.fd = fd;
}
setRawMode(mode) {
this.isRaw = mode;
return this;
}
}

View file

@ -0,0 +1,20 @@
import type nodeTty from "node:tty";
export declare class WriteStream implements Partial<nodeTty.WriteStream> {
fd: number;
columns: number;
rows: number;
isTTY: boolean;
constructor(fd: number);
clearLine(dir: nodeTty.Direction, callback?: (() => void) | undefined): boolean;
clearScreenDown(callback?: (() => void) | undefined): boolean;
cursorTo(x: number, y?: number | undefined, callback?: (() => void) | undefined): boolean;
cursorTo(x: number, callback: () => void): boolean;
moveCursor(dx: number, dy: number, callback?: (() => void) | undefined): boolean;
getColorDepth(env?: object | undefined): number;
hasColors(count?: number | undefined): boolean;
hasColors(env?: object | undefined): boolean;
hasColors(count: number, env?: object | undefined): boolean;
getWindowSize(): [number, number];
write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean;
}

View file

@ -0,0 +1,44 @@
export class WriteStream {
fd;
columns = 80;
rows = 24;
isTTY = false;
constructor(fd) {
this.fd = fd;
}
clearLine(dir, callback) {
callback && callback();
return false;
}
clearScreenDown(callback) {
callback && callback();
return false;
}
cursorTo(x, y, callback) {
callback && typeof callback === "function" && callback();
return false;
}
moveCursor(dx, dy, callback) {
callback && callback();
return false;
}
getColorDepth(env) {
return 1;
}
hasColors(count, env) {
return false;
}
getWindowSize() {
return [this.columns, this.rows];
}
write(str, encoding, cb) {
if (str instanceof Uint8Array) {
str = new TextDecoder().decode(str);
}
try {
console.log(str);
} catch {}
cb && typeof cb === "function" && cb();
return false;
}
}