Skip to content

Commit

Permalink
Fix JSDoc for __experimentalAddAnnotation (#22794)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocean90 authored Jun 2, 2020
1 parent 87fdc2c commit 7518908
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions packages/annotations/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
*/
import { v4 as uuid } from 'uuid';

/**
* @typedef WPAnnotationRange
*
* @property {number} start The offset where the annotation should start.
* @property {number} end The offset where the annotation should end.
*/

/**
* Adds an annotation to a block.
*
Expand All @@ -13,15 +20,13 @@ import { v4 as uuid } from 'uuid';
*
* The `range` property is only relevant if the selector is 'range'.
*
* @param {Object} annotation The annotation to add.
* @param {string} annotation.blockClientId The blockClientId to add the annotation to.
* @param {string} annotation.richTextIdentifier Identifier for the RichText instance the annotation applies to.
* @param {Object} annotation.range The range at which to apply this annotation.
* @param {number} annotation.range.start The offset where the annotation should start.
* @param {number} annotation.range.end The offset where the annotation should end.
* @param {string} annotation.[selector="range"] The way to apply this annotation.
* @param {string} annotation.[source="default"] The source that added the annotation.
* @param {string} annotation.[id] The ID the annotation should have. Generates a UUID by default.
* @param {Object} annotation The annotation to add.
* @param {string} annotation.blockClientId The blockClientId to add the annotation to.
* @param {string} annotation.richTextIdentifier Identifier for the RichText instance the annotation applies to.
* @param {WPAnnotationRange} annotation.range The range at which to apply this annotation.
* @param {string} [annotation.selector="range"] The way to apply this annotation.
* @param {string} [annotation.source="default"] The source that added the annotation.
* @param {string} [annotation.id] The ID the annotation should have. Generates a UUID by default.
*
* @return {Object} Action object.
*/
Expand Down

0 comments on commit 7518908

Please sign in to comment.