2018-07-04 14:50:28 -04:00
|
|
|
namespace deno;
|
|
|
|
|
2018-07-06 11:27:36 -04:00
|
|
|
union Any {
|
|
|
|
Start,
|
|
|
|
StartRes,
|
|
|
|
CodeFetch,
|
|
|
|
CodeFetchRes,
|
|
|
|
CodeCache,
|
|
|
|
Exit,
|
|
|
|
TimerStart,
|
|
|
|
TimerReady,
|
|
|
|
TimerClear,
|
|
|
|
FetchReq,
|
|
|
|
FetchRes,
|
|
|
|
ReadFileSync,
|
|
|
|
ReadFileSyncRes,
|
|
|
|
WriteFileSync,
|
2018-07-04 14:50:28 -04:00
|
|
|
}
|
|
|
|
|
2018-07-06 11:27:36 -04:00
|
|
|
table Base {
|
|
|
|
error: string;
|
|
|
|
msg: Any;
|
2018-07-04 14:50:28 -04:00
|
|
|
}
|
|
|
|
|
2018-07-06 11:27:36 -04:00
|
|
|
struct Start {
|
|
|
|
unused: int8;
|
|
|
|
}
|
|
|
|
|
|
|
|
table StartRes {
|
|
|
|
cwd: string;
|
|
|
|
argv: [string];
|
|
|
|
debug_flag: bool;
|
|
|
|
}
|
|
|
|
|
|
|
|
table CodeFetch {
|
|
|
|
module_specifier: string;
|
|
|
|
containing_file: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
table CodeFetchRes {
|
|
|
|
// If it's a non-http module, moduleName and filename will be the same.
|
|
|
|
// For http modules, moduleName is its resolved http URL, and filename
|
|
|
|
// is the location of the locally downloaded source code.
|
|
|
|
module_name: string;
|
|
|
|
filename: string;
|
|
|
|
source_code: string;
|
|
|
|
output_code: string; // Non-empty only if cached.
|
|
|
|
}
|
|
|
|
|
|
|
|
table CodeCache {
|
|
|
|
filename: string;
|
|
|
|
source_code: string;
|
|
|
|
output_code: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Exit {
|
|
|
|
code: int;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct TimerStart {
|
|
|
|
id: uint;
|
|
|
|
interval: bool;
|
|
|
|
delay: int;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct TimerReady {
|
|
|
|
id: uint;
|
|
|
|
done: bool;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct TimerClear {
|
|
|
|
id: uint;
|
|
|
|
}
|
|
|
|
|
|
|
|
table FetchReq {
|
|
|
|
id: uint;
|
|
|
|
url: string;
|
|
|
|
// header_line: [string];
|
|
|
|
}
|
|
|
|
|
|
|
|
table FetchRes {
|
|
|
|
id: uint;
|
|
|
|
status: int;
|
|
|
|
header_line: [string];
|
|
|
|
body: [byte];
|
|
|
|
}
|
|
|
|
|
|
|
|
table ReadFileSync {
|
|
|
|
filename: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
table ReadFileSyncRes {
|
|
|
|
data: [byte];
|
|
|
|
}
|
|
|
|
|
|
|
|
table WriteFileSync {
|
|
|
|
filename: string;
|
|
|
|
data: [byte];
|
|
|
|
perm: uint;
|
|
|
|
// perm specified by https://godoc.org/os#FileMode
|
|
|
|
}
|