WIP .d.ts refactoring not compiling yet...