@mintplayer/polyglot-target-typescript 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintplayer/polyglot-target-typescript",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "MintPlayer Polyglot TypeScript / JavaScript target — a pure-JSON language plugin (spec + emission rules + capabilities + std bindings) for the polyglot transpiler.",
5
5
  "keywords": [
6
6
  "polyglot",
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "name": "typescript",
4
+ "crossDirImports": true,
4
5
  "capabilities": {},
5
6
  "spec": {
6
7
  "name": "typescript",
@@ -94,6 +95,10 @@
94
95
  "mutable": "let $x",
95
96
  "const": "const $x"
96
97
  },
98
+ "localDeclTyped": {
99
+ "mutable": "let $x: $T",
100
+ "const": "const $x: $T"
101
+ },
97
102
  "yield": {
98
103
  "value": "yield $x;",
99
104
  "empty": "return;"
@@ -2291,14 +2296,14 @@
2291
2296
  "when": [
2292
2297
  [
2293
2298
  { "eq": [ "item.isNamespace", "true" ] },
2294
- { "tmpl": [ "import * as ", { "get": "item.ns" }, " from \"./", { "get": "item.path" }, "\";" ] }
2299
+ { "tmpl": [ "import * as ", { "get": "item.ns" }, " from \"", { "get": "item.path" }, "\";" ] }
2295
2300
  ],
2296
2301
  [
2297
2302
  { "not": { "eq": [ "item.names", "" ] } },
2298
- { "tmpl": [ "import { ", { "get": "item.names" }, " } from \"./", { "get": "item.path" }, "\";" ] }
2303
+ { "tmpl": [ "import { ", { "get": "item.names" }, " } from \"", { "get": "item.path" }, "\";" ] }
2299
2304
  ]
2300
2305
  ],
2301
- "else": { "tmpl": [ "import \"./", { "get": "item.path" }, "\";" ] }
2306
+ "else": { "tmpl": [ "import \"", { "get": "item.path" }, "\";" ] }
2302
2307
  }
2303
2308
  }
2304
2309
  }
@@ -3051,10 +3056,11 @@
3051
3056
  },
3052
3057
  {
3053
3058
  "tmpl": [
3059
+ "(",
3054
3060
  {
3055
3061
  "type": "type.base"
3056
3062
  },
3057
- " | null"
3063
+ " | null)"
3058
3064
  ]
3059
3065
  }
3060
3066
  ],
@@ -3534,6 +3540,9 @@
3534
3540
  "Error.init": "new $T($0)",
3535
3541
  "Error.message": "$this.message",
3536
3542
  "Iterable.type": "Iterable<$0>",
3543
+ "Array.type": "$0[]",
3544
+ "Array.init": "[]",
3545
+ "Array.count": "$this.length",
3537
3546
  "i8.parse": "(Number.parseInt($0, 10) << 24 >> 24)",
3538
3547
  "i16.parse": "(Number.parseInt($0, 10) << 16 >> 16)",
3539
3548
  "i32.parse": "(Number.parseInt($0, 10) | 0)",