typedoc-plugin-typescript-declaration
Advanced tools
Comparing version 0.2.13 to 0.3.0
@@ -290,2 +290,5 @@ 'use strict'; | ||
} | ||
if (type.type === 'query') { | ||
return `typeof ${TypeFormatter.format(type.queryType)}`; | ||
} | ||
const other = type; | ||
@@ -998,27 +1001,2 @@ if (other.name) { | ||
class KeyOfCommentResolver { | ||
resolveKeys(project, reflection, override = false) { | ||
const node = reflection; | ||
const type = node.type; | ||
const reference = this.getDeclaration(project, type.target); | ||
let keys = this.getKeys(reference) | ||
.sort(propertySorter(r => r.id)) | ||
.map(r => { var _a, _b; return ((_a = type.target) === null || _a === void 0 ? void 0 : _a.type) === 'reference' ? `[[${(_b = type.target) === null || _b === void 0 ? void 0 : _b.name}.${r.name}|\`${r.name}\`]]` : `\`${r.name}\``; }) | ||
.join(', '); | ||
if (!node.comment) { | ||
node.comment = new models.Comment(); | ||
} | ||
if (!node.comment.tags) { | ||
node.comment.tags = []; | ||
} | ||
let tag = node.comment.getTag('keys'); | ||
if (tag) { | ||
if (override) { | ||
tag.text = keys; | ||
} | ||
} | ||
else { | ||
tag = new models.CommentTag('keys', undefined, keys); | ||
node.comment.tags.push(tag); | ||
} | ||
} | ||
shouldResolveKeys(project, reflection) { | ||
@@ -1097,20 +1075,2 @@ var _a, _b, _c; | ||
var AddKeysTagOption; | ||
(function (AddKeysTagOption) { | ||
AddKeysTagOption[AddKeysTagOption["off"] = 0] = "off"; | ||
AddKeysTagOption[AddKeysTagOption["add"] = 1] = "add"; | ||
AddKeysTagOption[AddKeysTagOption["update"] = 2] = "update"; | ||
})(AddKeysTagOption || (AddKeysTagOption = {})); | ||
const addKeysOptionMapping = { | ||
off: AddKeysTagOption.off, | ||
add: AddKeysTagOption.add, | ||
update: AddKeysTagOption.update, | ||
}; | ||
const keyofCommentsOption = { | ||
name: 'keyofComments', | ||
type: declaration.ParameterType.Map, | ||
help: 'Expands the values of the keyof operator and adds a tag, default is set to off', | ||
defaultValue: AddKeysTagOption.off, | ||
map: addKeysOptionMapping, | ||
}; | ||
class KeyOfPlugin extends components$1.ConverterComponent { | ||
@@ -1124,8 +1084,2 @@ initialize() { | ||
const resolver = KeyOfCommentResolver.instance(); | ||
if (this._mode !== AddKeysTagOption.off) { | ||
const override = this._mode === AddKeysTagOption.update; | ||
Object.values(context.project.reflections) | ||
.filter(item => resolver.shouldResolveKeys(context.project, item)) | ||
.forEach(item => resolver.resolveKeys(context.project, item, override)); | ||
} | ||
Object.values(context.project.reflections) | ||
@@ -1136,8 +1090,3 @@ .filter(item => resolver.shouldInlineKeys(context.project, item)) | ||
} | ||
KeyOfPlugin.options = [ | ||
keyofCommentsOption, | ||
]; | ||
__decorate([ | ||
utils.BindOption(keyofCommentsOption.name) | ||
], KeyOfPlugin.prototype, "_mode", void 0); | ||
KeyOfPlugin.options = []; | ||
@@ -1144,0 +1093,0 @@ const omitTagOption = { |
{ | ||
"name": "typedoc-plugin-typescript-declaration", | ||
"version": "0.2.13", | ||
"version": "0.3.0", | ||
"description": "Typedoc plugin to render to typescript declaration file", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63643
1456