tsdoc-markdown
Version:
Generates markdown documentation from TypeScript source code.
56 lines (55 loc) • 1.58 kB
TypeScript
import type { CompilerOptions, JSDocTagInfo } from 'typescript';
export type DocEntryType = 'property' | 'function' | 'method' | 'class' | 'const' | 'interface' | 'type' | 'enum';
export type DocEntryConstructor = Pick<DocEntry, 'parameters' | 'returnType' | 'documentation'> & {
visibility: 'private' | 'public';
};
export interface DocEntry {
name: string;
fileName?: string;
url?: string;
documentation?: string;
type?: string;
isStatic?: boolean;
constructors?: DocEntryConstructor[];
parameters?: DocEntry[];
methods?: DocEntry[];
properties?: DocEntry[];
returnType?: string;
jsDocs?: JSDocTagInfo[];
doc_type?: DocEntryType;
}
/**
* Emoji to use to parse titles. Shortcode without `:` - e.g. `gear` for `:gear:`.
* e.g. cheatsheet https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md
*/
export interface MarkdownEmoji {
classes: string;
functions: string;
constants: string;
enum: string;
entry: string;
link: string;
interfaces: string;
types: string;
}
export type MarkdownHeadingLevel = '#' | '##' | '###';
/**
* The options to parse the Markdown content.
*/
export interface MarkdownOptions {
emoji?: MarkdownEmoji | null;
headingLevel?: MarkdownHeadingLevel;
}
export interface RepoOptions {
url: string;
branch?: string;
}
/**
* The options to generate the JSON representation of the documentation.
*/
export interface BuildOptions {
compilerOptions?: CompilerOptions;
explore?: boolean;
repo?: RepoOptions;
types?: boolean;
}