rrdelaney / Reasonablytyped
Licence: mit
💠Converts Flow and TypeScript definitions to Reason interfaces
Stars: ✠525
Programming Languages
Labels
Projects that are alternatives of or similar to Reasonablytyped
expo-reason-starter
This project allows you to quickly get started with building mobile apps in ReasonML/ReScript
Stars: ✠16 (-96.95%)
Mutual labels: reasonml
Learn Reasonml Workshop
Learn ReasonML with 24 exercises. No prior functional programming knowledge required.
Stars: ✠265 (-49.52%)
Mutual labels: reasonml
Hazel
Hazel, a live functional programming environment with typed holes
Stars: ✠340 (-35.24%)
Mutual labels: reasonml
resuggest
Discover ReasonML functions that do what you want. https://GuillaumeSalles.github.io/resuggest
Stars: ✠85 (-83.81%)
Mutual labels: reasonml
Renature
A physics-based animation library for React focused on modeling natural world forces.
Stars: ✠408 (-22.29%)
Mutual labels: reasonml
Reason Design Patterns
🗺 An unofficial collection of "design patterns" for Reason and OCaml
Stars: ✠379 (-27.81%)
Mutual labels: reasonml
React Recomponent
🥫 Reason-style reducer components for React using ES6 classes.
Stars: ✠272 (-48.19%)
Mutual labels: reasonml
Fnm
🚀 Fast and simple Node.js version manager, built in Rust
Stars: ✠6,102 (+1062.29%)
Mutual labels: reasonml
Sketch Sh
Sketch.sh - Online Code Editor and ReasonML community
Stars: ✠403 (-23.24%)
Mutual labels: reasonml
respect
RSpec inspired test framework for Reason/OCaml/Bucklescript.
Stars: ✠28 (-94.67%)
Mutual labels: reasonml
Graphql ppx
GraphQL PPX rewriter for Bucklescript/ReasonML
Stars: ✠325 (-38.1%)
Mutual labels: reasonml
Brisk
✨Cross-platform set of tools for building native UIs with Reason/OCaml
Stars: ✠518 (-1.33%)
Mutual labels: reasonml
$ npm install --global reasonably-typed
(Also maybe TypeScript definitions to Flow)
Converts TypeScript and Flow definitions to Reason interfaces
Take your Flow or TypeScript definition
// class.js
declare module 'classes' {
declare type State = {
id: number,
storeName: string,
}
declare export class Store {
constructor(initialState: State): Store;
state: State;
update(nextState: State): void;
}
}
Run retyped
$ retyped class.js
Get Reason
/* Module classes */
type state = {. "id": float, "storeName": string };
module Store = {
type t = {. "state": (state), "update": [@bs.meth](state => unit)};
[@bs.new] [@bs.module "classes"] external make : state => t = "Store";
};
Docs
TypeScript
TypeScript has a similar workflow. Compile your TypeScript file with:
$ retyped my-definition.d.ts
Command-line Usage
Usage:
$ retyped ...files
Examples:
$ retyped file1.js file2.js file3.d.ts [boolean]
Usage as a library
ReasonablyTyped also exports a library for use! See the example below:// lib-usage.js
import * as ReasonablyTyped from 'reasonably-typed'
const libSrc = fs.readFileSync('lib.js').toString()
const bsInterface = ReasonablyTyped.compile(libSrc)
format (code: string) => string
Formats a block of code using refmt
compile (code: string, filename?: string) => string
Compiles a libdef, formats the result, and handles errors cleanly
Development
See DEVELOPING and CONTRIBUTING.
Status
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].