mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
[paper] Fix toJSON return type (#35806)
This commit is contained in:
committed by
Sheetal Nandi
parent
13e317fe33
commit
bb632389a0
Vendored
+1
-1
@@ -74,7 +74,7 @@ declare module paper {
|
||||
/**
|
||||
* Same as `exportJSON({ asString: false })`.
|
||||
*/
|
||||
toJSON(): string;
|
||||
toJSON(): object | any[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15281,9 +15281,11 @@ function APIReferenceExamples() {
|
||||
const str = src.exportJSON(); // "['Point', 50, 25]"
|
||||
// not type save import
|
||||
const res0 = paper.Point.importJSON(str);
|
||||
// not type save import
|
||||
const res1 = paper.Point.importJSON(src.toJSON());
|
||||
// type save import to existing object
|
||||
// if object is not same type with json, object will not be updated
|
||||
const res1 = new paper.Point(0, 0);
|
||||
const res2 = new paper.Point(0, 0);
|
||||
paper.Point.importJSON(str, res1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user