import * as React from "react"; import { Instance } from "mobx-state-tree"; import { DocumentNode } from "graphql"; import { Query, FetchPolicy } from "./Query"; import { MSTGQLStore } from "./MSTGQLStore"; declare var ReactNamespace: typeof import("react"); export declare type QueryLike = | ((store: STORE) => Query) | Query | string | DocumentNode; export declare function createStoreContext< STORE extends Instance >(React: typeof ReactNamespace): any; export declare function getDataFromTree< STORE extends Instance >( tree: React.ReactElement, client: STORE, renderFunction?: (tree: React.ReactElement) => string ): Promise; export declare type UseQueryHookOptions = { store?: STORE; variables?: any; fetchPolicy?: FetchPolicy; }; export declare type UseQueryHookResult = { store: STORE; loading: boolean; error: any; data: | { [key in keyof DATA]: DATA[key]; } | undefined; query: Query | undefined; setQuery: (query: QueryLike) => void; }; export declare type UseQueryHook = ( query?: QueryLike, options?: UseQueryHookOptions ) => UseQueryHookResult; export declare function createUseQueryHook< STORE extends Instance >( context: React.Context, React: typeof ReactNamespace ): UseQueryHook; export {};