type COMMANDS_TO_MAP =
  | 'UPDATE_USER_LOCATION'
  | 'WAYFIND_TO_WAYPOINT'
  | 'WAYFIND_BETWEEN_WAYPOINTS'
  | 'DRAW_NAVIGATION_PATH'
  | 'STYLE_SHAPE'
  | 'RESET_ALL_UNIT_STYLES';
type COMMANDS_FROM_MAP =
  | 'DESTINATION_SELECTED'
  | 'NAVIGATION_PATH_GENERATED'
  | 'USER_POSITION_UPDATED'
  | 'CONSOLE_LOG';
type EVENTS_FROM_ODP = 'ON_NAVIGATION_UPDATE' | 'ON_FACILITY_UPDATE';

type MAP_EVENT_LISTENER_TYPE = {
  onDestinationSelected?: (destination: JIBESTREAM_DESTINATION_TYPE) => void;
  onNavigationPathGenerated?: (
    pathId: string,
    instructions: INSTRUCTION_TYPE[],
    start: JIBESTREAM_WAYPOINT_TYPE,
    end: JIBESTREAM_WAYPOINT_TYPE,
    path: JIBESTREAM_PATH_TYPE[]
  ) => void;
  onUserPositionUpdated?: (userPosition: number[]) => void;
};

type ODP_EVENT_LISTENER_TYPE = {
  onReady?: (message: ODP_ON_READY_TYPE) => void;
  onKeyValidation?: (message: ODP_ON_KEY_VALIDATION_TYPE) => void;
  onNavigationUpdate?: (message: ODP_ON_NAVIGATION_UPDATE_TYPE) => void;
  onFacilityUpdate?: (message: ODP_ON_FACILITY_UPDATE_TYPE) => void;
};

type MAP_VIEW_REFERENCE_TYPE = {
  setUserPosition: (lat: number, long: number) => void;
  wayfindToWaypoint: (waypointId: number) => void;
  wayfindBetweenWaypoints: (originId: number, destinationId: number) => void;
  drawNavigationPath: (
    pathId: string,
    shouldFocus?: boolean,
    style?: JIBESTREAM_STYLE_TYPE
  ) => void;
  styleUnitsForDestination: (
    destination: JIBESTREAM_DESTINATION_TYPE,
    style?: JIBESTREAM_STYLE_TYPE
  ) => void;
  styleShape: (id: number, style?: JIBESTREAM_STYLE_TYPE) => void;
};
