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.
- package/assembly/__tests__/as-json.spec.ts +0 -4
- package/assembly/index.d.ts +14 -0
- package/assembly/index.ts +2 -0
- package/assembly/test.ts +0 -2
- package/package.json +1 -1
- package/transform/package.json +1 -1
|
@@ -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
package/assembly/test.ts
CHANGED
package/package.json
CHANGED