Just yesterday I've stumbled upon this entire project. It's very cool, I must admit it got me all excited and enthusiastic :smile:
To make it easier for me to understand which properties/functions are available in the just global variable, I created a skeleton just.d.ts. For now I'm just keeping it in the root of my playground project so VSCode can generate intellisense info from it. Maybe it could be generated when just init is called, together with config.json. Or just shared with the community as an optional file. I just need some help in determining any additional parameters to the functions and correct param/return types. I guess it could at least be a good starting point if nothing else :)
The main purpose is just to have the VSCode intellisense working, so any additional function descriptions etc. can also be added.
Related to #10
declare namespace just {
interface KernelVersion {
os: string;
release: string;
version: string;
}
interface Version {
just: string;
v8: string;
kernel: KernelVersion;
}
declare namespace opts {
}
declare namespace vm {
function compile(): any;
function runScript(): any;
function runInContext(): any;
function compileInContext(): any;
function compileAndRunInContext(): any;
function createContext(): any;
function enterContext(): any;
function exitContext(): any;
}
declare namespace loop {
let EPOLL_CTL_ADD: number;
let EPOLL_CTL_MOD: number;
let EPOLL_CTL_DEL: number;
let EPOLLET: number;
let EPOLLIN: number;
let EPOLLOUT: number;
let EPOLLERR: number;
let EPOLLHUP: number;
let EPOLLEXCLUSIVE: number;
let EPOLLONESHOT: number;
let EPOLL_CLOEXEC: number;
function control(): any;
function create(): any;
function wait(): any;
}
declare namespace fs {
let O_RDONLY: number;
let O_WRONLY: number;
let O_RDWR: number;
let O_CREAT: number;
let O_EXCL: number;
let O_APPEND: number;
let O_SYNC: number;
let O_TRUNC: number;
let S_IRUSR: number;
let S_IWUSR: number;
let S_IXUSR: number;
let S_IRGRP: number;
let S_IWGRP: number;
let S_IXGRP: number;
let S_IROTH: number;
let S_IWOTH: number;
let S_IXOTH: number;
let S_IRWXO: number;
let S_IRWXG: number;
let S_IRWXU: number;
let DT_BLK: number;
let DT_CHR: number;
let DT_DIR: number;
let DT_FIFO: number;
let DT_LNK: number;
let DT_REG: number;
let DT_SOCK: number;
let DT_UNKNOWN: number;
let SEEK_SET: number;
let SEEK_CUR: number;
let SEEK_END: number;
let EPERM: number;
let ENOENT: number;
let ESRCH: number;
let EINTR: number;
let EIO: number;
let ENXIO: number;
let E2BIG: number;
let ENOEXEC: number;
let EBADF: number;
let ECHILD: number;
let EAGAIN: number;
let ENOMEM: number;
let EACCES: number;
let EFAULT: number;
let ENOTBLK: number;
let EBUSY: number;
let EEXIST: number;
let EXDEV: number;
let ENODEV: number;
let ENOTDIR: number;
let EISDIR: number;
let EINVAL: number;
let ENFILE: number;
let ENOTTY: number;
let ETXTBSY: number;
let EFBIG: number;
let ENOSPC: number;
let ESPIPE: number;
let EROFS: number;
let EMLINK: number;
let EPIPE: number;
let EDOM: number;
let ERANGE: number;
let S_IFMT: number;
let S_IFSOCK: number;
let S_IFLNK: number;
let S_IFREG: number;
let S_IFBLK: number;
let S_IFDIR: number;
let S_IFCHR: number;
let S_IFIFO: number;
let UTIME_NOW: number;
let UTIME_OMIT: number;
let MS_MGC_VAL: number;
let MS_MGC_MSK: number;
function open(): any;
function unlink(): any;
function symlink(): any;
function ioctl(): any;
function rmdir(): any;
function ftruncate(): any;
function rename(): any;
function mkdir(): any;
function fstat(): any;
function lseek(): any;
function readdir(): any;
function chdir(): any;
function mount(): any;
function umount(): any;
function mknod(): any;
function mkfifo(): any;
function realpath(): any;
function chmod(): any;
function chown(): any;
function readFile(path: any, unused: any, flags: any): any;
function readFileBytes(path: any, flags: any): any;
function writeFile(path: any, buf: any, flags: any): any;
function getStats(stat: any): any;
function getStat(path: any): any;
function fileType(type: any): any;
function checkMode(val: any, mode: any): any;
function checkFlag(val: any, flag: any): any;
function readDir(path: any): any;
function copyFile(src: any, dest: any): any;
function isFile(path: any): any;
function isDir(path: any): any;
function makeNode(target: any, stype: any, smode: any, ...args: any): any;
function getModified(fd: any): any;
}
declare namespace net {
let AF_INET: number;
let AF_UNIX: number;
let AF_INET6: number;
let AF_NETLINK: number;
let AF_PACKET: number;
let AF_RDS: number;
let AF_PPPOX: number;
let AF_BLUETOOTH: number;
let AF_ALG: number;
let AF_VSOCK: number;
let AF_LLC: number;
let AF_IB: number;
let AF_MPLS: number;
let AF_CAN: number;
let ETH_P_ALL: number;
let PACKET_BROADCAST: number;
let PACKET_MULTICAST: number;
let PACKET_OTHERHOST: number;
let PACKET_OUTGOING: number;
let PACKET_HOST: number;
let PACKET_LOOPBACK: number;
let SOCK_STREAM: number;
let SOCK_DGRAM: number;
let SOCK_RAW: number;
let SOCK_SEQPACKET: number;
let SOCK_RDM: number;
let PF_PACKET: number;
let SOCK_NONBLOCK: number;
let SOCK_CLOEXEC: number;
let SOL_SOCKET: number;
let SO_ERROR: number;
let SO_REUSEADDR: number;
let SO_REUSEPORT: number;
let SO_ATTACH_FILTER: number;
let SO_INCOMING_CPU: number;
let IPPROTO_TCP: number;
let IPPROTO_UDP: number;
let IPPROTO_ICMP: number;
let IPPROTO_IGMP: number;
let IPPROTO_IPV6: number;
let IPPROTO_AH: number;
let IPPROTO_ENCAP: number;
let IPPROTO_COMP: number;
let IPPROTO_PIM: number;
let IPPROTO_SCTP: number;
let IPPROTO_UDPLITE: number;
let IPPROTO_RAW: number;
let TCP_NODELAY: number;
let SO_KEEPALIVE: number;
let SOMAXCONN: number;
let O_NONBLOCK: number;
let O_CLOEXEC: number;
let EAGAIN: number;
let EWOULDBLOCK: number;
let EINTR: number;
let SEEK_SET: number;
let SEEK_CUR: number;
let SEEK_END: number;
let SHUT_RD: number;
let SHUT_WR: number;
let SHUT_RDWR: number;
function socket(): any;
function setsockopt(): any;
function getsockopt(): any;
function listen(): any;
function connect(): any;
function socketpair(): any;
function pipe(): any;
function bind(): any;
function bindInterface(): any;
function getMacAddress(): any;
function accept(): any;
function accept4(): any;
function read(): any;
function dup(): any;
function seek(): any;
function recv(): any;
function write(): any;
function splice(): any;
function sendfile(): any;
function writeString(): any;
function send(): any;
function sendString(): any;
function close(): any;
function shutdown(): any;
function getsockname(): any;
function getpeername(): any;
function setNonBlocking(fd: any): any;
}
declare namespace sys {
let CLOCK_MONOTONIC: number;
let TFD_NONBLOCK: number;
let TFD_CLOEXEC: number;
let FD_CLOEXEC: number;
let O_CLOEXEC: number;
let F_GETFL: number;
let F_SETFL: number;
let F_GETFD: number;
let F_SETFD: number;
let STDIN_FILENO: number;
let STDOUT_FILENO: number;
let STDERR_FILENO: number;
let PROT_READ: number;
let PROT_WRITE: number;
let MAP_SHARED: number;
let MAP_ANONYMOUS: number;
let RB_AUTOBOOT: number;
let RB_HALT_SYSTEM: number;
let RB_POWER_OFF: number;
let RB_SW_SUSPEND: number;
let TIOCNOTTY: number;
let TIOCSCTTY: number;
let WNOHANG: number;
let WUNTRACED: number;
let WCONTINUED: number;
let RUSAGE_SELF: number;
let RUSAGE_THREAD: number;
let BYTE_ORDER: number;
let LITTLE_ENDIAN: number;
let BIG_ENDIAN: number;
let cpus: number;
let physicalPages: number;
let pageSize: number;
function getuid(): any;
function setuid(): any;
function getgid(): any;
function setgid(): any;
function calloc(): any;
function setTerminalFlags(): any;
function getTerminalFlags(): any;
function shmopen(): any;
function shmunlink(): any;
function fexecve(): any;
function readString(): any;
function writeString(): any;
function writeCString(): any;
function getAddress(): any;
function fcntl(): any;
function memcpy(): any;
function sleep(): any;
function utf8Length(): any;
function readMemory(): any;
function writePointer(): any;
function bufferInfo(): any;
function timer(): any;
function heapUsage(): any;
function sharedMemoryUsage(): any;
function heapObjectStatistics(): any;
function heapCodeStatistics(): any;
function memfdCreate(): any;
function pid(): any;
function ppid(): any;
function setpgid(): any;
function getpgrp(): any;
function tid(): any;
function fork(): any;
function exec(): any;
function getsid(): any;
function setsid(): any;
function errno(): any;
function getchar(): any;
function putchar(): any;
function strerror(): any;
function cpuUsage(): any;
function getrUsage(): any;
function hrtime(): any;
function cwd(): any;
function env(): any;
function ioctl(): any;
function spawn(): any;
function waitpid(): any;
function runMicroTasks(): any;
function nextTick(): any;
function exit(): any;
function kill(): any;
function usleep(): any;
function pages(): any;
function nanosleep(): any;
function mmap(): any;
function munmap(): any;
function reboot(): any;
function getenv(): any;
function setenv(): any;
function unsetenv(): any;
}
declare namespace path {
function join(...args: any): any;
function baseName(path: any): any;
function normalize(path: any): any;
function fileName(path: any): any;
function extName(path: any): any;
}
declare namespace factory {
interface LoopEntry {
fd: number;
poll: (timeout: any, sigmask: any) => any;
add: (fd: any, callback: any, events: any) => any;
remove: (fd: any) => any;
update: (fd: any, events: any) => any;
handles: any;
count: number;
}
let loops: Array<LoopEntry>;
let paused: boolean;
function create(nevents: any): any;
function run(ms: any): any;
function stop(): any;
function shutdown(): any;
}
declare namespace process {
function launch(program: any, args: any, workDir: any): any;
function watch(p: any): any;
}
let version: Version;
let args: Array<string>;
function print(string: string): void;
function error(message: string): void;
function load(): any;
function exit(): any;
function pid(): any;
function chdir(): any;
function sleep(): any;
function builtin(): any;
function memoryUsage(): any;
function env(): any;
function SystemError(syscall: any): any;
function setTimeout(callback: any, timeout: any, repeat: any, loop: any): any;
function setInterval(callback: any, timeout: any, loop: any): any;
function clearInterval(fd: any, loop: any): any;
function clearTimeout(fd: any, loop: any): any;
function library(name: any, path: any): any;
function requireNative(path: any): any;
function require(path: any, parent: any): any;
function cpuUsage(): any;
function rUsage(): any;
function heapUsage(): any;
}
Hi!
Just yesterday I've stumbled upon this entire project. It's very cool, I must admit it got me all excited and enthusiastic :smile:
To make it easier for me to understand which properties/functions are available in the
just
global variable, I created a skeletonjust.d.ts
. For now I'm just keeping it in the root of my playground project so VSCode can generate intellisense info from it. Maybe it could be generated whenjust init
is called, together withconfig.json
. Or just shared with the community as an optional file. I just need some help in determining any additional parameters to the functions and correct param/return types. I guess it could at least be a good starting point if nothing else :) The main purpose is just to have the VSCode intellisense working, so any additional function descriptions etc. can also be added.Related to #10