Skip to content

Commit

Permalink
fix: typo error text.wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
yolopunk committed Mar 14, 2024
1 parent 88aee8a commit d8f7d77
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/api-constructor.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ where the overall height is the `pageHeight` multiplied by the number of `pages`
| [options.text.dpi] | <code>number</code> | <code>72</code> | the resolution (size) at which to render the text. Does not take effect if `height` is specified. |
| [options.text.rgba] | <code>boolean</code> | <code>false</code> | set this to true to enable RGBA output. This is useful for colour emoji rendering, or support for pango markup features like `<span foreground="red">Red!</span>`. |
| [options.text.spacing] | <code>number</code> | <code>0</code> | text line height in points. Will use the font line height if none is specified. |
| [options.text.wrap] | <code>string</code> | <code>&quot;&#x27;word&#x27;&quot;</code> | word wrapping style when width is provided, one of: 'word', 'char', 'charWord' (prefer char, fallback to word) or 'none'. |
| [options.text.wrap] | <code>string</code> | <code>&quot;&#x27;word&#x27;&quot;</code> | word wrapping style when width is provided, one of: 'word', 'char', 'wordChar' (prefer char, fallback to word) or 'none'. |

**Example**
```js
Expand Down
2 changes: 1 addition & 1 deletion lib/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const debuglog = util.debuglog('sharp');
* @param {number} [options.text.dpi=72] - the resolution (size) at which to render the text. Does not take effect if `height` is specified.
* @param {boolean} [options.text.rgba=false] - set this to true to enable RGBA output. This is useful for colour emoji rendering, or support for pango markup features like `<span foreground="red">Red!</span>`.
* @param {number} [options.text.spacing=0] - text line height in points. Will use the font line height if none is specified.
* @param {string} [options.text.wrap='word'] - word wrapping style when width is provided, one of: 'word', 'char', 'charWord' (prefer char, fallback to word) or 'none'.
* @param {string} [options.text.wrap='word'] - word wrapping style when width is provided, one of: 'word', 'char', 'wordChar' (prefer char, fallback to word) or 'none'.
* @returns {Sharp}
* @throws {Error} Invalid parameters
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ declare namespace sharp {
rgba?: boolean;
/** Text line height in points. Will use the font line height if none is specified. (optional, default `0`) */
spacing?: number;
/** Word wrapping style when width is provided, one of: 'word', 'char', 'charWord' (prefer char, fallback to word) or 'none' */
/** Word wrapping style when width is provided, one of: 'word', 'char', 'wordChar' (prefer char, fallback to word) or 'none' */
wrap?: TextWrap;
}

Expand Down Expand Up @@ -1613,7 +1613,7 @@ declare namespace sharp {

type TextAlign = 'left' | 'centre' | 'center' | 'right';

type TextWrap = 'word' | 'char' | 'charWord' | 'none';
type TextWrap = 'word' | 'char' | 'wordChar' | 'none';

type TileContainer = 'fs' | 'zip';

Expand Down
2 changes: 1 addition & 1 deletion test/types/sharp.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ sharp({
rgba: true,
justify: true,
spacing: 10,
wrap: 'charWord',
wrap: 'wordChar',
},
})
.png()
Expand Down

0 comments on commit d8f7d77

Please sign in to comment.