import { Color } from "@ionic/core";
import { Feed, Job, Location, Pin, Service, Site, Template, User } from "./sdk";

export interface Control {
  /**
   * The label to show next to the button
   */
  label: string;
  /**
   * The icon to use in the button
   */
  icon: string;
  /**
   * The color from the theme to make the button
   */
  color?: Color;
  /**
   * The link to use for the button
   */
  href?: string;
  /**
   * The functionality to run when the button is clicked
   */
  onClick?: (event: any) => any;
}

export interface LocalCache {
  darkMode?: boolean;
  manifest?: {
    name?: string;
    short_name?: string;
    start_url?: string;
    display?: string;
    icons?: {
      src?: string;
      sizes?: string;
      type?: string;
      purpose?: string;
    }[];
    shortcuts?: {
      name?: string;
      short_name?: string;
      description?: string;
      url?: string;
      icons?: {
        src?: string;
        sizes?: string;
      }[];
    }[];
    orientation?: string;
    background_color?: string;
    theme_color?: string;
    permissions?: string[];
    gcm_sender_id?: string;
    version?: string;
  };
  config?: {
    emulate?: boolean;
    env?: string;
    dade?: {
      apiKey?: string;
      url?: string;
    };
    functions?: {
      url?: string;
    };
    logrocketKey?: string;
    firebase?: {
      apiKey: string;
      authDomain: string;
      databaseURL: string;
      projectId: string;
      storageBucket: string;
      messagingSenderId: string;
      appId: string;
    };
    messaging?: {
      vapidKey?: string;
    };
    graphql?: {
      url?: string;
    };
    stripe?: {
      key?: string;
      clientId?: string;
    };
    franchise?: {
      stripe?: {
        key?: string;
        clientId?: string;
      };
      dade?: {
        apiKey?: string;
        url?: string;
      };
    };
    url?: string;
    dynamicLinkDomain?: string;
    showingNotifications?: boolean;
  };
  locations?: Location[];
  profile?: User;
  session?: {
    displayName?: string | null;
    email?: string | null;
    phoneNumber?: string | null;
    photoURL?: string | null;
    providerId?: string;
    uid?: string;
    [key: string]: any;
  };
  services?: Service[];
  templates?: Template[];
  claims?: {
    admin?: boolean;
    tester?: boolean;
    role?: string;
    locationId?: string;
  };
  myJobs?: Job[];
  job?: Job;
  site?: Site;
  pins?: Pin[];
  feed?: Feed[];
  editorSizes?: number[];
  isPreviewing?: boolean;
  showingNavigation?: boolean;
  roles?: string[];
}
