// Generated by dts-bundle-generator v9.5.1 import * as Schema from 'effect/Schema'; export type CartAddInput = Schema.Schema.Encoded; declare const CartAddInput: Schema.extend; quantity: Schema.optionalWith number; }>; properties: Schema.optionalWith>, { default: () => {}; }>; selling_plan: Schema.optional>; }>>; }>, Schema.Struct<{ sections: Schema.optional, typeof Schema.String>>; sections_url: Schema.optional; }>>; export type CartUpdateInput = Schema.Schema.Encoded; declare const CartUpdateInput: Schema.extend, Schema.Array$ ]>>; note: Schema.optional>; attributes: Schema.optional>>; discount: Schema.optional, typeof Schema.String>>; }>, Schema.Struct<{ sections: Schema.optional, typeof Schema.String>>; sections_url: Schema.optional; }>>; export type CartChangeInput = Schema.Schema.Encoded; declare const CartChangeInput: Schema.Union<[ Schema.extend, Schema.extend; properties: Schema.optional>>; selling_plan: Schema.optional>>; }>, Schema.Struct<{ sections: Schema.optional, typeof Schema.String>>; sections_url: Schema.optional; }>>>, Schema.extend, Schema.extend; properties: Schema.optional>>; selling_plan: Schema.optional>>; }>, Schema.Struct<{ sections: Schema.optional, typeof Schema.String>>; sections_url: Schema.optional; }>>> ]>; export type CartClearInput = Schema.Schema.Encoded; declare const CartClearInput: Schema.Struct<{ sections: Schema.optional, typeof Schema.String>>; sections_url: Schema.optional; }>; export type CartGetInput = Schema.Schema.Encoded; declare const CartGetInput: Schema.Struct<{ sections: Schema.optional, typeof Schema.String>>; sections_url: Schema.optional; }>; export type AddInput = CartAddInput; export type ChangeInput = CartChangeInput; export type ClearInput = CartClearInput; export type GetInput = CartGetInput; export type UpdateInput = CartUpdateInput; declare namespace add { type Input = AddInput; } declare const add: (input?: ({ readonly items: readonly { readonly id: string | number; readonly selling_plan?: string | number | undefined; readonly properties?: { readonly [x: string]: string | number | boolean | null; } | undefined; readonly quantity?: number | undefined; }[]; } & { readonly sections?: readonly string[] | undefined; readonly sections_url?: string | undefined; }) | undefined, options?: { headers?: Record; }) => import("effect/Effect").Effect<{ readonly data?: undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; } | { readonly data?: { readonly items: readonly ({ readonly title: string; readonly key: string; readonly url: string; readonly image: string | null; readonly quantity_rule?: { readonly min: number; readonly max: number | null; readonly increment: number; } | undefined; readonly price: number; readonly id: string | number; readonly selling_plan_allocation: { readonly price: number; readonly price_adjustments: readonly { readonly position: number; readonly price: number; }[]; readonly selling_plan: { readonly description: string | null; readonly name: string; readonly id: string | number; readonly options: readonly { readonly value: string; readonly name: string; readonly position: number; }[]; readonly recurring_deliveries: boolean; readonly fixed_selling_plan: boolean; readonly price_adjustments: readonly { readonly value: string | number; readonly value_type: "fixed_amount" | "percentage" | "price"; readonly position: number; readonly order_count: number | null; }[]; }; readonly compare_at_price: number; readonly per_delivery_price: number; } | null; readonly unit_price_measurement?: { readonly measured_type: "volume" | "weight" | "dimension"; readonly quantity_unit: string; readonly quantity_value: number; readonly reference_unit: string; readonly reference_value: number; } | undefined; readonly variant_options: readonly string[]; readonly properties: { readonly [x: string]: string | number | boolean | null; }; readonly quantity: number; readonly variant_id: string | number; readonly original_price: number; readonly discounted_price: number; readonly line_price: number; readonly original_line_price: number; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly sku: string | null; readonly grams: number; readonly vendor: string; readonly taxable: boolean; readonly product_id: string | number; readonly product_has_only_default_variant: boolean; readonly gift_card: boolean; readonly final_line_price: number; readonly final_price: number; readonly featured_image: { readonly aspect_ratio: number | null; readonly alt: string | null; readonly height: number | null; readonly url: string | null; readonly width: number | null; }; readonly handle: string; readonly requires_shipping: boolean; readonly product_type: string | null; readonly product_title: string; readonly product_description: string | null; readonly variant_title: string | null; readonly options_with_values: readonly { readonly value: string; readonly name: string; }[]; readonly line_level_discount_allocations: readonly { readonly discount_application: { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }; readonly amount: number; }[]; readonly line_level_total_discount: number; readonly has_components: boolean; readonly unit_price?: number | undefined; } & { readonly properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_properties: { readonly [x: string]: string | number | boolean | null; }; readonly private_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_properties: { readonly [x: string]: string | number | boolean | null; }; readonly public_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; })[]; } | undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; }, Error, import("@effect/platform/HttpClient").HttpClient>; declare namespace change { type Input = ChangeInput; } declare const change: (input?: ({ readonly id: string; } & { readonly selling_plan?: string | number | null | undefined; readonly properties?: { readonly [x: string]: string | null; } | undefined; readonly quantity?: number | undefined; } & { readonly sections?: readonly string[] | undefined; readonly sections_url?: string | undefined; }) | ({ readonly line: number; } & { readonly selling_plan?: string | number | null | undefined; readonly properties?: { readonly [x: string]: string | null; } | undefined; readonly quantity?: number | undefined; } & { readonly sections?: readonly string[] | undefined; readonly sections_url?: string | undefined; }) | undefined, options?: { headers?: Record; }) => import("effect/Effect").Effect<{ readonly data?: undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; } | { readonly data?: ({ readonly attributes: { readonly [x: string]: string | number | boolean | null; }; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly requires_shipping: boolean; readonly token: string; readonly note: string | null; readonly discount_codes: readonly { readonly code: string; readonly applicable: boolean; }[]; readonly original_total_price: number; readonly total_price: number; readonly total_weight: number; readonly item_count: number; readonly items: readonly ({ readonly title: string; readonly key: string; readonly url: string; readonly image: string | null; readonly quantity_rule?: { readonly min: number; readonly max: number | null; readonly increment: number; } | undefined; readonly price: number; readonly id: string | number; readonly selling_plan_allocation: { readonly price: number; readonly price_adjustments: readonly { readonly position: number; readonly price: number; }[]; readonly selling_plan: { readonly description: string | null; readonly name: string; readonly id: string | number; readonly options: readonly { readonly value: string; readonly name: string; readonly position: number; }[]; readonly recurring_deliveries: boolean; readonly fixed_selling_plan: boolean; readonly price_adjustments: readonly { readonly value: string | number; readonly value_type: "fixed_amount" | "percentage" | "price"; readonly position: number; readonly order_count: number | null; }[]; }; readonly compare_at_price: number; readonly per_delivery_price: number; } | null; readonly unit_price_measurement?: { readonly measured_type: "volume" | "weight" | "dimension"; readonly quantity_unit: string; readonly quantity_value: number; readonly reference_unit: string; readonly reference_value: number; } | undefined; readonly variant_options: readonly string[]; readonly properties: { readonly [x: string]: string | number | boolean | null; }; readonly quantity: number; readonly variant_id: string | number; readonly original_price: number; readonly discounted_price: number; readonly line_price: number; readonly original_line_price: number; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly sku: string | null; readonly grams: number; readonly vendor: string; readonly taxable: boolean; readonly product_id: string | number; readonly product_has_only_default_variant: boolean; readonly gift_card: boolean; readonly final_line_price: number; readonly final_price: number; readonly featured_image: { readonly aspect_ratio: number | null; readonly alt: string | null; readonly height: number | null; readonly url: string | null; readonly width: number | null; }; readonly handle: string; readonly requires_shipping: boolean; readonly product_type: string | null; readonly product_title: string; readonly product_description: string | null; readonly variant_title: string | null; readonly options_with_values: readonly { readonly value: string; readonly name: string; }[]; readonly line_level_discount_allocations: readonly { readonly discount_application: { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }; readonly amount: number; }[]; readonly line_level_total_discount: number; readonly has_components: boolean; readonly unit_price?: number | undefined; } & { readonly properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_properties: { readonly [x: string]: string | number | boolean | null; }; readonly private_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_properties: { readonly [x: string]: string | number | boolean | null; }; readonly public_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; })[]; readonly currency: string; readonly items_subtotal_price: number; readonly cart_level_discount_applications: readonly { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }[]; } & { readonly attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly private_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly public_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; }) | undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; }, Error, import("@effect/platform/HttpClient").HttpClient>; declare namespace clear { type Input = ClearInput; } declare const clear: (input?: { readonly sections?: readonly string[] | undefined; readonly sections_url?: string | undefined; } | undefined, options?: { headers?: Record; }) => import("effect/Effect").Effect<{ readonly data?: undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; } | { readonly data?: ({ readonly attributes: { readonly [x: string]: string | number | boolean | null; }; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly requires_shipping: boolean; readonly token: string; readonly note: string | null; readonly discount_codes: readonly { readonly code: string; readonly applicable: boolean; }[]; readonly original_total_price: number; readonly total_price: number; readonly total_weight: number; readonly item_count: number; readonly items: readonly ({ readonly title: string; readonly key: string; readonly url: string; readonly image: string | null; readonly quantity_rule?: { readonly min: number; readonly max: number | null; readonly increment: number; } | undefined; readonly price: number; readonly id: string | number; readonly selling_plan_allocation: { readonly price: number; readonly price_adjustments: readonly { readonly position: number; readonly price: number; }[]; readonly selling_plan: { readonly description: string | null; readonly name: string; readonly id: string | number; readonly options: readonly { readonly value: string; readonly name: string; readonly position: number; }[]; readonly recurring_deliveries: boolean; readonly fixed_selling_plan: boolean; readonly price_adjustments: readonly { readonly value: string | number; readonly value_type: "fixed_amount" | "percentage" | "price"; readonly position: number; readonly order_count: number | null; }[]; }; readonly compare_at_price: number; readonly per_delivery_price: number; } | null; readonly unit_price_measurement?: { readonly measured_type: "volume" | "weight" | "dimension"; readonly quantity_unit: string; readonly quantity_value: number; readonly reference_unit: string; readonly reference_value: number; } | undefined; readonly variant_options: readonly string[]; readonly properties: { readonly [x: string]: string | number | boolean | null; }; readonly quantity: number; readonly variant_id: string | number; readonly original_price: number; readonly discounted_price: number; readonly line_price: number; readonly original_line_price: number; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly sku: string | null; readonly grams: number; readonly vendor: string; readonly taxable: boolean; readonly product_id: string | number; readonly product_has_only_default_variant: boolean; readonly gift_card: boolean; readonly final_line_price: number; readonly final_price: number; readonly featured_image: { readonly aspect_ratio: number | null; readonly alt: string | null; readonly height: number | null; readonly url: string | null; readonly width: number | null; }; readonly handle: string; readonly requires_shipping: boolean; readonly product_type: string | null; readonly product_title: string; readonly product_description: string | null; readonly variant_title: string | null; readonly options_with_values: readonly { readonly value: string; readonly name: string; }[]; readonly line_level_discount_allocations: readonly { readonly discount_application: { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }; readonly amount: number; }[]; readonly line_level_total_discount: number; readonly has_components: boolean; readonly unit_price?: number | undefined; } & { readonly properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_properties: { readonly [x: string]: string | number | boolean | null; }; readonly private_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_properties: { readonly [x: string]: string | number | boolean | null; }; readonly public_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; })[]; readonly currency: string; readonly items_subtotal_price: number; readonly cart_level_discount_applications: readonly { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }[]; } & { readonly attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly private_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly public_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; }) | undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; }, Error, import("@effect/platform/HttpClient").HttpClient>; declare namespace get { type Input = GetInput; } declare const get: (input?: { readonly sections?: readonly string[] | undefined; readonly sections_url?: string | undefined; } | undefined, options?: { headers?: Record; }) => import("effect/Effect").Effect<{ readonly data?: undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; } | { readonly data?: ({ readonly attributes: { readonly [x: string]: string | number | boolean | null; }; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly requires_shipping: boolean; readonly token: string; readonly note: string | null; readonly discount_codes: readonly { readonly code: string; readonly applicable: boolean; }[]; readonly original_total_price: number; readonly total_price: number; readonly total_weight: number; readonly item_count: number; readonly items: readonly ({ readonly title: string; readonly key: string; readonly url: string; readonly image: string | null; readonly quantity_rule?: { readonly min: number; readonly max: number | null; readonly increment: number; } | undefined; readonly price: number; readonly id: string | number; readonly selling_plan_allocation: { readonly price: number; readonly price_adjustments: readonly { readonly position: number; readonly price: number; }[]; readonly selling_plan: { readonly description: string | null; readonly name: string; readonly id: string | number; readonly options: readonly { readonly value: string; readonly name: string; readonly position: number; }[]; readonly recurring_deliveries: boolean; readonly fixed_selling_plan: boolean; readonly price_adjustments: readonly { readonly value: string | number; readonly value_type: "fixed_amount" | "percentage" | "price"; readonly position: number; readonly order_count: number | null; }[]; }; readonly compare_at_price: number; readonly per_delivery_price: number; } | null; readonly unit_price_measurement?: { readonly measured_type: "volume" | "weight" | "dimension"; readonly quantity_unit: string; readonly quantity_value: number; readonly reference_unit: string; readonly reference_value: number; } | undefined; readonly variant_options: readonly string[]; readonly properties: { readonly [x: string]: string | number | boolean | null; }; readonly quantity: number; readonly variant_id: string | number; readonly original_price: number; readonly discounted_price: number; readonly line_price: number; readonly original_line_price: number; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly sku: string | null; readonly grams: number; readonly vendor: string; readonly taxable: boolean; readonly product_id: string | number; readonly product_has_only_default_variant: boolean; readonly gift_card: boolean; readonly final_line_price: number; readonly final_price: number; readonly featured_image: { readonly aspect_ratio: number | null; readonly alt: string | null; readonly height: number | null; readonly url: string | null; readonly width: number | null; }; readonly handle: string; readonly requires_shipping: boolean; readonly product_type: string | null; readonly product_title: string; readonly product_description: string | null; readonly variant_title: string | null; readonly options_with_values: readonly { readonly value: string; readonly name: string; }[]; readonly line_level_discount_allocations: readonly { readonly discount_application: { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }; readonly amount: number; }[]; readonly line_level_total_discount: number; readonly has_components: boolean; readonly unit_price?: number | undefined; } & { readonly properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_properties: { readonly [x: string]: string | number | boolean | null; }; readonly private_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_properties: { readonly [x: string]: string | number | boolean | null; }; readonly public_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; })[]; readonly currency: string; readonly items_subtotal_price: number; readonly cart_level_discount_applications: readonly { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }[]; } & { readonly attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly private_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly public_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; }) | undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; }, Error, import("@effect/platform/HttpClient").HttpClient>; declare namespace update { type Input = UpdateInput; } declare const update: (input?: ({ readonly attributes?: { readonly [x: string]: string | number | boolean | null; } | undefined; readonly discount?: readonly string[] | undefined; readonly note?: string | null | undefined; readonly updates?: { readonly [x: string]: number; } | readonly number[] | undefined; } & { readonly sections?: readonly string[] | undefined; readonly sections_url?: string | undefined; }) | undefined, options?: { headers?: Record; }) => import("effect/Effect").Effect<{ readonly data?: undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; } | { readonly data?: ({ readonly attributes: { readonly [x: string]: string | number | boolean | null; }; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly requires_shipping: boolean; readonly token: string; readonly note: string | null; readonly discount_codes: readonly { readonly code: string; readonly applicable: boolean; }[]; readonly original_total_price: number; readonly total_price: number; readonly total_weight: number; readonly item_count: number; readonly items: readonly ({ readonly title: string; readonly key: string; readonly url: string; readonly image: string | null; readonly quantity_rule?: { readonly min: number; readonly max: number | null; readonly increment: number; } | undefined; readonly price: number; readonly id: string | number; readonly selling_plan_allocation: { readonly price: number; readonly price_adjustments: readonly { readonly position: number; readonly price: number; }[]; readonly selling_plan: { readonly description: string | null; readonly name: string; readonly id: string | number; readonly options: readonly { readonly value: string; readonly name: string; readonly position: number; }[]; readonly recurring_deliveries: boolean; readonly fixed_selling_plan: boolean; readonly price_adjustments: readonly { readonly value: string | number; readonly value_type: "fixed_amount" | "percentage" | "price"; readonly position: number; readonly order_count: number | null; }[]; }; readonly compare_at_price: number; readonly per_delivery_price: number; } | null; readonly unit_price_measurement?: { readonly measured_type: "volume" | "weight" | "dimension"; readonly quantity_unit: string; readonly quantity_value: number; readonly reference_unit: string; readonly reference_value: number; } | undefined; readonly variant_options: readonly string[]; readonly properties: { readonly [x: string]: string | number | boolean | null; }; readonly quantity: number; readonly variant_id: string | number; readonly original_price: number; readonly discounted_price: number; readonly line_price: number; readonly original_line_price: number; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly sku: string | null; readonly grams: number; readonly vendor: string; readonly taxable: boolean; readonly product_id: string | number; readonly product_has_only_default_variant: boolean; readonly gift_card: boolean; readonly final_line_price: number; readonly final_price: number; readonly featured_image: { readonly aspect_ratio: number | null; readonly alt: string | null; readonly height: number | null; readonly url: string | null; readonly width: number | null; }; readonly handle: string; readonly requires_shipping: boolean; readonly product_type: string | null; readonly product_title: string; readonly product_description: string | null; readonly variant_title: string | null; readonly options_with_values: readonly { readonly value: string; readonly name: string; }[]; readonly line_level_discount_allocations: readonly { readonly discount_application: { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }; readonly amount: number; }[]; readonly line_level_total_discount: number; readonly has_components: boolean; readonly unit_price?: number | undefined; } & { readonly properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_properties: { readonly [x: string]: string | number | boolean | null; }; readonly private_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_properties: { readonly [x: string]: string | number | boolean | null; }; readonly public_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; })[]; readonly currency: string; readonly items_subtotal_price: number; readonly cart_level_discount_applications: readonly { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }[]; } & { readonly attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly private_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly public_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; }) | undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; }, Error, import("@effect/platform/HttpClient").HttpClient>; export declare namespace createAjaxCartClient { type Options = { debug?: boolean; }; type RequestOptions = { signal?: AbortSignal; headers?: Record; }; } /** * Validates the input cart object against the defined CartOutput schema. * * @remarks * This function is used to ensure that the provided cart object adheres to the expected structure. * It uses the `Effect.runSync` function to decode the unknown cart object using the `Schema.decodeUnknown` function. * * @param cart - The unknown cart object to be validated. * @returns The validated cart object if it matches the CartOutput schema, or throws an error if it doesn't. * * @example * ```typescript * const cartData = { * id: "1234567890", * items: [ * { * id: "9876543210", * quantity: 2, * variantId: "variant-123", * // ... other item properties * }, * // ... other cart items * ], * // ... other cart properties * }; * * try { * const validatedCart = validateCart(cartData); * console.log("Cart is valid:", validatedCart); * } catch (error) { * console.error("Cart validation failed:", error); * } * ``` */ export declare const validateCart: (cart: unknown) => { readonly attributes: { readonly [x: string]: string | number | boolean | null; }; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly requires_shipping: boolean; readonly token: string; readonly note: string | null; readonly discount_codes: readonly { readonly code: string; readonly applicable: boolean; }[]; readonly original_total_price: number; readonly total_price: number; readonly total_weight: number; readonly item_count: number; readonly items: readonly ({ readonly title: string; readonly key: string; readonly url: string; readonly image: string | null; readonly quantity_rule?: { readonly min: number; readonly max: number | null; readonly increment: number; } | undefined; readonly price: number; readonly id: string | number; readonly selling_plan_allocation: { readonly price: number; readonly price_adjustments: readonly { readonly position: number; readonly price: number; }[]; readonly selling_plan: { readonly description: string | null; readonly name: string; readonly id: string | number; readonly options: readonly { readonly value: string; readonly name: string; readonly position: number; }[]; readonly recurring_deliveries: boolean; readonly fixed_selling_plan: boolean; readonly price_adjustments: readonly { readonly value: string | number; readonly value_type: "fixed_amount" | "percentage" | "price"; readonly position: number; readonly order_count: number | null; }[]; }; readonly compare_at_price: number; readonly per_delivery_price: number; } | null; readonly unit_price_measurement?: { readonly measured_type: "volume" | "weight" | "dimension"; readonly quantity_unit: string; readonly quantity_value: number; readonly reference_unit: string; readonly reference_value: number; } | undefined; readonly variant_options: readonly string[]; readonly properties: { readonly [x: string]: string | number | boolean | null; }; readonly quantity: number; readonly variant_id: string | number; readonly original_price: number; readonly discounted_price: number; readonly line_price: number; readonly original_line_price: number; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly sku: string | null; readonly grams: number; readonly vendor: string; readonly taxable: boolean; readonly product_id: string | number; readonly product_has_only_default_variant: boolean; readonly gift_card: boolean; readonly final_line_price: number; readonly final_price: number; readonly featured_image: { readonly aspect_ratio: number | null; readonly alt: string | null; readonly height: number | null; readonly url: string | null; readonly width: number | null; }; readonly handle: string; readonly requires_shipping: boolean; readonly product_type: string | null; readonly product_title: string; readonly product_description: string | null; readonly variant_title: string | null; readonly options_with_values: readonly { readonly value: string; readonly name: string; }[]; readonly line_level_discount_allocations: readonly { readonly discount_application: { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }; readonly amount: number; }[]; readonly line_level_total_discount: number; readonly has_components: boolean; readonly unit_price?: number | undefined; } & { readonly properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_properties: { readonly [x: string]: string | number | boolean | null; }; readonly private_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_properties: { readonly [x: string]: string | number | boolean | null; }; readonly public_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; })[]; readonly currency: string; readonly items_subtotal_price: number; readonly cart_level_discount_applications: readonly { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }[]; } & { readonly attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly private_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly public_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; }; /** * Creates an instance of the Ajax Cart API client with optional debugging capabilities. * * @remarks * This function initializes the Ajax Cart API client with the provided options. * It sets up the necessary layers for logging and AJAX requests based on the debug flag. * * @param options - An optional object containing debug flag. * @param options.debug - A boolean indicating whether to enable debugging. Default is false. * * @returns An object containing the Ajax Cart API methods: add, change, clear, get, and update. * * @example * ```typescript * const ajaxCartApi = createAjaxCartApi({ debug: true }); * * // Use the Ajax Cart API methods * ajaxCartApi.add({ productId: "123", quantity: 2 }) * .then((response) => { * console.log("Cart updated:", response); * }) * .catch((error) => { * console.error("Failed to update cart:", error); * }); * ``` */ export declare const createAjaxCartApi: ({ debug }: { debug?: boolean | undefined; }) => { /** * Adds a product to the cart. * * @param input - The input object containing the product ID and quantity to be added. * @param options - An optional object containing request options. * @param options.signal - An AbortSignal object to abort the request. * @param options.headers - Custom headers to be sent with the request. * * @returns A Promise that resolves to the updated cart object. * * @example * ```typescript * const ajaxCartApi = createAjaxCartApi({ debug: true }); * * ajaxCartApi.add({ productId: "123", quantity: 2 }) * .then((response) => { * console.log("Cart updated:", response); * }) * .catch((error) => { * console.error("Failed to update cart:", error); * }); * ``` */ add: (input: add.Input, options?: createAjaxCartClient.RequestOptions) => Promise<{ readonly data?: undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; } | { readonly data?: { readonly items: readonly ({ readonly title: string; readonly key: string; readonly url: string; readonly image: string | null; readonly quantity_rule?: { readonly min: number; readonly max: number | null; readonly increment: number; } | undefined; readonly price: number; readonly id: string | number; readonly selling_plan_allocation: { readonly price: number; readonly price_adjustments: readonly { readonly position: number; readonly price: number; }[]; readonly selling_plan: { readonly description: string | null; readonly name: string; readonly id: string | number; readonly options: readonly { readonly value: string; readonly name: string; readonly position: number; }[]; readonly recurring_deliveries: boolean; readonly fixed_selling_plan: boolean; readonly price_adjustments: readonly { readonly value: string | number; readonly value_type: "fixed_amount" | "percentage" | "price"; readonly position: number; readonly order_count: number | null; }[]; }; readonly compare_at_price: number; readonly per_delivery_price: number; } | null; readonly unit_price_measurement?: { readonly measured_type: "volume" | "weight" | "dimension"; readonly quantity_unit: string; readonly quantity_value: number; readonly reference_unit: string; readonly reference_value: number; } | undefined; readonly variant_options: readonly string[]; readonly properties: { readonly [x: string]: string | number | boolean | null; }; readonly quantity: number; readonly variant_id: string | number; readonly original_price: number; readonly discounted_price: number; readonly line_price: number; readonly original_line_price: number; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly sku: string | null; readonly grams: number; readonly vendor: string; readonly taxable: boolean; readonly product_id: string | number; readonly product_has_only_default_variant: boolean; readonly gift_card: boolean; readonly final_line_price: number; readonly final_price: number; readonly featured_image: { readonly aspect_ratio: number | null; readonly alt: string | null; readonly height: number | null; readonly url: string | null; readonly width: number | null; }; readonly handle: string; readonly requires_shipping: boolean; readonly product_type: string | null; readonly product_title: string; readonly product_description: string | null; readonly variant_title: string | null; readonly options_with_values: readonly { readonly value: string; readonly name: string; }[]; readonly line_level_discount_allocations: readonly { readonly discount_application: { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }; readonly amount: number; }[]; readonly line_level_total_discount: number; readonly has_components: boolean; readonly unit_price?: number | undefined; } & { readonly properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_properties: { readonly [x: string]: string | number | boolean | null; }; readonly private_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_properties: { readonly [x: string]: string | number | boolean | null; }; readonly public_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; })[]; } | undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; }>; /** * Updates the quantity, attributes, or selling plan of a specific item in the cart. * * @remarks * This function sends a request to update the quantity, attributes, or selling plan of a specific item in the cart. * It uses the provided input object to specify the item ID and the new quantity, attributes, or selling plan. * The function also accepts optional request options, such as an AbortSignal for cancellation. * * @param input - The input object containing the item ID and the new quantity. * @param options - An optional object containing request options. * @param options.signal - An AbortSignal object to abort the request. * @param options.headers - Custom headers to be sent with the request. * * @returns A Promise that resolves to the updated cart object. * * @example * ```typescript * const ajaxCartApi = createAjaxCartApi({ debug: true }); * * ajaxCartApi.change({ itemId: "9876543210", quantity: 3 }) * .then((response) => { * console.log("Cart updated:", response); * }) * .catch((error) => { * console.error("Failed to update cart:", error); * }); * ``` */ change: (input: change.Input, options?: createAjaxCartClient.RequestOptions) => Promise<{ readonly data?: undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; } | { readonly data?: ({ readonly attributes: { readonly [x: string]: string | number | boolean | null; }; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly requires_shipping: boolean; readonly token: string; readonly note: string | null; readonly discount_codes: readonly { readonly code: string; readonly applicable: boolean; }[]; readonly original_total_price: number; readonly total_price: number; readonly total_weight: number; readonly item_count: number; readonly items: readonly ({ readonly title: string; readonly key: string; readonly url: string; readonly image: string | null; readonly quantity_rule?: { readonly min: number; readonly max: number | null; readonly increment: number; } | undefined; readonly price: number; readonly id: string | number; readonly selling_plan_allocation: { readonly price: number; readonly price_adjustments: readonly { readonly position: number; readonly price: number; }[]; readonly selling_plan: { readonly description: string | null; readonly name: string; readonly id: string | number; readonly options: readonly { readonly value: string; readonly name: string; readonly position: number; }[]; readonly recurring_deliveries: boolean; readonly fixed_selling_plan: boolean; readonly price_adjustments: readonly { readonly value: string | number; readonly value_type: "fixed_amount" | "percentage" | "price"; readonly position: number; readonly order_count: number | null; }[]; }; readonly compare_at_price: number; readonly per_delivery_price: number; } | null; readonly unit_price_measurement?: { readonly measured_type: "volume" | "weight" | "dimension"; readonly quantity_unit: string; readonly quantity_value: number; readonly reference_unit: string; readonly reference_value: number; } | undefined; readonly variant_options: readonly string[]; readonly properties: { readonly [x: string]: string | number | boolean | null; }; readonly quantity: number; readonly variant_id: string | number; readonly original_price: number; readonly discounted_price: number; readonly line_price: number; readonly original_line_price: number; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly sku: string | null; readonly grams: number; readonly vendor: string; readonly taxable: boolean; readonly product_id: string | number; readonly product_has_only_default_variant: boolean; readonly gift_card: boolean; readonly final_line_price: number; readonly final_price: number; readonly featured_image: { readonly aspect_ratio: number | null; readonly alt: string | null; readonly height: number | null; readonly url: string | null; readonly width: number | null; }; readonly handle: string; readonly requires_shipping: boolean; readonly product_type: string | null; readonly product_title: string; readonly product_description: string | null; readonly variant_title: string | null; readonly options_with_values: readonly { readonly value: string; readonly name: string; }[]; readonly line_level_discount_allocations: readonly { readonly discount_application: { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }; readonly amount: number; }[]; readonly line_level_total_discount: number; readonly has_components: boolean; readonly unit_price?: number | undefined; } & { readonly properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_properties: { readonly [x: string]: string | number | boolean | null; }; readonly private_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_properties: { readonly [x: string]: string | number | boolean | null; }; readonly public_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; })[]; readonly currency: string; readonly items_subtotal_price: number; readonly cart_level_discount_applications: readonly { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }[]; } & { readonly attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly private_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly public_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; }) | undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; }>; /** * Clears the entire cart. * * This function sends a request to clear the entire cart. It does not require any input parameters. * The function accepts optional request options, such as an AbortSignal for cancellation. * * @param input - An optional input object containing request options. * @param input.signal - An AbortSignal object to abort the request. * @param input.headers - Custom headers to be sent with the request. * * @returns A Promise that resolves to an empty object upon successful cart clearance. * * @example * ```typescript * const ajaxCartApi = createAjaxCartApi({ debug: true }); * * ajaxCartApi.clear() * .then(() => { * console.log("Cart cleared successfully"); * }) * .catch((error) => { * console.error("Failed to clear cart:", error); * }); * ``` */ clear: (input: clear.Input, options?: createAjaxCartClient.RequestOptions) => Promise<{ readonly data?: undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; } | { readonly data?: ({ readonly attributes: { readonly [x: string]: string | number | boolean | null; }; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly requires_shipping: boolean; readonly token: string; readonly note: string | null; readonly discount_codes: readonly { readonly code: string; readonly applicable: boolean; }[]; readonly original_total_price: number; readonly total_price: number; readonly total_weight: number; readonly item_count: number; readonly items: readonly ({ readonly title: string; readonly key: string; readonly url: string; readonly image: string | null; readonly quantity_rule?: { readonly min: number; readonly max: number | null; readonly increment: number; } | undefined; readonly price: number; readonly id: string | number; readonly selling_plan_allocation: { readonly price: number; readonly price_adjustments: readonly { readonly position: number; readonly price: number; }[]; readonly selling_plan: { readonly description: string | null; readonly name: string; readonly id: string | number; readonly options: readonly { readonly value: string; readonly name: string; readonly position: number; }[]; readonly recurring_deliveries: boolean; readonly fixed_selling_plan: boolean; readonly price_adjustments: readonly { readonly value: string | number; readonly value_type: "fixed_amount" | "percentage" | "price"; readonly position: number; readonly order_count: number | null; }[]; }; readonly compare_at_price: number; readonly per_delivery_price: number; } | null; readonly unit_price_measurement?: { readonly measured_type: "volume" | "weight" | "dimension"; readonly quantity_unit: string; readonly quantity_value: number; readonly reference_unit: string; readonly reference_value: number; } | undefined; readonly variant_options: readonly string[]; readonly properties: { readonly [x: string]: string | number | boolean | null; }; readonly quantity: number; readonly variant_id: string | number; readonly original_price: number; readonly discounted_price: number; readonly line_price: number; readonly original_line_price: number; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly sku: string | null; readonly grams: number; readonly vendor: string; readonly taxable: boolean; readonly product_id: string | number; readonly product_has_only_default_variant: boolean; readonly gift_card: boolean; readonly final_line_price: number; readonly final_price: number; readonly featured_image: { readonly aspect_ratio: number | null; readonly alt: string | null; readonly height: number | null; readonly url: string | null; readonly width: number | null; }; readonly handle: string; readonly requires_shipping: boolean; readonly product_type: string | null; readonly product_title: string; readonly product_description: string | null; readonly variant_title: string | null; readonly options_with_values: readonly { readonly value: string; readonly name: string; }[]; readonly line_level_discount_allocations: readonly { readonly discount_application: { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }; readonly amount: number; }[]; readonly line_level_total_discount: number; readonly has_components: boolean; readonly unit_price?: number | undefined; } & { readonly properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_properties: { readonly [x: string]: string | number | boolean | null; }; readonly private_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_properties: { readonly [x: string]: string | number | boolean | null; }; readonly public_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; })[]; readonly currency: string; readonly items_subtotal_price: number; readonly cart_level_discount_applications: readonly { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }[]; } & { readonly attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly private_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly public_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; }) | undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; }>; /** * Retrieves the current state of the cart. * * This function sends a request to retrieve the current state of the cart. * It does not require any input parameters. * The function accepts optional request options, such as an AbortSignal for cancellation. * * @param input - An optional input object containing request options. * @param input.signal - An AbortSignal object to abort the request. * @param input.headers - Custom headers to be sent with the request. * * @returns A Promise that resolves to the current cart object. * * @example * ```typescript * const ajaxCartApi = createAjaxCartApi({ debug: true }); * * ajaxCartApi.get() * .then((response) => { * console.log("Current cart:", response); * }) * .catch((error) => { * console.error("Failed to retrieve cart:", error); * }); * ``` */ get: (input: get.Input, options?: createAjaxCartClient.RequestOptions) => Promise<{ readonly data?: undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; } | { readonly data?: ({ readonly attributes: { readonly [x: string]: string | number | boolean | null; }; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly requires_shipping: boolean; readonly token: string; readonly note: string | null; readonly discount_codes: readonly { readonly code: string; readonly applicable: boolean; }[]; readonly original_total_price: number; readonly total_price: number; readonly total_weight: number; readonly item_count: number; readonly items: readonly ({ readonly title: string; readonly key: string; readonly url: string; readonly image: string | null; readonly quantity_rule?: { readonly min: number; readonly max: number | null; readonly increment: number; } | undefined; readonly price: number; readonly id: string | number; readonly selling_plan_allocation: { readonly price: number; readonly price_adjustments: readonly { readonly position: number; readonly price: number; }[]; readonly selling_plan: { readonly description: string | null; readonly name: string; readonly id: string | number; readonly options: readonly { readonly value: string; readonly name: string; readonly position: number; }[]; readonly recurring_deliveries: boolean; readonly fixed_selling_plan: boolean; readonly price_adjustments: readonly { readonly value: string | number; readonly value_type: "fixed_amount" | "percentage" | "price"; readonly position: number; readonly order_count: number | null; }[]; }; readonly compare_at_price: number; readonly per_delivery_price: number; } | null; readonly unit_price_measurement?: { readonly measured_type: "volume" | "weight" | "dimension"; readonly quantity_unit: string; readonly quantity_value: number; readonly reference_unit: string; readonly reference_value: number; } | undefined; readonly variant_options: readonly string[]; readonly properties: { readonly [x: string]: string | number | boolean | null; }; readonly quantity: number; readonly variant_id: string | number; readonly original_price: number; readonly discounted_price: number; readonly line_price: number; readonly original_line_price: number; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly sku: string | null; readonly grams: number; readonly vendor: string; readonly taxable: boolean; readonly product_id: string | number; readonly product_has_only_default_variant: boolean; readonly gift_card: boolean; readonly final_line_price: number; readonly final_price: number; readonly featured_image: { readonly aspect_ratio: number | null; readonly alt: string | null; readonly height: number | null; readonly url: string | null; readonly width: number | null; }; readonly handle: string; readonly requires_shipping: boolean; readonly product_type: string | null; readonly product_title: string; readonly product_description: string | null; readonly variant_title: string | null; readonly options_with_values: readonly { readonly value: string; readonly name: string; }[]; readonly line_level_discount_allocations: readonly { readonly discount_application: { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }; readonly amount: number; }[]; readonly line_level_total_discount: number; readonly has_components: boolean; readonly unit_price?: number | undefined; } & { readonly properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_properties: { readonly [x: string]: string | number | boolean | null; }; readonly private_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_properties: { readonly [x: string]: string | number | boolean | null; }; readonly public_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; })[]; readonly currency: string; readonly items_subtotal_price: number; readonly cart_level_discount_applications: readonly { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }[]; } & { readonly attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly private_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly public_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; }) | undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; }>; /** * Updates the cart with the provided input data. * * This function sends a request to update any cart level data (discount codes, notes, attributes, etc...). * It uses the provided input object to specify the changes to be made to the cart. * The function also accepts optional request options, such as an AbortSignal for cancellation. * * @param input - The input object containing the changes to be made to the cart. * @param options - An optional object containing request options. * @param options.signal - An AbortSignal object to abort the request. * @param options.headers - Custom headers to be sent with the request. * * @returns A Promise that resolves to the updated cart object. * * @example * ```typescript * const ajaxCartApi = createAjaxCartApi({ debug: true }); * * ajaxCartApi.update({ * updates: { 1231231: 2, 1231230: 0 }, * note: "This is a note", * attributes: { * "public_key": "Public value", * "_private_key": "Private value" * }, * discount: ["hello","world"] * }) * .then((response) => { * console.log("Cart updated:", response); * }) * .catch((error) => { * console.error("Failed to update cart:", error); * }); * ``` */ update: (input: update.Input, options?: createAjaxCartClient.RequestOptions) => Promise<{ readonly data?: undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; } | { readonly data?: ({ readonly attributes: { readonly [x: string]: string | number | boolean | null; }; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly requires_shipping: boolean; readonly token: string; readonly note: string | null; readonly discount_codes: readonly { readonly code: string; readonly applicable: boolean; }[]; readonly original_total_price: number; readonly total_price: number; readonly total_weight: number; readonly item_count: number; readonly items: readonly ({ readonly title: string; readonly key: string; readonly url: string; readonly image: string | null; readonly quantity_rule?: { readonly min: number; readonly max: number | null; readonly increment: number; } | undefined; readonly price: number; readonly id: string | number; readonly selling_plan_allocation: { readonly price: number; readonly price_adjustments: readonly { readonly position: number; readonly price: number; }[]; readonly selling_plan: { readonly description: string | null; readonly name: string; readonly id: string | number; readonly options: readonly { readonly value: string; readonly name: string; readonly position: number; }[]; readonly recurring_deliveries: boolean; readonly fixed_selling_plan: boolean; readonly price_adjustments: readonly { readonly value: string | number; readonly value_type: "fixed_amount" | "percentage" | "price"; readonly position: number; readonly order_count: number | null; }[]; }; readonly compare_at_price: number; readonly per_delivery_price: number; } | null; readonly unit_price_measurement?: { readonly measured_type: "volume" | "weight" | "dimension"; readonly quantity_unit: string; readonly quantity_value: number; readonly reference_unit: string; readonly reference_value: number; } | undefined; readonly variant_options: readonly string[]; readonly properties: { readonly [x: string]: string | number | boolean | null; }; readonly quantity: number; readonly variant_id: string | number; readonly original_price: number; readonly discounted_price: number; readonly line_price: number; readonly original_line_price: number; readonly total_discount: number; readonly discounts: readonly { readonly title: string; readonly amount: number; }[]; readonly sku: string | null; readonly grams: number; readonly vendor: string; readonly taxable: boolean; readonly product_id: string | number; readonly product_has_only_default_variant: boolean; readonly gift_card: boolean; readonly final_line_price: number; readonly final_price: number; readonly featured_image: { readonly aspect_ratio: number | null; readonly alt: string | null; readonly height: number | null; readonly url: string | null; readonly width: number | null; }; readonly handle: string; readonly requires_shipping: boolean; readonly product_type: string | null; readonly product_title: string; readonly product_description: string | null; readonly variant_title: string | null; readonly options_with_values: readonly { readonly value: string; readonly name: string; }[]; readonly line_level_discount_allocations: readonly { readonly discount_application: { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }; readonly amount: number; }[]; readonly line_level_total_discount: number; readonly has_components: boolean; readonly unit_price?: number | undefined; } & { readonly properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_properties: { readonly [x: string]: string | number | boolean | null; }; readonly private_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_properties: { readonly [x: string]: string | number | boolean | null; }; readonly public_properties_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; })[]; readonly currency: string; readonly items_subtotal_price: number; readonly cart_level_discount_applications: readonly { readonly title: string; readonly description: string | null; readonly value: number; readonly target_selection: "all" | "entitled" | "explicit"; readonly target_type: "line_item" | "shipping_line"; readonly total_allocated_amount: number; readonly type: "" | "automatic" | "discount_code" | "manual" | "script"; readonly value_type: "fixed_amount" | "percentage"; }[]; } & { readonly attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly private_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly private_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; readonly public_attributes: { readonly [x: string]: string | number | boolean | null; }; readonly public_attributes_array: readonly { readonly key: string; readonly value: string | number | boolean | null; }[]; }) | undefined; readonly error?: { status: number; message: string; description?: string; } | undefined; }>; }; export {};