import * as drizzle_orm from 'drizzle-orm';
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
export { CalendarRouteConfig, createBatchDeleteEventsHandler, createConfigHandler, createCreateEventHandler, createDeleteEventHandler, createGetEventByIdHandler, createGetEventsHandler, createUpdateEventHandler } from './routes/index.js';
import 'next/server';

/**
 * 简化版日历数据库服务
 *
 * 提供基础的数据库操作，避免复杂的类型转换
 * 后续可以根据需要逐步完善
 */
declare class CalendarDbService {
    private _db;
    /**
     * 设置数据库实例
     */
    setDb(db: any): void;
    /**
     * 数据库是否已初始化
     */
    isConfigured(): boolean;
    /**
     * 获取数据库实例
     */
    get db(): any;
    /**
     * 获取用户的所有事件（基础版本）
     */
    getAllEvents(userId: number, startDate?: Date, endDate?: Date): Promise<any>;
    /**
     * 根据ID获取事件
     */
    getEventById(eventId: number): Promise<any>;
    /**
     * 创建事件（基础版本）
     */
    createEvent(eventData: {
        title: string;
        description?: string;
        startTime: Date;
        endTime: Date;
        allDay: boolean;
        location?: string;
        color: string;
        userId: number;
    }): Promise<any>;
    /**
     * 更新事件
     */
    updateEvent(eventId: number, eventData: {
        title?: string;
        description?: string;
        startTime?: Date;
        endTime?: Date;
        allDay?: boolean;
        location?: string;
        color?: string;
    }): Promise<any>;
    /**
     * 删除事件
     */
    deleteEvent(eventId: number): Promise<void>;
    /**
     * 获取用户的日历配置
     */
    getUserConfig(userId: number): Promise<any>;
    /**
     * 创建或更新用户配置
     */
    upsertUserConfig(userId: number, configData: {
        firstDayOfWeek?: number;
        workingHoursStart?: string;
        workingHoursEnd?: string;
        timeZone?: string;
        dateFormat?: string;
        timeFormat?: string;
        defaultView?: string;
        defaultEventColor?: string;
        weekends?: boolean;
        eventColors?: Record<string, string>;
    }): Promise<any>;
    /**
     * 为事件创建重复规则
     */
    createRecurrenceRule(ruleData: {
        eventId: number;
        ruleType: string;
        interval: number;
        endDate?: Date;
        count?: number;
        byWeekday?: number[];
        byMonthday?: number[];
        byMonth?: number[];
    }): Promise<any>;
    /**
     * 获取事件的重复规则
     */
    getRecurrenceRule(eventId: number): Promise<any>;
    /**
     * 删除重复规则
     */
    deleteRecurrenceRule(eventId: number): Promise<void>;
    /**
     * 为事件创建提醒
     */
    createReminder(reminderData: {
        eventId: number;
        reminderTime: Date;
        reminderType: string;
        status?: string;
    }): Promise<any>;
    /**
     * 获取事件的提醒列表
     */
    getEventReminders(eventId: number): Promise<any>;
    /**
     * 删除事件的所有提醒
     */
    deleteEventReminders(eventId: number): Promise<void>;
    /**
     * 获取用户在指定时间范围内的事件数量
     */
    getEventCount(userId: number, startDate?: Date, endDate?: Date): Promise<number>;
    /**
     * 搜索事件
     */
    searchEvents(userId: number, searchTerm: string): Promise<any>;
    /**
     * 批量删除用户的所有事件
     */
    deleteAllUserEvents(userId: number): Promise<void>;
}
declare const calendarDbService: CalendarDbService;

/**
 * 日历事件表
 */
declare const calendarEvents: drizzle_orm_pg_core.PgTableWithColumns<{
    name: "calendar_events";
    schema: undefined;
    columns: {
        id: drizzle_orm_pg_core.PgColumn<{
            name: "id";
            tableName: "calendar_events";
            dataType: "number";
            columnType: "PgSerial";
            data: number;
            driverParam: number;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: true;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        title: drizzle_orm_pg_core.PgColumn<{
            name: "title";
            tableName: "calendar_events";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 255;
        }>;
        description: drizzle_orm_pg_core.PgColumn<{
            name: "description";
            tableName: "calendar_events";
            dataType: "string";
            columnType: "PgText";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        startTime: drizzle_orm_pg_core.PgColumn<{
            name: "start_time";
            tableName: "calendar_events";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        endTime: drizzle_orm_pg_core.PgColumn<{
            name: "end_time";
            tableName: "calendar_events";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        allDay: drizzle_orm_pg_core.PgColumn<{
            name: "all_day";
            tableName: "calendar_events";
            dataType: "boolean";
            columnType: "PgBoolean";
            data: boolean;
            driverParam: boolean;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        location: drizzle_orm_pg_core.PgColumn<{
            name: "location";
            tableName: "calendar_events";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 500;
        }>;
        color: drizzle_orm_pg_core.PgColumn<{
            name: "color";
            tableName: "calendar_events";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 7;
        }>;
        priority: drizzle_orm_pg_core.PgColumn<{
            name: "priority";
            tableName: "calendar_events";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 10;
        }>;
        userId: drizzle_orm_pg_core.PgColumn<{
            name: "user_id";
            tableName: "calendar_events";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        createdAt: drizzle_orm_pg_core.PgColumn<{
            name: "created_at";
            tableName: "calendar_events";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        updatedAt: drizzle_orm_pg_core.PgColumn<{
            name: "updated_at";
            tableName: "calendar_events";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
    };
    dialect: "pg";
}>;
/**
 * 重复规则表
 */
declare const recurrenceRules: drizzle_orm_pg_core.PgTableWithColumns<{
    name: "recurrence_rules";
    schema: undefined;
    columns: {
        id: drizzle_orm_pg_core.PgColumn<{
            name: "id";
            tableName: "recurrence_rules";
            dataType: "number";
            columnType: "PgSerial";
            data: number;
            driverParam: number;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: true;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        eventId: drizzle_orm_pg_core.PgColumn<{
            name: "event_id";
            tableName: "recurrence_rules";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        ruleType: drizzle_orm_pg_core.PgColumn<{
            name: "rule_type";
            tableName: "recurrence_rules";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 20;
        }>;
        interval: drizzle_orm_pg_core.PgColumn<{
            name: "interval";
            tableName: "recurrence_rules";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        endDate: drizzle_orm_pg_core.PgColumn<{
            name: "end_date";
            tableName: "recurrence_rules";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        count: drizzle_orm_pg_core.PgColumn<{
            name: "count";
            tableName: "recurrence_rules";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        byWeekday: drizzle_orm_pg_core.PgColumn<{
            name: "by_weekday";
            tableName: "recurrence_rules";
            dataType: "json";
            columnType: "PgJson";
            data: number[];
            driverParam: unknown;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            $type: number[];
        }>;
        byMonthday: drizzle_orm_pg_core.PgColumn<{
            name: "by_monthday";
            tableName: "recurrence_rules";
            dataType: "json";
            columnType: "PgJson";
            data: number[];
            driverParam: unknown;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            $type: number[];
        }>;
        byMonth: drizzle_orm_pg_core.PgColumn<{
            name: "by_month";
            tableName: "recurrence_rules";
            dataType: "json";
            columnType: "PgJson";
            data: number[];
            driverParam: unknown;
            notNull: false;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            $type: number[];
        }>;
        createdAt: drizzle_orm_pg_core.PgColumn<{
            name: "created_at";
            tableName: "recurrence_rules";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
    };
    dialect: "pg";
}>;
/**
 * 提醒表
 */
declare const reminders: drizzle_orm_pg_core.PgTableWithColumns<{
    name: "reminders";
    schema: undefined;
    columns: {
        id: drizzle_orm_pg_core.PgColumn<{
            name: "id";
            tableName: "reminders";
            dataType: "number";
            columnType: "PgSerial";
            data: number;
            driverParam: number;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: true;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        eventId: drizzle_orm_pg_core.PgColumn<{
            name: "event_id";
            tableName: "reminders";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        reminderTime: drizzle_orm_pg_core.PgColumn<{
            name: "reminder_time";
            tableName: "reminders";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        reminderType: drizzle_orm_pg_core.PgColumn<{
            name: "reminder_type";
            tableName: "reminders";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 20;
        }>;
        status: drizzle_orm_pg_core.PgColumn<{
            name: "status";
            tableName: "reminders";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 20;
        }>;
        createdAt: drizzle_orm_pg_core.PgColumn<{
            name: "created_at";
            tableName: "reminders";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        updatedAt: drizzle_orm_pg_core.PgColumn<{
            name: "updated_at";
            tableName: "reminders";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
    };
    dialect: "pg";
}>;
/**
 * 日历配置表 - 用户个人日历设置
 */
declare const calendarConfigs: drizzle_orm_pg_core.PgTableWithColumns<{
    name: "calendar_configs";
    schema: undefined;
    columns: {
        id: drizzle_orm_pg_core.PgColumn<{
            name: "id";
            tableName: "calendar_configs";
            dataType: "number";
            columnType: "PgSerial";
            data: number;
            driverParam: number;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: true;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        userId: drizzle_orm_pg_core.PgColumn<{
            name: "user_id";
            tableName: "calendar_configs";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        firstDayOfWeek: drizzle_orm_pg_core.PgColumn<{
            name: "first_day_of_week";
            tableName: "calendar_configs";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        workingHoursStart: drizzle_orm_pg_core.PgColumn<{
            name: "working_hours_start";
            tableName: "calendar_configs";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 5;
        }>;
        workingHoursEnd: drizzle_orm_pg_core.PgColumn<{
            name: "working_hours_end";
            tableName: "calendar_configs";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 5;
        }>;
        timeZone: drizzle_orm_pg_core.PgColumn<{
            name: "time_zone";
            tableName: "calendar_configs";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 50;
        }>;
        dateFormat: drizzle_orm_pg_core.PgColumn<{
            name: "date_format";
            tableName: "calendar_configs";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 20;
        }>;
        timeFormat: drizzle_orm_pg_core.PgColumn<{
            name: "time_format";
            tableName: "calendar_configs";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 20;
        }>;
        defaultView: drizzle_orm_pg_core.PgColumn<{
            name: "default_view";
            tableName: "calendar_configs";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 20;
        }>;
        defaultEventColor: drizzle_orm_pg_core.PgColumn<{
            name: "default_event_color";
            tableName: "calendar_configs";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 7;
        }>;
        weekends: drizzle_orm_pg_core.PgColumn<{
            name: "weekends";
            tableName: "calendar_configs";
            dataType: "boolean";
            columnType: "PgBoolean";
            data: boolean;
            driverParam: boolean;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        eventColors: drizzle_orm_pg_core.PgColumn<{
            name: "event_colors";
            tableName: "calendar_configs";
            dataType: "json";
            columnType: "PgJson";
            data: Record<string, string>;
            driverParam: unknown;
            notNull: false;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            $type: Record<string, string>;
        }>;
        createdAt: drizzle_orm_pg_core.PgColumn<{
            name: "created_at";
            tableName: "calendar_configs";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        updatedAt: drizzle_orm_pg_core.PgColumn<{
            name: "updated_at";
            tableName: "calendar_configs";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
    };
    dialect: "pg";
}>;
/**
 * 事件分享表 - 用于共享日历功能
 */
declare const eventShares: drizzle_orm_pg_core.PgTableWithColumns<{
    name: "event_shares";
    schema: undefined;
    columns: {
        id: drizzle_orm_pg_core.PgColumn<{
            name: "id";
            tableName: "event_shares";
            dataType: "number";
            columnType: "PgSerial";
            data: number;
            driverParam: number;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: true;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        eventId: drizzle_orm_pg_core.PgColumn<{
            name: "event_id";
            tableName: "event_shares";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        sharedWithUserId: drizzle_orm_pg_core.PgColumn<{
            name: "shared_with_user_id";
            tableName: "event_shares";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        sharedByUserId: drizzle_orm_pg_core.PgColumn<{
            name: "shared_by_user_id";
            tableName: "event_shares";
            dataType: "number";
            columnType: "PgInteger";
            data: number;
            driverParam: string | number;
            notNull: true;
            hasDefault: false;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
        permission: drizzle_orm_pg_core.PgColumn<{
            name: "permission";
            tableName: "event_shares";
            dataType: "string";
            columnType: "PgVarchar";
            data: string;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: [string, ...string[]];
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {
            length: 20;
        }>;
        createdAt: drizzle_orm_pg_core.PgColumn<{
            name: "created_at";
            tableName: "event_shares";
            dataType: "date";
            columnType: "PgTimestamp";
            data: Date;
            driverParam: string;
            notNull: true;
            hasDefault: true;
            isPrimaryKey: false;
            isAutoincrement: false;
            hasRuntimeDefault: false;
            enumValues: undefined;
            baseColumn: never;
            identity: undefined;
            generated: undefined;
        }, {}, {}>;
    };
    dialect: "pg";
}>;
/**
 * 日历事件关系
 */
declare const calendarEventsRelations: drizzle_orm.Relations<"calendar_events", {
    user: drizzle_orm.One<"User", true>;
    recurrenceRule: drizzle_orm.One<"recurrence_rules", true>;
    reminders: drizzle_orm.Many<"reminders">;
    shares: drizzle_orm.Many<"event_shares">;
}>;
/**
 * 重复规则关系
 */
declare const recurrenceRulesRelations: drizzle_orm.Relations<"recurrence_rules", {
    event: drizzle_orm.One<"calendar_events", true>;
}>;
/**
 * 提醒关系
 */
declare const remindersRelations: drizzle_orm.Relations<"reminders", {
    event: drizzle_orm.One<"calendar_events", true>;
}>;
/**
 * 日历配置关系
 */
declare const calendarConfigsRelations: drizzle_orm.Relations<"calendar_configs", {
    user: drizzle_orm.One<"User", true>;
}>;
/**
 * 事件分享关系
 */
declare const eventSharesRelations: drizzle_orm.Relations<"event_shares", {
    event: drizzle_orm.One<"calendar_events", true>;
    sharedWithUser: drizzle_orm.One<"User", true>;
    sharedByUser: drizzle_orm.One<"User", true>;
}>;

/**
 * Calendar 模块 - 服务端专用导出
 *
 * 这个文件包含只能在服务端使用的功能，包括：
 * - 数据库服务层
 * - 服务端配置和工具
 * - API处理函数
 *
 * 注意：这些导出只能在服务端环境中使用，不要在客户端组件中导入！
 *
 * 使用方式：
 * ```typescript
 * import { calendarDbService } from 'sa2kit/calendar/server';
 * ```
 *
 * @version 1.0.0
 * @author Profile-v1 Team
 */
/**
 * 日历数据库服务
 *
 * 提供所有与日历相关的数据库操作，包括：
 * - 事件的CRUD操作
 * - 重复规则管理
 * - 提醒管理
 * - 用户配置管理
 * - 事件分享功能
 */

/**
 * 服务端专用的工具函数和常量
 */
/**
 * 默认日历配置
 */
declare const DEFAULT_CALENDAR_CONFIG: {
    firstDayOfWeek: number;
    workingHours: {
        start: string;
        end: string;
    };
    timeZone: string;
    dateFormat: string;
    timeFormat: string;
    defaultView: "month";
    defaultEventColor: string;
    weekends: boolean;
    eventColors: {
        blue: string;
        green: string;
        purple: string;
        red: string;
        yellow: string;
        pink: string;
        indigo: string;
        gray: string;
    };
};
/**
 * 验证事件数据的服务端函数
 */
declare function validateEventData(eventData: any): {
    valid: boolean;
    errors: string[];
};
/**
 * 验证重复规则数据
 */
declare function validateRecurrenceData(recurrenceData: any): {
    valid: boolean;
    errors: string[];
};
/**
 * 生成重复事件的服务端函数
 */
declare function generateRecurrenceInstances(baseEvent: any, recurrenceRule: any, maxInstances?: number): Array<{
    startTime: Date;
    endTime: Date;
}>;
/**
 * 获取提醒发送时间
 */
declare function calculateReminderTime(eventStartTime: Date, reminderOffset: number): Date;
/**
 * 格式化错误响应
 */
declare function createErrorResponse(message: string, errors?: string[]): Response;
/**
 * 格式化成功响应
 */
declare function createSuccessResponse(data: any, message?: string): Response;
/**
 * 检查用户是否有权限访问事件
 */
declare function checkEventPermission(eventId: number, userId: number, requiredPermission?: 'read' | 'write'): Promise<boolean>;
declare const CALENDAR_SERVER_MODULE_VERSION = "1.0.0";
declare const CALENDAR_SERVER_MODULE_NAME = "sa2kit/calendar/server";

export { CALENDAR_SERVER_MODULE_NAME, CALENDAR_SERVER_MODULE_VERSION, DEFAULT_CALENDAR_CONFIG, calculateReminderTime, calendarConfigs, calendarConfigsRelations, calendarDbService, calendarEvents, calendarEventsRelations, checkEventPermission, createErrorResponse, createSuccessResponse, eventShares, eventSharesRelations, generateRecurrenceInstances, recurrenceRules, recurrenceRulesRelations, reminders, remindersRelations, validateEventData, validateRecurrenceData };
