e0a986eb30
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
22 lines
703 B
TypeScript
22 lines
703 B
TypeScript
/// <reference types="node" />
|
|
import fs from 'fs';
|
|
interface Result {
|
|
files: Array<string>;
|
|
directories: Array<string>;
|
|
}
|
|
interface FileSystem {
|
|
join(pathA: string, pathB: string): string;
|
|
basename(path: string): string;
|
|
stat(path: string): Promise<fs.Stats>;
|
|
readdir(path: string): Promise<string[]>;
|
|
}
|
|
declare type Validate = (path: string) => boolean;
|
|
export declare const defaultFilesystem: FileSystem;
|
|
declare function scanDirectory(path: string, { recursive, validate, concurrency, fileSystem, }?: {
|
|
recursive?: boolean;
|
|
validate?: Validate | null;
|
|
concurrency?: number;
|
|
fileSystem?: Partial<FileSystem>;
|
|
}): Promise<Result>;
|
|
export default scanDirectory;
|