From c047c3cfcdfa2a52df27d723b8239896833b221b Mon Sep 17 00:00:00 2001 From: Mikel Arnaiz Date: Tue, 25 Sep 2018 10:38:44 +0200 Subject: [PATCH] Adds interface for fetchUpdateAsync() params --- types/expo/expo-tests.tsx | 2 +- types/expo/index.d.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 1858faa549..2e9aa07198 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -834,7 +834,7 @@ async () => { console.log(updateCheckResult.manifest); } - Updates.fetchUpdateAsync(updateEventListener); + Updates.fetchUpdateAsync({ eventListener: updateEventListener }); const bundleFetchResult = await Updates.fetchUpdateAsync(); diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 36afc712ab..4633a83dd7 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -2915,6 +2915,11 @@ export namespace Updates { message?: string; } + /** An optional params object passed to fetchUpdateAsync. */ + interface FetchUpdateAsyncParams { + eventListener: UpdateEventListener; + } + type UpdateEventListener = (event: UpdateEvent) => any; /** @@ -2934,7 +2939,7 @@ export namespace Updates { * Downloads the most recent published version of your experience to the device's local cache. * Rejects if `updates.enabled` is `false` in app.json. */ - function fetchUpdateAsync(listener?: UpdateEventListener): Promise; + function fetchUpdateAsync(params?: FetchUpdateAsyncParams): Promise; /** * Immediately reloads the current experience.