diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 4266ca0be7..115175fa3f 100644 --- a/types/paper/index.d.ts +++ b/types/paper/index.d.ts @@ -74,7 +74,7 @@ declare module paper { /** * Same as `exportJSON({ asString: false })`. */ - toJSON(): string; + toJSON(): object | any[]; } /** diff --git a/types/paper/paper-tests.ts b/types/paper/paper-tests.ts index 6860037e70..efa01b5d69 100644 --- a/types/paper/paper-tests.ts +++ b/types/paper/paper-tests.ts @@ -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); } }