Topdown TypeScript Redstone

One of the projects I made and I'm proud of is a Nuclear Throne mod, that adds a topdown variant of Minecraft's redstone to the game. I knew it would have been absolutely useless, but it was a fun idea, interesting to program, optimize and port to TypeScript, which is the version you are currently seeing.
The avaliable pieces are:
The only difference with the NT mod is that torches aren't there, there are just levers switched on.

Torches, levers and powered dusts power adiacent non-powered dusts and pistons.
When powered, piston push the piece in from of him, and all the pieces behind it, and when it pulls back it also makes all the pieces in line stick.
Blocks are not affected by but can still be pushed by pistons, like all the other pieces.


A piston cannot be powered from the direction that he is supposed to push to.


Those were the main rules that the simulation follows. There are not many things that it can do, but one of those is an AND gate:


And if it can do that, it can also do a calculator.


This one can calculate the sum of two numbers from 0 to 15. It was actually "generated" by the GetFA function in the index.js that I just ran on your browser. Just by changing the function's parameter from 4 to 8, the calculator will be able to add together numbers up to 255.