File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 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
5252arguments incompatibility. But you may not be worried in case you are using first arguments only.
5353``` typescript
5454class JSON22 {
55- static parse(text : string , options ? : Json22ParseOptions ): any ;
55+ static parse< T > (text : string , options ? : Json22ParseOptions ): T ;
5656 static stringify(value : any , options ? : Json22StringifyOptions ): string ;
5757}
5858
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 11{
22 "name" : " json22" ,
3- "version" : " 0.0.5 " ,
3+ "version" : " 0.0.6 " ,
44 "description" : " JSON superset with an ability to deal with classes and extended support for number values" ,
55 "author" : " Dmitry Dutikov" ,
66 "license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments