import * as React from 'react'; import { CommonAddress as Address } from '@wix/ambassador-wix-atlas-service-web/http'; import { AmbassadorHTTPError as AtlasError } from '@wix/ambassador/runtime/http'; import { AddressInputProps } from '../AddressInput'; import { DropdownLayoutValueOption as Option } from '../DropdownLayout'; import { AtlasInitOptions } from '../providers/useAtlasClient'; export type { Option, Address, AtlasError }; export type GetAddress = () => Promise
; export type AtlasAddressInputProps = Omit & AtlasInitOptions & { /** Fetch predictions debounce in milliseconds (default: 200) */ debounceMs?: number; /** Allows passing a custom debounce function (default: lodash debounce). * Receives the callback to debounce and the wait in ms, and returns a * debounced function with the same parameters. */ debounceFn?: any>(callback: T, debounceMs: number) => (...args: Parameters) => unknown; /** Sets the layout of `mainLabel` and `secondaryLabel`. The possible options can be either side by side or vertically stacked. */ optionLayout?: 'single-line' | 'double-line'; /** Pass any component to show as the prefix of the option, e.g., text, icon. */ optionPrefix?: React.ReactNode; /** Pass any component to show as the suffix of the option, e.g., text, icon, button. */ optionSuffix?: React.ReactNode; /** Defines a callback function which is called whenever a user selects a different option in the list. * @param {DropdownLayoutOption} option selected option * @param {() => Promise
} getAddress function for retrieving additional place details */ onSelect?: (option: Option, getAddress: GetAddress) => void; /** Defines a handler for prediction fetching errors. Receives the HTTP error object of the failed request. */ onError?: (error: AtlasError) => any; /** Specifies whether to trigger `onSelect` handler when performing a Submit-Action (Enter or Tab key down). * If set to true, `onSelect` will be called with the following params: * * `option`: an option with a label set to the input value. * * `getAddress`: function for retrieving additional place details * uses Atlas's search function to return the closest result to the input value * * This is useful when looking for locations for which Atlas doesn't give suggestions - for example: Apartment/Apt. */ selectOnSubmit?: boolean; /** Sets the `language` to pass to the Atlas Service. * Use the language code e.g. `'en'`. */ language?: string; /** Sets the `locale` to pass to the Atlas Service. * Locale consists of language code and country code separated by a dash e.g. `'en-us'`. */ locale?: string; }; export type AtlasAddressInputImperativeActions = { focus(): void; }; //# sourceMappingURL=AtlasAddressInput.types.d.ts.map