import { Module, PisellCore } from '../../types';
import { BaseModule } from '../../modules/BaseModule';
import { Response } from '../../plugins';
import { BookingByStepState } from './types';
import { CartItem, IUpdateItemParams, ProductData, ProductResourceItem, ECartItemInfoType, ECartItemCheckType } from '../../modules';
import { Account } from '../../modules/Account/types';
import { IStep } from '../../modules/Step/tyeps';
import { TimeSliceItem, ResourceItem } from './utils/resources';
import { ITime } from '../../modules/Date/types';
import dayjs from 'dayjs';
import { LoadScheduleAvailableDateParams } from '../../modules/Schedule/types';
import { IHolder, IFetchHolderAccountsParams } from '../../modules/AccountList/types';
export declare class BookingByStepImpl extends BaseModule implements Module {
    protected defaultName: string;
    protected defaultVersion: string;
    isSolution: boolean;
    private request;
    private window;
    private shopStore;
    private store;
    private otherParams;
    private cacheId;
    private otherData;
    private platform;
    initialize(core: PisellCore, options: any): Promise<void>;
    initStep(stepList: (keyof BookingByStepState)[]): void;
    getCurrentStep(): {
        index: number;
        step: IStep;
    };
    next(): void;
    back(): void;
    gotoStep(index: number): void;
    getStepList(): IStep[];
    /**
     * 添加step
     */
    addStep(step: IStep, key?: string): void;
    /**
     * 删除step
     */
    removeStep(key: string): void;
    /**
     * 更新step
     */
    updateStep(key: string, step: IStep): void;
    /**
     *
     * 加载商品，然后导到商品列表里去
     * @param {({
     *     category_ids?: number[];
     *     product_ids?: number[];
     *     collection?: number | string[];
     *     schedule_date?: string;
     *   })} {
     *     category_ids = [],
     *     product_ids = [],
     *     collection = [],
     *     schedule_date,
     *   }
     * @return {*}
     * @memberof BookingByStepImpl
     */
    loadProducts({ category_ids, product_ids, collection, schedule_date, }: {
        category_ids?: number[];
        product_ids?: number[];
        collection?: number | string[];
        schedule_date?: string;
    }): Promise<any>;
    /**
     * 通过 schedule 来读取商品，适用于 session 类商品
     *
     * @param {{
     *     date: string;
     *     product_ids?: number[];
     *     category_ids?: number[];
     *   }} {
     *     date,
     *     product_ids = [],
     *     category_ids = [],
     *   }
     * @return {*}
     * @memberof BookingByStepImpl
     */
    loadProductByScheduleDate({ date, product_ids, category_ids, }: {
        date: string;
        product_ids?: number[];
        category_ids?: number[];
    }): Promise<any>;
    /**
     * 更新完商品数据、切换日期、或者在较后的流程里登录了，检测当前购物车里是否有商品，如果有，则需要更新购物车里的商品价格
     *
     * @param {string} date
     * @memberof BookingByStepImpl
     */
    updateQuotationPriceAndCart(date: string): Promise<void>;
    /**
     * ui 层提供日期的起始范围，返回一个起始范围内日期的可用情况
     * 适用于先选日期的流程，确定日期是否可用
     * 已知问题：如果挂接的商品的资源不可用，后端是不会计算的
     *
     * @param {LoadScheduleAvailableDateParams} {
     *     startDate,
     *     endDate,
     *     custom_page_id,
     *     channel,
     *   }
     * @memberof BookingByStepImpl
     */
    loadScheduleAvailableDate({ startDate, endDate, custom_page_id, channel, }: LoadScheduleAvailableDateParams): Promise<ITime[]>;
    addAccount(account: Account | IHolder, extra?: {
        type: 'account' | 'holder';
        customerId: number;
    }): Promise<Account | null>;
    addAccounts(accounts: Account[] | IHolder[], extra?: {
        type: 'account' | 'holder';
        customerId: number;
    }): Promise<Account[] | undefined>;
    getAccounts(): Promise<(Account | null)[]>;
    checkHasLoginAccount(): boolean;
    setActiveAccount(id: string): void;
    getActiveAccount(): Account | undefined;
    removeAccount(id: string): void;
    /**
     * 获取holder类型账户列表
     * @param params
     */
    fetchHolderAccountsAsync(params: IFetchHolderAccountsParams): Promise<void>;
    setDateRange(dateRange: ITime[]): Promise<void>;
    clearDateRange(): void;
    getDateRange(): Promise<ITime[]>;
    getCart(): CartItem[];
    getAvailableDate(params?: {
        url?: string;
        useCache?: boolean;
        products?: ProductData[];
        startDate?: string;
        endDate?: string;
        type?: 'month' | 'day';
    }): Promise<ITime[]>;
    /**
     * 获取购物车汇总信息
     */
    getSummary(): Promise<{
        subtotal: string | number;
        total: string | number;
        originTotal: string | number;
        taxTitle?: string | undefined;
        totalTaxFee?: string | number | undefined;
        isPriceIncludeTax?: 0 | 1 | undefined;
        surchargeAmount?: string | number | undefined;
        surcharge?: any[] | undefined;
        taxRate?: string | number | undefined;
        deposit?: {
            total?: string | number | undefined;
            policies?: import("../../modules/Summary/types").IProtocol[] | undefined;
        } | undefined;
    }>;
    /**
     * 获取协议
     */
    getProtocol(protocolId: string): Promise<any>;
    getProducts(): Promise<ProductData[]>;
    setLoginAccount(accountId: string, accountInfo: Account): Promise<void>;
    generateCartData(): Promise<void>;
    getFreeProduct(id: string | number): Promise<Response<any>>;
    /**
     * 检查购物车提交订单前是否符合条件
     * @param type 类型 "holder" | "account"
     * @returns boolean
     */
    checkBeforeSubmitOrder(type: 'holder' | 'account'): boolean;
    submitOrder(extraData?: Record<string, any>): Promise<void>;
    pay(): Promise<void>;
    getPayInfo(): Promise<void>;
    setOtherParams(params: Record<string, any>, { cover }?: {
        cover?: boolean;
    }): Promise<void>;
    getOtherParams(): Promise<Record<string, any>>;
    /**
     * 往购物车加商品数据(duration 类、普通商品)
     * 老接口，先不删，怕 UI 有问题，直接桥接到新接口addProductToCart上
     *
     * @param {ProductData} productData
     * @memberof BookingByStepImpl
     */
    storeProduct(productData: ProductData): {
        success: boolean;
        errorCode?: string;
    };
    /**
     * 往购物车加商品数据
     *
     * @param {({
     *     product: ProductData;
     *     date?: { startTime: string; endTime: string } | null;
     *     account?: Account | null;
     *   })} {
     *     product,
     *     date,
     *     account,
     *   }
     * @return {*}
     * @memberof BookingByStepImpl
     */
    addProductToCart({ product, date, account, }: {
        product: ProductData;
        date?: {
            startTime: string;
            endTime: string;
        } | null;
        account?: Account | null;
    }): {
        success: boolean;
        errorCode?: string;
    };
    /**
     * 添加完购物车以后做的一些检测，比如日期是否在同一天
     *
     * @param {({ date?: { startTime: string; endTime: string } | null })} { date }
     * @memberof BookingByStepImpl
     */
    addProductCheck({ date, }: {
        date?: {
            startTime: string;
            endTime: string;
        } | null;
    }): void;
    beforeUpdateCart(params: IUpdateItemParams, targetCartItem: CartItem): void;
    updateCart(params: IUpdateItemParams): void;
    /**
     * 更新购物车以后的一些操作，比如检测资源是否重复，检测资源容量是否足够
     *
     * @param {IUpdateItemParams} params
     * @param {CartItem} targetCartItem
     * @return {*}
     * @memberof BookingByStepImpl
     */
    updateCartCheck(params: IUpdateItemParams, targetCartItem: CartItem): void;
    deleteCart(cartItemId: string): void;
    clearCart(): void;
    clearCartByAccount(account_id: string): void;
    /**
     * 批量更新购物车
     */
    batchUpdateCart(paramsList: IUpdateItemParams[]): void;
    /**
     * 从购物车中按类别删除信息
     */
    deleteCartItemInfo(type: ECartItemInfoType, _id?: string): void;
    checkCartItemByType(cartItem: CartItem, type: ECartItemCheckType): boolean;
    /**
     * 检查购物车商品是否符合条件
     * @param type 类型
     * @returns 不符合条件的购物车商品ID列表
     */
    checkCartItems(type: ECartItemCheckType): string[];
    destroy(): void;
    getResourcesList(): any[];
    /**
     * 在日期那边点击下一步的时候，检查这一天购物车里的商品是不是都有资源可以用
     *
     * @return {*}
     * @memberof BookingByStepImpl
     */
    checkResourceListForDate(): boolean;
    /**
     * 给单个购物车里的商品获取资源列表，给 UI 用的
     *
     * @param {(string | number)} id
     * @return {*}
     * @memberof BookingByStepImpl
     */
    getResourcesListByCartItem(id: string | number): {
        id: number | undefined;
        _id: string;
        product: ProductData | undefined;
        resources: ResourceItem[];
        holder_id: string | number | undefined;
        holder_name: string | undefined;
    } | undefined;
    autoSelectAccountResources({ cartItem, holder_id, resources_code, timeSlots, countMap, capacity, }: {
        cartItem: CartItem;
        holder_id: string;
        resources_code: string | number;
        timeSlots?: TimeSliceItem;
        countMap: Record<number, {
            pax: number;
            time: TimeSliceItem;
        }[]>;
        capacity?: number;
    }): {
        selectedResource?: undefined;
        timeSlots?: undefined;
    } | {
        selectedResource: any;
        timeSlots?: undefined;
    } | {
        timeSlots: any[];
        selectedResource: any;
    } | undefined;
    autoSelectAllProductResources(resources_code: string, timeSlots?: TimeSliceItem): {
        errorList: any[];
    };
    getTimeSlotByAllResources(resources_code: string): any[];
    getTimeSlotByAllResourcesForDate({ resources_code, startDate, endDate }: {
        resources_code: string;
        startDate: string;
        endDate: string;
    }): Promise<{
        date: string;
        status: string;
        week: string;
        weekNum: 0 | 1 | 2 | 3 | 5 | 4 | 6;
    }[]>;
    submitTimeSlot(timeSlots: TimeSliceItem): void;
    private getScheduleDataByIds;
    openProductDetail(productId: number): Promise<void>;
    closeProductDetail(): void;
    getTimeslotBySchedule({ date, scheduleIds, resources, product, }: {
        date: string;
        scheduleIds?: number[];
        resources?: ProductResourceItem[];
        product?: ProductData;
    }): {
        start_time: string;
        end_time: string;
        start_at: dayjs.Dayjs;
        end_at: dayjs.Dayjs;
        count: number;
        left: number;
        summaryCount: number;
        status: "lots_of_space" | "filling_up_fast" | "sold_out";
    }[];
    /**
     * 找到多个资源的公共可用时间段
     */
    private findCommonAvailableTimeSlots;
    checkMaxDurationCapacity(): {
        success: boolean;
        minAvailableCount: number;
    };
    /**
     * 将 ProductData 转换为 CartItem，但不添加到购物车
     * 参考 addProductToCart 方法的实现
     */
    private convertProductToCartItem;
    checkMaxDurationCapacityForDetailNums({ product, date, account, }: {
        product: ProductData;
        date?: {
            startTime: string;
            endTime: string;
        } | null;
        account?: Account | null;
    }): {
        success: boolean;
        minAvailableCount: number;
    };
    setOtherData(key: string, value: any): void;
    getOtherData(key: string): any;
    getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
    /**
     * 提供给 UI 的方法，减轻 UI 层的计算压力，UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
     *
     * @param {string} cartItemId
     * @param {string} resourceCode
     * @return {*}
     * @memberof BookingByStepImpl
     */
    getResourcesByCartItemAndCode(cartItemId: string, resourceCode: string): any;
    /**
     * 根据日期范围批量获取时间槽
     * @param params 参数对象
     * @returns Promise<Record<string, TimeSliceItem[]>> 返回日期到时间槽的映射
     */
    getTimeslotsScheduleByDateRange({ startDate, endDate, scheduleIds, resources, }: {
        startDate: string;
        endDate: string;
        scheduleIds?: number[];
        resources?: ProductResourceItem[];
    }): Promise<Record<string, TimeSliceItem[]>>;
    getAvailableDateForSessionOptimize(params?: {
        startDate?: string;
        endDate?: string;
    }): Promise<{
        dateList: any;
        firstAvailableDate: any;
    }>;
    isCartAllNormalProducts(): boolean;
    isCartHasDurationProduct(): boolean;
    isTargetNormalProduct(product: ProductData): boolean;
    isTargetCartIdNormalProduct(id: string): boolean | undefined;
    /**
     * 获取联系信息
    */
    getContactInfo(params: any): Promise<any>;
}
