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.

52 lines (51 loc) 3.15 kB
import type { Avocado, Domain, Shop, Vendor } from "../../models"; export declare class ShopURLs { static MainShopUrl(shop: Shop & { domains?: Domain[]; }): string; static GetVendorLandingPageUrl(shop: Shop, vendor: Vendor): string | null; static GetVendorListingPageUrl(shop: Shop, vendor: Vendor): string | null; /** * Generates a URL link for a specific page in the shop, based on the shop information, query parameters, and optional path. * * @param shop - The `Shop` object containing information about the shop. * @param query - An object representing the query parameters as key-value pairs, where each key is a parameter name and each value is the parameter's value. * @param path - (Optional) A string specifying the path within the shop. Defaults to an empty string if not provided. * @returns The full URL string for the specified shop page, combining the shop's main URL, path, and serialized query string. */ static GetShopPageLink(shop: Shop, query: { [key: string]: string; }, path?: string): string; /** * Generates the URL link for a product based on the shop information, product ID, and optional slug. * * @param shop - The `Shop` object that contains information about the shop. * @param product_id - The unique identifier for the product, which can be a number or string. * @param slug - (Optional) A slug string that may be appended to the URL for SEO-friendly purposes. * If provided, it will be added to the URL after the product ID. * Defaults to `null`. * @returns The full URL string for the product, combining the shop's main URL, product path, and slug if available. */ static GetProductLink(shop: Shop, product_id: number | string, slug?: null): string; /** * Generates the URL link for a specific category in the shop based on the shop information and category name. * * @param shop - The `Shop` object containing information about the shop. * @param category_name - The name of the category to be included in the URL. * This will be appended to the URL with a `-category` suffix. * @returns The full URL string for the specified category in the shop, combining the shop's main URL and the category name with the `-category` suffix. */ static GetCategoryLink(shop: Shop, category_name: string): string; /** * Generates the URL link for a blog post based on the shop information and blog ID. * * @param shop - The `Shop` object containing information about the shop. * @param blog_id - The unique identifier for the blog post, which can be a number or a string. * @returns The full URL string for the blog post, combining the shop's main URL and the blog ID path. */ static GetBlogLink(shop: Shop, blog_id: number | string): string; static GetShopHyperUrl(shop: Shop): string; static GetShopAvocadoUrl(shop: Shop): string; static GetAvocadoBuyerUrl(shop: Shop, avocado: Avocado): string; static GetShopInstagramUrl(shop: Shop): string; }