From 44b53c0f1e75b1ca625962af3aa8fb87d6315a20 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Mon, 14 May 2018 13:43:08 +0200 Subject: [PATCH] chore: add more info about tasks --- types/algoliasearch/index.d.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index b2e8f95663..21ad90e665 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -340,7 +340,7 @@ declare namespace algoliasearch { * Wait for an indexing task to be compete * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask */ - waitTask(taskID: number, cb: (err: Error, res: any) => void): void; + waitTask(taskID: number, cb: (err: Error, res: TaskStatus) => void): void; /** * Get an index settings * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings @@ -572,7 +572,7 @@ declare namespace algoliasearch { * Wait for an indexing task to be compete * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask */ - waitTask(taskID: number): Promise; + waitTask(taskID: number): Promise; /** * Get an index settings * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings @@ -1492,6 +1492,13 @@ declare namespace algoliasearch { interface Task { taskID: number; + createdAt: string; + objectID?: string; + } + + interface TaskStatus { + status: 'published' | 'notPublished', + pendingTask: boolean, } interface IndexSettings {