UNPKG

@microsoft/api-extractor

Version:

Validatation, documentation, and auditing for the exported API of a TypeScript package

51 lines (50 loc) 1.2 kB
/** * Allowed Token types. */ export declare enum TokenType { /** * A Token that contains only text. */ Text = 0, /** * A Token that specifies a tag. * Example: \@link, \@internal, etc. */ Tag = 1, /** * This is a specific kind of Tag that is important to * distinguish because it contains additional parameters. * * Example: * \{@link http://microosft.com | microsoft home \} * \{@inheritdoc @ microsoft/sp-core-library:Guid.newGuid \} */ Inline = 2, } /** * A structured object created from a doc comment string within a JSDoc comment block. */ export default class Token { /** * The type of the token. */ private _type; /** * This is not used for Text. */ private _tag; /** * For inline tags, this is the parameter. * For text it is the text. */ private _text; constructor(type: TokenType, tag?: string, text?: string); /** * Determines if the type is not what we expect. */ requireType(type: TokenType): void; readonly type: TokenType; readonly tag: string; readonly text: string; private _unescape(text); }