// Generated by dts-bundle-generator v9.5.1 import Awesomplete$1 from 'awesomplete'; import { Feature, FeatureCollection, Geometry, Point } from 'geojson'; import { LatLngBoundsExpression, LatLngLiteral } from 'leaflet'; export interface TypedEventTarget extends EventTarget { addEventListener(type: K, callback: (event: EventMap[K] extends Event ? EventMap[K] : never) => EventMap[K] extends Event ? void : never, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; } declare abstract class EventTargetAdapter implements TypedEventTarget { private eventTarget; constructor(); addEventListener(type: K, callback: (event: TEventMap[K] extends Event ? TEventMap[K] : never) => TEventMap[K] extends Event ? void : never, options?: boolean | AddEventListenerOptions | undefined): void; addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined): void; dispatchEvent(event: Event): boolean; removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined): void; } export type ApiSourceUrl = string; export type ApiSourceCallback = (currentLocation?: Location | URL | { hostname?: string; protocol: "http:" | "https:"; }) => ApiSourceUrl; export type ApiSource = ApiSourceUrl | ApiSourceCallback; export type LatLngBoundsLiteral = LatLngTuple[]; type LatLngBoundsExpression$1 = LatLngBoundsLiteral; interface LatLngLiteral$1 { lat: number; lng: number; alt?: number; } export type LatLngTuple = [ number, number, number? ]; export type LatLngExpression = LatLngLiteral$1 | LatLngTuple; export interface SmartmapsGeolocationCoordinates extends Partial> { readonly latitude: number; readonly longitude: number; } export interface SmartmapsGeolocationPosition extends Partial> { readonly coords: SmartmapsGeolocationCoordinates; } export type SmartmapsPointExpression = LatLngExpression | SmartmapsGeolocationCoordinates | SmartmapsGeolocationPosition; export interface SmartmapsBoundsLiteral { southWest: LatLngLiteral$1; northEast: LatLngLiteral$1; } export type SmartmapsBoundsExpression = LatLngBoundsExpression$1 | SmartmapsBoundsLiteral; export interface Settings { rootUrl: string; name?: string; channel?: string; } export interface AutocompleteOptionsBase { className?: string; suggestionItemAlign?: "rows" | "columns" | "auto"; url?: string; radius?: number; isoCountries?: string[]; isoLanguages?: string[]; positionIsFixed?: boolean; iconColor?: string; iconAltColor?: string; searchIconPosition?: "left" | "right" | "none"; enableSearchOnClick?: boolean; debug?: boolean; } export interface AutocompleteBase { options: Options; session: AutocompleteSession; isReady: boolean; center: LatLngLiteral | undefined; radius: number; bounds: SmartmapsBoundsLiteral | undefined; open(): void; close(): void; findAddress(query: RequestQuery, address: RequestQuery, done?: (data: unknown) => void): Promise> | void; whenReady(onReady?: (err?: Error) => void): void; setMap(map: unknown): void; updateMap(): void; removeMap(): void; setCenter(latlng: SmartmapsPointExpression, radius?: number): void; getCenter(): LatLngLiteral | undefined; setBounds(latLngBounds: SmartmapsBoundsExpression): void; getBounds(): LatLngBoundsExpression | undefined; } export type AutocompleteServiceProvider = "smartmaps" | "google"; export interface ApiServiceAddressItems { primaryLine: string; secondaryLine: string; } export interface ApiService { apiKey: string; initialize(session: AutocompleteSession, autocomplete: AutocompleteBase): Promise; fetch(query: RequestQuery): Promise>; createAddressItems(props: Partial): ApiServiceAddressItems; } export interface AutocompleteRequestQueryBase { Locales: string; Query: string; State?: string; District?: string; Zip?: string; City?: string; CityPart?: string; Street?: string; Count: number; AuthToken: string; UpperRightLat?: number; UpperRightLon?: number; LowerLeftLat?: number; LowerLeftLon?: number; } export interface AutocompleteSuggestionProperties { status: "Result" | "Empty" | "Aborted"; } export interface AutocompleteSuggestionCollection extends FeatureCollection { properties: AutocompleteSuggestionProperties; } declare class AutocompleteSession { private delay; private _lastUpdate; private _strategy; private _token; private _ready; currentUpdate: Promise; get token(): string; constructor(apiKey: string, provider: AutocompleteServiceProvider, delay?: number); update(): Promise; interval(): void; } export type SelectEvent = { text: { label: string; value: TValue; }; }; export interface ISelectCompleteStrategy { onSelect(geojson: FeatureCollection, event: SelectEvent, emitter?: EventTarget | EventTargetAdapter): F["properties"] | undefined; } declare class SelectByCoordsStrategy implements ISelectCompleteStrategy { private findByCoords; onSelect(geoJson: FeatureCollection, event: SelectEvent, emitter?: EventTarget | EventTargetAdapter): T["properties"] | undefined; } interface TypedEventTarget$1 extends EventTarget { addEventListener(type: K, callback: (event: EventMap[K] extends Event ? EventMap[K] : never) => EventMap[K] extends Event ? void : never, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; } declare abstract class EventTargetAdapter$1 implements TypedEventTarget$1 { private eventTarget; constructor(); addEventListener(type: K, callback: (event: TEventMap[K] extends Event ? TEventMap[K] : never) => TEventMap[K] extends Event ? void : never, options?: boolean | AddEventListenerOptions | undefined): void; addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined): void; dispatchEvent(event: Event): boolean; removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions | undefined): void; } declare abstract class AutoComplete extends EventTargetAdapter$1 implements AutocompleteBase { protected api: ApiService; private selectStrategy?; options: Options; isReady: boolean; center: LatLngLiteral | undefined; radius: number; bounds: SmartmapsBoundsLiteral | undefined; session: AutocompleteSession; protected inputElement: HTMLInputElement; private map; private currentHandler; autocomplete: Awesomplete$1; constructor(element: string | HTMLInputElement, options: Options, api: ApiService, selectStrategy?: SelectByCoordsStrategy>); update(): void; open(): void; close(): void; findAddress(query: RequestQuery, address: RequestQuery, done?: (data: any) => void): Promise> | void; setMap(map: any): void; updateMap(): void; setCenter(latlng: SmartmapsPointExpression, radius?: number): void; setBounds(latLngBounds: SmartmapsBoundsExpression): void; getCenter(): LatLngLiteral | undefined; getBounds(): LatLngBoundsExpression | undefined; removeMap(): void; whenReady(onReady?: (err?: Error) => void): Promise | void; protected abstract fetch(query: RequestQuery): Promise>; protected abstract getSearchIcon(): string; protected abstract getPin(address: ResponseProperties | string): string; protected abstract getBrand(): string; protected abstract getClearIcon(): string; private isIgnoredKey; protected getSuggestionDirection(): string; protected setClassName(brandClassName: string): void; protected extractLatLng(latlng: unknown): void; protected extractBounds(bounds: unknown): void; private fitLongitude; private fitLatitude; private toRadians; private calcDistance; private formatToSuggestionItem; } export interface AutocompleteSettings extends Settings { authToken: string; onlineState?: "STAGING" | "DEV" | "ONLINE"; } declare class CustomClearEvent extends CustomEvent { static EventName: string; constructor(); } export type SearchButtonClickedEventDataOf = { selectedAddress: TProperties | undefined; query: string; }; declare class CustomSearchButtonClickedEvent extends CustomEvent> { static EventName: string; constructor(event: SearchButtonClickedEventDataOf, bubbles?: boolean); } export type SelectedEventDataOf = { geojson: Feature; properties: TResponse; value: string; }; declare class CustomSelectedEvent extends CustomEvent> { static EventName: string; constructor(event: SelectedEventDataOf, bubbles?: boolean); } export type SuggestionEventDataOf = { geojson: AutocompleteSuggestionCollection; propertiesList: TResponse[]; value: string; }; declare class CustomSuggestionEvent extends CustomEvent> { static EventName: string; constructor(event: SuggestionEventDataOf, bubbles?: boolean); static Empty(value: string): CustomSuggestionEvent; } export type EmptyEventData = { value: string; }; declare class CustomEmptyEvent extends CustomEvent { static EventName: string; constructor(event: EmptyEventData, bubbles?: boolean); } export type AutocompleteAddressFeature = Feature; export declare enum GeoEntityTypes { UNDEFINED = "UNDEFINED", AIRPORT = "AIRPORT", CITY = "CITY", CITY_WITH_ZIP = "CITY_WITH_ZIP", CITYPART = "CITYPART", CITYPART_WITH_ZIP = "CITYPART_WITH_ZIP", COUNTY = "COUNTY", COUNTRY = "COUNTRY", DISTRICT = "DISTRICT", NEIGHBOURHOOD = "NEIGHBOURHOOD", PARCEL_LOCKER = "PARCEL_LOCKER", STATE = "STATE", STREET = "STREET", STREET_WITHOUT_CITY = "STREET_WITHOUT_CITY", TRAIN_STATION = "TRAIN_STATION", ZIP = "ZIP", ISLAND = "ISLAND", VILLAGE = "VILLAGE", ATTRACTION = "ATTRACTION" } export interface ResponseProperties { city: string | null; cityPart: string | null; country: string; countryLongName: string; county: string | null; displayValue: string; district: string | null; geoEntityType: GeoEntityTypes; houseNo: string | null; importance: number; poi: string | null; neighbourhood: string | null; parcelLocker: string | null; state: string | null; street: string | null; village: string | null; zip: string | null; geometry?: Point | null; } export type AddressFeature = AutocompleteAddressFeature; export type PinType = "UNDEFINED" | "AIRPORT" | "CITY" | "CITY_WITH_ZIP" | "CITYPART" | "CITYPART_WITH_ZIP" | "COUNTY" | "COUNTRY" | "DISTRICT" | "NEIGHBOURHOOD" | "PARCEL_LOCKER" | "STATE" | "STREET" | "STREET_WITHOUT_CITY" | "TRAIN_STATION" | "ZIP" | "ISLAND" | "VILLAGE" | "ATTRACTION"; export type SearchIconPosition = "left" | "right" | "none"; export interface Pin { html: string; type?: PinType; width?: number; height?: number; color?: string; } export interface Filters { airport?: boolean; attraction?: boolean; city?: boolean; citypart?: boolean; county?: boolean; country?: boolean; district?: boolean; island?: boolean; neighborhood?: boolean; parcelLocker?: boolean; state?: boolean; street?: boolean; streetWithoutCity?: boolean; trainstation?: boolean; village?: boolean; zip?: boolean; zipCity?: boolean; zipCitypart?: boolean; } export interface AutocompleteOptions extends AutocompleteOptionsBase { dataType?: "json" | "msgpack"; showCountry?: boolean; showState?: boolean; showCounty?: boolean; showDistrict?: boolean; showZip?: boolean; showCityPart?: boolean; showVillage?: boolean; showNeighborhood?: boolean; showParcelLocker?: boolean; showStreet?: boolean; showPoi?: boolean; proximityBoost?: { enable: boolean; value?: number; radius?: number; }; boundingBoxBoost?: { enable: boolean; value?: number; }; inBoundingBox?: boolean; searchZip?: boolean; includeFilters?: Filters; excludeFilters?: Filters; pins?: Pin[]; iconColor?: string; textColor?: string; textAltColor?: string; primaryColor?: string; accentColor?: string; top?: number; searchIconPosition?: SearchIconPosition; enableSearchOnClick?: boolean; settingsOverrides?: Partial; } export type RequestQuery = AutocompleteRequestQueryBase; export type SearchButtonClickedEvent = CustomSearchButtonClickedEvent; export type SearchButtonClickedEventData = SearchButtonClickedEventDataOf; export type SelectedEvent = CustomSelectedEvent; export type SelectedEventData = SelectedEventDataOf; export type SuggestionEvent = CustomSuggestionEvent; export type SuggestionEventData = SuggestionEventDataOf; export interface SmartmapsAutocompleteEvents { selected: SelectedEvent; clear: CustomClearEvent; search: SearchButtonClickedEvent; ready: CustomEvent; suggestion: SuggestionEvent; empty: CustomEmptyEvent; } declare class SmartmapsAutocomplete extends AutoComplete { constructor(element: HTMLInputElement | string, apiKey: string, options?: Partial); fetch(query: RequestQuery): Promise>; protected getSearchIcon(): string; protected getBrand(): string; protected getClearIcon(): string; getPin(address: ResponseProperties | string): string; private textReplacement; private replacePinVariables; private formatRequestParams; } export declare function createAutocomplete(element: HTMLInputElement | string, apiKey: string, options?: AutocompleteOptions, apiSource?: ApiSource): Promise; export type SuggestionCollection = AutocompleteSuggestionCollection; export { SmartmapsAutocomplete as Autocomplete, }; export {};