import { EventSchema, AllDayEventSchema } from '../../schemas/Event'; import { EventId } from 'teambition-types'; /** * 判断一个日程对象是否为重复日程。 * 注意:有重复规则,但仅能推导得零个可用时间点的日程,会返回 true。 */ export declare const isRecurrent: (event: Readonly>) => boolean; /** * 判断一个日程是否为全天日程。 */ export declare const isAllDay: (e: Readonly) => boolean; /** * LEGACY 全天日程的定义:开始时间为零点,结束时间为第二天零点,或 * 接下来第 n 天零点,的日程。 * 注意:零点判断根据当地时区得。 */ export declare function isAllDayLegacy(e: Readonly): boolean; export declare function normFromAllDayAttrs(event: AllDayEventSchema): EventSchema; export declare function normFromAllDayAttrs(attrs: Partial): Partial; export declare function normToAllDayAttrs(event: EventSchema): AllDayEventSchema; export declare function normToAllDayAttrs(attrs: Partial): Partial; /** * 取输入中的日期信息,得当前时区同一日期零点的时间。如:北京时间环境下, * 输入 '2017-11-30',会得 '2017-11-29T16:00:00.000Z'。若参数 * returnValue 为 true,返回对应时间的毫秒数。 */ export declare function dateToTime(date: string, returnValue: true): number; export declare function dateToTime(date: string, returnValue?: false): string; /** * 取输入中的日期信息(根据当前时区解析),得对应日期的 'YYYY-MM-DD' 表达。 * 如:北京时间环境下,输入 '2017-11-29T16:00:00.000Z',会得 '2017-11-30'。 * 若参数 returnValue 为 true,返回对应日期 UTC 零点的毫秒数,如: * new Date('2017-11-30T00:00:00.000Z').valueOf() 的值。 */ export declare function timeToDate(date: string, returnValue: true): number; export declare function timeToDate(date: string, returnValue?: false): string; /** * 从重复日程实例上生成的 _id 获取原重复日程 _id。 * (重复日程在使用时,根据重复规则,常被生成多个日程实例,每个这样的 * 日程实例会带区别于原重复日程的 _id。)用例如:在一个重复日程的 * 实例上更新数据,则最终需要通过原 _id 来与后端同步,此时,就可以 * 使用该函数根据实例上的 _id 获得原 _id。 */ export declare const originEventId: (id: EventId) => EventId;