import { Position } from '../Core';
import { Floor } from '../Venue';
import { ManeuverType } from './ManeuverType';

/**
 * A navigation instruction should be returned by "computeNavigation".
 * It holds all ingredients needed to create elements to display that instruction (icon, segment) on the map and within UI navigation elements ("go straight", "turn left"...).
 * Each NavigationInstruction hold the data for one segment of the whole navigation.
 */
export interface NavigationInstruction {
    /**
     * Each position stored here are used to create the line that'll be displayed on the map for current navigation instruction.
     */
    readonly segmentPositions: Position[];
    /**
     * Position were the icon(turn left, turn right, go straight ...) should be displayed on the map.
     */
    readonly iconPosition: Position;
    /**
     * Modality used to navigate along this segment.
     * Available modalities are defined in VisioMapEditor.
     */
    readonly modality: string;
    /**
     * Floor related to current navigation instruction, in which the current segment will be displayed.
     */
    readonly floor: Floor;
    /**
     * Length in meters of current navigation instruction's segment.
     */
    readonly length: number;
    /**
     * Estimate of the time, in seconds, needed to move from this navigation instruction to the next, depending on the modality used.
     */
    readonly duration: number;
    /**
     * Maneuver type of the current segment, it'll influence the image used for the icon.
     */
    readonly maneuverType: ManeuverType;
    /**
     * Detailed instruction. It is the displayed sentence that indicate what to do along the navigation to go to next step.
     */
    readonly detailedInstruction: string;
    /**
     * Attributes are defined in VisioMapEditor, an attribute mostly represent a floor transition, but it can also be a tag.
     */
    readonly attributes: string[];
    /**
     * When having a multi-destination request, this represents the waypoint index.
     * 0 is when the segment is between the "source" point and the first destination.
     * Non-zero "i" means the segment is between the (i - 1) point from "destinations" and the next destination.
     */
    readonly waypointIndex: number;
}
