import { Module, PisellCore, ModuleOptions } from '../../types';
import { BaseModule } from '../BaseModule';
import { Rules, RulesModuleAPI, DiscountResult, UnavailableReason } from './types';
import { Discount } from '../Discount/types';
import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
import { WindowPlugin } from '../../plugins';
export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
    protected defaultName: string;
    protected defaultVersion: string;
    private store;
    window: WindowPlugin;
    private hooks;
    constructor(name?: string, version?: string);
    initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
    setRulesList(rulesList: Rules[]): Promise<void>;
    getRulesList(): Rules[];
    getWalletPassEvaluator(): import("../..").WalletPassEvaluator | undefined;
    private checkHolderMatch;
    isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, orderTotalAmount, holders, isFormSubject, }: {
        oldDiscountList: Discount[];
        newDiscountList: Discount[];
        productList: any[];
        orderTotalAmount: number;
        holders: {
            form_record_id: number;
        }[];
        isFormSubject: boolean;
    }): {
        isAvailable: boolean;
        discountList: Discount[];
        productList: any[];
        unavailableReason?: UnavailableReason;
    };
    filterDiscountListByType(discountList: Discount[], type: string): Discount[];
    /** 剔除指定 type/tag 的折扣项，保留手动改价(type=product) / 券等 */
    excludeDiscountListByType(discountList: Discount[], type: string): Discount[];
    /** 手动改价场景：去掉 promotion，保留 type=product 等行内折扣 */
    resolveDiscountListForManualOverride(discountList: Discount[]): Discount[];
    private getUnavailableReason;
    calcDiscount({ discountList, productList, holders, isFormSubject, orderTotalAmount }: {
        discountList: Discount[];
        productList: any[];
        holders: {
            form_record_id: number;
        }[];
        isFormSubject: boolean;
        orderTotalAmount: number;
    }, options?: {
        isSelected?: boolean;
        discountId?: number;
        selectedList?: SetDiscountSelectedParams[];
        scan?: boolean;
    }): DiscountResult;
    /**
     * 检查优惠是否符合 PackageSubItemUsageRules 配置
     * @param discount 优惠券
     * @param flatItem 扁平化后的商品项（可能是主商品或bundle子商品）
     * @returns 是否可用
     */
    private checkPackageSubItemUsageRules;
    destroy(): Promise<void>;
    clear(): Promise<void>;
}
