import { BlockquoteHTMLAttributes, Image } from 'react';

// {"id":425049,"status":true,"name":"Machine Shop","description":"","tags":[],"keywords":[],"extensors":{},"locations":[{"mapId":7216,"waypointIds":[43102987]}],"uris":{"items":[]},"displayMode":1,"_mappedPoints":{"7216":true}}
export type JIBESTREAM_DESTINATION = {
  id: number;
  name: string;
  description: string;
  tags: string[];
  keywords: string[];
  extensors: Object;
  locations: JIBESTREAM_LOCATION[];
  uris: Object;
  displayMode: number;
  waypoints?: JIBESTREAM_WAYPOINT[];
};

export type JIBESTREAM_PATH_TYPE = {
  id: number;
  name: string;
  description: string;
  accessibility: number;
  verticalWeight: number;
  maxFloors: number;
  weight: number;
  direction: number;
  locations: JIBESTREAM_LOCATION[];
  uris: Object;
};

export type JIBESTREAM_AMENITY = {
  id: number;
  name: string;
  description: string;
  status: boolean;
  keywords: any[];
  extensors: Extensors;
  locations: JIBESTREAM_LOCATION[];
  uris: Object;
  svg: string;
};

export type JIBESTREAM_WAYPOINT = {
  id: number;
  mapId: number;
  coordinates: number[];
  associations: {
    destinations: number[];
    amenities: number[];
  };
  xyz: {
    x: number;
    y: number;
    z: number;
  };
};

export type JIBESTREAM_PATH = {
  mapId: number;
  mover: {
    moverId: number;
    speed: number;
    accessiblity: number;
    typeName: string;
    svg: null;
  };
  points: {
    id: number;
    mapId: number;
    associations?: {
      destinations: number[];
      amenities:number[];
    };
    xyz: {
      x: number;
      y: number;
      z: number;
    };
    x: number;
    y: number;
    z: number;
  }[];
  cost: number;
  pixelDistance: number;
  mmDistance: number;
};

export type GEOJSON_PATH = {
  distance: number;
  duration: number;
  startTime: number;
  endTime: number;
  legGeometry: {
    properties: Object;
    type: "Feature";
    geometry: {
      type: "LineString";
      coordinates: number[][];
    }
  };
  steps: {
    distance: number;
    directions: string;
    lat: number;
    lon: number;
  }[];
};

export type JIBESTREAM_LOCATION = {
  mapId: number;
  waypointIds: number[];
};

export type JIBESTREAM_STYLE = {
  color?: string;
  alpha?: number;
  stroke?: string;
  strokeWidth?: number;
  strokeAlpha?: number;
};

export type JIBESTREAM_FONT = {
  align?: string;
  fill?: string;
  fontFamily?: string;
  fontSize?: number & string;
  wordWrap?: boolean;
  wordWrapWidth?: number;
};

export type INSTRUCTION = {
  fullText: string;
  prepend: string;
  direction: string;
  destinationName?: string;
  distance: number;
  remainingDistance: number;
  wp: number;
  dest: number;
  startPoint?: number[];
  endPoint?: number[];
};

export type MAP_CREDENTIALS = {
  clientId: string;
  clientSecret: string;
  customerId: number;
  venueId: number;
  host: string;
  locale?: MAP_LOCALE;
};

export type MAP_IMAGE = {
  iconSource?: ImageSourcePropType;
  iconImage?: Image;
  iconUrl?: string;
  iconWidth?: number;
  iconHeight?: number;
  iconOffsetX?: number;
  iconOffsetY?: number;
};

export type MAP_OPTIONS = {
  snap?: {
    grid?: boolean;
    waypoint?: boolean;
    path?: boolean;
    pathThreshold?: number;
  };
  user?: MAP_IMAGE & {
    maxSpeed?: number;
  };
  userCircle?: {
    delayBetweenPulses?: number;
    pulseAnimationDuration?: number;
    confidenceColor?: string;
    confidenceOpacity?: number;
    confidenceRadius?: number;
  };
  navigation?: {
    autoReroute?: boolean;
    autoRerouteThreshold?: number;
  };
};

export type SIMULATION_OPTIONS = {
  movementSpeed: number;
  updateRate: number;
  variance_m: number;
};

export type SIMULATION_PATH = GEOJSON_PATH & {
  name: string;
};

export type SIMULATION_STATUS_VALUES = "ACTIVE" | "PAUSED";

export type SIMULATION_STATUS = {
  status?: SIMULATION_STATUS_VALUES;
  details?: {
    timeRemaining: number;
    currLoc: number[];
    currRndmLoc: number[];
    pathLeg: number;
  }
};

export type FOLLOW_BLUE_DOT_PROPERTIES = {
  enabled: boolean;
  rotate: boolean;
  interval: number;
};

export type MAP_TAP_EVENT = {
  x: number;
  y: number;
  destination?: JIBESTREAM_DESTINATION;
};

export type JIBESTREAM_GEOFENCE = {
  id: number;
  name: string;
  coordinates: number[][];
};

export interface JIBESTREAM_LR_COORDINATES {
  topLeft: number[];
  bottomRight: number[];
}

export interface JIBESTREAM_BUILDING {
  id: number;
  name: string;
  description: string;
  address: string;
  coordinates: Coordinates;
}

export type JIBESTREAM_MAP_LABEL = {
  id: number;
  name: string;
  status: boolean;
  mapLabelInstances: {
    items: MapLabelInstance[];
  };
  uris: Object;
};

export type JIBESTREAM_MAP_LABEL_INSTANCE = {
  id: number;
  name: string;
  mapId: number;
  position: number[];
  rotation: number;
  allLevels: boolean;
};

export type SCREEN_ROTATED_EVENT = {
  degrees: number;
};
