bpf
@steelbrain/babel-plugin-flow-to-typescript
npm i @steelbrain/babel-plugin-flow-to-typescript
bpf

@steelbrain/babel-plugin-flow-to-typescript

Babel plugin to convert Flow code into TypeScript

by Yuichiro Kikura

0.7.0 (see all)License:MITTypeScript:Not Found
npm i @steelbrain/babel-plugin-flow-to-typescript
Readme

babel-plugin-flow-to-typescript

Babel plugin to convert Flow code into TypeScript

How to use

$ yarn global add @babel/cli
$ yarn add @steelbrain/babel-plugin-flow-to-typescript

# you must use babel@^7.x.x
$ babel --version
7.0.0-beta.44 (@babel/core 7.0.0-beta.44)

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

Implementation status

Supported?SyntaxFlowTypeScript
Maybe typelet a:?numberlet a: number \| null \| undefined
Void typevoidvoid
Object typeObjectobject
Mixed typemixedunknown
Function type(A, B) => C(x1: A, x2: B) => C
Exact type{\| a: A \|}{ a: A }
Indexers{ [A]: B }{ [a: A]: B }
Existential typeMap<*, *>Map<any, any>
Opaque typesopaque type A = Btype A = B
Varianceinterface A { +b: B, -c: C }interface A { readonly b: B, c: C }
Type parameter boundsfunction f<A: string>(a:A){}function f<A extends string>(a:A){}
Cast(a: A)(a as A)
type/typeof importimport 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]
typeof operatortypeof footypeof foo
JSX--
Tuple type[number, string][number, string]
Exact type`{a: T
Type aliastype A = stringtype A = string
Flow Ignore$FlowFixMeany
Interfacesinterface X { +prop: string }interface X { readonly prop: string }
Optional Membersa?.ba == null ? null : a.b == null ? null : a.b
Declare functionsdeclare function x(false): true;function x(x0: false): true;

Downloads/wk

18

GitHub Stars

161

LAST COMMIT

3yrs ago

MAINTAINERS

1

CONTRIBUTORS

10

OPEN ISSUES

4

OPEN PRs

12
VersionTagPublished
0.7.0
latest
3yrs ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate