vitepress-jsdoc
Version:
A bridge between Vitepress and JSDoc-style commented codebases for hassle-free documentation.
34 lines • 1.53 kB
TypeScript
import { type FilterStrategy, type DirectoryEntity } from '../interfaces.js';
/**
* Represents a filter strategy that determines the inclusion of directory entries
* based on specified include and exclude patterns. This class leverages the `micromatch`
* library to perform pattern matching.
*
* @implements {FilterStrategy}
*/
export declare class PatternFilter implements FilterStrategy {
private readonly include;
private readonly exclude;
/**
* Initializes a new instance of the PatternFilter class.
*
* @param {string[]} include - Patterns that specify which entries to include.
* @param {string[]} exclude - Patterns that specify which entries to exclude.
*/
constructor(include: string[], exclude: string[]);
/**
* Determines whether a given directory entry should be included based on the
* provided include and exclude patterns.
*
* @param {DirectoryEntity} entry - The directory entry to evaluate.
* @param {string} srcPath - The source directory path.
* @param {string} mainPath - The main directory path for relative path calculations.
* @returns {boolean} Returns true if the entry matches the inclusion criteria, false otherwise.
*
* @example
* const filter = new PatternFilter(['*.js'], ['test.js']);
* const shouldInclude = filter.shouldInclude(entry, './src', './main');
*/
shouldInclude(entry: DirectoryEntity, srcPath: string, mainPath: string): boolean;
}
//# sourceMappingURL=pattern-filter.d.ts.map