When loading the manifest https://iiif.io/api/cookbook/recipe/0036-composition-from-multiple-images/manifest.json with vault and drilling down into the canvas' annotations via vault.get, the target key is not being normalized into an array as specified by the type annotations on AnnotationNormalized:
const manifest = await vault.loadManifest('https://iiif.io/api/cookbook/recipe/0036-composition-from-multiple-images/manifest.json');
for (const canvas of vault.get<CanvasNormalized>(manifest.items)) {
const annos = vault.get<AnnotationPageNormalized>(canvas.items)
.flatMap(p => vault.get<AnnotationNormalized>(p.items));
for (const anno of annos) {
console.dir(anno.target, { depth: null });
}
}
Expected Output (Array<ContentResource>):
[{ id: 'https://iiif.io/api/cookbook/recipe/0036-composition-from-multiple-images/canvas/p1', type: ??? }]
[{ id: ''https://iiif.io/api/cookbook/recipe/0036-composition-from-multiple-images/canvas/p1#xywh=3949,994,1091,1232', type: ??? }]
Actual Output: (ContentResourceString?)
'https://iiif.io/api/cookbook/recipe/0036-composition-from-multiple-images/canvas/p1'
'https://iiif.io/api/cookbook/recipe/0036-composition-from-multiple-images/canvas/p1#xywh=3949,994,1091,1232'
I'm also a bit confused as to why AnnotationNormalized#target has the type Array<Reference<"ContentResource">>, shouldn't it be a union Array<Reference<"ContentResource"> | ContentResourceString>? Although that's probably more of a question for https://github.com/IIIF-Commons/presentation-3-types.