CustomTaginterfaceno test imports itinterface CustomTagAny other tag, with the value of the reader a project gave for it.
| Member | Type | What it is |
|---|---|---|
kind | "custom" | |
tag | string | |
text | string | |
value | unknown |
Documentation as a value (commons lang-sql 0004-sql-docs FR-003 to FR-005): a summary, a description and tags, read from the text of comments as TSDoc reads it. The tags param, returns, example, deprecated, since and see are typed; any other is a tag with its name and text, or the value a reader a project gave for it makes.
The summary is the first paragraph with its lines joined by a space; the description is the paragraphs after it, before the first tag, with their line breaks kept; a tag begins on a line whose first character is @ and a name, and its text goes on until the next tag. The code of an example is parsed with the dialect it is given.
parseDoc("The people.\n\n@since 2026\n@param id the key").tags.map((t) => t.kind); // ["since", "param"]Spec: 0004-sql-docs FR-003, FR-004, FR-005
CustomTaginterfaceno test imports itinterface CustomTagAny other tag, with the value of the reader a project gave for it.
| Member | Type | What it is |
|---|---|---|
kind | "custom" | |
tag | string | |
text | string | |
value | unknown |
Docinterfaceno test imports itinterface DocDocumentation.
| Member | Type | What it is |
|---|---|---|
raw | string | All of the text, with the markers taken off. |
summary | string | |
description | string | |
tags | readonly DocTag[] |
DocOptionsinterfaceno test imports itinterface DocOptionsWhat parseDoc may be given.
| Member | Type | What it is |
|---|---|---|
dialect? | Dialect | The dialect the examples are parsed in; the base dialect by default. |
readers? | Readonly<Record<string, (text: string) => unknown>> | Readers for tags of a project's own, by tag name; each is given the text of the tag. |
DocTagtypeno test imports ittype DocTag = ParamTag | ReturnsTag | ExampleTag | NoteTag | CustomTag;A tag of a documentation.
ExampleTaginterfaceno test imports itinterface ExampleTagAn @example: its code and what the parser made of it.
| Member | Type | What it is |
|---|---|---|
kind | "example" | |
tag | string | |
code | string | |
parsed | Parsed |
NoteTaginterfaceno test imports itinterface NoteTagA @deprecated, @since or @see.
| Member | Type | What it is |
|---|---|---|
kind | "deprecated" | "see" | "since" | |
tag | string | |
text | string |
ParamTaginterfaceno test imports itinterface ParamTagA @param name {type} text.
| Member | Type | What it is |
|---|---|---|
kind | "param" | |
tag | string | |
name | string | |
type | string | undefined | |
text | string |
parseDocfunctionfunction parseDoc(text: string, options?: DocOptions): DocReads documentation from text.
| Parameter | What it is |
|---|---|
text | the text of comments with their markers taken off (see docText) |
options | the dialect for the examples, and readers for a project's tags |
Returns: the summary, the description and the tags
ReturnsTaginterfaceno test imports itinterface ReturnsTagA @returns text.
| Member | Type | What it is |
|---|---|---|
kind | "returns" | |
tag | string | |
text | string |