From 8779de0419ee311f7ee133a468801291890d57e9 Mon Sep 17 00:00:00 2001 From: Francisco Sales Date: Tue, 30 Apr 2024 12:54:57 +0100 Subject: [PATCH 1/2] fix: export provider ersi and algolia result types --- src/providers/algoliaProvider.ts | 16 ++++++++-------- src/providers/esriProvider.ts | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/providers/algoliaProvider.ts b/src/providers/algoliaProvider.ts index d37269a36..dd1e0e57c 100644 --- a/src/providers/algoliaProvider.ts +++ b/src/providers/algoliaProvider.ts @@ -5,7 +5,7 @@ import AbstractProvider, { SearchResult, } from './provider'; -interface RequestResult { +export interface RequestResult { hits: RawResult[]; } @@ -16,7 +16,7 @@ interface ValueMatch { fullyHighlighted?: boolean; } -interface RawResult { +export interface RawResult { country: { [key: string]: string }; country_code: string; city: { [key: string]: string[] }; @@ -86,21 +86,21 @@ export default class Provider extends AbstractProvider< return [ // Building + Street result.locale_names?.default[ - this.findBestMatchLevelIndex( - result._highlightResult.locale_names.default, - ) + this.findBestMatchLevelIndex( + result._highlightResult.locale_names.default, + ) ], // City result.city?.default[ - this.findBestMatchLevelIndex(result._highlightResult.city.default) + this.findBestMatchLevelIndex(result._highlightResult.city.default) ], // Administrative (State / Province) result.administrative[ - this.findBestMatchLevelIndex(result._highlightResult.administrative) + this.findBestMatchLevelIndex(result._highlightResult.administrative) ], // Zip code / Postal code result.postcode?.[ - this.findBestMatchLevelIndex(result._highlightResult.postcode) + this.findBestMatchLevelIndex(result._highlightResult.postcode) ], // Country result.country?.default, diff --git a/src/providers/esriProvider.ts b/src/providers/esriProvider.ts index 3816b7233..7fe96e372 100644 --- a/src/providers/esriProvider.ts +++ b/src/providers/esriProvider.ts @@ -4,12 +4,12 @@ import AbstractProvider, { SearchResult, } from './provider'; -interface RequestResult { +export interface RequestResult { spatialReference: { wkid: number; latestWkid: number }; locations: RawResult[]; } -interface RawResult { +export interface RawResult { name: string; extent: { xmin: number; From 48f2f69a4bf216dc9635ce212c916ac59614fd2d Mon Sep 17 00:00:00 2001 From: Stephan Meijer Date: Fri, 17 May 2024 21:13:22 +0200 Subject: [PATCH 2/2] chore: undo style changes --- src/providers/algoliaProvider.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/providers/algoliaProvider.ts b/src/providers/algoliaProvider.ts index dd1e0e57c..262f918f2 100644 --- a/src/providers/algoliaProvider.ts +++ b/src/providers/algoliaProvider.ts @@ -86,21 +86,21 @@ export default class Provider extends AbstractProvider< return [ // Building + Street result.locale_names?.default[ - this.findBestMatchLevelIndex( - result._highlightResult.locale_names.default, - ) + this.findBestMatchLevelIndex( + result._highlightResult.locale_names.default, + ) ], // City result.city?.default[ - this.findBestMatchLevelIndex(result._highlightResult.city.default) + this.findBestMatchLevelIndex(result._highlightResult.city.default) ], // Administrative (State / Province) result.administrative[ - this.findBestMatchLevelIndex(result._highlightResult.administrative) + this.findBestMatchLevelIndex(result._highlightResult.administrative) ], // Zip code / Postal code result.postcode?.[ - this.findBestMatchLevelIndex(result._highlightResult.postcode) + this.findBestMatchLevelIndex(result._highlightResult.postcode) ], // Country result.country?.default,