From f2e297f1e063de5c582d0e3fa5e527e896c5cb8f Mon Sep 17 00:00:00 2001 From: Jorne De Smedt Date: Thu, 6 Jan 2022 21:14:42 +0100 Subject: [PATCH] Added @ns tsconfig.js, used in snippet + example --- .vscode/snippets.code-snippets | 2 +- src/watcher.ts | 2 +- tsconfig.json | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.vscode/snippets.code-snippets b/.vscode/snippets.code-snippets index 6b379c1..a337168 100644 --- a/.vscode/snippets.code-snippets +++ b/.vscode/snippets.code-snippets @@ -3,7 +3,7 @@ "scope": "typescript", "prefix": "template", "body": [ - "import { NS } from '../NetscriptDefinitions'", + "import { NS } from '@ns'", "", "export async function main(ns : NS) : Promise {", "\t//", diff --git a/src/watcher.ts b/src/watcher.ts index 33a80ce..a969053 100644 --- a/src/watcher.ts +++ b/src/watcher.ts @@ -1,4 +1,4 @@ -import { NS, ProcessInfo } from '../NetscriptDefinitions' +import { NS, ProcessInfo } from '@ns' export async function main(ns: NS): Promise { const hashes: any = {} diff --git a/tsconfig.json b/tsconfig.json index dd91a5f..c7e5b34 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "include": [ "NetscriptDefinitions.d.ts", - "src/**/*", + "src/**/*", "foo.ts", ], "compilerOptions": { @@ -19,7 +19,8 @@ "baseUrl": "src/", "paths": { "/*.js": [ "*" ], - "*.js": [ "*" ] + "*.js": [ "*" ], + "@ns": ["../NetscriptDefinitions.d.ts"] } } } \ No newline at end of file