-// Interpret as Command Sequences.
-const kEscape = new Buffer([0xFF, 0xF4, 0XFF, 0xFD, 0x06]); // IAC IP IAC DO TIMING_MARK
-const kNAWSRequest = new Buffer([0xFF, 0xFD, 0X1F]); // IAC DO NAWS
-const kNAWSResponse = new Buffer([0xFF, 0xFB, 0X1F, 0xFF, 0xFA, 0X1F]); // IAC WILL NAWS IAC SB NAWS
-
-// Main tomato sauce class. Properties:
-// * screens <TomatoSauce.IScreen[]>
-// * renderers <TomatoSauce.IRenderer[]>
-// * port <int>
-// * frequency <int>
-// * modulation <int>
-//
-// The main entry point is the #run() function.
-//
-// It emits a listening event that contains the server information on
-// the `server` key inside the `data` property of the event.
-//
-// It also emits an error event that contains the error information on
-// the `error` key inside the `data` property of the event.
+const internals = {
+ // Interpret as Command Sequences.
+ kEscape: new Buffer([0xFF, 0xF4, 0XFF, 0xFD, 0x06]), // IAC IP IAC DO TIMING_MARK
+ kNAWSRequest: new Buffer([0xFF, 0xFD, 0X1F]), // IAC DO NAWS
+ kNAWSResponse: new Buffer([0xFF, 0xFB, 0X1F, 0xFF, 0xFA, 0X1F]) // IAC WILL NAWS IAC SB NAWS
+};
+
+/**
+ * A function that represents a screen, it is called frequently and should
+ * return a string consisting of commands to run.
+ *
+ * @interface IScreen
+ * @type function
+ * @param {Number} modulation A number between 0 and 255 representing the current
+ * step of the modulation
+ * @param {Number} width The width of the screen
+ * @param {Number} height The height of the screen
+ * @param {IRenderer} renderer The renderer used to colorize the scfeen
+ * @return {String} The commands used to render the screen elements
+ */
+
+/**
+ * A function that represents a renderer, it should take in a color in RGB and
+ * return a string with the appropriate code to colorize the terminal.
+ *
+ * @interface IRenderer
+ * @type function
+ * @param {Number} red The red component of the color between 0 and 255
+ * @param {Number} green The green component of the color between 0 and 255
+ * @param {Number} blue The green component of the color between 0 and 255
+ * @return {String} The commands used to colorize the terminal
+ */
+
+/**
+ * The main application for tomato sauce. Listens for connections and serves
+ * random combinations of screens and renderers
+ *
+ * The main entry point is the `#run()` function.
+ *
+ * It emits a listening event that contains the server information on
+ * the `server` key inside the `data` property of the event.
+ *
+ * It also emits an error event that contains the error information on
+ * the `error` key inside the `data` property of the event.
+ *
+ * @class TomatoSauce
+ * @extends EventEmitter
+ *
+ * @param {object} config the configuration object used to extend the properties.
+ *
+ * @property {Array<IScreen>} screens an array of screens available to serve
+ * @property {Array<IRenderer>} renderers an array of renderers available to colorize
+ * @property {Number} [port=9999] the port to listen on
+ * @property {Number} [frequency=333] how often to update the screen
+ * @property {Number} [modulation=5] number between 0-255 depicting current modulation step
+ */