import type { Connection } from 'mongoose';
import type { RedisClientType } from 'redis';
import { AbstractStockHolderRepo, IGetHolderResult, ILockKey, IOffer, IUnlockKey } from './stockHolderAbstract';
export { ILockKey, IOffer, IUnlockKey };
/**
 * イベントストックホルダーリポジトリ
 */
export declare class StockHolderRepo implements AbstractStockHolderRepo {
    static KEY_PREFIX_NEW: string;
    private readonly redisClient;
    private readonly pendingReservationRepo;
    constructor(redisClient: RedisClientType, connection: Connection);
    private static offer2field;
    private static createKey;
    /**
     * 座席をロックする(maxキャパシティチェック有)
     */
    lockIfNotLimitExceeded(lockKey: ILockKey, maximum: number): Promise<void>;
    /**
     * 座席をロックする
     */
    lock(lockKey: ILockKey & {}): Promise<void>;
    /**
     * 座席ロックを解除する
     */
    unlock(params: IUnlockKey): Promise<void>;
    /**
     * 空席でない座席をカウントする
     */
    countUnavailableOffers(params: {
        project: {
            id: string;
        };
        event: {
            id: string;
            startDate: Date;
            hasTicketedSeat: boolean;
        };
    }): Promise<number>;
    /**
     * 保持者を取得する
     */
    getHolder(params: Omit<IUnlockKey, 'holder'>): Promise<string | null | undefined>;
    searchHolders(params: {
        project: {
            id: string;
        };
        eventId: string;
        startDate: Date;
        hasTicketedSeat: boolean;
        offers: IOffer[];
    }): Promise<IGetHolderResult[]>;
    redisKeyExists(params: {
        eventId: string;
        startDate: Date;
    }): Promise<boolean>;
    checkIfConflicted(params: {
        eventId: string;
        startDate: Date;
    }): Promise<void>;
    /**
     * 万が一に備えて、保留予約をredis->mongo移行
     */
    migrate2mongoJustInCase(params: {
        eventId: string;
        startDate: Date;
    }): Promise<{
        expireTime: number;
        hash: {
            [x: string]: string;
        };
    }>;
    /**
     * 新リポジトリを使用するかどうか
     */
    private useMongoose;
}
