diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index dcc1fdcc9e..2a3fcd2eb2 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -9,8 +9,8 @@ import { Response, IndexSettings, QueryParameters, + Client } from 'algoliasearch'; -import { Client } from './lite'; let _algoliaResponse: Response = { hits: [{}, {}], @@ -149,7 +149,7 @@ let _algoliaQueryParameters: QueryParameters = { }; let client: Client = algoliasearch('', ''); -let index: Index = algoliasearch('', '').initIndex(''); +let index: Index = client.initIndex(''); let search = index.search({ query: '' }); @@ -170,8 +170,8 @@ index.partialUpdateObjects([{}], false).then(() => {}); let indexName : string = index.indexName; // complete copy -algoliasearch('','').copyIndex('from', 'to').then(()=>{}) -algoliasearch('','').copyIndex('from', 'to', ()=> {}) +client.copyIndex('from', 'to').then(()=>{}) +client.copyIndex('from', 'to', ()=> {}) // with scope -algoliasearch('','').copyIndex('from', 'to', ['settings']).then(()=>{}) -algoliasearch('','').copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {}) +client.copyIndex('from', 'to', ['settings']).then(()=>{}) +client.copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {}) diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index 588e2ac543..1bb8254de9 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -67,6 +67,7 @@ declare namespace algoliasearch { * Interface for the index algolia object */ interface Index { + indexName: string; /** * Gets a specific object * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects