From c1734c63f6e985e4ab7e6bd2c8cfadaae3bb0bd1 Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Thu, 24 Aug 2023 11:55:55 +0200 Subject: [PATCH 1/4] migrate textUnderline to TypeScript --- src/styles/utilities/textUnderline/index.js | 9 --------- src/styles/utilities/textUnderline/index.native.js | 4 ---- src/styles/utilities/textUnderline/index.native.ts | 5 +++++ src/styles/utilities/textUnderline/index.ts | 12 ++++++++++++ src/styles/utilities/textUnderline/types.ts | 5 +++++ 5 files changed, 22 insertions(+), 13 deletions(-) delete mode 100644 src/styles/utilities/textUnderline/index.js delete mode 100644 src/styles/utilities/textUnderline/index.native.js create mode 100644 src/styles/utilities/textUnderline/index.native.ts create mode 100644 src/styles/utilities/textUnderline/index.ts create mode 100644 src/styles/utilities/textUnderline/types.ts diff --git a/src/styles/utilities/textUnderline/index.js b/src/styles/utilities/textUnderline/index.js deleted file mode 100644 index 3ec9ce507765..000000000000 --- a/src/styles/utilities/textUnderline/index.js +++ /dev/null @@ -1,9 +0,0 @@ -const textUnderlinePositionUnder = { - textUnderlinePosition: 'under', -}; - -const textDecorationSkipInkNone = { - textDecorationSkipInk: 'none', -}; - -export default {textUnderlinePositionUnder, textDecorationSkipInkNone}; diff --git a/src/styles/utilities/textUnderline/index.native.js b/src/styles/utilities/textUnderline/index.native.js deleted file mode 100644 index ce2e2e7d6c20..000000000000 --- a/src/styles/utilities/textUnderline/index.native.js +++ /dev/null @@ -1,4 +0,0 @@ -// following styles are not supported -const textUnderlinePositionUnder = {}; -const textDecorationSkipInkNone = {}; -export default {textUnderlinePositionUnder, textDecorationSkipInkNone}; diff --git a/src/styles/utilities/textUnderline/index.native.ts b/src/styles/utilities/textUnderline/index.native.ts new file mode 100644 index 000000000000..d5ff82e3cdd7 --- /dev/null +++ b/src/styles/utilities/textUnderline/index.native.ts @@ -0,0 +1,5 @@ +import TextUnderlineStyles from './types'; + +const textUnderline: TextUnderlineStyles = {}; + +export default textUnderline; diff --git a/src/styles/utilities/textUnderline/index.ts b/src/styles/utilities/textUnderline/index.ts new file mode 100644 index 000000000000..2fbf6e0e354c --- /dev/null +++ b/src/styles/utilities/textUnderline/index.ts @@ -0,0 +1,12 @@ +import TextUnderlineStyles from './types'; + +const textUnderline: TextUnderlineStyles = { + textUnderlinePositionUnder: { + textUnderlinePosition: 'under', + }, + textDecorationSkipInkNone: { + textDecorationSkipInk: 'none', + }, +}; + +export default textUnderline; diff --git a/src/styles/utilities/textUnderline/types.ts b/src/styles/utilities/textUnderline/types.ts new file mode 100644 index 000000000000..da52926abf23 --- /dev/null +++ b/src/styles/utilities/textUnderline/types.ts @@ -0,0 +1,5 @@ +import {CSSProperties} from 'react'; + +type TextUnderlineStyles = Partial>>>; + +export default TextUnderlineStyles; From 35e2b92e70f11abed342b0689af049d110d51612 Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Thu, 24 Aug 2023 12:01:24 +0200 Subject: [PATCH 2/4] improve types --- src/styles/utilities/textUnderline/index.native.ts | 5 ++++- src/styles/utilities/textUnderline/types.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/styles/utilities/textUnderline/index.native.ts b/src/styles/utilities/textUnderline/index.native.ts index d5ff82e3cdd7..5656e4ff133e 100644 --- a/src/styles/utilities/textUnderline/index.native.ts +++ b/src/styles/utilities/textUnderline/index.native.ts @@ -1,5 +1,8 @@ import TextUnderlineStyles from './types'; -const textUnderline: TextUnderlineStyles = {}; +const textUnderline: TextUnderlineStyles = { + textUnderlinePositionUnder: {}, + textDecorationSkipInkNone: {}, +}; export default textUnderline; diff --git a/src/styles/utilities/textUnderline/types.ts b/src/styles/utilities/textUnderline/types.ts index da52926abf23..10ad0dd46d52 100644 --- a/src/styles/utilities/textUnderline/types.ts +++ b/src/styles/utilities/textUnderline/types.ts @@ -1,5 +1,5 @@ import {CSSProperties} from 'react'; -type TextUnderlineStyles = Partial>>>; +type TextUnderlineStyles = Record<'textUnderlinePositionUnder' | 'textDecorationSkipInkNone', Partial>>; export default TextUnderlineStyles; From ef2ff20a3af1e2f4d5cf3633a4ba9ff2618610ba Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Thu, 24 Aug 2023 12:02:10 +0200 Subject: [PATCH 3/4] bring back the comment --- src/styles/utilities/textUnderline/index.native.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles/utilities/textUnderline/index.native.ts b/src/styles/utilities/textUnderline/index.native.ts index 5656e4ff133e..b3acbb48d01c 100644 --- a/src/styles/utilities/textUnderline/index.native.ts +++ b/src/styles/utilities/textUnderline/index.native.ts @@ -1,5 +1,6 @@ import TextUnderlineStyles from './types'; +// following styles are not supported const textUnderline: TextUnderlineStyles = { textUnderlinePositionUnder: {}, textDecorationSkipInkNone: {}, From e21f6ad500fdfaabb7e0f492095d3db59af58826 Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Thu, 24 Aug 2023 15:52:58 +0200 Subject: [PATCH 4/4] increase type accuracy --- src/styles/utilities/textUnderline/types.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/styles/utilities/textUnderline/types.ts b/src/styles/utilities/textUnderline/types.ts index 10ad0dd46d52..ecc09ed0fe09 100644 --- a/src/styles/utilities/textUnderline/types.ts +++ b/src/styles/utilities/textUnderline/types.ts @@ -1,5 +1,8 @@ import {CSSProperties} from 'react'; -type TextUnderlineStyles = Record<'textUnderlinePositionUnder' | 'textDecorationSkipInkNone', Partial>>; +type TextUnderlineStyles = { + textUnderlinePositionUnder: Pick; + textDecorationSkipInkNone: Pick; +}; export default TextUnderlineStyles;