UNPKG

@iterable/react-native-sdk

Version:
113 lines (102 loc) 2.54 kB
"use strict"; /** * Represents an item for purchase. * * This is used in methods like `trackPurchase` to track purchases made by * users. It is also used in the `updateCart` method to update the shopping cart. * * @example * ```typescript * const commerceItem = new IterableCommerceItem( * '12345', * 'Example Item', * 9.99, * 1, * 'SKU123', * 'An example item for demonstration purposes.', * 'https://example.com/item', * 'https://example.com/item.jpg', * ['Example', 'Demo'], * { customField: 'value' }, * ); * * IterableAPI.updateCart([commerceItem]); * ``` */ export class IterableCommerceItem { /** * The unique identifier for the item. */ /** * The name of the item. */ /** * The price of the item. */ /** * The quantity of the item. */ /** * The stock keeping unit (SKU) of the item. */ /** * The description of the item. */ /** * The URL of the item. */ /** * The image URL of the item. */ /** * The categories the item belongs to. */ /** * Additional data fields for the item. */ /** * Creates an instance of IterableCommerceItem. * * @param id - The unique identifier for the item. * @param name - The name of the item. * @param price - The price of the item. * @param quantity - The quantity of the item. * @param sku - The stock keeping unit (SKU) of the item. * @param description - The description of the item. * @param url - The URL of the item. * @param imageUrl - The image URL of the item. * @param categories - The categories the item belongs to. * @param dataFields - Additional data fields for the item. * * @returns A new instance of IterableCommerceItem. * * @example * ```typescript * const commerceItem = new IterableCommerceItem( * '12345', * 'Example Item', * 9.99, * 1, * 'SKU123', * 'An example item for demonstration purposes.', * 'https://example.com/item', * 'https://example.com/item.jpg', * ['Example', 'Demo'], * { customField: 'value' }, * ); * ``` */ constructor(id, name, price, quantity, sku, description, url, imageUrl, categories, dataFields) { this.id = id; this.name = name; this.price = price; this.quantity = quantity; this.sku = sku; this.description = description; this.url = url; this.imageUrl = imageUrl; this.categories = categories; this.dataFields = dataFields; } } //# sourceMappingURL=IterableCommerceItem.js.map