/**
 * ZIP Format Plugin
 *
 * @module plugins/zip
 * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
 * @copyright (c) 2012-2014 Chris Talkington, contributors.
 */
var engine = require('zip-stream');
var util = require('archiver-utils');

/**
 * @constructor
 * @param {Object} [options]
 * @param {String} [options.comment] Sets the zip archive comment.
 * @param {Boolean} [options.forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
 * @param {Boolean} [options.forceZip64=false] Forces the archive to contain ZIP64 headers.
 * @param {Boolean} [options.store=false] Sets the compression method to STORE.
 * @param {Object} [options.zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
 */
var Zip = function(options) {
  if (!(this instanceof Zip)) {
    return new Zip(options);
  }

  options = this.options = util.defaults(options, {
    comment: '',
    forceUTC: false,
    store: false
  });

  this.supports = {
    directory: true
  };

  this.engine = new engine(options);
};

/**
 * @param  {(Buffer|Stream)} source
 * @param  {ZipEntryData} data
 * @param  {Function} callback
 * @return void
 */
Zip.prototype.append = function(source, data, callback) {
  this.engine.entry(source, data, callback);
};

/**
 * @return void
 */
Zip.prototype.finalize = function() {
  this.engine.finalize();
};

/**
 * @return this.engine
 */
Zip.prototype.on = function() {
  return this.engine.on.apply(this.engine, arguments);
};

/**
 * @return this.engine
 */
Zip.prototype.pipe = function() {
  return this.engine.pipe.apply(this.engine, arguments);
};

/**
 * @return this.engine
 */
Zip.prototype.unpipe = function() {
  return this.engine.unpipe.apply(this.engine, arguments);
};

module.exports = Zip;

/**
 * @typedef {Object} ZipOptions
 * @global
 * @property {String} [comment] Sets the zip archive comment.
 * @param {Boolean} [forceLocalTime=false] Forces the archive to contain local file times instead of UTC.
 * @param {Boolean} [forceZip64=false] Forces the archive to contain ZIP64 headers.
 * @property {Boolean} [store=false] Sets the compression method to STORE.
 * @property {Object} [zlib] Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options}
 * to control compression.
 * @property {*} [*] See [zip-stream]{@link https://archiverjs.com/zip-stream/ZipStream.html} documentation for additional properties.
 */

/**
 * @typedef {Object} ZipEntryData
 * @global
 * @property {String} name Sets the entry name including internal path.
 * @property {(String|Date)} [date=NOW()] Sets the entry date.
 * @property {Number} [mode=D:0755/F:0644] Sets the entry permissions.
 * @property {String} [prefix] Sets a path prefix for the entry name. Useful
 * when working with methods like `directory` or `glob`.
 * @property {fs.Stats} [stats] Sets the fs stat data for this entry allowing
 * for reduction of fs stat calls when stat data is already known.
 * @property {Boolean} [store=ZipOptions.store] Sets the compression method to STORE.
 */
@@ -1152,24 +1152,613 @@
 yData%7D data%0A
+ * @param  %7BString%7D data.name Sets the entry name including internal path.%0A * @param  %7B(String%7CDate)%7D %5Bdata.date=NOW()%5D Sets the entry date.%0A * @param  %7BNumber%7D %5Bdata.mode=D:0755/F:0644%5D Sets the entry permissions.%0A * @param  %7BString%7D %5Bdata.prefix%5D Sets a path prefix for the entry name. Useful%0A * when working with methods like %60directory%60 or %60glob%60.%0A * @param  %7Bfs.Stats%7D %5Bdata.stats%5D Sets the fs stat data for this entry allowing%0A * for reduction of fs stat calls when stat data is already known.%0A * @param  %7BBoolean%7D %5Bdata.store=ZipOptions.store%5D Sets the compression method to STORE.%0A
  * @param  %7B
@@ -2428,1245 +2428,31 @@
  Zip
-Options%0A * @global%0A * @property %7BString%7D %5Bcomment%5D Sets the zip archive comment.%0A * @param %7BBoolean%7D %5BforceLocalTime=false%5D Forces the archive to contain local file times instead of UTC.%0A * @param %7BBoolean%7D %5BforceZip64=false%5D Forces the archive to contain ZIP64 headers.%0A * @property %7BBoolean%7D %5Bstore=false%5D Sets the compression method to STORE.%0A * @property %7BObject%7D %5Bzlib%5D Passed to %5Bzlib%5D%7B@link https://nodejs.org/api/zlib.html#zlib_class_options%7D%0A * to control compression.%0A * @property %7B*%7D %5B*%5D See %5Bzip-stream%5D%7B@link https://archiverjs.com/zip-stream/ZipStream.html%7D documentation for additional properties.%0A */%0A%0A/**%0A * @typedef %7BObject%7D ZipEntryData%0A * @global%0A * @property %7BString%7D name Sets the entry name including internal path.%0A * @property %7B(String%7CDate)%7D %5Bdate=NOW()%5D Sets the entry date.%0A * @property %7BNumber%7D %5Bmode=D:0755/F:0644%5D Sets the entry permissions.%0A * @property %7BString%7D %5Bprefix%5D Sets a path prefix for the entry name. Useful%0A * when working with methods like %60directory%60 or %60glob%60.%0A * @property %7Bfs.Stats%7D %5Bstats%5D Sets the fs stat data for this entry allowing%0A * for reduction of fs stat calls when stat data is already known.%0A * @property %7BBoolean%7D %5Bstore=ZipOptions.store%5D Sets the compression method to STORE.
+EntryData%0A * @global%0A *
 %0A */

update zip docs.