2018-08-15 23:36:48 -04:00
|
|
|
union Any {
|
2019-03-11 23:25:18 -04:00
|
|
|
Chdir,
|
|
|
|
Chmod,
|
2019-05-07 21:58:58 -04:00
|
|
|
Chown,
|
2019-03-11 23:25:18 -04:00
|
|
|
CopyFile,
|
|
|
|
Cwd,
|
|
|
|
CwdRes,
|
2019-04-08 09:11:32 -04:00
|
|
|
Link,
|
2018-08-23 18:36:45 -04:00
|
|
|
MakeTempDir,
|
|
|
|
MakeTempDirRes,
|
2018-09-10 05:48:36 -04:00
|
|
|
Mkdir,
|
2019-08-16 11:05:24 -04:00
|
|
|
Read,
|
2018-10-03 17:56:56 -04:00
|
|
|
ReadDir,
|
|
|
|
ReadDirRes,
|
2019-08-16 11:05:24 -04:00
|
|
|
ReadRes,
|
2018-09-25 00:20:49 -04:00
|
|
|
Readlink,
|
|
|
|
ReadlinkRes,
|
2019-03-11 23:25:18 -04:00
|
|
|
Remove,
|
|
|
|
Rename,
|
2019-02-18 18:26:41 -05:00
|
|
|
Seek,
|
2019-03-11 23:25:18 -04:00
|
|
|
Stat,
|
|
|
|
StatRes,
|
|
|
|
Symlink,
|
|
|
|
Truncate,
|
2019-08-16 11:05:24 -04:00
|
|
|
Write,
|
|
|
|
WriteRes,
|
2018-07-04 14:50:28 -04:00
|
|
|
}
|
|
|
|
|
2018-08-15 23:36:48 -04:00
|
|
|
enum ErrorKind: byte {
|
|
|
|
NoError = 0,
|
|
|
|
|
|
|
|
// io errors
|
|
|
|
|
|
|
|
NotFound,
|
|
|
|
PermissionDenied,
|
|
|
|
ConnectionRefused,
|
|
|
|
ConnectionReset,
|
|
|
|
ConnectionAborted,
|
|
|
|
NotConnected,
|
|
|
|
AddrInUse,
|
|
|
|
AddrNotAvailable,
|
|
|
|
BrokenPipe,
|
|
|
|
AlreadyExists,
|
|
|
|
WouldBlock,
|
|
|
|
InvalidInput,
|
|
|
|
InvalidData,
|
|
|
|
TimedOut,
|
|
|
|
Interrupted,
|
|
|
|
WriteZero,
|
|
|
|
Other,
|
|
|
|
UnexpectedEof,
|
2018-10-10 11:15:47 -04:00
|
|
|
BadResource,
|
2018-11-15 23:07:40 -05:00
|
|
|
CommandFailed,
|
2018-09-27 00:56:39 -04:00
|
|
|
|
2018-08-15 23:36:48 -04:00
|
|
|
// url errors
|
|
|
|
|
|
|
|
EmptyHost,
|
|
|
|
IdnaError,
|
|
|
|
InvalidPort,
|
|
|
|
InvalidIpv4Address,
|
|
|
|
InvalidIpv6Address,
|
|
|
|
InvalidDomainCharacter,
|
|
|
|
RelativeUrlWithoutBase,
|
|
|
|
RelativeUrlWithCannotBeABaseBase,
|
|
|
|
SetHostOnCannotBeABaseUrl,
|
|
|
|
Overflow,
|
2018-08-14 16:50:53 -04:00
|
|
|
|
|
|
|
// hyper errors
|
|
|
|
|
|
|
|
HttpUser,
|
|
|
|
HttpClosed,
|
|
|
|
HttpCanceled,
|
|
|
|
HttpParse,
|
|
|
|
HttpOther,
|
2018-12-09 15:38:30 -05:00
|
|
|
TooLarge,
|
2018-12-21 04:47:09 -05:00
|
|
|
|
|
|
|
// custom errors
|
|
|
|
InvalidUri,
|
2019-02-18 18:26:41 -05:00
|
|
|
InvalidSeekMode,
|
2019-06-19 22:07:01 -04:00
|
|
|
OpNotAvailable,
|
2019-04-21 21:26:56 -04:00
|
|
|
WorkerInitFailed,
|
|
|
|
UnixError,
|
2019-06-17 21:02:08 -04:00
|
|
|
NoAsyncSupport,
|
|
|
|
NoSyncSupport,
|
2019-06-09 09:08:20 -04:00
|
|
|
ImportMapError,
|
2019-07-10 18:53:48 -04:00
|
|
|
InvalidPath,
|
core: clearly define when module lookup is path-based vs URL-based
The rules are now as follows:
* In `import` statements, as mandated by the WHATWG specification,
the import specifier is always treated as a URL.
If it is a relative URL, it must start with either / or ./ or ../
* A script name passed to deno as a command line argument may be either
an absolute URL or a local path.
- If the name starts with a valid URI scheme followed by a colon, e.g.
'http:', 'https:', 'file:', 'foo+bar:', it always interpreted as a
URL (even if Deno doesn't support the indicated protocol).
- Otherwise, the script name is interpreted as a local path. The local
path may be relative, and operating system semantics determine how
it is resolved. Prefixing a relative path with ./ is not required.
2019-07-08 03:55:24 -04:00
|
|
|
ImportPrefixMissing,
|
2019-07-10 18:53:48 -04:00
|
|
|
UnsupportedFetchScheme,
|
2019-07-22 18:52:40 -04:00
|
|
|
TooManyRedirects,
|
2019-06-19 22:07:01 -04:00
|
|
|
|
|
|
|
// other kinds
|
|
|
|
Diagnostic,
|
|
|
|
JSError,
|
2018-08-15 23:36:48 -04:00
|
|
|
}
|
|
|
|
|
2018-10-13 16:03:27 -04:00
|
|
|
table Cwd {}
|
|
|
|
|
|
|
|
table CwdRes {
|
|
|
|
cwd: string;
|
|
|
|
}
|
|
|
|
|
2018-10-21 22:14:27 -04:00
|
|
|
enum MediaType: byte {
|
|
|
|
JavaScript = 0,
|
|
|
|
TypeScript,
|
|
|
|
Json,
|
|
|
|
Unknown
|
|
|
|
}
|
|
|
|
|
2018-07-06 11:27:36 -04:00
|
|
|
table Base {
|
2019-06-14 13:58:20 -04:00
|
|
|
cmd_id: uint32;
|
2018-12-12 08:24:36 -05:00
|
|
|
sync: bool = false;
|
2018-08-15 23:36:48 -04:00
|
|
|
error_kind: ErrorKind = NoError;
|
2018-07-06 11:27:36 -04:00
|
|
|
error: string;
|
2018-10-03 21:12:23 -04:00
|
|
|
inner: Any;
|
2018-07-04 14:50:28 -04:00
|
|
|
}
|
|
|
|
|
2019-02-09 16:55:40 -05:00
|
|
|
table FormatError {
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
table FormatErrorRes {
|
|
|
|
error: string;
|
|
|
|
}
|
|
|
|
|
2018-10-13 16:03:27 -04:00
|
|
|
table Chdir {
|
|
|
|
directory: string;
|
|
|
|
}
|
|
|
|
|
2018-11-02 20:09:10 -04:00
|
|
|
table KeyValue {
|
2018-09-07 18:59:02 -04:00
|
|
|
key: string;
|
|
|
|
value: string;
|
2018-08-31 07:51:12 -04:00
|
|
|
}
|
|
|
|
|
2018-08-23 18:36:45 -04:00
|
|
|
table MakeTempDir {
|
|
|
|
dir: string;
|
|
|
|
prefix: string;
|
|
|
|
suffix: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
table MakeTempDirRes {
|
|
|
|
path: string;
|
|
|
|
}
|
|
|
|
|
2018-09-10 05:48:36 -04:00
|
|
|
table Mkdir {
|
2018-08-26 02:26:30 -04:00
|
|
|
path: string;
|
2019-01-17 23:39:06 -05:00
|
|
|
recursive: bool;
|
|
|
|
mode: uint; // Specified by https://godoc.org/os#FileMode
|
2018-08-26 02:26:30 -04:00
|
|
|
}
|
|
|
|
|
2018-10-26 16:01:45 -04:00
|
|
|
table Chmod {
|
|
|
|
path: string;
|
2019-01-17 23:39:06 -05:00
|
|
|
mode: uint; // Specified by https://godoc.org/os#FileMode
|
2018-10-26 16:01:45 -04:00
|
|
|
}
|
|
|
|
|
2019-05-07 21:58:58 -04:00
|
|
|
table Chown {
|
|
|
|
path: string;
|
|
|
|
uid: uint;
|
|
|
|
gid: uint; // Specified by https://godoc.org/os#Chown
|
|
|
|
}
|
|
|
|
|
2018-09-10 23:40:03 -04:00
|
|
|
table Remove {
|
|
|
|
path: string;
|
|
|
|
recursive: bool;
|
|
|
|
}
|
|
|
|
|
2018-10-03 17:56:56 -04:00
|
|
|
table ReadDir {
|
|
|
|
path: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
table ReadDirRes {
|
|
|
|
entries: [StatRes];
|
|
|
|
}
|
|
|
|
|
2018-09-30 18:06:41 -04:00
|
|
|
table CopyFile {
|
|
|
|
from: string;
|
|
|
|
to: string;
|
|
|
|
}
|
|
|
|
|
2018-09-12 11:44:58 -04:00
|
|
|
table Rename {
|
2018-09-03 20:22:30 -04:00
|
|
|
oldpath: string;
|
|
|
|
newpath: string;
|
|
|
|
}
|
|
|
|
|
2018-09-25 00:20:49 -04:00
|
|
|
table Readlink {
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
table ReadlinkRes {
|
|
|
|
path: string;
|
|
|
|
}
|
|
|
|
|
2018-09-19 00:38:24 -04:00
|
|
|
table Symlink {
|
|
|
|
oldname: string;
|
|
|
|
newname: string;
|
|
|
|
}
|
|
|
|
|
2019-04-08 09:11:32 -04:00
|
|
|
table Link {
|
|
|
|
oldname: string;
|
|
|
|
newname: string;
|
|
|
|
}
|
|
|
|
|
2018-09-11 15:38:53 -04:00
|
|
|
table Stat {
|
2018-08-29 09:22:25 -04:00
|
|
|
filename: string;
|
|
|
|
lstat: bool;
|
|
|
|
}
|
|
|
|
|
2018-09-11 15:38:53 -04:00
|
|
|
table StatRes {
|
2018-08-29 09:22:25 -04:00
|
|
|
is_file: bool;
|
|
|
|
is_symlink: bool;
|
|
|
|
len: ulong;
|
|
|
|
modified:ulong;
|
|
|
|
accessed:ulong;
|
|
|
|
created:ulong;
|
2018-09-17 19:53:55 -04:00
|
|
|
mode: uint;
|
|
|
|
has_mode: bool; // false on windows
|
2018-10-03 17:56:56 -04:00
|
|
|
name: string;
|
2018-08-29 09:22:25 -04:00
|
|
|
}
|
|
|
|
|
2018-09-30 15:06:20 -04:00
|
|
|
table Truncate {
|
|
|
|
name: string;
|
|
|
|
len: uint;
|
|
|
|
}
|
|
|
|
|
2019-08-16 11:05:24 -04:00
|
|
|
table Read {
|
|
|
|
rid: uint32;
|
|
|
|
// (ptr, len) is passed as second parameter to Deno.core.send().
|
|
|
|
}
|
|
|
|
|
|
|
|
table ReadRes {
|
|
|
|
nread: uint;
|
|
|
|
eof: bool;
|
|
|
|
}
|
|
|
|
|
|
|
|
table Write {
|
|
|
|
rid: uint32;
|
|
|
|
}
|
|
|
|
|
|
|
|
table WriteRes {
|
|
|
|
nbyte: uint;
|
|
|
|
}
|
|
|
|
|
2019-02-18 18:26:41 -05:00
|
|
|
table Seek {
|
|
|
|
rid: uint32;
|
|
|
|
offset: int;
|
|
|
|
whence: uint;
|
|
|
|
}
|
|
|
|
|
2018-08-13 19:55:10 -04:00
|
|
|
root_type Base;
|