manifesto.js 4.2.4 → 4.2.8

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 (175) hide show
  1. package/README.md +10 -8
  2. package/dist-commonjs/Annotation.d.ts +10 -10
  3. package/dist-commonjs/Annotation.js +74 -74
  4. package/dist-commonjs/AnnotationBody.d.ts +9 -9
  5. package/dist-commonjs/AnnotationBody.js +44 -44
  6. package/dist-commonjs/AnnotationList.d.ts +12 -12
  7. package/dist-commonjs/AnnotationList.js +61 -61
  8. package/dist-commonjs/AnnotationPage.d.ts +5 -5
  9. package/dist-commonjs/AnnotationPage.js +27 -27
  10. package/dist-commonjs/Canvas.d.ts +31 -31
  11. package/dist-commonjs/Canvas.js +304 -302
  12. package/dist-commonjs/Canvas.js.map +1 -1
  13. package/dist-commonjs/Collection.d.ts +28 -28
  14. package/dist-commonjs/Collection.js +156 -156
  15. package/dist-commonjs/Duration.d.ts +6 -6
  16. package/dist-commonjs/Duration.js +13 -13
  17. package/dist-commonjs/IAccessToken.d.ts +7 -7
  18. package/dist-commonjs/IAccessToken.js +2 -2
  19. package/dist-commonjs/IExternalImageResourceData.d.ts +5 -5
  20. package/dist-commonjs/IExternalImageResourceData.js +2 -2
  21. package/dist-commonjs/IExternalResource.d.ts +24 -24
  22. package/dist-commonjs/IExternalResource.js +2 -2
  23. package/dist-commonjs/IExternalResourceData.d.ts +6 -6
  24. package/dist-commonjs/IExternalResourceData.js +2 -2
  25. package/dist-commonjs/IExternalResourceOptions.d.ts +3 -3
  26. package/dist-commonjs/IExternalResourceOptions.js +2 -2
  27. package/dist-commonjs/IIIFResource.d.ts +28 -28
  28. package/dist-commonjs/IIIFResource.js +167 -155
  29. package/dist-commonjs/IIIFResource.js.map +1 -1
  30. package/dist-commonjs/IManifestoOptions.d.ts +9 -9
  31. package/dist-commonjs/IManifestoOptions.js +2 -2
  32. package/dist-commonjs/JSONLDResource.d.ts +7 -7
  33. package/dist-commonjs/JSONLDResource.js +22 -22
  34. package/dist-commonjs/LabelValuePair.d.ts +14 -14
  35. package/dist-commonjs/LabelValuePair.js +56 -56
  36. package/dist-commonjs/Language.d.ts +5 -5
  37. package/dist-commonjs/Language.js +2 -2
  38. package/dist-commonjs/LanguageMap.d.ts +8 -8
  39. package/dist-commonjs/LanguageMap.js +32 -32
  40. package/dist-commonjs/Manifest.d.ts +29 -29
  41. package/dist-commonjs/Manifest.js +259 -259
  42. package/dist-commonjs/ManifestResource.d.ts +23 -22
  43. package/dist-commonjs/ManifestResource.js +129 -120
  44. package/dist-commonjs/ManifestResource.js.map +1 -1
  45. package/dist-commonjs/ManifestType.d.ts +5 -5
  46. package/dist-commonjs/ManifestType.js +8 -8
  47. package/dist-commonjs/PropertyValue.d.ts +58 -58
  48. package/dist-commonjs/PropertyValue.js +285 -285
  49. package/dist-commonjs/Range.d.ts +20 -20
  50. package/dist-commonjs/Range.js +197 -197
  51. package/dist-commonjs/Rendering.d.ts +6 -6
  52. package/dist-commonjs/Rendering.js +27 -27
  53. package/dist-commonjs/Resource.d.ts +13 -13
  54. package/dist-commonjs/Resource.js +67 -67
  55. package/dist-commonjs/Sequence.d.ts +30 -30
  56. package/dist-commonjs/Sequence.js +266 -266
  57. package/dist-commonjs/Serialisation.d.ts +11 -11
  58. package/dist-commonjs/Serialisation.js +155 -155
  59. package/dist-commonjs/Service.d.ts +13 -13
  60. package/dist-commonjs/Service.js +60 -60
  61. package/dist-commonjs/Size.d.ts +5 -5
  62. package/dist-commonjs/Size.js +10 -10
  63. package/dist-commonjs/StatusCode.d.ts +6 -6
  64. package/dist-commonjs/StatusCode.js +9 -9
  65. package/dist-commonjs/Thumb.d.ts +13 -11
  66. package/dist-commonjs/Thumb.js +23 -22
  67. package/dist-commonjs/Thumb.js.map +1 -1
  68. package/dist-commonjs/Thumbnail.d.ts +4 -4
  69. package/dist-commonjs/Thumbnail.js +24 -24
  70. package/dist-commonjs/TreeNode.d.ts +15 -15
  71. package/dist-commonjs/TreeNode.js +25 -25
  72. package/dist-commonjs/TreeNodeType.d.ts +5 -5
  73. package/dist-commonjs/TreeNodeType.js +8 -8
  74. package/dist-commonjs/Utils.d.ts +42 -42
  75. package/dist-commonjs/Utils.js +736 -729
  76. package/dist-commonjs/Utils.js.map +1 -1
  77. package/dist-commonjs/index.d.ts +5 -5
  78. package/dist-commonjs/index.js +13 -13
  79. package/dist-commonjs/internal.d.ts +35 -35
  80. package/dist-commonjs/internal.js +33 -33
  81. package/dist-esmodule/Annotation.d.ts +10 -10
  82. package/dist-esmodule/Annotation.js +72 -72
  83. package/dist-esmodule/AnnotationBody.d.ts +9 -9
  84. package/dist-esmodule/AnnotationBody.js +42 -42
  85. package/dist-esmodule/AnnotationList.d.ts +12 -12
  86. package/dist-esmodule/AnnotationList.js +59 -59
  87. package/dist-esmodule/AnnotationPage.d.ts +5 -5
  88. package/dist-esmodule/AnnotationPage.js +25 -25
  89. package/dist-esmodule/Canvas.d.ts +31 -31
  90. package/dist-esmodule/Canvas.js +302 -300
  91. package/dist-esmodule/Canvas.js.map +1 -1
  92. package/dist-esmodule/Collection.d.ts +28 -28
  93. package/dist-esmodule/Collection.js +154 -154
  94. package/dist-esmodule/Duration.d.ts +6 -6
  95. package/dist-esmodule/Duration.js +11 -11
  96. package/dist-esmodule/IAccessToken.d.ts +7 -7
  97. package/dist-esmodule/IExternalImageResourceData.d.ts +5 -5
  98. package/dist-esmodule/IExternalResource.d.ts +24 -24
  99. package/dist-esmodule/IExternalResourceData.d.ts +6 -6
  100. package/dist-esmodule/IExternalResourceOptions.d.ts +3 -3
  101. package/dist-esmodule/IIIFResource.d.ts +28 -28
  102. package/dist-esmodule/IIIFResource.js +165 -153
  103. package/dist-esmodule/IIIFResource.js.map +1 -1
  104. package/dist-esmodule/IManifestoOptions.d.ts +9 -9
  105. package/dist-esmodule/JSONLDResource.d.ts +7 -7
  106. package/dist-esmodule/JSONLDResource.js +20 -20
  107. package/dist-esmodule/LabelValuePair.d.ts +14 -14
  108. package/dist-esmodule/LabelValuePair.js +54 -54
  109. package/dist-esmodule/Language.d.ts +5 -5
  110. package/dist-esmodule/LanguageMap.d.ts +8 -8
  111. package/dist-esmodule/LanguageMap.js +30 -30
  112. package/dist-esmodule/Manifest.d.ts +29 -29
  113. package/dist-esmodule/Manifest.js +257 -257
  114. package/dist-esmodule/ManifestResource.d.ts +23 -22
  115. package/dist-esmodule/ManifestResource.js +127 -118
  116. package/dist-esmodule/ManifestResource.js.map +1 -1
  117. package/dist-esmodule/ManifestType.d.ts +5 -5
  118. package/dist-esmodule/ManifestType.js +6 -6
  119. package/dist-esmodule/PropertyValue.d.ts +58 -58
  120. package/dist-esmodule/PropertyValue.js +283 -283
  121. package/dist-esmodule/Range.d.ts +20 -20
  122. package/dist-esmodule/Range.js +195 -195
  123. package/dist-esmodule/Rendering.d.ts +6 -6
  124. package/dist-esmodule/Rendering.js +25 -25
  125. package/dist-esmodule/Resource.d.ts +13 -13
  126. package/dist-esmodule/Resource.js +65 -65
  127. package/dist-esmodule/Sequence.d.ts +30 -30
  128. package/dist-esmodule/Sequence.js +264 -264
  129. package/dist-esmodule/Serialisation.d.ts +11 -11
  130. package/dist-esmodule/Serialisation.js +153 -153
  131. package/dist-esmodule/Service.d.ts +13 -13
  132. package/dist-esmodule/Service.js +58 -58
  133. package/dist-esmodule/Size.d.ts +5 -5
  134. package/dist-esmodule/Size.js +8 -8
  135. package/dist-esmodule/StatusCode.d.ts +6 -6
  136. package/dist-esmodule/StatusCode.js +7 -7
  137. package/dist-esmodule/Thumb.d.ts +13 -11
  138. package/dist-esmodule/Thumb.js +21 -20
  139. package/dist-esmodule/Thumb.js.map +1 -1
  140. package/dist-esmodule/Thumbnail.d.ts +4 -4
  141. package/dist-esmodule/Thumbnail.js +22 -22
  142. package/dist-esmodule/TreeNode.d.ts +15 -15
  143. package/dist-esmodule/TreeNode.js +23 -23
  144. package/dist-esmodule/TreeNodeType.d.ts +5 -5
  145. package/dist-esmodule/TreeNodeType.js +6 -6
  146. package/dist-esmodule/Utils.d.ts +42 -42
  147. package/dist-esmodule/Utils.js +734 -727
  148. package/dist-esmodule/Utils.js.map +1 -1
  149. package/dist-esmodule/index.d.ts +5 -5
  150. package/dist-esmodule/index.js +8 -8
  151. package/dist-esmodule/internal.d.ts +35 -35
  152. package/dist-esmodule/internal.js +28 -28
  153. package/dist-umd/manifesto.js +1 -1
  154. package/dist-var/manifesto.js +1 -1
  155. package/package.json +2 -1
  156. package/pkg-tests/README.md +9 -0
  157. package/pkg-tests/index.esm.html +29 -0
  158. package/pkg-tests/index.umd.html +16 -0
  159. package/pkg-tests/node-load.js +8 -0
  160. package/pkg-tests/node-load.mjs +4 -0
  161. package/pkg-tests/node-umd.js +8 -0
  162. package/test/fixtures/RHUL.json +433 -0
  163. package/test/fixtures/manifests.js +1 -0
  164. package/test/index.js +3 -0
  165. package/test/tests/get-range-by-id.js +22 -0
  166. package/test/tests/rhul.js +18 -0
  167. package/types/index.d.ts +467 -465
  168. package/coverage/coverage-final.json +0 -2
  169. package/coverage/lcov-report/base.css +0 -182
  170. package/coverage/lcov-report/index.html +0 -60
  171. package/coverage/lcov-report/prettify.css +0 -1
  172. package/coverage/lcov-report/prettify.js +0 -1
  173. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  174. package/coverage/lcov-report/sorter.js +0 -156
  175. package/coverage/lcov.info +0 -0
package/README.md CHANGED
@@ -6,14 +6,12 @@ IIIF Presentation API client and server utility library.
6
6
 
7
7
  npm install manifesto.js --save
8
8
 
9
- Getting Started
10
- --
9
+ ## Getting Started
11
10
 
12
11
  ### Documentation
13
12
 
14
13
  https://iiif-commons.github.io/manifesto/
15
14
 
16
-
17
15
  ### Developer Setup
18
16
 
19
17
  git clone https://github.com/iiif-commons/manifesto.git
@@ -23,8 +21,12 @@ https://iiif-commons.github.io/manifesto/
23
21
 
24
22
  ### Publishing Package
25
23
 
26
- 1. Bump the version locally using `npm version` on a branch other than `master`. Example: `npm version patch -m 'bump to v3.0.42'`
27
- 1. Push the bump version branch to GitHub and create a pull request to `master`.
28
- 1. After the pull request is merged, checkout `master` and pull the latest changes. `git checkout master && git pull`
29
- 1. Run `npm publish`
30
- 1. Push the git tags created `git push --tags`
24
+ `git checkout master`
25
+
26
+ `npm version patch`
27
+
28
+ `git add .`
29
+
30
+ If the new version is e.g. v1.2.3
31
+
32
+ `git push origin master v1.2.3`
@@ -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
+ }