NETSCRIPT: A minorly breaking change around script launch, and refactoring. (#1213)

This commit is contained in:
David Walker
2024-04-23 17:21:05 -07:00
committed by GitHub
parent 7a1fce6f64
commit 384d1c1a2b
24 changed files with 48 additions and 66 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
import { NSFull } from "../NetscriptFunctions";
import { AutocompleteData } from "@nsdefs";
import type { NSFull } from "../NetscriptFunctions";
import type { AutocompleteData, ScriptArg } from "@nsdefs";
// The object portion of this type is not runtime information, it's only to ensure type validation
// And make it harder to overwrite a url with a random non-url string.
export type ScriptURL = string & { __type: "ScriptURL" };
export interface ScriptModule {
main?: (ns: NSFull) => unknown;
main?: (ns: NSFull, ...args: ScriptArg[]) => unknown;
autocomplete?: (data: AutocompleteData, flags: string[]) => unknown;
}