docs: function createInterface(interface) {
  
    return {
      complies: complies.bind(null, false),
      checkComplies: complies.bind(null, true),
      wrap: wrapInterface
    };
  
    function complies(throwError, obj) {
  
      var ok = true;
  
      if (interface.methods) {
        interface.methods.forEach(function(method) {
          if (typeof obj[method] !== 'function') {
            if (throwError) throw new errors.MissingMethodError('Missing required method: ' + method);
            ok = false;
          }
        });
      }
  
      if (interface.properties) {
        interface.properties.forEach(function(prop) {
          if (typeof obj[prop] === 'undefined') {
            if (throwError) throw new errors.MissingPropertyError('Missing required property: ' + prop);
            ok = false;
          }
        });
      }
  
      return ok;
  
    }
  
    function wrapInterface(obj) {
      var wrapper = {};
      complies(true, obj);
      if (interface.methods) {
        interface.methods.forEach(function(method) {
          wrapper[method] = obj[method].bind(obj);
        });
      }
      if (interface.properties) {
        interface.properties.forEach(function(prop) {
          Object.defineProperty(wrapper, prop, {get: function() { return obj[prop]; }});
        });
      }
      return wrapper;
    }
  }