haxiomic / dts2hx

Converts TypeScript definition files (d.ts) to haxe externs (.hx) via the TypeScript compiler API
MIT License
135 stars 9 forks source link

Errors when converting telegraf #82

Open andyli opened 3 years ago

andyli commented 3 years ago

Just reporting it in hope dts2hx will work out of the box for telegraf (4.0.0). Btw, dts2hx is super cool, please keep it up :)

> Converting module telegraf
> Error: [TypeScript 3.7] Cannot find name 'as'. (/workspace/node_modules/telegraf/typings/composer.d.ts:26:25)
> Error: [TypeScript 3.7] 'SnakeToCamelCase' only refers to a type, but is being used as a value here. (/workspace/node_modules/telegraf/typings/composer.d.ts:26:28)
> Error: [TypeScript 3.7] Cannot find name 'P'. (/workspace/node_modules/telegraf/typings/composer.d.ts:26:45)
> Error: [TypeScript 3.7] 'PropOr' only refers to a type, but is being used as a value here. (/workspace/node_modules/telegraf/typings/composer.d.ts:26:50)
> Error: [TypeScript 3.7] Cannot find name 'U'. (/workspace/node_modules/telegraf/typings/composer.d.ts:26:57)
> Error: [TypeScript 3.7] Cannot find name 'P'. (/workspace/node_modules/telegraf/typings/composer.d.ts:26:60)
> Error: [TypeScript 3.7] The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. (/workspace/node_modules/telegraf/typings/composer.d.ts:27:5)
> Error: [TypeScript 3.7] Cannot find name 'U'. (/workspace/node_modules/telegraf/typings/composer.d.ts:28:13)
> Error: [TypeScript 3.7] Cannot find name 'keyof'. (/workspace/node_modules/telegraf/typings/composer.d.ts:29:17)
> Error: [TypeScript 3.7] A rest element type must be an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:4:44)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:37:23)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:38:19)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:39:21)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:40:25)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:41:28)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:48:11)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:49:13)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:50:26)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:51:20)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:52:21)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:53:24)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:54:23)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:55:37)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:56:18)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:57:21)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:58:18)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:59:24)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:60:20)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:61:22)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:62:26)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:63:15)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:64:24)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:65:27)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:66:19)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:67:25)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:69:20)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:70:25)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:71:20)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:72:19)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:73:23)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:74:22)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:75:20)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:76:24)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:77:24)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:78:22)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:79:19)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:80:20)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:81:19)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:82:19)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:83:14)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:84:25)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:85:23)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:86:20)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:87:22)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:94:23)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:95:25)
> Error: [TypeScript 3.7] A rest parameter must be of an array type. (/workspace/node_modules/telegraf/typings/context.d.ts:96:21)
> Error: [TypeScript 3.7] Cannot find name 'infer'. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:71)
> Error: [TypeScript 3.7] Cannot find name 'T'. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:77)
> Error: [TypeScript 3.7] Cannot find name '_$'. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:79)
> Error: [TypeScript 3.7] Cannot find name 'infer'. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:82)
> Error: [TypeScript 3.7] Cannot find name 'U'. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:88)
> Error: [TypeScript 3.7] Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:95)
> Error: [TypeScript 3.7] Cannot find name 'T'. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:97)
> Error: [TypeScript 3.7] Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:99)
> Error: [TypeScript 3.7] Cannot find name 'Capitalize'. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:101)
> Error: [TypeScript 3.7] Cannot find name 'U'. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:129)
> Error: [TypeScript 3.7] Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:138)
> Error: [TypeScript 3.7] Cannot find name 'S'. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:140)
> Error: [TypeScript 3.7] String literal expected. (/workspace/node_modules/telegraf/typings/index.d.ts:6:10)
> Error: [TypeScript 3.7] Cannot find name 'Markup'. (/workspace/node_modules/telegraf/typings/index.d.ts:6:13)
> Error: [TypeScript 3.7] Cannot find name 'from'. (/workspace/node_modules/telegraf/typings/index.d.ts:6:20)
> Error: [TypeScript 3.7] String literal expected. (/workspace/node_modules/telegraf/typings/index.d.ts:8:10)
> Error: [TypeScript 3.7] Cannot find name 'Scenes'. (/workspace/node_modules/telegraf/typings/index.d.ts:8:13)
> Error: [TypeScript 3.7] Cannot find name 'from'. (/workspace/node_modules/telegraf/typings/index.d.ts:8:20)
> Error: [TypeScript 3.7] ']' expected. (/workspace/node_modules/telegraf/typings/composer.d.ts:26:25)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/composer.d.ts:26:28)
> Error: [TypeScript 3.7] '(' expected. (/workspace/node_modules/telegraf/typings/composer.d.ts:26:47)
> Error: [TypeScript 3.7] Argument expression expected. (/workspace/node_modules/telegraf/typings/composer.d.ts:26:48)
> Error: [TypeScript 3.7] '(' expected. (/workspace/node_modules/telegraf/typings/composer.d.ts:26:73)
> Error: [TypeScript 3.7] Declaration or statement expected. (/workspace/node_modules/telegraf/typings/composer.d.ts:27)
> Error: [TypeScript 3.7] Expression expected. (/workspace/node_modules/telegraf/typings/composer.d.ts:27:3)
> Error: [TypeScript 3.7] ',' expected. (/workspace/node_modules/telegraf/typings/composer.d.ts:28:14)
> Error: [TypeScript 3.7] ',' expected. (/workspace/node_modules/telegraf/typings/composer.d.ts:29:23)
> Error: [TypeScript 3.7] '(' expected. (/workspace/node_modules/telegraf/typings/composer.d.ts:29:45)
> Error: [TypeScript 3.7] Type expected. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:68)
> Error: [TypeScript 3.7] '}' expected. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:77)
> Error: [TypeScript 3.7] Declaration or statement expected. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:78)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:81)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:88)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:95)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:96)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:100)
> Error: [TypeScript 3.7] '(' expected. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:132)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:138)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:1:139)
> Error: [TypeScript 3.7] Unterminated template literal. (/workspace/node_modules/telegraf/typings/core/helpers/string.d.ts:2:37)
> Error: [TypeScript 3.7] 'from' expected. (/workspace/node_modules/telegraf/typings/index.d.ts:6:10)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/index.d.ts:6:13)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/index.d.ts:6:20)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/index.d.ts:6:25)
> Error: [TypeScript 3.7] 'from' expected. (/workspace/node_modules/telegraf/typings/index.d.ts:8:10)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/index.d.ts:8:13)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/index.d.ts:8:20)
> Error: [TypeScript 3.7] ';' expected. (/workspace/node_modules/telegraf/typings/index.d.ts:8:25)
> Saved externs for telegraf into lib/dts2hx/
haxiomic commented 3 years ago

Thanks for reporting @andyli, this looks to be because dts2hx is using 3.7 whereas these externs use ts 4 syntax, I was hoping typescript changes wouldn't happen so fast :P but oh well

Should be resolved when I upgrade the compiler to ts 4+