DOC: Add ns documentation for possible sleeve tasks (#217)

* Add specific types for sleeve tasks
* Moved LocationName enum to overall enums file
* Add LocationName enum to those provided to player
* remove trailing s on CompanyPosNames enum (now CompanyPosName, in line with LocationName)
* Also regenerated all ns documentation. This leads to an expected error when checking for generated files, because PRs should not normally touch markdown files. Also leads to a lint failure in generated file bitburner.d.ts
* also removed some exporting from NetscriptDefinitions.d.ts for anything that wasn't imported somewhere else.
This commit is contained in:
Snarling
2022-11-20 12:07:22 -05:00
committed by GitHub
parent 88d51e9a7e
commit 65cd14e33b
369 changed files with 2767 additions and 2449 deletions

View File

@@ -1,11 +1,11 @@
/** @public */
export interface HP {
interface HP {
current: number;
max: number;
}
/** @public */
export interface Skills {
interface Skills {
hacking: number;
strength: number;
defense: number;
@@ -15,12 +15,7 @@ export interface Skills {
intelligence: number;
}
/** @public */
export interface PossibleInfiltrationLocation {
city: string;
name: string;
}
// TODO: provide same treatment to CodingContractData as for SleeveTask
/**
* Coding contract data will differ depending on coding contract.
* @public
@@ -96,7 +91,7 @@ interface MoneySources {
}
/** @public */
export interface Multipliers {
interface Multipliers {
/** Multiplier to hacking skill */
hacking: number;
/** Multiplier to strength skill */
@@ -160,7 +155,7 @@ export interface Multipliers {
}
/** @public */
export interface RunningScript {
interface RunningScript {
/** Arguments the script was called with */
args: (string | number | boolean)[];
/** Filename of the script */
@@ -193,7 +188,7 @@ export interface RunningScript {
}
/** @public */
export interface RecentScript extends RunningScript {
interface RecentScript extends RunningScript {
/** Timestamp of when the script was killed */
timeOfDeath: Date;
}
@@ -202,7 +197,7 @@ export interface RecentScript extends RunningScript {
* Data representing the internal values of a crime.
* @public
*/
export interface CrimeStats {
interface CrimeStats {
/** Number representing the difficulty of the crime. Used for success chance calculations */
difficulty: number;
/** Amount of karma lost for successfully committing this crime */
@@ -247,7 +242,7 @@ export interface CrimeStats {
* Options to affect the behavior of {@link NS.hack | hack}, {@link NS.grow | grow}, and {@link NS.weaken | weaken}.
* @public
*/
export interface BasicHGWOptions {
interface BasicHGWOptions {
/** Number of threads to use for this function.
* Must be less than or equal to the number of threads the script is running with. */
threads?: number;
@@ -259,7 +254,7 @@ export interface BasicHGWOptions {
* Options to affect the behavior of {@link CodingContract} attempt.
* @public
*/
export interface CodingAttemptOptions {
interface CodingAttemptOptions {
/** If truthy, then the function will return a string that states the contracts reward when it is successfully solved. */
returnReward: boolean;
}
@@ -268,7 +263,7 @@ export interface CodingAttemptOptions {
* Return value of {@link sleeve.getSleevePurchasableAugs | getSleevePurchasableAugs}
* @public
*/
export interface AugmentPair {
interface AugmentPair {
/** augmentation name */
name: string;
/** augmentation cost */
@@ -276,13 +271,13 @@ export interface AugmentPair {
}
/** @public */
export enum PositionTypes {
declare enum PositionTypes {
Long = "L",
Short = "S",
}
/** @public */
export enum OrderTypes {
declare enum OrderTypes {
LimitBuy = "Limit Buy Order",
LimitSell = "Limit Sell Order",
StopBuy = "Stop Buy Order",
@@ -293,7 +288,7 @@ export enum OrderTypes {
* Value in map of {@link StockOrder}
* @public
*/
export interface StockOrderObject {
interface StockOrderObject {
/** Number of shares */
shares: number;
/** Price per share */
@@ -310,7 +305,7 @@ export interface StockOrderObject {
* Keys are stock symbols, properties are arrays of {@link StockOrderObject}
* @public
*/
export interface StockOrder {
interface StockOrder {
[key: string]: StockOrderObject[];
}
@@ -318,7 +313,7 @@ export interface StockOrder {
* A single process on a server.
* @public
*/
export interface ProcessInfo {
interface ProcessInfo {
/** Script name. */
filename: string;
/** Number of threads script is running with */
@@ -333,7 +328,7 @@ export interface ProcessInfo {
* Hack related multipliers.
* @public
*/
export interface HackingMultipliers {
interface HackingMultipliers {
/** Player's hacking chance multiplier. */
chance: number;
/** Player's hacking speed multiplier. */
@@ -348,7 +343,7 @@ export interface HackingMultipliers {
* Hacknet related multipliers.
* @public
*/
export interface HacknetMultipliers {
interface HacknetMultipliers {
/** Player's hacknet production multiplier */
production: number;
/** Player's hacknet purchase cost multiplier */
@@ -365,7 +360,7 @@ export interface HacknetMultipliers {
* Hacknet node related constants
* @public
*/
export interface HacknetNodeConstants {
interface HacknetNodeConstants {
/** Amount of money gained per level */
MoneyGainPerLevel: number;
/** Base cost for a new node */
@@ -396,7 +391,7 @@ export interface HacknetNodeConstants {
* Hacknet server related constants
* @public
*/
export interface HacknetServerConstants {
interface HacknetServerConstants {
/** Number of hashes calculated per level */
HashesPerLevel: number;
/** Base cost for a new server */
@@ -433,7 +428,7 @@ export interface HacknetServerConstants {
* A single server.
* @public
*/
export interface Server {
interface Server {
/**
* How many CPU cores this server has. Maximum of 8.
* Affects magnitude of grow and weaken.
@@ -523,7 +518,7 @@ export interface Server {
* All multipliers affecting the difficulty of the current challenge.
* @public
*/
export interface BitNodeMultipliers {
interface BitNodeMultipliers {
/** Influences how quickly the player's agility level (not exp) scales */
AgilityLevelMultiplier: number;
/** Influences the base cost to purchase an augmentation. */
@@ -624,7 +619,7 @@ export interface BitNodeMultipliers {
* Object representing all the values related to a hacknet node.
* @public
*/
export interface NodeStats {
interface NodeStats {
/** Node's name */
name: string;
/** Node's level */
@@ -648,7 +643,7 @@ export interface NodeStats {
}
/** @public */
export interface SourceFileLvl {
interface SourceFileLvl {
/** The number of the source file */
n: number;
/** The level of the source file */
@@ -659,7 +654,7 @@ export interface SourceFileLvl {
* Bladeburner current action.
* @public
*/
export interface BladeburnerCurAction {
interface BladeburnerCurAction {
/** Type of Action */
type: string;
/** Name of Action */
@@ -670,7 +665,7 @@ export interface BladeburnerCurAction {
* Gang general info.
* @public
*/
export interface GangGenInfo {
interface GangGenInfo {
/** Name of faction that the gang belongs to ("Slum Snakes", etc.) */
faction: string;
/** Indicating whether or not it's a hacking gang */
@@ -698,7 +693,7 @@ export interface GangGenInfo {
}
/** @public */
export interface GangOtherInfoObject {
interface GangOtherInfoObject {
/** Gang power */
power: number;
/** Gang territory, in decimal form */
@@ -706,7 +701,7 @@ export interface GangOtherInfoObject {
}
/** @public */
export interface GangOtherInfo {
interface GangOtherInfo {
[key: string]: GangOtherInfoObject;
}
@@ -714,7 +709,7 @@ export interface GangOtherInfo {
* Object representing data representing a gang member task.
* @public
*/
export interface GangTaskStats {
interface GangTaskStats {
/** Task name */
name: string;
/** Task Description */
@@ -751,7 +746,7 @@ export interface GangTaskStats {
* Object representing data representing a gang member equipment.
* @public
*/
export interface EquipmentStats {
interface EquipmentStats {
/** Strength multiplier */
str?: number;
/** Defense multiplier */
@@ -767,7 +762,7 @@ export interface EquipmentStats {
}
/** @public */
export interface GangTerritory {
interface GangTerritory {
/** Money gain impact on task scaling */
money: number;
/** Respect gain impact on task scaling */
@@ -777,7 +772,7 @@ export interface GangTerritory {
}
/** @public */
export interface GangMemberInfo {
interface GangMemberInfo {
/** Name of the gang member */
name: string;
/** Currently assigned task */
@@ -858,7 +853,7 @@ export interface GangMemberInfo {
}
/** @public */
export interface GangMemberAscension {
interface GangMemberAscension {
/** Amount of respect lost from ascending */
respect: number;
/** Hacking multiplier gained from ascending */
@@ -875,24 +870,66 @@ export interface GangMemberAscension {
cha: number;
}
/**
* Object representing a sleeve current task.
* @public
*/
export type SleeveTask = any;
/** @public */
type SleeveBladeburnerTask = {
type: "BLADEBURNER";
actionType: "General" | "Contracts";
actionName: string;
};
/**
* Object representing a port. A port is a serialized queue.
* @public
*/
export interface NetscriptPort {
/**
* Write data to a port.
/** @public */
type SleeveClassTask = {
type: "CLASS";
classType: UniversityClassType | GymType | `${UniversityClassType}` | `${GymType}`;
location: LocationName | `${LocationName}`;
};
/** @public */
type SleeveCompanyTask = { type: "COMPANY"; companyName: string };
/** @public */
type SleeveCrimeTask = { type: "CRIME"; crimeType: CrimeType | `${CrimeType}` };
/** @public */
type SleeveFactionTask = {
type: "FACTION";
factionWorkType: FactionWorkType | `${FactionWorkType}`;
factionName: string;
};
/** @public */
type SleeveInfiltrateTask = { type: "INFILTRATE" };
/** @public */
type SleeveRecoveryTask = { type: "RECOVERY" };
/** @public */
type SleeveSupportTask = { type: "SUPPORT" };
/** @public */
type SleeveSynchroTask = { type: "SYNCHRO" };
/** Object representing a sleeve current task.
* @public */
export type SleeveTask =
| SleeveBladeburnerTask
| SleeveClassTask
| SleeveCompanyTask
| SleeveCrimeTask
| SleeveFactionTask
| SleeveInfiltrateTask
| SleeveRecoveryTask
| SleeveSupportTask
| SleeveSynchroTask;
/** Object representing a port. A port is a serialized queue.
* @public */
interface NetscriptPort {
/** Write data to a port.
* @remarks
* RAM cost: 0 GB
*
* @returns The data popped off the queue if it was full.
*/
* @returns The data popped off the queue if it was full. */
write(value: string | number): PortData | null;
/**
@@ -3507,12 +3544,13 @@ export interface sleeve {
* @remarks
* RAM cost: 4 GB
*
* Return the current task that the sleeve is performing. type is set to “Idle” if the sleeve isnt doing anything.
* Return the current task that the sleeve is performing, or null if the sleeve is idle. All tasks have a "type"
* property, and other available properties depend on the type of task.
*
* @param sleeveNumber - Index of the sleeve to retrieve task from.
* @returns Object containing information the current task that the sleeve is performing.
* @returns Object containing information for the current task that the sleeve is performing.
*/
getTask(sleeveNumber: number): SleeveTask;
getTask(sleeveNumber: number): SleeveTask | null;
/**
* Set a sleeve to shock recovery.
@@ -3795,7 +3833,7 @@ interface SkillsFormulas {
}
/** @public */
export interface WorkStats {
interface WorkStats {
money: number;
reputation: number;
hackExp: number;
@@ -3829,7 +3867,7 @@ interface WorkFormulas {
companyGains(
person: Person,
companyName: string,
workType: CompanyPosNames | `${CompanyPosNames}`,
workType: CompanyPosName | `${CompanyPosName}`,
favor: number,
): WorkStats;
}
@@ -4123,7 +4161,7 @@ export interface Formulas {
}
/** @public */
export interface Fragment {
interface Fragment {
id: number;
shape: boolean[][];
type: number;
@@ -4132,7 +4170,7 @@ export interface Fragment {
}
/** @public */
export interface ActiveFragment {
interface ActiveFragment {
id: number;
highestCharge: number;
numCharge: number;
@@ -4254,20 +4292,20 @@ interface Stanek {
}
/** @public */
export interface InfiltrationReward {
interface InfiltrationReward {
tradeRep: number;
sellCash: number;
SoARep: number;
}
/** @public */
export interface ILocation {
interface ILocation {
city: string;
name: string;
}
/** @public */
export interface InfiltrationLocation {
interface InfiltrationLocation {
location: ILocation;
reward: InfiltrationReward;
difficulty: number;
@@ -4285,7 +4323,7 @@ interface Infiltration {
*
* @returns all locations that can be infiltrated.
*/
getPossibleLocations(): PossibleInfiltrationLocation[];
getPossibleLocations(): ILocation[];
/**
* Get all infiltrations with difficulty, location and rewards.
* @remarks
@@ -6859,7 +6897,7 @@ declare enum GymType {
}
/** @public */
declare enum CompanyPosNames {
declare enum CompanyPosName {
sw0 = "Software Engineering Intern",
sw1 = "Junior Software Engineer",
sw2 = "Senior Software Engineer",
@@ -6930,6 +6968,74 @@ declare enum IndustryType {
RealEstate = "RealEstate",
}
/** Names of all locations
* @public */
declare enum LocationName {
AevumAeroCorp = "AeroCorp",
AevumBachmanAndAssociates = "Bachman & Associates",
AevumClarkeIncorporated = "Clarke Incorporated",
AevumCrushFitnessGym = "Crush Fitness Gym",
AevumECorp = "ECorp",
AevumFulcrumTechnologies = "Fulcrum Technologies",
AevumGalacticCybersystems = "Galactic Cybersystems",
AevumNetLinkTechnologies = "NetLink Technologies",
AevumPolice = "Aevum Police Headquarters",
AevumRhoConstruction = "Rho Construction",
AevumSnapFitnessGym = "Snap Fitness Gym",
AevumSummitUniversity = "Summit University",
AevumWatchdogSecurity = "Watchdog Security",
AevumCasino = "Iker Molina Casino",
ChongqingKuaiGongInternational = "KuaiGong International",
ChongqingSolarisSpaceSystems = "Solaris Space Systems",
ChongqingChurchOfTheMachineGod = "Church of the Machine God",
Sector12AlphaEnterprises = "Alpha Enterprises",
Sector12BladeIndustries = "Blade Industries",
Sector12CIA = "Central Intelligence Agency",
Sector12CarmichaelSecurity = "Carmichael Security",
Sector12CityHall = "Sector-12 City Hall",
Sector12DeltaOne = "DeltaOne",
Sector12FoodNStuff = "FoodNStuff",
Sector12FourSigma = "Four Sigma",
Sector12IcarusMicrosystems = "Icarus Microsystems",
Sector12IronGym = "Iron Gym",
Sector12JoesGuns = "Joe's Guns",
Sector12MegaCorp = "MegaCorp",
Sector12NSA = "National Security Agency",
Sector12PowerhouseGym = "Powerhouse Gym",
Sector12RothmanUniversity = "Rothman University",
Sector12UniversalEnergy = "Universal Energy",
NewTokyoDefComm = "DefComm",
NewTokyoGlobalPharmaceuticals = "Global Pharmaceuticals",
NewTokyoNoodleBar = "Noodle Bar",
NewTokyoVitaLife = "VitaLife",
NewTokyoArcade = "Arcade",
IshimaNovaMedical = "Nova Medical",
IshimaOmegaSoftware = "Omega Software",
IshimaStormTechnologies = "Storm Technologies",
IshimaGlitch = "0x6C1",
VolhavenCompuTek = "CompuTek",
VolhavenHeliosLabs = "Helios Labs",
VolhavenLexoCorp = "LexoCorp",
VolhavenMilleniumFitnessGym = "Millenium Fitness Gym",
VolhavenNWO = "NWO",
VolhavenOmniTekIncorporated = "OmniTek Incorporated",
VolhavenOmniaCybersystems = "Omnia Cybersystems",
VolhavenSysCoreSecurities = "SysCore Securities",
VolhavenZBInstituteOfTechnology = "ZB Institute of Technology",
Hospital = "Hospital",
Slums = "The Slums",
TravelAgency = "Travel Agency",
WorldStockExchange = "World Stock Exchange",
Void = "The Void",
}
/** @public */
export type NSEnums = {
toast: typeof ToastVariant;
@@ -6937,7 +7043,8 @@ export type NSEnums = {
FactionWorkType: typeof FactionWorkType;
GymType: typeof GymType;
UniversityClassType: typeof UniversityClassType;
CompanyPosNames: typeof CompanyPosNames;
CompanyPosName: typeof CompanyPosName;
LocationName: typeof LocationName;
};
/**