UNPKG

vitepress-jsdoc

Version:

A bridge between Vitepress and JSDoc-style commented codebases for hassle-free documentation.

44 lines 1.73 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DirectoryManager = void 0; const directory_tree_builder_js_1 = require("./directory-tree-builder.js"); /** * Options for listing directory tree contents. * @typedef DirectoryTreeListOptions * @property {string[]} [exclude] - Patterns to exclude from the tree. * @property {string[]} [include] - Patterns to include in the tree. * @property {string} [mainPath] - Main path for relative calculations. * @property {string} srcPath - Source path of the directory to list. * @property {FileTree[]} [tree] - Existing tree to append to, if available. */ /** * The `DirectoryManager` class provides functionalities to manage and interact * with directories. It leverages the `DirectoryTreeBuilder` to construct a * directory tree based on the provided options. */ class DirectoryManager { options; /** * Creates an instance of the `DirectoryManager` class. * * @param {DirectoryTreeListOptions} options - Configuration options for directory management. */ constructor(options) { this.options = options; } /** * Constructs a directory tree based on the provided options. * * @returns {Promise<object>} A promise that resolves to the constructed directory tree. * * @example * const manager = new DirectoryManager({ srcPath: './src', exclude: ['node_modules'] }); * const tree = await manager.build(); */ async build() { const directoryTree = new directory_tree_builder_js_1.DirectoryTreeBuilder(this.options); return directoryTree.build(); } } exports.DirectoryManager = DirectoryManager; //# sourceMappingURL=directory-manager.js.map