react-iiif-vault 0.9.11 → 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.
Files changed (90) hide show
  1. package/.build/types/canvas-panel/Viewer.d.ts +13 -0
  2. package/.build/types/canvas-panel/index.d.ts +18 -0
  3. package/.build/types/canvas-panel/render/Annotation.d.ts +8 -0
  4. package/.build/types/canvas-panel/render/AnnotationPage.d.ts +6 -0
  5. package/.build/types/canvas-panel/render/Audio.d.ts +6 -0
  6. package/.build/types/canvas-panel/render/Canvas.d.ts +23 -0
  7. package/.build/types/canvas-panel/render/DefaultCanvasFallback.d.ts +5 -0
  8. package/.build/types/canvas-panel/render/Image.d.ts +13 -0
  9. package/.build/types/canvas-panel/render/Model.d.ts +3 -0
  10. package/.build/types/canvas-panel/render/Video.d.ts +6 -0
  11. package/.build/types/context/AnnotationContext.d.ts +5 -0
  12. package/.build/types/context/CanvasContext.d.ts +5 -0
  13. package/.build/types/context/CollectionContext.d.ts +5 -0
  14. package/.build/types/context/ContextBridge.d.ts +22 -0
  15. package/.build/types/context/ImageServiceLoaderContext.d.ts +4 -0
  16. package/.build/types/context/ManifestContext.d.ts +5 -0
  17. package/.build/types/context/MediaContext.d.ts +17 -0
  18. package/.build/types/context/PortalContext.d.ts +7 -0
  19. package/.build/types/context/RangeContext.d.ts +5 -0
  20. package/.build/types/context/ResourceContext.d.ts +14 -0
  21. package/.build/types/context/VaultContext.d.ts +14 -0
  22. package/.build/types/context/ViewerPresetContext.d.ts +3 -0
  23. package/.build/types/context/VisibleCanvasContext.d.ts +4 -0
  24. package/.build/types/demo/demo.d.ts +1 -0
  25. package/.build/types/demo/media-controls.d.ts +1 -0
  26. package/.build/types/demo/viewer-controls.d.ts +1 -0
  27. package/.build/types/features/rendering-strategy/3d-strategy.d.ts +13 -0
  28. package/.build/types/features/rendering-strategy/audio-strategy.d.ts +3 -0
  29. package/.build/types/features/rendering-strategy/choice-types.d.ts +15 -0
  30. package/.build/types/features/rendering-strategy/image-strategy.d.ts +13 -0
  31. package/.build/types/features/rendering-strategy/rendering-utils.d.ts +21 -0
  32. package/.build/types/features/rendering-strategy/resource-types.d.ts +42 -0
  33. package/.build/types/features/rendering-strategy/selector-extensions.d.ts +53 -0
  34. package/.build/types/features/rendering-strategy/strategies.d.ts +22 -0
  35. package/.build/types/features/rendering-strategy/video-strategy.d.ts +3 -0
  36. package/.build/types/hooks/useAnnotation.d.ts +8 -0
  37. package/.build/types/hooks/useAnnotationPageManager.d.ts +10 -0
  38. package/.build/types/hooks/useAnnotationsAtTime.d.ts +4 -0
  39. package/.build/types/hooks/useCanvas.d.ts +8 -0
  40. package/.build/types/hooks/useCanvasClock.d.ts +1 -0
  41. package/.build/types/hooks/useCanvasSelector.d.ts +0 -0
  42. package/.build/types/hooks/useCanvasTimeline.d.ts +0 -0
  43. package/.build/types/hooks/useCollection.d.ts +8 -0
  44. package/.build/types/hooks/useDispatch.d.ts +2 -0
  45. package/.build/types/hooks/useEnabledAnnotationPageIds.d.ts +1 -0
  46. package/.build/types/hooks/useEventListener.d.ts +4 -0
  47. package/.build/types/hooks/useExistingVault.d.ts +1 -0
  48. package/.build/types/hooks/useExternalCollection.d.ts +13 -0
  49. package/.build/types/hooks/useExternalManifest.d.ts +13 -0
  50. package/.build/types/hooks/useExternalResource.d.ts +16 -0
  51. package/.build/types/hooks/useImageService.d.ts +9 -0
  52. package/.build/types/hooks/useImageTile.d.ts +11 -0
  53. package/.build/types/hooks/useLoadImageService.d.ts +6 -0
  54. package/.build/types/hooks/useManifest.d.ts +8 -0
  55. package/.build/types/hooks/usePaintables.d.ts +8 -0
  56. package/.build/types/hooks/usePaintingAnnotations.d.ts +4 -0
  57. package/.build/types/hooks/useRange.d.ts +8 -0
  58. package/.build/types/hooks/useRenderingStrategy.d.ts +14 -0
  59. package/.build/types/hooks/useResourceEvents.d.ts +3 -0
  60. package/.build/types/hooks/useResources.d.ts +1 -0
  61. package/.build/types/hooks/useSearchService.d.ts +2 -0
  62. package/.build/types/hooks/useSimpleMediaPlayer.d.ts +32 -0
  63. package/.build/types/hooks/useStyleHelper.d.ts +1 -0
  64. package/.build/types/hooks/useStyles.d.ts +3 -0
  65. package/.build/types/hooks/useThumbnail.d.ts +5 -0
  66. package/.build/types/hooks/useVault.d.ts +2 -0
  67. package/.build/types/hooks/useVaultEffect.d.ts +2 -0
  68. package/.build/types/hooks/useVaultSelector.d.ts +2 -0
  69. package/.build/types/hooks/useVirtualAnnotationPage.d.ts +13 -0
  70. package/.build/types/hooks/useVirtualAnnotationPageContext.d.ts +9 -0
  71. package/.build/types/hooks/useVirtualCanvas.d.ts +0 -0
  72. package/.build/types/index.d.ts +56 -0
  73. package/.build/types/utility/expand-target.d.ts +19 -0
  74. package/.build/types/utility/flatten-annotation-page-ids.d.ts +7 -0
  75. package/.build/types/utility/parse-selector.d.ts +7 -0
  76. package/.build/types/viewers/SimpleViewerContext.d.ts +18 -0
  77. package/.build/types/viewers/SingleCanvasContext.d.ts +1 -0
  78. package/dist/bundle/cjs/index.js +36 -0
  79. package/dist/bundle/cjs/index.js.map +1 -0
  80. package/dist/{esm → bundle/esm}/index.mjs +720 -790
  81. package/dist/bundle/esm/index.mjs.map +1 -0
  82. package/dist/canvas-panel/cjs/canvas-panel.js +36 -0
  83. package/dist/canvas-panel/cjs/canvas-panel.js.map +1 -0
  84. package/dist/canvas-panel/esm/canvas-panel.mjs +2024 -0
  85. package/dist/canvas-panel/esm/canvas-panel.mjs.map +1 -0
  86. package/dist/index.umd.js +121 -31744
  87. package/dist/index.umd.js.map +1 -0
  88. package/package.json +38 -28
  89. package/dist/cjs/index.js +0 -2538
  90. package/dist/index.d.ts +0 -619
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { AtlasProps } from '@atlas-viewer/atlas/dist/types/modules/react-reconciler/Atlas';
3
+ export declare function Viewer({ children, errorFallback, outerContainerProps, ...props }: AtlasProps & {
4
+ height?: number | string;
5
+ width?: number | string;
6
+ resizeHash?: number;
7
+ containerProps?: any;
8
+ outerContainerProps?: any;
9
+ aspectRatio?: number;
10
+ errorFallback?: any;
11
+ } & {
12
+ children: ReactNode;
13
+ }): JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { Viewer } from './Viewer';
2
+ import { RenderCanvas } from './render/Canvas';
3
+ import { RenderImage } from './render/Image';
4
+ export declare const CanvasPanel: {
5
+ RenderImage: typeof RenderImage;
6
+ RenderCanvas: typeof RenderCanvas;
7
+ RenderAnnotationPage: import("react").FC<{
8
+ page: import("@iiif/presentation-3").AnnotationPageNormalized | import("@iiif/presentation-3").AnnotationPage;
9
+ className?: string | undefined;
10
+ }>;
11
+ RenderAnnotation: import("react").FC<{
12
+ id: string;
13
+ className?: string | undefined;
14
+ style?: import("@atlas-viewer/atlas/*").BoxStyle | undefined;
15
+ interactive?: boolean | undefined;
16
+ }>;
17
+ Viewer: typeof Viewer;
18
+ };
@@ -0,0 +1,8 @@
1
+ import { BoxStyle } from '@atlas-viewer/atlas';
2
+ import { FC } from 'react';
3
+ export declare const RenderAnnotation: FC<{
4
+ id: string;
5
+ className?: string;
6
+ style?: BoxStyle;
7
+ interactive?: boolean;
8
+ }>;
@@ -0,0 +1,6 @@
1
+ import { AnnotationPage, AnnotationPageNormalized } from '@iiif/presentation-3';
2
+ import { FC } from 'react';
3
+ export declare const RenderAnnotationPage: FC<{
4
+ page: AnnotationPage | AnnotationPageNormalized;
5
+ className?: string;
6
+ }>;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ import { SingleAudio } from '../../features/rendering-strategy/resource-types';
3
+ export declare function Audio({ media, children }: {
4
+ media: SingleAudio;
5
+ children: ReactNode;
6
+ }): JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from 'react';
2
+ import { ChoiceDescription } from '../../features/rendering-strategy/choice-types';
3
+ import { StrategyActions } from '../../hooks/useRenderingStrategy';
4
+ import { MediaStrategy, RenderingStrategy } from '../../features/rendering-strategy/strategies';
5
+ import { SingleImageStrategy } from '../../features/rendering-strategy/image-strategy';
6
+ declare type CanvasProps = {
7
+ x?: number;
8
+ y?: number;
9
+ onCreated?: any;
10
+ onChoiceChange?: (choice?: ChoiceDescription) => void;
11
+ registerActions?: (actions: StrategyActions) => void;
12
+ defaultChoices?: Array<{
13
+ id: string;
14
+ opacity?: number;
15
+ }>;
16
+ isStatic?: boolean;
17
+ children?: ReactNode;
18
+ renderViewerControls?: (strategy: SingleImageStrategy) => ReactNode;
19
+ renderMediaControls?: (strategy: MediaStrategy) => ReactNode;
20
+ strategies?: Array<RenderingStrategy['type']>;
21
+ };
22
+ export declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic, renderViewerControls, renderMediaControls, strategies, children, }: CanvasProps): JSX.Element | null;
23
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare function DefaultCanvasFallback({ width, style, height }: {
2
+ width?: number;
3
+ height?: number;
4
+ style?: any;
5
+ }): JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { ImageCandidate } from '@atlas-viewer/iiif-image-api';
2
+ import { ReactNode } from 'react';
3
+ import { ImageWithOptionalService } from '../../features/rendering-strategy/resource-types';
4
+ export declare function RenderImage({ id, image, thumbnail, isStatic, x, y, annotations, children, }: {
5
+ id: string;
6
+ image: ImageWithOptionalService;
7
+ thumbnail?: ImageCandidate;
8
+ isStatic?: boolean;
9
+ x?: number;
10
+ y?: number;
11
+ annotations?: ReactNode;
12
+ children?: ReactNode;
13
+ }): JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare function Model({ model }: {
2
+ model: any;
3
+ }): JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ import { SingleVideo } from '../../features/rendering-strategy/resource-types';
3
+ export declare function Video({ media, children }: {
4
+ media: SingleVideo;
5
+ children: ReactNode;
6
+ }): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function AnnotationContext({ annotation, children }: {
3
+ annotation: string;
4
+ children: ReactNode;
5
+ }): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function CanvasContext({ canvas, children }: {
3
+ canvas: string;
4
+ children: ReactNode;
5
+ }): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function CollectionContext({ collection, children }: {
3
+ collection: string;
4
+ children: ReactNode;
5
+ }): JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function useContextBridge(): {
3
+ VaultContext: {
4
+ vault: import("@iiif/vault/*").Vault | null;
5
+ setVaultInstance: (vault: import("@iiif/vault/*").Vault) => void;
6
+ };
7
+ ResourceContext: import("./ResourceContext").ResourceContextType;
8
+ SimpleViewerReactContext: {
9
+ setCurrentCanvasId: (newId: string | ((prev: string) => string)) => void;
10
+ setCurrentCanvasIndex: (newId: number | ((prev: number) => number)) => void;
11
+ currentCanvasIndex: number;
12
+ pagingView: boolean;
13
+ totalCanvases: number;
14
+ nextCanvas: () => void;
15
+ previousCanvas: () => void;
16
+ };
17
+ VisibleCanvasReactContext: string[];
18
+ };
19
+ export declare function ContextBridge(props: {
20
+ bridge: ReturnType<typeof useContextBridge>;
21
+ children: ReactNode;
22
+ }): JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ImageServiceLoader } from '@atlas-viewer/iiif-image-api';
3
+ export declare const ImageServiceLoaderContext: React.Context<ImageServiceLoader>;
4
+ export declare function useImageServiceLoader(): ImageServiceLoader;
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function ManifestContext({ manifest, children }: {
3
+ manifest: string;
4
+ children: ReactNode;
5
+ }): JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { ReactNode, RefObject } from 'react';
2
+ import { MediaPlayerActions, MediaPlayerState } from '../hooks/useSimpleMediaPlayer';
3
+ export declare function useMediaState(): MediaPlayerState;
4
+ export declare function useMediaActions(): MediaPlayerActions;
5
+ export declare function useMediaElements(): {
6
+ element: RefObject<HTMLAudioElement | HTMLVideoElement>;
7
+ currentTime: RefObject<HTMLDivElement>;
8
+ progress: RefObject<HTMLDivElement>;
9
+ };
10
+ export declare function MediaPlayerProvider({ actions, state, children, currentTime, progress, element, }: {
11
+ actions: MediaPlayerActions;
12
+ state: MediaPlayerState;
13
+ children: ReactNode;
14
+ currentTime: RefObject<HTMLDivElement>;
15
+ progress: RefObject<HTMLDivElement>;
16
+ element: RefObject<HTMLAudioElement | HTMLVideoElement>;
17
+ }): JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from 'react';
2
+ export declare const PortalContext: React.Context<HTMLDivElement | null>;
3
+ export declare const OverlayPortalContext: React.Context<HTMLDivElement | null>;
4
+ export declare function CanvasPortal({ children, overlay }: {
5
+ children: ReactNode;
6
+ overlay?: boolean;
7
+ }): null;
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function RangeContext({ range, children }: {
3
+ range: string;
4
+ children: ReactNode;
5
+ }): JSX.Element;
@@ -0,0 +1,14 @@
1
+ import React, { ReactNode } from 'react';
2
+ export declare type ResourceContextType = {
3
+ collection?: string;
4
+ manifest?: string;
5
+ range?: string;
6
+ canvas?: string;
7
+ annotation?: string;
8
+ };
9
+ export declare const ResourceReactContext: React.Context<ResourceContextType>;
10
+ export declare const useResourceContext: () => ResourceContextType;
11
+ export declare function ResourceProvider({ value, children }: {
12
+ value: ResourceContextType;
13
+ children: ReactNode;
14
+ }): JSX.Element;
@@ -0,0 +1,14 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Vault, VaultOptions } from '@iiif/vault';
3
+ import { ResourceContextType } from './ResourceContext';
4
+ export declare const ReactVaultContext: React.Context<{
5
+ vault: Vault | null;
6
+ setVaultInstance: (vault: Vault) => void;
7
+ }>;
8
+ export declare function VaultProvider({ vault, vaultOptions, useGlobal, resources, children, }: {
9
+ vault?: Vault;
10
+ useGlobal?: boolean;
11
+ vaultOptions?: VaultOptions;
12
+ resources?: ResourceContextType;
13
+ children: ReactNode;
14
+ }): JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { Preset } from '@atlas-viewer/atlas';
2
+ export declare const ViewerPresetContext: import("react").Context<Preset | null | undefined>;
3
+ export declare function useViewerPreset(): Preset | null | undefined;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CanvasNormalized } from '@iiif/presentation-3';
3
+ export declare const VisibleCanvasReactContext: React.Context<string[]>;
4
+ export declare function useVisibleCanvases(): CanvasNormalized[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare function MediaControls(): JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ViewerControls(): JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { CanvasNormalized } from '@iiif/presentation-3';
2
+ import { Paintables } from './rendering-utils';
3
+ import { AnnotationPageDescription } from './resource-types';
4
+ import { ChoiceDescription } from './choice-types';
5
+ import { ExternalWebResource } from '@iiif/presentation-3/resources/annotation';
6
+ import { RenderingStrategy } from './strategies';
7
+ export declare type Single3DModelStrategy = {
8
+ type: '3d-model';
9
+ model: ExternalWebResource;
10
+ choice?: ChoiceDescription;
11
+ annotations?: AnnotationPageDescription;
12
+ };
13
+ export declare function get3dStrategy(canvas: CanvasNormalized, paintables: Paintables): RenderingStrategy;
@@ -0,0 +1,3 @@
1
+ import { CanvasNormalized } from '@iiif/presentation-3';
2
+ import { Paintables } from './rendering-utils';
3
+ export declare function getAudioStrategy(canvas: CanvasNormalized, paintables: Paintables): import("./strategies").RenderingStrategy;
@@ -0,0 +1,15 @@
1
+ import { InternationalString } from '@iiif/presentation-3';
2
+ export interface SingleChoice {
3
+ type: 'single-choice';
4
+ label?: InternationalString;
5
+ items: Array<{
6
+ id: string;
7
+ label?: InternationalString;
8
+ selected?: true;
9
+ }>;
10
+ }
11
+ export interface ComplexChoice {
12
+ type: 'complex-choice';
13
+ items: SingleChoice[];
14
+ }
15
+ export declare type ChoiceDescription = SingleChoice | ComplexChoice;
@@ -0,0 +1,13 @@
1
+ import { CanvasNormalized } from '@iiif/presentation-3';
2
+ import { ImageServiceLoaderType } from '../../hooks/useLoadImageService';
3
+ import { AnnotationPageDescription, ImageWithOptionalService } from './resource-types';
4
+ import { Paintables } from './rendering-utils';
5
+ import { ChoiceDescription } from './choice-types';
6
+ export declare type SingleImageStrategy = {
7
+ type: 'images';
8
+ image: ImageWithOptionalService;
9
+ images: Array<ImageWithOptionalService>;
10
+ choice?: ChoiceDescription;
11
+ annotations?: AnnotationPageDescription;
12
+ };
13
+ export declare function getImageStrategy(canvas: CanvasNormalized, paintables: Paintables, loadImageService: ImageServiceLoaderType): import("./strategies").RenderingStrategy;
@@ -0,0 +1,21 @@
1
+ import { AnnotationNormalized, ContentResource, IIIFExternalWebResource, SpecificResource } from '@iiif/presentation-3';
2
+ import { Vault } from '@iiif/vault';
3
+ import { ChoiceDescription } from './choice-types';
4
+ import { UseRenderingStrategy } from '../../hooks/useRenderingStrategy';
5
+ export declare function parseSpecificResource(resource: ContentResource): any[];
6
+ export interface Paintables {
7
+ choice: ChoiceDescription | null;
8
+ types: string[];
9
+ items: Array<{
10
+ type: string;
11
+ resource: IIIFExternalWebResource | SpecificResource;
12
+ target: any;
13
+ selector: any;
14
+ }>;
15
+ }
16
+ export declare function getPaintables(vault: Vault, paintingAnnotations: AnnotationNormalized[], enabledChoices: string[]): Paintables;
17
+ export declare const emptyActions: {
18
+ makeChoice: () => void;
19
+ };
20
+ export declare const unknownResponse: UseRenderingStrategy[0];
21
+ export declare const unsupportedStrategy: (reason: string) => UseRenderingStrategy[0];
@@ -0,0 +1,42 @@
1
+ import { AnnotationPageNormalized, ImageService } from '@iiif/presentation-3';
2
+ import { BoxSelector, TemporalBoxSelector, TemporalSelector } from './selector-extensions';
3
+ export declare type ImageWithOptionalService = {
4
+ id: string;
5
+ type: 'Image';
6
+ service?: ImageService;
7
+ width?: number;
8
+ height?: number;
9
+ sizes?: Array<{
10
+ width: number;
11
+ height: number;
12
+ }>;
13
+ target: BoxSelector | TemporalBoxSelector;
14
+ selector: BoxSelector;
15
+ };
16
+ export declare type SingleAudio = {
17
+ type: 'Sound';
18
+ url: string;
19
+ format: string;
20
+ duration: number;
21
+ target: TemporalSelector;
22
+ selector: TemporalSelector;
23
+ };
24
+ export declare type SingleVideo = {
25
+ type: 'Video';
26
+ url: string;
27
+ format: string;
28
+ duration: number;
29
+ target: TemporalSelector | TemporalBoxSelector;
30
+ selector: TemporalSelector | TemporalBoxSelector;
31
+ };
32
+ export declare type AudioSequence = {
33
+ type: 'SoundSequence';
34
+ items: SingleAudio[];
35
+ };
36
+ export declare type VideoSequence = {
37
+ type: 'VideoSequence';
38
+ items: SingleVideo[];
39
+ };
40
+ export declare type AnnotationPageDescription = {
41
+ pages: AnnotationPageNormalized[];
42
+ };
@@ -0,0 +1,53 @@
1
+ export interface SupportedSelector {
2
+ type: string;
3
+ temporal?: {
4
+ startTime: number;
5
+ endTime?: number;
6
+ };
7
+ spatial?: {
8
+ unit?: 'percent' | 'pixel';
9
+ x: number;
10
+ y: number;
11
+ width?: number;
12
+ height?: number;
13
+ };
14
+ }
15
+ export interface BoxSelector extends SupportedSelector {
16
+ type: 'BoxSelector';
17
+ spatial: {
18
+ unit?: 'percent' | 'pixel';
19
+ x: number;
20
+ y: number;
21
+ width: number;
22
+ height: number;
23
+ };
24
+ }
25
+ export interface PointSelector extends SupportedSelector {
26
+ type: 'PointSelector';
27
+ spatial: {
28
+ x: number;
29
+ y: number;
30
+ };
31
+ }
32
+ export interface TemporalSelector extends SupportedSelector {
33
+ type: 'TemporalSelector';
34
+ temporal: {
35
+ startTime: number;
36
+ endTime?: number;
37
+ };
38
+ }
39
+ export interface TemporalBoxSelector extends SupportedSelector {
40
+ type: 'TemporalBoxSelector';
41
+ spatial: {
42
+ unit?: 'percent' | 'pixel';
43
+ x: number;
44
+ y: number;
45
+ width: number;
46
+ height: number;
47
+ };
48
+ temporal: {
49
+ startTime: number;
50
+ endTime?: number;
51
+ };
52
+ }
53
+ export declare type SupportedSelectors = TemporalSelector | BoxSelector | TemporalBoxSelector | PointSelector;
@@ -0,0 +1,22 @@
1
+ import { AnnotationPageDescription, AudioSequence, ImageWithOptionalService, SingleAudio, SingleVideo, VideoSequence } from './resource-types';
2
+ import { ChoiceDescription } from './choice-types';
3
+ import { SingleImageStrategy } from './image-strategy';
4
+ import { Single3DModelStrategy } from './3d-strategy';
5
+ export declare type MediaStrategy = {
6
+ type: 'media';
7
+ media: SingleAudio | SingleVideo | AudioSequence | VideoSequence;
8
+ choice?: ChoiceDescription;
9
+ annotations?: AnnotationPageDescription;
10
+ };
11
+ export declare type ComplexTimelineStrategy = {
12
+ type: 'complex-timeline';
13
+ items: Array<ImageWithOptionalService | SingleAudio | SingleVideo>;
14
+ choice?: ChoiceDescription;
15
+ annotations?: AnnotationPageDescription;
16
+ };
17
+ export declare type UnknownStrategy = {
18
+ type: 'unknown';
19
+ reason?: string;
20
+ annotations?: AnnotationPageDescription;
21
+ };
22
+ export declare type RenderingStrategy = SingleImageStrategy | MediaStrategy | ComplexTimelineStrategy | Single3DModelStrategy | UnknownStrategy;
@@ -0,0 +1,3 @@
1
+ import { CanvasNormalized } from '@iiif/presentation-3';
2
+ import { Paintables } from './rendering-utils';
3
+ export declare function getVideoStrategy(canvas: CanvasNormalized, paintables: Paintables): import("./strategies").RenderingStrategy;
@@ -0,0 +1,8 @@
1
+ import { AnnotationNormalized } from '@iiif/presentation-3';
2
+ export declare function useAnnotation(options?: {
3
+ id: string;
4
+ }): AnnotationNormalized | undefined;
5
+ export declare function useAnnotation<T>(options?: {
6
+ id: string;
7
+ selector: (annotation: AnnotationNormalized) => T;
8
+ }, deps?: any[]): T | undefined;
@@ -0,0 +1,10 @@
1
+ export declare function useAnnotationPageManager(resourceId?: string, options?: {
2
+ all?: boolean;
3
+ }): {
4
+ availablePageIds: string[];
5
+ enabledPageIds: string[];
6
+ setPageEnabled: (id: string, opt?: {
7
+ deselectOthers?: boolean;
8
+ }) => void;
9
+ setPageDisabled: (deselectId: string) => void;
10
+ };
@@ -0,0 +1,4 @@
1
+ import { AnnotationNormalized } from '@iiif/presentation-3';
2
+ export declare function useAnnotationsAtTime(time: number, options?: {
3
+ canvasId?: string;
4
+ }): AnnotationNormalized[];
@@ -0,0 +1,8 @@
1
+ import { CanvasNormalized } from '@iiif/presentation-3';
2
+ export declare function useCanvas(options?: {
3
+ id: string;
4
+ }): CanvasNormalized | undefined;
5
+ export declare function useCanvas<T>(options?: {
6
+ id: string;
7
+ selector: (canvas: CanvasNormalized) => T;
8
+ }, deps?: any[]): T | undefined;
@@ -0,0 +1 @@
1
+ export declare function useCanvasClock(canvasId?: string, autoplay?: boolean): void;
File without changes
File without changes
@@ -0,0 +1,8 @@
1
+ import { CollectionNormalized } from '@iiif/presentation-3';
2
+ export declare function useCollection(options: {
3
+ id: string;
4
+ }): CollectionNormalized | undefined;
5
+ export declare function useCollection<T>(options: {
6
+ id: string;
7
+ selector: (collection: CollectionNormalized) => T;
8
+ }, deps?: any[]): T | undefined;
@@ -0,0 +1,2 @@
1
+ import { ReduxStore } from '@iiif/vault';
2
+ export declare function useDispatch(): ReduxStore['dispatch'];
@@ -0,0 +1 @@
1
+ export declare function useEnabledAnnotationPageIds(resourceId?: string, availablePageIds?: string[]): string[];
@@ -0,0 +1,4 @@
1
+ import { Reference } from '@iiif/presentation-3';
2
+ declare type SupportedEvents = 'onClick';
3
+ export declare function useEventListener<T>(resource: Reference, name: SupportedEvents, listener: (e: any, resource: T) => void, scope?: string[], deps?: any[]): void;
4
+ export {};
@@ -0,0 +1 @@
1
+ export declare function useExistingVault(): any;
@@ -0,0 +1,13 @@
1
+ import { CollectionNormalized } from '@iiif/presentation-3';
2
+ import { ResourceRequestOptions } from './useExternalResource';
3
+ export declare function useExternalCollection(idOrRef: string | {
4
+ id: string;
5
+ type: string;
6
+ }, options?: ResourceRequestOptions): {
7
+ id: string;
8
+ requestId: string;
9
+ isLoaded: boolean;
10
+ cached?: boolean;
11
+ error: any;
12
+ manifest?: CollectionNormalized;
13
+ };
@@ -0,0 +1,13 @@
1
+ import { ManifestNormalized } from '@iiif/presentation-3';
2
+ import { ResourceRequestOptions } from './useExternalResource';
3
+ export declare function useExternalManifest(idOrRef: string | {
4
+ id: string;
5
+ type: string;
6
+ }, options?: ResourceRequestOptions): {
7
+ id: string;
8
+ requestId: string;
9
+ isLoaded: boolean;
10
+ cached?: boolean;
11
+ error: any;
12
+ manifest?: ManifestNormalized;
13
+ };
@@ -0,0 +1,16 @@
1
+ export declare type ResourceRequestOptions = {
2
+ noCache?: boolean;
3
+ };
4
+ export declare function useExternalResource<T extends {
5
+ id: string;
6
+ }>(idOrRef: string | {
7
+ id: string;
8
+ type: string;
9
+ }, { noCache }?: ResourceRequestOptions): {
10
+ id: string;
11
+ requestId: string;
12
+ isLoaded: boolean;
13
+ error: any;
14
+ cached: boolean;
15
+ resource?: T;
16
+ };
@@ -0,0 +1,9 @@
1
+ import { ImageService } from '@iiif/presentation-3';
2
+ export interface ImageServiceRequestOptions {
3
+ cacheKey?: string;
4
+ }
5
+ export declare function useImageService({ cacheKey }?: ImageServiceRequestOptions): {
6
+ data: ImageService | undefined;
7
+ isFetching: boolean;
8
+ status: 'error' | 'success' | 'loading' | 'idle';
9
+ };
@@ -0,0 +1,11 @@
1
+ import { ImageService } from '@iiif/presentation-3';
2
+ export declare function useImageTile(): {
3
+ isLoading: boolean;
4
+ tile: {
5
+ id: string | undefined;
6
+ width: number | null | undefined;
7
+ height: number | null | undefined;
8
+ imageService: ImageService;
9
+ thumbnail: undefined;
10
+ } | null;
11
+ };
@@ -0,0 +1,6 @@
1
+ import { ImageService } from '@iiif/presentation-3';
2
+ export declare type ImageServiceLoaderType = (imageService: any | undefined, { height, width }: {
3
+ height: number;
4
+ width: number;
5
+ }) => ImageService | undefined;
6
+ export declare function useLoadImageService(): readonly [ImageServiceLoaderType, Record<string, string>];
@@ -0,0 +1,8 @@
1
+ import { ManifestNormalized } from '@iiif/presentation-3';
2
+ export declare function useManifest(options?: {
3
+ id: string;
4
+ }): ManifestNormalized | undefined;
5
+ export declare function useManifest<T>(options?: {
6
+ id: string;
7
+ selector: (manifest: ManifestNormalized) => T;
8
+ }, deps?: any[]): T | undefined;
@@ -0,0 +1,8 @@
1
+ export declare function usePaintables(options?: {
2
+ defaultChoices?: string[];
3
+ }, deps?: any[]): readonly [import("../features/rendering-strategy/rendering-utils").Paintables, {
4
+ makeChoice: (id: string, { deselectOthers, deselect }?: {
5
+ deselectOthers?: boolean | undefined;
6
+ deselect?: boolean | undefined;
7
+ }) => void;
8
+ }];
@@ -0,0 +1,4 @@
1
+ import { AnnotationNormalized } from '@iiif/presentation-3';
2
+ export declare function usePaintingAnnotations(options?: {
3
+ canvasId?: string;
4
+ }): AnnotationNormalized[];