mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 14:59:16 +02:00
nuke some use of any
This commit is contained in:
@@ -17,7 +17,7 @@ import {
|
||||
import { HacknetNodeConstants } from "./data/Constants";
|
||||
|
||||
import { dialogBoxCreate } from "../ui/React/DialogBox";
|
||||
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver";
|
||||
import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../utils/JSONReviver";
|
||||
import { ObjectValidator, minMax } from "../utils/Validator";
|
||||
|
||||
export class HacknetNode implements IHacknetNode {
|
||||
@@ -123,15 +123,14 @@ export class HacknetNode implements IHacknetNode {
|
||||
/**
|
||||
* Serialize the current object to a JSON save state.
|
||||
*/
|
||||
toJSON(): any {
|
||||
toJSON(): IReviverValue {
|
||||
return Generic_toJSON("HacknetNode", this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiatizes a HacknetNode object from a JSON save state.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
static fromJSON(value: any): HacknetNode {
|
||||
static fromJSON(value: IReviverValue): HacknetNode {
|
||||
return Generic_fromJSON(HacknetNode, value.data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
|
||||
import { createRandomIp } from "../utils/IPAddress";
|
||||
|
||||
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver";
|
||||
import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../utils/JSONReviver";
|
||||
import { IPlayer } from "../PersonObjects/IPlayer";
|
||||
|
||||
interface IConstructorParams {
|
||||
@@ -145,13 +145,12 @@ export class HacknetServer extends BaseServer implements IHacknetNode {
|
||||
}
|
||||
|
||||
// Serialize the current object to a JSON save state
|
||||
toJSON(): any {
|
||||
toJSON(): IReviverValue {
|
||||
return Generic_toJSON("HacknetServer", this);
|
||||
}
|
||||
|
||||
// Initializes a HacknetServer Object from a JSON save state
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
static fromJSON(value: any): HacknetServer {
|
||||
static fromJSON(value: IReviverValue): HacknetServer {
|
||||
return Generic_fromJSON(HacknetServer, value.data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { HashUpgrades } from "./HashUpgrades";
|
||||
import { HashUpgrade } from "./HashUpgrade";
|
||||
|
||||
import { IMap } from "../types";
|
||||
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver";
|
||||
import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../utils/JSONReviver";
|
||||
|
||||
export class HashManager {
|
||||
// Max number of hashes this can hold. Equal to the sum of capacities of
|
||||
@@ -157,13 +157,12 @@ export class HashManager {
|
||||
}
|
||||
|
||||
//Serialize the current object to a JSON save state.
|
||||
toJSON(): any {
|
||||
toJSON(): IReviverValue {
|
||||
return Generic_toJSON("HashManager", this);
|
||||
}
|
||||
|
||||
// Initiatizes a HashManager object from a JSON save state.
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
static fromJSON(value: any): HashManager {
|
||||
static fromJSON(value: IReviverValue): HashManager {
|
||||
return Generic_fromJSON(HashManager, value.data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user