@shopify/hydrogen-react
Version:
React components, hooks, and utilities for creating custom Shopify storefronts
25 lines (24 loc) • 1.21 kB
TypeScript
import { CartInput } from './storefront-api-types.js';
import type { StorefrontApiResponseOkPartial } from './storefront-api-response.types.js';
export declare function useCartFetch(): <ReturnDataGeneric>({ query, variables, }: {
query: string;
variables: Record<string, unknown>;
}) => Promise<StorefrontApiResponseOkPartial<ReturnDataGeneric>>;
export declare function useInstantCheckout(): {
cart: import("type-fest/source/partial-deep.js").PartialObjectDeep<{
id?: string | undefined;
lines: import("./storefront-api-types.js").CartLine[];
checkoutUrl?: string | undefined;
note?: string | undefined;
buyerIdentity?: import("./storefront-api-types.js").CartBuyerIdentity | undefined;
attributes: import("./storefront-api-types.js").Attribute[];
discountCodes?: import("./storefront-api-types.js").CartDiscountCode[] | undefined;
cost?: import("./storefront-api-types.js").CartCost | undefined;
totalQuantity: number;
}, {
recurseIntoArrays: true;
}> | undefined;
checkoutUrl: string | undefined;
error: string | undefined;
createInstantCheckout: (cartInput: CartInput) => Promise<void>;
};