From 75189088130ce6287b74342da2188837445b58aa Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Tue, 2 Jun 2020 07:01:35 +0200 Subject: [PATCH] Fix JSDoc for __experimentalAddAnnotation (#22794) --- packages/annotations/src/store/actions.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/annotations/src/store/actions.js b/packages/annotations/src/store/actions.js index 00c9fa589732af..e6f1e5b409dd0a 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. */