rm more anys

This commit is contained in:
Olivier Gagnon 2022-07-19 21:53:43 -04:00
parent 249242a0a3
commit 810f3a87b9
5 changed files with 14 additions and 17 deletions

@ -70,7 +70,7 @@ export class PlayerObject implements IPlayer {
moneySourceB: MoneySourceTracker; moneySourceB: MoneySourceTracker;
playtimeSinceLastAug: number; playtimeSinceLastAug: number;
playtimeSinceLastBitnode: number; playtimeSinceLastBitnode: number;
purchasedServers: any[]; purchasedServers: string[];
queuedAugmentations: IPlayerOwnedAugmentation[]; queuedAugmentations: IPlayerOwnedAugmentation[];
scriptProdSinceLastAug: number; scriptProdSinceLastAug: number;
sleeves: Sleeve[]; sleeves: Sleeve[];

@ -69,8 +69,6 @@ interface IServerMetadata {
* A "unique" server that has special implications when the player manually hacks it. * A "unique" server that has special implications when the player manually hacks it.
*/ */
specialName?: string; specialName?: string;
[key: string]: any;
} }
/** /**

@ -34,7 +34,7 @@ export function exportScripts(pattern: string, server: BaseServer): void {
// Return an error if no files matched, rather than an empty zip folder // Return an error if no files matched, rather than an empty zip folder
if (Object.keys(zip.files).length == 0) throw new Error(`No files match the pattern ${pattern}`); if (Object.keys(zip.files).length == 0) throw new Error(`No files match the pattern ${pattern}`);
const zipFn = `bitburner${isScriptFilename(pattern) ? "Scripts" : pattern === "*.txt" ? "Texts" : "Files"}.zip`; const zipFn = `bitburner${isScriptFilename(pattern) ? "Scripts" : pattern === "*.txt" ? "Texts" : "Files"}.zip`;
zip.generateAsync({ type: "blob" }).then((content: any) => FileSaver.saveAs(content, zipFn)); zip.generateAsync({ type: "blob" }).then((content: Blob) => FileSaver.saveAs(content, zipFn));
} }
export function download( export function download(

@ -8,18 +8,17 @@ import { BaseServer } from "../../Server/BaseServer";
import { evaluateDirectoryPath, getFirstParentDirectory, isValidDirectoryPath } from "../DirectoryHelpers"; import { evaluateDirectoryPath, getFirstParentDirectory, isValidDirectoryPath } from "../DirectoryHelpers";
import { IRouter } from "../../ui/Router"; import { IRouter } from "../../ui/Router";
import { ITerminal } from "../ITerminal"; import { ITerminal } from "../ITerminal";
import * as libarg from "arg"; import libarg from "arg";
import { showLiterature } from "../../Literature/LiteratureHelpers"; import { showLiterature } from "../../Literature/LiteratureHelpers";
import { MessageFilenames, showMessage } from "../../Message/MessageHelpers"; import { MessageFilenames, showMessage } from "../../Message/MessageHelpers";
import { ScriptArg } from "../../Netscript/ScriptArg";
export function ls( export function ls(terminal: ITerminal, router: IRouter, player: IPlayer, server: BaseServer, args: ScriptArg[]): void {
terminal: ITerminal, interface LSFlags {
router: IRouter, ["-l"]: boolean;
player: IPlayer, ["--grep"]: string;
server: BaseServer, }
args: (string | number | boolean)[], let flags: LSFlags;
): void {
let flags;
try { try {
flags = libarg( flags = libarg(
{ {
@ -235,7 +234,7 @@ export function ls(
segments: string[]; segments: string[];
} }
function postSegments(group: FileGroup, flags: any): void { function postSegments(group: FileGroup, flags: LSFlags): void {
const segments = group.segments; const segments = group.segments;
const linked = group.type === FileType.Script || group.type === FileType.Message; const linked = group.type === FileType.Script || group.type === FileType.Message;
const maxLength = Math.max(...segments.map((s) => s.length)) + 1; const maxLength = Math.max(...segments.map((s) => s.length)) + 1;

@ -25,12 +25,12 @@ export function wget(
} }
$.get( $.get(
url, url,
function (data: any) { function (data: unknown) {
let res; let res;
if (isScriptFilename(target)) { if (isScriptFilename(target)) {
res = server.writeToScriptFile(player, target, data); res = server.writeToScriptFile(player, target, String(data));
} else { } else {
res = server.writeToTextFile(target, data); res = server.writeToTextFile(target, String(data));
} }
if (!res.success) { if (!res.success) {
return terminal.error("wget failed"); return terminal.error("wget failed");