Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing datatype of constants from string to enum #97

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/enums.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export enum MODE {
Window,
Browser,
Cloud,
Chrome
}

export enum OS {
Linux,
Windows,
Darwin,
FreeBSD,
Unknown
}

export enum ARCH {
x64,
Arm,
Itanium,
ia32,
Unknown
}
10 changes: 6 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { MODE, OS, ARCH } from './enums';

declare global {
interface Window {
// --- globals ---
/** Mode of the application: window, browser, cloud, or chrome */
NL_MODE: string;
NL_MODE: MODE;
/** Application port */
NL_PORT: number;
/** Command-line arguments */
Expand All @@ -19,10 +21,10 @@ interface Window {
NL_PATH: string;
/** Returns true if extensions are enabled */
NL_EXTENABLED: boolean;
/** Operating system name: Linux, Windows, Darwin, FreeBSD, or Uknown */
NL_OS: string;
/** Operating system name: Linux, Windows, Darwin, FreeBSD, or Unknown */
NL_OS: OS;
/** CPU architecture: x64, arm, itanium, ia32, or unknown */
NL_ARCH: string;
NL_ARCH: ARCH;
/** Neutralinojs server version */
NL_VERSION: string;
/** Current working directory */
Expand Down
Loading