MISC: Add ns.enums to AutocompleteData (#1389)

This commit is contained in:
catloversg 2024-06-14 13:56:27 +07:00 committed by GitHub
parent e9347fca76
commit a780880531
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 0 deletions

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [AutocompleteData](./bitburner.autocompletedata.md) &gt; [enums](./bitburner.autocompletedata.enums.md)
## AutocompleteData.enums property
**Signature:**
```typescript
enums: NSEnums;
```

@ -16,6 +16,7 @@ interface AutocompleteData
| Property | Modifiers | Type | Description | | Property | Modifiers | Type | Description |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| [enums](./bitburner.autocompletedata.enums.md) | | [NSEnums](./bitburner.nsenums.md) | |
| [scripts](./bitburner.autocompletedata.scripts.md) | | string\[\] | | | [scripts](./bitburner.autocompletedata.scripts.md) | | string\[\] | |
| [servers](./bitburner.autocompletedata.servers.md) | | string\[\] | | | [servers](./bitburner.autocompletedata.servers.md) | | string\[\] | |
| [txts](./bitburner.autocompletedata.txts.md) | | string\[\] | | | [txts](./bitburner.autocompletedata.txts.md) | | string\[\] | |

@ -8770,6 +8770,7 @@ interface AutocompleteData {
servers: string[]; servers: string[];
scripts: string[]; scripts: string[];
txts: string[]; txts: string[];
enums: NSEnums;
flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] }; flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] };
} }

@ -10,6 +10,7 @@ import { AutocompleteData } from "@nsdefs";
import libarg from "arg"; import libarg from "arg";
import { getAllDirectories, resolveDirectory, root } from "../Paths/Directory"; import { getAllDirectories, resolveDirectory, root } from "../Paths/Directory";
import { resolveScriptFilePath } from "../Paths/ScriptFilePath"; import { resolveScriptFilePath } from "../Paths/ScriptFilePath";
import { enums } from "../NetscriptFunctions";
// TODO: this shouldn't be hardcoded in two places with no typechecks to verify equivalence // TODO: this shouldn't be hardcoded in two places with no typechecks to verify equivalence
// An array of all Terminal commands // An array of all Terminal commands
@ -324,6 +325,7 @@ export async function getTabCompletionPossibilities(terminalText: string, baseDi
.map((server) => server.hostname), .map((server) => server.hostname),
scripts: [...currServ.scripts.keys()], scripts: [...currServ.scripts.keys()],
txts: [...currServ.textFiles.keys()], txts: [...currServ.textFiles.keys()],
enums: enums,
flags: (schema: unknown) => { flags: (schema: unknown) => {
if (!Array.isArray(schema)) throw new Error("flags require an array of array"); if (!Array.isArray(schema)) throw new Error("flags require an array of array");
pos2 = schema.map((f: unknown) => { pos2 = schema.map((f: unknown) => {