@treinetic/treinetic-epub-reader 2.0.2 → 2.0.4

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Treinetic Epub Reader 2.0.0
1
+ # Treinetic Epub Reader 2.0.3
2
2
 
3
3
  A modern, lightweight, and framework-agnostic EPUB reader for the web, built with TypeScript.
4
4
  This project is an initiative of Treinetic (Pvt) Ltd, Sri Lanka.
@@ -58,17 +58,23 @@ This will start a local server at `http://localhost:3001` with hot-reloading.
58
58
 
59
59
  ### Basic Usage
60
60
 
61
- First, import the necessary classes and CSS.
61
+ First, import the necessary methods and CSS.
62
+
63
+ > [!NOTE]
64
+ > **v2.0.3 Update:** You can now use Named Exports for better compatibility with Vite and modern bundlers.
62
65
 
63
66
  ```typescript
64
- import TreineticEpubReader from '@treinetic/treinetic-epub-reader';
67
+ import { create } from '@treinetic/treinetic-epub-reader';
65
68
  import '@treinetic/treinetic-epub-reader/dist/style.css';
66
69
 
67
70
  // Create the reader instance targeting your container
68
- const reader = TreineticEpubReader.create("#epub-reader-frame");
71
+ const reader = create("#epub-reader-frame");
69
72
 
70
73
  // Load an EPUB file (url or base64)
71
- reader.open("path/to/book.epub");
74
+ // Note: Must be a valid .epub file, not a PDF.
75
+ // For correct path resolution in Vite, ensure files are in 'public/' or imported as assets.
76
+ import { open } from '@treinetic/treinetic-epub-reader';
77
+ open("path/to/book.epub");
72
78
  ```
73
79
 
74
80
  ### HTML Structure
@@ -36,3 +36,14 @@ declare const TreineticEpubReader: {
36
36
  clearSettings: () => void;
37
37
  };
38
38
  export default TreineticEpubReader;
39
+ export declare const create: (selectorOrElement: string | HTMLElement) => ExternalControls | null;
40
+ export declare const init: (selectorOrElement: string | HTMLElement) => ExternalControls | null;
41
+ export declare const open: (epubUrlOrFolder: string) => void;
42
+ export declare const setScrollOption: (type: "auto" | "scroll-continuous") => void;
43
+ export declare const setTheme: (theme: string) => void;
44
+ export declare const registerTheme: (theme: ReaderTheme) => void;
45
+ export declare const clearSettings: () => void;
46
+ export declare const setFontSize: (size: number) => void;
47
+ export declare const goToPage: (href: string) => void;
48
+ export declare const nextPage: () => void;
49
+ export declare const prevPage: () => void;