Path: blob/main/third_party/closure-compiler/node-externs/stream.js
6174 views
/*1* Copyright 2012 The Closure Compiler Authors.2*3* Licensed under the Apache License, Version 2.0 (the "License");4* you may not use this file except in compliance with the License.5* You may obtain a copy of the License at6*7* http://www.apache.org/licenses/LICENSE-2.08*9* Unless required by applicable law or agreed to in writing, software10* distributed under the License is distributed on an "AS IS" BASIS,11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12* See the License for the specific language governing permissions and13* limitations under the License.14*/1516/**17* @fileoverview Definitions for node's stream module. Depends on the events module.18* @see http://nodejs.org/api/stream.html19* @see https://github.com/joyent/node/blob/master/lib/stream.js20* @externs21* @author Daniel Wirtz <[email protected]>22*/2324/**25BEGIN_NODE_INCLUDE26var stream = require('stream');27END_NODE_INCLUDE28*/2930var stream = {};3132/**33* @constructor34* @param {Object=} options35* @extends events.EventEmitter36*/37stream.Stream = function(options) {};3839/**40* @param {stream.Writable} dest41* @param {{end: boolean}=} pipeOpts42* @return {stream.Writable}43*/44stream.Stream.prototype.pipe = function(dest, pipeOpts) {};4546/**47* @constructor48* @extends stream.Readable49*/50stream.ReadableStream = function() {};5152/**53* @type {boolean}54*/55stream.ReadableStream.prototype.readable;5657/**58* @param {string=} encoding59*/60stream.ReadableStream.prototype.setEncoding = function(encoding) {};6162/**63*/64stream.ReadableStream.prototype.destroy = function() {};6566/**67* @constructor68* @extends stream.Writable69*/70stream.WritableStream = function() {};7172/**73*/74stream.WritableStream.prototype.drain = function() {};7576/**77* @type {boolean}78*/79stream.WritableStream.prototype.writable;8081/**82* @param {string|nodeBuffer.Buffer} buffer83* @param {string=} encoding84*/85stream.WritableStream.prototype.write = function(buffer, encoding) {};8687/**88* @param {string|nodeBuffer.Buffer=} buffer89* @param {string=} encoding90* @param {function(*=)=} cb91*/92stream.WritableStream.prototype.end = function(buffer, encoding, cb) {};9394/**95*/96stream.WritableStream.prototype.destroy = function() {};9798/**99*/100stream.WritableStream.prototype.destroySoon = function() {};101102// Undocumented103104/**105* @constructor106* @param {Object=} options107* @extends stream.Stream108*/109stream.Readable = function(options) {};110111/**112* @type {boolean}113* @deprecated114*/115stream.Readable.prototype.readable;116117/**118* @protected119* @param {string|nodeBuffer.Buffer|null} chunk120* @return {boolean}121*/122stream.Readable.prototype.push = function(chunk) {};123124/**125* @param {string|nodeBuffer.Buffer|null} chunk126* @return {boolean}127*/128stream.Readable.prototype.unshift = function(chunk) {};129130/**131* @param {string} enc132*/133stream.Readable.prototype.setEncoding = function(enc) {};134135/**136* @param {number=} n137* @return {nodeBuffer.Buffer|string|null}138*/139stream.Readable.prototype.read = function(n) {};140141/**142* @protected143* @param {number} n144*/145stream.Readable.prototype._read = function(n) {};146147/**148* @param {stream.Writable=} dest149* @return {stream.Readable}150*/151stream.Readable.prototype.unpipe = function(dest) {};152153/**154*/155stream.Readable.prototype.resume = function() {};156157/**158*/159stream.Readable.prototype.pause = function() {};160161/**162* @param {stream.Stream} stream163* @return {stream.Readable}164*/165stream.Readable.prototype.wrap = function(stream) {};166167/**168* @constructor169* @param {Object=} options170* @extends stream.Stream171*/172stream.Writable = function(options) {};173174/**175* @deprecated176* @type {boolean}177*/178stream.Writable.prototype.writable;179180/**181* @param {string|nodeBuffer.Buffer} chunk182* @param {string=} encoding183* @param {function(*=)=} cb184* @return {boolean}185*/186stream.Writable.prototype.write = function(chunk, encoding, cb) {};187188/**189* @protected190* @param {string|nodeBuffer.Buffer} chunk191* @param {string} encoding192* @param {function(*=)} cb193*/194stream.Writable.prototype._write = function(chunk, encoding, cb) {};195196/**197* @param {string|nodeBuffer.Buffer=} chunk198* @param {string=} encoding199* @param {function(*=)=} cb200*/201stream.Writable.prototype.end = function(chunk, encoding, cb) {};202203/**204* @constructor205* @param {Object=} options206* @extends stream.Readable207* Xextends stream.Writable208*/209stream.Duplex = function(options) {};210211/**212* @type {boolean}213*/214stream.Duplex.prototype.allowHalfOpen;215216217/**218* @param {Object=} options219* @constructor220* @extends stream.Duplex221*/222stream.Transform = function(options) {};223224/**225* @protected226* @param {string|nodeBuffer.Buffer} chunk227* @param {string} encoding228* @param {function(*=)} cb229*/230stream.Transform._transform = function(chunk, encoding, cb) {};231232/**233* @protected234* @param {function(*=)} cb235*/236stream.Transform._flush = function(cb) {};237238/**239* @param {Object=} options240* @constructor241* @extends stream.Transform242*/243stream.PassThrough = function(options) {};244245246