import type { ProductData, SalesSdkAddProductResult, SalesSdkAddProductWithFlowOptions, SalesSdkAddProductWithFlowResult, SalesSdkCartBookingView, SalesSdkCartItemView } from '../types';
import { type AddToCartToastApi } from '../components/showAddToCartToast';
/**
 * 仅跨日预约商品绕过 UI 防抖；其余预约商品与普通商品一样参与连点合并（OS 落库时拆行）。
 *
 * @example
 * shouldBypassAddProductDebounce({ duration_type: 'days' }); // true
 * shouldBypassAddProductDebounce({ id: 1 }, { duration: { value: 30 } }); // false
 */
export declare function shouldBypassAddProductDebounce(product: ProductData & Record<string, any>, cacheItem?: Record<string, any> | null): boolean;
export declare const DEFAULT_ADD_PRODUCT_DEBOUNCE_MS = 200;
export declare type AddProductOsDecision = {
    action: 'add';
    cacheItem?: any;
} | {
    action: 'requiresDetail';
    payload?: any;
    cacheItem?: any;
} | {
    action: 'requiresBookingEdit';
    payload?: any;
    cacheItem?: any;
} | {
    action: 'reloadCatalog';
};
export interface AddProductWithFlowDebouncedDeps {
    decideAddProduct: (product: ProductData & Record<string, any>, options?: Pick<SalesSdkAddProductWithFlowOptions, 'type' | 'quantity'>) => AddProductOsDecision;
    runAddProductFlow: (product: ProductData & Record<string, any>, options?: SalesSdkAddProductWithFlowOptions) => Promise<SalesSdkAddProductWithFlowResult>;
    addProductDirect: (product: ProductData & Record<string, any>, options?: SalesSdkAddProductWithFlowOptions) => Promise<SalesSdkAddProductResult>;
    /** session catalog 过期时 silent reload products（TimeBar 当前日期）。 */
    reloadProductCatalog?: () => Promise<void>;
    getCartItems: () => SalesSdkCartItemView[];
    getCartBookings?: () => SalesSdkCartBookingView[];
    Toast?: AddToCartToastApi | null;
    getToast?: () => AddToCartToastApi | null;
    defaultDebounceMs?: number;
}
/**
 * 创建带防抖的 `addProductWithFlow`：
 * - OS `decideAddProduct` 为 `requiresDetail` / `requiresBookingEdit` 时立即走完整弹窗链；
 * - 仅 `action === 'add'` 时：首击立即 `addProduct`，200ms 窗口内后续点击合并追加数量；
 * - 跨日预约商品每次点击独立加车；其余预约商品连点合并后由 OS 按数量拆行；
 * - 首击/立即加车：Toast 弹出后 yield 一帧再落库（Toast 先于购物车可见）；连点合并仅同步更新 Toast。
 */
export declare function createAddProductWithFlowDebounced(deps: AddProductWithFlowDebouncedDeps): {
    addProductWithFlow: (product: ProductData & Record<string, any>, options?: SalesSdkAddProductWithFlowOptions) => Promise<SalesSdkAddProductWithFlowResult>;
};
