@d-i-t-a/reader 3.0.0-alpha.6 → 3.0.0-alpha.7

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,9 +1,11 @@
1
+ export { Link, D2Link, Links } from "./v3/Link";
1
2
  /**
2
- * @deprecated Import from "./v3/Link" instead. This file re-exports for backwards compatibility.
3
+ * Converts @readium/shared objects to plain JSON-safe objects.
4
+ * Unwraps Links wrappers (.items), converts Sets to Arrays,
5
+ * and recursively processes nested objects.
3
6
  */
4
- export { Link, D2Link, Links } from "./v3/Link";
7
+ export declare function toPlainObject(o: any): any;
5
8
  /**
6
- * @deprecated No longer needed — @readium/shared uses camelCase natively.
7
- * Kept for backwards compatibility with code that calls convertAndCamel().
9
+ * @deprecated Use toPlainObject() instead.
8
10
  */
9
- export declare function convertAndCamel(o: any): any;
11
+ export declare const convertAndCamel: typeof toPlainObject;
@@ -19,6 +19,12 @@ export declare class Publication {
19
19
  private _toc?;
20
20
  private _links?;
21
21
  constructor(manifest: Manifest, manifestUrl: URL);
22
+ /**
23
+ * Create a Publication from a raw JSON object.
24
+ * Handles both RWPM (camelCase) and legacy (PascalCase) key formats.
25
+ * Returns null if the JSON cannot be parsed.
26
+ */
27
+ static fromJSON(json: any, url: URL): Publication | null;
22
28
  static fromUrl(url: URL, requestConfig?: RequestConfig): Promise<Publication>;
23
29
  get metadata(): import("@readium/shared").Metadata;
24
30
  get readingOrder(): Link[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-i-t-a/reader",
3
- "version": "3.0.0-alpha.6",
3
+ "version": "3.0.0-alpha.7",
4
4
  "description": "A viewer application for EPUB files.",
5
5
  "repository": "https://github.com/d-i-t-a/R2D2BC",
6
6
  "license": "Apache-2.0",