@atlas-viewer/atlas 3.1.1 → 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 -712
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1724 -712
- 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.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Projection as Projection$1, Strand } from "@atlas-viewer/dna";
|
|
2
2
|
import * as react0 from "react";
|
|
3
|
-
import React, { ReactNode } from "react";
|
|
4
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
5
4
|
import { RectReadOnly } from "react-use-measure";
|
|
5
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
6
|
import { ImageService as ImageService$1, ViewingDirection as ViewingDirection$1 } from "@iiif/presentation-3";
|
|
7
7
|
import LRUCache from "lru-cache";
|
|
8
8
|
import { HookOptions as HookOptions$1 } from "src/standalone";
|
|
@@ -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;
|
|
345
|
+
};
|
|
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?: {
|
|
573
|
+
x: number;
|
|
574
|
+
y: number;
|
|
575
|
+
width: number;
|
|
576
|
+
height: number;
|
|
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;
|
|
220
613
|
};
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
layers: SupportedChildElements[];
|
|
225
|
-
time: WorldTime[];
|
|
226
|
-
_crop?: Strand;
|
|
227
|
-
cropData?: {
|
|
228
|
-
x: number;
|
|
229
|
-
y: number;
|
|
614
|
+
constructor(data?: {
|
|
615
|
+
id?: string;
|
|
616
|
+
uri: string;
|
|
230
617
|
width: number;
|
|
231
618
|
height: number;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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;
|
|
@@ -420,130 +921,49 @@ declare class World extends BaseObject<WorldProps, WorldObject> {
|
|
|
420
921
|
}): void;
|
|
421
922
|
zoomTo(factor: number, point?: {
|
|
422
923
|
x: number;
|
|
423
|
-
y: number;
|
|
424
|
-
}, stream?: boolean): void;
|
|
425
|
-
zoomIn(point?: {
|
|
426
|
-
x: number;
|
|
427
|
-
y: number;
|
|
428
|
-
}): void;
|
|
429
|
-
zoomOut(point?: {
|
|
430
|
-
x: number;
|
|
431
|
-
y: number;
|
|
432
|
-
}): void;
|
|
433
|
-
constraintBounds(immediate?: boolean): void;
|
|
434
|
-
}
|
|
435
|
-
//#endregion
|
|
436
|
-
//#region src/renderer/renderer.d.ts
|
|
437
|
-
interface Renderer {
|
|
438
|
-
beforeFrame(world: World, delta: number, target: Strand, options: HookOptions): void;
|
|
439
|
-
paint(paint: SpacialContent, index: number, x: number, y: number, width: number, height: number): void;
|
|
440
|
-
afterFrame(world: World, delta: number, target: Strand, options: HookOptions): void;
|
|
441
|
-
getScale(width: number, height: number, dpi?: boolean): number;
|
|
442
|
-
prepareLayer(paint: SpacialContent, point: Strand): void;
|
|
443
|
-
finishLayer(paint: SpacialContent, point: Strand): void;
|
|
444
|
-
afterPaintLayer(paint: SpacialContent, transform?: Strand): void;
|
|
445
|
-
pendingUpdate(): boolean;
|
|
446
|
-
getPointsAt(world: World, target: Strand, aggregate: Strand, scaleFactor: number): Paint[];
|
|
447
|
-
getViewportBounds(world: World, target: Strand, padding: number): PositionPair | null;
|
|
448
|
-
isReady(): boolean;
|
|
449
|
-
resize(): void;
|
|
450
|
-
resize(width?: number, height?: number): void;
|
|
451
|
-
triggerResize?: () => void;
|
|
452
|
-
reset(): void;
|
|
453
|
-
getRendererScreenPosition(): {
|
|
454
|
-
x: number;
|
|
455
|
-
y: number;
|
|
456
|
-
width: number;
|
|
457
|
-
height: number;
|
|
458
|
-
top: number;
|
|
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
|
-
};
|
|
924
|
+
y: number;
|
|
925
|
+
}, stream?: boolean): void;
|
|
926
|
+
zoomIn(point?: {
|
|
927
|
+
x: number;
|
|
928
|
+
y: number;
|
|
514
929
|
}): void;
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
constrain?: boolean;
|
|
519
|
-
}, defaults?: {
|
|
520
|
-
duration: number;
|
|
521
|
-
easing: EasingFunction;
|
|
522
|
-
constrain?: boolean;
|
|
523
|
-
callback?: () => void;
|
|
524
|
-
}, {
|
|
525
|
-
stream
|
|
526
|
-
}?: {
|
|
527
|
-
stream?: boolean;
|
|
930
|
+
zoomOut(point?: {
|
|
931
|
+
x: number;
|
|
932
|
+
y: number;
|
|
528
933
|
}): void;
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
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,6 +1053,8 @@ declare class Runtime {
|
|
|
624
1053
|
y: number;
|
|
625
1054
|
};
|
|
626
1055
|
_lastGoodScale: number;
|
|
1056
|
+
debugFrame: number;
|
|
1057
|
+
debugSubscribers: Set<(event: RuntimeDebugEvent) => void>;
|
|
627
1058
|
hooks: RuntimeHooks;
|
|
628
1059
|
fpsLimit: number | undefined;
|
|
629
1060
|
options: RuntimeOptions;
|
|
@@ -681,6 +1112,16 @@ declare class Runtime {
|
|
|
681
1112
|
width: number;
|
|
682
1113
|
height: number;
|
|
683
1114
|
};
|
|
1115
|
+
isViewportAtHome(options?: {
|
|
1116
|
+
cover?: boolean;
|
|
1117
|
+
tolerance?: number;
|
|
1118
|
+
target?: Projection;
|
|
1119
|
+
}): boolean;
|
|
1120
|
+
isViewportAtHomeZoomLevel(options?: {
|
|
1121
|
+
cover?: boolean;
|
|
1122
|
+
tolerance?: number;
|
|
1123
|
+
target?: Projection;
|
|
1124
|
+
}): boolean;
|
|
684
1125
|
goHome(options?: {
|
|
685
1126
|
cover?: boolean;
|
|
686
1127
|
position?: Strand;
|
|
@@ -757,6 +1198,20 @@ declare class Runtime {
|
|
|
757
1198
|
readonly maxY: number;
|
|
758
1199
|
};
|
|
759
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];
|
|
760
1215
|
/**
|
|
761
1216
|
* Zoom
|
|
762
1217
|
*/
|
|
@@ -845,8 +1300,25 @@ declare class Runtime {
|
|
|
845
1300
|
*/
|
|
846
1301
|
stop(): () => void;
|
|
847
1302
|
reset(): void;
|
|
1303
|
+
resetReadyState(reason?: AtlasReadyResetReason): void;
|
|
1304
|
+
getReadyState(): {
|
|
1305
|
+
ready: boolean;
|
|
1306
|
+
cycle: number;
|
|
1307
|
+
reason: AtlasReadyResetReason;
|
|
1308
|
+
timestamp?: number;
|
|
1309
|
+
};
|
|
848
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;
|
|
849
1320
|
deselectZone(): void;
|
|
1321
|
+
getZoneRuntimeState(zoneId: string, viewport?: Projection): RuntimeZoneState;
|
|
850
1322
|
hook<Name$1 extends keyof RuntimeHooks, Arg = UnwrapHookArg<Name$1>>(name: keyof RuntimeHooks, arg: Arg): void;
|
|
851
1323
|
registerHook<Name$1 extends keyof RuntimeHooks, Hook = UnwrapHook<Name$1>>(name: Name$1, hook: Hook): () => void;
|
|
852
1324
|
/**
|
|
@@ -858,6 +1330,10 @@ declare class Runtime {
|
|
|
858
1330
|
*/
|
|
859
1331
|
render: (t: number) => void;
|
|
860
1332
|
updateNextFrame(): void;
|
|
1333
|
+
addDebugSubscriber(callback: (event: RuntimeDebugEvent) => void): () => void;
|
|
1334
|
+
removeDebugSubscriber(callback: (event: RuntimeDebugEvent) => void): void;
|
|
1335
|
+
private hasDebugSubscribers;
|
|
1336
|
+
private emitDebug;
|
|
861
1337
|
}
|
|
862
1338
|
//#endregion
|
|
863
1339
|
//#region src/types.d.ts
|
|
@@ -970,187 +1446,108 @@ interface TextWrapperOptions {
|
|
|
970
1446
|
textDecoration?: 'none' | 'underline';
|
|
971
1447
|
}
|
|
972
1448
|
//#endregion
|
|
973
|
-
//#region src/
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
id: string;
|
|
980
|
-
display?: {
|
|
981
|
-
width: number;
|
|
982
|
-
height: number;
|
|
983
|
-
};
|
|
984
|
-
target: {
|
|
985
|
-
width: number;
|
|
986
|
-
height: number;
|
|
987
|
-
};
|
|
988
|
-
scale?: number;
|
|
989
|
-
getTexture: UpdateTextureFunction;
|
|
990
|
-
};
|
|
991
|
-
declare class ImageTexture extends BaseObject implements SpacialContent {
|
|
992
|
-
readonly type = "spacial-content";
|
|
993
|
-
id: string;
|
|
994
|
-
uri: string;
|
|
995
|
-
display: DisplayData;
|
|
996
|
-
points: Strand;
|
|
997
|
-
getTexture: UpdateTextureFunction;
|
|
998
|
-
constructor(data?: {
|
|
999
|
-
id?: string;
|
|
1000
|
-
uri: string;
|
|
1001
|
-
width: number;
|
|
1002
|
-
height: number;
|
|
1003
|
-
scale?: number;
|
|
1004
|
-
});
|
|
1005
|
-
applyProps(props: ImageTextureProps): void;
|
|
1006
|
-
getAllPointsAt(target: Strand, aggregate?: Strand, scale?: number): Paint[];
|
|
1007
|
-
}
|
|
1008
|
-
//#endregion
|
|
1009
|
-
//#region src/spacial-content/spacial-content.d.ts
|
|
1010
|
-
interface SpacialContent {
|
|
1011
|
-
readonly id: string;
|
|
1012
|
-
readonly type: 'spacial-content';
|
|
1013
|
-
readonly display: DisplayData;
|
|
1014
|
-
__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;
|
|
1015
1455
|
__parent?: CompositeResource;
|
|
1016
1456
|
__owner: {
|
|
1017
1457
|
value: WorldObject | undefined;
|
|
1018
1458
|
};
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
};
|
|
1029
|
-
style?: {
|
|
1030
|
-
opacity: number;
|
|
1031
|
-
};
|
|
1032
|
-
getScheduledUpdates(target: Strand, scaleFactor: number): Array<() => void | Promise<void>>;
|
|
1033
|
-
getAllPointsAt(target: Strand, aggregate?: Strand, scale?: number): Paint[];
|
|
1034
|
-
transform(op: Strand): void;
|
|
1035
|
-
loadFullResource?(): Promise<void>;
|
|
1036
|
-
dispatchEvent(event: string, e: any): void;
|
|
1037
|
-
getImageUrl?: (index: number) => string;
|
|
1038
|
-
getTexture?: UpdateTextureFunction;
|
|
1039
|
-
}
|
|
1040
|
-
//#endregion
|
|
1041
|
-
//#region src/spacial-content/single-image.d.ts
|
|
1042
|
-
type SingleImageProps = {
|
|
1043
|
-
uri: string;
|
|
1044
|
-
id?: string;
|
|
1045
|
-
display?: {
|
|
1046
|
-
width: number;
|
|
1047
|
-
height: number;
|
|
1048
|
-
rotation?: number;
|
|
1049
|
-
};
|
|
1050
|
-
target: {
|
|
1051
|
-
width: number;
|
|
1052
|
-
height: number;
|
|
1053
|
-
x?: number;
|
|
1054
|
-
y?: number;
|
|
1055
|
-
};
|
|
1056
|
-
crop?: {
|
|
1057
|
-
x: number;
|
|
1058
|
-
y: number;
|
|
1059
|
-
width: number;
|
|
1060
|
-
height: number;
|
|
1061
|
-
};
|
|
1062
|
-
scale?: number;
|
|
1063
|
-
priority?: boolean;
|
|
1064
|
-
style?: any;
|
|
1065
|
-
};
|
|
1066
|
-
declare class SingleImage extends BaseObject implements SpacialContent {
|
|
1067
|
-
readonly type = "spacial-content";
|
|
1068
|
-
/**
|
|
1069
|
-
* An identifier for this image. Will default to the image URI.
|
|
1070
|
-
*/
|
|
1071
|
-
id: string;
|
|
1072
|
-
/**
|
|
1073
|
-
* The URI of the image being painted.
|
|
1074
|
-
*/
|
|
1075
|
-
uri: string;
|
|
1076
|
-
/**
|
|
1077
|
-
* The real height and width of the image. For example a 1000x1000 painted at 100x100 would contain
|
|
1078
|
-
* the display data for 1000x1000 and `this.points` would scale that down to 100x100. This is used to
|
|
1079
|
-
* calculate the scale.
|
|
1080
|
-
*/
|
|
1081
|
-
display: DisplayData;
|
|
1082
|
-
/**
|
|
1083
|
-
* Points are relative to the world object.
|
|
1084
|
-
* Does not change when viewport moves
|
|
1085
|
-
* Does not change if world object position changes.
|
|
1086
|
-
* */
|
|
1087
|
-
points: Strand;
|
|
1088
|
-
/**
|
|
1089
|
-
* Displayed as priority
|
|
1090
|
-
*/
|
|
1091
|
-
priority?: boolean;
|
|
1092
|
-
/**
|
|
1093
|
-
* Some simple styling options
|
|
1094
|
-
*/
|
|
1095
|
-
style: {
|
|
1096
|
-
opacity: number;
|
|
1097
|
-
};
|
|
1098
|
-
constructor(data?: {
|
|
1099
|
-
id?: string;
|
|
1100
|
-
uri: string;
|
|
1101
|
-
width: number;
|
|
1102
|
-
height: number;
|
|
1103
|
-
scale?: number;
|
|
1104
|
-
x?: number;
|
|
1105
|
-
y?: number;
|
|
1106
|
-
rotation?: number;
|
|
1107
|
-
});
|
|
1108
|
-
applyProps(props: SingleImageProps): void;
|
|
1109
|
-
getAllPointsAt(target: Strand, aggregate?: Strand, scale?: number): Paint[];
|
|
1110
|
-
static fromSvg(svg: string, target: SpacialSize, display?: SpacialSize, id?: string): SingleImage;
|
|
1111
|
-
static fromImage(uri: string, target: SpacialSize, display?: SpacialSize, id?: string): SingleImage;
|
|
1112
|
-
getImageUrl(): string;
|
|
1113
|
-
}
|
|
1114
|
-
//#endregion
|
|
1115
|
-
//#region src/spacial-content/tiled-image.d.ts
|
|
1116
|
-
declare class TiledImage extends BaseObject implements SpacialContent {
|
|
1117
|
-
readonly id: string;
|
|
1118
|
-
readonly type = "spacial-content";
|
|
1119
|
-
readonly display: DisplayData;
|
|
1120
|
-
tileWidth: number;
|
|
1121
|
-
style: {
|
|
1122
|
-
opacity: number;
|
|
1123
|
-
};
|
|
1124
|
-
points: Strand;
|
|
1125
|
-
service?: ImageService$1;
|
|
1126
|
-
format: string;
|
|
1127
|
-
crop2?: Strand;
|
|
1128
|
-
version3?: boolean;
|
|
1129
|
-
tileUrl: string;
|
|
1130
|
-
constructor(data: {
|
|
1131
|
-
url: string;
|
|
1132
|
-
scaleFactor: number;
|
|
1133
|
-
points: Strand;
|
|
1134
|
-
displayPoints?: Strand;
|
|
1135
|
-
tileWidth: number;
|
|
1136
|
-
width: number;
|
|
1137
|
-
height: number;
|
|
1138
|
-
format?: string;
|
|
1139
|
-
id?: string;
|
|
1140
|
-
version3?: boolean;
|
|
1141
|
-
});
|
|
1142
|
-
applyProps(props: any): void;
|
|
1143
|
-
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;
|
|
1144
1468
|
width: number;
|
|
1145
1469
|
height: number;
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
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;
|
|
1152
1491
|
transform(op: Strand): void;
|
|
1153
|
-
|
|
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;
|
|
1154
1551
|
}
|
|
1155
1552
|
//#endregion
|
|
1156
1553
|
//#region src/objects/box.d.ts
|
|
@@ -1304,115 +1701,6 @@ declare class Text extends BaseObject<TextProps> implements SpacialContent {
|
|
|
1304
1701
|
}: Partial<TextProps>): void;
|
|
1305
1702
|
}
|
|
1306
1703
|
//#endregion
|
|
1307
|
-
//#region src/objects/geometry.d.ts
|
|
1308
|
-
type GeometryProps = {
|
|
1309
|
-
id: string;
|
|
1310
|
-
target: {
|
|
1311
|
-
x: number;
|
|
1312
|
-
y: number;
|
|
1313
|
-
width: number;
|
|
1314
|
-
height: number;
|
|
1315
|
-
};
|
|
1316
|
-
open?: boolean;
|
|
1317
|
-
points: [number, number][];
|
|
1318
|
-
className?: string;
|
|
1319
|
-
href?: string;
|
|
1320
|
-
title?: string;
|
|
1321
|
-
hrefTarget?: string;
|
|
1322
|
-
interactive?: boolean;
|
|
1323
|
-
relativeSize?: boolean;
|
|
1324
|
-
relativeStyle?: boolean;
|
|
1325
|
-
html?: boolean;
|
|
1326
|
-
style?: GeometryStyle;
|
|
1327
|
-
backgroundColor?: string;
|
|
1328
|
-
border?: string;
|
|
1329
|
-
};
|
|
1330
|
-
type GeometryStyle = _GeometryStyle & {
|
|
1331
|
-
':hover'?: _GeometryStyle;
|
|
1332
|
-
':active'?: _GeometryStyle;
|
|
1333
|
-
};
|
|
1334
|
-
type _GeometryStyle = Partial<{
|
|
1335
|
-
backgroundColor: string;
|
|
1336
|
-
opacity: number;
|
|
1337
|
-
boxShadow: string;
|
|
1338
|
-
borderColor: string;
|
|
1339
|
-
borderWidth: string;
|
|
1340
|
-
borderStyle: string;
|
|
1341
|
-
outlineColor: string;
|
|
1342
|
-
outlineWidth: string;
|
|
1343
|
-
outlineOffset: string;
|
|
1344
|
-
outlineStyle: string;
|
|
1345
|
-
border: string;
|
|
1346
|
-
outline: string;
|
|
1347
|
-
background: string;
|
|
1348
|
-
}>;
|
|
1349
|
-
declare class Geometry extends BaseObject<GeometryProps> implements SpacialContent {
|
|
1350
|
-
id: string;
|
|
1351
|
-
type: 'spacial-content';
|
|
1352
|
-
isShape: boolean;
|
|
1353
|
-
points: Strand;
|
|
1354
|
-
hoverEvents: boolean;
|
|
1355
|
-
activeEvents: boolean;
|
|
1356
|
-
display: {
|
|
1357
|
-
x: number;
|
|
1358
|
-
y: number;
|
|
1359
|
-
scale: number;
|
|
1360
|
-
width: number;
|
|
1361
|
-
height: number;
|
|
1362
|
-
points: Strand;
|
|
1363
|
-
};
|
|
1364
|
-
boundingBox: {
|
|
1365
|
-
x: number;
|
|
1366
|
-
y: number;
|
|
1367
|
-
width: number;
|
|
1368
|
-
height: number;
|
|
1369
|
-
} | null;
|
|
1370
|
-
_parsed: {
|
|
1371
|
-
border: {
|
|
1372
|
-
id: string | null;
|
|
1373
|
-
match: string[];
|
|
1374
|
-
};
|
|
1375
|
-
outline: {
|
|
1376
|
-
id: string | null;
|
|
1377
|
-
match: string[];
|
|
1378
|
-
};
|
|
1379
|
-
};
|
|
1380
|
-
hovering?: boolean;
|
|
1381
|
-
pressing?: boolean;
|
|
1382
|
-
props: {
|
|
1383
|
-
href?: string;
|
|
1384
|
-
hrefTarget?: string;
|
|
1385
|
-
title?: string;
|
|
1386
|
-
backgroundColor?: string;
|
|
1387
|
-
border?: string;
|
|
1388
|
-
interactive?: boolean;
|
|
1389
|
-
open?: boolean;
|
|
1390
|
-
className?: string;
|
|
1391
|
-
relativeSize?: boolean;
|
|
1392
|
-
relativeStyle?: boolean;
|
|
1393
|
-
html?: boolean;
|
|
1394
|
-
style?: GeometryStyle;
|
|
1395
|
-
hoverStyles?: GeometryStyle;
|
|
1396
|
-
pressStyles?: GeometryStyle;
|
|
1397
|
-
};
|
|
1398
|
-
shape: {
|
|
1399
|
-
type: 'none';
|
|
1400
|
-
} | {
|
|
1401
|
-
type: 'polygon';
|
|
1402
|
-
points: [number, number][];
|
|
1403
|
-
open?: boolean;
|
|
1404
|
-
};
|
|
1405
|
-
constructor();
|
|
1406
|
-
updateBoundingBox(): void;
|
|
1407
|
-
intersects(pointer?: [number, number] | null): boolean;
|
|
1408
|
-
getAllPointsAt(target: Strand, aggregate: Strand): Paint[];
|
|
1409
|
-
addHover: () => void;
|
|
1410
|
-
removeHover: () => void;
|
|
1411
|
-
addPress: () => void;
|
|
1412
|
-
removePress: () => void;
|
|
1413
|
-
applyProps(props?: Partial<GeometryProps>): void;
|
|
1414
|
-
}
|
|
1415
|
-
//#endregion
|
|
1416
1704
|
//#region src/modules/composite-renderer/composite-renderer.d.ts
|
|
1417
1705
|
declare class CompositeRenderer implements Renderer {
|
|
1418
1706
|
renderers: Renderer[];
|
|
@@ -1440,6 +1728,7 @@ declare class CompositeRenderer implements Renderer {
|
|
|
1440
1728
|
finishLayer(paint: SpacialContent, point: Strand): void;
|
|
1441
1729
|
resize(width?: number, height?: number): void;
|
|
1442
1730
|
reset(): void;
|
|
1731
|
+
resetReadyState(): void;
|
|
1443
1732
|
}
|
|
1444
1733
|
//#endregion
|
|
1445
1734
|
//#region src/modules/grid-builder/grid-builder.d.ts
|
|
@@ -1469,6 +1758,85 @@ declare class GridBuilder {
|
|
|
1469
1758
|
getWorld(): World;
|
|
1470
1759
|
}
|
|
1471
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
|
|
1472
1840
|
//#region src/modules/popmotion-controller/popmotion-controller.d.ts
|
|
1473
1841
|
type PopmotionControllerConfig = {
|
|
1474
1842
|
zoomOutFactor?: number;
|
|
@@ -1482,14 +1850,24 @@ type PopmotionControllerConfig = {
|
|
|
1482
1850
|
panBounceDamping?: number;
|
|
1483
1851
|
panTimeConstant?: number;
|
|
1484
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;
|
|
1485
1861
|
nudgeDistance?: number;
|
|
1486
1862
|
panPadding?: number;
|
|
1487
1863
|
devicePixelRatio?: number;
|
|
1488
1864
|
enableWheel?: boolean;
|
|
1489
1865
|
enableClickToZoom?: boolean;
|
|
1866
|
+
enableDoubleTapZoom?: boolean;
|
|
1490
1867
|
ignoreSingleFingerTouch?: boolean;
|
|
1491
1868
|
enablePanOnWait?: boolean;
|
|
1492
1869
|
requireMetaKeyForWheelZoom?: boolean;
|
|
1870
|
+
wheelInExploreModeOnly?: boolean;
|
|
1493
1871
|
panOnWaitDelay?: number;
|
|
1494
1872
|
parentElement?: HTMLElement | null;
|
|
1495
1873
|
onPanInSketchMode?: () => void;
|
|
@@ -1497,72 +1875,83 @@ type PopmotionControllerConfig = {
|
|
|
1497
1875
|
declare const defaultConfig: Required<PopmotionControllerConfig>;
|
|
1498
1876
|
declare const popmotionController: (config?: PopmotionControllerConfig) => RuntimeController;
|
|
1499
1877
|
//#endregion
|
|
1500
|
-
//#region src/modules/
|
|
1501
|
-
type
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
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;
|
|
1511
1902
|
};
|
|
1512
|
-
declare function getId(entity: any): string;
|
|
1513
1903
|
//#endregion
|
|
1514
|
-
//#region src/modules/
|
|
1515
|
-
type
|
|
1516
|
-
|
|
1517
|
-
|
|
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>;
|
|
1518
1935
|
};
|
|
1519
|
-
declare class
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
mousedOver: BaseObject[];
|
|
1539
|
-
itemsBeingDragged: BaseObject[];
|
|
1540
|
-
mouseDownStart: {
|
|
1541
|
-
x: number;
|
|
1542
|
-
y: number;
|
|
1543
|
-
};
|
|
1544
|
-
lastTouches: Array<{
|
|
1545
|
-
id: number;
|
|
1546
|
-
x: number;
|
|
1547
|
-
y: number;
|
|
1548
|
-
}>;
|
|
1549
|
-
};
|
|
1550
|
-
options: BrowserEventManagerOptions;
|
|
1551
|
-
constructor(element: HTMLElement, runtime: Runtime, options?: Partial<BrowserEventManagerOptions>);
|
|
1552
|
-
updateBounds(): void;
|
|
1553
|
-
layoutSubscriber(type: string): void;
|
|
1554
|
-
assignToEvent(e: any, x: number, y: number): void;
|
|
1555
|
-
activateEvents(): void;
|
|
1556
|
-
_realPointerMove: (e: PointerEvent) => void;
|
|
1557
|
-
onWheelEvent: (e: WheelEvent) => void;
|
|
1558
|
-
onContextMenu: (e: MouseEvent) => void;
|
|
1559
|
-
onTouchEvent: (e: TouchEvent) => void;
|
|
1560
|
-
onPointerEvent: (e: PointerEvent | MouseEvent) => void;
|
|
1561
|
-
onPointerDown: (e: PointerEvent | MouseEvent) => void;
|
|
1562
|
-
onPointerUp: (e: PointerEvent | MouseEvent) => void;
|
|
1563
|
-
onPointerMove: (e: PointerEvent | MouseEvent) => void;
|
|
1564
|
-
normalizeEventName(event: string): string;
|
|
1565
|
-
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;
|
|
1566
1955
|
}
|
|
1567
1956
|
//#endregion
|
|
1568
1957
|
//#region src/modules/canvas-renderer/canvas-renderer.d.ts
|
|
@@ -1575,15 +1964,60 @@ type CanvasRendererOptions = {
|
|
|
1575
1964
|
box?: boolean;
|
|
1576
1965
|
polygon?: boolean;
|
|
1577
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;
|
|
1578
1972
|
};
|
|
1579
1973
|
type ImageBuffer = {
|
|
1580
|
-
canvas
|
|
1974
|
+
canvas?: HTMLCanvasElement;
|
|
1581
1975
|
canvases: string[];
|
|
1976
|
+
tiles?: Record<number, TileLoadingState>;
|
|
1582
1977
|
indices: number[];
|
|
1583
1978
|
loaded: number[];
|
|
1584
1979
|
fallback?: ImageBuffer;
|
|
1585
1980
|
loading: boolean;
|
|
1586
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
|
+
};
|
|
1587
2021
|
declare class CanvasRenderer implements Renderer {
|
|
1588
2022
|
/**
|
|
1589
2023
|
* The primary viewing space for the viewer.
|
|
@@ -1616,18 +2050,24 @@ declare class CanvasRenderer implements Renderer {
|
|
|
1616
2050
|
pendingDrawCall: boolean;
|
|
1617
2051
|
firstMeaningfulPaint: boolean;
|
|
1618
2052
|
parallelTasks: number;
|
|
2053
|
+
maxPrefetchPerFrame: number;
|
|
2054
|
+
imageLoadingConfig: ImageLoadingConfig;
|
|
2055
|
+
imageRequestPool: ImageRequestPool;
|
|
1619
2056
|
frameTasks: number;
|
|
1620
2057
|
loadingQueueOrdered: boolean;
|
|
1621
|
-
loadingQueue:
|
|
1622
|
-
id: string;
|
|
1623
|
-
scale: number;
|
|
1624
|
-
network?: boolean;
|
|
1625
|
-
distance: number;
|
|
1626
|
-
shifted?: boolean;
|
|
1627
|
-
task: () => Promise<any>;
|
|
1628
|
-
}>;
|
|
2058
|
+
loadingQueue: QueueTask[];
|
|
1629
2059
|
currentTask: Promise<any>;
|
|
1630
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
|
+
}>;
|
|
1631
2071
|
stats?: any;
|
|
1632
2072
|
averageJobTime: number;
|
|
1633
2073
|
lastKnownScale: number;
|
|
@@ -1639,12 +2079,18 @@ declare class CanvasRenderer implements Renderer {
|
|
|
1639
2079
|
lastPaintedObject?: WorldObject;
|
|
1640
2080
|
hostCache: LRUCache<string, HTMLCanvasElement>;
|
|
1641
2081
|
invalidated: string[];
|
|
2082
|
+
fallbackRevealTimeout: ReturnType<typeof setTimeout> | null;
|
|
2083
|
+
framePrefetchCount: number;
|
|
2084
|
+
hasTilesFading: boolean;
|
|
2085
|
+
hasActiveLayerClip: boolean;
|
|
1642
2086
|
constructor(canvas: HTMLCanvasElement, options?: CanvasRendererOptions);
|
|
1643
2087
|
getCanvasDims(): {
|
|
1644
2088
|
width: number;
|
|
1645
2089
|
height: number;
|
|
1646
2090
|
};
|
|
1647
2091
|
resize(): void;
|
|
2092
|
+
private getCompositeOwner;
|
|
2093
|
+
private compareCompositeLoadPriority;
|
|
1648
2094
|
isReady(): boolean;
|
|
1649
2095
|
afterFrame(world: World): void;
|
|
1650
2096
|
doOffscreenWork(): void;
|
|
@@ -1655,9 +2101,31 @@ declare class CanvasRenderer implements Renderer {
|
|
|
1655
2101
|
beforeFrame(world: World, delta: number, target: Strand, options: HookOptions): void;
|
|
1656
2102
|
applyTransform(paint: Paintable, x: number, y: number, width: number, height: number): void;
|
|
1657
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;
|
|
1658
2127
|
paint(paint: SpacialContent | Text | Box, index: number, x: number, y: number, width: number, height: number): void;
|
|
1659
|
-
|
|
1660
|
-
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;
|
|
1661
2129
|
afterPaintLayer(paint: SpacialContent, transform: Strand): void;
|
|
1662
2130
|
prepareLayer(paint: SpacialContent, points: Strand): void;
|
|
1663
2131
|
finishLayer(): void;
|
|
@@ -1666,6 +2134,7 @@ declare class CanvasRenderer implements Renderer {
|
|
|
1666
2134
|
getViewportBounds(world: World, target: Strand, padding: number): PositionPair | null;
|
|
1667
2135
|
pendingUpdate(): boolean;
|
|
1668
2136
|
getRendererScreenPosition(): DOMRect;
|
|
2137
|
+
resetReadyState(): void;
|
|
1669
2138
|
reset(): void;
|
|
1670
2139
|
}
|
|
1671
2140
|
//#endregion
|
|
@@ -1702,6 +2171,254 @@ declare class DebugRenderer implements Renderer {
|
|
|
1702
2171
|
reset(): void;
|
|
1703
2172
|
}
|
|
1704
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
|
|
1705
2422
|
//#region src/modules/react-reconciler/presets/_types.d.ts
|
|
1706
2423
|
type Preset = {
|
|
1707
2424
|
name: string;
|
|
@@ -1712,6 +2429,7 @@ type Preset = {
|
|
|
1712
2429
|
ready?: boolean;
|
|
1713
2430
|
unmount(): void;
|
|
1714
2431
|
canvas?: HTMLCanvasElement;
|
|
2432
|
+
parityCanvas?: HTMLCanvasElement;
|
|
1715
2433
|
overlay?: HTMLDivElement;
|
|
1716
2434
|
container?: HTMLDivElement;
|
|
1717
2435
|
navigator?: HTMLCanvasElement;
|
|
@@ -1719,44 +2437,63 @@ type Preset = {
|
|
|
1719
2437
|
type PresetArgs = {
|
|
1720
2438
|
viewport: Viewer;
|
|
1721
2439
|
forceRefresh: () => void;
|
|
2440
|
+
controllerConfig?: any;
|
|
2441
|
+
interactionMode?: 'popmotion' | 'pdf-scroll-zone';
|
|
1722
2442
|
runtimeOptions?: RuntimeOptions;
|
|
1723
2443
|
containerElement?: HTMLDivElement;
|
|
1724
2444
|
canvasElement?: HTMLCanvasElement;
|
|
2445
|
+
parityCanvasElement?: HTMLCanvasElement;
|
|
1725
2446
|
overlayElement?: HTMLDivElement;
|
|
1726
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';
|
|
1727
2453
|
};
|
|
1728
2454
|
//#endregion
|
|
1729
2455
|
//#region src/modules/react-reconciler/presets/default-preset.d.ts
|
|
1730
2456
|
type DefaultPresetName = 'default-preset';
|
|
1731
2457
|
type DefaultPresetOptions = {
|
|
1732
2458
|
controllerConfig?: any;
|
|
2459
|
+
interactionMode?: 'popmotion' | 'pdf-scroll-zone';
|
|
1733
2460
|
unstable_webglRenderer?: boolean;
|
|
1734
2461
|
interactive?: boolean;
|
|
1735
2462
|
dpi?: number;
|
|
1736
2463
|
debug?: boolean;
|
|
1737
2464
|
canvasBox?: boolean;
|
|
1738
2465
|
polygon?: boolean;
|
|
2466
|
+
navigatorRendererOptions?: NavigatorRendererOptions;
|
|
1739
2467
|
};
|
|
1740
2468
|
declare function defaultPreset({
|
|
1741
2469
|
interactive,
|
|
1742
2470
|
viewport,
|
|
1743
2471
|
forceRefresh,
|
|
1744
2472
|
canvasElement,
|
|
2473
|
+
parityCanvasElement,
|
|
1745
2474
|
overlayElement,
|
|
1746
2475
|
controllerConfig,
|
|
2476
|
+
interactionMode,
|
|
1747
2477
|
unstable_webglRenderer,
|
|
1748
2478
|
dpi,
|
|
1749
2479
|
debug,
|
|
1750
2480
|
canvasBox,
|
|
1751
2481
|
polygon,
|
|
1752
2482
|
navigatorElement,
|
|
1753
|
-
runtimeOptions
|
|
2483
|
+
runtimeOptions,
|
|
2484
|
+
onWebGLFallback,
|
|
2485
|
+
onImageError,
|
|
2486
|
+
imageLoading,
|
|
2487
|
+
webglFallbackOnImageLoadError,
|
|
2488
|
+
webglReadiness,
|
|
2489
|
+
navigatorRendererOptions
|
|
1754
2490
|
}: PresetArgs & DefaultPresetOptions): Preset;
|
|
1755
2491
|
//#endregion
|
|
1756
2492
|
//#region src/modules/react-reconciler/presets/static-preset.d.ts
|
|
1757
2493
|
type StaticPresetName = 'static-preset';
|
|
1758
2494
|
type StaticPresetOptions = {
|
|
1759
2495
|
controllerConfig?: any;
|
|
2496
|
+
interactionMode?: 'popmotion' | 'pdf-scroll-zone';
|
|
1760
2497
|
interactive?: boolean;
|
|
1761
2498
|
};
|
|
1762
2499
|
declare function staticPreset({
|
|
@@ -1765,7 +2502,8 @@ declare function staticPreset({
|
|
|
1765
2502
|
forceRefresh,
|
|
1766
2503
|
containerElement,
|
|
1767
2504
|
overlayElement,
|
|
1768
|
-
controllerConfig
|
|
2505
|
+
controllerConfig,
|
|
2506
|
+
interactionMode
|
|
1769
2507
|
}: PresetArgs & StaticPresetOptions): Preset;
|
|
1770
2508
|
//#endregion
|
|
1771
2509
|
//#region src/modules/react-reconciler/presets/index.d.ts
|
|
@@ -1780,11 +2518,19 @@ type AtlasProps = {
|
|
|
1780
2518
|
onCreated?: (ctx: Preset) => void | Promise<void>;
|
|
1781
2519
|
resetWorldOnChange?: boolean;
|
|
1782
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>;
|
|
1783
2528
|
unstable_noReconciler?: boolean;
|
|
1784
2529
|
overlayStyle?: any;
|
|
1785
2530
|
containerStyle?: any;
|
|
1786
2531
|
containerProps?: any;
|
|
1787
|
-
controllerConfig?: PopmotionControllerConfig;
|
|
2532
|
+
controllerConfig?: PopmotionControllerConfig | PdfScrollZoneControllerConfig;
|
|
2533
|
+
interactionMode?: 'popmotion' | 'pdf-scroll-zone';
|
|
1788
2534
|
renderPreset?: PresetNames | Presets;
|
|
1789
2535
|
hideInlineStyle?: boolean;
|
|
1790
2536
|
homeCover?: true | false | 'start' | 'end';
|
|
@@ -1803,8 +2549,19 @@ type AtlasProps = {
|
|
|
1803
2549
|
className?: string;
|
|
1804
2550
|
background?: string;
|
|
1805
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
|
+
};
|
|
1806
2562
|
htmlChildren?: ReactNode;
|
|
1807
2563
|
children: ReactNode;
|
|
2564
|
+
devTools?: boolean | DevToolsProps;
|
|
1808
2565
|
runtimeOptions?: Partial<RuntimeOptions>;
|
|
1809
2566
|
filters?: Partial<ViewerFilters>;
|
|
1810
2567
|
};
|
|
@@ -1813,52 +2570,211 @@ declare const Atlas: React.FC<AtlasProps & {
|
|
|
1813
2570
|
height: number;
|
|
1814
2571
|
}>;
|
|
1815
2572
|
//#endregion
|
|
1816
|
-
//#region src/modules/react-reconciler/
|
|
1817
|
-
declare
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
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;
|
|
1823
2653
|
};
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
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;
|
|
1832
2668
|
}>;
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
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: {
|
|
1842
2677
|
x: number;
|
|
1843
2678
|
y: number;
|
|
2679
|
+
scale: number;
|
|
1844
2680
|
width: number;
|
|
1845
2681
|
height: number;
|
|
1846
|
-
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1849
|
-
//#region src/modules/react-reconciler/components/HTMLPortal.d.ts
|
|
1850
|
-
declare const HTMLPortal: React.FC<{
|
|
1851
|
-
children?: ReactNode;
|
|
1852
|
-
backgroundColor?: string;
|
|
1853
|
-
interactive?: boolean;
|
|
1854
|
-
relative?: boolean;
|
|
1855
|
-
target?: {
|
|
2682
|
+
points: Strand;
|
|
2683
|
+
};
|
|
2684
|
+
boundingBox: {
|
|
1856
2685
|
x: number;
|
|
1857
2686
|
y: number;
|
|
1858
2687
|
width: number;
|
|
1859
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
|
+
};
|
|
1860
2699
|
};
|
|
1861
|
-
|
|
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>;
|
|
1862
2778
|
//#endregion
|
|
1863
2779
|
//#region src/modules/react-reconciler/components/RegionHighlight.d.ts
|
|
1864
2780
|
type RegionHighlightType = {
|
|
@@ -1934,22 +2850,6 @@ declare const TileSet: React.FC<{
|
|
|
1934
2850
|
renderOptions?: CompositeResourceProps;
|
|
1935
2851
|
}>;
|
|
1936
2852
|
//#endregion
|
|
1937
|
-
//#region src/modules/react-reconciler/components/ImageService.d.ts
|
|
1938
|
-
declare const ImageService: React.FC<{
|
|
1939
|
-
id: string;
|
|
1940
|
-
width: number;
|
|
1941
|
-
height: number;
|
|
1942
|
-
x?: number;
|
|
1943
|
-
y?: number;
|
|
1944
|
-
rotation?: number;
|
|
1945
|
-
scale?: number;
|
|
1946
|
-
children?: ReactNode;
|
|
1947
|
-
crop?: any;
|
|
1948
|
-
enableSizes?: boolean;
|
|
1949
|
-
enableThumbnail?: boolean;
|
|
1950
|
-
renderOptions?: CompositeResourceProps;
|
|
1951
|
-
}>;
|
|
1952
|
-
//#endregion
|
|
1953
2853
|
//#region src/modules/react-reconciler/hooks/use-after-frame.d.ts
|
|
1954
2854
|
declare const useAfterFrame: (callback: (time: number) => void, deps?: any[]) => void;
|
|
1955
2855
|
//#endregion
|
|
@@ -2017,6 +2917,51 @@ declare const useControlledAnnotationList: (initialList?: Array<{
|
|
|
2017
2917
|
//#region src/modules/react-reconciler/hooks/use-frame.d.ts
|
|
2018
2918
|
declare const useFrame: (callback: (time: number) => void, deps?: any[]) => void;
|
|
2019
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
|
|
2020
2965
|
//#region src/modules/react-reconciler/hooks/use-mode.d.ts
|
|
2021
2966
|
declare const ModeContext: React.Context<ViewerMode>;
|
|
2022
2967
|
declare const useMode: () => ViewerMode;
|
|
@@ -2052,10 +2997,17 @@ declare const useRuntime: () => Runtime | undefined;
|
|
|
2052
2997
|
//#region src/modules/react-reconciler/hooks/use-world-event.d.ts
|
|
2053
2998
|
declare const useWorldEvent: <Name$1 extends SupportedEventNames>(name: Name$1, cb: (e: any) => void, deps?: any[]) => void;
|
|
2054
2999
|
//#endregion
|
|
2055
|
-
//#region src/modules/react-reconciler/
|
|
2056
|
-
declare
|
|
2057
|
-
|
|
2058
|
-
|
|
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
|
+
};
|
|
2059
3011
|
//#endregion
|
|
2060
3012
|
//#region src/clean-objects/traits/evented.d.ts
|
|
2061
3013
|
type AtlasEvent<BaseEvent extends Event> = BaseEvent & {
|
|
@@ -2109,6 +3061,11 @@ type BaseElement = {
|
|
|
2109
3061
|
priority?: boolean;
|
|
2110
3062
|
};
|
|
2111
3063
|
type AllEvents = EventListenerProps;
|
|
3064
|
+
type ZoneVisibilityProps = {
|
|
3065
|
+
onZoneVisible?: () => void;
|
|
3066
|
+
onZoneHidden?: () => void;
|
|
3067
|
+
onZoneVisibilityChange?: (visible: boolean) => void;
|
|
3068
|
+
};
|
|
2112
3069
|
declare global {
|
|
2113
3070
|
namespace JSX {
|
|
2114
3071
|
interface IntrinsicElements {
|
|
@@ -2134,6 +3091,15 @@ declare global {
|
|
|
2134
3091
|
y?: number;
|
|
2135
3092
|
rotation?: number;
|
|
2136
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;
|
|
2137
3103
|
worldImage: BaseElement & {
|
|
2138
3104
|
uri: string;
|
|
2139
3105
|
target: any;
|
|
@@ -2191,6 +3157,28 @@ declare global {
|
|
|
2191
3157
|
crop: any;
|
|
2192
3158
|
version3?: boolean;
|
|
2193
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;
|
|
2194
3182
|
box: BaseElement & {
|
|
2195
3183
|
interactive?: boolean;
|
|
2196
3184
|
backgroundColor?: string;
|
|
@@ -2230,75 +3218,10 @@ declare global {
|
|
|
2230
3218
|
}
|
|
2231
3219
|
}
|
|
2232
3220
|
//#endregion
|
|
2233
|
-
//#region src/modules/
|
|
2234
|
-
declare function
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
declare function getTiles(manifestId: string): Promise<Array<GetTile>>;
|
|
2238
|
-
//#endregion
|
|
2239
|
-
//#region src/utility/stylesheet.d.ts
|
|
2240
|
-
declare class Stylesheet {
|
|
2241
|
-
$element: HTMLStyleElement;
|
|
2242
|
-
stylesheetClasses: string[];
|
|
2243
|
-
activeStylesheetClasses: string[];
|
|
2244
|
-
sheetsDidUpdate: boolean;
|
|
2245
|
-
sheetPrefix: string;
|
|
2246
|
-
stylesheetEntries: Record<string, string>;
|
|
2247
|
-
constructor(options?: {
|
|
2248
|
-
sheetPrefix?: string;
|
|
2249
|
-
});
|
|
2250
|
-
getElement(): HTMLStyleElement;
|
|
2251
|
-
addStylesheet(_sheet: string): string;
|
|
2252
|
-
removeStylesheet(obj: any): void;
|
|
2253
|
-
clearClasses(): void;
|
|
2254
|
-
didUpdateActive(): boolean;
|
|
2255
|
-
updateSheet(): void;
|
|
2256
|
-
}
|
|
2257
|
-
//#endregion
|
|
2258
|
-
//#region src/modules/overlay-renderer/overlay-renderer.d.ts
|
|
2259
|
-
type OverlayRendererOptions = {
|
|
2260
|
-
sheetPrefix: string;
|
|
2261
|
-
box: boolean;
|
|
2262
|
-
text: boolean;
|
|
2263
|
-
inlineStyles: boolean;
|
|
2264
|
-
triggerResize: () => void;
|
|
2265
|
-
background: string;
|
|
2266
|
-
};
|
|
2267
|
-
declare class OverlayRenderer implements Renderer {
|
|
2268
|
-
htmlContainer: HTMLDivElement;
|
|
2269
|
-
visible: Array<Text | Box | SpacialContent>;
|
|
2270
|
-
previousVisible: Array<Text | Box | SpacialContent>;
|
|
2271
|
-
htmlIds: string[];
|
|
2272
|
-
firstMeaningfulPaint: boolean;
|
|
2273
|
-
rendererPosition: DOMRect;
|
|
2274
|
-
stylesheet: Stylesheet;
|
|
2275
|
-
options: OverlayRendererOptions;
|
|
2276
|
-
paintTx: number;
|
|
2277
|
-
zIndex: number;
|
|
2278
|
-
classes: {
|
|
2279
|
-
hostClassName: string;
|
|
2280
|
-
interactive: string;
|
|
2281
|
-
nonInteractive: string;
|
|
2282
|
-
};
|
|
2283
|
-
constructor(htmlContainer: HTMLDivElement, options?: Partial<OverlayRendererOptions>);
|
|
2284
|
-
createHtmlHost(paint: Text | Box): void;
|
|
2285
|
-
triggerResize(): void;
|
|
2286
|
-
updateHtmlHost(paint: Text | Box, width?: number, height?: number): void;
|
|
2287
|
-
afterFrame(world: World, delta: number, target: Strand): void;
|
|
2288
|
-
afterPaintLayer(paint: SpacialContent, transform?: Strand): void;
|
|
2289
|
-
beforeFrame(world: World, delta: number, target: Strand): void;
|
|
2290
|
-
getPointsAt(world: World, target: Strand, aggregate: Strand, scaleFactor: number): Paint[];
|
|
2291
|
-
getScale(width: number, height: number): number;
|
|
2292
|
-
getViewportBounds(world: World, target: Strand, padding: number): PositionPair | null;
|
|
2293
|
-
isReady(): boolean;
|
|
2294
|
-
paint(paint: SpacialContent, index: number, x: number, y: number, width: number, height: number): void;
|
|
2295
|
-
pendingUpdate(): boolean;
|
|
2296
|
-
prepareLayer(paint: SpacialContent): void;
|
|
2297
|
-
resize(width?: number, height?: number): void;
|
|
2298
|
-
getRendererScreenPosition(): DOMRect;
|
|
2299
|
-
finishLayer(): void;
|
|
2300
|
-
reset(): void;
|
|
2301
|
-
}
|
|
3221
|
+
//#region src/modules/react-reconciler/utility/can-drag.d.ts
|
|
3222
|
+
declare function canDrag(ref: {
|
|
3223
|
+
current: ViewerMode;
|
|
3224
|
+
}): boolean;
|
|
2302
3225
|
//#endregion
|
|
2303
3226
|
//#region src/modules/static-renderer/static-renderer.d.ts
|
|
2304
3227
|
type StaticRendererOptions = {
|
|
@@ -2342,10 +3265,44 @@ declare class StaticRenderer implements Renderer {
|
|
|
2342
3265
|
//#region src/modules/webgl-renderer/webgl-renderer.d.ts
|
|
2343
3266
|
type WebGLRendererOptions = {
|
|
2344
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;
|
|
2345
3300
|
};
|
|
2346
3301
|
declare class WebGLRenderer implements Renderer {
|
|
2347
3302
|
canvas: HTMLCanvasElement;
|
|
2348
3303
|
gl: WebGL2RenderingContext;
|
|
3304
|
+
options: WebGLRendererOptions;
|
|
3305
|
+
fatalImageError?: AtlasWebGLFallbackEvent;
|
|
2349
3306
|
program: WebGLProgram;
|
|
2350
3307
|
fragmentShader: WebGLShader;
|
|
2351
3308
|
vertexShader: WebGLShader;
|
|
@@ -2359,6 +3316,7 @@ declare class WebGLRenderer implements Renderer {
|
|
|
2359
3316
|
uniforms: {
|
|
2360
3317
|
resolution: WebGLUniformLocation | null;
|
|
2361
3318
|
texture: WebGLUniformLocation | null;
|
|
3319
|
+
alpha: WebGLUniformLocation | null;
|
|
2362
3320
|
};
|
|
2363
3321
|
buffers: {
|
|
2364
3322
|
position: WebGLBuffer;
|
|
@@ -2366,14 +3324,67 @@ declare class WebGLRenderer implements Renderer {
|
|
|
2366
3324
|
};
|
|
2367
3325
|
rendererPosition: DOMRect;
|
|
2368
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;
|
|
2369
3351
|
constructor(canvas: HTMLCanvasElement, options?: WebGLRendererOptions);
|
|
3352
|
+
private isImmediateReadiness;
|
|
3353
|
+
emitFatalImageError(event: Omit<AtlasWebGLFallbackEvent, 'from' | 'to'>): void;
|
|
2370
3354
|
resize(): void;
|
|
2371
3355
|
isReady(): boolean;
|
|
2372
|
-
beforeFrame(world: World, delta: number, target: Strand): void;
|
|
3356
|
+
beforeFrame(world: World, delta: number, target: Strand, options: HookOptions): void;
|
|
2373
3357
|
lastResize: number;
|
|
2374
|
-
|
|
3358
|
+
private getCompositeRenderOptions;
|
|
3359
|
+
private shouldClipLayerToBounds;
|
|
3360
|
+
private getBoundsFromPoints;
|
|
3361
|
+
private toScissorRect;
|
|
3362
|
+
prepareLayer(paint: SpacialContent, points?: Strand): void;
|
|
2375
3363
|
createTextureHost(paint: ImageTexture | Box): void;
|
|
2376
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;
|
|
2377
3388
|
paint(paint: SpacialContent, index: number, x: number, y: number, width: number, height: number): void;
|
|
2378
3389
|
afterPaintLayer(paint: SpacialContent, transform?: Strand): void;
|
|
2379
3390
|
pendingUpdate(): boolean;
|
|
@@ -2394,11 +3405,12 @@ declare class WebGLRenderer implements Renderer {
|
|
|
2394
3405
|
getRectangle(x: number, y: number, width: number, height: number): Float32Array<ArrayBufferLike>;
|
|
2395
3406
|
getRendererScreenPosition(): DOMRect;
|
|
2396
3407
|
finishLayer(): void;
|
|
3408
|
+
resetReadyState(): void;
|
|
2397
3409
|
reset(): void;
|
|
2398
3410
|
}
|
|
2399
3411
|
//#endregion
|
|
2400
3412
|
//#region src/utility/merge-styles.d.ts
|
|
2401
3413
|
declare function mergeStyles(defaultStyle?: BoxStyle, style?: BoxStyle): BoxStyle | undefined;
|
|
2402
3414
|
//#endregion
|
|
2403
|
-
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 };
|
|
2404
3416
|
//# sourceMappingURL=index.d.ts.map
|