@micrio/client 7.0.10 → 7.0.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/micrio.min.d.ts +45 -14
- package/micrio.min.js +3 -3
- package/package.json +1 -1
package/micrio.min.d.ts
CHANGED
|
@@ -692,8 +692,8 @@ declare module '@micrio/client' {
|
|
|
692
692
|
prev: () => void;
|
|
693
693
|
/** Go to next page */
|
|
694
694
|
next: () => void;
|
|
695
|
-
/** Go to specific
|
|
696
|
-
goto: (n: number) =>
|
|
695
|
+
/** Go to specific image index. Resolves once the gallery has animated to the target page. */
|
|
696
|
+
goto: (n: number) => Promise<MicrioImage | undefined>;
|
|
697
697
|
/** Album has been initialized and hooked */
|
|
698
698
|
hooked?: boolean;
|
|
699
699
|
/** Strip-swipe only: writable store tracking the currently active child
|
|
@@ -1758,12 +1758,10 @@ declare module '@micrio/client' {
|
|
|
1758
1758
|
export class Gallery {
|
|
1759
1759
|
#private;
|
|
1760
1760
|
readonly _items: Models.ImageInfo.ImageInfo[];
|
|
1761
|
-
|
|
1762
|
-
goto(index: number)
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
/** Go to the previous page. */
|
|
1766
|
-
prev(): void;
|
|
1761
|
+
gotoId: (id: string) => Promise<MicrioImage | undefined>;
|
|
1762
|
+
goto: (index: number) => Promise<MicrioImage | undefined>;
|
|
1763
|
+
next: () => void;
|
|
1764
|
+
prev: () => void;
|
|
1767
1765
|
}
|
|
1768
1766
|
|
|
1769
1767
|
/** Manages omni 3D object rotation UI: dial, swipe gestures, frame navigation, and layer menu. */
|
|
@@ -1852,6 +1850,10 @@ declare module '@micrio/client' {
|
|
|
1852
1850
|
export const VIEWPORT_MARGIN_PCT = 0.05;
|
|
1853
1851
|
/** Default camera polar angle in radians (0 = side view, π/2 = directly overhead) */
|
|
1854
1852
|
export const DEFAULT_CAMERA_PHI: number;
|
|
1853
|
+
/** When true, page margins without a texture are discarded instead of drawn as
|
|
1854
|
+
* transparent: they no longer block the pages behind them and you can see
|
|
1855
|
+
* through to the underlying spread. */
|
|
1856
|
+
export const SEE_THROUGH_MARGINS = false;
|
|
1855
1857
|
/** RGB tint for the front face of each page */
|
|
1856
1858
|
export const FRONT_COLOR: [number, number, number];
|
|
1857
1859
|
/** RGB tint for the back face of each page */
|
|
@@ -2029,11 +2031,20 @@ declare module '@micrio/client' {
|
|
|
2029
2031
|
export class PaperRenderer {
|
|
2030
2032
|
#private;
|
|
2031
2033
|
_tiltShiftEnabled: boolean;
|
|
2034
|
+
/** When true, page margins without a texture are discarded (see-through) instead of drawn as transparent, so pages behind remain visible. */
|
|
2035
|
+
_seeThroughMargins: boolean;
|
|
2032
2036
|
constructor(gl: WebGL2RenderingContext);
|
|
2033
2037
|
_initialize(meshes: PaperMesh[]): void;
|
|
2034
2038
|
_setPageTextures(pageIndex: number, frontBitmap: TexImageSource, backBitmap: TexImageSource): void;
|
|
2035
2039
|
_setPageHiResTexture(pageIdx: number, side: 0 | 1, slot: 0 | 1, bitmap: ImageBitmap): void;
|
|
2036
2040
|
_setPageBlend(pageIdx: number, frontBlendA: number, frontBlendB: number, backBlendA: number, backBlendB: number): void;
|
|
2041
|
+
/**
|
|
2042
|
+
* Sets the per-page texture regions (see the fragment shader): each page's
|
|
2043
|
+
* front/back texture only occupies a sub-rectangle `[uMin, vMin, fU, fV]` of
|
|
2044
|
+
* the page UV space. Pass regions of `(0, 0, 1, 1)` to stretch textures over
|
|
2045
|
+
* the whole page. Each array has `4 · pageCount` floats.
|
|
2046
|
+
*/
|
|
2047
|
+
_setAspectRegions(frontRegions: Float32Array, backRegions: Float32Array): void;
|
|
2037
2048
|
_evictPageHiRes(pageIdx: number, side: 0 | 1, slot: 0 | 1): void;
|
|
2038
2049
|
_getCanvas(): HTMLCanvasElement;
|
|
2039
2050
|
_setLightingPreset(name: string, params: Record<string, number>): void;
|
|
@@ -2143,8 +2154,8 @@ declare module '@micrio/client' {
|
|
|
2143
2154
|
_gravity: number;
|
|
2144
2155
|
_gravityEnabled: boolean;
|
|
2145
2156
|
}
|
|
2146
|
-
export function
|
|
2147
|
-
export function
|
|
2157
|
+
export function isSolverReady(): boolean;
|
|
2158
|
+
export function initSolver(meshes: PaperMesh[], pageCount: number): Promise<void>;
|
|
2148
2159
|
export function dispatchSolve(subDt: number, activeIndices: number[], substeps: number, solverSettings: SolverSettings, meshes: PaperMesh[], progress: Float32Array, totalStackHeight: number, pageCount: number, pageThickness: number): void;
|
|
2149
2160
|
|
|
2150
2161
|
export class IIIFTextureManager {
|
|
@@ -2184,6 +2195,18 @@ declare module '@micrio/client' {
|
|
|
2184
2195
|
/** World-space direction of increasing image v (not normalized). */
|
|
2185
2196
|
_tangentV: Vec3;
|
|
2186
2197
|
}
|
|
2198
|
+
/**
|
|
2199
|
+
* The sub-rectangle of a page's UV space in which a texture is displayed with
|
|
2200
|
+
* its native aspect ratio. `uMin`/`vMin` are the lower-left corner and
|
|
2201
|
+
* `fU`/`fV` the fraction of the page's u/v range the texture occupies. A region
|
|
2202
|
+
* of `(0, 0, 1, 1)` stretches the texture over the whole page.
|
|
2203
|
+
*/
|
|
2204
|
+
export interface TexRegion {
|
|
2205
|
+
uMin: number;
|
|
2206
|
+
vMin: number;
|
|
2207
|
+
fU: number;
|
|
2208
|
+
fV: number;
|
|
2209
|
+
}
|
|
2187
2210
|
/**
|
|
2188
2211
|
* Returns the world-space position, surface normal and UV tangents of a
|
|
2189
2212
|
* relative texture coordinate (u, v) on a page mesh, using the mesh's *current*
|
|
@@ -2194,14 +2217,18 @@ declare module '@micrio/client' {
|
|
|
2194
2217
|
* 1 = back face (sampled with the U axis mirrored on a single-grid PaperMesh,
|
|
2195
2218
|
* or on the separate back-face grid of a CoverMesh).
|
|
2196
2219
|
*
|
|
2220
|
+
* `region` restricts the image to a sub-rectangle of the page (see
|
|
2221
|
+
* {@link TexRegion}); the tangents are scaled accordingly. When omitted the
|
|
2222
|
+
* image is stretched over the whole page.
|
|
2223
|
+
*
|
|
2197
2224
|
* Returns null when (u, v) falls outside [0, 1].
|
|
2198
2225
|
*/
|
|
2199
|
-
export function uvToWorldPosition(mesh: PaperMesh, u: number, v: number, side: 0 | 1): UvWorldResult | null;
|
|
2226
|
+
export function uvToWorldPosition(mesh: PaperMesh, u: number, v: number, side: 0 | 1, region?: TexRegion | null): UvWorldResult | null;
|
|
2200
2227
|
/**
|
|
2201
2228
|
* Like `uvToWorldPosition` but returns only the interpolated world-space
|
|
2202
2229
|
* position, skipping the surface normal and tangent computation.
|
|
2203
2230
|
*/
|
|
2204
|
-
export function sampleMeshPosition(mesh: PaperMesh, u: number, v: number, side: 0 | 1): Vec3 | null;
|
|
2231
|
+
export function sampleMeshPosition(mesh: PaperMesh, u: number, v: number, side: 0 | 1, region?: TexRegion | null): Vec3 | null;
|
|
2205
2232
|
/**
|
|
2206
2233
|
* Projects a world-space point through the given view-projection matrix to CSS
|
|
2207
2234
|
* pixel coordinates relative to the canvas top-left. Returns null when the point
|
|
@@ -2237,6 +2264,10 @@ declare module '@micrio/client' {
|
|
|
2237
2264
|
_tiltShift?: boolean;
|
|
2238
2265
|
_lightingPreset?: string;
|
|
2239
2266
|
_useIndividualAspects?: boolean;
|
|
2267
|
+
/** When true, page margins without a texture are discarded instead of drawn as
|
|
2268
|
+
* transparent: they no longer block the pages behind them and you can see
|
|
2269
|
+
* through to the underlying spread. */
|
|
2270
|
+
_seeThroughMargins?: boolean;
|
|
2240
2271
|
_startPageIdx?: number;
|
|
2241
2272
|
/** Base URL for the IIIF image server (hi-res streaming). */
|
|
2242
2273
|
_iiifBaseUrl?: string;
|
|
@@ -2246,7 +2277,7 @@ declare module '@micrio/client' {
|
|
|
2246
2277
|
static _getPresets: typeof getPresets;
|
|
2247
2278
|
readonly _ready: Promise<void>;
|
|
2248
2279
|
constructor(options: BookViewerOptions);
|
|
2249
|
-
goto(pageIdx: number): void
|
|
2280
|
+
goto(pageIdx: number): Promise<void>;
|
|
2250
2281
|
zoom(delta: number): void;
|
|
2251
2282
|
/**
|
|
2252
2283
|
* Returns whether the camera is zoomed in beyond the fit view. This is the
|
|
@@ -2475,7 +2506,7 @@ declare module '@micrio/client' {
|
|
|
2475
2506
|
/** Holds bundle-level marker tours, available regardless of which image is shown. */
|
|
2476
2507
|
bundleTours: Models.ImageData.MarkerTour[] | undefined;
|
|
2477
2508
|
/** The current active gallery controller, if any. */
|
|
2478
|
-
|
|
2509
|
+
gallery: Gallery | undefined;
|
|
2479
2510
|
/** Destroys the Micrio instance, cleans up resources, and removes event listeners. */
|
|
2480
2511
|
destroy(): void;
|
|
2481
2512
|
/**
|