@readium/shared 1.2.1 → 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.
- package/dist/index.js +1256 -1152
- package/dist/index.umd.cjs +3 -3
- package/package.json +11 -10
- package/src/publication/AltIdentifier.ts +58 -0
- package/src/publication/Contributor.ts +15 -0
- package/src/publication/GuidedNavigation.ts +126 -15
- package/src/publication/Layout.ts +13 -0
- package/src/publication/Link.ts +9 -1
- package/src/publication/Manifest.ts +5 -5
- package/src/publication/Metadata.ts +77 -8
- package/src/publication/Profiles.ts +15 -0
- package/src/publication/Properties.ts +10 -0
- package/src/publication/Publication.ts +2 -2
- package/src/publication/ReadingProgression.ts +2 -15
- package/src/publication/TDM.ts +56 -0
- package/src/publication/epub/MediaOverlay.ts +43 -0
- package/src/publication/epub/Metadata.ts +16 -0
- package/src/publication/epub/Properties.ts +0 -10
- package/src/publication/epub/index.ts +2 -2
- package/src/publication/index.ts +4 -1
- package/src/util/JSONParse.ts +3 -3
- package/types/src/publication/AltIdentifier.d.ts +23 -0
- package/types/src/publication/Contributor.d.ts +4 -0
- package/types/src/publication/GuidedNavigation.d.ts +62 -9
- package/types/src/publication/Layout.d.ts +8 -0
- package/types/src/publication/Link.d.ts +3 -0
- package/types/src/publication/Manifest.d.ts +2 -2
- package/types/src/publication/Metadata.d.ts +25 -2
- package/types/src/publication/Profiles.d.ts +10 -0
- package/types/src/publication/Properties.d.ts +6 -0
- package/types/src/publication/Publication.d.ts +1 -1
- package/types/src/publication/ReadingProgression.d.ts +2 -5
- package/types/src/publication/TDM.d.ts +30 -0
- package/types/src/publication/accessibility/Accessibility.d.ts +196 -0
- package/types/src/publication/accessibility/AccessibilityMetadataDisplayGuide.d.ts +211 -0
- package/types/src/publication/accessibility/Localization.d.ts +37 -0
- package/types/src/publication/accessibility/index.d.ts +3 -0
- package/types/src/publication/epub/MediaOverlay.d.ts +19 -0
- package/types/src/publication/epub/Metadata.d.ts +6 -0
- package/types/src/publication/epub/Properties.d.ts +1 -5
- package/types/src/publication/epub/index.d.ts +2 -2
- package/types/src/publication/index.d.ts +4 -1
- package/types/src/util/JSONParse.d.ts +2 -2
- package/LICENSE +0 -28
- package/src/publication/epub/EPUBLayout.ts +0 -10
- package/src/publication/epub/Presentation.ts +0 -16
- package/src/publication/presentation/Metadata.ts +0 -19
- package/src/publication/presentation/Presentation.ts +0 -155
- package/src/publication/presentation/Properties.ts +0 -70
- package/src/publication/presentation/index.ts +0 -3
- package/types/src/publication/epub/EPUBLayout.d.ts +0 -5
- package/types/src/publication/epub/Presentation.d.ts +0 -7
- package/types/src/publication/presentation/Metadata.d.ts +0 -6
- package/types/src/publication/presentation/Presentation.d.ts +0 -95
- package/types/src/publication/presentation/Properties.d.ts +0 -32
- package/types/src/publication/presentation/index.d.ts +0 -3
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Holds the accessibility metadata of a Publication.
|
|
3
|
+
*
|
|
4
|
+
* https://www.w3.org/2021/a11y-discov-vocab/latest/
|
|
5
|
+
* https://readium.org/webpub-manifest/schema/a11y.schema.json
|
|
6
|
+
*/
|
|
7
|
+
export declare class Accessibility {
|
|
8
|
+
/**
|
|
9
|
+
* An established standard to which the described resource conforms.
|
|
10
|
+
*/
|
|
11
|
+
conformsTo: AccessibilityProfile[];
|
|
12
|
+
/**
|
|
13
|
+
* Certification of accessible publications.
|
|
14
|
+
*/
|
|
15
|
+
certification: Certification | null;
|
|
16
|
+
/**
|
|
17
|
+
* A human-readable summary of specific accessibility features or deficiencies.
|
|
18
|
+
*/
|
|
19
|
+
summary: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* The human sensory perceptual system through which a person may process or perceive information.
|
|
22
|
+
*/
|
|
23
|
+
accessMode: AccessMode[];
|
|
24
|
+
/**
|
|
25
|
+
* A list of single or combined accessModes that are sufficient to understand all the intellectual content.
|
|
26
|
+
*/
|
|
27
|
+
accessModeSufficient: PrimaryAccessMode[];
|
|
28
|
+
/**
|
|
29
|
+
* Content features of the resource.
|
|
30
|
+
*/
|
|
31
|
+
feature: Feature[];
|
|
32
|
+
/**
|
|
33
|
+
* A characteristic of the described resource that is physiologically dangerous to some users.
|
|
34
|
+
*/
|
|
35
|
+
hazard: Hazard[];
|
|
36
|
+
/**
|
|
37
|
+
* Justifications for non-conformance based on exemptions in a given jurisdiction.
|
|
38
|
+
*/
|
|
39
|
+
exemption: Exemption[];
|
|
40
|
+
constructor(values?: {
|
|
41
|
+
conformsTo?: AccessibilityProfile[];
|
|
42
|
+
certification?: Certification | null;
|
|
43
|
+
summary?: string | null;
|
|
44
|
+
accessMode?: AccessMode[];
|
|
45
|
+
accessModeSufficient?: PrimaryAccessMode[];
|
|
46
|
+
feature?: Feature[];
|
|
47
|
+
hazard?: Hazard[];
|
|
48
|
+
exemption?: Exemption[];
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Parses an [Accessibility] from its RWPM JSON representation.
|
|
52
|
+
*/
|
|
53
|
+
static deserialize(json: Record<string, any> | string): Accessibility | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Serializes an [Accessibility] to its RWPM JSON representation.
|
|
56
|
+
*/
|
|
57
|
+
serialize(): Record<string, any>;
|
|
58
|
+
}
|
|
59
|
+
export declare class AccessibilityProfile {
|
|
60
|
+
readonly uri: string;
|
|
61
|
+
constructor(uri: string);
|
|
62
|
+
static deserialize(json: any): AccessibilityProfile | undefined;
|
|
63
|
+
serialize(): any;
|
|
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
|
+
get isWCAGLevelA(): boolean;
|
|
77
|
+
get isWCAGLevelAA(): boolean;
|
|
78
|
+
get isWCAGLevelAAA(): boolean;
|
|
79
|
+
}
|
|
80
|
+
export declare class Certification {
|
|
81
|
+
readonly certifiedBy: string | null;
|
|
82
|
+
readonly credential: string | null;
|
|
83
|
+
readonly report: string | null;
|
|
84
|
+
constructor(certifiedBy?: string | null, credential?: string | null, report?: string | null);
|
|
85
|
+
static deserialize(json: any): Certification | undefined;
|
|
86
|
+
serialize(): Record<string, any>;
|
|
87
|
+
}
|
|
88
|
+
export declare class AccessMode {
|
|
89
|
+
readonly value: string;
|
|
90
|
+
constructor(value: string);
|
|
91
|
+
static deserialize(json: any): AccessMode | undefined;
|
|
92
|
+
serialize(): any;
|
|
93
|
+
static readonly AUDITORY: AccessMode;
|
|
94
|
+
static readonly CHART_ON_VISUAL: AccessMode;
|
|
95
|
+
static readonly CHEM_ON_VISUAL: AccessMode;
|
|
96
|
+
static readonly COLOR_DEPENDENT: AccessMode;
|
|
97
|
+
static readonly DIAGRAM_ON_VISUAL: AccessMode;
|
|
98
|
+
static readonly MATH_ON_VISUAL: AccessMode;
|
|
99
|
+
static readonly MUSIC_ON_VISUAL: AccessMode;
|
|
100
|
+
static readonly TACTILE: AccessMode;
|
|
101
|
+
static readonly TEXT_ON_VISUAL: AccessMode;
|
|
102
|
+
static readonly TEXTUAL: AccessMode;
|
|
103
|
+
static readonly VISUAL: AccessMode;
|
|
104
|
+
}
|
|
105
|
+
export declare class PrimaryAccessMode {
|
|
106
|
+
readonly value: string | string[];
|
|
107
|
+
private static readonly VALID_MODES;
|
|
108
|
+
constructor(value: string | string[]);
|
|
109
|
+
static deserialize(json: any): PrimaryAccessMode | undefined;
|
|
110
|
+
serialize(): string | string[];
|
|
111
|
+
static readonly AUDITORY: PrimaryAccessMode;
|
|
112
|
+
static readonly TACTILE: PrimaryAccessMode;
|
|
113
|
+
static readonly TEXTUAL: PrimaryAccessMode;
|
|
114
|
+
static readonly VISUAL: PrimaryAccessMode;
|
|
115
|
+
}
|
|
116
|
+
export declare class Feature {
|
|
117
|
+
readonly value: string;
|
|
118
|
+
constructor(value: string);
|
|
119
|
+
static deserialize(json: any): Feature | undefined;
|
|
120
|
+
serialize(): any;
|
|
121
|
+
static readonly NONE: Feature;
|
|
122
|
+
static readonly ANNOTATIONS: Feature;
|
|
123
|
+
static readonly ARIA: Feature;
|
|
124
|
+
static readonly INDEX: Feature;
|
|
125
|
+
static readonly PAGE_BREAK_MARKERS: Feature;
|
|
126
|
+
static readonly PAGE_NAVIGATION: Feature;
|
|
127
|
+
static readonly PRINT_PAGE_NUMBERS: Feature;
|
|
128
|
+
static readonly READING_ORDER: Feature;
|
|
129
|
+
static readonly STRUCTURAL_NAVIGATION: Feature;
|
|
130
|
+
static readonly TABLE_OF_CONTENTS: Feature;
|
|
131
|
+
static readonly TAGGED_PDF: Feature;
|
|
132
|
+
static readonly ALTERNATIVE_TEXT: Feature;
|
|
133
|
+
static readonly AUDIO_DESCRIPTION: Feature;
|
|
134
|
+
static readonly CAPTIONS: Feature;
|
|
135
|
+
static readonly CLOSED_CAPTIONS: Feature;
|
|
136
|
+
static readonly DESCRIBED_MATH: Feature;
|
|
137
|
+
static readonly LONG_DESCRIPTION: Feature;
|
|
138
|
+
static readonly OPEN_CAPTIONS: Feature;
|
|
139
|
+
static readonly SIGN_LANGUAGE: Feature;
|
|
140
|
+
static readonly TRANSCRIPT: Feature;
|
|
141
|
+
static readonly DISPLAY_TRANSFORMABILITY: Feature;
|
|
142
|
+
static readonly SYNCHRONIZED_AUDIO_TEXT: Feature;
|
|
143
|
+
static readonly TIMING_CONTROL: Feature;
|
|
144
|
+
static readonly UNLOCKED: Feature;
|
|
145
|
+
static readonly CHEM_ML: Feature;
|
|
146
|
+
static readonly LATEX: Feature;
|
|
147
|
+
static readonly LATEX_CHEMISTRY: Feature;
|
|
148
|
+
static readonly MATH_ML: Feature;
|
|
149
|
+
static readonly MATH_ML_CHEMISTRY: Feature;
|
|
150
|
+
static readonly TTS_MARKUP: Feature;
|
|
151
|
+
static readonly HIGH_CONTRAST_AUDIO: Feature;
|
|
152
|
+
static readonly HIGH_CONTRAST_DISPLAY: Feature;
|
|
153
|
+
static readonly LARGE_PRINT: Feature;
|
|
154
|
+
static readonly BRAILLE: Feature;
|
|
155
|
+
static readonly TACTILE_GRAPHIC: Feature;
|
|
156
|
+
static readonly TACTILE_OBJECT: Feature;
|
|
157
|
+
static readonly FULL_RUBY_ANNOTATIONS: Feature;
|
|
158
|
+
static readonly HORIZONTAL_WRITING: Feature;
|
|
159
|
+
static readonly RUBY_ANNOTATIONS: Feature;
|
|
160
|
+
static readonly VERTICAL_WRITING: Feature;
|
|
161
|
+
static readonly WITH_ADDITIONAL_WORD_SEGMENTATION: Feature;
|
|
162
|
+
static readonly WITHOUT_ADDITIONAL_WORD_SEGMENTATION: Feature;
|
|
163
|
+
}
|
|
164
|
+
export declare class Hazard {
|
|
165
|
+
readonly value: string;
|
|
166
|
+
constructor(value: string);
|
|
167
|
+
static deserialize(json: any): Hazard | undefined;
|
|
168
|
+
serialize(): any;
|
|
169
|
+
static readonly FLASHING: Hazard;
|
|
170
|
+
static readonly NO_FLASHING_HAZARD: Hazard;
|
|
171
|
+
static readonly UNKNOWN_FLASHING_HAZARD: Hazard;
|
|
172
|
+
static readonly MOTION_SIMULATION: Hazard;
|
|
173
|
+
static readonly NO_MOTION_SIMULATION_HAZARD: Hazard;
|
|
174
|
+
static readonly UNKNOWN_MOTION_SIMULATION_HAZARD: Hazard;
|
|
175
|
+
static readonly SOUND: Hazard;
|
|
176
|
+
static readonly NO_SOUND_HAZARD: Hazard;
|
|
177
|
+
static readonly UNKNOWN_SOUND_HAZARD: Hazard;
|
|
178
|
+
static readonly UNKNOWN: Hazard;
|
|
179
|
+
static readonly NONE: Hazard;
|
|
180
|
+
}
|
|
181
|
+
export declare class Exemption {
|
|
182
|
+
readonly value: string;
|
|
183
|
+
constructor(value: string);
|
|
184
|
+
static deserialize(json: any): Exemption | undefined;
|
|
185
|
+
serialize(): any;
|
|
186
|
+
static readonly NONE: Exemption;
|
|
187
|
+
static readonly DOCUMENTED: Exemption;
|
|
188
|
+
static readonly LEGAL: Exemption;
|
|
189
|
+
static readonly TEMPORARY: Exemption;
|
|
190
|
+
static readonly TECHNICAL: Exemption;
|
|
191
|
+
static readonly EAA_DISPROPORTIONATE_BURDEN: Exemption;
|
|
192
|
+
static readonly EAA_FUNDAMENTAL_ALTERATION: Exemption;
|
|
193
|
+
static readonly EAA_MICROENTERPRISE: Exemption;
|
|
194
|
+
static readonly EAA_TECHNICAL_IMPOSSIBILITY: Exemption;
|
|
195
|
+
static readonly EAA_TEMPORARY: Exemption;
|
|
196
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { Publication } from '../Publication';
|
|
2
|
+
import { AccessibilityProfile } from './Accessibility';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a single accessibility claim
|
|
5
|
+
*/
|
|
6
|
+
export interface AccessibilityDisplayStatement {
|
|
7
|
+
id: string;
|
|
8
|
+
compactString?: string;
|
|
9
|
+
descriptiveString?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Represents a collection of related accessibility claims which should be
|
|
13
|
+
* displayed together in a section
|
|
14
|
+
*/
|
|
15
|
+
export interface AccessibilityDisplayField {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
statements: AccessibilityDisplayStatement[];
|
|
19
|
+
shouldDisplay: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Represents the different ways visual adjustments can be made
|
|
23
|
+
*/
|
|
24
|
+
export declare enum VisualAdjustments {
|
|
25
|
+
Unknown = "unknown",
|
|
26
|
+
Modifiable = "modifiable",
|
|
27
|
+
Unmodifiable = "unmodifiable"
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Represents the different types of non-visual reading
|
|
31
|
+
*/
|
|
32
|
+
export declare enum NonvisualReading {
|
|
33
|
+
NoMetadata = "noMetadata",
|
|
34
|
+
Readable = "readable",
|
|
35
|
+
NotFully = "notFully",
|
|
36
|
+
Unreadable = "unreadable"
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Represents the different types of prerecorded audio
|
|
40
|
+
*/
|
|
41
|
+
export declare enum PrerecordedAudio {
|
|
42
|
+
NoMetadata = "noMetadata",
|
|
43
|
+
Synchronized = "synchronized",
|
|
44
|
+
AudioOnly = "audioOnly",
|
|
45
|
+
AudioComplementary = "audioComplementary"
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The ways of reading display field is a banner heading that groups
|
|
49
|
+
* together the following information about how the content facilitates
|
|
50
|
+
* access.
|
|
51
|
+
*/
|
|
52
|
+
export declare class WaysOfReading implements AccessibilityDisplayField {
|
|
53
|
+
readonly id = "ways-of-reading.title";
|
|
54
|
+
readonly title: string;
|
|
55
|
+
readonly shouldDisplay: boolean;
|
|
56
|
+
readonly visualAdjustments: VisualAdjustments;
|
|
57
|
+
readonly nonvisualReading: NonvisualReading;
|
|
58
|
+
readonly nonvisualReadingAltText: boolean;
|
|
59
|
+
readonly prerecordedAudio: PrerecordedAudio;
|
|
60
|
+
readonly statements: AccessibilityDisplayStatement[];
|
|
61
|
+
private constructor();
|
|
62
|
+
static fromPublication(publication: Publication): WaysOfReading;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Navigation features of the content
|
|
66
|
+
*/
|
|
67
|
+
export declare class Navigation implements AccessibilityDisplayField {
|
|
68
|
+
readonly id = "navigation.title";
|
|
69
|
+
readonly title: string;
|
|
70
|
+
readonly shouldDisplay: boolean;
|
|
71
|
+
readonly noMetadata: boolean;
|
|
72
|
+
readonly tableOfContents: boolean;
|
|
73
|
+
readonly index: boolean;
|
|
74
|
+
readonly headings: boolean;
|
|
75
|
+
readonly page: boolean;
|
|
76
|
+
readonly statements: AccessibilityDisplayStatement[];
|
|
77
|
+
private constructor();
|
|
78
|
+
static fromPublication(publication: Publication): Navigation;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Represents the different types of rich content
|
|
82
|
+
*/
|
|
83
|
+
export declare enum RichContentType {
|
|
84
|
+
Math = "math",
|
|
85
|
+
Chemistry = "chemistry",
|
|
86
|
+
Music = "music",
|
|
87
|
+
Diagram = "diagram",
|
|
88
|
+
Chart = "chart",
|
|
89
|
+
Graph = "graph",
|
|
90
|
+
Table = "table",
|
|
91
|
+
Image = "image"
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Rich content features of the content
|
|
95
|
+
*/
|
|
96
|
+
export declare class RichContent implements AccessibilityDisplayField {
|
|
97
|
+
readonly id = "rich-content.title";
|
|
98
|
+
readonly title: string;
|
|
99
|
+
readonly shouldDisplay: boolean;
|
|
100
|
+
readonly noMetadata: boolean;
|
|
101
|
+
readonly extendedAltTextDescriptions: boolean;
|
|
102
|
+
readonly mathFormula: boolean;
|
|
103
|
+
readonly mathFormulaAsMathML: boolean;
|
|
104
|
+
readonly mathFormulaAsLaTeX: boolean;
|
|
105
|
+
readonly chemicalFormulaAsMathML: boolean;
|
|
106
|
+
readonly chemicalFormulaAsLaTeX: boolean;
|
|
107
|
+
readonly closedCaptions: boolean;
|
|
108
|
+
readonly openCaptions: boolean;
|
|
109
|
+
readonly transcript: boolean;
|
|
110
|
+
readonly statements: AccessibilityDisplayStatement[];
|
|
111
|
+
private constructor();
|
|
112
|
+
static fromPublication(publication: Publication): RichContent;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Represents additional accessibility information
|
|
116
|
+
*/
|
|
117
|
+
export declare class AdditionalInformation implements AccessibilityDisplayField {
|
|
118
|
+
readonly id = "additional-accessibility-information.title";
|
|
119
|
+
readonly title: string;
|
|
120
|
+
readonly shouldDisplay: boolean;
|
|
121
|
+
readonly noMetadata: boolean;
|
|
122
|
+
readonly pageBreakMarkers: boolean;
|
|
123
|
+
readonly aria: boolean;
|
|
124
|
+
readonly audioDescriptions: boolean;
|
|
125
|
+
readonly braille: boolean;
|
|
126
|
+
readonly rubyAnnotations: boolean;
|
|
127
|
+
readonly fullRubyAnnotations: boolean;
|
|
128
|
+
readonly highAudioContrast: boolean;
|
|
129
|
+
readonly highDisplayContrast: boolean;
|
|
130
|
+
readonly largePrint: boolean;
|
|
131
|
+
readonly signLanguage: boolean;
|
|
132
|
+
readonly tactileGraphics: boolean;
|
|
133
|
+
readonly tactileObjects: boolean;
|
|
134
|
+
readonly textToSpeechHinting: boolean;
|
|
135
|
+
readonly statements: AccessibilityDisplayStatement[];
|
|
136
|
+
private constructor();
|
|
137
|
+
static fromPublication(publication: Publication): AdditionalInformation;
|
|
138
|
+
}
|
|
139
|
+
export declare enum HazardType {
|
|
140
|
+
yes = "yes",
|
|
141
|
+
no = "no",
|
|
142
|
+
unknown = "unknown",
|
|
143
|
+
noMetadata = "noMetadata"
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Represents potential hazards in the content
|
|
147
|
+
*/
|
|
148
|
+
export declare class Hazards implements AccessibilityDisplayField {
|
|
149
|
+
readonly id = "hazards.title";
|
|
150
|
+
readonly title: string;
|
|
151
|
+
readonly shouldDisplay: boolean;
|
|
152
|
+
readonly noMetadata: boolean;
|
|
153
|
+
readonly noHazards: boolean;
|
|
154
|
+
readonly unknown: boolean;
|
|
155
|
+
readonly flashing: HazardType;
|
|
156
|
+
readonly motion: HazardType;
|
|
157
|
+
readonly sound: HazardType;
|
|
158
|
+
readonly statements: AccessibilityDisplayStatement[];
|
|
159
|
+
private constructor();
|
|
160
|
+
static fromPublication(publication: Publication): Hazards;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Represents conformance to accessibility standards
|
|
164
|
+
*/
|
|
165
|
+
export declare class Conformance implements AccessibilityDisplayField {
|
|
166
|
+
readonly id = "conformance.title";
|
|
167
|
+
readonly title: string;
|
|
168
|
+
readonly shouldDisplay: boolean;
|
|
169
|
+
readonly profiles: AccessibilityProfile[];
|
|
170
|
+
readonly statements: AccessibilityDisplayStatement[];
|
|
171
|
+
private constructor();
|
|
172
|
+
static fromPublication(publication: Publication): Conformance;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Represents legal exemptions
|
|
176
|
+
*/
|
|
177
|
+
export declare class Legal implements AccessibilityDisplayField {
|
|
178
|
+
readonly id = "legal-considerations.title";
|
|
179
|
+
readonly title: string;
|
|
180
|
+
readonly shouldDisplay: boolean;
|
|
181
|
+
readonly exemption: boolean;
|
|
182
|
+
readonly statements: AccessibilityDisplayStatement[];
|
|
183
|
+
private constructor();
|
|
184
|
+
static fromPublication(publication: Publication): Legal;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Represents the accessibility summary
|
|
188
|
+
*/
|
|
189
|
+
export declare class AccessibilitySummary implements AccessibilityDisplayField {
|
|
190
|
+
readonly id = "accessibility-summary.title";
|
|
191
|
+
readonly title: string;
|
|
192
|
+
readonly shouldDisplay: boolean;
|
|
193
|
+
readonly statements: AccessibilityDisplayStatement[];
|
|
194
|
+
private constructor();
|
|
195
|
+
static fromPublication(publication: Publication): AccessibilitySummary;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Main accessibility metadata display guide
|
|
199
|
+
*/
|
|
200
|
+
export declare class AccessibilityMetadataDisplayGuide {
|
|
201
|
+
readonly waysOfReading: WaysOfReading;
|
|
202
|
+
readonly navigation: Navigation;
|
|
203
|
+
readonly richContent: RichContent;
|
|
204
|
+
readonly additionalInformation: AdditionalInformation;
|
|
205
|
+
readonly hazards: Hazards;
|
|
206
|
+
readonly conformance: Conformance;
|
|
207
|
+
readonly legal: Legal;
|
|
208
|
+
readonly accessibilitySummary: AccessibilitySummary;
|
|
209
|
+
readonly fields: AccessibilityDisplayField[];
|
|
210
|
+
constructor(publication: Publication);
|
|
211
|
+
}
|
|
@@ -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 {};
|
|
@@ -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
|
+
}
|
|
@@ -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 {};
|
|
@@ -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';
|
|
@@ -7,5 +7,5 @@ export declare function datefromJSON(json: any): Date | undefined;
|
|
|
7
7
|
export declare function numberfromJSON(json: any): number | undefined;
|
|
8
8
|
/** Parses a numeric value, but returns undefined if it is not a positive number. */
|
|
9
9
|
export declare function positiveNumberfromJSON(json: any): number | undefined;
|
|
10
|
-
/** Converts a Set
|
|
11
|
-
export declare function setToArray(obj: Set<
|
|
10
|
+
/** Converts a Set to an Array object */
|
|
11
|
+
export declare function setToArray(obj: Set<any>): Array<any>;
|
package/LICENSE
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
BSD 3-Clause License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022, Readium Foundation
|
|
4
|
-
|
|
5
|
-
Redistribution and use in source and binary forms, with or without
|
|
6
|
-
modification, are permitted provided that the following conditions are met:
|
|
7
|
-
|
|
8
|
-
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
-
list of conditions and the following disclaimer.
|
|
10
|
-
|
|
11
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
-
this list of conditions and the following disclaimer in the documentation
|
|
13
|
-
and/or other materials provided with the distribution.
|
|
14
|
-
|
|
15
|
-
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
-
contributors may be used to endorse or promote products derived from
|
|
17
|
-
this software without specific prior written permission.
|
|
18
|
-
|
|
19
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* Copyright 2021 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
|
-
/** Hint about the nature of the layout for the linked resources. */
|
|
7
|
-
export enum EPUBLayout {
|
|
8
|
-
fixed = 'fixed',
|
|
9
|
-
reflowable = 'reflowable',
|
|
10
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Link } from '../Link';
|
|
2
|
-
import { Presentation } from '../presentation/Presentation';
|
|
3
|
-
import { EPUBLayout } from './EPUBLayout';
|
|
4
|
-
|
|
5
|
-
declare module '../presentation/Presentation' {
|
|
6
|
-
export interface Presentation {
|
|
7
|
-
layoutOf(link: Link): EPUBLayout;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/** Determines the layout of the given resource in this publication.
|
|
12
|
-
* Default layout is reflowable.
|
|
13
|
-
*/
|
|
14
|
-
Presentation.prototype.layoutOf = function(link: Link): EPUBLayout {
|
|
15
|
-
return link.properties?.getLayout() || this.layout || EPUBLayout.reflowable;
|
|
16
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Metadata } from '../Metadata';
|
|
2
|
-
import { Presentation } from './Presentation';
|
|
3
|
-
|
|
4
|
-
// Presentation extensions for [Metadata]
|
|
5
|
-
|
|
6
|
-
declare module '../Metadata' {
|
|
7
|
-
export interface Metadata {
|
|
8
|
-
getPresentation(): Presentation | undefined;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
Metadata.prototype.getPresentation = function(): Presentation | undefined {
|
|
13
|
-
const presentation =
|
|
14
|
-
this.otherMetadata?.['presentation'] || this.otherMetadata?.['rendition'];
|
|
15
|
-
|
|
16
|
-
if (!presentation) return;
|
|
17
|
-
|
|
18
|
-
return Presentation.deserialize(presentation);
|
|
19
|
-
};
|