lib-utils-ts
Version:
<img src="https://img.shields.io/npm/v/lib-utils-ts"/> <img src="https://img.shields.io/snyk/vulnerabilities/npm/lib-utils-ts"/> <img src="https://img.shields.io/npm/l/lib-utils-ts"/> <img src="https://img.shields.io/github/languages/top/devGnode/lib-util
86 lines (85 loc) • 3.12 kB
text/typescript
import {Enum} from "../Enum";
/***
* @version 4.0-R-libUtilsTs
* @version 1.0-R-JSTrip
*/export class ExitSign extends Enum{
/***/
.args(true, 0) static EXIT:ExitSign;
.args(true, 1) static SIGHUP:ExitSign;
.args(true, 2) static SIGINT:ExitSign;
.args(false, 3) static SIGQUIT:ExitSign;
.args(false, 4) static SIGILL:ExitSign;
.args(false, 5) static SIGTRAP:ExitSign;
.args(false, 6) static SIGABRT:ExitSign;
.args(false, 6) static SIGIOT:ExitSign;
.args(false, 7) static SIGBUS:ExitSign;
.args(false, null) static SIGEMT:ExitSign;
.args(false,8) static SIGFPE:ExitSign;
.args(true, 9) static SIGKILL:ExitSign;
.args(false, 10) static SIGUSR1:ExitSign;
.args(false, 11) static SIGSEGV:ExitSign;
.args(false, 12) static SIGUSR2:ExitSign;
.args(false, 13) static SIGPIPE:ExitSign;
.args(false, 14) static SIGALRM:ExitSign;
.args(true, 15) static SIGTERM:ExitSign;
.args(false, 16) static SIGSTKFLT:ExitSign;
.args(false, 17) static SIGCHLD:ExitSign;
.args(false, null) static SIGCLD:ExitSign;
.args(false, 18) static SIGCONT:ExitSign;
.args(true, 19) static SIGSTOP:ExitSign;
.args(false, 20) static SIGTSTP:ExitSign;
.args(false, 21) static SIGTTIN:ExitSign;
.args(false, 22) static SIGTTOU:ExitSign;
.args(false, 23) static SIGURG:ExitSign;
.args(false, 24) static SIGXCPU:ExitSign;
.args(false, 25) static SIGFSZ:ExitSign
.args(false, 26) static SIGVTALRM:ExitSign
.args(false, 27) static SIGPROF:ExitSign;
.args(false, 28) static SIWINCH:ExitSign;
.args(false, 29) static SIGIO:ExitSign;
.args(false, null) static SIGPOLL:ExitSign;
.args(false, 30) static SIGPWR:ExitSign;
.args(false, null) static SIGINFO:ExitSign;
.args(false, null) static SIGLOST:ExitSign;
.args(false) static SIGSYS:ExitSign;
.args(false, 31) static SIGUNUSED:ExitSign;
.args(true, 31) static SIGBREAK:ExitSign;
/****
* This attribute allow to check if
* a signal, is already in listener
* see {ApplicationShutdownHooks}.
*/
private initListen:boolean;
private readonly exitCode:number;
/***
* @param {boolean} state
* @param code
*/
protected constructor(state:boolean, code:number) {
super();
this.initListen = state||false;
this.exitCode = code;
}
/***
* @constructor
*/
public Init():void{
if(this.initListen)return;
this.initListen=true;
}
/***
* @return {boolean}
*/
public isListen():boolean{return this.initListen;}
/***
*
*/
public getExitCode():number{return this.exitCode; }
/***
* Need for have a good parameter type
* for a native NodeJS signs type.
* @return {NodeJS.Signals}
*/
public toSignJS():NodeJS.Signals{ return <NodeJS.Signals>this.name(); }
}
Object.package(this);