From b268ca16110411adbdc5541e4cdd781153277a43 Mon Sep 17 00:00:00 2001 From: Luca Pasquale Date: Thu, 4 Apr 2019 19:11:11 -0300 Subject: [PATCH 1/2] added forwardToReplicas to setSettings --- types/algoliasearch/algoliasearch-tests.ts | 5 +++++ types/algoliasearch/index.d.ts | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index fa6e29dbab..4c68a75831 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -207,6 +207,11 @@ browser.on('error', function onError(err) { browser.stop(); +index.setSettings({ hitsPerPage: 10 }, () => {}) +index.setSettings({ hitsPerPage: 10 }, { forwardToReplicas: true }, () => {}) +index.setSettings({ hitsPerPage: 10 }).then(() => {}) +index.setSettings({ hitsPerPage: 10 }, { forwardToReplicas: true }).then(() => {}) + index.browse("", { advancedSyntax: false, attributesToRetrieve: ['dogs'] diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 86cedc9b93..48aaa629ac 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -359,6 +359,15 @@ declare namespace algoliasearch { settings: IndexSettings, cb: (err: Error, res: Task) => void ): void; + /** + * Set an index settings + * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings + */ + setSettings( + settings: IndexSettings, + extra: { forwardToReplicas: boolean }, + cb: (err: Error, res: Task) => void + ): void; /** * Clear cache of an index * https://github.com/algolia/algoliasearch-client-js#cache @@ -587,7 +596,7 @@ declare namespace algoliasearch { * Set an index settings * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings */ - setSettings(settings: IndexSettings): Promise; + setSettings(settings: IndexSettings, extra?: { forwardToReplicas: boolean }): Promise; /** * Search in an index * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search From d84bde067902441343a8a8fa99e587863db1fb8a Mon Sep 17 00:00:00 2001 From: Luca Pasquale Date: Thu, 4 Apr 2019 19:17:19 -0300 Subject: [PATCH 2/2] added myself to list of contributers --- types/algoliasearch/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 48aaa629ac..8c32304c9e 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -7,6 +7,7 @@ // Kai Eichinger // Nery Ortez // Antoine Rousseau +// Luca Pasquale // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8