gray-adeyi / paystack-sdk

A paystack client SDK for the javascript runtime.
MIT License
5 stars 0 forks source link

Convert `PaystackResponse` to a generic type #34

Open gray-adeyi opened 2 hours ago

gray-adeyi commented 2 hours ago

The current PaystackResponse.data field is Record<string, any> | Record<string, any>[] | null which leaves the consumer of the package to implement the types of the returned data, in plans to support type inference for arbitrary types like Transaction, Plan, Subscription e.t.c in future releases modify PaystackResponse to allow the data field to be a generic type so that when e.g. a transaction type is defined, it may be annotated as PaystackResponse<Transaction>, PaystackResponse<Record<string, any>>

gray-adeyi commented 2 hours ago

All pull requests should be send to the dev branch