Kotlin / dukat

Converter of <any kind of declarations> to Kotlin external declarations
554 stars 43 forks source link

@types/react converts with lot of issues. #193

Open a-tsvil opened 7 years ago

a-tsvil commented 7 years ago

Kotlin files with types for react converted from @types/react

have a lot of issues,

Conversion logs

react Converting node_modules/@types/react/index.d.ts ts2kt: "NamespaceExportDeclaration" kind unsupported yet here! (node_modules/@types/react/index.d.ts:31:16 to 32:27) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:40:30 to 40:31) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:40:33 to 40:76) ts2kt: "Identifier" kind unsupported yet here! (node_modules/@types/react/index.d.ts:140:20 to 140:30) ts2kt: "Identifier" kind unsupported yet here! (node_modules/@types/react/index.d.ts:142:20 to 142:29) ts2kt: "Identifier" kind unsupported yet here! (node_modules/@types/react/index.d.ts:156:20 to 156:30) ts2kt: "Identifier" kind unsupported yet here! (node_modules/@types/react/index.d.ts:160:20 to 160:29) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:237:32 to 237:40) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:237:48 to 237:77) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:263:32 to 263:40) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:263:48 to 263:68) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:265:39 to 265:47) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:265:55 to 269:6) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:279:20 to 279:21) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:279:23 to 279:46) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:280:40 to 281:61) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:281:62 to 281:88) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:281:88 to 282:38) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:282:38 to 283:43) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:283:43 to 284:35) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:284:35 to 285:30) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:288:36 to 295:6) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:297:43 to 297:44) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:297:52 to 300:6) ts2kt: "StringLiteral" kind unsupported yet here! (node_modules/@types/react/index.d.ts:3256:85 to 3257:14) ts2kt: "ComputedPropertyName" kind unsupported yet here! (node_modules/@types/react/index.d.ts:3298:30 to 3298:41) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:3298:41 to 3298:43) ts2kt: "ExpressionStatement" kind unsupported yet here! (node_modules/@types/react/index.d.ts:3298:46 to 3298:62) ts2kt: "StringLiteral" kind unsupported yet here! (node_modules/@types/react/index.d.ts:3485:99 to 3486:18) ts2kt: Can't merge classifiers with different type parameters -- klass: open class Component<P, S>(props: P? = definedExternally /* null */, context: Any? = defi nedExternally /* null */) { open fun <K : keyof, S> setState(f: (prevState: S, props: P) -> Pick<S, K>, callback: (() -> Any)? = definedExternally /* null */): Unit = definedExternally open fun <K : keyof, S> setState(state: Pick<S, K>, callback: (() -> Any)? = definedExternally /* null */): Unit = definedExternally open fun forceUpdate(callBack: (() -> Any)? = definedExternally /* null */): Unit = definedExternally open fun render(): dynamic /* JSX.Element | Nothing? | Any /* "null" */ */ = definedExternally open var props: Readonly<T$0> /* Readonly<T$0> & Readonly<P> */ = definedExternally open var state: Readonly<S> = definedExternally open var context: Any = definedExternally open var refs:T$1` = definedExternally } , iface: interface Component

Save declarations: types/react/index.kt types/react/index.React.kt types/react/index.global.JSX.kt`

react-dom

ts2kt version: 0.0.14 Converting node_modules/@types/react-dom/index.d.ts ts2kt: "NamespaceExportDeclaration" kind unsupported yet here! (node_modules/@types/react-dom/index.d.ts:1:1 to 10:30) ts2kt: "ImportDeclaration" kind unsupported yet here! (node_modules/@types/react-dom/index.d.ts:10:30 to 16:16) Nothing was converted

a-tsvil commented 7 years ago

Build output from Idea build

Also there is was comma in annotation at line 2 @file:[JsQualifier("React"), JsModule("React")]