All files Cursor.js

100% Statements 7/7
100% Branches 0/0
66.67% Functions 2/3
100% Lines 7/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38      1x           1x                       1x     1x     1x       1x         1x  
// Import
 
// Export
module.exports = Cursor
 
/**
 * Cursor is a abstract cursor position in a table that support table formating
 */
function Cursor (table) {
  this.table = table
 
  // The line in a table relative to the table offset.
  //
  // The line could be any line in a marktable:
  // - caption and id row
  // - blank line between caption/id and table
  // - header row,
  // - column definition row,
  // - tbody separator,
  // - a row,
  // - a multiline-row separator
  this.line = 0
 
  // The cell index in the line
  this.cell = 0
 
  // The char offset from the left side of the cell
  this.cellOffset = 0
}
 
// From row-column coordinate point relative to table offset
Cursor.prototype.fromPoint = function (point) {
  // body...
}
 
// To row-column coordinate point relative to table offset
Cursor.prototype.toPoint = function () {}