@readium/shared 1.3.0 → 2.0.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 (52) hide show
  1. package/dist/index.js +1253 -1149
  2. package/dist/index.umd.cjs +3 -3
  3. package/package.json +1 -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 +77 -8
  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/epub/MediaOverlay.ts +43 -0
  15. package/src/publication/epub/Metadata.ts +16 -0
  16. package/src/publication/epub/Properties.ts +0 -10
  17. package/src/publication/epub/index.ts +2 -2
  18. package/src/publication/index.ts +4 -1
  19. package/src/util/JSONParse.ts +3 -3
  20. package/types/src/publication/AltIdentifier.d.ts +23 -0
  21. package/types/src/publication/Contributor.d.ts +4 -0
  22. package/types/src/publication/GuidedNavigation.d.ts +62 -9
  23. package/types/src/publication/Layout.d.ts +8 -0
  24. package/types/src/publication/Link.d.ts +3 -0
  25. package/types/src/publication/Metadata.d.ts +25 -2
  26. package/types/src/publication/Profiles.d.ts +10 -0
  27. package/types/src/publication/Properties.d.ts +6 -0
  28. package/types/src/publication/ReadingProgression.d.ts +2 -5
  29. package/types/src/publication/TDM.d.ts +30 -0
  30. package/types/src/publication/accessibility/Accessibility.d.ts +16 -16
  31. package/types/src/publication/accessibility/AccessibilityMetadataDisplayGuide.d.ts +22 -25
  32. package/types/src/publication/accessibility/Localization.d.ts +37 -0
  33. package/types/src/publication/accessibility/index.d.ts +1 -0
  34. package/types/src/publication/epub/MediaOverlay.d.ts +19 -0
  35. package/types/src/publication/epub/Metadata.d.ts +6 -0
  36. package/types/src/publication/epub/Properties.d.ts +1 -5
  37. package/types/src/publication/epub/index.d.ts +2 -2
  38. package/types/src/publication/index.d.ts +4 -1
  39. package/types/src/util/JSONParse.d.ts +2 -2
  40. package/src/publication/epub/EPUBLayout.ts +0 -10
  41. package/src/publication/epub/Presentation.ts +0 -16
  42. package/src/publication/presentation/Metadata.ts +0 -19
  43. package/src/publication/presentation/Presentation.ts +0 -155
  44. package/src/publication/presentation/Properties.ts +0 -70
  45. package/src/publication/presentation/index.ts +0 -3
  46. package/types/src/publication/accessibility/AccessibilityDisplayString.d.ts +0 -56
  47. package/types/src/publication/epub/EPUBLayout.d.ts +0 -5
  48. package/types/src/publication/epub/Presentation.d.ts +0 -7
  49. package/types/src/publication/presentation/Metadata.d.ts +0 -6
  50. package/types/src/publication/presentation/Presentation.d.ts +0 -95
  51. package/types/src/publication/presentation/Properties.d.ts +0 -32
  52. package/types/src/publication/presentation/index.d.ts +0 -3
@@ -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';
@@ -2,8 +2,8 @@ export * from './encryption';
2
2
  export * from './epub';
3
3
  export * from './html';
4
4
  export * from './opds';
5
- export * from './presentation';
6
5
  export * from './services';
6
+ export * from './AltIdentifier';
7
7
  export * from './BelongsTo';
8
8
  export * from './Contributor';
9
9
  export * from './Link';
@@ -12,9 +12,12 @@ export * from './Locator';
12
12
  export * from './LocatorCollection';
13
13
  export * from './Manifest';
14
14
  export * from './Metadata';
15
+ export * from './Profiles';
15
16
  export * from './Properties';
16
17
  export * from './Publication';
17
18
  export * from './PublicationCollection';
19
+ export * from './Layout';
18
20
  export * from './ReadingProgression';
19
21
  export * from './Subject';
22
+ export * from './TDM';
20
23
  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,12 @@
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 { TDM } from './TDM';
6
10
  /**
7
11
  * https://readium.org/webpub-manifest/schema/metadata.schema.json
8
12
  *
@@ -14,7 +18,9 @@ import { Subjects } from './Subject';
14
18
  export declare class Metadata {
15
19
  title: LocalizedString;
16
20
  typeUri?: string;
21
+ conformsTo?: Array<Profile>;
17
22
  identifier?: string;
23
+ altIdentifier?: AltIdentifier;
18
24
  subtitle?: LocalizedString;
19
25
  sortAs?: LocalizedString;
20
26
  artists?: Contributors;
@@ -38,9 +44,11 @@ export declare class Metadata {
38
44
  belongsTo?: BelongsTo;
39
45
  belongsToCollections?: Contributors;
40
46
  belongsToSeries?: Contributors;
47
+ layout?: Layout;
41
48
  readingProgression?: ReadingProgression;
42
49
  duration?: number;
43
50
  numberOfPages?: number;
51
+ tdm?: TDM;
44
52
  otherMetadata?: {
45
53
  [key: string]: any;
46
54
  };
@@ -50,7 +58,9 @@ export declare class Metadata {
50
58
  constructor(values: {
51
59
  title: LocalizedString;
52
60
  typeUri?: string;
61
+ conformsTo?: Array<Profile>;
53
62
  identifier?: string;
63
+ altIdentifier?: AltIdentifier;
54
64
  subtitle?: LocalizedString;
55
65
  sortAs?: LocalizedString;
56
66
  artists?: Contributors;
@@ -74,9 +84,11 @@ export declare class Metadata {
74
84
  belongsTo?: BelongsTo;
75
85
  belongsToCollections?: Contributors;
76
86
  belongsToSeries?: Contributors;
87
+ layout?: Layout;
77
88
  readingProgression?: ReadingProgression;
78
89
  duration?: number;
79
90
  numberOfPages?: number;
91
+ tdm?: TDM;
80
92
  otherMetadata?: {
81
93
  [key: string]: any;
82
94
  };
@@ -92,8 +104,19 @@ export declare class Metadata {
92
104
  */
93
105
  serialize(): any;
94
106
  /**
95
- * Computes a [ReadingProgression] when the value of [readingProgression] is set to
96
- * auto, using the publication language.
107
+ * Computes a [Layout] using the [conformsTo] profile and layout property.
108
+ *
109
+ * Special cases:
110
+ * - EPUB profile defaults to reflowable if layout is not present
111
+ * - Divina profile defaults to fixed if layout is not present
112
+ * - Layout is ignored for audiobook and PDF profiles
113
+ * - Layout is ignored if set to reflowable on a Divina profile
114
+ *
115
+ * Note: Stops at the first matching profile.
116
+ */
117
+ get effectiveLayout(): Layout | null;
118
+ /**
119
+ * Computes a [ReadingProgression] when the value of [readingProgression] is undefined, using the publication language.
97
120
  *
98
121
  * See this issue for more details: https://github.com/readium/architecture/issues/113
99
122
  */
@@ -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;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * https://readium.org/webpub-manifest/contexts/default/#text-and-data-mining
3
+ */
4
+ export declare enum TDMReservation {
5
+ all = "all",
6
+ none = "none"
7
+ }
8
+ export declare class TDM {
9
+ /**
10
+ * Indicates whether the publication allows text and data mining.
11
+ */
12
+ readonly reservation?: TDMReservation;
13
+ /**
14
+ * Additional policy information about text and data mining usage.
15
+ */
16
+ readonly policy?: string;
17
+ /** Creates a [TDM] object */
18
+ constructor(values: {
19
+ reservation?: TDMReservation;
20
+ policy?: string;
21
+ });
22
+ /**
23
+ * Parses a [TDM] from its RWPM JSON representation.
24
+ */
25
+ static deserialize(json: any): TDM | undefined;
26
+ /**
27
+ * Serializes a [TDM] to its RWPM JSON representation.
28
+ */
29
+ serialize(): any;
30
+ }
@@ -8,7 +8,7 @@ export declare class Accessibility {
8
8
  /**
9
9
  * An established standard to which the described resource conforms.
10
10
  */
11
- conformsTo: Profile[];
11
+ conformsTo: AccessibilityProfile[];
12
12
  /**
13
13
  * Certification of accessible publications.
14
14
  */
@@ -38,7 +38,7 @@ export declare class Accessibility {
38
38
  */
39
39
  exemption: Exemption[];
40
40
  constructor(values?: {
41
- conformsTo?: Profile[];
41
+ conformsTo?: AccessibilityProfile[];
42
42
  certification?: Certification | null;
43
43
  summary?: string | null;
44
44
  accessMode?: AccessMode[];
@@ -56,23 +56,23 @@ export declare class Accessibility {
56
56
  */
57
57
  serialize(): Record<string, any>;
58
58
  }
59
- export declare class Profile {
59
+ export declare class AccessibilityProfile {
60
60
  readonly uri: string;
61
61
  constructor(uri: string);
62
- static deserialize(json: any): Profile | undefined;
62
+ static deserialize(json: any): AccessibilityProfile | undefined;
63
63
  serialize(): any;
64
- static readonly EPUB_A11Y_10_WCAG_20_A: Profile;
65
- static readonly EPUB_A11Y_10_WCAG_20_AA: Profile;
66
- static readonly EPUB_A11Y_10_WCAG_20_AAA: Profile;
67
- static readonly EPUB_A11Y_11_WCAG_20_A: Profile;
68
- static readonly EPUB_A11Y_11_WCAG_20_AA: Profile;
69
- static readonly EPUB_A11Y_11_WCAG_20_AAA: Profile;
70
- static readonly EPUB_A11Y_11_WCAG_21_A: Profile;
71
- static readonly EPUB_A11Y_11_WCAG_21_AA: Profile;
72
- static readonly EPUB_A11Y_11_WCAG_21_AAA: Profile;
73
- static readonly EPUB_A11Y_11_WCAG_22_A: Profile;
74
- static readonly EPUB_A11Y_11_WCAG_22_AA: Profile;
75
- static readonly EPUB_A11Y_11_WCAG_22_AAA: Profile;
64
+ static readonly EPUB_A11Y_10_WCAG_20_A: AccessibilityProfile;
65
+ static readonly EPUB_A11Y_10_WCAG_20_AA: AccessibilityProfile;
66
+ static readonly EPUB_A11Y_10_WCAG_20_AAA: AccessibilityProfile;
67
+ static readonly EPUB_A11Y_11_WCAG_20_A: AccessibilityProfile;
68
+ static readonly EPUB_A11Y_11_WCAG_20_AA: AccessibilityProfile;
69
+ static readonly EPUB_A11Y_11_WCAG_20_AAA: AccessibilityProfile;
70
+ static readonly EPUB_A11Y_11_WCAG_21_A: AccessibilityProfile;
71
+ static readonly EPUB_A11Y_11_WCAG_21_AA: AccessibilityProfile;
72
+ static readonly EPUB_A11Y_11_WCAG_21_AAA: AccessibilityProfile;
73
+ static readonly EPUB_A11Y_11_WCAG_22_A: AccessibilityProfile;
74
+ static readonly EPUB_A11Y_11_WCAG_22_AA: AccessibilityProfile;
75
+ static readonly EPUB_A11Y_11_WCAG_22_AAA: AccessibilityProfile;
76
76
  get isWCAGLevelA(): boolean;
77
77
  get isWCAGLevelAA(): boolean;
78
78
  get isWCAGLevelAAA(): boolean;
@@ -1,13 +1,12 @@
1
1
  import { Publication } from '../Publication';
2
- import { AccessibilityDisplayString } from './AccessibilityDisplayString';
3
- import { Profile } from './Accessibility';
2
+ import { AccessibilityProfile } from './Accessibility';
4
3
  /**
5
4
  * Represents a single accessibility claim
6
5
  */
7
6
  export interface AccessibilityDisplayStatement {
8
7
  id: string;
9
- displayId: AccessibilityDisplayString;
10
- values?: any[];
8
+ compactString?: string;
9
+ descriptiveString?: string;
11
10
  }
12
11
  /**
13
12
  * Represents a collection of related accessibility claims which should be
@@ -51,8 +50,8 @@ export declare enum PrerecordedAudio {
51
50
  * access.
52
51
  */
53
52
  export declare class WaysOfReading implements AccessibilityDisplayField {
54
- readonly id = AccessibilityDisplayString.WaysOfReadingTitle;
55
- readonly title = "Ways of Reading";
53
+ readonly id = "ways-of-reading.title";
54
+ readonly title: string;
56
55
  readonly shouldDisplay: boolean;
57
56
  readonly visualAdjustments: VisualAdjustments;
58
57
  readonly nonvisualReading: NonvisualReading;
@@ -66,8 +65,8 @@ export declare class WaysOfReading implements AccessibilityDisplayField {
66
65
  * Navigation features of the content
67
66
  */
68
67
  export declare class Navigation implements AccessibilityDisplayField {
69
- readonly id = AccessibilityDisplayString.NavigationTitle;
70
- readonly title = "Navigation";
68
+ readonly id = "navigation.title";
69
+ readonly title: string;
71
70
  readonly shouldDisplay: boolean;
72
71
  readonly noMetadata: boolean;
73
72
  readonly tableOfContents: boolean;
@@ -95,8 +94,8 @@ export declare enum RichContentType {
95
94
  * Rich content features of the content
96
95
  */
97
96
  export declare class RichContent implements AccessibilityDisplayField {
98
- readonly id = AccessibilityDisplayString.RichContentTitle;
99
- readonly title = "Rich Content";
97
+ readonly id = "rich-content.title";
98
+ readonly title: string;
100
99
  readonly shouldDisplay: boolean;
101
100
  readonly noMetadata: boolean;
102
101
  readonly extendedAltTextDescriptions: boolean;
@@ -116,8 +115,8 @@ export declare class RichContent implements AccessibilityDisplayField {
116
115
  * Represents additional accessibility information
117
116
  */
118
117
  export declare class AdditionalInformation implements AccessibilityDisplayField {
119
- readonly id = AccessibilityDisplayString.AdditionalInformationTitle;
120
- readonly title = "Additional Information";
118
+ readonly id = "additional-accessibility-information.title";
119
+ readonly title: string;
121
120
  readonly shouldDisplay: boolean;
122
121
  readonly noMetadata: boolean;
123
122
  readonly pageBreakMarkers: boolean;
@@ -147,8 +146,8 @@ export declare enum HazardType {
147
146
  * Represents potential hazards in the content
148
147
  */
149
148
  export declare class Hazards implements AccessibilityDisplayField {
150
- readonly id = AccessibilityDisplayString.HazardsTitle;
151
- readonly title = "Hazards";
149
+ readonly id = "hazards.title";
150
+ readonly title: string;
152
151
  readonly shouldDisplay: boolean;
153
152
  readonly noMetadata: boolean;
154
153
  readonly noHazards: boolean;
@@ -164,22 +163,21 @@ export declare class Hazards implements AccessibilityDisplayField {
164
163
  * Represents conformance to accessibility standards
165
164
  */
166
165
  export declare class Conformance implements AccessibilityDisplayField {
167
- readonly id = AccessibilityDisplayString.ConformanceTitle;
168
- readonly title = "Conformance";
166
+ readonly id = "conformance.title";
167
+ readonly title: string;
169
168
  readonly shouldDisplay: boolean;
170
- readonly profiles: Profile[];
169
+ readonly profiles: AccessibilityProfile[];
171
170
  readonly statements: AccessibilityDisplayStatement[];
172
171
  private constructor();
173
172
  static fromPublication(publication: Publication): Conformance;
174
173
  }
175
174
  /**
176
- * Represents legal exemptions
177
- */
175
+ * Represents legal exemptions
176
+ */
178
177
  export declare class Legal implements AccessibilityDisplayField {
179
- readonly id = AccessibilityDisplayString.LegalTitle;
180
- readonly title = "Legal";
178
+ readonly id = "legal-considerations.title";
179
+ readonly title: string;
181
180
  readonly shouldDisplay: boolean;
182
- readonly noMetadata: boolean;
183
181
  readonly exemption: boolean;
184
182
  readonly statements: AccessibilityDisplayStatement[];
185
183
  private constructor();
@@ -189,10 +187,9 @@ export declare class Legal implements AccessibilityDisplayField {
189
187
  * Represents the accessibility summary
190
188
  */
191
189
  export declare class AccessibilitySummary implements AccessibilityDisplayField {
192
- readonly id = AccessibilityDisplayString.AccessibilitySummaryTitle;
193
- readonly title = "Accessibility Summary";
190
+ readonly id = "accessibility-summary.title";
191
+ readonly title: string;
194
192
  readonly shouldDisplay: boolean;
195
- readonly hasSummary: boolean;
196
193
  readonly statements: AccessibilityDisplayStatement[];
197
194
  private constructor();
198
195
  static fromPublication(publication: Publication): AccessibilitySummary;
@@ -0,0 +1,37 @@
1
+ export interface L10nString {
2
+ compact: string;
3
+ descriptive: string;
4
+ }
5
+ type LocaleData = Record<string, any>;
6
+ declare class LocalizationImpl {
7
+ private static instance;
8
+ private currentLocaleCode;
9
+ private locale;
10
+ private availableLocales;
11
+ private constructor();
12
+ static getInstance(): LocalizationImpl;
13
+ /**
14
+ * Registers a new locale or updates an existing one
15
+ * @param localeCode BCP 47 language code (e.g., 'en', 'fr-FR')
16
+ * @param localeData The locale data to register
17
+ */
18
+ registerLocale(localeCode: string, localeData: LocaleData): void;
19
+ /**
20
+ * Sets the current locale by language code
21
+ * @param localeCode BCP 47 language code (e.g., 'en', 'fr-FR')
22
+ * @returns boolean indicating if the locale was set successfully
23
+ */
24
+ setLocale(localeCode: string): boolean;
25
+ /**
26
+ * Gets the current locale code (BCP 47)
27
+ */
28
+ getCurrentLocale(): string;
29
+ /**
30
+ * Gets a list of available locale codes
31
+ */
32
+ getAvailableLocales(): string[];
33
+ private getNestedValue;
34
+ getString(key: string): L10nString;
35
+ }
36
+ export declare const Localization: LocalizationImpl;
37
+ export {};
@@ -1,2 +1,3 @@
1
1
  export * from './Accessibility';
2
2
  export * from './AccessibilityMetadataDisplayGuide';
3
+ export * from './Localization';
@@ -0,0 +1,19 @@
1
+ export declare class MediaOverlay {
2
+ /** Author-defined CSS class name to apply to the currently-playing EPUB Content Document element. */
3
+ activeClass?: string;
4
+ /** Author-defined CSS class name to apply to the EPUB Content Document's document element when playback is active. */
5
+ playbackActiveClass?: string;
6
+ /** Creates a MediaOverlay object */
7
+ constructor(values: {
8
+ activeClass?: string;
9
+ playbackActiveClass?: string;
10
+ });
11
+ /**
12
+ * Parses a MediaOverlay from its RWPM JSON representation.
13
+ */
14
+ static deserialize(json: any): MediaOverlay | undefined;
15
+ /**
16
+ * Serializes a MediaOverlay to its RWPM JSON representation.
17
+ */
18
+ serialize(): any;
19
+ }
@@ -0,0 +1,6 @@
1
+ import { MediaOverlay } from "./MediaOverlay";
2
+ declare module '../Metadata' {
3
+ interface Metadata {
4
+ getMediaOverlay(): MediaOverlay | undefined;
5
+ }
6
+ }
@@ -1,4 +1,3 @@
1
- import { EPUBLayout } from './EPUBLayout';
2
1
  declare module '../Properties' {
3
2
  interface Properties {
4
3
  /**
@@ -6,9 +5,6 @@ declare module '../Properties' {
6
5
  * media type.
7
6
  */
8
7
  getContains(): Set<string> | undefined;
9
- /**
10
- * Hints how the layout of the resource should be presented.
11
- */
12
- getLayout(): EPUBLayout | undefined;
13
8
  }
14
9
  }
10
+ export {};
@@ -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';