Skip to content

Commit d82f3e7

Browse files
committed
more doc
1 parent 2b79871 commit d82f3e7

File tree

71 files changed

+4410
-4463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4410
-4463
lines changed

dist/bitburner.d.ts

+80-99
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,25 @@ export declare interface CrimeStats {
875875
intelligence_exp: number;
876876
}
877877

878+
/**
879+
* Object representing data representing a gang member equipment.
880+
* @public
881+
*/
882+
export declare interface EquipmentStats {
883+
/** Strength multiplier */
884+
str: number;
885+
/** Defense multiplier */
886+
def: number;
887+
/** Dexterity multiplier */
888+
dex: number;
889+
/** Agility multiplier */
890+
agi: number;
891+
/** Charisma multiplier */
892+
cha: number;
893+
/** Hacking multiplier */
894+
hack: number;
895+
}
896+
878897
/**
879898
* Gang API
880899
* @remarks
@@ -989,7 +1008,7 @@ export declare interface Gang {
9891008
* @param name - Name of the task.
9901009
* @returns Detailed stats of a task.
9911010
*/
992-
getTaskStats(name: string): stringStats;
1011+
getTaskStats(name: string): GangTaskStats;
9931012

9941013
/**
9951014
* List equipment names.
@@ -1038,7 +1057,7 @@ export declare interface Gang {
10381057
* @param equipName - Name of equipment.
10391058
* @returns A dictionary containing the stats of the equipment.
10401059
*/
1041-
getEquipmentStats(equipName: string): stringStats;
1060+
getEquipmentStats(equipName: string): EquipmentStats;
10421061

10431062
/**
10441063
* Purchase an equipment for a gang member.
@@ -1202,10 +1221,10 @@ export declare interface GangMemberInfo {
12021221
/**
12031222
* @public
12041223
*/
1205-
export declare type GangOtherInfo = {
1224+
export declare interface GangOtherInfo {
12061225
/** Stock Symbol */
12071226
[key: string]: GangOtherInfoObject[];
1208-
};
1227+
}
12091228

12101229
/**
12111230
* @public
@@ -1217,6 +1236,55 @@ export declare interface GangOtherInfoObject {
12171236
territory: number;
12181237
}
12191238

1239+
/**
1240+
* Object representing data representing a gang member task.
1241+
* @public
1242+
*/
1243+
export declare interface GangTaskStats {
1244+
/** Task name */
1245+
name: string;
1246+
/** Task Description */
1247+
desc: string;
1248+
/** Is a task of a hacking gang */
1249+
isHacking: boolean;
1250+
/** Is a task of a combat gang */
1251+
isCombat: boolean;
1252+
/** Base respect earned */
1253+
baseRespect: number;
1254+
/** Base wanted earned */
1255+
baseWanted: number;
1256+
/** Base money earned */
1257+
baseMoney: number;
1258+
/** Hacking skill impact on task scaling */
1259+
hackWeight: number;
1260+
/** Stength skill impact on task scaling */
1261+
strWeight: number;
1262+
/** Defense skill impact on task scaling */
1263+
defWeight: number;
1264+
/** Dexterity skill impact on task scaling */
1265+
dexWeight: number;
1266+
/** Agility skill impact on task scaling */
1267+
agiWeight: number;
1268+
/** Charisma skill impact on task scaling */
1269+
chaWeight: number;
1270+
/** Number representing the difficulty of the task */
1271+
difficulty: number;
1272+
/** Territory impact on task scaling */
1273+
territory: GangTerritory;
1274+
}
1275+
1276+
/**
1277+
* @public
1278+
*/
1279+
export declare interface GangTerritory {
1280+
/** Money gain impact on task scaling */
1281+
money: number;
1282+
/** Respect gain impact on task scaling */
1283+
respect: number;
1284+
/** Wanted gain impact on task scaling */
1285+
wanted: number;
1286+
}
1287+
12201288
/**
12211289
* Hack related multipliers.
12221290
* @public
@@ -1512,11 +1580,6 @@ export declare interface HacknetMultipliers {
15121580
levelCost: number;
15131581
}
15141582

1515-
/**
1516-
* @public
1517-
*/
1518-
export declare type Handle = string | Port;
1519-
15201583
/**
15211584
* Object representing all the values related to a hacknet node.
15221585
* @public
@@ -2573,7 +2636,7 @@ export declare interface NS extends Singularity {
25732636
* @param data - Data to write.
25742637
* @param mode - Defines the write mode. Only valid when writing to text files.
25752638
*/
2576-
write(handle: Handle, data?: string[] | number, mode?: "w" | "a"): void;
2639+
write(handle: string | number, data?: string[] | number, mode?: "w" | "a"): void;
25772640

25782641
/**
25792642
* Attempts to write data to the specified Netscript Port.
@@ -2585,7 +2648,7 @@ export declare interface NS extends Singularity {
25852648
* @param data - Data to write.
25862649
* @returns True if the data is successfully written to the port, and false otherwise.
25872650
*/
2588-
tryWrite(port: Handle, data: string[] | number): boolean;
2651+
tryWrite(port: number, data: string[] | number): boolean;
25892652

25902653
/**
25912654
* This function is used to read data from a port or from a text file (.txt).
@@ -2603,7 +2666,7 @@ export declare interface NS extends Singularity {
26032666
* @param handle - Port or text file to read from.
26042667
* @returns Data in the specified text file or port.
26052668
*/
2606-
read(handle: Handle): string | number | object;
2669+
read(handle: string | number): string | number | object;
26072670

26082671
/**
26092672
* This function is used to peek at the data from a port. It returns the
@@ -2614,7 +2677,7 @@ export declare interface NS extends Singularity {
26142677
* @param port - Port to peek. Must be an integer between 1 and 20.
26152678
* @returns Data in the specified port.
26162679
*/
2617-
peek(port: Port): string | number | object;
2680+
peek(port: number): string | number | object;
26182681

26192682
/**
26202683
* This function is used to clear data in a Netscript Ports or a text file.
@@ -2628,7 +2691,7 @@ export declare interface NS extends Singularity {
26282691
* @remarks RAM cost: 1 GB
26292692
* @param handle - Port or text file to clear.
26302693
*/
2631-
clear(handle: Handle): void;
2694+
clear(handle: string | number): void;
26322695

26332696
/**
26342697
* Get a handle to a Netscript Port.
@@ -2640,7 +2703,7 @@ export declare interface NS extends Singularity {
26402703
* @param port - Port number. Must be an integer between 1 and 20.
26412704
* @returns Data in the specified port.
26422705
*/
2643-
getPortHandle(port: Port): any[];
2706+
getPortHandle(port: number): any[];
26442707

26452708
/**
26462709
* Removes the specified file from the current server. This function works for every file
@@ -2919,20 +2982,6 @@ export declare interface PlayerSkills {
29192982
intelligence: number;
29202983
}
29212984

2922-
/**
2923-
* Queue used to send and receive messages.
2924-
* @remarks
2925-
* A port is implemented as a sort of serialized queue,
2926-
* where you can only write and read one element at a time from the port.
2927-
* When you read data from a port, the element that is read is removed from the port.
2928-
*
2929-
* IMPORTANT: The data inside ports are not saved!
2930-
* This means if you close and re-open the game, or reload the page
2931-
* then you will lose all of the data in the ports!
2932-
* @public
2933-
*/
2934-
export declare type Port = number;
2935-
29362985
/**
29372986
* A single process on a server.
29382987
* @public
@@ -3892,10 +3941,10 @@ export declare interface SourceFileLvl {
38923941
* Return value of {@link TIX.getOrders | getOrders}
38933942
* @public
38943943
*/
3895-
export declare type StockOrder = {
3944+
export declare interface StockOrder {
38963945
/** Stock Symbol */
38973946
[key: string]: StockOrderObject[];
3898-
};
3947+
}
38993948

39003949
/**
39013950
* Value in map of {@link StockOrder}
@@ -3912,74 +3961,6 @@ export declare interface StockOrderObject {
39123961
position: string;
39133962
}
39143963

3915-
/**
3916-
* Object representing data representing a gang member task.
3917-
* @public
3918-
*/
3919-
export declare interface stringStats {
3920-
/** Task name */
3921-
name: string;
3922-
/** Task Description */
3923-
desc: string;
3924-
/** Is a task of a hacking gang */
3925-
isHacking: boolean;
3926-
/** Is a task of a combat gang */
3927-
isCombat: boolean;
3928-
/** Base respect earned */
3929-
baseRespect: number;
3930-
/** Base wanted earned */
3931-
baseWanted: number;
3932-
/** Base money earned */
3933-
baseMoney: number;
3934-
/** Hacking skill impact on task scaling */
3935-
hackWeight: number;
3936-
/** Stength skill impact on task scaling */
3937-
strWeight: number;
3938-
/** Defense skill impact on task scaling */
3939-
defWeight: number;
3940-
/** Dexterity skill impact on task scaling */
3941-
dexWeight: number;
3942-
/** Agility skill impact on task scaling */
3943-
agiWeight: number;
3944-
/** Charisma skill impact on task scaling */
3945-
chaWeight: number;
3946-
/** Number representing the difficulty of the task */
3947-
difficulty: number;
3948-
/** Territory impact on task scaling */
3949-
territory: stringTerritory;
3950-
}
3951-
3952-
/**
3953-
* Object representing data representing a gang member equipment.
3954-
* @public
3955-
*/
3956-
export declare interface stringStats {
3957-
/** Strength multiplier */
3958-
str: number;
3959-
/** Defense multiplier */
3960-
def: number;
3961-
/** Dexterity multiplier */
3962-
dex: number;
3963-
/** Agility multiplier */
3964-
agi: number;
3965-
/** Charisma multiplier */
3966-
cha: number;
3967-
/** Hacking multiplier */
3968-
hack: number;
3969-
}
3970-
3971-
/**
3972-
* @public
3973-
*/
3974-
export declare interface stringTerritory {
3975-
/** Money gain impact on task scaling */
3976-
money: number;
3977-
/** Respect gain impact on task scaling */
3978-
respect: number;
3979-
/** Wanted gain impact on task scaling */
3980-
wanted: number;
3981-
}
3982-
39833964
/**
39843965
* Stock market API
39853966
* @public

0 commit comments

Comments
 (0)