2024-09-30 09:33:32 -04:00
|
|
|
// 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>;
|
2024-11-14 15:24:25 -05:00
|
|
|
fn exists_sync(&self, path: &Path) -> bool;
|
2024-09-30 09:33:32 -04:00
|
|
|
fn is_dir_sync(&self, path: &Path) -> bool;
|
|
|
|
fn read_dir_sync(&self, dir_path: &Path) -> std::io::Result<Vec<DirEntry>>;
|
|
|
|
}
|