react-iiif-vault 0.9.9 → 0.9.12
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/.build/types/canvas-panel/Viewer.d.ts +13 -0
- package/.build/types/canvas-panel/index.d.ts +18 -0
- package/.build/types/canvas-panel/render/Annotation.d.ts +8 -0
- package/.build/types/canvas-panel/render/AnnotationPage.d.ts +6 -0
- package/.build/types/canvas-panel/render/Audio.d.ts +6 -0
- package/.build/types/canvas-panel/render/Canvas.d.ts +23 -0
- package/.build/types/canvas-panel/render/DefaultCanvasFallback.d.ts +5 -0
- package/.build/types/canvas-panel/render/Image.d.ts +13 -0
- package/.build/types/canvas-panel/render/Model.d.ts +3 -0
- package/.build/types/canvas-panel/render/Video.d.ts +6 -0
- package/.build/types/context/AnnotationContext.d.ts +5 -0
- package/.build/types/context/CanvasContext.d.ts +5 -0
- package/.build/types/context/CollectionContext.d.ts +5 -0
- package/.build/types/context/ContextBridge.d.ts +22 -0
- package/.build/types/context/ImageServiceLoaderContext.d.ts +4 -0
- package/.build/types/context/ManifestContext.d.ts +5 -0
- package/.build/types/context/MediaContext.d.ts +17 -0
- package/.build/types/context/PortalContext.d.ts +7 -0
- package/.build/types/context/RangeContext.d.ts +5 -0
- package/.build/types/context/ResourceContext.d.ts +14 -0
- package/.build/types/context/VaultContext.d.ts +14 -0
- package/.build/types/context/ViewerPresetContext.d.ts +3 -0
- package/.build/types/context/VisibleCanvasContext.d.ts +4 -0
- package/.build/types/demo/demo.d.ts +1 -0
- package/.build/types/demo/media-controls.d.ts +1 -0
- package/.build/types/demo/viewer-controls.d.ts +1 -0
- package/.build/types/features/rendering-strategy/3d-strategy.d.ts +13 -0
- package/.build/types/features/rendering-strategy/audio-strategy.d.ts +3 -0
- package/.build/types/features/rendering-strategy/choice-types.d.ts +15 -0
- package/.build/types/features/rendering-strategy/image-strategy.d.ts +13 -0
- package/.build/types/features/rendering-strategy/rendering-utils.d.ts +21 -0
- package/.build/types/features/rendering-strategy/resource-types.d.ts +42 -0
- package/.build/types/features/rendering-strategy/selector-extensions.d.ts +53 -0
- package/.build/types/features/rendering-strategy/strategies.d.ts +22 -0
- package/.build/types/features/rendering-strategy/video-strategy.d.ts +3 -0
- package/.build/types/hooks/useAnnotation.d.ts +8 -0
- package/.build/types/hooks/useAnnotationPageManager.d.ts +10 -0
- package/.build/types/hooks/useAnnotationsAtTime.d.ts +4 -0
- package/.build/types/hooks/useCanvas.d.ts +8 -0
- package/.build/types/hooks/useCanvasClock.d.ts +1 -0
- package/.build/types/hooks/useCanvasSelector.d.ts +0 -0
- package/.build/types/hooks/useCanvasTimeline.d.ts +0 -0
- package/.build/types/hooks/useCollection.d.ts +8 -0
- package/.build/types/hooks/useDispatch.d.ts +2 -0
- package/.build/types/hooks/useEnabledAnnotationPageIds.d.ts +1 -0
- package/.build/types/hooks/useEventListener.d.ts +4 -0
- package/.build/types/hooks/useExistingVault.d.ts +1 -0
- package/.build/types/hooks/useExternalCollection.d.ts +13 -0
- package/.build/types/hooks/useExternalManifest.d.ts +13 -0
- package/.build/types/hooks/useExternalResource.d.ts +16 -0
- package/.build/types/hooks/useImageService.d.ts +9 -0
- package/.build/types/hooks/useImageTile.d.ts +11 -0
- package/.build/types/hooks/useLoadImageService.d.ts +6 -0
- package/.build/types/hooks/useManifest.d.ts +8 -0
- package/.build/types/hooks/usePaintables.d.ts +8 -0
- package/.build/types/hooks/usePaintingAnnotations.d.ts +4 -0
- package/.build/types/hooks/useRange.d.ts +8 -0
- package/.build/types/hooks/useRenderingStrategy.d.ts +14 -0
- package/.build/types/hooks/useResourceEvents.d.ts +3 -0
- package/.build/types/hooks/useResources.d.ts +1 -0
- package/.build/types/hooks/useSearchService.d.ts +2 -0
- package/.build/types/hooks/useSimpleMediaPlayer.d.ts +32 -0
- package/.build/types/hooks/useStyleHelper.d.ts +1 -0
- package/.build/types/hooks/useStyles.d.ts +3 -0
- package/.build/types/hooks/useThumbnail.d.ts +5 -0
- package/.build/types/hooks/useVault.d.ts +2 -0
- package/.build/types/hooks/useVaultEffect.d.ts +2 -0
- package/.build/types/hooks/useVaultSelector.d.ts +2 -0
- package/.build/types/hooks/useVirtualAnnotationPage.d.ts +13 -0
- package/.build/types/hooks/useVirtualAnnotationPageContext.d.ts +9 -0
- package/.build/types/hooks/useVirtualCanvas.d.ts +0 -0
- package/.build/types/index.d.ts +56 -0
- package/.build/types/utility/expand-target.d.ts +19 -0
- package/.build/types/utility/flatten-annotation-page-ids.d.ts +7 -0
- package/.build/types/utility/parse-selector.d.ts +7 -0
- package/.build/types/viewers/SimpleViewerContext.d.ts +18 -0
- package/.build/types/viewers/SingleCanvasContext.d.ts +1 -0
- package/dist/bundle/cjs/index.js +36 -0
- package/dist/bundle/cjs/index.js.map +1 -0
- package/dist/{esm → bundle/esm}/index.mjs +734 -796
- package/dist/bundle/esm/index.mjs.map +1 -0
- package/dist/canvas-panel/cjs/canvas-panel.js +36 -0
- package/dist/canvas-panel/cjs/canvas-panel.js.map +1 -0
- package/dist/canvas-panel/esm/canvas-panel.mjs +2024 -0
- package/dist/canvas-panel/esm/canvas-panel.mjs.map +1 -0
- package/dist/index.umd.js +121 -31732
- package/dist/index.umd.js.map +1 -0
- package/package.json +38 -28
- package/dist/cjs/index.js +0 -2528
- package/dist/index.d.ts +0 -615
package/dist/index.d.ts
DELETED
|
@@ -1,615 +0,0 @@
|
|
|
1
|
-
import * as _atlas_viewer_atlas from '@atlas-viewer/atlas';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import React__default, { ReactNode, RefObject } from 'react';
|
|
4
|
-
import * as _iiif_presentation_3 from '@iiif/presentation-3';
|
|
5
|
-
import { InternationalString, ImageService, AnnotationPageNormalized, ContentResource, IIIFExternalWebResource, SpecificResource, AnnotationNormalized, CanvasNormalized, CollectionNormalized, Reference, ManifestNormalized, RangeNormalized, SearchService, Annotation, ExternalWebResource as ExternalWebResource$1, W3CAnnotationTarget, Selector } from '@iiif/presentation-3';
|
|
6
|
-
import { AtlasProps } from '@atlas-viewer/atlas/dist/types/modules/react-reconciler/Atlas';
|
|
7
|
-
import { Vault, VaultOptions, ReduxStore, NormalizedEntity, IIIFStore } from '@iiif/vault';
|
|
8
|
-
import { ExternalWebResource } from '@iiif/presentation-3/resources/annotation';
|
|
9
|
-
import { ImageCandidate, ImageServiceLoader, ImageCandidateRequest } from '@atlas-viewer/iiif-image-api';
|
|
10
|
-
import * as _iiif_vault__ from '@iiif/vault/*';
|
|
11
|
-
import * as _iiif_vault_helpers from '@iiif/vault-helpers';
|
|
12
|
-
|
|
13
|
-
declare function Viewer({ children, errorFallback, outerContainerProps, ...props }: AtlasProps & {
|
|
14
|
-
height?: number | string;
|
|
15
|
-
width?: number | string;
|
|
16
|
-
resizeHash?: number;
|
|
17
|
-
containerProps?: any;
|
|
18
|
-
outerContainerProps?: any;
|
|
19
|
-
aspectRatio?: number;
|
|
20
|
-
errorFallback?: any;
|
|
21
|
-
} & {
|
|
22
|
-
children: ReactNode;
|
|
23
|
-
}): JSX.Element;
|
|
24
|
-
|
|
25
|
-
interface SingleChoice {
|
|
26
|
-
type: 'single-choice';
|
|
27
|
-
label?: InternationalString;
|
|
28
|
-
items: Array<{
|
|
29
|
-
id: string;
|
|
30
|
-
label?: InternationalString;
|
|
31
|
-
selected?: true;
|
|
32
|
-
}>;
|
|
33
|
-
}
|
|
34
|
-
interface ComplexChoice {
|
|
35
|
-
type: 'complex-choice';
|
|
36
|
-
items: SingleChoice[];
|
|
37
|
-
}
|
|
38
|
-
declare type ChoiceDescription = SingleChoice | ComplexChoice;
|
|
39
|
-
|
|
40
|
-
interface SupportedSelector {
|
|
41
|
-
type: string;
|
|
42
|
-
temporal?: {
|
|
43
|
-
startTime: number;
|
|
44
|
-
endTime?: number;
|
|
45
|
-
};
|
|
46
|
-
spatial?: {
|
|
47
|
-
unit?: 'percent' | 'pixel';
|
|
48
|
-
x: number;
|
|
49
|
-
y: number;
|
|
50
|
-
width?: number;
|
|
51
|
-
height?: number;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
interface BoxSelector extends SupportedSelector {
|
|
55
|
-
type: 'BoxSelector';
|
|
56
|
-
spatial: {
|
|
57
|
-
unit?: 'percent' | 'pixel';
|
|
58
|
-
x: number;
|
|
59
|
-
y: number;
|
|
60
|
-
width: number;
|
|
61
|
-
height: number;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
interface PointSelector extends SupportedSelector {
|
|
65
|
-
type: 'PointSelector';
|
|
66
|
-
spatial: {
|
|
67
|
-
x: number;
|
|
68
|
-
y: number;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
interface TemporalSelector extends SupportedSelector {
|
|
72
|
-
type: 'TemporalSelector';
|
|
73
|
-
temporal: {
|
|
74
|
-
startTime: number;
|
|
75
|
-
endTime?: number;
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
interface TemporalBoxSelector extends SupportedSelector {
|
|
79
|
-
type: 'TemporalBoxSelector';
|
|
80
|
-
spatial: {
|
|
81
|
-
unit?: 'percent' | 'pixel';
|
|
82
|
-
x: number;
|
|
83
|
-
y: number;
|
|
84
|
-
width: number;
|
|
85
|
-
height: number;
|
|
86
|
-
};
|
|
87
|
-
temporal: {
|
|
88
|
-
startTime: number;
|
|
89
|
-
endTime?: number;
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
declare type SupportedSelectors = TemporalSelector | BoxSelector | TemporalBoxSelector | PointSelector;
|
|
93
|
-
|
|
94
|
-
declare type ImageWithOptionalService = {
|
|
95
|
-
id: string;
|
|
96
|
-
type: 'Image';
|
|
97
|
-
service?: ImageService;
|
|
98
|
-
width?: number;
|
|
99
|
-
height?: number;
|
|
100
|
-
sizes?: Array<{
|
|
101
|
-
width: number;
|
|
102
|
-
height: number;
|
|
103
|
-
}>;
|
|
104
|
-
target: BoxSelector | TemporalBoxSelector;
|
|
105
|
-
selector: BoxSelector;
|
|
106
|
-
};
|
|
107
|
-
declare type SingleAudio = {
|
|
108
|
-
type: 'Sound';
|
|
109
|
-
url: string;
|
|
110
|
-
format: string;
|
|
111
|
-
duration: number;
|
|
112
|
-
target: TemporalSelector;
|
|
113
|
-
selector: TemporalSelector;
|
|
114
|
-
};
|
|
115
|
-
declare type SingleVideo = {
|
|
116
|
-
type: 'Video';
|
|
117
|
-
url: string;
|
|
118
|
-
format: string;
|
|
119
|
-
duration: number;
|
|
120
|
-
target: TemporalSelector | TemporalBoxSelector;
|
|
121
|
-
selector: TemporalSelector | TemporalBoxSelector;
|
|
122
|
-
};
|
|
123
|
-
declare type AudioSequence = {
|
|
124
|
-
type: 'SoundSequence';
|
|
125
|
-
items: SingleAudio[];
|
|
126
|
-
};
|
|
127
|
-
declare type VideoSequence = {
|
|
128
|
-
type: 'VideoSequence';
|
|
129
|
-
items: SingleVideo[];
|
|
130
|
-
};
|
|
131
|
-
declare type AnnotationPageDescription = {
|
|
132
|
-
pages: AnnotationPageNormalized[];
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
declare type ImageServiceLoaderType = (imageService: any | undefined, { height, width }: {
|
|
136
|
-
height: number;
|
|
137
|
-
width: number;
|
|
138
|
-
}) => ImageService | undefined;
|
|
139
|
-
declare function useLoadImageService(): readonly [ImageServiceLoaderType, Record<string, string>];
|
|
140
|
-
|
|
141
|
-
declare function parseSpecificResource(resource: ContentResource): any[];
|
|
142
|
-
interface Paintables {
|
|
143
|
-
choice: ChoiceDescription | null;
|
|
144
|
-
types: string[];
|
|
145
|
-
items: Array<{
|
|
146
|
-
type: string;
|
|
147
|
-
resource: IIIFExternalWebResource | SpecificResource;
|
|
148
|
-
target: any;
|
|
149
|
-
selector: any;
|
|
150
|
-
}>;
|
|
151
|
-
}
|
|
152
|
-
declare function getPaintables(vault: Vault, paintingAnnotations: AnnotationNormalized[], enabledChoices: string[]): Paintables;
|
|
153
|
-
declare const emptyActions: {
|
|
154
|
-
makeChoice: () => void;
|
|
155
|
-
};
|
|
156
|
-
declare const unknownResponse: UseRenderingStrategy[0];
|
|
157
|
-
declare const unsupportedStrategy: (reason: string) => UseRenderingStrategy[0];
|
|
158
|
-
|
|
159
|
-
declare type SingleImageStrategy = {
|
|
160
|
-
type: 'images';
|
|
161
|
-
image: ImageWithOptionalService;
|
|
162
|
-
images: Array<ImageWithOptionalService>;
|
|
163
|
-
choice?: ChoiceDescription;
|
|
164
|
-
annotations?: AnnotationPageDescription;
|
|
165
|
-
};
|
|
166
|
-
declare function getImageStrategy(canvas: CanvasNormalized, paintables: Paintables, loadImageService: ImageServiceLoaderType): RenderingStrategy;
|
|
167
|
-
|
|
168
|
-
declare type Single3DModelStrategy = {
|
|
169
|
-
type: '3d-model';
|
|
170
|
-
model: ExternalWebResource;
|
|
171
|
-
choice?: ChoiceDescription;
|
|
172
|
-
annotations?: AnnotationPageDescription;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
declare type MediaStrategy = {
|
|
176
|
-
type: 'media';
|
|
177
|
-
media: SingleAudio | SingleVideo | AudioSequence | VideoSequence;
|
|
178
|
-
choice?: ChoiceDescription;
|
|
179
|
-
annotations?: AnnotationPageDescription;
|
|
180
|
-
};
|
|
181
|
-
declare type ComplexTimelineStrategy = {
|
|
182
|
-
type: 'complex-timeline';
|
|
183
|
-
items: Array<ImageWithOptionalService | SingleAudio | SingleVideo>;
|
|
184
|
-
choice?: ChoiceDescription;
|
|
185
|
-
annotations?: AnnotationPageDescription;
|
|
186
|
-
};
|
|
187
|
-
declare type UnknownStrategy = {
|
|
188
|
-
type: 'unknown';
|
|
189
|
-
reason?: string;
|
|
190
|
-
annotations?: AnnotationPageDescription;
|
|
191
|
-
};
|
|
192
|
-
declare type RenderingStrategy = SingleImageStrategy | MediaStrategy | ComplexTimelineStrategy | Single3DModelStrategy | UnknownStrategy;
|
|
193
|
-
|
|
194
|
-
declare type StrategyActions = {
|
|
195
|
-
makeChoice: (id: string, options?: {
|
|
196
|
-
deselectOthers?: boolean;
|
|
197
|
-
deselect?: boolean;
|
|
198
|
-
}) => void;
|
|
199
|
-
};
|
|
200
|
-
declare type UseRenderingStrategy = [RenderingStrategy, StrategyActions];
|
|
201
|
-
declare type UseRenderingStrategyOptions = {
|
|
202
|
-
strategies?: Array<RenderingStrategy['type']>;
|
|
203
|
-
annotationPageManagerId?: string;
|
|
204
|
-
defaultChoices?: string[];
|
|
205
|
-
};
|
|
206
|
-
declare function useRenderingStrategy(options?: UseRenderingStrategyOptions): UseRenderingStrategy;
|
|
207
|
-
|
|
208
|
-
declare type CanvasProps = {
|
|
209
|
-
x?: number;
|
|
210
|
-
y?: number;
|
|
211
|
-
onCreated?: any;
|
|
212
|
-
onChoiceChange?: (choice?: ChoiceDescription) => void;
|
|
213
|
-
registerActions?: (actions: StrategyActions) => void;
|
|
214
|
-
defaultChoices?: Array<{
|
|
215
|
-
id: string;
|
|
216
|
-
opacity?: number;
|
|
217
|
-
}>;
|
|
218
|
-
isStatic?: boolean;
|
|
219
|
-
children?: ReactNode;
|
|
220
|
-
renderViewerControls?: (strategy: SingleImageStrategy) => ReactNode;
|
|
221
|
-
renderMediaControls?: (strategy: MediaStrategy) => ReactNode;
|
|
222
|
-
strategies?: Array<RenderingStrategy['type']>;
|
|
223
|
-
};
|
|
224
|
-
declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic, renderViewerControls, renderMediaControls, strategies, children, }: CanvasProps): JSX.Element | null;
|
|
225
|
-
|
|
226
|
-
declare function RenderImage({ id, image, thumbnail, isStatic, x, y, annotations, children, }: {
|
|
227
|
-
id: string;
|
|
228
|
-
image: ImageWithOptionalService;
|
|
229
|
-
thumbnail?: ImageCandidate;
|
|
230
|
-
isStatic?: boolean;
|
|
231
|
-
x?: number;
|
|
232
|
-
y?: number;
|
|
233
|
-
annotations?: ReactNode;
|
|
234
|
-
children?: ReactNode;
|
|
235
|
-
}): JSX.Element;
|
|
236
|
-
|
|
237
|
-
declare const CanvasPanel: {
|
|
238
|
-
RenderImage: typeof RenderImage;
|
|
239
|
-
RenderCanvas: typeof RenderCanvas;
|
|
240
|
-
RenderAnnotationPage: React.FC<{
|
|
241
|
-
page: _iiif_presentation_3.AnnotationPageNormalized | _iiif_presentation_3.AnnotationPage;
|
|
242
|
-
className?: string | undefined;
|
|
243
|
-
}>;
|
|
244
|
-
RenderAnnotation: React.FC<{
|
|
245
|
-
id: string;
|
|
246
|
-
className?: string | undefined;
|
|
247
|
-
style?: _atlas_viewer_atlas.BoxStyle | undefined;
|
|
248
|
-
interactive?: boolean | undefined;
|
|
249
|
-
}>;
|
|
250
|
-
Viewer: typeof Viewer;
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
declare function AnnotationContext({ annotation, children }: {
|
|
254
|
-
annotation: string;
|
|
255
|
-
children: ReactNode;
|
|
256
|
-
}): JSX.Element;
|
|
257
|
-
|
|
258
|
-
declare function CanvasContext({ canvas, children }: {
|
|
259
|
-
canvas: string;
|
|
260
|
-
children: ReactNode;
|
|
261
|
-
}): JSX.Element;
|
|
262
|
-
|
|
263
|
-
declare function CollectionContext({ collection, children }: {
|
|
264
|
-
collection: string;
|
|
265
|
-
children: ReactNode;
|
|
266
|
-
}): JSX.Element;
|
|
267
|
-
|
|
268
|
-
declare function ManifestContext({ manifest, children }: {
|
|
269
|
-
manifest: string;
|
|
270
|
-
children: ReactNode;
|
|
271
|
-
}): JSX.Element;
|
|
272
|
-
|
|
273
|
-
declare type MediaPlayerState = {
|
|
274
|
-
isPlaying: boolean;
|
|
275
|
-
isMuted: boolean;
|
|
276
|
-
playRequested: boolean;
|
|
277
|
-
volume: number;
|
|
278
|
-
isFinished: boolean;
|
|
279
|
-
duration: number;
|
|
280
|
-
};
|
|
281
|
-
declare type MediaPlayerActions = {
|
|
282
|
-
play(): void;
|
|
283
|
-
pause(): void;
|
|
284
|
-
playPause(): void;
|
|
285
|
-
mute(): void;
|
|
286
|
-
unmute(): void;
|
|
287
|
-
toggleMute(): void;
|
|
288
|
-
setVolume(volume: number): void;
|
|
289
|
-
setDurationPercent(percent: number): void;
|
|
290
|
-
setTime(time: number): void;
|
|
291
|
-
};
|
|
292
|
-
declare function formatTime(time: number): string;
|
|
293
|
-
declare function useSimpleMediaPlayer(props: {
|
|
294
|
-
duration: number;
|
|
295
|
-
}): readonly [
|
|
296
|
-
{
|
|
297
|
-
element: RefObject<HTMLAudioElement | HTMLVideoElement>;
|
|
298
|
-
currentTime: RefObject<HTMLDivElement>;
|
|
299
|
-
progress: RefObject<HTMLDivElement>;
|
|
300
|
-
},
|
|
301
|
-
MediaPlayerState,
|
|
302
|
-
MediaPlayerActions
|
|
303
|
-
];
|
|
304
|
-
|
|
305
|
-
declare function useMediaState(): MediaPlayerState;
|
|
306
|
-
declare function useMediaActions(): MediaPlayerActions;
|
|
307
|
-
declare function useMediaElements(): {
|
|
308
|
-
element: RefObject<HTMLAudioElement | HTMLVideoElement>;
|
|
309
|
-
currentTime: RefObject<HTMLDivElement>;
|
|
310
|
-
progress: RefObject<HTMLDivElement>;
|
|
311
|
-
};
|
|
312
|
-
declare function MediaPlayerProvider({ actions, state, children, currentTime, progress, element, }: {
|
|
313
|
-
actions: MediaPlayerActions;
|
|
314
|
-
state: MediaPlayerState;
|
|
315
|
-
children: ReactNode;
|
|
316
|
-
currentTime: RefObject<HTMLDivElement>;
|
|
317
|
-
progress: RefObject<HTMLDivElement>;
|
|
318
|
-
element: RefObject<HTMLAudioElement | HTMLVideoElement>;
|
|
319
|
-
}): JSX.Element;
|
|
320
|
-
|
|
321
|
-
declare const PortalContext: React__default.Context<HTMLDivElement | null>;
|
|
322
|
-
declare const OverlayPortalContext: React__default.Context<HTMLDivElement | null>;
|
|
323
|
-
declare function CanvasPortal({ children, overlay }: {
|
|
324
|
-
children: ReactNode;
|
|
325
|
-
overlay?: boolean;
|
|
326
|
-
}): null;
|
|
327
|
-
|
|
328
|
-
declare function RangeContext({ range, children }: {
|
|
329
|
-
range: string;
|
|
330
|
-
children: ReactNode;
|
|
331
|
-
}): JSX.Element;
|
|
332
|
-
|
|
333
|
-
declare type ResourceContextType = {
|
|
334
|
-
collection?: string;
|
|
335
|
-
manifest?: string;
|
|
336
|
-
range?: string;
|
|
337
|
-
canvas?: string;
|
|
338
|
-
annotation?: string;
|
|
339
|
-
};
|
|
340
|
-
declare const ResourceReactContext: React__default.Context<ResourceContextType>;
|
|
341
|
-
declare const useResourceContext: () => ResourceContextType;
|
|
342
|
-
declare function ResourceProvider({ value, children }: {
|
|
343
|
-
value: ResourceContextType;
|
|
344
|
-
children: ReactNode;
|
|
345
|
-
}): JSX.Element;
|
|
346
|
-
|
|
347
|
-
declare const ReactVaultContext: React__default.Context<{
|
|
348
|
-
vault: Vault | null;
|
|
349
|
-
setVaultInstance: (vault: Vault) => void;
|
|
350
|
-
}>;
|
|
351
|
-
declare function VaultProvider({ vault, vaultOptions, useGlobal, resources, children, }: {
|
|
352
|
-
vault?: Vault;
|
|
353
|
-
useGlobal?: boolean;
|
|
354
|
-
vaultOptions?: VaultOptions;
|
|
355
|
-
resources?: ResourceContextType;
|
|
356
|
-
children: ReactNode;
|
|
357
|
-
}): JSX.Element;
|
|
358
|
-
|
|
359
|
-
declare function useContextBridge(): {
|
|
360
|
-
VaultContext: {
|
|
361
|
-
vault: _iiif_vault__.Vault | null;
|
|
362
|
-
setVaultInstance: (vault: _iiif_vault__.Vault) => void;
|
|
363
|
-
};
|
|
364
|
-
ResourceContext: ResourceContextType;
|
|
365
|
-
SimpleViewerReactContext: {
|
|
366
|
-
setCurrentCanvasId: (newId: string | ((prev: string) => string)) => void;
|
|
367
|
-
setCurrentCanvasIndex: (newId: number | ((prev: number) => number)) => void;
|
|
368
|
-
currentCanvasIndex: number;
|
|
369
|
-
pagingView: boolean;
|
|
370
|
-
totalCanvases: number;
|
|
371
|
-
nextCanvas: () => void;
|
|
372
|
-
previousCanvas: () => void;
|
|
373
|
-
};
|
|
374
|
-
VisibleCanvasReactContext: string[];
|
|
375
|
-
};
|
|
376
|
-
declare function ContextBridge(props: {
|
|
377
|
-
bridge: ReturnType<typeof useContextBridge>;
|
|
378
|
-
children: ReactNode;
|
|
379
|
-
}): JSX.Element;
|
|
380
|
-
|
|
381
|
-
declare const VisibleCanvasReactContext: React__default.Context<string[]>;
|
|
382
|
-
declare function useVisibleCanvases(): CanvasNormalized[];
|
|
383
|
-
|
|
384
|
-
declare const ImageServiceLoaderContext: React__default.Context<ImageServiceLoader>;
|
|
385
|
-
declare function useImageServiceLoader(): ImageServiceLoader;
|
|
386
|
-
|
|
387
|
-
declare function useAnnotation(options?: {
|
|
388
|
-
id: string;
|
|
389
|
-
}): AnnotationNormalized | undefined;
|
|
390
|
-
declare function useAnnotation<T>(options?: {
|
|
391
|
-
id: string;
|
|
392
|
-
selector: (annotation: AnnotationNormalized) => T;
|
|
393
|
-
}, deps?: any[]): T | undefined;
|
|
394
|
-
|
|
395
|
-
declare function useAnnotationPageManager(resourceId?: string, options?: {
|
|
396
|
-
all?: boolean;
|
|
397
|
-
}): {
|
|
398
|
-
availablePageIds: string[];
|
|
399
|
-
enabledPageIds: string[];
|
|
400
|
-
setPageEnabled: (id: string, opt?: {
|
|
401
|
-
deselectOthers?: boolean;
|
|
402
|
-
}) => void;
|
|
403
|
-
setPageDisabled: (deselectId: string) => void;
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
declare function useAnnotationsAtTime(time: number, options?: {
|
|
407
|
-
canvasId?: string;
|
|
408
|
-
}): AnnotationNormalized[];
|
|
409
|
-
|
|
410
|
-
declare function useCanvas(options?: {
|
|
411
|
-
id: string;
|
|
412
|
-
}): CanvasNormalized | undefined;
|
|
413
|
-
declare function useCanvas<T>(options?: {
|
|
414
|
-
id: string;
|
|
415
|
-
selector: (canvas: CanvasNormalized) => T;
|
|
416
|
-
}, deps?: any[]): T | undefined;
|
|
417
|
-
|
|
418
|
-
declare function useCanvasClock(canvasId?: string, autoplay?: boolean): void;
|
|
419
|
-
|
|
420
|
-
declare function useCollection(options: {
|
|
421
|
-
id: string;
|
|
422
|
-
}): CollectionNormalized | undefined;
|
|
423
|
-
declare function useCollection<T>(options: {
|
|
424
|
-
id: string;
|
|
425
|
-
selector: (collection: CollectionNormalized) => T;
|
|
426
|
-
}, deps?: any[]): T | undefined;
|
|
427
|
-
|
|
428
|
-
declare function useDispatch(): ReduxStore['dispatch'];
|
|
429
|
-
|
|
430
|
-
declare type SupportedEvents = 'onClick';
|
|
431
|
-
declare function useEventListener<T>(resource: Reference, name: SupportedEvents, listener: (e: any, resource: T) => void, scope?: string[], deps?: any[]): void;
|
|
432
|
-
|
|
433
|
-
declare function useExistingVault(): any;
|
|
434
|
-
|
|
435
|
-
declare type ResourceRequestOptions = {
|
|
436
|
-
noCache?: boolean;
|
|
437
|
-
};
|
|
438
|
-
declare function useExternalResource<T extends {
|
|
439
|
-
id: string;
|
|
440
|
-
}>(idOrRef: string | {
|
|
441
|
-
id: string;
|
|
442
|
-
type: string;
|
|
443
|
-
}, { noCache }?: ResourceRequestOptions): {
|
|
444
|
-
id: string;
|
|
445
|
-
requestId: string;
|
|
446
|
-
isLoaded: boolean;
|
|
447
|
-
error: any;
|
|
448
|
-
cached: boolean;
|
|
449
|
-
resource?: T;
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
declare function useExternalCollection(idOrRef: string | {
|
|
453
|
-
id: string;
|
|
454
|
-
type: string;
|
|
455
|
-
}, options?: ResourceRequestOptions): {
|
|
456
|
-
id: string;
|
|
457
|
-
requestId: string;
|
|
458
|
-
isLoaded: boolean;
|
|
459
|
-
cached?: boolean;
|
|
460
|
-
error: any;
|
|
461
|
-
manifest?: CollectionNormalized;
|
|
462
|
-
};
|
|
463
|
-
|
|
464
|
-
declare function useExternalManifest(idOrRef: string | {
|
|
465
|
-
id: string;
|
|
466
|
-
type: string;
|
|
467
|
-
}, options?: ResourceRequestOptions): {
|
|
468
|
-
id: string;
|
|
469
|
-
requestId: string;
|
|
470
|
-
isLoaded: boolean;
|
|
471
|
-
cached?: boolean;
|
|
472
|
-
error: any;
|
|
473
|
-
manifest?: ManifestNormalized;
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
interface ImageServiceRequestOptions {
|
|
477
|
-
cacheKey?: string;
|
|
478
|
-
}
|
|
479
|
-
declare function useImageService({ cacheKey }?: ImageServiceRequestOptions): {
|
|
480
|
-
data: ImageService | undefined;
|
|
481
|
-
isFetching: boolean;
|
|
482
|
-
status: 'error' | 'success' | 'loading' | 'idle';
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
declare function useImageTile(): {
|
|
486
|
-
isLoading: boolean;
|
|
487
|
-
tile: {
|
|
488
|
-
id: string | undefined;
|
|
489
|
-
width: number | null | undefined;
|
|
490
|
-
height: number | null | undefined;
|
|
491
|
-
imageService: ImageService;
|
|
492
|
-
thumbnail: undefined;
|
|
493
|
-
} | null;
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
declare function useManifest(options?: {
|
|
497
|
-
id: string;
|
|
498
|
-
}): ManifestNormalized | undefined;
|
|
499
|
-
declare function useManifest<T>(options?: {
|
|
500
|
-
id: string;
|
|
501
|
-
selector: (manifest: ManifestNormalized) => T;
|
|
502
|
-
}, deps?: any[]): T | undefined;
|
|
503
|
-
|
|
504
|
-
declare function usePaintables(options?: {
|
|
505
|
-
defaultChoices?: string[];
|
|
506
|
-
}, deps?: any[]): readonly [Paintables, {
|
|
507
|
-
makeChoice: (id: string, { deselectOthers, deselect }?: {
|
|
508
|
-
deselectOthers?: boolean | undefined;
|
|
509
|
-
deselect?: boolean | undefined;
|
|
510
|
-
}) => void;
|
|
511
|
-
}];
|
|
512
|
-
|
|
513
|
-
declare function usePaintingAnnotations(options?: {
|
|
514
|
-
canvasId?: string;
|
|
515
|
-
}): AnnotationNormalized[];
|
|
516
|
-
|
|
517
|
-
declare function useRange(options?: {
|
|
518
|
-
id: string;
|
|
519
|
-
}): RangeNormalized | undefined;
|
|
520
|
-
declare function useRange<T>(options?: {
|
|
521
|
-
id: string;
|
|
522
|
-
selector: (range: RangeNormalized) => T;
|
|
523
|
-
}, deps?: any[]): T | undefined;
|
|
524
|
-
|
|
525
|
-
declare function useResourceEvents<T extends NormalizedEntity>(resource?: Reference, scope?: string[]): any;
|
|
526
|
-
|
|
527
|
-
declare function useResources<Type>(ids: string[], type: string): Type[];
|
|
528
|
-
|
|
529
|
-
declare function useSearchService(): SearchService | undefined;
|
|
530
|
-
|
|
531
|
-
declare function useStyleHelper(): _iiif_vault_helpers.StyledHelper<_iiif_vault_helpers.StyleDefinition>;
|
|
532
|
-
|
|
533
|
-
declare function useStyles<Style extends Record<string, Record<string, any>>>(resource: undefined | Reference<any>): Style;
|
|
534
|
-
declare function useStyles<Style extends Record<string, any>>(resource: undefined | Reference<any>, scope: string): Style;
|
|
535
|
-
|
|
536
|
-
declare function useThumbnail(request: ImageCandidateRequest, dereference?: boolean, { canvasId, manifestId }?: {
|
|
537
|
-
canvasId?: string;
|
|
538
|
-
manifestId?: string;
|
|
539
|
-
}): ImageCandidate | undefined;
|
|
540
|
-
|
|
541
|
-
declare const useVault: () => Vault;
|
|
542
|
-
|
|
543
|
-
declare const useVaultEffect: (callback: (vault: Vault) => void, deps?: any[]) => void;
|
|
544
|
-
|
|
545
|
-
declare function useVaultSelector<T>(selector: (state: IIIFStore, vault: Vault) => T, deps?: any[]): T;
|
|
546
|
-
|
|
547
|
-
interface VaultActivatedAnnotation {
|
|
548
|
-
__vault?: Vault;
|
|
549
|
-
bindToVault(vault: Vault): void;
|
|
550
|
-
source: string | {
|
|
551
|
-
id: string;
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
declare function useVirtualAnnotationPage(): readonly [AnnotationPageNormalized | null, {
|
|
555
|
-
readonly addAnnotation: (id: string | Annotation | VaultActivatedAnnotation | AnnotationNormalized, atIndex?: number | undefined) => void;
|
|
556
|
-
readonly removeAnnotation: (id: string | Annotation | VaultActivatedAnnotation | AnnotationNormalized) => void;
|
|
557
|
-
}];
|
|
558
|
-
|
|
559
|
-
declare function useVirtualAnnotationPageContext(): readonly [AnnotationPageNormalized | null, {
|
|
560
|
-
readonly addAnnotation: (id: string | AnnotationNormalized | VaultActivatedAnnotation | Annotation, atIndex?: number | undefined) => void;
|
|
561
|
-
readonly removeAnnotation: (id: string | AnnotationNormalized | VaultActivatedAnnotation | Annotation) => void;
|
|
562
|
-
}];
|
|
563
|
-
declare function VirtualAnnotationProvider({ children }: {
|
|
564
|
-
children: any;
|
|
565
|
-
}): JSX.Element;
|
|
566
|
-
|
|
567
|
-
declare type SupportedTarget = {
|
|
568
|
-
type: 'SpecificResource';
|
|
569
|
-
source: ExternalWebResource$1 | {
|
|
570
|
-
id: string;
|
|
571
|
-
type: 'Unknown' | 'Canvas' | 'Range' | 'Manifest';
|
|
572
|
-
partOf?: Array<{
|
|
573
|
-
id: string;
|
|
574
|
-
type: string;
|
|
575
|
-
}>;
|
|
576
|
-
};
|
|
577
|
-
purpose?: string;
|
|
578
|
-
selector: SupportedSelectors | null;
|
|
579
|
-
selectors: SupportedSelectors[];
|
|
580
|
-
};
|
|
581
|
-
declare function expandTarget(target: W3CAnnotationTarget | W3CAnnotationTarget[], options?: {
|
|
582
|
-
typeMap?: Record<string, string>;
|
|
583
|
-
}): SupportedTarget;
|
|
584
|
-
|
|
585
|
-
declare function flattenAnnotationPageIds({ canvas, manifest, all, canvases, }: {
|
|
586
|
-
manifest?: ManifestNormalized;
|
|
587
|
-
canvas?: CanvasNormalized;
|
|
588
|
-
canvases?: CanvasNormalized[];
|
|
589
|
-
all?: boolean;
|
|
590
|
-
}): string[];
|
|
591
|
-
|
|
592
|
-
declare type ParsedSelector = {
|
|
593
|
-
selector: SupportedSelectors | null;
|
|
594
|
-
selectors: SupportedSelectors[];
|
|
595
|
-
};
|
|
596
|
-
declare function parseSelector(source: Selector | Selector[]): ParsedSelector;
|
|
597
|
-
|
|
598
|
-
declare type SimpleViewerContext = {
|
|
599
|
-
setCurrentCanvasId: (newId: string | ((prev: string) => string)) => void;
|
|
600
|
-
setCurrentCanvasIndex: (newId: number | ((prev: number) => number)) => void;
|
|
601
|
-
currentCanvasIndex: number;
|
|
602
|
-
pagingView: boolean;
|
|
603
|
-
totalCanvases: number;
|
|
604
|
-
nextCanvas: () => void;
|
|
605
|
-
previousCanvas: () => void;
|
|
606
|
-
};
|
|
607
|
-
declare const SimpleViewerReactContext: React__default.Context<SimpleViewerContext>;
|
|
608
|
-
declare function SimpleViewerProvider(props: {
|
|
609
|
-
manifest: string;
|
|
610
|
-
pagingEnabled?: boolean;
|
|
611
|
-
children: ReactNode;
|
|
612
|
-
}): JSX.Element;
|
|
613
|
-
declare function useSimpleViewer(): SimpleViewerContext;
|
|
614
|
-
|
|
615
|
-
export { AnnotationContext, AnnotationPageDescription, AudioSequence, BoxSelector, CanvasContext, CanvasPanel, CanvasPortal, ChoiceDescription, CollectionContext, ComplexChoice, ComplexTimelineStrategy, ContextBridge, ImageServiceLoaderContext, ImageServiceLoaderType, ImageServiceRequestOptions, ImageWithOptionalService, ManifestContext, MediaPlayerActions, MediaPlayerProvider, MediaPlayerState, MediaStrategy, OverlayPortalContext, Paintables, ParsedSelector, PointSelector, PortalContext, RangeContext, ReactVaultContext, RenderingStrategy, ResourceContextType, ResourceProvider, ResourceReactContext, ResourceRequestOptions, SimpleViewerProvider, SimpleViewerReactContext, SingleAudio, SingleChoice, SingleImageStrategy, SingleVideo, StrategyActions, SupportedSelector, SupportedSelectors, SupportedTarget, TemporalBoxSelector, TemporalSelector, UnknownStrategy, UseRenderingStrategy, UseRenderingStrategyOptions, VaultActivatedAnnotation, VaultProvider, VideoSequence, VirtualAnnotationProvider, VisibleCanvasReactContext, emptyActions, expandTarget, flattenAnnotationPageIds, formatTime, getImageStrategy, getPaintables, parseSelector, parseSpecificResource, unknownResponse, unsupportedStrategy, useAnnotation, useAnnotationPageManager, useAnnotationsAtTime, useCanvas, useCanvasClock, useCollection, useContextBridge, useDispatch, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useImageService, useImageServiceLoader, useImageTile, useLoadImageService, useManifest, useMediaActions, useMediaElements, useMediaState, usePaintables, usePaintingAnnotations, useRange, useRenderingStrategy, useResourceContext, useResourceEvents, useResources, useSearchService, useSimpleMediaPlayer, useSimpleViewer, useStyleHelper, useStyles, useThumbnail, useVault, useVaultEffect, useVaultSelector, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
|