Fix observable properties documentation

This commit is contained in:
ahocevar
2019-07-14 10:15:00 +02:00
parent 5222a0ffd6
commit b6bd35c15c
2 changed files with 19 additions and 3 deletions

View File

@@ -31,6 +31,24 @@ function hasApiMembers(doclet) {
} }
function includeAugments(doclet) { function includeAugments(doclet) {
// Make sure that `observables` and `fires` are taken from an already processed `class` doclet.
// This is necessary because JSDoc generates multiple doclets with the same longname.
const cls = classes[doclet.longname];
if (cls.observables && !doclet.observables) {
doclet.observables = cls.observables;
}
if (doclet.fires && cls.fires) {
for (let i = 0, ii = cls.fires.length; i < ii; ++i) {
const fires = cls.fires[i];
if (doclet.fires.indexOf(fires) == -1) {
doclet.fires.push(fires);
}
}
}
if (cls.fires && !doclet.fires) {
doclet.fires = cls.fires;
}
const augments = doclet.augments; const augments = doclet.augments;
if (augments) { if (augments) {
let cls; let cls;
@@ -148,7 +166,7 @@ exports.handlers = {
// constructor from the docs. // constructor from the docs.
doclet._hideConstructor = true; doclet._hideConstructor = true;
includeAugments(doclet); includeAugments(doclet);
} else if (doclet.undocumented !== false && !doclet._hideConstructor && !(doclet.kind == 'typedef' && doclet.longname in types)) { } else if (!doclet._hideConstructor && !(doclet.kind == 'typedef' && doclet.longname in types)) {
// Remove all other undocumented symbols // Remove all other undocumented symbols
doclet.undocumented = true; doclet.undocumented = true;
} }

View File

@@ -1147,7 +1147,6 @@ class View extends BaseObject {
* constraint will apply. * constraint will apply.
* @param {number} ratio The ratio to apply on the view resolution. * @param {number} ratio The ratio to apply on the view resolution.
* @param {import("./coordinate.js").Coordinate=} opt_anchor The origin of the transformation. * @param {import("./coordinate.js").Coordinate=} opt_anchor The origin of the transformation.
* @observable
* @api * @api
*/ */
adjustResolution(ratio, opt_anchor) { adjustResolution(ratio, opt_anchor) {
@@ -1179,7 +1178,6 @@ class View extends BaseObject {
* constraint will apply. * constraint will apply.
* @param {number} delta Relative value to add to the zoom rotation, in radians. * @param {number} delta Relative value to add to the zoom rotation, in radians.
* @param {import("./coordinate.js").Coordinate=} opt_anchor The rotation center. * @param {import("./coordinate.js").Coordinate=} opt_anchor The rotation center.
* @observable
* @api * @api
*/ */
adjustRotation(delta, opt_anchor) { adjustRotation(delta, opt_anchor) {