adding types to frontend.ts

The only remaining implicit 'any's are the Stats types, which
Typescript is having trouble seeing from the node.d.ts file.