import type { ApolloQueryResult } from "@apollo/client/core"; import type { CustomHeaders, CustomQuery, GetProductSearchParams, ProductDetailsQuery } from "@vue-storefront/magento-types"; import type { Context } from "../../types/context"; /** * Get products details * * @example * Simple usage without filters, sorting or pagination: * ```ts * import { sdk } from '~/sdk.config.ts'; * * // fetch list of products with default parameters * const details = await sdk.magento.productDetails({}); * ``` * * @example * Usage with filters, sorting and pagination: * * ```ts * import { sdk } from '~/sdk.config.ts'; * * // make a request to fetch list of products with custom parameters * const details = await sdk.magento.productDetails({ * pageSize: 20, * currentPage: 1, * filter: { * sku: { * eq: PRODUCT_SKU * } * } * }); * ``` * * @example * Creating a custom GraphQL query for adding product details. * * ```ts * module.exports = { * integrations: { * magento: { * customQueries: { * 'product-details-custom-query': ({ variables, metadata }) => ({ * variables, * query: ` * query productDetails( * $search: String = "", * $filter: ProductAttributeFilterInput, * $pageSize: Int = 10, * $currentPage: Int = 1, * $sort: ProductAttributeSortInput * ) { * products(search: $search, filter: $filter, sort: $sort, pageSize: $pageSize, currentPage: $currentPage) { * ${metadata.fields} * } * } * ` * }), * }, * } * } * }; * ``` * * @example * Using a custom GraphQL query to fetch product details. * * ```ts * import { sdk } from '~/sdk.config.ts'; * const customQuery = { * productDetails: 'product-details-custom-query', * metadata: { * fields: 'items { sku name }' * } * }; * * const details = await sdk.magento.productDetails({ * filter: { * sku: { * eq: 'some-sku' // optional SKU filter * } * } * }, customQuery); * * // Details will contain only the fields specified in the custom query. * ``` */ export declare function productDetails(context: Context, searchParams?: GetProductSearchParams, customQuery?: CustomQuery, customHeaders?: CustomHeaders): Promise>; //# sourceMappingURL=index.d.ts.map