Merge pull request #1 from wcandillon/ts

apply() implementation
Typescript integration