react-iiif-vault 0.9.10 → 0.9.13
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/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 +54 -0
- package/.build/types/utility/flatten-annotation-page-ids.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 +740 -791
- 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 +2043 -0
- package/dist/canvas-panel/esm/canvas-panel.mjs.map +1 -0
- package/dist/index.umd.js +121 -31742
- package/dist/index.umd.js.map +1 -0
- package/package.json +38 -28
- package/dist/cjs/index.js +0 -2536
- package/dist/index.d.ts +0 -615
|
@@ -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,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,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,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,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,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 @@
|
|
|
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,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 '@iiif/vault-helpers/annotation-targets';
|
|
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,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,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,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 @@
|
|
|
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,8 @@
|
|
|
1
|
+
import { RangeNormalized } from '@iiif/presentation-3';
|
|
2
|
+
export declare function useRange(options?: {
|
|
3
|
+
id: string;
|
|
4
|
+
}): RangeNormalized | undefined;
|
|
5
|
+
export declare function useRange<T>(options?: {
|
|
6
|
+
id: string;
|
|
7
|
+
selector: (range: RangeNormalized) => T;
|
|
8
|
+
}, deps?: any[]): T | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RenderingStrategy } from '../features/rendering-strategy/strategies';
|
|
2
|
+
export declare type StrategyActions = {
|
|
3
|
+
makeChoice: (id: string, options?: {
|
|
4
|
+
deselectOthers?: boolean;
|
|
5
|
+
deselect?: boolean;
|
|
6
|
+
}) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare type UseRenderingStrategy = [RenderingStrategy, StrategyActions];
|
|
9
|
+
export declare type UseRenderingStrategyOptions = {
|
|
10
|
+
strategies?: Array<RenderingStrategy['type']>;
|
|
11
|
+
annotationPageManagerId?: string;
|
|
12
|
+
defaultChoices?: string[];
|
|
13
|
+
};
|
|
14
|
+
export declare function useRenderingStrategy(options?: UseRenderingStrategyOptions): UseRenderingStrategy;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useResources<Type>(ids: string[], type: string): Type[];
|