@@ -24,6 +24,177 @@ type LanguageCode =
2424
2525type Directions = "ltr" | "rtl" ;
2626
27+ /**
28+ * Represents the current state and metadata of the loaded eBook in the Kotobee Reader.
29+ */
30+ interface Book {
31+ /**
32+ * Information about the current chapter.
33+ */
34+ chapter : {
35+ /**
36+ * Whether this is not the last chapter.
37+ */
38+ notLastChapter : boolean ;
39+ /**
40+ * Whether this is not the first chapter.
41+ */
42+ notFirstChapter : boolean ;
43+ /**
44+ * Relative URL path of the current chapter.
45+ */
46+ url : string ;
47+ /**
48+ * Fully qualified URL for the current chapter.
49+ */
50+ absoluteURL : string ;
51+ /**
52+ * Title of the current chapter.
53+ */
54+ title : string ;
55+ /**
56+ * Viewport settings or null if not specified.
57+ */
58+ viewport : null ;
59+ /**
60+ * Layout type of the current chapter (e.g., 'reflowable' or 'fixed').
61+ */
62+ layout : string ;
63+ /**
64+ * Current view mode (e.g., 'single', 'double', 'scroll', etc.).
65+ */
66+ view : string ;
67+ /**
68+ * Indicates if the chapter is displayed in paged mode.
69+ */
70+ paged : boolean ;
71+ } ;
72+ /**
73+ * Metadata describing the book, compatible with various standards.
74+ */
75+ meta : {
76+ /**
77+ * Dublin Core metadata fields.
78+ */
79+ dc : {
80+ /**
81+ * The book's title.
82+ */
83+ title : string ;
84+ /**
85+ * Unique identifier for the book.
86+ */
87+ identifier : string ;
88+ /**
89+ * Publication identifier.
90+ */
91+ "pub-id" : string ;
92+ /**
93+ * Book author/creator.
94+ */
95+ creator : string ;
96+ /**
97+ * Publisher's name.
98+ */
99+ publisher : string ;
100+ /**
101+ * Copyright or rights information.
102+ */
103+ rights : string ;
104+ language : LanguageCode ;
105+ /**
106+ * Book description or summary.
107+ */
108+ description : string ;
109+ } ;
110+ /**
111+ * Cover image URL or path.
112+ */
113+ cover : string ;
114+ /**
115+ * DCMI Terms metadata.
116+ */
117+ dcterms : {
118+ /**
119+ * Date and time of the last modification (ISO 8601).
120+ */
121+ modified : string ;
122+ } ;
123+ /**
124+ * Epub3 'rendition' metadata.
125+ */
126+ rendition : {
127+ /**
128+ * Rendering/layout mode ("reflowable", "pre-paginated", etc.).
129+ */
130+ layout : string ;
131+ /**
132+ * Device orientation ("portrait", "landscape", etc.).
133+ */
134+ orientation : string ;
135+ } ;
136+ /**
137+ * Apple Books (iBooks) specific metadata.
138+ */
139+ ibooks : {
140+ /**
141+ * Whether the book is interactive ("true" or "false").
142+ */
143+ interactive : "true" | "false" ;
144+ /**
145+ * Whether specified fonts are used ("true" or "false").
146+ */
147+ "specified-fonts" : "true" | "false" ;
148+ } ;
149+ /**
150+ * Kotobee-specific metadata.
151+ */
152+ kotobee : {
153+ /**
154+ * Kotobee reader version.
155+ */
156+ version : string ;
157+ /**
158+ * Kotobee reader build number.
159+ */
160+ build : string ;
161+ } ;
162+ /**
163+ * Schema.org accessibility metadata.
164+ */
165+ schema : {
166+ /**
167+ * The access mode (e.g., "textual", "visual").
168+ */
169+ accessmode : string ;
170+ /**
171+ * Sufficient access modes ("textual", "visual", etc.).
172+ */
173+ accessmodesufficient : string ;
174+ /**
175+ * Accessibility feature (e.g., "structuralNavigation").
176+ */
177+ accessibilityfeature : string ;
178+ /**
179+ * Accessibility hazards ("none", "flashing", etc.).
180+ */
181+ accessibilityhazard : string ;
182+ /**
183+ * Summary of the book's accessibility features.
184+ */
185+ accessibilitysummary : string ;
186+ } ;
187+ } ;
188+ /**
189+ * Kotobee Book structure version.
190+ */
191+ version : number ;
192+ /**
193+ * Book chapters serialized as a string (usually JSON or XML).
194+ */
195+ chapters : string ;
196+ }
197+
27198interface KotobeeReader {
28199 /**
29200 * Clears cached local data used by the reader.
@@ -49,6 +220,7 @@ interface KotobeeReader {
49220 * Sets reading direction (left-to-right or right-to-left).
50221 */
51222 setDirection : ( direction : Directions ) => void ;
223+ book : Book ;
52224}
53225
54226// Declare the global variable
0 commit comments