1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
denoland-deno/cli/msg.fbs
2019-08-26 10:18:42 -04:00

134 lines
1.7 KiB
Text

union Any {
Read,
ReadRes,
Seek,
Write,
WriteRes,
}
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,
BadResource,
CommandFailed,
// url errors
EmptyHost,
IdnaError,
InvalidPort,
InvalidIpv4Address,
InvalidIpv6Address,
InvalidDomainCharacter,
RelativeUrlWithoutBase,
RelativeUrlWithCannotBeABaseBase,
SetHostOnCannotBeABaseUrl,
Overflow,
// hyper errors
HttpUser,
HttpClosed,
HttpCanceled,
HttpParse,
HttpOther,
TooLarge,
// custom errors
InvalidUri,
InvalidSeekMode,
OpNotAvailable,
WorkerInitFailed,
UnixError,
NoAsyncSupport,
NoSyncSupport,
ImportMapError,
InvalidPath,
ImportPrefixMissing,
UnsupportedFetchScheme,
TooManyRedirects,
// other kinds
Diagnostic,
JSError,
}
table Cwd {}
table CwdRes {
cwd: string;
}
enum MediaType: byte {
JavaScript = 0,
TypeScript,
Json,
Unknown
}
table Base {
cmd_id: uint32;
sync: bool = false;
error_kind: ErrorKind = NoError;
error: string;
inner: Any;
}
table FormatError {
error: string;
}
table FormatErrorRes {
error: string;
}
table KeyValue {
key: string;
value: string;
}
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;
}
table Seek {
rid: uint32;
offset: int;
whence: uint;
}
root_type Base;