mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-17 13:13:49 +01:00
MISC: Add ns.enums to AutocompleteData (#1389)
This commit is contained in:
parent
e9347fca76
commit
a780880531
11
markdown/bitburner.autocompletedata.enums.md
Normal file
11
markdown/bitburner.autocompletedata.enums.md
Normal file
@ -0,0 +1,11 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [AutocompleteData](./bitburner.autocompletedata.md) > [enums](./bitburner.autocompletedata.enums.md)
|
||||
|
||||
## AutocompleteData.enums property
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
enums: NSEnums;
|
||||
```
|
@ -16,6 +16,7 @@ interface AutocompleteData
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [enums](./bitburner.autocompletedata.enums.md) | | [NSEnums](./bitburner.nsenums.md) | |
|
||||
| [scripts](./bitburner.autocompletedata.scripts.md) | | string\[\] | |
|
||||
| [servers](./bitburner.autocompletedata.servers.md) | | string\[\] | |
|
||||
| [txts](./bitburner.autocompletedata.txts.md) | | string\[\] | |
|
||||
|
1
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
1
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -8770,6 +8770,7 @@ interface AutocompleteData {
|
||||
servers: string[];
|
||||
scripts: string[];
|
||||
txts: string[];
|
||||
enums: NSEnums;
|
||||
flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] };
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ import { AutocompleteData } from "@nsdefs";
|
||||
import libarg from "arg";
|
||||
import { getAllDirectories, resolveDirectory, root } from "../Paths/Directory";
|
||||
import { resolveScriptFilePath } from "../Paths/ScriptFilePath";
|
||||
import { enums } from "../NetscriptFunctions";
|
||||
|
||||
// TODO: this shouldn't be hardcoded in two places with no typechecks to verify equivalence
|
||||
// An array of all Terminal commands
|
||||
@ -324,6 +325,7 @@ export async function getTabCompletionPossibilities(terminalText: string, baseDi
|
||||
.map((server) => server.hostname),
|
||||
scripts: [...currServ.scripts.keys()],
|
||||
txts: [...currServ.textFiles.keys()],
|
||||
enums: enums,
|
||||
flags: (schema: unknown) => {
|
||||
if (!Array.isArray(schema)) throw new Error("flags require an array of array");
|
||||
pos2 = schema.map((f: unknown) => {
|
||||
|
Loading…
Reference in New Issue
Block a user