From a36bb6891a65c87b7b35be5240db1106594c2c8d Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Mon, 14 May 2018 13:48:42 +0200 Subject: [PATCH] chore: stricter settings type --- types/algoliasearch/algoliasearch-tests.ts | 4 ++-- types/algoliasearch/index.d.ts | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index 2a3fcd2eb2..96270b31eb 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -79,7 +79,7 @@ let _algoliaIndexSettings: IndexSettings = { ignorePlurals: false, disableTypoToleranceOnAttributes: '', separatorsToIndex: '', - queryType: '', + queryType: 'prefixAll', removeWordsIfNoResults: '', advancedSyntax: false, optionalWords: [''], @@ -87,7 +87,7 @@ let _algoliaIndexSettings: IndexSettings = { disablePrefixOnAttributes: [''], disableExactOnAttributes: [''], exactOnSingleWordQuery: '', - alternativesAsExact: false, + alternativesAsExact: ['ignorePlurals'], attributeForDistinct: '', distinct: false, numericAttributesToIndex: [''], diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 21ad90e665..ba46f37ce6 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1619,7 +1619,7 @@ declare namespace algoliasearch { * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. * https://github.com/algolia/algoliasearch-client-js#typotolerance */ - typoTolerance?: any; + typoTolerance?: boolean | 'min' | 'strict'; /** * If set to false, disables typo tolerance on numeric tokens (numbers). * default: true @@ -1652,7 +1652,7 @@ declare namespace algoliasearch { * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. * https://github.com/algolia/algoliasearch-client-js#querytype */ - queryType?: any; + queryType?: 'prefixAll' | 'prefixLast' | 'prefixNone'; /** * This option is used to select a strategy in order to avoid having an empty result page * default: 'none' @@ -1718,7 +1718,10 @@ declare namespace algoliasearch { * 'multiWordsSynonym': multiple-words synonym * https://github.com/algolia/algoliasearch-client-js#alternativesasexact */ - alternativesAsExact?: any; + alternativesAsExact?: ( + | "ignorePlurals" + | "singleWordSynonym" + | "multiWordsSynonym")[]; /** * The name of the attribute used for the Distinct feature * default: null @@ -1729,7 +1732,7 @@ declare namespace algoliasearch { * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. * https://github.com/algolia/algoliasearch-client-js#distinct */ - distinct?: any; + distinct?: boolean | number; /** * All numerical attributes are automatically indexed as numerical filters * default ''