File tree 3 files changed +15
-2
lines changed
3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ Note: JSON22 cannot be used as drop in JSON object replacement due to `parse` an
52
52
arguments incompatibility. But you may not be worried in case you are using first arguments only.
53
53
``` typescript
54
54
class JSON22 {
55
- static parse(text : string , options ? : Json22ParseOptions ): any ;
55
+ static parse< T > (text : string , options ? : Json22ParseOptions ): T ;
56
56
static stringify(value : any , options ? : Json22StringifyOptions ): string ;
57
57
}
58
58
Original file line number Diff line number Diff line change
1
+ export declare class JSON22 {
2
+ static parse < T > ( text : string , options ?: Json22ParseOptions ) : T ;
3
+ static stringify ( value : any , options ?: Json22StringifyOptions ) : string ;
4
+ }
5
+
6
+ export interface Json22ParseOptions {
7
+ context ?: Record < string , { new ( ...args : any ) } > ; // default { 'Date': Date }
8
+ // To be extended
9
+ }
10
+
11
+ export interface Json22StringifyOptions {
12
+ // To be extended
13
+ }
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " json22" ,
3
- "version" : " 0.0.5 " ,
3
+ "version" : " 0.0.6 " ,
4
4
"description" : " JSON superset with an ability to deal with classes and extended support for number values" ,
5
5
"author" : " Dmitry Dutikov" ,
6
6
"license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments