From acd61b71c3b952146f5153cb2d374bc0f0269224 Mon Sep 17 00:00:00 2001 From: Yauheni Pasiukevich Date: Thu, 24 Aug 2023 13:28:50 +0200 Subject: [PATCH] migrate user select styles to typescript --- .../userSelect/{index.native.js => index.native.ts} | 6 +++++- src/styles/utilities/userSelect/{index.js => index.ts} | 6 +++++- src/styles/utilities/userSelect/types.ts | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) rename src/styles/utilities/userSelect/{index.native.js => index.native.ts} (52%) rename src/styles/utilities/userSelect/{index.js => index.ts} (63%) create mode 100644 src/styles/utilities/userSelect/types.ts diff --git a/src/styles/utilities/userSelect/index.native.js b/src/styles/utilities/userSelect/index.native.ts similarity index 52% rename from src/styles/utilities/userSelect/index.native.js rename to src/styles/utilities/userSelect/index.native.ts index 0d1dfe97aa1d..0d1a34ef2473 100644 --- a/src/styles/utilities/userSelect/index.native.js +++ b/src/styles/utilities/userSelect/index.native.ts @@ -1,4 +1,6 @@ -export default { +import UserSelectStyles from './types'; + +const userSelect: UserSelectStyles = { userSelectText: { userSelect: 'text', }, @@ -6,3 +8,5 @@ export default { userSelect: 'none', }, }; + +export default userSelect; diff --git a/src/styles/utilities/userSelect/index.js b/src/styles/utilities/userSelect/index.ts similarity index 63% rename from src/styles/utilities/userSelect/index.js rename to src/styles/utilities/userSelect/index.ts index c6b71170cf14..6b9f26131b5e 100644 --- a/src/styles/utilities/userSelect/index.js +++ b/src/styles/utilities/userSelect/index.ts @@ -1,4 +1,6 @@ -export default { +import UserSelectStyles from './types'; + +const userSelect: UserSelectStyles = { userSelectText: { userSelect: 'text', WebkitUserSelect: 'text', @@ -8,3 +10,5 @@ export default { WebkitUserSelect: 'none', }, }; + +export default userSelect; diff --git a/src/styles/utilities/userSelect/types.ts b/src/styles/utilities/userSelect/types.ts new file mode 100644 index 000000000000..67a8c9c7b9b6 --- /dev/null +++ b/src/styles/utilities/userSelect/types.ts @@ -0,0 +1,5 @@ +import {CSSProperties} from 'react'; + +type UserSelectStyles = Record<'userSelectText' | 'userSelectNone', Partial>>; + +export default UserSelectStyles;