From 930e0f4ac382993450b74ad7018194dc833c3be2 Mon Sep 17 00:00:00 2001 From: Alex Munoz Date: Tue, 29 Jun 2021 20:06:13 +0200 Subject: [PATCH] Convert reactBatchedUpdates to TypeScript --- src/global.d.ts | 25 +++++++++++++++++++ ...ative.js => reactBatchedUpdates.native.ts} | 0 ...tchedUpdates.js => reactBatchedUpdates.ts} | 1 - 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/global.d.ts rename src/utils/{reactBatchedUpdates.native.js => reactBatchedUpdates.native.ts} (100%) rename src/utils/{reactBatchedUpdates.js => reactBatchedUpdates.ts} (55%) diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 000000000..b6a445318 --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1,25 @@ +declare module 'react-dom' { + export function unstable_batchedUpdates( + callback: (a: A, b: B) => any, + a: A, + b: B + ): void + export function unstable_batchedUpdates( + callback: (a: A) => any, + a: A + ): void + export function unstable_batchedUpdates(callback: () => any): void +} + +declare module 'react-native' { + export function unstable_batchedUpdates( + callback: (a: A, b: B) => any, + a: A, + b: B + ): void + export function unstable_batchedUpdates( + callback: (a: A) => any, + a: A + ): void + export function unstable_batchedUpdates(callback: () => any): void +} diff --git a/src/utils/reactBatchedUpdates.native.js b/src/utils/reactBatchedUpdates.native.ts similarity index 100% rename from src/utils/reactBatchedUpdates.native.js rename to src/utils/reactBatchedUpdates.native.ts diff --git a/src/utils/reactBatchedUpdates.js b/src/utils/reactBatchedUpdates.ts similarity index 55% rename from src/utils/reactBatchedUpdates.js rename to src/utils/reactBatchedUpdates.ts index 2a66a4428..0fca6d85e 100644 --- a/src/utils/reactBatchedUpdates.js +++ b/src/utils/reactBatchedUpdates.ts @@ -1,2 +1 @@ -/* eslint-disable import/no-unresolved */ export { unstable_batchedUpdates } from 'react-dom'