import { AfterViewInit, OnInit, OnDestroy, EventEmitter } from '@angular/core'; import { Widget } from '../base-widget'; import { InstantSearchOptions, InstantSearch } from 'instantsearch.js/es/types'; export declare type SearchRequest = { indexName: string; params: SearchRequestParameters; }; export declare type SearchForFacetValuesRequest = { indexName: string; params: SearchForFacetValuesRequestParameters; }; export declare type SearchParameters = { attributesToRetrieve?: string[]; restrictSearchableAttributes?: string[]; filters?: string; facetFilters?: string[]; optionalFilters?: string[]; numericFilters?: string[]; sumOrFiltersScores?: boolean; facets?: string[]; maxValuesPerFacet?: number; facetingAfterDistinct?: boolean; sortFacetValuesBy?: string; attributesToHighlight?: string[]; attributesToSnippet?: string[]; highlightPreTag?: string; highlightPostTag?: string; snippetEllipsisText?: string; restrictHighlightAndSnippetArrays?: boolean; page?: number; hitsPerPage?: number; offset?: number; length?: number; minWordSizefor1Typo?: number; minWordSizefor2Typos?: number; typoTolerance?: string | boolean; allowTyposOnNumericTokens?: boolean; ignorePlurals?: boolean | string[]; disableTypoToleranceOnAttributes?: string[]; aroundLatLng?: string; aroundLatLngViaIP?: boolean; aroundRadius?: number | 'all'; aroundPrecision?: number; minimumAroundRadius?: number; insideBoundingBox?: GeoRectangle | GeoRectangle[]; insidePolygon?: GeoPolygon | GeoPolygon[]; queryType?: string; removeWordsIfNoResults?: string; advancedSyntax?: boolean; optionalWords?: string | string[]; removeStopWords?: boolean | string[]; disableExactOnAttributes?: string[]; exactOnSingleWordQuery?: string; alternativesAsExact?: string[]; enableRules?: boolean; ruleContexts?: string[]; minProximity?: number; responseFields?: string[]; maxFacetHits?: number; percentileComputation?: boolean; distinct?: number | boolean; getRankingInfo?: boolean; clickAnalytics?: boolean; analytics?: boolean; analyticsTags?: string[]; synonyms?: boolean; replaceSynonymsInHighlight?: boolean; }; export interface SearchRequestParameters extends SearchParameters { query: string; } export interface SearchForFacetValuesRequestParameters extends SearchParameters { facetQuery: string; facetName: string; } export declare type GeoRectangle = [number, number, number, number]; export declare type GeoPolygon = [number, number, number, number, number, number]; export declare type FacetSortByStringOptions = 'count' | 'count:asc' | 'count:desc' | 'name' | 'name:asc' | 'name:desc' | 'isRefined'; export declare type SearchResponse = { hits: Hit[]; page?: number; nbHits?: number; nbPages?: number; hitsPerPage?: number; processingTimeMS?: number; query?: string; params?: string; index?: string; }; declare type HitAttributeHighlightResult = { value: string; matchLevel: 'none' | 'partial' | 'full'; matchedWords: string[]; fullyHighlighted?: boolean; }; declare type HitHighlightResult = { [attribute: string]: HitAttributeHighlightResult | HitAttributeHighlightResult[] | HitHighlightResult; }; declare type HitAttributeSnippetResult = Pick; declare type HitSnippetResult = { [attribute: string]: HitAttributeSnippetResult | HitAttributeSnippetResult[] | HitSnippetResult; }; export declare type Hit = { [attribute: string]: any; objectID: string; _highlightResult?: HitHighlightResult; _snippetResult?: HitSnippetResult; _rankingInfo?: { promoted: boolean; nbTypos: number; firstMatchedWord: number; proximityDistance?: number; geoDistance: number; geoPrecision?: number; nbExactWords: number; words: number; filters: number; userScore: number; matchedGeoLocation?: { lat: number; lng: number; distance: number; }; }; _distinctSeqID?: number; __position: number; __queryID?: string; }; export declare type SearchForFacetValuesResponse = { value: string; highlighted?: string; count?: number; }; export declare type SearchClient = { addAlgoliaAgent?: (agent: string) => void; search: (requests: SearchRequest[]) => Promise<{ results: SearchResponse[]; }>; searchForFacetValues?: (requests: SearchForFacetValuesRequest[]) => Promise<{ facetHits: SearchForFacetValuesResponse[]; }[]>; }; export declare type InstantSearchConfig = InstantSearchOptions; export declare type InstantSearchInstance = InstantSearch; export declare class NgAisInstantSearch implements AfterViewInit, OnInit, OnDestroy { platformId: Object; config: InstantSearchConfig; instanceName: string; change: EventEmitter<{ results: {}; state: {}; }>; instantSearchInstance: InstantSearchInstance; constructor(platformId: Object); ngOnInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; addWidgets(widgets: Widget[]): void; removeWidgets(widgets: Widget[]): void; refresh(): void; onRender: () => void; } export {};