@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.
@@ -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>;
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ content: string;
3
+ widgets: {};
4
+ };
5
+ export default _default;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Shared Perseus infrastructure",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "23.4.0",
6
+ "version": "23.5.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },