actually adding defn files, also converted node.ts
fixing isDirectory usage