added enum support and fixed js doc