From 2b85d030b6708699f5011db14e5e3699d47e451c Mon Sep 17 00:00:00 2001 From: tay suisin Date: Thu, 24 Nov 2022 11:58:07 +0800 Subject: [PATCH 1/3] refactor: ts migration for poi/limited --- packages/account/globals.d.ts | 7 +++++++ .../__tests__/{limited.spec.js => limited.spec.tsx} | 0 .../account/src/Components/poi/status/limited/index.js | 2 +- .../poi/status/limited/{limited.jsx => limited.tsx} | 0 packages/account/tsconfig.json | 2 +- packages/components/stories/icon/icons.js | 2 +- 6 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 packages/account/globals.d.ts rename packages/account/src/Components/poi/status/limited/__tests__/{limited.spec.js => limited.spec.tsx} (100%) rename packages/account/src/Components/poi/status/limited/{limited.jsx => limited.tsx} (100%) diff --git a/packages/account/globals.d.ts b/packages/account/globals.d.ts new file mode 100644 index 000000000000..573ac87ae472 --- /dev/null +++ b/packages/account/globals.d.ts @@ -0,0 +1,7 @@ +export {}; + +declare global { + interface Window { + LC_API: any; + } +} diff --git a/packages/account/src/Components/poi/status/limited/__tests__/limited.spec.js b/packages/account/src/Components/poi/status/limited/__tests__/limited.spec.tsx similarity index 100% rename from packages/account/src/Components/poi/status/limited/__tests__/limited.spec.js rename to packages/account/src/Components/poi/status/limited/__tests__/limited.spec.tsx diff --git a/packages/account/src/Components/poi/status/limited/index.js b/packages/account/src/Components/poi/status/limited/index.js index 0857c9167422..0d81a71ea60a 100644 --- a/packages/account/src/Components/poi/status/limited/index.js +++ b/packages/account/src/Components/poi/status/limited/index.js @@ -1,3 +1,3 @@ -import { POILimited } from './limited.jsx'; +import { POILimited } from './limited'; export default POILimited; diff --git a/packages/account/src/Components/poi/status/limited/limited.jsx b/packages/account/src/Components/poi/status/limited/limited.tsx similarity index 100% rename from packages/account/src/Components/poi/status/limited/limited.jsx rename to packages/account/src/Components/poi/status/limited/limited.tsx diff --git a/packages/account/tsconfig.json b/packages/account/tsconfig.json index 1a92d82ee4aa..515e73541263 100644 --- a/packages/account/tsconfig.json +++ b/packages/account/tsconfig.json @@ -19,5 +19,5 @@ "@deriv/*": ["../*/src"] } }, - "include": ["src","globals.d.ts"] + "include": ["src", "*/globals.d.ts"] } diff --git a/packages/components/stories/icon/icons.js b/packages/components/stories/icon/icons.js index 8ec9cb6c33d1..99d75cba5a26 100644 --- a/packages/components/stories/icon/icons.js +++ b/packages/components/stories/icon/icons.js @@ -882,4 +882,4 @@ export const icons = 'IcWalletZingpayDark', 'IcWalletZingpayLight', ], -}; +} From 10a8da2dadc3841dd1ac6b7c7bcf06ba57d43d49 Mon Sep 17 00:00:00 2001 From: tay suisin Date: Fri, 25 Nov 2022 13:33:32 +0800 Subject: [PATCH 2/3] refactor: apply changes on globals.d.ts --- packages/account/globals.d.ts | 4 +++- packages/account/tsconfig.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/account/globals.d.ts b/packages/account/globals.d.ts index aac124e7739d..73759bd6fe18 100644 --- a/packages/account/globals.d.ts +++ b/packages/account/globals.d.ts @@ -1,7 +1,9 @@ export {}; declare global { interface Window { - LC_API: any; + LC_API: { + open_chat_window: VoidFunction; + }; } } declare module '*.svg' { diff --git a/packages/account/tsconfig.json b/packages/account/tsconfig.json index 16938f7358c3..47c77e6dd7de 100644 --- a/packages/account/tsconfig.json +++ b/packages/account/tsconfig.json @@ -20,5 +20,5 @@ "@deriv/*": ["../*/src"] } }, - "include": ["src", "*/globals.d.ts"] + "include": ["src", "globals.d.ts"] } From 3952f20ff117364ba51e5f7a0baa557244f4ad55 Mon Sep 17 00:00:00 2001 From: tay suisin Date: Fri, 25 Nov 2022 14:48:11 +0800 Subject: [PATCH 3/3] refactor: changed open_chat_window to packages/core/globals.d.ts --- packages/account/globals.d.ts | 8 -------- packages/core/global.d.ts | 1 + 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/account/globals.d.ts b/packages/account/globals.d.ts index 73759bd6fe18..60bd434c6f91 100644 --- a/packages/account/globals.d.ts +++ b/packages/account/globals.d.ts @@ -1,11 +1,3 @@ -export {}; -declare global { - interface Window { - LC_API: { - open_chat_window: VoidFunction; - }; - } -} declare module '*.svg' { const content: any; export default content; diff --git a/packages/core/global.d.ts b/packages/core/global.d.ts index 45154c088fbf..51f0e7548ac4 100644 --- a/packages/core/global.d.ts +++ b/packages/core/global.d.ts @@ -7,6 +7,7 @@ declare global { }; LC_API: { on_chat_ended: VoidFunction; + open_chat_window: VoidFunction; }; } }