nytra 0.0.8 → 0.0.9
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/README.md +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,6 +101,21 @@ If you see decorator typing/runtime issues, enable modern decorators + metadata
|
|
|
101
101
|
|
|
102
102
|
> Nytra decorators use the new standard decorator context APIs (`ClassDecoratorContext`, `ClassFieldDecoratorContext`).
|
|
103
103
|
|
|
104
|
+
For projecty relying on legacy TypeScript decorators, you can use the exported `NytraExperimental` class wrapping the new TC30 Decorators.
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import {NytraExperimental, Types as T} from "nytra";
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@NytraExperimental.registerClass(10000)
|
|
111
|
+
export class PageStats {
|
|
112
|
+
@NytraExperimental.registerField(0, T.TYPE_STRING)
|
|
113
|
+
version: string;
|
|
114
|
+
@NytraExperimental.registerField(1, T.TYPE_UINT32)
|
|
115
|
+
registrationCount: number;
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
104
119
|
## License
|
|
105
120
|
|
|
106
121
|
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "nytra",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"description": "A javascript ES6 Decorator driven library to encode/decode javascript objects to/from binary optimized buffers to reduce payload on network",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|