@readium/shared 1.3.0 → 2.1.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.
Files changed (59) hide show
  1. package/dist/index.js +3898 -2382
  2. package/dist/index.umd.cjs +3 -3
  3. package/package.json +3 -1
  4. package/src/publication/AltIdentifier.ts +58 -0
  5. package/src/publication/Contributor.ts +15 -0
  6. package/src/publication/GuidedNavigation.ts +126 -15
  7. package/src/publication/Layout.ts +13 -0
  8. package/src/publication/Link.ts +7 -0
  9. package/src/publication/Metadata.ts +86 -9
  10. package/src/publication/Profiles.ts +15 -0
  11. package/src/publication/Properties.ts +10 -0
  12. package/src/publication/ReadingProgression.ts +2 -15
  13. package/src/publication/TDM.ts +56 -0
  14. package/src/publication/accessibility/Accessibility.ts +860 -0
  15. package/src/publication/accessibility/AccessibilityMetadataDisplayGuide.ts +1055 -0
  16. package/src/publication/accessibility/Localization.md +203 -0
  17. package/src/publication/accessibility/Localization.ts +115 -0
  18. package/src/publication/accessibility/index.ts +3 -0
  19. package/src/publication/accessibility/locales/en.json +231 -0
  20. package/src/publication/accessibility/locales/fr.json +231 -0
  21. package/src/publication/epub/MediaOverlay.ts +43 -0
  22. package/src/publication/epub/Metadata.ts +16 -0
  23. package/src/publication/epub/Properties.ts +0 -10
  24. package/src/publication/epub/index.ts +2 -2
  25. package/src/publication/index.ts +5 -1
  26. package/src/util/JSONParse.ts +3 -3
  27. package/types/src/publication/AltIdentifier.d.ts +23 -0
  28. package/types/src/publication/Contributor.d.ts +4 -0
  29. package/types/src/publication/GuidedNavigation.d.ts +62 -9
  30. package/types/src/publication/Layout.d.ts +8 -0
  31. package/types/src/publication/Link.d.ts +3 -0
  32. package/types/src/publication/Metadata.d.ts +28 -2
  33. package/types/src/publication/Profiles.d.ts +10 -0
  34. package/types/src/publication/Properties.d.ts +6 -0
  35. package/types/src/publication/ReadingProgression.d.ts +2 -5
  36. package/types/src/publication/TDM.d.ts +30 -0
  37. package/types/src/publication/accessibility/Accessibility.d.ts +337 -16
  38. package/types/src/publication/accessibility/AccessibilityMetadataDisplayGuide.d.ts +22 -25
  39. package/types/src/publication/accessibility/Localization.d.ts +45 -0
  40. package/types/src/publication/accessibility/index.d.ts +1 -0
  41. package/types/src/publication/epub/MediaOverlay.d.ts +19 -0
  42. package/types/src/publication/epub/Metadata.d.ts +6 -0
  43. package/types/src/publication/epub/Properties.d.ts +1 -5
  44. package/types/src/publication/epub/index.d.ts +2 -2
  45. package/types/src/publication/index.d.ts +5 -1
  46. package/types/src/util/JSONParse.d.ts +2 -2
  47. package/src/publication/epub/EPUBLayout.ts +0 -10
  48. package/src/publication/epub/Presentation.ts +0 -16
  49. package/src/publication/presentation/Metadata.ts +0 -19
  50. package/src/publication/presentation/Presentation.ts +0 -155
  51. package/src/publication/presentation/Properties.ts +0 -70
  52. package/src/publication/presentation/index.ts +0 -3
  53. package/types/src/publication/accessibility/AccessibilityDisplayString.d.ts +0 -56
  54. package/types/src/publication/epub/EPUBLayout.d.ts +0 -5
  55. package/types/src/publication/epub/Presentation.d.ts +0 -7
  56. package/types/src/publication/presentation/Metadata.d.ts +0 -6
  57. package/types/src/publication/presentation/Presentation.d.ts +0 -95
  58. package/types/src/publication/presentation/Properties.d.ts +0 -32
  59. package/types/src/publication/presentation/index.d.ts +0 -3
@@ -0,0 +1,231 @@
1
+ {
2
+ "ways-of-reading": {
3
+ "title": "Lisibilité",
4
+ "nonvisual-reading": {
5
+ "alt-text": {
6
+ "compact": "Images décrites",
7
+ "descriptive": "Les images sont décrites par un texte"
8
+ },
9
+ "no-metadata": "Aucune information pour la lecture en voix de synthèse ou en braille",
10
+ "none": {
11
+ "compact": "Non lisible en voix de synthèse ou en braille",
12
+ "descriptive": "Le contenu n'est pas lisible en voix de synthèse ou en braille"
13
+ },
14
+ "not-fully": {
15
+ "compact": "Pas entièrement lisible en voix de synthèse ou en braille",
16
+ "descriptive": "Tous les contenus ne pourront pas être lus à haute voix ou en braille"
17
+ },
18
+ "readable": {
19
+ "compact": "Entièrement lisible en voix de synthèse ou en braille",
20
+ "descriptive": "Tous les contenus peuvent être lus en voix de synthèse ou en braille"
21
+ }
22
+ },
23
+ "prerecorded-audio": {
24
+ "complementary": {
25
+ "compact": "Clips audio préenregistrés",
26
+ "descriptive": "Des clips audio préenregistrés sont intégrés au contenu"
27
+ },
28
+ "no-metadata": "Aucune information sur les enregistrements audio",
29
+ "only": {
30
+ "compact": "Audio préenregistré uniquement",
31
+ "descriptive": "Livre audio sans texte alternatif"
32
+ },
33
+ "synchronized": {
34
+ "compact": "Audio préenregistré synchronisé avec du texte",
35
+ "descriptive": "Tous les contenus sont disponibles comme audio préenregistrés synchronisés avec le texte"
36
+ }
37
+ },
38
+ "visual-adjustments": {
39
+ "modifiable": {
40
+ "compact": "L'affichage peut être adapté",
41
+ "descriptive": "L'apparence du texte et la mise en page peuvent être modifiées en fonction des capacités du système de lecture (famille et taille des polices, espaces entre les paragraphes, les phrases, les mots et les lettres, ainsi que la couleur de l'arrière-plan et du texte)"
42
+ },
43
+ "unknown": "Aucune information sur les possibilités d'adaptation de l'affichage",
44
+ "unmodifiable": {
45
+ "compact": "L'affichage ne peut pas être adapté",
46
+ "descriptive": "Le texte et la mise en page ne peuvent pas être adaptés étant donné que l'expérience de lecture est proche de celle de la version imprimée, mais l'application de lecture peut tout de même proposer la capacité de zoomer"
47
+ }
48
+ }
49
+ },
50
+ "conformance": {
51
+ "title": "Règles d'accessibilité",
52
+ "details-title": "Information détaillée",
53
+ "a": {
54
+ "compact": "Cette publication répond aux règles minimales d'accessibilité",
55
+ "descriptive": "La publication indique qu'elle respecte les règles d'accessibilité EPUB et WCAG 2 niveau A"
56
+ },
57
+ "aa": {
58
+ "compact": "Cette publication répond aux règles d'accessibilité reconnues",
59
+ "descriptive": "La publication indique qu'elle respecte les règles d'accessibilité EPUB et WCAG 2 niveau AA"
60
+ },
61
+ "aaa": {
62
+ "compact": "Cette publication dépasse les règles d'accessibilité reconnues",
63
+ "descriptive": "La publication indique qu'elle respecte les règles d'accessibilité EPUB et WCAG 2 niveau AAA"
64
+ },
65
+ "no": "Aucune information disponible",
66
+ "unknown-standard": "Aucune indication concernant les normes d'accessibilité",
67
+ "certifier": "Accessibilité évaluée par ",
68
+ "certifier-credentials": "L'évaluateur est accrédité par ",
69
+ "details": {
70
+ "certification-info": "Cette publication a été certifié le",
71
+ "certifier-report": "Pour plus d'information, veuillez consulter le rapport de certification",
72
+ "claim": "Cette publication indique respecter",
73
+ "epub-accessibility-1-0": "EPUB Accessibilité 1.0",
74
+ "epub-accessibility-1-1": "EPUB Accessibilité 1.1",
75
+ "level-a": "Niveau A",
76
+ "level-aa": "Niveau AA",
77
+ "level-aaa": "Niveau AAA",
78
+ "wcag-2-0": {
79
+ "compact": "WCAG 2.0",
80
+ "descriptive": "Règles pour l’accessibilité des contenus Web (WCAG) 2.0"
81
+ },
82
+ "wcag-2-1": {
83
+ "compact": "WCAG 2.1",
84
+ "descriptive": "Règles pour l’accessibilité des contenus Web (WCAG) 2.1"
85
+ },
86
+ "wcag-2-2": {
87
+ "compact": "WCAG 2.2",
88
+ "descriptive": "Règles pour l’accessibilité des contenus Web (WCAG) 2.2"
89
+ }
90
+ }
91
+ },
92
+ "navigation": {
93
+ "title": "Points de repère",
94
+ "index": {
95
+ "compact": "Index",
96
+ "descriptive": "Index comportant des liens vers les entrées référencées"
97
+ },
98
+ "no-metadata": "Aucune information disponible",
99
+ "page-navigation": {
100
+ "compact": "Aller à la page",
101
+ "descriptive": "Permet d'accéder aux pages de la version source imprimée"
102
+ },
103
+ "structural": {
104
+ "compact": "Titres",
105
+ "descriptive": "Contient des titres pour une navigation structurée"
106
+ },
107
+ "toc": {
108
+ "compact": "Table des matières",
109
+ "descriptive": "Table des matières"
110
+ }
111
+ },
112
+ "rich-content": {
113
+ "title": "Contenus spécifiques",
114
+ "accessible-chemistry-as-latex": {
115
+ "compact": "Formules chimiques en LaTeX",
116
+ "descriptive": "Formules chimiques en format accessible (LaTeX)"
117
+ },
118
+ "accessible-chemistry-as-mathml": {
119
+ "compact": "Formules chimiques en MathML",
120
+ "descriptive": "Formules chimiques en format accessible (MathML)"
121
+ },
122
+ "accessible-math-as-latex": {
123
+ "compact": "Mathématiques en LaTeX",
124
+ "descriptive": "Formules mathématiques en format accessible (LaTeX)"
125
+ },
126
+ "math-as-mathml": {
127
+ "compact": "Mathématiques en MathML",
128
+ "descriptive": "Formules mathématiques en format accessible (MathML)"
129
+ },
130
+ "accessible-math-described": "Des descriptions textuelles des formules mathématiques sont fournies",
131
+ "closed-captions": {
132
+ "compact": "Sous-titres disponibles pour les vidéos",
133
+ "descriptive": "Des sous titres sont disponibles pour les vidéos"
134
+ },
135
+ "extended-descriptions": "Les images porteuses d'informations complexes sont décrites par des descriptions longues",
136
+ "open-captions": {
137
+ "compact": "Sous-titres incrustés",
138
+ "descriptive": "Des sous titres sont incrustés pour les vidéos"
139
+ },
140
+ "transcript": "Transcriptions fournies",
141
+ "unknown": "Aucune information disponible"
142
+ },
143
+ "hazards": {
144
+ "title": "Points d'attention",
145
+ "flashing": {
146
+ "compact": "Flashs lumineux",
147
+ "descriptive": "La publication contient des flashs lumineux qui peuvent provoquer des crises d’épilepsie"
148
+ },
149
+ "flashing-none": {
150
+ "compact": "Pas de flashs lumineux",
151
+ "descriptive": "La publication ne contient pas de flashs lumineux susceptibles de provoquer des crises d’épilepsie"
152
+ },
153
+ "flashing-unknown": {
154
+ "compact": "Pas d'information concernant la présence de flashs lumineux",
155
+ "descriptive": "La présence de flashs lumineux susceptibles de provoquer des crises d’épilepsie n'a pas pu être déterminée"
156
+ },
157
+ "motion": {
158
+ "compact": "Sensations de mouvement",
159
+ "descriptive": "La publication contient des images en mouvement qui peuvent provoquer des nausées, des vertiges et des maux de tête"
160
+ },
161
+ "motion-none": {
162
+ "compact": "Pas de sensations de mouvement",
163
+ "descriptive": "La publication ne contient pas d'images en mouvement qui pourraient provoquer des nausées, des vertiges et des maux de tête"
164
+ },
165
+ "motion-unknown": {
166
+ "compact": "Pas d'information concernant la présence d'images en mouvement",
167
+ "descriptive": "La présence d'images en mouvement susceptibles de provoquer des nausées, des vertiges et des maux de tête n'a pas pu être déterminée"
168
+ },
169
+ "no-metadata": "Aucune information disponible",
170
+ "none": {
171
+ "compact": "Aucun points d'attention",
172
+ "descriptive": "La publication ne présente aucun risque lié à la présence de flashs lumineux, de sensations de mouvement ou de sons"
173
+ },
174
+ "sound": {
175
+ "compact": "Sons",
176
+ "descriptive": "La publication contient des sons qui peuvent causer des troubles de la sensibilité"
177
+ },
178
+ "sound-none": {
179
+ "compact": "Pas de risques sonores",
180
+ "descriptive": "La publication ne contient pas de sons susceptibles de provoquer des troubles de la sensibilité"
181
+ },
182
+ "sound-unknown": {
183
+ "compact": "Pas d'information concernant la présence de sons",
184
+ "descriptive": "La présence de sons susceptibles de causer des troubles de sensibilité n'a pas pu être déterminée"
185
+ },
186
+ "unknown": "La présence de risques est inconnue"
187
+ },
188
+ "accessibility-summary": {
189
+ "title": "Informations d'accessibilité supplémentaires fournies par l'éditeur",
190
+ "no-metadata": "Aucune information disponible",
191
+ "publisher-contact": "Pour plus d'information à propos de l'accessibilité de cette publication, veuillez contacter l'éditeur : "
192
+ },
193
+ "legal-considerations": {
194
+ "title": "Considérations légales",
195
+ "exempt": {
196
+ "compact": "Déclare être sous le coup d'une exemption dans certaines juridictions",
197
+ "descriptive": "Cette publication dééclare être sous le coup d'une exemption dans certaines juridictions"
198
+ },
199
+ "no-metadata": "Aucune information disponible"
200
+ },
201
+ "additional-accessibility-information": {
202
+ "title": "Informations complémentaires sur l'accessibilité",
203
+ "aria": {
204
+ "compact": "Information enrichie pour les technologies d'assistances",
205
+ "descriptive": "La structure est enrichi de rôles ARIA afin d'optimiser l'organisation et de faciliter la navigation via les technologies d'assistances"
206
+ },
207
+ "audio-descriptions": "Description audio",
208
+ "braille": "Braille",
209
+ "color-not-sole-means-of-conveying-information": "La couleur n'est pas la seule manière de communiquer de l'information",
210
+ "dyslexia-readability": "Lisibilité adapté aux publics dys",
211
+ "full-ruby-annotations": "Annotations complètes au format ruby (langues asiatiques)",
212
+ "high-contrast-between-foreground-and-background-audio": "Contraste sonore amélioré entre les différents plans",
213
+ "high-contrast-between-text-and-background": "Contraste élevé entre le texte et l'arrière-plan",
214
+ "large-print": "Grands caractères",
215
+ "page-breaks": {
216
+ "compact": "Pagination identique à l'imprimé",
217
+ "descriptive": "Contient une pagination identique à la version imprimée"
218
+ },
219
+ "ruby-annotations": "Annotations partielles au format ruby (langues asiatiques)",
220
+ "sign-language": "Langue des signes",
221
+ "tactile-graphics": {
222
+ "compact": "Graphiques tactiles",
223
+ "descriptive": "Des graphiques tactiles ont été intégrés pour faciliter l'accès des personnes aveugles aux éléments visuels"
224
+ },
225
+ "tactile-objects": "Objets 3D ou tactiles",
226
+ "text-to-speech-hinting": "Prononciation améliorée pour la synthèse vocale",
227
+ "ultra-high-contrast-between-text-and-background": "Contraste très élevé entre le texte et l'arrière-plan",
228
+ "visible-page-numbering": "Numérotation de page visible",
229
+ "without-background-sounds": "Aucun bruit de fond"
230
+ }
231
+ }
@@ -0,0 +1,43 @@
1
+ /* Copyright 2025 Readium Foundation. All rights reserved.
2
+ * Use of this source code is governed by a BSD-style license,
3
+ * available in the LICENSE file present in the Github repository of the project.
4
+ */
5
+
6
+ export class MediaOverlay {
7
+ /** Author-defined CSS class name to apply to the currently-playing EPUB Content Document element. */
8
+ public activeClass?: string;
9
+
10
+ /** Author-defined CSS class name to apply to the EPUB Content Document's document element when playback is active. */
11
+ public playbackActiveClass?: string;
12
+
13
+ /** Creates a MediaOverlay object */
14
+ constructor(values: {
15
+ activeClass?: string;
16
+ playbackActiveClass?: string;
17
+ }) {
18
+ this.activeClass = values.activeClass;
19
+ this.playbackActiveClass = values.playbackActiveClass;
20
+ }
21
+
22
+ /**
23
+ * Parses a MediaOverlay from its RWPM JSON representation.
24
+ */
25
+ public static deserialize(json: any): MediaOverlay | undefined {
26
+ if (!json) return;
27
+
28
+ return new MediaOverlay({
29
+ activeClass: json.activeClass,
30
+ playbackActiveClass: json.playbackActiveClass,
31
+ });
32
+ }
33
+
34
+ /**
35
+ * Serializes a MediaOverlay to its RWPM JSON representation.
36
+ */
37
+ public serialize(): any {
38
+ const json: any = {};
39
+ if (this.activeClass) json.activeClass = this.activeClass;
40
+ if (this.playbackActiveClass) json.playbackActiveClass = this.playbackActiveClass;
41
+ return json;
42
+ }
43
+ }
@@ -0,0 +1,16 @@
1
+ import { Metadata } from "../Metadata";
2
+ import { MediaOverlay } from "./MediaOverlay";
3
+
4
+ declare module '../Metadata' {
5
+ export interface Metadata {
6
+ getMediaOverlay(): MediaOverlay | undefined;
7
+ }
8
+ }
9
+
10
+ Metadata.prototype.getMediaOverlay = function(): MediaOverlay | undefined {
11
+ const mediaOverlay = this.otherMetadata?.['mediaOverlay'];
12
+
13
+ if (!mediaOverlay) return;
14
+
15
+ return MediaOverlay.deserialize(mediaOverlay);
16
+ };
@@ -1,5 +1,4 @@
1
1
  import { Properties } from '../Properties';
2
- import { EPUBLayout } from './EPUBLayout';
3
2
 
4
3
  // EPUB extensions for link [Properties].
5
4
  // https://readium.org/webpub-manifest/schema/extensions/epub/properties.schema.json
@@ -11,18 +10,9 @@ declare module '../Properties' {
11
10
  * media type.
12
11
  */
13
12
  getContains(): Set<string> | undefined;
14
-
15
- /**
16
- * Hints how the layout of the resource should be presented.
17
- */
18
- getLayout(): EPUBLayout | undefined;
19
13
  }
20
14
  }
21
15
 
22
16
  Properties.prototype.getContains = function(): Set<string> | undefined {
23
17
  return new Set<string>(this.otherProperties['contains'] || []);
24
18
  };
25
-
26
- Properties.prototype.getLayout = function(): EPUBLayout | undefined {
27
- return this.otherProperties['layout'];
28
- };
@@ -1,4 +1,4 @@
1
- export * from './EPUBLayout';
2
- export * from './Presentation';
1
+ export * from './MediaOverlay';
2
+ export * from './Metadata';
3
3
  export * from './Properties';
4
4
  export * from './Publication';
@@ -1,9 +1,10 @@
1
+ export * from './accessibility';
1
2
  export * from './encryption';
2
3
  export * from './epub';
3
4
  export * from './html';
4
5
  export * from './opds';
5
- export * from './presentation';
6
6
  export * from './services';
7
+ export * from './AltIdentifier';
7
8
  export * from './BelongsTo';
8
9
  export * from './Contributor';
9
10
  export * from './Link';
@@ -12,9 +13,12 @@ export * from './Locator';
12
13
  export * from './LocatorCollection';
13
14
  export * from './Manifest';
14
15
  export * from './Metadata';
16
+ export * from './Profiles';
15
17
  export * from './Properties';
16
18
  export * from './Publication';
17
19
  export * from './PublicationCollection';
20
+ export * from './Layout';
18
21
  export * from './ReadingProgression';
19
22
  export * from './Subject';
23
+ export * from './TDM';
20
24
  export * from './GuidedNavigation';
@@ -23,9 +23,9 @@ export function positiveNumberfromJSON(json: any): number | undefined {
23
23
  return num !== undefined && Math.sign(json) >= 0 ? json : undefined;
24
24
  }
25
25
 
26
- /** Converts a Set of a string to a string Array object */
27
- export function setToArray(obj: Set<string>): Array<string> {
28
- const list = new Array<string>();
26
+ /** Converts a Set to an Array object */
27
+ export function setToArray(obj: Set<any>): Array<any> {
28
+ const list = new Array<any>();
29
29
  obj.forEach(x => list.push(x));
30
30
  return list;
31
31
  }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Represents an alternate identifier for a publication.
3
+ * https://readium.org/webpub-manifest/schema/altIdentifier.schema.json
4
+ */
5
+ export declare class AltIdentifier {
6
+ /** The value of the alternate identifier. */
7
+ readonly value: string;
8
+ /** The scheme of the alternate identifier (URI format). */
9
+ readonly scheme?: string;
10
+ /** Creates an AltIdentifier object */
11
+ constructor(values: {
12
+ value: string;
13
+ scheme?: string;
14
+ });
15
+ /**
16
+ * Parses an AltIdentifier from its RWPM JSON representation.
17
+ */
18
+ static deserialize(json: string | any): AltIdentifier | undefined;
19
+ /**
20
+ * Serializes an AltIdentifier to its RWPM JSON representation.
21
+ */
22
+ serialize(): string | any;
23
+ }
@@ -1,5 +1,6 @@
1
1
  import { Links } from './Link';
2
2
  import { LocalizedString } from './LocalizedString';
3
+ import { AltIdentifier } from './AltIdentifier';
3
4
  /**
4
5
  * Contributor Object for the Readium Web Publication Manifest.
5
6
  * https://readium.org/webpub-manifest/schema/contributor-object.schema.json
@@ -11,6 +12,8 @@ export declare class Contributor {
11
12
  readonly sortAs?: string;
12
13
  /** An unambiguous reference to this contributor. */
13
14
  readonly identifier?: string;
15
+ /** Alternate identifiers for this contributor. */
16
+ readonly altIdentifiers?: Set<AltIdentifier>;
14
17
  /** The role of the contributor in the publication making. */
15
18
  readonly roles?: Set<string>;
16
19
  /** Used to retrieve similar publications for the given contributor. */
@@ -24,6 +27,7 @@ export declare class Contributor {
24
27
  name: LocalizedString;
25
28
  sortAs?: string;
26
29
  identifier?: string;
30
+ altIdentifiers?: Set<AltIdentifier>;
27
31
  roles?: Set<string>;
28
32
  links?: Links;
29
33
  position?: number;
@@ -19,6 +19,33 @@ export declare class GuidedNavigationDocument {
19
19
  static deserialize(json: any): GuidedNavigationDocument | undefined;
20
20
  serialize(): any;
21
21
  }
22
+ /**
23
+ * Represents a text value containing plain text, SSML, and language information.
24
+ */
25
+ export declare class GuidedNavigationText {
26
+ /** Plain text content */
27
+ readonly plain?: string;
28
+ /** SSML (Speech Synthesis Markup Language) content */
29
+ readonly ssml?: string;
30
+ /**
31
+ * BCP 47 language tag
32
+ * @pattern ^((?<grandfathered>(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((?<language>([A-Za-z]{2,3}(-(?<extlang>[A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-(?<script>[A-Za-z]{4}))?(-(?<region>[A-Za-z]{2}|[0-9]{3}))?(-(?<variant>[A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-(?<extension>[0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(?<privateUse>x(-[A-Za-z0-9]{1,8})+))?)|(?<privateUse2>x(-[A-Za-z0-9]{1,8})+))$
33
+ */
34
+ readonly language?: string;
35
+ constructor(values: {
36
+ plain?: string;
37
+ ssml?: string;
38
+ language?: string;
39
+ });
40
+ /**
41
+ * Deserializes a GuidedNavigationText from JSON
42
+ */
43
+ static deserialize(json: any): GuidedNavigationText | undefined;
44
+ /**
45
+ * Serializes the text to a plain object
46
+ */
47
+ serialize(): any;
48
+ }
22
49
  /**
23
50
  * Guided Navigation Object
24
51
  * https://github.com/readium/guided-navigation/blob/main/schema/object.schema.json
@@ -32,10 +59,23 @@ export declare class GuidedNavigationObject {
32
59
  readonly imgref?: string;
33
60
  /** Convey the structural semantics of a publication. */
34
61
  readonly role?: Set<string>;
35
- /** Textual equivalent of the resources or fragment of the resources referenced by the current Guided Navigation Object. */
36
- readonly text?: string;
62
+ /**
63
+ * Indicates the heading level (1-6) for the navigation object.
64
+ * @minimum 1
65
+ * @maximum 6
66
+ */
67
+ readonly level?: number;
68
+ /**
69
+ * Textual equivalent of the resources or fragment of the resources referenced by the current Guided Navigation Object.
70
+ */
71
+ readonly text?: GuidedNavigationText;
37
72
  /** References a textual resource or a fragment of it. */
38
73
  readonly textref?: string;
74
+ /**
75
+ * Describes the image referenced by the current Guided Navigation Object.
76
+ * This is a GuidedNavigationObject that should not contain 'level' or 'children' properties.
77
+ */
78
+ readonly description?: Omit<GuidedNavigationObject, 'level' | 'children'>;
39
79
  /**
40
80
  * Creates a [GuidedNavigation] object.
41
81
  */
@@ -44,22 +84,35 @@ export declare class GuidedNavigationObject {
44
84
  children?: GuidedNavigationObject[];
45
85
  imgref?: string;
46
86
  role?: Set<string>;
47
- text?: string;
87
+ level?: number;
88
+ text?: GuidedNavigationText;
48
89
  textref?: string;
90
+ description?: Omit<GuidedNavigationObject, 'level' | 'children'>;
49
91
  });
50
92
  /**
51
- * Parses a [GuidedNavigationObject] from its RWPM JSON representation.
52
- *
53
- * A GuidedNavigationObject can be parsed from a single string, or a full-fledged object.
54
- */
93
+ * Gets the plain text content.
94
+ * Returns undefined if no text is available.
95
+ */
96
+ get plainText(): string | undefined;
97
+ /**
98
+ * Gets the SSML content if available.
99
+ */
100
+ get ssmlText(): string | undefined;
101
+ /**
102
+ * Gets the language of the text if available.
103
+ */
104
+ get textLanguage(): string | undefined;
105
+ /**
106
+ * Deserializes a GuidedNavigationObject from JSON
107
+ */
55
108
  static deserialize(json: any): GuidedNavigationObject | undefined;
56
109
  /**
57
110
  * Parses a [GuidedNavigationObject] array from its RWPM JSON representation.
58
- */
111
+ */
59
112
  static deserializeArray(json: any): GuidedNavigationObject[] | undefined;
60
113
  /**
61
114
  * Serializes a [GuidedNavigationObject] to its RWPM JSON representation.
62
- */
115
+ */
63
116
  serialize(): any;
64
117
  get audioFile(): string | undefined;
65
118
  get audioTime(): string | undefined;
@@ -0,0 +1,8 @@
1
+ /** Hint about the nature of the layout for the publication.
2
+ * https://readium.org/webpub-manifest/contexts/default/#layout-and-reading-progression
3
+ */
4
+ export declare enum Layout {
5
+ reflowable = "reflowable",
6
+ fixed = "fixed",
7
+ scrolled = "scrolled"
8
+ }
@@ -22,6 +22,8 @@ export declare class Link {
22
22
  readonly height?: number;
23
23
  /** Width of the linked resource in pixels. */
24
24
  readonly width?: number;
25
+ /** Size of the linked resource in bytes. */
26
+ readonly size?: number;
25
27
  /** Length of the linked resource in seconds. */
26
28
  readonly duration?: number;
27
29
  /** Bitrate of the linked resource in kbps. */
@@ -44,6 +46,7 @@ export declare class Link {
44
46
  properties?: Properties;
45
47
  height?: number;
46
48
  width?: number;
49
+ size?: number;
47
50
  duration?: number;
48
51
  bitrate?: number;
49
52
  languages?: Array<string>;
@@ -1,8 +1,13 @@
1
+ import { AltIdentifier } from './AltIdentifier';
1
2
  import { BelongsTo } from './BelongsTo';
2
3
  import { Contributors } from './Contributor';
4
+ import { Layout } from './Layout';
3
5
  import { LocalizedString } from './LocalizedString';
6
+ import { Profile } from './Profiles';
4
7
  import { ReadingProgression } from './ReadingProgression';
5
8
  import { Subjects } from './Subject';
9
+ import { Accessibility } from './accessibility/Accessibility';
10
+ import { TDM } from './TDM';
6
11
  /**
7
12
  * https://readium.org/webpub-manifest/schema/metadata.schema.json
8
13
  *
@@ -14,7 +19,9 @@ import { Subjects } from './Subject';
14
19
  export declare class Metadata {
15
20
  title: LocalizedString;
16
21
  typeUri?: string;
22
+ conformsTo?: Array<Profile>;
17
23
  identifier?: string;
24
+ altIdentifier?: AltIdentifier;
18
25
  subtitle?: LocalizedString;
19
26
  sortAs?: LocalizedString;
20
27
  artists?: Contributors;
@@ -38,9 +45,12 @@ export declare class Metadata {
38
45
  belongsTo?: BelongsTo;
39
46
  belongsToCollections?: Contributors;
40
47
  belongsToSeries?: Contributors;
48
+ layout?: Layout;
41
49
  readingProgression?: ReadingProgression;
42
50
  duration?: number;
43
51
  numberOfPages?: number;
52
+ accessibility?: Accessibility;
53
+ tdm?: TDM;
44
54
  otherMetadata?: {
45
55
  [key: string]: any;
46
56
  };
@@ -50,7 +60,9 @@ export declare class Metadata {
50
60
  constructor(values: {
51
61
  title: LocalizedString;
52
62
  typeUri?: string;
63
+ conformsTo?: Array<Profile>;
53
64
  identifier?: string;
65
+ altIdentifier?: AltIdentifier;
54
66
  subtitle?: LocalizedString;
55
67
  sortAs?: LocalizedString;
56
68
  artists?: Contributors;
@@ -74,9 +86,12 @@ export declare class Metadata {
74
86
  belongsTo?: BelongsTo;
75
87
  belongsToCollections?: Contributors;
76
88
  belongsToSeries?: Contributors;
89
+ layout?: Layout;
77
90
  readingProgression?: ReadingProgression;
78
91
  duration?: number;
79
92
  numberOfPages?: number;
93
+ accessibility?: Accessibility;
94
+ tdm?: TDM;
80
95
  otherMetadata?: {
81
96
  [key: string]: any;
82
97
  };
@@ -92,8 +107,19 @@ export declare class Metadata {
92
107
  */
93
108
  serialize(): any;
94
109
  /**
95
- * Computes a [ReadingProgression] when the value of [readingProgression] is set to
96
- * auto, using the publication language.
110
+ * Computes a [Layout] using the [conformsTo] profile and layout property.
111
+ *
112
+ * Special cases:
113
+ * - EPUB profile defaults to reflowable if layout is not present
114
+ * - Divina profile defaults to fixed if layout is not present
115
+ * - Layout is ignored for audiobook and PDF profiles
116
+ * - Layout is ignored if set to reflowable on a Divina profile
117
+ *
118
+ * Note: Stops at the first matching profile.
119
+ */
120
+ get effectiveLayout(): Layout | null;
121
+ /**
122
+ * Computes a [ReadingProgression] when the value of [readingProgression] is undefined, using the publication language.
97
123
  *
98
124
  * See this issue for more details: https://github.com/readium/architecture/issues/113
99
125
  */
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Registered profiles.
3
+ * https://readium.org/webpub-manifest/profiles/
4
+ */
5
+ export declare enum Profile {
6
+ EPUB = "https://readium.org/webpub-manifest/profiles/epub",
7
+ AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook",
8
+ DIVINA = "https://readium.org/webpub-manifest/profiles/divina",
9
+ PDF = "https://readium.org/webpub-manifest/profiles/pdf"
10
+ }
@@ -1,3 +1,8 @@
1
+ export declare enum Page {
2
+ left = "left",
3
+ right = "right",
4
+ center = "center"
5
+ }
1
6
  /**
2
7
  * Properties associated to the linked resource.
3
8
  *
@@ -11,6 +16,7 @@ export declare class Properties {
11
16
  constructor(values: {
12
17
  [key: string]: any;
13
18
  });
19
+ get page(): Page | undefined;
14
20
  /**
15
21
  * Creates a [Properties] from its RWPM JSON representation.
16
22
  */
@@ -1,9 +1,6 @@
1
- import { Page } from './presentation/Presentation';
1
+ import { Page } from "./Properties";
2
2
  export declare enum ReadingProgression {
3
- auto = "auto",
4
- btt = "btt",
5
3
  ltr = "ltr",
6
- rtl = "rtl",
7
- ttb = "ttb"
4
+ rtl = "rtl"
8
5
  }
9
6
  export declare function leadingPage(readingProgression: ReadingProgression): Page;