Skip to content

Commit

Permalink
Using enums for constants instead of string datatype (#98)
Browse files Browse the repository at this point in the history
* feat: added enums in a separate folder to use for constant values instead of using string datatype

* fix: making the case upper or lower same as given in the comments

* Delete src/types/enums.ts

* Update index.ts

---------

Co-authored-by: Shalitha Suranga <[email protected]>
  • Loading branch information
Sadaf-A and shalithasuranga authored Feb 29, 2024
1 parent ceb6374 commit e42ffe8
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
export enum Mode {
window,
browser,
cloud,
chrome
}

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

export enum Architecture {
x64,
arm,
itanium,
ia32,
unknown
}

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 +42,10 @@ interface Window {
NL_PATH: string;
/** Returns true if extensions are enabled */
NL_EXTENABLED: boolean;
/** Operating system name: Linux, Windows, Darwin, FreeBSD, or Unknown */
NL_OS: string;
/** Operating system name: Linux, Windows, Darwin, FreeBSD, or Uknown */
NL_OS: OperatingSystem;
/** CPU architecture: x64, arm, itanium, ia32, or unknown */
NL_ARCH: string;
NL_ARCH: Architecture;
/** Neutralinojs server version */
NL_VERSION: string;
/** Current working directory */
Expand Down

0 comments on commit e42ffe8

Please sign in to comment.