mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-11 02:03:58 +01:00
Add type fix for flags
This commit is contained in:
parent
bba9317ef6
commit
650db2dee7
@ -4,7 +4,7 @@ import { ScriptArg } from "../Netscript/ScriptArg";
|
||||
import { NetscriptContext } from "../Netscript/APIWrapper";
|
||||
|
||||
type FlagType = StringConstructor | NumberConstructor | BooleanConstructor | StringConstructor[];
|
||||
type FlagsRet = { [key: string]: ScriptArg };
|
||||
type FlagsRet = { [key: string]: ScriptArg | string[] };
|
||||
export function Flags(ctx: NetscriptContext | string[]): (data: unknown) => FlagsRet {
|
||||
const vargs = Array.isArray(ctx) ? ctx : ctx.workerScript.args;
|
||||
return (schema: unknown): FlagsRet => {
|
||||
|
2
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
2
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -6531,7 +6531,7 @@ export interface NS {
|
||||
* // {"_":[],"delay":0,"server":"foodnstuff","exclude":[],"help":true}
|
||||
* ```
|
||||
*/
|
||||
flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg };
|
||||
flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] };
|
||||
|
||||
/**
|
||||
* Share your computer with your factions.
|
||||
|
Loading…
Reference in New Issue
Block a user