This commit is contained in:
Olivier Gagnon
2021-11-03 00:33:14 -04:00
parent 2b79871c02
commit d82f3e7ad7
71 changed files with 1313 additions and 1366 deletions

View File

@@ -162,10 +162,10 @@ interface StockOrderObject {
* Return value of {@link TIX.getOrders | getOrders}
* @public
*/
type StockOrder = {
interface StockOrder {
/** Stock Symbol */
[key: string]: StockOrderObject[];
};
}
/**
* A single process on a server.
@@ -347,24 +347,6 @@ interface BitNodeMultipliers {
/** Influences how quickly the player's strength level (not exp) scales */
StrengthLevelMultiplier: number;
}
/**
* Queue used to send and receive messages.
* @remarks
* A port is implemented as a sort of serialized queue,
* where you can only write and read one element at a time from the port.
* When you read data from a port, the element that is read is removed from the port.
*
* IMPORTANT: The data inside ports are not saved!
* This means if you close and re-open the game, or reload the page
* then you will lose all of the data in the ports!
* @public
*/
type Port = number;
/**
* @public
*/
type Handle = string | Port;
/**
* Object representing all the values related to a hacknet node.
@@ -571,16 +553,16 @@ interface GangOtherInfoObject {
/**
* @public
*/
type GangOtherInfo = {
interface GangOtherInfo {
/** Stock Symbol */
[key: string]: GangOtherInfoObject[];
};
}
/**
* Object representing data representing a gang member task.
* @public
*/
interface stringStats {
interface GangTaskStats {
/** Task name */
name: string;
/** Task Description */
@@ -610,14 +592,14 @@ interface stringStats {
/** Number representing the difficulty of the task */
difficulty: number;
/** Territory impact on task scaling */
territory: stringTerritory;
territory: GangTerritory;
}
/**
* Object representing data representing a gang member equipment.
* @public
*/
interface stringStats {
interface EquipmentStats {
/** Strength multiplier */
str: number;
/** Defense multiplier */
@@ -635,7 +617,7 @@ interface stringStats {
/**
* @public
*/
interface stringTerritory {
interface GangTerritory {
/** Money gain impact on task scaling */
money: number;
/** Respect gain impact on task scaling */
@@ -2658,7 +2640,7 @@ interface Gang {
* @param name - Name of the task.
* @returns Detailed stats of a task.
*/
getTaskStats(name: string): stringStats;
getTaskStats(name: string): GangTaskStats;
/**
* List equipment names.
@@ -2707,7 +2689,7 @@ interface Gang {
* @param equipName - Name of equipment.
* @returns A dictionary containing the stats of the equipment.
*/
getEquipmentStats(equipName: string): stringStats;
getEquipmentStats(equipName: string): EquipmentStats;
/**
* Purchase an equipment for a gang member.
@@ -4003,7 +3985,7 @@ export interface NS extends Singularity {
* @param data - Data to write.
* @param mode - Defines the write mode. Only valid when writing to text files.
*/
write(handle: Handle, data?: string[] | number, mode?: "w" | "a"): void;
write(handle: string | number, data?: string[] | number, mode?: "w" | "a"): void;
/**
* Attempts to write data to the specified Netscript Port.
@@ -4015,7 +3997,7 @@ export interface NS extends Singularity {
* @param data - Data to write.
* @returns True if the data is successfully written to the port, and false otherwise.
*/
tryWrite(port: Handle, data: string[] | number): boolean;
tryWrite(port: number, data: string[] | number): boolean;
/**
* This function is used to read data from a port or from a text file (.txt).
@@ -4033,7 +4015,7 @@ export interface NS extends Singularity {
* @param handle - Port or text file to read from.
* @returns Data in the specified text file or port.
*/
read(handle: Handle): string | number | object;
read(handle: string | number): string | number | object;
/**
* This function is used to peek at the data from a port. It returns the
@@ -4044,7 +4026,7 @@ export interface NS extends Singularity {
* @param port - Port to peek. Must be an integer between 1 and 20.
* @returns Data in the specified port.
*/
peek(port: Port): string | number | object;
peek(port: number): string | number | object;
/**
* This function is used to clear data in a Netscript Ports or a text file.
@@ -4058,7 +4040,7 @@ export interface NS extends Singularity {
* @remarks RAM cost: 1 GB
* @param handle - Port or text file to clear.
*/
clear(handle: Handle): void;
clear(handle: string | number): void;
/**
* Get a handle to a Netscript Port.
@@ -4070,7 +4052,7 @@ export interface NS extends Singularity {
* @param port - Port number. Must be an integer between 1 and 20.
* @returns Data in the specified port.
*/
getPortHandle(port: Port): any[];
getPortHandle(port: number): any[];
/**
* Removes the specified file from the current server. This function works for every file