diff --git a/packages/annotations/src/store/actions.js b/packages/annotations/src/store/actions.js index 00c9fa589732a..e6f1e5b409dd0 100644 --- a/packages/annotations/src/store/actions.js +++ b/packages/annotations/src/store/actions.js @@ -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. * @@ -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. */