mirror of
https://github.com/denoland/deno.git
synced 2024-11-01 09:24:20 -04:00
60 lines
2.7 KiB
Rust
60 lines
2.7 KiB
Rust
|
static DENO_RUNTIME: &str = include_str!("../js/lib.deno_runtime.d.ts");
|
||
|
|
||
|
macro_rules! inc {
|
||
|
($e:expr) => {
|
||
|
Some(include_str!(concat!(
|
||
|
"../third_party/node_modules/typescript/lib/",
|
||
|
$e
|
||
|
)))
|
||
|
};
|
||
|
}
|
||
|
|
||
|
pub fn get_source_code(name: &str) -> Option<&'static str> {
|
||
|
match name {
|
||
|
"lib.deno_runtime.d.ts" => Some(DENO_RUNTIME),
|
||
|
"lib.es2015.collection.d.ts" => inc!("lib.es2015.collection.d.ts"),
|
||
|
"lib.es2015.core.d.ts" => inc!("lib.es2015.core.d.ts"),
|
||
|
"lib.es2015.d.ts" => inc!("lib.es2015.d.ts"),
|
||
|
"lib.es2015.generator.d.ts" => inc!("lib.es2015.generator.d.ts"),
|
||
|
"lib.es2015.iterable.d.ts" => inc!("lib.es2015.iterable.d.ts"),
|
||
|
"lib.es2015.promise.d.ts" => inc!("lib.es2015.promise.d.ts"),
|
||
|
"lib.es2015.proxy.d.ts" => inc!("lib.es2015.proxy.d.ts"),
|
||
|
"lib.es2015.reflect.d.ts" => inc!("lib.es2015.reflect.d.ts"),
|
||
|
"lib.es2015.symbol.d.ts" => inc!("lib.es2015.symbol.d.ts"),
|
||
|
"lib.es2015.symbol.wellknown.d.ts" => {
|
||
|
inc!("lib.es2015.symbol.wellknown.d.ts")
|
||
|
}
|
||
|
"lib.es2016.array.include.d.ts" => inc!("lib.es2016.array.include.d.ts"),
|
||
|
"lib.es2016.d.ts" => inc!("lib.es2016.d.ts"),
|
||
|
"lib.es2017.d.ts" => inc!("lib.es2017.d.ts"),
|
||
|
"lib.es2017.intl.d.ts" => inc!("lib.es2017.intl.d.ts"),
|
||
|
"lib.es2017.object.d.ts" => inc!("lib.es2017.object.d.ts"),
|
||
|
"lib.es2017.sharedmemory.d.ts" => inc!("lib.es2017.sharedmemory.d.ts"),
|
||
|
"lib.es2017.string.d.ts" => inc!("lib.es2017.string.d.ts"),
|
||
|
"lib.es2017.typedarrays.d.ts" => inc!("lib.es2017.typedarrays.d.ts"),
|
||
|
"lib.es2018.d.ts" => inc!("lib.es2018.d.ts"),
|
||
|
"lib.es2018.asynciterable.d.ts" => inc!("lib.es2018.asynciterable.d.ts"),
|
||
|
"lib.es2018.intl.d.ts" => inc!("lib.es2018.intl.d.ts"),
|
||
|
"lib.es2018.promise.d.ts" => inc!("lib.es2018.promise.d.ts"),
|
||
|
"lib.es2018.regexp.d.ts" => inc!("lib.es2018.regexp.d.ts"),
|
||
|
"lib.es2019.d.ts" => inc!("lib.es2019.d.ts"),
|
||
|
"lib.es2019.array.d.ts" => inc!("lib.es2019.array.d.ts"),
|
||
|
"lib.es2019.object.d.ts" => inc!("lib.es2019.object.d.ts"),
|
||
|
"lib.es2019.string.d.ts" => inc!("lib.es2019.string.d.ts"),
|
||
|
"lib.es2019.symbol.d.ts" => inc!("lib.es2019.symbol.d.ts"),
|
||
|
"lib.es2020.d.ts" => inc!("lib.es2020.d.ts"),
|
||
|
"lib.es2020.string.d.ts" => inc!("lib.es2020.string.d.ts"),
|
||
|
"lib.es2020.symbol.wellknown.d.ts" => {
|
||
|
inc!("lib.es2020.symbol.wellknown.d.ts")
|
||
|
}
|
||
|
"lib.es5.d.ts" => inc!("lib.es5.d.ts"),
|
||
|
"lib.esnext.d.ts" => inc!("lib.esnext.d.ts"),
|
||
|
"lib.esnext.array.d.ts" => inc!("lib.esnext.array.d.ts"),
|
||
|
"lib.esnext.asynciterable.d.ts" => inc!("lib.esnext.asynciterable.d.ts"),
|
||
|
"lib.esnext.bigint.d.ts" => inc!("lib.esnext.bigint.d.ts"),
|
||
|
"lib.esnext.intl.d.ts" => inc!("lib.esnext.intl.d.ts"),
|
||
|
"lib.esnext.symbol.d.ts" => inc!("lib.esnext.symbol.d.ts"),
|
||
|
_ => None,
|
||
|
}
|
||
|
}
|