node-scripts-docs
Version:
Generate documentation for your `package.json` scripts.
65 lines • 2.31 kB
TypeScript
export declare const DOCS_FRAGMENTS_DEFAULT_LOCATION = "docs/reference/Repository Scripts/";
/**
* A documentation fragment contains the documentation for a single script.
*/
export declare class DocumentationFragment {
/**
* The description for the script in Markdown.
*/
descriptionMarkdown: string;
/**
* The filename of the fragment.
*/
filename: string;
/**
* Constructs a new documentation fragment.
* @param filename - The filename of the fragment.
* @param descriptionMarkdown - The description of the script.
*/
constructor(filename: string, descriptionMarkdown?: string);
}
/**
* A store for documentation fragments.
*/
export declare class FragmentStore {
private fragmentDirectory;
/**
* The fragments in the store.
*/
fragments: Map<string, DocumentationFragment>;
/**
* Constructs a new fragment store.
* @param fragmentDirectory - The directory where the fragments are located.
*/
constructor(fragmentDirectory: string);
/**
* Loads the given fragment into the store.
* @param fragmentFilename - The filename of the fragment to load.
*/
loadFragment(fragmentFilename: string): Promise<void>;
/**
* Retrieves the current description of a script.
* @param scriptName - The name of the script.
* @returns The current description of the script, if one exists.
*/
getExistingDescription(scriptName: string): string | undefined;
/**
* Generate the filename for a fragment.
* @param scriptName - The name of the script.
* @returns The filename that should represent the fragment.
*/
static scriptToFragmentFilename(scriptName: string): string;
/**
* Retrieve the script name from the filename of a fragment.
* @param fragmentName - The filename of the fragment.
* @returns The script name, if the fragment name could be parsed.
*/
static fragmentFilenameToScript(fragmentName: string): string | null;
/**
* Determine if the given store location exists.
* @param storePath - The location of a store.
* @returns `true` if the store exists; `false` otherwise.
*/
static exists(storePath: string): Promise<boolean>;
}
//# sourceMappingURL=FragmentStore.d.ts.map