mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
typefix netscriptFunctions (see desc)
* Types for InternalFunction and ExternalFunction have been modified to actually typecheck ns functions against docs. * Internal functions are required to use unknown for any params on the inner function. * Return types for internal function inner-function must match the respective external function. * Added new typecheck assertion function for asserting dynamic object types, to allow unknownifying params that were previously hardcoded objec structures. * Because type assertion for parameter types and return types is enforced by InternalAPI, removed all duplicate type declarations on NetscriptFunction params and returns.
This commit is contained in:
6
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
6
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -961,7 +961,7 @@ export interface NetscriptPort {
|
||||
*
|
||||
* @returns The data popped off the queue if it was full.
|
||||
*/
|
||||
write(value: string | number): null | string | number;
|
||||
write(value: string | number): PortData | null;
|
||||
|
||||
/**
|
||||
* Attempt to write data to the port.
|
||||
@@ -981,7 +981,7 @@ export interface NetscriptPort {
|
||||
* If the port is empty, then the string “NULL PORT DATA” will be returned.
|
||||
* @returns the data read.
|
||||
*/
|
||||
read(): string | number;
|
||||
read(): PortData;
|
||||
|
||||
/**
|
||||
* Retrieve the first element from the port without removing it.
|
||||
@@ -993,7 +993,7 @@ export interface NetscriptPort {
|
||||
* the port is empty, the string “NULL PORT DATA” will be returned.
|
||||
* @returns the data read
|
||||
*/
|
||||
peek(): string | number;
|
||||
peek(): PortData;
|
||||
|
||||
/**
|
||||
* Check if the port is full.
|
||||
|
||||
Reference in New Issue
Block a user