import { TypedDocumentNode } from '@graphql-typed-document-node/core';
import { DataService } from '@vendure/admin-ui/core';
import { DocumentNode } from 'graphql/index';
import { Observable } from 'rxjs';
/**
 * @description
 * A React hook which provides access to the results of a GraphQL query.
 *
 * @example
 * ```ts
 * import { useQuery } from '\@vendure/admin-ui/react';
 * import { gql } from 'graphql-tag';
 *
 * const GET_PRODUCT = gql`
 *    query GetProduct($id: ID!) {
 *      product(id: $id) {
 *        id
 *        name
 *        description
 *      }
 *    }`;
 *
 * export const MyComponent = () => {
 *     const { data, loading, error } = useQuery(GET_PRODUCT, { id: '1' });
 *
 *     if (loading) return <div>Loading...</div>;
 *     if (error) return <div>Error! { error }</div>;
 *     return (
 *         <div>
 *             <h1>{data.product.name}</h1>
 *             <p>{data.product.description}</p>
 *         </div>
 *     );
 * };
 * ```
 *
 * @docsCategory react-hooks
 */
export declare function useQuery<T, V extends Record<string, any> = Record<string, any>>(query: DocumentNode | TypedDocumentNode<T, V>, variables?: V): {
    readonly data: T | undefined;
    readonly loading: boolean;
    readonly error: string | undefined;
    readonly refetch: (variables?: V) => Promise<T>;
};
/**
 * @description
 * A React hook which allows you to execute a GraphQL mutation.
 *
 * @example
 * ```ts
 * import { useMutation } from '\@vendure/admin-ui/react';
 * import { gql } from 'graphql-tag';
 *
 * const UPDATE_PRODUCT = gql`
 *   mutation UpdateProduct($input: UpdateProductInput!) {
 *     updateProduct(input: $input) {
 *     id
 *     name
 *   }
 * }`;
 *
 * export const MyComponent = () => {
 *     const [updateProduct, { data, loading, error }] = useMutation(UPDATE_PRODUCT);
 *
 *     const handleClick = () => {
 *         updateProduct({
 *             input: {
 *                 id: '1',
 *                 name: 'New name',
 *             },
 *         }).then(result => {
 *             // do something with the result
 *         });
 *     };
 *
 *     if (loading) return <div>Loading...</div>;
 *     if (error) return <div>Error! { error }</div>;
 *
 *     return (
 *     <div>
 *         <button onClick={handleClick}>Update product</button>
 *         {data && <div>Product updated!</div>}
 *     </div>
 *     );
 * };
 * ```
 *
 * @docsCategory react-hooks
 */
export declare function useMutation<T, V extends Record<string, any> = Record<string, any>>(mutation: DocumentNode | TypedDocumentNode<T, V>): [(variables?: V) => Promise<T>, {
    data: T | undefined;
    loading: boolean;
    error: string | undefined;
}];
export declare function useDataService<T, V extends Record<string, any> = Record<string, any>>(operation: (dataService: DataService, variables?: V) => Observable<T>): {
    data: T | undefined;
    loading: boolean;
    error: string | undefined;
    runQuery: (variables?: V) => Observable<T>;
};
