50 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Haxe
		
	
	
	
	
	
		
		
			
		
	
	
			50 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Haxe
		
	
	
	
	
	
|  | /* | ||
|  |  * Copyright (C)2014-2020 Haxe Foundation | ||
|  |  * | ||
|  |  * Permission is hereby granted, free of charge, to any person obtaining a | ||
|  |  * copy of this software and associated documentation files (the "Software"), | ||
|  |  * to deal in the Software without restriction, including without limitation | ||
|  |  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
|  |  * and/or sell copies of the Software, and to permit persons to whom the | ||
|  |  * Software is furnished to do so, subject to the following conditions: | ||
|  |  * | ||
|  |  * The above copyright notice and this permission notice shall be included in | ||
|  |  * all copies or substantial portions of the Software. | ||
|  |  * | ||
|  |  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
|  |  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
|  |  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
|  |  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
|  |  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
|  |  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
|  |  * DEALINGS IN THE SOFTWARE. | ||
|  |  */ | ||
|  | 
 | ||
|  | package js.node.fs; | ||
|  | 
 | ||
|  | import js.node.Fs.FsPath; | ||
|  | import js.node.events.EventEmitter.Event; | ||
|  | 
 | ||
|  | @:enum abstract ReadStreamEvent<T:haxe.Constraints.Function>(Event<T>) to Event<T> { | ||
|  | 	/** | ||
|  | 		Emitted when the `ReadStream`'s file is opened.
 | ||
|  | 
 | ||
|  | 		Listener arguments: | ||
|  | 			fd - file descriptor used by the `ReadStream`. | ||
|  | 	**/ | ||
|  | 	var Open:ReadStreamEvent<Int->Void> = "open"; | ||
|  | } | ||
|  | 
 | ||
|  | /** | ||
|  | 	Readable file stream. | ||
|  | **/ | ||
|  | extern class ReadStream extends js.node.stream.Readable<ReadStream> { | ||
|  | 	/** | ||
|  | 		The path to the file the stream is reading from as specified in the first argument to `Fs.createReadStream`. | ||
|  | 
 | ||
|  | 		If path is passed as a string, then readStream.path will be a string. | ||
|  | 		If path is passed as a Buffer, then readStream.path will be a Buffer. | ||
|  | 	**/ | ||
|  | 	var path:FsPath; | ||
|  | } |