@tileflow/core 0.1.0-alpha.38 → 0.1.0-alpha.39

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/browser.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TileflowSymbolStyle, a as TileflowThemeImageValue, b as TileflowThemeColorValue, c as TileflowMarkerSymbolStyle, d as TileflowAreaStyle, e as TileflowLineStackStyle, f as TileflowLineHatchStyle, g as TileflowIconStyle, h as TileflowLinePaint, i as TileflowThemeNumberValue, j as TileflowNumberStyleValue, k as TileflowCircleStyle, l as TileflowLineStyle, m as TileflowFillStyle, n as TileflowExtrusionStyle, o as TileflowBackgroundStyle, p as TileflowSymbolPlacement, q as TileflowVegetationModuleConfig, r as TileflowTileLayer, s as TileflowMap3DOptions, t as TileflowMap3D, u as TileflowViewMode, v as TileflowSun } from './3d-D9c3i78O.js';
2
- export { w as TileflowBuildings3D, x as TileflowBuildings3DChange, y as TileflowBuildings3DMap, z as TileflowBuildings3DOptions, A as TileflowBuildings3DThemes, B as TileflowMap3DMap, C as TileflowStreetLights, D as TileflowStreetLightsMap, E as TileflowStreetLightsOptions, F as TileflowSunPreset, G as TileflowTile, H as TileflowTileAddress, I as TileflowTileAreaRequest, J as TileflowTileFeature, K as TileflowTileGeometryType, L as TileflowTileReader, M as TileflowTileReaderOptions, N as TileflowTileRequestTransform, O as TileflowTileSourceMap, P as TileflowTreeFields, Q as TileflowTreeForm, R as TileflowTreeFormMix, S as TileflowTreeFormRange, U as TileflowTreeLayers, V as TileflowTreePlacement, W as TileflowTreePlacementOptions, X as TileflowTreeRange, Y as TileflowTreeRegion, Z as TileflowTrees3D, _ as TileflowTrees3DChange, $ as TileflowTrees3DMap, a0 as TileflowTrees3DOptions, a1 as TileflowTrees3DThemes, a2 as TileflowVectorTileDecodeOptions, a3 as TileflowVegetation3D, a4 as TileflowVegetationController, a5 as TileflowVegetationDisplay, a6 as TileflowVegetationOptions, a7 as TileflowVegetationRepresentation, a8 as createTileflowBuildings3D, a9 as createTileflowMap3D, aa as createTileflowStreetLights, ab as createTileflowTileReader, ac as createTileflowTrees3D, ad as createTileflowVegetation, ae as decodeTileflowVectorTile, af as mixTileflowSunPresets, ag as placeTileflowTrees, ah as readTileflowMapTileSource, ai as readTileflowSunPreset, aj as readTileflowVegetation3D, ak as readTileflowVegetationDisplay, al as resolveTileflowSun, am as resolveTileflowVegetationRepresentation, an as tileflowBuildings3DLayerId, ao as tileflowDefaultSunPreset, ap as tileflowStreetLightsLayerId, aq as tileflowStyleSunPreset, ar as tileflowSunDirection, as as tileflowSunMetadataKey, at as tileflowSunPosition, au as tileflowTilePointToLngLat, av as tileflowTilesForBounds, aw as tileflowTreeBytes, ax as tileflowTreeFormOf, ay as tileflowTreeForms, az as tileflowTrees3DLayerId, aA as tileflowVegetationDisplayMetadataKey, aB as tileflowVegetationMetadataKey } from './3d-D9c3i78O.js';
1
+ import { T as TileflowSymbolStyle, a as TileflowThemeImageValue, b as TileflowThemeColorValue, c as TileflowMarkerSymbolStyle, d as TileflowAreaStyle, e as TileflowLineStackStyle, f as TileflowLineHatchStyle, g as TileflowIconStyle, h as TileflowLinePaint, i as TileflowThemeNumberValue, j as TileflowNumberStyleValue, k as TileflowCircleStyle, l as TileflowLineStyle, m as TileflowFillStyle, n as TileflowExtrusionStyle, o as TileflowBackgroundStyle, p as TileflowSymbolPlacement, q as TileflowVegetationModuleConfig, r as TileflowTileLayer, s as TileflowMap3DOptions, t as TileflowMap3D, u as TileflowViewMode, v as TileflowSun } from './3d-BkaJjwfk.js';
2
+ export { w as TileflowBuildings3D, x as TileflowBuildings3DChange, y as TileflowBuildings3DMap, z as TileflowBuildings3DOptions, A as TileflowBuildings3DThemes, B as TileflowMap3DMap, C as TileflowStreetLights, D as TileflowStreetLightsMap, E as TileflowStreetLightsOptions, F as TileflowSunPreset, G as TileflowTile, H as TileflowTileAddress, I as TileflowTileAreaRequest, J as TileflowTileFeature, K as TileflowTileGeometryType, L as TileflowTileReader, M as TileflowTileReaderOptions, N as TileflowTileRequestTransform, O as TileflowTileSourceMap, P as TileflowTreeFields, Q as TileflowTreeForm, R as TileflowTreeFormMix, S as TileflowTreeFormRange, U as TileflowTreeLayers, V as TileflowTreePlacement, W as TileflowTreePlacementOptions, X as TileflowTreeRange, Y as TileflowTreeRegion, Z as TileflowTrees3D, _ as TileflowTrees3DChange, $ as TileflowTrees3DMap, a0 as TileflowTrees3DOptions, a1 as TileflowTrees3DThemes, a2 as TileflowVectorTileDecodeOptions, a3 as TileflowVegetation3D, a4 as TileflowVegetationController, a5 as TileflowVegetationDisplay, a6 as TileflowVegetationOptions, a7 as TileflowVegetationRepresentation, a8 as createTileflowBuildings3D, a9 as createTileflowMap3D, aa as createTileflowStreetLights, ab as createTileflowTileReader, ac as createTileflowTrees3D, ad as createTileflowVegetation, ae as decodeTileflowVectorTile, af as mixTileflowSunPresets, ag as placeTileflowTrees, ah as readTileflowMapTileSource, ai as readTileflowSunPreset, aj as readTileflowVegetation3D, ak as readTileflowVegetationDisplay, al as resolveTileflowSun, am as resolveTileflowVegetationRepresentation, an as tileflowBuildings3DLayerId, ao as tileflowDefaultSunPreset, ap as tileflowStreetLightsLayerId, aq as tileflowStyleSunPreset, ar as tileflowSunDirection, as as tileflowSunMetadataKey, at as tileflowSunPosition, au as tileflowTilePointToLngLat, av as tileflowTilesForBounds, aw as tileflowTreeBytes, ax as tileflowTreeFormOf, ay as tileflowTreeForms, az as tileflowTrees3DLayerId, aA as tileflowVegetationDisplayMetadataKey, aB as tileflowVegetationMetadataKey } from './3d-BkaJjwfk.js';
3
3
 
4
4
  type TileflowColor = `#${string}`;
5
5
  type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
@@ -302,7 +302,12 @@ type TileflowDynamicImageMap = {
302
302
  off(event: string, listener: () => void): unknown;
303
303
  };
304
304
 
305
- type TileflowFairUseNoticeState = 'GRACE' | 'MANAGED_REQUIRED';
305
+ /**
306
+ * `GRACE` and `MANAGED_REQUIRED` come from the site's fair-use state. `LIMITED` means Tileflow is
307
+ * temporarily limiting anonymous World delivery for everyone: cached areas keep loading while some
308
+ * uncached areas fail, and a managed map is not affected.
309
+ */
310
+ type TileflowFairUseNoticeState = 'GRACE' | 'MANAGED_REQUIRED' | 'LIMITED';
306
311
  type TileflowFairUseNotice = Readonly<{
307
312
  action: string;
308
313
  helpUrl: string;
@@ -331,6 +336,7 @@ type TileflowFairUseNoticeController = Readonly<{
331
336
  declare function registerTileflowWorldRequestBridge(input: {
332
337
  addProtocol: (name: string, handler: TileflowWorldProtocolHandler) => void;
333
338
  fetch?: typeof fetch;
339
+ now?: () => number;
334
340
  onNotice: (notice: TileflowFairUseNotice | null) => void;
335
341
  }): TileflowWorldRequestBridge;
336
342
  declare function tileflowFairUseNoticeMessage(state: TileflowFairUseNoticeState): string;
@@ -549,12 +555,22 @@ type TileflowLandformsModuleConfig = TileflowLandformsModuleOptions & {
549
555
  type: 'landforms';
550
556
  };
551
557
 
552
- /** Labels anchored inside polygon features; point-feature labels remain on their feature style. */
558
+ /**
559
+ * Labels anchored inside polygon features, and the clearance labels of bridges and overhead cables;
560
+ * other point-feature labels remain on their feature style.
561
+ */
553
562
  type TileflowNauticalAreaLabelStyles = {
563
+ /**
564
+ * Vertical clearance of bridges, or their clearance closed and open, at bridge points and inside
565
+ * bridge polygons; bridge lines carry it at their centre.
566
+ */
567
+ bridges?: TileflowSymbolStyle;
554
568
  /** Provider coverage cells; hidden unless a map makes this style visible. */
555
569
  coverage?: TileflowSymbolStyle;
556
570
  hazards?: TileflowSymbolStyle;
557
571
  navigationAreas?: TileflowSymbolStyle;
572
+ /** Safe vertical clearance of overhead cables, at cable points and along cable lines. */
573
+ overheadCables?: TileflowSymbolStyle;
558
574
  reefs?: TileflowSymbolStyle;
559
575
  wrecks?: TileflowSymbolStyle;
560
576
  };
@@ -567,15 +583,33 @@ type TileflowNauticalAreaLabelStyles = {
567
583
  type TileflowNauticalModuleOptions = {
568
584
  /** Other aids: moorings, fog signals, racons, radio and signal stations, and virtual aids. */
569
585
  aids?: TileflowMarkerSymbolStyle;
586
+ /**
587
+ * Flash each light in its rhythm where a browser runtime animates the map. Defaults to `true`.
588
+ * `false` keeps every light steady, as do reduced motion, capture, and native renderers.
589
+ */
590
+ animateLights?: boolean;
570
591
  /** Fixed beacons and daymarks, coloured by their first colour. */
571
592
  beacons?: TileflowMarkerSymbolStyle;
593
+ /** Berth polygons; the outline also strokes berth lines and emphasises guest berths. */
594
+ berths?: TileflowAreaStyle;
595
+ /** Bridge polygons; the outline also strokes bridge lines. */
596
+ bridges?: TileflowAreaStyle;
572
597
  /** Buoys, light floats, and light vessels, coloured by their first colour. */
573
598
  buoys?: TileflowMarkerSymbolStyle;
574
599
  /** Submarine cable and pipeline lines. */
575
600
  cables?: TileflowLineStyle;
576
601
  /** Restrained indication of where a provider publishes marks. */
577
602
  coverage?: TileflowAreaStyle;
578
- /** Harbour and marina points. */
603
+ /** Waterway distance marks with their distance and unit. */
604
+ distanceMarks?: TileflowMarkerSymbolStyle;
605
+ /**
606
+ * Small-craft facilities such as fuel, water, slipways, pump-out, visitor berths, boat hoists,
607
+ * and boatyards, at facility points, inside facility polygons, and at the centre of their lines.
608
+ */
609
+ facilities?: TileflowMarkerSymbolStyle;
610
+ /** Harbour and marina polygons. */
611
+ harbourAreas?: TileflowAreaStyle;
612
+ /** Harbour and marina points, and their symbol and name inside harbour polygons. */
579
613
  harbours?: TileflowMarkerSymbolStyle;
580
614
  /** Hazard areas; the outline also strokes linear hazards such as booms. */
581
615
  hazardAreas?: TileflowAreaStyle;
@@ -587,6 +621,10 @@ type TileflowNauticalModuleOptions = {
587
621
  lights?: TileflowMarkerSymbolStyle;
588
622
  /** Restricted, military, anchorage, traffic-separation, and other navigation areas. */
589
623
  navigationAreas?: TileflowAreaStyle;
624
+ /** Inland notice boards coloured by function, with the information they show. */
625
+ notices?: TileflowMarkerSymbolStyle;
626
+ /** Overhead cable lines. */
627
+ overheadCables?: TileflowLineStyle;
590
628
  /** Ports, sized by `size` and placed by `rank` from low zooms. */
591
629
  ports?: TileflowMarkerSymbolStyle;
592
630
  reefs?: TileflowAreaStyle;
@@ -817,6 +855,70 @@ type TileflowThemeMotionMap = {
817
855
  updateImage?: unknown;
818
856
  };
819
857
 
858
+ declare const tileflowSkyLayerId = "tileflow-sky";
859
+ /** The MapLibre GL JS map capabilities the sky layer uses; importing this module loads no renderer. */
860
+ type TileflowSkyMap = {
861
+ addLayer(layer: object, beforeId?: string): unknown;
862
+ getBearing(): number;
863
+ getLayer(id: string): unknown;
864
+ getPitch(): number;
865
+ getSky?(): unknown;
866
+ getStyle(): unknown;
867
+ getTerrain?(): unknown;
868
+ getVerticalFieldOfView?(): number;
869
+ isStyleLoaded(): boolean | void;
870
+ off(event: string, listener: () => void): unknown;
871
+ on(event: string, listener: () => void): unknown;
872
+ removeLayer(id: string): unknown;
873
+ };
874
+ /**
875
+ * Light in the sky above the horizon, for maps that declare a sky: a glow on the horizon towards
876
+ * a low sun, the sun's disc as it sets or rises, and stars as the sky darkens. The sun is the one
877
+ * a theme controller shows, so a sun an application places by date brings its glow; without a
878
+ * controller, the theme's own sun. The layer sits under every other layer and draws only where
879
+ * nothing else has, so buildings and trees stand in front. Follows style replacements; the
880
+ * returned function removes the layer.
881
+ */
882
+ declare function attachTileflowSky(map: TileflowSkyMap): () => void;
883
+
884
+ declare const tileflowSkyHazeLayerId = "tileflow-sky-haze";
885
+ /** The MapLibre GL JS map capabilities the haze reads; importing this module loads no renderer. */
886
+ type TileflowSkyHazeView = {
887
+ getBearing?(): number;
888
+ getCanvas?(): {
889
+ clientHeight: number;
890
+ };
891
+ getCenter?(): {
892
+ lat: number;
893
+ lng: number;
894
+ };
895
+ getPitch(): number;
896
+ getSky?(): unknown;
897
+ getVerticalFieldOfView?(): number;
898
+ getZoom?(): number;
899
+ };
900
+ /** The map capabilities the haze layer uses. */
901
+ type TileflowSkyHazeMap = TileflowSkyHazeView & {
902
+ addLayer(layer: object, beforeId?: string): unknown;
903
+ getLayer(id: string): unknown;
904
+ getLayersOrder?(): string[];
905
+ getStyle(): unknown;
906
+ getTerrain?(): unknown;
907
+ moveLayer?(id: string, beforeId?: string): unknown;
908
+ off(event: string, listener: () => void): unknown;
909
+ on(event: string, listener: () => void): unknown;
910
+ removeLayer(id: string): unknown;
911
+ };
912
+ /**
913
+ * The distance haze over the flat map, for maps with a sky: a band of the sky's horizon colour from
914
+ * where the haze starts up to the horizon, thickening with the flat ground's distance, so the
915
+ * ground meets the sky in the colour the sky starts with. It sits under the first 3D layer (or,
916
+ * without one, the first label layer); Tileflow's 3D buildings, trees and models haze themselves
917
+ * in their own shaders, and labels drawn above it stay clear. It shows only above 45° of pitch,
918
+ * costs one quad, and follows style replacements; the returned function removes it.
919
+ */
920
+ declare function attachTileflowSkyHaze(map: TileflowSkyHazeMap): () => void;
921
+
820
922
  /** Structural MapLibre capabilities; importing this module never loads a renderer. */
821
923
  type TileflowAtmosphereMap = {
822
924
  getBearing(): number;
@@ -836,13 +938,64 @@ type TileflowAtmosphereMap = {
836
938
  } | undefined;
837
939
  on(event: 'move' | 'resize' | 'style.load' | 'remove', listener: () => void): unknown;
838
940
  off(event: 'move' | 'resize' | 'style.load' | 'remove', listener: () => void): unknown;
839
- };
941
+ } & Partial<TileflowSkyMap> & Partial<TileflowSkyHazeMap>;
840
942
  /**
841
- * Render compiled globe atmosphere metadata. Call after constructing a browser map.
842
- * Follows style replacements and releases its canvas, listeners, and pending frame on disposal.
943
+ * Render compiled globe atmosphere metadata, and the stars and distance haze of a sky. Call after
944
+ * constructing a browser map. Follows style replacements and releases its canvas, layer,
945
+ * listeners, and pending frame on disposal.
843
946
  */
844
947
  declare function attachTileflowAtmosphere(map: TileflowAtmosphereMap): () => void;
845
948
 
949
+ /**
950
+ * The steepest camera pitch Tileflow supports, in degrees from looking straight down. Every
951
+ * portable view admits pitch 0–85, and Tileflow's maps raise MapLibre's own default of 60 to this,
952
+ * so a street-level view looks along the street to the sky. A map's `mapOptions.maxPitch` lowers it.
953
+ */
954
+ declare const tileflowMaxPitch = 85;
955
+
956
+ declare const tileflowSkyMetadataKey = "tileflow:sky";
957
+ /** One theme's sky colours, as a time of day lends them to a sky that follows the sun. */
958
+ type TileflowSkyColours = Readonly<{
959
+ color: string;
960
+ horizonColor: string;
961
+ horizonBlend: number;
962
+ glowColor: string;
963
+ }>;
964
+ /** The skies of a theme's time-of-day family, from which a sky that follows the sun is mixed. */
965
+ type TileflowSkyTimesOfDay = Readonly<Record<'day' | 'dawn' | 'dusk' | 'night', TileflowSkyColours>>;
966
+ /**
967
+ * The versioned runtime payload: what the browser needs to draw the stars and the glow round the
968
+ * sun, and, for a theme in a time-of-day family, the family's skies, so that a sun an application
969
+ * places brings the sky of its hour.
970
+ */
971
+ type TileflowSkyMetadata = Readonly<{
972
+ version: 1;
973
+ starIntensity: number;
974
+ glowColor: string;
975
+ timesOfDay?: TileflowSkyTimesOfDay;
976
+ }>;
977
+ /** Validate the runtime payload without loading authoring schemas. */
978
+ declare function readTileflowSky(value: unknown): TileflowSkyMetadata | undefined;
979
+ /**
980
+ * The sky of a sun at this height and direction, mixed from a time-of-day family's skies: the day
981
+ * sky above the golden hour, the dawn or dusk sky within two degrees of sunrise or sunset (dawn while the sun is in
982
+ * the eastern half of the sky), and the night sky once twilight ends. Every colour comes from the
983
+ * family's themes, so a monochrome or a client's own family keeps its palette.
984
+ */
985
+ declare function tileflowSkyAtSun(times: TileflowSkyTimesOfDay, sun: Readonly<{
986
+ altitude: number;
987
+ azimuth: number;
988
+ }>): TileflowSkyColours;
989
+
990
+ /**
991
+ * The WebGL context a browser map asks for. Multisampling is on, so the thin edges of 3D models,
992
+ * buildings and trees resolve smoothly instead of breaking into stipple. Attributes the caller
993
+ * passes win, so `{antialias: false}` opts out.
994
+ */
995
+ declare function tileflowCanvasContextAttributes<T extends object>(attributes?: T): T & {
996
+ antialias: boolean;
997
+ };
998
+
846
999
  /**
847
1000
  * Boundaries families. Each one has its own license, attribution, TileJSON path and style source
848
1001
  * ID; families are never merged.
@@ -873,7 +1026,7 @@ type TileflowBoundaryValues = Readonly<{
873
1026
  rows: readonly TileflowBoundaryRow[];
874
1027
  }>;
875
1028
 
876
- type FeatureTarget = {
1029
+ type FeatureTarget$1 = {
877
1030
  id?: number | string;
878
1031
  source: string;
879
1032
  sourceLayer?: string;
@@ -886,8 +1039,8 @@ type TileflowFeatureStateMap = {
886
1039
  } | undefined;
887
1040
  off(type: 'styledata', listener: () => void): unknown;
888
1041
  on(type: 'styledata', listener: () => void): unknown;
889
- removeFeatureState(target: FeatureTarget, key?: string): void;
890
- setFeatureState(target: FeatureTarget & {
1042
+ removeFeatureState(target: FeatureTarget$1, key?: string): void;
1043
+ setFeatureState(target: FeatureTarget$1 & {
891
1044
  id: number | string;
892
1045
  }, state: Record<string, unknown>): void;
893
1046
  };
@@ -1548,6 +1701,182 @@ declare const tileflowNoticeLimits: Readonly<{
1548
1701
  /** Read bounded notices from style metadata; malformed entries are ignored, never rendered. */
1549
1702
  declare function readTileflowNotices(metadata: unknown): readonly TileflowMapNotice[];
1550
1703
 
1704
+ type FeatureId = number | string;
1705
+ type FeatureTarget = {
1706
+ id: FeatureId;
1707
+ source: string;
1708
+ sourceLayer: string;
1709
+ };
1710
+ type TileflowNauticalLightsEvent = 'idle' | 'moveend' | 'remove' | 'sourcedata' | 'style.load' | 'styledata';
1711
+ /** Structural MapLibre capabilities; importing this module never loads a renderer. */
1712
+ type TileflowNauticalLightsMap = {
1713
+ getContainer(): HTMLElement;
1714
+ getLayer(id: string): {
1715
+ maxzoom?: number;
1716
+ minzoom?: number;
1717
+ } | undefined;
1718
+ getLayoutProperty(id: string, name: 'visibility'): unknown;
1719
+ getSource(id: string): unknown;
1720
+ getStyle(): {
1721
+ metadata?: unknown;
1722
+ } | undefined;
1723
+ getZoom(): number;
1724
+ off(event: TileflowNauticalLightsEvent, listener: (event?: {
1725
+ sourceId?: unknown;
1726
+ }) => void): unknown;
1727
+ on(event: TileflowNauticalLightsEvent, listener: (event?: {
1728
+ sourceId?: unknown;
1729
+ }) => void): unknown;
1730
+ queryRenderedFeatures(options: {
1731
+ layers: string[];
1732
+ }): readonly {
1733
+ id?: unknown;
1734
+ properties?: Record<string, unknown> | null;
1735
+ }[];
1736
+ removeFeatureState(target: FeatureTarget, key?: string): unknown;
1737
+ setFeatureState(target: FeatureTarget, state: Record<string, number>): unknown;
1738
+ };
1739
+ /**
1740
+ * Flash the Nautical lights of a compiled style in their rhythms. The style's
1741
+ * `tileflow:nautical-lights` metadata names the light layers; for each light drawn in them, the
1742
+ * helper derives its rhythm (`tileflowLightRhythm`) and writes the light's intensity and colour as
1743
+ * MapLibre feature state whenever its phase changes. Lights that are in the same phase change
1744
+ * together, and the helper wakes only for the next change.
1745
+ *
1746
+ * Nothing is written, and no timer runs, while the page is hidden, while no light layer is
1747
+ * visible at the current zoom, or when no drawn light has a rhythm. When the person viewing the
1748
+ * map prefers reduced motion, or on disposal or map `remove`, every light returns to steady.
1749
+ * Lights are identified by the feature ID their source promotes; the compiled Nautical source
1750
+ * promotes each light's unique `provenance`. A light without an ID stays steady.
1751
+ */
1752
+ declare function attachTileflowNauticalLights(map: TileflowNauticalLightsMap): () => void;
1753
+
1754
+ /** Style metadata key that names the layers whose Nautical lights flash in their rhythm. */
1755
+ declare const tileflowNauticalLightsMetadataKey: "tileflow:nautical-lights";
1756
+ /**
1757
+ * MapLibre feature-state keys the light layers read. A runtime writes them per light feature; a
1758
+ * light without them shows steadily, exactly as a map that is not animated.
1759
+ */
1760
+ declare const tileflowNauticalLightStates: Readonly<{
1761
+ /** Index of the colour shown, into the light's comma-separated `color` list. */
1762
+ colour: "tileflowLightColour";
1763
+ /** `1` while the light shines, `0` while it is eclipsed, in between for a fixed part. */
1764
+ intensity: "tileflowLightIntensity";
1765
+ }>;
1766
+ /** The light layers of a compiled style and the source features they draw. */
1767
+ type TileflowNauticalLights = Readonly<{
1768
+ layers: readonly string[];
1769
+ source: string;
1770
+ sourceLayer: string;
1771
+ version: 1;
1772
+ }>;
1773
+ /** Read the bounded light declaration of style metadata; a malformed one is ignored. */
1774
+ declare function readTileflowNauticalLights(metadata: unknown): TileflowNauticalLights | undefined;
1775
+
1776
+ /** One phase of a light's cycle. */
1777
+ type TileflowLightPhase = Readonly<{
1778
+ /** Index of the colour shown, into the light's comma-separated `color` list. */
1779
+ colour: number;
1780
+ /** Seconds, with millisecond precision. */
1781
+ duration: number;
1782
+ /**
1783
+ * `1` while the light shines, `0` while it is eclipsed, and
1784
+ * `tileflowLightRhythmConventions.fixedIntensity` for the steady part of a fixed-and-flashing light.
1785
+ */
1786
+ intensity: number;
1787
+ }>;
1788
+ /** A light's repeating cycle. Lights with the same `key` flash identically. */
1789
+ type TileflowLightRhythm = Readonly<{
1790
+ /** A canonical description of the phases; equal rhythms have equal keys. */
1791
+ key: string;
1792
+ /** Seconds, the sum of the phase durations. */
1793
+ period: number;
1794
+ phases: readonly TileflowLightPhase[];
1795
+ }>;
1796
+ /** What the light shows at a moment, and for how many more seconds. */
1797
+ type TileflowLightState = Readonly<{
1798
+ colour: number;
1799
+ intensity: number;
1800
+ /** Seconds until the next phase begins; always positive. */
1801
+ remaining: number;
1802
+ }>;
1803
+ /** The `nautical-v1` light fields that define a rhythm; other properties are ignored. */
1804
+ type TileflowLightCharacteristic = Readonly<{
1805
+ character?: unknown;
1806
+ color?: unknown;
1807
+ group?: unknown;
1808
+ period_s?: unknown;
1809
+ sequence?: unknown;
1810
+ }>;
1811
+ /**
1812
+ * The conventions used when a light publishes no `sequence`. Durations are in seconds.
1813
+ *
1814
+ * - `Fl`: flashes of `min(flash, flashShare × period / flashes)`. Flashes of one group are
1815
+ * separated by an eclipse of at most twice the flash, groups of a composite group such as
1816
+ * `2+1` by twice that eclipse, and the remainder of the period is the final eclipse.
1817
+ * - `LFl`: the same layout with flashes of `longFlash`, or `flashShare × period / flashes` when
1818
+ * the period is too short for them.
1819
+ * - `Q`, `VQ`, `UQ`: one flash per `quickCycle` (60, 120 and 240 per minute), lit for
1820
+ * `quickDuty` of each cycle. Without a group they flash continuously; with a group of `n` they
1821
+ * flash `n` times, then stay eclipsed until the period ends.
1822
+ * - `IQ`, `IVQ`, `IUQ`: quick flashes for `interruptedShare` of the period, then an eclipse.
1823
+ * - `Iso`: light and eclipse of equal length.
1824
+ * - `Oc`: eclipses of `occultingShare × period / eclipses`, laid out like `Fl` with light and
1825
+ * eclipse exchanged, so the light is always longer than the eclipse.
1826
+ * - `Mo`: the Morse letters of `group`, with dots of `morseUnit` (shortened to fit the
1827
+ * period), dashes of three units, one unit between signals and three between letters; the
1828
+ * remainder of the period, or seven units without one, is the eclipse.
1829
+ * - `FFl`: a fixed light at `fixedIntensity` with full-intensity flashes laid out like `Fl`;
1830
+ * `F+LFl` does the same with long flashes.
1831
+ * - `Q+LFl`, `VQ+LFl`, `UQ+LFl`, `Fl+LFl`: the group of the first part (six quick flashes when
1832
+ * absent), then one long flash, then the eclipse.
1833
+ * - `Oc+Fl`: drawn as its occulting part.
1834
+ * - `Al.<character>`: the rhythm of that character, each lit phase taking the next colour of
1835
+ * `color`; `Al` alone shows each colour for an equal share of the period.
1836
+ * - Grouped `Q`/`VQ` and `Q+LFl`/`VQ+LFl` without a period use the cardinal-mark periods of
1837
+ * `cardinalPeriods`.
1838
+ *
1839
+ * `F`, an absent or unknown character, a missing period where one is needed, or a layout that
1840
+ * does not fit its period leaves the light steady.
1841
+ */
1842
+ declare const tileflowLightRhythmConventions: Readonly<{
1843
+ cardinalPeriods: Readonly<{
1844
+ Q: Readonly<{
1845
+ 3: 10;
1846
+ 6: 15;
1847
+ 9: 15;
1848
+ }>;
1849
+ 'Q+LFl': 15;
1850
+ VQ: Readonly<{
1851
+ 3: 5;
1852
+ 6: 10;
1853
+ 9: 10;
1854
+ }>;
1855
+ 'VQ+LFl': 10;
1856
+ }>;
1857
+ fixedIntensity: 0.5;
1858
+ flash: 1;
1859
+ flashShare: 0.3;
1860
+ interruptedShare: 0.6;
1861
+ longFlash: 2;
1862
+ morseUnit: 0.5;
1863
+ occultingShare: 0.25;
1864
+ quickCycle: Readonly<{
1865
+ Q: 1;
1866
+ UQ: 0.25;
1867
+ VQ: 0.5;
1868
+ }>;
1869
+ quickDuty: 0.3;
1870
+ }>;
1871
+ /**
1872
+ * The rhythm of one light, or `undefined` when it shows steadily: a fixed light, or one without a
1873
+ * usable characteristic. `sequence` wins when it is well formed; otherwise the rhythm follows
1874
+ * `tileflowLightRhythmConventions`.
1875
+ */
1876
+ declare function tileflowLightRhythm(light: TileflowLightCharacteristic): TileflowLightRhythm | undefined;
1877
+ /** What `rhythm` shows `seconds` after the shared epoch of every rhythm. */
1878
+ declare function tileflowLightStateAt(rhythm: TileflowLightRhythm, seconds: number): TileflowLightState;
1879
+
1551
1880
  declare const tileflowMaplibreContourVersion: "0.1.0";
1552
1881
  type TileflowContourProtocolRequest = Readonly<{
1553
1882
  url: string;
@@ -1873,4 +2202,4 @@ declare function createTileflowTransformRequest<TRequest extends TileflowTransfo
1873
2202
  worldRequestBridge?: TileflowWorldRequestBridge;
1874
2203
  }): TileflowTransformRequest<TRequest, TResourceType>;
1875
2204
 
1876
- export { type AttachTileflowMap3DOptions, type CreateBoundaryFeatureStateOptions, type TileflowAtmosphereMap, type TileflowBoundaryFeatureState, type TileflowBrowserThemeBlendSelection, type TileflowBuildingMesh, type TileflowBuildingMeshOptions, type TileflowBuildingModelPlacement, type TileflowBuildings3DDesign, type TileflowComposedRequest, type TileflowContourProtocolHandler, type TileflowContourProtocolRegistrationOptions, type TileflowContourProtocolRegistry, type TileflowContourProtocolRequest, type TileflowContourProtocolResponse, type TileflowDepthMarker, type TileflowDepthMarkerHandle, type TileflowDepthMarkerMap, type TileflowDepthMarkers, type TileflowDepthMarkersOptions, type TileflowDynamicImage, type TileflowDynamicImageContext, type TileflowDynamicImageHandle, type TileflowEmphasis, type TileflowEmphasisArea, type TileflowEmphasisModule, type TileflowFairUseNotice, type TileflowFairUseNoticeController, type TileflowFairUseNoticeState, type TileflowFeatureStateMap, type TileflowFrameScheduler, type TileflowGroundLayer, type TileflowGroundLayers, type TileflowGroundLayersMap, type TileflowGroundLayersOptions, type TileflowGroundOrderMap, type TileflowLineProgressAnimation, type TileflowLineProgressController, type TileflowLineProgressGradientOptions, type TileflowLineProgressLayer, type TileflowLineProgressMap, type TileflowLineProgressOptions, type TileflowLineProgressShown, type TileflowLineProgressState, TileflowMap3D, type TileflowMap3DAttachment, type TileflowMap3DLoader, TileflowMap3DOptions, type TileflowMap3DSource, type TileflowMapLifecycleAttachment, type TileflowMapLifecycleEvent, type TileflowMapLifecycleSubscriber, type TileflowMapNotice, type TileflowMapReadinessState, type TileflowNoticeControl, type TileflowNoticeControlPosition, type TileflowNoticesMap, type TileflowNoticesOptions, type TileflowPmtilesProtocolHandler, type TileflowPmtilesProtocolRegistrationOptions, type TileflowPmtilesProtocolRegistry, type TileflowRouteInks, type TileflowSessionSender, type TileflowSessionStarter, type TileflowShotCamera, type TileflowShotCue, type TileflowShotKeyframe, type TileflowShotMotion, type TileflowShotPlayback, type TileflowShotPlaybackOptions, type TileflowShotPlayerMap, type TileflowShotState, type TileflowStreetLightEstimate, type TileflowStreetLightLayers, type TileflowStreetLightPlacement, type TileflowStreetLightPlacementOptions, type TileflowStreetLightsDesign, type TileflowStyleFontLoadOptions, type TileflowStyleStateValue, type TileflowStyleSwitchMap, TileflowSun, type TileflowSunRequest, type TileflowThemeBlendRequest, type TileflowThemeBlendState, type TileflowThemeChangeOptions, type TileflowThemeController, type TileflowThemeTransition, type TileflowThemeTransitionOptions, type TileflowThemeTransitionPhase, type TileflowThemeTransitionResult, TileflowTileLayer, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowUserTransformRequest, TileflowViewMode, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowAtmosphere, attachTileflowFairUseNotice, attachTileflowMap3D, attachTileflowMapLifecycle, attachTileflowNotices, createBoundaryFeatureState, createTileflowDepthMarkers, createTileflowGroundLayers, createTileflowLineProgress, createTileflowSessionStarter, createTileflowThemeController, createTileflowTransformRequest, getTileflowSystemColorScheme, loadTileflowStyleFonts, meshTileflowBuildings, mixTileflowRouteInks, placeTileflowStreetLights, playTileflowShot, readTileflowBuildings3D, readTileflowNotices, readTileflowRouteInks, readTileflowStreetLights, readTileflowTeamModelName, registerTileflowContourProtocol, registerTileflowPmtilesProtocol, registerTileflowWorldRequestBridge, subscribeTileflowSystemColorScheme, tileflowBuildingExtent, tileflowBuildingModelPlacementLimit, tileflowBuildingVertexBytes, tileflowBuildingsMetadataKey, tileflowDefaultRouteInks, tileflowDepthMarkerPlacement, tileflowFairUseNoticeMessage, tileflowGroundBeforeId, tileflowLayerDomainMetadataKey, tileflowLineProgressGradient, tileflowMap3DDeclarations, tileflowMap3DMetadataKeys, tileflowMapDeclares3D, tileflowMaplibreContourVersion, tileflowNoticeLimits, tileflowNoticesMetadataKey, tileflowPmtilesMaximumDirectoryDepth, tileflowPmtilesProtocol, tileflowRouteMetadataKey, tileflowShotStateAt, tileflowStreetLightBytes, tileflowStreetLightsMetadataKey, tileflowStyleRouteInks, tileflowSunLightMatrix, tileflowTeamModelUrl, validateTileflowBrowserThemeBlendSelection, validateTileflowEmphasis };
2205
+ export { type AttachTileflowMap3DOptions, type CreateBoundaryFeatureStateOptions, type TileflowAtmosphereMap, type TileflowBoundaryFeatureState, type TileflowBrowserThemeBlendSelection, type TileflowBuildingMesh, type TileflowBuildingMeshOptions, type TileflowBuildingModelPlacement, type TileflowBuildings3DDesign, type TileflowComposedRequest, type TileflowContourProtocolHandler, type TileflowContourProtocolRegistrationOptions, type TileflowContourProtocolRegistry, type TileflowContourProtocolRequest, type TileflowContourProtocolResponse, type TileflowDepthMarker, type TileflowDepthMarkerHandle, type TileflowDepthMarkerMap, type TileflowDepthMarkers, type TileflowDepthMarkersOptions, type TileflowDynamicImage, type TileflowDynamicImageContext, type TileflowDynamicImageHandle, type TileflowEmphasis, type TileflowEmphasisArea, type TileflowEmphasisModule, type TileflowFairUseNotice, type TileflowFairUseNoticeController, type TileflowFairUseNoticeState, type TileflowFeatureStateMap, type TileflowFrameScheduler, type TileflowGroundLayer, type TileflowGroundLayers, type TileflowGroundLayersMap, type TileflowGroundLayersOptions, type TileflowGroundOrderMap, type TileflowLightCharacteristic, type TileflowLightPhase, type TileflowLightRhythm, type TileflowLightState, type TileflowLineProgressAnimation, type TileflowLineProgressController, type TileflowLineProgressGradientOptions, type TileflowLineProgressLayer, type TileflowLineProgressMap, type TileflowLineProgressOptions, type TileflowLineProgressShown, type TileflowLineProgressState, TileflowMap3D, type TileflowMap3DAttachment, type TileflowMap3DLoader, TileflowMap3DOptions, type TileflowMap3DSource, type TileflowMapLifecycleAttachment, type TileflowMapLifecycleEvent, type TileflowMapLifecycleSubscriber, type TileflowMapNotice, type TileflowMapReadinessState, type TileflowNauticalLights, type TileflowNauticalLightsMap, type TileflowNoticeControl, type TileflowNoticeControlPosition, type TileflowNoticesMap, type TileflowNoticesOptions, type TileflowPmtilesProtocolHandler, type TileflowPmtilesProtocolRegistrationOptions, type TileflowPmtilesProtocolRegistry, type TileflowRouteInks, type TileflowSessionSender, type TileflowSessionStarter, type TileflowShotCamera, type TileflowShotCue, type TileflowShotKeyframe, type TileflowShotMotion, type TileflowShotPlayback, type TileflowShotPlaybackOptions, type TileflowShotPlayerMap, type TileflowShotState, type TileflowSkyColours, type TileflowSkyHazeMap, type TileflowSkyMap, type TileflowSkyMetadata, type TileflowSkyTimesOfDay, type TileflowStreetLightEstimate, type TileflowStreetLightLayers, type TileflowStreetLightPlacement, type TileflowStreetLightPlacementOptions, type TileflowStreetLightsDesign, type TileflowStyleFontLoadOptions, type TileflowStyleStateValue, type TileflowStyleSwitchMap, TileflowSun, type TileflowSunRequest, type TileflowThemeBlendRequest, type TileflowThemeBlendState, type TileflowThemeChangeOptions, type TileflowThemeController, type TileflowThemeTransition, type TileflowThemeTransitionOptions, type TileflowThemeTransitionPhase, type TileflowThemeTransitionResult, TileflowTileLayer, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowUserTransformRequest, TileflowViewMode, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowAtmosphere, attachTileflowFairUseNotice, attachTileflowMap3D, attachTileflowMapLifecycle, attachTileflowNauticalLights, attachTileflowNotices, attachTileflowSky, attachTileflowSkyHaze, createBoundaryFeatureState, createTileflowDepthMarkers, createTileflowGroundLayers, createTileflowLineProgress, createTileflowSessionStarter, createTileflowThemeController, createTileflowTransformRequest, getTileflowSystemColorScheme, loadTileflowStyleFonts, meshTileflowBuildings, mixTileflowRouteInks, placeTileflowStreetLights, playTileflowShot, readTileflowBuildings3D, readTileflowNauticalLights, readTileflowNotices, readTileflowRouteInks, readTileflowSky, readTileflowStreetLights, readTileflowTeamModelName, registerTileflowContourProtocol, registerTileflowPmtilesProtocol, registerTileflowWorldRequestBridge, subscribeTileflowSystemColorScheme, tileflowBuildingExtent, tileflowBuildingModelPlacementLimit, tileflowBuildingVertexBytes, tileflowBuildingsMetadataKey, tileflowCanvasContextAttributes, tileflowDefaultRouteInks, tileflowDepthMarkerPlacement, tileflowFairUseNoticeMessage, tileflowGroundBeforeId, tileflowLayerDomainMetadataKey, tileflowLightRhythm, tileflowLightRhythmConventions, tileflowLightStateAt, tileflowLineProgressGradient, tileflowMap3DDeclarations, tileflowMap3DMetadataKeys, tileflowMapDeclares3D, tileflowMaplibreContourVersion, tileflowMaxPitch, tileflowNauticalLightStates, tileflowNauticalLightsMetadataKey, tileflowNoticeLimits, tileflowNoticesMetadataKey, tileflowPmtilesMaximumDirectoryDepth, tileflowPmtilesProtocol, tileflowRouteMetadataKey, tileflowShotStateAt, tileflowSkyAtSun, tileflowSkyHazeLayerId, tileflowSkyLayerId, tileflowSkyMetadataKey, tileflowStreetLightBytes, tileflowStreetLightsMetadataKey, tileflowStyleRouteInks, tileflowSunLightMatrix, tileflowTeamModelUrl, validateTileflowBrowserThemeBlendSelection, validateTileflowEmphasis };