import { Store } from "effector"; import { AggregatedOptions } from "../aggregateOptions"; import { Dict } from "../commonTypes"; import { SearchOption, SearchProductsSortBy } from "../graphql/types"; import { HierarchicalSearchOption } from "../hierarchicalSearchOption"; import { AbstractOp, GraphQLOpts, RequestResponseError } from "../request"; export interface OptionAgg { count: number; name: string; values: { count: number; name: string; }[]; } export interface SearchData { products: Product[]; options: OptionAgg[]; priceRange: { min: number; max: number; } | null; count: number; lastKey: string; hasMore: boolean; params: ProductsPageQueryParameters | null; } export declare const defaultSearchData: SearchData; export interface ProductsPageQueryParameters { shopID: string; pageKey: string; baseFilter: HierarchicalSearchOption[]; filter: HierarchicalSearchOption[]; limit: number; sortBy: SearchProductsSortBy; sortDesc: boolean; filterState: Dict; } export interface LoadProductsEvent { params: ProductsPageQueryParameters; } export declare function aggregatedOptionsToOptionAgg(aggOpts: AggregatedOptions): OptionAgg[]; export interface AdvancedSearchConfig { readonly graphql: { readonly searchProductsQuery: AbstractOp<{ search: { count: number; items: Array | null; last_key: string; options: Array; price_max: number; price_min: number; } | null; }, { aggregations: boolean; data: Array; lastKey: string; limit: number; shopID: string; sortBy: SearchProductsSortBy; sortDesc: boolean; }>; }; /** Your shop id. */ readonly shopID: string; /** These graphql options are applied to all "request" api calls search does. */ readonly opts?: Readonly>; /** A store that represents current auth state. You should pass it in to keep auth state in-sync. */ readonly jwt: Store; /** Current locale. Module will react to its changes. */ readonly locale: Store; } export declare function createAdvancedSearch(config: AdvancedSearchConfig): { loadProducts: import("effector").Event; queuedFor: Store; data: Store>; somethingIsPending: Store; unexpectedError: import("effector").Event; };