Spaces:
Paused
Paused
Re-add Swagger dependencies (part 3)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- node_modules/@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference.d.ts +200 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference.js +1293 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/configuration/DocNodeManager.js +98 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/configuration/DocNodeManager.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/configuration/TSDocConfiguration.js +223 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/configuration/TSDocConfiguration.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/configuration/TSDocTagDefinition.js +49 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/configuration/TSDocTagDefinition.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/configuration/TSDocValidationConfiguration.js +51 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/configuration/TSDocValidationConfiguration.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/details/ModifierTagSet.js +72 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/details/ModifierTagSet.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/details/StandardModifierTagSet.js +81 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/details/StandardModifierTagSet.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/details/StandardTags.js +561 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/details/StandardTags.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/details/Standardization.js +39 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/details/Standardization.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/emitters/PlainTextEmitter.js +79 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/emitters/PlainTextEmitter.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/emitters/StringBuilder.js +39 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/emitters/StringBuilder.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/emitters/TSDocEmitter.js +371 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/emitters/TSDocEmitter.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/index.js +63 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/index.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/BuiltInDocNodes.js +92 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/BuiltInDocNodes.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocBlock.js +44 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocBlock.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocBlockTag.js +60 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocBlockTag.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocCodeSpan.js +59 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocCodeSpan.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocComment.js +99 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocComment.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocDeclarationReference.js +126 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocDeclarationReference.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocErrorText.js +80 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocErrorText.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocEscapedText.js +71 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocEscapedText.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocExcerpt.js +126 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocExcerpt.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocFencedCode.js +133 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocFencedCode.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocHtmlAttribute.js +137 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocHtmlAttribute.js.map +1 -0
- node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocHtmlEndTag.js +82 -0
node_modules/@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference.d.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Represents a reference to a declaration.
|
| 3 |
+
* @beta
|
| 4 |
+
*/
|
| 5 |
+
export declare class DeclarationReference {
|
| 6 |
+
private _source;
|
| 7 |
+
private _navigation;
|
| 8 |
+
private _symbol;
|
| 9 |
+
constructor(source?: ModuleSource | GlobalSource, navigation?: Navigation.Locals | Navigation.Exports, symbol?: SymbolReference);
|
| 10 |
+
get source(): ModuleSource | GlobalSource | undefined;
|
| 11 |
+
get navigation(): Navigation.Locals | Navigation.Exports | undefined;
|
| 12 |
+
get symbol(): SymbolReference | undefined;
|
| 13 |
+
get isEmpty(): boolean;
|
| 14 |
+
static parse(text: string): DeclarationReference;
|
| 15 |
+
static parseComponent(text: string): Component;
|
| 16 |
+
/**
|
| 17 |
+
* Determines whether the provided string is a well-formed symbol navigation component string.
|
| 18 |
+
*/
|
| 19 |
+
static isWellFormedComponentString(text: string): boolean;
|
| 20 |
+
/**
|
| 21 |
+
* Escapes a string for use as a symbol navigation component. If the string contains any of `!.#~:,"{}()@` or starts
|
| 22 |
+
* with `[`, it is enclosed in quotes.
|
| 23 |
+
*/
|
| 24 |
+
static escapeComponentString(text: string): string;
|
| 25 |
+
/**
|
| 26 |
+
* Unescapes a string used as a symbol navigation component.
|
| 27 |
+
*/
|
| 28 |
+
static unescapeComponentString(text: string): string;
|
| 29 |
+
/**
|
| 30 |
+
* Determines whether the provided string is a well-formed module source string. The string may not
|
| 31 |
+
* have a trailing `!` character.
|
| 32 |
+
*/
|
| 33 |
+
static isWellFormedModuleSourceString(text: string): boolean;
|
| 34 |
+
/**
|
| 35 |
+
* Escapes a string for use as a module source. If the string contains any of `!"` it is enclosed in quotes.
|
| 36 |
+
*/
|
| 37 |
+
static escapeModuleSourceString(text: string): string;
|
| 38 |
+
/**
|
| 39 |
+
* Unescapes a string used as a module source. The string may not have a trailing `!` character.
|
| 40 |
+
*/
|
| 41 |
+
static unescapeModuleSourceString(text: string): string;
|
| 42 |
+
static empty(): DeclarationReference;
|
| 43 |
+
static package(packageName: string, importPath?: string): DeclarationReference;
|
| 44 |
+
static module(path: string, userEscaped?: boolean): DeclarationReference;
|
| 45 |
+
static global(): DeclarationReference;
|
| 46 |
+
static from(base: DeclarationReference | undefined): DeclarationReference;
|
| 47 |
+
withSource(source: ModuleSource | GlobalSource | undefined): DeclarationReference;
|
| 48 |
+
withNavigation(navigation: Navigation.Locals | Navigation.Exports | undefined): DeclarationReference;
|
| 49 |
+
withSymbol(symbol: SymbolReference | undefined): DeclarationReference;
|
| 50 |
+
withComponentPath(componentPath: ComponentPath): DeclarationReference;
|
| 51 |
+
withMeaning(meaning: Meaning | undefined): DeclarationReference;
|
| 52 |
+
withOverloadIndex(overloadIndex: number | undefined): DeclarationReference;
|
| 53 |
+
addNavigationStep(navigation: Navigation, component: ComponentLike): DeclarationReference;
|
| 54 |
+
toString(): string;
|
| 55 |
+
}
|
| 56 |
+
/**
|
| 57 |
+
* Indicates the symbol table from which to resolve the next symbol component.
|
| 58 |
+
* @beta
|
| 59 |
+
*/
|
| 60 |
+
export declare enum Navigation {
|
| 61 |
+
Exports = ".",
|
| 62 |
+
Members = "#",
|
| 63 |
+
Locals = "~"
|
| 64 |
+
}
|
| 65 |
+
/**
|
| 66 |
+
* Represents a module.
|
| 67 |
+
* @beta
|
| 68 |
+
*/
|
| 69 |
+
export declare class ModuleSource {
|
| 70 |
+
readonly escapedPath: string;
|
| 71 |
+
private _path;
|
| 72 |
+
private _pathComponents;
|
| 73 |
+
constructor(path: string, userEscaped?: boolean);
|
| 74 |
+
get path(): string;
|
| 75 |
+
get packageName(): string;
|
| 76 |
+
get scopeName(): string;
|
| 77 |
+
get unscopedPackageName(): string;
|
| 78 |
+
get importPath(): string;
|
| 79 |
+
static fromScopedPackage(scopeName: string | undefined, unscopedPackageName: string, importPath?: string): ModuleSource;
|
| 80 |
+
static fromPackage(packageName: string, importPath?: string): ModuleSource;
|
| 81 |
+
private static _fromPackageName;
|
| 82 |
+
toString(): string;
|
| 83 |
+
private _getOrParsePathComponents;
|
| 84 |
+
}
|
| 85 |
+
/**
|
| 86 |
+
* Represents the global scope.
|
| 87 |
+
* @beta
|
| 88 |
+
*/
|
| 89 |
+
export declare class GlobalSource {
|
| 90 |
+
static readonly instance: GlobalSource;
|
| 91 |
+
private constructor();
|
| 92 |
+
toString(): string;
|
| 93 |
+
}
|
| 94 |
+
/**
|
| 95 |
+
* @beta
|
| 96 |
+
*/
|
| 97 |
+
export type Component = ComponentString | ComponentReference;
|
| 98 |
+
/**
|
| 99 |
+
* @beta
|
| 100 |
+
*/
|
| 101 |
+
export declare namespace Component {
|
| 102 |
+
function from(value: ComponentLike): Component;
|
| 103 |
+
}
|
| 104 |
+
/**
|
| 105 |
+
* @beta
|
| 106 |
+
*/
|
| 107 |
+
export type ComponentLike = Component | DeclarationReference | string;
|
| 108 |
+
/**
|
| 109 |
+
* @beta
|
| 110 |
+
*/
|
| 111 |
+
export declare class ComponentString {
|
| 112 |
+
readonly text: string;
|
| 113 |
+
constructor(text: string, userEscaped?: boolean);
|
| 114 |
+
toString(): string;
|
| 115 |
+
}
|
| 116 |
+
/**
|
| 117 |
+
* @beta
|
| 118 |
+
*/
|
| 119 |
+
export declare class ComponentReference {
|
| 120 |
+
readonly reference: DeclarationReference;
|
| 121 |
+
constructor(reference: DeclarationReference);
|
| 122 |
+
static parse(text: string): ComponentReference;
|
| 123 |
+
withReference(reference: DeclarationReference): ComponentReference;
|
| 124 |
+
toString(): string;
|
| 125 |
+
}
|
| 126 |
+
/**
|
| 127 |
+
* @beta
|
| 128 |
+
*/
|
| 129 |
+
export type ComponentPath = ComponentRoot | ComponentNavigation;
|
| 130 |
+
/**
|
| 131 |
+
* @beta
|
| 132 |
+
*/
|
| 133 |
+
export declare abstract class ComponentPathBase {
|
| 134 |
+
readonly component: Component;
|
| 135 |
+
constructor(component: Component);
|
| 136 |
+
addNavigationStep(this: ComponentPath, navigation: Navigation, component: ComponentLike): ComponentPath;
|
| 137 |
+
abstract toString(): string;
|
| 138 |
+
}
|
| 139 |
+
/**
|
| 140 |
+
* @beta
|
| 141 |
+
*/
|
| 142 |
+
export declare class ComponentRoot extends ComponentPathBase {
|
| 143 |
+
withComponent(component: ComponentLike): ComponentRoot;
|
| 144 |
+
toString(): string;
|
| 145 |
+
}
|
| 146 |
+
/**
|
| 147 |
+
* @beta
|
| 148 |
+
*/
|
| 149 |
+
export declare class ComponentNavigation extends ComponentPathBase {
|
| 150 |
+
readonly parent: ComponentPath;
|
| 151 |
+
readonly navigation: Navigation;
|
| 152 |
+
constructor(parent: ComponentPath, navigation: Navigation, component: Component);
|
| 153 |
+
withParent(parent: ComponentPath): ComponentNavigation;
|
| 154 |
+
withNavigation(navigation: Navigation): ComponentNavigation;
|
| 155 |
+
withComponent(component: ComponentLike): ComponentNavigation;
|
| 156 |
+
toString(): string;
|
| 157 |
+
}
|
| 158 |
+
/**
|
| 159 |
+
* @beta
|
| 160 |
+
*/
|
| 161 |
+
export declare enum Meaning {
|
| 162 |
+
Class = "class",// SymbolFlags.Class
|
| 163 |
+
Interface = "interface",// SymbolFlags.Interface
|
| 164 |
+
TypeAlias = "type",// SymbolFlags.TypeAlias
|
| 165 |
+
Enum = "enum",// SymbolFlags.Enum
|
| 166 |
+
Namespace = "namespace",// SymbolFlags.Module
|
| 167 |
+
Function = "function",// SymbolFlags.Function
|
| 168 |
+
Variable = "var",// SymbolFlags.Variable
|
| 169 |
+
Constructor = "constructor",// SymbolFlags.Constructor
|
| 170 |
+
Member = "member",// SymbolFlags.ClassMember | SymbolFlags.EnumMember
|
| 171 |
+
Event = "event",//
|
| 172 |
+
CallSignature = "call",// SymbolFlags.Signature (for __call)
|
| 173 |
+
ConstructSignature = "new",// SymbolFlags.Signature (for __new)
|
| 174 |
+
IndexSignature = "index",// SymbolFlags.Signature (for __index)
|
| 175 |
+
ComplexType = "complex"
|
| 176 |
+
}
|
| 177 |
+
/**
|
| 178 |
+
* @beta
|
| 179 |
+
*/
|
| 180 |
+
export interface ISymbolReferenceOptions {
|
| 181 |
+
meaning?: Meaning;
|
| 182 |
+
overloadIndex?: number;
|
| 183 |
+
}
|
| 184 |
+
/**
|
| 185 |
+
* Represents a reference to a TypeScript symbol.
|
| 186 |
+
* @beta
|
| 187 |
+
*/
|
| 188 |
+
export declare class SymbolReference {
|
| 189 |
+
readonly componentPath: ComponentPath | undefined;
|
| 190 |
+
readonly meaning: Meaning | undefined;
|
| 191 |
+
readonly overloadIndex: number | undefined;
|
| 192 |
+
constructor(component: ComponentPath | undefined, { meaning, overloadIndex }?: ISymbolReferenceOptions);
|
| 193 |
+
static empty(): SymbolReference;
|
| 194 |
+
withComponentPath(componentPath: ComponentPath | undefined): SymbolReference;
|
| 195 |
+
withMeaning(meaning: Meaning | undefined): SymbolReference;
|
| 196 |
+
withOverloadIndex(overloadIndex: number | undefined): SymbolReference;
|
| 197 |
+
addNavigationStep(navigation: Navigation, component: ComponentLike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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.SymbolReference = exports.Meaning = exports.ComponentNavigation = exports.ComponentRoot = exports.ComponentPathBase = exports.ComponentReference = exports.ComponentString = exports.Component = exports.GlobalSource = exports.ModuleSource = exports.Navigation = exports.DeclarationReference = void 0;
|
| 6 |
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
| 7 |
+
/* eslint-disable @typescript-eslint/naming-convention */
|
| 8 |
+
// NOTE: See DeclarationReference.grammarkdown for information on the underlying grammar.
|
| 9 |
+
const StringChecks_1 = require("../parser/StringChecks");
|
| 10 |
+
/**
|
| 11 |
+
* Represents a reference to a declaration.
|
| 12 |
+
* @beta
|
| 13 |
+
*/
|
| 14 |
+
class DeclarationReference {
|
| 15 |
+
constructor(source, navigation, symbol) {
|
| 16 |
+
this._source = source;
|
| 17 |
+
this._navigation = navigation;
|
| 18 |
+
this._symbol = symbol;
|
| 19 |
+
}
|
| 20 |
+
get source() {
|
| 21 |
+
return this._source;
|
| 22 |
+
}
|
| 23 |
+
get navigation() {
|
| 24 |
+
if (!this._source || !this._symbol) {
|
| 25 |
+
return undefined;
|
| 26 |
+
}
|
| 27 |
+
if (this._source === GlobalSource.instance) {
|
| 28 |
+
return Navigation.Locals;
|
| 29 |
+
}
|
| 30 |
+
if (this._navigation === undefined) {
|
| 31 |
+
return Navigation.Exports;
|
| 32 |
+
}
|
| 33 |
+
return this._navigation;
|
| 34 |
+
}
|
| 35 |
+
get symbol() {
|
| 36 |
+
return this._symbol;
|
| 37 |
+
}
|
| 38 |
+
get isEmpty() {
|
| 39 |
+
return this.source === undefined && this.symbol === undefined;
|
| 40 |
+
}
|
| 41 |
+
static parse(text) {
|
| 42 |
+
const parser = new Parser(text);
|
| 43 |
+
const reference = parser.parseDeclarationReference();
|
| 44 |
+
if (parser.errors.length) {
|
| 45 |
+
throw new SyntaxError(`Invalid DeclarationReference '${text}':\n ${parser.errors.join('\n ')}`);
|
| 46 |
+
}
|
| 47 |
+
if (!parser.eof) {
|
| 48 |
+
throw new SyntaxError(`Invalid DeclarationReference '${text}'`);
|
| 49 |
+
}
|
| 50 |
+
return reference;
|
| 51 |
+
}
|
| 52 |
+
static parseComponent(text) {
|
| 53 |
+
if (text[0] === '[') {
|
| 54 |
+
return ComponentReference.parse(text);
|
| 55 |
+
}
|
| 56 |
+
else {
|
| 57 |
+
return new ComponentString(text, true);
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
/**
|
| 61 |
+
* Determines whether the provided string is a well-formed symbol navigation component string.
|
| 62 |
+
*/
|
| 63 |
+
static isWellFormedComponentString(text) {
|
| 64 |
+
const scanner = new Scanner(text);
|
| 65 |
+
return scanner.scan() === Token.String
|
| 66 |
+
? scanner.scan() === Token.EofToken
|
| 67 |
+
: scanner.token() === Token.Text
|
| 68 |
+
? scanner.scan() === Token.EofToken
|
| 69 |
+
: scanner.token() === Token.EofToken;
|
| 70 |
+
}
|
| 71 |
+
/**
|
| 72 |
+
* Escapes a string for use as a symbol navigation component. If the string contains any of `!.#~:,"{}()@` or starts
|
| 73 |
+
* with `[`, it is enclosed in quotes.
|
| 74 |
+
*/
|
| 75 |
+
static escapeComponentString(text) {
|
| 76 |
+
if (text.length === 0) {
|
| 77 |
+
return '""';
|
| 78 |
+
}
|
| 79 |
+
const ch = text.charAt(0);
|
| 80 |
+
if (ch === '[' || ch === '"' || !this.isWellFormedComponentString(text)) {
|
| 81 |
+
return JSON.stringify(text);
|
| 82 |
+
}
|
| 83 |
+
return text;
|
| 84 |
+
}
|
| 85 |
+
/**
|
| 86 |
+
* Unescapes a string used as a symbol navigation component.
|
| 87 |
+
*/
|
| 88 |
+
static unescapeComponentString(text) {
|
| 89 |
+
if (text.length >= 2 && text.charAt(0) === '"' && text.charAt(text.length - 1) === '"') {
|
| 90 |
+
try {
|
| 91 |
+
return JSON.parse(text);
|
| 92 |
+
}
|
| 93 |
+
catch (_a) {
|
| 94 |
+
throw new SyntaxError(`Invalid Component '${text}'`);
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
if (!this.isWellFormedComponentString(text)) {
|
| 98 |
+
throw new SyntaxError(`Invalid Component '${text}'`);
|
| 99 |
+
}
|
| 100 |
+
return text;
|
| 101 |
+
}
|
| 102 |
+
/**
|
| 103 |
+
* Determines whether the provided string is a well-formed module source string. The string may not
|
| 104 |
+
* have a trailing `!` character.
|
| 105 |
+
*/
|
| 106 |
+
static isWellFormedModuleSourceString(text) {
|
| 107 |
+
const scanner = new Scanner(text + '!');
|
| 108 |
+
return (scanner.rescanModuleSource() === Token.ModuleSource &&
|
| 109 |
+
!scanner.stringIsUnterminated &&
|
| 110 |
+
scanner.scan() === Token.ExclamationToken &&
|
| 111 |
+
scanner.scan() === Token.EofToken);
|
| 112 |
+
}
|
| 113 |
+
/**
|
| 114 |
+
* Escapes a string for use as a module source. If the string contains any of `!"` it is enclosed in quotes.
|
| 115 |
+
*/
|
| 116 |
+
static escapeModuleSourceString(text) {
|
| 117 |
+
if (text.length === 0) {
|
| 118 |
+
return '""';
|
| 119 |
+
}
|
| 120 |
+
const ch = text.charAt(0);
|
| 121 |
+
if (ch === '"' || !this.isWellFormedModuleSourceString(text)) {
|
| 122 |
+
return JSON.stringify(text);
|
| 123 |
+
}
|
| 124 |
+
return text;
|
| 125 |
+
}
|
| 126 |
+
/**
|
| 127 |
+
* Unescapes a string used as a module source. The string may not have a trailing `!` character.
|
| 128 |
+
*/
|
| 129 |
+
static unescapeModuleSourceString(text) {
|
| 130 |
+
if (text.length >= 2 && text.charAt(0) === '"' && text.charAt(text.length - 1) === '"') {
|
| 131 |
+
try {
|
| 132 |
+
return JSON.parse(text);
|
| 133 |
+
}
|
| 134 |
+
catch (_a) {
|
| 135 |
+
throw new SyntaxError(`Invalid Module source '${text}'`);
|
| 136 |
+
}
|
| 137 |
+
}
|
| 138 |
+
if (!this.isWellFormedModuleSourceString(text)) {
|
| 139 |
+
throw new SyntaxError(`Invalid Module source '${text}'`);
|
| 140 |
+
}
|
| 141 |
+
return text;
|
| 142 |
+
}
|
| 143 |
+
static empty() {
|
| 144 |
+
return new DeclarationReference();
|
| 145 |
+
}
|
| 146 |
+
static package(packageName, importPath) {
|
| 147 |
+
return new DeclarationReference(ModuleSource.fromPackage(packageName, importPath));
|
| 148 |
+
}
|
| 149 |
+
static module(path, userEscaped) {
|
| 150 |
+
return new DeclarationReference(new ModuleSource(path, userEscaped));
|
| 151 |
+
}
|
| 152 |
+
static global() {
|
| 153 |
+
return new DeclarationReference(GlobalSource.instance);
|
| 154 |
+
}
|
| 155 |
+
static from(base) {
|
| 156 |
+
return base || this.empty();
|
| 157 |
+
}
|
| 158 |
+
withSource(source) {
|
| 159 |
+
return this._source === source ? this : new DeclarationReference(source, this._navigation, this._symbol);
|
| 160 |
+
}
|
| 161 |
+
withNavigation(navigation) {
|
| 162 |
+
return this._navigation === navigation
|
| 163 |
+
? this
|
| 164 |
+
: new DeclarationReference(this._source, navigation, this._symbol);
|
| 165 |
+
}
|
| 166 |
+
withSymbol(symbol) {
|
| 167 |
+
return this._symbol === symbol ? this : new DeclarationReference(this._source, this._navigation, symbol);
|
| 168 |
+
}
|
| 169 |
+
withComponentPath(componentPath) {
|
| 170 |
+
return this.withSymbol(this.symbol ? this.symbol.withComponentPath(componentPath) : new SymbolReference(componentPath));
|
| 171 |
+
}
|
| 172 |
+
withMeaning(meaning) {
|
| 173 |
+
if (!this.symbol) {
|
| 174 |
+
if (meaning === undefined) {
|
| 175 |
+
return this;
|
| 176 |
+
}
|
| 177 |
+
return this.withSymbol(SymbolReference.empty().withMeaning(meaning));
|
| 178 |
+
}
|
| 179 |
+
return this.withSymbol(this.symbol.withMeaning(meaning));
|
| 180 |
+
}
|
| 181 |
+
withOverloadIndex(overloadIndex) {
|
| 182 |
+
if (!this.symbol) {
|
| 183 |
+
if (overloadIndex === undefined) {
|
| 184 |
+
return this;
|
| 185 |
+
}
|
| 186 |
+
return this.withSymbol(SymbolReference.empty().withOverloadIndex(overloadIndex));
|
| 187 |
+
}
|
| 188 |
+
return this.withSymbol(this.symbol.withOverloadIndex(overloadIndex));
|
| 189 |
+
}
|
| 190 |
+
addNavigationStep(navigation, component) {
|
| 191 |
+
if (this.symbol) {
|
| 192 |
+
return this.withSymbol(this.symbol.addNavigationStep(navigation, component));
|
| 193 |
+
}
|
| 194 |
+
if (navigation === Navigation.Members) {
|
| 195 |
+
navigation = Navigation.Exports;
|
| 196 |
+
}
|
| 197 |
+
const symbol = new SymbolReference(new ComponentRoot(Component.from(component)));
|
| 198 |
+
return new DeclarationReference(this.source, navigation, symbol);
|
| 199 |
+
}
|
| 200 |
+
toString() {
|
| 201 |
+
const navigation = this._source instanceof ModuleSource && this._symbol && this.navigation === Navigation.Locals
|
| 202 |
+
? '~'
|
| 203 |
+
: '';
|
| 204 |
+
return `${this.source || ''}${navigation}${this.symbol || ''}`;
|
| 205 |
+
}
|
| 206 |
+
}
|
| 207 |
+
exports.DeclarationReference = DeclarationReference;
|
| 208 |
+
/**
|
| 209 |
+
* Indicates the symbol table from which to resolve the next symbol component.
|
| 210 |
+
* @beta
|
| 211 |
+
*/
|
| 212 |
+
var Navigation;
|
| 213 |
+
(function (Navigation) {
|
| 214 |
+
Navigation["Exports"] = ".";
|
| 215 |
+
Navigation["Members"] = "#";
|
| 216 |
+
Navigation["Locals"] = "~";
|
| 217 |
+
})(Navigation || (exports.Navigation = Navigation = {}));
|
| 218 |
+
/**
|
| 219 |
+
* Represents a module.
|
| 220 |
+
* @beta
|
| 221 |
+
*/
|
| 222 |
+
class ModuleSource {
|
| 223 |
+
constructor(path, userEscaped = true) {
|
| 224 |
+
this.escapedPath =
|
| 225 |
+
this instanceof ParsedModuleSource ? path : escapeModuleSourceIfNeeded(path, userEscaped);
|
| 226 |
+
}
|
| 227 |
+
get path() {
|
| 228 |
+
return this._path || (this._path = DeclarationReference.unescapeModuleSourceString(this.escapedPath));
|
| 229 |
+
}
|
| 230 |
+
get packageName() {
|
| 231 |
+
return this._getOrParsePathComponents().packageName;
|
| 232 |
+
}
|
| 233 |
+
get scopeName() {
|
| 234 |
+
const scopeName = this._getOrParsePathComponents().scopeName;
|
| 235 |
+
return scopeName ? '@' + scopeName : '';
|
| 236 |
+
}
|
| 237 |
+
get unscopedPackageName() {
|
| 238 |
+
return this._getOrParsePathComponents().unscopedPackageName;
|
| 239 |
+
}
|
| 240 |
+
get importPath() {
|
| 241 |
+
return this._getOrParsePathComponents().importPath || '';
|
| 242 |
+
}
|
| 243 |
+
static fromScopedPackage(scopeName, unscopedPackageName, importPath) {
|
| 244 |
+
let packageName = unscopedPackageName;
|
| 245 |
+
if (scopeName) {
|
| 246 |
+
if (scopeName.charAt(0) === '@') {
|
| 247 |
+
scopeName = scopeName.slice(1);
|
| 248 |
+
}
|
| 249 |
+
packageName = `@${scopeName}/${unscopedPackageName}`;
|
| 250 |
+
}
|
| 251 |
+
const parsed = { packageName, scopeName: scopeName || '', unscopedPackageName };
|
| 252 |
+
return this._fromPackageName(parsed, packageName, importPath);
|
| 253 |
+
}
|
| 254 |
+
static fromPackage(packageName, importPath) {
|
| 255 |
+
return this._fromPackageName(parsePackageName(packageName), packageName, importPath);
|
| 256 |
+
}
|
| 257 |
+
static _fromPackageName(parsed, packageName, importPath) {
|
| 258 |
+
if (!parsed) {
|
| 259 |
+
throw new Error('Parsed package must be provided.');
|
| 260 |
+
}
|
| 261 |
+
const packageNameError = StringChecks_1.StringChecks.explainIfInvalidPackageName(packageName);
|
| 262 |
+
if (packageNameError) {
|
| 263 |
+
throw new SyntaxError(`Invalid NPM package name: ${packageNameError}`);
|
| 264 |
+
}
|
| 265 |
+
let path = packageName;
|
| 266 |
+
if (importPath) {
|
| 267 |
+
if (invalidImportPathRegExp.test(importPath)) {
|
| 268 |
+
throw new SyntaxError(`Invalid import path '${importPath}`);
|
| 269 |
+
}
|
| 270 |
+
path += '/' + importPath;
|
| 271 |
+
parsed.importPath = importPath;
|
| 272 |
+
}
|
| 273 |
+
const source = new ModuleSource(path);
|
| 274 |
+
source._pathComponents = parsed;
|
| 275 |
+
return source;
|
| 276 |
+
}
|
| 277 |
+
toString() {
|
| 278 |
+
return `${this.escapedPath}!`;
|
| 279 |
+
}
|
| 280 |
+
_getOrParsePathComponents() {
|
| 281 |
+
if (!this._pathComponents) {
|
| 282 |
+
const path = this.path;
|
| 283 |
+
const parsed = parsePackageName(path);
|
| 284 |
+
if (parsed && !StringChecks_1.StringChecks.explainIfInvalidPackageName(parsed.packageName)) {
|
| 285 |
+
this._pathComponents = parsed;
|
| 286 |
+
}
|
| 287 |
+
else {
|
| 288 |
+
this._pathComponents = {
|
| 289 |
+
packageName: '',
|
| 290 |
+
scopeName: '',
|
| 291 |
+
unscopedPackageName: '',
|
| 292 |
+
importPath: path
|
| 293 |
+
};
|
| 294 |
+
}
|
| 295 |
+
}
|
| 296 |
+
return this._pathComponents;
|
| 297 |
+
}
|
| 298 |
+
}
|
| 299 |
+
exports.ModuleSource = ModuleSource;
|
| 300 |
+
class ParsedModuleSource extends ModuleSource {
|
| 301 |
+
}
|
| 302 |
+
// matches the following:
|
| 303 |
+
// 'foo' -> ["foo", "foo", undefined, "foo", undefined]
|
| 304 |
+
// 'foo/bar' -> ["foo/bar", "foo", undefined, "foo", "bar"]
|
| 305 |
+
// '@scope/foo' -> ["@scope/foo", "@scope/foo", "scope", "foo", undefined]
|
| 306 |
+
// '@scope/foo/bar' -> ["@scope/foo/bar", "@scope/foo", "scope", "foo", "bar"]
|
| 307 |
+
// does not match:
|
| 308 |
+
// '/'
|
| 309 |
+
// '@/'
|
| 310 |
+
// '@scope/'
|
| 311 |
+
// capture groups:
|
| 312 |
+
// 1. The package name (including scope)
|
| 313 |
+
// 2. The scope name (excluding the leading '@')
|
| 314 |
+
// 3. The unscoped package name
|
| 315 |
+
// 4. The package-relative import path
|
| 316 |
+
const packageNameRegExp = /^((?:@([^/]+?)\/)?([^/]+?))(?:\/(.+))?$/;
|
| 317 |
+
// no leading './' or '.\'
|
| 318 |
+
// no leading '../' or '..\'
|
| 319 |
+
// no leading '/' or '\'
|
| 320 |
+
// not '.' or '..'
|
| 321 |
+
const invalidImportPathRegExp = /^(\.\.?([\\/]|$)|[\\/])/;
|
| 322 |
+
// eslint-disable-next-line @rushstack/no-new-null
|
| 323 |
+
function parsePackageName(text) {
|
| 324 |
+
const match = packageNameRegExp.exec(text);
|
| 325 |
+
if (!match) {
|
| 326 |
+
return match;
|
| 327 |
+
}
|
| 328 |
+
const [, packageName = '', scopeName = '', unscopedPackageName = '', importPath] = match;
|
| 329 |
+
return { packageName, scopeName, unscopedPackageName, importPath };
|
| 330 |
+
}
|
| 331 |
+
/**
|
| 332 |
+
* Represents the global scope.
|
| 333 |
+
* @beta
|
| 334 |
+
*/
|
| 335 |
+
class GlobalSource {
|
| 336 |
+
constructor() { }
|
| 337 |
+
toString() {
|
| 338 |
+
return '!';
|
| 339 |
+
}
|
| 340 |
+
}
|
| 341 |
+
exports.GlobalSource = GlobalSource;
|
| 342 |
+
GlobalSource.instance = new GlobalSource();
|
| 343 |
+
/**
|
| 344 |
+
* @beta
|
| 345 |
+
*/
|
| 346 |
+
// eslint-disable-next-line @typescript-eslint/no-namespace,@typescript-eslint/no-redeclare
|
| 347 |
+
var Component;
|
| 348 |
+
(function (Component) {
|
| 349 |
+
function from(value) {
|
| 350 |
+
if (typeof value === 'string') {
|
| 351 |
+
return new ComponentString(value);
|
| 352 |
+
}
|
| 353 |
+
if (value instanceof DeclarationReference) {
|
| 354 |
+
return new ComponentReference(value);
|
| 355 |
+
}
|
| 356 |
+
return value;
|
| 357 |
+
}
|
| 358 |
+
Component.from = from;
|
| 359 |
+
})(Component || (exports.Component = Component = {}));
|
| 360 |
+
/**
|
| 361 |
+
* @beta
|
| 362 |
+
*/
|
| 363 |
+
class ComponentString {
|
| 364 |
+
constructor(text, userEscaped) {
|
| 365 |
+
this.text = this instanceof ParsedComponentString ? text : escapeComponentIfNeeded(text, userEscaped);
|
| 366 |
+
}
|
| 367 |
+
toString() {
|
| 368 |
+
return this.text;
|
| 369 |
+
}
|
| 370 |
+
}
|
| 371 |
+
exports.ComponentString = ComponentString;
|
| 372 |
+
class ParsedComponentString extends ComponentString {
|
| 373 |
+
}
|
| 374 |
+
/**
|
| 375 |
+
* @beta
|
| 376 |
+
*/
|
| 377 |
+
class ComponentReference {
|
| 378 |
+
constructor(reference) {
|
| 379 |
+
this.reference = reference;
|
| 380 |
+
}
|
| 381 |
+
static parse(text) {
|
| 382 |
+
if (text.length > 2 && text.charAt(0) === '[' && text.charAt(text.length - 1) === ']') {
|
| 383 |
+
return new ComponentReference(DeclarationReference.parse(text.slice(1, -1)));
|
| 384 |
+
}
|
| 385 |
+
throw new SyntaxError(`Invalid component reference: '${text}'`);
|
| 386 |
+
}
|
| 387 |
+
withReference(reference) {
|
| 388 |
+
return this.reference === reference ? this : new ComponentReference(reference);
|
| 389 |
+
}
|
| 390 |
+
toString() {
|
| 391 |
+
return `[${this.reference}]`;
|
| 392 |
+
}
|
| 393 |
+
}
|
| 394 |
+
exports.ComponentReference = ComponentReference;
|
| 395 |
+
/**
|
| 396 |
+
* @beta
|
| 397 |
+
*/
|
| 398 |
+
class ComponentPathBase {
|
| 399 |
+
constructor(component) {
|
| 400 |
+
this.component = component;
|
| 401 |
+
}
|
| 402 |
+
addNavigationStep(navigation, component) {
|
| 403 |
+
// tslint:disable-next-line:no-use-before-declare
|
| 404 |
+
return new ComponentNavigation(this, navigation, Component.from(component));
|
| 405 |
+
}
|
| 406 |
+
}
|
| 407 |
+
exports.ComponentPathBase = ComponentPathBase;
|
| 408 |
+
/**
|
| 409 |
+
* @beta
|
| 410 |
+
*/
|
| 411 |
+
class ComponentRoot extends ComponentPathBase {
|
| 412 |
+
withComponent(component) {
|
| 413 |
+
return this.component === component ? this : new ComponentRoot(Component.from(component));
|
| 414 |
+
}
|
| 415 |
+
toString() {
|
| 416 |
+
return this.component.toString();
|
| 417 |
+
}
|
| 418 |
+
}
|
| 419 |
+
exports.ComponentRoot = ComponentRoot;
|
| 420 |
+
/**
|
| 421 |
+
* @beta
|
| 422 |
+
*/
|
| 423 |
+
class ComponentNavigation extends ComponentPathBase {
|
| 424 |
+
constructor(parent, navigation, component) {
|
| 425 |
+
super(component);
|
| 426 |
+
this.parent = parent;
|
| 427 |
+
this.navigation = navigation;
|
| 428 |
+
}
|
| 429 |
+
withParent(parent) {
|
| 430 |
+
return this.parent === parent ? this : new ComponentNavigation(parent, this.navigation, this.component);
|
| 431 |
+
}
|
| 432 |
+
withNavigation(navigation) {
|
| 433 |
+
return this.navigation === navigation
|
| 434 |
+
? this
|
| 435 |
+
: new ComponentNavigation(this.parent, navigation, this.component);
|
| 436 |
+
}
|
| 437 |
+
withComponent(component) {
|
| 438 |
+
return this.component === component
|
| 439 |
+
? this
|
| 440 |
+
: new ComponentNavigation(this.parent, this.navigation, Component.from(component));
|
| 441 |
+
}
|
| 442 |
+
toString() {
|
| 443 |
+
return `${this.parent}${formatNavigation(this.navigation)}${this.component}`;
|
| 444 |
+
}
|
| 445 |
+
}
|
| 446 |
+
exports.ComponentNavigation = ComponentNavigation;
|
| 447 |
+
/**
|
| 448 |
+
* @beta
|
| 449 |
+
*/
|
| 450 |
+
var Meaning;
|
| 451 |
+
(function (Meaning) {
|
| 452 |
+
Meaning["Class"] = "class";
|
| 453 |
+
Meaning["Interface"] = "interface";
|
| 454 |
+
Meaning["TypeAlias"] = "type";
|
| 455 |
+
Meaning["Enum"] = "enum";
|
| 456 |
+
Meaning["Namespace"] = "namespace";
|
| 457 |
+
Meaning["Function"] = "function";
|
| 458 |
+
Meaning["Variable"] = "var";
|
| 459 |
+
Meaning["Constructor"] = "constructor";
|
| 460 |
+
Meaning["Member"] = "member";
|
| 461 |
+
Meaning["Event"] = "event";
|
| 462 |
+
Meaning["CallSignature"] = "call";
|
| 463 |
+
Meaning["ConstructSignature"] = "new";
|
| 464 |
+
Meaning["IndexSignature"] = "index";
|
| 465 |
+
Meaning["ComplexType"] = "complex"; // Any complex type
|
| 466 |
+
})(Meaning || (exports.Meaning = Meaning = {}));
|
| 467 |
+
/**
|
| 468 |
+
* Represents a reference to a TypeScript symbol.
|
| 469 |
+
* @beta
|
| 470 |
+
*/
|
| 471 |
+
class SymbolReference {
|
| 472 |
+
constructor(component, { meaning, overloadIndex } = {}) {
|
| 473 |
+
this.componentPath = component;
|
| 474 |
+
this.overloadIndex = overloadIndex;
|
| 475 |
+
this.meaning = meaning;
|
| 476 |
+
}
|
| 477 |
+
static empty() {
|
| 478 |
+
return new SymbolReference(/*component*/ undefined);
|
| 479 |
+
}
|
| 480 |
+
withComponentPath(componentPath) {
|
| 481 |
+
return this.componentPath === componentPath
|
| 482 |
+
? this
|
| 483 |
+
: new SymbolReference(componentPath, {
|
| 484 |
+
meaning: this.meaning,
|
| 485 |
+
overloadIndex: this.overloadIndex
|
| 486 |
+
});
|
| 487 |
+
}
|
| 488 |
+
withMeaning(meaning) {
|
| 489 |
+
return this.meaning === meaning
|
| 490 |
+
? this
|
| 491 |
+
: new SymbolReference(this.componentPath, {
|
| 492 |
+
meaning,
|
| 493 |
+
overloadIndex: this.overloadIndex
|
| 494 |
+
});
|
| 495 |
+
}
|
| 496 |
+
withOverloadIndex(overloadIndex) {
|
| 497 |
+
return this.overloadIndex === overloadIndex
|
| 498 |
+
? this
|
| 499 |
+
: new SymbolReference(this.componentPath, {
|
| 500 |
+
meaning: this.meaning,
|
| 501 |
+
overloadIndex
|
| 502 |
+
});
|
| 503 |
+
}
|
| 504 |
+
addNavigationStep(navigation, component) {
|
| 505 |
+
if (!this.componentPath) {
|
| 506 |
+
throw new Error('Cannot add a navigation step to an empty symbol reference.');
|
| 507 |
+
}
|
| 508 |
+
return new SymbolReference(this.componentPath.addNavigationStep(navigation, component));
|
| 509 |
+
}
|
| 510 |
+
toString() {
|
| 511 |
+
let result = `${this.componentPath || ''}`;
|
| 512 |
+
if (this.meaning && this.overloadIndex !== undefined) {
|
| 513 |
+
result += `:${this.meaning}(${this.overloadIndex})`;
|
| 514 |
+
}
|
| 515 |
+
else if (this.meaning) {
|
| 516 |
+
result += `:${this.meaning}`;
|
| 517 |
+
}
|
| 518 |
+
else if (this.overloadIndex !== undefined) {
|
| 519 |
+
result += `:${this.overloadIndex}`;
|
| 520 |
+
}
|
| 521 |
+
return result;
|
| 522 |
+
}
|
| 523 |
+
}
|
| 524 |
+
exports.SymbolReference = SymbolReference;
|
| 525 |
+
var Token;
|
| 526 |
+
(function (Token) {
|
| 527 |
+
Token[Token["None"] = 0] = "None";
|
| 528 |
+
Token[Token["EofToken"] = 1] = "EofToken";
|
| 529 |
+
// Punctuator
|
| 530 |
+
Token[Token["OpenBraceToken"] = 2] = "OpenBraceToken";
|
| 531 |
+
Token[Token["CloseBraceToken"] = 3] = "CloseBraceToken";
|
| 532 |
+
Token[Token["OpenParenToken"] = 4] = "OpenParenToken";
|
| 533 |
+
Token[Token["CloseParenToken"] = 5] = "CloseParenToken";
|
| 534 |
+
Token[Token["OpenBracketToken"] = 6] = "OpenBracketToken";
|
| 535 |
+
Token[Token["CloseBracketToken"] = 7] = "CloseBracketToken";
|
| 536 |
+
Token[Token["ExclamationToken"] = 8] = "ExclamationToken";
|
| 537 |
+
Token[Token["DotToken"] = 9] = "DotToken";
|
| 538 |
+
Token[Token["HashToken"] = 10] = "HashToken";
|
| 539 |
+
Token[Token["TildeToken"] = 11] = "TildeToken";
|
| 540 |
+
Token[Token["ColonToken"] = 12] = "ColonToken";
|
| 541 |
+
Token[Token["CommaToken"] = 13] = "CommaToken";
|
| 542 |
+
Token[Token["AtToken"] = 14] = "AtToken";
|
| 543 |
+
Token[Token["DecimalDigits"] = 15] = "DecimalDigits";
|
| 544 |
+
Token[Token["String"] = 16] = "String";
|
| 545 |
+
Token[Token["Text"] = 17] = "Text";
|
| 546 |
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
| 547 |
+
Token[Token["ModuleSource"] = 18] = "ModuleSource";
|
| 548 |
+
// Keywords
|
| 549 |
+
Token[Token["ClassKeyword"] = 19] = "ClassKeyword";
|
| 550 |
+
Token[Token["InterfaceKeyword"] = 20] = "InterfaceKeyword";
|
| 551 |
+
Token[Token["TypeKeyword"] = 21] = "TypeKeyword";
|
| 552 |
+
Token[Token["EnumKeyword"] = 22] = "EnumKeyword";
|
| 553 |
+
Token[Token["NamespaceKeyword"] = 23] = "NamespaceKeyword";
|
| 554 |
+
Token[Token["FunctionKeyword"] = 24] = "FunctionKeyword";
|
| 555 |
+
Token[Token["VarKeyword"] = 25] = "VarKeyword";
|
| 556 |
+
Token[Token["ConstructorKeyword"] = 26] = "ConstructorKeyword";
|
| 557 |
+
Token[Token["MemberKeyword"] = 27] = "MemberKeyword";
|
| 558 |
+
Token[Token["EventKeyword"] = 28] = "EventKeyword";
|
| 559 |
+
Token[Token["CallKeyword"] = 29] = "CallKeyword";
|
| 560 |
+
Token[Token["NewKeyword"] = 30] = "NewKeyword";
|
| 561 |
+
Token[Token["IndexKeyword"] = 31] = "IndexKeyword";
|
| 562 |
+
Token[Token["ComplexKeyword"] = 32] = "ComplexKeyword"; // 'complex'
|
| 563 |
+
})(Token || (Token = {}));
|
| 564 |
+
function tokenToString(token) {
|
| 565 |
+
switch (token) {
|
| 566 |
+
case Token.OpenBraceToken:
|
| 567 |
+
return '{';
|
| 568 |
+
case Token.CloseBraceToken:
|
| 569 |
+
return '}';
|
| 570 |
+
case Token.OpenParenToken:
|
| 571 |
+
return '(';
|
| 572 |
+
case Token.CloseParenToken:
|
| 573 |
+
return ')';
|
| 574 |
+
case Token.OpenBracketToken:
|
| 575 |
+
return '[';
|
| 576 |
+
case Token.CloseBracketToken:
|
| 577 |
+
return ']';
|
| 578 |
+
case Token.ExclamationToken:
|
| 579 |
+
return '!';
|
| 580 |
+
case Token.DotToken:
|
| 581 |
+
return '.';
|
| 582 |
+
case Token.HashToken:
|
| 583 |
+
return '#';
|
| 584 |
+
case Token.TildeToken:
|
| 585 |
+
return '~';
|
| 586 |
+
case Token.ColonToken:
|
| 587 |
+
return ':';
|
| 588 |
+
case Token.CommaToken:
|
| 589 |
+
return ',';
|
| 590 |
+
case Token.AtToken:
|
| 591 |
+
return '@';
|
| 592 |
+
case Token.ClassKeyword:
|
| 593 |
+
return 'class';
|
| 594 |
+
case Token.InterfaceKeyword:
|
| 595 |
+
return 'interface';
|
| 596 |
+
case Token.TypeKeyword:
|
| 597 |
+
return 'type';
|
| 598 |
+
case Token.EnumKeyword:
|
| 599 |
+
return 'enum';
|
| 600 |
+
case Token.NamespaceKeyword:
|
| 601 |
+
return 'namespace';
|
| 602 |
+
case Token.FunctionKeyword:
|
| 603 |
+
return 'function';
|
| 604 |
+
case Token.VarKeyword:
|
| 605 |
+
return 'var';
|
| 606 |
+
case Token.ConstructorKeyword:
|
| 607 |
+
return 'constructor';
|
| 608 |
+
case Token.MemberKeyword:
|
| 609 |
+
return 'member';
|
| 610 |
+
case Token.EventKeyword:
|
| 611 |
+
return 'event';
|
| 612 |
+
case Token.CallKeyword:
|
| 613 |
+
return 'call';
|
| 614 |
+
case Token.NewKeyword:
|
| 615 |
+
return 'new';
|
| 616 |
+
case Token.IndexKeyword:
|
| 617 |
+
return 'index';
|
| 618 |
+
case Token.ComplexKeyword:
|
| 619 |
+
return 'complex';
|
| 620 |
+
case Token.None:
|
| 621 |
+
return '<none>';
|
| 622 |
+
case Token.EofToken:
|
| 623 |
+
return '<eof>';
|
| 624 |
+
case Token.DecimalDigits:
|
| 625 |
+
return '<decimal digits>';
|
| 626 |
+
case Token.String:
|
| 627 |
+
return '<string>';
|
| 628 |
+
case Token.Text:
|
| 629 |
+
return '<text>';
|
| 630 |
+
case Token.ModuleSource:
|
| 631 |
+
return '<module source>';
|
| 632 |
+
}
|
| 633 |
+
}
|
| 634 |
+
class Scanner {
|
| 635 |
+
constructor(text) {
|
| 636 |
+
this._pos = 0;
|
| 637 |
+
this._tokenPos = 0;
|
| 638 |
+
this._stringIsUnterminated = false;
|
| 639 |
+
this._token = Token.None;
|
| 640 |
+
this._text = text;
|
| 641 |
+
}
|
| 642 |
+
get stringIsUnterminated() {
|
| 643 |
+
return this._stringIsUnterminated;
|
| 644 |
+
}
|
| 645 |
+
get text() {
|
| 646 |
+
return this._text;
|
| 647 |
+
}
|
| 648 |
+
get tokenText() {
|
| 649 |
+
return this._text.slice(this._tokenPos, this._pos);
|
| 650 |
+
}
|
| 651 |
+
get eof() {
|
| 652 |
+
return this._pos >= this._text.length;
|
| 653 |
+
}
|
| 654 |
+
token() {
|
| 655 |
+
return this._token;
|
| 656 |
+
}
|
| 657 |
+
speculate(cb) {
|
| 658 |
+
const tokenPos = this._tokenPos;
|
| 659 |
+
const pos = this._pos;
|
| 660 |
+
const text = this._text;
|
| 661 |
+
const token = this._token;
|
| 662 |
+
const stringIsUnterminated = this._stringIsUnterminated;
|
| 663 |
+
let accepted = false;
|
| 664 |
+
try {
|
| 665 |
+
const accept = () => {
|
| 666 |
+
accepted = true;
|
| 667 |
+
};
|
| 668 |
+
return cb(accept);
|
| 669 |
+
}
|
| 670 |
+
finally {
|
| 671 |
+
if (!accepted) {
|
| 672 |
+
this._tokenPos = tokenPos;
|
| 673 |
+
this._pos = pos;
|
| 674 |
+
this._text = text;
|
| 675 |
+
this._token = token;
|
| 676 |
+
this._stringIsUnterminated = stringIsUnterminated;
|
| 677 |
+
}
|
| 678 |
+
}
|
| 679 |
+
}
|
| 680 |
+
scan() {
|
| 681 |
+
if (!this.eof) {
|
| 682 |
+
this._tokenPos = this._pos;
|
| 683 |
+
this._stringIsUnterminated = false;
|
| 684 |
+
while (!this.eof) {
|
| 685 |
+
const ch = this._text.charAt(this._pos++);
|
| 686 |
+
switch (ch) {
|
| 687 |
+
case '{':
|
| 688 |
+
return (this._token = Token.OpenBraceToken);
|
| 689 |
+
case '}':
|
| 690 |
+
return (this._token = Token.CloseBraceToken);
|
| 691 |
+
case '(':
|
| 692 |
+
return (this._token = Token.OpenParenToken);
|
| 693 |
+
case ')':
|
| 694 |
+
return (this._token = Token.CloseParenToken);
|
| 695 |
+
case '[':
|
| 696 |
+
return (this._token = Token.OpenBracketToken);
|
| 697 |
+
case ']':
|
| 698 |
+
return (this._token = Token.CloseBracketToken);
|
| 699 |
+
case '!':
|
| 700 |
+
return (this._token = Token.ExclamationToken);
|
| 701 |
+
case '.':
|
| 702 |
+
return (this._token = Token.DotToken);
|
| 703 |
+
case '#':
|
| 704 |
+
return (this._token = Token.HashToken);
|
| 705 |
+
case '~':
|
| 706 |
+
return (this._token = Token.TildeToken);
|
| 707 |
+
case ':':
|
| 708 |
+
return (this._token = Token.ColonToken);
|
| 709 |
+
case ',':
|
| 710 |
+
return (this._token = Token.CommaToken);
|
| 711 |
+
case '@':
|
| 712 |
+
return (this._token = Token.AtToken);
|
| 713 |
+
case '"':
|
| 714 |
+
this.scanString();
|
| 715 |
+
return (this._token = Token.String);
|
| 716 |
+
default:
|
| 717 |
+
this.scanText();
|
| 718 |
+
return (this._token = Token.Text);
|
| 719 |
+
}
|
| 720 |
+
}
|
| 721 |
+
}
|
| 722 |
+
return (this._token = Token.EofToken);
|
| 723 |
+
}
|
| 724 |
+
rescanModuleSource() {
|
| 725 |
+
switch (this._token) {
|
| 726 |
+
case Token.ModuleSource:
|
| 727 |
+
case Token.ExclamationToken:
|
| 728 |
+
case Token.EofToken:
|
| 729 |
+
return this._token;
|
| 730 |
+
}
|
| 731 |
+
return this.speculate((accept) => {
|
| 732 |
+
if (!this.eof) {
|
| 733 |
+
this._pos = this._tokenPos;
|
| 734 |
+
this._stringIsUnterminated = false;
|
| 735 |
+
let scanned = 'none';
|
| 736 |
+
while (!this.eof) {
|
| 737 |
+
const ch = this._text[this._pos];
|
| 738 |
+
if (ch === '!') {
|
| 739 |
+
if (scanned === 'none') {
|
| 740 |
+
return this._token;
|
| 741 |
+
}
|
| 742 |
+
accept();
|
| 743 |
+
return (this._token = Token.ModuleSource);
|
| 744 |
+
}
|
| 745 |
+
this._pos++;
|
| 746 |
+
if (ch === '"') {
|
| 747 |
+
if (scanned === 'other') {
|
| 748 |
+
// strings not allowed after scanning any other characters
|
| 749 |
+
return this._token;
|
| 750 |
+
}
|
| 751 |
+
scanned = 'string';
|
| 752 |
+
this.scanString();
|
| 753 |
+
}
|
| 754 |
+
else {
|
| 755 |
+
if (scanned === 'string') {
|
| 756 |
+
// no other tokens allowed after string
|
| 757 |
+
return this._token;
|
| 758 |
+
}
|
| 759 |
+
scanned = 'other';
|
| 760 |
+
if (!isPunctuator(ch)) {
|
| 761 |
+
this.scanText();
|
| 762 |
+
}
|
| 763 |
+
}
|
| 764 |
+
}
|
| 765 |
+
}
|
| 766 |
+
return this._token;
|
| 767 |
+
});
|
| 768 |
+
}
|
| 769 |
+
rescanMeaning() {
|
| 770 |
+
if (this._token === Token.Text) {
|
| 771 |
+
const tokenText = this.tokenText;
|
| 772 |
+
switch (tokenText) {
|
| 773 |
+
case 'class':
|
| 774 |
+
return (this._token = Token.ClassKeyword);
|
| 775 |
+
case 'interface':
|
| 776 |
+
return (this._token = Token.InterfaceKeyword);
|
| 777 |
+
case 'type':
|
| 778 |
+
return (this._token = Token.TypeKeyword);
|
| 779 |
+
case 'enum':
|
| 780 |
+
return (this._token = Token.EnumKeyword);
|
| 781 |
+
case 'namespace':
|
| 782 |
+
return (this._token = Token.NamespaceKeyword);
|
| 783 |
+
case 'function':
|
| 784 |
+
return (this._token = Token.FunctionKeyword);
|
| 785 |
+
case 'var':
|
| 786 |
+
return (this._token = Token.VarKeyword);
|
| 787 |
+
case 'constructor':
|
| 788 |
+
return (this._token = Token.ConstructorKeyword);
|
| 789 |
+
case 'member':
|
| 790 |
+
return (this._token = Token.MemberKeyword);
|
| 791 |
+
case 'event':
|
| 792 |
+
return (this._token = Token.EventKeyword);
|
| 793 |
+
case 'call':
|
| 794 |
+
return (this._token = Token.CallKeyword);
|
| 795 |
+
case 'new':
|
| 796 |
+
return (this._token = Token.NewKeyword);
|
| 797 |
+
case 'index':
|
| 798 |
+
return (this._token = Token.IndexKeyword);
|
| 799 |
+
case 'complex':
|
| 800 |
+
return (this._token = Token.ComplexKeyword);
|
| 801 |
+
}
|
| 802 |
+
}
|
| 803 |
+
return this._token;
|
| 804 |
+
}
|
| 805 |
+
rescanDecimalDigits() {
|
| 806 |
+
if (this._token === Token.Text) {
|
| 807 |
+
const tokenText = this.tokenText;
|
| 808 |
+
if (/^\d+$/.test(tokenText)) {
|
| 809 |
+
return (this._token = Token.DecimalDigits);
|
| 810 |
+
}
|
| 811 |
+
}
|
| 812 |
+
return this._token;
|
| 813 |
+
}
|
| 814 |
+
scanString() {
|
| 815 |
+
while (!this.eof) {
|
| 816 |
+
const ch = this._text.charAt(this._pos++);
|
| 817 |
+
switch (ch) {
|
| 818 |
+
case '"':
|
| 819 |
+
return;
|
| 820 |
+
case '\\':
|
| 821 |
+
this.scanEscapeSequence();
|
| 822 |
+
break;
|
| 823 |
+
default:
|
| 824 |
+
if (isLineTerminator(ch)) {
|
| 825 |
+
this._stringIsUnterminated = true;
|
| 826 |
+
return;
|
| 827 |
+
}
|
| 828 |
+
}
|
| 829 |
+
}
|
| 830 |
+
this._stringIsUnterminated = true;
|
| 831 |
+
}
|
| 832 |
+
scanEscapeSequence() {
|
| 833 |
+
if (this.eof) {
|
| 834 |
+
this._stringIsUnterminated = true;
|
| 835 |
+
return;
|
| 836 |
+
}
|
| 837 |
+
const ch = this._text.charAt(this._pos);
|
| 838 |
+
// EscapeSequence:: CharacterEscapeSequence
|
| 839 |
+
if (isCharacterEscapeSequence(ch)) {
|
| 840 |
+
this._pos++;
|
| 841 |
+
return;
|
| 842 |
+
}
|
| 843 |
+
// EscapeSequence:: `0` [lookahead != DecimalDigit]
|
| 844 |
+
if (ch === '0' &&
|
| 845 |
+
(this._pos + 1 === this._text.length || !isDecimalDigit(this._text.charAt(this._pos + 1)))) {
|
| 846 |
+
this._pos++;
|
| 847 |
+
return;
|
| 848 |
+
}
|
| 849 |
+
// EscapeSequence:: HexEscapeSequence
|
| 850 |
+
if (ch === 'x' &&
|
| 851 |
+
this._pos + 3 <= this._text.length &&
|
| 852 |
+
isHexDigit(this._text.charAt(this._pos + 1)) &&
|
| 853 |
+
isHexDigit(this._text.charAt(this._pos + 2))) {
|
| 854 |
+
this._pos += 3;
|
| 855 |
+
return;
|
| 856 |
+
}
|
| 857 |
+
// EscapeSequence:: UnicodeEscapeSequence
|
| 858 |
+
// UnicodeEscapeSequence:: `u` Hex4Digits
|
| 859 |
+
if (ch === 'u' &&
|
| 860 |
+
this._pos + 5 <= this._text.length &&
|
| 861 |
+
isHexDigit(this._text.charAt(this._pos + 1)) &&
|
| 862 |
+
isHexDigit(this._text.charAt(this._pos + 2)) &&
|
| 863 |
+
isHexDigit(this._text.charAt(this._pos + 3)) &&
|
| 864 |
+
isHexDigit(this._text.charAt(this._pos + 4))) {
|
| 865 |
+
this._pos += 5;
|
| 866 |
+
return;
|
| 867 |
+
}
|
| 868 |
+
// EscapeSequence:: UnicodeEscapeSequence
|
| 869 |
+
// UnicodeEscapeSequence:: `u` `{` CodePoint `}`
|
| 870 |
+
if (ch === 'u' && this._pos + 4 <= this._text.length && this._text.charAt(this._pos + 1) === '{') {
|
| 871 |
+
let hexDigits = this._text.charAt(this._pos + 2);
|
| 872 |
+
if (isHexDigit(hexDigits)) {
|
| 873 |
+
for (let i = this._pos + 3; i < this._text.length; i++) {
|
| 874 |
+
const ch2 = this._text.charAt(i);
|
| 875 |
+
if (ch2 === '}') {
|
| 876 |
+
const mv = parseInt(hexDigits, 16);
|
| 877 |
+
if (mv <= 0x10ffff) {
|
| 878 |
+
this._pos = i + 1;
|
| 879 |
+
return;
|
| 880 |
+
}
|
| 881 |
+
break;
|
| 882 |
+
}
|
| 883 |
+
if (!isHexDigit(ch2)) {
|
| 884 |
+
hexDigits += ch2;
|
| 885 |
+
break;
|
| 886 |
+
}
|
| 887 |
+
}
|
| 888 |
+
}
|
| 889 |
+
}
|
| 890 |
+
this._stringIsUnterminated = true;
|
| 891 |
+
}
|
| 892 |
+
scanText() {
|
| 893 |
+
while (this._pos < this._text.length) {
|
| 894 |
+
const ch = this._text.charAt(this._pos);
|
| 895 |
+
if (isPunctuator(ch) || ch === '"') {
|
| 896 |
+
return;
|
| 897 |
+
}
|
| 898 |
+
this._pos++;
|
| 899 |
+
}
|
| 900 |
+
}
|
| 901 |
+
}
|
| 902 |
+
class Parser {
|
| 903 |
+
constructor(text) {
|
| 904 |
+
this._errors = [];
|
| 905 |
+
this._scanner = new Scanner(text);
|
| 906 |
+
this._scanner.scan();
|
| 907 |
+
}
|
| 908 |
+
get eof() {
|
| 909 |
+
return this.token() === Token.EofToken;
|
| 910 |
+
}
|
| 911 |
+
get errors() {
|
| 912 |
+
return this._errors;
|
| 913 |
+
}
|
| 914 |
+
parseDeclarationReference() {
|
| 915 |
+
let source;
|
| 916 |
+
let navigation;
|
| 917 |
+
let symbol;
|
| 918 |
+
if (this.optionalToken(Token.ExclamationToken)) {
|
| 919 |
+
// Reference to global symbol
|
| 920 |
+
source = GlobalSource.instance;
|
| 921 |
+
}
|
| 922 |
+
else if (this._scanner.rescanModuleSource() === Token.ModuleSource) {
|
| 923 |
+
source = this.parseModuleSource();
|
| 924 |
+
// Check for optional `~` navigation token.
|
| 925 |
+
if (this.optionalToken(Token.TildeToken)) {
|
| 926 |
+
navigation = Navigation.Locals;
|
| 927 |
+
}
|
| 928 |
+
}
|
| 929 |
+
if (this.isStartOfComponent()) {
|
| 930 |
+
symbol = this.parseSymbol();
|
| 931 |
+
}
|
| 932 |
+
else if (this.token() === Token.ColonToken) {
|
| 933 |
+
symbol = this.parseSymbolRest(new ComponentRoot(new ComponentString('', /*userEscaped*/ true)));
|
| 934 |
+
}
|
| 935 |
+
return new DeclarationReference(source, navigation, symbol);
|
| 936 |
+
}
|
| 937 |
+
parseModuleSourceString() {
|
| 938 |
+
this._scanner.rescanModuleSource();
|
| 939 |
+
return this.parseTokenString(Token.ModuleSource, 'Module source');
|
| 940 |
+
}
|
| 941 |
+
parseComponentString() {
|
| 942 |
+
switch (this._scanner.token()) {
|
| 943 |
+
case Token.String:
|
| 944 |
+
return this.parseString();
|
| 945 |
+
default:
|
| 946 |
+
return this.parseComponentCharacters();
|
| 947 |
+
}
|
| 948 |
+
}
|
| 949 |
+
token() {
|
| 950 |
+
return this._scanner.token();
|
| 951 |
+
}
|
| 952 |
+
parseModuleSource() {
|
| 953 |
+
const source = this.parseModuleSourceString();
|
| 954 |
+
this.expectToken(Token.ExclamationToken);
|
| 955 |
+
return new ParsedModuleSource(source, /*userEscaped*/ true);
|
| 956 |
+
}
|
| 957 |
+
parseSymbol() {
|
| 958 |
+
const component = this.parseComponentRest(this.parseRootComponent());
|
| 959 |
+
return this.parseSymbolRest(component);
|
| 960 |
+
}
|
| 961 |
+
parseSymbolRest(component) {
|
| 962 |
+
let meaning;
|
| 963 |
+
let overloadIndex;
|
| 964 |
+
if (this.optionalToken(Token.ColonToken)) {
|
| 965 |
+
meaning = this.tryParseMeaning();
|
| 966 |
+
overloadIndex = this.tryParseOverloadIndex(!!meaning);
|
| 967 |
+
}
|
| 968 |
+
return new SymbolReference(component, { meaning, overloadIndex });
|
| 969 |
+
}
|
| 970 |
+
parseRootComponent() {
|
| 971 |
+
if (!this.isStartOfComponent()) {
|
| 972 |
+
return this.fail('Component expected', new ComponentRoot(new ComponentString('', /*userEscaped*/ true)));
|
| 973 |
+
}
|
| 974 |
+
const component = this.parseComponent();
|
| 975 |
+
return new ComponentRoot(component);
|
| 976 |
+
}
|
| 977 |
+
parseComponentRest(component) {
|
| 978 |
+
for (;;) {
|
| 979 |
+
switch (this.token()) {
|
| 980 |
+
case Token.DotToken:
|
| 981 |
+
case Token.HashToken:
|
| 982 |
+
case Token.TildeToken:
|
| 983 |
+
const navigation = this.parseNavigation();
|
| 984 |
+
const right = this.parseComponent();
|
| 985 |
+
component = new ComponentNavigation(component, navigation, right);
|
| 986 |
+
break;
|
| 987 |
+
default:
|
| 988 |
+
return component;
|
| 989 |
+
}
|
| 990 |
+
}
|
| 991 |
+
}
|
| 992 |
+
parseNavigation() {
|
| 993 |
+
switch (this._scanner.token()) {
|
| 994 |
+
case Token.DotToken: {
|
| 995 |
+
this._scanner.scan();
|
| 996 |
+
return Navigation.Exports;
|
| 997 |
+
}
|
| 998 |
+
case Token.HashToken: {
|
| 999 |
+
this._scanner.scan();
|
| 1000 |
+
return Navigation.Members;
|
| 1001 |
+
}
|
| 1002 |
+
case Token.TildeToken: {
|
| 1003 |
+
this._scanner.scan();
|
| 1004 |
+
return Navigation.Locals;
|
| 1005 |
+
}
|
| 1006 |
+
default: {
|
| 1007 |
+
return this.fail("Expected '.', '#', or '~'", Navigation.Exports);
|
| 1008 |
+
}
|
| 1009 |
+
}
|
| 1010 |
+
}
|
| 1011 |
+
tryParseMeaning() {
|
| 1012 |
+
switch (this._scanner.rescanMeaning()) {
|
| 1013 |
+
case Token.ClassKeyword: {
|
| 1014 |
+
this._scanner.scan();
|
| 1015 |
+
return Meaning.Class;
|
| 1016 |
+
}
|
| 1017 |
+
case Token.InterfaceKeyword: {
|
| 1018 |
+
this._scanner.scan();
|
| 1019 |
+
return Meaning.Interface;
|
| 1020 |
+
}
|
| 1021 |
+
case Token.TypeKeyword: {
|
| 1022 |
+
this._scanner.scan();
|
| 1023 |
+
return Meaning.TypeAlias;
|
| 1024 |
+
}
|
| 1025 |
+
case Token.EnumKeyword: {
|
| 1026 |
+
this._scanner.scan();
|
| 1027 |
+
return Meaning.Enum;
|
| 1028 |
+
}
|
| 1029 |
+
case Token.NamespaceKeyword: {
|
| 1030 |
+
this._scanner.scan();
|
| 1031 |
+
return Meaning.Namespace;
|
| 1032 |
+
}
|
| 1033 |
+
case Token.FunctionKeyword: {
|
| 1034 |
+
this._scanner.scan();
|
| 1035 |
+
return Meaning.Function;
|
| 1036 |
+
}
|
| 1037 |
+
case Token.VarKeyword: {
|
| 1038 |
+
this._scanner.scan();
|
| 1039 |
+
return Meaning.Variable;
|
| 1040 |
+
}
|
| 1041 |
+
case Token.ConstructorKeyword: {
|
| 1042 |
+
this._scanner.scan();
|
| 1043 |
+
return Meaning.Constructor;
|
| 1044 |
+
}
|
| 1045 |
+
case Token.MemberKeyword: {
|
| 1046 |
+
this._scanner.scan();
|
| 1047 |
+
return Meaning.Member;
|
| 1048 |
+
}
|
| 1049 |
+
case Token.EventKeyword: {
|
| 1050 |
+
this._scanner.scan();
|
| 1051 |
+
return Meaning.Event;
|
| 1052 |
+
}
|
| 1053 |
+
case Token.CallKeyword: {
|
| 1054 |
+
this._scanner.scan();
|
| 1055 |
+
return Meaning.CallSignature;
|
| 1056 |
+
}
|
| 1057 |
+
case Token.NewKeyword: {
|
| 1058 |
+
this._scanner.scan();
|
| 1059 |
+
return Meaning.ConstructSignature;
|
| 1060 |
+
}
|
| 1061 |
+
case Token.IndexKeyword: {
|
| 1062 |
+
this._scanner.scan();
|
| 1063 |
+
return Meaning.IndexSignature;
|
| 1064 |
+
}
|
| 1065 |
+
case Token.ComplexKeyword: {
|
| 1066 |
+
this._scanner.scan();
|
| 1067 |
+
return Meaning.ComplexType;
|
| 1068 |
+
}
|
| 1069 |
+
}
|
| 1070 |
+
}
|
| 1071 |
+
tryParseOverloadIndex(hasMeaning) {
|
| 1072 |
+
if (this.optionalToken(Token.OpenParenToken)) {
|
| 1073 |
+
const overloadIndex = this.parseDecimalDigits();
|
| 1074 |
+
this.expectToken(Token.CloseParenToken);
|
| 1075 |
+
return overloadIndex;
|
| 1076 |
+
}
|
| 1077 |
+
else if (!hasMeaning) {
|
| 1078 |
+
return this.parseDecimalDigits();
|
| 1079 |
+
}
|
| 1080 |
+
return undefined;
|
| 1081 |
+
}
|
| 1082 |
+
parseDecimalDigits() {
|
| 1083 |
+
switch (this._scanner.rescanDecimalDigits()) {
|
| 1084 |
+
case Token.DecimalDigits:
|
| 1085 |
+
const value = +this._scanner.tokenText;
|
| 1086 |
+
this._scanner.scan();
|
| 1087 |
+
return value;
|
| 1088 |
+
default:
|
| 1089 |
+
return this.fail('Decimal digit expected', 0);
|
| 1090 |
+
}
|
| 1091 |
+
}
|
| 1092 |
+
isStartOfComponent() {
|
| 1093 |
+
switch (this.token()) {
|
| 1094 |
+
case Token.Text:
|
| 1095 |
+
case Token.String:
|
| 1096 |
+
case Token.OpenBracketToken:
|
| 1097 |
+
return true;
|
| 1098 |
+
default:
|
| 1099 |
+
return false;
|
| 1100 |
+
}
|
| 1101 |
+
}
|
| 1102 |
+
parseComponentCharacters() {
|
| 1103 |
+
let text = '';
|
| 1104 |
+
for (;;) {
|
| 1105 |
+
switch (this._scanner.token()) {
|
| 1106 |
+
case Token.Text:
|
| 1107 |
+
text += this.parseText();
|
| 1108 |
+
break;
|
| 1109 |
+
default:
|
| 1110 |
+
return text;
|
| 1111 |
+
}
|
| 1112 |
+
}
|
| 1113 |
+
}
|
| 1114 |
+
parseTokenString(token, tokenString) {
|
| 1115 |
+
if (this._scanner.token() === token) {
|
| 1116 |
+
const text = this._scanner.tokenText;
|
| 1117 |
+
const stringIsUnterminated = this._scanner.stringIsUnterminated;
|
| 1118 |
+
this._scanner.scan();
|
| 1119 |
+
if (stringIsUnterminated) {
|
| 1120 |
+
return this.fail(`${tokenString || tokenToString(token)} is unterminated`, text);
|
| 1121 |
+
}
|
| 1122 |
+
return text;
|
| 1123 |
+
}
|
| 1124 |
+
return this.fail(`${tokenString || tokenToString(token)} expected`, '');
|
| 1125 |
+
}
|
| 1126 |
+
parseText() {
|
| 1127 |
+
return this.parseTokenString(Token.Text, 'Text');
|
| 1128 |
+
}
|
| 1129 |
+
parseString() {
|
| 1130 |
+
return this.parseTokenString(Token.String, 'String');
|
| 1131 |
+
}
|
| 1132 |
+
parseComponent() {
|
| 1133 |
+
switch (this._scanner.token()) {
|
| 1134 |
+
case Token.OpenBracketToken:
|
| 1135 |
+
return this.parseBracketedComponent();
|
| 1136 |
+
default:
|
| 1137 |
+
return new ParsedComponentString(this.parseComponentString(), /*userEscaped*/ true);
|
| 1138 |
+
}
|
| 1139 |
+
}
|
| 1140 |
+
parseBracketedComponent() {
|
| 1141 |
+
this.expectToken(Token.OpenBracketToken);
|
| 1142 |
+
const reference = this.parseDeclarationReference();
|
| 1143 |
+
this.expectToken(Token.CloseBracketToken);
|
| 1144 |
+
return new ComponentReference(reference);
|
| 1145 |
+
}
|
| 1146 |
+
optionalToken(token) {
|
| 1147 |
+
if (this._scanner.token() === token) {
|
| 1148 |
+
this._scanner.scan();
|
| 1149 |
+
return true;
|
| 1150 |
+
}
|
| 1151 |
+
return false;
|
| 1152 |
+
}
|
| 1153 |
+
expectToken(token, message) {
|
| 1154 |
+
if (this._scanner.token() !== token) {
|
| 1155 |
+
const expected = tokenToString(token);
|
| 1156 |
+
const actual = tokenToString(this._scanner.token());
|
| 1157 |
+
return this.fail(message || `Expected token '${expected}', received '${actual}' instead.`, undefined);
|
| 1158 |
+
}
|
| 1159 |
+
this._scanner.scan();
|
| 1160 |
+
}
|
| 1161 |
+
fail(message, fallback) {
|
| 1162 |
+
this._errors.push(message);
|
| 1163 |
+
return fallback;
|
| 1164 |
+
}
|
| 1165 |
+
}
|
| 1166 |
+
function formatNavigation(navigation) {
|
| 1167 |
+
switch (navigation) {
|
| 1168 |
+
case Navigation.Exports:
|
| 1169 |
+
return '.';
|
| 1170 |
+
case Navigation.Members:
|
| 1171 |
+
return '#';
|
| 1172 |
+
case Navigation.Locals:
|
| 1173 |
+
return '~';
|
| 1174 |
+
default:
|
| 1175 |
+
return '';
|
| 1176 |
+
}
|
| 1177 |
+
}
|
| 1178 |
+
function isCharacterEscapeSequence(ch) {
|
| 1179 |
+
return isSingleEscapeCharacter(ch) || isNonEscapeCharacter(ch);
|
| 1180 |
+
}
|
| 1181 |
+
function isSingleEscapeCharacter(ch) {
|
| 1182 |
+
switch (ch) {
|
| 1183 |
+
case "'":
|
| 1184 |
+
case '"':
|
| 1185 |
+
case '\\':
|
| 1186 |
+
case 'b':
|
| 1187 |
+
case 'f':
|
| 1188 |
+
case 'n':
|
| 1189 |
+
case 'r':
|
| 1190 |
+
case 't':
|
| 1191 |
+
case 'v':
|
| 1192 |
+
return true;
|
| 1193 |
+
default:
|
| 1194 |
+
return false;
|
| 1195 |
+
}
|
| 1196 |
+
}
|
| 1197 |
+
function isNonEscapeCharacter(ch) {
|
| 1198 |
+
return !isEscapeCharacter(ch) && !isLineTerminator(ch);
|
| 1199 |
+
}
|
| 1200 |
+
function isEscapeCharacter(ch) {
|
| 1201 |
+
switch (ch) {
|
| 1202 |
+
case 'x':
|
| 1203 |
+
case 'u':
|
| 1204 |
+
return true;
|
| 1205 |
+
default:
|
| 1206 |
+
return isSingleEscapeCharacter(ch) || isDecimalDigit(ch);
|
| 1207 |
+
}
|
| 1208 |
+
}
|
| 1209 |
+
function isLineTerminator(ch) {
|
| 1210 |
+
switch (ch) {
|
| 1211 |
+
case '\r':
|
| 1212 |
+
case '\n':
|
| 1213 |
+
// TODO: <LS>, <PS>
|
| 1214 |
+
return true;
|
| 1215 |
+
default:
|
| 1216 |
+
return false;
|
| 1217 |
+
}
|
| 1218 |
+
}
|
| 1219 |
+
function isDecimalDigit(ch) {
|
| 1220 |
+
switch (ch) {
|
| 1221 |
+
case '0':
|
| 1222 |
+
case '1':
|
| 1223 |
+
case '2':
|
| 1224 |
+
case '3':
|
| 1225 |
+
case '4':
|
| 1226 |
+
case '5':
|
| 1227 |
+
case '6':
|
| 1228 |
+
case '7':
|
| 1229 |
+
case '8':
|
| 1230 |
+
case '9':
|
| 1231 |
+
return true;
|
| 1232 |
+
default:
|
| 1233 |
+
return false;
|
| 1234 |
+
}
|
| 1235 |
+
}
|
| 1236 |
+
function isHexDigit(ch) {
|
| 1237 |
+
switch (ch) {
|
| 1238 |
+
case 'a':
|
| 1239 |
+
case 'b':
|
| 1240 |
+
case 'c':
|
| 1241 |
+
case 'd':
|
| 1242 |
+
case 'e':
|
| 1243 |
+
case 'f':
|
| 1244 |
+
case 'A':
|
| 1245 |
+
case 'B':
|
| 1246 |
+
case 'C':
|
| 1247 |
+
case 'D':
|
| 1248 |
+
case 'E':
|
| 1249 |
+
case 'F':
|
| 1250 |
+
return true;
|
| 1251 |
+
default:
|
| 1252 |
+
return isDecimalDigit(ch);
|
| 1253 |
+
}
|
| 1254 |
+
}
|
| 1255 |
+
function isPunctuator(ch) {
|
| 1256 |
+
switch (ch) {
|
| 1257 |
+
case '{':
|
| 1258 |
+
case '}':
|
| 1259 |
+
case '(':
|
| 1260 |
+
case ')':
|
| 1261 |
+
case '[':
|
| 1262 |
+
case ']':
|
| 1263 |
+
case '!':
|
| 1264 |
+
case '.':
|
| 1265 |
+
case '#':
|
| 1266 |
+
case '~':
|
| 1267 |
+
case ':':
|
| 1268 |
+
case ',':
|
| 1269 |
+
case '@':
|
| 1270 |
+
return true;
|
| 1271 |
+
default:
|
| 1272 |
+
return false;
|
| 1273 |
+
}
|
| 1274 |
+
}
|
| 1275 |
+
function escapeComponentIfNeeded(text, userEscaped) {
|
| 1276 |
+
if (userEscaped) {
|
| 1277 |
+
if (!DeclarationReference.isWellFormedComponentString(text)) {
|
| 1278 |
+
throw new SyntaxError(`Invalid Component '${text}'`);
|
| 1279 |
+
}
|
| 1280 |
+
return text;
|
| 1281 |
+
}
|
| 1282 |
+
return DeclarationReference.escapeComponentString(text);
|
| 1283 |
+
}
|
| 1284 |
+
function escapeModuleSourceIfNeeded(text, userEscaped) {
|
| 1285 |
+
if (userEscaped) {
|
| 1286 |
+
if (!DeclarationReference.isWellFormedModuleSourceString(text)) {
|
| 1287 |
+
throw new SyntaxError(`Invalid Module source '${text}'`);
|
| 1288 |
+
}
|
| 1289 |
+
return text;
|
| 1290 |
+
}
|
| 1291 |
+
return DeclarationReference.escapeModuleSourceString(text);
|
| 1292 |
+
}
|
| 1293 |
+
//# sourceMappingURL=DeclarationReference.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"DeclarationReference.js","sourceRoot":"","sources":["../../src/beta/DeclarationReference.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,4DAA4D;AAC5D,yDAAyD;AAEzD,yFAAyF;AAEzF,yDAAsD;AAEtD;;;GAGG;AACH,MAAa,oBAAoB;IAK/B,YACE,MAAoC,EACpC,UAAmD,EACnD,MAAwB;QAExB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CA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IAAI,CAAC,oBAAoB,CAAC,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5D,MAAM,IAAI,WAAW,CAAC,sBAAsB,IAAI,GAAG,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,oBAAoB,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,0BAA0B,CAAC,IAAY,EAAE,WAAqB;IACrE,IAAI,WAAW,EAAE,CAAC;QAChB,IAAI,CAAC,oBAAoB,CAAC,8BAA8B,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/D,MAAM,IAAI,WAAW,CAAC,0BAA0B,IAAI,GAAG,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,oBAAoB,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\n/* eslint-disable @typescript-eslint/no-use-before-define */\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\n// NOTE: See DeclarationReference.grammarkdown for information on the underlying grammar.\r\n\r\nimport { StringChecks } from '../parser/StringChecks';\r\n\r\n/**\r\n * Represents a reference to a declaration.\r\n * @beta\r\n */\r\nexport class DeclarationReference {\r\n private _source: ModuleSource | GlobalSource | undefined;\r\n private _navigation: Navigation.Locals | Navigation.Exports | undefined;\r\n private _symbol: SymbolReference | undefined;\r\n\r\n public constructor(\r\n source?: ModuleSource | GlobalSource,\r\n navigation?: Navigation.Locals | Navigation.Exports,\r\n symbol?: SymbolReference\r\n ) {\r\n this._source = source;\r\n this._navigation = navigation;\r\n this._symbol = symbol;\r\n }\r\n\r\n public get source(): ModuleSource | GlobalSource | undefined {\r\n return this._source;\r\n }\r\n\r\n public get navigation(): Navigation.Locals | Navigation.Exports | undefined {\r\n if (!this._source || !this._symbol) {\r\n return undefined;\r\n }\r\n if (this._source === GlobalSource.instance) {\r\n return Navigation.Locals;\r\n }\r\n if (this._navigation === undefined) {\r\n return Navigation.Exports;\r\n }\r\n return this._navigation;\r\n }\r\n\r\n public get symbol(): SymbolReference | undefined {\r\n return this._symbol;\r\n }\r\n\r\n public get isEmpty(): boolean {\r\n return this.source === undefined && this.symbol === undefined;\r\n }\r\n\r\n public static parse(text: string): DeclarationReference {\r\n const parser: Parser = new Parser(text);\r\n const reference: DeclarationReference = parser.parseDeclarationReference();\r\n if (parser.errors.length) {\r\n throw new SyntaxError(`Invalid DeclarationReference '${text}':\\n ${parser.errors.join('\\n ')}`);\r\n }\r\n if (!parser.eof) {\r\n throw new SyntaxError(`Invalid DeclarationReference '${text}'`);\r\n }\r\n return reference;\r\n }\r\n\r\n public static parseComponent(text: string): Component {\r\n if (text[0] === '[') {\r\n return ComponentReference.parse(text);\r\n } else {\r\n return new ComponentString(text, true);\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether the provided string is a well-formed symbol navigation component string.\r\n */\r\n public static isWellFormedComponentString(text: string): boolean {\r\n const scanner: Scanner = new Scanner(text);\r\n return scanner.scan() === Token.String\r\n ? scanner.scan() === Token.EofToken\r\n : scanner.token() === Token.Text\r\n ? scanner.scan() === Token.EofToken\r\n : scanner.token() === Token.EofToken;\r\n }\r\n\r\n /**\r\n * Escapes a string for use as a symbol navigation component. If the string contains any of `!.#~:,\"{}()@` or starts\r\n * with `[`, it is enclosed in quotes.\r\n */\r\n public static escapeComponentString(text: string): string {\r\n if (text.length === 0) {\r\n return '\"\"';\r\n }\r\n const ch: string = text.charAt(0);\r\n if (ch === '[' || ch === '\"' || !this.isWellFormedComponentString(text)) {\r\n return JSON.stringify(text);\r\n }\r\n return text;\r\n }\r\n\r\n /**\r\n * Unescapes a string used as a symbol navigation component.\r\n */\r\n public static unescapeComponentString(text: string): string {\r\n if (text.length >= 2 && text.charAt(0) === '\"' && text.charAt(text.length - 1) === '\"') {\r\n try {\r\n return JSON.parse(text);\r\n } catch {\r\n throw new SyntaxError(`Invalid Component '${text}'`);\r\n }\r\n }\r\n if (!this.isWellFormedComponentString(text)) {\r\n throw new SyntaxError(`Invalid Component '${text}'`);\r\n }\r\n return text;\r\n }\r\n\r\n /**\r\n * Determines whether the provided string is a well-formed module source string. The string may not\r\n * have a trailing `!` character.\r\n */\r\n public static isWellFormedModuleSourceString(text: string): boolean {\r\n const scanner: Scanner = new Scanner(text + '!');\r\n return (\r\n scanner.rescanModuleSource() === Token.ModuleSource &&\r\n !scanner.stringIsUnterminated &&\r\n scanner.scan() === Token.ExclamationToken &&\r\n scanner.scan() === Token.EofToken\r\n );\r\n }\r\n\r\n /**\r\n * Escapes a string for use as a module source. If the string contains any of `!\"` it is enclosed in quotes.\r\n */\r\n public static escapeModuleSourceString(text: string): string {\r\n if (text.length === 0) {\r\n return '\"\"';\r\n }\r\n const ch: string = text.charAt(0);\r\n if (ch === '\"' || !this.isWellFormedModuleSourceString(text)) {\r\n return JSON.stringify(text);\r\n }\r\n return text;\r\n }\r\n\r\n /**\r\n * Unescapes a string used as a module source. The string may not have a trailing `!` character.\r\n */\r\n public static unescapeModuleSourceString(text: string): string {\r\n if (text.length >= 2 && text.charAt(0) === '\"' && text.charAt(text.length - 1) === '\"') {\r\n try {\r\n return JSON.parse(text);\r\n } catch {\r\n throw new SyntaxError(`Invalid Module source '${text}'`);\r\n }\r\n }\r\n if (!this.isWellFormedModuleSourceString(text)) {\r\n throw new SyntaxError(`Invalid Module source '${text}'`);\r\n }\r\n return text;\r\n }\r\n\r\n public static empty(): DeclarationReference {\r\n return new DeclarationReference();\r\n }\r\n\r\n public static package(packageName: string, importPath?: string): DeclarationReference {\r\n return new DeclarationReference(ModuleSource.fromPackage(packageName, importPath));\r\n }\r\n\r\n public static module(path: string, userEscaped?: boolean): DeclarationReference {\r\n return new DeclarationReference(new ModuleSource(path, userEscaped));\r\n }\r\n\r\n public static global(): DeclarationReference {\r\n return new DeclarationReference(GlobalSource.instance);\r\n }\r\n\r\n public static from(base: DeclarationReference | undefined): DeclarationReference {\r\n return base || this.empty();\r\n }\r\n\r\n public withSource(source: ModuleSource | GlobalSource | undefined): DeclarationReference {\r\n return this._source === source ? this : new DeclarationReference(source, this._navigation, this._symbol);\r\n }\r\n\r\n public withNavigation(\r\n navigation: Navigation.Locals | Navigation.Exports | undefined\r\n ): DeclarationReference {\r\n return this._navigation === navigation\r\n ? this\r\n : new DeclarationReference(this._source, navigation, this._symbol);\r\n }\r\n\r\n public withSymbol(symbol: SymbolReference | undefined): DeclarationReference {\r\n return this._symbol === symbol ? this : new DeclarationReference(this._source, this._navigation, symbol);\r\n }\r\n\r\n public withComponentPath(componentPath: ComponentPath): DeclarationReference {\r\n return this.withSymbol(\r\n this.symbol ? this.symbol.withComponentPath(componentPath) : new SymbolReference(componentPath)\r\n );\r\n }\r\n\r\n public withMeaning(meaning: Meaning | undefined): DeclarationReference {\r\n if (!this.symbol) {\r\n if (meaning === undefined) {\r\n return this;\r\n }\r\n return this.withSymbol(SymbolReference.empty().withMeaning(meaning));\r\n }\r\n return this.withSymbol(this.symbol.withMeaning(meaning));\r\n }\r\n\r\n public withOverloadIndex(overloadIndex: number | undefined): DeclarationReference {\r\n if (!this.symbol) {\r\n if (overloadIndex === undefined) {\r\n return this;\r\n }\r\n return this.withSymbol(SymbolReference.empty().withOverloadIndex(overloadIndex));\r\n }\r\n return this.withSymbol(this.symbol.withOverloadIndex(overloadIndex));\r\n }\r\n\r\n public addNavigationStep(navigation: Navigation, component: ComponentLike): DeclarationReference {\r\n if (this.symbol) {\r\n return this.withSymbol(this.symbol.addNavigationStep(navigation, component));\r\n }\r\n if (navigation === Navigation.Members) {\r\n navigation = Navigation.Exports;\r\n }\r\n const symbol: SymbolReference = new SymbolReference(new ComponentRoot(Component.from(component)));\r\n return new DeclarationReference(this.source, navigation, symbol);\r\n }\r\n\r\n public toString(): string {\r\n const navigation: string =\r\n this._source instanceof ModuleSource && this._symbol && this.navigation === Navigation.Locals\r\n ? '~'\r\n : '';\r\n return `${this.source || ''}${navigation}${this.symbol || ''}`;\r\n }\r\n}\r\n\r\n/**\r\n * Indicates the symbol table from which to resolve the next symbol component.\r\n * @beta\r\n */\r\nexport enum Navigation {\r\n Exports = '.',\r\n Members = '#',\r\n Locals = '~'\r\n}\r\n\r\n/**\r\n * Represents a module.\r\n * @beta\r\n */\r\nexport class ModuleSource {\r\n public readonly escapedPath: string;\r\n private _path: string | undefined;\r\n\r\n private _pathComponents: IParsedPackage | undefined;\r\n\r\n public constructor(path: string, userEscaped: boolean = true) {\r\n this.escapedPath =\r\n this instanceof ParsedModuleSource ? path : escapeModuleSourceIfNeeded(path, userEscaped);\r\n }\r\n\r\n public get path(): string {\r\n return this._path || (this._path = DeclarationReference.unescapeModuleSourceString(this.escapedPath));\r\n }\r\n\r\n public get packageName(): string {\r\n return this._getOrParsePathComponents().packageName;\r\n }\r\n\r\n public get scopeName(): string {\r\n const scopeName: string = this._getOrParsePathComponents().scopeName;\r\n return scopeName ? '@' + scopeName : '';\r\n }\r\n\r\n public get unscopedPackageName(): string {\r\n return this._getOrParsePathComponents().unscopedPackageName;\r\n }\r\n\r\n public get importPath(): string {\r\n return this._getOrParsePathComponents().importPath || '';\r\n }\r\n\r\n public static fromScopedPackage(\r\n scopeName: string | undefined,\r\n unscopedPackageName: string,\r\n importPath?: string\r\n ): ModuleSource {\r\n let packageName: string = unscopedPackageName;\r\n if (scopeName) {\r\n if (scopeName.charAt(0) === '@') {\r\n scopeName = scopeName.slice(1);\r\n }\r\n packageName = `@${scopeName}/${unscopedPackageName}`;\r\n }\r\n\r\n const parsed: IParsedPackage = { packageName, scopeName: scopeName || '', unscopedPackageName };\r\n return this._fromPackageName(parsed, packageName, importPath);\r\n }\r\n\r\n public static fromPackage(packageName: string, importPath?: string): ModuleSource {\r\n return this._fromPackageName(parsePackageName(packageName), packageName, importPath);\r\n }\r\n\r\n private static _fromPackageName(\r\n parsed: IParsedPackage | null,\r\n packageName: string,\r\n importPath?: string\r\n ): ModuleSource {\r\n if (!parsed) {\r\n throw new Error('Parsed package must be provided.');\r\n }\r\n\r\n const packageNameError: string | undefined = StringChecks.explainIfInvalidPackageName(packageName);\r\n if (packageNameError) {\r\n throw new SyntaxError(`Invalid NPM package name: ${packageNameError}`);\r\n }\r\n\r\n let path: string = packageName;\r\n if (importPath) {\r\n if (invalidImportPathRegExp.test(importPath)) {\r\n throw new SyntaxError(`Invalid import path '${importPath}`);\r\n }\r\n path += '/' + importPath;\r\n parsed.importPath = importPath;\r\n }\r\n\r\n const source: ModuleSource = new ModuleSource(path);\r\n source._pathComponents = parsed;\r\n return source;\r\n }\r\n\r\n public toString(): string {\r\n return `${this.escapedPath}!`;\r\n }\r\n\r\n private _getOrParsePathComponents(): IParsedPackage {\r\n if (!this._pathComponents) {\r\n const path: string = this.path;\r\n const parsed: IParsedPackage | null = parsePackageName(path);\r\n if (parsed && !StringChecks.explainIfInvalidPackageName(parsed.packageName)) {\r\n this._pathComponents = parsed;\r\n } else {\r\n this._pathComponents = {\r\n packageName: '',\r\n scopeName: '',\r\n unscopedPackageName: '',\r\n importPath: path\r\n };\r\n }\r\n }\r\n return this._pathComponents;\r\n }\r\n}\r\n\r\nclass ParsedModuleSource extends ModuleSource {}\r\n\r\n// matches the following:\r\n// 'foo' -> [\"foo\", \"foo\", undefined, \"foo\", undefined]\r\n// 'foo/bar' -> [\"foo/bar\", \"foo\", undefined, \"foo\", \"bar\"]\r\n// '@scope/foo' -> [\"@scope/foo\", \"@scope/foo\", \"scope\", \"foo\", undefined]\r\n// '@scope/foo/bar' -> [\"@scope/foo/bar\", \"@scope/foo\", \"scope\", \"foo\", \"bar\"]\r\n// does not match:\r\n// '/'\r\n// '@/'\r\n// '@scope/'\r\n// capture groups:\r\n// 1. The package name (including scope)\r\n// 2. The scope name (excluding the leading '@')\r\n// 3. The unscoped package name\r\n// 4. The package-relative import path\r\nconst packageNameRegExp: RegExp = /^((?:@([^/]+?)\\/)?([^/]+?))(?:\\/(.+))?$/;\r\n\r\n// no leading './' or '.\\'\r\n// no leading '../' or '..\\'\r\n// no leading '/' or '\\'\r\n// not '.' or '..'\r\nconst invalidImportPathRegExp: RegExp = /^(\\.\\.?([\\\\/]|$)|[\\\\/])/;\r\n\r\ninterface IParsedPackage {\r\n packageName: string;\r\n scopeName: string;\r\n unscopedPackageName: string;\r\n importPath?: string;\r\n}\r\n\r\n// eslint-disable-next-line @rushstack/no-new-null\r\nfunction parsePackageName(text: string): IParsedPackage | null {\r\n const match: RegExpExecArray | null = packageNameRegExp.exec(text);\r\n if (!match) {\r\n return match;\r\n }\r\n const [, packageName = '', scopeName = '', unscopedPackageName = '', importPath]: RegExpExecArray = match;\r\n return { packageName, scopeName, unscopedPackageName, importPath };\r\n}\r\n\r\n/**\r\n * Represents the global scope.\r\n * @beta\r\n */\r\nexport class GlobalSource {\r\n public static readonly instance: GlobalSource = new GlobalSource();\r\n\r\n private constructor() {}\r\n\r\n public toString(): string {\r\n return '!';\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport type Component = ComponentString | ComponentReference;\r\n\r\n/**\r\n * @beta\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-namespace,@typescript-eslint/no-redeclare\r\nexport namespace Component {\r\n export function from(value: ComponentLike): Component {\r\n if (typeof value === 'string') {\r\n return new ComponentString(value);\r\n }\r\n if (value instanceof DeclarationReference) {\r\n return new ComponentReference(value);\r\n }\r\n return value;\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport type ComponentLike = Component | DeclarationReference | string;\r\n\r\n/**\r\n * @beta\r\n */\r\nexport class ComponentString {\r\n public readonly text: string;\r\n\r\n public constructor(text: string, userEscaped?: boolean) {\r\n this.text = this instanceof ParsedComponentString ? text : escapeComponentIfNeeded(text, userEscaped);\r\n }\r\n\r\n public toString(): string {\r\n return this.text;\r\n }\r\n}\r\n\r\nclass ParsedComponentString extends ComponentString {}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport class ComponentReference {\r\n public readonly reference: DeclarationReference;\r\n\r\n public constructor(reference: DeclarationReference) {\r\n this.reference = reference;\r\n }\r\n\r\n public static parse(text: string): ComponentReference {\r\n if (text.length > 2 && text.charAt(0) === '[' && text.charAt(text.length - 1) === ']') {\r\n return new ComponentReference(DeclarationReference.parse(text.slice(1, -1)));\r\n }\r\n throw new SyntaxError(`Invalid component reference: '${text}'`);\r\n }\r\n\r\n public withReference(reference: DeclarationReference): ComponentReference {\r\n return this.reference === reference ? this : new ComponentReference(reference);\r\n }\r\n\r\n public toString(): string {\r\n return `[${this.reference}]`;\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport type ComponentPath = ComponentRoot | ComponentNavigation;\r\n\r\n/**\r\n * @beta\r\n */\r\nexport abstract class ComponentPathBase {\r\n public readonly component: Component;\r\n\r\n public constructor(component: Component) {\r\n this.component = component;\r\n }\r\n\r\n public addNavigationStep(\r\n this: ComponentPath,\r\n navigation: Navigation,\r\n component: ComponentLike\r\n ): ComponentPath {\r\n // tslint:disable-next-line:no-use-before-declare\r\n return new ComponentNavigation(this, navigation, Component.from(component));\r\n }\r\n\r\n public abstract toString(): string;\r\n}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport class ComponentRoot extends ComponentPathBase {\r\n public withComponent(component: ComponentLike): ComponentRoot {\r\n return this.component === component ? this : new ComponentRoot(Component.from(component));\r\n }\r\n\r\n public toString(): string {\r\n return this.component.toString();\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport class ComponentNavigation extends ComponentPathBase {\r\n public readonly parent: ComponentPath;\r\n public readonly navigation: Navigation;\r\n\r\n public constructor(parent: ComponentPath, navigation: Navigation, component: Component) {\r\n super(component);\r\n this.parent = parent;\r\n this.navigation = navigation;\r\n }\r\n\r\n public withParent(parent: ComponentPath): ComponentNavigation {\r\n return this.parent === parent ? this : new ComponentNavigation(parent, this.navigation, this.component);\r\n }\r\n\r\n public withNavigation(navigation: Navigation): ComponentNavigation {\r\n return this.navigation === navigation\r\n ? this\r\n : new ComponentNavigation(this.parent, navigation, this.component);\r\n }\r\n\r\n public withComponent(component: ComponentLike): ComponentNavigation {\r\n return this.component === component\r\n ? this\r\n : new ComponentNavigation(this.parent, this.navigation, Component.from(component));\r\n }\r\n\r\n public toString(): string {\r\n return `${this.parent}${formatNavigation(this.navigation)}${this.component}`;\r\n }\r\n}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport enum Meaning {\r\n Class = 'class', // SymbolFlags.Class\r\n Interface = 'interface', // SymbolFlags.Interface\r\n TypeAlias = 'type', // SymbolFlags.TypeAlias\r\n Enum = 'enum', // SymbolFlags.Enum\r\n Namespace = 'namespace', // SymbolFlags.Module\r\n Function = 'function', // SymbolFlags.Function\r\n Variable = 'var', // SymbolFlags.Variable\r\n Constructor = 'constructor', // SymbolFlags.Constructor\r\n Member = 'member', // SymbolFlags.ClassMember | SymbolFlags.EnumMember\r\n Event = 'event', //\r\n CallSignature = 'call', // SymbolFlags.Signature (for __call)\r\n ConstructSignature = 'new', // SymbolFlags.Signature (for __new)\r\n IndexSignature = 'index', // SymbolFlags.Signature (for __index)\r\n ComplexType = 'complex' // Any complex type\r\n}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport interface ISymbolReferenceOptions {\r\n meaning?: Meaning;\r\n overloadIndex?: number;\r\n}\r\n\r\n/**\r\n * Represents a reference to a TypeScript symbol.\r\n * @beta\r\n */\r\nexport class SymbolReference {\r\n public readonly componentPath: ComponentPath | undefined;\r\n public readonly meaning: Meaning | undefined;\r\n public readonly overloadIndex: number | undefined;\r\n\r\n public constructor(\r\n component: ComponentPath | undefined,\r\n { meaning, overloadIndex }: ISymbolReferenceOptions = {}\r\n ) {\r\n this.componentPath = component;\r\n this.overloadIndex = overloadIndex;\r\n this.meaning = meaning;\r\n }\r\n\r\n public static empty(): SymbolReference {\r\n return new SymbolReference(/*component*/ undefined);\r\n }\r\n\r\n public withComponentPath(componentPath: ComponentPath | undefined): SymbolReference {\r\n return this.componentPath === componentPath\r\n ? this\r\n : new SymbolReference(componentPath, {\r\n meaning: this.meaning,\r\n overloadIndex: this.overloadIndex\r\n });\r\n }\r\n\r\n public withMeaning(meaning: Meaning | undefined): SymbolReference {\r\n return this.meaning === meaning\r\n ? this\r\n : new SymbolReference(this.componentPath, {\r\n meaning,\r\n overloadIndex: this.overloadIndex\r\n });\r\n }\r\n\r\n public withOverloadIndex(overloadIndex: number | undefined): SymbolReference {\r\n return this.overloadIndex === overloadIndex\r\n ? this\r\n : new SymbolReference(this.componentPath, {\r\n meaning: this.meaning,\r\n overloadIndex\r\n });\r\n }\r\n\r\n public addNavigationStep(navigation: Navigation, component: ComponentLike): SymbolReference {\r\n if (!this.componentPath) {\r\n throw new Error('Cannot add a navigation step to an empty symbol reference.');\r\n }\r\n return new SymbolReference(this.componentPath.addNavigationStep(navigation, component));\r\n }\r\n\r\n public toString(): string {\r\n let result: string = `${this.componentPath || ''}`;\r\n if (this.meaning && this.overloadIndex !== undefined) {\r\n result += `:${this.meaning}(${this.overloadIndex})`;\r\n } else if (this.meaning) {\r\n result += `:${this.meaning}`;\r\n } else if (this.overloadIndex !== undefined) {\r\n result += `:${this.overloadIndex}`;\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nconst enum Token {\r\n None,\r\n EofToken,\r\n // Punctuator\r\n OpenBraceToken, // '{'\r\n CloseBraceToken, // '}'\r\n OpenParenToken, // '('\r\n CloseParenToken, // ')'\r\n OpenBracketToken, // '['\r\n CloseBracketToken, // ']'\r\n ExclamationToken, // '!'\r\n DotToken, // '.'\r\n HashToken, // '#'\r\n TildeToken, // '~'\r\n ColonToken, // ':'\r\n CommaToken, // ','\r\n AtToken, // '@'\r\n DecimalDigits, // '12345'\r\n String, // '\"abc\"'\r\n Text, // 'abc'\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n ModuleSource, // 'abc/def!' (excludes '!')\r\n // Keywords\r\n ClassKeyword, // 'class'\r\n InterfaceKeyword, // 'interface'\r\n TypeKeyword, // 'type'\r\n EnumKeyword, // 'enum'\r\n NamespaceKeyword, // 'namespace'\r\n FunctionKeyword, // 'function'\r\n VarKeyword, // 'var'\r\n ConstructorKeyword, // 'constructor'\r\n MemberKeyword, // 'member'\r\n EventKeyword, // 'event'\r\n CallKeyword, // 'call'\r\n NewKeyword, // 'new'\r\n IndexKeyword, // 'index'\r\n ComplexKeyword // 'complex'\r\n}\r\n\r\nfunction tokenToString(token: Token): string {\r\n switch (token) {\r\n case Token.OpenBraceToken:\r\n return '{';\r\n case Token.CloseBraceToken:\r\n return '}';\r\n case Token.OpenParenToken:\r\n return '(';\r\n case Token.CloseParenToken:\r\n return ')';\r\n case Token.OpenBracketToken:\r\n return '[';\r\n case Token.CloseBracketToken:\r\n return ']';\r\n case Token.ExclamationToken:\r\n return '!';\r\n case Token.DotToken:\r\n return '.';\r\n case Token.HashToken:\r\n return '#';\r\n case Token.TildeToken:\r\n return '~';\r\n case Token.ColonToken:\r\n return ':';\r\n case Token.CommaToken:\r\n return ',';\r\n case Token.AtToken:\r\n return '@';\r\n case Token.ClassKeyword:\r\n return 'class';\r\n case Token.InterfaceKeyword:\r\n return 'interface';\r\n case Token.TypeKeyword:\r\n return 'type';\r\n case Token.EnumKeyword:\r\n return 'enum';\r\n case Token.NamespaceKeyword:\r\n return 'namespace';\r\n case Token.FunctionKeyword:\r\n return 'function';\r\n case Token.VarKeyword:\r\n return 'var';\r\n case Token.ConstructorKeyword:\r\n return 'constructor';\r\n case Token.MemberKeyword:\r\n return 'member';\r\n case Token.EventKeyword:\r\n return 'event';\r\n case Token.CallKeyword:\r\n return 'call';\r\n case Token.NewKeyword:\r\n return 'new';\r\n case Token.IndexKeyword:\r\n return 'index';\r\n case Token.ComplexKeyword:\r\n return 'complex';\r\n case Token.None:\r\n return '<none>';\r\n case Token.EofToken:\r\n return '<eof>';\r\n case Token.DecimalDigits:\r\n return '<decimal digits>';\r\n case Token.String:\r\n return '<string>';\r\n case Token.Text:\r\n return '<text>';\r\n case Token.ModuleSource:\r\n return '<module source>';\r\n }\r\n}\r\n\r\nclass Scanner {\r\n private _tokenPos: number;\r\n private _pos: number;\r\n private _text: string;\r\n private _token: Token;\r\n private _stringIsUnterminated: boolean;\r\n\r\n public constructor(text: string) {\r\n this._pos = 0;\r\n this._tokenPos = 0;\r\n this._stringIsUnterminated = false;\r\n this._token = Token.None;\r\n this._text = text;\r\n }\r\n\r\n public get stringIsUnterminated(): boolean {\r\n return this._stringIsUnterminated;\r\n }\r\n\r\n public get text(): string {\r\n return this._text;\r\n }\r\n\r\n public get tokenText(): string {\r\n return this._text.slice(this._tokenPos, this._pos);\r\n }\r\n\r\n public get eof(): boolean {\r\n return this._pos >= this._text.length;\r\n }\r\n\r\n public token(): Token {\r\n return this._token;\r\n }\r\n\r\n public speculate<T>(cb: (accept: () => void) => T): T {\r\n const tokenPos: number = this._tokenPos;\r\n const pos: number = this._pos;\r\n const text: string = this._text;\r\n const token: Token = this._token;\r\n const stringIsUnterminated: boolean = this._stringIsUnterminated;\r\n let accepted: boolean = false;\r\n try {\r\n const accept: () => void = () => {\r\n accepted = true;\r\n };\r\n return cb(accept);\r\n } finally {\r\n if (!accepted) {\r\n this._tokenPos = tokenPos;\r\n this._pos = pos;\r\n this._text = text;\r\n this._token = token;\r\n this._stringIsUnterminated = stringIsUnterminated;\r\n }\r\n }\r\n }\r\n\r\n public scan(): Token {\r\n if (!this.eof) {\r\n this._tokenPos = this._pos;\r\n this._stringIsUnterminated = false;\r\n while (!this.eof) {\r\n const ch: string = this._text.charAt(this._pos++);\r\n switch (ch) {\r\n case '{':\r\n return (this._token = Token.OpenBraceToken);\r\n case '}':\r\n return (this._token = Token.CloseBraceToken);\r\n case '(':\r\n return (this._token = Token.OpenParenToken);\r\n case ')':\r\n return (this._token = Token.CloseParenToken);\r\n case '[':\r\n return (this._token = Token.OpenBracketToken);\r\n case ']':\r\n return (this._token = Token.CloseBracketToken);\r\n case '!':\r\n return (this._token = Token.ExclamationToken);\r\n case '.':\r\n return (this._token = Token.DotToken);\r\n case '#':\r\n return (this._token = Token.HashToken);\r\n case '~':\r\n return (this._token = Token.TildeToken);\r\n case ':':\r\n return (this._token = Token.ColonToken);\r\n case ',':\r\n return (this._token = Token.CommaToken);\r\n case '@':\r\n return (this._token = Token.AtToken);\r\n case '\"':\r\n this.scanString();\r\n return (this._token = Token.String);\r\n default:\r\n this.scanText();\r\n return (this._token = Token.Text);\r\n }\r\n }\r\n }\r\n return (this._token = Token.EofToken);\r\n }\r\n\r\n public rescanModuleSource(): Token {\r\n switch (this._token) {\r\n case Token.ModuleSource:\r\n case Token.ExclamationToken:\r\n case Token.EofToken:\r\n return this._token;\r\n }\r\n return this.speculate((accept) => {\r\n if (!this.eof) {\r\n this._pos = this._tokenPos;\r\n this._stringIsUnterminated = false;\r\n let scanned: 'string' | 'other' | 'none' = 'none';\r\n while (!this.eof) {\r\n const ch: string = this._text[this._pos];\r\n if (ch === '!') {\r\n if (scanned === 'none') {\r\n return this._token;\r\n }\r\n accept();\r\n return (this._token = Token.ModuleSource);\r\n }\r\n this._pos++;\r\n if (ch === '\"') {\r\n if (scanned === 'other') {\r\n // strings not allowed after scanning any other characters\r\n return this._token;\r\n }\r\n scanned = 'string';\r\n this.scanString();\r\n } else {\r\n if (scanned === 'string') {\r\n // no other tokens allowed after string\r\n return this._token;\r\n }\r\n scanned = 'other';\r\n if (!isPunctuator(ch)) {\r\n this.scanText();\r\n }\r\n }\r\n }\r\n }\r\n return this._token;\r\n });\r\n }\r\n\r\n public rescanMeaning(): Token {\r\n if (this._token === Token.Text) {\r\n const tokenText: string = this.tokenText;\r\n switch (tokenText) {\r\n case 'class':\r\n return (this._token = Token.ClassKeyword);\r\n case 'interface':\r\n return (this._token = Token.InterfaceKeyword);\r\n case 'type':\r\n return (this._token = Token.TypeKeyword);\r\n case 'enum':\r\n return (this._token = Token.EnumKeyword);\r\n case 'namespace':\r\n return (this._token = Token.NamespaceKeyword);\r\n case 'function':\r\n return (this._token = Token.FunctionKeyword);\r\n case 'var':\r\n return (this._token = Token.VarKeyword);\r\n case 'constructor':\r\n return (this._token = Token.ConstructorKeyword);\r\n case 'member':\r\n return (this._token = Token.MemberKeyword);\r\n case 'event':\r\n return (this._token = Token.EventKeyword);\r\n case 'call':\r\n return (this._token = Token.CallKeyword);\r\n case 'new':\r\n return (this._token = Token.NewKeyword);\r\n case 'index':\r\n return (this._token = Token.IndexKeyword);\r\n case 'complex':\r\n return (this._token = Token.ComplexKeyword);\r\n }\r\n }\r\n return this._token;\r\n }\r\n\r\n public rescanDecimalDigits(): Token {\r\n if (this._token === Token.Text) {\r\n const tokenText: string = this.tokenText;\r\n if (/^\\d+$/.test(tokenText)) {\r\n return (this._token = Token.DecimalDigits);\r\n }\r\n }\r\n return this._token;\r\n }\r\n\r\n private scanString(): void {\r\n while (!this.eof) {\r\n const ch: string = this._text.charAt(this._pos++);\r\n switch (ch) {\r\n case '\"':\r\n return;\r\n case '\\\\':\r\n this.scanEscapeSequence();\r\n break;\r\n default:\r\n if (isLineTerminator(ch)) {\r\n this._stringIsUnterminated = true;\r\n return;\r\n }\r\n }\r\n }\r\n this._stringIsUnterminated = true;\r\n }\r\n\r\n private scanEscapeSequence(): void {\r\n if (this.eof) {\r\n this._stringIsUnterminated = true;\r\n return;\r\n }\r\n\r\n const ch: string = this._text.charAt(this._pos);\r\n\r\n // EscapeSequence:: CharacterEscapeSequence\r\n if (isCharacterEscapeSequence(ch)) {\r\n this._pos++;\r\n return;\r\n }\r\n\r\n // EscapeSequence:: `0` [lookahead != DecimalDigit]\r\n if (\r\n ch === '0' &&\r\n (this._pos + 1 === this._text.length || !isDecimalDigit(this._text.charAt(this._pos + 1)))\r\n ) {\r\n this._pos++;\r\n return;\r\n }\r\n\r\n // EscapeSequence:: HexEscapeSequence\r\n if (\r\n ch === 'x' &&\r\n this._pos + 3 <= this._text.length &&\r\n isHexDigit(this._text.charAt(this._pos + 1)) &&\r\n isHexDigit(this._text.charAt(this._pos + 2))\r\n ) {\r\n this._pos += 3;\r\n return;\r\n }\r\n\r\n // EscapeSequence:: UnicodeEscapeSequence\r\n // UnicodeEscapeSequence:: `u` Hex4Digits\r\n if (\r\n ch === 'u' &&\r\n this._pos + 5 <= this._text.length &&\r\n isHexDigit(this._text.charAt(this._pos + 1)) &&\r\n isHexDigit(this._text.charAt(this._pos + 2)) &&\r\n isHexDigit(this._text.charAt(this._pos + 3)) &&\r\n isHexDigit(this._text.charAt(this._pos + 4))\r\n ) {\r\n this._pos += 5;\r\n return;\r\n }\r\n\r\n // EscapeSequence:: UnicodeEscapeSequence\r\n // UnicodeEscapeSequence:: `u` `{` CodePoint `}`\r\n if (ch === 'u' && this._pos + 4 <= this._text.length && this._text.charAt(this._pos + 1) === '{') {\r\n let hexDigits: string = this._text.charAt(this._pos + 2);\r\n if (isHexDigit(hexDigits)) {\r\n for (let i: number = this._pos + 3; i < this._text.length; i++) {\r\n const ch2: string = this._text.charAt(i);\r\n if (ch2 === '}') {\r\n const mv: number = parseInt(hexDigits, 16);\r\n if (mv <= 0x10ffff) {\r\n this._pos = i + 1;\r\n return;\r\n }\r\n break;\r\n }\r\n if (!isHexDigit(ch2)) {\r\n hexDigits += ch2;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n this._stringIsUnterminated = true;\r\n }\r\n\r\n private scanText(): void {\r\n while (this._pos < this._text.length) {\r\n const ch: string = this._text.charAt(this._pos);\r\n if (isPunctuator(ch) || ch === '\"') {\r\n return;\r\n }\r\n this._pos++;\r\n }\r\n }\r\n}\r\n\r\nclass Parser {\r\n private _errors: string[];\r\n private _scanner: Scanner;\r\n\r\n public constructor(text: string) {\r\n this._errors = [];\r\n this._scanner = new Scanner(text);\r\n this._scanner.scan();\r\n }\r\n\r\n public get eof(): boolean {\r\n return this.token() === Token.EofToken;\r\n }\r\n\r\n public get errors(): readonly string[] {\r\n return this._errors;\r\n }\r\n\r\n public parseDeclarationReference(): DeclarationReference {\r\n let source: ModuleSource | GlobalSource | undefined;\r\n let navigation: Navigation.Locals | undefined;\r\n let symbol: SymbolReference | undefined;\r\n if (this.optionalToken(Token.ExclamationToken)) {\r\n // Reference to global symbol\r\n source = GlobalSource.instance;\r\n } else if (this._scanner.rescanModuleSource() === Token.ModuleSource) {\r\n source = this.parseModuleSource();\r\n // Check for optional `~` navigation token.\r\n if (this.optionalToken(Token.TildeToken)) {\r\n navigation = Navigation.Locals;\r\n }\r\n }\r\n if (this.isStartOfComponent()) {\r\n symbol = this.parseSymbol();\r\n } else if (this.token() === Token.ColonToken) {\r\n symbol = this.parseSymbolRest(new ComponentRoot(new ComponentString('', /*userEscaped*/ true)));\r\n }\r\n return new DeclarationReference(source, navigation, symbol);\r\n }\r\n\r\n public parseModuleSourceString(): string {\r\n this._scanner.rescanModuleSource();\r\n return this.parseTokenString(Token.ModuleSource, 'Module source');\r\n }\r\n\r\n public parseComponentString(): string {\r\n switch (this._scanner.token()) {\r\n case Token.String:\r\n return this.parseString();\r\n default:\r\n return this.parseComponentCharacters();\r\n }\r\n }\r\n\r\n private token(): Token {\r\n return this._scanner.token();\r\n }\r\n\r\n private parseModuleSource(): ModuleSource | undefined {\r\n const source: string = this.parseModuleSourceString();\r\n this.expectToken(Token.ExclamationToken);\r\n return new ParsedModuleSource(source, /*userEscaped*/ true);\r\n }\r\n\r\n private parseSymbol(): SymbolReference {\r\n const component: ComponentPath = this.parseComponentRest(this.parseRootComponent());\r\n return this.parseSymbolRest(component);\r\n }\r\n\r\n private parseSymbolRest(component: ComponentPath): SymbolReference {\r\n let meaning: Meaning | undefined;\r\n let overloadIndex: number | undefined;\r\n if (this.optionalToken(Token.ColonToken)) {\r\n meaning = this.tryParseMeaning();\r\n overloadIndex = this.tryParseOverloadIndex(!!meaning);\r\n }\r\n\r\n return new SymbolReference(component, { meaning, overloadIndex });\r\n }\r\n\r\n private parseRootComponent(): ComponentPath {\r\n if (!this.isStartOfComponent()) {\r\n return this.fail(\r\n 'Component expected',\r\n new ComponentRoot(new ComponentString('', /*userEscaped*/ true))\r\n );\r\n }\r\n\r\n const component: Component = this.parseComponent();\r\n return new ComponentRoot(component);\r\n }\r\n\r\n private parseComponentRest(component: ComponentPath): ComponentPath {\r\n for (;;) {\r\n switch (this.token()) {\r\n case Token.DotToken:\r\n case Token.HashToken:\r\n case Token.TildeToken:\r\n const navigation: Navigation = this.parseNavigation();\r\n const right: Component = this.parseComponent();\r\n component = new ComponentNavigation(component, navigation, right);\r\n break;\r\n default:\r\n return component;\r\n }\r\n }\r\n }\r\n\r\n private parseNavigation(): Navigation {\r\n switch (this._scanner.token()) {\r\n case Token.DotToken: {\r\n this._scanner.scan();\r\n return Navigation.Exports;\r\n }\r\n\r\n case Token.HashToken: {\r\n this._scanner.scan();\r\n return Navigation.Members;\r\n }\r\n\r\n case Token.TildeToken: {\r\n this._scanner.scan();\r\n return Navigation.Locals;\r\n }\r\n\r\n default: {\r\n return this.fail(\"Expected '.', '#', or '~'\", Navigation.Exports);\r\n }\r\n }\r\n }\r\n\r\n private tryParseMeaning(): Meaning | undefined {\r\n switch (this._scanner.rescanMeaning()) {\r\n case Token.ClassKeyword: {\r\n this._scanner.scan();\r\n return Meaning.Class;\r\n }\r\n\r\n case Token.InterfaceKeyword: {\r\n this._scanner.scan();\r\n return Meaning.Interface;\r\n }\r\n\r\n case Token.TypeKeyword: {\r\n this._scanner.scan();\r\n return Meaning.TypeAlias;\r\n }\r\n\r\n case Token.EnumKeyword: {\r\n this._scanner.scan();\r\n return Meaning.Enum;\r\n }\r\n\r\n case Token.NamespaceKeyword: {\r\n this._scanner.scan();\r\n return Meaning.Namespace;\r\n }\r\n\r\n case Token.FunctionKeyword: {\r\n this._scanner.scan();\r\n return Meaning.Function;\r\n }\r\n\r\n case Token.VarKeyword: {\r\n this._scanner.scan();\r\n return Meaning.Variable;\r\n }\r\n\r\n case Token.ConstructorKeyword: {\r\n this._scanner.scan();\r\n return Meaning.Constructor;\r\n }\r\n\r\n case Token.MemberKeyword: {\r\n this._scanner.scan();\r\n return Meaning.Member;\r\n }\r\n\r\n case Token.EventKeyword: {\r\n this._scanner.scan();\r\n return Meaning.Event;\r\n }\r\n\r\n case Token.CallKeyword: {\r\n this._scanner.scan();\r\n return Meaning.CallSignature;\r\n }\r\n\r\n case Token.NewKeyword: {\r\n this._scanner.scan();\r\n return Meaning.ConstructSignature;\r\n }\r\n\r\n case Token.IndexKeyword: {\r\n this._scanner.scan();\r\n return Meaning.IndexSignature;\r\n }\r\n\r\n case Token.ComplexKeyword: {\r\n this._scanner.scan();\r\n return Meaning.ComplexType;\r\n }\r\n }\r\n }\r\n\r\n private tryParseOverloadIndex(hasMeaning: boolean): number | undefined {\r\n if (this.optionalToken(Token.OpenParenToken)) {\r\n const overloadIndex: number = this.parseDecimalDigits();\r\n this.expectToken(Token.CloseParenToken);\r\n return overloadIndex;\r\n } else if (!hasMeaning) {\r\n return this.parseDecimalDigits();\r\n }\r\n return undefined;\r\n }\r\n\r\n private parseDecimalDigits(): number {\r\n switch (this._scanner.rescanDecimalDigits()) {\r\n case Token.DecimalDigits:\r\n const value: number = +this._scanner.tokenText;\r\n this._scanner.scan();\r\n return value;\r\n default:\r\n return this.fail('Decimal digit expected', 0);\r\n }\r\n }\r\n\r\n private isStartOfComponent(): boolean {\r\n switch (this.token()) {\r\n case Token.Text:\r\n case Token.String:\r\n case Token.OpenBracketToken:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n private parseComponentCharacters(): string {\r\n let text: string = '';\r\n for (;;) {\r\n switch (this._scanner.token()) {\r\n case Token.Text:\r\n text += this.parseText();\r\n break;\r\n default:\r\n return text;\r\n }\r\n }\r\n }\r\n\r\n private parseTokenString(token: Token, tokenString?: string): string {\r\n if (this._scanner.token() === token) {\r\n const text: string = this._scanner.tokenText;\r\n const stringIsUnterminated: boolean = this._scanner.stringIsUnterminated;\r\n this._scanner.scan();\r\n if (stringIsUnterminated) {\r\n return this.fail(`${tokenString || tokenToString(token)} is unterminated`, text);\r\n }\r\n return text;\r\n }\r\n return this.fail(`${tokenString || tokenToString(token)} expected`, '');\r\n }\r\n\r\n private parseText(): string {\r\n return this.parseTokenString(Token.Text, 'Text');\r\n }\r\n\r\n private parseString(): string {\r\n return this.parseTokenString(Token.String, 'String');\r\n }\r\n\r\n private parseComponent(): Component {\r\n switch (this._scanner.token()) {\r\n case Token.OpenBracketToken:\r\n return this.parseBracketedComponent();\r\n default:\r\n return new ParsedComponentString(this.parseComponentString(), /*userEscaped*/ true);\r\n }\r\n }\r\n\r\n private parseBracketedComponent(): ComponentReference {\r\n this.expectToken(Token.OpenBracketToken);\r\n const reference: DeclarationReference = this.parseDeclarationReference();\r\n this.expectToken(Token.CloseBracketToken);\r\n return new ComponentReference(reference);\r\n }\r\n\r\n private optionalToken(token: Token): boolean {\r\n if (this._scanner.token() === token) {\r\n this._scanner.scan();\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n private expectToken(token: Token, message?: string): void {\r\n if (this._scanner.token() !== token) {\r\n const expected: string = tokenToString(token);\r\n const actual: string = tokenToString(this._scanner.token());\r\n return this.fail(message || `Expected token '${expected}', received '${actual}' instead.`, undefined);\r\n }\r\n this._scanner.scan();\r\n }\r\n\r\n private fail<T>(message: string, fallback: T): T {\r\n this._errors.push(message);\r\n return fallback;\r\n }\r\n}\r\n\r\nfunction formatNavigation(navigation: Navigation | undefined): string {\r\n switch (navigation) {\r\n case Navigation.Exports:\r\n return '.';\r\n case Navigation.Members:\r\n return '#';\r\n case Navigation.Locals:\r\n return '~';\r\n default:\r\n return '';\r\n }\r\n}\r\n\r\nfunction isCharacterEscapeSequence(ch: string): boolean {\r\n return isSingleEscapeCharacter(ch) || isNonEscapeCharacter(ch);\r\n}\r\n\r\nfunction isSingleEscapeCharacter(ch: string): boolean {\r\n switch (ch) {\r\n case \"'\":\r\n case '\"':\r\n case '\\\\':\r\n case 'b':\r\n case 'f':\r\n case 'n':\r\n case 'r':\r\n case 't':\r\n case 'v':\r\n return true;\r\n default:\r\n return false;\r\n }\r\n}\r\n\r\nfunction isNonEscapeCharacter(ch: string): boolean {\r\n return !isEscapeCharacter(ch) && !isLineTerminator(ch);\r\n}\r\n\r\nfunction isEscapeCharacter(ch: string): boolean {\r\n switch (ch) {\r\n case 'x':\r\n case 'u':\r\n return true;\r\n default:\r\n return isSingleEscapeCharacter(ch) || isDecimalDigit(ch);\r\n }\r\n}\r\n\r\nfunction isLineTerminator(ch: string): boolean {\r\n switch (ch) {\r\n case '\\r':\r\n case '\\n':\r\n // TODO: <LS>, <PS>\r\n return true;\r\n default:\r\n return false;\r\n }\r\n}\r\n\r\nfunction isDecimalDigit(ch: string): boolean {\r\n switch (ch) {\r\n case '0':\r\n case '1':\r\n case '2':\r\n case '3':\r\n case '4':\r\n case '5':\r\n case '6':\r\n case '7':\r\n case '8':\r\n case '9':\r\n return true;\r\n default:\r\n return false;\r\n }\r\n}\r\n\r\nfunction isHexDigit(ch: string): boolean {\r\n switch (ch) {\r\n case 'a':\r\n case 'b':\r\n case 'c':\r\n case 'd':\r\n case 'e':\r\n case 'f':\r\n case 'A':\r\n case 'B':\r\n case 'C':\r\n case 'D':\r\n case 'E':\r\n case 'F':\r\n return true;\r\n default:\r\n return isDecimalDigit(ch);\r\n }\r\n}\r\n\r\nfunction isPunctuator(ch: string): boolean {\r\n switch (ch) {\r\n case '{':\r\n case '}':\r\n case '(':\r\n case ')':\r\n case '[':\r\n case ']':\r\n case '!':\r\n case '.':\r\n case '#':\r\n case '~':\r\n case ':':\r\n case ',':\r\n case '@':\r\n return true;\r\n default:\r\n return false;\r\n }\r\n}\r\n\r\nfunction escapeComponentIfNeeded(text: string, userEscaped?: boolean): string {\r\n if (userEscaped) {\r\n if (!DeclarationReference.isWellFormedComponentString(text)) {\r\n throw new SyntaxError(`Invalid Component '${text}'`);\r\n }\r\n return text;\r\n }\r\n return DeclarationReference.escapeComponentString(text);\r\n}\r\n\r\nfunction escapeModuleSourceIfNeeded(text: string, userEscaped?: boolean): string {\r\n if (userEscaped) {\r\n if (!DeclarationReference.isWellFormedModuleSourceString(text)) {\r\n throw new SyntaxError(`Invalid Module source '${text}'`);\r\n }\r\n return text;\r\n }\r\n return DeclarationReference.escapeModuleSourceString(text);\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/configuration/DocNodeManager.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocNodeManager = void 0;
|
| 6 |
+
const StringChecks_1 = require("../parser/StringChecks");
|
| 7 |
+
/**
|
| 8 |
+
* Part of the {@link TSDocConfiguration} object.
|
| 9 |
+
*
|
| 10 |
+
* @remarks
|
| 11 |
+
* If you define your own custom subclasses of `DocNode`, they must be registered with the `DocNodeManager`.
|
| 12 |
+
* Use {@link DocNodeManager.registerAllowableChildren} to specify which {@link DocNodeContainer} subclasses
|
| 13 |
+
* are allowed to contain your nodes.
|
| 14 |
+
*/
|
| 15 |
+
class DocNodeManager {
|
| 16 |
+
constructor() {
|
| 17 |
+
this._docNodeDefinitionsByKind = new Map();
|
| 18 |
+
this._docNodeDefinitionsByConstructor = new Map();
|
| 19 |
+
}
|
| 20 |
+
/**
|
| 21 |
+
* Registers a list of {@link IDocNodeDefinition} objects to be used with the associated
|
| 22 |
+
* {@link TSDocConfiguration} object.
|
| 23 |
+
*/
|
| 24 |
+
registerDocNodes(packageName, definitions) {
|
| 25 |
+
const packageNameError = StringChecks_1.StringChecks.explainIfInvalidPackageName(packageName);
|
| 26 |
+
if (packageNameError) {
|
| 27 |
+
throw new Error('Invalid NPM package name: ' + packageNameError);
|
| 28 |
+
}
|
| 29 |
+
for (const definition of definitions) {
|
| 30 |
+
if (!DocNodeManager._nodeKindRegExp.test(definition.docNodeKind)) {
|
| 31 |
+
throw new Error(`The DocNode kind ${JSON.stringify(definition.docNodeKind)} is not a valid identifier.` +
|
| 32 |
+
` It must start with an underscore or letter, and be comprised of letters, numbers, and underscores`);
|
| 33 |
+
}
|
| 34 |
+
let existingDefinition = this._docNodeDefinitionsByKind.get(definition.docNodeKind);
|
| 35 |
+
if (existingDefinition !== undefined) {
|
| 36 |
+
throw new Error(`The DocNode kind "${definition.docNodeKind}" was already registered` +
|
| 37 |
+
` by ${existingDefinition.packageName}`);
|
| 38 |
+
}
|
| 39 |
+
existingDefinition = this._docNodeDefinitionsByConstructor.get(definition.constructor);
|
| 40 |
+
if (existingDefinition !== undefined) {
|
| 41 |
+
throw new Error(`This DocNode constructor was already registered by ${existingDefinition.packageName}` +
|
| 42 |
+
` as ${existingDefinition.docNodeKind}`);
|
| 43 |
+
}
|
| 44 |
+
const newDefinition = {
|
| 45 |
+
docNodeKind: definition.docNodeKind,
|
| 46 |
+
constructor: definition.constructor,
|
| 47 |
+
packageName,
|
| 48 |
+
allowedChildKinds: new Set()
|
| 49 |
+
};
|
| 50 |
+
this._docNodeDefinitionsByKind.set(definition.docNodeKind, newDefinition);
|
| 51 |
+
this._docNodeDefinitionsByConstructor.set(definition.constructor, newDefinition);
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
/**
|
| 55 |
+
* Reports an error if the specified DocNode kind has not been registered.
|
| 56 |
+
*/
|
| 57 |
+
throwIfNotRegisteredKind(docNodeKind) {
|
| 58 |
+
if (!this._docNodeDefinitionsByKind.has(docNodeKind)) {
|
| 59 |
+
throw new Error(`The DocNode kind "${docNodeKind}" was not registered with this TSDocConfiguration`);
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
/**
|
| 63 |
+
* For the given parent DocNode kind, registers the specified DocNode kinds as being allowable children of
|
| 64 |
+
* the parent.
|
| 65 |
+
*
|
| 66 |
+
* @remarks
|
| 67 |
+
* To prevent mistakes, `DocNodeContainer` will report an error if you try to add node that was not registered
|
| 68 |
+
* as an allowable child of the container.
|
| 69 |
+
*/
|
| 70 |
+
registerAllowableChildren(parentKind, childKinds) {
|
| 71 |
+
const parentDefinition = this._getDefinition(parentKind);
|
| 72 |
+
for (const childKind of childKinds) {
|
| 73 |
+
this._getDefinition(childKind);
|
| 74 |
+
parentDefinition.allowedChildKinds.add(childKind);
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
/**
|
| 78 |
+
* Returns true if the specified DocNode kind has been registered as an allowable child of the specified
|
| 79 |
+
* parent DocNode kind.
|
| 80 |
+
*/
|
| 81 |
+
isAllowedChild(parentKind, childKind) {
|
| 82 |
+
const parentDefinition = this._getDefinition(parentKind);
|
| 83 |
+
return parentDefinition.allowedChildKinds.has(childKind);
|
| 84 |
+
}
|
| 85 |
+
_getDefinition(docNodeKind) {
|
| 86 |
+
const definition = this._docNodeDefinitionsByKind.get(docNodeKind);
|
| 87 |
+
if (definition === undefined) {
|
| 88 |
+
throw new Error(`The DocNode kind "${docNodeKind}" was not registered with this TSDocConfiguration`);
|
| 89 |
+
}
|
| 90 |
+
return definition;
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
exports.DocNodeManager = DocNodeManager;
|
| 94 |
+
// Matches an ASCII TypeScript-style identifier.
|
| 95 |
+
//
|
| 96 |
+
// Example: "_myIdentifier99"
|
| 97 |
+
DocNodeManager._nodeKindRegExp = /^[_a-z][_a-z0-9]*$/i;
|
| 98 |
+
//# sourceMappingURL=DocNodeManager.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/configuration/DocNodeManager.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"DocNodeManager.js","sourceRoot":"","sources":["../../src/configuration/DocNodeManager.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,yDAAsD;AAiBtD;;;;;;;GAOG;AACH,MAAa,cAAc;IAA3B;QAMmB,8BAAyB,GAA8C,IAAI,GAAG,EAG5F,CAAC;QACa,qCAAgC,GAC/C,IAAI,GAAG,EAAoD,CAAC;IA8FhE,CAAC;IA5FC;;;OAGG;IACI,gBAAgB,CAAC,WAAmB,EAAE,WAA8C;QACzF,MAAM,gBAAgB,GAAuB,2BAAY,CAAC,2BAA2B,CAAC,WAAW,CAAC,CAAC;QACnG,IAAI,gBAAgB,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,gBAAgB,CAAC,CAAC;QACnE,CAAC;QAED,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;gBACjE,MAAM,IAAI,KAAK,CACb,oBAAoB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,6BAA6B;oBACrF,oGAAoG,CACvG,CAAC;Y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AAC;QAEvF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;YAC/B,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,UAAkB,EAAE,SAAiB;QACzD,MAAM,gBAAgB,GAAiC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACvF,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAEO,cAAc,CAAC,WAAmB;QACxC,MAAM,UAAU,GACd,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAClD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,qBAAqB,WAAW,mDAAmD,CAAC,CAAC;QACvG,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;;AAxGH,wCAyGC;AAxGC,gDAAgD;AAChD,EAAE;AACF,6BAA6B;AACL,8BAAe,GAAW,qBAAqB,AAAhC,CAAiC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport type { DocNode } from '../nodes/DocNode';\r\nimport { StringChecks } from '../parser/StringChecks';\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nexport type DocNodeConstructor = new (...args: any[]) => DocNode;\r\n\r\nexport interface IDocNodeDefinition {\r\n docNodeKind: string;\r\n constructor: DocNodeConstructor;\r\n}\r\n\r\ninterface IRegisteredDocNodeDefinition {\r\n docNodeKind: string;\r\n constructor: DocNodeConstructor;\r\n packageName: string;\r\n allowedChildKinds: Set<string>;\r\n}\r\n\r\n/**\r\n * Part of the {@link TSDocConfiguration} object.\r\n *\r\n * @remarks\r\n * If you define your own custom subclasses of `DocNode`, they must be registered with the `DocNodeManager`.\r\n * Use {@link DocNodeManager.registerAllowableChildren} to specify which {@link DocNodeContainer} subclasses\r\n * are allowed to contain your nodes.\r\n */\r\nexport class DocNodeManager {\r\n // Matches an ASCII TypeScript-style identifier.\r\n //\r\n // Example: \"_myIdentifier99\"\r\n private static readonly _nodeKindRegExp: RegExp = /^[_a-z][_a-z0-9]*$/i;\r\n\r\n private readonly _docNodeDefinitionsByKind: Map<string, IRegisteredDocNodeDefinition> = new Map<\r\n string,\r\n IRegisteredDocNodeDefinition\r\n >();\r\n private readonly _docNodeDefinitionsByConstructor: Map<DocNodeConstructor, IRegisteredDocNodeDefinition> =\r\n new Map<DocNodeConstructor, IRegisteredDocNodeDefinition>();\r\n\r\n /**\r\n * Registers a list of {@link IDocNodeDefinition} objects to be used with the associated\r\n * {@link TSDocConfiguration} object.\r\n */\r\n public registerDocNodes(packageName: string, definitions: ReadonlyArray<IDocNodeDefinition>): void {\r\n const packageNameError: string | undefined = StringChecks.explainIfInvalidPackageName(packageName);\r\n if (packageNameError) {\r\n throw new Error('Invalid NPM package name: ' + packageNameError);\r\n }\r\n\r\n for (const definition of definitions) {\r\n if (!DocNodeManager._nodeKindRegExp.test(definition.docNodeKind)) {\r\n throw new Error(\r\n `The DocNode kind ${JSON.stringify(definition.docNodeKind)} is not a valid identifier.` +\r\n ` It must start with an underscore or letter, and be comprised of letters, numbers, and underscores`\r\n );\r\n }\r\n\r\n let existingDefinition: IRegisteredDocNodeDefinition | undefined = this._docNodeDefinitionsByKind.get(\r\n definition.docNodeKind\r\n );\r\n\r\n if (existingDefinition !== undefined) {\r\n throw new Error(\r\n `The DocNode kind \"${definition.docNodeKind}\" was already registered` +\r\n ` by ${existingDefinition.packageName}`\r\n );\r\n }\r\n\r\n existingDefinition = this._docNodeDefinitionsByConstructor.get(definition.constructor);\r\n if (existingDefinition !== undefined) {\r\n throw new Error(\r\n `This DocNode constructor was already registered by ${existingDefinition.packageName}` +\r\n ` as ${existingDefinition.docNodeKind}`\r\n );\r\n }\r\n\r\n const newDefinition: IRegisteredDocNodeDefinition = {\r\n docNodeKind: definition.docNodeKind,\r\n constructor: definition.constructor,\r\n packageName,\r\n allowedChildKinds: new Set<string>()\r\n };\r\n\r\n this._docNodeDefinitionsByKind.set(definition.docNodeKind, newDefinition);\r\n this._docNodeDefinitionsByConstructor.set(definition.constructor, newDefinition);\r\n }\r\n }\r\n\r\n /**\r\n * Reports an error if the specified DocNode kind has not been registered.\r\n */\r\n public throwIfNotRegisteredKind(docNodeKind: string): void {\r\n if (!this._docNodeDefinitionsByKind.has(docNodeKind)) {\r\n throw new Error(`The DocNode kind \"${docNodeKind}\" was not registered with this TSDocConfiguration`);\r\n }\r\n }\r\n\r\n /**\r\n * For the given parent DocNode kind, registers the specified DocNode kinds as being allowable children of\r\n * the parent.\r\n *\r\n * @remarks\r\n * To prevent mistakes, `DocNodeContainer` will report an error if you try to add node that was not registered\r\n * as an allowable child of the container.\r\n */\r\n public registerAllowableChildren(parentKind: string, childKinds: ReadonlyArray<string>): void {\r\n const parentDefinition: IRegisteredDocNodeDefinition = this._getDefinition(parentKind);\r\n\r\n for (const childKind of childKinds) {\r\n this._getDefinition(childKind);\r\n parentDefinition.allowedChildKinds.add(childKind);\r\n }\r\n }\r\n\r\n /**\r\n * Returns true if the specified DocNode kind has been registered as an allowable child of the specified\r\n * parent DocNode kind.\r\n */\r\n public isAllowedChild(parentKind: string, childKind: string): boolean {\r\n const parentDefinition: IRegisteredDocNodeDefinition = this._getDefinition(parentKind);\r\n return parentDefinition.allowedChildKinds.has(childKind);\r\n }\r\n\r\n private _getDefinition(docNodeKind: string): IRegisteredDocNodeDefinition {\r\n const definition: IRegisteredDocNodeDefinition | undefined =\r\n this._docNodeDefinitionsByKind.get(docNodeKind);\r\n if (definition === undefined) {\r\n throw new Error(`The DocNode kind \"${docNodeKind}\" was not registered with this TSDocConfiguration`);\r\n }\r\n return definition;\r\n }\r\n}\r\n"]}
|
node_modules/@micros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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.TSDocConfiguration = void 0;
|
| 6 |
+
const StandardTags_1 = require("../details/StandardTags");
|
| 7 |
+
const TSDocValidationConfiguration_1 = require("./TSDocValidationConfiguration");
|
| 8 |
+
const DocNodeManager_1 = require("./DocNodeManager");
|
| 9 |
+
const BuiltInDocNodes_1 = require("../nodes/BuiltInDocNodes");
|
| 10 |
+
const TSDocMessageId_1 = require("../parser/TSDocMessageId");
|
| 11 |
+
/**
|
| 12 |
+
* Configuration for the TSDocParser.
|
| 13 |
+
*/
|
| 14 |
+
class TSDocConfiguration {
|
| 15 |
+
constructor() {
|
| 16 |
+
this._tagDefinitions = [];
|
| 17 |
+
this._tagDefinitionsByName = new Map();
|
| 18 |
+
this._supportedTagDefinitions = new Set();
|
| 19 |
+
this._validation = new TSDocValidationConfiguration_1.TSDocValidationConfiguration();
|
| 20 |
+
this._docNodeManager = new DocNodeManager_1.DocNodeManager();
|
| 21 |
+
this._supportedHtmlElements = new Set();
|
| 22 |
+
this.clear(false);
|
| 23 |
+
// Register the built-in node kinds
|
| 24 |
+
BuiltInDocNodes_1.BuiltInDocNodes.register(this);
|
| 25 |
+
}
|
| 26 |
+
/**
|
| 27 |
+
* Resets the `TSDocConfiguration` object to its initial empty state.
|
| 28 |
+
* @param noStandardTags - The `TSDocConfiguration` constructor normally adds definitions for the
|
| 29 |
+
* standard TSDoc tags. Set `noStandardTags` to true for a completely empty `tagDefinitions` collection.
|
| 30 |
+
*/
|
| 31 |
+
clear(noStandardTags = false) {
|
| 32 |
+
this._tagDefinitions.length = 0;
|
| 33 |
+
this._tagDefinitionsByName.clear();
|
| 34 |
+
this._supportedTagDefinitions.clear();
|
| 35 |
+
this._validation.ignoreUndefinedTags = false;
|
| 36 |
+
this._validation.reportUnsupportedTags = false;
|
| 37 |
+
this._validation.reportUnsupportedHtmlElements = false;
|
| 38 |
+
this._supportedHtmlElements.clear();
|
| 39 |
+
if (!noStandardTags) {
|
| 40 |
+
// Define all the standard tags
|
| 41 |
+
this.addTagDefinitions(StandardTags_1.StandardTags.allDefinitions);
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
/**
|
| 45 |
+
* The TSDoc tags that are defined in this configuration.
|
| 46 |
+
*
|
| 47 |
+
* @remarks
|
| 48 |
+
* The subset of "supported" tags is tracked by {@link TSDocConfiguration.supportedTagDefinitions}.
|
| 49 |
+
*/
|
| 50 |
+
get tagDefinitions() {
|
| 51 |
+
return this._tagDefinitions;
|
| 52 |
+
}
|
| 53 |
+
/**
|
| 54 |
+
* Returns the subset of {@link TSDocConfiguration.tagDefinitions}
|
| 55 |
+
* that are supported in this configuration.
|
| 56 |
+
*
|
| 57 |
+
* @remarks
|
| 58 |
+
* This property is only used when
|
| 59 |
+
* {@link TSDocValidationConfiguration.reportUnsupportedTags} is enabled.
|
| 60 |
+
*/
|
| 61 |
+
get supportedTagDefinitions() {
|
| 62 |
+
return this.tagDefinitions.filter((x) => this.isTagSupported(x));
|
| 63 |
+
}
|
| 64 |
+
/**
|
| 65 |
+
* Enable/disable validation checks performed by the parser.
|
| 66 |
+
*/
|
| 67 |
+
get validation() {
|
| 68 |
+
return this._validation;
|
| 69 |
+
}
|
| 70 |
+
/**
|
| 71 |
+
* The HTML element names that are supported in this configuration. Used in conjunction with the `reportUnsupportedHtmlElements` setting.
|
| 72 |
+
*/
|
| 73 |
+
get supportedHtmlElements() {
|
| 74 |
+
return Array.from(this._supportedHtmlElements.values());
|
| 75 |
+
}
|
| 76 |
+
/**
|
| 77 |
+
* Register custom DocNode subclasses.
|
| 78 |
+
*/
|
| 79 |
+
get docNodeManager() {
|
| 80 |
+
return this._docNodeManager;
|
| 81 |
+
}
|
| 82 |
+
/**
|
| 83 |
+
* Return the tag that was defined with the specified name, or undefined
|
| 84 |
+
* if not found.
|
| 85 |
+
*/
|
| 86 |
+
tryGetTagDefinition(tagName) {
|
| 87 |
+
return this._tagDefinitionsByName.get(tagName.toUpperCase());
|
| 88 |
+
}
|
| 89 |
+
/**
|
| 90 |
+
* Return the tag that was defined with the specified name, or undefined
|
| 91 |
+
* if not found.
|
| 92 |
+
*/
|
| 93 |
+
tryGetTagDefinitionWithUpperCase(alreadyUpperCaseTagName) {
|
| 94 |
+
return this._tagDefinitionsByName.get(alreadyUpperCaseTagName);
|
| 95 |
+
}
|
| 96 |
+
/**
|
| 97 |
+
* Define a new TSDoc tag to be recognized by the TSDocParser, and mark it as unsupported.
|
| 98 |
+
* Use {@link TSDocConfiguration.setSupportForTag} to mark it as supported.
|
| 99 |
+
*
|
| 100 |
+
* @remarks
|
| 101 |
+
* If a tag is "defined" this means that the parser recognizes it and understands its syntax.
|
| 102 |
+
* Whereas if a tag is "supported", this means it is defined AND the application implements the tag.
|
| 103 |
+
*/
|
| 104 |
+
addTagDefinition(tagDefinition) {
|
| 105 |
+
const existingDefinition = this._tagDefinitionsByName.get(tagDefinition.tagNameWithUpperCase);
|
| 106 |
+
if (existingDefinition === tagDefinition) {
|
| 107 |
+
return;
|
| 108 |
+
}
|
| 109 |
+
if (existingDefinition) {
|
| 110 |
+
throw new Error(`A tag is already defined using the name ${existingDefinition.tagName}`);
|
| 111 |
+
}
|
| 112 |
+
this._tagDefinitions.push(tagDefinition);
|
| 113 |
+
this._tagDefinitionsByName.set(tagDefinition.tagNameWithUpperCase, tagDefinition);
|
| 114 |
+
}
|
| 115 |
+
/**
|
| 116 |
+
* Calls {@link TSDocConfiguration.addTagDefinition} for a list of definitions,
|
| 117 |
+
* and optionally marks them as supported.
|
| 118 |
+
* @param tagDefinitions - the definitions to be added
|
| 119 |
+
* @param supported - if specified, calls the {@link TSDocConfiguration.setSupportForTag}
|
| 120 |
+
* method to mark the definitions as supported or unsupported
|
| 121 |
+
*/
|
| 122 |
+
addTagDefinitions(tagDefinitions, supported) {
|
| 123 |
+
for (const tagDefinition of tagDefinitions) {
|
| 124 |
+
this.addTagDefinition(tagDefinition);
|
| 125 |
+
if (supported !== undefined) {
|
| 126 |
+
this.setSupportForTag(tagDefinition, supported);
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
}
|
| 130 |
+
/**
|
| 131 |
+
* Returns true if the tag is supported in this configuration.
|
| 132 |
+
*/
|
| 133 |
+
isTagSupported(tagDefinition) {
|
| 134 |
+
this._requireTagToBeDefined(tagDefinition);
|
| 135 |
+
return this._supportedTagDefinitions.has(tagDefinition);
|
| 136 |
+
}
|
| 137 |
+
/**
|
| 138 |
+
* Specifies whether the tag definition is supported in this configuration.
|
| 139 |
+
* The parser may issue warnings for unsupported tags.
|
| 140 |
+
*
|
| 141 |
+
* @remarks
|
| 142 |
+
* If a tag is "defined" this means that the parser recognizes it and understands its syntax.
|
| 143 |
+
* Whereas if a tag is "supported", this means it is defined AND the application implements the tag.
|
| 144 |
+
*
|
| 145 |
+
* This function automatically sets {@link TSDocValidationConfiguration.reportUnsupportedTags}
|
| 146 |
+
* to true.
|
| 147 |
+
*/
|
| 148 |
+
setSupportForTag(tagDefinition, supported) {
|
| 149 |
+
this._requireTagToBeDefined(tagDefinition);
|
| 150 |
+
if (supported) {
|
| 151 |
+
this._supportedTagDefinitions.add(tagDefinition);
|
| 152 |
+
}
|
| 153 |
+
else {
|
| 154 |
+
this._supportedTagDefinitions.delete(tagDefinition);
|
| 155 |
+
}
|
| 156 |
+
this.validation.reportUnsupportedTags = true;
|
| 157 |
+
}
|
| 158 |
+
/**
|
| 159 |
+
* Specifies whether the tag definition is supported in this configuration.
|
| 160 |
+
* This operation sets {@link TSDocValidationConfiguration.reportUnsupportedTags} to `true`.
|
| 161 |
+
*
|
| 162 |
+
* @remarks
|
| 163 |
+
* The parser may issue warnings for unsupported tags.
|
| 164 |
+
* If a tag is "defined" this means that the parser recognizes it and understands its syntax.
|
| 165 |
+
* Whereas if a tag is "supported", this means it is defined AND the application implements the tag.
|
| 166 |
+
*/
|
| 167 |
+
setSupportForTags(tagDefinitions, supported) {
|
| 168 |
+
for (const tagDefinition of tagDefinitions) {
|
| 169 |
+
this.setSupportForTag(tagDefinition, supported);
|
| 170 |
+
}
|
| 171 |
+
}
|
| 172 |
+
/**
|
| 173 |
+
* Assigns the `supportedHtmlElements` property, replacing any previous elements.
|
| 174 |
+
* This operation sets {@link TSDocValidationConfiguration.reportUnsupportedHtmlElements} to `true`.
|
| 175 |
+
*/
|
| 176 |
+
setSupportedHtmlElements(htmlTags) {
|
| 177 |
+
this._supportedHtmlElements.clear();
|
| 178 |
+
this._validation.reportUnsupportedHtmlElements = true;
|
| 179 |
+
for (const htmlTag of htmlTags) {
|
| 180 |
+
this._supportedHtmlElements.add(htmlTag);
|
| 181 |
+
}
|
| 182 |
+
}
|
| 183 |
+
/**
|
| 184 |
+
* Returns true if the html element is supported in this configuration.
|
| 185 |
+
*/
|
| 186 |
+
isHtmlElementSupported(htmlTag) {
|
| 187 |
+
return this._supportedHtmlElements.has(htmlTag);
|
| 188 |
+
}
|
| 189 |
+
/**
|
| 190 |
+
* Returns true if the specified {@link TSDocMessageId} string is implemented by this release of the TSDoc parser.
|
| 191 |
+
* This can be used to detect misspelled identifiers.
|
| 192 |
+
*
|
| 193 |
+
* @privateRemarks
|
| 194 |
+
*
|
| 195 |
+
* Why this API is associated with TSDocConfiguration: In the future, if we enable support for custom extensions
|
| 196 |
+
* of the TSDoc parser, we may provide a way to register custom message identifiers.
|
| 197 |
+
*/
|
| 198 |
+
isKnownMessageId(messageId) {
|
| 199 |
+
return TSDocMessageId_1.allTsdocMessageIdsSet.has(messageId);
|
| 200 |
+
}
|
| 201 |
+
/**
|
| 202 |
+
* Returns the list of {@link TSDocMessageId} strings that are implemented by this release of the TSDoc parser.
|
| 203 |
+
*
|
| 204 |
+
* @privateRemarks
|
| 205 |
+
*
|
| 206 |
+
* Why this API is associated with TSDocConfiguration: In the future, if we enable support for custom extensions
|
| 207 |
+
* of the TSDoc parser, we may provide a way to register custom message identifiers.
|
| 208 |
+
*/
|
| 209 |
+
get allTsdocMessageIds() {
|
| 210 |
+
return TSDocMessageId_1.allTsdocMessageIds;
|
| 211 |
+
}
|
| 212 |
+
_requireTagToBeDefined(tagDefinition) {
|
| 213 |
+
const matching = this._tagDefinitionsByName.get(tagDefinition.tagNameWithUpperCase);
|
| 214 |
+
if (matching) {
|
| 215 |
+
if (matching === tagDefinition) {
|
| 216 |
+
return;
|
| 217 |
+
}
|
| 218 |
+
}
|
| 219 |
+
throw new Error('The specified TSDocTagDefinition is not defined for this TSDocConfiguration');
|
| 220 |
+
}
|
| 221 |
+
}
|
| 222 |
+
exports.TSDocConfiguration = TSDocConfiguration;
|
| 223 |
+
//# sourceMappingURL=TSDocConfiguration.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/configuration/TSDocConfiguration.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"TSDocConfiguration.js","sourceRoot":"","sources":["../../src/configuration/TSDocConfiguration.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,0DAAuD;AAEvD,iFAA8E;AAC9E,qDAAkD;AAClD,8DAA2D;AAC3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OAEG;IACI,sBAAsB,CAAC,OAAe;QAC3C,OAAO,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;;;OAQG;IACI,gBAAgB,CAAC,SAAkC;QACxD,OAAO,sCAAqB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;OAOG;IACH,IAAW,kBAAkB;QAC3B,OAAO,mCAAmD,CAAC;IAC7D,CAAC;IAEO,sBAAsB,CAAC,aAAiC;QAC9D,MAAM,QAAQ,GAAmC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAC7E,aAAa,CAAC,oBAAoB,CACnC,CAAC;QACF,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;gBAC/B,OAAO;YACT,CAAC;QACH,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;IACjG,CAAC;CACF;AAtPD,gDAsPC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { StandardTags } from '../details/StandardTags';\r\nimport type { TSDocTagDefinition } from './TSDocTagDefinition';\r\nimport { TSDocValidationConfiguration } from './TSDocValidationConfiguration';\r\nimport { DocNodeManager } from './DocNodeManager';\r\nimport { BuiltInDocNodes } from '../nodes/BuiltInDocNodes';\r\nimport { type TSDocMessageId, allTsdocMessageIds, allTsdocMessageIdsSet } from '../parser/TSDocMessageId';\r\n\r\n/**\r\n * Configuration for the TSDocParser.\r\n */\r\nexport class TSDocConfiguration {\r\n private readonly _tagDefinitions: TSDocTagDefinition[];\r\n private readonly _tagDefinitionsByName: Map<string, TSDocTagDefinition>;\r\n private readonly _supportedTagDefinitions: Set<TSDocTagDefinition>;\r\n private readonly _validation: TSDocValidationConfiguration;\r\n private readonly _docNodeManager: DocNodeManager;\r\n private readonly _supportedHtmlElements: Set<string>;\r\n\r\n public constructor() {\r\n this._tagDefinitions = [];\r\n this._tagDefinitionsByName = new Map<string, TSDocTagDefinition>();\r\n this._supportedTagDefinitions = new Set<TSDocTagDefinition>();\r\n this._validation = new TSDocValidationConfiguration();\r\n this._docNodeManager = new DocNodeManager();\r\n this._supportedHtmlElements = new Set();\r\n\r\n this.clear(false);\r\n\r\n // Register the built-in node kinds\r\n BuiltInDocNodes.register(this);\r\n }\r\n\r\n /**\r\n * Resets the `TSDocConfiguration` object to its initial empty state.\r\n * @param noStandardTags - The `TSDocConfiguration` constructor normally adds definitions for the\r\n * standard TSDoc tags. Set `noStandardTags` to true for a completely empty `tagDefinitions` collection.\r\n */\r\n public clear(noStandardTags: boolean = false): void {\r\n this._tagDefinitions.length = 0;\r\n this._tagDefinitionsByName.clear();\r\n this._supportedTagDefinitions.clear();\r\n this._validation.ignoreUndefinedTags = false;\r\n this._validation.reportUnsupportedTags = false;\r\n this._validation.reportUnsupportedHtmlElements = false;\r\n this._supportedHtmlElements.clear();\r\n\r\n if (!noStandardTags) {\r\n // Define all the standard tags\r\n this.addTagDefinitions(StandardTags.allDefinitions);\r\n }\r\n }\r\n\r\n /**\r\n * The TSDoc tags that are defined in this configuration.\r\n *\r\n * @remarks\r\n * The subset of \"supported\" tags is tracked by {@link TSDocConfiguration.supportedTagDefinitions}.\r\n */\r\n public get tagDefinitions(): ReadonlyArray<TSDocTagDefinition> {\r\n return this._tagDefinitions;\r\n }\r\n\r\n /**\r\n * Returns the subset of {@link TSDocConfiguration.tagDefinitions}\r\n * that are supported in this configuration.\r\n *\r\n * @remarks\r\n * This property is only used when\r\n * {@link TSDocValidationConfiguration.reportUnsupportedTags} is enabled.\r\n */\r\n public get supportedTagDefinitions(): ReadonlyArray<TSDocTagDefinition> {\r\n return this.tagDefinitions.filter((x) => this.isTagSupported(x));\r\n }\r\n\r\n /**\r\n * Enable/disable validation checks performed by the parser.\r\n */\r\n public get validation(): TSDocValidationConfiguration {\r\n return this._validation;\r\n }\r\n\r\n /**\r\n * The HTML element names that are supported in this configuration. Used in conjunction with the `reportUnsupportedHtmlElements` setting.\r\n */\r\n public get supportedHtmlElements(): string[] {\r\n return Array.from(this._supportedHtmlElements.values());\r\n }\r\n\r\n /**\r\n * Register custom DocNode subclasses.\r\n */\r\n public get docNodeManager(): DocNodeManager {\r\n return this._docNodeManager;\r\n }\r\n\r\n /**\r\n * Return the tag that was defined with the specified name, or undefined\r\n * if not found.\r\n */\r\n public tryGetTagDefinition(tagName: string): TSDocTagDefinition | undefined {\r\n return this._tagDefinitionsByName.get(tagName.toUpperCase());\r\n }\r\n\r\n /**\r\n * Return the tag that was defined with the specified name, or undefined\r\n * if not found.\r\n */\r\n public tryGetTagDefinitionWithUpperCase(alreadyUpperCaseTagName: string): TSDocTagDefinition | undefined {\r\n return this._tagDefinitionsByName.get(alreadyUpperCaseTagName);\r\n }\r\n\r\n /**\r\n * Define a new TSDoc tag to be recognized by the TSDocParser, and mark it as unsupported.\r\n * Use {@link TSDocConfiguration.setSupportForTag} to mark it as supported.\r\n *\r\n * @remarks\r\n * If a tag is \"defined\" this means that the parser recognizes it and understands its syntax.\r\n * Whereas if a tag is \"supported\", this means it is defined AND the application implements the tag.\r\n */\r\n public addTagDefinition(tagDefinition: TSDocTagDefinition): void {\r\n const existingDefinition: TSDocTagDefinition | undefined = this._tagDefinitionsByName.get(\r\n tagDefinition.tagNameWithUpperCase\r\n );\r\n\r\n if (existingDefinition === tagDefinition) {\r\n return;\r\n }\r\n\r\n if (existingDefinition) {\r\n throw new Error(`A tag is already defined using the name ${existingDefinition.tagName}`);\r\n }\r\n\r\n this._tagDefinitions.push(tagDefinition);\r\n this._tagDefinitionsByName.set(tagDefinition.tagNameWithUpperCase, tagDefinition);\r\n }\r\n\r\n /**\r\n * Calls {@link TSDocConfiguration.addTagDefinition} for a list of definitions,\r\n * and optionally marks them as supported.\r\n * @param tagDefinitions - the definitions to be added\r\n * @param supported - if specified, calls the {@link TSDocConfiguration.setSupportForTag}\r\n * method to mark the definitions as supported or unsupported\r\n */\r\n public addTagDefinitions(\r\n tagDefinitions: ReadonlyArray<TSDocTagDefinition>,\r\n supported?: boolean | undefined\r\n ): void {\r\n for (const tagDefinition of tagDefinitions) {\r\n this.addTagDefinition(tagDefinition);\r\n\r\n if (supported !== undefined) {\r\n this.setSupportForTag(tagDefinition, supported);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Returns true if the tag is supported in this configuration.\r\n */\r\n public isTagSupported(tagDefinition: TSDocTagDefinition): boolean {\r\n this._requireTagToBeDefined(tagDefinition);\r\n return this._supportedTagDefinitions.has(tagDefinition);\r\n }\r\n\r\n /**\r\n * Specifies whether the tag definition is supported in this configuration.\r\n * The parser may issue warnings for unsupported tags.\r\n *\r\n * @remarks\r\n * If a tag is \"defined\" this means that the parser recognizes it and understands its syntax.\r\n * Whereas if a tag is \"supported\", this means it is defined AND the application implements the tag.\r\n *\r\n * This function automatically sets {@link TSDocValidationConfiguration.reportUnsupportedTags}\r\n * to true.\r\n */\r\n public setSupportForTag(tagDefinition: TSDocTagDefinition, supported: boolean): void {\r\n this._requireTagToBeDefined(tagDefinition);\r\n if (supported) {\r\n this._supportedTagDefinitions.add(tagDefinition);\r\n } else {\r\n this._supportedTagDefinitions.delete(tagDefinition);\r\n }\r\n\r\n this.validation.reportUnsupportedTags = true;\r\n }\r\n\r\n /**\r\n * Specifies whether the tag definition is supported in this configuration.\r\n * This operation sets {@link TSDocValidationConfiguration.reportUnsupportedTags} to `true`.\r\n *\r\n * @remarks\r\n * The parser may issue warnings for unsupported tags.\r\n * If a tag is \"defined\" this means that the parser recognizes it and understands its syntax.\r\n * Whereas if a tag is \"supported\", this means it is defined AND the application implements the tag.\r\n */\r\n public setSupportForTags(tagDefinitions: ReadonlyArray<TSDocTagDefinition>, supported: boolean): void {\r\n for (const tagDefinition of tagDefinitions) {\r\n this.setSupportForTag(tagDefinition, supported);\r\n }\r\n }\r\n\r\n /**\r\n * Assigns the `supportedHtmlElements` property, replacing any previous elements.\r\n * This operation sets {@link TSDocValidationConfiguration.reportUnsupportedHtmlElements} to `true`.\r\n */\r\n public setSupportedHtmlElements(htmlTags: string[]): void {\r\n this._supportedHtmlElements.clear();\r\n this._validation.reportUnsupportedHtmlElements = true;\r\n for (const htmlTag of htmlTags) {\r\n this._supportedHtmlElements.add(htmlTag);\r\n }\r\n }\r\n\r\n /**\r\n * Returns true if the html element is supported in this configuration.\r\n */\r\n public isHtmlElementSupported(htmlTag: string): boolean {\r\n return this._supportedHtmlElements.has(htmlTag);\r\n }\r\n\r\n /**\r\n * Returns true if the specified {@link TSDocMessageId} string is implemented by this release of the TSDoc parser.\r\n * This can be used to detect misspelled identifiers.\r\n *\r\n * @privateRemarks\r\n *\r\n * Why this API is associated with TSDocConfiguration: In the future, if we enable support for custom extensions\r\n * of the TSDoc parser, we may provide a way to register custom message identifiers.\r\n */\r\n public isKnownMessageId(messageId: TSDocMessageId | string): boolean {\r\n return allTsdocMessageIdsSet.has(messageId);\r\n }\r\n\r\n /**\r\n * Returns the list of {@link TSDocMessageId} strings that are implemented by this release of the TSDoc parser.\r\n *\r\n * @privateRemarks\r\n *\r\n * Why this API is associated with TSDocConfiguration: In the future, if we enable support for custom extensions\r\n * of the TSDoc parser, we may provide a way to register custom message identifiers.\r\n */\r\n public get allTsdocMessageIds(): ReadonlyArray<TSDocMessageId> {\r\n return allTsdocMessageIds as ReadonlyArray<TSDocMessageId>;\r\n }\r\n\r\n private _requireTagToBeDefined(tagDefinition: TSDocTagDefinition): void {\r\n const matching: TSDocTagDefinition | undefined = this._tagDefinitionsByName.get(\r\n tagDefinition.tagNameWithUpperCase\r\n );\r\n if (matching) {\r\n if (matching === tagDefinition) {\r\n return;\r\n }\r\n }\r\n throw new Error('The specified TSDocTagDefinition is not defined for this TSDocConfiguration');\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/configuration/TSDocTagDefinition.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.TSDocTagDefinition = exports.TSDocTagSyntaxKind = void 0;
|
| 6 |
+
const StringChecks_1 = require("../parser/StringChecks");
|
| 7 |
+
const Standardization_1 = require("../details/Standardization");
|
| 8 |
+
/**
|
| 9 |
+
* Determines the type of syntax for a TSDocTagDefinition
|
| 10 |
+
*/
|
| 11 |
+
var TSDocTagSyntaxKind;
|
| 12 |
+
(function (TSDocTagSyntaxKind) {
|
| 13 |
+
/**
|
| 14 |
+
* The tag is intended to be an inline tag. For example: `{@link}`.
|
| 15 |
+
*/
|
| 16 |
+
TSDocTagSyntaxKind[TSDocTagSyntaxKind["InlineTag"] = 0] = "InlineTag";
|
| 17 |
+
/**
|
| 18 |
+
* The tag is intended to be a block tag that starts a new documentation
|
| 19 |
+
* section. For example: `@remarks`
|
| 20 |
+
*/
|
| 21 |
+
TSDocTagSyntaxKind[TSDocTagSyntaxKind["BlockTag"] = 1] = "BlockTag";
|
| 22 |
+
/**
|
| 23 |
+
* The tag is intended to be a modifier tag whose presence indicates
|
| 24 |
+
* an aspect of the associated API item. For example: `@internal`
|
| 25 |
+
*/
|
| 26 |
+
TSDocTagSyntaxKind[TSDocTagSyntaxKind["ModifierTag"] = 2] = "ModifierTag";
|
| 27 |
+
})(TSDocTagSyntaxKind || (exports.TSDocTagSyntaxKind = TSDocTagSyntaxKind = {}));
|
| 28 |
+
/**
|
| 29 |
+
* Defines a TSDoc tag that will be understood by the TSDocParser.
|
| 30 |
+
*/
|
| 31 |
+
class TSDocTagDefinition {
|
| 32 |
+
constructor(parameters) {
|
| 33 |
+
StringChecks_1.StringChecks.validateTSDocTagName(parameters.tagName);
|
| 34 |
+
this.tagName = parameters.tagName;
|
| 35 |
+
this.tagNameWithUpperCase = parameters.tagName.toUpperCase();
|
| 36 |
+
this.syntaxKind = parameters.syntaxKind;
|
| 37 |
+
this.standardization =
|
| 38 |
+
parameters.standardization || Standardization_1.Standardization.None;
|
| 39 |
+
this.allowMultiple = !!parameters.allowMultiple;
|
| 40 |
+
}
|
| 41 |
+
/**
|
| 42 |
+
* Throws an exception if `tagName` is not a valid TSDoc tag name.
|
| 43 |
+
*/
|
| 44 |
+
static validateTSDocTagName(tagName) {
|
| 45 |
+
StringChecks_1.StringChecks.validateTSDocTagName(tagName);
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
exports.TSDocTagDefinition = TSDocTagDefinition;
|
| 49 |
+
//# sourceMappingURL=TSDocTagDefinition.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/configuration/TSDocTagDefinition.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"TSDocTagDefinition.js","sourceRoot":"","sources":["../../src/configuration/TSDocTagDefinition.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,yDAAsD;AACtD,gEAA6D;AAE7D;;GAEG;AACH,IAAY,kBAiBX;AAjBD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,qEAAS,CAAA;IAET;;;OAGG;IACH,mEAAQ,CAAA;IAER;;;OAGG;IACH,yEAAW,CAAA;AACb,CAAC,EAjBW,kBAAkB,kCAAlB,kBAAkB,QAiB7B;AAkBD;;GAEG;AACH,MAAa,kBAAkB;IA8B7B,YAAmB,UAAyC;QAC1D,2BAAY,CAAC,oBAAoB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAClC,IAAI,CAAC,oBAAoB,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAC7D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,eAAe;YACjB,UAAoD,CAAC,eAAe,IAAI,iCAAe,CAAC,IAAI,CAAC;QAChG,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC;IAClD,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,oBAAoB,CAAC,OAAe;QAChD,2BAAY,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AA9CD,gDA8CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { StringChecks } from '../parser/StringChecks';\r\nimport { Standardization } from '../details/Standardization';\r\n\r\n/**\r\n * Determines the type of syntax for a TSDocTagDefinition\r\n */\r\nexport enum TSDocTagSyntaxKind {\r\n /**\r\n * The tag is intended to be an inline tag. For example: `{@link}`.\r\n */\r\n InlineTag,\r\n\r\n /**\r\n * The tag is intended to be a block tag that starts a new documentation\r\n * section. For example: `@remarks`\r\n */\r\n BlockTag,\r\n\r\n /**\r\n * The tag is intended to be a modifier tag whose presence indicates\r\n * an aspect of the associated API item. For example: `@internal`\r\n */\r\n ModifierTag\r\n}\r\n\r\n/**\r\n * Constructor parameters for {@link TSDocTagDefinition}\r\n */\r\nexport interface ITSDocTagDefinitionParameters {\r\n tagName: string;\r\n syntaxKind: TSDocTagSyntaxKind;\r\n allowMultiple?: boolean;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface ITSDocTagDefinitionInternalParameters extends ITSDocTagDefinitionParameters {\r\n standardization: Standardization;\r\n}\r\n\r\n/**\r\n * Defines a TSDoc tag that will be understood by the TSDocParser.\r\n */\r\nexport class TSDocTagDefinition {\r\n /**\r\n * The TSDoc tag name. TSDoc tag names start with an at-sign (`@`) followed\r\n * by ASCII letters using \"camelCase\" capitalization.\r\n */\r\n public readonly tagName: string;\r\n\r\n /**\r\n * The TSDoc tag name in all capitals, which is used for performing\r\n * case-insensitive comparisons or lookups.\r\n */\r\n public readonly tagNameWithUpperCase: string;\r\n\r\n /**\r\n * Specifies the expected syntax for this tag.\r\n */\r\n public readonly syntaxKind: TSDocTagSyntaxKind;\r\n\r\n /**\r\n * Indicates the level of support expected from documentation tools that implement\r\n * the standard.\r\n */\r\n public readonly standardization: Standardization;\r\n\r\n /**\r\n * If true, then this TSDoc tag may appear multiple times in a doc comment.\r\n * By default, a tag may only appear once.\r\n */\r\n public readonly allowMultiple: boolean;\r\n\r\n public constructor(parameters: ITSDocTagDefinitionParameters) {\r\n StringChecks.validateTSDocTagName(parameters.tagName);\r\n this.tagName = parameters.tagName;\r\n this.tagNameWithUpperCase = parameters.tagName.toUpperCase();\r\n this.syntaxKind = parameters.syntaxKind;\r\n this.standardization =\r\n (parameters as ITSDocTagDefinitionInternalParameters).standardization || Standardization.None;\r\n this.allowMultiple = !!parameters.allowMultiple;\r\n }\r\n\r\n /**\r\n * Throws an exception if `tagName` is not a valid TSDoc tag name.\r\n */\r\n public static validateTSDocTagName(tagName: string): void {\r\n StringChecks.validateTSDocTagName(tagName);\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/configuration/TSDocValidationConfiguration.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.TSDocValidationConfiguration = void 0;
|
| 6 |
+
/**
|
| 7 |
+
* Part of the {@link TSDocConfiguration} object.
|
| 8 |
+
*/
|
| 9 |
+
class TSDocValidationConfiguration {
|
| 10 |
+
constructor() {
|
| 11 |
+
/**
|
| 12 |
+
* Set `ignoreUndefinedTags` to true to silently ignore unrecognized tags,
|
| 13 |
+
* instead of reporting a warning.
|
| 14 |
+
*
|
| 15 |
+
* @remarks
|
| 16 |
+
* Normally the parser will issue errors when it encounters tag names that do not
|
| 17 |
+
* have a corresponding definition in {@link TSDocConfiguration.tagDefinitions}.
|
| 18 |
+
* This helps to catch common mistakes such as a misspelled tag.
|
| 19 |
+
*
|
| 20 |
+
* @defaultValue `false`
|
| 21 |
+
*/
|
| 22 |
+
this.ignoreUndefinedTags = false;
|
| 23 |
+
/**
|
| 24 |
+
* Set `reportUnsupportedTags` to true to issue a warning for tags that are not
|
| 25 |
+
* supported by your tool.
|
| 26 |
+
*
|
| 27 |
+
* @remarks
|
| 28 |
+
* The TSDoc standard defines may tags. By default it assumes that if your tool does
|
| 29 |
+
* not implement one of these tags, then it will simply ignore it. But sometimes this
|
| 30 |
+
* may be misleading for developers. (For example, they might write an `@example` block
|
| 31 |
+
* and then be surprised if it doesn't appear in the documentation output.).
|
| 32 |
+
*
|
| 33 |
+
* For a better experience, you can tell the parser which tags you support, and then it
|
| 34 |
+
* will issue warnings wherever unsupported tags are used. This is done using
|
| 35 |
+
* {@link TSDocConfiguration.setSupportForTag}. Note that calling that function
|
| 36 |
+
* automatically sets `reportUnsupportedTags` to true.
|
| 37 |
+
*
|
| 38 |
+
* @defaultValue `false`
|
| 39 |
+
*/
|
| 40 |
+
this.reportUnsupportedTags = false;
|
| 41 |
+
/**
|
| 42 |
+
* Set `reportUnsupportedHtmlElements` to true to issue a warning for HTML elements which
|
| 43 |
+
* are not defined in your TSDoc configuration's `supportedHtmlElements` field.
|
| 44 |
+
*
|
| 45 |
+
* @defaultValue `false`
|
| 46 |
+
*/
|
| 47 |
+
this.reportUnsupportedHtmlElements = false;
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
exports.TSDocValidationConfiguration = TSDocValidationConfiguration;
|
| 51 |
+
//# sourceMappingURL=TSDocValidationConfiguration.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/configuration/TSDocValidationConfiguration.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"TSDocValidationConfiguration.js","sourceRoot":"","sources":["../../src/configuration/TSDocValidationConfiguration.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;GAEG;AACH,MAAa,4BAA4B;IAAzC;QACE;;;;;;;;;;WAUG;QACI,wBAAmB,GAAY,KAAK,CAAC;QAE5C;;;;;;;;;;;;;;;;WAgBG;QACI,0BAAqB,GAAY,KAAK,CAAC;QAE9C;;;;;WAKG;QACI,kCAA6B,GAAY,KAAK,CAAC;IACxD,CAAC;CAAA;AAxCD,oEAwCC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\n/**\r\n * Part of the {@link TSDocConfiguration} object.\r\n */\r\nexport class TSDocValidationConfiguration {\r\n /**\r\n * Set `ignoreUndefinedTags` to true to silently ignore unrecognized tags,\r\n * instead of reporting a warning.\r\n *\r\n * @remarks\r\n * Normally the parser will issue errors when it encounters tag names that do not\r\n * have a corresponding definition in {@link TSDocConfiguration.tagDefinitions}.\r\n * This helps to catch common mistakes such as a misspelled tag.\r\n *\r\n * @defaultValue `false`\r\n */\r\n public ignoreUndefinedTags: boolean = false;\r\n\r\n /**\r\n * Set `reportUnsupportedTags` to true to issue a warning for tags that are not\r\n * supported by your tool.\r\n *\r\n * @remarks\r\n * The TSDoc standard defines may tags. By default it assumes that if your tool does\r\n * not implement one of these tags, then it will simply ignore it. But sometimes this\r\n * may be misleading for developers. (For example, they might write an `@example` block\r\n * and then be surprised if it doesn't appear in the documentation output.).\r\n *\r\n * For a better experience, you can tell the parser which tags you support, and then it\r\n * will issue warnings wherever unsupported tags are used. This is done using\r\n * {@link TSDocConfiguration.setSupportForTag}. Note that calling that function\r\n * automatically sets `reportUnsupportedTags` to true.\r\n *\r\n * @defaultValue `false`\r\n */\r\n public reportUnsupportedTags: boolean = false;\r\n\r\n /**\r\n * Set `reportUnsupportedHtmlElements` to true to issue a warning for HTML elements which\r\n * are not defined in your TSDoc configuration's `supportedHtmlElements` field.\r\n *\r\n * @defaultValue `false`\r\n */\r\n public reportUnsupportedHtmlElements: boolean = false;\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/details/ModifierTagSet.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.ModifierTagSet = void 0;
|
| 6 |
+
const TSDocTagDefinition_1 = require("../configuration/TSDocTagDefinition");
|
| 7 |
+
/**
|
| 8 |
+
* Represents a set of modifier tags that were extracted from a doc comment.
|
| 9 |
+
*
|
| 10 |
+
* @remarks
|
| 11 |
+
* TSDoc modifier tags are block tags that do not have any associated rich text content.
|
| 12 |
+
* Instead, their presence or absence acts as an on/off switch, indicating some aspect
|
| 13 |
+
* of the underlying API item. For example, the `@internal` modifier indicates that a
|
| 14 |
+
* signature is internal (i.e. not part of the public API contract).
|
| 15 |
+
*/
|
| 16 |
+
class ModifierTagSet {
|
| 17 |
+
constructor() {
|
| 18 |
+
this._nodes = [];
|
| 19 |
+
// NOTE: To implement case insensitivity, the keys in this set are always upper-case.
|
| 20 |
+
// This convention makes the normalization more obvious (and as a general practice handles
|
| 21 |
+
// the Turkish "i" character correctly).
|
| 22 |
+
this._nodesByName = new Map();
|
| 23 |
+
}
|
| 24 |
+
/**
|
| 25 |
+
* The original block tag nodes that defined the modifiers in this set, excluding duplicates.
|
| 26 |
+
*/
|
| 27 |
+
get nodes() {
|
| 28 |
+
return this._nodes;
|
| 29 |
+
}
|
| 30 |
+
/**
|
| 31 |
+
* Returns true if the set contains a DocBlockTag with the specified tag name.
|
| 32 |
+
* Note that synonyms are not considered. The comparison is case-insensitive.
|
| 33 |
+
* @param modifierTagName - The name of the tag, including the `@` prefix For example, `@internal`
|
| 34 |
+
*/
|
| 35 |
+
hasTagName(modifierTagName) {
|
| 36 |
+
return this._nodesByName.has(modifierTagName.toUpperCase());
|
| 37 |
+
}
|
| 38 |
+
/**
|
| 39 |
+
* Returns true if the set contains a DocBlockTag matching the specified tag definition.
|
| 40 |
+
* Note that synonyms are not considered. The comparison is case-insensitive.
|
| 41 |
+
* The TSDocTagDefinition must be a modifier tag.
|
| 42 |
+
* @param tagName - The name of the tag, including the `@` prefix For example, `@internal`
|
| 43 |
+
*/
|
| 44 |
+
hasTag(modifierTagDefinition) {
|
| 45 |
+
return !!this.tryGetTag(modifierTagDefinition);
|
| 46 |
+
}
|
| 47 |
+
/**
|
| 48 |
+
* Returns a DocBlockTag matching the specified tag definition, or undefined if no such
|
| 49 |
+
* tag was added to the set. If there were multiple instances, returned object will be
|
| 50 |
+
* the first one to be added.
|
| 51 |
+
*/
|
| 52 |
+
tryGetTag(modifierTagDefinition) {
|
| 53 |
+
if (modifierTagDefinition.syntaxKind !== TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag) {
|
| 54 |
+
throw new Error('The tag definition is not a modifier tag');
|
| 55 |
+
}
|
| 56 |
+
return this._nodesByName.get(modifierTagDefinition.tagNameWithUpperCase);
|
| 57 |
+
}
|
| 58 |
+
/**
|
| 59 |
+
* Adds a new modifier tag to the set. If a tag already exists with the same name,
|
| 60 |
+
* then no change is made, and the return value is false.
|
| 61 |
+
*/
|
| 62 |
+
addTag(blockTag) {
|
| 63 |
+
if (this._nodesByName.has(blockTag.tagNameWithUpperCase)) {
|
| 64 |
+
return false;
|
| 65 |
+
}
|
| 66 |
+
this._nodesByName.set(blockTag.tagNameWithUpperCase, blockTag);
|
| 67 |
+
this._nodes.push(blockTag);
|
| 68 |
+
return true;
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
exports.ModifierTagSet = ModifierTagSet;
|
| 72 |
+
//# sourceMappingURL=ModifierTagSet.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/details/ModifierTagSet.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |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OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5DD,wCA4DC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport type { DocBlockTag } from '../nodes/DocBlockTag';\r\nimport { type TSDocTagDefinition, TSDocTagSyntaxKind } from '../configuration/TSDocTagDefinition';\r\n\r\n/**\r\n * Represents a set of modifier tags that were extracted from a doc comment.\r\n *\r\n * @remarks\r\n * TSDoc modifier tags are block tags that do not have any associated rich text content.\r\n * Instead, their presence or absence acts as an on/off switch, indicating some aspect\r\n * of the underlying API item. For example, the `@internal` modifier indicates that a\r\n * signature is internal (i.e. not part of the public API contract).\r\n */\r\nexport class ModifierTagSet {\r\n private readonly _nodes: DocBlockTag[] = [];\r\n\r\n // NOTE: To implement case insensitivity, the keys in this set are always upper-case.\r\n // This convention makes the normalization more obvious (and as a general practice handles\r\n // the Turkish \"i\" character correctly).\r\n private readonly _nodesByName: Map<string, DocBlockTag> = new Map<string, DocBlockTag>();\r\n\r\n /**\r\n * The original block tag nodes that defined the modifiers in this set, excluding duplicates.\r\n */\r\n public get nodes(): ReadonlyArray<DocBlockTag> {\r\n return this._nodes;\r\n }\r\n\r\n /**\r\n * Returns true if the set contains a DocBlockTag with the specified tag name.\r\n * Note that synonyms are not considered. The comparison is case-insensitive.\r\n * @param modifierTagName - The name of the tag, including the `@` prefix For example, `@internal`\r\n */\r\n public hasTagName(modifierTagName: string): boolean {\r\n return this._nodesByName.has(modifierTagName.toUpperCase());\r\n }\r\n\r\n /**\r\n * Returns true if the set contains a DocBlockTag matching the specified tag definition.\r\n * Note that synonyms are not considered. The comparison is case-insensitive.\r\n * The TSDocTagDefinition must be a modifier tag.\r\n * @param tagName - The name of the tag, including the `@` prefix For example, `@internal`\r\n */\r\n public hasTag(modifierTagDefinition: TSDocTagDefinition): boolean {\r\n return !!this.tryGetTag(modifierTagDefinition);\r\n }\r\n\r\n /**\r\n * Returns a DocBlockTag matching the specified tag definition, or undefined if no such\r\n * tag was added to the set. If there were multiple instances, returned object will be\r\n * the first one to be added.\r\n */\r\n public tryGetTag(modifierTagDefinition: TSDocTagDefinition): DocBlockTag | undefined {\r\n if (modifierTagDefinition.syntaxKind !== TSDocTagSyntaxKind.ModifierTag) {\r\n throw new Error('The tag definition is not a modifier tag');\r\n }\r\n return this._nodesByName.get(modifierTagDefinition.tagNameWithUpperCase);\r\n }\r\n\r\n /**\r\n * Adds a new modifier tag to the set. If a tag already exists with the same name,\r\n * then no change is made, and the return value is false.\r\n */\r\n public addTag(blockTag: DocBlockTag): boolean {\r\n if (this._nodesByName.has(blockTag.tagNameWithUpperCase)) {\r\n return false;\r\n }\r\n\r\n this._nodesByName.set(blockTag.tagNameWithUpperCase, blockTag);\r\n this._nodes.push(blockTag);\r\n\r\n return true;\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/details/StandardModifierTagSet.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.StandardModifierTagSet = void 0;
|
| 6 |
+
const ModifierTagSet_1 = require("./ModifierTagSet");
|
| 7 |
+
const StandardTags_1 = require("./StandardTags");
|
| 8 |
+
/**
|
| 9 |
+
* Extends the ModifierTagSet base class with getters for modifiers that
|
| 10 |
+
* are part of the standardized core tags for TSDoc.
|
| 11 |
+
*/
|
| 12 |
+
class StandardModifierTagSet extends ModifierTagSet_1.ModifierTagSet {
|
| 13 |
+
/**
|
| 14 |
+
* Returns true if the `@alpha` modifier tag was specified.
|
| 15 |
+
*/
|
| 16 |
+
isAlpha() {
|
| 17 |
+
return this.hasTag(StandardTags_1.StandardTags.alpha);
|
| 18 |
+
}
|
| 19 |
+
/**
|
| 20 |
+
* Returns true if the `@beta` modifier tag was specified.
|
| 21 |
+
*/
|
| 22 |
+
isBeta() {
|
| 23 |
+
return this.hasTag(StandardTags_1.StandardTags.beta);
|
| 24 |
+
}
|
| 25 |
+
/**
|
| 26 |
+
* Returns true if the `@eventProperty` modifier tag was specified.
|
| 27 |
+
*/
|
| 28 |
+
isEventProperty() {
|
| 29 |
+
return this.hasTag(StandardTags_1.StandardTags.eventProperty);
|
| 30 |
+
}
|
| 31 |
+
/**
|
| 32 |
+
* Returns true if the `@experimental` modifier tag was specified.
|
| 33 |
+
*/
|
| 34 |
+
isExperimental() {
|
| 35 |
+
return this.hasTag(StandardTags_1.StandardTags.experimental);
|
| 36 |
+
}
|
| 37 |
+
/**
|
| 38 |
+
* Returns true if the `@internal` modifier tag was specified.
|
| 39 |
+
*/
|
| 40 |
+
isInternal() {
|
| 41 |
+
return this.hasTag(StandardTags_1.StandardTags.internal);
|
| 42 |
+
}
|
| 43 |
+
/**
|
| 44 |
+
* Returns true if the `@override` modifier tag was specified.
|
| 45 |
+
*/
|
| 46 |
+
isOverride() {
|
| 47 |
+
return this.hasTag(StandardTags_1.StandardTags.override);
|
| 48 |
+
}
|
| 49 |
+
/**
|
| 50 |
+
* Returns true if the `@packageDocumentation` modifier tag was specified.
|
| 51 |
+
*/
|
| 52 |
+
isPackageDocumentation() {
|
| 53 |
+
return this.hasTag(StandardTags_1.StandardTags.packageDocumentation);
|
| 54 |
+
}
|
| 55 |
+
/**
|
| 56 |
+
* Returns true if the `@public` modifier tag was specified.
|
| 57 |
+
*/
|
| 58 |
+
isPublic() {
|
| 59 |
+
return this.hasTag(StandardTags_1.StandardTags.public);
|
| 60 |
+
}
|
| 61 |
+
/**
|
| 62 |
+
* Returns true if the `@readonly` modifier tag was specified.
|
| 63 |
+
*/
|
| 64 |
+
isReadonly() {
|
| 65 |
+
return this.hasTag(StandardTags_1.StandardTags.readonly);
|
| 66 |
+
}
|
| 67 |
+
/**
|
| 68 |
+
* Returns true if the `@sealed` modifier tag was specified.
|
| 69 |
+
*/
|
| 70 |
+
isSealed() {
|
| 71 |
+
return this.hasTag(StandardTags_1.StandardTags.sealed);
|
| 72 |
+
}
|
| 73 |
+
/**
|
| 74 |
+
* Returns true if the `@virtual` modifier tag was specified.
|
| 75 |
+
*/
|
| 76 |
+
isVirtual() {
|
| 77 |
+
return this.hasTag(StandardTags_1.StandardTags.virtual);
|
| 78 |
+
}
|
| 79 |
+
}
|
| 80 |
+
exports.StandardModifierTagSet = StandardModifierTagSet;
|
| 81 |
+
//# sourceMappingURL=StandardModifierTagSet.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/details/StandardModifierTagSet.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"StandardModifierTagSet.js","sourceRoot":"","sources":["../../src/details/StandardModifierTagSet.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,qDAAkD;AAClD,iDAA8C;AAE9C;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,+BAAc;IACxD;;OAEG;IACI,OAAO;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,2BAAY,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,MAAM;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,2BAAY,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACI,eAAe;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,2BAAY,CAAC,aAAa,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,2BAAY,CAAC,YAAY,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACI,UAAU;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,2BAAY,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACI,UAAU;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,2BAAY,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACI,sBAAsB;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,2BAAY,CAAC,oBAAoB,CAAC,CAAC;IACxD,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,2BAAY,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,UAAU;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,2BAAY,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,2BAAY,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,2BAAY,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;CACF;AA7ED,wDA6EC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { ModifierTagSet } from './ModifierTagSet';\r\nimport { StandardTags } from './StandardTags';\r\n\r\n/**\r\n * Extends the ModifierTagSet base class with getters for modifiers that\r\n * are part of the standardized core tags for TSDoc.\r\n */\r\nexport class StandardModifierTagSet extends ModifierTagSet {\r\n /**\r\n * Returns true if the `@alpha` modifier tag was specified.\r\n */\r\n public isAlpha(): boolean {\r\n return this.hasTag(StandardTags.alpha);\r\n }\r\n\r\n /**\r\n * Returns true if the `@beta` modifier tag was specified.\r\n */\r\n public isBeta(): boolean {\r\n return this.hasTag(StandardTags.beta);\r\n }\r\n\r\n /**\r\n * Returns true if the `@eventProperty` modifier tag was specified.\r\n */\r\n public isEventProperty(): boolean {\r\n return this.hasTag(StandardTags.eventProperty);\r\n }\r\n\r\n /**\r\n * Returns true if the `@experimental` modifier tag was specified.\r\n */\r\n public isExperimental(): boolean {\r\n return this.hasTag(StandardTags.experimental);\r\n }\r\n\r\n /**\r\n * Returns true if the `@internal` modifier tag was specified.\r\n */\r\n public isInternal(): boolean {\r\n return this.hasTag(StandardTags.internal);\r\n }\r\n\r\n /**\r\n * Returns true if the `@override` modifier tag was specified.\r\n */\r\n public isOverride(): boolean {\r\n return this.hasTag(StandardTags.override);\r\n }\r\n\r\n /**\r\n * Returns true if the `@packageDocumentation` modifier tag was specified.\r\n */\r\n public isPackageDocumentation(): boolean {\r\n return this.hasTag(StandardTags.packageDocumentation);\r\n }\r\n\r\n /**\r\n * Returns true if the `@public` modifier tag was specified.\r\n */\r\n public isPublic(): boolean {\r\n return this.hasTag(StandardTags.public);\r\n }\r\n\r\n /**\r\n * Returns true if the `@readonly` modifier tag was specified.\r\n */\r\n public isReadonly(): boolean {\r\n return this.hasTag(StandardTags.readonly);\r\n }\r\n\r\n /**\r\n * Returns true if the `@sealed` modifier tag was specified.\r\n */\r\n public isSealed(): boolean {\r\n return this.hasTag(StandardTags.sealed);\r\n }\r\n\r\n /**\r\n * Returns true if the `@virtual` modifier tag was specified.\r\n */\r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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.StandardTags = void 0;
|
| 6 |
+
const TSDocTagDefinition_1 = require("../configuration/TSDocTagDefinition");
|
| 7 |
+
const Standardization_1 = require("./Standardization");
|
| 8 |
+
/**
|
| 9 |
+
* Tags whose meaning is defined by the TSDoc standard.
|
| 10 |
+
*/
|
| 11 |
+
class StandardTags {
|
| 12 |
+
static _defineTag(parameters) {
|
| 13 |
+
return new TSDocTagDefinition_1.TSDocTagDefinition(parameters);
|
| 14 |
+
}
|
| 15 |
+
}
|
| 16 |
+
exports.StandardTags = StandardTags;
|
| 17 |
+
/**
|
| 18 |
+
* (Discretionary)
|
| 19 |
+
*
|
| 20 |
+
* Suggested meaning: Designates that an API item's release stage is "alpha".
|
| 21 |
+
* It is intended to be used by third-party developers eventually, but has not
|
| 22 |
+
* yet been released. The tooling may trim the declaration from a public release.
|
| 23 |
+
*
|
| 24 |
+
* @remarks
|
| 25 |
+
* Example implementations: API Extractor
|
| 26 |
+
*/
|
| 27 |
+
StandardTags.alpha = StandardTags._defineTag({
|
| 28 |
+
tagName: '@alpha',
|
| 29 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag,
|
| 30 |
+
standardization: Standardization_1.Standardization.Discretionary
|
| 31 |
+
});
|
| 32 |
+
/**
|
| 33 |
+
* (Discretionary)
|
| 34 |
+
*
|
| 35 |
+
* Suggested meaning: Designates that an API item's release stage is "beta".
|
| 36 |
+
* It has been released to third-party developers experimentally for the purpose of
|
| 37 |
+
* collecting feedback. The API should not be used in production, because its contract may
|
| 38 |
+
* change without notice. The tooling may trim the declaration from a public release,
|
| 39 |
+
* but may include it in a developer preview release.
|
| 40 |
+
*
|
| 41 |
+
* @remarks
|
| 42 |
+
* Example implementations: API Extractor
|
| 43 |
+
*
|
| 44 |
+
* Synonyms: `@experimental`
|
| 45 |
+
*/
|
| 46 |
+
StandardTags.beta = StandardTags._defineTag({
|
| 47 |
+
tagName: '@beta',
|
| 48 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag,
|
| 49 |
+
standardization: Standardization_1.Standardization.Discretionary
|
| 50 |
+
});
|
| 51 |
+
/**
|
| 52 |
+
* (Extended)
|
| 53 |
+
*
|
| 54 |
+
* ECMAScript decorators are sometimes an important part of an API contract.
|
| 55 |
+
* However, today the TypeScript compiler does not represent decorators in the
|
| 56 |
+
* .d.ts output files used by API consumers. The `@decorator` tag provides a workaround,
|
| 57 |
+
* enabling a decorator expressions to be quoted in a doc comment.
|
| 58 |
+
*
|
| 59 |
+
* @example
|
| 60 |
+
* ```ts
|
| 61 |
+
* class Book {
|
| 62 |
+
* /**
|
| 63 |
+
* * The title of the book.
|
| 64 |
+
* * @decorator `@jsonSerialized`
|
| 65 |
+
* * @decorator `@jsonFormat(JsonFormats.Url)`
|
| 66 |
+
* *
|
| 67 |
+
*+/
|
| 68 |
+
* @jsonSerialized
|
| 69 |
+
* @jsonFormat(JsonFormats.Url)
|
| 70 |
+
* public website: string;
|
| 71 |
+
* }
|
| 72 |
+
* ```
|
| 73 |
+
*/
|
| 74 |
+
StandardTags.decorator = StandardTags._defineTag({
|
| 75 |
+
tagName: '@decorator',
|
| 76 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 77 |
+
allowMultiple: true,
|
| 78 |
+
standardization: Standardization_1.Standardization.Extended
|
| 79 |
+
});
|
| 80 |
+
/**
|
| 81 |
+
* (Extended)
|
| 82 |
+
*
|
| 83 |
+
* This block tag is used to document the default value for a field or property,
|
| 84 |
+
* if a value is not assigned explicitly.
|
| 85 |
+
*
|
| 86 |
+
* @remarks
|
| 87 |
+
* This tag should only be used with fields or properties that are members of a class or interface.
|
| 88 |
+
*/
|
| 89 |
+
StandardTags.defaultValue = StandardTags._defineTag({
|
| 90 |
+
tagName: '@defaultValue',
|
| 91 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 92 |
+
standardization: Standardization_1.Standardization.Extended
|
| 93 |
+
});
|
| 94 |
+
/**
|
| 95 |
+
* (Core)
|
| 96 |
+
*
|
| 97 |
+
* This block tag communicates that an API item is no longer supported and may be removed
|
| 98 |
+
* in a future release. The `@deprecated` tag is followed by a sentence describing
|
| 99 |
+
* the recommended alternative. It recursively applies to members of the container.
|
| 100 |
+
* For example, if a class is deprecated, then so are all of its members.
|
| 101 |
+
*/
|
| 102 |
+
StandardTags.deprecated = StandardTags._defineTag({
|
| 103 |
+
tagName: '@deprecated',
|
| 104 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 105 |
+
standardization: Standardization_1.Standardization.Core
|
| 106 |
+
});
|
| 107 |
+
/**
|
| 108 |
+
* (Extended)
|
| 109 |
+
*
|
| 110 |
+
* When applied to a class or interface property, this indicates that the property
|
| 111 |
+
* returns an event object that event handlers can be attached to. The event-handling
|
| 112 |
+
* API is implementation-defined, but typically the property return type would be a class
|
| 113 |
+
* with members such as `addHandler()` and `removeHandler()`. A documentation tool can
|
| 114 |
+
* display such properties under an "Events" heading instead of the usual "Properties" heading.
|
| 115 |
+
*/
|
| 116 |
+
StandardTags.eventProperty = StandardTags._defineTag({
|
| 117 |
+
tagName: '@eventProperty',
|
| 118 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag,
|
| 119 |
+
standardization: Standardization_1.Standardization.Extended
|
| 120 |
+
});
|
| 121 |
+
/**
|
| 122 |
+
* (Extended)
|
| 123 |
+
*
|
| 124 |
+
* Indicates a documentation section that should be presented as an example
|
| 125 |
+
* illustrating how to use the API. It may include a code sample.
|
| 126 |
+
*/
|
| 127 |
+
StandardTags.example = StandardTags._defineTag({
|
| 128 |
+
tagName: '@example',
|
| 129 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 130 |
+
allowMultiple: true,
|
| 131 |
+
standardization: Standardization_1.Standardization.Extended
|
| 132 |
+
});
|
| 133 |
+
/**
|
| 134 |
+
* (Discretionary)
|
| 135 |
+
*
|
| 136 |
+
* Suggested meaning: Same semantics as `@beta`, but used by tools that don't support
|
| 137 |
+
* an `@alpha` release stage.
|
| 138 |
+
*
|
| 139 |
+
* @remarks
|
| 140 |
+
* Example implementations: Angular API documenter
|
| 141 |
+
*
|
| 142 |
+
* Synonyms: `@beta`
|
| 143 |
+
*/
|
| 144 |
+
StandardTags.experimental = StandardTags._defineTag({
|
| 145 |
+
tagName: '@experimental',
|
| 146 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag,
|
| 147 |
+
standardization: Standardization_1.Standardization.Discretionary
|
| 148 |
+
});
|
| 149 |
+
/**
|
| 150 |
+
* (Extended)
|
| 151 |
+
*
|
| 152 |
+
* This inline tag is used to automatically generate an API item's documentation by
|
| 153 |
+
* copying it from another API item. The inline tag parameter contains a reference
|
| 154 |
+
* to the other item, which may be an unrelated class, or even an import from a
|
| 155 |
+
* separate NPM package.
|
| 156 |
+
*
|
| 157 |
+
* @remarks
|
| 158 |
+
* What gets copied
|
| 159 |
+
*
|
| 160 |
+
* The `@inheritDoc` tag does not copy the entire comment body. Only the following
|
| 161 |
+
* components are copied:
|
| 162 |
+
* - summary section
|
| 163 |
+
* - `@remarks` block
|
| 164 |
+
* - `@params` blocks
|
| 165 |
+
* - `@typeParam` blocks
|
| 166 |
+
* - `@returns` block
|
| 167 |
+
* Other tags such as `@defaultValue` or `@example` are not copied, and need to be
|
| 168 |
+
* explicitly included after the `@inheritDoc` tag.
|
| 169 |
+
*
|
| 170 |
+
* TODO: The notation for API item references is still being standardized. See this issue:
|
| 171 |
+
* https://github.com/microsoft/tsdoc/issues/9
|
| 172 |
+
*/
|
| 173 |
+
StandardTags.inheritDoc = StandardTags._defineTag({
|
| 174 |
+
tagName: '@inheritDoc',
|
| 175 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.InlineTag,
|
| 176 |
+
standardization: Standardization_1.Standardization.Extended
|
| 177 |
+
});
|
| 178 |
+
/**
|
| 179 |
+
* (Discretionary)
|
| 180 |
+
*
|
| 181 |
+
* Suggested meaning: Designates that an API item is not planned to be used by
|
| 182 |
+
* third-party developers. The tooling may trim the declaration from a public release.
|
| 183 |
+
* In some implementations, certain designated packages may be allowed to consume
|
| 184 |
+
* internal API items, e.g. because the packages are components of the same product.
|
| 185 |
+
*
|
| 186 |
+
* @remarks
|
| 187 |
+
* Example implementations: API Extractor
|
| 188 |
+
*/
|
| 189 |
+
StandardTags.internal = StandardTags._defineTag({
|
| 190 |
+
tagName: '@internal',
|
| 191 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag,
|
| 192 |
+
standardization: Standardization_1.Standardization.Discretionary
|
| 193 |
+
});
|
| 194 |
+
/**
|
| 195 |
+
* (Core)
|
| 196 |
+
*
|
| 197 |
+
* The `{@label}` inline tag is used to label a declaration, so that it can be referenced
|
| 198 |
+
* using a selector in the TSDoc declaration reference notation.
|
| 199 |
+
*
|
| 200 |
+
* @remarks
|
| 201 |
+
* TODO: The `{@label}` notation is still being standardized. See this issue:
|
| 202 |
+
* https://github.com/microsoft/tsdoc/issues/9
|
| 203 |
+
*/
|
| 204 |
+
StandardTags.label = StandardTags._defineTag({
|
| 205 |
+
tagName: '@label',
|
| 206 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.InlineTag,
|
| 207 |
+
standardization: Standardization_1.Standardization.Core
|
| 208 |
+
});
|
| 209 |
+
/**
|
| 210 |
+
* (Core)
|
| 211 |
+
*
|
| 212 |
+
* The `{@link}` inline tag is used to create hyperlinks to other pages in a
|
| 213 |
+
* documentation system or general internet URLs. In particular, it supports
|
| 214 |
+
* expressions for referencing API items.
|
| 215 |
+
*
|
| 216 |
+
* @remarks
|
| 217 |
+
* TODO: The `{@link}` notation is still being standardized. See this issue:
|
| 218 |
+
* https://github.com/microsoft/tsdoc/issues/9
|
| 219 |
+
*/
|
| 220 |
+
StandardTags.link = StandardTags._defineTag({
|
| 221 |
+
tagName: '@link',
|
| 222 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.InlineTag,
|
| 223 |
+
allowMultiple: true,
|
| 224 |
+
standardization: Standardization_1.Standardization.Core
|
| 225 |
+
});
|
| 226 |
+
/**
|
| 227 |
+
* (Extended)
|
| 228 |
+
*
|
| 229 |
+
* This modifier has similar semantics to the `override` keyword in C# or Java.
|
| 230 |
+
* For a member function or property, explicitly indicates that this definition
|
| 231 |
+
* is overriding (i.e. redefining) the definition inherited from the base class.
|
| 232 |
+
* The base class definition would normally be marked as `virtual`.
|
| 233 |
+
*
|
| 234 |
+
* @remarks
|
| 235 |
+
* A documentation tool may enforce that the `@virtual`, `@override`, and/or `@sealed`
|
| 236 |
+
* modifiers are consistently applied, but this is not required by the TSDoc standard.
|
| 237 |
+
*/
|
| 238 |
+
StandardTags.override = StandardTags._defineTag({
|
| 239 |
+
tagName: '@override',
|
| 240 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag,
|
| 241 |
+
standardization: Standardization_1.Standardization.Extended
|
| 242 |
+
});
|
| 243 |
+
/**
|
| 244 |
+
* (Core)
|
| 245 |
+
*
|
| 246 |
+
* Used to indicate a doc comment that describes an entire NPM package (as opposed
|
| 247 |
+
* to an individual API item belonging to that package). The `@packageDocumentation` comment
|
| 248 |
+
* is found in the *.d.ts file that acts as the entry point for the package, and it
|
| 249 |
+
* should be the first `/**` comment encountered in that file. A comment containing a
|
| 250 |
+
* `@packageDocumentation` tag should never be used to describe an individual API item.
|
| 251 |
+
*/
|
| 252 |
+
StandardTags.packageDocumentation = StandardTags._defineTag({
|
| 253 |
+
tagName: '@packageDocumentation',
|
| 254 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag,
|
| 255 |
+
standardization: Standardization_1.Standardization.Core
|
| 256 |
+
});
|
| 257 |
+
/**
|
| 258 |
+
* (Core)
|
| 259 |
+
*
|
| 260 |
+
* Used to document a function parameter. The `@param` tag is followed by a parameter
|
| 261 |
+
* name, followed by a hyphen, followed by a description. The TSDoc parser recognizes
|
| 262 |
+
* this syntax and will extract it into a DocParamBlock node.
|
| 263 |
+
*/
|
| 264 |
+
StandardTags.param = StandardTags._defineTag({
|
| 265 |
+
tagName: '@param',
|
| 266 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 267 |
+
allowMultiple: true,
|
| 268 |
+
standardization: Standardization_1.Standardization.Core
|
| 269 |
+
});
|
| 270 |
+
/**
|
| 271 |
+
* (Core)
|
| 272 |
+
*
|
| 273 |
+
* Starts a section of additional documentation content that is not intended for a
|
| 274 |
+
* public audience. A tool must omit this entire section from the API reference web site,
|
| 275 |
+
* generated *.d.ts file, and any other outputs incorporating the content.
|
| 276 |
+
*/
|
| 277 |
+
StandardTags.privateRemarks = StandardTags._defineTag({
|
| 278 |
+
tagName: '@privateRemarks',
|
| 279 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 280 |
+
standardization: Standardization_1.Standardization.Core
|
| 281 |
+
});
|
| 282 |
+
/**
|
| 283 |
+
* (Discretionary)
|
| 284 |
+
*
|
| 285 |
+
* Suggested meaning: Designates that an API item's release stage is "public".
|
| 286 |
+
* It has been officially released to third-party developers, and its signature is
|
| 287 |
+
* guaranteed to be stable (e.g. following Semantic Versioning rules).
|
| 288 |
+
*
|
| 289 |
+
* @remarks
|
| 290 |
+
* Example implementations: API Extractor
|
| 291 |
+
*/
|
| 292 |
+
StandardTags.public = StandardTags._defineTag({
|
| 293 |
+
tagName: '@public',
|
| 294 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag,
|
| 295 |
+
standardization: Standardization_1.Standardization.Discretionary
|
| 296 |
+
});
|
| 297 |
+
/**
|
| 298 |
+
* (Extended)
|
| 299 |
+
*
|
| 300 |
+
* This modifier tag indicates that an API item should be documented as being read-only,
|
| 301 |
+
* even if the TypeScript type system may indicate otherwise. For example, suppose a
|
| 302 |
+
* class property has a setter function that always throws an exception explaining that
|
| 303 |
+
* the property cannot be assigned; in this situation, the `@readonly` modifier can be
|
| 304 |
+
* added so that the property is shown as read-only in the documentation.
|
| 305 |
+
*
|
| 306 |
+
* @remarks
|
| 307 |
+
* Example implementations: API Extractor
|
| 308 |
+
*/
|
| 309 |
+
StandardTags.readonly = StandardTags._defineTag({
|
| 310 |
+
tagName: '@readonly',
|
| 311 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag,
|
| 312 |
+
standardization: Standardization_1.Standardization.Extended
|
| 313 |
+
});
|
| 314 |
+
/**
|
| 315 |
+
* (Core)
|
| 316 |
+
*
|
| 317 |
+
* The main documentation for an API item is separated into a brief "summary" section,
|
| 318 |
+
* optionally followed by a more detailed "remarks" section. On a documentation web site,
|
| 319 |
+
* index pages (e.g. showing members of a class) will show only the brief summaries,
|
| 320 |
+
* whereas a detail pages (e.g. describing a single member) will show the summary followed
|
| 321 |
+
* by the remarks. The `@remarks` block tag ends the summary section, and begins the
|
| 322 |
+
* remarks section for a doc comment.
|
| 323 |
+
*/
|
| 324 |
+
StandardTags.remarks = StandardTags._defineTag({
|
| 325 |
+
tagName: '@remarks',
|
| 326 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 327 |
+
standardization: Standardization_1.Standardization.Core
|
| 328 |
+
});
|
| 329 |
+
/**
|
| 330 |
+
* (Core)
|
| 331 |
+
*
|
| 332 |
+
* Used to document the return value for a function.
|
| 333 |
+
*/
|
| 334 |
+
StandardTags.returns = StandardTags._defineTag({
|
| 335 |
+
tagName: '@returns',
|
| 336 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 337 |
+
standardization: Standardization_1.Standardization.Core
|
| 338 |
+
});
|
| 339 |
+
/**
|
| 340 |
+
* (Extended)
|
| 341 |
+
*
|
| 342 |
+
* This modifier has similar semantics to the `sealed` keyword in C# or Java.
|
| 343 |
+
* For a class, indicates that subclasses must not inherit from the class.
|
| 344 |
+
* For a member function or property, indicates that subclasses must not override
|
| 345 |
+
* (i.e. redefine) the member.
|
| 346 |
+
*
|
| 347 |
+
* @remarks
|
| 348 |
+
* A documentation tool may enforce that the `@virtual`, `@override`, and/or `@sealed`
|
| 349 |
+
* modifiers are consistently applied, but this is not required by the TSDoc standard.
|
| 350 |
+
*/
|
| 351 |
+
StandardTags.sealed = StandardTags._defineTag({
|
| 352 |
+
tagName: '@sealed',
|
| 353 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag,
|
| 354 |
+
standardization: Standardization_1.Standardization.Extended
|
| 355 |
+
});
|
| 356 |
+
/**
|
| 357 |
+
* (Extended)
|
| 358 |
+
*
|
| 359 |
+
* Used to build a list of references to an API item or other resource that may be related to the
|
| 360 |
+
* current item.
|
| 361 |
+
*
|
| 362 |
+
* @remarks
|
| 363 |
+
*
|
| 364 |
+
* For example:
|
| 365 |
+
*
|
| 366 |
+
* ```ts
|
| 367 |
+
* /**
|
| 368 |
+
* * Parses a string containing a Uniform Resource Locator (URL).
|
| 369 |
+
* * @see {@link ParsedUrl} for the returned data structure
|
| 370 |
+
* * @see {@link https://tools.ietf.org/html/rfc1738|RFC 1738}
|
| 371 |
+
* * for syntax
|
| 372 |
+
* * @see your developer SDK for code samples
|
| 373 |
+
* * @param url - the string to be parsed
|
| 374 |
+
* * @returns the parsed result
|
| 375 |
+
* */
|
| 376 |
+
* function parseURL(url: string): ParsedUrl;
|
| 377 |
+
* ```
|
| 378 |
+
*
|
| 379 |
+
* `@see` is a block tag. Each block becomes an item in the list of references. For example, a documentation
|
| 380 |
+
* system might render the above blocks as follows:
|
| 381 |
+
*
|
| 382 |
+
* ```markdown
|
| 383 |
+
* `function parseURL(url: string): ParsedUrl;`
|
| 384 |
+
*
|
| 385 |
+
* Parses a string containing a Uniform Resource Locator (URL).
|
| 386 |
+
*
|
| 387 |
+
* ## See Also
|
| 388 |
+
* - ParsedUrl for the returned data structure
|
| 389 |
+
* - RFC 1738 for syntax
|
| 390 |
+
* - your developer SDK for code samples
|
| 391 |
+
* ```
|
| 392 |
+
*
|
| 393 |
+
* NOTE: JSDoc attempts to automatically hyperlink the text immediately after `@see`. Because this is ambiguous
|
| 394 |
+
* with plain text, TSDoc instead requires an explicit `{@link}` tag to make hyperlinks.
|
| 395 |
+
*/
|
| 396 |
+
StandardTags.see = StandardTags._defineTag({
|
| 397 |
+
tagName: '@see',
|
| 398 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 399 |
+
standardization: Standardization_1.Standardization.Extended
|
| 400 |
+
});
|
| 401 |
+
/**
|
| 402 |
+
* (Extended)
|
| 403 |
+
*
|
| 404 |
+
* Used to document an exception type that may be thrown by a function or property.
|
| 405 |
+
*
|
| 406 |
+
* @remarks
|
| 407 |
+
*
|
| 408 |
+
* A separate `@throws` block should be used to document each exception type. This tag is for informational
|
| 409 |
+
* purposes only, and does not restrict other types from being thrown. It is suggested, but not required,
|
| 410 |
+
* for the `@throws` block to start with a line containing only the name of the exception.
|
| 411 |
+
*
|
| 412 |
+
* For example:
|
| 413 |
+
*
|
| 414 |
+
* ```ts
|
| 415 |
+
* /**
|
| 416 |
+
* * Retrieves metadata about a book from the catalog.
|
| 417 |
+
* *
|
| 418 |
+
* * @param isbnCode - the ISBN number for the book
|
| 419 |
+
* * @returns the retrieved book object
|
| 420 |
+
* *
|
| 421 |
+
* * @throws {@link IsbnSyntaxError}
|
| 422 |
+
* * This exception is thrown if the input is not a valid ISBN number.
|
| 423 |
+
* *
|
| 424 |
+
* * @throws {@link book-lib#BookNotFoundError}
|
| 425 |
+
* * Thrown if the ISBN number is valid, but no such book exists in the catalog.
|
| 426 |
+
* *
|
| 427 |
+
* * @public
|
| 428 |
+
* */
|
| 429 |
+
* function fetchBookByIsbn(isbnCode: string): Book;
|
| 430 |
+
* ```
|
| 431 |
+
*/
|
| 432 |
+
StandardTags.throws = StandardTags._defineTag({
|
| 433 |
+
tagName: '@throws',
|
| 434 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 435 |
+
allowMultiple: true,
|
| 436 |
+
standardization: Standardization_1.Standardization.Extended
|
| 437 |
+
});
|
| 438 |
+
/**
|
| 439 |
+
* (Core)
|
| 440 |
+
*
|
| 441 |
+
* Used to document a generic parameter. The `@typeParam` tag is followed by a parameter
|
| 442 |
+
* name, followed by a hyphen, followed by a description. The TSDoc parser recognizes
|
| 443 |
+
* this syntax and will extract it into a DocParamBlock node.
|
| 444 |
+
*/
|
| 445 |
+
StandardTags.typeParam = StandardTags._defineTag({
|
| 446 |
+
tagName: '@typeParam',
|
| 447 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 448 |
+
allowMultiple: true,
|
| 449 |
+
standardization: Standardization_1.Standardization.Core
|
| 450 |
+
});
|
| 451 |
+
/**
|
| 452 |
+
* (Extended)
|
| 453 |
+
*
|
| 454 |
+
* This modifier has similar semantics to the `virtual` keyword in C# or Java.
|
| 455 |
+
* For a member function or property, explicitly indicates that subclasses may override
|
| 456 |
+
* (i.e. redefine) the member.
|
| 457 |
+
*
|
| 458 |
+
* @remarks
|
| 459 |
+
* A documentation tool may enforce that the `@virtual`, `@override`, and/or `@sealed`
|
| 460 |
+
* modifiers are consistently applied, but this is not required by the TSDoc standard.
|
| 461 |
+
*/
|
| 462 |
+
StandardTags.virtual = StandardTags._defineTag({
|
| 463 |
+
tagName: '@virtual',
|
| 464 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.ModifierTag,
|
| 465 |
+
standardization: Standardization_1.Standardization.Extended
|
| 466 |
+
});
|
| 467 |
+
/**
|
| 468 |
+
* (Extended)
|
| 469 |
+
*
|
| 470 |
+
* Used to specify the JSX factory function to use when compiling JSX syntax.
|
| 471 |
+
*
|
| 472 |
+
* @remarks
|
| 473 |
+
* The TypeScript compiler recognizes this tag and specifies its behavior:
|
| 474 |
+
*
|
| 475 |
+
* @see {@link https://www.typescriptlang.org/tsconfig/#jsx}
|
| 476 |
+
*/
|
| 477 |
+
StandardTags.jsx = StandardTags._defineTag({
|
| 478 |
+
tagName: '@jsx',
|
| 479 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 480 |
+
standardization: Standardization_1.Standardization.Extended
|
| 481 |
+
});
|
| 482 |
+
/**
|
| 483 |
+
* (Extended)
|
| 484 |
+
*
|
| 485 |
+
* Used to specify the JSX runtime to use when compiling JSX syntax.
|
| 486 |
+
*
|
| 487 |
+
* @remarks
|
| 488 |
+
* The TypeScript compiler recognizes this tag and specifies its behavior:
|
| 489 |
+
*
|
| 490 |
+
* @see {@link https://www.typescriptlang.org/tsconfig/#jsx}
|
| 491 |
+
*/
|
| 492 |
+
StandardTags.jsxRuntime = StandardTags._defineTag({
|
| 493 |
+
tagName: '@jsxRuntime',
|
| 494 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 495 |
+
standardization: Standardization_1.Standardization.Extended
|
| 496 |
+
});
|
| 497 |
+
/**
|
| 498 |
+
* (Extended)
|
| 499 |
+
*
|
| 500 |
+
* Used to specify the JSX fragment factory to use when compiling JSX syntax.
|
| 501 |
+
*
|
| 502 |
+
* @remarks
|
| 503 |
+
* The TypeScript compiler recognizes this tag and specifies its behavior:
|
| 504 |
+
*
|
| 505 |
+
* @see {@link https://www.typescriptlang.org/tsconfig/#jsx}
|
| 506 |
+
*/
|
| 507 |
+
StandardTags.jsxFrag = StandardTags._defineTag({
|
| 508 |
+
tagName: '@jsxFrag',
|
| 509 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 510 |
+
standardization: Standardization_1.Standardization.Extended
|
| 511 |
+
});
|
| 512 |
+
/**
|
| 513 |
+
* (Extended)
|
| 514 |
+
*
|
| 515 |
+
* Used to specify the JSX import source when compiling JSX syntax.
|
| 516 |
+
*
|
| 517 |
+
* @remarks
|
| 518 |
+
* The TypeScript compiler recognizes this tag and specifies its behavior:
|
| 519 |
+
*
|
| 520 |
+
* @see {@link https://www.typescriptlang.org/tsconfig/#jsx}
|
| 521 |
+
*/
|
| 522 |
+
StandardTags.jsxImportSource = StandardTags._defineTag({
|
| 523 |
+
tagName: '@jsxImportSource',
|
| 524 |
+
syntaxKind: TSDocTagDefinition_1.TSDocTagSyntaxKind.BlockTag,
|
| 525 |
+
standardization: Standardization_1.Standardization.Extended
|
| 526 |
+
});
|
| 527 |
+
/**
|
| 528 |
+
* Returns the full list of all core tags.
|
| 529 |
+
*/
|
| 530 |
+
StandardTags.allDefinitions = [
|
| 531 |
+
StandardTags.alpha,
|
| 532 |
+
StandardTags.beta,
|
| 533 |
+
StandardTags.defaultValue,
|
| 534 |
+
StandardTags.decorator,
|
| 535 |
+
StandardTags.deprecated,
|
| 536 |
+
StandardTags.eventProperty,
|
| 537 |
+
StandardTags.example,
|
| 538 |
+
StandardTags.experimental,
|
| 539 |
+
StandardTags.inheritDoc,
|
| 540 |
+
StandardTags.internal,
|
| 541 |
+
StandardTags.label,
|
| 542 |
+
StandardTags.link,
|
| 543 |
+
StandardTags.override,
|
| 544 |
+
StandardTags.packageDocumentation,
|
| 545 |
+
StandardTags.param,
|
| 546 |
+
StandardTags.privateRemarks,
|
| 547 |
+
StandardTags.public,
|
| 548 |
+
StandardTags.readonly,
|
| 549 |
+
StandardTags.remarks,
|
| 550 |
+
StandardTags.returns,
|
| 551 |
+
StandardTags.sealed,
|
| 552 |
+
StandardTags.see,
|
| 553 |
+
StandardTags.throws,
|
| 554 |
+
StandardTags.typeParam,
|
| 555 |
+
StandardTags.virtual,
|
| 556 |
+
StandardTags.jsx,
|
| 557 |
+
StandardTags.jsxRuntime,
|
| 558 |
+
StandardTags.jsxFrag,
|
| 559 |
+
StandardTags.jsxImportSource
|
| 560 |
+
];
|
| 561 |
+
//# sourceMappingURL=StandardTags.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/details/StandardTags.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"StandardTags.js","sourceRoot":"","sources":["../../src/details/StandardTags.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,4EAI6C;AAC7C,uDAAoD;AAEpD;;GAEG;AACH,MAAa,YAAY;IA+jBf,MAAM,CAAC,UAAU,CAAC,UAAiD;QACzE,OAAO,IAAI,uCAAkB,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;;AAjkBH,oCAkkBC;AAjkBC;;;;;;;;;GASG;AACoB,kBAAK,GAAuB,YAAY,CAAC,UAAU,CAAC;IACzE,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,uCAAkB,CAAC,WAAW;IAC1C,eAAe,EAAE,iCAAe,CAAC,aAAa;CAC/C,CAAC,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ChB,YAAY,CAAC,UAAU;IACvB,YAAY,CAAC,OAAO;IACpB,YAAY,CAAC,eAAe;CAC7B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport {\r\n TSDocTagDefinition,\r\n TSDocTagSyntaxKind,\r\n type ITSDocTagDefinitionInternalParameters\r\n} from '../configuration/TSDocTagDefinition';\r\nimport { Standardization } from './Standardization';\r\n\r\n/**\r\n * Tags whose meaning is defined by the TSDoc standard.\r\n */\r\nexport class StandardTags {\r\n /**\r\n * (Discretionary)\r\n *\r\n * Suggested meaning: Designates that an API item's release stage is \"alpha\".\r\n * It is intended to be used by third-party developers eventually, but has not\r\n * yet been released. The tooling may trim the declaration from a public release.\r\n *\r\n * @remarks\r\n * Example implementations: API Extractor\r\n */\r\n public static readonly alpha: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@alpha',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag,\r\n standardization: Standardization.Discretionary\r\n });\r\n\r\n /**\r\n * (Discretionary)\r\n *\r\n * Suggested meaning: Designates that an API item's release stage is \"beta\".\r\n * It has been released to third-party developers experimentally for the purpose of\r\n * collecting feedback. The API should not be used in production, because its contract may\r\n * change without notice. The tooling may trim the declaration from a public release,\r\n * but may include it in a developer preview release.\r\n *\r\n * @remarks\r\n * Example implementations: API Extractor\r\n *\r\n * Synonyms: `@experimental`\r\n */\r\n public static readonly beta: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@beta',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag,\r\n standardization: Standardization.Discretionary\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * ECMAScript decorators are sometimes an important part of an API contract.\r\n * However, today the TypeScript compiler does not represent decorators in the\r\n * .d.ts output files used by API consumers. The `@decorator` tag provides a workaround,\r\n * enabling a decorator expressions to be quoted in a doc comment.\r\n *\r\n * @example\r\n * ```ts\r\n * class Book {\r\n * /**\r\n * * The title of the book.\r\n * * @decorator `@jsonSerialized`\r\n * * @decorator `@jsonFormat(JsonFormats.Url)`\r\n * *\r\n *+/\r\n * @jsonSerialized\r\n * @jsonFormat(JsonFormats.Url)\r\n * public website: string;\r\n * }\r\n * ```\r\n */\r\n public static readonly decorator: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@decorator',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n allowMultiple: true,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * This block tag is used to document the default value for a field or property,\r\n * if a value is not assigned explicitly.\r\n *\r\n * @remarks\r\n * This tag should only be used with fields or properties that are members of a class or interface.\r\n */\r\n public static readonly defaultValue: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@defaultValue',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Core)\r\n *\r\n * This block tag communicates that an API item is no longer supported and may be removed\r\n * in a future release. The `@deprecated` tag is followed by a sentence describing\r\n * the recommended alternative. It recursively applies to members of the container.\r\n * For example, if a class is deprecated, then so are all of its members.\r\n */\r\n public static readonly deprecated: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@deprecated',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n standardization: Standardization.Core\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * When applied to a class or interface property, this indicates that the property\r\n * returns an event object that event handlers can be attached to. The event-handling\r\n * API is implementation-defined, but typically the property return type would be a class\r\n * with members such as `addHandler()` and `removeHandler()`. A documentation tool can\r\n * display such properties under an \"Events\" heading instead of the usual \"Properties\" heading.\r\n */\r\n public static readonly eventProperty: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@eventProperty',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * Indicates a documentation section that should be presented as an example\r\n * illustrating how to use the API. It may include a code sample.\r\n */\r\n public static readonly example: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@example',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n allowMultiple: true,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Discretionary)\r\n *\r\n * Suggested meaning: Same semantics as `@beta`, but used by tools that don't support\r\n * an `@alpha` release stage.\r\n *\r\n * @remarks\r\n * Example implementations: Angular API documenter\r\n *\r\n * Synonyms: `@beta`\r\n */\r\n public static readonly experimental: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@experimental',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag,\r\n standardization: Standardization.Discretionary\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * This inline tag is used to automatically generate an API item's documentation by\r\n * copying it from another API item. The inline tag parameter contains a reference\r\n * to the other item, which may be an unrelated class, or even an import from a\r\n * separate NPM package.\r\n *\r\n * @remarks\r\n * What gets copied\r\n *\r\n * The `@inheritDoc` tag does not copy the entire comment body. Only the following\r\n * components are copied:\r\n * - summary section\r\n * - `@remarks` block\r\n * - `@params` blocks\r\n * - `@typeParam` blocks\r\n * - `@returns` block\r\n * Other tags such as `@defaultValue` or `@example` are not copied, and need to be\r\n * explicitly included after the `@inheritDoc` tag.\r\n *\r\n * TODO: The notation for API item references is still being standardized. See this issue:\r\n * https://github.com/microsoft/tsdoc/issues/9\r\n */\r\n public static readonly inheritDoc: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@inheritDoc',\r\n syntaxKind: TSDocTagSyntaxKind.InlineTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Discretionary)\r\n *\r\n * Suggested meaning: Designates that an API item is not planned to be used by\r\n * third-party developers. The tooling may trim the declaration from a public release.\r\n * In some implementations, certain designated packages may be allowed to consume\r\n * internal API items, e.g. because the packages are components of the same product.\r\n *\r\n * @remarks\r\n * Example implementations: API Extractor\r\n */\r\n public static readonly internal: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@internal',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag,\r\n standardization: Standardization.Discretionary\r\n });\r\n\r\n /**\r\n * (Core)\r\n *\r\n * The `{@label}` inline tag is used to label a declaration, so that it can be referenced\r\n * using a selector in the TSDoc declaration reference notation.\r\n *\r\n * @remarks\r\n * TODO: The `{@label}` notation is still being standardized. See this issue:\r\n * https://github.com/microsoft/tsdoc/issues/9\r\n */\r\n public static readonly label: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@label',\r\n syntaxKind: TSDocTagSyntaxKind.InlineTag,\r\n standardization: Standardization.Core\r\n });\r\n\r\n /**\r\n * (Core)\r\n *\r\n * The `{@link}` inline tag is used to create hyperlinks to other pages in a\r\n * documentation system or general internet URLs. In particular, it supports\r\n * expressions for referencing API items.\r\n *\r\n * @remarks\r\n * TODO: The `{@link}` notation is still being standardized. See this issue:\r\n * https://github.com/microsoft/tsdoc/issues/9\r\n */\r\n public static readonly link: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@link',\r\n syntaxKind: TSDocTagSyntaxKind.InlineTag,\r\n allowMultiple: true,\r\n standardization: Standardization.Core\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * This modifier has similar semantics to the `override` keyword in C# or Java.\r\n * For a member function or property, explicitly indicates that this definition\r\n * is overriding (i.e. redefining) the definition inherited from the base class.\r\n * The base class definition would normally be marked as `virtual`.\r\n *\r\n * @remarks\r\n * A documentation tool may enforce that the `@virtual`, `@override`, and/or `@sealed`\r\n * modifiers are consistently applied, but this is not required by the TSDoc standard.\r\n */\r\n public static readonly override: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@override',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Core)\r\n *\r\n * Used to indicate a doc comment that describes an entire NPM package (as opposed\r\n * to an individual API item belonging to that package). The `@packageDocumentation` comment\r\n * is found in the *.d.ts file that acts as the entry point for the package, and it\r\n * should be the first `/**` comment encountered in that file. A comment containing a\r\n * `@packageDocumentation` tag should never be used to describe an individual API item.\r\n */\r\n public static readonly packageDocumentation: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@packageDocumentation',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag,\r\n standardization: Standardization.Core\r\n });\r\n\r\n /**\r\n * (Core)\r\n *\r\n * Used to document a function parameter. The `@param` tag is followed by a parameter\r\n * name, followed by a hyphen, followed by a description. The TSDoc parser recognizes\r\n * this syntax and will extract it into a DocParamBlock node.\r\n */\r\n public static readonly param: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@param',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n allowMultiple: true,\r\n standardization: Standardization.Core\r\n });\r\n\r\n /**\r\n * (Core)\r\n *\r\n * Starts a section of additional documentation content that is not intended for a\r\n * public audience. A tool must omit this entire section from the API reference web site,\r\n * generated *.d.ts file, and any other outputs incorporating the content.\r\n */\r\n public static readonly privateRemarks: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@privateRemarks',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n standardization: Standardization.Core\r\n });\r\n\r\n /**\r\n * (Discretionary)\r\n *\r\n * Suggested meaning: Designates that an API item's release stage is \"public\".\r\n * It has been officially released to third-party developers, and its signature is\r\n * guaranteed to be stable (e.g. following Semantic Versioning rules).\r\n *\r\n * @remarks\r\n * Example implementations: API Extractor\r\n */\r\n public static readonly public: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@public',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag,\r\n standardization: Standardization.Discretionary\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * This modifier tag indicates that an API item should be documented as being read-only,\r\n * even if the TypeScript type system may indicate otherwise. For example, suppose a\r\n * class property has a setter function that always throws an exception explaining that\r\n * the property cannot be assigned; in this situation, the `@readonly` modifier can be\r\n * added so that the property is shown as read-only in the documentation.\r\n *\r\n * @remarks\r\n * Example implementations: API Extractor\r\n */\r\n public static readonly readonly: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@readonly',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Core)\r\n *\r\n * The main documentation for an API item is separated into a brief \"summary\" section,\r\n * optionally followed by a more detailed \"remarks\" section. On a documentation web site,\r\n * index pages (e.g. showing members of a class) will show only the brief summaries,\r\n * whereas a detail pages (e.g. describing a single member) will show the summary followed\r\n * by the remarks. The `@remarks` block tag ends the summary section, and begins the\r\n * remarks section for a doc comment.\r\n */\r\n public static readonly remarks: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@remarks',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n standardization: Standardization.Core\r\n });\r\n\r\n /**\r\n * (Core)\r\n *\r\n * Used to document the return value for a function.\r\n */\r\n public static readonly returns: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@returns',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n standardization: Standardization.Core\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * This modifier has similar semantics to the `sealed` keyword in C# or Java.\r\n * For a class, indicates that subclasses must not inherit from the class.\r\n * For a member function or property, indicates that subclasses must not override\r\n * (i.e. redefine) the member.\r\n *\r\n * @remarks\r\n * A documentation tool may enforce that the `@virtual`, `@override`, and/or `@sealed`\r\n * modifiers are consistently applied, but this is not required by the TSDoc standard.\r\n */\r\n public static readonly sealed: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@sealed',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * Used to build a list of references to an API item or other resource that may be related to the\r\n * current item.\r\n *\r\n * @remarks\r\n *\r\n * For example:\r\n *\r\n * ```ts\r\n * /**\r\n * * Parses a string containing a Uniform Resource Locator (URL).\r\n * * @see {@link ParsedUrl} for the returned data structure\r\n * * @see {@link https://tools.ietf.org/html/rfc1738|RFC 1738}\r\n * * for syntax\r\n * * @see your developer SDK for code samples\r\n * * @param url - the string to be parsed\r\n * * @returns the parsed result\r\n * */\r\n * function parseURL(url: string): ParsedUrl;\r\n * ```\r\n *\r\n * `@see` is a block tag. Each block becomes an item in the list of references. For example, a documentation\r\n * system might render the above blocks as follows:\r\n *\r\n * ```markdown\r\n * `function parseURL(url: string): ParsedUrl;`\r\n *\r\n * Parses a string containing a Uniform Resource Locator (URL).\r\n *\r\n * ## See Also\r\n * - ParsedUrl for the returned data structure\r\n * - RFC 1738 for syntax\r\n * - your developer SDK for code samples\r\n * ```\r\n *\r\n * NOTE: JSDoc attempts to automatically hyperlink the text immediately after `@see`. Because this is ambiguous\r\n * with plain text, TSDoc instead requires an explicit `{@link}` tag to make hyperlinks.\r\n */\r\n public static readonly see: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@see',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * Used to document an exception type that may be thrown by a function or property.\r\n *\r\n * @remarks\r\n *\r\n * A separate `@throws` block should be used to document each exception type. This tag is for informational\r\n * purposes only, and does not restrict other types from being thrown. It is suggested, but not required,\r\n * for the `@throws` block to start with a line containing only the name of the exception.\r\n *\r\n * For example:\r\n *\r\n * ```ts\r\n * /**\r\n * * Retrieves metadata about a book from the catalog.\r\n * *\r\n * * @param isbnCode - the ISBN number for the book\r\n * * @returns the retrieved book object\r\n * *\r\n * * @throws {@link IsbnSyntaxError}\r\n * * This exception is thrown if the input is not a valid ISBN number.\r\n * *\r\n * * @throws {@link book-lib#BookNotFoundError}\r\n * * Thrown if the ISBN number is valid, but no such book exists in the catalog.\r\n * *\r\n * * @public\r\n * */\r\n * function fetchBookByIsbn(isbnCode: string): Book;\r\n * ```\r\n */\r\n public static readonly throws: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@throws',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n allowMultiple: true,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Core)\r\n *\r\n * Used to document a generic parameter. The `@typeParam` tag is followed by a parameter\r\n * name, followed by a hyphen, followed by a description. The TSDoc parser recognizes\r\n * this syntax and will extract it into a DocParamBlock node.\r\n */\r\n public static readonly typeParam: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@typeParam',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n allowMultiple: true,\r\n standardization: Standardization.Core\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * This modifier has similar semantics to the `virtual` keyword in C# or Java.\r\n * For a member function or property, explicitly indicates that subclasses may override\r\n * (i.e. redefine) the member.\r\n *\r\n * @remarks\r\n * A documentation tool may enforce that the `@virtual`, `@override`, and/or `@sealed`\r\n * modifiers are consistently applied, but this is not required by the TSDoc standard.\r\n */\r\n public static readonly virtual: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@virtual',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * Used to specify the JSX factory function to use when compiling JSX syntax.\r\n *\r\n * @remarks\r\n * The TypeScript compiler recognizes this tag and specifies its behavior:\r\n *\r\n * @see {@link https://www.typescriptlang.org/tsconfig/#jsx}\r\n */\r\n public static readonly jsx: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@jsx',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * Used to specify the JSX runtime to use when compiling JSX syntax.\r\n *\r\n * @remarks\r\n * The TypeScript compiler recognizes this tag and specifies its behavior:\r\n *\r\n * @see {@link https://www.typescriptlang.org/tsconfig/#jsx}\r\n */\r\n public static readonly jsxRuntime: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@jsxRuntime',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * Used to specify the JSX fragment factory to use when compiling JSX syntax.\r\n *\r\n * @remarks\r\n * The TypeScript compiler recognizes this tag and specifies its behavior:\r\n *\r\n * @see {@link https://www.typescriptlang.org/tsconfig/#jsx}\r\n */\r\n public static readonly jsxFrag: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@jsxFrag',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * (Extended)\r\n *\r\n * Used to specify the JSX import source when compiling JSX syntax.\r\n *\r\n * @remarks\r\n * The TypeScript compiler recognizes this tag and specifies its behavior:\r\n *\r\n * @see {@link https://www.typescriptlang.org/tsconfig/#jsx}\r\n */\r\n public static readonly jsxImportSource: TSDocTagDefinition = StandardTags._defineTag({\r\n tagName: '@jsxImportSource',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag,\r\n standardization: Standardization.Extended\r\n });\r\n\r\n /**\r\n * Returns the full list of all core tags.\r\n */\r\n public static allDefinitions: ReadonlyArray<TSDocTagDefinition> = [\r\n StandardTags.alpha,\r\n StandardTags.beta,\r\n StandardTags.defaultValue,\r\n StandardTags.decorator,\r\n StandardTags.deprecated,\r\n StandardTags.eventProperty,\r\n StandardTags.example,\r\n StandardTags.experimental,\r\n StandardTags.inheritDoc,\r\n StandardTags.internal,\r\n StandardTags.label,\r\n StandardTags.link,\r\n StandardTags.override,\r\n StandardTags.packageDocumentation,\r\n StandardTags.param,\r\n StandardTags.privateRemarks,\r\n StandardTags.public,\r\n StandardTags.readonly,\r\n StandardTags.remarks,\r\n StandardTags.returns,\r\n StandardTags.sealed,\r\n StandardTags.see,\r\n StandardTags.throws,\r\n StandardTags.typeParam,\r\n StandardTags.virtual,\r\n StandardTags.jsx,\r\n StandardTags.jsxRuntime,\r\n StandardTags.jsxFrag,\r\n StandardTags.jsxImportSource\r\n ];\r\n\r\n private static _defineTag(parameters: ITSDocTagDefinitionInternalParameters): TSDocTagDefinition {\r\n return new TSDocTagDefinition(parameters);\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/details/Standardization.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.Standardization = void 0;
|
| 6 |
+
/**
|
| 7 |
+
* Used to group the {@link StandardTags} definitions according to the level of support
|
| 8 |
+
* expected from documentation tools that implement the standard.
|
| 9 |
+
*/
|
| 10 |
+
var Standardization;
|
| 11 |
+
(function (Standardization) {
|
| 12 |
+
/**
|
| 13 |
+
* TSDoc tags in the "Core" standardization group are considered essential.
|
| 14 |
+
* Their meaning is standardized, and every documentation tool is expected
|
| 15 |
+
* to recognize them. The TSDoc parser library typically provides dedicated APIs
|
| 16 |
+
* for accessing these tags.
|
| 17 |
+
*/
|
| 18 |
+
Standardization["Core"] = "Core";
|
| 19 |
+
/**
|
| 20 |
+
* TSDoc tags in the "Extended" standardization group are optional. Documentation tools
|
| 21 |
+
* may or may not support them. If they do, the syntax and semantics should conform to
|
| 22 |
+
* the TSDoc standard definitions.
|
| 23 |
+
*/
|
| 24 |
+
Standardization["Extended"] = "Extended";
|
| 25 |
+
/**
|
| 26 |
+
* TSDoc tags in the "Discretionary" standardization group are optional. Although the
|
| 27 |
+
* syntax is specified, the semantics for these tags are implementation-specific
|
| 28 |
+
* (and sometimes difficult to describe completely without referring to a specific
|
| 29 |
+
* implementation). Discretionary tags are included in the TSDoc standard to ensure that
|
| 30 |
+
* if two different popular tools use the same tag name, developers can expect the syntax
|
| 31 |
+
* to be the same, and the semantics to be somewhat similar.
|
| 32 |
+
*/
|
| 33 |
+
Standardization["Discretionary"] = "Discretionary";
|
| 34 |
+
/**
|
| 35 |
+
* The tag is not part of the TSDoc standard. All user-defined tags are assigned to this group.
|
| 36 |
+
*/
|
| 37 |
+
Standardization["None"] = "None";
|
| 38 |
+
})(Standardization || (exports.Standardization = Standardization = {}));
|
| 39 |
+
//# sourceMappingURL=Standardization.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/details/Standardization.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"Standardization.js","sourceRoot":"","sources":["../../src/details/Standardization.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;GAGG;AACH,IAAY,eA8BX;AA9BD,WAAY,eAAe;IACzB;;;;;OAKG;IACH,gCAAa,CAAA;IAEb;;;;OAIG;IACH,wCAAqB,CAAA;IAErB;;;;;;;OAOG;IACH,kDAA+B,CAAA;IAE/B;;OAEG;IACH,gCAAa,CAAA;AACf,CAAC,EA9BW,eAAe,+BAAf,eAAe,QA8B1B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\n/**\r\n * Used to group the {@link StandardTags} definitions according to the level of support\r\n * expected from documentation tools that implement the standard.\r\n */\r\nexport enum Standardization {\r\n /**\r\n * TSDoc tags in the \"Core\" standardization group are considered essential.\r\n * Their meaning is standardized, and every documentation tool is expected\r\n * to recognize them. The TSDoc parser library typically provides dedicated APIs\r\n * for accessing these tags.\r\n */\r\n Core = 'Core',\r\n\r\n /**\r\n * TSDoc tags in the \"Extended\" standardization group are optional. Documentation tools\r\n * may or may not support them. If they do, the syntax and semantics should conform to\r\n * the TSDoc standard definitions.\r\n */\r\n Extended = 'Extended',\r\n\r\n /**\r\n * TSDoc tags in the \"Discretionary\" standardization group are optional. Although the\r\n * syntax is specified, the semantics for these tags are implementation-specific\r\n * (and sometimes difficult to describe completely without referring to a specific\r\n * implementation). Discretionary tags are included in the TSDoc standard to ensure that\r\n * if two different popular tools use the same tag name, developers can expect the syntax\r\n * to be the same, and the semantics to be somewhat similar.\r\n */\r\n Discretionary = 'Discretionary',\r\n\r\n /**\r\n * The tag is not part of the TSDoc standard. All user-defined tags are assigned to this group.\r\n */\r\n None = 'None'\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/emitters/PlainTextEmitter.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.PlainTextEmitter = void 0;
|
| 6 |
+
const nodes_1 = require("../nodes");
|
| 7 |
+
/**
|
| 8 |
+
* Renders a DocNode tree as plain text, without any rich text formatting or markup.
|
| 9 |
+
*/
|
| 10 |
+
class PlainTextEmitter {
|
| 11 |
+
static hasAnyTextContent(nodeOrNodes, requiredCharacters) {
|
| 12 |
+
if (requiredCharacters === undefined || requiredCharacters < 1) {
|
| 13 |
+
requiredCharacters = 1; // default
|
| 14 |
+
}
|
| 15 |
+
let nodes;
|
| 16 |
+
if (nodeOrNodes instanceof nodes_1.DocNode) {
|
| 17 |
+
nodes = [nodeOrNodes];
|
| 18 |
+
}
|
| 19 |
+
else {
|
| 20 |
+
nodes = nodeOrNodes;
|
| 21 |
+
}
|
| 22 |
+
const foundCharacters = PlainTextEmitter._scanTextContent(nodes, requiredCharacters, 0);
|
| 23 |
+
return foundCharacters >= requiredCharacters;
|
| 24 |
+
}
|
| 25 |
+
static _scanTextContent(nodes, requiredCharacters, foundCharacters) {
|
| 26 |
+
for (const node of nodes) {
|
| 27 |
+
switch (node.kind) {
|
| 28 |
+
case nodes_1.DocNodeKind.FencedCode:
|
| 29 |
+
const docFencedCode = node;
|
| 30 |
+
foundCharacters += PlainTextEmitter._countNonSpaceCharacters(docFencedCode.code);
|
| 31 |
+
break;
|
| 32 |
+
case nodes_1.DocNodeKind.CodeSpan:
|
| 33 |
+
const docCodeSpan = node;
|
| 34 |
+
foundCharacters += PlainTextEmitter._countNonSpaceCharacters(docCodeSpan.code);
|
| 35 |
+
break;
|
| 36 |
+
case nodes_1.DocNodeKind.EscapedText:
|
| 37 |
+
const docEscapedText = node;
|
| 38 |
+
foundCharacters += PlainTextEmitter._countNonSpaceCharacters(docEscapedText.decodedText);
|
| 39 |
+
break;
|
| 40 |
+
case nodes_1.DocNodeKind.LinkTag:
|
| 41 |
+
const docLinkTag = node;
|
| 42 |
+
foundCharacters += PlainTextEmitter._countNonSpaceCharacters(docLinkTag.linkText || '');
|
| 43 |
+
break;
|
| 44 |
+
case nodes_1.DocNodeKind.PlainText:
|
| 45 |
+
const docPlainText = node;
|
| 46 |
+
foundCharacters += PlainTextEmitter._countNonSpaceCharacters(docPlainText.text);
|
| 47 |
+
break;
|
| 48 |
+
}
|
| 49 |
+
if (foundCharacters >= requiredCharacters) {
|
| 50 |
+
break;
|
| 51 |
+
}
|
| 52 |
+
foundCharacters += PlainTextEmitter._scanTextContent(node.getChildNodes(), requiredCharacters, foundCharacters);
|
| 53 |
+
if (foundCharacters >= requiredCharacters) {
|
| 54 |
+
break;
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
return foundCharacters;
|
| 58 |
+
}
|
| 59 |
+
static _countNonSpaceCharacters(s) {
|
| 60 |
+
let count = 0;
|
| 61 |
+
const length = s.length;
|
| 62 |
+
let i = 0;
|
| 63 |
+
while (i < length) {
|
| 64 |
+
switch (s.charCodeAt(i)) {
|
| 65 |
+
case 32: // space
|
| 66 |
+
case 9: // tab
|
| 67 |
+
case 13: // CR
|
| 68 |
+
case 10: // LF
|
| 69 |
+
break;
|
| 70 |
+
default:
|
| 71 |
+
++count;
|
| 72 |
+
}
|
| 73 |
+
++i;
|
| 74 |
+
}
|
| 75 |
+
return count;
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
exports.PlainTextEmitter = PlainTextEmitter;
|
| 79 |
+
//# sourceMappingURL=PlainTextEmitter.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/emitters/PlainTextEmitter.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"PlainTextEmitter.js","sourceRoot":"","sources":["../../src/emitters/PlainTextEmitter.ts"],"names":[],"mappings":";AAAA,4FAA4F;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Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport {\r\n DocNode,\r\n DocNodeKind,\r\n type DocPlainText,\r\n type DocFencedCode,\r\n type DocCodeSpan,\r\n type DocLinkTag,\r\n type DocEscapedText\r\n} from '../nodes';\r\n\r\n/**\r\n * Renders a DocNode tree as plain text, without any rich text formatting or markup.\r\n */\r\nexport class PlainTextEmitter {\r\n /**\r\n * Returns true if the specified node contains any text content.\r\n *\r\n * @remarks\r\n * A documentation tool can use this test to report warnings when a developer neglected to write a code comment\r\n * for a declaration.\r\n *\r\n * @param node - this node and all its children will be considered\r\n * @param requiredCharacters - The test returns true if at least this many non-spacing characters are found.\r\n * The default value is 1.\r\n */\r\n public static hasAnyTextContent(node: DocNode, requiredCharacters?: number): boolean;\r\n\r\n /**\r\n * Returns true if the specified collection of nodes contains any text content.\r\n *\r\n * @remarks\r\n * A documentation tool can use this test to report warnings when a developer neglected to write a code comment\r\n * for a declaration.\r\n *\r\n * @param nodes - the collection of nodes to be tested\r\n * @param requiredCharacters - The test returns true if at least this many non-spacing characters are found.\r\n * The default value is 1.\r\n */\r\n public static hasAnyTextContent(nodes: ReadonlyArray<DocNode>, requiredCharacters?: number): boolean;\r\n public static hasAnyTextContent(\r\n nodeOrNodes: DocNode | ReadonlyArray<DocNode>,\r\n requiredCharacters?: number\r\n ): boolean {\r\n if (requiredCharacters === undefined || requiredCharacters < 1) {\r\n requiredCharacters = 1; // default\r\n }\r\n\r\n let nodes: ReadonlyArray<DocNode>;\r\n if (nodeOrNodes instanceof DocNode) {\r\n nodes = [nodeOrNodes];\r\n } else {\r\n nodes = nodeOrNodes;\r\n }\r\n\r\n const foundCharacters: number = PlainTextEmitter._scanTextContent(nodes, requiredCharacters, 0);\r\n\r\n return foundCharacters >= requiredCharacters;\r\n }\r\n\r\n private static _scanTextContent(\r\n nodes: ReadonlyArray<DocNode>,\r\n requiredCharacters: number,\r\n foundCharacters: number\r\n ): number {\r\n for (const node of nodes) {\r\n switch (node.kind) {\r\n case DocNodeKind.FencedCode:\r\n const docFencedCode: DocFencedCode = node as DocFencedCode;\r\n foundCharacters += PlainTextEmitter._countNonSpaceCharacters(docFencedCode.code);\r\n break;\r\n\r\n case DocNodeKind.CodeSpan:\r\n const docCodeSpan: DocCodeSpan = node as DocCodeSpan;\r\n foundCharacters += PlainTextEmitter._countNonSpaceCharacters(docCodeSpan.code);\r\n break;\r\n case DocNodeKind.EscapedText:\r\n const docEscapedText: DocEscapedText = node as DocEscapedText;\r\n foundCharacters += PlainTextEmitter._countNonSpaceCharacters(docEscapedText.decodedText);\r\n break;\r\n\r\n case DocNodeKind.LinkTag:\r\n const docLinkTag: DocLinkTag = node as DocLinkTag;\r\n foundCharacters += PlainTextEmitter._countNonSpaceCharacters(docLinkTag.linkText || '');\r\n break;\r\n\r\n case DocNodeKind.PlainText:\r\n const docPlainText: DocPlainText = node as DocPlainText;\r\n foundCharacters += PlainTextEmitter._countNonSpaceCharacters(docPlainText.text);\r\n break;\r\n }\r\n\r\n if (foundCharacters >= requiredCharacters) {\r\n break;\r\n }\r\n\r\n foundCharacters += PlainTextEmitter._scanTextContent(\r\n node.getChildNodes(),\r\n requiredCharacters,\r\n foundCharacters\r\n );\r\n\r\n if (foundCharacters >= requiredCharacters) {\r\n break;\r\n }\r\n }\r\n\r\n return foundCharacters;\r\n }\r\n\r\n private static _countNonSpaceCharacters(s: string): number {\r\n let count: number = 0;\r\n const length: number = s.length;\r\n let i: number = 0;\r\n while (i < length) {\r\n switch (s.charCodeAt(i)) {\r\n case 32: // space\r\n case 9: // tab\r\n case 13: // CR\r\n case 10: // LF\r\n break;\r\n default:\r\n ++count;\r\n }\r\n ++i;\r\n }\r\n return count;\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/emitters/StringBuilder.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.StringBuilder = void 0;
|
| 6 |
+
/**
|
| 7 |
+
* This class allows a large text string to be constructed incrementally by appending small chunks. The final
|
| 8 |
+
* string can be obtained by calling StringBuilder.toString().
|
| 9 |
+
*
|
| 10 |
+
* @remarks
|
| 11 |
+
* A naive approach might use the `+=` operator to append strings: This would have the downside of copying
|
| 12 |
+
* the entire string each time a chunk is appended, resulting in `O(n^2)` bytes of memory being allocated
|
| 13 |
+
* (and later freed by the garbage collector), and many of the allocations could be very large objects.
|
| 14 |
+
* StringBuilder avoids this overhead by accumulating the chunks in an array, and efficiently joining them
|
| 15 |
+
* when `getText()` is finally called.
|
| 16 |
+
*/
|
| 17 |
+
class StringBuilder {
|
| 18 |
+
constructor() {
|
| 19 |
+
this._chunks = [];
|
| 20 |
+
}
|
| 21 |
+
/** {@inheritdoc IStringBuilder.append} */
|
| 22 |
+
append(text) {
|
| 23 |
+
this._chunks.push(text);
|
| 24 |
+
}
|
| 25 |
+
/** {@inheritdoc IStringBuilder.toString} */
|
| 26 |
+
toString() {
|
| 27 |
+
if (this._chunks.length === 0) {
|
| 28 |
+
return '';
|
| 29 |
+
}
|
| 30 |
+
if (this._chunks.length > 1) {
|
| 31 |
+
const joined = this._chunks.join('');
|
| 32 |
+
this._chunks.length = 1;
|
| 33 |
+
this._chunks[0] = joined;
|
| 34 |
+
}
|
| 35 |
+
return this._chunks[0];
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
exports.StringBuilder = StringBuilder;
|
| 39 |
+
//# sourceMappingURL=StringBuilder.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/emitters/StringBuilder.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"StringBuilder.js","sourceRoot":"","sources":["../../src/emitters/StringBuilder.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AA0B3D;;;;;;;;;;GAUG;AACH,MAAa,aAAa;IAGxB;QACE,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,0CAA0C;IACnC,MAAM,CAAC,IAAY;QACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,4CAA4C;IACrC,QAAQ;QACb,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,MAAM,GAAW,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC7C,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;YACxB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;QAC3B,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;CACF;AA1BD,sCA0BC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\n/**\r\n * An interface for a builder object that allows a large text string to be constructed incrementally by appending\r\n * small chunks.\r\n *\r\n * @remarks\r\n *\r\n * {@link StringBuilder} is the default implementation of this contract.\r\n */\r\nexport interface IStringBuilder {\r\n /**\r\n * Append the specified text to the buffer.\r\n */\r\n append(text: string): void;\r\n\r\n /**\r\n * Returns a single string containing all the text that was appended to the buffer so far.\r\n *\r\n * @remarks\r\n *\r\n * This is a potentially expensive operation.\r\n */\r\n toString(): string;\r\n}\r\n\r\n/**\r\n * This class allows a large text string to be constructed incrementally by appending small chunks. The final\r\n * string can be obtained by calling StringBuilder.toString().\r\n *\r\n * @remarks\r\n * A naive approach might use the `+=` operator to append strings: This would have the downside of copying\r\n * the entire string each time a chunk is appended, resulting in `O(n^2)` bytes of memory being allocated\r\n * (and later freed by the garbage collector), and many of the allocations could be very large objects.\r\n * StringBuilder avoids this overhead by accumulating the chunks in an array, and efficiently joining them\r\n * when `getText()` is finally called.\r\n */\r\nexport class StringBuilder implements IStringBuilder {\r\n private _chunks: string[];\r\n\r\n public constructor() {\r\n this._chunks = [];\r\n }\r\n\r\n /** {@inheritdoc IStringBuilder.append} */\r\n public append(text: string): void {\r\n this._chunks.push(text);\r\n }\r\n\r\n /** {@inheritdoc IStringBuilder.toString} */\r\n public toString(): string {\r\n if (this._chunks.length === 0) {\r\n return '';\r\n }\r\n\r\n if (this._chunks.length > 1) {\r\n const joined: string = this._chunks.join('');\r\n this._chunks.length = 1;\r\n this._chunks[0] = joined;\r\n }\r\n\r\n return this._chunks[0];\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/emitters/TSDocEmitter.js
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.TSDocEmitter = void 0;
|
| 6 |
+
const DocNode_1 = require("../nodes/DocNode");
|
| 7 |
+
const DocNodeTransforms_1 = require("../transforms/DocNodeTransforms");
|
| 8 |
+
const StandardTags_1 = require("../details/StandardTags");
|
| 9 |
+
var LineState;
|
| 10 |
+
(function (LineState) {
|
| 11 |
+
LineState[LineState["Closed"] = 0] = "Closed";
|
| 12 |
+
LineState[LineState["StartOfLine"] = 1] = "StartOfLine";
|
| 13 |
+
LineState[LineState["MiddleOfLine"] = 2] = "MiddleOfLine";
|
| 14 |
+
})(LineState || (LineState = {}));
|
| 15 |
+
/**
|
| 16 |
+
* Renders a DocNode tree as a code comment.
|
| 17 |
+
*/
|
| 18 |
+
class TSDocEmitter {
|
| 19 |
+
constructor() {
|
| 20 |
+
this.eol = '\n';
|
| 21 |
+
// Whether to emit the /** */ framing
|
| 22 |
+
this._emitCommentFraming = true;
|
| 23 |
+
// This state machine is used by the writer functions to generate the /** */ framing around the emitted lines
|
| 24 |
+
this._lineState = LineState.Closed;
|
| 25 |
+
// State for _ensureLineSkipped()
|
| 26 |
+
this._previousLineHadContent = false;
|
| 27 |
+
// Normally a paragraph is precede by a blank line (unless it's the first thing written).
|
| 28 |
+
// But sometimes we want the paragraph to be attached to the previous element, e.g. when it's part of
|
| 29 |
+
// an "@param" block. Setting _hangingParagraph=true accomplishes that.
|
| 30 |
+
this._hangingParagraph = false;
|
| 31 |
+
}
|
| 32 |
+
renderComment(output, docComment) {
|
| 33 |
+
this._emitCommentFraming = true;
|
| 34 |
+
this._renderCompleteObject(output, docComment);
|
| 35 |
+
}
|
| 36 |
+
renderHtmlTag(output, htmlTag) {
|
| 37 |
+
this._emitCommentFraming = false;
|
| 38 |
+
this._renderCompleteObject(output, htmlTag);
|
| 39 |
+
}
|
| 40 |
+
renderDeclarationReference(output, declarationReference) {
|
| 41 |
+
this._emitCommentFraming = false;
|
| 42 |
+
this._renderCompleteObject(output, declarationReference);
|
| 43 |
+
}
|
| 44 |
+
_renderCompleteObject(output, docNode) {
|
| 45 |
+
this._output = output;
|
| 46 |
+
this._lineState = LineState.Closed;
|
| 47 |
+
this._previousLineHadContent = false;
|
| 48 |
+
this._hangingParagraph = false;
|
| 49 |
+
this._renderNode(docNode);
|
| 50 |
+
this._writeEnd();
|
| 51 |
+
}
|
| 52 |
+
_renderNode(docNode) {
|
| 53 |
+
if (docNode === undefined) {
|
| 54 |
+
return;
|
| 55 |
+
}
|
| 56 |
+
switch (docNode.kind) {
|
| 57 |
+
case DocNode_1.DocNodeKind.Block:
|
| 58 |
+
const docBlock = docNode;
|
| 59 |
+
this._ensureLineSkipped();
|
| 60 |
+
this._renderNode(docBlock.blockTag);
|
| 61 |
+
if (docBlock.blockTag.tagNameWithUpperCase === StandardTags_1.StandardTags.returns.tagNameWithUpperCase ||
|
| 62 |
+
docBlock.blockTag.tagNameWithUpperCase === StandardTags_1.StandardTags.defaultValue.tagNameWithUpperCase) {
|
| 63 |
+
this._writeContent(' ');
|
| 64 |
+
this._hangingParagraph = true;
|
| 65 |
+
}
|
| 66 |
+
this._renderNode(docBlock.content);
|
| 67 |
+
break;
|
| 68 |
+
case DocNode_1.DocNodeKind.BlockTag:
|
| 69 |
+
const docBlockTag = docNode;
|
| 70 |
+
if (this._lineState === LineState.MiddleOfLine) {
|
| 71 |
+
this._writeContent(' ');
|
| 72 |
+
}
|
| 73 |
+
this._writeContent(docBlockTag.tagName);
|
| 74 |
+
break;
|
| 75 |
+
case DocNode_1.DocNodeKind.CodeSpan:
|
| 76 |
+
const docCodeSpan = docNode;
|
| 77 |
+
this._writeContent('`');
|
| 78 |
+
this._writeContent(docCodeSpan.code);
|
| 79 |
+
this._writeContent('`');
|
| 80 |
+
break;
|
| 81 |
+
case DocNode_1.DocNodeKind.Comment:
|
| 82 |
+
const docComment = docNode;
|
| 83 |
+
this._renderNodes([
|
| 84 |
+
docComment.summarySection,
|
| 85 |
+
docComment.remarksBlock,
|
| 86 |
+
docComment.privateRemarks,
|
| 87 |
+
docComment.deprecatedBlock,
|
| 88 |
+
docComment.params,
|
| 89 |
+
docComment.typeParams,
|
| 90 |
+
docComment.returnsBlock,
|
| 91 |
+
...docComment.customBlocks,
|
| 92 |
+
...docComment.seeBlocks,
|
| 93 |
+
docComment.inheritDocTag
|
| 94 |
+
]);
|
| 95 |
+
if (docComment.modifierTagSet.nodes.length > 0) {
|
| 96 |
+
this._ensureLineSkipped();
|
| 97 |
+
this._renderNodes(docComment.modifierTagSet.nodes);
|
| 98 |
+
}
|
| 99 |
+
break;
|
| 100 |
+
case DocNode_1.DocNodeKind.DeclarationReference:
|
| 101 |
+
const docDeclarationReference = docNode;
|
| 102 |
+
this._writeContent(docDeclarationReference.packageName);
|
| 103 |
+
this._writeContent(docDeclarationReference.importPath);
|
| 104 |
+
if (docDeclarationReference.packageName !== undefined ||
|
| 105 |
+
docDeclarationReference.importPath !== undefined) {
|
| 106 |
+
this._writeContent('#');
|
| 107 |
+
}
|
| 108 |
+
this._renderNodes(docDeclarationReference.memberReferences);
|
| 109 |
+
break;
|
| 110 |
+
case DocNode_1.DocNodeKind.ErrorText:
|
| 111 |
+
const docErrorText = docNode;
|
| 112 |
+
this._writeContent(docErrorText.text);
|
| 113 |
+
break;
|
| 114 |
+
case DocNode_1.DocNodeKind.EscapedText:
|
| 115 |
+
const docEscapedText = docNode;
|
| 116 |
+
this._writeContent(docEscapedText.encodedText);
|
| 117 |
+
break;
|
| 118 |
+
case DocNode_1.DocNodeKind.FencedCode:
|
| 119 |
+
const docFencedCode = docNode;
|
| 120 |
+
this._ensureAtStartOfLine();
|
| 121 |
+
this._writeContent('```');
|
| 122 |
+
this._writeContent(docFencedCode.language);
|
| 123 |
+
this._writeNewline();
|
| 124 |
+
this._writeContent(docFencedCode.code);
|
| 125 |
+
this._writeContent('```');
|
| 126 |
+
this._writeNewline();
|
| 127 |
+
this._writeNewline();
|
| 128 |
+
break;
|
| 129 |
+
case DocNode_1.DocNodeKind.HtmlAttribute:
|
| 130 |
+
const docHtmlAttribute = docNode;
|
| 131 |
+
this._writeContent(docHtmlAttribute.name);
|
| 132 |
+
this._writeContent(docHtmlAttribute.spacingAfterName);
|
| 133 |
+
this._writeContent('=');
|
| 134 |
+
this._writeContent(docHtmlAttribute.spacingAfterEquals);
|
| 135 |
+
this._writeContent(docHtmlAttribute.value);
|
| 136 |
+
this._writeContent(docHtmlAttribute.spacingAfterValue);
|
| 137 |
+
break;
|
| 138 |
+
case DocNode_1.DocNodeKind.HtmlEndTag:
|
| 139 |
+
const docHtmlEndTag = docNode;
|
| 140 |
+
this._writeContent('</');
|
| 141 |
+
this._writeContent(docHtmlEndTag.name);
|
| 142 |
+
this._writeContent('>');
|
| 143 |
+
break;
|
| 144 |
+
case DocNode_1.DocNodeKind.HtmlStartTag:
|
| 145 |
+
const docHtmlStartTag = docNode;
|
| 146 |
+
this._writeContent('<');
|
| 147 |
+
this._writeContent(docHtmlStartTag.name);
|
| 148 |
+
this._writeContent(docHtmlStartTag.spacingAfterName);
|
| 149 |
+
let needsSpace = docHtmlStartTag.spacingAfterName === undefined || docHtmlStartTag.spacingAfterName.length === 0;
|
| 150 |
+
for (const attribute of docHtmlStartTag.htmlAttributes) {
|
| 151 |
+
if (needsSpace) {
|
| 152 |
+
this._writeContent(' ');
|
| 153 |
+
}
|
| 154 |
+
this._renderNode(attribute);
|
| 155 |
+
needsSpace = attribute.spacingAfterValue === undefined || attribute.spacingAfterValue.length === 0;
|
| 156 |
+
}
|
| 157 |
+
this._writeContent(docHtmlStartTag.selfClosingTag ? '/>' : '>');
|
| 158 |
+
break;
|
| 159 |
+
case DocNode_1.DocNodeKind.InheritDocTag:
|
| 160 |
+
const docInheritDocTag = docNode;
|
| 161 |
+
this._renderInlineTag(docInheritDocTag, () => {
|
| 162 |
+
if (docInheritDocTag.declarationReference) {
|
| 163 |
+
this._writeContent(' ');
|
| 164 |
+
this._renderNode(docInheritDocTag.declarationReference);
|
| 165 |
+
}
|
| 166 |
+
});
|
| 167 |
+
break;
|
| 168 |
+
case DocNode_1.DocNodeKind.InlineTag:
|
| 169 |
+
const docInlineTag = docNode;
|
| 170 |
+
this._renderInlineTag(docInlineTag, () => {
|
| 171 |
+
if (docInlineTag.tagContent.length > 0) {
|
| 172 |
+
this._writeContent(' ');
|
| 173 |
+
this._writeContent(docInlineTag.tagContent);
|
| 174 |
+
}
|
| 175 |
+
});
|
| 176 |
+
break;
|
| 177 |
+
case DocNode_1.DocNodeKind.LinkTag:
|
| 178 |
+
const docLinkTag = docNode;
|
| 179 |
+
this._renderInlineTag(docLinkTag, () => {
|
| 180 |
+
if (docLinkTag.urlDestination !== undefined || docLinkTag.codeDestination !== undefined) {
|
| 181 |
+
if (docLinkTag.urlDestination !== undefined) {
|
| 182 |
+
this._writeContent(' ');
|
| 183 |
+
this._writeContent(docLinkTag.urlDestination);
|
| 184 |
+
}
|
| 185 |
+
else if (docLinkTag.codeDestination !== undefined) {
|
| 186 |
+
this._writeContent(' ');
|
| 187 |
+
this._renderNode(docLinkTag.codeDestination);
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
if (docLinkTag.linkText !== undefined) {
|
| 191 |
+
this._writeContent(' ');
|
| 192 |
+
this._writeContent('|');
|
| 193 |
+
this._writeContent(' ');
|
| 194 |
+
this._writeContent(docLinkTag.linkText);
|
| 195 |
+
}
|
| 196 |
+
});
|
| 197 |
+
break;
|
| 198 |
+
case DocNode_1.DocNodeKind.MemberIdentifier:
|
| 199 |
+
const docMemberIdentifier = docNode;
|
| 200 |
+
if (docMemberIdentifier.hasQuotes) {
|
| 201 |
+
this._writeContent('"');
|
| 202 |
+
this._writeContent(docMemberIdentifier.identifier); // todo: encoding
|
| 203 |
+
this._writeContent('"');
|
| 204 |
+
}
|
| 205 |
+
else {
|
| 206 |
+
this._writeContent(docMemberIdentifier.identifier);
|
| 207 |
+
}
|
| 208 |
+
break;
|
| 209 |
+
case DocNode_1.DocNodeKind.MemberReference:
|
| 210 |
+
const docMemberReference = docNode;
|
| 211 |
+
if (docMemberReference.hasDot) {
|
| 212 |
+
this._writeContent('.');
|
| 213 |
+
}
|
| 214 |
+
if (docMemberReference.selector) {
|
| 215 |
+
this._writeContent('(');
|
| 216 |
+
}
|
| 217 |
+
if (docMemberReference.memberSymbol) {
|
| 218 |
+
this._renderNode(docMemberReference.memberSymbol);
|
| 219 |
+
}
|
| 220 |
+
else {
|
| 221 |
+
this._renderNode(docMemberReference.memberIdentifier);
|
| 222 |
+
}
|
| 223 |
+
if (docMemberReference.selector) {
|
| 224 |
+
this._writeContent(':');
|
| 225 |
+
this._renderNode(docMemberReference.selector);
|
| 226 |
+
this._writeContent(')');
|
| 227 |
+
}
|
| 228 |
+
break;
|
| 229 |
+
case DocNode_1.DocNodeKind.MemberSelector:
|
| 230 |
+
const docMemberSelector = docNode;
|
| 231 |
+
this._writeContent(docMemberSelector.selector);
|
| 232 |
+
break;
|
| 233 |
+
case DocNode_1.DocNodeKind.MemberSymbol:
|
| 234 |
+
const docMemberSymbol = docNode;
|
| 235 |
+
this._writeContent('[');
|
| 236 |
+
this._renderNode(docMemberSymbol.symbolReference);
|
| 237 |
+
this._writeContent(']');
|
| 238 |
+
break;
|
| 239 |
+
case DocNode_1.DocNodeKind.Section:
|
| 240 |
+
const docSection = docNode;
|
| 241 |
+
this._renderNodes(docSection.nodes);
|
| 242 |
+
break;
|
| 243 |
+
case DocNode_1.DocNodeKind.Paragraph:
|
| 244 |
+
const trimmedParagraph = DocNodeTransforms_1.DocNodeTransforms.trimSpacesInParagraph(docNode);
|
| 245 |
+
if (trimmedParagraph.nodes.length > 0) {
|
| 246 |
+
if (this._hangingParagraph) {
|
| 247 |
+
// If it's a hanging paragraph, then don't skip a line
|
| 248 |
+
this._hangingParagraph = false;
|
| 249 |
+
}
|
| 250 |
+
else {
|
| 251 |
+
this._ensureLineSkipped();
|
| 252 |
+
}
|
| 253 |
+
this._renderNodes(trimmedParagraph.nodes);
|
| 254 |
+
this._writeNewline();
|
| 255 |
+
}
|
| 256 |
+
break;
|
| 257 |
+
case DocNode_1.DocNodeKind.ParamBlock:
|
| 258 |
+
const docParamBlock = docNode;
|
| 259 |
+
this._ensureLineSkipped();
|
| 260 |
+
this._renderNode(docParamBlock.blockTag);
|
| 261 |
+
this._writeContent(' ');
|
| 262 |
+
this._writeContent(docParamBlock.parameterName);
|
| 263 |
+
this._writeContent(' - ');
|
| 264 |
+
this._hangingParagraph = true;
|
| 265 |
+
this._renderNode(docParamBlock.content);
|
| 266 |
+
this._hangingParagraph = false;
|
| 267 |
+
break;
|
| 268 |
+
case DocNode_1.DocNodeKind.ParamCollection:
|
| 269 |
+
const docParamCollection = docNode;
|
| 270 |
+
this._renderNodes(docParamCollection.blocks);
|
| 271 |
+
break;
|
| 272 |
+
case DocNode_1.DocNodeKind.PlainText:
|
| 273 |
+
const docPlainText = docNode;
|
| 274 |
+
this._writeContent(docPlainText.text);
|
| 275 |
+
break;
|
| 276 |
+
}
|
| 277 |
+
}
|
| 278 |
+
_renderInlineTag(docInlineTagBase, writeInlineTagContent) {
|
| 279 |
+
this._writeContent('{');
|
| 280 |
+
this._writeContent(docInlineTagBase.tagName);
|
| 281 |
+
writeInlineTagContent();
|
| 282 |
+
this._writeContent('}');
|
| 283 |
+
}
|
| 284 |
+
_renderNodes(docNodes) {
|
| 285 |
+
for (const docNode of docNodes) {
|
| 286 |
+
this._renderNode(docNode);
|
| 287 |
+
}
|
| 288 |
+
}
|
| 289 |
+
// Calls _writeNewline() only if we're not already at the start of a new line
|
| 290 |
+
_ensureAtStartOfLine() {
|
| 291 |
+
if (this._lineState === LineState.MiddleOfLine) {
|
| 292 |
+
this._writeNewline();
|
| 293 |
+
}
|
| 294 |
+
}
|
| 295 |
+
// Calls _writeNewline() if needed to ensure that we have skipped at least one line
|
| 296 |
+
_ensureLineSkipped() {
|
| 297 |
+
this._ensureAtStartOfLine();
|
| 298 |
+
if (this._previousLineHadContent) {
|
| 299 |
+
this._writeNewline();
|
| 300 |
+
}
|
| 301 |
+
}
|
| 302 |
+
// Writes literal text content. If it contains newlines, they will automatically be converted to
|
| 303 |
+
// _writeNewline() calls, to ensure that "*" is written at the start of each line.
|
| 304 |
+
_writeContent(content) {
|
| 305 |
+
if (content === undefined || content.length === 0) {
|
| 306 |
+
return;
|
| 307 |
+
}
|
| 308 |
+
const splitLines = content.split(/\r?\n/g);
|
| 309 |
+
if (splitLines.length > 1) {
|
| 310 |
+
let firstLine = true;
|
| 311 |
+
for (const line of splitLines) {
|
| 312 |
+
if (firstLine) {
|
| 313 |
+
firstLine = false;
|
| 314 |
+
}
|
| 315 |
+
else {
|
| 316 |
+
this._writeNewline();
|
| 317 |
+
}
|
| 318 |
+
this._writeContent(line);
|
| 319 |
+
}
|
| 320 |
+
return;
|
| 321 |
+
}
|
| 322 |
+
if (this._lineState === LineState.Closed) {
|
| 323 |
+
if (this._emitCommentFraming) {
|
| 324 |
+
this._output.append('/**' + this.eol + ' *');
|
| 325 |
+
}
|
| 326 |
+
this._lineState = LineState.StartOfLine;
|
| 327 |
+
}
|
| 328 |
+
if (this._lineState === LineState.StartOfLine) {
|
| 329 |
+
if (this._emitCommentFraming) {
|
| 330 |
+
this._output.append(' ');
|
| 331 |
+
}
|
| 332 |
+
}
|
| 333 |
+
this._output.append(content);
|
| 334 |
+
this._lineState = LineState.MiddleOfLine;
|
| 335 |
+
this._previousLineHadContent = true;
|
| 336 |
+
}
|
| 337 |
+
// Starts a new line, and inserts "/**" or "*" as appropriate.
|
| 338 |
+
_writeNewline() {
|
| 339 |
+
if (this._lineState === LineState.Closed) {
|
| 340 |
+
if (this._emitCommentFraming) {
|
| 341 |
+
this._output.append('/**' + this.eol + ' *');
|
| 342 |
+
}
|
| 343 |
+
this._lineState = LineState.StartOfLine;
|
| 344 |
+
}
|
| 345 |
+
this._previousLineHadContent = this._lineState === LineState.MiddleOfLine;
|
| 346 |
+
if (this._emitCommentFraming) {
|
| 347 |
+
this._output.append(this.eol + ' *');
|
| 348 |
+
}
|
| 349 |
+
else {
|
| 350 |
+
this._output.append(this.eol);
|
| 351 |
+
}
|
| 352 |
+
this._lineState = LineState.StartOfLine;
|
| 353 |
+
this._hangingParagraph = false;
|
| 354 |
+
}
|
| 355 |
+
// Closes the comment, adding the final "*/" delimiter
|
| 356 |
+
_writeEnd() {
|
| 357 |
+
if (this._lineState === LineState.MiddleOfLine) {
|
| 358 |
+
if (this._emitCommentFraming) {
|
| 359 |
+
this._writeNewline();
|
| 360 |
+
}
|
| 361 |
+
}
|
| 362 |
+
if (this._lineState !== LineState.Closed) {
|
| 363 |
+
if (this._emitCommentFraming) {
|
| 364 |
+
this._output.append('/' + this.eol);
|
| 365 |
+
}
|
| 366 |
+
this._lineState = LineState.Closed;
|
| 367 |
+
}
|
| 368 |
+
}
|
| 369 |
+
}
|
| 370 |
+
exports.TSDocEmitter = TSDocEmitter;
|
| 371 |
+
//# sourceMappingURL=TSDocEmitter.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/emitters/TSDocEmitter.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"TSDocEmitter.js","sourceRoot":"","sources":["../../src/emitters/TSDocEmitter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AA4B3D,8CAA+C;AAE/C,uEAAoE;AACpE,0DAAuD;AAGvD,IAAK,SAIJ;AAJD,WAAK,SAAS;IACZ,6CAAM,CAAA;IACN,uDAAW,CAAA;IACX,yDAAY,CAAA;AACd,CAAC,EAJI,SAAS,KAAT,SAAS,QAIb;AAED;;GAEG;AACH,MAAa,YAAY;IAAzB;QACkB,QAAG,GAAW,IAAI,CAAC;QAEnC,qCAAqC;QAC7B,wBAAmB,GAAY,IAAI,CAAC;QAI5C,6GAA6G;QACrG,eAAU,GAAc,SAAS,CAAC,MAAM,CAAC;QAEjD,iCAAiC;QACzB,4BAAuB,GAAY,KAAK,CAAC;QAEjD,yFAAyF;QACzF,qGAAqG;QACrG,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,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,YAAY,CAAC;QAE1E,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,WAAW,CAAC;QACxC,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;IACjC,CAAC;IAED,sDAAsD;IAC9C,SAAS;QACf,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,YAAY,EAAE,CAAC;YAC/C,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBAC7B,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,CAAC;QACH,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,MAAM,EAAE,CAAC;YACzC,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBAC7B,IAAI,CAAC,OAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YACvC,CAAC;YACD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC;QACrC,CAAC;IACH,CAAC;CACF;AA/ZD,oCA+ZC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport type {\r\n DocNode,\r\n DocComment,\r\n DocPlainText,\r\n DocSection,\r\n DocBlock,\r\n DocParagraph,\r\n DocBlockTag,\r\n DocCodeSpan,\r\n DocFencedCode,\r\n DocDeclarationReference,\r\n DocErrorText,\r\n DocEscapedText,\r\n DocHtmlEndTag,\r\n DocHtmlStartTag,\r\n DocHtmlAttribute,\r\n DocInheritDocTag,\r\n DocInlineTagBase,\r\n DocInlineTag,\r\n DocLinkTag,\r\n DocMemberIdentifier,\r\n DocMemberReference,\r\n DocMemberSymbol,\r\n DocMemberSelector,\r\n DocParamBlock\r\n} from '../nodes';\r\nimport { DocNodeKind } from '../nodes/DocNode';\r\nimport type { IStringBuilder } from './StringBuilder';\r\nimport { DocNodeTransforms } from '../transforms/DocNodeTransforms';\r\nimport { StandardTags } from '../details/StandardTags';\r\nimport type { DocParamCollection } from '../nodes/DocParamCollection';\r\n\r\nenum LineState {\r\n Closed,\r\n StartOfLine,\r\n MiddleOfLine\r\n}\r\n\r\n/**\r\n * Renders a DocNode tree as a code comment.\r\n */\r\nexport class TSDocEmitter {\r\n public readonly eol: string = '\\n';\r\n\r\n // Whether to emit the /** */ framing\r\n private _emitCommentFraming: boolean = true;\r\n\r\n private _output: IStringBuilder | undefined;\r\n\r\n // This state machine is used by the writer functions to generate the /** */ framing around the emitted lines\r\n private _lineState: LineState = LineState.Closed;\r\n\r\n // State for _ensureLineSkipped()\r\n private _previousLineHadContent: boolean = false;\r\n\r\n // Normally a paragraph is precede by a blank line (unless it's the first thing written).\r\n // But sometimes we want the paragraph to be attached to the previous element, e.g. when it's part of\r\n // an \"@param\" block. Setting _hangingParagraph=true accomplishes that.\r\n private _hangingParagraph: boolean = false;\r\n\r\n public renderComment(output: IStringBuilder, docComment: DocComment): void {\r\n this._emitCommentFraming = true;\r\n this._renderCompleteObject(output, docComment);\r\n }\r\n\r\n public renderHtmlTag(output: IStringBuilder, htmlTag: DocHtmlStartTag | DocHtmlEndTag): void {\r\n this._emitCommentFraming = false;\r\n this._renderCompleteObject(output, htmlTag);\r\n }\r\n\r\n public renderDeclarationReference(\r\n output: IStringBuilder,\r\n declarationReference: DocDeclarationReference\r\n ): void {\r\n this._emitCommentFraming = false;\r\n this._renderCompleteObject(output, declarationReference);\r\n }\r\n\r\n private _renderCompleteObject(output: IStringBuilder, docNode: DocNode): void {\r\n this._output = output;\r\n\r\n this._lineState = LineState.Closed;\r\n this._previousLineHadContent = false;\r\n this._hangingParagraph = false;\r\n\r\n this._renderNode(docNode);\r\n\r\n this._writeEnd();\r\n }\r\n\r\n private _renderNode(docNode: DocNode | undefined): void {\r\n if (docNode === undefined) {\r\n return;\r\n }\r\n\r\n switch (docNode.kind) {\r\n case DocNodeKind.Block:\r\n const docBlock: DocBlock = docNode as DocBlock;\r\n this._ensureLineSkipped();\r\n this._renderNode(docBlock.blockTag);\r\n\r\n if (\r\n docBlock.blockTag.tagNameWithUpperCase === StandardTags.returns.tagNameWithUpperCase ||\r\n docBlock.blockTag.tagNameWithUpperCase === StandardTags.defaultValue.tagNameWithUpperCase\r\n ) {\r\n this._writeContent(' ');\r\n this._hangingParagraph = true;\r\n }\r\n\r\n this._renderNode(docBlock.content);\r\n break;\r\n\r\n case DocNodeKind.BlockTag:\r\n const docBlockTag: DocBlockTag = docNode as DocBlockTag;\r\n if (this._lineState === LineState.MiddleOfLine) {\r\n this._writeContent(' ');\r\n }\r\n this._writeContent(docBlockTag.tagName);\r\n break;\r\n\r\n case DocNodeKind.CodeSpan:\r\n const docCodeSpan: DocCodeSpan = docNode as DocCodeSpan;\r\n this._writeContent('`');\r\n this._writeContent(docCodeSpan.code);\r\n this._writeContent('`');\r\n break;\r\n\r\n case DocNodeKind.Comment:\r\n const docComment: DocComment = docNode as DocComment;\r\n this._renderNodes([\r\n docComment.summarySection,\r\n docComment.remarksBlock,\r\n docComment.privateRemarks,\r\n docComment.deprecatedBlock,\r\n docComment.params,\r\n docComment.typeParams,\r\n docComment.returnsBlock,\r\n ...docComment.customBlocks,\r\n ...docComment.seeBlocks,\r\n docComment.inheritDocTag\r\n ]);\r\n if (docComment.modifierTagSet.nodes.length > 0) {\r\n this._ensureLineSkipped();\r\n this._renderNodes(docComment.modifierTagSet.nodes);\r\n }\r\n break;\r\n\r\n case DocNodeKind.DeclarationReference:\r\n const docDeclarationReference: DocDeclarationReference = docNode as DocDeclarationReference;\r\n this._writeContent(docDeclarationReference.packageName);\r\n this._writeContent(docDeclarationReference.importPath);\r\n if (\r\n docDeclarationReference.packageName !== undefined ||\r\n docDeclarationReference.importPath !== undefined\r\n ) {\r\n this._writeContent('#');\r\n }\r\n this._renderNodes(docDeclarationReference.memberReferences);\r\n break;\r\n\r\n case DocNodeKind.ErrorText:\r\n const docErrorText: DocErrorText = docNode as DocErrorText;\r\n this._writeContent(docErrorText.text);\r\n break;\r\n\r\n case DocNodeKind.EscapedText:\r\n const docEscapedText: DocEscapedText = docNode as DocEscapedText;\r\n this._writeContent(docEscapedText.encodedText);\r\n break;\r\n\r\n case DocNodeKind.FencedCode:\r\n const docFencedCode: DocFencedCode = docNode as DocFencedCode;\r\n\r\n this._ensureAtStartOfLine();\r\n\r\n this._writeContent('```');\r\n this._writeContent(docFencedCode.language);\r\n this._writeNewline();\r\n this._writeContent(docFencedCode.code);\r\n this._writeContent('```');\r\n this._writeNewline();\r\n this._writeNewline();\r\n break;\r\n\r\n case DocNodeKind.HtmlAttribute:\r\n const docHtmlAttribute: DocHtmlAttribute = docNode as DocHtmlAttribute;\r\n this._writeContent(docHtmlAttribute.name);\r\n this._writeContent(docHtmlAttribute.spacingAfterName);\r\n this._writeContent('=');\r\n this._writeContent(docHtmlAttribute.spacingAfterEquals);\r\n this._writeContent(docHtmlAttribute.value);\r\n this._writeContent(docHtmlAttribute.spacingAfterValue);\r\n break;\r\n\r\n case DocNodeKind.HtmlEndTag:\r\n const docHtmlEndTag: DocHtmlEndTag = docNode as DocHtmlEndTag;\r\n this._writeContent('</');\r\n this._writeContent(docHtmlEndTag.name);\r\n this._writeContent('>');\r\n break;\r\n\r\n case DocNodeKind.HtmlStartTag:\r\n const docHtmlStartTag: DocHtmlStartTag = docNode as DocHtmlStartTag;\r\n this._writeContent('<');\r\n this._writeContent(docHtmlStartTag.name);\r\n this._writeContent(docHtmlStartTag.spacingAfterName);\r\n\r\n let needsSpace: boolean =\r\n docHtmlStartTag.spacingAfterName === undefined || docHtmlStartTag.spacingAfterName.length === 0;\r\n\r\n for (const attribute of docHtmlStartTag.htmlAttributes) {\r\n if (needsSpace) {\r\n this._writeContent(' ');\r\n }\r\n this._renderNode(attribute);\r\n needsSpace = attribute.spacingAfterValue === undefined || attribute.spacingAfterValue.length === 0;\r\n }\r\n this._writeContent(docHtmlStartTag.selfClosingTag ? '/>' : '>');\r\n break;\r\n\r\n case DocNodeKind.InheritDocTag:\r\n const docInheritDocTag: DocInheritDocTag = docNode as DocInheritDocTag;\r\n this._renderInlineTag(docInheritDocTag, () => {\r\n if (docInheritDocTag.declarationReference) {\r\n this._writeContent(' ');\r\n this._renderNode(docInheritDocTag.declarationReference);\r\n }\r\n });\r\n break;\r\n\r\n case DocNodeKind.InlineTag:\r\n const docInlineTag: DocInlineTag = docNode as DocInlineTag;\r\n this._renderInlineTag(docInlineTag, () => {\r\n if (docInlineTag.tagContent.length > 0) {\r\n this._writeContent(' ');\r\n this._writeContent(docInlineTag.tagContent);\r\n }\r\n });\r\n break;\r\n\r\n case DocNodeKind.LinkTag:\r\n const docLinkTag: DocLinkTag = docNode as DocLinkTag;\r\n this._renderInlineTag(docLinkTag, () => {\r\n if (docLinkTag.urlDestination !== undefined || docLinkTag.codeDestination !== undefined) {\r\n if (docLinkTag.urlDestination !== undefined) {\r\n this._writeContent(' ');\r\n this._writeContent(docLinkTag.urlDestination);\r\n } else if (docLinkTag.codeDestination !== undefined) {\r\n this._writeContent(' ');\r\n this._renderNode(docLinkTag.codeDestination);\r\n }\r\n }\r\n if (docLinkTag.linkText !== undefined) {\r\n this._writeContent(' ');\r\n this._writeContent('|');\r\n this._writeContent(' ');\r\n this._writeContent(docLinkTag.linkText);\r\n }\r\n });\r\n break;\r\n\r\n case DocNodeKind.MemberIdentifier:\r\n const docMemberIdentifier: DocMemberIdentifier = docNode as DocMemberIdentifier;\r\n if (docMemberIdentifier.hasQuotes) {\r\n this._writeContent('\"');\r\n this._writeContent(docMemberIdentifier.identifier); // todo: encoding\r\n this._writeContent('\"');\r\n } else {\r\n this._writeContent(docMemberIdentifier.identifier);\r\n }\r\n break;\r\n\r\n case DocNodeKind.MemberReference:\r\n const docMemberReference: DocMemberReference = docNode as DocMemberReference;\r\n if (docMemberReference.hasDot) {\r\n this._writeContent('.');\r\n }\r\n\r\n if (docMemberReference.selector) {\r\n this._writeContent('(');\r\n }\r\n\r\n if (docMemberReference.memberSymbol) {\r\n this._renderNode(docMemberReference.memberSymbol);\r\n } else {\r\n this._renderNode(docMemberReference.memberIdentifier);\r\n }\r\n\r\n if (docMemberReference.selector) {\r\n this._writeContent(':');\r\n this._renderNode(docMemberReference.selector);\r\n this._writeContent(')');\r\n }\r\n break;\r\n\r\n case DocNodeKind.MemberSelector:\r\n const docMemberSelector: DocMemberSelector = docNode as DocMemberSelector;\r\n this._writeContent(docMemberSelector.selector);\r\n break;\r\n\r\n case DocNodeKind.MemberSymbol:\r\n const docMemberSymbol: DocMemberSymbol = docNode as DocMemberSymbol;\r\n this._writeContent('[');\r\n this._renderNode(docMemberSymbol.symbolReference);\r\n this._writeContent(']');\r\n break;\r\n\r\n case DocNodeKind.Section:\r\n const docSection: DocSection = docNode as DocSection;\r\n this._renderNodes(docSection.nodes);\r\n break;\r\n\r\n case DocNodeKind.Paragraph:\r\n const trimmedParagraph: DocParagraph = DocNodeTransforms.trimSpacesInParagraph(\r\n docNode as DocParagraph\r\n );\r\n if (trimmedParagraph.nodes.length > 0) {\r\n if (this._hangingParagraph) {\r\n // If it's a hanging paragraph, then don't skip a line\r\n this._hangingParagraph = false;\r\n } else {\r\n this._ensureLineSkipped();\r\n }\r\n\r\n this._renderNodes(trimmedParagraph.nodes);\r\n this._writeNewline();\r\n }\r\n break;\r\n\r\n case DocNodeKind.ParamBlock:\r\n const docParamBlock: DocParamBlock = docNode as DocParamBlock;\r\n this._ensureLineSkipped();\r\n this._renderNode(docParamBlock.blockTag);\r\n this._writeContent(' ');\r\n this._writeContent(docParamBlock.parameterName);\r\n this._writeContent(' - ');\r\n this._hangingParagraph = true;\r\n this._renderNode(docParamBlock.content);\r\n this._hangingParagraph = false;\r\n break;\r\n\r\n case DocNodeKind.ParamCollection:\r\n const docParamCollection: DocParamCollection = docNode as DocParamCollection;\r\n this._renderNodes(docParamCollection.blocks);\r\n break;\r\n\r\n case DocNodeKind.PlainText:\r\n const docPlainText: DocPlainText = docNode as DocPlainText;\r\n this._writeContent(docPlainText.text);\r\n break;\r\n }\r\n }\r\n\r\n private _renderInlineTag(docInlineTagBase: DocInlineTagBase, writeInlineTagContent: () => void): void {\r\n this._writeContent('{');\r\n this._writeContent(docInlineTagBase.tagName);\r\n writeInlineTagContent();\r\n this._writeContent('}');\r\n }\r\n\r\n private _renderNodes(docNodes: ReadonlyArray<DocNode | undefined>): void {\r\n for (const docNode of docNodes) {\r\n this._renderNode(docNode);\r\n }\r\n }\r\n\r\n // Calls _writeNewline() only if we're not already at the start of a new line\r\n private _ensureAtStartOfLine(): void {\r\n if (this._lineState === LineState.MiddleOfLine) {\r\n this._writeNewline();\r\n }\r\n }\r\n\r\n // Calls _writeNewline() if needed to ensure that we have skipped at least one line\r\n private _ensureLineSkipped(): void {\r\n this._ensureAtStartOfLine();\r\n if (this._previousLineHadContent) {\r\n this._writeNewline();\r\n }\r\n }\r\n\r\n // Writes literal text content. If it contains newlines, they will automatically be converted to\r\n // _writeNewline() calls, to ensure that \"*\" is written at the start of each line.\r\n private _writeContent(content: string | undefined): void {\r\n if (content === undefined || content.length === 0) {\r\n return;\r\n }\r\n\r\n const splitLines: string[] = content.split(/\\r?\\n/g);\r\n if (splitLines.length > 1) {\r\n let firstLine: boolean = true;\r\n for (const line of splitLines) {\r\n if (firstLine) {\r\n firstLine = false;\r\n } else {\r\n this._writeNewline();\r\n }\r\n this._writeContent(line);\r\n }\r\n return;\r\n }\r\n\r\n if (this._lineState === LineState.Closed) {\r\n if (this._emitCommentFraming) {\r\n this._output!.append('/**' + this.eol + ' *');\r\n }\r\n this._lineState = LineState.StartOfLine;\r\n }\r\n\r\n if (this._lineState === LineState.StartOfLine) {\r\n if (this._emitCommentFraming) {\r\n this._output!.append(' ');\r\n }\r\n }\r\n\r\n this._output!.append(content);\r\n this._lineState = LineState.MiddleOfLine;\r\n this._previousLineHadContent = true;\r\n }\r\n\r\n // Starts a new line, and inserts \"/**\" or \"*\" as appropriate.\r\n private _writeNewline(): void {\r\n if (this._lineState === LineState.Closed) {\r\n if (this._emitCommentFraming) {\r\n this._output!.append('/**' + this.eol + ' *');\r\n }\r\n this._lineState = LineState.StartOfLine;\r\n }\r\n\r\n this._previousLineHadContent = this._lineState === LineState.MiddleOfLine;\r\n\r\n if (this._emitCommentFraming) {\r\n this._output!.append(this.eol + ' *');\r\n } else {\r\n this._output!.append(this.eol);\r\n }\r\n\r\n this._lineState = LineState.StartOfLine;\r\n this._hangingParagraph = false;\r\n }\r\n\r\n // Closes the comment, adding the final \"*/\" delimiter\r\n private _writeEnd(): void {\r\n if (this._lineState === LineState.MiddleOfLine) {\r\n if (this._emitCommentFraming) {\r\n this._writeNewline();\r\n }\r\n }\r\n\r\n if (this._lineState !== LineState.Closed) {\r\n if (this._emitCommentFraming) {\r\n this._output!.append('/' + this.eol);\r\n }\r\n this._lineState = LineState.Closed;\r\n }\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
| 5 |
+
if (k2 === undefined) k2 = k;
|
| 6 |
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
| 7 |
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
| 8 |
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
| 9 |
+
}
|
| 10 |
+
Object.defineProperty(o, k2, desc);
|
| 11 |
+
}) : (function(o, m, k, k2) {
|
| 12 |
+
if (k2 === undefined) k2 = k;
|
| 13 |
+
o[k2] = m[k];
|
| 14 |
+
}));
|
| 15 |
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
| 16 |
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
| 17 |
+
};
|
| 18 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 19 |
+
exports.DocNodeTransforms = exports.TSDocParser = exports.TSDocMessageId = exports.TokenSequence = exports.TokenKind = exports.Token = exports.TextRange = exports.ParserMessageLog = exports.ParserMessage = exports.ParserContext = exports.TSDocEmitter = exports.StringBuilder = exports.PlainTextEmitter = exports.ModifierTagSet = exports.StandardModifierTagSet = exports.Standardization = exports.StandardTags = exports.TSDocValidationConfiguration = exports.TSDocTagDefinition = exports.TSDocTagSyntaxKind = exports.TSDocConfiguration = exports.DocNodeManager = void 0;
|
| 20 |
+
var DocNodeManager_1 = require("./configuration/DocNodeManager");
|
| 21 |
+
Object.defineProperty(exports, "DocNodeManager", { enumerable: true, get: function () { return DocNodeManager_1.DocNodeManager; } });
|
| 22 |
+
var TSDocConfiguration_1 = require("./configuration/TSDocConfiguration");
|
| 23 |
+
Object.defineProperty(exports, "TSDocConfiguration", { enumerable: true, get: function () { return TSDocConfiguration_1.TSDocConfiguration; } });
|
| 24 |
+
var TSDocTagDefinition_1 = require("./configuration/TSDocTagDefinition");
|
| 25 |
+
Object.defineProperty(exports, "TSDocTagSyntaxKind", { enumerable: true, get: function () { return TSDocTagDefinition_1.TSDocTagSyntaxKind; } });
|
| 26 |
+
Object.defineProperty(exports, "TSDocTagDefinition", { enumerable: true, get: function () { return TSDocTagDefinition_1.TSDocTagDefinition; } });
|
| 27 |
+
var TSDocValidationConfiguration_1 = require("./configuration/TSDocValidationConfiguration");
|
| 28 |
+
Object.defineProperty(exports, "TSDocValidationConfiguration", { enumerable: true, get: function () { return TSDocValidationConfiguration_1.TSDocValidationConfiguration; } });
|
| 29 |
+
var StandardTags_1 = require("./details/StandardTags");
|
| 30 |
+
Object.defineProperty(exports, "StandardTags", { enumerable: true, get: function () { return StandardTags_1.StandardTags; } });
|
| 31 |
+
var Standardization_1 = require("./details/Standardization");
|
| 32 |
+
Object.defineProperty(exports, "Standardization", { enumerable: true, get: function () { return Standardization_1.Standardization; } });
|
| 33 |
+
var StandardModifierTagSet_1 = require("./details/StandardModifierTagSet");
|
| 34 |
+
Object.defineProperty(exports, "StandardModifierTagSet", { enumerable: true, get: function () { return StandardModifierTagSet_1.StandardModifierTagSet; } });
|
| 35 |
+
var ModifierTagSet_1 = require("./details/ModifierTagSet");
|
| 36 |
+
Object.defineProperty(exports, "ModifierTagSet", { enumerable: true, get: function () { return ModifierTagSet_1.ModifierTagSet; } });
|
| 37 |
+
var PlainTextEmitter_1 = require("./emitters/PlainTextEmitter");
|
| 38 |
+
Object.defineProperty(exports, "PlainTextEmitter", { enumerable: true, get: function () { return PlainTextEmitter_1.PlainTextEmitter; } });
|
| 39 |
+
var StringBuilder_1 = require("./emitters/StringBuilder");
|
| 40 |
+
Object.defineProperty(exports, "StringBuilder", { enumerable: true, get: function () { return StringBuilder_1.StringBuilder; } });
|
| 41 |
+
var TSDocEmitter_1 = require("./emitters/TSDocEmitter");
|
| 42 |
+
Object.defineProperty(exports, "TSDocEmitter", { enumerable: true, get: function () { return TSDocEmitter_1.TSDocEmitter; } });
|
| 43 |
+
__exportStar(require("./nodes"), exports);
|
| 44 |
+
var ParserContext_1 = require("./parser/ParserContext");
|
| 45 |
+
Object.defineProperty(exports, "ParserContext", { enumerable: true, get: function () { return ParserContext_1.ParserContext; } });
|
| 46 |
+
var ParserMessage_1 = require("./parser/ParserMessage");
|
| 47 |
+
Object.defineProperty(exports, "ParserMessage", { enumerable: true, get: function () { return ParserMessage_1.ParserMessage; } });
|
| 48 |
+
var ParserMessageLog_1 = require("./parser/ParserMessageLog");
|
| 49 |
+
Object.defineProperty(exports, "ParserMessageLog", { enumerable: true, get: function () { return ParserMessageLog_1.ParserMessageLog; } });
|
| 50 |
+
var TextRange_1 = require("./parser/TextRange");
|
| 51 |
+
Object.defineProperty(exports, "TextRange", { enumerable: true, get: function () { return TextRange_1.TextRange; } });
|
| 52 |
+
var Token_1 = require("./parser/Token");
|
| 53 |
+
Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return Token_1.Token; } });
|
| 54 |
+
Object.defineProperty(exports, "TokenKind", { enumerable: true, get: function () { return Token_1.TokenKind; } });
|
| 55 |
+
var TokenSequence_1 = require("./parser/TokenSequence");
|
| 56 |
+
Object.defineProperty(exports, "TokenSequence", { enumerable: true, get: function () { return TokenSequence_1.TokenSequence; } });
|
| 57 |
+
var TSDocMessageId_1 = require("./parser/TSDocMessageId");
|
| 58 |
+
Object.defineProperty(exports, "TSDocMessageId", { enumerable: true, get: function () { return TSDocMessageId_1.TSDocMessageId; } });
|
| 59 |
+
var TSDocParser_1 = require("./parser/TSDocParser");
|
| 60 |
+
Object.defineProperty(exports, "TSDocParser", { enumerable: true, get: function () { return TSDocParser_1.TSDocParser; } });
|
| 61 |
+
var DocNodeTransforms_1 = require("./transforms/DocNodeTransforms");
|
| 62 |
+
Object.defineProperty(exports, "DocNodeTransforms", { enumerable: true, get: function () { return DocNodeTransforms_1.DocNodeTransforms; } });
|
| 63 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;AAE3D,iEAIwC;AAHtC,gHAAA,cAAc,OAAA;AAIhB,yEAAwE;AAA/D,wHAAA,kBAAkB,OAAA;AAC3B,yEAI4C;AAF1C,wHAAA,kBAAkB,OAAA;AAClB,wHAAA,kBAAkB,OAAA;AAEpB,6FAA4F;AAAnF,4IAAA,4BAA4B,OAAA;AAErC,uDAAsD;AAA7C,4GAAA,YAAY,OAAA;AACrB,6DAA4D;AAAnD,kHAAA,eAAe,OAAA;AACxB,2EAA0E;AAAjE,gIAAA,sBAAsB,OAAA;AAC/B,2DAA0D;AAAjD,gHAAA,cAAc,OAAA;AAEvB,gEAA+D;AAAtD,oHAAA,gBAAgB,OAAA;AACzB,0DAA8E;AAArE,8GAAA,aAAa,OAAA;AACtB,wDAAuD;AAA9C,4GAAA,YAAY,OAAA;AAErB,0CAAwB;AAExB,wDAAuD;AAA9C,8GAAA,aAAa,OAAA;AACtB,wDAAsF;AAA7E,8GAAA,aAAa,OAAA;AACtB,8DAA6D;AAApD,oHAAA,gBAAgB,OAAA;AACzB,gDAAmE;AAA1D,sGAAA,SAAS,OAAA;AAClB,wCAAkD;AAAzC,8FAAA,KAAK,OAAA;AAAE,kGAAA,SAAS,OAAA;AACzB,wDAAsF;AAA7E,8GAAA,aAAa,OAAA;AACtB,0DAAyD;AAAhD,gHAAA,cAAc,OAAA;AACvB,oDAAmD;AAA1C,0GAAA,WAAW,OAAA;AAEpB,oEAAmE;AAA1D,sHAAA,iBAAiB,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nexport {\r\n DocNodeManager,\r\n type IDocNodeDefinition,\r\n type DocNodeConstructor\r\n} from './configuration/DocNodeManager';\r\nexport { TSDocConfiguration } from './configuration/TSDocConfiguration';\r\nexport {\r\n type ITSDocTagDefinitionParameters,\r\n TSDocTagSyntaxKind,\r\n TSDocTagDefinition\r\n} from './configuration/TSDocTagDefinition';\r\nexport { TSDocValidationConfiguration } from './configuration/TSDocValidationConfiguration';\r\n\r\nexport { StandardTags } from './details/StandardTags';\r\nexport { Standardization } from './details/Standardization';\r\nexport { StandardModifierTagSet } from './details/StandardModifierTagSet';\r\nexport { ModifierTagSet } from './details/ModifierTagSet';\r\n\r\nexport { PlainTextEmitter } from './emitters/PlainTextEmitter';\r\nexport { StringBuilder, type IStringBuilder } from './emitters/StringBuilder';\r\nexport { TSDocEmitter } from './emitters/TSDocEmitter';\r\n\r\nexport * from './nodes';\r\n\r\nexport { ParserContext } from './parser/ParserContext';\r\nexport { ParserMessage, type IParserMessageParameters } from './parser/ParserMessage';\r\nexport { ParserMessageLog } from './parser/ParserMessageLog';\r\nexport { TextRange, type ITextLocation } from './parser/TextRange';\r\nexport { Token, TokenKind } from './parser/Token';\r\nexport { TokenSequence, type ITokenSequenceParameters } from './parser/TokenSequence';\r\nexport { TSDocMessageId } from './parser/TSDocMessageId';\r\nexport { TSDocParser } from './parser/TSDocParser';\r\n\r\nexport { DocNodeTransforms } from './transforms/DocNodeTransforms';\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/BuiltInDocNodes.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
| 5 |
+
if (k2 === undefined) k2 = k;
|
| 6 |
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
| 7 |
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
| 8 |
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
| 9 |
+
}
|
| 10 |
+
Object.defineProperty(o, k2, desc);
|
| 11 |
+
}) : (function(o, m, k, k2) {
|
| 12 |
+
if (k2 === undefined) k2 = k;
|
| 13 |
+
o[k2] = m[k];
|
| 14 |
+
}));
|
| 15 |
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
| 16 |
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
| 17 |
+
}) : function(o, v) {
|
| 18 |
+
o["default"] = v;
|
| 19 |
+
});
|
| 20 |
+
var __importStar = (this && this.__importStar) || (function () {
|
| 21 |
+
var ownKeys = function(o) {
|
| 22 |
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
| 23 |
+
var ar = [];
|
| 24 |
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
| 25 |
+
return ar;
|
| 26 |
+
};
|
| 27 |
+
return ownKeys(o);
|
| 28 |
+
};
|
| 29 |
+
return function (mod) {
|
| 30 |
+
if (mod && mod.__esModule) return mod;
|
| 31 |
+
var result = {};
|
| 32 |
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
| 33 |
+
__setModuleDefault(result, mod);
|
| 34 |
+
return result;
|
| 35 |
+
};
|
| 36 |
+
})();
|
| 37 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 38 |
+
exports.BuiltInDocNodes = void 0;
|
| 39 |
+
const DocNode_1 = require("./DocNode");
|
| 40 |
+
const nodes = __importStar(require(".."));
|
| 41 |
+
class BuiltInDocNodes {
|
| 42 |
+
static register(configuration) {
|
| 43 |
+
const docNodeManager = configuration.docNodeManager;
|
| 44 |
+
docNodeManager.registerDocNodes('@microsoft/tsdoc', [
|
| 45 |
+
{ docNodeKind: DocNode_1.DocNodeKind.Block, constructor: nodes.DocBlock },
|
| 46 |
+
{ docNodeKind: DocNode_1.DocNodeKind.BlockTag, constructor: nodes.DocBlockTag },
|
| 47 |
+
{ docNodeKind: DocNode_1.DocNodeKind.CodeSpan, constructor: nodes.DocCodeSpan },
|
| 48 |
+
{ docNodeKind: DocNode_1.DocNodeKind.Comment, constructor: nodes.DocComment },
|
| 49 |
+
{ docNodeKind: DocNode_1.DocNodeKind.DeclarationReference, constructor: nodes.DocDeclarationReference },
|
| 50 |
+
{ docNodeKind: DocNode_1.DocNodeKind.ErrorText, constructor: nodes.DocErrorText },
|
| 51 |
+
{ docNodeKind: DocNode_1.DocNodeKind.EscapedText, constructor: nodes.DocEscapedText },
|
| 52 |
+
{ docNodeKind: DocNode_1.DocNodeKind.Excerpt, constructor: nodes.DocExcerpt },
|
| 53 |
+
{ docNodeKind: DocNode_1.DocNodeKind.FencedCode, constructor: nodes.DocFencedCode },
|
| 54 |
+
{ docNodeKind: DocNode_1.DocNodeKind.HtmlAttribute, constructor: nodes.DocHtmlAttribute },
|
| 55 |
+
{ docNodeKind: DocNode_1.DocNodeKind.HtmlEndTag, constructor: nodes.DocHtmlEndTag },
|
| 56 |
+
{ docNodeKind: DocNode_1.DocNodeKind.HtmlStartTag, constructor: nodes.DocHtmlStartTag },
|
| 57 |
+
{ docNodeKind: DocNode_1.DocNodeKind.InheritDocTag, constructor: nodes.DocInheritDocTag },
|
| 58 |
+
{ docNodeKind: DocNode_1.DocNodeKind.InlineTag, constructor: nodes.DocInlineTag },
|
| 59 |
+
{ docNodeKind: DocNode_1.DocNodeKind.LinkTag, constructor: nodes.DocLinkTag },
|
| 60 |
+
{ docNodeKind: DocNode_1.DocNodeKind.MemberIdentifier, constructor: nodes.DocMemberIdentifier },
|
| 61 |
+
{ docNodeKind: DocNode_1.DocNodeKind.MemberReference, constructor: nodes.DocMemberReference },
|
| 62 |
+
{ docNodeKind: DocNode_1.DocNodeKind.MemberSelector, constructor: nodes.DocMemberSelector },
|
| 63 |
+
{ docNodeKind: DocNode_1.DocNodeKind.MemberSymbol, constructor: nodes.DocMemberSymbol },
|
| 64 |
+
{ docNodeKind: DocNode_1.DocNodeKind.Paragraph, constructor: nodes.DocParagraph },
|
| 65 |
+
{ docNodeKind: DocNode_1.DocNodeKind.ParamBlock, constructor: nodes.DocParamBlock },
|
| 66 |
+
{ docNodeKind: DocNode_1.DocNodeKind.ParamCollection, constructor: nodes.DocParamCollection },
|
| 67 |
+
{ docNodeKind: DocNode_1.DocNodeKind.PlainText, constructor: nodes.DocPlainText },
|
| 68 |
+
{ docNodeKind: DocNode_1.DocNodeKind.Section, constructor: nodes.DocSection },
|
| 69 |
+
{ docNodeKind: DocNode_1.DocNodeKind.SoftBreak, constructor: nodes.DocSoftBreak }
|
| 70 |
+
]);
|
| 71 |
+
docNodeManager.registerAllowableChildren(DocNode_1.DocNodeKind.Section, [
|
| 72 |
+
DocNode_1.DocNodeKind.FencedCode,
|
| 73 |
+
DocNode_1.DocNodeKind.Paragraph,
|
| 74 |
+
DocNode_1.DocNodeKind.HtmlStartTag,
|
| 75 |
+
DocNode_1.DocNodeKind.HtmlEndTag
|
| 76 |
+
]);
|
| 77 |
+
docNodeManager.registerAllowableChildren(DocNode_1.DocNodeKind.Paragraph, [
|
| 78 |
+
DocNode_1.DocNodeKind.BlockTag,
|
| 79 |
+
DocNode_1.DocNodeKind.CodeSpan,
|
| 80 |
+
DocNode_1.DocNodeKind.ErrorText,
|
| 81 |
+
DocNode_1.DocNodeKind.EscapedText,
|
| 82 |
+
DocNode_1.DocNodeKind.HtmlStartTag,
|
| 83 |
+
DocNode_1.DocNodeKind.HtmlEndTag,
|
| 84 |
+
DocNode_1.DocNodeKind.InlineTag,
|
| 85 |
+
DocNode_1.DocNodeKind.LinkTag,
|
| 86 |
+
DocNode_1.DocNodeKind.PlainText,
|
| 87 |
+
DocNode_1.DocNodeKind.SoftBreak
|
| 88 |
+
]);
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
exports.BuiltInDocNodes = BuiltInDocNodes;
|
| 92 |
+
//# sourceMappingURL=BuiltInDocNodes.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/BuiltInDocNodes.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"BuiltInDocNodes.js","sourceRoot":"","sources":["../../src/nodes/BuiltInDocNodes.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAI3D,uCAAwC;AACxC,0CAA4B;AAE5B,MAAa,eAAe;IACnB,MAAM,CAAC,QAAQ,CAAC,aAAiC;QACtD,MAAM,cAAc,GAAmB,aAAa,CAAC,cAAc,CAAC;QAEpE,cAAc,CAAC,gBAAgB,CAAC,kBAAkB,EAAE;YAClD,EAAE,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;YACpB,qBAAW,CAAC,SAAS;YACrB,qBAAW,CAAC,WAAW;YACvB,qBAAW,CAAC,YAAY;YACxB,qBAAW,CAAC,UAAU;YACtB,qBAAW,CAAC,SAAS;YACrB,qBAAW,CAAC,OAAO;YACnB,qBAAW,CAAC,SAAS;YACrB,qBAAW,CAAC,SAAS;SACtB,CAAC,CAAC;IACL,CAAC;CACF;AApDD,0CAoDC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport type { TSDocConfiguration } from '../configuration/TSDocConfiguration';\r\nimport type { DocNodeManager } from '../configuration/DocNodeManager';\r\nimport { DocNodeKind } from './DocNode';\r\nimport * as nodes from '..';\r\n\r\nexport class BuiltInDocNodes {\r\n public static register(configuration: TSDocConfiguration): void {\r\n const docNodeManager: DocNodeManager = configuration.docNodeManager;\r\n\r\n docNodeManager.registerDocNodes('@microsoft/tsdoc', [\r\n { docNodeKind: DocNodeKind.Block, constructor: nodes.DocBlock },\r\n { docNodeKind: DocNodeKind.BlockTag, constructor: nodes.DocBlockTag },\r\n { docNodeKind: DocNodeKind.CodeSpan, constructor: nodes.DocCodeSpan },\r\n { docNodeKind: DocNodeKind.Comment, constructor: nodes.DocComment },\r\n { docNodeKind: DocNodeKind.DeclarationReference, constructor: nodes.DocDeclarationReference },\r\n { docNodeKind: DocNodeKind.ErrorText, constructor: nodes.DocErrorText },\r\n { docNodeKind: DocNodeKind.EscapedText, constructor: nodes.DocEscapedText },\r\n { docNodeKind: DocNodeKind.Excerpt, constructor: nodes.DocExcerpt },\r\n { docNodeKind: DocNodeKind.FencedCode, constructor: nodes.DocFencedCode },\r\n { docNodeKind: DocNodeKind.HtmlAttribute, constructor: nodes.DocHtmlAttribute },\r\n { docNodeKind: DocNodeKind.HtmlEndTag, constructor: nodes.DocHtmlEndTag },\r\n { docNodeKind: DocNodeKind.HtmlStartTag, constructor: nodes.DocHtmlStartTag },\r\n { docNodeKind: DocNodeKind.InheritDocTag, constructor: nodes.DocInheritDocTag },\r\n { docNodeKind: DocNodeKind.InlineTag, constructor: nodes.DocInlineTag },\r\n { docNodeKind: DocNodeKind.LinkTag, constructor: nodes.DocLinkTag },\r\n { docNodeKind: DocNodeKind.MemberIdentifier, constructor: nodes.DocMemberIdentifier },\r\n { docNodeKind: DocNodeKind.MemberReference, constructor: nodes.DocMemberReference },\r\n { docNodeKind: DocNodeKind.MemberSelector, constructor: nodes.DocMemberSelector },\r\n { docNodeKind: DocNodeKind.MemberSymbol, constructor: nodes.DocMemberSymbol },\r\n { docNodeKind: DocNodeKind.Paragraph, constructor: nodes.DocParagraph },\r\n { docNodeKind: DocNodeKind.ParamBlock, constructor: nodes.DocParamBlock },\r\n { docNodeKind: DocNodeKind.ParamCollection, constructor: nodes.DocParamCollection },\r\n { docNodeKind: DocNodeKind.PlainText, constructor: nodes.DocPlainText },\r\n { docNodeKind: DocNodeKind.Section, constructor: nodes.DocSection },\r\n { docNodeKind: DocNodeKind.SoftBreak, constructor: nodes.DocSoftBreak }\r\n ]);\r\n\r\n docNodeManager.registerAllowableChildren(DocNodeKind.Section, [\r\n DocNodeKind.FencedCode,\r\n DocNodeKind.Paragraph,\r\n DocNodeKind.HtmlStartTag,\r\n DocNodeKind.HtmlEndTag\r\n ]);\r\n\r\n docNodeManager.registerAllowableChildren(DocNodeKind.Paragraph, [\r\n DocNodeKind.BlockTag,\r\n DocNodeKind.CodeSpan,\r\n DocNodeKind.ErrorText,\r\n DocNodeKind.EscapedText,\r\n DocNodeKind.HtmlStartTag,\r\n DocNodeKind.HtmlEndTag,\r\n DocNodeKind.InlineTag,\r\n DocNodeKind.LinkTag,\r\n DocNodeKind.PlainText,\r\n DocNodeKind.SoftBreak\r\n ]);\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocBlock.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocBlock = void 0;
|
| 6 |
+
const DocNode_1 = require("./DocNode");
|
| 7 |
+
const DocSection_1 = require("./DocSection");
|
| 8 |
+
/**
|
| 9 |
+
* Represents a section that is introduced by a TSDoc block tag.
|
| 10 |
+
* For example, an `@example` block.
|
| 11 |
+
*/
|
| 12 |
+
class DocBlock extends DocNode_1.DocNode {
|
| 13 |
+
/**
|
| 14 |
+
* Don't call this directly. Instead use {@link TSDocParser}
|
| 15 |
+
* @internal
|
| 16 |
+
*/
|
| 17 |
+
constructor(parameters) {
|
| 18 |
+
super(parameters);
|
| 19 |
+
this._blockTag = parameters.blockTag;
|
| 20 |
+
this._content = new DocSection_1.DocSection({ configuration: this.configuration });
|
| 21 |
+
}
|
| 22 |
+
/** @override */
|
| 23 |
+
get kind() {
|
| 24 |
+
return DocNode_1.DocNodeKind.Block;
|
| 25 |
+
}
|
| 26 |
+
/**
|
| 27 |
+
* The TSDoc tag that introduces this section.
|
| 28 |
+
*/
|
| 29 |
+
get blockTag() {
|
| 30 |
+
return this._blockTag;
|
| 31 |
+
}
|
| 32 |
+
/**
|
| 33 |
+
* The TSDoc tag that introduces this section.
|
| 34 |
+
*/
|
| 35 |
+
get content() {
|
| 36 |
+
return this._content;
|
| 37 |
+
}
|
| 38 |
+
/** @override */
|
| 39 |
+
onGetChildNodes() {
|
| 40 |
+
return [this.blockTag, this._content];
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
exports.DocBlock = DocBlock;
|
| 44 |
+
//# sourceMappingURL=DocBlock.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocBlock.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"DocBlock.js","sourceRoot":"","sources":["../../src/nodes/DocBlock.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,uCAAyG;AACzG,6CAA0C;AAiB1C;;;GAGG;AACH,MAAa,QAAS,SAAQ,iBAAO;IAInC;;;OAGG;IACH,YAAmB,UAA2D;QAC5E,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,uBAAU,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,qBAAW,CAAC,KAAK,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;CACF;AArCD,4BAqCC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { DocNodeKind, DocNode, type IDocNodeParameters, type IDocNodeParsedParameters } from './DocNode';\r\nimport { DocSection } from './DocSection';\r\nimport type { DocBlockTag } from './DocBlockTag';\r\n\r\n/**\r\n * Constructor parameters for {@link DocBlock}.\r\n */\r\nexport interface IDocBlockParameters extends IDocNodeParameters {\r\n blockTag: DocBlockTag;\r\n}\r\n\r\n/**\r\n * Constructor parameters for {@link DocBlock}.\r\n */\r\nexport interface IDocBlockParsedParameters extends IDocNodeParsedParameters {\r\n blockTag: DocBlockTag;\r\n}\r\n\r\n/**\r\n * Represents a section that is introduced by a TSDoc block tag.\r\n * For example, an `@example` block.\r\n */\r\nexport class DocBlock extends DocNode {\r\n private readonly _blockTag: DocBlockTag;\r\n private readonly _content: DocSection;\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(parameters: IDocBlockParameters | IDocBlockParsedParameters) {\r\n super(parameters);\r\n this._blockTag = parameters.blockTag;\r\n this._content = new DocSection({ configuration: this.configuration });\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.Block;\r\n }\r\n\r\n /**\r\n * The TSDoc tag that introduces this section.\r\n */\r\n public get blockTag(): DocBlockTag {\r\n return this._blockTag;\r\n }\r\n\r\n /**\r\n * The TSDoc tag that introduces this section.\r\n */\r\n public get content(): DocSection {\r\n return this._content;\r\n }\r\n\r\n /** @override */\r\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\r\n return [this.blockTag, this._content];\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocBlockTag.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocBlockTag = void 0;
|
| 6 |
+
const DocNode_1 = require("./DocNode");
|
| 7 |
+
const StringChecks_1 = require("../parser/StringChecks");
|
| 8 |
+
const DocExcerpt_1 = require("./DocExcerpt");
|
| 9 |
+
/**
|
| 10 |
+
* Represents a TSDoc block tag such as `@param` or `@public`.
|
| 11 |
+
*/
|
| 12 |
+
class DocBlockTag extends DocNode_1.DocNode {
|
| 13 |
+
/**
|
| 14 |
+
* Don't call this directly. Instead use {@link TSDocParser}
|
| 15 |
+
* @internal
|
| 16 |
+
*/
|
| 17 |
+
constructor(parameters) {
|
| 18 |
+
super(parameters);
|
| 19 |
+
StringChecks_1.StringChecks.validateTSDocTagName(parameters.tagName);
|
| 20 |
+
this._tagName = parameters.tagName;
|
| 21 |
+
this._tagNameWithUpperCase = parameters.tagName.toUpperCase();
|
| 22 |
+
if (DocNode_1.DocNode.isParsedParameters(parameters)) {
|
| 23 |
+
this._tagNameExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 24 |
+
configuration: this.configuration,
|
| 25 |
+
excerptKind: DocExcerpt_1.ExcerptKind.BlockTag,
|
| 26 |
+
content: parameters.tagNameExcerpt
|
| 27 |
+
});
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
/** @override */
|
| 31 |
+
get kind() {
|
| 32 |
+
return DocNode_1.DocNodeKind.BlockTag;
|
| 33 |
+
}
|
| 34 |
+
/**
|
| 35 |
+
* The TSDoc tag name. TSDoc tag names start with an at-sign (`@`) followed
|
| 36 |
+
* by ASCII letters using "camelCase" capitalization.
|
| 37 |
+
*/
|
| 38 |
+
get tagName() {
|
| 39 |
+
return this._tagName;
|
| 40 |
+
}
|
| 41 |
+
/**
|
| 42 |
+
* The TSDoc tag name in all capitals, which is used for performing
|
| 43 |
+
* case-insensitive comparisons or lookups.
|
| 44 |
+
*/
|
| 45 |
+
get tagNameWithUpperCase() {
|
| 46 |
+
return this._tagNameWithUpperCase;
|
| 47 |
+
}
|
| 48 |
+
/** @override */
|
| 49 |
+
onGetChildNodes() {
|
| 50 |
+
return [this._tagNameExcerpt];
|
| 51 |
+
}
|
| 52 |
+
getTokenSequence() {
|
| 53 |
+
if (!this._tagNameExcerpt) {
|
| 54 |
+
throw new Error('DocBlockTag.getTokenSequence() failed because this object did not originate from a parsed input');
|
| 55 |
+
}
|
| 56 |
+
return this._tagNameExcerpt.content;
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
exports.DocBlockTag = DocBlockTag;
|
| 60 |
+
//# sourceMappingURL=DocBlockTag.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocBlockTag.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"DocBlockTag.js","sourceRoot":"","sources":["../../src/nodes/DocBlockTag.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,uCAAyG;AACzG,yDAAsD;AAEtD,6CAAuD;AAiBvD;;GAEG;AACH,MAAa,WAAY,SAAQ,iBAAO;IAKtC;;;OAGG;IACH,YAAmB,UAAiE;QAClF,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,2BAAY,CAAC,oBAAoB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,qBAAqB,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAE9D,IAAI,iBAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,eAAe,GAAG,IAAI,uBAAU,CAAC;gBACpC,aAAa,EAAE,IAAI,CAAC,aAAa;gBACjC,WAAW,EAAE,wBAAW,CAAC,QAAQ;gBACjC,OAAO,EAAE,UAAU,CAAC,cAAc;aACnC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,qBAAW,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,IAAW,oBAAoB;QAC7B,OAAO,IAAI,CAAC,qBAAqB,CAAC;IACpC,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAChC,CAAC;IAEM,gBAAgB;QACrB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;IACtC,CAAC;CACF;AA3DD,kCA2DC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { DocNodeKind, DocNode, type IDocNodeParameters, type IDocNodeParsedParameters } from './DocNode';\r\nimport { StringChecks } from '../parser/StringChecks';\r\nimport type { TokenSequence } from '../parser/TokenSequence';\r\nimport { DocExcerpt, ExcerptKind } from './DocExcerpt';\r\n\r\n/**\r\n * Constructor parameters for {@link DocBlockTag}.\r\n */\r\nexport interface IDocBlockTagParameters extends IDocNodeParameters {\r\n tagName: string;\r\n}\r\n\r\n/**\r\n * Constructor parameters for {@link DocBlockTag}.\r\n */\r\nexport interface IDocBlockTagParsedParameters extends IDocNodeParsedParameters {\r\n tagName: string;\r\n tagNameExcerpt: TokenSequence;\r\n}\r\n\r\n/**\r\n * Represents a TSDoc block tag such as `@param` or `@public`.\r\n */\r\nexport class DocBlockTag extends DocNode {\r\n private readonly _tagName: string;\r\n private readonly _tagNameWithUpperCase: string;\r\n private readonly _tagNameExcerpt: DocExcerpt | undefined;\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(parameters: IDocBlockTagParameters | IDocBlockTagParsedParameters) {\r\n super(parameters);\r\n\r\n StringChecks.validateTSDocTagName(parameters.tagName);\r\n this._tagName = parameters.tagName;\r\n this._tagNameWithUpperCase = parameters.tagName.toUpperCase();\r\n\r\n if (DocNode.isParsedParameters(parameters)) {\r\n this._tagNameExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.BlockTag,\r\n content: parameters.tagNameExcerpt\r\n });\r\n }\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.BlockTag;\r\n }\r\n\r\n /**\r\n * The TSDoc tag name. TSDoc tag names start with an at-sign (`@`) followed\r\n * by ASCII letters using \"camelCase\" capitalization.\r\n */\r\n public get tagName(): string {\r\n return this._tagName;\r\n }\r\n\r\n /**\r\n * The TSDoc tag name in all capitals, which is used for performing\r\n * case-insensitive comparisons or lookups.\r\n */\r\n public get tagNameWithUpperCase(): string {\r\n return this._tagNameWithUpperCase;\r\n }\r\n\r\n /** @override */\r\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\r\n return [this._tagNameExcerpt];\r\n }\r\n\r\n public getTokenSequence(): TokenSequence {\r\n if (!this._tagNameExcerpt) {\r\n throw new Error(\r\n 'DocBlockTag.getTokenSequence() failed because this object did not originate from a parsed input'\r\n );\r\n }\r\n return this._tagNameExcerpt.content;\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocCodeSpan.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocCodeSpan = void 0;
|
| 6 |
+
const DocNode_1 = require("./DocNode");
|
| 7 |
+
const DocExcerpt_1 = require("./DocExcerpt");
|
| 8 |
+
/**
|
| 9 |
+
* Represents CommonMark-style code span, i.e. code surrounded by
|
| 10 |
+
* backtick characters.
|
| 11 |
+
*/
|
| 12 |
+
class DocCodeSpan extends DocNode_1.DocNode {
|
| 13 |
+
/**
|
| 14 |
+
* Don't call this directly. Instead use {@link TSDocParser}
|
| 15 |
+
* @internal
|
| 16 |
+
*/
|
| 17 |
+
constructor(parameters) {
|
| 18 |
+
super(parameters);
|
| 19 |
+
if (DocNode_1.DocNode.isParsedParameters(parameters)) {
|
| 20 |
+
this._openingDelimiterExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 21 |
+
configuration: this.configuration,
|
| 22 |
+
excerptKind: DocExcerpt_1.ExcerptKind.CodeSpan_OpeningDelimiter,
|
| 23 |
+
content: parameters.openingDelimiterExcerpt
|
| 24 |
+
});
|
| 25 |
+
this._codeExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 26 |
+
configuration: this.configuration,
|
| 27 |
+
excerptKind: DocExcerpt_1.ExcerptKind.CodeSpan_Code,
|
| 28 |
+
content: parameters.codeExcerpt
|
| 29 |
+
});
|
| 30 |
+
this._closingDelimiterExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 31 |
+
configuration: this.configuration,
|
| 32 |
+
excerptKind: DocExcerpt_1.ExcerptKind.CodeSpan_ClosingDelimiter,
|
| 33 |
+
content: parameters.closingDelimiterExcerpt
|
| 34 |
+
});
|
| 35 |
+
}
|
| 36 |
+
else {
|
| 37 |
+
this._code = parameters.code;
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
/** @override */
|
| 41 |
+
get kind() {
|
| 42 |
+
return DocNode_1.DocNodeKind.CodeSpan;
|
| 43 |
+
}
|
| 44 |
+
/**
|
| 45 |
+
* The text that should be rendered as code, excluding the backtick delimiters.
|
| 46 |
+
*/
|
| 47 |
+
get code() {
|
| 48 |
+
if (this._code === undefined) {
|
| 49 |
+
this._code = this._codeExcerpt.content.toString();
|
| 50 |
+
}
|
| 51 |
+
return this._code;
|
| 52 |
+
}
|
| 53 |
+
/** @override */
|
| 54 |
+
onGetChildNodes() {
|
| 55 |
+
return [this._openingDelimiterExcerpt, this._codeExcerpt, this._closingDelimiterExcerpt];
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
exports.DocCodeSpan = DocCodeSpan;
|
| 59 |
+
//# sourceMappingURL=DocCodeSpan.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocCodeSpan.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"DocCodeSpan.js","sourceRoot":"","sources":["../../src/nodes/DocCodeSpan.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,uCAAyG;AAEzG,6CAAuD;AAoBvD;;;GAGG;AACH,MAAa,WAAY,SAAQ,iBAAO;IAWtC;;;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CACF;AA1DD,kCA0DC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { DocNodeKind, type IDocNodeParameters, DocNode, type IDocNodeParsedParameters } from './DocNode';\r\nimport type { TokenSequence } from '../parser/TokenSequence';\r\nimport { DocExcerpt, ExcerptKind } from './DocExcerpt';\r\n\r\n/**\r\n * Constructor parameters for {@link DocCodeSpan}.\r\n */\r\nexport interface IDocCodeSpanParameters extends IDocNodeParameters {\r\n code: string;\r\n}\r\n\r\n/**\r\n * Constructor parameters for {@link DocCodeSpan}.\r\n */\r\nexport interface IDocCodeSpanParsedParameters extends IDocNodeParsedParameters {\r\n openingDelimiterExcerpt: TokenSequence;\r\n\r\n codeExcerpt: TokenSequence;\r\n\r\n closingDelimiterExcerpt: TokenSequence;\r\n}\r\n\r\n/**\r\n * Represents CommonMark-style code span, i.e. code surrounded by\r\n * backtick characters.\r\n */\r\nexport class DocCodeSpan extends DocNode {\r\n // The opening ` delimiter\r\n private readonly _openingDelimiterExcerpt: DocExcerpt | undefined;\r\n\r\n // The code content\r\n private _code: string | undefined;\r\n private readonly _codeExcerpt: DocExcerpt | undefined;\r\n\r\n // The closing ` delimiter\r\n private readonly _closingDelimiterExcerpt: DocExcerpt | undefined;\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(parameters: IDocCodeSpanParameters | IDocCodeSpanParsedParameters) {\r\n super(parameters);\r\n\r\n if (DocNode.isParsedParameters(parameters)) {\r\n this._openingDelimiterExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.CodeSpan_OpeningDelimiter,\r\n content: parameters.openingDelimiterExcerpt\r\n });\r\n this._codeExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.CodeSpan_Code,\r\n content: parameters.codeExcerpt\r\n });\r\n this._closingDelimiterExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.CodeSpan_ClosingDelimiter,\r\n content: parameters.closingDelimiterExcerpt\r\n });\r\n } else {\r\n this._code = parameters.code;\r\n }\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.CodeSpan;\r\n }\r\n\r\n /**\r\n * The text that should be rendered as code, excluding the backtick delimiters.\r\n */\r\n public get code(): string {\r\n if (this._code === undefined) {\r\n this._code = this._codeExcerpt!.content.toString();\r\n }\r\n return this._code;\r\n }\r\n\r\n /** @override */\r\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\r\n return [this._openingDelimiterExcerpt, this._codeExcerpt, this._closingDelimiterExcerpt];\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocComment.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocComment = void 0;
|
| 6 |
+
const DocNode_1 = require("./DocNode");
|
| 7 |
+
const DocSection_1 = require("./DocSection");
|
| 8 |
+
const StandardModifierTagSet_1 = require("../details/StandardModifierTagSet");
|
| 9 |
+
const StringBuilder_1 = require("../emitters/StringBuilder");
|
| 10 |
+
const TSDocEmitter_1 = require("../emitters/TSDocEmitter");
|
| 11 |
+
const DocParamCollection_1 = require("./DocParamCollection");
|
| 12 |
+
/**
|
| 13 |
+
* Represents an entire documentation comment conforming to the TSDoc structure.
|
| 14 |
+
* This is the root of the DocNode tree.
|
| 15 |
+
*/
|
| 16 |
+
class DocComment extends DocNode_1.DocNode {
|
| 17 |
+
/**
|
| 18 |
+
* Don't call this directly. Instead use {@link TSDocParser}
|
| 19 |
+
* @internal
|
| 20 |
+
*/
|
| 21 |
+
constructor(parameters) {
|
| 22 |
+
super(parameters);
|
| 23 |
+
this.summarySection = new DocSection_1.DocSection({ configuration: this.configuration });
|
| 24 |
+
this.remarksBlock = undefined;
|
| 25 |
+
this.privateRemarks = undefined;
|
| 26 |
+
this.deprecatedBlock = undefined;
|
| 27 |
+
this.params = new DocParamCollection_1.DocParamCollection({ configuration: this.configuration });
|
| 28 |
+
this.typeParams = new DocParamCollection_1.DocParamCollection({ configuration: this.configuration });
|
| 29 |
+
this.returnsBlock = undefined;
|
| 30 |
+
this.modifierTagSet = new StandardModifierTagSet_1.StandardModifierTagSet();
|
| 31 |
+
this._seeBlocks = [];
|
| 32 |
+
this._customBlocks = [];
|
| 33 |
+
}
|
| 34 |
+
/** @override */
|
| 35 |
+
get kind() {
|
| 36 |
+
return DocNode_1.DocNodeKind.Comment;
|
| 37 |
+
}
|
| 38 |
+
/**
|
| 39 |
+
* The collection of all `@see` DockBlockTag nodes belonging to this doc comment.
|
| 40 |
+
*/
|
| 41 |
+
get seeBlocks() {
|
| 42 |
+
return this._seeBlocks;
|
| 43 |
+
}
|
| 44 |
+
/**
|
| 45 |
+
* The collection of all DocBlock nodes belonging to this doc comment.
|
| 46 |
+
*/
|
| 47 |
+
get customBlocks() {
|
| 48 |
+
return this._customBlocks;
|
| 49 |
+
}
|
| 50 |
+
/**
|
| 51 |
+
* Append an item to the seeBlocks collection.
|
| 52 |
+
* @internal
|
| 53 |
+
*/
|
| 54 |
+
_appendSeeBlock(block) {
|
| 55 |
+
this._seeBlocks.push(block);
|
| 56 |
+
}
|
| 57 |
+
/**
|
| 58 |
+
* Append an item to the customBlocks collection.
|
| 59 |
+
*/
|
| 60 |
+
appendCustomBlock(block) {
|
| 61 |
+
this._customBlocks.push(block);
|
| 62 |
+
}
|
| 63 |
+
/** @override */
|
| 64 |
+
onGetChildNodes() {
|
| 65 |
+
return [
|
| 66 |
+
this.summarySection,
|
| 67 |
+
this.remarksBlock,
|
| 68 |
+
this.privateRemarks,
|
| 69 |
+
this.deprecatedBlock,
|
| 70 |
+
this.params.count > 0 ? this.params : undefined,
|
| 71 |
+
this.typeParams.count > 0 ? this.typeParams : undefined,
|
| 72 |
+
this.returnsBlock,
|
| 73 |
+
...this.customBlocks,
|
| 74 |
+
...this.seeBlocks,
|
| 75 |
+
this.inheritDocTag,
|
| 76 |
+
...this.modifierTagSet.nodes
|
| 77 |
+
];
|
| 78 |
+
}
|
| 79 |
+
/**
|
| 80 |
+
* Generates a doc comment corresponding to the `DocComment` tree. The output is in a normalized form,
|
| 81 |
+
* and may ignore formatting/spacing from the original input.
|
| 82 |
+
*
|
| 83 |
+
* @remarks
|
| 84 |
+
* After parsing a string, and possibly modifying the result, `emitAsTsdoc()` can be used to render the result
|
| 85 |
+
* as a doc comment in a normalized format. It can also be used to emit a `DocComment` tree that was constructed
|
| 86 |
+
* manually.
|
| 87 |
+
*
|
| 88 |
+
* This method is provided as convenience for simple use cases. To customize the output, or if you need
|
| 89 |
+
* to render into a `StringBuilder`, use the {@link TSDocEmitter} class instead.
|
| 90 |
+
*/
|
| 91 |
+
emitAsTsdoc() {
|
| 92 |
+
const stringBuilder = new StringBuilder_1.StringBuilder();
|
| 93 |
+
const emitter = new TSDocEmitter_1.TSDocEmitter();
|
| 94 |
+
emitter.renderComment(stringBuilder, this);
|
| 95 |
+
return stringBuilder.toString();
|
| 96 |
+
}
|
| 97 |
+
}
|
| 98 |
+
exports.DocComment = DocComment;
|
| 99 |
+
//# sourceMappingURL=DocComment.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocComment.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"DocComment.js","sourceRoot":"","sources":["../../src/nodes/DocComment.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,uCAA0E;AAC1E,6CAA0C;AAC1C,8EAA2E;AAG3E,6DAA0D;AAC1D,2DAAwD;AACxD,6DAA0D;AAO1D;;;GAGG;AACH,MAAa,UAAW,SAAQ,iBAAO;IA0ErC;;;OAGG;IACH,YAAmB,UAAiC;QAClD,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,cAAc,GAAG,IAAI,uBAAU,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAC5E,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,IAAI,uCAAkB,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAC5E,IAAI,CAAC,UAAU,GAAG,IAAI,uCAAkB,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,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AM,aAAa,GAAkB,IAAI,6BAAa,EAAE,CAAC;QACzD,MAAM,OAAO,GAAiB,IAAI,2BAAY,EAAE,CAAC;QACjD,OAAO,CAAC,aAAa,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAC3C,OAAO,aAAa,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CACF;AApKD,gCAoKC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { DocNode, DocNodeKind, type IDocNodeParameters } from './DocNode';\r\nimport { DocSection } from './DocSection';\r\nimport { StandardModifierTagSet } from '../details/StandardModifierTagSet';\r\nimport type { DocBlock } from './DocBlock';\r\nimport type { DocInheritDocTag } from './DocInheritDocTag';\r\nimport { StringBuilder } from '../emitters/StringBuilder';\r\nimport { TSDocEmitter } from '../emitters/TSDocEmitter';\r\nimport { DocParamCollection } from './DocParamCollection';\r\n\r\n/**\r\n * Constructor parameters for {@link DocComment}.\r\n */\r\nexport interface IDocCommentParameters extends IDocNodeParameters {}\r\n\r\n/**\r\n * Represents an entire documentation comment conforming to the TSDoc structure.\r\n * This is the root of the DocNode tree.\r\n */\r\nexport class DocComment extends DocNode {\r\n /**\r\n * The main documentation for an API item is separated into a brief \"summary\" section,\r\n * optionally followed by an `@remarks` block containing additional details.\r\n *\r\n * @remarks\r\n * The summary section should be brief. On a documentation web site, it will be shown\r\n * on a page that lists summaries for many different API items. On a detail page for\r\n * a single item, the summary will be shown followed by the remarks section (if any).\r\n */\r\n public summarySection: DocSection;\r\n\r\n /**\r\n * The main documentation for an API item is separated into a brief \"summary\" section\r\n * optionally followed by an `@remarks` block containing additional details.\r\n *\r\n * @remarks\r\n * Unlike the summary, the remarks block may contain lengthy documentation content.\r\n * The remarks should not restate information from the summary, since the summary section\r\n * will always be displayed wherever the remarks section appears. Other sections\r\n * (e.g. an `@example` block) will be shown after the remarks section.\r\n */\r\n public remarksBlock: DocBlock | undefined;\r\n\r\n /**\r\n * The `@privateRemarks` tag starts a block of additional commentary that is not meant\r\n * for an external audience. A documentation tool must omit this content from an\r\n * API reference web site. It should also be omitted when generating a normalized\r\n * *.d.ts file intended for third-party developers.\r\n *\r\n * @remarks\r\n * A similar effect could be accomplished by enclosing content inside CommonMark\r\n * `<!-- -->` comments, or by moving the content into a separate `//` TypeScript comment.\r\n * However, the `@privateRemarks` tag is a more formal convention.\r\n */\r\n public privateRemarks: DocBlock | undefined;\r\n\r\n /**\r\n * If present, this block indicates that an API item is no loner supported and may be\r\n * removed in a future release. The `@deprecated` tag must be followed by a sentence\r\n * describing the recommended alternative. Deprecation recursively applies to members\r\n * of a container. For example, if a class is deprecated, then so are all of its members.\r\n */\r\n public deprecatedBlock: DocBlock | undefined;\r\n\r\n /**\r\n * The collection of parsed `@param` blocks for this doc comment.\r\n */\r\n public readonly params: DocParamCollection;\r\n\r\n /**\r\n * The collection of parsed `@typeParam` blocks for this doc comment.\r\n */\r\n public readonly typeParams: DocParamCollection;\r\n\r\n /**\r\n * The `@returns` block for this doc comment, or undefined if there is not one.\r\n */\r\n public returnsBlock: DocBlock | undefined;\r\n\r\n /**\r\n * If this doc comment contains an `@inheritDoc` tag, it will be extracted and associated\r\n * with the DocComment.\r\n */\r\n public inheritDocTag: DocInheritDocTag | undefined;\r\n\r\n /**\r\n * The modifier tags for this DocComment.\r\n */\r\n public readonly modifierTagSet: StandardModifierTagSet;\r\n\r\n private _seeBlocks: DocBlock[];\r\n private _customBlocks: DocBlock[];\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(parameters: IDocCommentParameters) {\r\n super(parameters);\r\n\r\n this.summarySection = new DocSection({ configuration: this.configuration });\r\n this.remarksBlock = undefined;\r\n this.privateRemarks = undefined;\r\n this.deprecatedBlock = undefined;\r\n this.params = new DocParamCollection({ configuration: this.configuration });\r\n this.typeParams = new DocParamCollection({ configuration: this.configuration });\r\n this.returnsBlock = undefined;\r\n\r\n this.modifierTagSet = new StandardModifierTagSet();\r\n\r\n this._seeBlocks = [];\r\n this._customBlocks = [];\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.Comment;\r\n }\r\n\r\n /**\r\n * The collection of all `@see` DockBlockTag nodes belonging to this doc comment.\r\n */\r\n public get seeBlocks(): ReadonlyArray<DocBlock> {\r\n return this._seeBlocks;\r\n }\r\n\r\n /**\r\n * The collection of all DocBlock nodes belonging to this doc comment.\r\n */\r\n public get customBlocks(): ReadonlyArray<DocBlock> {\r\n return this._customBlocks;\r\n }\r\n\r\n /**\r\n * Append an item to the seeBlocks collection.\r\n * @internal\r\n */\r\n public _appendSeeBlock(block: DocBlock): void {\r\n this._seeBlocks.push(block);\r\n }\r\n\r\n /**\r\n * Append an item to the customBlocks collection.\r\n */\r\n public appendCustomBlock(block: DocBlock): void {\r\n this._customBlocks.push(block);\r\n }\r\n\r\n /** @override */\r\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\r\n return [\r\n this.summarySection,\r\n this.remarksBlock,\r\n this.privateRemarks,\r\n this.deprecatedBlock,\r\n this.params.count > 0 ? this.params : undefined,\r\n this.typeParams.count > 0 ? this.typeParams : undefined,\r\n this.returnsBlock,\r\n ...this.customBlocks,\r\n ...this.seeBlocks,\r\n this.inheritDocTag,\r\n ...this.modifierTagSet.nodes\r\n ];\r\n }\r\n\r\n /**\r\n * Generates a doc comment corresponding to the `DocComment` tree. The output is in a normalized form,\r\n * and may ignore formatting/spacing from the original input.\r\n *\r\n * @remarks\r\n * After parsing a string, and possibly modifying the result, `emitAsTsdoc()` can be used to render the result\r\n * as a doc comment in a normalized format. It can also be used to emit a `DocComment` tree that was constructed\r\n * manually.\r\n *\r\n * This method is provided as convenience for simple use cases. To customize the output, or if you need\r\n * to render into a `StringBuilder`, use the {@link TSDocEmitter} class instead.\r\n */\r\n public emitAsTsdoc(): string {\r\n const stringBuilder: StringBuilder = new StringBuilder();\r\n const emitter: TSDocEmitter = new TSDocEmitter();\r\n emitter.renderComment(stringBuilder, this);\r\n return stringBuilder.toString();\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocDeclarationReference.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocDeclarationReference = void 0;
|
| 6 |
+
const DocNode_1 = require("./DocNode");
|
| 7 |
+
const DocExcerpt_1 = require("./DocExcerpt");
|
| 8 |
+
const StringBuilder_1 = require("../emitters/StringBuilder");
|
| 9 |
+
const TSDocEmitter_1 = require("../emitters/TSDocEmitter");
|
| 10 |
+
/**
|
| 11 |
+
* Represents a declaration reference.
|
| 12 |
+
*
|
| 13 |
+
* @remarks
|
| 14 |
+
* Declaration references are TSDoc expressions used by tags such as `{@link}`
|
| 15 |
+
* or `{@inheritDoc}` that need to refer to another declaration.
|
| 16 |
+
*/
|
| 17 |
+
class DocDeclarationReference extends DocNode_1.DocNode {
|
| 18 |
+
/**
|
| 19 |
+
* Don't call this directly. Instead use {@link TSDocParser}
|
| 20 |
+
* @internal
|
| 21 |
+
*/
|
| 22 |
+
constructor(parameters) {
|
| 23 |
+
super(parameters);
|
| 24 |
+
if (DocNode_1.DocNode.isParsedParameters(parameters)) {
|
| 25 |
+
if (parameters.packageNameExcerpt) {
|
| 26 |
+
this._packageNameExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 27 |
+
configuration: this.configuration,
|
| 28 |
+
excerptKind: DocExcerpt_1.ExcerptKind.DeclarationReference_PackageName,
|
| 29 |
+
content: parameters.packageNameExcerpt
|
| 30 |
+
});
|
| 31 |
+
}
|
| 32 |
+
if (parameters.importPathExcerpt) {
|
| 33 |
+
this._importPathExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 34 |
+
configuration: this.configuration,
|
| 35 |
+
excerptKind: DocExcerpt_1.ExcerptKind.DeclarationReference_ImportPath,
|
| 36 |
+
content: parameters.importPathExcerpt
|
| 37 |
+
});
|
| 38 |
+
}
|
| 39 |
+
if (parameters.importHashExcerpt) {
|
| 40 |
+
this._importHashExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 41 |
+
configuration: this.configuration,
|
| 42 |
+
excerptKind: DocExcerpt_1.ExcerptKind.DeclarationReference_ImportHash,
|
| 43 |
+
content: parameters.importHashExcerpt
|
| 44 |
+
});
|
| 45 |
+
}
|
| 46 |
+
if (parameters.spacingAfterImportHashExcerpt) {
|
| 47 |
+
this._spacingAfterImportHashExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 48 |
+
configuration: this.configuration,
|
| 49 |
+
excerptKind: DocExcerpt_1.ExcerptKind.Spacing,
|
| 50 |
+
content: parameters.spacingAfterImportHashExcerpt
|
| 51 |
+
});
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
else {
|
| 55 |
+
this._packageName = parameters.packageName;
|
| 56 |
+
this._importPath = parameters.importPath;
|
| 57 |
+
}
|
| 58 |
+
this._memberReferences = [];
|
| 59 |
+
if (parameters.memberReferences) {
|
| 60 |
+
this._memberReferences.push(...parameters.memberReferences);
|
| 61 |
+
}
|
| 62 |
+
}
|
| 63 |
+
/** @override */
|
| 64 |
+
get kind() {
|
| 65 |
+
return DocNode_1.DocNodeKind.DeclarationReference;
|
| 66 |
+
}
|
| 67 |
+
/**
|
| 68 |
+
* The optional package name, which may optionally include an NPM scope.
|
| 69 |
+
*
|
| 70 |
+
* Example: `"@scope/my-package"`
|
| 71 |
+
*/
|
| 72 |
+
get packageName() {
|
| 73 |
+
if (this._packageName === undefined) {
|
| 74 |
+
if (this._packageNameExcerpt !== undefined) {
|
| 75 |
+
this._packageName = this._packageNameExcerpt.content.toString();
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
return this._packageName;
|
| 79 |
+
}
|
| 80 |
+
/**
|
| 81 |
+
* The optional import path. If a package name is provided, then if an import path is provided,
|
| 82 |
+
* the path must start with a "/" delimiter; otherwise paths are resolved relative to the source file
|
| 83 |
+
* containing the reference.
|
| 84 |
+
*
|
| 85 |
+
* Example: `"/path1/path2"`
|
| 86 |
+
* Example: `"./path1/path2"`
|
| 87 |
+
* Example: `"../path2/path2"`
|
| 88 |
+
*/
|
| 89 |
+
get importPath() {
|
| 90 |
+
if (this._importPath === undefined) {
|
| 91 |
+
if (this._importPathExcerpt !== undefined) {
|
| 92 |
+
this._importPath = this._importPathExcerpt.content.toString();
|
| 93 |
+
}
|
| 94 |
+
}
|
| 95 |
+
return this._importPath;
|
| 96 |
+
}
|
| 97 |
+
/**
|
| 98 |
+
* The chain of member references that indicate the declaration being referenced.
|
| 99 |
+
* If this list is empty, then either the packageName or importPath must be provided,
|
| 100 |
+
* because the reference refers to a module.
|
| 101 |
+
*/
|
| 102 |
+
get memberReferences() {
|
| 103 |
+
return this._memberReferences;
|
| 104 |
+
}
|
| 105 |
+
/**
|
| 106 |
+
* Generates the TSDoc representation of this declaration reference.
|
| 107 |
+
*/
|
| 108 |
+
emitAsTsdoc() {
|
| 109 |
+
const stringBuilder = new StringBuilder_1.StringBuilder();
|
| 110 |
+
const emitter = new TSDocEmitter_1.TSDocEmitter();
|
| 111 |
+
emitter.renderDeclarationReference(stringBuilder, this);
|
| 112 |
+
return stringBuilder.toString();
|
| 113 |
+
}
|
| 114 |
+
/** @override */
|
| 115 |
+
onGetChildNodes() {
|
| 116 |
+
return [
|
| 117 |
+
this._packageNameExcerpt,
|
| 118 |
+
this._importPathExcerpt,
|
| 119 |
+
this._importHashExcerpt,
|
| 120 |
+
this._spacingAfterImportHashExcerpt,
|
| 121 |
+
...this._memberReferences
|
| 122 |
+
];
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
exports.DocDeclarationReference = DocDeclarationReference;
|
| 126 |
+
//# sourceMappingURL=DocDeclarationReference.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocDeclarationReference.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"DocDeclarationReference.js","sourceRoot":"","sources":["../../src/nodes/DocDeclarationReference.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,uCAAyG;AAGzG,6CAAuD;AACvD,6DAA0D;AAC1D,2DAAwD;AAsBxD;;;;;;GAMG;AACH,MAAa,uBAAwB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EAAE,CAAC;IAClC,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO;YACL,IAAI,CAAC,mBAAmB;YACxB,IAAI,CAAC,kBAAkB;YACvB,IAAI,CAAC,kBAAkB;YACvB,IAAI,CAAC,8BAA8B;YACnC,GAAG,IAAI,CAAC,iBAAiB;SAC1B,CAAC;IACJ,CAAC;CACF;AA/HD,0DA+HC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { DocNode, DocNodeKind, type IDocNodeParameters, type IDocNodeParsedParameters } from './DocNode';\r\nimport type { DocMemberReference } from './DocMemberReference';\r\nimport type { TokenSequence } from '../parser/TokenSequence';\r\nimport { DocExcerpt, ExcerptKind } from './DocExcerpt';\r\nimport { StringBuilder } from '../emitters/StringBuilder';\r\nimport { TSDocEmitter } from '../emitters/TSDocEmitter';\r\n\r\n/**\r\n * Constructor parameters for {@link DocDeclarationReference}.\r\n */\r\nexport interface IDocDeclarationReferenceParameters extends IDocNodeParameters {\r\n packageName?: string;\r\n importPath?: string;\r\n memberReferences?: DocMemberReference[];\r\n}\r\n\r\n/**\r\n * Constructor parameters for {@link DocDeclarationReference}.\r\n */\r\nexport interface IDocDeclarationReferenceParsedParameters extends IDocNodeParsedParameters {\r\n packageNameExcerpt?: TokenSequence;\r\n importPathExcerpt?: TokenSequence;\r\n importHashExcerpt?: TokenSequence;\r\n spacingAfterImportHashExcerpt?: TokenSequence;\r\n memberReferences?: DocMemberReference[];\r\n}\r\n\r\n/**\r\n * Represents a declaration reference.\r\n *\r\n * @remarks\r\n * Declaration references are TSDoc expressions used by tags such as `{@link}`\r\n * or `{@inheritDoc}` that need to refer to another declaration.\r\n */\r\nexport class DocDeclarationReference extends DocNode {\r\n private _packageName: string | undefined;\r\n private readonly _packageNameExcerpt: DocExcerpt | undefined;\r\n\r\n private _importPath: string | undefined;\r\n private readonly _importPathExcerpt: DocExcerpt | undefined;\r\n\r\n private readonly _importHashExcerpt: DocExcerpt | undefined;\r\n private readonly _spacingAfterImportHashExcerpt: DocExcerpt | undefined;\r\n\r\n private readonly _memberReferences: DocMemberReference[];\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(\r\n parameters: IDocDeclarationReferenceParameters | IDocDeclarationReferenceParsedParameters\r\n ) {\r\n super(parameters);\r\n\r\n if (DocNode.isParsedParameters(parameters)) {\r\n if (parameters.packageNameExcerpt) {\r\n this._packageNameExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.DeclarationReference_PackageName,\r\n content: parameters.packageNameExcerpt\r\n });\r\n }\r\n if (parameters.importPathExcerpt) {\r\n this._importPathExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.DeclarationReference_ImportPath,\r\n content: parameters.importPathExcerpt\r\n });\r\n }\r\n if (parameters.importHashExcerpt) {\r\n this._importHashExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.DeclarationReference_ImportHash,\r\n content: parameters.importHashExcerpt\r\n });\r\n }\r\n if (parameters.spacingAfterImportHashExcerpt) {\r\n this._spacingAfterImportHashExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterImportHashExcerpt\r\n });\r\n }\r\n } else {\r\n this._packageName = parameters.packageName;\r\n this._importPath = parameters.importPath;\r\n }\r\n\r\n this._memberReferences = [];\r\n if (parameters.memberReferences) {\r\n this._memberReferences.push(...parameters.memberReferences);\r\n }\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.DeclarationReference;\r\n }\r\n\r\n /**\r\n * The optional package name, which may optionally include an NPM scope.\r\n *\r\n * Example: `\"@scope/my-package\"`\r\n */\r\n public get packageName(): string | undefined {\r\n if (this._packageName === undefined) {\r\n if (this._packageNameExcerpt !== undefined) {\r\n this._packageName = this._packageNameExcerpt.content.toString();\r\n }\r\n }\r\n return this._packageName;\r\n }\r\n\r\n /**\r\n * The optional import path. If a package name is provided, then if an import path is provided,\r\n * the path must start with a \"/\" delimiter; otherwise paths are resolved relative to the source file\r\n * containing the reference.\r\n *\r\n * Example: `\"/path1/path2\"`\r\n * Example: `\"./path1/path2\"`\r\n * Example: `\"../path2/path2\"`\r\n */\r\n public get importPath(): string | undefined {\r\n if (this._importPath === undefined) {\r\n if (this._importPathExcerpt !== undefined) {\r\n this._importPath = this._importPathExcerpt.content.toString();\r\n }\r\n }\r\n return this._importPath;\r\n }\r\n\r\n /**\r\n * The chain of member references that indicate the declaration being referenced.\r\n * If this list is empty, then either the packageName or importPath must be provided,\r\n * because the reference refers to a module.\r\n */\r\n public get memberReferences(): ReadonlyArray<DocMemberReference> {\r\n return this._memberReferences;\r\n }\r\n\r\n /**\r\n * Generates the TSDoc representation of this declaration reference.\r\n */\r\n public emitAsTsdoc(): string {\r\n const stringBuilder: StringBuilder = new StringBuilder();\r\n const emitter: TSDocEmitter = new TSDocEmitter();\r\n emitter.renderDeclarationReference(stringBuilder, this);\r\n return stringBuilder.toString();\r\n }\r\n\r\n /** @override */\r\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\r\n return [\r\n this._packageNameExcerpt,\r\n this._importPathExcerpt,\r\n this._importHashExcerpt,\r\n this._spacingAfterImportHashExcerpt,\r\n ...this._memberReferences\r\n ];\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocErrorText.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocErrorText = void 0;
|
| 6 |
+
const DocNode_1 = require("./DocNode");
|
| 7 |
+
const DocExcerpt_1 = require("./DocExcerpt");
|
| 8 |
+
/**
|
| 9 |
+
* Represents a span of text that contained invalid markup.
|
| 10 |
+
* The characters should be rendered as plain text.
|
| 11 |
+
*/
|
| 12 |
+
class DocErrorText extends DocNode_1.DocNode {
|
| 13 |
+
/**
|
| 14 |
+
* Don't call this directly. Instead use {@link TSDocParser}
|
| 15 |
+
* @internal
|
| 16 |
+
*/
|
| 17 |
+
constructor(parameters) {
|
| 18 |
+
super(parameters);
|
| 19 |
+
this._textExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 20 |
+
configuration: this.configuration,
|
| 21 |
+
excerptKind: DocExcerpt_1.ExcerptKind.ErrorText,
|
| 22 |
+
content: parameters.textExcerpt
|
| 23 |
+
});
|
| 24 |
+
this._messageId = parameters.messageId;
|
| 25 |
+
this._errorMessage = parameters.errorMessage;
|
| 26 |
+
this._errorLocation = parameters.errorLocation;
|
| 27 |
+
}
|
| 28 |
+
/** @override */
|
| 29 |
+
get kind() {
|
| 30 |
+
return DocNode_1.DocNodeKind.ErrorText;
|
| 31 |
+
}
|
| 32 |
+
/**
|
| 33 |
+
* The characters that should be rendered as plain text because they
|
| 34 |
+
* could not be parsed successfully.
|
| 35 |
+
*/
|
| 36 |
+
get text() {
|
| 37 |
+
if (this._text === undefined) {
|
| 38 |
+
this._text = this._textExcerpt.content.toString();
|
| 39 |
+
}
|
| 40 |
+
return this._text;
|
| 41 |
+
}
|
| 42 |
+
get textExcerpt() {
|
| 43 |
+
if (this._textExcerpt) {
|
| 44 |
+
return this._textExcerpt.content;
|
| 45 |
+
}
|
| 46 |
+
else {
|
| 47 |
+
return undefined;
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
/**
|
| 51 |
+
* The TSDoc error message identifier.
|
| 52 |
+
*/
|
| 53 |
+
get messageId() {
|
| 54 |
+
return this._messageId;
|
| 55 |
+
}
|
| 56 |
+
/**
|
| 57 |
+
* A description of why the character could not be parsed.
|
| 58 |
+
*/
|
| 59 |
+
get errorMessage() {
|
| 60 |
+
return this._errorMessage;
|
| 61 |
+
}
|
| 62 |
+
/**
|
| 63 |
+
* The range of characters that caused the error. In general these may be
|
| 64 |
+
* somewhat farther ahead in the input stream from the DocErrorText node itself.
|
| 65 |
+
*
|
| 66 |
+
* @remarks
|
| 67 |
+
* For example, for the malformed HTML tag `<a href="123" @ /a>`, the DocErrorText node
|
| 68 |
+
* will correspond to the `<` character that looked like an HTML tag, whereas the
|
| 69 |
+
* error location might be the `@` character that caused the trouble.
|
| 70 |
+
*/
|
| 71 |
+
get errorLocation() {
|
| 72 |
+
return this._errorLocation;
|
| 73 |
+
}
|
| 74 |
+
/** @override */
|
| 75 |
+
onGetChildNodes() {
|
| 76 |
+
return [this._textExcerpt];
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
exports.DocErrorText = DocErrorText;
|
| 80 |
+
//# sourceMappingURL=DocErrorText.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocErrorText.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 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,aAAa,CAAC;IAC5B,CAAC;IAED;;;;;;;;OAQG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7B,CAAC;CACF;AAjFD,oCAiFC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { DocNodeKind, DocNode, type IDocNodeParsedParameters } from './DocNode';\r\nimport type { TokenSequence } from '../parser/TokenSequence';\r\nimport { DocExcerpt, ExcerptKind } from './DocExcerpt';\r\nimport type { TSDocMessageId } from '../parser/TSDocMessageId';\r\n\r\n/**\r\n * Constructor parameters for {@link DocErrorText}.\r\n */\r\nexport interface IDocErrorTextParsedParameters extends IDocNodeParsedParameters {\r\n textExcerpt: TokenSequence;\r\n\r\n messageId: TSDocMessageId;\r\n errorMessage: string;\r\n errorLocation: TokenSequence;\r\n}\r\n\r\n/**\r\n * Represents a span of text that contained invalid markup.\r\n * The characters should be rendered as plain text.\r\n */\r\nexport class DocErrorText extends DocNode {\r\n private _text: string | undefined;\r\n private readonly _textExcerpt: DocExcerpt;\r\n\r\n private readonly _messageId: TSDocMessageId;\r\n private readonly _errorMessage: string;\r\n private readonly _errorLocation: TokenSequence;\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(parameters: IDocErrorTextParsedParameters) {\r\n super(parameters);\r\n\r\n this._textExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.ErrorText,\r\n content: parameters.textExcerpt\r\n });\r\n\r\n this._messageId = parameters.messageId;\r\n this._errorMessage = parameters.errorMessage;\r\n this._errorLocation = parameters.errorLocation;\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.ErrorText;\r\n }\r\n\r\n /**\r\n * The characters that should be rendered as plain text because they\r\n * could not be parsed successfully.\r\n */\r\n public get text(): string {\r\n if (this._text === undefined) {\r\n this._text = this._textExcerpt.content.toString();\r\n }\r\n return this._text;\r\n }\r\n\r\n public get textExcerpt(): TokenSequence | undefined {\r\n if (this._textExcerpt) {\r\n return this._textExcerpt.content;\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n\r\n /**\r\n * The TSDoc error message identifier.\r\n */\r\n public get messageId(): TSDocMessageId {\r\n return this._messageId;\r\n }\r\n\r\n /**\r\n * A description of why the character could not be parsed.\r\n */\r\n public get errorMessage(): string {\r\n return this._errorMessage;\r\n }\r\n\r\n /**\r\n * The range of characters that caused the error. In general these may be\r\n * somewhat farther ahead in the input stream from the DocErrorText node itself.\r\n *\r\n * @remarks\r\n * For example, for the malformed HTML tag `<a href=\"123\" @ /a>`, the DocErrorText node\r\n * will correspond to the `<` character that looked like an HTML tag, whereas the\r\n * error location might be the `@` character that caused the trouble.\r\n */\r\n public get errorLocation(): TokenSequence {\r\n return this._errorLocation;\r\n }\r\n\r\n /** @override */\r\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\r\n return [this._textExcerpt];\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocEscapedText.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocEscapedText = exports.EscapeStyle = void 0;
|
| 6 |
+
const DocNode_1 = require("./DocNode");
|
| 7 |
+
const DocExcerpt_1 = require("./DocExcerpt");
|
| 8 |
+
/**
|
| 9 |
+
* The style of escaping to be used with DocEscapedText.
|
| 10 |
+
*/
|
| 11 |
+
var EscapeStyle;
|
| 12 |
+
(function (EscapeStyle) {
|
| 13 |
+
/**
|
| 14 |
+
* Use a backslash symbol to escape the character.
|
| 15 |
+
*/
|
| 16 |
+
EscapeStyle[EscapeStyle["CommonMarkBackslash"] = 0] = "CommonMarkBackslash";
|
| 17 |
+
})(EscapeStyle || (exports.EscapeStyle = EscapeStyle = {}));
|
| 18 |
+
/**
|
| 19 |
+
* Represents a text character that should be escaped as a TSDoc symbol.
|
| 20 |
+
* @remarks
|
| 21 |
+
* Note that renders will normally apply appropriate escaping when rendering
|
| 22 |
+
* DocPlainText in a format such as HTML or TSDoc. The DocEscapedText node
|
| 23 |
+
* forces a specific escaping that may not be the default.
|
| 24 |
+
*/
|
| 25 |
+
class DocEscapedText extends DocNode_1.DocNode {
|
| 26 |
+
/**
|
| 27 |
+
* Don't call this directly. Instead use {@link TSDocParser}
|
| 28 |
+
* @internal
|
| 29 |
+
*/
|
| 30 |
+
constructor(parameters) {
|
| 31 |
+
super(parameters);
|
| 32 |
+
this._escapeStyle = parameters.escapeStyle;
|
| 33 |
+
this._encodedTextExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 34 |
+
configuration: this.configuration,
|
| 35 |
+
excerptKind: DocExcerpt_1.ExcerptKind.EscapedText,
|
| 36 |
+
content: parameters.encodedTextExcerpt
|
| 37 |
+
});
|
| 38 |
+
this._decodedText = parameters.decodedText;
|
| 39 |
+
}
|
| 40 |
+
/** @override */
|
| 41 |
+
get kind() {
|
| 42 |
+
return DocNode_1.DocNodeKind.EscapedText;
|
| 43 |
+
}
|
| 44 |
+
/**
|
| 45 |
+
* The style of escaping to be performed.
|
| 46 |
+
*/
|
| 47 |
+
get escapeStyle() {
|
| 48 |
+
return this._escapeStyle;
|
| 49 |
+
}
|
| 50 |
+
/**
|
| 51 |
+
* The text sequence including escapes.
|
| 52 |
+
*/
|
| 53 |
+
get encodedText() {
|
| 54 |
+
if (this._encodedText === undefined) {
|
| 55 |
+
this._encodedText = this._encodedTextExcerpt.content.toString();
|
| 56 |
+
}
|
| 57 |
+
return this._encodedText;
|
| 58 |
+
}
|
| 59 |
+
/**
|
| 60 |
+
* The text without escaping.
|
| 61 |
+
*/
|
| 62 |
+
get decodedText() {
|
| 63 |
+
return this._decodedText;
|
| 64 |
+
}
|
| 65 |
+
/** @override */
|
| 66 |
+
onGetChildNodes() {
|
| 67 |
+
return [this._encodedTextExcerpt];
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
exports.DocEscapedText = DocEscapedText;
|
| 71 |
+
//# sourceMappingURL=DocEscapedText.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocEscapedText.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"DocEscapedText.js","sourceRoot":"","sources":["../../src/nodes/DocEscapedText.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,uCAAgF;AAChF,6CAAuD;AAYvD;;GAEG;AACH,IAAY,WAKX;AALD,WAAY,WAAW;IACrB;;OAEG;IACH,2EAAmB,CAAA;AACrB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED;;;;;;GAMG;AACH,MAAa,cAAe,SAAQ,iBAAO;IAQzC;;;OAGG;IACH,YAAmB,UAA2C;QAC5D,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,WAAW,CAAC;QAE3C,IAAI,CAAC,mBAAmB,GAAG,IAAI,uBAAU,CAAC;YACxC,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,wBAAW,CAAC,WAAW;YACpC,OAAO,EAAE,UAAU,CAAC,kBAAkB;SACvC,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,WAAW,CAAC;IAC7C,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,qBAAW,CAAC,WAAW,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QACpB,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAClE,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACpC,CAAC;CACF;AA3DD,wCA2DC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { DocNodeKind, type IDocNodeParsedParameters, DocNode } from './DocNode';\r\nimport { DocExcerpt, ExcerptKind } from './DocExcerpt';\r\nimport type { TokenSequence } from '../parser/TokenSequence';\r\n\r\n/**\r\n * Constructor parameters for {@link DocEscapedText}.\r\n */\r\nexport interface IDocEscapedTextParsedParameters extends IDocNodeParsedParameters {\r\n escapeStyle: EscapeStyle;\r\n encodedTextExcerpt: TokenSequence;\r\n decodedText: string;\r\n}\r\n\r\n/**\r\n * The style of escaping to be used with DocEscapedText.\r\n */\r\nexport enum EscapeStyle {\r\n /**\r\n * Use a backslash symbol to escape the character.\r\n */\r\n CommonMarkBackslash\r\n}\r\n\r\n/**\r\n * Represents a text character that should be escaped as a TSDoc symbol.\r\n * @remarks\r\n * Note that renders will normally apply appropriate escaping when rendering\r\n * DocPlainText in a format such as HTML or TSDoc. The DocEscapedText node\r\n * forces a specific escaping that may not be the default.\r\n */\r\nexport class DocEscapedText extends DocNode {\r\n private readonly _escapeStyle: EscapeStyle;\r\n\r\n private _encodedText: string | undefined;\r\n private readonly _encodedTextExcerpt: DocExcerpt;\r\n\r\n private readonly _decodedText: string;\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(parameters: IDocEscapedTextParsedParameters) {\r\n super(parameters);\r\n\r\n this._escapeStyle = parameters.escapeStyle;\r\n\r\n this._encodedTextExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.EscapedText,\r\n content: parameters.encodedTextExcerpt\r\n });\r\n\r\n this._decodedText = parameters.decodedText;\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.EscapedText;\r\n }\r\n\r\n /**\r\n * The style of escaping to be performed.\r\n */\r\n public get escapeStyle(): EscapeStyle {\r\n return this._escapeStyle;\r\n }\r\n\r\n /**\r\n * The text sequence including escapes.\r\n */\r\n public get encodedText(): string {\r\n if (this._encodedText === undefined) {\r\n this._encodedText = this._encodedTextExcerpt.content.toString();\r\n }\r\n return this._encodedText;\r\n }\r\n\r\n /**\r\n * The text without escaping.\r\n */\r\n public get decodedText(): string {\r\n return this._decodedText;\r\n }\r\n\r\n /** @override */\r\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\r\n return [this._encodedTextExcerpt];\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocExcerpt.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocExcerpt = exports.ExcerptKind = void 0;
|
| 6 |
+
const DocNode_1 = require("./DocNode");
|
| 7 |
+
const Token_1 = require("../parser/Token");
|
| 8 |
+
/* eslint-disable @typescript-eslint/naming-convention */
|
| 9 |
+
/**
|
| 10 |
+
* Indicates the type of {@link DocExcerpt}.
|
| 11 |
+
*/
|
| 12 |
+
var ExcerptKind;
|
| 13 |
+
(function (ExcerptKind) {
|
| 14 |
+
ExcerptKind["Spacing"] = "Spacing";
|
| 15 |
+
ExcerptKind["BlockTag"] = "BlockTag";
|
| 16 |
+
ExcerptKind["CodeSpan_OpeningDelimiter"] = "CodeSpan_OpeningDelimiter";
|
| 17 |
+
ExcerptKind["CodeSpan_Code"] = "CodeSpan_Code";
|
| 18 |
+
ExcerptKind["CodeSpan_ClosingDelimiter"] = "CodeSpan_ClosingDelimiter";
|
| 19 |
+
ExcerptKind["DeclarationReference_PackageName"] = "DeclarationReference_PackageName";
|
| 20 |
+
ExcerptKind["DeclarationReference_ImportPath"] = "DeclarationReference_ImportPath";
|
| 21 |
+
ExcerptKind["DeclarationReference_ImportHash"] = "DeclarationReference_ImportHash";
|
| 22 |
+
/**
|
| 23 |
+
* Input characters that were reported as an error and do not appear to be part of a valid expression.
|
| 24 |
+
* A syntax highlighter might display them with an error color (e.g. red).
|
| 25 |
+
*/
|
| 26 |
+
ExcerptKind["ErrorText"] = "ErrorText";
|
| 27 |
+
/**
|
| 28 |
+
* Input characters that do not conform to the TSDoc specification, but were recognized by the parser, for example
|
| 29 |
+
* as a known JSDoc pattern. A syntax highlighter should not display them with an error color (e.g. red)
|
| 30 |
+
* because the error reporting may be suppressed for "lax" parsing of legacy source code.
|
| 31 |
+
*/
|
| 32 |
+
ExcerptKind["NonstandardText"] = "NonstandardText";
|
| 33 |
+
ExcerptKind["EscapedText"] = "EscapedText";
|
| 34 |
+
ExcerptKind["FencedCode_OpeningFence"] = "FencedCode_OpeningFence";
|
| 35 |
+
ExcerptKind["FencedCode_Language"] = "FencedCode_Language";
|
| 36 |
+
ExcerptKind["FencedCode_Code"] = "FencedCode_Code";
|
| 37 |
+
ExcerptKind["FencedCode_ClosingFence"] = "FencedCode_ClosingFence";
|
| 38 |
+
ExcerptKind["HtmlAttribute_Name"] = "HtmlAttribute_Name";
|
| 39 |
+
ExcerptKind["HtmlAttribute_Equals"] = "HtmlAttribute_Equals";
|
| 40 |
+
ExcerptKind["HtmlAttribute_Value"] = "HtmlAttribute_Value";
|
| 41 |
+
ExcerptKind["HtmlEndTag_OpeningDelimiter"] = "HtmlEndTag_OpeningDelimiter";
|
| 42 |
+
ExcerptKind["HtmlEndTag_Name"] = "HtmlEndTag_Name";
|
| 43 |
+
ExcerptKind["HtmlEndTag_ClosingDelimiter"] = "HtmlEndTag_ClosingDelimiter";
|
| 44 |
+
ExcerptKind["HtmlStartTag_OpeningDelimiter"] = "HtmlStartTag_OpeningDelimiter";
|
| 45 |
+
ExcerptKind["HtmlStartTag_Name"] = "HtmlStartTag_Name";
|
| 46 |
+
ExcerptKind["HtmlStartTag_ClosingDelimiter"] = "HtmlStartTag_ClosingDelimiter";
|
| 47 |
+
ExcerptKind["InlineTag_OpeningDelimiter"] = "InlineTag_OpeningDelimiter";
|
| 48 |
+
ExcerptKind["InlineTag_TagName"] = "InlineTag_TagName";
|
| 49 |
+
ExcerptKind["InlineTag_TagContent"] = "InlineTag_TagContent";
|
| 50 |
+
ExcerptKind["InlineTag_ClosingDelimiter"] = "InlineTag_ClosingDelimiter";
|
| 51 |
+
ExcerptKind["LinkTag_UrlDestination"] = "LinkTag_UrlDestination";
|
| 52 |
+
ExcerptKind["LinkTag_Pipe"] = "LinkTag_Pipe";
|
| 53 |
+
ExcerptKind["LinkTag_LinkText"] = "LinkTag_LinkText";
|
| 54 |
+
ExcerptKind["MemberIdentifier_LeftQuote"] = "MemberIdentifier_LeftQuote";
|
| 55 |
+
ExcerptKind["MemberIdentifier_Identifier"] = "MemberIdentifier_Identifier";
|
| 56 |
+
ExcerptKind["MemberIdentifier_RightQuote"] = "MemberIdentifier_RightQuote";
|
| 57 |
+
ExcerptKind["MemberReference_Dot"] = "MemberReference_Dot";
|
| 58 |
+
ExcerptKind["MemberReference_LeftParenthesis"] = "MemberReference_LeftParenthesis";
|
| 59 |
+
ExcerptKind["MemberReference_Colon"] = "MemberReference_Colon";
|
| 60 |
+
ExcerptKind["MemberReference_RightParenthesis"] = "MemberReference_RightParenthesis";
|
| 61 |
+
ExcerptKind["MemberSelector"] = "MemberSelector";
|
| 62 |
+
ExcerptKind["DocMemberSymbol_LeftBracket"] = "DocMemberSymbol_LeftBracket";
|
| 63 |
+
ExcerptKind["DocMemberSymbol_RightBracket"] = "DocMemberSymbol_RightBracket";
|
| 64 |
+
ExcerptKind["ParamBlock_ParameterName"] = "ParamBlock_ParameterName";
|
| 65 |
+
ExcerptKind["ParamBlock_Hyphen"] = "ParamBlock_Hyphen";
|
| 66 |
+
ExcerptKind["PlainText"] = "PlainText";
|
| 67 |
+
ExcerptKind["SoftBreak"] = "SoftBreak";
|
| 68 |
+
})(ExcerptKind || (exports.ExcerptKind = ExcerptKind = {}));
|
| 69 |
+
/**
|
| 70 |
+
* Represents a parsed token sequence.
|
| 71 |
+
*
|
| 72 |
+
* @remarks
|
| 73 |
+
* When a `DocNode` is created by parsing a doc comment, it will have `DocExcerpt` child nodes corresponding to
|
| 74 |
+
* the parsed syntax elements such as names, keywords, punctuation, and spaces. These excerpts indicate the original
|
| 75 |
+
* coordinates of the syntax element, and thus can be used for syntax highlighting and precise error reporting.
|
| 76 |
+
* They could also be used to rewrite specific words in a source file (e.g. renaming a parameter) without disturbing
|
| 77 |
+
* any other characters in the file.
|
| 78 |
+
*
|
| 79 |
+
* Every parsed character will correspond to at most one DocExcerpt object. In other words, excerpts never overlap.
|
| 80 |
+
* A given excerpt can span multiple comment lines, and it may contain gaps, for example to skip the `*` character
|
| 81 |
+
* that starts a new TSDoc comment line.
|
| 82 |
+
*/
|
| 83 |
+
class DocExcerpt extends DocNode_1.DocNode {
|
| 84 |
+
/**
|
| 85 |
+
* Don't call this directly. Instead use {@link TSDocParser}
|
| 86 |
+
* @internal
|
| 87 |
+
*/
|
| 88 |
+
constructor(parameters) {
|
| 89 |
+
super(parameters);
|
| 90 |
+
if (parameters.excerptKind === ExcerptKind.Spacing) {
|
| 91 |
+
for (const token of parameters.content.tokens) {
|
| 92 |
+
switch (token.kind) {
|
| 93 |
+
case Token_1.TokenKind.Spacing:
|
| 94 |
+
case Token_1.TokenKind.Newline:
|
| 95 |
+
case Token_1.TokenKind.EndOfInput:
|
| 96 |
+
break;
|
| 97 |
+
default:
|
| 98 |
+
throw new Error(`The excerptKind=Spacing but the range contains a non-whitespace token`);
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
this._excerptKind = parameters.excerptKind;
|
| 103 |
+
this._content = parameters.content;
|
| 104 |
+
}
|
| 105 |
+
/** @override */
|
| 106 |
+
get kind() {
|
| 107 |
+
return DocNode_1.DocNodeKind.Excerpt;
|
| 108 |
+
}
|
| 109 |
+
/**
|
| 110 |
+
* Indicates the kind of DocExcerpt.
|
| 111 |
+
*/
|
| 112 |
+
get excerptKind() {
|
| 113 |
+
return this._excerptKind;
|
| 114 |
+
}
|
| 115 |
+
/**
|
| 116 |
+
* The input token sequence corresponding to this excerpt.
|
| 117 |
+
* @remarks
|
| 118 |
+
* Note that a token sequence can span multiple input lines and may contain gaps, for example to skip the `*`
|
| 119 |
+
* character that starts a new TSDoc comment line.
|
| 120 |
+
*/
|
| 121 |
+
get content() {
|
| 122 |
+
return this._content;
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
exports.DocExcerpt = DocExcerpt;
|
| 126 |
+
//# sourceMappingURL=DocExcerpt.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocExcerpt.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"DocExcerpt.js","sourceRoot":"","sources":["../../src/nodes/DocExcerpt.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3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UAAU,CAAC,CAAC;QAElB,IAAI,UAAU,CAAC,WAAW,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC;YACnD,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,OAAQ,CAAC,MAAM,EAAE,CAAC;gBAC/C,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;oBACnB,KAAK,iBAAS,CAAC,OAAO,CAAC;oBACvB,KAAK,iBAAS,CAAC,OAAO,CAAC;oBACvB,KAAK,iBAAS,CAAC,UAAU;wBACvB,MAAM;oBACR;wBACE,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;gBAC7F,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,WAAW,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC;IACrC,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,qBAAW,CAAC,OAAO,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAjDD,gCAiDC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { DocNode, type IDocNodeParameters, DocNodeKind } from './DocNode';\r\nimport type { TokenSequence } from '../parser/TokenSequence';\r\nimport { TokenKind } from '../parser/Token';\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\n/**\r\n * Indicates the type of {@link DocExcerpt}.\r\n */\r\nexport enum ExcerptKind {\r\n Spacing = 'Spacing',\r\n\r\n BlockTag = 'BlockTag',\r\n\r\n CodeSpan_OpeningDelimiter = 'CodeSpan_OpeningDelimiter',\r\n CodeSpan_Code = 'CodeSpan_Code',\r\n CodeSpan_ClosingDelimiter = 'CodeSpan_ClosingDelimiter',\r\n\r\n DeclarationReference_PackageName = 'DeclarationReference_PackageName',\r\n DeclarationReference_ImportPath = 'DeclarationReference_ImportPath',\r\n DeclarationReference_ImportHash = 'DeclarationReference_ImportHash',\r\n\r\n /**\r\n * Input characters that were reported as an error and do not appear to be part of a valid expression.\r\n * A syntax highlighter might display them with an error color (e.g. red).\r\n */\r\n ErrorText = 'ErrorText',\r\n\r\n /**\r\n * Input characters that do not conform to the TSDoc specification, but were recognized by the parser, for example\r\n * as a known JSDoc pattern. A syntax highlighter should not display them with an error color (e.g. red)\r\n * because the error reporting may be suppressed for \"lax\" parsing of legacy source code.\r\n */\r\n NonstandardText = 'NonstandardText',\r\n\r\n EscapedText = 'EscapedText',\r\n\r\n FencedCode_OpeningFence = 'FencedCode_OpeningFence',\r\n FencedCode_Language = 'FencedCode_Language',\r\n FencedCode_Code = 'FencedCode_Code',\r\n FencedCode_ClosingFence = 'FencedCode_ClosingFence',\r\n\r\n HtmlAttribute_Name = 'HtmlAttribute_Name',\r\n HtmlAttribute_Equals = 'HtmlAttribute_Equals',\r\n HtmlAttribute_Value = 'HtmlAttribute_Value',\r\n\r\n HtmlEndTag_OpeningDelimiter = 'HtmlEndTag_OpeningDelimiter',\r\n HtmlEndTag_Name = 'HtmlEndTag_Name',\r\n HtmlEndTag_ClosingDelimiter = 'HtmlEndTag_ClosingDelimiter',\r\n\r\n HtmlStartTag_OpeningDelimiter = 'HtmlStartTag_OpeningDelimiter',\r\n HtmlStartTag_Name = 'HtmlStartTag_Name',\r\n HtmlStartTag_ClosingDelimiter = 'HtmlStartTag_ClosingDelimiter',\r\n\r\n InlineTag_OpeningDelimiter = 'InlineTag_OpeningDelimiter',\r\n InlineTag_TagName = 'InlineTag_TagName',\r\n InlineTag_TagContent = 'InlineTag_TagContent',\r\n InlineTag_ClosingDelimiter = 'InlineTag_ClosingDelimiter',\r\n\r\n LinkTag_UrlDestination = 'LinkTag_UrlDestination',\r\n LinkTag_Pipe = 'LinkTag_Pipe',\r\n LinkTag_LinkText = 'LinkTag_LinkText',\r\n\r\n MemberIdentifier_LeftQuote = 'MemberIdentifier_LeftQuote',\r\n MemberIdentifier_Identifier = 'MemberIdentifier_Identifier',\r\n MemberIdentifier_RightQuote = 'MemberIdentifier_RightQuote',\r\n\r\n MemberReference_Dot = 'MemberReference_Dot',\r\n MemberReference_LeftParenthesis = 'MemberReference_LeftParenthesis',\r\n MemberReference_Colon = 'MemberReference_Colon',\r\n MemberReference_RightParenthesis = 'MemberReference_RightParenthesis',\r\n\r\n MemberSelector = 'MemberSelector',\r\n\r\n DocMemberSymbol_LeftBracket = 'DocMemberSymbol_LeftBracket',\r\n DocMemberSymbol_RightBracket = 'DocMemberSymbol_RightBracket',\r\n\r\n ParamBlock_ParameterName = 'ParamBlock_ParameterName',\r\n ParamBlock_Hyphen = 'ParamBlock_Hyphen',\r\n\r\n PlainText = 'PlainText',\r\n\r\n SoftBreak = 'SoftBreak'\r\n}\r\n\r\n/* eslint-enable @typescript-eslint/naming-convention */\r\n\r\n/**\r\n * Constructor parameters for {@link DocExcerpt}.\r\n */\r\nexport interface IDocExcerptParameters extends IDocNodeParameters {\r\n excerptKind: ExcerptKind;\r\n content: TokenSequence;\r\n}\r\n\r\n/**\r\n * Represents a parsed token sequence.\r\n *\r\n * @remarks\r\n * When a `DocNode` is created by parsing a doc comment, it will have `DocExcerpt` child nodes corresponding to\r\n * the parsed syntax elements such as names, keywords, punctuation, and spaces. These excerpts indicate the original\r\n * coordinates of the syntax element, and thus can be used for syntax highlighting and precise error reporting.\r\n * They could also be used to rewrite specific words in a source file (e.g. renaming a parameter) without disturbing\r\n * any other characters in the file.\r\n *\r\n * Every parsed character will correspond to at most one DocExcerpt object. In other words, excerpts never overlap.\r\n * A given excerpt can span multiple comment lines, and it may contain gaps, for example to skip the `*` character\r\n * that starts a new TSDoc comment line.\r\n */\r\nexport class DocExcerpt extends DocNode {\r\n private readonly _excerptKind: ExcerptKind;\r\n private readonly _content: TokenSequence;\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(parameters: IDocExcerptParameters) {\r\n super(parameters);\r\n\r\n if (parameters.excerptKind === ExcerptKind.Spacing) {\r\n for (const token of parameters.content!.tokens) {\r\n switch (token.kind) {\r\n case TokenKind.Spacing:\r\n case TokenKind.Newline:\r\n case TokenKind.EndOfInput:\r\n break;\r\n default:\r\n throw new Error(`The excerptKind=Spacing but the range contains a non-whitespace token`);\r\n }\r\n }\r\n }\r\n\r\n this._excerptKind = parameters.excerptKind;\r\n this._content = parameters.content;\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.Excerpt;\r\n }\r\n\r\n /**\r\n * Indicates the kind of DocExcerpt.\r\n */\r\n public get excerptKind(): ExcerptKind {\r\n return this._excerptKind;\r\n }\r\n\r\n /**\r\n * The input token sequence corresponding to this excerpt.\r\n * @remarks\r\n * Note that a token sequence can span multiple input lines and may contain gaps, for example to skip the `*`\r\n * character that starts a new TSDoc comment line.\r\n */\r\n public get content(): TokenSequence {\r\n return this._content;\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocFencedCode.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocFencedCode = void 0;
|
| 6 |
+
const DocNode_1 = require("./DocNode");
|
| 7 |
+
const DocExcerpt_1 = require("./DocExcerpt");
|
| 8 |
+
/**
|
| 9 |
+
* Represents CommonMark-style code fence, i.e. a block of program code that
|
| 10 |
+
* starts and ends with a line comprised of three backticks. The opening delimiter
|
| 11 |
+
* can also specify a language for a syntax highlighter.
|
| 12 |
+
*/
|
| 13 |
+
class DocFencedCode extends DocNode_1.DocNode {
|
| 14 |
+
/**
|
| 15 |
+
* Don't call this directly. Instead use {@link TSDocParser}
|
| 16 |
+
* @internal
|
| 17 |
+
*/
|
| 18 |
+
constructor(parameters) {
|
| 19 |
+
super(parameters);
|
| 20 |
+
if (DocNode_1.DocNode.isParsedParameters(parameters)) {
|
| 21 |
+
this._openingFenceExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 22 |
+
configuration: this.configuration,
|
| 23 |
+
excerptKind: DocExcerpt_1.ExcerptKind.FencedCode_OpeningFence,
|
| 24 |
+
content: parameters.openingFenceExcerpt
|
| 25 |
+
});
|
| 26 |
+
if (parameters.spacingAfterOpeningFenceExcerpt) {
|
| 27 |
+
this._spacingAfterOpeningFenceExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 28 |
+
configuration: this.configuration,
|
| 29 |
+
excerptKind: DocExcerpt_1.ExcerptKind.Spacing,
|
| 30 |
+
content: parameters.spacingAfterOpeningFenceExcerpt
|
| 31 |
+
});
|
| 32 |
+
}
|
| 33 |
+
if (parameters.languageExcerpt) {
|
| 34 |
+
this._languageExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 35 |
+
configuration: this.configuration,
|
| 36 |
+
excerptKind: DocExcerpt_1.ExcerptKind.FencedCode_Language,
|
| 37 |
+
content: parameters.languageExcerpt
|
| 38 |
+
});
|
| 39 |
+
}
|
| 40 |
+
if (parameters.spacingAfterLanguageExcerpt) {
|
| 41 |
+
this._spacingAfterLanguageExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 42 |
+
configuration: this.configuration,
|
| 43 |
+
excerptKind: DocExcerpt_1.ExcerptKind.Spacing,
|
| 44 |
+
content: parameters.spacingAfterLanguageExcerpt
|
| 45 |
+
});
|
| 46 |
+
}
|
| 47 |
+
this._codeExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 48 |
+
configuration: this.configuration,
|
| 49 |
+
excerptKind: DocExcerpt_1.ExcerptKind.FencedCode_Code,
|
| 50 |
+
content: parameters.codeExcerpt
|
| 51 |
+
});
|
| 52 |
+
if (parameters.spacingBeforeClosingFenceExcerpt) {
|
| 53 |
+
this._spacingBeforeClosingFenceExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 54 |
+
configuration: this.configuration,
|
| 55 |
+
excerptKind: DocExcerpt_1.ExcerptKind.Spacing,
|
| 56 |
+
content: parameters.spacingBeforeClosingFenceExcerpt
|
| 57 |
+
});
|
| 58 |
+
}
|
| 59 |
+
this._closingFenceExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 60 |
+
configuration: this.configuration,
|
| 61 |
+
excerptKind: DocExcerpt_1.ExcerptKind.FencedCode_ClosingFence,
|
| 62 |
+
content: parameters.closingFenceExcerpt
|
| 63 |
+
});
|
| 64 |
+
if (parameters.spacingAfterClosingFenceExcerpt) {
|
| 65 |
+
this._spacingAfterClosingFenceExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 66 |
+
configuration: this.configuration,
|
| 67 |
+
excerptKind: DocExcerpt_1.ExcerptKind.Spacing,
|
| 68 |
+
content: parameters.spacingAfterClosingFenceExcerpt
|
| 69 |
+
});
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
else {
|
| 73 |
+
this._code = parameters.code;
|
| 74 |
+
this._language = parameters.language;
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
/** @override */
|
| 78 |
+
get kind() {
|
| 79 |
+
return DocNode_1.DocNodeKind.FencedCode;
|
| 80 |
+
}
|
| 81 |
+
/**
|
| 82 |
+
* A name that can optionally be included after the opening code fence delimiter,
|
| 83 |
+
* on the same line as the three backticks. This name indicates the programming language
|
| 84 |
+
* for the code, which a syntax highlighter may use to style the code block.
|
| 85 |
+
*
|
| 86 |
+
* @remarks
|
| 87 |
+
* The TSDoc standard requires that the language "ts" should be interpreted to mean TypeScript.
|
| 88 |
+
* Other languages names may be supported, but this is implementation dependent.
|
| 89 |
+
*
|
| 90 |
+
* CommonMark refers to this field as the "info string".
|
| 91 |
+
*
|
| 92 |
+
* @privateRemarks
|
| 93 |
+
* Examples of language strings supported by GitHub flavored markdown:
|
| 94 |
+
* https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml
|
| 95 |
+
*/
|
| 96 |
+
get language() {
|
| 97 |
+
if (this._language === undefined) {
|
| 98 |
+
if (this._languageExcerpt !== undefined) {
|
| 99 |
+
this._language = this._languageExcerpt.content.toString();
|
| 100 |
+
}
|
| 101 |
+
else {
|
| 102 |
+
this._language = '';
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
return this._language;
|
| 106 |
+
}
|
| 107 |
+
/**
|
| 108 |
+
* The text that should be rendered as code.
|
| 109 |
+
*/
|
| 110 |
+
get code() {
|
| 111 |
+
if (this._code === undefined) {
|
| 112 |
+
if (this._codeExcerpt !== undefined) {
|
| 113 |
+
this._code = this._codeExcerpt.content.toString();
|
| 114 |
+
}
|
| 115 |
+
}
|
| 116 |
+
return this._code;
|
| 117 |
+
}
|
| 118 |
+
/** @override */
|
| 119 |
+
onGetChildNodes() {
|
| 120 |
+
return [
|
| 121 |
+
this._openingFenceExcerpt,
|
| 122 |
+
this._spacingAfterOpeningFenceExcerpt,
|
| 123 |
+
this._languageExcerpt,
|
| 124 |
+
this._spacingAfterLanguageExcerpt,
|
| 125 |
+
this._codeExcerpt,
|
| 126 |
+
this._spacingBeforeClosingFenceExcerpt,
|
| 127 |
+
this._closingFenceExcerpt,
|
| 128 |
+
this._spacingAfterClosingFenceExcerpt
|
| 129 |
+
];
|
| 130 |
+
}
|
| 131 |
+
}
|
| 132 |
+
exports.DocFencedCode = DocFencedCode;
|
| 133 |
+
//# sourceMappingURL=DocFencedCode.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocFencedCode.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"DocFencedCode.js","sourceRoot":"","sources":["../../src/nodes/DocFencedCode.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,uCAAyG;AAEzG,6CAAuD;AA4BvD;;;;GAIG;AACH,MAAa,aAAc,SAAQ,iBAAO;IAuBxC;;;OAGG;IACH,YAAmB,UAAqE;QACtF,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,iBAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,oBAAoB,GAAG,IA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AAK,SAAS,EAAE,CAAC;gBACpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACpD,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,KAAM,CAAC;IACrB,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO;YACL,IAAI,CAAC,oBAAoB;YACzB,IAAI,CAAC,gCAAgC;YAErC,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,4BAA4B;YAEjC,IAAI,CAAC,YAAY;YAEjB,IAAI,CAAC,iCAAiC;YACtC,IAAI,CAAC,oBAAoB;YACzB,IAAI,CAAC,gCAAgC;SACtC,CAAC;IACJ,CAAC;CACF;AArJD,sCAqJC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { DocNodeKind, type IDocNodeParameters, DocNode, type IDocNodeParsedParameters } from './DocNode';\r\nimport type { TokenSequence } from '../parser/TokenSequence';\r\nimport { DocExcerpt, ExcerptKind } from './DocExcerpt';\r\n\r\n/**\r\n * Constructor parameters for {@link DocFencedCode}.\r\n */\r\nexport interface IDocFencedCodeParameters extends IDocNodeParameters {\r\n language: string;\r\n\r\n code: string;\r\n}\r\n\r\n/**\r\n * Constructor parameters for {@link DocFencedCode}.\r\n */\r\nexport interface IDocFencedCodeParsedParameters extends IDocNodeParsedParameters {\r\n openingFenceExcerpt: TokenSequence;\r\n spacingAfterOpeningFenceExcerpt?: TokenSequence;\r\n\r\n languageExcerpt?: TokenSequence;\r\n spacingAfterLanguageExcerpt?: TokenSequence;\r\n\r\n codeExcerpt: TokenSequence;\r\n\r\n spacingBeforeClosingFenceExcerpt?: TokenSequence;\r\n closingFenceExcerpt: TokenSequence;\r\n spacingAfterClosingFenceExcerpt?: TokenSequence;\r\n}\r\n\r\n/**\r\n * Represents CommonMark-style code fence, i.e. a block of program code that\r\n * starts and ends with a line comprised of three backticks. The opening delimiter\r\n * can also specify a language for a syntax highlighter.\r\n */\r\nexport class DocFencedCode extends DocNode {\r\n // The opening ``` delimiter and padding\r\n private readonly _openingFenceExcerpt: DocExcerpt | undefined;\r\n\r\n private readonly _spacingAfterOpeningFenceExcerpt: DocExcerpt | undefined;\r\n\r\n // The optional language string\r\n private _language: string | undefined;\r\n private readonly _languageExcerpt: DocExcerpt | undefined;\r\n\r\n private readonly _spacingAfterLanguageExcerpt: DocExcerpt | undefined;\r\n\r\n // The code content\r\n private _code: string | undefined;\r\n private readonly _codeExcerpt: DocExcerpt | undefined;\r\n\r\n // The closing ``` delimiter and padding\r\n private readonly _spacingBeforeClosingFenceExcerpt: DocExcerpt | undefined;\r\n\r\n private readonly _closingFenceExcerpt: DocExcerpt | undefined;\r\n\r\n private readonly _spacingAfterClosingFenceExcerpt: DocExcerpt | undefined;\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(parameters: IDocFencedCodeParameters | IDocFencedCodeParsedParameters) {\r\n super(parameters);\r\n\r\n if (DocNode.isParsedParameters(parameters)) {\r\n this._openingFenceExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.FencedCode_OpeningFence,\r\n content: parameters.openingFenceExcerpt\r\n });\r\n if (parameters.spacingAfterOpeningFenceExcerpt) {\r\n this._spacingAfterOpeningFenceExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterOpeningFenceExcerpt\r\n });\r\n }\r\n\r\n if (parameters.languageExcerpt) {\r\n this._languageExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.FencedCode_Language,\r\n content: parameters.languageExcerpt\r\n });\r\n }\r\n if (parameters.spacingAfterLanguageExcerpt) {\r\n this._spacingAfterLanguageExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterLanguageExcerpt\r\n });\r\n }\r\n\r\n this._codeExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.FencedCode_Code,\r\n content: parameters.codeExcerpt\r\n });\r\n\r\n if (parameters.spacingBeforeClosingFenceExcerpt) {\r\n this._spacingBeforeClosingFenceExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingBeforeClosingFenceExcerpt\r\n });\r\n }\r\n this._closingFenceExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.FencedCode_ClosingFence,\r\n content: parameters.closingFenceExcerpt\r\n });\r\n if (parameters.spacingAfterClosingFenceExcerpt) {\r\n this._spacingAfterClosingFenceExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterClosingFenceExcerpt\r\n });\r\n }\r\n } else {\r\n this._code = parameters.code;\r\n this._language = parameters.language;\r\n }\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.FencedCode;\r\n }\r\n\r\n /**\r\n * A name that can optionally be included after the opening code fence delimiter,\r\n * on the same line as the three backticks. This name indicates the programming language\r\n * for the code, which a syntax highlighter may use to style the code block.\r\n *\r\n * @remarks\r\n * The TSDoc standard requires that the language \"ts\" should be interpreted to mean TypeScript.\r\n * Other languages names may be supported, but this is implementation dependent.\r\n *\r\n * CommonMark refers to this field as the \"info string\".\r\n *\r\n * @privateRemarks\r\n * Examples of language strings supported by GitHub flavored markdown:\r\n * https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml\r\n */\r\n public get language(): string | 'ts' | '' {\r\n if (this._language === undefined) {\r\n if (this._languageExcerpt !== undefined) {\r\n this._language = this._languageExcerpt.content.toString();\r\n } else {\r\n this._language = '';\r\n }\r\n }\r\n return this._language;\r\n }\r\n\r\n /**\r\n * The text that should be rendered as code.\r\n */\r\n public get code(): string {\r\n if (this._code === undefined) {\r\n if (this._codeExcerpt !== undefined) {\r\n this._code = this._codeExcerpt.content.toString();\r\n }\r\n }\r\n return this._code!;\r\n }\r\n\r\n /** @override */\r\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\r\n return [\r\n this._openingFenceExcerpt,\r\n this._spacingAfterOpeningFenceExcerpt,\r\n\r\n this._languageExcerpt,\r\n this._spacingAfterLanguageExcerpt,\r\n\r\n this._codeExcerpt,\r\n\r\n this._spacingBeforeClosingFenceExcerpt,\r\n this._closingFenceExcerpt,\r\n this._spacingAfterClosingFenceExcerpt\r\n ];\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocHtmlAttribute.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocHtmlAttribute = void 0;
|
| 6 |
+
const DocNode_1 = require("./DocNode");
|
| 7 |
+
const DocExcerpt_1 = require("./DocExcerpt");
|
| 8 |
+
/**
|
| 9 |
+
* Represents an HTML attribute inside a DocHtmlStartTag or DocHtmlEndTag.
|
| 10 |
+
*
|
| 11 |
+
* Example: `href="#"` inside `<a href="#" />`
|
| 12 |
+
*/
|
| 13 |
+
class DocHtmlAttribute extends DocNode_1.DocNode {
|
| 14 |
+
/**
|
| 15 |
+
* Don't call this directly. Instead use {@link TSDocParser}
|
| 16 |
+
* @internal
|
| 17 |
+
*/
|
| 18 |
+
constructor(parameters) {
|
| 19 |
+
super(parameters);
|
| 20 |
+
if (DocNode_1.DocNode.isParsedParameters(parameters)) {
|
| 21 |
+
this._nameExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 22 |
+
configuration: this.configuration,
|
| 23 |
+
excerptKind: DocExcerpt_1.ExcerptKind.HtmlAttribute_Name,
|
| 24 |
+
content: parameters.nameExcerpt
|
| 25 |
+
});
|
| 26 |
+
if (parameters.spacingAfterNameExcerpt) {
|
| 27 |
+
this._spacingAfterNameExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 28 |
+
configuration: this.configuration,
|
| 29 |
+
excerptKind: DocExcerpt_1.ExcerptKind.Spacing,
|
| 30 |
+
content: parameters.spacingAfterNameExcerpt
|
| 31 |
+
});
|
| 32 |
+
}
|
| 33 |
+
this._equalsExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 34 |
+
configuration: this.configuration,
|
| 35 |
+
excerptKind: DocExcerpt_1.ExcerptKind.HtmlAttribute_Equals,
|
| 36 |
+
content: parameters.equalsExcerpt
|
| 37 |
+
});
|
| 38 |
+
if (parameters.spacingAfterEqualsExcerpt) {
|
| 39 |
+
this._spacingAfterEqualsExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 40 |
+
configuration: this.configuration,
|
| 41 |
+
excerptKind: DocExcerpt_1.ExcerptKind.Spacing,
|
| 42 |
+
content: parameters.spacingAfterEqualsExcerpt
|
| 43 |
+
});
|
| 44 |
+
}
|
| 45 |
+
this._valueExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 46 |
+
configuration: this.configuration,
|
| 47 |
+
excerptKind: DocExcerpt_1.ExcerptKind.HtmlAttribute_Value,
|
| 48 |
+
content: parameters.valueExcerpt
|
| 49 |
+
});
|
| 50 |
+
if (parameters.spacingAfterValueExcerpt) {
|
| 51 |
+
this._spacingAfterValueExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 52 |
+
configuration: this.configuration,
|
| 53 |
+
excerptKind: DocExcerpt_1.ExcerptKind.Spacing,
|
| 54 |
+
content: parameters.spacingAfterValueExcerpt
|
| 55 |
+
});
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
else {
|
| 59 |
+
this._name = parameters.name;
|
| 60 |
+
this._spacingAfterName = parameters.spacingAfterName;
|
| 61 |
+
this._spacingAfterEquals = parameters.spacingAfterEquals;
|
| 62 |
+
this._value = parameters.value;
|
| 63 |
+
this._spacingAfterValue = parameters.spacingAfterValue;
|
| 64 |
+
}
|
| 65 |
+
}
|
| 66 |
+
/** @override */
|
| 67 |
+
get kind() {
|
| 68 |
+
return DocNode_1.DocNodeKind.HtmlAttribute;
|
| 69 |
+
}
|
| 70 |
+
/**
|
| 71 |
+
* The HTML attribute name.
|
| 72 |
+
*/
|
| 73 |
+
get name() {
|
| 74 |
+
if (this._name === undefined) {
|
| 75 |
+
this._name = this._nameExcerpt.content.toString();
|
| 76 |
+
}
|
| 77 |
+
return this._name;
|
| 78 |
+
}
|
| 79 |
+
/**
|
| 80 |
+
* Explicit whitespace that a renderer should insert after the HTML attribute name.
|
| 81 |
+
* If undefined, then the renderer can use a formatting rule to generate appropriate spacing.
|
| 82 |
+
*/
|
| 83 |
+
get spacingAfterName() {
|
| 84 |
+
if (this._spacingAfterName === undefined) {
|
| 85 |
+
if (this._spacingAfterNameExcerpt !== undefined) {
|
| 86 |
+
this._spacingAfterName = this._spacingAfterNameExcerpt.content.toString();
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
return this._spacingAfterName;
|
| 90 |
+
}
|
| 91 |
+
/**
|
| 92 |
+
* Explicit whitespace that a renderer should insert after the "=".
|
| 93 |
+
* If undefined, then the renderer can use a formatting rule to generate appropriate spacing.
|
| 94 |
+
*/
|
| 95 |
+
get spacingAfterEquals() {
|
| 96 |
+
if (this._spacingAfterEquals === undefined) {
|
| 97 |
+
if (this._spacingAfterEqualsExcerpt !== undefined) {
|
| 98 |
+
this._spacingAfterEquals = this._spacingAfterEqualsExcerpt.content.toString();
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
return this._spacingAfterEquals;
|
| 102 |
+
}
|
| 103 |
+
/**
|
| 104 |
+
* The HTML attribute value.
|
| 105 |
+
*/
|
| 106 |
+
get value() {
|
| 107 |
+
if (this._value === undefined) {
|
| 108 |
+
this._value = this._valueExcerpt.content.toString();
|
| 109 |
+
}
|
| 110 |
+
return this._value;
|
| 111 |
+
}
|
| 112 |
+
/**
|
| 113 |
+
* Explicit whitespace that a renderer should insert after the HTML attribute name.
|
| 114 |
+
* If undefined, then the renderer can use a formatting rule to generate appropriate spacing.
|
| 115 |
+
*/
|
| 116 |
+
get spacingAfterValue() {
|
| 117 |
+
if (this._spacingAfterValue === undefined) {
|
| 118 |
+
if (this._spacingAfterValueExcerpt !== undefined) {
|
| 119 |
+
this._spacingAfterValue = this._spacingAfterValueExcerpt.content.toString();
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
return this._spacingAfterValue;
|
| 123 |
+
}
|
| 124 |
+
/** @override */
|
| 125 |
+
onGetChildNodes() {
|
| 126 |
+
return [
|
| 127 |
+
this._nameExcerpt,
|
| 128 |
+
this._spacingAfterNameExcerpt,
|
| 129 |
+
this._equalsExcerpt,
|
| 130 |
+
this._spacingAfterEqualsExcerpt,
|
| 131 |
+
this._valueExcerpt,
|
| 132 |
+
this._spacingAfterValueExcerpt
|
| 133 |
+
];
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
exports.DocHtmlAttribute = DocHtmlAttribute;
|
| 137 |
+
//# sourceMappingURL=DocHtmlAttribute.js.map
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocHtmlAttribute.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"DocHtmlAttribute.js","sourceRoot":"","sources":["../../src/nodes/DocHtmlAttribute.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,uCAAyG;AAEzG,6CAAuD;AA2BvD;;;;GAIG;AACH,MAAa,gBAAiB,SAAQ,iBAAO;IAqB3C;;;OAGG;IACH,YAAmB,UAA2E;QAC5F,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,IAAI,iBAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,YAAY,GAAG,IAAI,uBAAU,CAAC;gBACjC,aAAa,EAAE,IAAI,CAAC,aAAa;gBACjC,WAAW,EAAE,wBAAW,CAAC,kBAAkB;gBAC3C,OAAO,EAAE,UAAU,CAAC,WAAW;aAChC,CAAC,CAAC;YACH,IAAI,UAAU,CAAC,uBAAuB,EAAE,CAAC;gBACvC,IAAI,CA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CAAC;QACvD,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;OAGG;IACH,IAAW,iBAAiB;QAC1B,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;YAC1C,IAAI,IAAI,CAAC,yBAAyB,KAAK,SAAS,EAAE,CAAC;gBACjD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC9E,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED,gBAAgB;IACN,eAAe;QACvB,OAAO;YACL,IAAI,CAAC,YAAY;YACjB,IAAI,CAAC,wBAAwB;YAC7B,IAAI,CAAC,cAAc;YACnB,IAAI,CAAC,0BAA0B;YAC/B,IAAI,CAAC,aAAa;YAClB,IAAI,CAAC,yBAAyB;SAC/B,CAAC;IACJ,CAAC;CACF;AAzJD,4CAyJC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { DocNode, DocNodeKind, type IDocNodeParameters, type IDocNodeParsedParameters } from './DocNode';\r\nimport type { TokenSequence } from '../parser/TokenSequence';\r\nimport { DocExcerpt, ExcerptKind } from './DocExcerpt';\r\n\r\n/**\r\n * Constructor parameters for {@link DocHtmlAttribute}.\r\n */\r\nexport interface IDocHtmlAttributeParameters extends IDocNodeParameters {\r\n name: string;\r\n spacingAfterName?: string;\r\n spacingAfterEquals?: string;\r\n value: string;\r\n spacingAfterValue?: string;\r\n}\r\n\r\n/**\r\n * Constructor parameters for {@link DocHtmlAttribute}.\r\n */\r\nexport interface IDocHtmlAttributeParsedParameters extends IDocNodeParsedParameters {\r\n nameExcerpt: TokenSequence;\r\n spacingAfterNameExcerpt?: TokenSequence;\r\n\r\n equalsExcerpt: TokenSequence;\r\n spacingAfterEqualsExcerpt?: TokenSequence;\r\n\r\n valueExcerpt: TokenSequence;\r\n spacingAfterValueExcerpt?: TokenSequence;\r\n}\r\n\r\n/**\r\n * Represents an HTML attribute inside a DocHtmlStartTag or DocHtmlEndTag.\r\n *\r\n * Example: `href=\"#\"` inside `<a href=\"#\" />`\r\n */\r\nexport class DocHtmlAttribute extends DocNode {\r\n // The attribute name\r\n private _name: string | undefined;\r\n private readonly _nameExcerpt: DocExcerpt | undefined;\r\n\r\n private _spacingAfterName: string | undefined;\r\n private readonly _spacingAfterNameExcerpt: DocExcerpt | undefined;\r\n\r\n // The \"=\" delimiter\r\n private readonly _equalsExcerpt: DocExcerpt | undefined;\r\n\r\n private _spacingAfterEquals: string | undefined;\r\n private readonly _spacingAfterEqualsExcerpt: DocExcerpt | undefined;\r\n\r\n // The attribute value including quotation marks\r\n private _value: string | undefined;\r\n private readonly _valueExcerpt: DocExcerpt | undefined;\r\n\r\n private _spacingAfterValue: string | undefined;\r\n private readonly _spacingAfterValueExcerpt: DocExcerpt | undefined;\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(parameters: IDocHtmlAttributeParameters | IDocHtmlAttributeParsedParameters) {\r\n super(parameters);\r\n\r\n if (DocNode.isParsedParameters(parameters)) {\r\n this._nameExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.HtmlAttribute_Name,\r\n content: parameters.nameExcerpt\r\n });\r\n if (parameters.spacingAfterNameExcerpt) {\r\n this._spacingAfterNameExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterNameExcerpt\r\n });\r\n }\r\n\r\n this._equalsExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.HtmlAttribute_Equals,\r\n content: parameters.equalsExcerpt\r\n });\r\n if (parameters.spacingAfterEqualsExcerpt) {\r\n this._spacingAfterEqualsExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterEqualsExcerpt\r\n });\r\n }\r\n\r\n this._valueExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.HtmlAttribute_Value,\r\n content: parameters.valueExcerpt\r\n });\r\n if (parameters.spacingAfterValueExcerpt) {\r\n this._spacingAfterValueExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.Spacing,\r\n content: parameters.spacingAfterValueExcerpt\r\n });\r\n }\r\n } else {\r\n this._name = parameters.name;\r\n this._spacingAfterName = parameters.spacingAfterName;\r\n\r\n this._spacingAfterEquals = parameters.spacingAfterEquals;\r\n\r\n this._value = parameters.value;\r\n this._spacingAfterValue = parameters.spacingAfterValue;\r\n }\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.HtmlAttribute;\r\n }\r\n\r\n /**\r\n * The HTML attribute name.\r\n */\r\n public get name(): string {\r\n if (this._name === undefined) {\r\n this._name = this._nameExcerpt!.content.toString();\r\n }\r\n return this._name;\r\n }\r\n\r\n /**\r\n * Explicit whitespace that a renderer should insert after the HTML attribute name.\r\n * If undefined, then the renderer can use a formatting rule to generate appropriate spacing.\r\n */\r\n public get spacingAfterName(): string | undefined {\r\n if (this._spacingAfterName === undefined) {\r\n if (this._spacingAfterNameExcerpt !== undefined) {\r\n this._spacingAfterName = this._spacingAfterNameExcerpt.content.toString();\r\n }\r\n }\r\n return this._spacingAfterName;\r\n }\r\n\r\n /**\r\n * Explicit whitespace that a renderer should insert after the \"=\".\r\n * If undefined, then the renderer can use a formatting rule to generate appropriate spacing.\r\n */\r\n public get spacingAfterEquals(): string | undefined {\r\n if (this._spacingAfterEquals === undefined) {\r\n if (this._spacingAfterEqualsExcerpt !== undefined) {\r\n this._spacingAfterEquals = this._spacingAfterEqualsExcerpt.content.toString();\r\n }\r\n }\r\n return this._spacingAfterEquals;\r\n }\r\n\r\n /**\r\n * The HTML attribute value.\r\n */\r\n public get value(): string {\r\n if (this._value === undefined) {\r\n this._value = this._valueExcerpt!.content.toString();\r\n }\r\n return this._value;\r\n }\r\n\r\n /**\r\n * Explicit whitespace that a renderer should insert after the HTML attribute name.\r\n * If undefined, then the renderer can use a formatting rule to generate appropriate spacing.\r\n */\r\n public get spacingAfterValue(): string | undefined {\r\n if (this._spacingAfterValue === undefined) {\r\n if (this._spacingAfterValueExcerpt !== undefined) {\r\n this._spacingAfterValue = this._spacingAfterValueExcerpt.content.toString();\r\n }\r\n }\r\n return this._spacingAfterValue;\r\n }\r\n\r\n /** @override */\r\n protected onGetChildNodes(): ReadonlyArray<DocNode | undefined> {\r\n return [\r\n this._nameExcerpt,\r\n this._spacingAfterNameExcerpt,\r\n this._equalsExcerpt,\r\n this._spacingAfterEqualsExcerpt,\r\n this._valueExcerpt,\r\n this._spacingAfterValueExcerpt\r\n ];\r\n }\r\n}\r\n"]}
|
node_modules/@microsoft/tsdoc/lib-commonjs/nodes/DocHtmlEndTag.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
| 3 |
+
// See LICENSE in the project root for license information.
|
| 4 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 5 |
+
exports.DocHtmlEndTag = void 0;
|
| 6 |
+
const DocNode_1 = require("./DocNode");
|
| 7 |
+
const DocExcerpt_1 = require("./DocExcerpt");
|
| 8 |
+
const StringBuilder_1 = require("../emitters/StringBuilder");
|
| 9 |
+
const TSDocEmitter_1 = require("../emitters/TSDocEmitter");
|
| 10 |
+
/**
|
| 11 |
+
* Represents an HTML end tag. Example: `</a>`
|
| 12 |
+
*/
|
| 13 |
+
class DocHtmlEndTag extends DocNode_1.DocNode {
|
| 14 |
+
/**
|
| 15 |
+
* Don't call this directly. Instead use {@link TSDocParser}
|
| 16 |
+
* @internal
|
| 17 |
+
*/
|
| 18 |
+
constructor(parameters) {
|
| 19 |
+
super(parameters);
|
| 20 |
+
if (DocNode_1.DocNode.isParsedParameters(parameters)) {
|
| 21 |
+
this._openingDelimiterExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 22 |
+
configuration: this.configuration,
|
| 23 |
+
excerptKind: DocExcerpt_1.ExcerptKind.HtmlEndTag_OpeningDelimiter,
|
| 24 |
+
content: parameters.openingDelimiterExcerpt
|
| 25 |
+
});
|
| 26 |
+
this._nameExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 27 |
+
configuration: this.configuration,
|
| 28 |
+
excerptKind: DocExcerpt_1.ExcerptKind.HtmlEndTag_Name,
|
| 29 |
+
content: parameters.nameExcerpt
|
| 30 |
+
});
|
| 31 |
+
if (parameters.spacingAfterNameExcerpt) {
|
| 32 |
+
this._spacingAfterNameExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 33 |
+
configuration: this.configuration,
|
| 34 |
+
excerptKind: DocExcerpt_1.ExcerptKind.Spacing,
|
| 35 |
+
content: parameters.spacingAfterNameExcerpt
|
| 36 |
+
});
|
| 37 |
+
}
|
| 38 |
+
this._closingDelimiterExcerpt = new DocExcerpt_1.DocExcerpt({
|
| 39 |
+
configuration: this.configuration,
|
| 40 |
+
excerptKind: DocExcerpt_1.ExcerptKind.HtmlEndTag_ClosingDelimiter,
|
| 41 |
+
content: parameters.closingDelimiterExcerpt
|
| 42 |
+
});
|
| 43 |
+
}
|
| 44 |
+
else {
|
| 45 |
+
this._name = parameters.name;
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
/** @override */
|
| 49 |
+
get kind() {
|
| 50 |
+
return DocNode_1.DocNodeKind.HtmlEndTag;
|
| 51 |
+
}
|
| 52 |
+
/**
|
| 53 |
+
* The HTML element name.
|
| 54 |
+
*/
|
| 55 |
+
get name() {
|
| 56 |
+
if (this._name === undefined) {
|
| 57 |
+
this._name = this._nameExcerpt.content.toString();
|
| 58 |
+
}
|
| 59 |
+
return this._name;
|
| 60 |
+
}
|
| 61 |
+
/**
|
| 62 |
+
* Generates the HTML for this tag.
|
| 63 |
+
*/
|
| 64 |
+
emitAsHtml() {
|
| 65 |
+
// NOTE: Here we're assuming that the TSDoc representation for a tag is also a valid HTML expression.
|
| 66 |
+
const stringBuilder = new StringBuilder_1.StringBuilder();
|
| 67 |
+
const emitter = new TSDocEmitter_1.TSDocEmitter();
|
| 68 |
+
emitter.renderHtmlTag(stringBuilder, this);
|
| 69 |
+
return stringBuilder.toString();
|
| 70 |
+
}
|
| 71 |
+
/** @override */
|
| 72 |
+
onGetChildNodes() {
|
| 73 |
+
return [
|
| 74 |
+
this._openingDelimiterExcerpt,
|
| 75 |
+
this._nameExcerpt,
|
| 76 |
+
this._spacingAfterNameExcerpt,
|
| 77 |
+
this._closingDelimiterExcerpt
|
| 78 |
+
];
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
exports.DocHtmlEndTag = DocHtmlEndTag;
|
| 82 |
+
//# sourceMappingURL=DocHtmlEndTag.js.map
|