• Stars
    star
    162
  • Rank 232,284 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Babel plugin to convert Flow code into TypeScript

babel-plugin-flow-to-typescript

Babel plugin to convert Flow code into TypeScript

How to use

$ npm install -g @babel/cli @babel/core
$ npm install babel-plugin-flow-to-typescript

# you must use babel@^7.x.x
$ babel --version
7.4.4 (@babel/core 7.4.5)

$ babel --plugins babel-plugin-flow-to-typescript ${SRC_FLOW_FILE} -o ${DEST_TS_FILE}

Implementation status

Supported? Syntax Flow TypeScript
Maybe type let a:?number let a: number | null | undefined
Void type void void
Object type Object object
Mixed type mixed unknown
Function type (A, B) => C (x1: A, x2: B) => C
Exact type {| a: A |} { a: A }
Indexers { [A]: B } { [a: A]: B }
Existential type Map<*, *> Map<any, any>
Opaque types opaque type A = B type A = B
Variance interface A { +b: B, -c: C } interface A { readonly b: B, c: C }
Type parameter bounds function f<A: string>(a:A){} function f<A extends string>(a:A){}
Cast (a: A) (a as A)
type/typeof import import type A from 'module' import A from 'module'
$Keys $Keys<X> keyof X
$Values $Values<X> X[keyof X]
$ReadOnly $Readonly<X> Readonly<X>
$Exact $Exact<X> X
$Diff $Diff<X, Y> Pick<X, Exclude<keyof X, keyof Y>>
$PropertyType $PropertyType<T, k> T[k]
$ElementType $ElementType<T, k> T[k]
$Shape $Shape<T> Partial<T>
Class Class<T> typeof T
typeof operator typeof foo typeof foo
JSX - -
Tuple type [number, string] [number, string]
Type alias type A = string type A = string
Flow Ignore $FlowFixMe any
Interfaces interface X { +prop: string } interface X { readonly prop: string }
Optional Members a?.b ...
Declare functions declare function x(false): true; function x(x0: false): true;
Declare Class ... ...

More Repositories

1

video-editor

Simple Video Editor for Windows / macOS / Linux based on Electron and web technologies.
TypeScript
23
star
2

neural-style-transfer-webdnn

Example of Neural Style Transfer (Johnson+, 2016) with [WebDNN](https://github.com/mil-tokyo/webdnn)
JavaScript
5
star
3

webgpu-test

WebGPU(WebMetal) Computing Shader Debug Tool
TypeScript
4
star
4

NicoPIP

ニコニコ動画をコメントも含めてPIP表示するためのウェブブラウザ拡張機能
TypeScript
3
star
5

Template-Typescript

Template for TypeScript projects
TypeScript
3
star
6

resume

My career resume
3
star
7

use-virtual-list

Minimal React hook for virtual list
JavaScript
2
star
8

TriggerStorage

Non-Spreadsheets Storage System Library for Google Apps Script(GAS)
JavaScript
2
star
9

packjs

packing javascript file to one file.
JavaScript
2
star
10

Template-ChromeExtension-TypeScript

Chrome Extension Template with TypeScript and Webpack
JavaScript
2
star
11

powerline-shell-installer

install/uninstall powerline-shell
Shell
2
star
12

Template-TypsScript

TypeScript Project Template
JavaScript
2
star
13

graph_report

chainer extension to output graph
Python
2
star
14

ci-20150824-programing

東京大学情報理工学系研究科創造情報学専攻の入試で提出した回答
JavaScript
2
star
15

Template-ExpressJS-TypeScript

ExpressJS Template with TypeScript
TypeScript
1
star
16

book-finder

TypeScript
1
star
17

qiita

qiitaのデータ解析
Python
1
star
18

ProcessSystemEngineering

C++
1
star
19

webdnn-yolo_v2

Python
1
star
20

adf2015Hackathon_KA

JavaScript
1
star
21

anitube

JavaScript
1
star
22

Template-Static-Website

Template-Static-Website
JavaScript
1
star
23

TerminalMessenger

Swift
1
star
24

keras-webdnn-binary_classification-example

Python
1
star
25

yt

JavaScript
1
star
26

aai

Python
1
star
27

VirtualList

仮想リストの解説 / Demo repository of virtualized list UI
TypeScript
1
star