@embedpdf/plugin-scroll 1.0.11 → 1.0.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/dist/index.cjs +2 -661
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -204
- package/dist/index.js +33 -67
- package/dist/index.js.map +1 -1
- package/dist/lib/actions.d.ts +27 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/manifest.d.ts +4 -0
- package/dist/lib/reducer.d.ts +6 -0
- package/dist/lib/scroll-plugin.d.ts +45 -0
- package/dist/lib/selectors.d.ts +2 -0
- package/dist/lib/strategies/base-strategy.d.ts +35 -0
- package/dist/lib/strategies/horizontal-strategy.d.ts +14 -0
- package/dist/lib/strategies/vertical-strategy.d.ts +14 -0
- package/dist/lib/types/virtual-item.d.ts +21 -0
- package/dist/lib/types.d.ts +112 -0
- package/dist/preact/adapter.d.ts +4 -0
- package/dist/preact/core.d.ts +1 -0
- package/dist/preact/index.cjs +2 -181
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.d.ts +1 -54
- package/dist/preact/index.js +13 -18
- package/dist/preact/index.js.map +1 -1
- package/dist/react/adapter.d.ts +2 -0
- package/dist/react/core.d.ts +1 -0
- package/dist/react/index.cjs +2 -181
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.ts +1 -53
- package/dist/react/index.js +12 -18
- package/dist/react/index.js.map +1 -1
- package/dist/shared-preact/components/index.d.ts +1 -0
- package/dist/shared-preact/components/scroller.d.ts +14 -0
- package/dist/shared-preact/hooks/index.d.ts +1 -0
- package/dist/shared-preact/hooks/use-scroll.d.ts +32 -0
- package/dist/shared-preact/index.d.ts +2 -0
- package/dist/shared-react/components/index.d.ts +1 -0
- package/dist/shared-react/components/scroller.d.ts +14 -0
- package/dist/shared-react/hooks/index.d.ts +1 -0
- package/dist/shared-react/hooks/use-scroll.d.ts +32 -0
- package/dist/shared-react/index.d.ts +2 -0
- package/dist/vue/components/index.d.ts +1 -0
- package/dist/vue/components/scroller.vue.d.ts +28 -0
- package/dist/vue/hooks/index.d.ts +1 -0
- package/dist/vue/hooks/use-scroll.d.ts +11 -0
- package/dist/vue/index.cjs +2 -0
- package/dist/vue/index.cjs.map +1 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +136 -0
- package/dist/vue/index.js.map +1 -0
- package/package.json +22 -13
- package/dist/index.d.cts +0 -204
- package/dist/preact/index.d.cts +0 -54
- package/dist/react/index.d.cts +0 -53
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/plugin-scroll",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -20,23 +20,30 @@
|
|
|
20
20
|
"types": "./dist/react/index.d.ts",
|
|
21
21
|
"import": "./dist/react/index.js",
|
|
22
22
|
"require": "./dist/react/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./vue": {
|
|
25
|
+
"types": "./dist/vue/index.d.ts",
|
|
26
|
+
"import": "./dist/vue/index.js",
|
|
27
|
+
"require": "./dist/vue/index.cjs"
|
|
23
28
|
}
|
|
24
29
|
},
|
|
25
30
|
"dependencies": {
|
|
26
|
-
"@embedpdf/models": "1.0.
|
|
31
|
+
"@embedpdf/models": "1.0.13"
|
|
27
32
|
},
|
|
28
33
|
"devDependencies": {
|
|
29
34
|
"@types/react": "^18.2.0",
|
|
30
|
-
"tsup": "^8.0.0",
|
|
31
35
|
"typescript": "^5.0.0",
|
|
32
|
-
"@embedpdf/
|
|
36
|
+
"@embedpdf/build": "1.0.0",
|
|
37
|
+
"@embedpdf/plugin-viewport": "1.0.13",
|
|
38
|
+
"@embedpdf/core": "1.0.13"
|
|
33
39
|
},
|
|
34
40
|
"peerDependencies": {
|
|
41
|
+
"preact": "^10.26.4",
|
|
35
42
|
"react": ">=16.8.0",
|
|
36
43
|
"react-dom": ">=16.8.0",
|
|
37
|
-
"
|
|
38
|
-
"@embedpdf/
|
|
39
|
-
"@embedpdf/
|
|
44
|
+
"vue": ">=3.2.0",
|
|
45
|
+
"@embedpdf/plugin-viewport": "1.0.13",
|
|
46
|
+
"@embedpdf/core": "1.0.13"
|
|
40
47
|
},
|
|
41
48
|
"files": [
|
|
42
49
|
"dist",
|
|
@@ -55,11 +62,13 @@
|
|
|
55
62
|
"access": "public"
|
|
56
63
|
},
|
|
57
64
|
"scripts": {
|
|
58
|
-
"build": "
|
|
59
|
-
"build:
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
65
|
+
"build:base": "vite build --mode base",
|
|
66
|
+
"build:react": "vite build --mode react",
|
|
67
|
+
"build:preact": "vite build --mode preact",
|
|
68
|
+
"build:vue": "vite build --mode vue",
|
|
69
|
+
"build": "pnpm run clean && concurrently -c auto -n base,react,preact,vue \"vite build --mode base\" \"vite build --mode react\" \"vite build --mode preact\" \"vite build --mode vue\"",
|
|
70
|
+
"clean": "rimraf dist",
|
|
71
|
+
"lint": "eslint src --color",
|
|
72
|
+
"lint:fix": "eslint src --color --fix"
|
|
64
73
|
}
|
|
65
74
|
}
|
package/dist/index.d.cts
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { BasePluginConfig, EventHook, Action, BasePlugin, PluginRegistry, StoreState, CoreState, PluginManifest, PluginPackage } from '@embedpdf/core';
|
|
2
|
-
import { Rect, Rotation, PdfPageObject } from '@embedpdf/models';
|
|
3
|
-
import { ViewportMetrics } from '@embedpdf/plugin-viewport';
|
|
4
|
-
|
|
5
|
-
interface PageLayout {
|
|
6
|
-
pageNumber: number;
|
|
7
|
-
pageIndex: number;
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
rotatedWidth: number;
|
|
13
|
-
rotatedHeight: number;
|
|
14
|
-
}
|
|
15
|
-
interface VirtualItem {
|
|
16
|
-
id: string;
|
|
17
|
-
x: number;
|
|
18
|
-
y: number;
|
|
19
|
-
offset: number;
|
|
20
|
-
width: number;
|
|
21
|
-
height: number;
|
|
22
|
-
pageLayouts: PageLayout[];
|
|
23
|
-
pageNumbers: number[];
|
|
24
|
-
index: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
interface ScrollState extends ScrollMetrics {
|
|
28
|
-
virtualItems: VirtualItem[];
|
|
29
|
-
totalPages: number;
|
|
30
|
-
totalContentSize: {
|
|
31
|
-
width: number;
|
|
32
|
-
height: number;
|
|
33
|
-
};
|
|
34
|
-
desiredScrollPosition: {
|
|
35
|
-
x: number;
|
|
36
|
-
y: number;
|
|
37
|
-
};
|
|
38
|
-
strategy: ScrollStrategy;
|
|
39
|
-
pageGap: number;
|
|
40
|
-
scale: number;
|
|
41
|
-
}
|
|
42
|
-
interface ScrollerLayout {
|
|
43
|
-
startSpacing: number;
|
|
44
|
-
endSpacing: number;
|
|
45
|
-
totalWidth: number;
|
|
46
|
-
totalHeight: number;
|
|
47
|
-
pageGap: number;
|
|
48
|
-
strategy: ScrollState['strategy'];
|
|
49
|
-
items: VirtualItem[];
|
|
50
|
-
}
|
|
51
|
-
declare enum ScrollStrategy {
|
|
52
|
-
Vertical = "vertical",
|
|
53
|
-
Horizontal = "horizontal"
|
|
54
|
-
}
|
|
55
|
-
interface PageVisibilityMetrics {
|
|
56
|
-
pageNumber: number;
|
|
57
|
-
viewportX: number;
|
|
58
|
-
viewportY: number;
|
|
59
|
-
visiblePercentage: number;
|
|
60
|
-
original: {
|
|
61
|
-
pageX: number;
|
|
62
|
-
pageY: number;
|
|
63
|
-
visibleWidth: number;
|
|
64
|
-
visibleHeight: number;
|
|
65
|
-
scale: number;
|
|
66
|
-
};
|
|
67
|
-
scaled: {
|
|
68
|
-
pageX: number;
|
|
69
|
-
pageY: number;
|
|
70
|
-
visibleWidth: number;
|
|
71
|
-
visibleHeight: number;
|
|
72
|
-
scale: number;
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
interface ScrollMetrics {
|
|
76
|
-
currentPage: number;
|
|
77
|
-
visiblePages: number[];
|
|
78
|
-
pageVisibilityMetrics: PageVisibilityMetrics[];
|
|
79
|
-
renderedPageIndexes: number[];
|
|
80
|
-
scrollOffset: {
|
|
81
|
-
x: number;
|
|
82
|
-
y: number;
|
|
83
|
-
};
|
|
84
|
-
startSpacing: number;
|
|
85
|
-
endSpacing: number;
|
|
86
|
-
}
|
|
87
|
-
interface ScrollStrategyInterface {
|
|
88
|
-
initialize(container: HTMLElement, innerDiv: HTMLElement): void;
|
|
89
|
-
destroy(): void;
|
|
90
|
-
updateLayout(viewport: ViewportMetrics, pdfPageObject: PdfPageObject[][]): void;
|
|
91
|
-
handleScroll(viewport: ViewportMetrics): void;
|
|
92
|
-
getVirtualItems(): VirtualItem[];
|
|
93
|
-
scrollToPage(pageNumber: number, behavior?: ScrollBehavior): void;
|
|
94
|
-
calculateDimensions(pdfPageObject: PdfPageObject[][]): void;
|
|
95
|
-
}
|
|
96
|
-
interface ScrollPluginConfig extends BasePluginConfig {
|
|
97
|
-
strategy?: ScrollStrategy;
|
|
98
|
-
initialPage?: number;
|
|
99
|
-
bufferSize?: number;
|
|
100
|
-
pageGap?: number;
|
|
101
|
-
}
|
|
102
|
-
type LayoutChangePayload = Pick<ScrollState, 'virtualItems' | 'totalContentSize'>;
|
|
103
|
-
interface ScrollToPageOptions {
|
|
104
|
-
pageNumber: number;
|
|
105
|
-
pageCoordinates?: {
|
|
106
|
-
x: number;
|
|
107
|
-
y: number;
|
|
108
|
-
};
|
|
109
|
-
behavior?: ScrollBehavior;
|
|
110
|
-
center?: boolean;
|
|
111
|
-
}
|
|
112
|
-
interface PageChangePayload {
|
|
113
|
-
pageNumber: number;
|
|
114
|
-
totalPages: number;
|
|
115
|
-
}
|
|
116
|
-
interface ScrollCapability {
|
|
117
|
-
onScrollerData: EventHook<ScrollerLayout>;
|
|
118
|
-
onStateChange: EventHook<ScrollState>;
|
|
119
|
-
onScroll: EventHook<ScrollMetrics>;
|
|
120
|
-
getCurrentPage(): number;
|
|
121
|
-
getTotalPages(): number;
|
|
122
|
-
onPageChange: EventHook<PageChangePayload>;
|
|
123
|
-
onLayoutChange: EventHook<LayoutChangePayload>;
|
|
124
|
-
onLayoutReady: EventHook<boolean>;
|
|
125
|
-
scrollToPage(options: ScrollToPageOptions): void;
|
|
126
|
-
scrollToNextPage(behavior?: ScrollBehavior): void;
|
|
127
|
-
scrollToPreviousPage(behavior?: ScrollBehavior): void;
|
|
128
|
-
getMetrics(viewport?: ViewportMetrics): ScrollMetrics;
|
|
129
|
-
getLayout(): LayoutChangePayload;
|
|
130
|
-
getScrollerLayout(): ScrollerLayout;
|
|
131
|
-
getRectPositionForPage(page: number, rect: Rect, scale?: number, rotation?: Rotation): Rect | null;
|
|
132
|
-
setScrollStrategy(strategy: ScrollStrategy): void;
|
|
133
|
-
getPageGap(): number;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
declare const UPDATE_SCROLL_STATE = "UPDATE_SCROLL_STATE";
|
|
137
|
-
declare const SET_DESIRED_SCROLL_POSITION = "SET_DESIRED_SCROLL_POSITION";
|
|
138
|
-
declare const UPDATE_TOTAL_PAGES = "UPDATE_TOTAL_PAGES";
|
|
139
|
-
interface UpdateScrollStateAction extends Action {
|
|
140
|
-
type: typeof UPDATE_SCROLL_STATE;
|
|
141
|
-
payload: Partial<ScrollState>;
|
|
142
|
-
}
|
|
143
|
-
interface SetDesiredScrollPositionAction extends Action {
|
|
144
|
-
type: typeof SET_DESIRED_SCROLL_POSITION;
|
|
145
|
-
payload: {
|
|
146
|
-
x: number;
|
|
147
|
-
y: number;
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
interface UpdateTotalPagesAction extends Action {
|
|
151
|
-
type: typeof UPDATE_TOTAL_PAGES;
|
|
152
|
-
payload: number;
|
|
153
|
-
}
|
|
154
|
-
type ScrollAction = UpdateScrollStateAction | SetDesiredScrollPositionAction | UpdateTotalPagesAction;
|
|
155
|
-
|
|
156
|
-
declare class ScrollPlugin extends BasePlugin<ScrollPluginConfig, ScrollCapability, ScrollState, ScrollAction> {
|
|
157
|
-
readonly id: string;
|
|
158
|
-
private config?;
|
|
159
|
-
static readonly id: "scroll";
|
|
160
|
-
private viewport;
|
|
161
|
-
private strategy;
|
|
162
|
-
private strategyConfig;
|
|
163
|
-
private currentScale;
|
|
164
|
-
private currentRotation;
|
|
165
|
-
private initialPage?;
|
|
166
|
-
private currentPage;
|
|
167
|
-
private layoutReady;
|
|
168
|
-
private readonly layout$;
|
|
169
|
-
private readonly scroll$;
|
|
170
|
-
private readonly state$;
|
|
171
|
-
private readonly scrollerLayout$;
|
|
172
|
-
private readonly pageChange$;
|
|
173
|
-
private readonly layoutReady$;
|
|
174
|
-
constructor(id: string, registry: PluginRegistry, config?: ScrollPluginConfig | undefined);
|
|
175
|
-
private computeLayout;
|
|
176
|
-
private computeMetrics;
|
|
177
|
-
private commit;
|
|
178
|
-
private commitMetrics;
|
|
179
|
-
private refreshAll;
|
|
180
|
-
private getVirtualItemsFromState;
|
|
181
|
-
private getScrollerLayoutFromState;
|
|
182
|
-
private pushScrollLayout;
|
|
183
|
-
onStoreUpdated(_prevState: ScrollState, _newState: ScrollState): void;
|
|
184
|
-
onCoreStoreUpdated(prevState: StoreState<CoreState>, newState: StoreState<CoreState>): void;
|
|
185
|
-
/**
|
|
186
|
-
* Change the scroll strategy at runtime (e.g., vertical <-> horizontal)
|
|
187
|
-
* @param newStrategy ScrollStrategy.Horizontal or ScrollStrategy.Vertical
|
|
188
|
-
*/
|
|
189
|
-
private setScrollStrategy;
|
|
190
|
-
setLayoutReady(): void;
|
|
191
|
-
protected buildCapability(): ScrollCapability;
|
|
192
|
-
private getMetrics;
|
|
193
|
-
private getLayout;
|
|
194
|
-
private getRectPositionForPage;
|
|
195
|
-
initialize(): Promise<void>;
|
|
196
|
-
destroy(): Promise<void>;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
declare const SCROLL_PLUGIN_ID = "scroll";
|
|
200
|
-
declare const manifest: PluginManifest<ScrollPluginConfig>;
|
|
201
|
-
|
|
202
|
-
declare const ScrollPluginPackage: PluginPackage<ScrollPlugin, ScrollPluginConfig, ScrollState, ScrollAction>;
|
|
203
|
-
|
|
204
|
-
export { type LayoutChangePayload, type PageChangePayload, type PageLayout, type PageVisibilityMetrics, SCROLL_PLUGIN_ID, type ScrollCapability, type ScrollMetrics, ScrollPlugin, type ScrollPluginConfig, ScrollPluginPackage, type ScrollState, ScrollStrategy, type ScrollStrategyInterface, type ScrollToPageOptions, type ScrollerLayout, type VirtualItem, manifest };
|
package/dist/preact/index.d.cts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import * as _embedpdf_models from '@embedpdf/models';
|
|
2
|
-
import { Rotation, PdfDocumentObject } from '@embedpdf/models';
|
|
3
|
-
import * as _embedpdf_plugin_viewport from '@embedpdf/plugin-viewport';
|
|
4
|
-
import * as _embedpdf_core from '@embedpdf/core';
|
|
5
|
-
import * as _embedpdf_plugin_scroll from '@embedpdf/plugin-scroll';
|
|
6
|
-
import { ScrollPlugin, PageLayout } from '@embedpdf/plugin-scroll';
|
|
7
|
-
import { JSX } from 'preact';
|
|
8
|
-
|
|
9
|
-
declare const useScrollPlugin: () => {
|
|
10
|
-
plugin: ScrollPlugin | null;
|
|
11
|
-
isLoading: boolean;
|
|
12
|
-
ready: Promise<void>;
|
|
13
|
-
};
|
|
14
|
-
declare const useScrollCapability: () => {
|
|
15
|
-
provides: Readonly<_embedpdf_plugin_scroll.ScrollCapability> | null;
|
|
16
|
-
isLoading: boolean;
|
|
17
|
-
ready: Promise<void>;
|
|
18
|
-
};
|
|
19
|
-
declare const useScroll: () => {
|
|
20
|
-
currentPage: number;
|
|
21
|
-
totalPages: number;
|
|
22
|
-
onScrollerData?: _embedpdf_core.EventHook<_embedpdf_plugin_scroll.ScrollerLayout> | undefined;
|
|
23
|
-
onStateChange?: _embedpdf_core.EventHook<_embedpdf_plugin_scroll.ScrollState> | undefined;
|
|
24
|
-
onScroll?: _embedpdf_core.EventHook<_embedpdf_plugin_scroll.ScrollMetrics> | undefined;
|
|
25
|
-
getCurrentPage?: (() => number) | undefined;
|
|
26
|
-
getTotalPages?: (() => number) | undefined;
|
|
27
|
-
onPageChange?: _embedpdf_core.EventHook<_embedpdf_plugin_scroll.PageChangePayload> | undefined;
|
|
28
|
-
onLayoutChange?: _embedpdf_core.EventHook<_embedpdf_plugin_scroll.LayoutChangePayload> | undefined;
|
|
29
|
-
onLayoutReady?: _embedpdf_core.EventHook<boolean> | undefined;
|
|
30
|
-
scrollToPage?: ((options: _embedpdf_plugin_scroll.ScrollToPageOptions) => void) | undefined;
|
|
31
|
-
scrollToNextPage?: ((behavior?: ScrollBehavior) => void) | undefined;
|
|
32
|
-
scrollToPreviousPage?: ((behavior?: ScrollBehavior) => void) | undefined;
|
|
33
|
-
getMetrics?: ((viewport?: _embedpdf_plugin_viewport.ViewportMetrics) => _embedpdf_plugin_scroll.ScrollMetrics) | undefined;
|
|
34
|
-
getLayout?: (() => _embedpdf_plugin_scroll.LayoutChangePayload) | undefined;
|
|
35
|
-
getScrollerLayout?: (() => _embedpdf_plugin_scroll.ScrollerLayout) | undefined;
|
|
36
|
-
getRectPositionForPage?: ((page: number, rect: _embedpdf_models.Rect, scale?: number, rotation?: _embedpdf_models.Rotation) => _embedpdf_models.Rect | null) | undefined;
|
|
37
|
-
setScrollStrategy?: ((strategy: _embedpdf_plugin_scroll.ScrollStrategy) => void) | undefined;
|
|
38
|
-
getPageGap?: (() => number) | undefined;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/** @jsxImportSource preact */
|
|
42
|
-
|
|
43
|
-
interface RenderPageProps extends PageLayout {
|
|
44
|
-
rotation: Rotation;
|
|
45
|
-
scale: number;
|
|
46
|
-
document: PdfDocumentObject | null;
|
|
47
|
-
}
|
|
48
|
-
type ScrollerProps = JSX.HTMLAttributes<HTMLDivElement> & {
|
|
49
|
-
renderPage: (props: RenderPageProps) => JSX.Element;
|
|
50
|
-
overlayElements?: JSX.Element[];
|
|
51
|
-
};
|
|
52
|
-
declare function Scroller({ renderPage, overlayElements, ...props }: ScrollerProps): JSX.Element | null;
|
|
53
|
-
|
|
54
|
-
export { Scroller, useScroll, useScrollCapability, useScrollPlugin };
|
package/dist/react/index.d.cts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as _embedpdf_models from '@embedpdf/models';
|
|
2
|
-
import { Rotation, PdfDocumentObject } from '@embedpdf/models';
|
|
3
|
-
import * as _embedpdf_plugin_viewport from '@embedpdf/plugin-viewport';
|
|
4
|
-
import * as _embedpdf_core from '@embedpdf/core';
|
|
5
|
-
import * as _embedpdf_plugin_scroll from '@embedpdf/plugin-scroll';
|
|
6
|
-
import { ScrollPlugin, PageLayout } from '@embedpdf/plugin-scroll';
|
|
7
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
|
-
import React, { ReactNode } from 'react';
|
|
9
|
-
|
|
10
|
-
declare const useScrollPlugin: () => {
|
|
11
|
-
plugin: ScrollPlugin | null;
|
|
12
|
-
isLoading: boolean;
|
|
13
|
-
ready: Promise<void>;
|
|
14
|
-
};
|
|
15
|
-
declare const useScrollCapability: () => {
|
|
16
|
-
provides: Readonly<_embedpdf_plugin_scroll.ScrollCapability> | null;
|
|
17
|
-
isLoading: boolean;
|
|
18
|
-
ready: Promise<void>;
|
|
19
|
-
};
|
|
20
|
-
declare const useScroll: () => {
|
|
21
|
-
currentPage: number;
|
|
22
|
-
totalPages: number;
|
|
23
|
-
onScrollerData?: _embedpdf_core.EventHook<_embedpdf_plugin_scroll.ScrollerLayout> | undefined;
|
|
24
|
-
onStateChange?: _embedpdf_core.EventHook<_embedpdf_plugin_scroll.ScrollState> | undefined;
|
|
25
|
-
onScroll?: _embedpdf_core.EventHook<_embedpdf_plugin_scroll.ScrollMetrics> | undefined;
|
|
26
|
-
getCurrentPage?: (() => number) | undefined;
|
|
27
|
-
getTotalPages?: (() => number) | undefined;
|
|
28
|
-
onPageChange?: _embedpdf_core.EventHook<_embedpdf_plugin_scroll.PageChangePayload> | undefined;
|
|
29
|
-
onLayoutChange?: _embedpdf_core.EventHook<_embedpdf_plugin_scroll.LayoutChangePayload> | undefined;
|
|
30
|
-
onLayoutReady?: _embedpdf_core.EventHook<boolean> | undefined;
|
|
31
|
-
scrollToPage?: ((options: _embedpdf_plugin_scroll.ScrollToPageOptions) => void) | undefined;
|
|
32
|
-
scrollToNextPage?: ((behavior?: ScrollBehavior) => void) | undefined;
|
|
33
|
-
scrollToPreviousPage?: ((behavior?: ScrollBehavior) => void) | undefined;
|
|
34
|
-
getMetrics?: ((viewport?: _embedpdf_plugin_viewport.ViewportMetrics) => _embedpdf_plugin_scroll.ScrollMetrics) | undefined;
|
|
35
|
-
getLayout?: (() => _embedpdf_plugin_scroll.LayoutChangePayload) | undefined;
|
|
36
|
-
getScrollerLayout?: (() => _embedpdf_plugin_scroll.ScrollerLayout) | undefined;
|
|
37
|
-
getRectPositionForPage?: ((page: number, rect: _embedpdf_models.Rect, scale?: number, rotation?: _embedpdf_models.Rotation) => _embedpdf_models.Rect | null) | undefined;
|
|
38
|
-
setScrollStrategy?: ((strategy: _embedpdf_plugin_scroll.ScrollStrategy) => void) | undefined;
|
|
39
|
-
getPageGap?: (() => number) | undefined;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
interface RenderPageProps extends PageLayout {
|
|
43
|
-
rotation: Rotation;
|
|
44
|
-
scale: number;
|
|
45
|
-
document: PdfDocumentObject | null;
|
|
46
|
-
}
|
|
47
|
-
type ScrollerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
48
|
-
renderPage: (props: RenderPageProps) => ReactNode;
|
|
49
|
-
overlayElements?: ReactNode[];
|
|
50
|
-
};
|
|
51
|
-
declare function Scroller({ renderPage, overlayElements, ...props }: ScrollerProps): react_jsx_runtime.JSX.Element | null;
|
|
52
|
-
|
|
53
|
-
export { Scroller, useScroll, useScrollCapability, useScrollPlugin };
|