Typescript port of LillyPad