Call your PureScript code from TypeScript.
- Getting Started Guide
- API Docs on Pursuit
- FAQs
- Type Comparison PureScript vs. TypeScript
- Demo repo
- Blog post: PureScript's foreign Functions less foreign (explains usage of ts-bridge for FFI)
spago install ts-bridge
Some TypeScript - PureScript ping pong ...
- Fully customizable via a user defined type class pattern
- Many default implementations to pick from (Primitives, Records, Variants, ...)
- Opaque types (implemented as branded types in TypeScript)
- Easily accessible Newtypes
- Module resolution
- Polymorphic types optimized for best type inference in TS
- Tried and tested in production
Via type classes a set of types are defined that you'd like to support to export to TypeScript.
The library creates an extra CLI entry point to your app, which generates types for given values of those types. They get written to the file system in the form of TypeScript type declaration (.d.ts
) files.
- purescript-tsd-gen This project follows a different approach for type generation. It extracts TypeScript types from the PureScript CST. As such the process is more automated but less customizable.
If you find a bug or have a feature idea feel free to make a PR or file an issue.