import { SearchResult } from '@jetshop/core/types'; import { DocumentNode } from 'graphql'; import * as React from 'react'; import { RouteComponentProps } from 'react-router-dom'; export interface Events { onClick?: React.MouseEventHandler; onBlur?: React.FocusEventHandler; onFocus?: React.FocusEventHandler; } export interface RenderFnProps extends SearchFieldState { getInputProps: (args?: Pick) => {}; getCancelProps: (args?: Pick) => {}; getFlyoutProps: (args?: any) => {}; updateFocus: (args: 'focus' | 'blur') => void; result: SearchResult; loading: boolean; inputRef: React.Ref; triggerSearch(term: string): void; } export interface SearchFieldProps { /** Initial value for the search field */ initialValue: string; /** Optional function to call when cancel button is clicked */ onCancel?: () => void; /** Optional function to call when the search is submitted */ onSubmit?: (term: string) => void; /** Whether to focus the search input on first mount */ focusOnLoad?: boolean; /** Query to perform the autocomplete search */ autocompleteQuery: DocumentNode; /** Internals */ children: (args: RenderFnProps) => JSX.Element; } export interface SearchFieldState { /** Whether or not the search term has been edited since render */ isDirty: boolean; /** The search term string */ term: string; /** The debounced search term string used for the query */ debouncedTerm: string; /** Whether the search field is open */ isOpen: boolean; } declare const _default: React.ComponentClass, keyof SearchFieldProps>, any> & import("react-router").WithRouterStatics<(props: SearchFieldProps & RouteComponentProps<{}, import("react-router").StaticContext, unknown>) => React.JSX.Element>; export default _default;