docschema
Version:
Schema declaration and validation library using JsDoc comments
34 lines (33 loc) • 808 B
TypeScript
export class DocSchemaParser {
/**
* @param {string} file
* @returns {Ast[]}
* @throws {Error} If the input file has not been parsed yet
*/
getParsedAst(file: string): Ast[];
/**
* @param {string} code Input code (string), containing one
* or more JsDoc comments
* @param {string} [file]
* @returns {Ast[]}
*/
parseComments(code: string, file?: string): Ast[];
/**
* @param {string} file
* @returns {Ast[]}
* @throws {Error}
*/
parseFile(file: string): Ast[];
/**
* @param {string} file
*/
removeFileFromCache(file: string): void;
#private;
}
export type ExtractedCommentInfo = {
comment: string;
index: number;
startLine: number;
endLine: number;
lineAfterComment: string;
};