333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
"use strict";
/**
 * @license
 * Copyright 2013 Palantir Technologies, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
var tsutils = require("tsutils");
var ts = require("typescript");
var Lint = require("../index");
var exclusions_1 = require("./completed-docs/exclusions");
exports.ALL = "all";
exports.ARGUMENT_CLASSES = "classes";
exports.ARGUMENT_ENUMS = "enums";
exports.ARGUMENT_ENUM_MEMBERS = "enum-members";
exports.ARGUMENT_FUNCTIONS = "functions";
exports.ARGUMENT_INTERFACES = "interfaces";
exports.ARGUMENT_METHODS = "methods";
exports.ARGUMENT_NAMESPACES = "namespaces";
exports.ARGUMENT_PROPERTIES = "properties";
exports.ARGUMENT_TYPES = "types";
exports.ARGUMENT_VARIABLES = "variables";
exports.DESCRIPTOR_TAGS = "tags";
exports.DESCRIPTOR_LOCATIONS = "locations";
exports.DESCRIPTOR_OVERLOADS = "overloads";
exports.DESCRIPTOR_PRIVACIES = "privacies";
exports.DESCRIPTOR_VISIBILITIES = "visibilities";
exports.LOCATION_INSTANCE = "instance";
exports.LOCATION_STATIC = "static";
exports.PRIVACY_PRIVATE = "private";
exports.PRIVACY_PROTECTED = "protected";
exports.PRIVACY_PUBLIC = "public";
exports.TAGS_FOR_CONTENT = "content";
exports.TAGS_FOR_EXISTENCE = "existence";
exports.VISIBILITY_EXPORTED = "exported";
exports.VISIBILITY_INTERNAL = "internal";
var Rule = /** @class */ (function (_super) {
    tslib_1.__extends(Rule, _super);
    function Rule() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /* tslint:enable:object-literal-sort-keys */
    Rule.prototype.apply = function (sourceFile) {
        var options = this.getOptions();
        var exclusionsMap = this.getExclusionsMap(options.ruleArguments);
        return this.applyWithFunction(sourceFile, walk, exclusionsMap);
    };
    Rule.prototype.getExclusionsMap = function (ruleArguments) {
        if (ruleArguments.length === 0) {
            ruleArguments = [Rule.defaultArguments];
        }
        return exclusions_1.constructExclusionsMap(ruleArguments);
    };
    Rule.FAILURE_STRING_EXIST = "Documentation must exist for ";
    Rule.defaultArguments = (_a = {},
        _a[exports.ARGUMENT_CLASSES] = true,
        _a[exports.ARGUMENT_FUNCTIONS] = true,
        _a[exports.ARGUMENT_METHODS] = (_b = {},
            _b[exports.DESCRIPTOR_TAGS] = (_c = {},
                _c[exports.TAGS_FOR_CONTENT] = {
                    see: ".*",
                },
                _c[exports.TAGS_FOR_EXISTENCE] = ["deprecated", "inheritdoc"],
                _c),
            _b),
        _a[exports.ARGUMENT_PROPERTIES] = (_d = {},
            _d[exports.DESCRIPTOR_TAGS] = (_e = {},
                _e[exports.TAGS_FOR_CONTENT] = {
                    see: ".*",
                },
                _e[exports.TAGS_FOR_EXISTENCE] = ["deprecated", "inheritdoc"],
                _e),
            _d),
        _a);
    Rule.ARGUMENT_DESCRIPTOR_BLOCK = {
        properties: (_f = {},
            _f[exports.DESCRIPTOR_TAGS] = {
                properties: (_g = {},
                    _g[exports.TAGS_FOR_CONTENT] = {
                        items: {
                            type: "string",
                        },
                        type: "object",
                    },
                    _g[exports.TAGS_FOR_EXISTENCE] = {
                        items: {
                            type: "string",
                        },
                        type: "array",
                    },
                    _g),
            },
            _f[exports.DESCRIPTOR_VISIBILITIES] = {
                enum: [exports.ALL, exports.VISIBILITY_EXPORTED, exports.VISIBILITY_INTERNAL],
                type: "string",
            },
            _f),
        type: "object",
    };
    Rule.ARGUMENT_DESCRIPTOR_CLASS = {
        properties: (_h = {},
            _h[exports.DESCRIPTOR_TAGS] = {
                properties: (_j = {},
                    _j[exports.TAGS_FOR_CONTENT] = {
                        items: {
                            type: "string",
                        },
                        type: "object",
                    },
                    _j[exports.TAGS_FOR_EXISTENCE] = {
                        items: {
                            type: "string",
                        },
                        type: "array",
                    },
                    _j),
            },
            _h[exports.DESCRIPTOR_LOCATIONS] = {
                enum: [exports.ALL, exports.LOCATION_INSTANCE, exports.LOCATION_STATIC],
                type: "string",
            },
            _h[exports.DESCRIPTOR_PRIVACIES] = {
                enum: [exports.ALL, exports.PRIVACY_PRIVATE, exports.PRIVACY_PROTECTED, exports.PRIVACY_PUBLIC],
                type: "string",
            },
            _h),
        type: "object",
    };
    Rule.ARGUMENT_DESCRIPTOR_FUNCTION = {
        properties: tslib_1.__assign({}, Rule.ARGUMENT_DESCRIPTOR_BLOCK.properties, (_k = {}, _k[exports.DESCRIPTOR_OVERLOADS] = {
            type: "boolean",
        }, _k)),
        type: "object",
    };
    Rule.ARGUMENT_DESCRIPTOR_METHOD = {
        properties: tslib_1.__assign({}, Rule.ARGUMENT_DESCRIPTOR_CLASS.properties, (_l = {}, _l[exports.DESCRIPTOR_OVERLOADS] = {
            type: "boolean",
        }, _l)),
        type: "object",
    };
    /* tslint:disable:object-literal-sort-keys */
    Rule.metadata = {
        ruleName: "completed-docs",
        description: "Enforces JSDoc comments for important items be filled out.",
        optionsDescription: Lint.Utils.dedent(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n            `true` to enable for `[", "]`,\n            or an array with each item in one of two formats:\n\n            * `string` to enable for that type\n            * `object` keying types to when their documentation is required:\n                * `\"", "\"` and `\"", "\"` may specify:\n                    * `\"", "\"`:\n                        * `\"", "\"`\n                        * `\"", "\"`\n                        * `\"", "\"`\n                        * `\"", "\"`\n                    * `\"", "\"`:\n                        * `\"", "\"`\n                        * `\"", "\"`\n                        * `\"", "\"`\n                * Other types may specify `\"", "\"`:\n                    * `\"", "\"`\n                    * `\"", "\"`\n                    * `\"", "\"`\n                * `\"", "\"` `\"", "\"` may also specify `\"", "\"`\n                  to indicate that each overload should have its own documentation, which is `false` by default.\n                * All types may also provide `\"", "\"`\n                  with members specifying tags that allow the docs to not have a body.\n                    * `\"", "\"`: Object mapping tags to `RegExp` bodies content allowed to count as complete docs.\n                    * `\"", "\"`: Array of tags that must only exist to count as complete docs.\n\n            Types that may be enabled are:\n\n            * `\"", "\"`\n            * `\"", "\"`\n            * `\"", "\"`\n            * `\"", "\"`\n            * `\"", "\"`\n            * `\"", "\"`\n            * `\"", "\"`\n            * `\"", "\"`\n            * `\"", "\"`\n            * `\"", "\"`"], ["\n            \\`true\\` to enable for \\`[", "]\\`,\n            or an array with each item in one of two formats:\n\n            * \\`string\\` to enable for that type\n            * \\`object\\` keying types to when their documentation is required:\n                * \\`\"", "\"\\` and \\`\"", "\"\\` may specify:\n                    * \\`\"", "\"\\`:\n                        * \\`\"", "\"\\`\n                        * \\`\"", "\"\\`\n                        * \\`\"", "\"\\`\n                        * \\`\"", "\"\\`\n                    * \\`\"", "\"\\`:\n                        * \\`\"", "\"\\`\n                        * \\`\"", "\"\\`\n                        * \\`\"", "\"\\`\n                * Other types may specify \\`\"", "\"\\`:\n                    * \\`\"", "\"\\`\n                    * \\`\"", "\"\\`\n                    * \\`\"", "\"\\`\n                * \\`\"", "\"\\` \\`\"", "\"\\` may also specify \\`\"", "\"\\`\n                  to indicate that each overload should have its own documentation, which is \\`false\\` by default.\n                * All types may also provide \\`\"", "\"\\`\n                  with members specifying tags that allow the docs to not have a body.\n                    * \\`\"", "\"\\`: Object mapping tags to \\`RegExp\\` bodies content allowed to count as complete docs.\n                    * \\`\"", "\"\\`: Array of tags that must only exist to count as complete docs.\n\n            Types that may be enabled are:\n\n            * \\`\"", "\"\\`\n            * \\`\"", "\"\\`\n            * \\`\"", "\"\\`\n            * \\`\"", "\"\\`\n            * \\`\"", "\"\\`\n            * \\`\"", "\"\\`\n            * \\`\"", "\"\\`\n            * \\`\"", "\"\\`\n            * \\`\"", "\"\\`\n            * \\`\"", "\"\\`"])), Object.keys(Rule.defaultArguments).join(", "), exports.ARGUMENT_METHODS, exports.ARGUMENT_PROPERTIES, exports.DESCRIPTOR_PRIVACIES, exports.ALL, exports.PRIVACY_PRIVATE, exports.PRIVACY_PROTECTED, exports.PRIVACY_PUBLIC, exports.DESCRIPTOR_LOCATIONS, exports.ALL, exports.LOCATION_INSTANCE, exports.LOCATION_STATIC, exports.DESCRIPTOR_VISIBILITIES, exports.ALL, exports.VISIBILITY_EXPORTED, exports.VISIBILITY_INTERNAL, exports.ARGUMENT_FUNCTIONS, exports.ARGUMENT_METHODS, exports.DESCRIPTOR_OVERLOADS, exports.DESCRIPTOR_TAGS, exports.TAGS_FOR_CONTENT, exports.TAGS_FOR_EXISTENCE, exports.ARGUMENT_CLASSES, exports.ARGUMENT_ENUMS, exports.ARGUMENT_ENUM_MEMBERS, exports.ARGUMENT_FUNCTIONS, exports.ARGUMENT_INTERFACES, exports.ARGUMENT_METHODS, exports.ARGUMENT_NAMESPACES, exports.ARGUMENT_PROPERTIES, exports.ARGUMENT_TYPES, exports.ARGUMENT_VARIABLES),
        options: {
            type: "array",
            items: {
                anyOf: [
                    {
                        options: [
                            exports.ARGUMENT_CLASSES,
                            exports.ARGUMENT_ENUMS,
                            exports.ARGUMENT_FUNCTIONS,
                            exports.ARGUMENT_INTERFACES,
                            exports.ARGUMENT_METHODS,
                            exports.ARGUMENT_NAMESPACES,
                            exports.ARGUMENT_PROPERTIES,
                            exports.ARGUMENT_TYPES,
                            exports.ARGUMENT_VARIABLES,
                        ],
                        type: "string",
                    },
                    {
                        type: "object",
                        properties: (_m = {},
                            _m[exports.ARGUMENT_CLASSES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
                            _m[exports.ARGUMENT_ENUMS] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
                            _m[exports.ARGUMENT_ENUM_MEMBERS] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
                            _m[exports.ARGUMENT_FUNCTIONS] = Rule.ARGUMENT_DESCRIPTOR_FUNCTION,
                            _m[exports.ARGUMENT_INTERFACES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
                            _m[exports.ARGUMENT_METHODS] = Rule.ARGUMENT_DESCRIPTOR_METHOD,
                            _m[exports.ARGUMENT_NAMESPACES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
                            _m[exports.ARGUMENT_PROPERTIES] = Rule.ARGUMENT_DESCRIPTOR_CLASS,
                            _m[exports.ARGUMENT_TYPES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
                            _m[exports.ARGUMENT_VARIABLES] = Rule.ARGUMENT_DESCRIPTOR_BLOCK,
                            _m),
                    },
                ],
            },
        },
        optionExamples: [
            true,
            [true, exports.ARGUMENT_ENUMS, exports.ARGUMENT_FUNCTIONS, exports.ARGUMENT_METHODS],
            [
                true,
                (_o = {},
                    _o[exports.ARGUMENT_ENUMS] = true,
                    _o[exports.ARGUMENT_FUNCTIONS] = (_p = {},
                        _p[exports.DESCRIPTOR_VISIBILITIES] = [exports.VISIBILITY_EXPORTED],
                        _p),
                    _o[exports.ARGUMENT_METHODS] = (_q = {},
                        _q[exports.DESCRIPTOR_LOCATIONS] = exports.LOCATION_INSTANCE,
                        _q[exports.DESCRIPTOR_PRIVACIES] = [exports.PRIVACY_PUBLIC, exports.PRIVACY_PROTECTED],
                        _q),
                    _o[exports.ARGUMENT_PROPERTIES] = (_r = {},
                        _r[exports.DESCRIPTOR_TAGS] = (_s = {},
                            _s[exports.TAGS_FOR_CONTENT] = {
                                see: ["#.*"],
                            },
                            _s[exports.TAGS_FOR_EXISTENCE] = ["inheritdoc"],
                            _s),
                        _r),
                    _o),
            ],
        ],
        rationale: Lint.Utils.dedent(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n            Helps ensure important components are documented.\n\n            Note: use this rule sparingly. It's better to have self-documenting names on components with single, concise responsibilities.\n            Comments that only restate the names of variables add nothing to code, and can easily become outdated.\n        "], ["\n            Helps ensure important components are documented.\n\n            Note: use this rule sparingly. It's better to have self-documenting names on components with single, concise responsibilities.\n            Comments that only restate the names of variables add nothing to code, and can easily become outdated.\n        "]))),
        type: "style",
        typescriptOnly: false,
    };
    return Rule;
}(Lint.Rules.AbstractRule));
exports.Rule = Rule;
var modifierAliases = {
    export: "exported",
};
function walk(context) {
    return ts.forEachChild(context.sourceFile, cb);
    function cb(node) {
        switch (node.kind) {
            case ts.SyntaxKind.ClassDeclaration:
                checkNode(node, exports.ARGUMENT_CLASSES);
                break;
            case ts.SyntaxKind.EnumDeclaration:
                checkNode(node, exports.ARGUMENT_ENUMS);
                for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
                    var member = _a[_i];
                    // Enum members don't have modifiers, so use the parent
                    // enum declaration when checking the requirements.
                    checkNode(member, exports.ARGUMENT_ENUM_MEMBERS, node);
                }
                break;
            case ts.SyntaxKind.FunctionDeclaration:
                checkNode(node, exports.ARGUMENT_FUNCTIONS);
                break;
            case ts.SyntaxKind.InterfaceDeclaration:
                checkNode(node, exports.ARGUMENT_INTERFACES);
                break;
            case ts.SyntaxKind.MethodSignature:
                checkNode(node, exports.ARGUMENT_METHODS);
                break;
            case ts.SyntaxKind.MethodDeclaration:
                if (node.parent.kind !== ts.SyntaxKind.ObjectLiteralExpression) {
                    checkNode(node, exports.ARGUMENT_METHODS);
                }
                break;
            case ts.SyntaxKind.ModuleDeclaration:
                checkNode(node, exports.ARGUMENT_NAMESPACES);
                break;
            case ts.SyntaxKind.PropertySignature:
                checkNode(node, exports.ARGUMENT_PROPERTIES);
                break;
            case ts.SyntaxKind.PropertyDeclaration:
                checkNode(node, exports.ARGUMENT_PROPERTIES);
                break;
            case ts.SyntaxKind.TypeAliasDeclaration:
                checkNode(node, exports.ARGUMENT_TYPES);
                break;
            case ts.SyntaxKind.VariableStatement:
                // Only check variables at the namespace/module-level or file-level
                // and not variables declared inside functions and other things.
                switch (node.parent.kind) {
                    case ts.SyntaxKind.SourceFile:
                    case ts.SyntaxKind.ModuleBlock:
                        for (var _b = 0, _c = node.declarationList
                            .declarations; _b < _c.length; _b++) {
                            var declaration = _c[_b];
                            checkNode(declaration, exports.ARGUMENT_VARIABLES, node);
                        }
                }
                break;
            case ts.SyntaxKind.GetAccessor:
            case ts.SyntaxKind.SetAccessor:
                if (node.parent.kind !== ts.SyntaxKind.ObjectLiteralExpression) {
                    checkAccessorNode(node, exports.ARGUMENT_PROPERTIES);
                }
        }
        return ts.forEachChild(node, cb);
    }
    function checkNode(node, docType, requirementNode) {
        if (requirementNode === void 0) { requirementNode = node; }
        if (!nodeIsExcluded(node, docType, requirementNode) && !nodeHasDocs(node, docType)) {
            addDocumentationFailure(node, describeDocType(docType), requirementNode);
        }
    }
    function checkAccessorNode(node, docType) {
        if (nodeIsExcluded(node, exports.ARGUMENT_PROPERTIES, node) || nodeHasDocs(node, docType)) {
            return;
        }
        var correspondingAccessor = getCorrespondingAccessor(node);
        if (correspondingAccessor === undefined || !nodeHasDocs(correspondingAccessor, docType)) {
            addDocumentationFailure(node, exports.ARGUMENT_PROPERTIES, node);
        }
    }
    function nodeIsExcluded(node, docType, requirementNode) {
        var name = node.name;
        if (name === undefined) {
            return true;
        }
        var exclusions = context.options.get(docType);
        if (exclusions === undefined) {
            return true;
        }
        for (var _i = 0, _a = exclusions.requirements; _i < _a.length; _i++) {
            var requirement = _a[_i];
            if (requirement.excludes(requirementNode)) {
                return true;
            }
        }
        return false;
    }
    function nodeHasDocs(node, docType) {
        var docs = getApparentJsDoc(node, docType, context.sourceFile);
        if (docs === undefined) {
            return false;
        }
        var comments = docs
            .map(function (doc) { return doc.comment; })
            .filter(function (comment) { return comment !== undefined && comment.trim() !== ""; });
        return comments.length !== 0;
    }
    /**
     * @see https://github.com/ajafff/tsutils/issues/16
     */
    function getApparentJsDoc(node, docType, sourceFile) {
        if (ts.isVariableDeclaration(node)) {
            if (variableIsAfterFirstInDeclarationList(node)) {
                return undefined;
            }
            node = node.parent;
        }
        if (ts.isVariableDeclarationList(node)) {
            node = node.parent;
        }
        var equivalentNodesForDocs = getEquivalentNodesForDocs(node, docType);
        return equivalentNodesForDocs
            .map(function (docsNode) { return tsutils.getJsDoc(docsNode, sourceFile); })
            .filter(function (nodeDocs) { return nodeDocs !== undefined; })
            .reduce(function (docs, moreDocs) { return docs.concat(moreDocs); }, []);
    }
    /**
     * @see https://github.com/palantir/tslint/issues/4416
     */
    function getEquivalentNodesForDocs(node, docType) {
        var exclusions = context.options.get(docType);
        if (exclusions === undefined || exclusions.overloadsSeparateDocs) {
            return [node];
        }
        if (tsutils.isFunctionDeclaration(node) && node.name !== undefined) {
            var functionName_1 = node.name.text;
            return getSiblings(node).filter(function (child) {
                return tsutils.isFunctionDeclaration(child) &&
                    child.name !== undefined &&
                    child.name.text === functionName_1;
            });
        }
        if (tsutils.isMethodDeclaration(node) &&
            tsutils.isIdentifier(node.name) &&
            tsutils.isClassDeclaration(node.parent)) {
            var methodName_1 = node.name.text;
            return node.parent.members.filter(function (member) {
                return tsutils.isMethodDeclaration(member) &&
                    tsutils.isIdentifier(member.name) &&
                    member.name.text === methodName_1;
            });
        }
        return [node];
    }
    function addDocumentationFailure(node, docType, requirementNode) {
        var start = node.getStart();
        var width = node.getText().split(/\r|\n/g)[0].length;
        var description = describeDocumentationFailure(requirementNode, docType);
        context.addFailureAt(start, width, description);
    }
}
function getCorrespondingAccessor(node) {
    var propertyName = tsutils.getPropertyName(node.name);
    if (propertyName === undefined) {
        return undefined;
    }
    var parent = node.parent;
    var correspondingKindCheck = node.kind === ts.SyntaxKind.GetAccessor ? isSetAccessor : isGetAccessor;
    for (var _i = 0, _a = parent.members; _i < _a.length; _i++) {
        var member = _a[_i];
        if (!correspondingKindCheck(member)) {
            continue;
        }
        if (tsutils.getPropertyName(member.name) === propertyName) {
            return member;
        }
    }
    return undefined;
}
function variableIsAfterFirstInDeclarationList(node) {
    var parent = node.parent;
    if (parent === undefined) {
        return false;
    }
    return ts.isVariableDeclarationList(parent) && node !== parent.declarations[0];
}
function describeDocumentationFailure(node, docType) {
    var description = Rule.FAILURE_STRING_EXIST;
    if (node.modifiers !== undefined) {
        description += node.modifiers
            .map(function (modifier) { return describeModifier(modifier.kind); })
            .join(" ") + " ";
    }
    return "" + description + docType + ".";
}
function describeModifier(kind) {
    var description = ts.SyntaxKind[kind].toLowerCase().split("keyword")[0];
    var alias = modifierAliases[description];
    return alias !== undefined ? alias : description;
}
function describeDocType(docType) {
    return docType.replace("-", " ");
}
function getSiblings(node) {
    var parent = node.parent;
    // Source files nest their statements within a node for getChildren()
    if (ts.isSourceFile(parent)) {
        return parent.statements.slice();
    }
    return parent.getChildren();
}
function isGetAccessor(node) {
    return node.kind === ts.SyntaxKind.GetAccessor;
}
function isSetAccessor(node) {
    return node.kind === ts.SyntaxKind.SetAccessor;
}
var templateObject_1, templateObject_2;