Skip to content

Commit a6e9ba2

Browse files
committed
add TextDecorationType
1 parent bdbc10f commit a6e9ba2

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

__TESTS__/unit/values/TextStyle/TextStyle.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ describe('Text Style tests', () => {
4242
.fontAntialias("good")
4343
.fontWeight("bold")
4444
.fontStyle("italic")
45+
.textDecoration("strikethrough")
4546
.textAlignment("center")
4647
.toString();
47-
expect(res).toBe('arial_50_bold_italic_center_antialias_good');
48+
expect(res).toBe('arial_50_bold_italic_strikethrough_center_antialias_good');
4849
});
4950

5051
it('Create a new instance with stroke solid', () => {

src/qualifiers/textStyle.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {normal as normalFontWeight} from "./fontWeight";
22
import {normal as normalFontStyle} from "./fontStyle";
33
import {normal as normalTextDecoration} from "./textDecoration";
44
import {serializeCloudinaryCharacters} from "../internal/utils/serializeCloudinaryCharacters";
5-
import {FontAntialiasType, FontWeightType, TextAlignmentType} from "../types/types";
5+
import {FontAntialiasType, FontWeightType, TextAlignmentType, TextDecorationType} from "../types/types";
66

77
/**
88
* @summary qualifier
@@ -110,9 +110,9 @@ class TextStyle {
110110

111111
/**
112112
*
113-
* @param {string} textDecoration The font decoration type.
113+
* @param {TextDecorationType|string} textDecoration The font decoration type.
114114
*/
115-
textDecoration(textDecoration: 'normal' | 'underline' | 'strikethrough' | string): this {
115+
textDecoration(textDecoration: TextDecorationType | string): this {
116116
this._textDecoration = textDecoration;
117117
return this;
118118
}

src/types/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ export type TextAlignmentType =
297297
'start' |
298298
'justify';
299299

300+
export type TextDecorationType =
301+
'normal' |
302+
'underline' |
303+
'strikethrough';
304+
300305
export type GradientDirectionType =
301306
"horizontal"|
302307
"vertical"|

0 commit comments

Comments
 (0)