Improve Typesafety on API Wrapper

This commit is contained in:
TheMas3212
2022-03-30 10:11:13 +11:00
parent 40f74e4a98
commit 8c58f0676d
2 changed files with 15 additions and 11 deletions
+3 -2
View File
@@ -9,11 +9,12 @@ import { Fragments, FragmentById } from "../CotMG/Fragment";
import {
Fragment as IFragment,
ActiveFragment as IActiveFragment,
Stanek as IStanek
} from "../ScriptEditor/NetscriptDefinitions";
import { AugmentationNames } from "../Augmentation/data/AugmentationNames";
import { NetscriptContext, InternalNetscriptAPI } from "src/Netscript/APIWrapper";
import { NetscriptContext, InternalAPI } from "src/Netscript/APIWrapper";
export function NetscriptStanek(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): InternalNetscriptAPI {
export function NetscriptStanek(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): InternalAPI<IStanek> {
function checkStanekAPIAccess(func: string): void {
if (!player.hasAugmentation(AugmentationNames.StaneksGift1, true)) {
helper.makeRuntimeErrorMsg(func, "Requires Stanek's Gift installed.");