import { ComputedRef, Ref } from 'vue';

declare function createProductConfigurator(product: Partial<Product>): {
    selection: any;
    getSelectedVariant: () => VariantOptions | undefined;
    getVariant: (variant: VariantOptions) => VariantOptions | undefined;
};

interface WebshopConfig {
    defaultBrand?: string;
    defaultCurrency?: string;
    defaultLocale?: string;
    itemsPerPage?: number;
    provider: 'firebase';
    firebase?: {
        db: any;
        products: string;
        collections: string;
        shippingOptions: string;
        promoCodes: string;
    };
    createPaymentLinkRequest?: (checkoutData: any) => Promise<string>;
    promoCodeValidationRequest?: (code: string) => Promise<PromoCodeValidationResult>;
}
type PromoCodeValidationResult = {
    valid: boolean;
    promo?: PromoCodeDto;
    error?: string;
};
interface Address {
    firstName: string;
    lastName: string;
    company?: string;
    streetLine1: string;
    streetLine2?: string;
    streetLine3?: string;
    city: string;
    stateOrProvince?: string;
    countyOrDistrict?: string;
    postalCode: string;
    country: string;
    phoneNumber?: string;
    email?: string;
    instructions?: string;
    latitude?: number;
    longitude?: number;
}
interface ShippingOption {
    id?: string;
    status: 'published' | 'draft';
    title: string;
    description?: string;
    price?: number;
    countries: string[];
    condition: 'always' | 'price_based' | 'weight_based';
    condition_min?: number;
    condition_max?: number;
}
interface Collection {
    id?: string;
    title: string;
    description?: string;
    thumbnail?: string;
    slug: string;
    type: 'manual' | 'auto';
    status: 'published' | 'draft';
    conditions?: CollectionCondition[];
    subcollections?: SubCollection[];
}
interface SubCollection {
    id?: string;
    title: string;
    description?: string;
    thumbnail?: string;
    slug: string;
    type: 'manual' | 'auto';
    status: 'published' | 'draft';
    conditions?: CollectionCondition[];
}
interface CollectionCondition {
    field: string;
    operator: '==' | '!=' | '<' | '>' | '<=' | '>=' | 'in' | 'not-in' | 'array-contains' | 'array-contains-any';
    value: any;
}
interface Product {
    id: string;
    slug: string;
    title: string;
    description: string;
    seo?: {
        title?: string;
        description?: string;
    };
    price: number;
    compareAtPrice?: number;
    costPerItem?: number;
    currency: string;
    isTaxable?: boolean;
    taxRate?: number;
    maxPrice: number;
    minPrice: number;
    maxCompareAtPrice?: number;
    minCompareAtPrice?: number;
    hasPriceVariation: boolean;
    available: boolean;
    canPickup: boolean;
    canDeliver: boolean;
    type: ProductType;
    status: ProductStatus;
    stock: number;
    trackInventory: boolean;
    allowBackorder: boolean;
    vendor?: string;
    isSingleVariant: boolean;
    variantsTotal: number;
    options?: ProductOption[];
    variants?: ProductVariant[];
    media: string[];
    featuredMedia?: string;
    sku?: string;
    mpn?: string;
    gtin?: string;
    brand?: string;
    tags: string[];
    collections: string[];
    createdAt: Date;
    updatedAt: Date;
    extraFields?: Record<string, any>;
}
type ProductStatus = 'published' | 'draft' | 'archived';
type ProductType = 'physical' | 'digital' | 'gift_card';
interface ProductOption {
    id: string;
    name: string;
    values: ProductOptionValue[];
}
interface ProductOptionValue {
    id: string;
    value: string;
}
interface ProductVariant {
    price: number;
    stock: number;
    name: string;
    image?: string;
    disabled?: boolean;
    combinedOptions: string;
    options: ProductOptionValue[];
}
interface CartItem {
    productId: string;
    title: string;
    slug: string;
    thumbnail?: string;
    price: number;
    currency: string;
    quantity: number;
    stock?: number;
    variant?: VariantOptions;
}
interface VariantOptions {
    [key: string]: any;
}
interface PromoCodeDto {
    id?: string;
    code: string;
    type: string;
    value?: number;
    minOrderAmount?: number;
}
type ProductConfigurator = ReturnType<typeof createProductConfigurator>;
interface UseProductReturn {
    /** never‐null */
    product: ComputedRef<Product | null>;
    /** loading state */
    pending: Ref<boolean>;
    /** fetch errors */
    error: Ref<Error | null>;
    /** manually re-fetch */
    refresh: () => Promise<void>;
    /** live selection object for v-model */
    selection: ProductConfigurator['selection'];
    /** shortcut for cfg.getVariant() */
    selectedVariant: ComputedRef<ReturnType<ProductConfigurator['getVariant']> | undefined>;
}

export type { Address as A, CartItem as C, Product as P, ShippingOption as S, UseProductReturn as U, VariantOptions as V, WebshopConfig as W, Collection as a, PromoCodeValidationResult as b };
