Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24400,7 +24400,7 @@
"filePath": "src/cart/createCartHandler.ts",
"syntaxKind": "TypeAliasDeclaration",
"name": "HydrogenCart",
"value": "{\n get: ReturnType<typeof cartGetDefault>;\n getCartId: () => string | undefined;\n setCartId: (cartId: string) => Headers;\n create: ReturnType<typeof cartCreateDefault>;\n addLines: ReturnType<typeof cartLinesAddDefault>;\n updateLines: ReturnType<typeof cartLinesUpdateDefault>;\n removeLines: ReturnType<typeof cartLinesRemoveDefault>;\n updateDiscountCodes: ReturnType<typeof cartDiscountCodesUpdateDefault>;\n updateGiftCardCodes: ReturnType<typeof cartGiftCardCodesUpdateDefault>;\n addGiftCardCodes: ReturnType<typeof cartGiftCardCodesAddDefault>;\n removeGiftCardCodes: ReturnType<typeof cartGiftCardCodesRemoveDefault>;\n updateBuyerIdentity: ReturnType<typeof cartBuyerIdentityUpdateDefault>;\n updateNote: ReturnType<typeof cartNoteUpdateDefault>;\n updateSelectedDeliveryOption: ReturnType<\n typeof cartSelectedDeliveryOptionsUpdateDefault\n >;\n updateAttributes: ReturnType<typeof cartAttributesUpdateDefault>;\n setMetafields: ReturnType<typeof cartMetafieldsSetDefault>;\n deleteMetafield: ReturnType<typeof cartMetafieldDeleteDefault>;\n /**\n * Adds delivery addresses to the cart.\n *\n * This function sends a mutation to the storefront API to add one or more delivery addresses to the cart.\n * It returns the result of the mutation, including any errors that occurred.\n *\n * @param {CartQueryOptions} options - The options for the cart query, including the storefront API client and cart fragment.\n * @returns {ReturnType<typeof cartDeliveryAddressesAddDefault>} - A function that takes an array of addresses and optional parameters, and returns the result of the API call.\n *\n * @example\n * const result = await cart.addDeliveryAddresses(\n * [\n * {\n * address1: '123 Main St',\n * city: 'Anytown',\n * countryCode: 'US'\n * }\n * ],\n * { someOptionalParam: 'value' }\n * );\n */\n addDeliveryAddresses: ReturnType<typeof cartDeliveryAddressesAddDefault>;\n /**\n * Removes delivery addresses from the cart.\n *\n * This function sends a mutation to the storefront API to remove one or more delivery addresses from the cart.\n * It returns the result of the mutation, including any errors that occurred.\n *\n * @param {CartQueryOptions} options - The options for the cart query, including the storefront API client and cart fragment.\n * @returns {CartDeliveryAddressRemoveFunction} - A function that takes an array of address IDs and optional parameters, and returns the result of the API call.\n *\n * @example\n * const result = await cart.removeDeliveryAddresses([\n * \"gid://shopify/<objectName>/10079785100\"\n * ],\n * { someOptionalParam: 'value' });\n */\n\n removeDeliveryAddresses: ReturnType<\n typeof cartDeliveryAddressesRemoveDefault\n >;\n /**\n * Updates delivery addresses in the cart.\n *\n * This function sends a mutation to the storefront API to update one or more delivery addresses in the cart.\n * It returns the result of the mutation, including any errors that occurred.\n *\n * @param {CartQueryOptions} options - The options for the cart query, including the storefront API client and cart fragment.\n * @returns {CartDeliveryAddressUpdateFunction} - A function that takes an array of addresses and optional parameters, and returns the result of the API call.\n *\n * const result = await cart.updateDeliveryAddresses([\n {\n \"address\": {\n \"copyFromCustomerAddressId\": \"gid://shopify/<objectName>/10079785100\",\n \"deliveryAddress\": {\n \"address1\": \"<your-address1>\",\n \"address2\": \"<your-address2>\",\n \"city\": \"<your-city>\",\n \"company\": \"<your-company>\",\n \"countryCode\": \"AC\",\n \"firstName\": \"<your-firstName>\",\n \"lastName\": \"<your-lastName>\",\n \"phone\": \"<your-phone>\",\n \"provinceCode\": \"<your-provinceCode>\",\n \"zip\": \"<your-zip>\"\n }\n },\n \"id\": \"gid://shopify/<objectName>/10079785100\",\n \"oneTimeUse\": true,\n \"selected\": true,\n \"validationStrategy\": \"COUNTRY_CODE_ONLY\"\n }\n ],{ someOptionalParam: 'value' });\n */\n updateDeliveryAddresses: ReturnType<\n typeof cartDeliveryAddressesUpdateDefault\n >;\n /**\n * Replaces all delivery addresses on the cart.\n *\n * This function sends a mutation to the storefront API to replace all delivery addresses on the cart\n * with the provided addresses. It returns the result of the mutation, including any errors that occurred.\n *\n * @param {CartQueryOptions} options - The options for the cart query, including the storefront API client and cart fragment.\n * @returns {CartDeliveryAddressesReplaceFunction} - A function that takes an array of addresses and optional parameters, and returns the result of the API call.\n *\n * @example\n * const result = await cart.replaceDeliveryAddresses([\n * {\n * address: {\n * deliveryAddress: {\n * address1: '123 Main St',\n * city: 'Anytown',\n * countryCode: 'US'\n * }\n * },\n * selected: true\n * }\n * ], { someOptionalParam: 'value' });\n */\n replaceDeliveryAddresses: ReturnType<\n typeof cartDeliveryAddressesReplaceDefault\n >;\n}",
"value": "{\n get: ReturnType<typeof cartGetDefault>;\n getCartId: () => string | undefined;\n setCartId: (cartId: string) => Headers;\n create: ReturnType<typeof cartCreateDefault>;\n addLines: ReturnType<typeof cartLinesAddDefault>;\n updateLines: ReturnType<typeof cartLinesUpdateDefault>;\n removeLines: ReturnType<typeof cartLinesRemoveDefault>;\n updateDiscountCodes: ReturnType<typeof cartDiscountCodesUpdateDefault>;\n updateGiftCardCodes: ReturnType<typeof cartGiftCardCodesUpdateDefault>;\n addGiftCardCodes: ReturnType<typeof cartGiftCardCodesAddDefault>;\n removeGiftCardCodes: ReturnType<typeof cartGiftCardCodesRemoveDefault>;\n updateBuyerIdentity: ReturnType<typeof cartBuyerIdentityUpdateDefault>;\n updateNote: ReturnType<typeof cartNoteUpdateDefault>;\n updateSelectedDeliveryOption: ReturnType<\n typeof cartSelectedDeliveryOptionsUpdateDefault\n >;\n updateAttributes: ReturnType<typeof cartAttributesUpdateDefault>;\n setMetafields: ReturnType<typeof cartMetafieldsSetDefault>;\n deleteMetafield: ReturnType<typeof cartMetafieldDeleteDefault>;\n /**\n * Adds delivery addresses to the cart.\n *\n * This function sends a mutation to the storefront API to add one or more delivery addresses to the cart.\n * It returns the result of the mutation, including any errors that occurred.\n *\n * @example\n * const result = await cart.addDeliveryAddresses(\n * [\n * {\n * address1: '123 Main St',\n * city: 'Anytown',\n * countryCode: 'US'\n * }\n * ],\n * { someOptionalParam: 'value' }\n * );\n */\n addDeliveryAddresses: ReturnType<typeof cartDeliveryAddressesAddDefault>;\n /**\n * Removes delivery addresses from the cart.\n *\n * This function sends a mutation to the storefront API to remove one or more delivery addresses from the cart.\n * It returns the result of the mutation, including any errors that occurred.\n *\n * @example\n * const result = await cart.removeDeliveryAddresses([\n * \"gid://shopify/<objectName>/10079785100\"\n * ],\n * { someOptionalParam: 'value' });\n */\n\n removeDeliveryAddresses: ReturnType<\n typeof cartDeliveryAddressesRemoveDefault\n >;\n /**\n * Updates delivery addresses in the cart.\n *\n * This function sends a mutation to the storefront API to update one or more delivery addresses in the cart.\n * It returns the result of the mutation, including any errors that occurred.\n *\n * const result = await cart.updateDeliveryAddresses([\n {\n \"address\": {\n \"copyFromCustomerAddressId\": \"gid://shopify/<objectName>/10079785100\",\n \"deliveryAddress\": {\n \"address1\": \"<your-address1>\",\n \"address2\": \"<your-address2>\",\n \"city\": \"<your-city>\",\n \"company\": \"<your-company>\",\n \"countryCode\": \"AC\",\n \"firstName\": \"<your-firstName>\",\n \"lastName\": \"<your-lastName>\",\n \"phone\": \"<your-phone>\",\n \"provinceCode\": \"<your-provinceCode>\",\n \"zip\": \"<your-zip>\"\n }\n },\n \"id\": \"gid://shopify/<objectName>/10079785100\",\n \"oneTimeUse\": true,\n \"selected\": true,\n \"validationStrategy\": \"COUNTRY_CODE_ONLY\"\n }\n ],{ someOptionalParam: 'value' });\n */\n updateDeliveryAddresses: ReturnType<\n typeof cartDeliveryAddressesUpdateDefault\n >;\n /**\n * Replaces all delivery addresses on the cart.\n *\n * This function sends a mutation to the storefront API to replace all delivery addresses on the cart\n * with the provided addresses. It returns the result of the mutation, including any errors that occurred.\n *\n * @example\n * const result = await cart.replaceDeliveryAddresses([\n * {\n * address: {\n * deliveryAddress: {\n * address1: '123 Main St',\n * city: 'Anytown',\n * countryCode: 'US'\n * }\n * },\n * selected: true\n * }\n * ], { someOptionalParam: 'value' });\n */\n replaceDeliveryAddresses: ReturnType<\n typeof cartDeliveryAddressesReplaceDefault\n >;\n}",
"description": "",
"members": [
{
Expand Down
12 changes: 0 additions & 12 deletions packages/hydrogen/src/cart/createCartHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ export type HydrogenCart = {
* This function sends a mutation to the storefront API to add one or more delivery addresses to the cart.
* It returns the result of the mutation, including any errors that occurred.
*
* @param {CartQueryOptions} options - The options for the cart query, including the storefront API client and cart fragment.
* @returns {ReturnType<typeof cartDeliveryAddressesAddDefault>} - A function that takes an array of addresses and optional parameters, and returns the result of the API call.
*
* @example
* const result = await cart.addDeliveryAddresses(
* [
Expand All @@ -140,9 +137,6 @@ export type HydrogenCart = {
* This function sends a mutation to the storefront API to remove one or more delivery addresses from the cart.
* It returns the result of the mutation, including any errors that occurred.
*
* @param {CartQueryOptions} options - The options for the cart query, including the storefront API client and cart fragment.
* @returns {CartDeliveryAddressRemoveFunction} - A function that takes an array of address IDs and optional parameters, and returns the result of the API call.
*
* @example
* const result = await cart.removeDeliveryAddresses([
* "gid://shopify/<objectName>/10079785100"
Expand All @@ -159,9 +153,6 @@ export type HydrogenCart = {
* This function sends a mutation to the storefront API to update one or more delivery addresses in the cart.
* It returns the result of the mutation, including any errors that occurred.
*
* @param {CartQueryOptions} options - The options for the cart query, including the storefront API client and cart fragment.
* @returns {CartDeliveryAddressUpdateFunction} - A function that takes an array of addresses and optional parameters, and returns the result of the API call.
*
* const result = await cart.updateDeliveryAddresses([
{
"address": {
Expand Down Expand Up @@ -195,9 +186,6 @@ export type HydrogenCart = {
* This function sends a mutation to the storefront API to replace all delivery addresses on the cart
* with the provided addresses. It returns the result of the mutation, including any errors that occurred.
*
* @param {CartQueryOptions} options - The options for the cart query, including the storefront API client and cart fragment.
* @returns {CartDeliveryAddressesReplaceFunction} - A function that takes an array of addresses and optional parameters, and returns the result of the API call.
*
* @example
* const result = await cart.replaceDeliveryAddresses([
* {
Expand Down
Loading