mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +02:00
DOCUMENTATION: Fix wrong param/return type and clarify ns.sleep, ns.asleep, ns.singularity.exportGame (#2242)
This commit is contained in:
@@ -9,14 +9,14 @@ Suspends the script for n milliseconds. Doesn't block with concurrent calls.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
asleep(millis: number): Promise<true>;
|
asleep(millis?: number): Promise<true>;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| millis | number | Number of milliseconds to sleep. |
|
| millis | number | _(Optional)_ Number of milliseconds to sleep. Default to 0. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
@@ -28,3 +28,5 @@ A promise that resolves to true when the sleep is completed.
|
|||||||
|
|
||||||
RAM cost: 0 GB
|
RAM cost: 0 GB
|
||||||
|
|
||||||
|
Note that the actual delay may be longer than intended. For more information, please check https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout\#delay.
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ Suspends the script for n milliseconds.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
sleep(millis: number): Promise<true>;
|
sleep(millis?: number): Promise<true>;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| millis | number | Number of milliseconds to sleep. |
|
| millis | number | _(Optional)_ Number of milliseconds to sleep. Default to 0. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
@@ -28,6 +28,8 @@ A promise that resolves to true when the sleep is completed.
|
|||||||
|
|
||||||
RAM cost: 0 GB
|
RAM cost: 0 GB
|
||||||
|
|
||||||
|
Note that the actual delay may be longer than intended. For more information, please check https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout\#delay.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ Backup game save.
|
|||||||
**Signature:**
|
**Signature:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
exportGame(): void;
|
exportGame(): Promise<void>;
|
||||||
```
|
```
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
void
|
Promise<void>
|
||||||
|
|
||||||
## Remarks
|
## Remarks
|
||||||
|
|
||||||
|
|||||||
16
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
16
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -1862,7 +1862,7 @@ export interface Singularity {
|
|||||||
* This function will automatically open the backup save prompt and claim the free faction favour if available.
|
* This function will automatically open the backup save prompt and claim the free faction favour if available.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
exportGame(): void;
|
exportGame(): Promise<void>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns Backup save bonus availability.
|
* Returns Backup save bonus availability.
|
||||||
@@ -6528,7 +6528,10 @@ export interface NS {
|
|||||||
* @remarks
|
* @remarks
|
||||||
* RAM cost: 0 GB
|
* RAM cost: 0 GB
|
||||||
*
|
*
|
||||||
* @param millis - Number of milliseconds to sleep.
|
* Note that the actual delay may be longer than intended. For more information, please check
|
||||||
|
* https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout#delay.
|
||||||
|
*
|
||||||
|
* @param millis - Number of milliseconds to sleep. Default to 0.
|
||||||
* @example
|
* @example
|
||||||
* ```js
|
* ```js
|
||||||
* // This will count from 1 to 10 in your terminal, with one number every 5 seconds
|
* // This will count from 1 to 10 in your terminal, with one number every 5 seconds
|
||||||
@@ -6539,17 +6542,20 @@ export interface NS {
|
|||||||
* ```
|
* ```
|
||||||
* @returns A promise that resolves to true when the sleep is completed.
|
* @returns A promise that resolves to true when the sleep is completed.
|
||||||
*/
|
*/
|
||||||
sleep(millis: number): Promise<true>;
|
sleep(millis?: number): Promise<true>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Suspends the script for n milliseconds. Doesn't block with concurrent calls.
|
* Suspends the script for n milliseconds. Doesn't block with concurrent calls.
|
||||||
* @remarks
|
* @remarks
|
||||||
* RAM cost: 0 GB
|
* RAM cost: 0 GB
|
||||||
*
|
*
|
||||||
* @param millis - Number of milliseconds to sleep.
|
* Note that the actual delay may be longer than intended. For more information, please check
|
||||||
|
* https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout#delay.
|
||||||
|
*
|
||||||
|
* @param millis - Number of milliseconds to sleep. Default to 0.
|
||||||
* @returns A promise that resolves to true when the sleep is completed.
|
* @returns A promise that resolves to true when the sleep is completed.
|
||||||
*/
|
*/
|
||||||
asleep(millis: number): Promise<true>;
|
asleep(millis?: number): Promise<true>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints one or more values or variables to the script’s logs.
|
* Prints one or more values or variables to the script’s logs.
|
||||||
|
|||||||
Reference in New Issue
Block a user