UNPKG

@selldone/sdk-storefront

Version:

A TypeScript SDK to connect to your shop and build a fully functional storefront and website by simply developing a frontend web application. All backend operations are seamlessly managed by the serverless Selldone solution.

159 lines (158 loc) 4.89 kB
import { XapiProduct } from "../XapiProduct"; import { Product } from "@selldone/core-js/models/shop/product/product.model"; import { Category } from "@selldone/core-js/models/shop/category/category.model"; export default function XapiProductList(this: XapiProduct, dir?: string | null, offset?: number, limit?: number, options?: XapiProductListTypes.IOptions): Promise<XapiProductListTypes.IResponse>; export declare namespace XapiProductListTypes { interface IResponse { products: Product.IProduct[]; folders: Category.ICategory[]; parent: Category.ICategory; after?: string | null; before?: string | null; total?: number; "relation-mode": string[] | "same-category"; tax_profile?: object | null; valuation?: object | null; time_filter?: object | null; } /** * Interface representing product options. * * @see getFilteredProducts for more details. */ interface IOptions { /** * Types of the product. */ types?: Product.ProductType[] | null; /** * Statuses of the product. */ statuses?: Product.ProductStatus[] | null; /** * Show only available products. * @default false * @example false */ available?: boolean; /** * Limit number of categories. */ categories_count?: number; /** * Return parent category of current category. * @default false * @example true */ with_parent?: boolean; /** * Sort type of the list. * @example newest */ sort?: "most_visited" | "most_popular" | "newest" | "bestselling" | "cheapest" | "most_expensive" | "random" | "related"; /** * Search text. * @example "example search text" * * User value '*' : It will return all products. */ search?: string; /** * Search type. Can be null or category. * @example category */ search_type?: "exact" | "quote" | "tax" | "valuation" | "new"; /** * Multiple category IDs. */ dirs?: string[]; /** * Product filtering criteria. */ filter?: IFilter | null; /** * Return only products. * @default false * @example true */ products_only?: boolean; /** * Return only categories. * @default false * @example true */ categories_only?: boolean; /** * Location constraints. * * Bounding coordinates for product location constraints. * Consists of [Lng1, Lat1, Lng2, Lat2]. */ bounds?: [number, number, number, number]; /** * Filter products by tags. */ tags?: string[]; /** * Show products only for this vendor. */ vendor_id?: string; /** * Controls category visibility. * true: Show only selected categories. * false: Show items inside selected categories. */ surrounded?: boolean; /** * Only for this map tag ID. */ map?: number | null; /** * Filter for starred products. */ only_stared?: boolean; /** * Filter for wishlist products. */ only_in_wishlist?: boolean; /** * Only return page if with_parent be true! It returns linked custom page of current category (parent). */ with_page?: boolean; with_total?: boolean; } /** * IFilter interface represents the structure for filtering products. */ interface IFilter { /** * A flag indicating if only original products should be retrieved. */ only_is_original?: boolean | null; /** * A flag indicating if only products with a discount should be retrieved. */ only_has_discount?: boolean | null; /** * An array of price ranges for filtering products. */ prices?: [number, number][] | null; /** * Brands to filter products by. */ brands?: (string | null)[]; /** * Selected product variants for filtering. */ selected_variants?: any[][] | null; /** * Selected specifications for filtering products. */ selected_spec?: any[][] | null; /** * If true, only products with limited offer will be retrieved. * If a number, only products with limited offer and the given number of hours left will be retrieved. */ limited_offer?: boolean | number | null; } }