Place js type function in seperate file