json-as 0.7.1 → 0.7.2

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.
@@ -15,7 +15,6 @@ function canSer<T>(data: T, toBe: string): void {
15
15
  expect(serialized).toBe(toBe);
16
16
  }
17
17
 
18
- // @ts-ignore
19
18
  @json
20
19
  class Map4 {
21
20
  a: string;
@@ -24,7 +23,6 @@ class Map4 {
24
23
  d: string;
25
24
  }
26
25
 
27
- // @ts-ignore
28
26
  @json
29
27
  class Vec3 {
30
28
  x: f64;
@@ -32,7 +30,6 @@ class Vec3 {
32
30
  z: f64;
33
31
  }
34
32
 
35
- // @ts-ignore
36
33
  @json
37
34
  class Player {
38
35
  firstName: string;
@@ -179,7 +176,6 @@ describe("Ser externals", () => {
179
176
  })
180
177
  });
181
178
 
182
- // @ts-ignore
183
179
  @json
184
180
  class HttpResp {
185
181
  statusCode: number;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Class decorator that enables the class to be serializable as JSON.
3
+ */
4
+ declare function json(target: any): void;
5
+
6
+ /**
7
+ * Class decorator that enables the class to be serializable as JSON.
8
+ */
9
+ declare function serializable(target: any): void;
10
+
11
+ /**
12
+ * Property decorator that provides an alias name for JSON serialization.
13
+ */
14
+ declare function alias(name: string): Function;
package/assembly/index.ts CHANGED
@@ -1 +1,3 @@
1
+ /// <reference path="./index.d.ts" />
2
+
1
3
  export { JSON } from "./src/json";
package/assembly/test.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { JSON } from "./src/json";
2
2
 
3
- // @ts-ignore
4
3
  @serializable
5
4
  class Vec3 {
6
5
  x: f64 = 3.4;
@@ -8,7 +7,6 @@ class Vec3 {
8
7
  z: f64 = 8.3;
9
8
  }
10
9
 
11
- // @ts-ignore
12
10
  @serializable
13
11
  class Player extends Vec3 {
14
12
  @alias("first name")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-as",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "JSON encoder/decoder for AssemblyScript",
5
5
  "types": "assembly/index.ts",
6
6
  "author": "Jairus Tanaka",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-as/transform",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "JSON encoder/decoder for AssemblyScript",
5
5
  "main": "./lib/index.js",
6
6
  "author": "Jairus Tanaka",