Aaronius / penpal

A promise-based library for securely communicating with iframes via postMessage.
MIT License
381 stars 56 forks source link

Fixes typescript generics to be correct for the returned proxy object #50

Closed marlon-tucker closed 4 years ago

marlon-tucker commented 4 years ago

Apologies for creating extra work for you but I screwed up in the previous pull request.

I neglected the fact that the returned promise is an proxy object which all methods return a promise object.

This fixes the typescript typings so the generic argument is automatically mapped to a type which the following:

  1. Only has function properties
  2. All functions return a promise, with the correct inferred type.
Aaronius commented 4 years ago

Thanks @marlon-tucker.