2020-01-02 15:13:47 -05:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2018-11-29 22:03:00 -05:00
|
|
|
|
2019-08-26 17:02:34 -04:00
|
|
|
// Warning! The values in this enum are duplicated in js/errors.ts
|
|
|
|
// Update carefully!
|
|
|
|
#[allow(non_camel_case_types)]
|
|
|
|
#[repr(i8)]
|
|
|
|
#[derive(Clone, Copy, PartialEq, Debug)]
|
|
|
|
pub enum ErrorKind {
|
|
|
|
NotFound = 1,
|
|
|
|
PermissionDenied = 2,
|
|
|
|
ConnectionRefused = 3,
|
|
|
|
ConnectionReset = 4,
|
|
|
|
ConnectionAborted = 5,
|
|
|
|
NotConnected = 6,
|
|
|
|
AddrInUse = 7,
|
|
|
|
AddrNotAvailable = 8,
|
|
|
|
BrokenPipe = 9,
|
|
|
|
AlreadyExists = 10,
|
|
|
|
WouldBlock = 11,
|
|
|
|
InvalidInput = 12,
|
|
|
|
InvalidData = 13,
|
|
|
|
TimedOut = 14,
|
|
|
|
Interrupted = 15,
|
|
|
|
WriteZero = 16,
|
|
|
|
Other = 17,
|
|
|
|
UnexpectedEof = 18,
|
|
|
|
BadResource = 19,
|
2020-01-20 10:50:16 -05:00
|
|
|
UrlParse = 20,
|
|
|
|
Http = 21,
|
|
|
|
TooLarge = 22,
|
|
|
|
InvalidSeekMode = 23,
|
|
|
|
UnixError = 24,
|
|
|
|
InvalidPath = 25,
|
|
|
|
ImportPrefixMissing = 26,
|
|
|
|
Diagnostic = 27,
|
|
|
|
JSError = 28,
|
2019-08-26 17:02:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Warning! The values in this enum are duplicated in js/compiler.ts
|
|
|
|
// Update carefully!
|
|
|
|
#[allow(non_camel_case_types)]
|
|
|
|
#[repr(i8)]
|
|
|
|
#[derive(Clone, Copy, PartialEq, Debug)]
|
|
|
|
pub enum MediaType {
|
|
|
|
JavaScript = 0,
|
2019-10-02 10:46:36 -04:00
|
|
|
JSX = 1,
|
|
|
|
TypeScript = 2,
|
|
|
|
TSX = 3,
|
|
|
|
Json = 4,
|
2019-11-14 08:31:39 -05:00
|
|
|
Wasm = 5,
|
|
|
|
Unknown = 6,
|
2019-08-26 17:02:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn enum_name_media_type(mt: MediaType) -> &'static str {
|
|
|
|
match mt {
|
|
|
|
MediaType::JavaScript => "JavaScript",
|
2019-10-02 10:46:36 -04:00
|
|
|
MediaType::JSX => "JSX",
|
2019-08-26 17:02:34 -04:00
|
|
|
MediaType::TypeScript => "TypeScript",
|
2019-10-02 10:46:36 -04:00
|
|
|
MediaType::TSX => "TSX",
|
2019-08-26 17:02:34 -04:00
|
|
|
MediaType::Json => "Json",
|
2019-11-14 08:31:39 -05:00
|
|
|
MediaType::Wasm => "Wasm",
|
2019-08-26 17:02:34 -04:00
|
|
|
MediaType::Unknown => "Unknown",
|
|
|
|
}
|
|
|
|
}
|
2019-11-13 10:35:56 -05:00
|
|
|
|
|
|
|
// Warning! The values in this enum are duplicated in js/compiler.ts
|
|
|
|
// Update carefully!
|
|
|
|
#[allow(non_camel_case_types)]
|
|
|
|
#[repr(i8)]
|
|
|
|
#[derive(Clone, Copy, PartialEq, Debug)]
|
|
|
|
pub enum CompilerRequestType {
|
|
|
|
Compile = 0,
|
2020-01-08 09:17:44 -05:00
|
|
|
RuntimeCompile = 1,
|
|
|
|
RuntimeTranspile = 2,
|
2019-11-13 10:35:56 -05:00
|
|
|
}
|