@projektemacher/storymapjs 0.10.0 → 0.10.2

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.
Files changed (36) hide show
  1. package/dist/assets/{demo-DYodj6d7.js → demo-rv3vz65J.js} +1 -1
  2. package/dist/assets/{harness-UkbbPmC4.js → harness-BnQbtq1l.js} +1 -1
  3. package/dist/assets/main-mUk_qlWN.js +17 -0
  4. package/dist/css/storymap.css +11 -2
  5. package/dist/demo.html +3 -3
  6. package/dist/examples/assets/custom-flag.svg +6 -0
  7. package/dist/examples/issue-405-custom-icon.json +63 -0
  8. package/dist/harness.html +3 -3
  9. package/dist/index.html +1 -1
  10. package/dist/js/storymap.d.ts +1431 -0
  11. package/dist/js/storymap.js +4171 -4356
  12. package/dist/js/storymap.js.map +1 -1
  13. package/package.json +15 -9
  14. package/dist/assets/main-BDSRsIiB.js +0 -17
  15. package/dist/assets/main-Bzm6THVj.css +0 -1
  16. package/dist/css/icons/vco-icons.eot +0 -0
  17. package/dist/css/icons/vco-icons.svg +0 -63
  18. package/dist/docs/api/.nojekyll +0 -1
  19. package/dist/docs/api/assets/custom.css +0 -47
  20. package/dist/docs/api/assets/hierarchy.js +0 -1
  21. package/dist/docs/api/assets/highlight.css +0 -22
  22. package/dist/docs/api/assets/icons.js +0 -18
  23. package/dist/docs/api/assets/icons.svg +0 -1
  24. package/dist/docs/api/assets/main.js +0 -60
  25. package/dist/docs/api/assets/navigation.js +0 -1
  26. package/dist/docs/api/assets/search.js +0 -1
  27. package/dist/docs/api/assets/style.css +0 -1648
  28. package/dist/docs/api/classes/StoryMap.html +0 -799
  29. package/dist/docs/api/functions/MediaType.html +0 -51
  30. package/dist/docs/api/functions/loadCSS.html +0 -64
  31. package/dist/docs/api/functions/setLanguage.html +0 -53
  32. package/dist/docs/api/functions/validateStorymap.html +0 -53
  33. package/dist/docs/api/functions/validateStorymapAndReport.html +0 -54
  34. package/dist/docs/api/hierarchy.html +0 -28
  35. package/dist/docs/api/index.html +0 -127
  36. package/dist/docs/api/modules.html +0 -42
@@ -0,0 +1,1431 @@
1
+ import { default as default_2 } from 'ol/control/OverviewMap';
2
+ import { default as default_3 } from 'ol/Map';
3
+ import { default as default_4 } from 'ol/Overlay';
4
+ import { default as default_5 } from 'ol/tilegrid/TileGrid';
5
+ import { default as default_6 } from 'ol/proj/Projection';
6
+ import { Map as Map_3 } from 'ol';
7
+ import { Style } from 'ol/style';
8
+ import { Tile } from 'ol/layer';
9
+ import { Vector } from 'ol/layer';
10
+
11
+ declare interface AnimationHandle {
12
+ stop: (jump?: boolean) => void;
13
+ }
14
+
15
+ /**
16
+ * Per-StoryMap GDPR consent manager. When the `consent_required` option is
17
+ * set, every external service (media embeds, map tiles, external font CSS)
18
+ * asks for permission before anything is loaded. Decisions are remembered
19
+ * per service in a cookie for 90 days — clearing cookies asks again.
20
+ */
21
+ declare class ConsentManager {
22
+ private granted;
23
+ private denied;
24
+ /** unanswered asks per service (preloaded slides stack several) */
25
+ private pending;
26
+ constructor();
27
+ /** Seed the per-service state from the consent cookie, if present. */
28
+ private restore;
29
+ /** Persist the per-service state to the consent cookie. */
30
+ private persist;
31
+ isGranted(service: string): boolean;
32
+ isDenied(service: string): boolean;
33
+ /**
34
+ * Ask the visitor for permission to load `service` (a human-readable
35
+ * name like "YouTube" or "map tiles"), optionally naming the `host`.
36
+ * The ask is rendered into `container`; resolves `true`/`false` on the
37
+ * visitor's decision, or immediately when the service was already
38
+ * granted or denied.
39
+ */
40
+ request(service: string, host: string, container: HTMLElement): Promise<boolean>;
41
+ }
42
+
43
+ declare interface DragData {
44
+ sliding: boolean;
45
+ direction: string | null;
46
+ pagex: {
47
+ start: number;
48
+ end: number;
49
+ };
50
+ pagey: {
51
+ start: number;
52
+ end: number;
53
+ };
54
+ pos: {
55
+ start: {
56
+ x: number;
57
+ y: number;
58
+ };
59
+ end: {
60
+ x: number;
61
+ y: number;
62
+ };
63
+ };
64
+ new_pos: {
65
+ x: number;
66
+ y: number;
67
+ };
68
+ new_pos_parent: {
69
+ x: number;
70
+ y: number;
71
+ };
72
+ time: {
73
+ start: number;
74
+ end: number;
75
+ };
76
+ touch: boolean;
77
+ }
78
+
79
+ declare interface DragEventNames {
80
+ down: string;
81
+ up: string;
82
+ leave: string;
83
+ move: string;
84
+ }
85
+
86
+ /** Eventing members provided by the Evented mixin. */
87
+ declare interface EventedInstance {
88
+ on: (type: string, fn: unknown, context?: unknown) => unknown;
89
+ off: (type: string, fn: unknown, context?: unknown) => unknown;
90
+ fire: (type: string, data?: unknown, target?: unknown) => unknown;
91
+ hasEventListeners: (type: string) => boolean;
92
+ }
93
+
94
+ declare type IconSpec = {
95
+ url: string;
96
+ size: number[];
97
+ anchor: number[];
98
+ };
99
+
100
+ declare interface LanguageEntry {
101
+ buttons?: Record<string, string>;
102
+ messages?: Record<string, string>;
103
+ [key: string]: unknown;
104
+ }
105
+
106
+ declare interface LatLngLiteral {
107
+ lat: number | undefined;
108
+ lon?: number | undefined;
109
+ lng?: number | undefined;
110
+ }
111
+
112
+ /** Legacy drag handlers historically mixed mouse and touch event surfaces. */
113
+ declare type LegacyEvent = Event & {
114
+ originalEvent?: TouchEvent;
115
+ targetTouches?: TouchList;
116
+ pageX?: number;
117
+ pageY?: number;
118
+ };
119
+
120
+ /** A point of the connection line: either a slide or a raw lat/lon pair. */
121
+ declare interface LinePoint {
122
+ location?: StorymapSlideLocation;
123
+ lat?: number;
124
+ lon?: number;
125
+ }
126
+
127
+ /**
128
+ * Append one stylesheet to the document head.
129
+ *
130
+ * @param url - The stylesheet URL.
131
+ * @param options - Optional AbortSignal to cancel an in-flight load.
132
+ * @returns Resolves when the stylesheet has loaded, rejects on error or abort.
133
+ */
134
+ export declare function loadCSS(url: string, options?: LoadOptions): Promise<void>;
135
+
136
+ declare interface LoadOptions {
137
+ /** Abort the load (removes the element, rejects the promise). */
138
+ signal?: AbortSignal;
139
+ }
140
+
141
+ declare class Map_2 extends Map_base {
142
+ constructor(...args: ConstructorParameters<typeof MapBase>);
143
+ }
144
+
145
+ declare const Map_base: {
146
+ new (...args: any[]): {
147
+ show(animate?: unknown): void;
148
+ hide(): void;
149
+ addTo(container: HTMLElement): /*elided*/ any;
150
+ removeFrom(container: HTMLElement): /*elided*/ any;
151
+ setPosition(pos: Record<string, number>, el?: HTMLElement): /*elided*/ any;
152
+ onLoaded(): void;
153
+ onAdd(): void;
154
+ onRemove(): void;
155
+ _el: Record<string, HTMLElement>;
156
+ data?: unknown;
157
+ on: (type: string, fn: unknown, context?: unknown) => unknown;
158
+ off: (type: string, fn: unknown, context?: unknown) => unknown;
159
+ fire: (type: string, data?: unknown, target?: unknown) => unknown;
160
+ hasEventListeners: (type: string) => boolean;
161
+ };
162
+ } & {
163
+ new (...args: any[]): {
164
+ _vco_events?: Record<string, {
165
+ action: unknown;
166
+ context: unknown;
167
+ }[]>;
168
+ on(type: string, fn: unknown, context?: unknown): /*elided*/ any;
169
+ hasEventListeners(type: string): boolean;
170
+ off(type: string, fn: unknown, context?: unknown): /*elided*/ any;
171
+ fire(type: string, data?: unknown, target?: unknown): /*elided*/ any;
172
+ };
173
+ } & typeof MapBase;
174
+
175
+ declare class MapBase {
176
+ "_el": {
177
+ container: HTMLElement;
178
+ map: HTMLElement;
179
+ map_mask: HTMLElement;
180
+ };
181
+ "_loaded": {
182
+ data: boolean;
183
+ map: boolean;
184
+ };
185
+ "_map": Map_3 | null;
186
+ "_mini_map": default_2 | null;
187
+ "_markers": MapMarker[];
188
+ "zoom_min_max": {
189
+ min: number | null;
190
+ max: number | null;
191
+ };
192
+ "_line": Vector | null;
193
+ "_line_active": Vector | null;
194
+ "current_marker": number;
195
+ "bounds_array": number[][] | null;
196
+ "_tile_layer": Tile | null;
197
+ "_tile_layer_mini": Tile | null;
198
+ "_image_layer": Tile | null;
199
+ "data": StorymapData;
200
+ "options": StorymapOptions;
201
+ "animator": AnimationHandle | null;
202
+ "_transition_duration": number;
203
+ "timer": ReturnType<typeof setTimeout> | null;
204
+ "touch_scale": number;
205
+ "scroll": ScrollState;
206
+ "fire": EventedInstance["fire"];
207
+ constructor(elem: string | HTMLElement, data?: Partial<StorymapData>, options?: Partial<StorymapOptions>);
208
+ updateDisplay(w: number, h: number, animate?: boolean, d?: number, offset?: unknown): void;
209
+ goTo(n: number, change?: boolean): void;
210
+ panTo(loc: LatLngLiteral, animate?: boolean): void;
211
+ zoomTo(z: number, animate?: boolean): void;
212
+ viewTo(loc: StorymapSlideLocation, opts?: ViewToOptions): void;
213
+ getBoundsZoom(m1: LatLngLiteral, m2: LatLngLiteral, inside?: boolean, padding?: unknown): void;
214
+ markerOverview(): void;
215
+ calculateMarkerZooms(): void;
216
+ createMiniMap(): void;
217
+ setMapOffset(left: number, top: number): void;
218
+ calculateMinMaxZoom(): void;
219
+ updateMinMaxZoom(zoom: number): void;
220
+ initialMapLocation(): void;
221
+ show(): void;
222
+ hide(): void;
223
+ createMarkers(array: StorymapSlide[]): void;
224
+ createMarker(d: StorymapSlide): void;
225
+ _destroyMarker(marker: MapMarker): void;
226
+ _createMarkers(array: StorymapSlide[]): void;
227
+ /**
228
+ * A slide has a real location: lat and lon are both numbers — lat 0 and
229
+ * lon 0 are valid coordinates and must not be treated as missing.
230
+ */
231
+ _hasLocation(d: StorymapSlide): boolean;
232
+ _createMap(): void;
233
+ _createMiniMap(): void;
234
+ _createMarker(d?: StorymapSlide): void;
235
+ _addMarker(marker: MapMarker): void;
236
+ _removeMarker(marker: MapMarker): void;
237
+ _resetMarkersActive(): void;
238
+ _calculateMarkerZooms(): void;
239
+ _createLine(d?: StorymapSlide): unknown;
240
+ _addToLine(line: Vector | null, d: LinePoint): void;
241
+ _replaceLines(line: Vector | null, d: LinePoint[], animate?: {
242
+ duration: number;
243
+ retractFrom?: LinePoint[] | null;
244
+ growFrom?: LinePoint[] | null;
245
+ }): void;
246
+ _addLineToMap(line: Vector): void;
247
+ _panTo(loc: LatLngLiteral, animate?: boolean): void;
248
+ _zoomTo(z: number, animate?: boolean): void;
249
+ _viewTo(loc: StorymapSlideLocation, opts?: ViewToOptions): void;
250
+ _updateMapDisplay(animate?: boolean, d?: number): void;
251
+ _refreshMap(): void;
252
+ _getMapZoom(): number;
253
+ _getMapCenter(correct_for_center?: boolean): LatLngLiteral;
254
+ _getBoundsZoom(m1: LatLngLiteral, m2: LatLngLiteral, inside?: boolean, padding?: unknown): number;
255
+ _markerOverview(duration?: number): void;
256
+ /**
257
+ * Great-circle length of the route through all markers in kilometers;
258
+ * `undefined` when the map cannot compute it or there are fewer than two
259
+ * markers (issue #341).
260
+ */
261
+ getRouteDistance(): number | undefined;
262
+ _onMarkerChange(e?: unknown): void;
263
+ _onMarkerClick(e: {
264
+ marker_number: number;
265
+ }): void;
266
+ _onMapLoaded(e?: unknown): void;
267
+ _onWheel(e: WheelEvent): void;
268
+ _scollZoom(e?: unknown): void;
269
+ _scollZoomDone(e?: unknown): void;
270
+ _calculateZoomChange(origin: LatLngLiteral, destination: LatLngLiteral, correct_for_center?: boolean): number;
271
+ _updateDisplay(w?: number, h?: number, animate?: boolean, d?: number, offset?: unknown): void;
272
+ /** Re-apply runtime-changed options (no-op in the base class) */
273
+ applyOptions(_keys: string[]): void;
274
+ _initLayout(): void;
275
+ _initData(): void;
276
+ /** Hook after marker creation (overridden per engine as needed) */
277
+ _afterCreateMarkers(): void;
278
+ _initEvents(): void;
279
+ }
280
+
281
+ declare class MapMarker extends MapMarker_base {
282
+ constructor(...args: ConstructorParameters<typeof MapMarkerBase>);
283
+ }
284
+
285
+ declare const MapMarker_base: {
286
+ new (...args: any[]): {
287
+ _vco_events?: Record<string, {
288
+ action: unknown;
289
+ context: unknown;
290
+ }[]>;
291
+ on(type: string, fn: unknown, context?: unknown): /*elided*/ any;
292
+ hasEventListeners(type: string): boolean;
293
+ off(type: string, fn: unknown, context?: unknown): /*elided*/ any;
294
+ fire(type: string, data?: unknown, target?: unknown): /*elided*/ any;
295
+ };
296
+ } & typeof MapMarkerBase;
297
+
298
+ declare class MapMarkerBase {
299
+ "_el": Record<string, HTMLElement>;
300
+ "_marker": HTMLDivElement;
301
+ "_icon": IconSpec | HTMLDivElement | false;
302
+ "_custom_icon": IconSpec | false;
303
+ "_custom_icon_url": string;
304
+ "_custom_image_icon": string | false;
305
+ "marker_number": number;
306
+ "media_icon_class": string;
307
+ "timer": ReturnType<typeof setTimeout> | null;
308
+ "data": MapMarkerData;
309
+ "options": StorymapOptions;
310
+ "animator": AnimationHandle | null;
311
+ "fire": EventedInstance["fire"];
312
+ constructor(data?: MapMarkerData, options?: Partial<StorymapOptions>);
313
+ show(): void;
314
+ hide(): void;
315
+ addTo(m: unknown): void;
316
+ removeFrom(m: unknown): void;
317
+ updateDisplay(w: number, h: number, a?: boolean): void;
318
+ createMarker(d?: MapMarkerData, o?: StorymapOptions): void;
319
+ active(a: boolean): void;
320
+ location(): LatLngLiteral;
321
+ _createMarker(d?: MapMarkerData, o?: StorymapOptions): void;
322
+ _addTo(m: unknown): void;
323
+ _removeFrom(m: unknown): void;
324
+ _active(a: boolean): void;
325
+ _location(): LatLngLiteral;
326
+ _onMarkerClick(e?: unknown): void;
327
+ _initLayout(): void;
328
+ _updateDisplay(width: number, height: number, animate?: boolean): void;
329
+ }
330
+
331
+ declare interface MapMarkerData {
332
+ real_marker?: boolean;
333
+ location?: StorymapSlideLocation;
334
+ media?: StorymapSlideMedia & {
335
+ mediatype?: MediaTypeMatch | null;
336
+ };
337
+ text?: {
338
+ headline?: string;
339
+ };
340
+ type?: string;
341
+ [key: string]: unknown;
342
+ }
343
+
344
+ declare interface MediaInstance {
345
+ addTo: (container: HTMLElement) => void;
346
+ loadMedia: () => void;
347
+ stopMedia: () => void;
348
+ updateDisplay: (w?: number, h?: number, l?: string) => void;
349
+ _state?: {
350
+ loaded?: boolean;
351
+ };
352
+ }
353
+
354
+ /**
355
+ * Resolve the media handler for a slide's media object: matches the URL (and
356
+ * optional explicit `type`) against the supported media types — YouTube,
357
+ * Vimeo, images, audio, video, ...
358
+ *
359
+ * @param m - The slide media definition.
360
+ * @returns The matching media type entry, or `false` for unknown media.
361
+ */
362
+ export declare function MediaType(m: StorymapSlideMedia): MediaTypeMatch | false;
363
+
364
+ declare type MediaTypeMatch = {
365
+ type: string;
366
+ name: string;
367
+ match_str: string;
368
+ cls: new (data: StorymapSlideMedia, options: Record<string, unknown>) => unknown;
369
+ };
370
+
371
+ declare class MenuBar extends MenuBar_base {
372
+ constructor(...args: ConstructorParameters<typeof MenuBarBase>);
373
+ }
374
+
375
+ declare const MenuBar_base: {
376
+ new (...args: any[]): {
377
+ show(animate?: unknown): void;
378
+ hide(): void;
379
+ addTo(container: HTMLElement): /*elided*/ any;
380
+ removeFrom(container: HTMLElement): /*elided*/ any;
381
+ setPosition(pos: Record<string, number>, el?: HTMLElement): /*elided*/ any;
382
+ onLoaded(): void;
383
+ onAdd(): void;
384
+ onRemove(): void;
385
+ _el: Record<string, HTMLElement>;
386
+ data?: unknown;
387
+ on: (type: string, fn: unknown, context?: unknown) => unknown;
388
+ off: (type: string, fn: unknown, context?: unknown) => unknown;
389
+ fire: (type: string, data?: unknown, target?: unknown) => unknown;
390
+ hasEventListeners: (type: string) => boolean;
391
+ };
392
+ } & {
393
+ new (...args: any[]): {
394
+ _vco_events?: Record<string, {
395
+ action: unknown;
396
+ context: unknown;
397
+ }[]>;
398
+ on(type: string, fn: unknown, context?: unknown): /*elided*/ any;
399
+ hasEventListeners(type: string): boolean;
400
+ off(type: string, fn: unknown, context?: unknown): /*elided*/ any;
401
+ fire(type: string, data?: unknown, target?: unknown): /*elided*/ any;
402
+ };
403
+ } & typeof MenuBarBase;
404
+
405
+ declare class MenuBarBase {
406
+ "_el": Record<string, HTMLElement>;
407
+ "collapsed": boolean;
408
+ "options": MenuBarOptions;
409
+ "animator": Record<string, unknown>;
410
+ "fire": EventedInstance["fire"];
411
+ constructor(elem: HTMLElement | string, parent_elem?: HTMLElement, options?: object);
412
+ show(d?: number): void;
413
+ hide(top: number): void;
414
+ setSticky(y: number): void;
415
+ setColor(inverted: boolean): void;
416
+ /**
417
+ * Reflect the fullscreen state in the button label/icon.
418
+ */
419
+ setFullscreenState(active: boolean): void;
420
+ /**
421
+ * Update the progress indicator (issue #247); no-op when disabled.
422
+ */
423
+ setProgress(current: number, total: number): void;
424
+ /**
425
+ * Update the route distance display (issue #341); no-op when disabled or
426
+ * before the first reading.
427
+ */
428
+ setDistance(kilometers?: number): void;
429
+ updateDisplay(w?: number, h?: number, a?: boolean): void;
430
+ _onButtonOverview(e: Event): void;
431
+ _onButtonBackToStart(e: Event): void;
432
+ _onButtonFullscreen(e: Event): void;
433
+ _onButtonCollapseMap(e: Event): void;
434
+ _initLayout(): void;
435
+ _updateDisplay(width?: number, height?: number, animate?: boolean): void;
436
+ }
437
+
438
+ declare interface MenuBarOptions {
439
+ width: number;
440
+ height: number;
441
+ duration: number;
442
+ ease: unknown;
443
+ menubar_default_y: number;
444
+ [key: string]: unknown;
445
+ }
446
+
447
+ declare class Message extends Message_base {
448
+ constructor(...args: ConstructorParameters<typeof MessageBase>);
449
+ }
450
+
451
+ declare const Message_base: {
452
+ new (...args: any[]): {
453
+ show(animate?: unknown): void;
454
+ hide(): void;
455
+ addTo(container: HTMLElement): /*elided*/ any;
456
+ removeFrom(container: HTMLElement): /*elided*/ any;
457
+ setPosition(pos: Record<string, number>, el?: HTMLElement): /*elided*/ any;
458
+ onLoaded(): void;
459
+ onAdd(): void;
460
+ onRemove(): void;
461
+ _el: Record<string, HTMLElement>;
462
+ data?: unknown;
463
+ on: (type: string, fn: unknown, context?: unknown) => unknown;
464
+ off: (type: string, fn: unknown, context?: unknown) => unknown;
465
+ fire: (type: string, data?: unknown, target?: unknown) => unknown;
466
+ hasEventListeners: (type: string) => boolean;
467
+ };
468
+ } & {
469
+ new (...args: any[]): {
470
+ _vco_events?: Record<string, {
471
+ action: unknown;
472
+ context: unknown;
473
+ }[]>;
474
+ on(type: string, fn: unknown, context?: unknown): /*elided*/ any;
475
+ hasEventListeners(type: string): boolean;
476
+ off(type: string, fn: unknown, context?: unknown): /*elided*/ any;
477
+ fire(type: string, data?: unknown, target?: unknown): /*elided*/ any;
478
+ };
479
+ } & typeof MessageBase;
480
+
481
+ declare class MessageBase {
482
+ "_el": Record<string, HTMLElement>;
483
+ "options": MessageOptions;
484
+ "data": Record<string, unknown>;
485
+ "animator": Record<string, unknown>;
486
+ "fire": EventedInstance["fire"];
487
+ constructor(data?: Record<string, unknown>, options?: Record<string, unknown>, add_to_container?: HTMLElement);
488
+ updateMessage(t: string): void;
489
+ _updateMessage(t?: string): void;
490
+ _onMouseClick(): void;
491
+ _initLayout(): void;
492
+ _initEvents(): void;
493
+ }
494
+
495
+ declare interface MessageOptions {
496
+ width: number;
497
+ height: number;
498
+ message_class: string;
499
+ message_icon_class: string;
500
+ [key: string]: unknown;
501
+ }
502
+
503
+ declare class OpenLayers extends Map_2 {
504
+ "_map": default_3;
505
+ "_tile_layer": Tile;
506
+ "_line": Vector;
507
+ "_line_active": Vector;
508
+ "_tile_layer_mini": Tile | null;
509
+ "_mini_map": default_2;
510
+ "_markers": OpenLayersMapMarker[];
511
+ /** rAF handle of the running active-line draw animation */
512
+ "_line_animation": number | null;
513
+ _createMap(): void;
514
+ _getAttribution(map_type: string): string;
515
+ /**
516
+ * Create the tile layer and register its load handler. Deferred until
517
+ * the visitor allows map tiles in consent mode.
518
+ */
519
+ _addTileLayer(): void;
520
+ /**
521
+ * Ask for tile consent, then attach the layers if allowed.
522
+ */
523
+ _requestTileConsent(consent: ConsentManager, tile_service: string): Promise<void>;
524
+ /**
525
+ * Map tiles were allowed: attach the main tile layer, create the
526
+ * minimap's deferred layer if it was withheld, then re-fit.
527
+ */
528
+ _onTilesAllowed(): void;
529
+ /**
530
+ * Legacy zoomify image pyramid: the levels (image size per level), the
531
+ * max zoom and the mercator bounds the image occupies (stretched from
532
+ * the world's top-left corner, the original renderer's mapping).
533
+ */
534
+ _zoomifyPyramid(): {
535
+ sizes: Array<[number, number]>;
536
+ maxZoom: number;
537
+ extent: number[];
538
+ tileGrid: default_5;
539
+ } | null;
540
+ /**
541
+ * The zoomify overview state: the best-fit pyramid level for a map
542
+ * window (the level whose image, times the tolerance, fits the window —
543
+ * the legacy `_getBestFitZoom`) and the image's mercator center.
544
+ */
545
+ _zoomifyOverview(mapSize: [number, number]): {
546
+ zoom: number;
547
+ center: number[];
548
+ } | null;
549
+ _createTileLayer(map_type: string): Tile;
550
+ _createVectorStyleLayer(style_url: string): Tile;
551
+ _createMiniMap(): void;
552
+ _fitMiniMapToImage(): void;
553
+ _createMarker(d: StorymapSlide): void;
554
+ _addMarker(marker: OpenLayersMapMarker): void;
555
+ /**
556
+ * Position marker overlays on the unwrapped longitude path so they sit on
557
+ * the same world copy as the fitted view and the line (issue #381).
558
+ * Image-space coordinates are not degrees and stay untouched.
559
+ */
560
+ _afterCreateMarkers(): void;
561
+ _removeMarker(marker: OpenLayersMapMarker): void;
562
+ _getAllMarkersBounds(markers_array: OpenLayersMapMarker[]): number[][];
563
+ /**
564
+ * Normalize a longitude sequence so consecutive values differ by at most
565
+ * 180 degrees: markers keep their raw coordinates (OpenLayers wraps the
566
+ * display), but fits and lines use the unwrapped path (issue #381).
567
+ */
568
+ _unwrapLongitudes(lons: number[]): number[];
569
+ _markerCoordsToViewCoords(coords: number[][]): number[][];
570
+ /**
571
+ * The View extent for the `map_bbox` option, or `null` when unset.
572
+ */
573
+ _bboxExtent(): number[] | null;
574
+ /**
575
+ * The slide content panel can be opaque — it then covers part of the map
576
+ * and the effective visible area shrinks. Returns the pixel padding for
577
+ * the covered side (right in landscape, bottom in portrait) so fits keep
578
+ * the story inside the visible region; transparent panels add nothing.
579
+ */
580
+ _opaquePanelPadding(): [number, number, number, number];
581
+ _fitView(ol_map: default_3, coords: number[][], duration?: number): void;
582
+ _calculateMarkerZooms(): void;
583
+ /**
584
+ * Stroke style for the route lines: the dash pattern and line join are
585
+ * applied at init too, matching the original rendering (the lines are
586
+ * dashed "5,5" by default, not solid).
587
+ */
588
+ _lineStyle(color: string): Style;
589
+ _createLine(d?: StorymapSlide): Vector;
590
+ _addLineToMap(line: Vector): void;
591
+ _addToLine(line: Vector, d: LinePoint): void;
592
+ /**
593
+ * Replace a line's geometry. With `animate.duration > 0` only the latest
594
+ * hop animates, in sync with the view animation: the already-traveled
595
+ * prefix stays drawn while the new segment traces progressively, so half
596
+ * way through the pan the old connections are fully red and only half
597
+ * the new hop is. Backward navigation mirrors this: the traveled prefix
598
+ * stays drawn while the far end pulls back along the abandoned hop.
599
+ */
600
+ _replaceLines(line: Vector, array: LinePoint[], animate?: {
601
+ duration: number;
602
+ retractFrom?: LinePoint[] | null;
603
+ growFrom?: LinePoint[] | null;
604
+ }): void;
605
+ /** Cancel a running active-line draw animation. */
606
+ _cancelLineAnimation(): void;
607
+ /** Total euclidean length of a path in view coordinates. */
608
+ _pathLength(coords: number[][]): number;
609
+ /**
610
+ * The prefix of the path up to `length` (in view units), with the cut
611
+ * point interpolated inside its segment.
612
+ */
613
+ _truncatePath(coords: number[][], length: number): number[][];
614
+ _panTo(loc: LatLngLiteral, animate?: boolean): void;
615
+ _zoomTo(z: number, animate?: boolean): void;
616
+ _viewTo(loc: StorymapSlideLocation, opts?: ViewToOptions): void;
617
+ _toViewCoords(loc: LatLngLiteral): number[];
618
+ _getMapZoom(): number;
619
+ _getMapCenter(offset?: boolean): LatLngLiteral;
620
+ _getMapCenterOffset(location: LatLngLiteral, zoom: number): LatLngLiteral;
621
+ _fromViewCoords(coord: number[], projection: default_6): LatLngLiteral;
622
+ _getBoundsZoom(origin: LatLngLiteral, destination: LatLngLiteral, correct_for_center?: boolean): number;
623
+ _initialMapLocation(): void;
624
+ /**
625
+ * Great-circle (haversine) length of the route through all markers in
626
+ * kilometers (issue #341).
627
+ */
628
+ getRouteDistance(): number | undefined;
629
+ _markerOverview(duration?: number): void;
630
+ /**
631
+ * Re-apply runtime-changed options (driven by StoryMap.setMapOptions).
632
+ * Only keys with an immediate effect are handled here; everything else is
633
+ * picked up on the next navigation or layout pass.
634
+ */
635
+ applyOptions(keys: string[]): void;
636
+ _updateMapDisplay(animate?: boolean, d?: number, instant?: boolean): void;
637
+ _refreshMap(instant?: boolean): void;
638
+ /**
639
+ * Set the view synchronously (resize path): OL's animate() applies its
640
+ * end state asynchronously which can leave marker overlays rendering
641
+ * stale positions after a size change.
642
+ */
643
+ _setViewInstant(loc: StorymapSlideLocation, zoom: number): void;
644
+ }
645
+
646
+ declare class OpenLayersMapMarker extends MapMarker {
647
+ "_overlay": default_4;
648
+ _createMarker(d?: MapMarkerData, o?: StorymapOptions): void;
649
+ _createMarkerElement(d: MapMarkerData, o?: StorymapOptions): HTMLDivElement;
650
+ _addTo(m: Map_3): void;
651
+ _removeFrom(m: Map_3): void;
652
+ _active(a: boolean): void;
653
+ _customIconAnchor(size?: number[]): number[];
654
+ _location(): LatLngLiteral;
655
+ }
656
+
657
+ /** Wheel/scroll zoom bookkeeping (handles cleared via clearTimeout). */
658
+ declare interface ScrollState {
659
+ start_time: number | null;
660
+ timer?: ReturnType<typeof setTimeout>;
661
+ timer_done?: ReturnType<typeof setTimeout>;
662
+ }
663
+
664
+ /**
665
+ * Switch the active UI language.
666
+ *
667
+ * @param code - A locale code for which a locale file exists (e.g. `"en"`).
668
+ * @returns The language entry that is now active.
669
+ */
670
+ export declare function setLanguage(code: string): LanguageEntry;
671
+
672
+ declare class Slide extends Slide_base {
673
+ constructor(...args: ConstructorParameters<typeof SlideBase>);
674
+ }
675
+
676
+ declare const Slide_base: {
677
+ new (...args: any[]): {
678
+ show(animate?: unknown): void;
679
+ hide(): void;
680
+ addTo(container: HTMLElement): /*elided*/ any;
681
+ removeFrom(container: HTMLElement): /*elided*/ any;
682
+ setPosition(pos: Record<string, number>, el?: HTMLElement): /*elided*/ any;
683
+ onLoaded(): void;
684
+ onAdd(): void;
685
+ onRemove(): void;
686
+ _el: Record<string, HTMLElement>;
687
+ data?: unknown;
688
+ on: (type: string, fn: unknown, context?: unknown) => unknown;
689
+ off: (type: string, fn: unknown, context?: unknown) => unknown;
690
+ fire: (type: string, data?: unknown, target?: unknown) => unknown;
691
+ hasEventListeners: (type: string) => boolean;
692
+ };
693
+ } & {
694
+ new (...args: any[]): {
695
+ _vco_events?: Record<string, {
696
+ action: unknown;
697
+ context: unknown;
698
+ }[]>;
699
+ on(type: string, fn: unknown, context?: unknown): /*elided*/ any;
700
+ hasEventListeners(type: string): boolean;
701
+ off(type: string, fn: unknown, context?: unknown): /*elided*/ any;
702
+ fire(type: string, data?: unknown, target?: unknown): /*elided*/ any;
703
+ };
704
+ } & typeof SlideBase;
705
+
706
+ declare interface SlideBackgroundChange {
707
+ color_value?: string;
708
+ image?: boolean;
709
+ }
710
+
711
+ declare class SlideBase {
712
+ "_el": Record<string, HTMLElement>;
713
+ "_media": MediaInstance | null;
714
+ "_mediaclass": unknown;
715
+ "_text": Text_2;
716
+ "_state": {
717
+ loaded: boolean;
718
+ };
719
+ "has": SlideHas;
720
+ "title": string;
721
+ "data": StorymapSlide;
722
+ "options": SlideOptions;
723
+ "active": boolean;
724
+ "animator": unknown;
725
+ "fire": EventedInstance["fire"];
726
+ "onLoaded": () => void;
727
+ constructor(data: StorymapSlide, options: Record<string, unknown>, title_slide?: boolean);
728
+ show(): void;
729
+ hide(): void;
730
+ setActive(is_active: boolean): void;
731
+ updateDisplay(w?: number, h?: number, l?: string): void;
732
+ loadMedia(): void;
733
+ stopMedia(): void;
734
+ getBackground(): {
735
+ image: boolean;
736
+ color: boolean;
737
+ color_value: string;
738
+ };
739
+ scrollToTop(): void;
740
+ addCallToAction(str: string): void;
741
+ _onCallToAction(e: Event): void;
742
+ _initLayout(): void;
743
+ _updateDisplay(width?: number, height?: number, layout?: string): void;
744
+ }
745
+
746
+ declare interface SlideHas {
747
+ headline: boolean;
748
+ text: boolean;
749
+ media: boolean;
750
+ title: boolean;
751
+ background: {
752
+ image: boolean;
753
+ color: boolean;
754
+ color_value: string;
755
+ };
756
+ }
757
+
758
+ declare class SlideNav extends SlideNav_base {
759
+ constructor(...args: ConstructorParameters<typeof SlideNavBase>);
760
+ }
761
+
762
+ declare const SlideNav_base: {
763
+ new (...args: any[]): {
764
+ show(animate?: unknown): void;
765
+ hide(): void;
766
+ addTo(container: HTMLElement): /*elided*/ any;
767
+ removeFrom(container: HTMLElement): /*elided*/ any;
768
+ setPosition(pos: Record<string, number>, el?: HTMLElement): /*elided*/ any;
769
+ onLoaded(): void;
770
+ onAdd(): void;
771
+ onRemove(): void;
772
+ _el: Record<string, HTMLElement>;
773
+ data?: unknown;
774
+ on: (type: string, fn: unknown, context?: unknown) => unknown;
775
+ off: (type: string, fn: unknown, context?: unknown) => unknown;
776
+ fire: (type: string, data?: unknown, target?: unknown) => unknown;
777
+ hasEventListeners: (type: string) => boolean;
778
+ };
779
+ } & {
780
+ new (...args: any[]): {
781
+ _vco_events?: Record<string, {
782
+ action: unknown;
783
+ context: unknown;
784
+ }[]>;
785
+ on(type: string, fn: unknown, context?: unknown): /*elided*/ any;
786
+ hasEventListeners(type: string): boolean;
787
+ off(type: string, fn: unknown, context?: unknown): /*elided*/ any;
788
+ fire(type: string, data?: unknown, target?: unknown): /*elided*/ any;
789
+ };
790
+ } & typeof SlideNavBase;
791
+
792
+ declare class SlideNavBase {
793
+ "_el": Record<string, HTMLElement>;
794
+ "mediatype": unknown;
795
+ "data": SlideNavData;
796
+ "options": SlideNavOptions;
797
+ "animator": AnimationHandle | null;
798
+ "animator_position": AnimationHandle | null;
799
+ "fire": EventedInstance["fire"];
800
+ constructor(data?: Partial<SlideNavData>, options?: Partial<SlideNavOptions>, add_to_container?: HTMLElement);
801
+ update(d?: Partial<SlideNavData>): void;
802
+ setColor(inverted: boolean): void;
803
+ updatePosition(pos: Record<string, number | string>, use_percent: boolean, duration: number, ease: unknown, start_value: number, return_to_default: boolean): void;
804
+ _onUpdatePositionComplete(return_to_default: boolean): void;
805
+ _onMouseClick(): void;
806
+ _update(d?: Partial<SlideNavData>): void;
807
+ _initLayout(): void;
808
+ _initEvents(): void;
809
+ }
810
+
811
+ declare interface SlideNavData {
812
+ title: string;
813
+ description: string;
814
+ date?: string;
815
+ [key: string]: unknown;
816
+ }
817
+
818
+ declare interface SlideNavOptions {
819
+ direction: string;
820
+ [key: string]: unknown;
821
+ }
822
+
823
+ declare interface SlideOptions {
824
+ duration: number;
825
+ slide_padding_lr: number;
826
+ ease: unknown;
827
+ width: number;
828
+ height: number;
829
+ skinny_size: number;
830
+ media_name?: string;
831
+ media_type?: string;
832
+ [key: string]: unknown;
833
+ }
834
+
835
+ export declare class StoryMap extends StoryMap_base {
836
+ /**
837
+ * The library base path (the directory containing the module).
838
+ * Derived from `import.meta.url`, which works both for the source module
839
+ * (src/main.ts) and the built ESM bundle (js/storymap.js).
840
+ */
841
+ static SCRIPT_PATH: string;
842
+ constructor(...args: ConstructorParameters<typeof StoryMapBase>);
843
+ }
844
+
845
+ declare const StoryMap_base: {
846
+ new (...args: any[]): {
847
+ _vco_events?: Record<string, {
848
+ action: unknown;
849
+ context: unknown;
850
+ }[]>;
851
+ on(type: string, fn: unknown, context?: unknown): /*elided*/ any;
852
+ hasEventListeners(type: string): boolean;
853
+ off(type: string, fn: unknown, context?: unknown): /*elided*/ any;
854
+ fire(type: string, data?: unknown, target?: unknown): /*elided*/ any;
855
+ };
856
+ } & typeof StoryMapBase;
857
+
858
+ /**
859
+ * Interactive StoryMap viewer.
860
+ *
861
+ * Renders a storymap JSON document (or a IIIF Presentation 3 manifest) into an
862
+ * element: an OpenLayers map on one side and a slide slider on the other.
863
+ *
864
+ * @example
865
+ * ```ts
866
+ * import { StoryMap } from "storymapjs";
867
+ * // from an inline data object
868
+ * const map = new StoryMap("embed", { storymap: { ... } }, { start_at_slide: 2 });
869
+ * // or straight from a source file (storymap JSON or IIIF manifest)
870
+ * const map2 = new StoryMap(document.getElementById("embed"), "./my-storymap.json");
871
+ * ```
872
+ */
873
+ declare class StoryMapBase {
874
+ "_loaded": {
875
+ storyslider: boolean;
876
+ map: boolean;
877
+ };
878
+ "on": EventedInstance["on"];
879
+ "version": string;
880
+ "ready": boolean;
881
+ "_el": {
882
+ container: HTMLElement;
883
+ menubar: HTMLElement;
884
+ map: HTMLElement;
885
+ storyslider: HTMLElement;
886
+ };
887
+ "_storyslider": StorySlider;
888
+ "_map": OpenLayers;
889
+ "map": Map_3;
890
+ "_menubar": MenuBar;
891
+ "data": StorymapData;
892
+ "options": StorymapOptions;
893
+ "current_slide": number;
894
+ "animator_map": AnimationHandle | null;
895
+ "animator_storyslider": AnimationHandle | null;
896
+ "_autoplay_timer": ReturnType<typeof setTimeout> | null;
897
+ "_autoplay_stopped": boolean;
898
+ "_hash_initialized": boolean;
899
+ /** the data source was a IIIF Presentation manifest (legacy zoomify options are ignored) */
900
+ "_data_from_manifest": boolean;
901
+ "_resize_observer": ResizeObserver | null;
902
+ "_resize_timer": ReturnType<typeof setTimeout> | null;
903
+ "fire": EventedInstance["fire"];
904
+ "hasEventListeners": EventedInstance["hasEventListeners"];
905
+ /**
906
+ * Create a StoryMap inside the given element.
907
+ *
908
+ * @param elem - The container element, or its DOM id.
909
+ * @param data - Either an inline storymap document (`{ storymap: ... }`),
910
+ * an inline IIIF Presentation 3 manifest, or the URL of a source file
911
+ * (storymap JSON or IIIF manifest) that is fetched automatically.
912
+ * @param options - Optional {@link StorymapOptions} overrides (map type,
913
+ * lines, fonts, animation, raw OpenLayers options via `map_options`...).
914
+ * @param listeners - Optional event listeners keyed by event name
915
+ * (`change`, `title`, `loaded`, ...) attached on creation.
916
+ */
917
+ constructor(elem: string | HTMLElement, data: string | StorymapDataWrapper | Record<string, unknown>, options?: Partial<StorymapOptions>, listeners?: Record<string, StoryMapListener | StoryMapListener[]>);
918
+ _initData(data: string | StorymapDataWrapper | Record<string, unknown>): void;
919
+ _loadDataFromUrl(url: string, source: string): Promise<void>;
920
+ _initOptions(): void;
921
+ _loadLanguage(): void;
922
+ _loadFontCss(): Promise<void>;
923
+ _onFontLoaded(font: string): void;
924
+ /**
925
+ * Navigate to a slide by index.
926
+ *
927
+ * @param n - Zero-based slide index; the map animates to the slide's
928
+ * marker (or the overview when `n` is 0 for storymaps with one).
929
+ */
930
+ goTo(n: number): void;
931
+ /**
932
+ * Re-measure the container and re-layout the map, slider and menubar.
933
+ * Called automatically on resize (see the `trackResize` option).
934
+ */
935
+ updateDisplay(): void;
936
+ /**
937
+ * Change a single map option at runtime and apply its effect immediately.
938
+ *
939
+ * Runtime-changeable options: `map_type` (rebuilds the tile layer),
940
+ * `show_lines`, `line_color`, `line_color_inactive`, `line_weight`,
941
+ * `line_opacity`, `line_dash`, `line_join`, `line_follows_path`,
942
+ * `show_history_line` (restyled instantly), `map_center_offset` (applied on
943
+ * the next navigation), `duration`, `ease`, `calculate_zoom`,
944
+ * `map_background_color`. All other options only take effect on the next
945
+ * navigation or require re-creating the StoryMap.
946
+ */
947
+ setMapOption(name: string, value: unknown): void;
948
+ /**
949
+ * Change several map options at runtime (see setMapOption).
950
+ */
951
+ setMapOptions(options: Partial<StorymapOptions>): void;
952
+ _initLayout(): void;
953
+ _initEvents(): void;
954
+ _updateDisplay(map_height?: number, animate?: boolean, d?: number): void;
955
+ _onDataLoaded(e?: unknown): void;
956
+ _startAutoplay(): void;
957
+ _scheduleAutoplay(): void;
958
+ _stopAutoplay(): void;
959
+ /** Keep the URL hash in sync with the current slide (#slide-N). */
960
+ _syncHash(): void;
961
+ /** A #slide-N hash deep-links the storymap (applied on load + hashchange). */
962
+ _applyHashSlide(): boolean;
963
+ _initResizeHandling(): void;
964
+ /**
965
+ * Resolve a caller-supplied map element (options.map_options.element).
966
+ * The passed element is "replaced by the real one": it is adopted as the
967
+ * map container (given the vco-map class) and moved into place between
968
+ * the menubar and the story slider.
969
+ */
970
+ _resolveMapElement(): HTMLElement | null;
971
+ _onTitle(e: unknown): void;
972
+ _onColorChange(e: {
973
+ color?: unknown;
974
+ image?: unknown;
975
+ }): void;
976
+ _onSlideChange(e: {
977
+ current_slide: number;
978
+ }): void;
979
+ _onMapChange(e: {
980
+ current_marker: number;
981
+ }): void;
982
+ _updateProgress(): void;
983
+ _onOverview(e?: unknown): void;
984
+ /**
985
+ * Toggle the native fullscreen API on the storymap container and keep the
986
+ * menubar button state in sync.
987
+ */
988
+ _onFullscreenToggle(e?: unknown): void;
989
+ _onFullscreenChange(): void;
990
+ _onBackToStart(e?: unknown): void;
991
+ _onMenuBarCollapse(e: {
992
+ y: number;
993
+ }): void;
994
+ _onMapLoaded(): void;
995
+ _onStorySliderLoaded(): void;
996
+ /**
997
+ * Compute and display the great-circle distance of the marker route
998
+ * (issue #341); hidden when `show_distance` is off.
999
+ */
1000
+ _updateDistance(): void;
1001
+ _onLoaded(): void;
1002
+ }
1003
+
1004
+ declare interface StorymapData {
1005
+ uniqueid?: string;
1006
+ slides: StorymapSlide[];
1007
+ [key: string]: unknown;
1008
+ }
1009
+
1010
+ declare interface StorymapDataWrapper {
1011
+ storymap: StorymapData;
1012
+ }
1013
+
1014
+ declare interface StorymapError {
1015
+ path: string;
1016
+ message: string;
1017
+ }
1018
+
1019
+ declare type StoryMapListener = (e: unknown) => void;
1020
+
1021
+ /** OpenLayers passthrough options (see StorymapOptions.map_options) */
1022
+ declare interface StorymapMapOptions {
1023
+ /** HTMLElement or DOM id that becomes the real map container */
1024
+ element?: HTMLElement | string;
1025
+ /** Merged over the default view configuration */
1026
+ view?: Record<string, unknown>;
1027
+ /** Replaces the default (empty) controls list */
1028
+ controls?: unknown[];
1029
+ /** Replaces the default (empty) interactions list */
1030
+ interactions?: unknown[];
1031
+ /** Any other ol/Map constructor option (layers, pixelRatio, ...) */
1032
+ [key: string]: unknown;
1033
+ }
1034
+
1035
+ declare interface StorymapOptions {
1036
+ width: number;
1037
+ height: number;
1038
+ layout: string;
1039
+ base_class: string;
1040
+ default_bg_color: {
1041
+ r: number;
1042
+ g: number;
1043
+ b: number;
1044
+ };
1045
+ map_size_sticky: number;
1046
+ map_center_offset: {
1047
+ left: number;
1048
+ top: number;
1049
+ } | null;
1050
+ less_bounce: boolean;
1051
+ start_at_slide: number;
1052
+ call_to_action: boolean;
1053
+ call_to_action_text: string;
1054
+ menubar_height: number;
1055
+ /** Show a fullscreen toggle button in the menubar (default: true) */
1056
+ fullscreen: boolean;
1057
+ /** Show the map overview button in the menubar (default: true) */
1058
+ show_overview: boolean;
1059
+ /** Show the back-to-the-beginning button in the menubar (default: true) */
1060
+ show_back_to_start: boolean;
1061
+ skinny_size: number;
1062
+ duration: number;
1063
+ ease: unknown;
1064
+ dragging: boolean;
1065
+ trackResize: boolean;
1066
+ /** Re-fetch the source file on every load, bypassing caches (issue #417) */
1067
+ nocache: boolean;
1068
+ /** Advance slides automatically every N milliseconds; 0 disables (issue #380) */
1069
+ autoplay: number;
1070
+ /** Show a progress bar in the menubar (issue #247) */
1071
+ show_progress: boolean;
1072
+ /** Show the slide headline as a label on the active map marker (issue #243) */
1073
+ marker_labels: boolean;
1074
+ /** Default text alignment for slide text: left, center or right (issue #244) */
1075
+ text_align: "left" | "center" | "right";
1076
+ /** Override the overview fit center (issues #107, #271) */
1077
+ map_overview_center: {
1078
+ lat: number;
1079
+ lon: number;
1080
+ } | null;
1081
+ map_type: string;
1082
+ attribution: string;
1083
+ map_mini: boolean;
1084
+ map_subdomains: string;
1085
+ map_as_image: boolean;
1086
+ map_access_token: string;
1087
+ map_background_color: string;
1088
+ /**
1089
+ * Limit the map to a bounding box `[west, south, east, north]` (lon/lat;
1090
+ * raw image pixel coordinates for image-space maps). Nothing outside of
1091
+ * the box can be visible. `null` (default) leaves the map unconstrained.
1092
+ */
1093
+ map_bbox: number[] | null;
1094
+ /**
1095
+ * Legacy zoomify image pyramid (map_type: "zoomify"): the tiles are
1096
+ * placed at the standard mercator tile positions, stretched from the
1097
+ * world's top-left corner.
1098
+ */
1099
+ zoomify?: {
1100
+ path?: string;
1101
+ width?: number;
1102
+ height?: number;
1103
+ tolerance?: number;
1104
+ attribution?: string;
1105
+ } | boolean;
1106
+ /**
1107
+ * Ask for permission before loading anything from external services
1108
+ * (media embeds, map tiles, external font CSS) — GDPR consent mode.
1109
+ * Grants are remembered per service in a cookie for 90 days.
1110
+ */
1111
+ consent_required: boolean;
1112
+ /** Slide text color override, sets --vco-color-text (issue #177) */
1113
+ text_color: string;
1114
+ /** Slide panel background color override (issue #177) */
1115
+ text_background_color: string;
1116
+ /** Show the great-circle route distance in the menubar (issue #341) */
1117
+ show_distance: boolean;
1118
+ /**
1119
+ * Raw OpenLayers map configuration. `controls` and `interactions` replace
1120
+ * the StoryMapJS defaults, `view` is merged over the computed default view
1121
+ * and `element` (an HTMLElement or DOM id) replaces the auto-created map
1122
+ * container div.
1123
+ */
1124
+ map_options: StorymapMapOptions;
1125
+ map_popup: boolean;
1126
+ zoom_distance: number;
1127
+ calculate_zoom: boolean;
1128
+ line_follows_path: boolean;
1129
+ line_color: string;
1130
+ line_color_inactive: string;
1131
+ line_join: string;
1132
+ line_weight: number;
1133
+ line_opacity: number;
1134
+ line_dash: string;
1135
+ show_lines: boolean;
1136
+ show_history_line: boolean;
1137
+ use_custom_markers: boolean;
1138
+ iiif: {
1139
+ url: string;
1140
+ attribution: string;
1141
+ };
1142
+ map_height: number;
1143
+ storyslider_height: number;
1144
+ slide_padding_lr: number;
1145
+ slide_default_fade: string;
1146
+ menubar_default_y: number;
1147
+ path_gfx: string;
1148
+ script_path: string;
1149
+ font_css: string;
1150
+ language: string;
1151
+ api_key_flickr: string;
1152
+ [key: string]: unknown;
1153
+ }
1154
+
1155
+ declare interface StorymapSlide {
1156
+ type?: string;
1157
+ date?: string | Record<string, unknown> | null;
1158
+ group?: string;
1159
+ location?: StorymapSlideLocation;
1160
+ media?: StorymapSlideMedia;
1161
+ text?: StorymapSlideText;
1162
+ background?: StorymapSlideBackground | string | null;
1163
+ uniqueid?: string;
1164
+ [key: string]: unknown;
1165
+ }
1166
+
1167
+ declare interface StorymapSlideBackground {
1168
+ url?: string | null;
1169
+ color?: string | null;
1170
+ opacity?: number;
1171
+ }
1172
+
1173
+ declare interface StorymapSlideLocation {
1174
+ lat?: number;
1175
+ lon?: number;
1176
+ zoom?: number;
1177
+ line?: boolean;
1178
+ icon?: string;
1179
+ iconSize?: number[];
1180
+ image?: string;
1181
+ use_custom_marker?: boolean;
1182
+ [key: string]: unknown;
1183
+ }
1184
+
1185
+ declare interface StorymapSlideMedia {
1186
+ url?: string | null;
1187
+ caption?: string | null;
1188
+ credit?: string | null;
1189
+ thumb?: string | null;
1190
+ mediatype?: MediaTypeMatch | null;
1191
+ [key: string]: unknown;
1192
+ }
1193
+
1194
+ declare interface StorymapSlideText {
1195
+ headline?: string;
1196
+ text?: string;
1197
+ text_align?: string;
1198
+ }
1199
+
1200
+ declare class StorySlider extends StorySlider_base {
1201
+ constructor(...args: ConstructorParameters<typeof StorySliderBase>);
1202
+ }
1203
+
1204
+ declare const StorySlider_base: {
1205
+ new (...args: any[]): {
1206
+ _vco_events?: Record<string, {
1207
+ action: unknown;
1208
+ context: unknown;
1209
+ }[]>;
1210
+ on(type: string, fn: unknown, context?: unknown): /*elided*/ any;
1211
+ hasEventListeners(type: string): boolean;
1212
+ off(type: string, fn: unknown, context?: unknown): /*elided*/ any;
1213
+ fire(type: string, data?: unknown, target?: unknown): /*elided*/ any;
1214
+ };
1215
+ } & typeof StorySliderBase;
1216
+
1217
+ declare class StorySliderBase {
1218
+ "_el": Record<string, HTMLElement>;
1219
+ "_nav": {
1220
+ previous: SlideNav;
1221
+ next: SlideNav;
1222
+ };
1223
+ "slide_spacing": number;
1224
+ "_slides": Slide[];
1225
+ "_swipable": Swipable;
1226
+ "preloadTimer": ReturnType<typeof setTimeout>;
1227
+ "_message": Message;
1228
+ "current_slide": number;
1229
+ "current_bg_color": string | null;
1230
+ "data": Partial<StorymapData>;
1231
+ "options": StorySliderOptions;
1232
+ "animator": AnimationHandle | null;
1233
+ "animator_background": AnimationHandle | null;
1234
+ "fire": EventedInstance["fire"];
1235
+ "_loaded": boolean;
1236
+ "hasEventListeners": EventedInstance["hasEventListeners"];
1237
+ constructor(elem: HTMLElement | string, data: Partial<StorymapData>, options?: Partial<StorySliderOptions>, init?: boolean);
1238
+ init(): void;
1239
+ updateDisplay(w?: number, h?: number, a?: unknown, l?: string): void;
1240
+ createSlide(d: StorymapSlide): void;
1241
+ createSlides(array: StorymapData["slides"]): void;
1242
+ _createSlides(array: StorymapData["slides"]): void;
1243
+ _createSlide(d: StorymapSlide, title_slide?: boolean): void;
1244
+ _addSlide(slide: Slide): void;
1245
+ goToId(n: string | number, fast?: boolean, displayupdate?: boolean): void;
1246
+ goTo(n: number, fast?: boolean, displayupdate?: boolean): void;
1247
+ preloadSlides(): void;
1248
+ getNavInfo(slide: Slide): {
1249
+ title: string;
1250
+ description: string;
1251
+ };
1252
+ next(): void;
1253
+ previous(): void;
1254
+ showNav(nav_obj: SlideNav, show: boolean): void;
1255
+ changeBackground(bg: SlideBackgroundChange): void;
1256
+ fadeInBackground(bg_css: string): void;
1257
+ _updateDisplay(width?: number, height?: number, animate?: unknown, layout?: string): void;
1258
+ _introInterface(): void;
1259
+ _initLayout(): void;
1260
+ _initEvents(): void;
1261
+ _onKeyDown(e: Event): void;
1262
+ _initData(): void;
1263
+ _onBackgroundChange(e: SlideBackgroundChange): void;
1264
+ _onMessageClick(e?: unknown): void;
1265
+ _onSwipeNoDirection(e?: unknown): void;
1266
+ _onNavigation(e: {
1267
+ direction: string;
1268
+ }): void;
1269
+ _onSlideAdded(e?: unknown): void;
1270
+ _onSlideChange(displayupdate?: boolean): void;
1271
+ _onLoaded(): void;
1272
+ }
1273
+
1274
+ declare interface StorySliderOptions {
1275
+ id?: string;
1276
+ layout: string;
1277
+ width: number;
1278
+ height: number;
1279
+ default_bg_color: {
1280
+ r: number;
1281
+ g: number;
1282
+ b: number;
1283
+ };
1284
+ slide_padding_lr: number;
1285
+ start_at_slide: number;
1286
+ slide_default_fade: string;
1287
+ duration: number;
1288
+ ease: unknown;
1289
+ skinny_size?: number;
1290
+ call_to_action?: boolean;
1291
+ call_to_action_text?: string;
1292
+ dragging?: boolean;
1293
+ trackResize?: boolean;
1294
+ [key: string]: unknown;
1295
+ }
1296
+
1297
+ declare class Swipable extends Swipable_base {
1298
+ constructor(...args: ConstructorParameters<typeof SwipableBase>);
1299
+ }
1300
+
1301
+ declare const Swipable_base: {
1302
+ new (...args: any[]): {
1303
+ _vco_events?: Record<string, {
1304
+ action: unknown;
1305
+ context: unknown;
1306
+ }[]>;
1307
+ on(type: string, fn: unknown, context?: unknown): /*elided*/ any;
1308
+ hasEventListeners(type: string): boolean;
1309
+ off(type: string, fn: unknown, context?: unknown): /*elided*/ any;
1310
+ fire(type: string, data?: unknown, target?: unknown): /*elided*/ any;
1311
+ };
1312
+ } & typeof SwipableBase;
1313
+
1314
+ declare class SwipableBase {
1315
+ "mousedrag": DragEventNames;
1316
+ "touchdrag": DragEventNames;
1317
+ "_el": Record<string, HTMLElement>;
1318
+ "options": SwipableOptions;
1319
+ "animator": AnimationHandle | null;
1320
+ "dragevent": DragEventNames;
1321
+ "data": DragData;
1322
+ "fire": EventedInstance["fire"];
1323
+ constructor(drag_elem: HTMLElement, move_elem?: HTMLElement, options?: Record<string, unknown>);
1324
+ enable(e?: LegacyEvent): void;
1325
+ disable(): void;
1326
+ stopMomentum(): void;
1327
+ updateConstraint(c: SwipableOptions["constraint"]): void;
1328
+ _onDragStart(e: LegacyEvent): void;
1329
+ _onDragEnd(e: LegacyEvent): void;
1330
+ _onDragMove(e: LegacyEvent): void;
1331
+ _momentum(): void;
1332
+ _animateMomentum(): void;
1333
+ }
1334
+
1335
+ declare interface SwipableOptions {
1336
+ snap: boolean;
1337
+ enable: {
1338
+ x: boolean;
1339
+ y: boolean;
1340
+ };
1341
+ constraint: {
1342
+ top: number | boolean;
1343
+ bottom: number | boolean;
1344
+ left: number | boolean;
1345
+ right: number | boolean;
1346
+ };
1347
+ momentum_multiplier: number;
1348
+ duration: number;
1349
+ ease: unknown;
1350
+ }
1351
+
1352
+ declare class Text_2 extends Text_base {
1353
+ constructor(...args: ConstructorParameters<typeof TextBase>);
1354
+ }
1355
+
1356
+ declare const Text_base: {
1357
+ new (...args: any[]): {
1358
+ _vco_events?: Record<string, {
1359
+ action: unknown;
1360
+ context: unknown;
1361
+ }[]>;
1362
+ on(type: string, fn: unknown, context?: unknown): /*elided*/ any;
1363
+ hasEventListeners(type: string): boolean;
1364
+ off(type: string, fn: unknown, context?: unknown): /*elided*/ any;
1365
+ fire(type: string, data?: unknown, target?: unknown): /*elided*/ any;
1366
+ };
1367
+ } & typeof TextBase;
1368
+
1369
+ declare class TextBase {
1370
+ "_el": Record<string, HTMLElement>;
1371
+ "data": TextData;
1372
+ "options": TextOptions;
1373
+ "fire": EventedInstance["fire"];
1374
+ constructor(data: TextData, options?: TextOptions, add_to_container?: HTMLElement);
1375
+ show(): void;
1376
+ hide(): void;
1377
+ addTo(container: HTMLElement): void;
1378
+ removeFrom(container: HTMLElement): void;
1379
+ headlineHeight(): number;
1380
+ addDateText(str: string): void;
1381
+ onLoaded(): void;
1382
+ onAdd(): void;
1383
+ onRemove(): void;
1384
+ _initLayout(): void;
1385
+ }
1386
+
1387
+ declare interface TextData {
1388
+ uniqueid?: string | null;
1389
+ headline?: string;
1390
+ text?: string;
1391
+ text_align?: string;
1392
+ date?: {
1393
+ created_time?: string;
1394
+ [key: string]: unknown;
1395
+ } | null;
1396
+ }
1397
+
1398
+ declare interface TextOptions {
1399
+ title?: boolean;
1400
+ text_align?: string;
1401
+ }
1402
+
1403
+ /** Validate storymap JSON (the object containing a "storymap" property). */
1404
+ export declare function validateStorymap(data: unknown): StorymapError[];
1405
+
1406
+ /** Validate and report all errors to the JavaScript console. Returns true when valid. */
1407
+ export declare function validateStorymapAndReport(data: unknown, source?: string): boolean;
1408
+
1409
+ /** Options accepted by viewTo/_viewTo. */
1410
+ declare interface ViewToOptions {
1411
+ calculate_zoom?: boolean;
1412
+ duration?: number;
1413
+ zoom?: number;
1414
+ }
1415
+
1416
+ export { }
1417
+
1418
+ // Externally loaded script globals (YouTube/SoundCloud player APIs).
1419
+ // Everything the library or the test harness touches on window is typed
1420
+ // at its usage site instead.
1421
+
1422
+ declare global {
1423
+ // Externally loaded script globals
1424
+ const YT: {
1425
+ Player: new (el: HTMLElement | string, opts: unknown) => unknown;
1426
+ PlayerState: Record<string, number>;
1427
+ };
1428
+ const SC: {
1429
+ Widget: (el: HTMLElement) => { pause(): void };
1430
+ };
1431
+ }