mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
36 lines
853 B
TypeScript
36 lines
853 B
TypeScript
import * as doctrine from 'doctrine';
|
|
|
|
let string: string = 'string';
|
|
let strings: string[];
|
|
let tags: doctrine.Tag[] = [];
|
|
let annotation: doctrine.Annotation;
|
|
|
|
annotation = doctrine.parse(string);
|
|
string = annotation.description;
|
|
tags = annotation.tags;
|
|
|
|
annotation = doctrine.parse(string, {});
|
|
annotation = doctrine.parse(string, {
|
|
unwrap: true,
|
|
tags: ['foo', 'bar', 'baz'],
|
|
recoverable: false,
|
|
sloppy: false,
|
|
strict: true,
|
|
preserveWhitespace: false,
|
|
lineNumbers: true
|
|
});
|
|
|
|
tags.forEach((tag) => {
|
|
string = doctrine.type.stringify({type: 'NullableLiteral'});
|
|
string = tag.title;
|
|
string = tag.description || '';
|
|
string = tag.kind || '';
|
|
string = tag.name || '';
|
|
strings = tag.errors || [];
|
|
if (tag.type && tag.type.type === 'NameExpression') {
|
|
string = tag.type.name;
|
|
}
|
|
});
|
|
|
|
string = doctrine.unwrapComment(string);
|