NuroDev / lemonsqueezy.ts

🍋 JavaScript / TypeScript SDK for the Lemon Squeezy API
https://paka.dev/npm/lemonsqueezy.ts
MIT License
159 stars 16 forks source link

[Feature Request] Export module's types #3

Closed madebyfabian closed 1 year ago

madebyfabian commented 1 year ago

Hey there! Love the module. Just a general request, I would love to reuse the types from this module in my application. For example I have a "Product" UI component which accepts a "productData" prop that is an object that should reflect the types.

Basically I would like to do:

import type { RetrieveProductResult } from 'lemonsqueezy.ts'

Thanks!

NuroDev commented 1 year ago

This is actually already achievable by importing from /types instead of the root / index import path. The reason why I have put the types into a export path & not in the root is because there is a LOT of types exported & I felt like it was spamming / clogging up the root export. This way the root export only exports the client class & all module functions.

import type { RetrieveProductResult } from 'lemonsqueezy.ts/types';
madebyfabian commented 1 year ago

@NuroDev Thanks!