Source
Extraction
Signature
declare function extract(source: string, format: SourceFormat): readonly Array<Snippet>extractFile
Added in v4.0.0
Source
Reads a file and extracts its marked code snippets.
Signature
declare function extractFile(file: string): Promise<readonly Array<Snippet>>Models
Represents an executable TypeScript code snippet.
Signature
interface Snippet {
readonly line: number;
readonly name: string | undefined;
readonly source: string;
}SourceFormat type
Added in v4.0.0
Source
Identifies how documentation is embedded in the source text.
Signature
type SourceFormat = "jsdoc" | "markdown";
Extracts marked TypeScript code snippets from documentation text.
Details
Extraction uses an ordered text scan and does not parse the containing source file.