Skip to content

Commit f52f895

Browse files
committed
[INTERNAL] lib/processors/jsdoc: support optional methods also in classes
So far, the documentation build only allowed optional methods in interfaces. But UI5 in several places specifies methods on a base class level without implementing them. Subclasses can then implement such a method to get a certain behavior (example: Control#getAccessibilityInfo). TypeScript (meanwhile?) allows to describe this as optional methods in the base class. To allow to use this and thereby to better describe those methods in the TypeScript types, the JSDoc template lifts its limitation and writes out the 'optional' marker also for methods in classes. Note: this is now even possible for static class methods, although this is not used yet in the framework. Cherry-picked from SAP/openui5@a7ccde144.
1 parent 0d2e62c commit f52f895

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/processors/jsdoc/lib/ui5/template/publish.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2308,7 +2308,7 @@ function createAPIJSON4Symbol(symbol, omitDefaults) {
23082308
if ( symbol.__ui5.stereotype !== 'xmlmacro' && ownMethods.length > 0 ) {
23092309
collection("methods");
23102310
ownMethods.forEach(function(member) {
2311-
writeMethod(member, undefined, symbol.kind === 'interface');
2311+
writeMethod(member, undefined, symbol.kind === 'interface' || symbol.kind === 'class');
23122312
if ( member.__ui5.members ) {
23132313
// HACK: export nested static functions as siblings of the current function
23142314
// A correct representation has to be discussed with the SDK / WebIDE

0 commit comments

Comments
 (0)