Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RichText: Add missing param docs for getActiveFormats() #23160

Merged
merged 3 commits into from
Jun 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/rich-text/src/get-active-formats.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/**
* Gets the all format objects at the start of the selection.
*
* @param {Object} value Value to inspect.
* @param {Array} EMPTY_ACTIVE_FORMATS Array to return if there are no active
* formats.
* @param {Object} value Value to inspect.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as your other PR, it would be good to create a type for a rich text value, then use it an all the other documentation. Might be good to also combine all rich text documentation updates into one PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://jsdoc.app/tags-typedef.html for type definitions. This would definitely be useful as this rich text value types is used numerous times.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR fixes existing warnings, can we merge it as is? The issue you mentioned existed before.

Copy link
Contributor Author

@kishanjasani kishanjasani Jun 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, This PR fixed the existing warning issue. But @ellatrix tells something about typedef.

* @param {Array<Array>} value.formats Formats object data values.
* @param {number} value.start Index to start from.
* @param {number} value.end Index to end.
* @param {Array} value.activeFormats Array to return if there are active formats.
* @param {Array} EMPTY_ACTIVE_FORMATS Array to return if there are no active
* formats.
*
* @return {?Object} Active format objects.
*/
Expand Down