import { Changes, FinancialSummary } from '../shared/index.mjs';
export { API_CONFIG, AUSTRALIAN_STATES, CALENDAR_TYPES, CALENDAR_VIEWS, CURRENCIES, CalendarType, DATE_FORMATS, DEFAULT_CURRENCY, DEFAULT_EVENT_DURATION_MINUTES, DEFAULT_START_OF_WEEK, DIFFICULTY_LEVELS, DifficultyLevel, EVENT_STATUS, EVENT_TYPES, EventStatus, EventType, FILE_UPLOAD, GENRES, Genre, ICalendar, IContact, IEvent, IEventExpense, IEventIncome, INSTRUMENTS, IVenue, Instrument, MAX_EVENT_DURATION_HOURS, MAX_LENGTHS, MAX_RECURRENCE_OCCURRENCES, PAYMENT_STATUS, PaymentStatus, STUDENT_LEVELS, StudentLevel, SyncToken, TIME_FORMATS, VALIDATION_PATTERNS, formatDateAustralian, generateTempId, getDurationMinutes, getEndOfWeek, getStartOfWeek, isSameDay, isValidEmail, isValidPhone } from '../shared/index.mjs';
import { DataSource } from 'typeorm';

/**
 * @file TypeORM entities for the calendar library.
 * These entities are for server-side use only and require Node.js/TypeORM.
 */
/**
 * Represents a calendar.
 */
declare class Calendar {
    id: string;
    name: string;
    description?: string;
    /**
     * The type of calendar.
     * 'individual' - A personal calendar for a single user.
     * 'group' - A shared calendar for a team or band.
     */
    type: string;
}
/**
 * Represents a venue or location for events.
 */
declare class Venue {
    id: string;
    name: string;
    address?: string;
    city?: string;
    state?: string;
    country?: string;
    website?: string;
    contactName?: string;
    contactEmail?: string;
    contactPhone?: string;
    notes?: string;
}
/**
 * Represents a person or organization (student, band member, promoter, etc.)
 */
declare class Contact {
    id: string;
    name: string;
    email?: string;
    phone?: string;
    role?: string;
    notes?: string;
}
/**
 * Represents a calendar event with musician-specific capabilities.
 */
declare class Event {
    id: string;
    summary: string;
    description?: string;
    start: Date;
    end: Date;
    /**
     * An RFC 5545 recurrence rule string.
     * @see https://icalendar.org/rrule-tool.html
     * @example 'FREQ=WEEKLY;BYDAY=MO,WE,FR;UNTIL=20251231T235959Z'
     */
    recurrenceRule?: string;
    /**
     * Event type: 'gig', 'lesson', 'audition', 'practice', 'rehearsal', 'recording', 'meeting', etc.
     */
    type: string;
    genre?: string;
    instrument?: string;
    difficulty?: string;
    repertoire?: string;
    setList?: string;
    equipmentNeeded?: string;
    dresscode?: string;
    soundcheckTime?: Date;
    loadInTime?: Date;
    paymentStatus?: string;
    paymentDueDate?: Date;
    studentLevel?: string;
    lessonFocus?: string;
    auditionPiece?: string;
    auditionRequirements?: string;
    practiceGoals?: string;
    rehearsalNotes?: string;
    status?: string;
    createdAt: Date;
    updatedAt: Date;
    calendar: Calendar;
    venue?: Venue;
    primaryContact?: Contact;
    income?: EventIncome[];
    expenses?: EventExpense[];
}
/**
 * Represents income for an event (gig fees, lesson payments, etc.)
 */
declare class EventIncome {
    id: string;
    description: string;
    amount: number;
    currency: string;
    notes?: string;
    event: Event;
}
/**
 * Represents expenses for an event (gear hire, travel, food, etc.)
 */
declare class EventExpense {
    id: string;
    description: string;
    amount: number;
    currency: string;
    receipt?: string;
    notes?: string;
    event: Event;
}

/**
 * @file Server-side event services for the calendar library.
 * These services handle all database operations and business logic for events.
 */

/**
 * Initializes the database connection and repositories.
 */
declare function initDb(dataSource: DataSource): DataSource;
/**
 * Fetches changes to events since a given date for sync purposes.
 */
declare function fetchChanges(calendarId: string, since: Date): Promise<Changes>;
/**
 * Creates a new event.
 */
declare function createEvent(calendarId: string, eventData: Omit<Event, 'id' | 'updatedAt' | 'createdAt' | 'calendar'>): Promise<Event>;
/**
 * Updates an existing event.
 */
declare function updateEvent(eventId: string, updates: Partial<Omit<Event, 'id' | 'calendar' | 'createdAt' | 'updatedAt'>>): Promise<Event>;
/**
 * Deletes an event.
 */
declare function deleteEvent(eventId: string): Promise<void>;
/**
 * Gets all events for a calendar.
 */
declare function getEventsByCalendar(calendarId: string): Promise<Event[]>;
/**
 * Gets events by type for a calendar.
 */
declare function getEventsByType(calendarId: string, type: string): Promise<Event[]>;
/**
 * Gets upcoming gigs for a calendar.
 */
declare function getUpcomingGigs(calendarId: string, limit?: number): Promise<Event[]>;
/**
 * Gets student lessons for a specific student contact.
 */
declare function getStudentLessons(calendarId: string, studentContactId: string): Promise<Event[]>;
/**
 * Adds income to an event.
 */
declare function addEventIncome(eventId: string, income: Omit<EventIncome, 'id' | 'event'>): Promise<EventIncome>;
/**
 * Adds expense to an event.
 */
declare function addEventExpense(eventId: string, expense: Omit<EventExpense, 'id' | 'event'>): Promise<EventExpense>;
/**
 * Gets all income for an event.
 */
declare function getEventIncome(eventId: string): Promise<EventIncome[]>;
/**
 * Gets all expenses for an event.
 */
declare function getEventExpenses(eventId: string): Promise<EventExpense[]>;
/**
 * Calculates total income for an event.
 */
declare function calculateEventIncome(eventId: string): Promise<number>;
/**
 * Calculates total expenses for an event.
 */
declare function calculateEventExpenses(eventId: string): Promise<number>;
/**
 * Calculates net profit/loss for an event.
 */
declare function calculateEventProfit(eventId: string): Promise<number>;
/**
 * Gets financial summary for multiple events.
 */
declare function getFinancialSummary(eventIds: string[]): Promise<FinancialSummary>;
/**
 * Updates event income.
 */
declare function updateEventIncome(incomeId: string, updates: Partial<EventIncome>): Promise<EventIncome>;
/**
 * Updates event expense.
 */
declare function updateEventExpense(expenseId: string, updates: Partial<EventExpense>): Promise<EventExpense>;
/**
 * Deletes event income.
 */
declare function deleteEventIncome(incomeId: string): Promise<void>;
/**
 * Deletes event expense.
 */
declare function deleteEventExpense(expenseId: string): Promise<void>;
/**
 * Creates a new venue.
 */
declare function createVenue(venue: Omit<Venue, 'id'>): Promise<Venue>;
/**
 * Creates a new contact.
 */
declare function createContact(contact: Omit<Contact, 'id'>): Promise<Contact>;

/**
 * @file Server-side ICS generation service for the calendar library.
 * This service handles iCalendar feed generation and requires Node.js.
 */

/**
 * Generates an iCalendar (.ics) feed for a given calendar.
 * This is a server-side operation that requires Node.js.
 *
 * @param calendar The calendar object.
 * @param calendarId The ID of the calendar to generate the feed for.
 * @returns A promise that resolves with the iCalendar feed as a string.
 */
declare function generateIcs(calendar: Calendar, calendarId: string): Promise<string>;
/**
 * Generates an ICS feed for a specific event type (e.g., only gigs).
 */
declare function generateIcsByType(calendar: Calendar, calendarId: string, eventType: string): Promise<string>;
/**
 * Generates an ICS feed for upcoming events only (next 30 days).
 */
declare function generateUpcomingIcs(calendar: Calendar, calendarId: string): Promise<string>;

/**
 * @file Server-side validation for the calendar library.
 * These validations can include database checks and are more comprehensive than client-side validation.
 */

interface ServerValidationResult {
    isValid: boolean;
    errors: Record<string, string[]>;
    warnings?: Record<string, string[]>;
}
/**
 * Validates event data with database checks.
 */
declare function validateEventWithDb(data: Partial<Event>, dataSource: DataSource, eventId?: string): Promise<ServerValidationResult>;
/**
 * Validates calendar data with database checks.
 */
declare function validateCalendarWithDb(data: Partial<Calendar>, dataSource: DataSource, calendarId?: string): Promise<ServerValidationResult>;
/**
 * Validates venue data with database checks.
 */
declare function validateVenueWithDb(data: Partial<Venue>, dataSource: DataSource, venueId?: string): Promise<ServerValidationResult>;
/**
 * Validates contact data with database checks.
 */
declare function validateContactWithDb(data: Partial<Contact>, dataSource: DataSource, contactId?: string): Promise<ServerValidationResult>;
/**
 * Validates business rules for event scheduling.
 */
declare function validateEventScheduling(eventData: Partial<Event>, dataSource: DataSource): Promise<ServerValidationResult>;

export { Calendar, Changes, Contact, Event, EventExpense, EventIncome, FinancialSummary, type ServerValidationResult, Venue, addEventExpense, addEventIncome, calculateEventExpenses, calculateEventIncome, calculateEventProfit, createContact, createEvent, createVenue, deleteEvent, deleteEventExpense, deleteEventIncome, fetchChanges, generateIcs, generateIcsByType, generateUpcomingIcs, getEventExpenses, getEventIncome, getEventsByCalendar, getEventsByType, getFinancialSummary, getStudentLessons, getUpcomingGigs, initDb, updateEvent, updateEventExpense, updateEventIncome, validateCalendarWithDb, validateContactWithDb, validateEventScheduling, validateEventWithDb, validateVenueWithDb };
