declare global {
    const route: typeof import('ziggy-js')['route']
}

declare module '@vue/runtime-core' {
    interface ComponentCustomProperties {
        route: typeof import('ziggy-js')['route']
    }
}

export type ProfileView = 'map' | 'board' | 'passes';
export type ChartType = "line" | "area" | "bar" | "pie" | "donut" | "radialBar" | "scatter" | "bubble" | "heatmap" | "candlestick" | "boxPlot" | "radar" | "polarArea" | "rangeBar" | "rangeArea" | "treemap" | undefined
export type BadgeVariant = 'first' | 'business' | 'premium' | 'economy' | 'private' | 'unspecified' | 'generic' | 'general_aviation' | 'crew'

export interface User {
    id: number
    name: string
    email: string
    email_verified_at: string | null
}

export type SharedProps = import('@inertiajs/core').PageProps & {
    auth: {
        user: User | null
        isLoggedIn: boolean
    },
    logo_api_url: string
}

export interface Region {
    id: number
    name: string
    code: string
    local_code: string
    country_id: number
    continent_id: number
    created_at: string | null
    updated_at: string | null
    continent: Continent
    country: Country
}

export interface Airport {
    id: number
    name: string
    latitude_deg: number
    longitude_deg: number
    elevation_ft: number | null
    region_id: number
    region?: Region
    municipality: string | null
    icao_code: string | null
    iata_code: string | null
    local_code: string | null
    type: string
    created_at: string | null
    updated_at: string | null
    timezone: string
    display_code: string
    display_name: string
}

export type Continent = {
    id: number
    name: string
    code: string
    internal_name:string
}

export type Country = {
    id: number
    code: string
    name: string
    created_at: string | null
    updated_at: string | null
    continent_id: number
    continent?: Continent
}

export interface Airline {
    id: number
    IATA_code: string | null
    ICAO_code: string | null
    name: string | null
    internal_name: string | null
    active: boolean
    logo: string | null
    country_id: number
    country?: Country
    display_name: string
}



export interface Aircraft {
    id: number
    designator: string
    manufacturer_code: string
    model_full_name: string
    aircraft_description: string
    engine_type: string
    engine_count: number
    wtc: string
    created_at: string | null
    updated_at: string | null
    display_name: string
}

export interface SeatType {
    id: number
    name: string
}

export interface FlightReason {
    id: number
    name: string
}

export interface FlightClass {
    id: number
    name: string
    internal_name: BadgeVariant
}

export interface CrewType {
    id: number
    name: string
    internal_name: string
}

export interface Flight {
    id: number
    flight_number: string | null
    departure_date: string
    arrival_date: string
    aircraft_registration: string | null
    seat_number: string | null
    note: string | null
    departure_airport: Airport
    arrival_airport: Airport
    departure_date_display: string,
    arrival_date_display: string,
    departure_time_display: string,
    arrival_time_display: string,
    arrival_day_difference: number,
    airline: Airline | null
    aircraft: Aircraft | null
    seat_type: SeatType | null
    crew_type: CrewType | null
    flight_reason: FlightReason | null
    flight_class: FlightClass | null
    duration_display: string
    duration: number
    distance: number
}

declare module '@inertiajs/vue3' {
    interface PageProps extends SharedProps {}
}
