Skip to content

Commit

Permalink
Remove non nullable type that wasn't needed
Browse files Browse the repository at this point in the history
  • Loading branch information
noahtallen committed Apr 7, 2023
1 parent 96ea218 commit eceb797
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/rich-text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ none are provided.

_Parameters_

- _value_ `RichTextValue & RichTextNonNullable`: Value to modify.
- _value_ `RichTextValue`: Value to modify.
- _valueToInsert_ `RichTextValue|string`: Value to insert.
- _startIndex_ `[number]`: Start index.
- _endIndex_ `[number]`: End index.
Expand Down
14 changes: 4 additions & 10 deletions packages/rich-text/src/insert.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,16 @@ import { normaliseFormats } from './normalise-formats';

/** @typedef {import('./create').RichTextValue} RichTextValue */

/**
* @typedef RichTextNonNullable
* @property {NonNullable< RichTextValue[ 'start' ] >} start Start index.
* @property {NonNullable< RichTextValue[ 'end' ] >} end End index.
*/

/**
* Insert a Rich Text value, an HTML string, or a plain text string, into a
* Rich Text value at the given `startIndex`. Any content between `startIndex`
* and `endIndex` will be removed. Indices are retrieved from the selection if
* none are provided.
*
* @param {RichTextValue & RichTextNonNullable} value Value to modify.
* @param {RichTextValue|string} valueToInsert Value to insert.
* @param {number} [startIndex] Start index.
* @param {number} [endIndex] End index.
* @param {RichTextValue} value Value to modify.
* @param {RichTextValue|string} valueToInsert Value to insert.
* @param {number} [startIndex] Start index.
* @param {number} [endIndex] End index.
*
* @return {RichTextValue} A new value with the value inserted.
*/
Expand Down

0 comments on commit eceb797

Please sign in to comment.