Basic working impl.
Added typescript.