wish js had types