convert to ts

This commit is contained in:
Olivier Gagnon 2021-09-24 16:37:42 -04:00
parent 2e05f14c0d
commit 4f219a3214
2 changed files with 4 additions and 6 deletions

3
src/RedPill.d.ts vendored

@ -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;

@ -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 {