Skip to content

Commit

Permalink
#86: Fix type declaration issues
Browse files Browse the repository at this point in the history
  • Loading branch information
shalithasuranga committed Feb 24, 2024
1 parent 28620b4 commit 1f3604e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 40 deletions.
3 changes: 2 additions & 1 deletion build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ rollup ({
else if (entry.fileName === 'neutralino.d.ts')
{
var code = entry.source.toString ()
writeDts (joinPath (outdir, 'neutralino.d.ts'), code.substring (0, code.lastIndexOf ("export")))
writeDts (joinPath (outdir, 'neutralino.d.ts'),
code.substring (code.indexOf("declare namespace"), code.lastIndexOf ("export")))
}
else
{
Expand Down
38 changes: 0 additions & 38 deletions src/globals.d.ts

This file was deleted.

41 changes: 40 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
/// <reference path="./globals.d.ts" />
declare global {
interface Window {
/** Mode of the application: window, browser, cloud, or chrome */
NL_MODE: string;
/** Application port */
NL_PORT: number;
/** Command-line arguments */
NL_ARGS: string[];
/** Basic authentication token */
NL_TOKEN: string;
/** Neutralinojs client version */
NL_CVERSION: string;
/** Application identifier */
NL_APPID: string;
/** Application version */
NL_APPVERSION?: string;
/** Application path */
NL_PATH: string;
/** Returns true if extensions are enabled */
NL_EXTENABLED: boolean;
/** Operating system name: Linux, Windows, Darwin, FreeBSD, or Uknown */
NL_OS: string;
/** CPU architecture: x64, arm, itanium, ia32, or unknown */
NL_ARCH: string;
/** Neutralinojs server version */
NL_VERSION: string;
/** Current working directory */
NL_CWD: string;
/** Identifier of the current process */
NL_PID: string;
/** Source of application resources: bundle or directory */
NL_RESMODE: string;
/** Release commit of the client library */
NL_CCOMMIT: string;
/** An array of custom methods */
NL_CMETHODS: string[];
}
/** Neutralino global object for custom methods **/
const Neutralino: any;
}

export * as filesystem from './api/filesystem';
export * as os from './api/os';
Expand Down

0 comments on commit 1f3604e

Please sign in to comment.