@khanacademy/perseus-core 23.4.0 → 23.5.0
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/dist/es/index.item-splitting.js.map +1 -1
- package/dist/es/index.js +4 -4
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.item-splitting.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/parse-perseus-json/index.d.ts +12 -1
- package/dist/parse-perseus-json/regression-tests/renderer-data/basic-renderer.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Result } from "./result";
|
|
2
|
-
import type { PerseusItem, PerseusArticle } from "../data-schema";
|
|
2
|
+
import type { PerseusItem, PerseusArticle, PerseusRenderer } from "../data-schema";
|
|
3
3
|
import type { UserInputMap } from "../validation.types";
|
|
4
4
|
export type ParseFailureDetail = {
|
|
5
5
|
/**
|
|
@@ -46,3 +46,14 @@ export declare function parseAndMigratePerseusArticle(data: unknown): Result<Per
|
|
|
46
46
|
* JSON.
|
|
47
47
|
*/
|
|
48
48
|
export declare function parseAndMigrateUserInputMap(data: unknown): Result<UserInputMap, ParseFailureDetail>;
|
|
49
|
+
/**
|
|
50
|
+
* Parses a PerseusRenderer from a plain object or JSON string, migrates old
|
|
51
|
+
* formats to the latest schema, and runtime-typechecks the result.
|
|
52
|
+
*
|
|
53
|
+
* @returns a {@link Result} of the parsed PerseusRenderer. If the result is a
|
|
54
|
+
* failure, it will contain an error message describing where in the tree
|
|
55
|
+
* parsing failed.
|
|
56
|
+
* @throws SyntaxError if the argument is a string that is not well-formed
|
|
57
|
+
* JSON.
|
|
58
|
+
*/
|
|
59
|
+
export declare function parseAndMigratePerseusRenderer(data: unknown): Result<PerseusRenderer, ParseFailureDetail>;
|