scala-js-ts-importer icon indicating copy to clipboard operation
scala-js-ts-importer copied to clipboard

TypeScript Importer for Scala.js

Results 15 scala-js-ts-importer issues
Sort by recently updated
recently updated
newest added
trafficstars

Was exploring scalajs over the weekend, and somehow ended here before finding https://scalablytyped.org/docs/readme.html. It would be good to add a link there and archive this github repository.

this pr fixes #103 enum values can be expressions including - unary operators - binary operators - string and number literals - parenthesis - identifiers See: https://github.com/microsoft/TypeScript/blob/master/doc/spec.md#92-enum-members https://github.com/microsoft/TypeScript/blob/master/doc/spec.md#419-binary-operators **Note:** this...

I think it's a good idea to test against the DefinitelyTyped code base. This pr adds a spec that tries to import every project on DefinitelyTyped (output goes into a...

Enum members can have optional values. At the moment they are parsed by parsing a number or a string. The specification, however, allows full expressions, like ``` enum Test {...

When trying to convert typings for libraries like Vue or Vuetify, issues like the following seems to arise: Vue, [converting this file](https://github.com/vuejs/vue/blob/5e3823a5766da1df60481e1e7a20f36d08e716ce/types/index.d.ts) ``` amar@tekpro ~/repos/ext/scala-js-ts-importer master $ sbt 'run node_modules/vue/types/index.d.ts...

TypeScript has `foo?` notation to indicate *optional* (can be null/undefined) type * [optional field](https://www.typescriptlang.org/docs/handbook/interfaces.html#optional-properties) * [optional method parameter](https://www.typescriptlang.org/docs/handbook/functions.html#optional-and-default-parameters) Currently, scalajs-ts-importer converts `foo?: T;` into `foo: T` which can not accept...

```typescript export interface GPGPUProgram { variableNames: string[]; outputShape: number[]; params: Array; userCode: string; supportsBroadcasting?: boolean; } ``` generates ```scala @js.native trait GPGPUProgram extends js.Object { var variableNames: js.Array[String] = js.native...

`export const enum` doesn't seem to be handled. [Example](https://github.com/Microsoft/monaco-editor/blob/28e4b900b8f/monaco.d.ts#L3069) ``` Parse error at 3069.23 '`}'' expected but identifier RenderLineNumbersType found export const enum RenderLineNumbersType { ^ ```

I tried running on Monaco Editor and discovered the importer doesn't handle TS Type Guards. [Example](https://github.com/Microsoft/monaco-editor/blob/28e4b900b8f/monaco.d.ts#L81) ``` Parse error at 81.48 '`:'' expected but identifier PromiseLike found public static is(value:...

input: ```typescript declare module 'vscode' { export class Position { readonly line: number; readonly character: number; constructor(line: number, character: number); } } ``` https://github.com/Microsoft/vscode/blob/e74a6601c3714f98fc63102e8304b00c983b6167/src/vs/vscode.d.ts#L243-L267 output: ```scala @js.native @JSGlobal("vscode.Position") class Position...