import { Dayjs } from 'dayjs';
import { CartItem, ProductData } from '../../../modules';
/**
 * 1. 获取资源列表
 * 2. 根据当前选择的商品过滤出来对应的资源列表  getResourcesByProduct
 * 3. 格式化资源相关 格式化资源列表 --> 格式化资源 --> 获取时间切片列表 --> 判断单个时间切片是否可用 formatResources
 *
 */
type DateType = Dayjs;
export interface TimeSliceItem {
    start_time: string;
    end_time: string;
    start_at: DateType;
    end_at: DateType;
    [key: string]: any;
}
export interface ResourceItem {
    [key: string]: any;
}
interface BookingItem {
    [key: string]: any;
}
/**
 * @title: 判断两个时间段是否有重叠
 * @description:
 * @param {object} event
 * @param {object} current
 * @return {*}
 * @Author: zhiwei.Wang
 */
export declare const isConflict: (event: {
    start_at: DateType;
    end_at: DateType;
}, current: {
    start_at: DateType;
    end_at?: DateType;
}) => boolean;
/**
 * @title: 获取时间切片是否可用
 * @description: 根据时间切片、资源、当前预约量判断时间切片是否可用
 * @param {any} param1
 * @return {*}
 * @Author: zhiwei.Wang
 */
export declare const getIsUsableByTimeItem: ({ timeSlice, time, resource, currentCount, resourcesUseableMap, cut_off_time, }: {
    timeSlice: TimeSliceItem;
    time: any;
    resource: ResourceItem;
    currentCount: number;
    resourcesUseableMap: Record<string, boolean>;
    cut_off_time?: {
        future_day: number;
        unit: number;
        unit_type: string;
        type: string;
        ongoing?: {
            type: string;
            unit: number;
        } | undefined;
    } | undefined;
}) => {
    afterToDay: boolean;
    capacity: boolean;
    usable: boolean;
    remainingCapacity: number;
    reason: string;
};
/**
 * @title: 获取商品下绑定的资源列表
 * @description:
 * @param {any} resourcesMap
 * @param {any} product
 * @return {*}
 * @Author: zhiwei.Wang
 */
export declare const getResourcesByProduct: (resourcesMap: Record<string, ResourceItem>, resources: ResourceItem[], selectedResources: number[], capacity?: number) => ResourceItem[];
/**
 * @title: 获取资源列表
 * @description:
 * @return {*}
 * @Author: zhiwei.Wang
 * @Date: 2024-01-09 13:38
 */
export declare const formatResources: ({ booking, resources, }: {
    booking: BookingItem;
    resources: ResourceItem[];
}) => {
    list: ResourceItem[];
    maps: any;
};
/**
 * @title: 获取资源的时间切片列表
 * @description:
 * @return {*}
 * @Author: zhiwei.Wang
 */
export declare const getTimeSlicesByResource: ({ resource, duration, split, currentDate, capacity, resourcesUseableMap, cut_off_time, hasFlexibleDuration, operating_day_boundary, maxBlockThreshold }: {
    resource: ResourceItem;
    duration: number;
    split: number;
    currentDate: DateType | string;
    capacity?: number | undefined;
    resourcesUseableMap?: Record<string, boolean> | undefined;
    cut_off_time?: {
        future_day: number;
        unit: number;
        unit_type: string;
        type: string;
        ongoing?: {
            type: string;
            unit: number;
        } | undefined;
    } | undefined;
    hasFlexibleDuration?: boolean | undefined;
    operating_day_boundary?: {
        type: string;
        time: string;
    } | undefined;
    maxBlockThreshold?: number | undefined;
}) => TimeSliceItem[];
/**
 * @title: 获取时间切片列表的交集
 * @description:  注意： 需要将多个时间切片列表合并在一起，然后判断交集
 * @param {TimeSliceItem} times 多个时间切片
 * @param {number} count 交集次数， 符合此次数的会返回
 * @return {*}
 * @Author: zhiwei.Wang
 */
export declare const getTimesIntersection: (times: TimeSliceItem[], count: number) => any[];
/**
 * @title: 根据ids筛选资源列表
 * @description:
 * @param {any} resourcesMap
 * @param {any} ids
 * @return {*}
 * @Author: zhiwei.Wang
 * @Date: 2024-09-19 20:23
 */
export declare const getResourcesByIds: (resourcesMap: Record<string, ResourceItem>, ids: number[]) => ResourceItem[];
/**
 * @title: 合并子资源的时间切片至组合资源
 * @description:
 * @param {ResourceItem[]} resources
 * @param {Record<string, ResourceItem>} resourcesMap
 * @return {*}
 * @Author: zhiwei.Wang
 */
export declare const mergeSubResourcesTimeSlices: (resources: ResourceItem[], resourcesMap: Record<string, ResourceItem>) => void;
/**
 * @title: 根据资源id列表获取时间切片
 * @description:  传入一个技师id列表， 找出技师列表中公共的时间切片
 * @param {ResourceItem} resources
 * @param {CartItem} cart
 * @return {*}
 * @Author: zhiwei.Wang
 */
export declare const getTimeSlicesByResources: ({ resourceIds, resourcesMap, duration, currentDate, split, capacity, resourcesUseableMap, cut_off_time, hasFlexibleDuration, operating_day_boundary, maxBlockThreshold }: {
    resourceIds: number[];
    resourcesMap: any;
    duration: number;
    currentDate: DateType | string;
    split: number;
    capacity?: number | undefined;
    resourcesUseableMap: Record<string, boolean>;
    cut_off_time?: {
        future_day: number;
        unit: number;
        unit_type: string;
        type: string;
        ongoing?: {
            type: string;
            unit: number;
        } | undefined;
    } | undefined;
    hasFlexibleDuration?: boolean | undefined;
    operating_day_boundary?: {
        type: string;
        time: string;
    } | undefined;
    maxBlockThreshold?: number | undefined;
}) => any[];
/**
 * @title: 获取其他人的已选资源
 * @description:
 * @param {CartItem[]} cartItems
 * @param {number | string} accountId
 * @return {*}
 * @Author: jinglin.tan
 */
export declare const getOthersSelectedResources: (cartItems: CartItem[], accountId: number | string, resourcesMap: Record<string, ResourceItem>) => number[];
/**
 * @title: 获取其他购物车内商品的已选资源
 * @description:
 * @param {CartItem[]} cartItems
 * @param {number | string} accountId
 * @return {*}
 * @Author: jinglin.tan
 */
export declare const getOthersCartSelectedResources: (cartItems: CartItem[], cartItemId: number | string, resourcesMap: Record<string, ResourceItem>) => number[];
export interface CapacityItem {
    id: number;
    value: number;
    name: string;
}
/**
 * @title: 根据日期范围过滤日程
 *
 * @export
 * @param {any[]} schedule
 * @param {string} startDate
 * @param {string} endDate
 * @return {*}
 */
export declare function filterScheduleByDateRange(schedule: any[], startDate: string, endDate: string): any[];
/**
 * 传入商品数据，返回基于商品配置的提前量的最早开始日期和最晚结束日期
 *
 * @export
 * @param {ProductData} product
 * @return {*}
 */
export declare function checkSessionProductLeadTime(product: ProductData): {
    latestStartDate: string;
    earliestEndDate: string;
};
/**
 * 基于商品的 resources 配置，返回可选择的资源的 id 列表
 *
 * @export
 * @param {ProductData} product
 * @return {*}
 */
export declare function getResourcesIdsByProduct(product: ProductData): number[];
/**
 * 资源排序，把单个资源靠前，组合资源排在后面
 *
 * @export
 * @param {ResourceItem[]} resourcesList
 * @return {*}
 */
export declare function sortCombinedResources(resourcesList: ResourceItem[]): ResourceItem[];
/**
 * 传入一个资源组，根据 formid筛出相同类型的资源
 *
 * @export
 * @param {ResourceItem[]} resources
 * @param {string} form_id
 * @return {*}
 */
export declare function filterResourcesByFormItem(resources: ResourceItem[], form_id: string): ResourceItem[];
/**
 * 传入两个资源，确认这两个资源是否有交集（包括组合资源）
 *
 * @export
 * @param {ResourceItem} resource1
 * @param {ResourceItem} resource2
 * @return {*}
 */
export declare function checkTwoResourcesIntersection(resource1: ResourceItem, resource2: ResourceItem): true | undefined;
export {};
