DOC: Specify optional parameters in hacknet functions (#515)

This commit is contained in:
Nikolai Korolev 2023-05-18 06:28:56 +01:00 committed by GitHub
parent 75706d273a
commit 2e9dc32deb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 32 additions and 32 deletions

@ -9,7 +9,7 @@ Calculate the cost of upgrading hacknet node cache.
**Signature:**
```typescript
getCacheUpgradeCost(index: number, n: number): number;
getCacheUpgradeCost(index: number, n?: number): number;
```
## Parameters
@ -17,7 +17,7 @@ getCacheUpgradeCost(index: number, n: number): number;
| Parameter | Type | Description |
| --- | --- | --- |
| index | number | Index/Identifier of Hacknet Node. |
| n | number | Number of times to upgrade cache. Must be positive. Rounded to nearest integer. |
| n | number | _(Optional)_ Number of times to upgrade cache. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
**Returns:**

@ -9,7 +9,7 @@ Calculate the cost of upgrading hacknet node cores.
**Signature:**
```typescript
getCoreUpgradeCost(index: number, n: number): number;
getCoreUpgradeCost(index: number, n?: number): number;
```
## Parameters
@ -17,7 +17,7 @@ getCoreUpgradeCost(index: number, n: number): number;
| Parameter | Type | Description |
| --- | --- | --- |
| index | number | Index/Identifier of Hacknet Node. |
| n | number | Number of times to upgrade cores. Must be positive. Rounded to nearest integer. |
| n | number | _(Optional)_ Number of times to upgrade cores. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
**Returns:**

@ -9,7 +9,7 @@ Calculate the cost of upgrading hacknet node levels.
**Signature:**
```typescript
getLevelUpgradeCost(index: number, n: number): number;
getLevelUpgradeCost(index: number, n?: number): number;
```
## Parameters
@ -17,7 +17,7 @@ getLevelUpgradeCost(index: number, n: number): number;
| Parameter | Type | Description |
| --- | --- | --- |
| index | number | Index/Identifier of Hacknet Node. |
| n | number | Number of levels to upgrade. Must be positive. Rounded to nearest integer. |
| n | number | _(Optional)_ Number of levels to upgrade. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
**Returns:**

@ -9,7 +9,7 @@ Calculate the cost of upgrading hacknet node RAM.
**Signature:**
```typescript
getRamUpgradeCost(index: number, n: number): number;
getRamUpgradeCost(index: number, n?: number): number;
```
## Parameters
@ -17,7 +17,7 @@ getRamUpgradeCost(index: number, n: number): number;
| Parameter | Type | Description |
| --- | --- | --- |
| index | number | Index/Identifier of Hacknet Node. |
| n | number | Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. |
| n | number | _(Optional)_ Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
**Returns:**

@ -9,7 +9,7 @@ Upgrade the cache of a hacknet node.
**Signature:**
```typescript
upgradeCache(index: number, n: number): boolean;
upgradeCache(index: number, n?: number): boolean;
```
## Parameters
@ -17,7 +17,7 @@ upgradeCache(index: number, n: number): boolean;
| Parameter | Type | Description |
| --- | --- | --- |
| index | number | Index/Identifier of Hacknet Node. |
| n | number | Number of cache levels to purchase. Must be positive. Rounded to nearest integer. |
| n | number | _(Optional)_ Number of cache levels to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
**Returns:**

@ -9,7 +9,7 @@ Upgrade the core of a hacknet node.
**Signature:**
```typescript
upgradeCore(index: number, n: number): boolean;
upgradeCore(index: number, n?: number): boolean;
```
## Parameters
@ -17,7 +17,7 @@ upgradeCore(index: number, n: number): boolean;
| Parameter | Type | Description |
| --- | --- | --- |
| index | number | Index/Identifier of Hacknet Node. |
| n | number | Number of cores to purchase. Must be positive. Rounded to nearest integer. |
| n | number | _(Optional)_ Number of cores to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
**Returns:**

@ -9,7 +9,7 @@ Upgrade the level of a hacknet node.
**Signature:**
```typescript
upgradeLevel(index: number, n: number): boolean;
upgradeLevel(index: number, n?: number): boolean;
```
## Parameters
@ -17,7 +17,7 @@ upgradeLevel(index: number, n: number): boolean;
| Parameter | Type | Description |
| --- | --- | --- |
| index | number | Index/Identifier of Hacknet Node. |
| n | number | Number of levels to purchase. Must be positive. Rounded to nearest integer. |
| n | number | _(Optional)_ Number of levels to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
**Returns:**

@ -9,7 +9,7 @@ Upgrade the RAM of a hacknet node.
**Signature:**
```typescript
upgradeRam(index: number, n: number): boolean;
upgradeRam(index: number, n?: number): boolean;
```
## Parameters
@ -17,7 +17,7 @@ upgradeRam(index: number, n: number): boolean;
| Parameter | Type | Description |
| --- | --- | --- |
| index | number | Index/Identifier of Hacknet Node. |
| n | number | Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. |
| n | number | _(Optional)_ Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified. |
**Returns:**

@ -2405,10 +2405,10 @@ export interface Hacknet {
* Returns false otherwise.
*
* @param index - Index/Identifier of Hacknet Node.
* @param n - Number of levels to purchase. Must be positive. Rounded to nearest integer.
* @param n - Number of levels to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
* @returns True if the Hacknet Nodes level is successfully upgraded, false otherwise.
*/
upgradeLevel(index: number, n: number): boolean;
upgradeLevel(index: number, n?: number): boolean;
/**
* Upgrade the RAM of a hacknet node.
@ -2425,10 +2425,10 @@ export interface Hacknet {
* Returns false otherwise.
*
* @param index - Index/Identifier of Hacknet Node.
* @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.
* @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
* @returns True if the Hacknet Nodes RAM is successfully upgraded, false otherwise.
*/
upgradeRam(index: number, n: number): boolean;
upgradeRam(index: number, n?: number): boolean;
/**
* Upgrade the core of a hacknet node.
@ -2443,10 +2443,10 @@ export interface Hacknet {
* Returns false otherwise.
*
* @param index - Index/Identifier of Hacknet Node.
* @param n - Number of cores to purchase. Must be positive. Rounded to nearest integer.
* @param n - Number of cores to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
* @returns True if the Hacknet Nodes cores are successfully purchased, false otherwise.
*/
upgradeCore(index: number, n: number): boolean;
upgradeCore(index: number, n?: number): boolean;
/**
* Upgrade the cache of a hacknet node.
@ -2463,10 +2463,10 @@ export interface Hacknet {
* Returns false otherwise.
*
* @param index - Index/Identifier of Hacknet Node.
* @param n - Number of cache levels to purchase. Must be positive. Rounded to nearest integer.
* @param n - Number of cache levels to purchase. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
* @returns True if the Hacknet Nodes cache level is successfully upgraded, false otherwise.
*/
upgradeCache(index: number, n: number): boolean;
upgradeCache(index: number, n?: number): boolean;
/**
* Calculate the cost of upgrading hacknet node levels.
@ -2479,10 +2479,10 @@ export interface Hacknet {
* If the specified Hacknet Node is already at max level, then Infinity is returned.
*
* @param index - Index/Identifier of Hacknet Node.
* @param n - Number of levels to upgrade. Must be positive. Rounded to nearest integer.
* @param n - Number of levels to upgrade. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
* @returns Cost of upgrading the specified Hacknet Node.
*/
getLevelUpgradeCost(index: number, n: number): number;
getLevelUpgradeCost(index: number, n?: number): number;
/**
* Calculate the cost of upgrading hacknet node RAM.
@ -2495,10 +2495,10 @@ export interface Hacknet {
* If the specified Hacknet Node already has max RAM, then Infinity is returned.
*
* @param index - Index/Identifier of Hacknet Node.
* @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.
* @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
* @returns Cost of upgrading the specified Hacknet Node's RAM.
*/
getRamUpgradeCost(index: number, n: number): number;
getRamUpgradeCost(index: number, n?: number): number;
/**
* Calculate the cost of upgrading hacknet node cores.
@ -2511,10 +2511,10 @@ export interface Hacknet {
* If the specified Hacknet Node is already at max level, then Infinity is returned.
*
* @param index - Index/Identifier of Hacknet Node.
* @param n - Number of times to upgrade cores. Must be positive. Rounded to nearest integer.
* @param n - Number of times to upgrade cores. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
* @returns Cost of upgrading the specified Hacknet Node's number of cores.
*/
getCoreUpgradeCost(index: number, n: number): number;
getCoreUpgradeCost(index: number, n?: number): number;
/**
* Calculate the cost of upgrading hacknet node cache.
@ -2529,10 +2529,10 @@ export interface Hacknet {
* If the specified Hacknet Node is already at max level, then Infinity is returned.
*
* @param index - Index/Identifier of Hacknet Node.
* @param n - Number of times to upgrade cache. Must be positive. Rounded to nearest integer.
* @param n - Number of times to upgrade cache. Must be positive. Rounded to nearest integer. Defaults to 1 if not specified.
* @returns Cost of upgrading the specified Hacknet Node's cache.
*/
getCacheUpgradeCost(index: number, n: number): number;
getCacheUpgradeCost(index: number, n?: number): number;
/**
* Get the total number of hashes stored.