I have had quite a few look at the flow documentation, with some question still in mind. I have write a constructor named Track ;with my best attempt to type annotate it still not fully understanding it.
Here is the code:
javascript
//@flow
"use strict";
/**
*A track is compatible with
* other track and can be parsed to
*a higher order function using the
* `this keyword.
*/
type ITrack<T> = {
x: T,
y: T,
width: T,
};
/**
* A Track is an adjustable and join-able imaginary ray
* That stretches out indefinite with a fixed starting x position.
*@Function Track
*@Param x -The x position to place the track
*@Param y - The y position to palce the track
*@Param width - The width of the track.
**/
function Track<ITrack> (x, y, width) {
this.x = x;
this.y = y;
this.width = width;
}