import { AxiosInstance } from 'axios';
import { route as routeFn } from 'ziggy-js';

export interface AuthUser {
    id: number;
    name: string;
    email: string;
    username?: string;
    roles: string[];
    role_labels: string[];
    permissions: string[];
}

export interface Branding {
    name?: string;
    short_name?: string;
    logo_url?: string | null;
    primary_color?: string;
    text_color?: string;
}

export interface PageProps {
    auth: {
        user: AuthUser | null;
    };
    flash: {
        success?: string;
        error?: string;
    };
    branding?: Branding | null;
    [key: string]: unknown;
}

declare global {
    interface Window {
        axios: AxiosInstance;
        appName: string;
    }

    var route: typeof routeFn;
}
