Skip to content

Commit

Permalink
Merge pull request #10850 from ahocevar/enum-docs
Browse files Browse the repository at this point in the history
API docs for enums
  • Loading branch information
ahocevar committed Apr 1, 2020
2 parents 7dd42ef + dd44ecf commit 5e8102b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
12 changes: 5 additions & 7 deletions config/jsdoc/api/plugins/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ function includeAugments(doclet) {
});
}
cls._hideConstructor = true;
if (!cls.undocumented) {
cls._documented = true;
}
}
}
}
Expand Down Expand Up @@ -182,13 +179,14 @@ exports.handlers = {
doclet._hideConstructor = true;
includeAugments(doclet);
sortOtherMembers(doclet);
} else if (!doclet._hideConstructor
&& !(doclet.longname in defaultExports && byLongname[doclet.longname].some(d => d.isEnum))) {
} else if (!doclet._hideConstructor) {
// Remove all other undocumented symbols
doclet.undocumented = true;
}
if (doclet._documented) {
delete doclet.undocumented;
if (doclet.memberof && byLongname[doclet.memberof] &&
byLongname[doclet.memberof][0].isEnum &&
!byLongname[doclet.memberof][0].properties.some(p => p.stability)) {
byLongname[doclet.memberof][0].undocumented = true;
}
}
},
Expand Down
11 changes: 4 additions & 7 deletions config/jsdoc/api/template/tmpl/method.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var self = this;
<ul><?js fires.forEach(function(f) {
var parts = f.split(/#?event:/);
var type = parts.pop();
var eventClassName = parts[0];
var eventClass = self.find({longname: parts[0]})[0];
parts = type.split(' ');
type = parts.shift();
var description = parts.length ? parts.join(' ') : '';
Expand All @@ -74,12 +74,9 @@ var self = this;
}
?>
<li class="<?js= (eventDoclet || data).stability !== 'stable' ? 'unstable' : '' ?>">
<code><?js= eventClassName ? self.linkto(f, type) : type ?></code>
<?js if (eventClassName) {
var eventClass = self.find({longname: eventClassName})[0];
if (eventClass) { ?>
(<?js= self.linkto(eventClass.longname) ?>)
<?js } ?>
<code><?js= eventClass ? self.linkto(f, type) : type ?></code>
<?js if (eventClass) { ?>
(<?js= self.linkto(eventClass.longname) ?>)
<?js } ?>
<?js= self.partial('stability.tmpl', eventDoclet || (data.stability ? data : {})) ?>
<?js if (description) { ?> -
Expand Down
8 changes: 8 additions & 0 deletions src/ol/style/IconAnchorUnits.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
* @enum {string}
*/
export default {
/**
* Anchor is a fraction
* @api
*/
FRACTION: 'fraction',
/**
* Anchor is in pixels
* @api
*/
PIXELS: 'pixels'
};
16 changes: 16 additions & 0 deletions src/ol/style/IconOrigin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,24 @@
* @enum {string}
*/
export default {
/**
* Origin is at bottom left
* @api
*/
BOTTOM_LEFT: 'bottom-left',
/**
* Origin is at bottom right
* @api
*/
BOTTOM_RIGHT: 'bottom-right',
/**
* Origin is at top left
* @api
*/
TOP_LEFT: 'top-left',
/**
* Origin is at top right
* @api
*/
TOP_RIGHT: 'top-right'
};

0 comments on commit 5e8102b

Please sign in to comment.