Add and use typescript definitions for packets