UNPKG

@wallfar/ocd-studio-core-sdk

Version:

Helper SDK for our OneClick Studio modules

45 lines (40 loc) 1.15 kB
import { InjectionKey, Component } from 'vue'; import { Firestore } from 'firebase-admin/firestore'; export { C as CartItem, P as Product } from './shared/ocd-studio-core-sdk.Swh7aSCT.js'; interface WebshopServerConfig { defaultBrand?: string; defaultCurrency?: string; defaultLocale?: string; provider: 'firebase'; firebase?: { db: Firestore; products: string; collections: string; shippingOptions: string; promoCodes: string; }; paymentProvider: 'stripe'; stripe?: { key: string; webhook_secret: string; }; } interface PromoCodeDto { id?: string; code: string; type: string; value?: number; minOrderAmount?: number; } declare class WebshopServer { private config; constructor(config: WebshopServerConfig); validatePromoCode(code: string): Promise<{ valid: boolean; promo?: PromoCodeDto; error?: string; }>; createPaymentLink(checkoutData: any): Promise<string>; } declare const studioComponentsKey: InjectionKey<Record<string, Component>>; export { WebshopServer, studioComponentsKey };