Amending NetscriptDefinitions

This commit is contained in:
Phil
2022-01-31 18:15:13 +00:00
parent af43e63415
commit 378f67097c
2 changed files with 15 additions and 12 deletions

View File

@@ -5878,19 +5878,22 @@ export interface NS extends Singularity {
tFormat(milliseconds: number, milliPrecision?: boolean): string;
/**
* Prompt the player with a Yes/No modal.
* Prompt the player with an input modal.
* @remarks
* RAM cost: 0 GB
*
* Prompts the player with a dialog box with two options: “Yes” and “No”.
* This function will return true if the player click “Yes” and false if
* the player clicks “No”. The scripts execution is halted until the player
* selects one of the options.
* Prompts the player with a dialog box. If `options.type` is undefined or "boolean",
* the player is shown "Yes" and "No" prompts, which return true and false respectively.
* Passing a type of "text" will give the player a text field and a value of "select"
* will show a drop-down field. Choosing type "select" will require an array or object
* to be passed via the `options.choices` property.
* The scripts execution is halted until the player selects one of the options.
*
* @param txt - Text to appear in the prompt dialog box.
* @returns True if the player click “Yes” and false if the player clicks “No”.
* @param options - Options to modify the prompt the player is shown.
* @returns True if the player click “Yes”; false if the player clicks “No”; or the value entered by the player.
*/
prompt(txt: string): Promise<boolean>;
prompt(txt: string, options?: { type?: "boolean"|"text"|"select"|undefined; choices?: string[] | { [key: string]: string | number } }): Promise<boolean | string>;
/**
* Open up a message box.