code: function VisSense(element, config) {
    if (!(this instanceof VisSense)) {
      return new VisSense(element, config);
    }
  
    if (!isElement(element)) {
      throw new Error('not an element node');
    }
  
    this._element = element;
    this._config = defaults(config, {
      fullyvisible: 1,
      hidden: 0,
      referenceWindow: window,
      percentageHook: percentage,
      precision: 3,
      visibilityHooks: []
    });
  
    var roundFactor = this._config.precision <= 0 ? 1 : Math.pow(10, this._config.precision || 3);
    this._round = function (val) {
      return Math.round(val * roundFactor) / roundFactor;
    };
  
    // page must be visible in order for the element to be visible
    var visibilityApi = createVisibilityApi(this._config.referenceWindow);
    this._config.visibilityHooks.push(function () {
      return !visibilityApi.isHidden();
    });
  }
docs: @callback VisSense~PercentageHook
  
  @param {DOMElement} element The element to get the visible percentage of.
  @returns {number} The visible percentage of the element (between 0 and 1).
  
  @description This callback function that will be called to determine
  the visible area of the element.
   
  @callback VisSense~VisibilityHook
  
  @param {DOMElement} element The target element.
  @returns {boolean} `false` if the element is hidden, `true` otherwise.
  
  @description This callback function that will be called to intercept
  the default visibility process.
   
  @class
  @name VisSense
  @throws {Error} Will throw an error if the first argument is not a DOM
  Element.
  
  @param {DOMElement} element A DOM element.
  @param {VisSense~VisSenseConfig} [config={fullyvisible: 1, hidden: 0}] A
  configuration object.
  
  @description Creates a `VisSense` object which wraps the given element
  to enable visibility operations.
  
  @example
  
  var element = document.getElementById('myElement');
  var vis = VisSense(element); // or new VisSense(element)
  
  vis.isVisible();
  // => true
  
  vis.percentage();
  // => 0.93