forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
68
Kha/Backends/Node/js/node/fs/FSWatcher.hx
Normal file
68
Kha/Backends/Node/js/node/fs/FSWatcher.hx
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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;
|
||||
#if haxe4
|
||||
import js.lib.Error;
|
||||
#else
|
||||
import js.Error;
|
||||
#end
|
||||
|
||||
/**
|
||||
Enumeration of possible types of changes for 'change' event.
|
||||
**/
|
||||
@:enum abstract FSWatcherChangeType(String) from String to String {
|
||||
var Change = "change";
|
||||
var Rename = "rename";
|
||||
}
|
||||
|
||||
/**
|
||||
Enumeration of the events emitted by `FSWatcher`.
|
||||
**/
|
||||
@:enum abstract FSWatcherEvent<T:haxe.Constraints.Function>(Event<T>) to Event<T> {
|
||||
/**
|
||||
Emitted when something changes in a watched directory or file. See more details in `Fs.watch`.
|
||||
|
||||
Listener arguments:
|
||||
event - The type of fs change
|
||||
filename - The filename that changed (if relevant/available)
|
||||
**/
|
||||
var Change:FSWatcherEvent<FSWatcherChangeType->FsPath->Void> = "change";
|
||||
|
||||
/**
|
||||
Emitted when an error occurs.
|
||||
**/
|
||||
var Error:FSWatcherEvent<Error->Void> = "error";
|
||||
}
|
||||
|
||||
/**
|
||||
Objects returned from `Fs.watch` are of this type.
|
||||
**/
|
||||
extern class FSWatcher extends EventEmitter<FSWatcher> {
|
||||
/**
|
||||
Stop watching for changes on the given `FSWatcher`.
|
||||
**/
|
||||
function close():Void;
|
||||
}
|
49
Kha/Backends/Node/js/node/fs/ReadStream.hx
Normal file
49
Kha/Backends/Node/js/node/fs/ReadStream.hx
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
82
Kha/Backends/Node/js/node/fs/Stats.hx
Normal file
82
Kha/Backends/Node/js/node/fs/Stats.hx
Normal file
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
Objects returned from `Fs.stat`, `Fs.lstat` and `Fs.fstat` and their synchronous counterparts are of this type.
|
||||
**/
|
||||
extern class Stats {
|
||||
var dev:Int;
|
||||
var ino:Float;
|
||||
var mode:Int;
|
||||
var nlink:Int;
|
||||
var uid:Int;
|
||||
var gid:Int;
|
||||
var rdev:Int;
|
||||
var size:Float;
|
||||
var blksize:Null<Int>;
|
||||
var blocks:Null<Float>;
|
||||
|
||||
/**
|
||||
"Access Time" - Time when file data last accessed.
|
||||
|
||||
Changed by the mknod(2), utimes(2), and read(2) system calls.
|
||||
**/
|
||||
var atime:Date;
|
||||
|
||||
/**
|
||||
"Modified Time" - Time when file data last modified.
|
||||
|
||||
Changed by the mknod(2), utimes(2), and write(2) system calls.
|
||||
**/
|
||||
var mtime:Date;
|
||||
|
||||
/**
|
||||
"Change Time" - Time when file status was last changed (inode data modification).
|
||||
|
||||
Changed by the chmod(2), chown(2), link(2), mknod(2), rename(2), unlink(2), utimes(2), read(2), and write(2) system calls.
|
||||
**/
|
||||
var ctime:Date;
|
||||
|
||||
/**
|
||||
"Birth Time" - Time of file creation. Set once when the file is created.
|
||||
|
||||
On filesystems where birthtime is not available, this field may instead hold either the ctime or 1970-01-01T00:00Z (ie, unix epoch timestamp 0).
|
||||
Note that this value may be greater than `atime` or `mtime` in this case. On Darwin and other FreeBSD variants,
|
||||
also set if the `atime` is explicitly set to an earlier value than the current birthtime using the utimes(2) system call.
|
||||
**/
|
||||
var birthtime:Date;
|
||||
|
||||
function isFile():Bool;
|
||||
function isDirectory():Bool;
|
||||
function isBlockDevice():Bool;
|
||||
function isCharacterDevice():Bool;
|
||||
|
||||
/**
|
||||
Only valid with `Fs.lstat`.
|
||||
**/
|
||||
function isSymbolicLink():Bool;
|
||||
|
||||
function isFIFO():Bool;
|
||||
function isSocket():Bool;
|
||||
}
|
54
Kha/Backends/Node/js/node/fs/WriteStream.hx
Normal file
54
Kha/Backends/Node/js/node/fs/WriteStream.hx
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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 WriteStreamEvent<T:haxe.Constraints.Function>(Event<T>) to Event<T> {
|
||||
/**
|
||||
Emitted when the `WriteStream`'s file is opened.
|
||||
|
||||
Listener arguments:
|
||||
fd - file descriptor used by the `WriteStream`.
|
||||
**/
|
||||
var Open:WriteStreamEvent<Int->Void> = "open";
|
||||
}
|
||||
|
||||
/**
|
||||
Writable file stream.
|
||||
**/
|
||||
extern class WriteStream extends js.node.stream.Writable<WriteStream> {
|
||||
/**
|
||||
The path to the file the stream is writing to as specified in the first argument to `Fs.createWriteStream`.
|
||||
If path is passed as a string, then writeStream.path will be a string.
|
||||
If path is passed as a Buffer, then writeStream.path will be a Buffer.
|
||||
**/
|
||||
var path:FsPath;
|
||||
|
||||
/**
|
||||
The number of bytes written so far.
|
||||
Does not include data that is still queued for writing.
|
||||
**/
|
||||
var bytesWritten:Int;
|
||||
}
|
Reference in New Issue
Block a user