aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/node/node.classes.ts
blob: f984077e440179ebdf4fe6ddb24ae2f5c0b87155 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
import { define } from "../scripts/class-definitions";

export default [
  define({
    name: "Timeout",
    construct: false,
    noConstructor: true,
    finalize: true,
    configurable: false,
    klass: {},
    JSType: "0b11101110",
    proto: {
      ref: {
        fn: "doRef",
        length: 0,
      },
      refresh: {
        fn: "doRefresh",
        length: 0,
      },
      unref: {
        fn: "doUnref",
        length: 0,
      },
      hasRef: {
        fn: "hasRef",
        length: 0,
      },
      ["@@toPrimitive"]: {
        fn: "toPrimitive",
        length: 1,
      },
    },
    values: ["arguments", "callback"],
  }),
  define({
    name: "Stats",
    construct: true,
    finalize: true,
    klass: {},
    JSType: "0b11101110",
    proto: {
      isBlockDevice: {
        fn: "isBlockDevice_",
        length: 0,
        enumerable: false,
        DOMJIT: {
          returns: "bool",
          args: [],
          pure: true,
        },
      },
      isCharacterDevice: {
        fn: "isCharacterDevice_",
        length: 0,
        enumerable: false,
        DOMJIT: {
          returns: "bool",
          args: [],
          pure: true,
        },
      },
      isDirectory: {
        fn: "isDirectory_",
        length: 0,
        enumerable: false,
        DOMJIT: {
          returns: "bool",
          args: [],
          pure: true,
        },
      },
      isFIFO: {
        fn: "isFIFO_",
        length: 0,
        enumerable: false,
        DOMJIT: {
          returns: "bool",
          args: [],
          pure: true,
        },
      },
      isFile: {
        fn: "isFile_",
        length: 0,
        enumerable: false,
        DOMJIT: {
          returns: "bool",
          args: [],
          pure: true,
        },
      },
      isSocket: {
        fn: "isSocket_",
        length: 0,
        enumerable: false,
        DOMJIT: {
          returns: "bool",
          args: [],
          pure: true,
        },
      },
      isSymbolicLink: {
        fn: "isSymbolicLink_",
        length: 0,
        enumerable: false,
        DOMJIT: {
          returns: "bool",
          args: [],
          pure: true,
        },
      },
      dev: {
        getter: "dev",
      },
      ino: {
        getter: "ino",
      },
      mode: {
        getter: "mode",
      },
      nlink: {
        getter: "nlink",
      },
      uid: {
        getter: "uid",
      },
      gid: {
        getter: "gid",
      },
      rdev: {
        getter: "rdev",
      },
      size: {
        getter: "size",
      },
      blksize: {
        getter: "blksize",
      },
      blocks: {
        getter: "blocks",
      },
      atime: {
        getter: "atime",
        cache: true,
      },
      mtime: {
        getter: "mtime",
        cache: true,
      },
      ctime: {
        getter: "ctime",
        cache: true,
      },
      birthtime: {
        getter: "birthtime",
      },
      atimeMs: {
        getter: "atimeMs",
      },
      mtimeMs: {
        getter: "mtimeMs",
      },
      ctimeMs: {
        getter: "ctimeMs",
      },
      birthtimeMs: {
        getter: "birthtimeMs",
      },
    },
  }),
  define({
    name: "Dirent",
    construct: true,
    finalize: true,

    klass: {},

    proto: {
      isBlockDevice: {
        fn: "isBlockDevice",
        length: 0,
      },
      isCharacterDevice: {
        fn: "isCharacterDevice",
        length: 0,
      },
      isDirectory: {
        fn: "isDirectory",
        length: 0,
      },
      isFIFO: {
        fn: "isFIFO",
        length: 0,
      },
      isFile: {
        fn: "isFile",
        length: 0,
      },
      isSocket: {
        fn: "isSocket",
        length: 0,
      },
      isSymbolicLink: {
        fn: "isSymbolicLink",
        length: 0,
      },
      name: {
        getter: "getName",
        cache: true,
      },
    },
  }),
  define({
    name: "NodeJSFS",
    construct: true,
    finalize: false,

    klass: {},
    proto: {
      appendFile: { fn: "appendFile", length: 4 },
      appendFileSync: { fn: "appendFileSync", length: 3 },
      access: { fn: "access", length: 3 },
      accessSync: { fn: "accessSync", length: 2 },
      chown: { fn: "chown", length: 4 },
      chownSync: { fn: "chownSync", length: 3 },
      chmod: { fn: "chmod", length: 3 },
      chmodSync: { fn: "chmodSync", length: 2 },
      close: { fn: "close", length: 1 },
      closeSync: { fn: "closeSync", length: 1 },
      copyFile: { fn: "copyFile", length: 4 },
      copyFileSync: { fn: "copyFileSync", length: 3 },

      // TODO:
      // cp: { fn: "cp", length: 4 },
      // cpSync: { fn: "cpSync", length: 3 },

      exists: { fn: "exists", length: 2 },
      existsSync: { fn: "existsSync", length: 1 },
      fchown: { fn: "fchown", length: 4 },
      fchownSync: { fn: "fchownSync", length: 3 },
      fchmod: { fn: "fchmod", length: 3 },
      fchmodSync: { fn: "fchmodSync", length: 2 },
      fdatasync: { fn: "fdatasync", length: 2 },
      fdatasyncSync: { fn: "fdatasyncSync", length: 1 },
      fstat: { fn: "fstat", length: 1 },
      fstatSync: { fn: "fstatSync", length: 1 },
      fsync: { fn: "fsync", length: 2 },
      fsyncSync: { fn: "fsyncSync", length: 1 },
      ftruncate: { fn: "ftruncate", length: 1 },
      ftruncateSync: { fn: "ftruncateSync", length: 1 },
      futimes: { fn: "futimes", length: 4 },
      futimesSync: { fn: "futimesSync", length: 3 },
      lchown: { fn: "lchown", length: 4 },
      lchownSync: { fn: "lchownSync", length: 3 },
      lchmod: { fn: "lchmod", length: 3 },
      lchmodSync: { fn: "lchmodSync", length: 2 },
      link: { fn: "link", length: 3 },
      linkSync: { fn: "linkSync", length: 2 },
      lstat: { fn: "lstat", length: 1 },
      lstatSync: { fn: "lstatSync", length: 1 },
      lutimes: { fn: "lutimes", length: 4 },
      lutimesSync: { fn: "lutimesSync", length: 3 },
      mkdir: { fn: "mkdir", length: 3 },
      mkdirSync: { fn: "mkdirSync", length: 2 },
      mkdtemp: { fn: "mkdtemp", length: 3 },
      mkdtempSync: { fn: "mkdtempSync", length: 2 },
      open: { fn: "open", length: 4 },
      openSync: { fn: "openSync", length: 3 },
      opendir: { fn: "opendir", length: 3 },
      opendirSync: { fn: "opendirSync", length: 2 },
      readdir: { fn: "readdir", length: 3 },
      readdirSync: { fn: "readdirSync", length: 2 },
      read: { fn: "read", length: 6 },
      readSync: { fn: "readSync", length: 5 },
      readv: { fn: "readv", length: 4 },
      readvSync: { fn: "readvSync", length: 3 },
      readFile: { fn: "readFile", length: 3 },
      readFileSync: { fn: "readFileSync", length: 2 },
      readlink: { fn: "readlink", length: 3 },
      readlinkSync: { fn: "readlinkSync", length: 2 },
      realpath: { fn: "realpath", length: 3 },
      realpathSync: { fn: "realpathSync", length: 2 },
      rename: { fn: "rename", length: 3 },
      renameSync: { fn: "renameSync", length: 2 },
      rm: { fn: "rm", length: 3 },
      rmSync: { fn: "rmSync", length: 2 },
      rmdir: { fn: "rmdir", length: 3 },
      rmdirSync: { fn: "rmdirSync", length: 2 },
      stat: { fn: "stat", length: 1 },
      statSync: { fn: "statSync", length: 1 },
      symlink: { fn: "symlink", length: 4 },
      symlinkSync: { fn: "symlinkSync", length: 3 },
      truncate: { fn: "truncate", length: 3 },
      truncateSync: { fn: "truncateSync", length: 2 },
      // TODO:
      // unwatchFile: { fn: "unwatchFile", length: 2 },
      unlink: { fn: "unlink", length: 2 },
      unlinkSync: { fn: "unlinkSync", length: 1 },
      utimes: { fn: "utimes", length: 4 },
      utimesSync: { fn: "utimesSync", length: 3 },
      // TODO:
      // watch: { fn: "watch", length: 3 },
      // watchFile: { fn: "watchFile", length: 3 },
      writeFile: { fn: "writeFile", length: 4 },
      writeFileSync: { fn: "writeFileSync", length: 3 },
      write: { fn: "write", length: 6 },
      writeSync: { fn: "writeSync", length: 5 },
      writev: { fn: "writev", length: 4 },
      writevSync: { fn: "writevSync", length: 3 },
      // TODO:
      // Dir: { fn: 'Dir', length: 3 },
      Dirent: { getter: "getDirent" },
      Stats: { getter: "getStats" },
      // ReadStream: { fn: 'ReadStream', length: 2 },
      // WriteStream: { fn: 'WriteStream', length: 2 },
      // FileReadStream: { fn: 'FileReadStream', length: 2 },
      // FileWriteStream: { fn: 'FileWriteStream', length: 2 },
      // _toUnixTimestamp: { fn: '_toUnixTimestamp', length: 1 }
      // createReadStream: { fn: "createReadStream", length: 2 },
      // createWriteStream: { fn: "createWriteStream", length: 2 },
    },
  }),
];