@monaco-neovim-wasm/lib 0.1.6
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.
- package/README.md +3 -0
- package/dist/index.d.ts +6 -0
- package/dist/monaco-neovim-wasm.es.js +2901 -0
- package/dist/monacoNeovim.d.ts +262 -0
- package/dist/msgpack-BSNDwQ9a.js +1351 -0
- package/dist/msgpack.d.ts +19 -0
- package/dist/neovimWasmSession.d.ts +69 -0
- package/dist/nvimWorker.d.ts +1 -0
- package/dist/nvimWorker.js +330 -0
- package/dist/nvimWorkerAsyncify.d.ts +1 -0
- package/dist/nvimWorkerAsyncify.js +461 -0
- package/dist/sharedInput.d.ts +10 -0
- package/package.json +34 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type MsgpackExt = {
|
|
2
|
+
type: number;
|
|
3
|
+
data: Uint8Array;
|
|
4
|
+
};
|
|
5
|
+
type MsgpackPrimitive = null | boolean | number | bigint | string | Uint8Array | MsgpackExt;
|
|
6
|
+
interface MsgpackValueArray extends Array<MsgpackValue> {
|
|
7
|
+
}
|
|
8
|
+
interface MsgpackValueMap {
|
|
9
|
+
[key: string]: MsgpackValue;
|
|
10
|
+
}
|
|
11
|
+
export type MsgpackValue = MsgpackPrimitive | MsgpackValueArray | MsgpackValueMap;
|
|
12
|
+
export declare function encode(value: MsgpackValue): Uint8Array;
|
|
13
|
+
export declare class Decoder {
|
|
14
|
+
private buffer;
|
|
15
|
+
private readonly onMessage;
|
|
16
|
+
constructor(onMessage: (value: MsgpackValue) => void);
|
|
17
|
+
push(chunk: Uint8Array): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export type NeovimWasmSessionHandlers = {
|
|
2
|
+
onNotify?: (method: string, params: unknown[]) => void;
|
|
3
|
+
onRequest?: (msgid: number, method: string, params: unknown[]) => void;
|
|
4
|
+
onClipboardCopy?: (lines: string[], regtype: string) => void;
|
|
5
|
+
onClipboardPaste?: (msgid: number) => void;
|
|
6
|
+
onStderr?: (message?: string) => void;
|
|
7
|
+
onStartError?: (message?: string) => void;
|
|
8
|
+
onExit?: (code: number, lastStderr?: string) => void;
|
|
9
|
+
onWarning?: (message: string) => void;
|
|
10
|
+
};
|
|
11
|
+
export type NeovimWasmInputMode = "shared" | "message";
|
|
12
|
+
export type NeovimWasmSessionInit = {
|
|
13
|
+
worker?: Worker | null;
|
|
14
|
+
workerUrl?: URL;
|
|
15
|
+
createWorker?: (() => Worker) | null;
|
|
16
|
+
sharedInputBytes?: number;
|
|
17
|
+
inputMode?: NeovimWasmInputMode;
|
|
18
|
+
rpcTimeoutMs?: number;
|
|
19
|
+
maxQueuedBytes?: number;
|
|
20
|
+
reuseWorker?: boolean;
|
|
21
|
+
handlers?: NeovimWasmSessionHandlers;
|
|
22
|
+
};
|
|
23
|
+
export type NeovimWasmSessionStartOptions = {
|
|
24
|
+
cols: number;
|
|
25
|
+
rows: number;
|
|
26
|
+
wasmPath: string;
|
|
27
|
+
runtimePath: string;
|
|
28
|
+
env?: Record<string, string>;
|
|
29
|
+
files?: Array<{
|
|
30
|
+
path: string;
|
|
31
|
+
data: Uint8Array;
|
|
32
|
+
}>;
|
|
33
|
+
inputMode?: NeovimWasmInputMode;
|
|
34
|
+
};
|
|
35
|
+
export declare function isSharedArrayBufferAvailable(): boolean;
|
|
36
|
+
export declare class NeovimWasmSession {
|
|
37
|
+
private readonly init;
|
|
38
|
+
private worker;
|
|
39
|
+
private sharedInput;
|
|
40
|
+
private inputMode;
|
|
41
|
+
private reqId;
|
|
42
|
+
private readonly pending;
|
|
43
|
+
private workerExited;
|
|
44
|
+
private workerExitCode;
|
|
45
|
+
private inputQueue;
|
|
46
|
+
private inputQueueHead;
|
|
47
|
+
private inputQueuedBytes;
|
|
48
|
+
private inputFlushTimer;
|
|
49
|
+
constructor(init?: NeovimWasmSessionInit);
|
|
50
|
+
setHandlers(handlers: NeovimWasmSessionHandlers): void;
|
|
51
|
+
isRunning(): boolean;
|
|
52
|
+
getExitCode(): number | null;
|
|
53
|
+
start(options: NeovimWasmSessionStartOptions): Promise<void>;
|
|
54
|
+
stop(opts?: {
|
|
55
|
+
terminate?: boolean;
|
|
56
|
+
silent?: boolean;
|
|
57
|
+
}): void;
|
|
58
|
+
dispose(): void;
|
|
59
|
+
notify(method: string, params?: unknown[]): void;
|
|
60
|
+
call<T = unknown>(method: string, params?: unknown[]): Promise<T>;
|
|
61
|
+
waitForApi(): Promise<void>;
|
|
62
|
+
respond(msgid: number, error: unknown, result: unknown): void;
|
|
63
|
+
private handleWorkerMessage;
|
|
64
|
+
private postInput;
|
|
65
|
+
private enqueueInput;
|
|
66
|
+
private scheduleFlushInput;
|
|
67
|
+
private flushInputQueue;
|
|
68
|
+
private postStdin;
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { W as Y, g as J, D as M, F as P, a as $, P as N, E as K, b as C, c as j, R as Q, d as G, e as m, f as L, h as w, i as H } from "./msgpack-BSNDwQ9a.js";
|
|
2
|
+
let v = null, f = null, U = null;
|
|
3
|
+
const Z = new TextDecoder();
|
|
4
|
+
let E = "", R = !1, g = null, A = null;
|
|
5
|
+
self.addEventListener("error", (n) => {
|
|
6
|
+
if (R) return;
|
|
7
|
+
R = !0;
|
|
8
|
+
const t = n.message || String(n.error || "worker error"), e = n.error?.stack;
|
|
9
|
+
try {
|
|
10
|
+
postMessage({ type: "start-error", message: e ? `${t}
|
|
11
|
+
${e}` : t }), postMessage({ type: "exit", code: 1, lastStderr: E });
|
|
12
|
+
} catch {
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
self.addEventListener("unhandledrejection", (n) => {
|
|
16
|
+
if (R) return;
|
|
17
|
+
R = !0;
|
|
18
|
+
const t = n.reason, e = t && (t.message || String(t)) || "unhandled rejection", r = t?.stack;
|
|
19
|
+
try {
|
|
20
|
+
postMessage({ type: "start-error", message: r ? `${e}
|
|
21
|
+
${r}` : e }), postMessage({ type: "exit", code: 1, lastStderr: E });
|
|
22
|
+
} catch {
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
self.onmessage = (n) => {
|
|
26
|
+
const { type: t } = n.data || {};
|
|
27
|
+
if (t === "start")
|
|
28
|
+
et(n.data).catch((e) => {
|
|
29
|
+
postMessage({ type: "start-error", message: e?.message || String(e) }), postMessage({ type: "exit", code: 1 });
|
|
30
|
+
});
|
|
31
|
+
else if (t === "stop") {
|
|
32
|
+
try {
|
|
33
|
+
f?.wasiImport?.proc_exit?.(0);
|
|
34
|
+
} catch {
|
|
35
|
+
}
|
|
36
|
+
U = null;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
class tt extends C {
|
|
40
|
+
ctrl;
|
|
41
|
+
data;
|
|
42
|
+
capacity;
|
|
43
|
+
constructor(t) {
|
|
44
|
+
super(), this.ctrl = new Int32Array(t, 0, 2), this.data = new Uint8Array(t, 8), this.capacity = this.data.length;
|
|
45
|
+
}
|
|
46
|
+
fd_fdstat_get() {
|
|
47
|
+
const t = new j(H, 0);
|
|
48
|
+
return t.fs_rights_base = BigInt(Q | G), { ret: m, fdstat: t };
|
|
49
|
+
}
|
|
50
|
+
fd_close() {
|
|
51
|
+
return m;
|
|
52
|
+
}
|
|
53
|
+
fd_read(t) {
|
|
54
|
+
const e = Math.min(Math.max(0, Number(t) || 0), this.capacity);
|
|
55
|
+
if (e === 0) return { ret: L, data: new Uint8Array() };
|
|
56
|
+
let r = Atomics.load(this.ctrl, 0);
|
|
57
|
+
const s = Atomics.load(this.ctrl, 1);
|
|
58
|
+
if (r === s) return { ret: L, data: new Uint8Array() };
|
|
59
|
+
const a = new Uint8Array(e);
|
|
60
|
+
let o = 0;
|
|
61
|
+
for (; r !== s && o < e; )
|
|
62
|
+
a[o++] = this.data[r], r = (r + 1) % this.capacity;
|
|
63
|
+
return Atomics.store(this.ctrl, 0, r), { ret: m, data: a.slice(0, o) };
|
|
64
|
+
}
|
|
65
|
+
fd_write() {
|
|
66
|
+
return { ret: w, nwritten: 0 };
|
|
67
|
+
}
|
|
68
|
+
fd_seek() {
|
|
69
|
+
return { ret: w, offset: 0n };
|
|
70
|
+
}
|
|
71
|
+
fd_tell() {
|
|
72
|
+
return { ret: w, offset: 0n };
|
|
73
|
+
}
|
|
74
|
+
fd_pread() {
|
|
75
|
+
return { ret: w, data: new Uint8Array() };
|
|
76
|
+
}
|
|
77
|
+
fd_pwrite() {
|
|
78
|
+
return { ret: w, nwritten: 0 };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
class O extends C {
|
|
82
|
+
onWrite;
|
|
83
|
+
constructor(t) {
|
|
84
|
+
super(), this.onWrite = t;
|
|
85
|
+
}
|
|
86
|
+
fd_fdstat_get() {
|
|
87
|
+
const t = new j(H, 0);
|
|
88
|
+
return t.fs_rights_base = BigInt(G), { ret: m, fdstat: t };
|
|
89
|
+
}
|
|
90
|
+
fd_write(t) {
|
|
91
|
+
return this.onWrite(new Uint8Array(t)), { ret: m, nwritten: t.byteLength };
|
|
92
|
+
}
|
|
93
|
+
fd_close() {
|
|
94
|
+
return m;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async function et({ cols: n, rows: t, wasmPath: e, runtimePath: r, inputBuffer: s, env: a, files: o }) {
|
|
98
|
+
let c = 1;
|
|
99
|
+
try {
|
|
100
|
+
if (!s) {
|
|
101
|
+
postMessage({ type: "start-error", message: "input buffer missing" }), postMessage({ type: "exit", code: 1 });
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
v = null, U = new tt(s);
|
|
105
|
+
const l = await nt(e), i = await rt(r), p = lt(i, () => {
|
|
106
|
+
});
|
|
107
|
+
o && Array.isArray(o) && o.length && st(p, o);
|
|
108
|
+
const u = U, k = new O(at), d = new O((S) => {
|
|
109
|
+
const y = Z.decode(S);
|
|
110
|
+
y && (E = (E + y).slice(-8192)), postMessage({ type: "stderr", message: y });
|
|
111
|
+
}), _ = new W("nvim", p.contents), D = p.contents.get("tmp")?.contents || /* @__PURE__ */ new Map(), h = new W("tmp", D), X = ["nvim", "--headless", "--embed", "-u", "NORC", "--noplugin", "-i", "NONE", "-n"], F = [
|
|
112
|
+
"VIMRUNTIME=/nvim/runtime",
|
|
113
|
+
"HOME=/nvim/home",
|
|
114
|
+
"PWD=/nvim",
|
|
115
|
+
"XDG_CONFIG_HOME=/nvim/home/.config",
|
|
116
|
+
"XDG_DATA_HOME=/nvim/home/.local/share",
|
|
117
|
+
"XDG_STATE_HOME=/nvim/home/.local/state",
|
|
118
|
+
"PATH=/usr/bin:/bin",
|
|
119
|
+
"TMPDIR=/nvim/tmp",
|
|
120
|
+
`COLUMNS=${n || 120}`,
|
|
121
|
+
`LINES=${t || 40}`
|
|
122
|
+
];
|
|
123
|
+
if (a && typeof a == "object")
|
|
124
|
+
for (const [S, y] of Object.entries(a))
|
|
125
|
+
S && F.push(`${S}=${String(y ?? "")}`);
|
|
126
|
+
f = new Y(X, F, [u, k, d, _, h], { debug: !1 }), f.fds[0] = u, f.fds[1] = k, f.fds[2] = d, f.fds[3] = _, f.fds[4] = h, f.preopens = { "/nvim": _, "/tmp": h };
|
|
127
|
+
const q = pt(() => f?.wasiImport?.proc_exit?.(1)), T = await WebAssembly.instantiate(l, {
|
|
128
|
+
wasi_snapshot_preview1: f.wasiImport,
|
|
129
|
+
env: q
|
|
130
|
+
}), V = T.instance ?? T.instance;
|
|
131
|
+
c = f.start(V);
|
|
132
|
+
} catch (l) {
|
|
133
|
+
const i = l?.message || String(l), p = l?.stack;
|
|
134
|
+
postMessage({ type: "start-error", message: p ? `${i}
|
|
135
|
+
${p}` : i });
|
|
136
|
+
}
|
|
137
|
+
postMessage({ type: "exit", code: c, lastStderr: E });
|
|
138
|
+
}
|
|
139
|
+
async function nt(n) {
|
|
140
|
+
if (g && g.url === n && g.bytes?.byteLength) return g.bytes;
|
|
141
|
+
const t = await z(n);
|
|
142
|
+
return g = { url: n, bytes: t }, t;
|
|
143
|
+
}
|
|
144
|
+
async function rt(n) {
|
|
145
|
+
if (A && A.url === n && A.entries?.length) return A.entries;
|
|
146
|
+
const t = await z(n);
|
|
147
|
+
let e;
|
|
148
|
+
if (it(t))
|
|
149
|
+
try {
|
|
150
|
+
e = J(t);
|
|
151
|
+
} catch (s) {
|
|
152
|
+
throw new Error(`gunzip runtime failed: ${s?.message ?? s}`);
|
|
153
|
+
}
|
|
154
|
+
else
|
|
155
|
+
e = t;
|
|
156
|
+
let r;
|
|
157
|
+
try {
|
|
158
|
+
r = ct(e);
|
|
159
|
+
} catch (s) {
|
|
160
|
+
throw new Error(`untar runtime failed: ${s?.message ?? s}`);
|
|
161
|
+
}
|
|
162
|
+
return A = { url: n, entries: r }, r;
|
|
163
|
+
}
|
|
164
|
+
function st(n, t) {
|
|
165
|
+
for (const e of t) {
|
|
166
|
+
const s = String(e?.path ?? "").replace(/^\/+/, "").replace(/^\.\/+/, "");
|
|
167
|
+
if (!s || s.endsWith("/")) continue;
|
|
168
|
+
const a = ot(e?.data);
|
|
169
|
+
if (!a) continue;
|
|
170
|
+
const o = s.split("/").filter(Boolean);
|
|
171
|
+
if (!o.length) continue;
|
|
172
|
+
let c = n;
|
|
173
|
+
for (let i = 0; i < o.length - 1; i += 1) {
|
|
174
|
+
const p = o[i];
|
|
175
|
+
c.contents.has(p) || c.contents.set(p, new M(/* @__PURE__ */ new Map())), c = c.contents.get(p);
|
|
176
|
+
}
|
|
177
|
+
const l = o[o.length - 1];
|
|
178
|
+
c.contents.set(l, new P(a, { readonly: !1 }));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function ot(n) {
|
|
182
|
+
if (!n) return new Uint8Array();
|
|
183
|
+
if (n instanceof Uint8Array) return n;
|
|
184
|
+
if (n instanceof ArrayBuffer) return new Uint8Array(n);
|
|
185
|
+
if (n instanceof SharedArrayBuffer) return new Uint8Array(n);
|
|
186
|
+
if (Array.isArray(n)) return new Uint8Array(n);
|
|
187
|
+
if (n && n.type === "Buffer" && Array.isArray(n.data)) return new Uint8Array(n.data);
|
|
188
|
+
try {
|
|
189
|
+
return new TextEncoder().encode(String(n));
|
|
190
|
+
} catch {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function at(n) {
|
|
195
|
+
v || (v = new $(B));
|
|
196
|
+
try {
|
|
197
|
+
v.push(n);
|
|
198
|
+
} catch {
|
|
199
|
+
v = new $(B);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function B(n) {
|
|
203
|
+
if (!Array.isArray(n) || n.length < 1) return;
|
|
204
|
+
const t = n[0];
|
|
205
|
+
if (t === 0) {
|
|
206
|
+
const [, e, r, s] = n;
|
|
207
|
+
postMessage(r === "wasm-clipboard-paste" ? { type: "clipboard-paste", msgid: e } : { type: "rpc-request", msgid: e, method: r, params: s });
|
|
208
|
+
} else if (t === 1) {
|
|
209
|
+
const [, e, r, s] = n;
|
|
210
|
+
postMessage({ type: "rpc-response", msgid: e, error: r, result: s });
|
|
211
|
+
} else if (t === 2) {
|
|
212
|
+
const [, e, r] = n;
|
|
213
|
+
if (e === "wasm-clipboard-copy") {
|
|
214
|
+
const s = Array.isArray(r?.[0]) ? r[0] : [], a = typeof r?.[1] == "string" ? r[1] : "v";
|
|
215
|
+
postMessage({ type: "clipboard-copy", lines: s, regtype: a });
|
|
216
|
+
} else (e === "nvim_buf_lines_event" || e === "nvim_buf_detach_event" || e === "redraw" || e === "monaco_cursor" || e === "monaco_mode" || e === "monaco_cursorMove" || e === "monaco_scroll" || e === "monaco_reveal" || e === "monaco_moveCursor" || e === "monaco_scrolloff" || e === "monaco_host_command" || e === "monaco_buf_enter" || e === "monaco_buf_delete") && postMessage({ type: "rpc-notify", method: e, params: r });
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
async function z(n) {
|
|
220
|
+
const t = await fetch(n);
|
|
221
|
+
if (!t.ok) throw new Error(`fetch ${n} failed (${t.status})`);
|
|
222
|
+
if ((t.headers.get("content-type") || "").toLowerCase().includes("text/html")) throw new Error(`fetch ${n} returned HTML (likely wrong path or dev server fallback)`);
|
|
223
|
+
const r = new Uint8Array(await t.arrayBuffer());
|
|
224
|
+
if (!r.byteLength) throw new Error(`fetch ${n} returned empty body`);
|
|
225
|
+
return r;
|
|
226
|
+
}
|
|
227
|
+
function it(n) {
|
|
228
|
+
return n && n.length >= 2 && n[0] === 31 && n[1] === 139;
|
|
229
|
+
}
|
|
230
|
+
function ct(n) {
|
|
231
|
+
const t = [], e = n instanceof Uint8Array ? n : new Uint8Array(n);
|
|
232
|
+
let r = 0;
|
|
233
|
+
const s = new TextDecoder();
|
|
234
|
+
let a = 0;
|
|
235
|
+
for (; r + 512 <= e.length; ) {
|
|
236
|
+
if (a++ > 1e5) throw new Error("untar safety break");
|
|
237
|
+
const o = I(s, e, r, 100), c = I(s, e, r + 124, 12), l = e[r + 156], i = I(s, e, r + 345, 155);
|
|
238
|
+
if (!o && !i) break;
|
|
239
|
+
const p = c.trim() || "0", u = parseInt(p, 8);
|
|
240
|
+
if (!Number.isFinite(u) || u < 0) throw new Error(`invalid tar size: ${p}`);
|
|
241
|
+
const k = i ? `${i}/${o}` : o, d = r + 512, _ = d + u, x = e.slice(d, _);
|
|
242
|
+
t.push({ name: k, type: l === 53 ? "dir" : "file", data: x });
|
|
243
|
+
const D = Math.ceil(u / 512), h = d + D * 512;
|
|
244
|
+
if (h <= r) throw new Error("tar parse did not advance");
|
|
245
|
+
r = h;
|
|
246
|
+
}
|
|
247
|
+
return t;
|
|
248
|
+
}
|
|
249
|
+
function I(n, t, e, r) {
|
|
250
|
+
let s = e;
|
|
251
|
+
const a = e + r;
|
|
252
|
+
for (; s < a && t[s] !== 0; ) s += 1;
|
|
253
|
+
return n.decode(t.subarray(e, s)).trim();
|
|
254
|
+
}
|
|
255
|
+
function lt(n, t) {
|
|
256
|
+
const e = new M(/* @__PURE__ */ new Map());
|
|
257
|
+
for (const r of n) {
|
|
258
|
+
const s = r.name.replace(/^\.\/?/, "");
|
|
259
|
+
if (!s) continue;
|
|
260
|
+
const a = s.split("/").filter(Boolean);
|
|
261
|
+
if (!a.length) continue;
|
|
262
|
+
let o = e;
|
|
263
|
+
for (let l = 0; l < a.length - 1; l += 1) {
|
|
264
|
+
const i = a[l];
|
|
265
|
+
o.contents.has(i) || o.contents.set(i, new M(/* @__PURE__ */ new Map())), o = o.contents.get(i);
|
|
266
|
+
}
|
|
267
|
+
const c = a[a.length - 1];
|
|
268
|
+
r.type === "dir" ? o.contents.has(c) || o.contents.set(c, new M(/* @__PURE__ */ new Map())) : o.contents.set(c, new P(r.data, { readonly: !0 }));
|
|
269
|
+
}
|
|
270
|
+
return b(e, "home"), b(e, "tmp"), b(e, "home/.config"), b(e, "home/.local/share"), b(e, "home/.local/state"), e;
|
|
271
|
+
}
|
|
272
|
+
function b(n, t) {
|
|
273
|
+
const e = t.split("/").filter(Boolean);
|
|
274
|
+
let r = n;
|
|
275
|
+
for (const s of e)
|
|
276
|
+
r.contents.has(s) || r.contents.set(s, new M(/* @__PURE__ */ new Map())), r = r.contents.get(s);
|
|
277
|
+
}
|
|
278
|
+
function pt(n) {
|
|
279
|
+
const t = WebAssembly, e = new t.Tag({ parameters: ["i32"], results: [] });
|
|
280
|
+
return {
|
|
281
|
+
flock: () => 0,
|
|
282
|
+
getpid: () => 1,
|
|
283
|
+
uv_random: () => -38,
|
|
284
|
+
uv_wtf8_to_utf16: () => {
|
|
285
|
+
},
|
|
286
|
+
uv_utf16_length_as_wtf8: () => 0,
|
|
287
|
+
uv_utf16_to_wtf8: () => -38,
|
|
288
|
+
uv_wtf8_length_as_utf16: () => 0,
|
|
289
|
+
__wasm_longjmp: (r) => {
|
|
290
|
+
throw n && n(1), new t.Exception(e, [r ?? 0]);
|
|
291
|
+
},
|
|
292
|
+
__wasm_setjmp: () => 0,
|
|
293
|
+
__wasm_setjmp_test: () => 0,
|
|
294
|
+
tmpfile: () => 0,
|
|
295
|
+
clock: () => 0,
|
|
296
|
+
system: () => -1,
|
|
297
|
+
tmpnam: () => 0,
|
|
298
|
+
__c_longjmp: e
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
class W extends N {
|
|
302
|
+
#t(t) {
|
|
303
|
+
return t.replace(/^\/+/, "");
|
|
304
|
+
}
|
|
305
|
+
path_open(t, e, r, s, a, o) {
|
|
306
|
+
return super.path_open(t, this.#t(e), r, s, a, o);
|
|
307
|
+
}
|
|
308
|
+
path_filestat_get(t, e) {
|
|
309
|
+
return super.path_filestat_get(t, this.#t(e));
|
|
310
|
+
}
|
|
311
|
+
path_create_directory(t) {
|
|
312
|
+
return super.path_create_directory(this.#t(t));
|
|
313
|
+
}
|
|
314
|
+
path_unlink_file(t) {
|
|
315
|
+
return super.path_unlink_file(this.#t(t));
|
|
316
|
+
}
|
|
317
|
+
path_remove_directory(t) {
|
|
318
|
+
return super.path_remove_directory(this.#t(t));
|
|
319
|
+
}
|
|
320
|
+
path_link(t, e, r) {
|
|
321
|
+
return super.path_link(this.#t(t), e, r);
|
|
322
|
+
}
|
|
323
|
+
path_readlink(t) {
|
|
324
|
+
return super.path_readlink(this.#t(t));
|
|
325
|
+
}
|
|
326
|
+
path_symlink(t, e) {
|
|
327
|
+
const r = N.prototype.path_symlink;
|
|
328
|
+
return r ? r.call(this, this.#t(t), this.#t(e)) : K;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|