import { Event, Store } from "effector"; import { AbstractOp, GraphQLOpts, RequestResponseError } from "../request"; import { SearchProductsQueryVariables } from "../graphql/types"; export interface SearchOperationResult { search: { count: number; items: Array | null; } | null; } export interface SearchConfig { readonly graphql: { readonly searchProductsQuery: AbstractOp, SearchProductsQueryVariables>; }; /** 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 type SearchResult = { kind: "not_submitted"; } | { kind: "error"; } | { kind: "result"; result: T[]; }; export interface Search { clear: Event; unexpectedError: Event; setQuery: Event; query: Store; submit: Event; result: Store>; pending: Store; } export declare function createSearch(config: SearchConfig): Search;