@scelar/nodepod 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/__tests__/smoke.test.d.ts +1 -0
  2. package/dist/constants/cdn-urls.d.ts +12 -0
  3. package/dist/constants/config.d.ts +121 -0
  4. package/dist/cross-origin.d.ts +5 -0
  5. package/dist/engine-factory.d.ts +24 -0
  6. package/dist/engine-types.d.ts +40 -0
  7. package/dist/helpers/byte-encoding.d.ts +4 -0
  8. package/dist/helpers/digest.d.ts +1 -0
  9. package/dist/helpers/event-loop.d.ts +12 -0
  10. package/dist/helpers/wasm-cache.d.ts +6 -0
  11. package/dist/iframe-sandbox.d.ts +25 -0
  12. package/dist/index.d.ts +86 -0
  13. package/dist/isolation-helpers.d.ts +13 -0
  14. package/dist/memory-volume.d.ts +147 -0
  15. package/dist/module-transformer.d.ts +6 -0
  16. package/dist/packages/archive-extractor.d.ts +28 -0
  17. package/dist/packages/browser-bundler.d.ts +14 -0
  18. package/dist/packages/installer.d.ts +41 -0
  19. package/dist/packages/registry-client.d.ts +46 -0
  20. package/dist/packages/version-resolver.d.ts +37 -0
  21. package/dist/polyfills/assert.d.ts +54 -0
  22. package/dist/polyfills/async_hooks.d.ts +46 -0
  23. package/dist/polyfills/buffer.d.ts +111 -0
  24. package/dist/polyfills/child_process.d.ts +141 -0
  25. package/dist/polyfills/chokidar.d.ts +63 -0
  26. package/dist/polyfills/cluster.d.ts +55 -0
  27. package/dist/polyfills/console.d.ts +72 -0
  28. package/dist/polyfills/constants.d.ts +207 -0
  29. package/dist/polyfills/crypto.d.ts +189 -0
  30. package/dist/polyfills/dgram.d.ts +37 -0
  31. package/dist/polyfills/diagnostics_channel.d.ts +27 -0
  32. package/dist/polyfills/dns.d.ts +76 -0
  33. package/dist/polyfills/domain.d.ts +27 -0
  34. package/dist/polyfills/esbuild.d.ts +106 -0
  35. package/dist/polyfills/events.d.ts +39 -0
  36. package/dist/polyfills/fs.d.ts +274 -0
  37. package/dist/polyfills/fsevents.d.ts +62 -0
  38. package/dist/polyfills/http.d.ts +215 -0
  39. package/dist/polyfills/http2.d.ts +119 -0
  40. package/dist/polyfills/https.d.ts +24 -0
  41. package/dist/polyfills/inspector.d.ts +29 -0
  42. package/dist/polyfills/lightningcss.d.ts +70 -0
  43. package/dist/polyfills/module.d.ts +35 -0
  44. package/dist/polyfills/net.d.ts +91 -0
  45. package/dist/polyfills/os.d.ts +240 -0
  46. package/dist/polyfills/path.d.ts +95 -0
  47. package/dist/polyfills/perf_hooks.d.ts +48 -0
  48. package/dist/polyfills/process.d.ts +190 -0
  49. package/dist/polyfills/punycode.d.ts +21 -0
  50. package/dist/polyfills/querystring.d.ts +18 -0
  51. package/dist/polyfills/quic.d.ts +42 -0
  52. package/dist/polyfills/readdirp.d.ts +48 -0
  53. package/dist/polyfills/readline.d.ts +87 -0
  54. package/dist/polyfills/repl.d.ts +45 -0
  55. package/dist/polyfills/rollup.d.ts +37 -0
  56. package/dist/polyfills/sea.d.ts +11 -0
  57. package/dist/polyfills/sqlite.d.ts +30 -0
  58. package/dist/polyfills/stream.d.ts +160 -0
  59. package/dist/polyfills/string_decoder.d.ts +16 -0
  60. package/dist/polyfills/tailwindcss-oxide.d.ts +42 -0
  61. package/dist/polyfills/test.d.ts +60 -0
  62. package/dist/polyfills/timers.d.ts +23 -0
  63. package/dist/polyfills/tls.d.ts +61 -0
  64. package/dist/polyfills/trace_events.d.ts +22 -0
  65. package/dist/polyfills/tty.d.ts +38 -0
  66. package/dist/polyfills/url.d.ts +55 -0
  67. package/dist/polyfills/util.d.ts +135 -0
  68. package/dist/polyfills/v8.d.ts +97 -0
  69. package/dist/polyfills/vm.d.ts +66 -0
  70. package/dist/polyfills/volume-registry.d.ts +3 -0
  71. package/dist/polyfills/wasi.d.ts +16 -0
  72. package/dist/polyfills/worker_threads.d.ts +111 -0
  73. package/dist/polyfills/ws.d.ts +92 -0
  74. package/dist/polyfills/zlib.d.ts +278 -0
  75. package/dist/request-proxy.d.ts +63 -0
  76. package/dist/script-engine.d.ts +79 -0
  77. package/dist/sdk/nodepod-fs.d.ts +27 -0
  78. package/dist/sdk/nodepod-process.d.ts +28 -0
  79. package/dist/sdk/nodepod-terminal.d.ts +48 -0
  80. package/dist/sdk/nodepod.d.ts +39 -0
  81. package/dist/sdk/types.d.ts +53 -0
  82. package/dist/shell/commands/bun.d.ts +4 -0
  83. package/dist/shell/commands/directory.d.ts +2 -0
  84. package/dist/shell/commands/file-ops.d.ts +2 -0
  85. package/dist/shell/commands/git.d.ts +2 -0
  86. package/dist/shell/commands/node.d.ts +4 -0
  87. package/dist/shell/commands/npm.d.ts +3 -0
  88. package/dist/shell/commands/pm-types.d.ts +25 -0
  89. package/dist/shell/commands/pnpm.d.ts +3 -0
  90. package/dist/shell/commands/search.d.ts +2 -0
  91. package/dist/shell/commands/shell-env.d.ts +3 -0
  92. package/dist/shell/commands/text-processing.d.ts +2 -0
  93. package/dist/shell/commands/yarn.d.ts +3 -0
  94. package/dist/shell/shell-builtins.d.ts +2 -0
  95. package/dist/shell/shell-helpers.d.ts +28 -0
  96. package/dist/shell/shell-interpreter.d.ts +48 -0
  97. package/dist/shell/shell-parser.d.ts +6 -0
  98. package/dist/shell/shell-types.d.ts +48 -0
  99. package/dist/syntax-transforms.d.ts +3 -0
  100. package/dist/threading/engine-worker.d.ts +1 -0
  101. package/dist/threading/inline-worker.d.ts +2 -0
  102. package/dist/threading/offload-types.d.ts +87 -0
  103. package/dist/threading/offload-worker.d.ts +1 -0
  104. package/dist/threading/offload.d.ts +16 -0
  105. package/dist/threading/process-context.d.ts +40 -0
  106. package/dist/threading/process-handle.d.ts +42 -0
  107. package/dist/threading/process-manager.d.ts +52 -0
  108. package/dist/threading/process-worker-entry.d.ts +24 -0
  109. package/dist/threading/shared-vfs.d.ts +36 -0
  110. package/dist/threading/sync-channel.d.ts +21 -0
  111. package/dist/threading/task-queue.d.ts +15 -0
  112. package/dist/threading/vfs-bridge.d.ts +25 -0
  113. package/dist/threading/worker-pool.d.ts +38 -0
  114. package/dist/threading/worker-protocol.d.ts +264 -0
  115. package/dist/threading/worker-vfs.d.ts +34 -0
  116. package/dist/types/fs-streams.d.ts +122 -0
  117. package/dist/types/manifest.d.ts +17 -0
  118. package/dist/worker-sandbox.d.ts +19 -0
  119. package/package.json +1 -1
@@ -0,0 +1,37 @@
1
+ import { RegistryClient } from "./registry-client";
2
+ export interface ResolvedDependency {
3
+ name: string;
4
+ version: string;
5
+ tarballUrl: string;
6
+ dependencies: Record<string, string>;
7
+ }
8
+ export interface ResolutionConfig {
9
+ registry?: RegistryClient;
10
+ devDependencies?: boolean;
11
+ optionalDependencies?: boolean;
12
+ onProgress?: (msg: string) => void;
13
+ }
14
+ export interface SemverComponents {
15
+ major: number;
16
+ minor: number;
17
+ patch: number;
18
+ prerelease?: string;
19
+ }
20
+ export declare function parseSemver(raw: string): SemverComponents | null;
21
+ export declare function compareSemver(left: string, right: string): number;
22
+ export declare function satisfiesRange(version: string, range: string): boolean;
23
+ export declare function pickBestMatch(available: string[], range: string): string | null;
24
+ export declare function resolveDependencyTree(rootName: string, versionRange?: string, config?: ResolutionConfig): Promise<Map<string, ResolvedDependency>>;
25
+ export declare function resolveFromManifest(manifest: {
26
+ dependencies?: Record<string, string>;
27
+ devDependencies?: Record<string, string>;
28
+ }, config?: ResolutionConfig): Promise<Map<string, ResolvedDependency>>;
29
+ export declare class VersionResolver {
30
+ parse: typeof parseSemver;
31
+ compare: typeof compareSemver;
32
+ satisfies: typeof satisfiesRange;
33
+ pickBest: typeof pickBestMatch;
34
+ resolveTree: typeof resolveDependencyTree;
35
+ resolveManifest: typeof resolveFromManifest;
36
+ }
37
+ export default VersionResolver;
@@ -0,0 +1,54 @@
1
+ export interface AssertionError extends Error {
2
+ actual: unknown;
3
+ expected: unknown;
4
+ operator: string;
5
+ generatedMessage: boolean;
6
+ code: string;
7
+ }
8
+ interface AssertionErrorConstructor {
9
+ new (info: {
10
+ message?: string;
11
+ actual?: unknown;
12
+ expected?: unknown;
13
+ operator?: string;
14
+ stackStartFn?: Function;
15
+ }): AssertionError;
16
+ (this: any, info: {
17
+ message?: string;
18
+ actual?: unknown;
19
+ expected?: unknown;
20
+ operator?: string;
21
+ stackStartFn?: Function;
22
+ }): void;
23
+ prototype: any;
24
+ }
25
+ export declare const AssertionError: AssertionErrorConstructor;
26
+ declare function assert(value: unknown, message?: string | Error): asserts value;
27
+ declare namespace assert {
28
+ var ok: (value: unknown, message?: string | Error) => asserts value;
29
+ var equal: (actual: unknown, expected: unknown, message?: string | Error) => void;
30
+ var notEqual: (actual: unknown, expected: unknown, message?: string | Error) => void;
31
+ var strictEqual: (actual: unknown, expected: unknown, message?: string | Error) => void;
32
+ var notStrictEqual: (actual: unknown, expected: unknown, message?: string | Error) => void;
33
+ var deepEqual: <T>(actual: T, expected: T, message?: string | Error) => void;
34
+ var deepStrictEqual: <T>(actual: T, expected: T, message?: string | Error) => void;
35
+ var notDeepStrictEqual: <T>(actual: T, expected: T, message?: string | Error) => void;
36
+ var throws: (fn: () => unknown, validatorOrMsg?: RegExp | Function | Error | {
37
+ message?: RegExp | string;
38
+ code?: string;
39
+ } | string, msg?: string) => void;
40
+ var doesNotThrow: (fn: () => unknown, validatorOrMsg?: RegExp | Function | string, msg?: string) => void;
41
+ var rejects: (asyncFn: Promise<unknown> | (() => Promise<unknown>), validatorOrMsg?: RegExp | Function | Error | {
42
+ message?: RegExp | string;
43
+ code?: string;
44
+ } | string, msg?: string) => Promise<void>;
45
+ var doesNotReject: (asyncFn: Promise<unknown> | (() => Promise<unknown>), validatorOrMsg?: RegExp | Function | string, msg?: string) => Promise<void>;
46
+ var fail: (msgOrActual?: string | unknown, expected?: unknown, message?: string, operator?: string) => never;
47
+ var match: (str: string, re: RegExp, message?: string | Error) => void;
48
+ var doesNotMatch: (str: string, re: RegExp, message?: string | Error) => void;
49
+ var ifError: (value: unknown) => void;
50
+ var AssertionError: AssertionErrorConstructor;
51
+ var strict: typeof assert;
52
+ }
53
+ export default assert;
54
+ export { assert };
@@ -0,0 +1,46 @@
1
+ export interface AsyncResource {
2
+ runInAsyncScope<R>(fn: (...a: any[]) => R, thisArg?: unknown, ...args: any[]): R;
3
+ emitDestroy(): this;
4
+ asyncId(): number;
5
+ triggerAsyncId(): number;
6
+ }
7
+ export declare const AsyncResource: {
8
+ new (_kind: string, _opts?: object): AsyncResource;
9
+ prototype: any;
10
+ bind<F extends (...a: any[]) => any>(fn: F, _kind?: string): F;
11
+ };
12
+ export interface AsyncLocalStorage<T> {
13
+ disable(): void;
14
+ getStore(): T | undefined;
15
+ run<R>(store: T, fn: (...args: any[]) => R, ...args: any[]): R;
16
+ exit<R>(fn: (...args: any[]) => R, ...args: any[]): R;
17
+ enterWith(store: T): void;
18
+ }
19
+ export declare const AsyncLocalStorage: {
20
+ new <T>(): AsyncLocalStorage<T>;
21
+ prototype: any;
22
+ };
23
+ export interface AsyncHook {
24
+ enable(): AsyncHook;
25
+ disable(): AsyncHook;
26
+ }
27
+ export declare function createHook(_callbacks: object): AsyncHook;
28
+ export declare function executionAsyncId(): number;
29
+ export declare function executionAsyncResource(): object;
30
+ export declare function triggerAsyncId(): number;
31
+ declare const _default: {
32
+ AsyncResource: {
33
+ new (_kind: string, _opts?: object): AsyncResource;
34
+ prototype: any;
35
+ bind<F extends (...a: any[]) => any>(fn: F, _kind?: string): F;
36
+ };
37
+ AsyncLocalStorage: {
38
+ new <T>(): AsyncLocalStorage<T>;
39
+ prototype: any;
40
+ };
41
+ createHook: typeof createHook;
42
+ executionAsyncId: typeof executionAsyncId;
43
+ executionAsyncResource: typeof executionAsyncResource;
44
+ triggerAsyncId: typeof triggerAsyncId;
45
+ };
46
+ export default _default;
@@ -0,0 +1,111 @@
1
+ declare class BufferPolyfill extends Uint8Array {
2
+ static readonly BYTES_PER_ELEMENT = 1;
3
+ static from(source: ArrayLike<number>): BufferPolyfill;
4
+ static from<T>(source: ArrayLike<T>, mapper: (v: T, i: number) => number, ctx?: unknown): BufferPolyfill;
5
+ static from(source: string, enc?: string): BufferPolyfill;
6
+ static from(source: ArrayBuffer | Uint8Array): BufferPolyfill;
7
+ static from(source: Iterable<number>): BufferPolyfill;
8
+ static alloc(len: number, fillValue?: number): BufferPolyfill;
9
+ static allocUnsafe(len: number): BufferPolyfill;
10
+ static allocUnsafeSlow(len: number): BufferPolyfill;
11
+ static concat(list: (Uint8Array | BufferPolyfill)[]): BufferPolyfill;
12
+ static isBuffer(candidate: unknown): candidate is BufferPolyfill;
13
+ static isEncoding(enc: string): boolean;
14
+ static byteLength(text: string, enc?: string): number;
15
+ toString(enc?: BufferEncoding): string;
16
+ slice(begin?: number, end?: number): BufferPolyfill;
17
+ subarray(begin?: number, end?: number): BufferPolyfill;
18
+ write(string: string, encoding?: BufferEncoding): number;
19
+ write(string: string, offset: number, encoding?: BufferEncoding): number;
20
+ write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
21
+ copy(dest: BufferPolyfill, destStart?: number, srcStart?: number, srcEnd?: number): number;
22
+ compare(other: Uint8Array): number;
23
+ equals(other: Uint8Array): boolean;
24
+ toJSON(): {
25
+ type: string;
26
+ data: number[];
27
+ };
28
+ hasOwnProperty(key: PropertyKey): boolean;
29
+ indexOf(needle: number | Uint8Array | string, fromIndex?: number): number;
30
+ includes(needle: number | Uint8Array | string, fromIndex?: number): boolean;
31
+ readUInt8(pos: number): number;
32
+ readUInt16BE(pos: number): number;
33
+ readUInt16LE(pos: number): number;
34
+ readUInt32BE(pos: number): number;
35
+ readUInt32LE(pos: number): number;
36
+ writeUInt8(val: number, pos: number): number;
37
+ writeUInt16BE(val: number, pos: number): number;
38
+ writeUInt16LE(val: number, pos: number): number;
39
+ writeUInt32BE(val: number, pos: number): number;
40
+ writeUInt32LE(val: number, pos: number): number;
41
+ readUint8(pos: number): number;
42
+ readUint16BE(pos: number): number;
43
+ readUint16LE(pos: number): number;
44
+ readUint32BE(pos: number): number;
45
+ readUint32LE(pos: number): number;
46
+ writeUint8(val: number, pos: number): number;
47
+ writeUint16BE(val: number, pos: number): number;
48
+ writeUint16LE(val: number, pos: number): number;
49
+ writeUint32BE(val: number, pos: number): number;
50
+ writeUint32LE(val: number, pos: number): number;
51
+ readInt8(pos: number): number;
52
+ readInt16BE(pos: number): number;
53
+ readInt16LE(pos: number): number;
54
+ readInt32BE(pos: number): number;
55
+ readInt32LE(pos: number): number;
56
+ writeInt8(val: number, pos: number): number;
57
+ writeInt16BE(val: number, pos: number): number;
58
+ writeInt16LE(val: number, pos: number): number;
59
+ writeInt32BE(val: number, pos: number): number;
60
+ writeInt32LE(val: number, pos: number): number;
61
+ readBigUInt64LE(pos: number): bigint;
62
+ readBigUInt64BE(pos: number): bigint;
63
+ readBigInt64LE(pos: number): bigint;
64
+ readBigInt64BE(pos: number): bigint;
65
+ writeBigUInt64LE(val: bigint, pos: number): number;
66
+ writeBigUInt64BE(val: bigint, pos: number): number;
67
+ writeBigInt64LE(val: bigint, pos: number): number;
68
+ writeBigInt64BE(val: bigint, pos: number): number;
69
+ readBigUint64LE(pos: number): bigint;
70
+ readBigUint64BE(pos: number): bigint;
71
+ writeBigUint64LE(val: bigint, pos: number): number;
72
+ writeBigUint64BE(val: bigint, pos: number): number;
73
+ readFloatLE(pos: number): number;
74
+ readFloatBE(pos: number): number;
75
+ readDoubleLE(pos: number): number;
76
+ readDoubleBE(pos: number): number;
77
+ writeFloatLE(val: number, pos: number): number;
78
+ writeFloatBE(val: number, pos: number): number;
79
+ writeDoubleLE(val: number, pos: number): number;
80
+ writeDoubleBE(val: number, pos: number): number;
81
+ readUIntLE(pos: number, width: number): number;
82
+ readUintLE(pos: number, width: number): number;
83
+ readUIntBE(pos: number, width: number): number;
84
+ readUintBE(pos: number, width: number): number;
85
+ readIntLE(pos: number, width: number): number;
86
+ readIntBE(pos: number, width: number): number;
87
+ writeUIntLE(val: number, pos: number, width: number): number;
88
+ writeUintLE(val: number, pos: number, width: number): number;
89
+ writeUIntBE(val: number, pos: number, width: number): number;
90
+ writeUintBE(val: number, pos: number, width: number): number;
91
+ writeIntLE(val: number, pos: number, width: number): number;
92
+ writeIntBE(val: number, pos: number, width: number): number;
93
+ swap16(): this;
94
+ swap32(): this;
95
+ swap64(): this;
96
+ }
97
+ declare const Buffer: BufferConstructor & typeof BufferPolyfill;
98
+ export { Buffer };
99
+ export declare const SlowBuffer: BufferConstructor & typeof BufferPolyfill;
100
+ export declare const kMaxLength = 2147483647;
101
+ export declare const INSPECT_MAX_BYTES = 50;
102
+ export declare const constants: {
103
+ MAX_LENGTH: number;
104
+ MAX_STRING_LENGTH: number;
105
+ };
106
+ export declare function transcode(src: Uint8Array, _fromEnc: string, _toEnc: string): InstanceType<typeof BufferPolyfill>;
107
+ export declare function resolveObjectURL(_id: string): undefined;
108
+ export declare function atob(data: string): string;
109
+ export declare function btoa(data: string): string;
110
+ declare const bufferModule: Record<string, unknown>;
111
+ export default bufferModule;
@@ -0,0 +1,141 @@
1
+ import type { ShellResult, ShellContext } from "../shell/shell-types";
2
+ import { EventEmitter } from "./events";
3
+ import { Readable, Writable } from "./stream";
4
+ import type { MemoryVolume } from "../memory-volume";
5
+ import type { SyncChannelWorker } from "../threading/sync-channel";
6
+ export declare function setStreamingCallbacks(cfg: {
7
+ onStdout?: (t: string) => void;
8
+ onStderr?: (t: string) => void;
9
+ signal?: AbortSignal;
10
+ getCols?: () => number;
11
+ getRows?: () => number;
12
+ onRawModeChange?: (isRaw: boolean) => void;
13
+ }): void;
14
+ export declare function clearStreamingCallbacks(): void;
15
+ export declare function setSyncChannel(channel: SyncChannelWorker): void;
16
+ export type SpawnChildCallback = (command: string, args: string[], opts?: {
17
+ cwd?: string;
18
+ env?: Record<string, string>;
19
+ stdio?: "pipe" | "inherit";
20
+ onStdout?: (data: string) => void;
21
+ onStderr?: (data: string) => void;
22
+ }) => Promise<{
23
+ pid: number;
24
+ exitCode: number;
25
+ stdout: string;
26
+ stderr: string;
27
+ }>;
28
+ export declare function setSpawnChildCallback(fn: SpawnChildCallback): void;
29
+ export type ForkChildCallback = (modulePath: string, args: string[], opts: {
30
+ cwd: string;
31
+ env: Record<string, string>;
32
+ onStdout?: (data: string) => void;
33
+ onStderr?: (data: string) => void;
34
+ onIPC?: (data: unknown) => void;
35
+ onExit?: (exitCode: number) => void;
36
+ }) => {
37
+ sendIPC: (data: unknown) => void;
38
+ disconnect: () => void;
39
+ requestId: number;
40
+ };
41
+ export declare function setForkChildCallback(fn: ForkChildCallback): void;
42
+ export declare function setIPCSend(fn: (data: unknown) => void): void;
43
+ export declare function setIPCReceiveHandler(fn: (data: unknown) => void): void;
44
+ export declare function handleIPCFromParent(data: unknown): void;
45
+ export declare function getShellCwd(): string;
46
+ export declare function setShellCwd(dir: string): void;
47
+ export declare function shellExec(cmd: string, opts: {
48
+ cwd?: string;
49
+ env?: Record<string, string>;
50
+ }, callback: (error: Error | null, stdout: string, stderr: string) => void): void;
51
+ export declare function isStdinRaw(): boolean;
52
+ export declare function sendStdin(text: string): void;
53
+ export declare function initShellExec(volume: MemoryVolume, opts?: {
54
+ cwd?: string;
55
+ env?: Record<string, string>;
56
+ }): void;
57
+ export declare function executeNodeBinary(filePath: string, args: string[], ctx: ShellContext, opts?: {
58
+ isFork?: boolean;
59
+ workerThreadsOverride?: {
60
+ isMainThread: boolean;
61
+ parentPort: unknown;
62
+ workerData: unknown;
63
+ threadId: number;
64
+ };
65
+ }): Promise<ShellResult>;
66
+ export interface RunOptions {
67
+ cwd?: string;
68
+ env?: Record<string, string>;
69
+ encoding?: BufferEncoding | "buffer";
70
+ timeout?: number;
71
+ maxBuffer?: number;
72
+ shell?: string | boolean;
73
+ }
74
+ export type RunCallback = (err: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void;
75
+ export interface SpawnConfig {
76
+ cwd?: string;
77
+ env?: Record<string, string>;
78
+ shell?: boolean | string;
79
+ stdio?: "pipe" | "inherit" | "ignore" | Array<"pipe" | "inherit" | "ignore">;
80
+ }
81
+ export declare function exec(command: string, optsOrCb?: RunOptions | RunCallback, cb?: RunCallback): ShellProcess;
82
+ export declare function execSync(cmd: string, opts?: RunOptions): string | Buffer;
83
+ export declare function spawn(command: string, argsOrOpts?: string[] | SpawnConfig, opts?: SpawnConfig): ShellProcess;
84
+ export declare function spawnSync(cmd: string, args?: string[] | SpawnConfig, opts?: SpawnConfig): {
85
+ stdout: Buffer;
86
+ stderr: Buffer;
87
+ status: number;
88
+ signal: null;
89
+ pid: number;
90
+ output: [null, Buffer, Buffer];
91
+ error?: Error;
92
+ };
93
+ export declare function execFileSync(file: string, args?: string[], opts?: RunOptions): string | Buffer;
94
+ export declare function execFile(file: string, argsOrOpts?: string[] | RunOptions | RunCallback, optsOrCb?: RunOptions | RunCallback, cb?: RunCallback): ShellProcess;
95
+ export declare function fork(modulePath: string, argsOrOpts?: string[] | Record<string, unknown>, opts?: Record<string, unknown>): ShellProcess;
96
+ export interface ShellProcess extends EventEmitter {
97
+ pid: number;
98
+ connected: boolean;
99
+ killed: boolean;
100
+ exitCode: number | null;
101
+ signalCode: string | null;
102
+ spawnargs: string[];
103
+ spawnfile: string;
104
+ stdin: Writable | null;
105
+ stdout: Readable | null;
106
+ stderr: Readable | null;
107
+ kill(sig?: string): boolean;
108
+ disconnect(): void;
109
+ send(msg: unknown, cb?: (e: Error | null) => void): boolean;
110
+ ref(): this;
111
+ unref(): this;
112
+ }
113
+ interface ShellProcessConstructor {
114
+ new (): ShellProcess;
115
+ (this: any): void;
116
+ prototype: any;
117
+ }
118
+ export declare const ShellProcess: ShellProcessConstructor;
119
+ declare const _default: {
120
+ exec: typeof exec;
121
+ execSync: typeof execSync;
122
+ execFile: typeof execFile;
123
+ execFileSync: typeof execFileSync;
124
+ spawn: typeof spawn;
125
+ spawnSync: typeof spawnSync;
126
+ fork: typeof fork;
127
+ ShellProcess: ShellProcessConstructor;
128
+ initShellExec: typeof initShellExec;
129
+ shellExec: typeof shellExec;
130
+ setStreamingCallbacks: typeof setStreamingCallbacks;
131
+ clearStreamingCallbacks: typeof clearStreamingCallbacks;
132
+ sendStdin: typeof sendStdin;
133
+ setSyncChannel: typeof setSyncChannel;
134
+ setSpawnChildCallback: typeof setSpawnChildCallback;
135
+ setForkChildCallback: typeof setForkChildCallback;
136
+ setIPCSend: typeof setIPCSend;
137
+ setIPCReceiveHandler: typeof setIPCReceiveHandler;
138
+ handleIPCFromParent: typeof handleIPCFromParent;
139
+ executeNodeBinary: typeof executeNodeBinary;
140
+ };
141
+ export default _default;
@@ -0,0 +1,63 @@
1
+ import type { MemoryVolume, FileWatchHandle } from "../memory-volume";
2
+ export declare function setVolume(vol: MemoryVolume): void;
3
+ type Listener = (...args: unknown[]) => void;
4
+ interface MiniEmitter {
5
+ handlers: Map<string, Set<Listener>>;
6
+ on(name: string, fn: Listener): this;
7
+ off(name: string, fn: Listener): this;
8
+ fire(name: string, ...args: unknown[]): void;
9
+ }
10
+ interface MiniEmitterConstructor {
11
+ new (): MiniEmitter;
12
+ (this: any): void;
13
+ prototype: any;
14
+ }
15
+ declare const MiniEmitter: MiniEmitterConstructor;
16
+ export interface WatcherConfig {
17
+ persistent?: boolean;
18
+ ignored?: string | RegExp | ((p: string) => boolean) | Array<string | RegExp | ((p: string) => boolean)>;
19
+ ignoreInitial?: boolean;
20
+ followSymlinks?: boolean;
21
+ cwd?: string;
22
+ disableGlobbing?: boolean;
23
+ usePolling?: boolean;
24
+ interval?: number;
25
+ binaryInterval?: number;
26
+ alwaysStat?: boolean;
27
+ depth?: number;
28
+ awaitWriteFinish?: boolean | {
29
+ stabilityThreshold?: number;
30
+ pollInterval?: number;
31
+ };
32
+ ignorePermissionErrors?: boolean;
33
+ atomic?: boolean | number;
34
+ }
35
+ export interface PathWatcher extends MiniEmitter {
36
+ vol: MemoryVolume;
37
+ cfg: WatcherConfig;
38
+ handles: Map<string, FileWatchHandle>;
39
+ terminated: boolean;
40
+ initialised: boolean;
41
+ add(targets: string | readonly string[]): this;
42
+ unwatch(targets: string | readonly string[]): this;
43
+ close(): Promise<void>;
44
+ getWatched(): Record<string, string[]>;
45
+ resolvePath(raw: string): string;
46
+ isExcluded(target: string): boolean;
47
+ gatherInitial(dir: string, queue: Array<() => void>): void;
48
+ attachWatcher(target: string, filterFor?: string): void;
49
+ watchSubtree(dir: string, level?: number): void;
50
+ }
51
+ interface PathWatcherConstructor {
52
+ new (cfg?: WatcherConfig): PathWatcher;
53
+ (this: any, cfg?: WatcherConfig): void;
54
+ prototype: any;
55
+ }
56
+ export declare const PathWatcher: PathWatcherConstructor;
57
+ export declare function watch(targets: string | readonly string[], options?: WatcherConfig): PathWatcher;
58
+ declare const _default: {
59
+ watch: typeof watch;
60
+ PathWatcher: PathWatcherConstructor;
61
+ setVolume: typeof setVolume;
62
+ };
63
+ export default _default;
@@ -0,0 +1,55 @@
1
+ import { EventEmitter } from "./events";
2
+ export declare const isMaster = true;
3
+ export declare const isPrimary = true;
4
+ export declare const isWorker = false;
5
+ export interface Worker extends EventEmitter {
6
+ id: number;
7
+ process: null;
8
+ send(_msg: unknown, _cb?: (err: Error | null) => void): boolean;
9
+ kill(_sig?: string): void;
10
+ disconnect(): void;
11
+ isDead(): boolean;
12
+ isConnected(): boolean;
13
+ }
14
+ export declare const Worker: {
15
+ new (): Worker;
16
+ prototype: any;
17
+ };
18
+ export declare const worker: Worker | null;
19
+ export declare const workers: Record<number, Worker>;
20
+ export declare const settings: Record<string, unknown>;
21
+ export declare const SCHED_NONE = 1;
22
+ export declare const SCHED_RR = 2;
23
+ export declare let schedulingPolicy: number;
24
+ export declare function fork(_env?: object): Worker;
25
+ export declare function disconnect(done?: () => void): void;
26
+ export declare function setupMaster(_cfg?: object): void;
27
+ export declare function setupPrimary(_cfg?: object): void;
28
+ export declare const on: (name: string, handler: import("./events").EventHandler) => EventEmitter;
29
+ export declare const once: (name: string, handler: import("./events").EventHandler) => EventEmitter;
30
+ export declare const emit: (name: string, ...payload: unknown[]) => boolean;
31
+ export declare const removeListener: (name: string, handler: import("./events").EventHandler) => EventEmitter;
32
+ declare const _default: {
33
+ isMaster: boolean;
34
+ isPrimary: boolean;
35
+ isWorker: boolean;
36
+ Worker: {
37
+ new (): Worker;
38
+ prototype: any;
39
+ };
40
+ worker: null;
41
+ workers: Record<number, Worker>;
42
+ fork: typeof fork;
43
+ disconnect: typeof disconnect;
44
+ settings: Record<string, unknown>;
45
+ SCHED_NONE: number;
46
+ SCHED_RR: number;
47
+ schedulingPolicy: number;
48
+ setupMaster: typeof setupMaster;
49
+ setupPrimary: typeof setupPrimary;
50
+ on: (name: string, handler: import("./events").EventHandler) => EventEmitter;
51
+ once: (name: string, handler: import("./events").EventHandler) => EventEmitter;
52
+ emit: (name: string, ...payload: unknown[]) => boolean;
53
+ removeListener: (name: string, handler: import("./events").EventHandler) => EventEmitter;
54
+ };
55
+ export default _default;
@@ -0,0 +1,72 @@
1
+ export interface Console {
2
+ _out: {
3
+ write: (s: string) => void;
4
+ } | null;
5
+ _err: {
6
+ write: (s: string) => void;
7
+ } | null;
8
+ _emit(target: "out" | "err", args: unknown[]): void;
9
+ log(...a: unknown[]): void;
10
+ error(...a: unknown[]): void;
11
+ warn(...a: unknown[]): void;
12
+ info(...a: unknown[]): void;
13
+ debug(...a: unknown[]): void;
14
+ trace(...a: unknown[]): void;
15
+ dir(o: unknown): void;
16
+ time(): void;
17
+ timeEnd(): void;
18
+ timeLog(): void;
19
+ assert(v: unknown, ...a: unknown[]): void;
20
+ clear(): void;
21
+ count(): void;
22
+ countReset(): void;
23
+ group(): void;
24
+ groupCollapsed(): void;
25
+ groupEnd(): void;
26
+ table(d: unknown): void;
27
+ }
28
+ interface ConsoleConstructor {
29
+ new (stdout?: unknown, stderr?: unknown): Console;
30
+ (this: any, stdout?: unknown, stderr?: unknown): void;
31
+ prototype: any;
32
+ }
33
+ export declare const Console: ConsoleConstructor;
34
+ export declare const log: (...data: any[]) => void;
35
+ export declare const error: (...data: any[]) => void;
36
+ export declare const warn: (...data: any[]) => void;
37
+ export declare const info: (...data: any[]) => void;
38
+ export declare const debug: (...data: any[]) => void;
39
+ export declare const trace: (...data: any[]) => void;
40
+ export declare const dir: (item?: any, options?: any) => void;
41
+ export declare const time: (label?: string) => void;
42
+ export declare const timeEnd: (label?: string) => void;
43
+ export declare const timeLog: (label?: string, ...data: any[]) => void;
44
+ export declare const clear: () => void;
45
+ export declare const count: (label?: string) => void;
46
+ export declare const countReset: (label?: string) => void;
47
+ export declare const group: (...data: any[]) => void;
48
+ export declare const groupCollapsed: (...data: any[]) => void;
49
+ export declare const groupEnd: () => void;
50
+ export declare const table: (tabularData?: any, properties?: string[]) => void;
51
+ declare const _default: {
52
+ Console: ConsoleConstructor;
53
+ log: (...data: any[]) => void;
54
+ error: (...data: any[]) => void;
55
+ warn: (...data: any[]) => void;
56
+ info: (...data: any[]) => void;
57
+ debug: (...data: any[]) => void;
58
+ trace: (...data: any[]) => void;
59
+ dir: (item?: any, options?: any) => void;
60
+ time: (label?: string) => void;
61
+ timeEnd: (label?: string) => void;
62
+ timeLog: (label?: string, ...data: any[]) => void;
63
+ assert: (condition?: boolean, ...data: any[]) => void;
64
+ clear: () => void;
65
+ count: (label?: string) => void;
66
+ countReset: (label?: string) => void;
67
+ group: (...data: any[]) => void;
68
+ groupCollapsed: (...data: any[]) => void;
69
+ groupEnd: () => void;
70
+ table: (tabularData?: any, properties?: string[]) => void;
71
+ };
72
+ export default _default;