All Projects â†’ rrdelaney â†’ Reasonablytyped

rrdelaney / Reasonablytyped

Licence: mit
💠 Converts Flow and TypeScript definitions to Reason interfaces

Programming Languages

typescript
32286 projects
ocaml
1615 projects
flowtype
47 projects
bucklescript
41 projects

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
Reason React
Reason bindings for ReactJS
Stars: ✭ 3,140 (+498.1%)
Mutual labels:  reasonml
Crra
Create Reason React App
Stars: ✭ 384 (-26.86%)
Mutual labels:  reasonml
Learn Reasonml Workshop
Learn ReasonML with 24 exercises. No prior functional programming knowledge required.
Stars: ✭ 265 (-49.52%)
Mutual labels:  reasonml
Reform
Reasonably making forms sound good 🛠
Stars: ✭ 282 (-46.29%)
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
Isolate
Lightweight image browser
Stars: ✭ 284 (-45.9%)
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
Reasonml Idea Plugin
ReasonML Language Plugin for IDEA
Stars: ✭ 273 (-48%)
Mutual labels:  reasonml
Fnm
🚀 Fast and simple Node.js version manager, built in Rust
Stars: ✭ 6,102 (+1062.29%)
Mutual labels:  reasonml
Bs Jest
BuckleScript bindings for Jest
Stars: ✭ 255 (-51.43%)
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
Reductive
Redux in Reason
Stars: ✭ 405 (-22.86%)
Mutual labels:  reasonml
Reason Tools
Adds Reason to the browser
Stars: ✭ 366 (-30.29%)
Mutual labels:  reasonml

  $ npm install --global reasonably-typed

Converts TypeScript and Flow definitions to Reason interfaces
(Also maybe TypeScript definitions to Flow)


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

Examples

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

CircleCI

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].