@atlas-viewer/atlas 3.1.0 → 3.2.0
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 +29 -23
- package/dist/index.d.cts +1724 -736
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1724 -736
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,11 +2,11 @@ import { Projection as Projection$1, Strand } from "@atlas-viewer/dna";
|
|
|
2
2
|
import { ImageService as ImageService$1, ViewingDirection as ViewingDirection$1 } from "@iiif/presentation-3";
|
|
3
3
|
import LRUCache from "lru-cache";
|
|
4
4
|
import { HookOptions as HookOptions$1 } from "src/standalone";
|
|
5
|
+
import { CanvasNormalized, ManifestNormalized } from "@iiif/presentation-3-normalized";
|
|
5
6
|
import * as react0 from "react";
|
|
6
|
-
import React, { ReactNode } from "react";
|
|
7
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
7
8
|
import { RectReadOnly } from "react-use-measure";
|
|
8
9
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
9
|
-
import { CanvasNormalized, ManifestNormalized } from "@iiif/presentation-3-normalized";
|
|
10
10
|
|
|
11
11
|
//#region src/events.d.ts
|
|
12
12
|
declare const supportedEventAttributes: readonly ["onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseOut", "onMouseOver", "onMouseUp", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "onPointerDown", "onPointerMove", "onPointerUp", "onPointerCancel", "onPointerEnter", "onPointerLeave", "onPointerOver", "onPointerOut", "onScroll", "onWheel", "onClick", "onDragStart", "onDragEnd", "onDragEnter", "onDragExit", "onDrag", "onDragOver", "onContextMenu"];
|
|
@@ -76,18 +76,6 @@ type SupportedEvents = {
|
|
|
76
76
|
type SupportedEventNames = 'mousedown' | 'mouseenter' | 'mouseleave' | 'mousemove' | 'mouseout' | 'mouseover' | 'mouseup' | 'touchcancel' | 'touchend' | 'touchmove' | 'touchstart' | 'pointerdown' | 'pointermove' | 'pointerup' | 'pointercancel' | 'pointerenter' | 'pointerleave' | 'pointerover' | 'pointerout' | 'scroll' | 'wheel' | 'click' | 'dragstart' | 'dragend' | 'dragenter' | 'dragexit' | 'drag' | 'dragover' | 'contextmenu';
|
|
77
77
|
type SupportedEventMap = { [Name in keyof SupportedEvents]: Array<SupportedEvents[Name]> };
|
|
78
78
|
//#endregion
|
|
79
|
-
//#region src/world-objects/paint.d.ts
|
|
80
|
-
type Paintable = SpacialContent;
|
|
81
|
-
type Paint = [Paintable, Strand, Strand | undefined];
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/world-objects/abstract-object.d.ts
|
|
84
|
-
interface AbstractObject {
|
|
85
|
-
id: string;
|
|
86
|
-
height: number;
|
|
87
|
-
width: number;
|
|
88
|
-
layers: Paintable[];
|
|
89
|
-
}
|
|
90
|
-
//#endregion
|
|
91
79
|
//#region src/aom.d.ts
|
|
92
80
|
interface AtlasObjectModel<Props, SupportedChildElements> {
|
|
93
81
|
applyProps(props: Props): void;
|
|
@@ -97,59 +85,180 @@ interface AtlasObjectModel<Props, SupportedChildElements> {
|
|
|
97
85
|
hideInstance(): void;
|
|
98
86
|
}
|
|
99
87
|
//#endregion
|
|
100
|
-
//#region src/
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
88
|
+
//#region src/modules/react-reconciler/devtools/types.d.ts
|
|
89
|
+
type RuntimeDebugEvent = RuntimeFrameStartEvent | RuntimePaintEvent | RuntimeFrameEndEvent;
|
|
90
|
+
type RuntimeFrameStartEvent = {
|
|
91
|
+
type: 'frame-start';
|
|
92
|
+
at: number;
|
|
93
|
+
runtimeId: string;
|
|
94
|
+
frame: number;
|
|
95
|
+
delta: number;
|
|
96
|
+
mode: string;
|
|
97
|
+
pendingUpdate: boolean;
|
|
98
|
+
rendererPendingUpdate: boolean;
|
|
99
|
+
target: [number, number, number, number];
|
|
100
|
+
};
|
|
101
|
+
type RuntimePaintEvent = {
|
|
102
|
+
type: 'paint';
|
|
103
|
+
at: number;
|
|
104
|
+
runtimeId: string;
|
|
105
|
+
frame: number;
|
|
106
|
+
layerIndex: number;
|
|
107
|
+
tileIndex: number;
|
|
111
108
|
x: number;
|
|
112
109
|
y: number;
|
|
113
|
-
scale: number;
|
|
114
|
-
time: WorldTime[];
|
|
115
|
-
points: Strand;
|
|
116
|
-
worldPoints: Strand;
|
|
117
|
-
atScale(factor: number): void;
|
|
118
|
-
translate(x: number, y: number): void;
|
|
119
|
-
getScheduledUpdates(target: Strand, scaleFactor: number): Array<() => Promise<void>>;
|
|
120
|
-
}
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region src/world-objects/image.d.ts
|
|
123
|
-
declare function fromImage(image: {
|
|
124
|
-
src: string;
|
|
125
|
-
height: number;
|
|
126
110
|
width: number;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
111
|
+
height: number;
|
|
112
|
+
paintId: string;
|
|
113
|
+
paintType: string;
|
|
114
|
+
ownerId?: string;
|
|
115
|
+
compositeId?: string;
|
|
116
|
+
imageUrl?: string;
|
|
117
|
+
};
|
|
118
|
+
type RuntimeFrameEndEvent = {
|
|
119
|
+
type: 'frame-end';
|
|
120
|
+
at: number;
|
|
121
|
+
runtimeId: string;
|
|
122
|
+
frame: number;
|
|
123
|
+
delta: number;
|
|
124
|
+
scaleFactor: number;
|
|
125
|
+
paintCount: number;
|
|
126
|
+
ready: boolean;
|
|
127
|
+
pendingUpdate: boolean;
|
|
128
|
+
worldWidth: number;
|
|
129
|
+
worldHeight: number;
|
|
130
|
+
target: [number, number, number, number];
|
|
131
|
+
};
|
|
132
|
+
type WorldDebugEvent = WorldTriggerDebugEvent | WorldPointerDebugEvent | WorldTouchDebugEvent;
|
|
133
|
+
type WorldTriggerDebugEvent = {
|
|
134
|
+
type: 'trigger';
|
|
135
|
+
at: number;
|
|
136
|
+
event: string;
|
|
137
|
+
data?: unknown;
|
|
138
|
+
};
|
|
139
|
+
type WorldPointerDebugEvent = {
|
|
140
|
+
type: 'pointer';
|
|
141
|
+
at: number;
|
|
142
|
+
event: string;
|
|
143
|
+
x: number;
|
|
144
|
+
y: number;
|
|
145
|
+
targets: number;
|
|
146
|
+
};
|
|
147
|
+
type WorldTouchDebugEvent = {
|
|
148
|
+
type: 'touch';
|
|
149
|
+
at: number;
|
|
150
|
+
event: string;
|
|
151
|
+
touches: number;
|
|
152
|
+
};
|
|
153
|
+
type DevToolsTab = 'Overview' | 'World' | 'Inspector' | 'Events' | 'Images' | 'Actions';
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region src/modules/shared/ready-events.d.ts
|
|
156
|
+
type AtlasReadyResetReason = 'initial' | 'manual' | 'ready-reset-key-change' | 'runtime-reset';
|
|
157
|
+
type AtlasReadyRenderer = 'canvas' | 'webgl' | 'static' | 'composite' | 'unknown';
|
|
158
|
+
type AtlasReadyEvent = {
|
|
159
|
+
runtimeId: string;
|
|
160
|
+
cycle: number;
|
|
161
|
+
reason: AtlasReadyResetReason;
|
|
162
|
+
renderer: AtlasReadyRenderer;
|
|
163
|
+
timestamp: number;
|
|
164
|
+
};
|
|
132
165
|
//#endregion
|
|
133
|
-
//#region src/
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
166
|
+
//#region src/utility/easing-functions.d.ts
|
|
167
|
+
type EasingFunction = (progress: number) => number;
|
|
168
|
+
declare const bounceOut: EasingFunction;
|
|
169
|
+
type EasingFunctionNames = 'linear' | 'easeInQuad' | 'easeOutQuad' | 'easeInOutQuad' | 'easeInCubic' | 'easeOutCubic' | 'easeInOutCubic' | 'easeInQuart' | 'easeOutQuart' | 'easeInOutQuart' | 'easeInQuint' | 'easeOutQuint' | 'easeInOutQuint' | 'easeInSine' | 'easeOutSine' | 'easeInOutSine' | 'easeInExpo' | 'easeOutExpo' | 'easeInOutExpo' | 'easeInCirc' | 'easeOutCirc' | 'easeInOutCirc' | 'easeInBack' | 'easeOutBack' | 'easeInOutBack' | 'easeInElastic' | 'easeOutElastic' | 'easeInOutElastic' | 'easeInBounce' | 'easeOutBounce' | 'easeInOutBounce';
|
|
170
|
+
declare const easingFunctions: { [key in EasingFunctionNames]: EasingFunction };
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/modules/transition-manager/transition-manager.d.ts
|
|
173
|
+
type PendingTransition = {
|
|
174
|
+
from: Strand;
|
|
175
|
+
to: Strand;
|
|
176
|
+
elapsed_time: number;
|
|
177
|
+
total_time: number;
|
|
178
|
+
timingFunction: EasingFunction;
|
|
179
|
+
done: boolean;
|
|
180
|
+
constrain: boolean;
|
|
181
|
+
callback?: () => void;
|
|
144
182
|
};
|
|
145
|
-
declare class
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
183
|
+
declare class TransitionManager {
|
|
184
|
+
runtime: Runtime;
|
|
185
|
+
readonly pendingTransition: PendingTransition;
|
|
186
|
+
constructor(runtime: Runtime);
|
|
187
|
+
hasPending(): boolean;
|
|
188
|
+
getPendingTransition(): PendingTransition;
|
|
189
|
+
getPendingFrom(): Strand;
|
|
190
|
+
customTransition(func: (transition: PendingTransition) => void): void;
|
|
191
|
+
stopTransition(): void;
|
|
192
|
+
runTransition(target: Strand, delta: number): void;
|
|
193
|
+
lastZoomTo: {
|
|
194
|
+
factor: number;
|
|
195
|
+
options: any;
|
|
196
|
+
} | null;
|
|
197
|
+
resumeTransition(): void;
|
|
198
|
+
zoomTo(factor: number, options?: {
|
|
199
|
+
origin?: Position;
|
|
200
|
+
stream?: boolean;
|
|
201
|
+
minZoomFactor?: number;
|
|
202
|
+
transition?: {
|
|
203
|
+
duration?: number;
|
|
204
|
+
easing?: EasingFunction;
|
|
205
|
+
};
|
|
206
|
+
}): void;
|
|
207
|
+
isConstraining: boolean;
|
|
208
|
+
constrainBounds({
|
|
209
|
+
transition,
|
|
210
|
+
panPadding
|
|
211
|
+
}?: {
|
|
212
|
+
panPadding?: number;
|
|
213
|
+
transition?: {
|
|
214
|
+
duration?: number;
|
|
215
|
+
easing?: EasingFunction;
|
|
216
|
+
};
|
|
217
|
+
}): void;
|
|
218
|
+
constrainTarget(target: Strand, {
|
|
219
|
+
origin,
|
|
220
|
+
transition,
|
|
221
|
+
panPadding
|
|
222
|
+
}?: {
|
|
223
|
+
origin?: Position;
|
|
224
|
+
panPadding?: number;
|
|
225
|
+
transition?: {
|
|
226
|
+
duration?: number;
|
|
227
|
+
easing?: EasingFunction;
|
|
228
|
+
};
|
|
229
|
+
}): void;
|
|
230
|
+
applyTransition(target: Strand, transition?: {
|
|
231
|
+
duration?: number;
|
|
232
|
+
easing?: EasingFunction;
|
|
233
|
+
constrain?: boolean;
|
|
234
|
+
}, defaults?: {
|
|
235
|
+
duration: number;
|
|
236
|
+
easing: EasingFunction;
|
|
237
|
+
constrain?: boolean;
|
|
238
|
+
callback?: () => void;
|
|
239
|
+
}, {
|
|
240
|
+
stream
|
|
241
|
+
}?: {
|
|
242
|
+
stream?: boolean;
|
|
243
|
+
}): void;
|
|
244
|
+
lastGoToRegion: null | {
|
|
245
|
+
target: any;
|
|
246
|
+
options: any;
|
|
247
|
+
};
|
|
248
|
+
goToRegion(target: {
|
|
249
|
+
x: number;
|
|
250
|
+
y: number;
|
|
251
|
+
width: number;
|
|
252
|
+
height: number;
|
|
253
|
+
padding?: number;
|
|
254
|
+
}, {
|
|
255
|
+
transition
|
|
256
|
+
}?: {
|
|
257
|
+
transition?: {
|
|
258
|
+
duration?: number;
|
|
259
|
+
easing?: EasingFunction;
|
|
260
|
+
};
|
|
261
|
+
}): void;
|
|
153
262
|
}
|
|
154
263
|
//#endregion
|
|
155
264
|
//#region src/spacial-content/abstract-content.d.ts
|
|
@@ -171,8 +280,16 @@ type RenderOptions = {
|
|
|
171
280
|
minSize: number;
|
|
172
281
|
maxImageSize: number;
|
|
173
282
|
quality: number;
|
|
283
|
+
useDevicePixelRatio: boolean;
|
|
284
|
+
layerPolicy: 'fallback-only' | 'always-blend' | 'active-only';
|
|
285
|
+
loadingBias: 'balanced' | 'speed' | 'data';
|
|
286
|
+
prefetchRadius?: number;
|
|
287
|
+
fadeInMs: number;
|
|
288
|
+
fadeFallbackTiles: boolean;
|
|
289
|
+
fadeOnLayerChange: boolean;
|
|
290
|
+
clipToBounds: boolean;
|
|
174
291
|
};
|
|
175
|
-
type CompositeResourceProps = RenderOptions
|
|
292
|
+
type CompositeResourceProps = Partial<RenderOptions>;
|
|
176
293
|
declare class CompositeResource extends AbstractContent implements SpacialContent, AtlasObjectModel<CompositeResourceProps, SpacialContent> {
|
|
177
294
|
readonly id: string;
|
|
178
295
|
readonly display: DisplayData;
|
|
@@ -183,7 +300,10 @@ declare class CompositeResource extends AbstractContent implements SpacialConten
|
|
|
183
300
|
aggregateBuffer: Strand;
|
|
184
301
|
lazyLoader?: () => Promise<SpacialContent[]>;
|
|
185
302
|
isFullyLoaded: boolean;
|
|
303
|
+
isLoadingFullResource: boolean;
|
|
186
304
|
maxScaleFactor: number;
|
|
305
|
+
private layerSelection;
|
|
306
|
+
private layerSelectionFrame;
|
|
187
307
|
renderOptions: RenderOptions;
|
|
188
308
|
constructor(data: {
|
|
189
309
|
id: string;
|
|
@@ -191,7 +311,7 @@ declare class CompositeResource extends AbstractContent implements SpacialConten
|
|
|
191
311
|
height: number;
|
|
192
312
|
images: SpacialContent[];
|
|
193
313
|
loadFullImages?: () => Promise<SpacialContent[]>;
|
|
194
|
-
renderOptions?:
|
|
314
|
+
renderOptions?: CompositeResourceProps;
|
|
195
315
|
});
|
|
196
316
|
applyProps(props: CompositeResourceProps): void;
|
|
197
317
|
appendChild(item: SpacialContent): void;
|
|
@@ -199,6 +319,7 @@ declare class CompositeResource extends AbstractContent implements SpacialConten
|
|
|
199
319
|
insertBefore(item: SpacialContent, before: SpacialContent): void;
|
|
200
320
|
hideInstance(): void;
|
|
201
321
|
addImages(images: SpacialContent[]): void;
|
|
322
|
+
private getImageDedupeKey;
|
|
202
323
|
sortByScales(): void;
|
|
203
324
|
_scheduleSortByScales: boolean;
|
|
204
325
|
_sortByScales: () => void;
|
|
@@ -206,56 +327,339 @@ declare class CompositeResource extends AbstractContent implements SpacialConten
|
|
|
206
327
|
fallback: (() => Promise<void>)[];
|
|
207
328
|
getScheduledUpdates(target: Strand, scaleFactor: number): Array<() => Promise<void>>;
|
|
208
329
|
getAllPointsAt(target: Strand, aggregate?: Strand, scale?: number): Paint[];
|
|
330
|
+
isImageActive(image: SpacialContent): boolean;
|
|
331
|
+
getImageActivatedAt(image: SpacialContent): number | undefined;
|
|
332
|
+
private getNow;
|
|
209
333
|
}
|
|
210
334
|
//#endregion
|
|
211
|
-
//#region src/
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
335
|
+
//#region src/spacial-content/image-texture.d.ts
|
|
336
|
+
type UpdateTextureFunction = () => {
|
|
337
|
+
source: TexImageSource | undefined;
|
|
338
|
+
hash: any;
|
|
339
|
+
};
|
|
340
|
+
type ImageTextureProps = {
|
|
341
|
+
id: string;
|
|
342
|
+
display?: {
|
|
343
|
+
width: number;
|
|
344
|
+
height: number;
|
|
220
345
|
};
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
346
|
+
target: {
|
|
347
|
+
width: number;
|
|
348
|
+
height: number;
|
|
349
|
+
};
|
|
350
|
+
scale?: number;
|
|
351
|
+
getTexture: UpdateTextureFunction;
|
|
352
|
+
};
|
|
353
|
+
declare class ImageTexture extends BaseObject implements SpacialContent {
|
|
354
|
+
readonly type = "spacial-content";
|
|
355
|
+
id: string;
|
|
356
|
+
uri: string;
|
|
357
|
+
display: DisplayData;
|
|
358
|
+
points: Strand;
|
|
359
|
+
getTexture: UpdateTextureFunction;
|
|
360
|
+
constructor(data?: {
|
|
361
|
+
id?: string;
|
|
362
|
+
uri: string;
|
|
363
|
+
width: number;
|
|
364
|
+
height: number;
|
|
365
|
+
scale?: number;
|
|
366
|
+
});
|
|
367
|
+
applyProps(props: ImageTextureProps): void;
|
|
368
|
+
getAllPointsAt(target: Strand, aggregate?: Strand, scale?: number): Paint[];
|
|
369
|
+
}
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region src/modules/maps/types.d.ts
|
|
372
|
+
type MapBounds = {
|
|
373
|
+
west: number;
|
|
374
|
+
south: number;
|
|
375
|
+
east: number;
|
|
376
|
+
north: number;
|
|
377
|
+
};
|
|
378
|
+
type LngLatPoint = {
|
|
379
|
+
lng: number;
|
|
380
|
+
lat: number;
|
|
381
|
+
};
|
|
382
|
+
type WorldPoint = {
|
|
383
|
+
x: number;
|
|
384
|
+
y: number;
|
|
385
|
+
};
|
|
386
|
+
type WorldRect = {
|
|
387
|
+
x: number;
|
|
388
|
+
y: number;
|
|
389
|
+
width: number;
|
|
390
|
+
height: number;
|
|
391
|
+
};
|
|
392
|
+
type MapProjection = {
|
|
393
|
+
lngLatToWorld: (lng: number, lat: number) => WorldPoint;
|
|
394
|
+
worldToLngLat: (x: number, y: number) => LngLatPoint;
|
|
395
|
+
lngLatBoundsToWorldRect: (bounds: MapBounds) => WorldRect;
|
|
396
|
+
worldRectToLngLatBounds: (rect: WorldRect) => MapBounds;
|
|
397
|
+
projectRing: (ring: Array<[number, number]>) => Array<[number, number]>;
|
|
398
|
+
};
|
|
399
|
+
type MapTileUrlContext = {
|
|
400
|
+
z: number;
|
|
401
|
+
x: number;
|
|
402
|
+
y: number;
|
|
403
|
+
s?: string;
|
|
404
|
+
subdomains?: string[];
|
|
405
|
+
tileSize?: number;
|
|
406
|
+
};
|
|
407
|
+
type MapTileSource = string | ((ctx: MapTileUrlContext) => string);
|
|
408
|
+
type GeoJSONPoint = {
|
|
409
|
+
type: 'Point';
|
|
410
|
+
coordinates: [number, number];
|
|
411
|
+
};
|
|
412
|
+
type GeoJSONMultiPoint = {
|
|
413
|
+
type: 'MultiPoint';
|
|
414
|
+
coordinates: Array<[number, number]>;
|
|
415
|
+
};
|
|
416
|
+
type GeoJSONLineString = {
|
|
417
|
+
type: 'LineString';
|
|
418
|
+
coordinates: Array<[number, number]>;
|
|
419
|
+
};
|
|
420
|
+
type GeoJSONMultiLineString = {
|
|
421
|
+
type: 'MultiLineString';
|
|
422
|
+
coordinates: Array<Array<[number, number]>>;
|
|
423
|
+
};
|
|
424
|
+
type GeoJSONPolygon = {
|
|
425
|
+
type: 'Polygon';
|
|
426
|
+
coordinates: Array<Array<[number, number]>>;
|
|
427
|
+
};
|
|
428
|
+
type GeoJSONMultiPolygon = {
|
|
429
|
+
type: 'MultiPolygon';
|
|
430
|
+
coordinates: Array<Array<Array<[number, number]>>>;
|
|
431
|
+
};
|
|
432
|
+
type MapGeoJSONGeometry = GeoJSONPoint | GeoJSONMultiPoint | GeoJSONLineString | GeoJSONMultiLineString | GeoJSONPolygon | GeoJSONMultiPolygon;
|
|
433
|
+
type MapGeoJSONFeature<TGeometry extends MapGeoJSONGeometry | null = MapGeoJSONGeometry, TProperties = Record<string, unknown> | null> = {
|
|
434
|
+
type: 'Feature';
|
|
435
|
+
id?: string | number;
|
|
436
|
+
geometry: TGeometry;
|
|
437
|
+
properties?: TProperties;
|
|
438
|
+
};
|
|
439
|
+
type MapGeoJSONFeatureCollection<TGeometry extends MapGeoJSONGeometry | null = MapGeoJSONGeometry, TProperties = Record<string, unknown> | null> = {
|
|
440
|
+
type: 'FeatureCollection';
|
|
441
|
+
features: Array<MapGeoJSONFeature<TGeometry, TProperties>>;
|
|
442
|
+
};
|
|
443
|
+
type MapGeoJSONInput = MapGeoJSONGeometry | MapGeoJSONFeature | MapGeoJSONFeatureCollection;
|
|
444
|
+
//#endregion
|
|
445
|
+
//#region src/spacial-content/tiled-image.d.ts
|
|
446
|
+
declare class TiledImage extends BaseObject implements SpacialContent {
|
|
447
|
+
readonly id: string;
|
|
448
|
+
readonly type = "spacial-content";
|
|
449
|
+
readonly display: DisplayData;
|
|
450
|
+
tileWidth: number;
|
|
451
|
+
tileHeight: number;
|
|
452
|
+
columns: number;
|
|
453
|
+
rows: number;
|
|
454
|
+
style: {
|
|
455
|
+
opacity: number;
|
|
456
|
+
};
|
|
457
|
+
points: Strand;
|
|
458
|
+
service?: ImageService$1;
|
|
459
|
+
format: string;
|
|
460
|
+
crop2?: Strand;
|
|
461
|
+
version3?: boolean;
|
|
462
|
+
tileUrl: string;
|
|
463
|
+
constructor(data: {
|
|
464
|
+
url: string;
|
|
465
|
+
scaleFactor: number;
|
|
466
|
+
points: Strand;
|
|
467
|
+
displayPoints?: Strand;
|
|
468
|
+
tileWidth: number;
|
|
469
|
+
tileHeight: number;
|
|
470
|
+
width: number;
|
|
471
|
+
height: number;
|
|
472
|
+
columns: number;
|
|
473
|
+
rows: number;
|
|
474
|
+
format?: string;
|
|
475
|
+
id?: string;
|
|
476
|
+
version3?: boolean;
|
|
477
|
+
});
|
|
478
|
+
applyProps(props: any): void;
|
|
479
|
+
static fromTile(url: string, canvas: {
|
|
480
|
+
width: number;
|
|
481
|
+
height: number;
|
|
482
|
+
}, tile: {
|
|
483
|
+
width: number;
|
|
484
|
+
height?: number;
|
|
485
|
+
}, scaleFactor: number, service?: ImageService$1, format?: string, useFloorCalc?: boolean, version3?: boolean): TiledImage;
|
|
486
|
+
getImageUrl(index: number): string;
|
|
487
|
+
getAllPointsAt(target: Strand, aggregate?: Strand, scaleFactor?: number): Paint[];
|
|
488
|
+
transform(op: Strand): void;
|
|
489
|
+
getScheduledUpdates(target: Strand, scaleFactor: number): Array<() => Promise<void>>;
|
|
490
|
+
}
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region src/spacial-content/map-tiled-image.d.ts
|
|
493
|
+
type MapTileCoordinate = {
|
|
494
|
+
x: number;
|
|
495
|
+
y: number;
|
|
496
|
+
z: number;
|
|
497
|
+
};
|
|
498
|
+
type MapTileGrid = {
|
|
499
|
+
points: Strand;
|
|
500
|
+
tiles: MapTileCoordinate[];
|
|
501
|
+
columns: number;
|
|
502
|
+
rows: number;
|
|
503
|
+
count: number;
|
|
504
|
+
minTileX: number;
|
|
505
|
+
maxTileX: number;
|
|
506
|
+
minTileY: number;
|
|
507
|
+
maxTileY: number;
|
|
508
|
+
};
|
|
509
|
+
type MapTileGridCoverage = Omit<MapTileGrid, 'points' | 'tiles'> & {
|
|
510
|
+
westTile: number;
|
|
511
|
+
eastTile: number;
|
|
512
|
+
northTile: number;
|
|
513
|
+
southTile: number;
|
|
514
|
+
tileSpanX: number;
|
|
515
|
+
tileSpanY: number;
|
|
516
|
+
};
|
|
517
|
+
type MapTiledImageProps = {
|
|
518
|
+
id?: string;
|
|
519
|
+
bounds: MapBounds;
|
|
520
|
+
worldWidth: number;
|
|
521
|
+
worldHeight: number;
|
|
522
|
+
zoom: number;
|
|
523
|
+
tileSize?: number;
|
|
524
|
+
scaleFactor?: number;
|
|
525
|
+
tileSource?: MapTileSource;
|
|
526
|
+
tileUrlTemplate?: string;
|
|
527
|
+
subdomains?: string[];
|
|
528
|
+
};
|
|
529
|
+
declare function estimateFiniteTileGridCoverage(config: {
|
|
530
|
+
bounds: MapBounds;
|
|
531
|
+
zoom: number;
|
|
532
|
+
}): MapTileGridCoverage;
|
|
533
|
+
declare function createFiniteTileGrid(config: {
|
|
534
|
+
bounds: MapBounds;
|
|
535
|
+
zoom: number;
|
|
536
|
+
worldWidth: number;
|
|
537
|
+
worldHeight: number;
|
|
538
|
+
maxTiles?: number;
|
|
539
|
+
}): MapTileGrid;
|
|
540
|
+
declare class MapTiledImage extends TiledImage {
|
|
541
|
+
readonly zoom: number;
|
|
542
|
+
readonly bounds: MapBounds;
|
|
543
|
+
readonly worldWidth: number;
|
|
544
|
+
readonly worldHeight: number;
|
|
545
|
+
readonly tileSize: number;
|
|
546
|
+
readonly tileSource: MapTileSource;
|
|
547
|
+
readonly subdomains: string[];
|
|
548
|
+
readonly tileCoordinates: MapTileCoordinate[];
|
|
549
|
+
readonly minTileX: number;
|
|
550
|
+
readonly maxTileX: number;
|
|
551
|
+
readonly minTileY: number;
|
|
552
|
+
readonly maxTileY: number;
|
|
553
|
+
constructor(props: MapTiledImageProps);
|
|
554
|
+
getImageUrl(index: number): string;
|
|
555
|
+
}
|
|
556
|
+
//#endregion
|
|
557
|
+
//#region src/spacial-content/single-image.d.ts
|
|
558
|
+
type SingleImageProps = {
|
|
559
|
+
uri: string;
|
|
560
|
+
id?: string;
|
|
561
|
+
display?: {
|
|
562
|
+
width: number;
|
|
563
|
+
height: number;
|
|
564
|
+
rotation?: number;
|
|
565
|
+
};
|
|
566
|
+
target: {
|
|
567
|
+
width: number;
|
|
568
|
+
height: number;
|
|
569
|
+
x?: number;
|
|
570
|
+
y?: number;
|
|
571
|
+
};
|
|
572
|
+
crop?: {
|
|
228
573
|
x: number;
|
|
229
574
|
y: number;
|
|
230
575
|
width: number;
|
|
231
576
|
height: number;
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
|
|
577
|
+
};
|
|
578
|
+
scale?: number;
|
|
579
|
+
priority?: boolean;
|
|
580
|
+
style?: any;
|
|
581
|
+
};
|
|
582
|
+
declare class SingleImage extends BaseObject implements SpacialContent {
|
|
583
|
+
readonly type = "spacial-content";
|
|
584
|
+
/**
|
|
585
|
+
* An identifier for this image. Will default to the image URI.
|
|
586
|
+
*/
|
|
587
|
+
id: string;
|
|
588
|
+
/**
|
|
589
|
+
* The URI of the image being painted.
|
|
590
|
+
*/
|
|
591
|
+
uri: string;
|
|
592
|
+
/**
|
|
593
|
+
* The real height and width of the image. For example a 1000x1000 painted at 100x100 would contain
|
|
594
|
+
* the display data for 1000x1000 and `this.points` would scale that down to 100x100. This is used to
|
|
595
|
+
* calculate the scale.
|
|
596
|
+
*/
|
|
597
|
+
display: DisplayData;
|
|
598
|
+
/**
|
|
599
|
+
* Points are relative to the world object.
|
|
600
|
+
* Does not change when viewport moves
|
|
601
|
+
* Does not change if world object position changes.
|
|
602
|
+
* */
|
|
603
|
+
points: Strand;
|
|
604
|
+
/**
|
|
605
|
+
* Displayed as priority
|
|
606
|
+
*/
|
|
607
|
+
priority?: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Some simple styling options
|
|
610
|
+
*/
|
|
611
|
+
style: {
|
|
612
|
+
opacity: number;
|
|
613
|
+
};
|
|
614
|
+
constructor(data?: {
|
|
615
|
+
id?: string;
|
|
616
|
+
uri: string;
|
|
617
|
+
width: number;
|
|
618
|
+
height: number;
|
|
619
|
+
scale?: number;
|
|
620
|
+
x?: number;
|
|
621
|
+
y?: number;
|
|
622
|
+
rotation?: number;
|
|
623
|
+
});
|
|
624
|
+
applyProps(props: SingleImageProps): void;
|
|
625
|
+
getAllPointsAt(target: Strand, aggregate?: Strand, scale?: number): Paint[];
|
|
626
|
+
static fromSvg(svg: string, target: SpacialSize, display?: SpacialSize, id?: string): SingleImage;
|
|
627
|
+
static fromImage(uri: string, target: SpacialSize, display?: SpacialSize, id?: string): SingleImage;
|
|
628
|
+
getImageUrl(): string;
|
|
629
|
+
}
|
|
630
|
+
//#endregion
|
|
631
|
+
//#region src/world-objects/paint.d.ts
|
|
632
|
+
type Paintable = SpacialContent;
|
|
633
|
+
type Paint = [Paintable, Strand, Strand | undefined];
|
|
634
|
+
//#endregion
|
|
635
|
+
//#region src/world-objects/abstract-object.d.ts
|
|
636
|
+
interface AbstractObject {
|
|
235
637
|
id: string;
|
|
236
|
-
|
|
237
|
-
|
|
638
|
+
height: number;
|
|
639
|
+
width: number;
|
|
640
|
+
layers: Paintable[];
|
|
641
|
+
}
|
|
642
|
+
//#endregion
|
|
643
|
+
//#region src/world-objects/render-pipeline.d.ts
|
|
644
|
+
interface RenderPipeline {
|
|
238
645
|
getAllPointsAt(target: Strand, aggregate: Strand, scale: number): Paint[];
|
|
239
|
-
getScheduledUpdates(target: Strand, scaleFactor: number): Array<() => void | Promise<void>>;
|
|
240
|
-
protected constructor();
|
|
241
|
-
addEventListener: <Name$1 extends SupportedEventNames>(name: Name$1, cb: (e: any) => void, options?: {
|
|
242
|
-
capture: boolean;
|
|
243
|
-
passive: boolean;
|
|
244
|
-
}) => void;
|
|
245
|
-
removeEventListener: <Name$1 extends SupportedEventNames>(name: Name$1, cb: (e: any) => void) => void;
|
|
246
|
-
dispatchEvent<Name$1 extends keyof SupportedEvents>(name: Name$1, e: any): boolean;
|
|
247
|
-
get x(): number;
|
|
248
|
-
get y(): number;
|
|
249
|
-
get width(): number;
|
|
250
|
-
get height(): number;
|
|
251
|
-
translate(x: number, y: number): void;
|
|
252
|
-
atScale(factor: number): void;
|
|
253
646
|
transform(op: Strand): void;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
647
|
+
}
|
|
648
|
+
//#endregion
|
|
649
|
+
//#region src/world-objects/abstract-world-object.d.ts
|
|
650
|
+
/**
|
|
651
|
+
* @deprecated
|
|
652
|
+
*/
|
|
653
|
+
interface AbstractWorldObject extends AbstractObject, RenderPipeline {
|
|
654
|
+
x: number;
|
|
655
|
+
y: number;
|
|
656
|
+
scale: number;
|
|
657
|
+
time: WorldTime[];
|
|
658
|
+
points: Strand;
|
|
659
|
+
worldPoints: Strand;
|
|
660
|
+
atScale(factor: number): void;
|
|
661
|
+
translate(x: number, y: number): void;
|
|
662
|
+
getScheduledUpdates(target: Strand, scaleFactor: number): Array<() => Promise<void>>;
|
|
259
663
|
}
|
|
260
664
|
//#endregion
|
|
261
665
|
//#region src/world-objects/world-object.d.ts
|
|
@@ -309,6 +713,91 @@ declare class WorldObject extends BaseObject<WorldObjectProps, Paintable> {
|
|
|
309
713
|
getScheduledUpdates(target: Strand, scaleFactor: number): Array<() => void | Promise<void>>;
|
|
310
714
|
}
|
|
311
715
|
//#endregion
|
|
716
|
+
//#region src/world-objects/image.d.ts
|
|
717
|
+
declare function fromImage(image: {
|
|
718
|
+
src: string;
|
|
719
|
+
height: number;
|
|
720
|
+
width: number;
|
|
721
|
+
target?: {
|
|
722
|
+
width: number;
|
|
723
|
+
height: number;
|
|
724
|
+
};
|
|
725
|
+
}): WorldObject;
|
|
726
|
+
//#endregion
|
|
727
|
+
//#region src/world-objects/zone.d.ts
|
|
728
|
+
interface ZoneInterface {
|
|
729
|
+
id: string;
|
|
730
|
+
config: ZoneResolvedConfig;
|
|
731
|
+
objects: WorldObject[];
|
|
732
|
+
points: Strand;
|
|
733
|
+
recalculateBounds(): void;
|
|
734
|
+
getPointsAt(target: Strand, aggregate: Strand, scaleFactor: number): Paint[];
|
|
735
|
+
}
|
|
736
|
+
type ZoneConfig = {
|
|
737
|
+
margin?: number;
|
|
738
|
+
x?: number;
|
|
739
|
+
y?: number;
|
|
740
|
+
width?: number;
|
|
741
|
+
height?: number;
|
|
742
|
+
};
|
|
743
|
+
type ZoneResolvedConfig = {
|
|
744
|
+
margin: number;
|
|
745
|
+
x?: number;
|
|
746
|
+
y?: number;
|
|
747
|
+
width?: number;
|
|
748
|
+
height?: number;
|
|
749
|
+
};
|
|
750
|
+
declare class Zone implements ZoneInterface {
|
|
751
|
+
id: string;
|
|
752
|
+
config: ZoneResolvedConfig;
|
|
753
|
+
points: Strand;
|
|
754
|
+
objects: WorldObject[];
|
|
755
|
+
constructor(objects: [WorldObject, ...WorldObject[]], config?: ZoneConfig);
|
|
756
|
+
constructor(config: ZoneConfig & {
|
|
757
|
+
id: string;
|
|
758
|
+
objects?: WorldObject[];
|
|
759
|
+
});
|
|
760
|
+
applyProps(config: ZoneConfig & {
|
|
761
|
+
id?: string;
|
|
762
|
+
}): void;
|
|
763
|
+
addObject(object: WorldObject): void;
|
|
764
|
+
removeObject(object: WorldObject): void;
|
|
765
|
+
recalculateBounds(): void;
|
|
766
|
+
getPointsAt(target: Strand, aggregate: Strand, scaleFactor: number): Paint[];
|
|
767
|
+
}
|
|
768
|
+
//#endregion
|
|
769
|
+
//#region src/spacial-content/spacial-content.d.ts
|
|
770
|
+
interface SpacialContent {
|
|
771
|
+
readonly id: string;
|
|
772
|
+
readonly type: 'spacial-content';
|
|
773
|
+
readonly display: DisplayData;
|
|
774
|
+
__id?: string;
|
|
775
|
+
__parent?: CompositeResource;
|
|
776
|
+
__owner: {
|
|
777
|
+
value: WorldObject | undefined;
|
|
778
|
+
};
|
|
779
|
+
__host?: any;
|
|
780
|
+
priority?: boolean;
|
|
781
|
+
points: Strand;
|
|
782
|
+
crop?: Strand;
|
|
783
|
+
cropData?: {
|
|
784
|
+
x: number;
|
|
785
|
+
y: number;
|
|
786
|
+
width: number;
|
|
787
|
+
height: number;
|
|
788
|
+
};
|
|
789
|
+
style?: {
|
|
790
|
+
opacity: number;
|
|
791
|
+
};
|
|
792
|
+
getScheduledUpdates(target: Strand, scaleFactor: number): Array<() => void | Promise<void>>;
|
|
793
|
+
getAllPointsAt(target: Strand, aggregate?: Strand, scale?: number): Paint[];
|
|
794
|
+
transform(op: Strand): void;
|
|
795
|
+
loadFullResource?(): Promise<void>;
|
|
796
|
+
dispatchEvent(event: string, e: any): void;
|
|
797
|
+
getImageUrl?: (index: number) => string;
|
|
798
|
+
getTexture?: UpdateTextureFunction;
|
|
799
|
+
}
|
|
800
|
+
//#endregion
|
|
312
801
|
//#region src/world.d.ts
|
|
313
802
|
type WorldTarget = {
|
|
314
803
|
x: number;
|
|
@@ -339,6 +828,13 @@ declare class World extends BaseObject<WorldProps, WorldObject> {
|
|
|
339
828
|
needsRecalculate: boolean;
|
|
340
829
|
emptyPaintables: never[];
|
|
341
830
|
renderOrder: number[];
|
|
831
|
+
debugSubscribers: Set<(event: WorldDebugEvent) => void>;
|
|
832
|
+
zoneVisibilityFadeDurationMs: number;
|
|
833
|
+
zoneOutsideOpacity: number;
|
|
834
|
+
zoneVisibilityFade?: {
|
|
835
|
+
zoneId: string;
|
|
836
|
+
startedAt: number;
|
|
837
|
+
};
|
|
342
838
|
get x(): number;
|
|
343
839
|
get y(): number;
|
|
344
840
|
get width(): number;
|
|
@@ -371,6 +867,9 @@ declare class World extends BaseObject<WorldProps, WorldObject> {
|
|
|
371
867
|
hideInstance(): void;
|
|
372
868
|
asWorldObject(): WorldObject | null;
|
|
373
869
|
addZone(zone: ZoneInterface): void;
|
|
870
|
+
removeZone(zone: ZoneInterface): void;
|
|
871
|
+
getZoneById(id: string): ZoneInterface | undefined;
|
|
872
|
+
hasZone(id: string): boolean;
|
|
374
873
|
selectZone(id: string | number): void;
|
|
375
874
|
deselectZone(): void;
|
|
376
875
|
getActiveZone(): ZoneInterface | undefined;
|
|
@@ -390,7 +889,9 @@ declare class World extends BaseObject<WorldProps, WorldObject> {
|
|
|
390
889
|
getPointsFromViewer(target: Viewer, aggregate?: Strand): Paint[];
|
|
391
890
|
addLayoutSubscriber(subscription: (type: string, data: unknown) => void): () => void;
|
|
392
891
|
getScheduledUpdates(target: Strand, scaleFactor: number): Array<() => void | Promise<void>>;
|
|
393
|
-
|
|
892
|
+
private isZoneOutsideVisibilityFading;
|
|
893
|
+
private getZoneOutsideVisibility;
|
|
894
|
+
getObjectsAt(target: Strand, all?: boolean, includeZoneFade?: boolean): Array<[WorldObject, Paintable[]]>;
|
|
394
895
|
getPointsAt(target: Strand, aggregate?: Strand, scaleFactor?: number): Paint[];
|
|
395
896
|
_alreadyFlushed: any;
|
|
396
897
|
flushSubscriptions(): void;
|
|
@@ -428,122 +929,41 @@ declare class World extends BaseObject<WorldProps, WorldObject> {
|
|
|
428
929
|
}): void;
|
|
429
930
|
zoomOut(point?: {
|
|
430
931
|
x: number;
|
|
431
|
-
y: number;
|
|
432
|
-
}): void;
|
|
433
|
-
constraintBounds(immediate?: boolean): void;
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
left: number;
|
|
460
|
-
} | undefined;
|
|
461
|
-
}
|
|
462
|
-
//#endregion
|
|
463
|
-
//#region src/utility/easing-functions.d.ts
|
|
464
|
-
type EasingFunction = (progress: number) => number;
|
|
465
|
-
declare const bounceOut: EasingFunction;
|
|
466
|
-
type EasingFunctionNames = 'linear' | 'easeInQuad' | 'easeOutQuad' | 'easeInOutQuad' | 'easeInCubic' | 'easeOutCubic' | 'easeInOutCubic' | 'easeInQuart' | 'easeOutQuart' | 'easeInOutQuart' | 'easeInQuint' | 'easeOutQuint' | 'easeInOutQuint' | 'easeInSine' | 'easeOutSine' | 'easeInOutSine' | 'easeInExpo' | 'easeOutExpo' | 'easeInOutExpo' | 'easeInCirc' | 'easeOutCirc' | 'easeInOutCirc' | 'easeInBack' | 'easeOutBack' | 'easeInOutBack' | 'easeInElastic' | 'easeOutElastic' | 'easeInOutElastic' | 'easeInBounce' | 'easeOutBounce' | 'easeInOutBounce';
|
|
467
|
-
declare const easingFunctions: { [key in EasingFunctionNames]: EasingFunction };
|
|
468
|
-
//#endregion
|
|
469
|
-
//#region src/modules/transition-manager/transition-manager.d.ts
|
|
470
|
-
type PendingTransition = {
|
|
471
|
-
from: Strand;
|
|
472
|
-
to: Strand;
|
|
473
|
-
elapsed_time: number;
|
|
474
|
-
total_time: number;
|
|
475
|
-
timingFunction: EasingFunction;
|
|
476
|
-
done: boolean;
|
|
477
|
-
constrain: boolean;
|
|
478
|
-
callback?: () => void;
|
|
479
|
-
};
|
|
480
|
-
declare class TransitionManager {
|
|
481
|
-
runtime: Runtime;
|
|
482
|
-
readonly pendingTransition: PendingTransition;
|
|
483
|
-
constructor(runtime: Runtime);
|
|
484
|
-
hasPending(): boolean;
|
|
485
|
-
getPendingTransition(): PendingTransition;
|
|
486
|
-
getPendingFrom(): Strand;
|
|
487
|
-
customTransition(func: (transition: PendingTransition) => void): void;
|
|
488
|
-
stopTransition(): void;
|
|
489
|
-
runTransition(target: Strand, delta: number): void;
|
|
490
|
-
lastZoomTo: {
|
|
491
|
-
factor: number;
|
|
492
|
-
options: any;
|
|
493
|
-
} | null;
|
|
494
|
-
resumeTransition(): void;
|
|
495
|
-
zoomTo(factor: number, options?: {
|
|
496
|
-
origin?: Position;
|
|
497
|
-
stream?: boolean;
|
|
498
|
-
minZoomFactor?: number;
|
|
499
|
-
transition?: {
|
|
500
|
-
duration?: number;
|
|
501
|
-
easing?: EasingFunction;
|
|
502
|
-
};
|
|
503
|
-
}): void;
|
|
504
|
-
isConstraining: boolean;
|
|
505
|
-
constrainBounds({
|
|
506
|
-
transition,
|
|
507
|
-
panPadding
|
|
508
|
-
}?: {
|
|
509
|
-
panPadding?: number;
|
|
510
|
-
transition?: {
|
|
511
|
-
duration?: number;
|
|
512
|
-
easing?: EasingFunction;
|
|
513
|
-
};
|
|
514
|
-
}): void;
|
|
515
|
-
applyTransition(target: Strand, transition?: {
|
|
516
|
-
duration?: number;
|
|
517
|
-
easing?: EasingFunction;
|
|
518
|
-
constrain?: boolean;
|
|
519
|
-
}, defaults?: {
|
|
520
|
-
duration: number;
|
|
521
|
-
easing: EasingFunction;
|
|
522
|
-
constrain?: boolean;
|
|
523
|
-
callback?: () => void;
|
|
524
|
-
}, {
|
|
525
|
-
stream
|
|
526
|
-
}?: {
|
|
527
|
-
stream?: boolean;
|
|
528
|
-
}): void;
|
|
529
|
-
lastGoToRegion: null | {
|
|
530
|
-
target: any;
|
|
531
|
-
options: any;
|
|
532
|
-
};
|
|
533
|
-
goToRegion(target: {
|
|
932
|
+
y: number;
|
|
933
|
+
}): void;
|
|
934
|
+
constraintBounds(immediate?: boolean): void;
|
|
935
|
+
hasPendingAnimation(): boolean;
|
|
936
|
+
addDebugSubscriber(callback: (event: WorldDebugEvent) => void): () => void;
|
|
937
|
+
removeDebugSubscriber(callback: (event: WorldDebugEvent) => void): void;
|
|
938
|
+
private emitDebug;
|
|
939
|
+
}
|
|
940
|
+
//#endregion
|
|
941
|
+
//#region src/renderer/renderer.d.ts
|
|
942
|
+
interface Renderer {
|
|
943
|
+
beforeFrame(world: World, delta: number, target: Strand, options: HookOptions): void;
|
|
944
|
+
paint(paint: SpacialContent, index: number, x: number, y: number, width: number, height: number): void;
|
|
945
|
+
afterFrame(world: World, delta: number, target: Strand, options: HookOptions): void;
|
|
946
|
+
getScale(width: number, height: number, dpi?: boolean): number;
|
|
947
|
+
prepareLayer(paint: SpacialContent, point: Strand): void;
|
|
948
|
+
finishLayer(paint: SpacialContent, point: Strand): void;
|
|
949
|
+
afterPaintLayer(paint: SpacialContent, transform?: Strand): void;
|
|
950
|
+
pendingUpdate(): boolean;
|
|
951
|
+
getPointsAt(world: World, target: Strand, aggregate: Strand, scaleFactor: number): Paint[];
|
|
952
|
+
getViewportBounds(world: World, target: Strand, padding: number): PositionPair | null;
|
|
953
|
+
isReady(): boolean;
|
|
954
|
+
resize(): void;
|
|
955
|
+
resize(width?: number, height?: number): void;
|
|
956
|
+
triggerResize?: () => void;
|
|
957
|
+
resetReadyState?: () => void;
|
|
958
|
+
reset(): void;
|
|
959
|
+
getRendererScreenPosition(): {
|
|
534
960
|
x: number;
|
|
535
961
|
y: number;
|
|
536
962
|
width: number;
|
|
537
963
|
height: number;
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
}?: {
|
|
542
|
-
transition?: {
|
|
543
|
-
duration?: number;
|
|
544
|
-
easing?: EasingFunction;
|
|
545
|
-
};
|
|
546
|
-
}): void;
|
|
964
|
+
top: number;
|
|
965
|
+
left: number;
|
|
966
|
+
} | undefined;
|
|
547
967
|
}
|
|
548
968
|
//#endregion
|
|
549
969
|
//#region src/renderer/runtime.d.ts
|
|
@@ -575,9 +995,18 @@ type RuntimeOptions = {
|
|
|
575
995
|
maxOverZoom: number;
|
|
576
996
|
maxUnderZoom: number;
|
|
577
997
|
};
|
|
998
|
+
type RuntimeZoneState = {
|
|
999
|
+
zoneId: string;
|
|
1000
|
+
exists: boolean;
|
|
1001
|
+
active: boolean;
|
|
1002
|
+
visibleInViewport: boolean;
|
|
1003
|
+
};
|
|
578
1004
|
declare class Runtime {
|
|
579
1005
|
id: string;
|
|
580
1006
|
ready: boolean;
|
|
1007
|
+
readyCycle: number;
|
|
1008
|
+
readyReason: AtlasReadyResetReason;
|
|
1009
|
+
readyTimestamp: number | undefined;
|
|
581
1010
|
get x(): number;
|
|
582
1011
|
set x(x: number);
|
|
583
1012
|
get y(): number;
|
|
@@ -624,27 +1053,20 @@ declare class Runtime {
|
|
|
624
1053
|
y: number;
|
|
625
1054
|
};
|
|
626
1055
|
_lastGoodScale: number;
|
|
627
|
-
|
|
628
|
-
|
|
1056
|
+
debugFrame: number;
|
|
1057
|
+
debugSubscribers: Set<(event: RuntimeDebugEvent) => void>;
|
|
629
1058
|
hooks: RuntimeHooks;
|
|
630
1059
|
fpsLimit: number | undefined;
|
|
631
1060
|
options: RuntimeOptions;
|
|
632
1061
|
hookOptions: HookOptions;
|
|
633
1062
|
constructor(renderer: Renderer, world: World, target: Viewer, controllers?: RuntimeController[], options?: Partial<RuntimeOptions>);
|
|
634
1063
|
setHomePosition(position?: Projection): void;
|
|
635
|
-
/**
|
|
636
|
-
* Set the default home padding in CSS pixels. When `goHome()` is invoked without a paddingPx
|
|
637
|
-
* this value will be used and converted to world units internally.
|
|
638
|
-
*/
|
|
639
1064
|
setHomePaddingPx(px?: number | {
|
|
640
1065
|
left?: number;
|
|
641
1066
|
right?: number;
|
|
642
1067
|
top?: number;
|
|
643
1068
|
bottom?: number;
|
|
644
1069
|
}): void;
|
|
645
|
-
/**
|
|
646
|
-
* Get the current default home padding in CSS pixels (as set via `setHomePaddingPx`).
|
|
647
|
-
*/
|
|
648
1070
|
getHomePaddingPx(): number | {
|
|
649
1071
|
left?: number;
|
|
650
1072
|
right?: number;
|
|
@@ -667,6 +1089,14 @@ declare class Runtime {
|
|
|
667
1089
|
} | undefined;
|
|
668
1090
|
updateRendererScreenPosition(): void;
|
|
669
1091
|
setOptions(options: Partial<RuntimeOptions>): void;
|
|
1092
|
+
/**
|
|
1093
|
+
* Normalize padding input to a consistent per-side format.
|
|
1094
|
+
*/
|
|
1095
|
+
private normalizePadding;
|
|
1096
|
+
/**
|
|
1097
|
+
* Calculate the viewport region that fits the target content within the available
|
|
1098
|
+
* canvas area (accounting for CSS pixel padding).
|
|
1099
|
+
*/
|
|
670
1100
|
getHomeTarget(options?: {
|
|
671
1101
|
cover?: boolean;
|
|
672
1102
|
position?: Strand;
|
|
@@ -682,16 +1112,16 @@ declare class Runtime {
|
|
|
682
1112
|
width: number;
|
|
683
1113
|
height: number;
|
|
684
1114
|
};
|
|
685
|
-
|
|
1115
|
+
isViewportAtHome(options?: {
|
|
686
1116
|
cover?: boolean;
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
}):
|
|
1117
|
+
tolerance?: number;
|
|
1118
|
+
target?: Projection;
|
|
1119
|
+
}): boolean;
|
|
1120
|
+
isViewportAtHomeZoomLevel(options?: {
|
|
1121
|
+
cover?: boolean;
|
|
1122
|
+
tolerance?: number;
|
|
1123
|
+
target?: Projection;
|
|
1124
|
+
}): boolean;
|
|
695
1125
|
goHome(options?: {
|
|
696
1126
|
cover?: boolean;
|
|
697
1127
|
position?: Strand;
|
|
@@ -746,17 +1176,10 @@ declare class Runtime {
|
|
|
746
1176
|
}) => void;
|
|
747
1177
|
constrainBounds(target: Strand, {
|
|
748
1178
|
panPadding,
|
|
749
|
-
ref
|
|
750
|
-
homePaddingPx
|
|
1179
|
+
ref
|
|
751
1180
|
}?: {
|
|
752
1181
|
ref?: boolean;
|
|
753
1182
|
panPadding?: number;
|
|
754
|
-
homePaddingPx?: number | {
|
|
755
|
-
left?: number;
|
|
756
|
-
right?: number;
|
|
757
|
-
top?: number;
|
|
758
|
-
bottom?: number;
|
|
759
|
-
};
|
|
760
1183
|
}): readonly [boolean, Strand];
|
|
761
1184
|
/**
|
|
762
1185
|
* Get bounds
|
|
@@ -768,12 +1191,6 @@ declare class Runtime {
|
|
|
768
1191
|
getBounds(options: {
|
|
769
1192
|
padding: number;
|
|
770
1193
|
target?: Strand;
|
|
771
|
-
homePaddingPx?: number | {
|
|
772
|
-
left?: number;
|
|
773
|
-
right?: number;
|
|
774
|
-
top?: number;
|
|
775
|
-
bottom?: number;
|
|
776
|
-
};
|
|
777
1194
|
}): {
|
|
778
1195
|
readonly minX: number;
|
|
779
1196
|
readonly maxX: number;
|
|
@@ -781,6 +1198,20 @@ declare class Runtime {
|
|
|
781
1198
|
readonly maxY: number;
|
|
782
1199
|
};
|
|
783
1200
|
getScaleFactor(dpi?: boolean): number;
|
|
1201
|
+
private copyStrandValues;
|
|
1202
|
+
private getZoomConstraintState;
|
|
1203
|
+
constrainTarget(target: Strand, {
|
|
1204
|
+
origin,
|
|
1205
|
+
panPadding,
|
|
1206
|
+
ref
|
|
1207
|
+
}?: {
|
|
1208
|
+
origin?: {
|
|
1209
|
+
x: number;
|
|
1210
|
+
y: number;
|
|
1211
|
+
};
|
|
1212
|
+
panPadding?: number;
|
|
1213
|
+
ref?: boolean;
|
|
1214
|
+
}): readonly [boolean, Strand];
|
|
784
1215
|
/**
|
|
785
1216
|
* Zoom
|
|
786
1217
|
*/
|
|
@@ -869,8 +1300,25 @@ declare class Runtime {
|
|
|
869
1300
|
*/
|
|
870
1301
|
stop(): () => void;
|
|
871
1302
|
reset(): void;
|
|
1303
|
+
resetReadyState(reason?: AtlasReadyResetReason): void;
|
|
1304
|
+
getReadyState(): {
|
|
1305
|
+
ready: boolean;
|
|
1306
|
+
cycle: number;
|
|
1307
|
+
reason: AtlasReadyResetReason;
|
|
1308
|
+
timestamp?: number;
|
|
1309
|
+
};
|
|
872
1310
|
selectZone(zone: number | string): void;
|
|
1311
|
+
goToZone(id: string, options?: {
|
|
1312
|
+
paddingPx?: number | {
|
|
1313
|
+
left?: number;
|
|
1314
|
+
right?: number;
|
|
1315
|
+
top?: number;
|
|
1316
|
+
bottom?: number;
|
|
1317
|
+
};
|
|
1318
|
+
immediate?: boolean;
|
|
1319
|
+
}): boolean;
|
|
873
1320
|
deselectZone(): void;
|
|
1321
|
+
getZoneRuntimeState(zoneId: string, viewport?: Projection): RuntimeZoneState;
|
|
874
1322
|
hook<Name$1 extends keyof RuntimeHooks, Arg = UnwrapHookArg<Name$1>>(name: keyof RuntimeHooks, arg: Arg): void;
|
|
875
1323
|
registerHook<Name$1 extends keyof RuntimeHooks, Hook = UnwrapHook<Name$1>>(name: Name$1, hook: Hook): () => void;
|
|
876
1324
|
/**
|
|
@@ -882,6 +1330,10 @@ declare class Runtime {
|
|
|
882
1330
|
*/
|
|
883
1331
|
render: (t: number) => void;
|
|
884
1332
|
updateNextFrame(): void;
|
|
1333
|
+
addDebugSubscriber(callback: (event: RuntimeDebugEvent) => void): () => void;
|
|
1334
|
+
removeDebugSubscriber(callback: (event: RuntimeDebugEvent) => void): void;
|
|
1335
|
+
private hasDebugSubscribers;
|
|
1336
|
+
private emitDebug;
|
|
885
1337
|
}
|
|
886
1338
|
//#endregion
|
|
887
1339
|
//#region src/types.d.ts
|
|
@@ -994,187 +1446,108 @@ interface TextWrapperOptions {
|
|
|
994
1446
|
textDecoration?: 'none' | 'underline';
|
|
995
1447
|
}
|
|
996
1448
|
//#endregion
|
|
997
|
-
//#region src/
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
id: string;
|
|
1004
|
-
display?: {
|
|
1005
|
-
width: number;
|
|
1006
|
-
height: number;
|
|
1007
|
-
};
|
|
1008
|
-
target: {
|
|
1009
|
-
width: number;
|
|
1010
|
-
height: number;
|
|
1011
|
-
};
|
|
1012
|
-
scale?: number;
|
|
1013
|
-
getTexture: UpdateTextureFunction;
|
|
1014
|
-
};
|
|
1015
|
-
declare class ImageTexture extends BaseObject implements SpacialContent {
|
|
1016
|
-
readonly type = "spacial-content";
|
|
1017
|
-
id: string;
|
|
1018
|
-
uri: string;
|
|
1019
|
-
display: DisplayData;
|
|
1020
|
-
points: Strand;
|
|
1021
|
-
getTexture: UpdateTextureFunction;
|
|
1022
|
-
constructor(data?: {
|
|
1023
|
-
id?: string;
|
|
1024
|
-
uri: string;
|
|
1025
|
-
width: number;
|
|
1026
|
-
height: number;
|
|
1027
|
-
scale?: number;
|
|
1028
|
-
});
|
|
1029
|
-
applyProps(props: ImageTextureProps): void;
|
|
1030
|
-
getAllPointsAt(target: Strand, aggregate?: Strand, scale?: number): Paint[];
|
|
1031
|
-
}
|
|
1032
|
-
//#endregion
|
|
1033
|
-
//#region src/spacial-content/spacial-content.d.ts
|
|
1034
|
-
interface SpacialContent {
|
|
1035
|
-
readonly id: string;
|
|
1036
|
-
readonly type: 'spacial-content';
|
|
1037
|
-
readonly display: DisplayData;
|
|
1038
|
-
__id?: string;
|
|
1449
|
+
//#region src/objects/base-object.d.ts
|
|
1450
|
+
declare abstract class BaseObject<Props = any, SupportedChildElements = never> implements AtlasObjectModel<Props, SupportedChildElements> {
|
|
1451
|
+
__id: string;
|
|
1452
|
+
__revision: number;
|
|
1453
|
+
__host: any;
|
|
1454
|
+
__onCreate?: () => void;
|
|
1039
1455
|
__parent?: CompositeResource;
|
|
1040
1456
|
__owner: {
|
|
1041
1457
|
value: WorldObject | undefined;
|
|
1042
1458
|
};
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
};
|
|
1053
|
-
style?: {
|
|
1054
|
-
opacity: number;
|
|
1055
|
-
};
|
|
1056
|
-
getScheduledUpdates(target: Strand, scaleFactor: number): Array<() => void | Promise<void>>;
|
|
1057
|
-
getAllPointsAt(target: Strand, aggregate?: Strand, scale?: number): Paint[];
|
|
1058
|
-
transform(op: Strand): void;
|
|
1059
|
-
loadFullResource?(): Promise<void>;
|
|
1060
|
-
dispatchEvent(event: string, e: any): void;
|
|
1061
|
-
getImageUrl?: (index: number) => string;
|
|
1062
|
-
getTexture?: UpdateTextureFunction;
|
|
1063
|
-
}
|
|
1064
|
-
//#endregion
|
|
1065
|
-
//#region src/spacial-content/single-image.d.ts
|
|
1066
|
-
type SingleImageProps = {
|
|
1067
|
-
uri: string;
|
|
1068
|
-
id?: string;
|
|
1069
|
-
display?: {
|
|
1070
|
-
width: number;
|
|
1071
|
-
height: number;
|
|
1072
|
-
rotation?: number;
|
|
1073
|
-
};
|
|
1074
|
-
target: {
|
|
1075
|
-
width: number;
|
|
1076
|
-
height: number;
|
|
1077
|
-
x?: number;
|
|
1078
|
-
y?: number;
|
|
1079
|
-
};
|
|
1080
|
-
crop?: {
|
|
1081
|
-
x: number;
|
|
1082
|
-
y: number;
|
|
1083
|
-
width: number;
|
|
1084
|
-
height: number;
|
|
1085
|
-
};
|
|
1086
|
-
scale?: number;
|
|
1087
|
-
priority?: boolean;
|
|
1088
|
-
style?: any;
|
|
1089
|
-
};
|
|
1090
|
-
declare class SingleImage extends BaseObject implements SpacialContent {
|
|
1091
|
-
readonly type = "spacial-content";
|
|
1092
|
-
/**
|
|
1093
|
-
* An identifier for this image. Will default to the image URI.
|
|
1094
|
-
*/
|
|
1095
|
-
id: string;
|
|
1096
|
-
/**
|
|
1097
|
-
* The URI of the image being painted.
|
|
1098
|
-
*/
|
|
1099
|
-
uri: string;
|
|
1100
|
-
/**
|
|
1101
|
-
* The real height and width of the image. For example a 1000x1000 painted at 100x100 would contain
|
|
1102
|
-
* the display data for 1000x1000 and `this.points` would scale that down to 100x100. This is used to
|
|
1103
|
-
* calculate the scale.
|
|
1104
|
-
*/
|
|
1105
|
-
display: DisplayData;
|
|
1106
|
-
/**
|
|
1107
|
-
* Points are relative to the world object.
|
|
1108
|
-
* Does not change when viewport moves
|
|
1109
|
-
* Does not change if world object position changes.
|
|
1110
|
-
* */
|
|
1111
|
-
points: Strand;
|
|
1112
|
-
/**
|
|
1113
|
-
* Displayed as priority
|
|
1114
|
-
*/
|
|
1115
|
-
priority?: boolean;
|
|
1116
|
-
/**
|
|
1117
|
-
* Some simple styling options
|
|
1118
|
-
*/
|
|
1119
|
-
style: {
|
|
1120
|
-
opacity: number;
|
|
1121
|
-
};
|
|
1122
|
-
constructor(data?: {
|
|
1123
|
-
id?: string;
|
|
1124
|
-
uri: string;
|
|
1125
|
-
width: number;
|
|
1126
|
-
height: number;
|
|
1127
|
-
scale?: number;
|
|
1128
|
-
x?: number;
|
|
1129
|
-
y?: number;
|
|
1130
|
-
rotation?: number;
|
|
1131
|
-
});
|
|
1132
|
-
applyProps(props: SingleImageProps): void;
|
|
1133
|
-
getAllPointsAt(target: Strand, aggregate?: Strand, scale?: number): Paint[];
|
|
1134
|
-
static fromSvg(svg: string, target: SpacialSize, display?: SpacialSize, id?: string): SingleImage;
|
|
1135
|
-
static fromImage(uri: string, target: SpacialSize, display?: SpacialSize, id?: string): SingleImage;
|
|
1136
|
-
getImageUrl(): string;
|
|
1137
|
-
}
|
|
1138
|
-
//#endregion
|
|
1139
|
-
//#region src/spacial-content/tiled-image.d.ts
|
|
1140
|
-
declare class TiledImage extends BaseObject implements SpacialContent {
|
|
1141
|
-
readonly id: string;
|
|
1142
|
-
readonly type = "spacial-content";
|
|
1143
|
-
readonly display: DisplayData;
|
|
1144
|
-
tileWidth: number;
|
|
1145
|
-
style: {
|
|
1146
|
-
opacity: number;
|
|
1147
|
-
};
|
|
1148
|
-
points: Strand;
|
|
1149
|
-
service?: ImageService$1;
|
|
1150
|
-
format: string;
|
|
1151
|
-
crop2?: Strand;
|
|
1152
|
-
version3?: boolean;
|
|
1153
|
-
tileUrl: string;
|
|
1154
|
-
constructor(data: {
|
|
1155
|
-
url: string;
|
|
1156
|
-
scaleFactor: number;
|
|
1157
|
-
points: Strand;
|
|
1158
|
-
displayPoints?: Strand;
|
|
1159
|
-
tileWidth: number;
|
|
1160
|
-
width: number;
|
|
1161
|
-
height: number;
|
|
1162
|
-
format?: string;
|
|
1163
|
-
id?: string;
|
|
1164
|
-
version3?: boolean;
|
|
1165
|
-
});
|
|
1166
|
-
applyProps(props: any): void;
|
|
1167
|
-
static fromTile(url: string, canvas: {
|
|
1459
|
+
__state: any;
|
|
1460
|
+
eventHandlers: SupportedEventMap;
|
|
1461
|
+
scale: number;
|
|
1462
|
+
layers: SupportedChildElements[];
|
|
1463
|
+
time: WorldTime[];
|
|
1464
|
+
_crop?: Strand;
|
|
1465
|
+
cropData?: {
|
|
1466
|
+
x: number;
|
|
1467
|
+
y: number;
|
|
1168
1468
|
width: number;
|
|
1169
1469
|
height: number;
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1470
|
+
};
|
|
1471
|
+
get crop(): Strand | undefined;
|
|
1472
|
+
set crop(crop: Strand | undefined);
|
|
1473
|
+
id: string;
|
|
1474
|
+
abstract points: Strand;
|
|
1475
|
+
getObjectsAt(target: Strand): SupportedChildElements[] | Array<[SupportedChildElements, any[]]>;
|
|
1476
|
+
getAllPointsAt(target: Strand, aggregate: Strand, scale: number): Paint[];
|
|
1477
|
+
getScheduledUpdates(target: Strand, scaleFactor: number): Array<() => void | Promise<void>>;
|
|
1478
|
+
protected constructor();
|
|
1479
|
+
addEventListener: <Name$1 extends SupportedEventNames>(name: Name$1, cb: (e: any) => void, options?: {
|
|
1480
|
+
capture: boolean;
|
|
1481
|
+
passive: boolean;
|
|
1482
|
+
}) => void;
|
|
1483
|
+
removeEventListener: <Name$1 extends SupportedEventNames>(name: Name$1, cb: (e: any) => void) => void;
|
|
1484
|
+
dispatchEvent<Name$1 extends keyof SupportedEvents>(name: Name$1, e: any): boolean;
|
|
1485
|
+
get x(): number;
|
|
1486
|
+
get y(): number;
|
|
1487
|
+
get width(): number;
|
|
1488
|
+
get height(): number;
|
|
1489
|
+
translate(x: number, y: number): void;
|
|
1490
|
+
atScale(factor: number): void;
|
|
1176
1491
|
transform(op: Strand): void;
|
|
1177
|
-
|
|
1492
|
+
applyProps(props: Props): void;
|
|
1493
|
+
appendChild(item: SupportedChildElements): void;
|
|
1494
|
+
removeChild(item: SupportedChildElements): void;
|
|
1495
|
+
insertBefore(item: SupportedChildElements, before: SupportedChildElements): void;
|
|
1496
|
+
hideInstance(): void;
|
|
1497
|
+
}
|
|
1498
|
+
//#endregion
|
|
1499
|
+
//#region src/modules/browser-event-manager/browser-event-manager.d.ts
|
|
1500
|
+
type BrowserEventManagerOptions = {
|
|
1501
|
+
/** Default 50ms **/
|
|
1502
|
+
simulationRate: number;
|
|
1503
|
+
};
|
|
1504
|
+
declare class BrowserEventManager {
|
|
1505
|
+
element: HTMLElement;
|
|
1506
|
+
runtime: Runtime;
|
|
1507
|
+
unsubscribe: () => any;
|
|
1508
|
+
activatedEvents: string[];
|
|
1509
|
+
eventHandlers: [string, any][];
|
|
1510
|
+
bounds: DOMRect;
|
|
1511
|
+
listening: boolean;
|
|
1512
|
+
static eventPool: {
|
|
1513
|
+
atlas: {
|
|
1514
|
+
x: number;
|
|
1515
|
+
y: number;
|
|
1516
|
+
};
|
|
1517
|
+
};
|
|
1518
|
+
pointerMoveEvent: PointerEvent | undefined;
|
|
1519
|
+
pointerEventState: {
|
|
1520
|
+
isClicking: boolean;
|
|
1521
|
+
isPressed: boolean;
|
|
1522
|
+
isDragging: boolean;
|
|
1523
|
+
mousedOver: BaseObject[];
|
|
1524
|
+
itemsBeingDragged: BaseObject[];
|
|
1525
|
+
mouseDownStart: {
|
|
1526
|
+
x: number;
|
|
1527
|
+
y: number;
|
|
1528
|
+
};
|
|
1529
|
+
lastTouches: Array<{
|
|
1530
|
+
id: number;
|
|
1531
|
+
x: number;
|
|
1532
|
+
y: number;
|
|
1533
|
+
}>;
|
|
1534
|
+
};
|
|
1535
|
+
options: BrowserEventManagerOptions;
|
|
1536
|
+
constructor(element: HTMLElement, runtime: Runtime, options?: Partial<BrowserEventManagerOptions>);
|
|
1537
|
+
updateBounds(): void;
|
|
1538
|
+
layoutSubscriber(type: string): void;
|
|
1539
|
+
assignToEvent(e: any, x: number, y: number): void;
|
|
1540
|
+
activateEvents(): void;
|
|
1541
|
+
_realPointerMove: (e: PointerEvent) => void;
|
|
1542
|
+
onWheelEvent: (e: WheelEvent) => void;
|
|
1543
|
+
onContextMenu: (e: MouseEvent) => void;
|
|
1544
|
+
onTouchEvent: (e: TouchEvent) => void;
|
|
1545
|
+
onPointerEvent: (e: PointerEvent | MouseEvent) => void;
|
|
1546
|
+
onPointerDown: (e: PointerEvent | MouseEvent) => void;
|
|
1547
|
+
onPointerUp: (e: PointerEvent | MouseEvent) => void;
|
|
1548
|
+
onPointerMove: (e: PointerEvent | MouseEvent) => void;
|
|
1549
|
+
normalizeEventName(event: string): string;
|
|
1550
|
+
stop(): void;
|
|
1178
1551
|
}
|
|
1179
1552
|
//#endregion
|
|
1180
1553
|
//#region src/objects/box.d.ts
|
|
@@ -1328,115 +1701,6 @@ declare class Text extends BaseObject<TextProps> implements SpacialContent {
|
|
|
1328
1701
|
}: Partial<TextProps>): void;
|
|
1329
1702
|
}
|
|
1330
1703
|
//#endregion
|
|
1331
|
-
//#region src/objects/geometry.d.ts
|
|
1332
|
-
type GeometryProps = {
|
|
1333
|
-
id: string;
|
|
1334
|
-
target: {
|
|
1335
|
-
x: number;
|
|
1336
|
-
y: number;
|
|
1337
|
-
width: number;
|
|
1338
|
-
height: number;
|
|
1339
|
-
};
|
|
1340
|
-
open?: boolean;
|
|
1341
|
-
points: [number, number][];
|
|
1342
|
-
className?: string;
|
|
1343
|
-
href?: string;
|
|
1344
|
-
title?: string;
|
|
1345
|
-
hrefTarget?: string;
|
|
1346
|
-
interactive?: boolean;
|
|
1347
|
-
relativeSize?: boolean;
|
|
1348
|
-
relativeStyle?: boolean;
|
|
1349
|
-
html?: boolean;
|
|
1350
|
-
style?: GeometryStyle;
|
|
1351
|
-
backgroundColor?: string;
|
|
1352
|
-
border?: string;
|
|
1353
|
-
};
|
|
1354
|
-
type GeometryStyle = _GeometryStyle & {
|
|
1355
|
-
':hover'?: _GeometryStyle;
|
|
1356
|
-
':active'?: _GeometryStyle;
|
|
1357
|
-
};
|
|
1358
|
-
type _GeometryStyle = Partial<{
|
|
1359
|
-
backgroundColor: string;
|
|
1360
|
-
opacity: number;
|
|
1361
|
-
boxShadow: string;
|
|
1362
|
-
borderColor: string;
|
|
1363
|
-
borderWidth: string;
|
|
1364
|
-
borderStyle: string;
|
|
1365
|
-
outlineColor: string;
|
|
1366
|
-
outlineWidth: string;
|
|
1367
|
-
outlineOffset: string;
|
|
1368
|
-
outlineStyle: string;
|
|
1369
|
-
border: string;
|
|
1370
|
-
outline: string;
|
|
1371
|
-
background: string;
|
|
1372
|
-
}>;
|
|
1373
|
-
declare class Geometry extends BaseObject<GeometryProps> implements SpacialContent {
|
|
1374
|
-
id: string;
|
|
1375
|
-
type: 'spacial-content';
|
|
1376
|
-
isShape: boolean;
|
|
1377
|
-
points: Strand;
|
|
1378
|
-
hoverEvents: boolean;
|
|
1379
|
-
activeEvents: boolean;
|
|
1380
|
-
display: {
|
|
1381
|
-
x: number;
|
|
1382
|
-
y: number;
|
|
1383
|
-
scale: number;
|
|
1384
|
-
width: number;
|
|
1385
|
-
height: number;
|
|
1386
|
-
points: Strand;
|
|
1387
|
-
};
|
|
1388
|
-
boundingBox: {
|
|
1389
|
-
x: number;
|
|
1390
|
-
y: number;
|
|
1391
|
-
width: number;
|
|
1392
|
-
height: number;
|
|
1393
|
-
} | null;
|
|
1394
|
-
_parsed: {
|
|
1395
|
-
border: {
|
|
1396
|
-
id: string | null;
|
|
1397
|
-
match: string[];
|
|
1398
|
-
};
|
|
1399
|
-
outline: {
|
|
1400
|
-
id: string | null;
|
|
1401
|
-
match: string[];
|
|
1402
|
-
};
|
|
1403
|
-
};
|
|
1404
|
-
hovering?: boolean;
|
|
1405
|
-
pressing?: boolean;
|
|
1406
|
-
props: {
|
|
1407
|
-
href?: string;
|
|
1408
|
-
hrefTarget?: string;
|
|
1409
|
-
title?: string;
|
|
1410
|
-
backgroundColor?: string;
|
|
1411
|
-
border?: string;
|
|
1412
|
-
interactive?: boolean;
|
|
1413
|
-
open?: boolean;
|
|
1414
|
-
className?: string;
|
|
1415
|
-
relativeSize?: boolean;
|
|
1416
|
-
relativeStyle?: boolean;
|
|
1417
|
-
html?: boolean;
|
|
1418
|
-
style?: GeometryStyle;
|
|
1419
|
-
hoverStyles?: GeometryStyle;
|
|
1420
|
-
pressStyles?: GeometryStyle;
|
|
1421
|
-
};
|
|
1422
|
-
shape: {
|
|
1423
|
-
type: 'none';
|
|
1424
|
-
} | {
|
|
1425
|
-
type: 'polygon';
|
|
1426
|
-
points: [number, number][];
|
|
1427
|
-
open?: boolean;
|
|
1428
|
-
};
|
|
1429
|
-
constructor();
|
|
1430
|
-
updateBoundingBox(): void;
|
|
1431
|
-
intersects(pointer?: [number, number] | null): boolean;
|
|
1432
|
-
getAllPointsAt(target: Strand, aggregate: Strand): Paint[];
|
|
1433
|
-
addHover: () => void;
|
|
1434
|
-
removeHover: () => void;
|
|
1435
|
-
addPress: () => void;
|
|
1436
|
-
removePress: () => void;
|
|
1437
|
-
applyProps(props?: Partial<GeometryProps>): void;
|
|
1438
|
-
}
|
|
1439
|
-
//#endregion
|
|
1440
1704
|
//#region src/modules/composite-renderer/composite-renderer.d.ts
|
|
1441
1705
|
declare class CompositeRenderer implements Renderer {
|
|
1442
1706
|
renderers: Renderer[];
|
|
@@ -1464,6 +1728,7 @@ declare class CompositeRenderer implements Renderer {
|
|
|
1464
1728
|
finishLayer(paint: SpacialContent, point: Strand): void;
|
|
1465
1729
|
resize(width?: number, height?: number): void;
|
|
1466
1730
|
reset(): void;
|
|
1731
|
+
resetReadyState(): void;
|
|
1467
1732
|
}
|
|
1468
1733
|
//#endregion
|
|
1469
1734
|
//#region src/modules/grid-builder/grid-builder.d.ts
|
|
@@ -1493,6 +1758,85 @@ declare class GridBuilder {
|
|
|
1493
1758
|
getWorld(): World;
|
|
1494
1759
|
}
|
|
1495
1760
|
//#endregion
|
|
1761
|
+
//#region src/modules/iiif/shared.d.ts
|
|
1762
|
+
type GetTile = {
|
|
1763
|
+
id: string;
|
|
1764
|
+
width: number;
|
|
1765
|
+
height: number;
|
|
1766
|
+
thumbnail?: {
|
|
1767
|
+
id: string;
|
|
1768
|
+
width: number;
|
|
1769
|
+
height: number;
|
|
1770
|
+
};
|
|
1771
|
+
imageService: ImageService$1;
|
|
1772
|
+
};
|
|
1773
|
+
declare function getId(entity: any): string;
|
|
1774
|
+
//#endregion
|
|
1775
|
+
//#region src/modules/maps/projection.d.ts
|
|
1776
|
+
declare const MAX_MERCATOR_LATITUDE = 85.05112878;
|
|
1777
|
+
declare function clampMercatorLatitude(lat: number): number;
|
|
1778
|
+
declare function validateMapBounds(bounds: MapBounds): MapBounds;
|
|
1779
|
+
declare function longitudeToMercatorX(lng: number): number;
|
|
1780
|
+
declare function latitudeToMercatorY(lat: number): number;
|
|
1781
|
+
declare function mercatorXToLongitude(x: number): number;
|
|
1782
|
+
declare function mercatorYToLatitude(y: number): number;
|
|
1783
|
+
declare function lngToTileX(lng: number, zoom: number): number;
|
|
1784
|
+
declare function latToTileY(lat: number, zoom: number): number;
|
|
1785
|
+
declare function tileXToLng(tileX: number, zoom: number): number;
|
|
1786
|
+
declare function tileYToLat(tileY: number, zoom: number): number;
|
|
1787
|
+
declare function createMapProjection(config: {
|
|
1788
|
+
bounds: MapBounds;
|
|
1789
|
+
width: number;
|
|
1790
|
+
height: number;
|
|
1791
|
+
}): MapProjection;
|
|
1792
|
+
//#endregion
|
|
1793
|
+
//#region src/modules/maps/tile-source.d.ts
|
|
1794
|
+
declare const DEFAULT_OSM_TILE_TEMPLATE = "https://tile.openstreetmap.org/{z}/{x}/{y}.png";
|
|
1795
|
+
declare function getSubdomainForTile(ctx: MapTileUrlContext): string | undefined;
|
|
1796
|
+
declare function resolveTileTemplate(template: string, ctx: MapTileUrlContext): string;
|
|
1797
|
+
declare function resolveTileUrl(source: MapTileSource | undefined, ctx: MapTileUrlContext): string;
|
|
1798
|
+
//#endregion
|
|
1799
|
+
//#region src/modules/maps/warped/types.d.ts
|
|
1800
|
+
type WarpControlPoint = {
|
|
1801
|
+
image: {
|
|
1802
|
+
x: number;
|
|
1803
|
+
y: number;
|
|
1804
|
+
};
|
|
1805
|
+
map: {
|
|
1806
|
+
lng: number;
|
|
1807
|
+
lat: number;
|
|
1808
|
+
};
|
|
1809
|
+
};
|
|
1810
|
+
type WarpTransformationType = 'affine' | 'projective' | 'thinPlateSpline';
|
|
1811
|
+
type WarpUpdateReason = 'gcps' | 'transformation' | 'manual';
|
|
1812
|
+
type WarpAdapterHooks = {
|
|
1813
|
+
onControlPointsChange?: (controlPoints: WarpControlPoint[]) => void;
|
|
1814
|
+
onTransformationTypeChange?: (type: WarpTransformationType) => void;
|
|
1815
|
+
onUpdate?: (reason: WarpUpdateReason) => void;
|
|
1816
|
+
};
|
|
1817
|
+
type WarpAdapter = {
|
|
1818
|
+
setMapGcps(controlPoints: WarpControlPoint[]): void;
|
|
1819
|
+
setMapTransformationType(type: WarpTransformationType): void;
|
|
1820
|
+
update(reason?: WarpUpdateReason): void;
|
|
1821
|
+
};
|
|
1822
|
+
//#endregion
|
|
1823
|
+
//#region src/modules/maps/warped/adapter.d.ts
|
|
1824
|
+
declare class WarpAdapterController {
|
|
1825
|
+
private readonly adapter;
|
|
1826
|
+
private readonly hooks;
|
|
1827
|
+
private controlPoints;
|
|
1828
|
+
private transformationType;
|
|
1829
|
+
constructor(adapter: WarpAdapter, hooks?: WarpAdapterHooks);
|
|
1830
|
+
getState(): {
|
|
1831
|
+
controlPoints: WarpControlPoint[];
|
|
1832
|
+
transformationType: WarpTransformationType;
|
|
1833
|
+
};
|
|
1834
|
+
setControlPoints(controlPoints: WarpControlPoint[]): void;
|
|
1835
|
+
setTransformationType(type: WarpTransformationType): void;
|
|
1836
|
+
update(reason?: WarpUpdateReason): void;
|
|
1837
|
+
}
|
|
1838
|
+
declare function createWarpAdapterController(adapter: WarpAdapter, hooks?: WarpAdapterHooks): WarpAdapterController;
|
|
1839
|
+
//#endregion
|
|
1496
1840
|
//#region src/modules/popmotion-controller/popmotion-controller.d.ts
|
|
1497
1841
|
type PopmotionControllerConfig = {
|
|
1498
1842
|
zoomOutFactor?: number;
|
|
@@ -1506,14 +1850,24 @@ type PopmotionControllerConfig = {
|
|
|
1506
1850
|
panBounceDamping?: number;
|
|
1507
1851
|
panTimeConstant?: number;
|
|
1508
1852
|
panPower?: number;
|
|
1853
|
+
/**
|
|
1854
|
+
* Enable inertial momentum when releasing from pan.
|
|
1855
|
+
*/
|
|
1856
|
+
enablePanMomentum?: boolean;
|
|
1857
|
+
/**
|
|
1858
|
+
* Pan momentum intensity multiplier. 1 is the default "Apple-like" feel.
|
|
1859
|
+
*/
|
|
1860
|
+
panMomentumStrength?: number;
|
|
1509
1861
|
nudgeDistance?: number;
|
|
1510
1862
|
panPadding?: number;
|
|
1511
1863
|
devicePixelRatio?: number;
|
|
1512
1864
|
enableWheel?: boolean;
|
|
1513
1865
|
enableClickToZoom?: boolean;
|
|
1866
|
+
enableDoubleTapZoom?: boolean;
|
|
1514
1867
|
ignoreSingleFingerTouch?: boolean;
|
|
1515
1868
|
enablePanOnWait?: boolean;
|
|
1516
1869
|
requireMetaKeyForWheelZoom?: boolean;
|
|
1870
|
+
wheelInExploreModeOnly?: boolean;
|
|
1517
1871
|
panOnWaitDelay?: number;
|
|
1518
1872
|
parentElement?: HTMLElement | null;
|
|
1519
1873
|
onPanInSketchMode?: () => void;
|
|
@@ -1521,72 +1875,83 @@ type PopmotionControllerConfig = {
|
|
|
1521
1875
|
declare const defaultConfig: Required<PopmotionControllerConfig>;
|
|
1522
1876
|
declare const popmotionController: (config?: PopmotionControllerConfig) => RuntimeController;
|
|
1523
1877
|
//#endregion
|
|
1524
|
-
//#region src/modules/
|
|
1525
|
-
type
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1878
|
+
//#region src/modules/pdf-scroll-zone-controller/pdf-scroll-zone-controller.d.ts
|
|
1879
|
+
type PdfScrollZoneControllerConfig = PopmotionControllerConfig & {
|
|
1880
|
+
scrollWheelFactor?: number;
|
|
1881
|
+
scrollLoadAheadFactor?: number;
|
|
1882
|
+
clickDragThresholdPx?: number;
|
|
1883
|
+
touchScrollMomentumStrength?: number;
|
|
1884
|
+
touchScrollMomentumMinStartPxPerMs?: number;
|
|
1885
|
+
};
|
|
1886
|
+
declare const pdfScrollZoneController: (config?: PdfScrollZoneControllerConfig) => RuntimeController;
|
|
1887
|
+
//#endregion
|
|
1888
|
+
//#region src/modules/shared/image-load-events.d.ts
|
|
1889
|
+
type AtlasImageLoadErrorSeverity = 'recoverable' | 'fatal';
|
|
1890
|
+
type AtlasImageLoadRenderer = 'canvas' | 'webgl';
|
|
1891
|
+
type AtlasImageLoadErrorEvent = {
|
|
1892
|
+
severity: AtlasImageLoadErrorSeverity;
|
|
1893
|
+
renderer: AtlasImageLoadRenderer;
|
|
1894
|
+
imageUrl?: string;
|
|
1895
|
+
contentId?: string;
|
|
1896
|
+
tileIndex?: number;
|
|
1897
|
+
attempt?: number;
|
|
1898
|
+
maxAttempts?: number;
|
|
1899
|
+
willRetry?: boolean;
|
|
1900
|
+
nextRetryAt?: number;
|
|
1901
|
+
error?: unknown;
|
|
1535
1902
|
};
|
|
1536
|
-
declare function getId(entity: any): string;
|
|
1537
1903
|
//#endregion
|
|
1538
|
-
//#region src/modules/
|
|
1539
|
-
type
|
|
1540
|
-
|
|
1541
|
-
|
|
1904
|
+
//#region src/modules/shared/image-loading-config.d.ts
|
|
1905
|
+
type ImageLoadingConfig = {
|
|
1906
|
+
maxConcurrentRequests: number;
|
|
1907
|
+
maxPrefetchPerFrame: number;
|
|
1908
|
+
timeoutMs: number;
|
|
1909
|
+
maxAttempts: number;
|
|
1910
|
+
baseDelayMs: number;
|
|
1911
|
+
maxDelayMs: number;
|
|
1912
|
+
jitterRatio: number;
|
|
1913
|
+
errorRetryIntervalMs: number;
|
|
1914
|
+
revealDelayFrames: number;
|
|
1915
|
+
revealBatchWindowFrames: number;
|
|
1916
|
+
skipFadeIfLoadedWithinMs: number;
|
|
1917
|
+
};
|
|
1918
|
+
type ImageLoadingConfigOverrides = Partial<ImageLoadingConfig>;
|
|
1919
|
+
declare function resolveImageLoadingConfig(overrides?: ImageLoadingConfigOverrides): ImageLoadingConfig;
|
|
1920
|
+
declare function getRetryDelayMs(config: ImageLoadingConfig, attempt: number, random?: () => number): number;
|
|
1921
|
+
//#endregion
|
|
1922
|
+
//#region src/modules/shared/image-request-pool.d.ts
|
|
1923
|
+
type AcquireResult = {
|
|
1924
|
+
requestKey: string;
|
|
1925
|
+
promise: Promise<HTMLImageElement>;
|
|
1926
|
+
release: (opts?: {
|
|
1927
|
+
silent?: boolean;
|
|
1928
|
+
}) => void;
|
|
1929
|
+
};
|
|
1930
|
+
type ImageRequestPoolOptions = {
|
|
1931
|
+
timeoutMs: number;
|
|
1932
|
+
crossOrigin?: 'anonymous' | 'use-credentials';
|
|
1933
|
+
useFetch?: boolean;
|
|
1934
|
+
cache?: Map<string, HTMLImageElement>;
|
|
1542
1935
|
};
|
|
1543
|
-
declare class
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
mousedOver: BaseObject[];
|
|
1563
|
-
itemsBeingDragged: BaseObject[];
|
|
1564
|
-
mouseDownStart: {
|
|
1565
|
-
x: number;
|
|
1566
|
-
y: number;
|
|
1567
|
-
};
|
|
1568
|
-
lastTouches: Array<{
|
|
1569
|
-
id: number;
|
|
1570
|
-
x: number;
|
|
1571
|
-
y: number;
|
|
1572
|
-
}>;
|
|
1573
|
-
};
|
|
1574
|
-
options: BrowserEventManagerOptions;
|
|
1575
|
-
constructor(element: HTMLElement, runtime: Runtime, options?: Partial<BrowserEventManagerOptions>);
|
|
1576
|
-
updateBounds(): void;
|
|
1577
|
-
layoutSubscriber(type: string): void;
|
|
1578
|
-
assignToEvent(e: any, x: number, y: number): void;
|
|
1579
|
-
activateEvents(): void;
|
|
1580
|
-
_realPointerMove: (e: PointerEvent) => void;
|
|
1581
|
-
onWheelEvent: (e: WheelEvent) => void;
|
|
1582
|
-
onContextMenu: (e: MouseEvent) => void;
|
|
1583
|
-
onTouchEvent: (e: TouchEvent) => void;
|
|
1584
|
-
onPointerEvent: (e: PointerEvent | MouseEvent) => void;
|
|
1585
|
-
onPointerDown: (e: PointerEvent | MouseEvent) => void;
|
|
1586
|
-
onPointerUp: (e: PointerEvent | MouseEvent) => void;
|
|
1587
|
-
onPointerMove: (e: PointerEvent | MouseEvent) => void;
|
|
1588
|
-
normalizeEventName(event: string): string;
|
|
1589
|
-
stop(): void;
|
|
1936
|
+
declare class ImageRequestPool {
|
|
1937
|
+
private readonly timeoutMs;
|
|
1938
|
+
private readonly crossOrigin?;
|
|
1939
|
+
private readonly useFetch;
|
|
1940
|
+
private readonly cache;
|
|
1941
|
+
private readonly inFlight;
|
|
1942
|
+
private readonly knownConsumers;
|
|
1943
|
+
constructor(options: ImageRequestPoolOptions);
|
|
1944
|
+
acquire(url: string, consumerId: string): AcquireResult;
|
|
1945
|
+
release(url: string, consumerId: string, opts?: {
|
|
1946
|
+
silent?: boolean;
|
|
1947
|
+
}): void;
|
|
1948
|
+
releaseConsumer(consumerId: string, opts?: {
|
|
1949
|
+
silent?: boolean;
|
|
1950
|
+
}): void;
|
|
1951
|
+
cancelAll(opts?: {
|
|
1952
|
+
silent?: boolean;
|
|
1953
|
+
}): void;
|
|
1954
|
+
private createRequest;
|
|
1590
1955
|
}
|
|
1591
1956
|
//#endregion
|
|
1592
1957
|
//#region src/modules/canvas-renderer/canvas-renderer.d.ts
|
|
@@ -1599,15 +1964,60 @@ type CanvasRendererOptions = {
|
|
|
1599
1964
|
box?: boolean;
|
|
1600
1965
|
polygon?: boolean;
|
|
1601
1966
|
lruCache?: boolean;
|
|
1967
|
+
paintImages?: boolean;
|
|
1968
|
+
shouldPaintImage?: (paint: SingleImage | TiledImage, index: number) => boolean;
|
|
1969
|
+
readiness?: 'first-meaningful-paint' | 'immediate';
|
|
1970
|
+
imageLoading?: Partial<ImageLoadingConfig>;
|
|
1971
|
+
onImageError?: (event: AtlasImageLoadErrorEvent) => void;
|
|
1602
1972
|
};
|
|
1603
1973
|
type ImageBuffer = {
|
|
1604
|
-
canvas
|
|
1974
|
+
canvas?: HTMLCanvasElement;
|
|
1605
1975
|
canvases: string[];
|
|
1976
|
+
tiles?: Record<number, TileLoadingState>;
|
|
1606
1977
|
indices: number[];
|
|
1607
1978
|
loaded: number[];
|
|
1608
1979
|
fallback?: ImageBuffer;
|
|
1609
1980
|
loading: boolean;
|
|
1610
1981
|
};
|
|
1982
|
+
type TileLoadingState = {
|
|
1983
|
+
state: 'idle' | 'queued' | 'loading' | 'decoded' | 'error';
|
|
1984
|
+
requestedAt?: number;
|
|
1985
|
+
loadedAt?: number;
|
|
1986
|
+
lastUsedAt?: number;
|
|
1987
|
+
url?: string;
|
|
1988
|
+
error?: unknown;
|
|
1989
|
+
attempts?: number;
|
|
1990
|
+
nextRetryAt?: number;
|
|
1991
|
+
lastRequestKey?: string;
|
|
1992
|
+
cancelledAt?: number;
|
|
1993
|
+
skipFade?: boolean;
|
|
1994
|
+
};
|
|
1995
|
+
type QueueTask = {
|
|
1996
|
+
id: string;
|
|
1997
|
+
scale: number;
|
|
1998
|
+
kind: 'network' | 'decode';
|
|
1999
|
+
tileKey?: string;
|
|
2000
|
+
requestKey?: string;
|
|
2001
|
+
network?: boolean;
|
|
2002
|
+
distance: number;
|
|
2003
|
+
shifted?: boolean;
|
|
2004
|
+
paint?: SingleImage | TiledImage;
|
|
2005
|
+
index?: number;
|
|
2006
|
+
prefetch?: boolean;
|
|
2007
|
+
task: () => Promise<any>;
|
|
2008
|
+
};
|
|
2009
|
+
type InFlightTileLoad$1 = {
|
|
2010
|
+
tileKey: string;
|
|
2011
|
+
requestKey: string;
|
|
2012
|
+
url: string;
|
|
2013
|
+
consumerId: string;
|
|
2014
|
+
paint: SingleImage | TiledImage;
|
|
2015
|
+
imageBuffer: ImageBuffer;
|
|
2016
|
+
index: number;
|
|
2017
|
+
release: (opts?: {
|
|
2018
|
+
silent?: boolean;
|
|
2019
|
+
}) => void;
|
|
2020
|
+
};
|
|
1611
2021
|
declare class CanvasRenderer implements Renderer {
|
|
1612
2022
|
/**
|
|
1613
2023
|
* The primary viewing space for the viewer.
|
|
@@ -1640,18 +2050,24 @@ declare class CanvasRenderer implements Renderer {
|
|
|
1640
2050
|
pendingDrawCall: boolean;
|
|
1641
2051
|
firstMeaningfulPaint: boolean;
|
|
1642
2052
|
parallelTasks: number;
|
|
2053
|
+
maxPrefetchPerFrame: number;
|
|
2054
|
+
imageLoadingConfig: ImageLoadingConfig;
|
|
2055
|
+
imageRequestPool: ImageRequestPool;
|
|
1643
2056
|
frameTasks: number;
|
|
1644
2057
|
loadingQueueOrdered: boolean;
|
|
1645
|
-
loadingQueue:
|
|
1646
|
-
id: string;
|
|
1647
|
-
scale: number;
|
|
1648
|
-
network?: boolean;
|
|
1649
|
-
distance: number;
|
|
1650
|
-
shifted?: boolean;
|
|
1651
|
-
task: () => Promise<any>;
|
|
1652
|
-
}>;
|
|
2058
|
+
loadingQueue: QueueTask[];
|
|
1653
2059
|
currentTask: Promise<any>;
|
|
1654
2060
|
tasksRunning: number;
|
|
2061
|
+
inFlightImageLoads: Map<string, InFlightTileLoad$1>;
|
|
2062
|
+
requiredTileKeys: Set<string>;
|
|
2063
|
+
requiredPrefetchTileKeys: Set<string>;
|
|
2064
|
+
requestGeneration: number;
|
|
2065
|
+
frameCounter: number;
|
|
2066
|
+
pendingTileReveals: Map<string, {
|
|
2067
|
+
imageBuffer: ImageBuffer;
|
|
2068
|
+
index: number;
|
|
2069
|
+
queuedFrame: number;
|
|
2070
|
+
}>;
|
|
1655
2071
|
stats?: any;
|
|
1656
2072
|
averageJobTime: number;
|
|
1657
2073
|
lastKnownScale: number;
|
|
@@ -1663,12 +2079,18 @@ declare class CanvasRenderer implements Renderer {
|
|
|
1663
2079
|
lastPaintedObject?: WorldObject;
|
|
1664
2080
|
hostCache: LRUCache<string, HTMLCanvasElement>;
|
|
1665
2081
|
invalidated: string[];
|
|
2082
|
+
fallbackRevealTimeout: ReturnType<typeof setTimeout> | null;
|
|
2083
|
+
framePrefetchCount: number;
|
|
2084
|
+
hasTilesFading: boolean;
|
|
2085
|
+
hasActiveLayerClip: boolean;
|
|
1666
2086
|
constructor(canvas: HTMLCanvasElement, options?: CanvasRendererOptions);
|
|
1667
2087
|
getCanvasDims(): {
|
|
1668
2088
|
width: number;
|
|
1669
2089
|
height: number;
|
|
1670
2090
|
};
|
|
1671
2091
|
resize(): void;
|
|
2092
|
+
private getCompositeOwner;
|
|
2093
|
+
private compareCompositeLoadPriority;
|
|
1672
2094
|
isReady(): boolean;
|
|
1673
2095
|
afterFrame(world: World): void;
|
|
1674
2096
|
doOffscreenWork(): void;
|
|
@@ -1679,9 +2101,31 @@ declare class CanvasRenderer implements Renderer {
|
|
|
1679
2101
|
beforeFrame(world: World, delta: number, target: Strand, options: HookOptions): void;
|
|
1680
2102
|
applyTransform(paint: Paintable, x: number, y: number, width: number, height: number): void;
|
|
1681
2103
|
clearTransform(): void;
|
|
2104
|
+
private getTileKey;
|
|
2105
|
+
private nextRequestKey;
|
|
2106
|
+
private markTileRequired;
|
|
2107
|
+
private isTileRequired;
|
|
2108
|
+
private shouldSkipFade;
|
|
2109
|
+
private enqueueTileReveal;
|
|
2110
|
+
private flushTileRevealBatch;
|
|
2111
|
+
private emitImageError;
|
|
2112
|
+
private releaseInFlightTileLoad;
|
|
2113
|
+
private pruneStaleTileWork;
|
|
2114
|
+
private ensureImageBuffer;
|
|
2115
|
+
private getTileState;
|
|
2116
|
+
private setTileState;
|
|
2117
|
+
private syncBufferState;
|
|
2118
|
+
private getCompositeRenderOptions;
|
|
2119
|
+
private shouldClipLayerToBounds;
|
|
2120
|
+
private getBoundsFromPoints;
|
|
2121
|
+
private getLayerPolicy;
|
|
2122
|
+
private isLayerActive;
|
|
2123
|
+
private getPrefetchRadius;
|
|
2124
|
+
private getFadeAlpha;
|
|
2125
|
+
private schedulePrefetchNeighbours;
|
|
2126
|
+
private scheduleSingleImageLookahead;
|
|
1682
2127
|
paint(paint: SpacialContent | Text | Box, index: number, x: number, y: number, width: number, height: number): void;
|
|
1683
|
-
|
|
1684
|
-
schedulePaintToCanvas(imageBuffer: ImageBuffer, paint: SingleImage | TiledImage, index: number, priority: number): void;
|
|
2128
|
+
schedulePaintToCanvas(imageBuffer: ImageBuffer, paint: SingleImage | TiledImage, index: number, priority: number, prefetch?: boolean): boolean;
|
|
1685
2129
|
afterPaintLayer(paint: SpacialContent, transform: Strand): void;
|
|
1686
2130
|
prepareLayer(paint: SpacialContent, points: Strand): void;
|
|
1687
2131
|
finishLayer(): void;
|
|
@@ -1690,6 +2134,7 @@ declare class CanvasRenderer implements Renderer {
|
|
|
1690
2134
|
getViewportBounds(world: World, target: Strand, padding: number): PositionPair | null;
|
|
1691
2135
|
pendingUpdate(): boolean;
|
|
1692
2136
|
getRendererScreenPosition(): DOMRect;
|
|
2137
|
+
resetReadyState(): void;
|
|
1693
2138
|
reset(): void;
|
|
1694
2139
|
}
|
|
1695
2140
|
//#endregion
|
|
@@ -1726,6 +2171,254 @@ declare class DebugRenderer implements Renderer {
|
|
|
1726
2171
|
reset(): void;
|
|
1727
2172
|
}
|
|
1728
2173
|
//#endregion
|
|
2174
|
+
//#region src/modules/iiif/get-tiles.d.ts
|
|
2175
|
+
declare function getTileFromImageService(infoJsonId: string, width: number, height: number): Promise<GetTile>;
|
|
2176
|
+
declare function getTileFromCanvas(canvas: CanvasNormalized, thumbnailSize?: number): Promise<GetTile[]>;
|
|
2177
|
+
declare function getTilesFromManifest(manifest: ManifestNormalized): Promise<any[]>;
|
|
2178
|
+
declare function getTiles(manifestId: string): Promise<Array<GetTile>>;
|
|
2179
|
+
//#endregion
|
|
2180
|
+
//#region src/modules/navigator-renderer/navigator-renderer.d.ts
|
|
2181
|
+
type NavigatorTransform = {
|
|
2182
|
+
scale: number;
|
|
2183
|
+
offsetX: number;
|
|
2184
|
+
offsetY: number;
|
|
2185
|
+
worldX: number;
|
|
2186
|
+
worldY: number;
|
|
2187
|
+
worldWidth: number;
|
|
2188
|
+
worldHeight: number;
|
|
2189
|
+
};
|
|
2190
|
+
type NavigatorWorldRegion = {
|
|
2191
|
+
x: number;
|
|
2192
|
+
y: number;
|
|
2193
|
+
width: number;
|
|
2194
|
+
height: number;
|
|
2195
|
+
};
|
|
2196
|
+
type NavigatorRendererStyle = {
|
|
2197
|
+
background: string;
|
|
2198
|
+
objectFill: string;
|
|
2199
|
+
objectStroke: string;
|
|
2200
|
+
viewportFill: string;
|
|
2201
|
+
viewportStroke: string;
|
|
2202
|
+
viewportLineWidth: number;
|
|
2203
|
+
};
|
|
2204
|
+
type SharedCanvasTileState = {
|
|
2205
|
+
state?: 'idle' | 'queued' | 'loading' | 'decoded' | 'error';
|
|
2206
|
+
};
|
|
2207
|
+
type SharedCanvasImageBuffer = {
|
|
2208
|
+
canvases?: string[];
|
|
2209
|
+
tiles?: Record<number, SharedCanvasTileState>;
|
|
2210
|
+
};
|
|
2211
|
+
type SharedCanvasRenderer = {
|
|
2212
|
+
hostCache?: {
|
|
2213
|
+
get(id: string): HTMLCanvasElement | undefined;
|
|
2214
|
+
};
|
|
2215
|
+
invalidated?: string[];
|
|
2216
|
+
schedulePaintToCanvas?: (imageBuffer: SharedCanvasImageBuffer, paint: SingleImage | TiledImage, index: number, priority: number, prefetch?: boolean) => boolean;
|
|
2217
|
+
createImageHost?: (paint: SingleImage | TiledImage) => void;
|
|
2218
|
+
};
|
|
2219
|
+
type NavigatorRendererOptions = {
|
|
2220
|
+
style?: Partial<NavigatorRendererStyle>;
|
|
2221
|
+
maxRects?: number;
|
|
2222
|
+
minVisibleRectSize?: number;
|
|
2223
|
+
drawFallbackBoxes?: boolean;
|
|
2224
|
+
zoneWindow?: NavigatorZoneWindowOptions;
|
|
2225
|
+
sharedCanvasRenderer?: SharedCanvasRenderer;
|
|
2226
|
+
onRequestRender?: () => void;
|
|
2227
|
+
onDebugEvent?: (event: NavigatorDebugEvent) => void;
|
|
2228
|
+
};
|
|
2229
|
+
type NavigatorDebugEvent = {
|
|
2230
|
+
type: 'preview-image-requested';
|
|
2231
|
+
imageUrl: string;
|
|
2232
|
+
} | {
|
|
2233
|
+
type: 'preview-image-loaded';
|
|
2234
|
+
imageUrl: string;
|
|
2235
|
+
cached: boolean;
|
|
2236
|
+
} | {
|
|
2237
|
+
type: 'preview-image-error';
|
|
2238
|
+
imageUrl: string;
|
|
2239
|
+
} | {
|
|
2240
|
+
type: 'world-layer-invalidated';
|
|
2241
|
+
reason: string;
|
|
2242
|
+
} | {
|
|
2243
|
+
type: 'frame-skipped-zero-size-canvas';
|
|
2244
|
+
canvasWidth: number;
|
|
2245
|
+
canvasHeight: number;
|
|
2246
|
+
baseCanvasWidth: number;
|
|
2247
|
+
baseCanvasHeight: number;
|
|
2248
|
+
} | {
|
|
2249
|
+
type: 'world-layer-render-start';
|
|
2250
|
+
region: NavigatorWorldRegion;
|
|
2251
|
+
} | {
|
|
2252
|
+
type: 'world-layer-render-end';
|
|
2253
|
+
region: NavigatorWorldRegion;
|
|
2254
|
+
} | {
|
|
2255
|
+
type: 'render-request-forwarded';
|
|
2256
|
+
reason: string;
|
|
2257
|
+
};
|
|
2258
|
+
type NavigatorZoneWindowOptions = {
|
|
2259
|
+
total?: number;
|
|
2260
|
+
before?: number;
|
|
2261
|
+
after?: number;
|
|
2262
|
+
};
|
|
2263
|
+
type NavigatorWorldRegionOptions = {
|
|
2264
|
+
target?: Strand | {
|
|
2265
|
+
x: number;
|
|
2266
|
+
y: number;
|
|
2267
|
+
width: number;
|
|
2268
|
+
height: number;
|
|
2269
|
+
};
|
|
2270
|
+
zoneWindow?: NavigatorZoneWindowOptions;
|
|
2271
|
+
};
|
|
2272
|
+
declare function getNavigatorWorldTransform(worldWidth: number, worldHeight: number, navigatorWidth: number, navigatorHeight: number, worldX?: number, worldY?: number): NavigatorTransform;
|
|
2273
|
+
declare function getNavigatorWorldRegion(world: World, options?: NavigatorWorldRegionOptions): NavigatorWorldRegion;
|
|
2274
|
+
declare function getNavigatorVisibleZoneIdSet(world: World, options?: NavigatorWorldRegionOptions): Set<string> | null;
|
|
2275
|
+
declare function navigatorToWorldPoint(transform: NavigatorTransform, x: number, y: number): {
|
|
2276
|
+
x: number;
|
|
2277
|
+
y: number;
|
|
2278
|
+
};
|
|
2279
|
+
declare class NavigatorRenderer extends DebugRenderer {
|
|
2280
|
+
private readonly style;
|
|
2281
|
+
private readonly maxRects;
|
|
2282
|
+
private readonly minVisibleRectSize;
|
|
2283
|
+
private readonly drawFallbackBoxes;
|
|
2284
|
+
private readonly zoneWindow?;
|
|
2285
|
+
private readonly sharedCanvasRenderer?;
|
|
2286
|
+
private readonly onRequestRender?;
|
|
2287
|
+
private readonly onDebugEvent?;
|
|
2288
|
+
private readonly baseCanvas;
|
|
2289
|
+
private readonly baseContext;
|
|
2290
|
+
private readonly worldTarget;
|
|
2291
|
+
private readonly previewImageCache;
|
|
2292
|
+
private worldLayerDirty;
|
|
2293
|
+
private lastWorldWidth;
|
|
2294
|
+
private lastWorldHeight;
|
|
2295
|
+
private lastTargetX;
|
|
2296
|
+
private lastTargetY;
|
|
2297
|
+
private lastTargetX2;
|
|
2298
|
+
private lastTargetY2;
|
|
2299
|
+
private lastRegionX;
|
|
2300
|
+
private lastRegionY;
|
|
2301
|
+
private lastRegionWidth;
|
|
2302
|
+
private lastRegionHeight;
|
|
2303
|
+
private worldLayerInvalidationVersion;
|
|
2304
|
+
private sharedCanvasResourcesPending;
|
|
2305
|
+
constructor(canvas: HTMLCanvasElement, options?: NavigatorRendererOptions);
|
|
2306
|
+
private emitDebugEvent;
|
|
2307
|
+
private requestRender;
|
|
2308
|
+
invalidateWorldLayer(reason?: string): void;
|
|
2309
|
+
resize(): void;
|
|
2310
|
+
beforeFrame(world: World): void;
|
|
2311
|
+
paint(): void;
|
|
2312
|
+
pendingUpdate(): boolean;
|
|
2313
|
+
afterFrame(world: World, _delta: number, target: Strand): void;
|
|
2314
|
+
private hasViewportChanged;
|
|
2315
|
+
private hasRegionChanged;
|
|
2316
|
+
private syncBaseLayerCanvas;
|
|
2317
|
+
private shouldClipImagePaintToBounds;
|
|
2318
|
+
private getBoundsFromPoints;
|
|
2319
|
+
private getLayerClipBounds;
|
|
2320
|
+
private renderWorldLayer;
|
|
2321
|
+
private renderFallbackBox;
|
|
2322
|
+
private renderImagePaint;
|
|
2323
|
+
private ensureSharedCanvasImageBuffer;
|
|
2324
|
+
private drawSharedCanvasTile;
|
|
2325
|
+
private renderSharedCanvasImage;
|
|
2326
|
+
private getLoadedPreviewImage;
|
|
2327
|
+
private renderBox;
|
|
2328
|
+
private renderGeometry;
|
|
2329
|
+
private renderViewportBox;
|
|
2330
|
+
}
|
|
2331
|
+
//#endregion
|
|
2332
|
+
//#region src/utility/stylesheet.d.ts
|
|
2333
|
+
declare class Stylesheet {
|
|
2334
|
+
$element: HTMLStyleElement;
|
|
2335
|
+
stylesheetClasses: string[];
|
|
2336
|
+
activeStylesheetClasses: string[];
|
|
2337
|
+
sheetsDidUpdate: boolean;
|
|
2338
|
+
sheetPrefix: string;
|
|
2339
|
+
stylesheetEntries: Record<string, string>;
|
|
2340
|
+
constructor(options?: {
|
|
2341
|
+
sheetPrefix?: string;
|
|
2342
|
+
});
|
|
2343
|
+
getElement(): HTMLStyleElement;
|
|
2344
|
+
addStylesheet(_sheet: string): string;
|
|
2345
|
+
removeStylesheet(obj: any): void;
|
|
2346
|
+
clearClasses(): void;
|
|
2347
|
+
didUpdateActive(): boolean;
|
|
2348
|
+
updateSheet(): void;
|
|
2349
|
+
}
|
|
2350
|
+
//#endregion
|
|
2351
|
+
//#region src/modules/overlay-renderer/overlay-renderer.d.ts
|
|
2352
|
+
type OverlayRendererOptions = {
|
|
2353
|
+
sheetPrefix: string;
|
|
2354
|
+
box: boolean;
|
|
2355
|
+
text: boolean;
|
|
2356
|
+
inlineStyles: boolean;
|
|
2357
|
+
triggerResize: () => void;
|
|
2358
|
+
background: string;
|
|
2359
|
+
};
|
|
2360
|
+
declare class OverlayRenderer implements Renderer {
|
|
2361
|
+
htmlContainer: HTMLDivElement;
|
|
2362
|
+
visible: Array<Text | Box | SpacialContent>;
|
|
2363
|
+
previousVisible: Array<Text | Box | SpacialContent>;
|
|
2364
|
+
htmlIds: string[];
|
|
2365
|
+
firstMeaningfulPaint: boolean;
|
|
2366
|
+
rendererPosition: DOMRect;
|
|
2367
|
+
stylesheet: Stylesheet;
|
|
2368
|
+
options: OverlayRendererOptions;
|
|
2369
|
+
paintTx: number;
|
|
2370
|
+
zIndex: number;
|
|
2371
|
+
classes: {
|
|
2372
|
+
hostClassName: string;
|
|
2373
|
+
interactive: string;
|
|
2374
|
+
nonInteractive: string;
|
|
2375
|
+
};
|
|
2376
|
+
constructor(htmlContainer: HTMLDivElement, options?: Partial<OverlayRendererOptions>);
|
|
2377
|
+
createHtmlHost(paint: Text | Box): void;
|
|
2378
|
+
triggerResize(): void;
|
|
2379
|
+
updateHtmlHost(paint: Text | Box, width?: number, height?: number): void;
|
|
2380
|
+
afterFrame(world: World, delta: number, target: Strand): void;
|
|
2381
|
+
afterPaintLayer(paint: SpacialContent, transform?: Strand): void;
|
|
2382
|
+
beforeFrame(world: World, delta: number, target: Strand): void;
|
|
2383
|
+
getPointsAt(world: World, target: Strand, aggregate: Strand, scaleFactor: number): Paint[];
|
|
2384
|
+
getScale(width: number, height: number): number;
|
|
2385
|
+
getViewportBounds(world: World, target: Strand, padding: number): PositionPair | null;
|
|
2386
|
+
isReady(): boolean;
|
|
2387
|
+
paint(paint: SpacialContent, index: number, x: number, y: number, width: number, height: number): void;
|
|
2388
|
+
pendingUpdate(): boolean;
|
|
2389
|
+
prepareLayer(paint: SpacialContent): void;
|
|
2390
|
+
resize(width?: number, height?: number): void;
|
|
2391
|
+
getRendererScreenPosition(): DOMRect;
|
|
2392
|
+
finishLayer(): void;
|
|
2393
|
+
reset(): void;
|
|
2394
|
+
}
|
|
2395
|
+
//#endregion
|
|
2396
|
+
//#region src/modules/webgl-renderer/types.d.ts
|
|
2397
|
+
type AtlasWebGLFallbackReason = 'image-cors-or-load' | 'teximage-security' | 'webgl-context-unavailable' | 'webgl-context-lost';
|
|
2398
|
+
type AtlasWebGLFallbackEvent = {
|
|
2399
|
+
from: 'webgl';
|
|
2400
|
+
to: 'canvas';
|
|
2401
|
+
reason: AtlasWebGLFallbackReason;
|
|
2402
|
+
imageUrl?: string;
|
|
2403
|
+
contentId?: string;
|
|
2404
|
+
tileIndex?: number;
|
|
2405
|
+
error?: unknown;
|
|
2406
|
+
};
|
|
2407
|
+
//#endregion
|
|
2408
|
+
//#region src/modules/react-reconciler/components/DevTools.d.ts
|
|
2409
|
+
declare const DevTools: React.FC<DevToolsProps>;
|
|
2410
|
+
type DevToolsProps = {
|
|
2411
|
+
initialOpen?: boolean;
|
|
2412
|
+
bottom?: number;
|
|
2413
|
+
right?: number;
|
|
2414
|
+
zIndex?: number;
|
|
2415
|
+
maxEvents?: number;
|
|
2416
|
+
maxRuntimeEvents?: number;
|
|
2417
|
+
runtimeId?: string;
|
|
2418
|
+
className?: string;
|
|
2419
|
+
style?: CSSProperties;
|
|
2420
|
+
};
|
|
2421
|
+
//#endregion
|
|
1729
2422
|
//#region src/modules/react-reconciler/presets/_types.d.ts
|
|
1730
2423
|
type Preset = {
|
|
1731
2424
|
name: string;
|
|
@@ -1736,6 +2429,7 @@ type Preset = {
|
|
|
1736
2429
|
ready?: boolean;
|
|
1737
2430
|
unmount(): void;
|
|
1738
2431
|
canvas?: HTMLCanvasElement;
|
|
2432
|
+
parityCanvas?: HTMLCanvasElement;
|
|
1739
2433
|
overlay?: HTMLDivElement;
|
|
1740
2434
|
container?: HTMLDivElement;
|
|
1741
2435
|
navigator?: HTMLCanvasElement;
|
|
@@ -1743,44 +2437,63 @@ type Preset = {
|
|
|
1743
2437
|
type PresetArgs = {
|
|
1744
2438
|
viewport: Viewer;
|
|
1745
2439
|
forceRefresh: () => void;
|
|
2440
|
+
controllerConfig?: any;
|
|
2441
|
+
interactionMode?: 'popmotion' | 'pdf-scroll-zone';
|
|
1746
2442
|
runtimeOptions?: RuntimeOptions;
|
|
1747
2443
|
containerElement?: HTMLDivElement;
|
|
1748
2444
|
canvasElement?: HTMLCanvasElement;
|
|
2445
|
+
parityCanvasElement?: HTMLCanvasElement;
|
|
1749
2446
|
overlayElement?: HTMLDivElement;
|
|
1750
2447
|
navigatorElement?: HTMLCanvasElement;
|
|
2448
|
+
onWebGLFallback?: (event: AtlasWebGLFallbackEvent) => void;
|
|
2449
|
+
onImageError?: (event: AtlasImageLoadErrorEvent) => void;
|
|
2450
|
+
imageLoading?: Partial<ImageLoadingConfig>;
|
|
2451
|
+
webglFallbackOnImageLoadError?: boolean;
|
|
2452
|
+
webglReadiness?: 'first-meaningful-paint' | 'immediate';
|
|
1751
2453
|
};
|
|
1752
2454
|
//#endregion
|
|
1753
2455
|
//#region src/modules/react-reconciler/presets/default-preset.d.ts
|
|
1754
2456
|
type DefaultPresetName = 'default-preset';
|
|
1755
2457
|
type DefaultPresetOptions = {
|
|
1756
2458
|
controllerConfig?: any;
|
|
2459
|
+
interactionMode?: 'popmotion' | 'pdf-scroll-zone';
|
|
1757
2460
|
unstable_webglRenderer?: boolean;
|
|
1758
2461
|
interactive?: boolean;
|
|
1759
2462
|
dpi?: number;
|
|
1760
2463
|
debug?: boolean;
|
|
1761
2464
|
canvasBox?: boolean;
|
|
1762
2465
|
polygon?: boolean;
|
|
2466
|
+
navigatorRendererOptions?: NavigatorRendererOptions;
|
|
1763
2467
|
};
|
|
1764
2468
|
declare function defaultPreset({
|
|
1765
2469
|
interactive,
|
|
1766
2470
|
viewport,
|
|
1767
2471
|
forceRefresh,
|
|
1768
2472
|
canvasElement,
|
|
2473
|
+
parityCanvasElement,
|
|
1769
2474
|
overlayElement,
|
|
1770
2475
|
controllerConfig,
|
|
2476
|
+
interactionMode,
|
|
1771
2477
|
unstable_webglRenderer,
|
|
1772
2478
|
dpi,
|
|
1773
2479
|
debug,
|
|
1774
2480
|
canvasBox,
|
|
1775
2481
|
polygon,
|
|
1776
2482
|
navigatorElement,
|
|
1777
|
-
runtimeOptions
|
|
2483
|
+
runtimeOptions,
|
|
2484
|
+
onWebGLFallback,
|
|
2485
|
+
onImageError,
|
|
2486
|
+
imageLoading,
|
|
2487
|
+
webglFallbackOnImageLoadError,
|
|
2488
|
+
webglReadiness,
|
|
2489
|
+
navigatorRendererOptions
|
|
1778
2490
|
}: PresetArgs & DefaultPresetOptions): Preset;
|
|
1779
2491
|
//#endregion
|
|
1780
2492
|
//#region src/modules/react-reconciler/presets/static-preset.d.ts
|
|
1781
2493
|
type StaticPresetName = 'static-preset';
|
|
1782
2494
|
type StaticPresetOptions = {
|
|
1783
2495
|
controllerConfig?: any;
|
|
2496
|
+
interactionMode?: 'popmotion' | 'pdf-scroll-zone';
|
|
1784
2497
|
interactive?: boolean;
|
|
1785
2498
|
};
|
|
1786
2499
|
declare function staticPreset({
|
|
@@ -1789,7 +2502,8 @@ declare function staticPreset({
|
|
|
1789
2502
|
forceRefresh,
|
|
1790
2503
|
containerElement,
|
|
1791
2504
|
overlayElement,
|
|
1792
|
-
controllerConfig
|
|
2505
|
+
controllerConfig,
|
|
2506
|
+
interactionMode
|
|
1793
2507
|
}: PresetArgs & StaticPresetOptions): Preset;
|
|
1794
2508
|
//#endregion
|
|
1795
2509
|
//#region src/modules/react-reconciler/presets/index.d.ts
|
|
@@ -1804,11 +2518,19 @@ type AtlasProps = {
|
|
|
1804
2518
|
onCreated?: (ctx: Preset) => void | Promise<void>;
|
|
1805
2519
|
resetWorldOnChange?: boolean;
|
|
1806
2520
|
unstable_webglRenderer?: boolean;
|
|
2521
|
+
onWebGLFallback?: (event: AtlasWebGLFallbackEvent) => void;
|
|
2522
|
+
onReady?: (event: AtlasReadyEvent) => void;
|
|
2523
|
+
onImageError?: (event: AtlasImageLoadErrorEvent) => void;
|
|
2524
|
+
readyResetKey?: string | number;
|
|
2525
|
+
webglFallbackOnImageLoadError?: boolean;
|
|
2526
|
+
webglReadiness?: 'first-meaningful-paint' | 'immediate';
|
|
2527
|
+
imageLoading?: Partial<ImageLoadingConfig>;
|
|
1807
2528
|
unstable_noReconciler?: boolean;
|
|
1808
2529
|
overlayStyle?: any;
|
|
1809
2530
|
containerStyle?: any;
|
|
1810
2531
|
containerProps?: any;
|
|
1811
|
-
controllerConfig?: PopmotionControllerConfig;
|
|
2532
|
+
controllerConfig?: PopmotionControllerConfig | PdfScrollZoneControllerConfig;
|
|
2533
|
+
interactionMode?: 'popmotion' | 'pdf-scroll-zone';
|
|
1812
2534
|
renderPreset?: PresetNames | Presets;
|
|
1813
2535
|
hideInlineStyle?: boolean;
|
|
1814
2536
|
homeCover?: true | false | 'start' | 'end';
|
|
@@ -1827,8 +2549,19 @@ type AtlasProps = {
|
|
|
1827
2549
|
className?: string;
|
|
1828
2550
|
background?: string;
|
|
1829
2551
|
enableNavigator?: boolean;
|
|
2552
|
+
navigatorOptions?: {
|
|
2553
|
+
width?: number;
|
|
2554
|
+
idleFade?: boolean;
|
|
2555
|
+
idleMs?: number;
|
|
2556
|
+
fadeDurationMs?: number;
|
|
2557
|
+
opacityActive?: number;
|
|
2558
|
+
opacityIdle?: number;
|
|
2559
|
+
style?: Partial<NavigatorRendererStyle>;
|
|
2560
|
+
pdfScrollZoneZoneWindow?: NavigatorZoneWindowOptions;
|
|
2561
|
+
};
|
|
1830
2562
|
htmlChildren?: ReactNode;
|
|
1831
2563
|
children: ReactNode;
|
|
2564
|
+
devTools?: boolean | DevToolsProps;
|
|
1832
2565
|
runtimeOptions?: Partial<RuntimeOptions>;
|
|
1833
2566
|
filters?: Partial<ViewerFilters>;
|
|
1834
2567
|
};
|
|
@@ -1837,52 +2570,211 @@ declare const Atlas: React.FC<AtlasProps & {
|
|
|
1837
2570
|
height: number;
|
|
1838
2571
|
}>;
|
|
1839
2572
|
//#endregion
|
|
1840
|
-
//#region src/modules/react-reconciler/
|
|
1841
|
-
declare
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
2573
|
+
//#region src/modules/react-reconciler/components/AtlasAuto.d.ts
|
|
2574
|
+
declare const AtlasAuto: React.FC<AtlasProps & {
|
|
2575
|
+
height?: number | string;
|
|
2576
|
+
width?: number | string;
|
|
2577
|
+
resizeHash?: number;
|
|
2578
|
+
containerProps?: any;
|
|
2579
|
+
aspectRatio?: number;
|
|
2580
|
+
}>;
|
|
2581
|
+
//#endregion
|
|
2582
|
+
//#region src/modules/react-reconciler/components/AtlasContext.d.ts
|
|
2583
|
+
declare const AtlasContext: React.Context<Preset | null>;
|
|
2584
|
+
declare const BoundsContext: React.Context<RectReadOnly | null>;
|
|
2585
|
+
//#endregion
|
|
2586
|
+
//#region src/modules/react-reconciler/components/BoxDraw.d.ts
|
|
2587
|
+
declare const DrawBox: React.FC<{
|
|
2588
|
+
children?: ReactNode;
|
|
2589
|
+
onCreate: (bounds: {
|
|
2590
|
+
x: number;
|
|
2591
|
+
y: number;
|
|
2592
|
+
width: number;
|
|
2593
|
+
height: number;
|
|
2594
|
+
}) => void;
|
|
2595
|
+
}>;
|
|
2596
|
+
//#endregion
|
|
2597
|
+
//#region src/modules/react-reconciler/components/HTMLPortal.d.ts
|
|
2598
|
+
declare const HTMLPortal: React.FC<{
|
|
2599
|
+
children?: ReactNode;
|
|
2600
|
+
backgroundColor?: string;
|
|
2601
|
+
interactive?: boolean;
|
|
2602
|
+
relative?: boolean;
|
|
2603
|
+
target?: {
|
|
2604
|
+
x: number;
|
|
2605
|
+
y: number;
|
|
2606
|
+
width: number;
|
|
2607
|
+
height: number;
|
|
2608
|
+
};
|
|
2609
|
+
} & React.RefAttributes<Box>>;
|
|
2610
|
+
//#endregion
|
|
2611
|
+
//#region src/modules/react-reconciler/components/ImageService.d.ts
|
|
2612
|
+
declare const ImageService: React.FC<{
|
|
2613
|
+
id: string;
|
|
2614
|
+
width: number;
|
|
2615
|
+
height: number;
|
|
2616
|
+
x?: number;
|
|
2617
|
+
y?: number;
|
|
2618
|
+
rotation?: number;
|
|
2619
|
+
scale?: number;
|
|
2620
|
+
children?: ReactNode;
|
|
2621
|
+
crop?: any;
|
|
2622
|
+
enableSizes?: boolean;
|
|
2623
|
+
enableThumbnail?: boolean;
|
|
2624
|
+
renderOptions?: CompositeResourceProps;
|
|
2625
|
+
}>;
|
|
2626
|
+
//#endregion
|
|
2627
|
+
//#region src/objects/geometry.d.ts
|
|
2628
|
+
type GeometryProps = {
|
|
2629
|
+
id: string;
|
|
2630
|
+
target: {
|
|
2631
|
+
x: number;
|
|
2632
|
+
y: number;
|
|
2633
|
+
width: number;
|
|
2634
|
+
height: number;
|
|
2635
|
+
};
|
|
2636
|
+
open?: boolean;
|
|
2637
|
+
points: [number, number][];
|
|
2638
|
+
className?: string;
|
|
2639
|
+
href?: string;
|
|
2640
|
+
title?: string;
|
|
2641
|
+
hrefTarget?: string;
|
|
2642
|
+
interactive?: boolean;
|
|
2643
|
+
relativeSize?: boolean;
|
|
2644
|
+
relativeStyle?: boolean;
|
|
2645
|
+
html?: boolean;
|
|
2646
|
+
style?: GeometryStyle;
|
|
2647
|
+
backgroundColor?: string;
|
|
2648
|
+
border?: string;
|
|
2649
|
+
};
|
|
2650
|
+
type GeometryStyle = _GeometryStyle & {
|
|
2651
|
+
':hover'?: _GeometryStyle;
|
|
2652
|
+
':active'?: _GeometryStyle;
|
|
1847
2653
|
};
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
2654
|
+
type _GeometryStyle = Partial<{
|
|
2655
|
+
backgroundColor: string;
|
|
2656
|
+
opacity: number;
|
|
2657
|
+
boxShadow: string;
|
|
2658
|
+
borderColor: string;
|
|
2659
|
+
borderWidth: string;
|
|
2660
|
+
borderStyle: string;
|
|
2661
|
+
outlineColor: string;
|
|
2662
|
+
outlineWidth: string;
|
|
2663
|
+
outlineOffset: string;
|
|
2664
|
+
outlineStyle: string;
|
|
2665
|
+
border: string;
|
|
2666
|
+
outline: string;
|
|
2667
|
+
background: string;
|
|
1856
2668
|
}>;
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
onCreate: (bounds: {
|
|
2669
|
+
declare class Geometry extends BaseObject<GeometryProps> implements SpacialContent {
|
|
2670
|
+
id: string;
|
|
2671
|
+
type: 'spacial-content';
|
|
2672
|
+
isShape: boolean;
|
|
2673
|
+
points: Strand;
|
|
2674
|
+
hoverEvents: boolean;
|
|
2675
|
+
activeEvents: boolean;
|
|
2676
|
+
display: {
|
|
1866
2677
|
x: number;
|
|
1867
2678
|
y: number;
|
|
2679
|
+
scale: number;
|
|
1868
2680
|
width: number;
|
|
1869
2681
|
height: number;
|
|
1870
|
-
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
//#region src/modules/react-reconciler/components/HTMLPortal.d.ts
|
|
1874
|
-
declare const HTMLPortal: React.FC<{
|
|
1875
|
-
children?: ReactNode;
|
|
1876
|
-
backgroundColor?: string;
|
|
1877
|
-
interactive?: boolean;
|
|
1878
|
-
relative?: boolean;
|
|
1879
|
-
target?: {
|
|
2682
|
+
points: Strand;
|
|
2683
|
+
};
|
|
2684
|
+
boundingBox: {
|
|
1880
2685
|
x: number;
|
|
1881
2686
|
y: number;
|
|
1882
2687
|
width: number;
|
|
1883
2688
|
height: number;
|
|
2689
|
+
} | null;
|
|
2690
|
+
_parsed: {
|
|
2691
|
+
border: {
|
|
2692
|
+
id: string | null;
|
|
2693
|
+
match: string[];
|
|
2694
|
+
};
|
|
2695
|
+
outline: {
|
|
2696
|
+
id: string | null;
|
|
2697
|
+
match: string[];
|
|
2698
|
+
};
|
|
1884
2699
|
};
|
|
1885
|
-
|
|
2700
|
+
hovering?: boolean;
|
|
2701
|
+
pressing?: boolean;
|
|
2702
|
+
props: {
|
|
2703
|
+
href?: string;
|
|
2704
|
+
hrefTarget?: string;
|
|
2705
|
+
title?: string;
|
|
2706
|
+
backgroundColor?: string;
|
|
2707
|
+
border?: string;
|
|
2708
|
+
interactive?: boolean;
|
|
2709
|
+
open?: boolean;
|
|
2710
|
+
className?: string;
|
|
2711
|
+
relativeSize?: boolean;
|
|
2712
|
+
relativeStyle?: boolean;
|
|
2713
|
+
html?: boolean;
|
|
2714
|
+
style?: GeometryStyle;
|
|
2715
|
+
hoverStyles?: GeometryStyle;
|
|
2716
|
+
pressStyles?: GeometryStyle;
|
|
2717
|
+
};
|
|
2718
|
+
shape: {
|
|
2719
|
+
type: 'none';
|
|
2720
|
+
} | {
|
|
2721
|
+
type: 'polygon';
|
|
2722
|
+
points: [number, number][];
|
|
2723
|
+
open?: boolean;
|
|
2724
|
+
};
|
|
2725
|
+
constructor();
|
|
2726
|
+
updateBoundingBox(): void;
|
|
2727
|
+
intersects(pointer?: [number, number] | null): boolean;
|
|
2728
|
+
getAllPointsAt(target: Strand, aggregate: Strand): Paint[];
|
|
2729
|
+
addHover: () => void;
|
|
2730
|
+
removeHover: () => void;
|
|
2731
|
+
addPress: () => void;
|
|
2732
|
+
removePress: () => void;
|
|
2733
|
+
applyProps(props?: Partial<GeometryProps>): void;
|
|
2734
|
+
}
|
|
2735
|
+
//#endregion
|
|
2736
|
+
//#region src/modules/react-reconciler/components/MapGeoJSON.d.ts
|
|
2737
|
+
type MapGeoJSONProps = {
|
|
2738
|
+
data: MapGeoJSONInput;
|
|
2739
|
+
markerSize?: number;
|
|
2740
|
+
markerStyle?: BoxStyle;
|
|
2741
|
+
lineStyle?: GeometryStyle;
|
|
2742
|
+
polygonStyle?: GeometryStyle;
|
|
2743
|
+
interactive?: boolean;
|
|
2744
|
+
};
|
|
2745
|
+
declare const MapGeoJSON: React.FC<MapGeoJSONProps>;
|
|
2746
|
+
//#endregion
|
|
2747
|
+
//#region src/modules/react-reconciler/components/MapObject.d.ts
|
|
2748
|
+
type MapObjectProps = {
|
|
2749
|
+
id?: string;
|
|
2750
|
+
bounds: MapBounds;
|
|
2751
|
+
x?: number;
|
|
2752
|
+
y?: number;
|
|
2753
|
+
width: number;
|
|
2754
|
+
height: number;
|
|
2755
|
+
preserveAspectRatio?: boolean;
|
|
2756
|
+
scale?: number;
|
|
2757
|
+
rotation?: number;
|
|
2758
|
+
children?: React.ReactNode;
|
|
2759
|
+
};
|
|
2760
|
+
declare const MapObject: React.FC<MapObjectProps>;
|
|
2761
|
+
//#endregion
|
|
2762
|
+
//#region src/modules/react-reconciler/components/MapTileLayer.d.ts
|
|
2763
|
+
type MapTileLayerProps = {
|
|
2764
|
+
id?: string;
|
|
2765
|
+
tileUrlTemplate?: string;
|
|
2766
|
+
tileSource?: MapTileSource;
|
|
2767
|
+
subdomains?: string[];
|
|
2768
|
+
tileSize?: number;
|
|
2769
|
+
minZoom?: number;
|
|
2770
|
+
maxZoom?: number;
|
|
2771
|
+
maxQualityLevels?: number;
|
|
2772
|
+
maxTilesPerLayer?: number;
|
|
2773
|
+
maxTotalTiles?: number;
|
|
2774
|
+
useDevicePixelRatio?: boolean;
|
|
2775
|
+
renderOptions?: CompositeResourceProps;
|
|
2776
|
+
};
|
|
2777
|
+
declare const MapTileLayer: React.FC<MapTileLayerProps>;
|
|
1886
2778
|
//#endregion
|
|
1887
2779
|
//#region src/modules/react-reconciler/components/RegionHighlight.d.ts
|
|
1888
2780
|
type RegionHighlightType = {
|
|
@@ -1958,22 +2850,6 @@ declare const TileSet: React.FC<{
|
|
|
1958
2850
|
renderOptions?: CompositeResourceProps;
|
|
1959
2851
|
}>;
|
|
1960
2852
|
//#endregion
|
|
1961
|
-
//#region src/modules/react-reconciler/components/ImageService.d.ts
|
|
1962
|
-
declare const ImageService: React.FC<{
|
|
1963
|
-
id: string;
|
|
1964
|
-
width: number;
|
|
1965
|
-
height: number;
|
|
1966
|
-
x?: number;
|
|
1967
|
-
y?: number;
|
|
1968
|
-
rotation?: number;
|
|
1969
|
-
scale?: number;
|
|
1970
|
-
children?: ReactNode;
|
|
1971
|
-
crop?: any;
|
|
1972
|
-
enableSizes?: boolean;
|
|
1973
|
-
enableThumbnail?: boolean;
|
|
1974
|
-
renderOptions?: CompositeResourceProps;
|
|
1975
|
-
}>;
|
|
1976
|
-
//#endregion
|
|
1977
2853
|
//#region src/modules/react-reconciler/hooks/use-after-frame.d.ts
|
|
1978
2854
|
declare const useAfterFrame: (callback: (time: number) => void, deps?: any[]) => void;
|
|
1979
2855
|
//#endregion
|
|
@@ -2041,6 +2917,51 @@ declare const useControlledAnnotationList: (initialList?: Array<{
|
|
|
2041
2917
|
//#region src/modules/react-reconciler/hooks/use-frame.d.ts
|
|
2042
2918
|
declare const useFrame: (callback: (time: number) => void, deps?: any[]) => void;
|
|
2043
2919
|
//#endregion
|
|
2920
|
+
//#region src/modules/react-reconciler/hooks/use-map-geojson.d.ts
|
|
2921
|
+
type ProjectedMapGeoJSONShape = {
|
|
2922
|
+
kind: 'shape';
|
|
2923
|
+
open: boolean;
|
|
2924
|
+
points: Array<[number, number]>;
|
|
2925
|
+
key: string;
|
|
2926
|
+
feature?: MapGeoJSONFeature;
|
|
2927
|
+
};
|
|
2928
|
+
type ProjectedMapGeoJSONPoint = {
|
|
2929
|
+
kind: 'point';
|
|
2930
|
+
x: number;
|
|
2931
|
+
y: number;
|
|
2932
|
+
key: string;
|
|
2933
|
+
feature?: MapGeoJSONFeature;
|
|
2934
|
+
};
|
|
2935
|
+
type ProjectedMapGeoJSONItem = ProjectedMapGeoJSONShape | ProjectedMapGeoJSONPoint;
|
|
2936
|
+
declare function projectMapGeoJSON(input: MapGeoJSONInput | null | undefined, projection: {
|
|
2937
|
+
projectRing: (ring: Array<[number, number]>) => Array<[number, number]>;
|
|
2938
|
+
lngLatToWorld: (lng: number, lat: number) => {
|
|
2939
|
+
x: number;
|
|
2940
|
+
y: number;
|
|
2941
|
+
};
|
|
2942
|
+
}): ProjectedMapGeoJSONItem[];
|
|
2943
|
+
type MapGeoJSONProjector = {
|
|
2944
|
+
project: (input: MapGeoJSONInput | null | undefined) => ProjectedMapGeoJSONItem[];
|
|
2945
|
+
};
|
|
2946
|
+
declare function useMapGeoJSON(): MapGeoJSONProjector;
|
|
2947
|
+
//#endregion
|
|
2948
|
+
//#region src/modules/react-reconciler/hooks/use-map-projection.d.ts
|
|
2949
|
+
type MapProjectionContextValue = {
|
|
2950
|
+
bounds: MapBounds;
|
|
2951
|
+
width: number;
|
|
2952
|
+
height: number;
|
|
2953
|
+
mapRect: {
|
|
2954
|
+
x: number;
|
|
2955
|
+
y: number;
|
|
2956
|
+
width: number;
|
|
2957
|
+
height: number;
|
|
2958
|
+
};
|
|
2959
|
+
projection: MapProjection;
|
|
2960
|
+
};
|
|
2961
|
+
declare const MapProjectionContext: react0.Context<MapProjectionContextValue | null>;
|
|
2962
|
+
declare function useMapProjectionContext(): MapProjectionContextValue;
|
|
2963
|
+
declare function useMapProjection(): MapProjection;
|
|
2964
|
+
//#endregion
|
|
2044
2965
|
//#region src/modules/react-reconciler/hooks/use-mode.d.ts
|
|
2045
2966
|
declare const ModeContext: React.Context<ViewerMode>;
|
|
2046
2967
|
declare const useMode: () => ViewerMode;
|
|
@@ -2076,10 +2997,17 @@ declare const useRuntime: () => Runtime | undefined;
|
|
|
2076
2997
|
//#region src/modules/react-reconciler/hooks/use-world-event.d.ts
|
|
2077
2998
|
declare const useWorldEvent: <Name$1 extends SupportedEventNames>(name: Name$1, cb: (e: any) => void, deps?: any[]) => void;
|
|
2078
2999
|
//#endregion
|
|
2079
|
-
//#region src/modules/react-reconciler/
|
|
2080
|
-
declare
|
|
2081
|
-
|
|
2082
|
-
|
|
3000
|
+
//#region src/modules/react-reconciler/hooks/use-zone-runtime-state.d.ts
|
|
3001
|
+
declare const useZoneRuntimeState: (zoneId: string) => RuntimeZoneState;
|
|
3002
|
+
//#endregion
|
|
3003
|
+
//#region src/modules/react-reconciler/reconciler.d.ts
|
|
3004
|
+
declare function applyProps(instance: any, oldProps: any, newProps: any): void;
|
|
3005
|
+
declare function activateEvents(world: World, props: any): void;
|
|
3006
|
+
declare function unmountComponentAtNode(runtime: Runtime, callback?: (runtime: any) => void): void;
|
|
3007
|
+
declare const ReactAtlas: {
|
|
3008
|
+
render(whatToRender: any, runtime: any): void;
|
|
3009
|
+
unmountComponentAtNode(runtime: Runtime, callback?: (runtime: any) => void): void;
|
|
3010
|
+
};
|
|
2083
3011
|
//#endregion
|
|
2084
3012
|
//#region src/clean-objects/traits/evented.d.ts
|
|
2085
3013
|
type AtlasEvent<BaseEvent extends Event> = BaseEvent & {
|
|
@@ -2133,6 +3061,11 @@ type BaseElement = {
|
|
|
2133
3061
|
priority?: boolean;
|
|
2134
3062
|
};
|
|
2135
3063
|
type AllEvents = EventListenerProps;
|
|
3064
|
+
type ZoneVisibilityProps = {
|
|
3065
|
+
onZoneVisible?: () => void;
|
|
3066
|
+
onZoneHidden?: () => void;
|
|
3067
|
+
onZoneVisibilityChange?: (visible: boolean) => void;
|
|
3068
|
+
};
|
|
2136
3069
|
declare global {
|
|
2137
3070
|
namespace JSX {
|
|
2138
3071
|
interface IntrinsicElements {
|
|
@@ -2158,6 +3091,15 @@ declare global {
|
|
|
2158
3091
|
y?: number;
|
|
2159
3092
|
rotation?: number;
|
|
2160
3093
|
} & AllEvents;
|
|
3094
|
+
zone: BaseElement & {
|
|
3095
|
+
id: string;
|
|
3096
|
+
x: number;
|
|
3097
|
+
y: number;
|
|
3098
|
+
width: number;
|
|
3099
|
+
height: number;
|
|
3100
|
+
margin?: number;
|
|
3101
|
+
children?: React.ReactNode;
|
|
3102
|
+
} & ZoneVisibilityProps;
|
|
2161
3103
|
worldImage: BaseElement & {
|
|
2162
3104
|
uri: string;
|
|
2163
3105
|
target: any;
|
|
@@ -2215,6 +3157,28 @@ declare global {
|
|
|
2215
3157
|
crop: any;
|
|
2216
3158
|
version3?: boolean;
|
|
2217
3159
|
} & AllEvents;
|
|
3160
|
+
mapTiledImage: BaseElement & {
|
|
3161
|
+
bounds: MapBounds;
|
|
3162
|
+
worldWidth: number;
|
|
3163
|
+
worldHeight: number;
|
|
3164
|
+
zoom: number;
|
|
3165
|
+
tileSize?: number;
|
|
3166
|
+
scaleFactor?: number;
|
|
3167
|
+
tileSource?: MapTileSource;
|
|
3168
|
+
tileUrlTemplate?: string;
|
|
3169
|
+
subdomains?: string[];
|
|
3170
|
+
} & AllEvents;
|
|
3171
|
+
['map-tiled-image']: BaseElement & {
|
|
3172
|
+
bounds: MapBounds;
|
|
3173
|
+
worldWidth: number;
|
|
3174
|
+
worldHeight: number;
|
|
3175
|
+
zoom: number;
|
|
3176
|
+
tileSize?: number;
|
|
3177
|
+
scaleFactor?: number;
|
|
3178
|
+
tileSource?: MapTileSource;
|
|
3179
|
+
tileUrlTemplate?: string;
|
|
3180
|
+
subdomains?: string[];
|
|
3181
|
+
} & AllEvents;
|
|
2218
3182
|
box: BaseElement & {
|
|
2219
3183
|
interactive?: boolean;
|
|
2220
3184
|
backgroundColor?: string;
|
|
@@ -2254,75 +3218,10 @@ declare global {
|
|
|
2254
3218
|
}
|
|
2255
3219
|
}
|
|
2256
3220
|
//#endregion
|
|
2257
|
-
//#region src/modules/
|
|
2258
|
-
declare function
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
declare function getTiles(manifestId: string): Promise<Array<GetTile>>;
|
|
2262
|
-
//#endregion
|
|
2263
|
-
//#region src/utility/stylesheet.d.ts
|
|
2264
|
-
declare class Stylesheet {
|
|
2265
|
-
$element: HTMLStyleElement;
|
|
2266
|
-
stylesheetClasses: string[];
|
|
2267
|
-
activeStylesheetClasses: string[];
|
|
2268
|
-
sheetsDidUpdate: boolean;
|
|
2269
|
-
sheetPrefix: string;
|
|
2270
|
-
stylesheetEntries: Record<string, string>;
|
|
2271
|
-
constructor(options?: {
|
|
2272
|
-
sheetPrefix?: string;
|
|
2273
|
-
});
|
|
2274
|
-
getElement(): HTMLStyleElement;
|
|
2275
|
-
addStylesheet(_sheet: string): string;
|
|
2276
|
-
removeStylesheet(obj: any): void;
|
|
2277
|
-
clearClasses(): void;
|
|
2278
|
-
didUpdateActive(): boolean;
|
|
2279
|
-
updateSheet(): void;
|
|
2280
|
-
}
|
|
2281
|
-
//#endregion
|
|
2282
|
-
//#region src/modules/overlay-renderer/overlay-renderer.d.ts
|
|
2283
|
-
type OverlayRendererOptions = {
|
|
2284
|
-
sheetPrefix: string;
|
|
2285
|
-
box: boolean;
|
|
2286
|
-
text: boolean;
|
|
2287
|
-
inlineStyles: boolean;
|
|
2288
|
-
triggerResize: () => void;
|
|
2289
|
-
background: string;
|
|
2290
|
-
};
|
|
2291
|
-
declare class OverlayRenderer implements Renderer {
|
|
2292
|
-
htmlContainer: HTMLDivElement;
|
|
2293
|
-
visible: Array<Text | Box | SpacialContent>;
|
|
2294
|
-
previousVisible: Array<Text | Box | SpacialContent>;
|
|
2295
|
-
htmlIds: string[];
|
|
2296
|
-
firstMeaningfulPaint: boolean;
|
|
2297
|
-
rendererPosition: DOMRect;
|
|
2298
|
-
stylesheet: Stylesheet;
|
|
2299
|
-
options: OverlayRendererOptions;
|
|
2300
|
-
paintTx: number;
|
|
2301
|
-
zIndex: number;
|
|
2302
|
-
classes: {
|
|
2303
|
-
hostClassName: string;
|
|
2304
|
-
interactive: string;
|
|
2305
|
-
nonInteractive: string;
|
|
2306
|
-
};
|
|
2307
|
-
constructor(htmlContainer: HTMLDivElement, options?: Partial<OverlayRendererOptions>);
|
|
2308
|
-
createHtmlHost(paint: Text | Box): void;
|
|
2309
|
-
triggerResize(): void;
|
|
2310
|
-
updateHtmlHost(paint: Text | Box, width?: number, height?: number): void;
|
|
2311
|
-
afterFrame(world: World, delta: number, target: Strand): void;
|
|
2312
|
-
afterPaintLayer(paint: SpacialContent, transform?: Strand): void;
|
|
2313
|
-
beforeFrame(world: World, delta: number, target: Strand): void;
|
|
2314
|
-
getPointsAt(world: World, target: Strand, aggregate: Strand, scaleFactor: number): Paint[];
|
|
2315
|
-
getScale(width: number, height: number): number;
|
|
2316
|
-
getViewportBounds(world: World, target: Strand, padding: number): PositionPair | null;
|
|
2317
|
-
isReady(): boolean;
|
|
2318
|
-
paint(paint: SpacialContent, index: number, x: number, y: number, width: number, height: number): void;
|
|
2319
|
-
pendingUpdate(): boolean;
|
|
2320
|
-
prepareLayer(paint: SpacialContent): void;
|
|
2321
|
-
resize(width?: number, height?: number): void;
|
|
2322
|
-
getRendererScreenPosition(): DOMRect;
|
|
2323
|
-
finishLayer(): void;
|
|
2324
|
-
reset(): void;
|
|
2325
|
-
}
|
|
3221
|
+
//#region src/modules/react-reconciler/utility/can-drag.d.ts
|
|
3222
|
+
declare function canDrag(ref: {
|
|
3223
|
+
current: ViewerMode;
|
|
3224
|
+
}): boolean;
|
|
2326
3225
|
//#endregion
|
|
2327
3226
|
//#region src/modules/static-renderer/static-renderer.d.ts
|
|
2328
3227
|
type StaticRendererOptions = {
|
|
@@ -2366,10 +3265,44 @@ declare class StaticRenderer implements Renderer {
|
|
|
2366
3265
|
//#region src/modules/webgl-renderer/webgl-renderer.d.ts
|
|
2367
3266
|
type WebGLRendererOptions = {
|
|
2368
3267
|
dpi?: number;
|
|
3268
|
+
onFatalImageError?: (event: AtlasWebGLFallbackEvent) => void;
|
|
3269
|
+
onImageError?: (event: AtlasImageLoadErrorEvent) => void;
|
|
3270
|
+
imageLoading?: Partial<ImageLoadingConfig>;
|
|
3271
|
+
fallbackOnImageLoadError?: boolean;
|
|
3272
|
+
readiness?: 'first-meaningful-paint' | 'immediate';
|
|
3273
|
+
};
|
|
3274
|
+
type WebGLTileRequest = {
|
|
3275
|
+
key: string;
|
|
3276
|
+
tileKey: string;
|
|
3277
|
+
requestKey: string;
|
|
3278
|
+
paint: SingleImage | TiledImage;
|
|
3279
|
+
index: number;
|
|
3280
|
+
url: string;
|
|
3281
|
+
priority: number;
|
|
3282
|
+
scale: number;
|
|
3283
|
+
prefetch: boolean;
|
|
3284
|
+
};
|
|
3285
|
+
type InFlightTileLoad = {
|
|
3286
|
+
tileKey: string;
|
|
3287
|
+
requestKey: string;
|
|
3288
|
+
consumerId: string;
|
|
3289
|
+
paint: SingleImage | TiledImage;
|
|
3290
|
+
index: number;
|
|
3291
|
+
release: (opts?: {
|
|
3292
|
+
silent?: boolean;
|
|
3293
|
+
}) => void;
|
|
3294
|
+
};
|
|
3295
|
+
type ScissorRect = {
|
|
3296
|
+
x: number;
|
|
3297
|
+
y: number;
|
|
3298
|
+
width: number;
|
|
3299
|
+
height: number;
|
|
2369
3300
|
};
|
|
2370
3301
|
declare class WebGLRenderer implements Renderer {
|
|
2371
3302
|
canvas: HTMLCanvasElement;
|
|
2372
3303
|
gl: WebGL2RenderingContext;
|
|
3304
|
+
options: WebGLRendererOptions;
|
|
3305
|
+
fatalImageError?: AtlasWebGLFallbackEvent;
|
|
2373
3306
|
program: WebGLProgram;
|
|
2374
3307
|
fragmentShader: WebGLShader;
|
|
2375
3308
|
vertexShader: WebGLShader;
|
|
@@ -2383,6 +3316,7 @@ declare class WebGLRenderer implements Renderer {
|
|
|
2383
3316
|
uniforms: {
|
|
2384
3317
|
resolution: WebGLUniformLocation | null;
|
|
2385
3318
|
texture: WebGLUniformLocation | null;
|
|
3319
|
+
alpha: WebGLUniformLocation | null;
|
|
2386
3320
|
};
|
|
2387
3321
|
buffers: {
|
|
2388
3322
|
position: WebGLBuffer;
|
|
@@ -2390,14 +3324,67 @@ declare class WebGLRenderer implements Renderer {
|
|
|
2390
3324
|
};
|
|
2391
3325
|
rendererPosition: DOMRect;
|
|
2392
3326
|
dpi: number;
|
|
3327
|
+
maxConcurrentTasks: number;
|
|
3328
|
+
maxPrefetchPerFrame: number;
|
|
3329
|
+
imageLoadingConfig: ImageLoadingConfig;
|
|
3330
|
+
imageRequestPool: ImageRequestPool;
|
|
3331
|
+
framePrefetchCount: number;
|
|
3332
|
+
loadingCount: number;
|
|
3333
|
+
hasTilesFading: boolean;
|
|
3334
|
+
firstMeaningfulPaint: boolean;
|
|
3335
|
+
frameSawFastPathCandidate: boolean;
|
|
3336
|
+
requiresRepaint: boolean;
|
|
3337
|
+
tileRequestQueue: WebGLTileRequest[];
|
|
3338
|
+
queuedTileRequestKeys: Set<string>;
|
|
3339
|
+
inFlightImageLoads: Map<string, InFlightTileLoad>;
|
|
3340
|
+
requiredTileKeys: Set<string>;
|
|
3341
|
+
requiredPrefetchTileKeys: Set<string>;
|
|
3342
|
+
requestGeneration: number;
|
|
3343
|
+
frameCounter: number;
|
|
3344
|
+
pendingTileReveals: Map<string, {
|
|
3345
|
+
paint: SingleImage | TiledImage;
|
|
3346
|
+
index: number;
|
|
3347
|
+
queuedFrame: number;
|
|
3348
|
+
}>;
|
|
3349
|
+
activeLayerScissorRect: ScissorRect | undefined;
|
|
3350
|
+
onContextLost: (event: Event) => void;
|
|
2393
3351
|
constructor(canvas: HTMLCanvasElement, options?: WebGLRendererOptions);
|
|
3352
|
+
private isImmediateReadiness;
|
|
3353
|
+
emitFatalImageError(event: Omit<AtlasWebGLFallbackEvent, 'from' | 'to'>): void;
|
|
2394
3354
|
resize(): void;
|
|
2395
3355
|
isReady(): boolean;
|
|
2396
|
-
beforeFrame(world: World, delta: number, target: Strand): void;
|
|
3356
|
+
beforeFrame(world: World, delta: number, target: Strand, options: HookOptions): void;
|
|
2397
3357
|
lastResize: number;
|
|
2398
|
-
|
|
3358
|
+
private getCompositeRenderOptions;
|
|
3359
|
+
private shouldClipLayerToBounds;
|
|
3360
|
+
private getBoundsFromPoints;
|
|
3361
|
+
private toScissorRect;
|
|
3362
|
+
prepareLayer(paint: SpacialContent, points?: Strand): void;
|
|
2399
3363
|
createTextureHost(paint: ImageTexture | Box): void;
|
|
2400
3364
|
createImageHost(paint: SingleImage | TiledImage): void;
|
|
3365
|
+
removeLoadingIndex(paint: SpacialContent, index: number): void;
|
|
3366
|
+
private getTileKey;
|
|
3367
|
+
private nextRequestKey;
|
|
3368
|
+
private getTileState;
|
|
3369
|
+
private setTileState;
|
|
3370
|
+
private markTileRequired;
|
|
3371
|
+
private isTileRequired;
|
|
3372
|
+
private shouldSkipFade;
|
|
3373
|
+
private enqueueTileReveal;
|
|
3374
|
+
private flushTileRevealBatch;
|
|
3375
|
+
private emitImageError;
|
|
3376
|
+
private releaseInFlightTileLoad;
|
|
3377
|
+
private pruneStaleTileWork;
|
|
3378
|
+
private getPrefetchRadius;
|
|
3379
|
+
private isLayerActive;
|
|
3380
|
+
private shouldDrawLayer;
|
|
3381
|
+
private getFadeAlpha;
|
|
3382
|
+
private getTileRequestKey;
|
|
3383
|
+
private getCompositeOwner;
|
|
3384
|
+
private compareCompositeLoadPriority;
|
|
3385
|
+
private enqueueTileRequest;
|
|
3386
|
+
private schedulePrefetchNeighbours;
|
|
3387
|
+
private processTileQueue;
|
|
2401
3388
|
paint(paint: SpacialContent, index: number, x: number, y: number, width: number, height: number): void;
|
|
2402
3389
|
afterPaintLayer(paint: SpacialContent, transform?: Strand): void;
|
|
2403
3390
|
pendingUpdate(): boolean;
|
|
@@ -2418,11 +3405,12 @@ declare class WebGLRenderer implements Renderer {
|
|
|
2418
3405
|
getRectangle(x: number, y: number, width: number, height: number): Float32Array<ArrayBufferLike>;
|
|
2419
3406
|
getRendererScreenPosition(): DOMRect;
|
|
2420
3407
|
finishLayer(): void;
|
|
3408
|
+
resetReadyState(): void;
|
|
2421
3409
|
reset(): void;
|
|
2422
3410
|
}
|
|
2423
3411
|
//#endregion
|
|
2424
3412
|
//#region src/utility/merge-styles.d.ts
|
|
2425
3413
|
declare function mergeStyles(defaultStyle?: BoxStyle, style?: BoxStyle): BoxStyle | undefined;
|
|
2426
3414
|
//#endregion
|
|
2427
|
-
export { AbstractObject, AbstractWorldObject, AllEvents, Atlas, AtlasAuto, AtlasContext, AtlasProps, BoundsContext, Box, BoxProps, BoxStyle, BrowserEventManager, BrowserEventManagerOptions, CanvasRenderer, CanvasRendererOptions, CompositeRenderer, CompositeResource, CompositeResourceProps, DebugRenderer, DefaultPresetName, DefaultPresetOptions, DisplayData, DrawBox, EasingFunction, EasingFunctionNames, Geometry, GeometryProps, GeometryStyle, GetTile, GridBuilder, HTMLPortal, HookOptions, ImageBuffer, ImageService, ImageTexture, ImageTextureProps, ModeContext, ModeProvider, OverlayRenderer, OverlayRendererOptions, Paint, Paintable, PointerEvents, PopmotionControllerConfig, Position, PositionPair, Preset, PresetArgs, PresetNames, Presets, Projection, ReactAtlas, RegionHighlight, RegionHighlightProps, Renderer, ResizeWorldItem, Runtime, RuntimeController, RuntimeHooks, RuntimeOptions, Scaled, SingleImage, SpacialContent, SpacialSize, StaticPresetName, StaticPresetOptions, StaticRenderer, SupportedEventMap, SupportedEventNames, SupportedEvents, Text, TextProps, TextWrapperOptions, TileSet, TiledImage, UpdateTextureFunction, Viewer, ViewerFilters, ViewerMode, ViewingDirection, WebGLRenderer, WebGLRendererOptions, World, WorldObject, WorldTime, Zone, ZoneConfig, ZoneInterface, activateEvents, applyProps, bounceOut, canDrag, createDefaultEventMap, defaultConfig, defaultPreset, easingFunctions, fromImage, getId, getTileFromCanvas, getTileFromImageService, getTiles, getTilesFromManifest, mergeStyles, popmotionController, presets, staticPreset, supportedEventAttributes, supportedEventMap, unmountComponentAtNode, useAfterFrame, useAfterPaint, useAtlas, useAtlasImage, useBeforeFrame, useCanvas, useControlledAnnotationList, useFrame, useMode, useResizeWorldItem, useRuntime, useWorldEvent };
|
|
3415
|
+
export { AbstractObject, AbstractWorldObject, AllEvents, Atlas, AtlasAuto, AtlasContext, type AtlasImageLoadErrorEvent, AtlasImageLoadErrorSeverity, AtlasImageLoadRenderer, AtlasProps, AtlasReadyEvent, AtlasReadyRenderer, AtlasReadyResetReason, type AtlasWebGLFallbackEvent, type AtlasWebGLFallbackReason, BoundsContext, Box, BoxProps, BoxStyle, BrowserEventManager, BrowserEventManagerOptions, CanvasRenderer, CanvasRendererOptions, CompositeRenderer, CompositeResource, CompositeResourceProps, DEFAULT_OSM_TILE_TEMPLATE, DebugRenderer, DefaultPresetName, DefaultPresetOptions, DevTools, DevToolsProps, DevToolsTab, DisplayData, DrawBox, EasingFunction, EasingFunctionNames, GeoJSONLineString, GeoJSONMultiLineString, GeoJSONMultiPoint, GeoJSONMultiPolygon, GeoJSONPoint, GeoJSONPolygon, Geometry, GeometryProps, GeometryStyle, GetTile, GridBuilder, HTMLPortal, HookOptions, ImageBuffer, ImageLoadingConfig, ImageLoadingConfigOverrides, ImageService, ImageTexture, ImageTextureProps, LngLatPoint, MAX_MERCATOR_LATITUDE, MapBounds, MapGeoJSON, MapGeoJSONFeature, MapGeoJSONFeatureCollection, MapGeoJSONGeometry, MapGeoJSONInput, MapGeoJSONProjector, MapGeoJSONProps, MapObject, MapObjectProps, MapProjection, MapProjectionContext, MapProjectionContextValue, MapTileCoordinate, MapTileGrid, MapTileGridCoverage, MapTileLayer, MapTileLayerProps, MapTileSource, MapTileUrlContext, MapTiledImage, MapTiledImageProps, ModeContext, ModeProvider, NavigatorDebugEvent, NavigatorRenderer, NavigatorRendererOptions, NavigatorRendererStyle, NavigatorTransform, NavigatorWorldRegion, NavigatorWorldRegionOptions, NavigatorZoneWindowOptions, OverlayRenderer, OverlayRendererOptions, Paint, Paintable, PdfScrollZoneControllerConfig, PointerEvents, PopmotionControllerConfig, Position, PositionPair, Preset, PresetArgs, PresetNames, Presets, ProjectedMapGeoJSONItem, ProjectedMapGeoJSONPoint, ProjectedMapGeoJSONShape, Projection, ReactAtlas, RegionHighlight, RegionHighlightProps, Renderer, ResizeWorldItem, Runtime, RuntimeController, RuntimeDebugEvent, RuntimeFrameEndEvent, RuntimeFrameStartEvent, RuntimeHooks, RuntimeOptions, RuntimePaintEvent, RuntimeZoneState, Scaled, SingleImage, SpacialContent, SpacialSize, StaticPresetName, StaticPresetOptions, StaticRenderer, SupportedEventMap, SupportedEventNames, SupportedEvents, Text, TextProps, TextWrapperOptions, TileLoadingState, TileSet, TiledImage, UpdateTextureFunction, Viewer, ViewerFilters, ViewerMode, ViewingDirection, WarpAdapter, WarpAdapterController, WarpAdapterHooks, WarpControlPoint, WarpTransformationType, WarpUpdateReason, WebGLRenderer, WebGLRendererOptions, World, WorldDebugEvent, WorldObject, WorldPoint, WorldPointerDebugEvent, WorldRect, WorldTime, WorldTouchDebugEvent, WorldTriggerDebugEvent, Zone, ZoneConfig, ZoneInterface, ZoneResolvedConfig, activateEvents, applyProps, bounceOut, canDrag, clampMercatorLatitude, createDefaultEventMap, createFiniteTileGrid, createMapProjection, createWarpAdapterController, defaultConfig, defaultPreset, easingFunctions, estimateFiniteTileGridCoverage, fromImage, getId, getNavigatorVisibleZoneIdSet, getNavigatorWorldRegion, getNavigatorWorldTransform, getRetryDelayMs, getSubdomainForTile, getTileFromCanvas, getTileFromImageService, getTiles, getTilesFromManifest, latToTileY, latitudeToMercatorY, lngToTileX, longitudeToMercatorX, mercatorXToLongitude, mercatorYToLatitude, mergeStyles, navigatorToWorldPoint, pdfScrollZoneController, popmotionController, presets, projectMapGeoJSON, resolveImageLoadingConfig, resolveTileTemplate, resolveTileUrl, staticPreset, supportedEventAttributes, supportedEventMap, tileXToLng, tileYToLat, unmountComponentAtNode, useAfterFrame, useAfterPaint, useAtlas, useAtlasImage, useBeforeFrame, useCanvas, useControlledAnnotationList, useFrame, useMapGeoJSON, useMapProjection, useMapProjectionContext, useMode, useResizeWorldItem, useRuntime, useWorldEvent, useZoneRuntimeState, validateMapBounds };
|
|
2428
3416
|
//# sourceMappingURL=index.d.cts.map
|