import { StorefrontApiClient, StorefrontApiResponse } from "./storefront-api-client"; import type { GetProductsQuery } from "./types/storefront.generated"; import type { CountryCode, LanguageCode } from "./types/storefront.types"; export type LoadProductsResponse = StorefrontApiResponse; /** * Arguments accepted by `loadProducts`. `country` and `language` are injected * automatically by `StorefrontApiClient.loadProducts` from the store's * localisation context — callers only need to supply `first` (and optionally * `after` for pagination). */ export interface LoadProductsArgs { /** Maximum number of products to return (capped by Shopify at 250 per page). */ first: number; /** Pagination cursor returned by a previous call's `pageInfo.endCursor`. */ after?: string | null; /** Storefront country code — injected by StorefrontApiClient. */ country: CountryCode; /** Storefront language code — injected by StorefrontApiClient. */ language: LanguageCode; } /** * Executes the GET_PRODUCTS query against the Shopify Storefront API and returns * a page of product nodes (id + default variant id) along with pagination info. * * Called via `StorefrontApiClient.loadProducts` — do not call this directly * from application code; use `swish.storefront.loadProducts(args)` instead so * country/language are applied automatically from the storefront context. */ export declare const loadProducts: (client: StorefrontApiClient, { first, after, country, language }: LoadProductsArgs) => Promise<{ data: GetProductsQuery | undefined; errors: import("@shopify/graphql-client").ResponseErrors | null; }>;