manifesto.js 4.2.4 → 4.2.6

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 (170) hide show
  1. package/dist-commonjs/Annotation.d.ts +10 -10
  2. package/dist-commonjs/Annotation.js +74 -74
  3. package/dist-commonjs/AnnotationBody.d.ts +9 -9
  4. package/dist-commonjs/AnnotationBody.js +44 -44
  5. package/dist-commonjs/AnnotationList.d.ts +12 -12
  6. package/dist-commonjs/AnnotationList.js +61 -61
  7. package/dist-commonjs/AnnotationPage.d.ts +5 -5
  8. package/dist-commonjs/AnnotationPage.js +27 -27
  9. package/dist-commonjs/Canvas.d.ts +31 -31
  10. package/dist-commonjs/Canvas.js +302 -302
  11. package/dist-commonjs/Collection.d.ts +28 -28
  12. package/dist-commonjs/Collection.js +156 -156
  13. package/dist-commonjs/Duration.d.ts +6 -6
  14. package/dist-commonjs/Duration.js +13 -13
  15. package/dist-commonjs/IAccessToken.d.ts +7 -7
  16. package/dist-commonjs/IAccessToken.js +2 -2
  17. package/dist-commonjs/IExternalImageResourceData.d.ts +5 -5
  18. package/dist-commonjs/IExternalImageResourceData.js +2 -2
  19. package/dist-commonjs/IExternalResource.d.ts +24 -24
  20. package/dist-commonjs/IExternalResource.js +2 -2
  21. package/dist-commonjs/IExternalResourceData.d.ts +6 -6
  22. package/dist-commonjs/IExternalResourceData.js +2 -2
  23. package/dist-commonjs/IExternalResourceOptions.d.ts +3 -3
  24. package/dist-commonjs/IExternalResourceOptions.js +2 -2
  25. package/dist-commonjs/IIIFResource.d.ts +28 -28
  26. package/dist-commonjs/IIIFResource.js +167 -155
  27. package/dist-commonjs/IIIFResource.js.map +1 -1
  28. package/dist-commonjs/IManifestoOptions.d.ts +9 -9
  29. package/dist-commonjs/IManifestoOptions.js +2 -2
  30. package/dist-commonjs/JSONLDResource.d.ts +7 -7
  31. package/dist-commonjs/JSONLDResource.js +22 -22
  32. package/dist-commonjs/LabelValuePair.d.ts +14 -14
  33. package/dist-commonjs/LabelValuePair.js +56 -56
  34. package/dist-commonjs/Language.d.ts +5 -5
  35. package/dist-commonjs/Language.js +2 -2
  36. package/dist-commonjs/LanguageMap.d.ts +8 -8
  37. package/dist-commonjs/LanguageMap.js +32 -32
  38. package/dist-commonjs/Manifest.d.ts +29 -29
  39. package/dist-commonjs/Manifest.js +259 -259
  40. package/dist-commonjs/ManifestResource.d.ts +23 -22
  41. package/dist-commonjs/ManifestResource.js +129 -120
  42. package/dist-commonjs/ManifestResource.js.map +1 -1
  43. package/dist-commonjs/ManifestType.d.ts +5 -5
  44. package/dist-commonjs/ManifestType.js +8 -8
  45. package/dist-commonjs/PropertyValue.d.ts +58 -58
  46. package/dist-commonjs/PropertyValue.js +285 -285
  47. package/dist-commonjs/Range.d.ts +20 -20
  48. package/dist-commonjs/Range.js +197 -197
  49. package/dist-commonjs/Rendering.d.ts +6 -6
  50. package/dist-commonjs/Rendering.js +27 -27
  51. package/dist-commonjs/Resource.d.ts +13 -13
  52. package/dist-commonjs/Resource.js +67 -67
  53. package/dist-commonjs/Sequence.d.ts +30 -30
  54. package/dist-commonjs/Sequence.js +266 -266
  55. package/dist-commonjs/Serialisation.d.ts +11 -11
  56. package/dist-commonjs/Serialisation.js +155 -155
  57. package/dist-commonjs/Service.d.ts +13 -13
  58. package/dist-commonjs/Service.js +60 -60
  59. package/dist-commonjs/Size.d.ts +5 -5
  60. package/dist-commonjs/Size.js +10 -10
  61. package/dist-commonjs/StatusCode.d.ts +6 -6
  62. package/dist-commonjs/StatusCode.js +9 -9
  63. package/dist-commonjs/Thumb.d.ts +11 -11
  64. package/dist-commonjs/Thumb.js +22 -22
  65. package/dist-commonjs/Thumbnail.d.ts +4 -4
  66. package/dist-commonjs/Thumbnail.js +24 -24
  67. package/dist-commonjs/TreeNode.d.ts +15 -15
  68. package/dist-commonjs/TreeNode.js +25 -25
  69. package/dist-commonjs/TreeNodeType.d.ts +5 -5
  70. package/dist-commonjs/TreeNodeType.js +8 -8
  71. package/dist-commonjs/Utils.d.ts +42 -42
  72. package/dist-commonjs/Utils.js +736 -729
  73. package/dist-commonjs/Utils.js.map +1 -1
  74. package/dist-commonjs/index.d.ts +5 -5
  75. package/dist-commonjs/index.js +13 -13
  76. package/dist-commonjs/internal.d.ts +35 -35
  77. package/dist-commonjs/internal.js +33 -33
  78. package/dist-esmodule/Annotation.d.ts +10 -10
  79. package/dist-esmodule/Annotation.js +72 -72
  80. package/dist-esmodule/AnnotationBody.d.ts +9 -9
  81. package/dist-esmodule/AnnotationBody.js +42 -42
  82. package/dist-esmodule/AnnotationList.d.ts +12 -12
  83. package/dist-esmodule/AnnotationList.js +59 -59
  84. package/dist-esmodule/AnnotationPage.d.ts +5 -5
  85. package/dist-esmodule/AnnotationPage.js +25 -25
  86. package/dist-esmodule/Canvas.d.ts +31 -31
  87. package/dist-esmodule/Canvas.js +300 -300
  88. package/dist-esmodule/Collection.d.ts +28 -28
  89. package/dist-esmodule/Collection.js +154 -154
  90. package/dist-esmodule/Duration.d.ts +6 -6
  91. package/dist-esmodule/Duration.js +11 -11
  92. package/dist-esmodule/IAccessToken.d.ts +7 -7
  93. package/dist-esmodule/IExternalImageResourceData.d.ts +5 -5
  94. package/dist-esmodule/IExternalResource.d.ts +24 -24
  95. package/dist-esmodule/IExternalResourceData.d.ts +6 -6
  96. package/dist-esmodule/IExternalResourceOptions.d.ts +3 -3
  97. package/dist-esmodule/IIIFResource.d.ts +28 -28
  98. package/dist-esmodule/IIIFResource.js +165 -153
  99. package/dist-esmodule/IIIFResource.js.map +1 -1
  100. package/dist-esmodule/IManifestoOptions.d.ts +9 -9
  101. package/dist-esmodule/JSONLDResource.d.ts +7 -7
  102. package/dist-esmodule/JSONLDResource.js +20 -20
  103. package/dist-esmodule/LabelValuePair.d.ts +14 -14
  104. package/dist-esmodule/LabelValuePair.js +54 -54
  105. package/dist-esmodule/Language.d.ts +5 -5
  106. package/dist-esmodule/LanguageMap.d.ts +8 -8
  107. package/dist-esmodule/LanguageMap.js +30 -30
  108. package/dist-esmodule/Manifest.d.ts +29 -29
  109. package/dist-esmodule/Manifest.js +257 -257
  110. package/dist-esmodule/ManifestResource.d.ts +23 -22
  111. package/dist-esmodule/ManifestResource.js +127 -118
  112. package/dist-esmodule/ManifestResource.js.map +1 -1
  113. package/dist-esmodule/ManifestType.d.ts +5 -5
  114. package/dist-esmodule/ManifestType.js +6 -6
  115. package/dist-esmodule/PropertyValue.d.ts +58 -58
  116. package/dist-esmodule/PropertyValue.js +283 -283
  117. package/dist-esmodule/Range.d.ts +20 -20
  118. package/dist-esmodule/Range.js +195 -195
  119. package/dist-esmodule/Rendering.d.ts +6 -6
  120. package/dist-esmodule/Rendering.js +25 -25
  121. package/dist-esmodule/Resource.d.ts +13 -13
  122. package/dist-esmodule/Resource.js +65 -65
  123. package/dist-esmodule/Sequence.d.ts +30 -30
  124. package/dist-esmodule/Sequence.js +264 -264
  125. package/dist-esmodule/Serialisation.d.ts +11 -11
  126. package/dist-esmodule/Serialisation.js +153 -153
  127. package/dist-esmodule/Service.d.ts +13 -13
  128. package/dist-esmodule/Service.js +58 -58
  129. package/dist-esmodule/Size.d.ts +5 -5
  130. package/dist-esmodule/Size.js +8 -8
  131. package/dist-esmodule/StatusCode.d.ts +6 -6
  132. package/dist-esmodule/StatusCode.js +7 -7
  133. package/dist-esmodule/Thumb.d.ts +11 -11
  134. package/dist-esmodule/Thumb.js +20 -20
  135. package/dist-esmodule/Thumbnail.d.ts +4 -4
  136. package/dist-esmodule/Thumbnail.js +22 -22
  137. package/dist-esmodule/TreeNode.d.ts +15 -15
  138. package/dist-esmodule/TreeNode.js +23 -23
  139. package/dist-esmodule/TreeNodeType.d.ts +5 -5
  140. package/dist-esmodule/TreeNodeType.js +6 -6
  141. package/dist-esmodule/Utils.d.ts +42 -42
  142. package/dist-esmodule/Utils.js +734 -727
  143. package/dist-esmodule/Utils.js.map +1 -1
  144. package/dist-esmodule/index.d.ts +5 -5
  145. package/dist-esmodule/index.js +8 -8
  146. package/dist-esmodule/internal.d.ts +35 -35
  147. package/dist-esmodule/internal.js +28 -28
  148. package/dist-umd/manifesto.js +1 -1
  149. package/dist-var/manifesto.js +1 -1
  150. package/package.json +1 -1
  151. package/pkg-tests/README.md +9 -0
  152. package/pkg-tests/index.esm.html +29 -0
  153. package/pkg-tests/index.umd.html +16 -0
  154. package/pkg-tests/node-load.js +8 -0
  155. package/pkg-tests/node-load.mjs +4 -0
  156. package/pkg-tests/node-umd.js +8 -0
  157. package/test/fixtures/RHUL.json +433 -0
  158. package/test/fixtures/manifests.js +1 -0
  159. package/test/index.js +3 -0
  160. package/test/tests/get-range-by-id.js +22 -0
  161. package/test/tests/rhul.js +18 -0
  162. package/types/index.d.ts +466 -465
  163. package/coverage/coverage-final.json +0 -2
  164. package/coverage/lcov-report/base.css +0 -182
  165. package/coverage/lcov-report/index.html +0 -60
  166. package/coverage/lcov-report/prettify.css +0 -1
  167. package/coverage/lcov-report/prettify.js +0 -1
  168. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  169. package/coverage/lcov-report/sorter.js +0 -156
  170. package/coverage/lcov.info +0 -0
@@ -1,10 +1,10 @@
1
- import { AnnotationMotivation } from "@iiif/vocabulary/dist-commonjs";
2
- import { AnnotationBody, IManifestoOptions, ManifestResource, Resource } from "./internal";
3
- export declare class Annotation extends ManifestResource {
4
- constructor(jsonld: any, options: IManifestoOptions);
5
- getBody(): AnnotationBody[];
6
- getMotivation(): AnnotationMotivation | null;
7
- getOn(): string;
8
- getTarget(): string | null;
9
- getResource(): Resource;
10
- }
1
+ import { AnnotationMotivation } from "@iiif/vocabulary/dist-commonjs";
2
+ import { AnnotationBody, IManifestoOptions, ManifestResource, Resource } from "./internal";
3
+ export declare class Annotation extends ManifestResource {
4
+ constructor(jsonld: any, options: IManifestoOptions);
5
+ getBody(): AnnotationBody[];
6
+ getMotivation(): AnnotationMotivation | null;
7
+ getOn(): string;
8
+ getTarget(): string | null;
9
+ getResource(): Resource;
10
+ }
@@ -1,75 +1,75 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- var internal_1 = require("./internal");
17
- var Annotation = /** @class */ (function (_super) {
18
- __extends(Annotation, _super);
19
- function Annotation(jsonld, options) {
20
- return _super.call(this, jsonld, options) || this;
21
- }
22
- Annotation.prototype.getBody = function () {
23
- var bodies = [];
24
- var body = this.getProperty("body");
25
- // todo: make this a generic "property that can be an object or array enumerator" util
26
- if (body) {
27
- if (Array.isArray(body)) {
28
- for (var i = 0; i < body.length; i++) {
29
- var b = body[i];
30
- if (b.items) {
31
- for (var i_1 = 0; i_1 < b.items.length; i_1++) {
32
- // todo: don't ignore that it's a choice. maybe add isChoice() to IAnnotationBody?
33
- var c = b.items[i_1];
34
- bodies.push(new internal_1.AnnotationBody(c, this.options));
35
- }
36
- }
37
- else {
38
- bodies.push(new internal_1.AnnotationBody(b, this.options));
39
- }
40
- }
41
- }
42
- else if (body.items) {
43
- for (var i = 0; i < body.items.length; i++) {
44
- var b = body.items[i];
45
- bodies.push(new internal_1.AnnotationBody(b, this.options));
46
- }
47
- }
48
- else {
49
- bodies.push(new internal_1.AnnotationBody(body, this.options));
50
- }
51
- }
52
- return bodies;
53
- };
54
- Annotation.prototype.getMotivation = function () {
55
- var motivation = this.getProperty("motivation");
56
- if (motivation) {
57
- //const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation);
58
- return motivation;
59
- }
60
- return null;
61
- };
62
- // open annotation
63
- Annotation.prototype.getOn = function () {
64
- return this.getProperty("on");
65
- };
66
- Annotation.prototype.getTarget = function () {
67
- return this.getProperty("target");
68
- };
69
- Annotation.prototype.getResource = function () {
70
- return new internal_1.Resource(this.getProperty("resource"), this.options);
71
- };
72
- return Annotation;
73
- }(internal_1.ManifestResource));
74
- exports.Annotation = Annotation;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ var internal_1 = require("./internal");
17
+ var Annotation = /** @class */ (function (_super) {
18
+ __extends(Annotation, _super);
19
+ function Annotation(jsonld, options) {
20
+ return _super.call(this, jsonld, options) || this;
21
+ }
22
+ Annotation.prototype.getBody = function () {
23
+ var bodies = [];
24
+ var body = this.getProperty("body");
25
+ // todo: make this a generic "property that can be an object or array enumerator" util
26
+ if (body) {
27
+ if (Array.isArray(body)) {
28
+ for (var i = 0; i < body.length; i++) {
29
+ var b = body[i];
30
+ if (b.items) {
31
+ for (var i_1 = 0; i_1 < b.items.length; i_1++) {
32
+ // todo: don't ignore that it's a choice. maybe add isChoice() to IAnnotationBody?
33
+ var c = b.items[i_1];
34
+ bodies.push(new internal_1.AnnotationBody(c, this.options));
35
+ }
36
+ }
37
+ else {
38
+ bodies.push(new internal_1.AnnotationBody(b, this.options));
39
+ }
40
+ }
41
+ }
42
+ else if (body.items) {
43
+ for (var i = 0; i < body.items.length; i++) {
44
+ var b = body.items[i];
45
+ bodies.push(new internal_1.AnnotationBody(b, this.options));
46
+ }
47
+ }
48
+ else {
49
+ bodies.push(new internal_1.AnnotationBody(body, this.options));
50
+ }
51
+ }
52
+ return bodies;
53
+ };
54
+ Annotation.prototype.getMotivation = function () {
55
+ var motivation = this.getProperty("motivation");
56
+ if (motivation) {
57
+ //const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation);
58
+ return motivation;
59
+ }
60
+ return null;
61
+ };
62
+ // open annotation
63
+ Annotation.prototype.getOn = function () {
64
+ return this.getProperty("on");
65
+ };
66
+ Annotation.prototype.getTarget = function () {
67
+ return this.getProperty("target");
68
+ };
69
+ Annotation.prototype.getResource = function () {
70
+ return new internal_1.Resource(this.getProperty("resource"), this.options);
71
+ };
72
+ return Annotation;
73
+ }(internal_1.ManifestResource));
74
+ exports.Annotation = Annotation;
75
75
  //# sourceMappingURL=Annotation.js.map
@@ -1,9 +1,9 @@
1
- import { ExternalResourceType, MediaType } from "@iiif/vocabulary/dist-commonjs";
2
- import { IManifestoOptions, ManifestResource } from "./internal";
3
- export declare class AnnotationBody extends ManifestResource {
4
- constructor(jsonld?: any, options?: IManifestoOptions);
5
- getFormat(): MediaType | null;
6
- getType(): ExternalResourceType | null;
7
- getWidth(): number;
8
- getHeight(): number;
9
- }
1
+ import { ExternalResourceType, MediaType } from "@iiif/vocabulary/dist-commonjs";
2
+ import { IManifestoOptions, ManifestResource } from "./internal";
3
+ export declare class AnnotationBody extends ManifestResource {
4
+ constructor(jsonld?: any, options?: IManifestoOptions);
5
+ getFormat(): MediaType | null;
6
+ getType(): ExternalResourceType | null;
7
+ getWidth(): number;
8
+ getHeight(): number;
9
+ }
@@ -1,45 +1,45 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- var internal_1 = require("./internal");
17
- var AnnotationBody = /** @class */ (function (_super) {
18
- __extends(AnnotationBody, _super);
19
- function AnnotationBody(jsonld, options) {
20
- return _super.call(this, jsonld, options) || this;
21
- }
22
- AnnotationBody.prototype.getFormat = function () {
23
- var format = this.getProperty("format");
24
- if (format) {
25
- return internal_1.Utils.getMediaType(format);
26
- }
27
- return null;
28
- };
29
- AnnotationBody.prototype.getType = function () {
30
- var type = this.getProperty("type");
31
- if (type) {
32
- return (internal_1.Utils.normaliseType(this.getProperty("type")));
33
- }
34
- return null;
35
- };
36
- AnnotationBody.prototype.getWidth = function () {
37
- return this.getProperty("width");
38
- };
39
- AnnotationBody.prototype.getHeight = function () {
40
- return this.getProperty("height");
41
- };
42
- return AnnotationBody;
43
- }(internal_1.ManifestResource));
44
- exports.AnnotationBody = AnnotationBody;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ var internal_1 = require("./internal");
17
+ var AnnotationBody = /** @class */ (function (_super) {
18
+ __extends(AnnotationBody, _super);
19
+ function AnnotationBody(jsonld, options) {
20
+ return _super.call(this, jsonld, options) || this;
21
+ }
22
+ AnnotationBody.prototype.getFormat = function () {
23
+ var format = this.getProperty("format");
24
+ if (format) {
25
+ return internal_1.Utils.getMediaType(format);
26
+ }
27
+ return null;
28
+ };
29
+ AnnotationBody.prototype.getType = function () {
30
+ var type = this.getProperty("type");
31
+ if (type) {
32
+ return (internal_1.Utils.normaliseType(this.getProperty("type")));
33
+ }
34
+ return null;
35
+ };
36
+ AnnotationBody.prototype.getWidth = function () {
37
+ return this.getProperty("width");
38
+ };
39
+ AnnotationBody.prototype.getHeight = function () {
40
+ return this.getProperty("height");
41
+ };
42
+ return AnnotationBody;
43
+ }(internal_1.ManifestResource));
44
+ exports.AnnotationBody = AnnotationBody;
45
45
  //# sourceMappingURL=AnnotationBody.js.map
@@ -1,12 +1,12 @@
1
- import { IIIFResourceType } from "@iiif/vocabulary/dist-commonjs";
2
- import { Annotation, IManifestoOptions, JSONLDResource } from "./internal";
3
- export declare class AnnotationList extends JSONLDResource {
4
- options: IManifestoOptions;
5
- label: string;
6
- isLoaded: boolean;
7
- constructor(label: any, jsonld?: any, options?: IManifestoOptions);
8
- getIIIFResourceType(): IIIFResourceType;
9
- getLabel(): string;
10
- getResources(): Annotation[];
11
- load(): Promise<AnnotationList>;
12
- }
1
+ import { IIIFResourceType } from "@iiif/vocabulary/dist-commonjs";
2
+ import { Annotation, IManifestoOptions, JSONLDResource } from "./internal";
3
+ export declare class AnnotationList extends JSONLDResource {
4
+ options: IManifestoOptions;
5
+ label: string;
6
+ isLoaded: boolean;
7
+ constructor(label: any, jsonld?: any, options?: IManifestoOptions);
8
+ getIIIFResourceType(): IIIFResourceType;
9
+ getLabel(): string;
10
+ getResources(): Annotation[];
11
+ load(): Promise<AnnotationList>;
12
+ }
@@ -1,62 +1,62 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- var internal_1 = require("./internal");
17
- var AnnotationList = /** @class */ (function (_super) {
18
- __extends(AnnotationList, _super);
19
- function AnnotationList(label, jsonld, options) {
20
- var _this = _super.call(this, jsonld) || this;
21
- _this.label = label;
22
- _this.options = options;
23
- return _this;
24
- }
25
- AnnotationList.prototype.getIIIFResourceType = function () {
26
- return internal_1.Utils.normaliseType(this.getProperty("type"));
27
- };
28
- AnnotationList.prototype.getLabel = function () {
29
- return this.label;
30
- };
31
- AnnotationList.prototype.getResources = function () {
32
- var _this = this;
33
- var resources = this.getProperty("resources");
34
- return resources.map(function (resource) { return new internal_1.Annotation(resource, _this.options); });
35
- };
36
- AnnotationList.prototype.load = function () {
37
- var _this = this;
38
- return new Promise(function (resolve, reject) {
39
- if (_this.isLoaded) {
40
- resolve(_this);
41
- }
42
- else {
43
- var id = _this.__jsonld.id;
44
- if (!id) {
45
- id = _this.__jsonld["@id"];
46
- }
47
- internal_1.Utils.loadManifest(id)
48
- .then(function (data) {
49
- _this.__jsonld = data;
50
- _this.context = _this.getProperty("context");
51
- _this.id = _this.getProperty("id");
52
- _this.isLoaded = true;
53
- resolve(_this);
54
- })
55
- .catch(reject);
56
- }
57
- });
58
- };
59
- return AnnotationList;
60
- }(internal_1.JSONLDResource));
61
- exports.AnnotationList = AnnotationList;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ var internal_1 = require("./internal");
17
+ var AnnotationList = /** @class */ (function (_super) {
18
+ __extends(AnnotationList, _super);
19
+ function AnnotationList(label, jsonld, options) {
20
+ var _this = _super.call(this, jsonld) || this;
21
+ _this.label = label;
22
+ _this.options = options;
23
+ return _this;
24
+ }
25
+ AnnotationList.prototype.getIIIFResourceType = function () {
26
+ return internal_1.Utils.normaliseType(this.getProperty("type"));
27
+ };
28
+ AnnotationList.prototype.getLabel = function () {
29
+ return this.label;
30
+ };
31
+ AnnotationList.prototype.getResources = function () {
32
+ var _this = this;
33
+ var resources = this.getProperty("resources");
34
+ return resources.map(function (resource) { return new internal_1.Annotation(resource, _this.options); });
35
+ };
36
+ AnnotationList.prototype.load = function () {
37
+ var _this = this;
38
+ return new Promise(function (resolve, reject) {
39
+ if (_this.isLoaded) {
40
+ resolve(_this);
41
+ }
42
+ else {
43
+ var id = _this.__jsonld.id;
44
+ if (!id) {
45
+ id = _this.__jsonld["@id"];
46
+ }
47
+ internal_1.Utils.loadManifest(id)
48
+ .then(function (data) {
49
+ _this.__jsonld = data;
50
+ _this.context = _this.getProperty("context");
51
+ _this.id = _this.getProperty("id");
52
+ _this.isLoaded = true;
53
+ resolve(_this);
54
+ })
55
+ .catch(reject);
56
+ }
57
+ });
58
+ };
59
+ return AnnotationList;
60
+ }(internal_1.JSONLDResource));
61
+ exports.AnnotationList = AnnotationList;
62
62
  //# sourceMappingURL=AnnotationList.js.map
@@ -1,5 +1,5 @@
1
- import { Annotation, IManifestoOptions, ManifestResource } from "./internal";
2
- export declare class AnnotationPage extends ManifestResource {
3
- constructor(jsonld: any, options: IManifestoOptions);
4
- getItems(): Annotation[];
5
- }
1
+ import { Annotation, IManifestoOptions, ManifestResource } from "./internal";
2
+ export declare class AnnotationPage extends ManifestResource {
3
+ constructor(jsonld: any, options: IManifestoOptions);
4
+ getItems(): Annotation[];
5
+ }
@@ -1,28 +1,28 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- var internal_1 = require("./internal");
17
- var AnnotationPage = /** @class */ (function (_super) {
18
- __extends(AnnotationPage, _super);
19
- function AnnotationPage(jsonld, options) {
20
- return _super.call(this, jsonld, options) || this;
21
- }
22
- AnnotationPage.prototype.getItems = function () {
23
- return this.getProperty("items");
24
- };
25
- return AnnotationPage;
26
- }(internal_1.ManifestResource));
27
- exports.AnnotationPage = AnnotationPage;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ var internal_1 = require("./internal");
17
+ var AnnotationPage = /** @class */ (function (_super) {
18
+ __extends(AnnotationPage, _super);
19
+ function AnnotationPage(jsonld, options) {
20
+ return _super.call(this, jsonld, options) || this;
21
+ }
22
+ AnnotationPage.prototype.getItems = function () {
23
+ return this.getProperty("items");
24
+ };
25
+ return AnnotationPage;
26
+ }(internal_1.ManifestResource));
27
+ exports.AnnotationPage = AnnotationPage;
28
28
  //# sourceMappingURL=AnnotationPage.js.map
@@ -1,31 +1,31 @@
1
- import { ViewingHint } from "@iiif/vocabulary/dist-commonjs";
2
- import { Annotation, AnnotationList, IManifestoOptions, Range, Resource, Size } from "./internal";
3
- export declare class Canvas extends Resource {
4
- ranges: Range[];
5
- constructor(jsonld?: any, options?: IManifestoOptions);
6
- getCanonicalImageUri(w?: number): string;
7
- getMaxDimensions(): Size | null;
8
- getContent(): Annotation[];
9
- getDuration(): number | null;
10
- getImages(): Annotation[];
11
- getIndex(): number;
12
- getOtherContent(): Promise<AnnotationList[]>;
13
- getWidth(): number;
14
- getHeight(): number;
15
- getViewingHint(): ViewingHint | null;
16
- readonly imageResources: any;
17
- readonly resourceAnnotations: any;
18
- /**
19
- * Returns a given resource Annotation, based on a contained resource or body
20
- * id
21
- */
22
- resourceAnnotation(id: any): any;
23
- /**
24
- * Returns the fragment placement values if a resourceAnnotation is placed on
25
- * a canvas somewhere besides the full extent
26
- */
27
- onFragment(id: any): any;
28
- readonly iiifImageResources: any;
29
- readonly imageServiceIds: any;
30
- readonly aspectRatio: number;
31
- }
1
+ import { ViewingHint } from "@iiif/vocabulary/dist-commonjs";
2
+ import { Annotation, AnnotationList, IManifestoOptions, Range, Resource, Size } from "./internal";
3
+ export declare class Canvas extends Resource {
4
+ ranges: Range[];
5
+ constructor(jsonld?: any, options?: IManifestoOptions);
6
+ getCanonicalImageUri(w?: number): string;
7
+ getMaxDimensions(): Size | null;
8
+ getContent(): Annotation[];
9
+ getDuration(): number | null;
10
+ getImages(): Annotation[];
11
+ getIndex(): number;
12
+ getOtherContent(): Promise<AnnotationList[]>;
13
+ getWidth(): number;
14
+ getHeight(): number;
15
+ getViewingHint(): ViewingHint | null;
16
+ readonly imageResources: any;
17
+ readonly resourceAnnotations: any;
18
+ /**
19
+ * Returns a given resource Annotation, based on a contained resource or body
20
+ * id
21
+ */
22
+ resourceAnnotation(id: any): any;
23
+ /**
24
+ * Returns the fragment placement values if a resourceAnnotation is placed on
25
+ * a canvas somewhere besides the full extent
26
+ */
27
+ onFragment(id: any): any;
28
+ readonly iiifImageResources: any;
29
+ readonly imageServiceIds: any;
30
+ readonly aspectRatio: number;
31
+ }