mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 17:53:00 +02:00
v2.2.1 (#293)
* handle enums differently * Enums are frozen and fed directly to the proxy * Enums are not included in the NSFull definition, allowing samekeys for RamCostTree<API>, InternalAPI<API>, and ExternalAPI<API> * Rewrote a lot of the ramcalc test, with better typing thanks to the samekeys above * Fix ns1 for proxy (args, pid, and enums after above changes were not being added to ns1 scripts.) * Fixed an overview issue where the bars could display inaccurately. Update changelog and bump version to 2.2.1
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import { Player } from "@player";
|
||||
import { NSFull } from "../NetscriptFunctions";
|
||||
|
||||
/** This type assumes any value that isn't an API layer or a function has been omitted (enum) */
|
||||
type RamCostTree<API> = Omit<
|
||||
{
|
||||
[Property in keyof API]: API[Property] extends () => unknown ? number | (() => number) : RamCostTree<API[Property]>;
|
||||
},
|
||||
"enums"
|
||||
>;
|
||||
/** The API does not include enums, args, or pid. */
|
||||
export type RamCostTree<API> = {
|
||||
[key in keyof API]: API[key] extends () => unknown ? number | (() => number) : RamCostTree<API[key]>;
|
||||
};
|
||||
|
||||
/** Constants for assigning costs to ns functions */
|
||||
export const RamCostConstants = {
|
||||
|
||||
Reference in New Issue
Block a user