From 4f219a32143dbbbd7e77eba84ac2c9d1a7826726 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Fri, 24 Sep 2021 16:37:42 -0400 Subject: [PATCH] convert to ts --- src/RedPill.d.ts | 3 --- src/{RedPill.jsx => RedPill.tsx} | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 src/RedPill.d.ts rename src/{RedPill.jsx => RedPill.tsx} (90%) diff --git a/src/RedPill.d.ts b/src/RedPill.d.ts deleted file mode 100644 index b9909c1d1..000000000 --- a/src/RedPill.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare let redPillFlag: boolean; -export declare function enterBitNode(router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number); -export declare function setRedPillFlag(b: boolean): void; diff --git a/src/RedPill.jsx b/src/RedPill.tsx similarity index 90% rename from src/RedPill.jsx rename to src/RedPill.tsx index 768175910..fc479b3f5 100644 --- a/src/RedPill.jsx +++ b/src/RedPill.tsx @@ -8,14 +8,15 @@ import { SourceFileFlags } from "./SourceFile/SourceFileFlags"; import { SourceFiles } from "./SourceFile/SourceFiles"; import { dialogBoxCreate } from "../utils/DialogBox"; +import { IRouter } from "./ui/Router"; export let redPillFlag = false; -export function setRedPillFlag(b) { +export function setRedPillFlag(b: boolean): void { redPillFlag = b; } -function giveSourceFile(bitNodeNumber) { +function giveSourceFile(bitNodeNumber: number): void { var sourceFileKey = "SourceFile" + bitNodeNumber.toString(); var sourceFile = SourceFiles[sourceFileKey]; if (sourceFile == null) { @@ -62,7 +63,7 @@ function giveSourceFile(bitNodeNumber) { } } -export function enterBitNode(router, flume, destroyedBitNode, newBitNode) { +export function enterBitNode(router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number): void { if (!flume) { giveSourceFile(destroyedBitNode); } else {