mirror of
https://github.com/denoland/deno.git
synced 2024-12-01 16:51:13 -05:00
826e42a5b5
* cts support * better cjs/cts type checking * deno compile cjs/cts support * More efficient detect cjs (going towards stabilization) * Determination of whether .js, .ts, .jsx, or .tsx is cjs or esm is only done after loading * Support `import x = require(...);` Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
17 lines
509 B
Rust
17 lines
509 B
Rust
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
use std::path::Path;
|
|
use std::path::PathBuf;
|
|
|
|
pub struct DirEntry {
|
|
pub name: String,
|
|
pub is_file: bool,
|
|
pub is_directory: bool,
|
|
}
|
|
|
|
pub trait DenoResolverFs {
|
|
fn read_to_string_lossy(&self, path: &Path) -> std::io::Result<String>;
|
|
fn realpath_sync(&self, path: &Path) -> std::io::Result<PathBuf>;
|
|
fn is_dir_sync(&self, path: &Path) -> bool;
|
|
fn read_dir_sync(&self, dir_path: &Path) -> std::io::Result<Vec<DirEntry>>;
|
|
}
|