extra-jsdoc-text
Version:
Utilities for processing JSDoc text.
59 lines (57 loc) • 1.38 kB
TypeScript
/**
* Param tag.
* [📘](https://github.com/nodef/extra-jsdoc-text/wiki/ParamTag)
*/
interface ParamTag {
/** Full param. */
full: string;
/** Param name. */
name: string;
/** Param type. */
type: string;
/** Param description. */
description: string;
}
/**
* Returns tag.
* [📘](https://github.com/nodef/extra-jsdoc-text/wiki/ReturnsTag)
*/
interface ReturnsTag {
/** Full returns. */
full: string;
/** Returns type. */
type: string;
/** Returns description. */
description: string;
}
/**
* JSDoc details.
* [📘](https://github.com/nodef/extra-jsdoc-text/wiki/Jsdoc)
*/
interface Jsdoc {
/** Full JSDoc. */
full: string;
/** JSDoc description. */
description: string;
/** JSDoc params. */
params: ParamTag[];
/** JSDoc returns. */
returns: ReturnsTag;
/** JSDoc examples. */
examples: string[];
}
/**
* Parse jsdoc from jsdoc text.
* [📘](https://github.com/nodef/extra-jsdoc-text/wiki/parse)
* @param txt jsdoc text
* @returns parsed jsdoc
*/
declare function parse(txt: string): Jsdoc;
/**
* Stringify jsdoc text from parsed jsdoc.
* [📘](https://github.com/nodef/extra-jsdoc-text/wiki/stringify)
* @param x parsed jsdoc
* @returns jsdoc text
*/
declare function stringify(x: Jsdoc): string;
export { Jsdoc, ParamTag, ReturnsTag, parse, stringify };