diff options
Diffstat (limited to 'node_modules/@terwer/typedoc-plugin-markdown/dist/resources/partials/member.declaration.identifier.js')
-rw-r--r-- | node_modules/@terwer/typedoc-plugin-markdown/dist/resources/partials/member.declaration.identifier.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/node_modules/@terwer/typedoc-plugin-markdown/dist/resources/partials/member.declaration.identifier.js b/node_modules/@terwer/typedoc-plugin-markdown/dist/resources/partials/member.declaration.identifier.js new file mode 100644 index 0000000..936f729 --- /dev/null +++ b/node_modules/@terwer/typedoc-plugin-markdown/dist/resources/partials/member.declaration.identifier.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.declarationMemberIdentifier = void 0; +const typedoc_1 = require("typedoc"); +const els_1 = require("../../support/els"); +const helpers_1 = require("../../support/helpers"); +const utils_1 = require("../../support/utils"); +function declarationMemberIdentifier(context, reflection) { + var _a, _b; + const md = []; + const declarationType = (0, helpers_1.getDeclarationType)(reflection); + if (((_a = reflection.flags) === null || _a === void 0 ? void 0 : _a.length) && + !reflection.flags.isRest && + !reflection.flags.isOptional) { + md.push(reflection.flags.map((flag) => (0, els_1.backTicks)(flag.toLowerCase())).join(' ')); + } + if (reflection.kindOf(typedoc_1.ReflectionKind.Variable) && !reflection.flags.isConst) { + md.push((0, els_1.backTicks)('let')); + } + if (reflection.flags.isRest) { + md.push('...'); + } + const name = [context.partials.declarationMemberName(reflection)]; + if (reflection.flags.isOptional) { + name.push('?'); + } + if (declarationType) { + name.push(':'); + } + md.push(name.join('')); + if (reflection.typeParameters) { + md.push(`\\<${(_b = reflection.typeParameters) === null || _b === void 0 ? void 0 : _b.map((typeParameter) => (0, els_1.backTicks)(typeParameter.name)).join(', ')}\\>`); + } + if (declarationType) { + md.push(`${context.partials.someType(declarationType, 'all')}`); + } + if (reflection.defaultValue && reflection.defaultValue !== '...') { + md.push(` = \`${(0, utils_1.stripLineBreaks)((0, utils_1.stripComments)(reflection.defaultValue))}\``); + } + return md.join(' '); +} +exports.declarationMemberIdentifier = declarationMemberIdentifier; |