@chrtco/sdk 0.10.4 → 0.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -492,8 +492,22 @@ interface CellDetail {
492
492
  * database does not enforce would be a promise the wire cannot keep.
493
493
  */
494
494
  scale_band: string | null;
495
+ /**
496
+ * The S-57 edition and update number of the release **CHRT holds and serves**
497
+ * for this cell — not necessarily the newest the issuing office has published.
498
+ * That is the number to quote when you need to say which chart a response came
499
+ * from. `status` is what tells you whether the office has moved on since.
500
+ */
495
501
  edition: number | null;
496
502
  update_number: number | null;
503
+ /**
504
+ * Publication date of the release named by `edition` / `update_number`.
505
+ *
506
+ * `null` means the date for *that* release is unknown — most often a cell
507
+ * ingested before CHRT started recording it, which resolves on the cell's next
508
+ * update. It never carries the date of an earlier edition: a plausible wrong
509
+ * date on a provenance field is worse than an honest absence.
510
+ */
497
511
  issue_date: string | null;
498
512
  /**
499
513
  * Bounds in decimal degrees (WGS 84), or `null` when the issuing office recorded
@@ -506,9 +520,14 @@ interface CellDetail {
506
520
  bbox_east: number | null;
507
521
  bbox_west: number | null;
508
522
  /**
509
- * ISO 8601 timestamp of when CHRT last checked the issuing office's catalogue
510
- * for this cell — freshness of the *check*, not of the chart. Compare
511
- * `edition` / `update_number` / `issue_date` for chart currency.
523
+ * ISO 8601 timestamp — a **lower bound** on when CHRT last checked the issuing
524
+ * office for this cell, not the exact time. It advances whenever a check
525
+ * results in a new release; a check that finds the cell unchanged leaves no
526
+ * per-cell record, so the real figure is at least this recent and usually more
527
+ * so. Treat it as "no older than", never as "not since".
528
+ *
529
+ * Freshness of the *check*, not of the chart — compare `edition` /
530
+ * `update_number` / `issue_date` for chart currency.
512
531
  */
513
532
  last_checked_at: string | null;
514
533
  }
@@ -1040,6 +1059,158 @@ interface MarineForecastResponse {
1040
1059
  attribution: string;
1041
1060
  disclaimer: string;
1042
1061
  }
1062
+ /**
1063
+ * One gazetteer hit.
1064
+ *
1065
+ * A hit is a PLACE, not a feature: a point, an extent, and the identity you
1066
+ * need to go and fetch the feature itself. If you want geometry, follow `lnam`
1067
+ * and `cell_id` into `features()` or CHRTinteract.
1068
+ */
1069
+ interface SearchHit {
1070
+ /** The `OBJNAM` verbatim, exactly as the hydrographic office charted it. */
1071
+ name: string;
1072
+ /**
1073
+ * A point GUARANTEED to lie inside real charted geometry carrying this name.
1074
+ *
1075
+ * Not a bbox centroid, and not a polygon centroid either — a centroid can
1076
+ * fall outside a concave area entirely, or inside a different, smaller
1077
+ * feature. Safe to fly a camera to.
1078
+ */
1079
+ lon: number;
1080
+ lat: number;
1081
+ /**
1082
+ * `[west, south, east, north]`, unioned across every charted instance of this
1083
+ * place — so fitting a camera to it covers the whole thing rather than one
1084
+ * chart cell's slice of it.
1085
+ *
1086
+ * DEGENERATE for a point feature (`west === east`, `south === north`). Never
1087
+ * null, so `fitBounds` never has to be guarded.
1088
+ */
1089
+ bbox: [number, number, number, number];
1090
+ /** S-57 layer acronym, e.g. `"SEAARE"`. */
1091
+ layer: string;
1092
+ /**
1093
+ * `place` — the name describes water or ground you can **be in**.
1094
+ * `object` — the name describes a **thing at** a position.
1095
+ *
1096
+ * Branch on this before writing a name into a sentence about position. It is
1097
+ * the difference between "you are in Nantasket Roads" and the nonsense
1098
+ * "you are in Boston South Channel Buoy 11".
1099
+ */
1100
+ kind: "place" | "object";
1101
+ /** Short human label to render beside the name, e.g. `"Bay"`, `"Lateral buoy"`. */
1102
+ class: string;
1103
+ /**
1104
+ * `secondary` marks survey and utility descriptors — dredged-area names,
1105
+ * pipelines, cables, recommended tracks. Fully searchable, but never sorted
1106
+ * above a `primary` hit in the same match tier, so a typeahead shows
1107
+ * "Quincy Bay" rather than "51-Foot Outer Harbor Confluence RIQ".
1108
+ */
1109
+ rank: "primary" | "secondary";
1110
+ /**
1111
+ * Colloquial names a skipper actually says, composed for buoys and beacons:
1112
+ * `"South River Buoy 16"` carries `["red 16", "r16", "red nun 16"]`. Empty
1113
+ * for everything else. `q` matches these at the same tiers as the name.
1114
+ */
1115
+ aliases: string[];
1116
+ /**
1117
+ * S-57 long name of the largest-scale instance — the stable handle for
1118
+ * re-resolving this hit later.
1119
+ *
1120
+ * **Not a de-duplication key.** The same place carries a different `LNAM` in
1121
+ * every cell that charts it (measured: 25 instances of "Vineyard Sound", 25
1122
+ * distinct LNAMs), and occasionally one `LNAM` spans several cells. CHRT has
1123
+ * already de-duplicated; you do not need to.
1124
+ */
1125
+ lnam: string;
1126
+ /** Source cell, and its data currency — inline, so a row renders without a second call. */
1127
+ cell_id: string;
1128
+ chart_source: string;
1129
+ edition: number | null;
1130
+ update_number: number | null;
1131
+ issue_date: string | null;
1132
+ /** Compilation scale denominator of the source cell. */
1133
+ scale: number | null;
1134
+ /** S-57 minimum display scale, where the feature carries one. */
1135
+ scamin: number | null;
1136
+ /** Metres from `near`. Absent when `near` was not supplied. */
1137
+ distance_m?: number;
1138
+ /** True bearing from `near` in degrees, geodesic. Absent when `near` was not supplied. */
1139
+ bearing_deg?: number;
1140
+ /**
1141
+ * Which tier matched. The ranking order is
1142
+ * `exact` → `prefix` → `all_words` → `substring` → `fuzzy`, then primary
1143
+ * before secondary, then distance, then largest scale.
1144
+ *
1145
+ * `fuzzy` appears only when nothing matched at the four stricter tiers.
1146
+ */
1147
+ match: "exact" | "prefix" | "all_words" | "substring" | "fuzzy";
1148
+ }
1149
+ /**
1150
+ * Present whenever the `near`/`bbox` you supplied falls outside CHRT's
1151
+ * coverage — **with or without results**.
1152
+ *
1153
+ * The notice is about the POSITION, not about the result set being empty. A
1154
+ * query can match places by name thousands of kilometres away while CHRT holds
1155
+ * no charts where you actually are; returning that list silently is the most
1156
+ * misleading answer available. When `results` accompany this block they matched
1157
+ * by NAME only, and their `distance_m` is measured from a position CHRT cannot
1158
+ * chart — do not present them as nearby.
1159
+ *
1160
+ * Its absence means the position is inside coverage, or you gave no position.
1161
+ * So an empty `results` with no `coverage` block is a genuine in-coverage miss:
1162
+ * "we have charts here and nothing is called that", as distinct from "we have
1163
+ * no charts here". Neither is ever a statement that the water is clear.
1164
+ */
1165
+ interface SearchCoverageNotice {
1166
+ covered: false;
1167
+ code: "outside_coverage";
1168
+ message: string;
1169
+ chart_sources: string[] | null;
1170
+ }
1171
+ interface SearchResponse {
1172
+ results: SearchHit[];
1173
+ /** Exact count of all matches — not an estimate, and not the page length. */
1174
+ total_count: number;
1175
+ limit: number;
1176
+ offset: number;
1177
+ coverage?: SearchCoverageNotice;
1178
+ attribution: string;
1179
+ disclaimer: string;
1180
+ }
1181
+ interface SearchOptions {
1182
+ /**
1183
+ * Free text. Multi-word in ANY order — `"cutty harbor"` finds
1184
+ * "Cuttyhunk Harbor Channel". 2–120 characters.
1185
+ */
1186
+ q: string;
1187
+ /**
1188
+ * `[longitude, latitude]` — a RANKING BIAS, never a filter.
1189
+ *
1190
+ * Supply it. "Newport" is Rhode Island, Oregon *and* California; without
1191
+ * `near` the first row is the wrong Newport most of the time, and a skipper
1192
+ * off Block Island is offered a place 2,500 miles away.
1193
+ */
1194
+ near?: [number, number];
1195
+ /** `[west, south, east, north]` — a HARD filter, for "search only this chart". */
1196
+ bbox?: [number, number, number, number];
1197
+ /** Restrict to places or to objects. Omit for both. */
1198
+ kind?: "place" | "object" | "all";
1199
+ /**
1200
+ * S-57 layer acronym, or several.
1201
+ *
1202
+ * Note that named lights are on `LNDMRK`, not `LIGHTS` — only 50 of the
1203
+ * 48,814 `LIGHTS` features in the corpus carry a name, so filtering to
1204
+ * `LIGHTS` to find "Deer Island Light" returns nothing.
1205
+ */
1206
+ layer?: string | string[];
1207
+ /** Page size, default 20, clamped to 100. */
1208
+ limit?: number;
1209
+ /** Pagination offset. */
1210
+ offset?: number;
1211
+ /** AbortSignal to cancel the request — pass one per keystroke in a typeahead. */
1212
+ signal?: AbortSignal;
1213
+ }
1043
1214
 
1044
1215
  declare class ChrtError extends Error {
1045
1216
  status: number;
@@ -3774,6 +3945,7 @@ declare class Chrt {
3774
3945
  */
3775
3946
  readonly interact: InteractClient;
3776
3947
  private featuresEp;
3948
+ private searchEp;
3777
3949
  private queryEp;
3778
3950
  private http;
3779
3951
  private tileAuth;
@@ -3784,6 +3956,30 @@ declare class Chrt {
3784
3956
  constructor(apiKeyOrConfig: string | ChrtConfig);
3785
3957
  /** Query GeoJSON features by bounding box */
3786
3958
  features(options: FeaturesOptions): Promise<FeatureCollection>;
3959
+ /**
3960
+ * CHRTsearch — find charted places by name.
3961
+ *
3962
+ * The only CHRT surface addressed by NAME rather than by space or identifier.
3963
+ * Text in, a small ranked list of named charted places out.
3964
+ *
3965
+ * ```ts
3966
+ * const { results } = await chrt.search({ q: "cutty harbor", near: [-70.93, 41.42] });
3967
+ * // -> [{ name: "Cuttyhunk Harbor Channel", class: "Fairway", kind: "place", ... }]
3968
+ * ```
3969
+ *
3970
+ * Three things worth knowing before wiring it to a text field:
3971
+ *
3972
+ * 1. **Pass `near`.** It biases ranking and never filters. "Newport" is
3973
+ * Rhode Island, Oregon *and* California; without `near` the first row is
3974
+ * the wrong Newport most of the time.
3975
+ * 2. **It is metered separately** from `features()` — exhausting one does not
3976
+ * affect the other. Sized for a typeahead, and not gated by tier.
3977
+ * 3. **An empty `results` array is not proof a place does not exist.** If the
3978
+ * response carries a `coverage` block, CHRT holds no charts at that
3979
+ * position and the search could not run there. That is a different answer
3980
+ * from "nothing matched", and neither means the water is clear.
3981
+ */
3982
+ search(options: SearchOptions): Promise<SearchResponse>;
3787
3983
  /** Spatial proximity query around a point */
3788
3984
  query(options: QueryOptions): Promise<QueryResponse>;
3789
3985
  /**
@@ -3976,4 +4172,4 @@ declare class Chrt {
3976
4172
  warmTiles(region?: string): Promise<void>;
3977
4173
  }
3978
4174
 
3979
- export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsOptions, type MarineConditionsResponse, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, type PmtilesVectorSource, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, type ResolvedStyle, type ResolvedTheme, type S101Feature, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_NEW_SYMBOLS, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SOUNDING_LAYERS, SYMBOL_FAMILIES, SYMBOL_FAMILY_META, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolFamily, type SymbolFamilyMeta, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildFlashPattern, buildLabelLayer, buildLayersForClass, buildOfflineStyle, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, chrtAtonTintExpression, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, deriveMarinerName, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, iconExpressionForFamily, isLabelLayerVisible, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, paginate, parseListCodes, parseSymbolFamily, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, sanitizeCustomStyleConfig, scaleSizeValue, scaminToMinZoom, styleModeBand, withinBboxFilter, worldMinusBboxPolygon };
4175
+ export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsOptions, type MarineConditionsResponse, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, type PmtilesVectorSource, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, type ResolvedStyle, type ResolvedTheme, type S101Feature, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_NEW_SYMBOLS, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SOUNDING_LAYERS, SYMBOL_FAMILIES, SYMBOL_FAMILY_META, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SearchCoverageNotice, type SearchHit, type SearchOptions, type SearchResponse, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolFamily, type SymbolFamilyMeta, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildFlashPattern, buildLabelLayer, buildLayersForClass, buildOfflineStyle, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, chrtAtonTintExpression, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, deriveMarinerName, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, iconExpressionForFamily, isLabelLayerVisible, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, paginate, parseListCodes, parseSymbolFamily, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, sanitizeCustomStyleConfig, scaleSizeValue, scaminToMinZoom, styleModeBand, withinBboxFilter, worldMinusBboxPolygon };
package/dist/index.d.ts CHANGED
@@ -492,8 +492,22 @@ interface CellDetail {
492
492
  * database does not enforce would be a promise the wire cannot keep.
493
493
  */
494
494
  scale_band: string | null;
495
+ /**
496
+ * The S-57 edition and update number of the release **CHRT holds and serves**
497
+ * for this cell — not necessarily the newest the issuing office has published.
498
+ * That is the number to quote when you need to say which chart a response came
499
+ * from. `status` is what tells you whether the office has moved on since.
500
+ */
495
501
  edition: number | null;
496
502
  update_number: number | null;
503
+ /**
504
+ * Publication date of the release named by `edition` / `update_number`.
505
+ *
506
+ * `null` means the date for *that* release is unknown — most often a cell
507
+ * ingested before CHRT started recording it, which resolves on the cell's next
508
+ * update. It never carries the date of an earlier edition: a plausible wrong
509
+ * date on a provenance field is worse than an honest absence.
510
+ */
497
511
  issue_date: string | null;
498
512
  /**
499
513
  * Bounds in decimal degrees (WGS 84), or `null` when the issuing office recorded
@@ -506,9 +520,14 @@ interface CellDetail {
506
520
  bbox_east: number | null;
507
521
  bbox_west: number | null;
508
522
  /**
509
- * ISO 8601 timestamp of when CHRT last checked the issuing office's catalogue
510
- * for this cell — freshness of the *check*, not of the chart. Compare
511
- * `edition` / `update_number` / `issue_date` for chart currency.
523
+ * ISO 8601 timestamp — a **lower bound** on when CHRT last checked the issuing
524
+ * office for this cell, not the exact time. It advances whenever a check
525
+ * results in a new release; a check that finds the cell unchanged leaves no
526
+ * per-cell record, so the real figure is at least this recent and usually more
527
+ * so. Treat it as "no older than", never as "not since".
528
+ *
529
+ * Freshness of the *check*, not of the chart — compare `edition` /
530
+ * `update_number` / `issue_date` for chart currency.
512
531
  */
513
532
  last_checked_at: string | null;
514
533
  }
@@ -1040,6 +1059,158 @@ interface MarineForecastResponse {
1040
1059
  attribution: string;
1041
1060
  disclaimer: string;
1042
1061
  }
1062
+ /**
1063
+ * One gazetteer hit.
1064
+ *
1065
+ * A hit is a PLACE, not a feature: a point, an extent, and the identity you
1066
+ * need to go and fetch the feature itself. If you want geometry, follow `lnam`
1067
+ * and `cell_id` into `features()` or CHRTinteract.
1068
+ */
1069
+ interface SearchHit {
1070
+ /** The `OBJNAM` verbatim, exactly as the hydrographic office charted it. */
1071
+ name: string;
1072
+ /**
1073
+ * A point GUARANTEED to lie inside real charted geometry carrying this name.
1074
+ *
1075
+ * Not a bbox centroid, and not a polygon centroid either — a centroid can
1076
+ * fall outside a concave area entirely, or inside a different, smaller
1077
+ * feature. Safe to fly a camera to.
1078
+ */
1079
+ lon: number;
1080
+ lat: number;
1081
+ /**
1082
+ * `[west, south, east, north]`, unioned across every charted instance of this
1083
+ * place — so fitting a camera to it covers the whole thing rather than one
1084
+ * chart cell's slice of it.
1085
+ *
1086
+ * DEGENERATE for a point feature (`west === east`, `south === north`). Never
1087
+ * null, so `fitBounds` never has to be guarded.
1088
+ */
1089
+ bbox: [number, number, number, number];
1090
+ /** S-57 layer acronym, e.g. `"SEAARE"`. */
1091
+ layer: string;
1092
+ /**
1093
+ * `place` — the name describes water or ground you can **be in**.
1094
+ * `object` — the name describes a **thing at** a position.
1095
+ *
1096
+ * Branch on this before writing a name into a sentence about position. It is
1097
+ * the difference between "you are in Nantasket Roads" and the nonsense
1098
+ * "you are in Boston South Channel Buoy 11".
1099
+ */
1100
+ kind: "place" | "object";
1101
+ /** Short human label to render beside the name, e.g. `"Bay"`, `"Lateral buoy"`. */
1102
+ class: string;
1103
+ /**
1104
+ * `secondary` marks survey and utility descriptors — dredged-area names,
1105
+ * pipelines, cables, recommended tracks. Fully searchable, but never sorted
1106
+ * above a `primary` hit in the same match tier, so a typeahead shows
1107
+ * "Quincy Bay" rather than "51-Foot Outer Harbor Confluence RIQ".
1108
+ */
1109
+ rank: "primary" | "secondary";
1110
+ /**
1111
+ * Colloquial names a skipper actually says, composed for buoys and beacons:
1112
+ * `"South River Buoy 16"` carries `["red 16", "r16", "red nun 16"]`. Empty
1113
+ * for everything else. `q` matches these at the same tiers as the name.
1114
+ */
1115
+ aliases: string[];
1116
+ /**
1117
+ * S-57 long name of the largest-scale instance — the stable handle for
1118
+ * re-resolving this hit later.
1119
+ *
1120
+ * **Not a de-duplication key.** The same place carries a different `LNAM` in
1121
+ * every cell that charts it (measured: 25 instances of "Vineyard Sound", 25
1122
+ * distinct LNAMs), and occasionally one `LNAM` spans several cells. CHRT has
1123
+ * already de-duplicated; you do not need to.
1124
+ */
1125
+ lnam: string;
1126
+ /** Source cell, and its data currency — inline, so a row renders without a second call. */
1127
+ cell_id: string;
1128
+ chart_source: string;
1129
+ edition: number | null;
1130
+ update_number: number | null;
1131
+ issue_date: string | null;
1132
+ /** Compilation scale denominator of the source cell. */
1133
+ scale: number | null;
1134
+ /** S-57 minimum display scale, where the feature carries one. */
1135
+ scamin: number | null;
1136
+ /** Metres from `near`. Absent when `near` was not supplied. */
1137
+ distance_m?: number;
1138
+ /** True bearing from `near` in degrees, geodesic. Absent when `near` was not supplied. */
1139
+ bearing_deg?: number;
1140
+ /**
1141
+ * Which tier matched. The ranking order is
1142
+ * `exact` → `prefix` → `all_words` → `substring` → `fuzzy`, then primary
1143
+ * before secondary, then distance, then largest scale.
1144
+ *
1145
+ * `fuzzy` appears only when nothing matched at the four stricter tiers.
1146
+ */
1147
+ match: "exact" | "prefix" | "all_words" | "substring" | "fuzzy";
1148
+ }
1149
+ /**
1150
+ * Present whenever the `near`/`bbox` you supplied falls outside CHRT's
1151
+ * coverage — **with or without results**.
1152
+ *
1153
+ * The notice is about the POSITION, not about the result set being empty. A
1154
+ * query can match places by name thousands of kilometres away while CHRT holds
1155
+ * no charts where you actually are; returning that list silently is the most
1156
+ * misleading answer available. When `results` accompany this block they matched
1157
+ * by NAME only, and their `distance_m` is measured from a position CHRT cannot
1158
+ * chart — do not present them as nearby.
1159
+ *
1160
+ * Its absence means the position is inside coverage, or you gave no position.
1161
+ * So an empty `results` with no `coverage` block is a genuine in-coverage miss:
1162
+ * "we have charts here and nothing is called that", as distinct from "we have
1163
+ * no charts here". Neither is ever a statement that the water is clear.
1164
+ */
1165
+ interface SearchCoverageNotice {
1166
+ covered: false;
1167
+ code: "outside_coverage";
1168
+ message: string;
1169
+ chart_sources: string[] | null;
1170
+ }
1171
+ interface SearchResponse {
1172
+ results: SearchHit[];
1173
+ /** Exact count of all matches — not an estimate, and not the page length. */
1174
+ total_count: number;
1175
+ limit: number;
1176
+ offset: number;
1177
+ coverage?: SearchCoverageNotice;
1178
+ attribution: string;
1179
+ disclaimer: string;
1180
+ }
1181
+ interface SearchOptions {
1182
+ /**
1183
+ * Free text. Multi-word in ANY order — `"cutty harbor"` finds
1184
+ * "Cuttyhunk Harbor Channel". 2–120 characters.
1185
+ */
1186
+ q: string;
1187
+ /**
1188
+ * `[longitude, latitude]` — a RANKING BIAS, never a filter.
1189
+ *
1190
+ * Supply it. "Newport" is Rhode Island, Oregon *and* California; without
1191
+ * `near` the first row is the wrong Newport most of the time, and a skipper
1192
+ * off Block Island is offered a place 2,500 miles away.
1193
+ */
1194
+ near?: [number, number];
1195
+ /** `[west, south, east, north]` — a HARD filter, for "search only this chart". */
1196
+ bbox?: [number, number, number, number];
1197
+ /** Restrict to places or to objects. Omit for both. */
1198
+ kind?: "place" | "object" | "all";
1199
+ /**
1200
+ * S-57 layer acronym, or several.
1201
+ *
1202
+ * Note that named lights are on `LNDMRK`, not `LIGHTS` — only 50 of the
1203
+ * 48,814 `LIGHTS` features in the corpus carry a name, so filtering to
1204
+ * `LIGHTS` to find "Deer Island Light" returns nothing.
1205
+ */
1206
+ layer?: string | string[];
1207
+ /** Page size, default 20, clamped to 100. */
1208
+ limit?: number;
1209
+ /** Pagination offset. */
1210
+ offset?: number;
1211
+ /** AbortSignal to cancel the request — pass one per keystroke in a typeahead. */
1212
+ signal?: AbortSignal;
1213
+ }
1043
1214
 
1044
1215
  declare class ChrtError extends Error {
1045
1216
  status: number;
@@ -3774,6 +3945,7 @@ declare class Chrt {
3774
3945
  */
3775
3946
  readonly interact: InteractClient;
3776
3947
  private featuresEp;
3948
+ private searchEp;
3777
3949
  private queryEp;
3778
3950
  private http;
3779
3951
  private tileAuth;
@@ -3784,6 +3956,30 @@ declare class Chrt {
3784
3956
  constructor(apiKeyOrConfig: string | ChrtConfig);
3785
3957
  /** Query GeoJSON features by bounding box */
3786
3958
  features(options: FeaturesOptions): Promise<FeatureCollection>;
3959
+ /**
3960
+ * CHRTsearch — find charted places by name.
3961
+ *
3962
+ * The only CHRT surface addressed by NAME rather than by space or identifier.
3963
+ * Text in, a small ranked list of named charted places out.
3964
+ *
3965
+ * ```ts
3966
+ * const { results } = await chrt.search({ q: "cutty harbor", near: [-70.93, 41.42] });
3967
+ * // -> [{ name: "Cuttyhunk Harbor Channel", class: "Fairway", kind: "place", ... }]
3968
+ * ```
3969
+ *
3970
+ * Three things worth knowing before wiring it to a text field:
3971
+ *
3972
+ * 1. **Pass `near`.** It biases ranking and never filters. "Newport" is
3973
+ * Rhode Island, Oregon *and* California; without `near` the first row is
3974
+ * the wrong Newport most of the time.
3975
+ * 2. **It is metered separately** from `features()` — exhausting one does not
3976
+ * affect the other. Sized for a typeahead, and not gated by tier.
3977
+ * 3. **An empty `results` array is not proof a place does not exist.** If the
3978
+ * response carries a `coverage` block, CHRT holds no charts at that
3979
+ * position and the search could not run there. That is a different answer
3980
+ * from "nothing matched", and neither means the water is clear.
3981
+ */
3982
+ search(options: SearchOptions): Promise<SearchResponse>;
3787
3983
  /** Spatial proximity query around a point */
3788
3984
  query(options: QueryOptions): Promise<QueryResponse>;
3789
3985
  /**
@@ -3976,4 +4172,4 @@ declare class Chrt {
3976
4172
  warmTiles(region?: string): Promise<void>;
3977
4173
  }
3978
4174
 
3979
- export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsOptions, type MarineConditionsResponse, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, type PmtilesVectorSource, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, type ResolvedStyle, type ResolvedTheme, type S101Feature, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_NEW_SYMBOLS, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SOUNDING_LAYERS, SYMBOL_FAMILIES, SYMBOL_FAMILY_META, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolFamily, type SymbolFamilyMeta, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildFlashPattern, buildLabelLayer, buildLayersForClass, buildOfflineStyle, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, chrtAtonTintExpression, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, deriveMarinerName, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, iconExpressionForFamily, isLabelLayerVisible, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, paginate, parseListCodes, parseSymbolFamily, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, sanitizeCustomStyleConfig, scaleSizeValue, scaminToMinZoom, styleModeBand, withinBboxFilter, worldMinusBboxPolygon };
4175
+ export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsOptions, type MarineConditionsResponse, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, type PmtilesVectorSource, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, type ResolvedStyle, type ResolvedTheme, type S101Feature, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_NEW_SYMBOLS, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SOUNDING_LAYERS, SYMBOL_FAMILIES, SYMBOL_FAMILY_META, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SearchCoverageNotice, type SearchHit, type SearchOptions, type SearchResponse, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolFamily, type SymbolFamilyMeta, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildFlashPattern, buildLabelLayer, buildLayersForClass, buildOfflineStyle, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, chrtAtonTintExpression, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, deriveMarinerName, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, iconExpressionForFamily, isLabelLayerVisible, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, paginate, parseListCodes, parseSymbolFamily, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, sanitizeCustomStyleConfig, scaleSizeValue, scaminToMinZoom, styleModeBand, withinBboxFilter, worldMinusBboxPolygon };
package/dist/index.js CHANGED
@@ -600,6 +600,37 @@ var FeaturesEndpoint = class {
600
600
  }
601
601
  };
602
602
 
603
+ // src/endpoints/search.ts
604
+ var SearchEndpoint = class {
605
+ constructor(http) {
606
+ this.http = http;
607
+ }
608
+ /**
609
+ * Search the gazetteer.
610
+ *
611
+ * `near` biases ranking and never filters — "Newport" is Rhode Island, Oregon
612
+ * *and* California, and all three come back with the nearest first. `bbox`
613
+ * does filter.
614
+ */
615
+ async find(options) {
616
+ return this.http.request(
617
+ "/search",
618
+ {
619
+ q: options.q,
620
+ near: options.near ? `${options.near[0]},${options.near[1]}` : void 0,
621
+ bbox: options.bbox ? options.bbox.join(",") : void 0,
622
+ kind: options.kind,
623
+ // Both spellings are accepted server-side; the SDK sends the
624
+ // comma-joined form so one array maps to one query parameter.
625
+ layer: Array.isArray(options.layer) ? options.layer.join(",") : options.layer,
626
+ limit: options.limit,
627
+ offset: options.offset
628
+ },
629
+ options.signal
630
+ );
631
+ }
632
+ };
633
+
603
634
  // src/endpoints/query.ts
604
635
  var METRES_PER_NAUTICAL_MILE2 = 1852;
605
636
  var QueryEndpoint = class {
@@ -28477,6 +28508,7 @@ var Chrt = class {
28477
28508
  */
28478
28509
  interact;
28479
28510
  featuresEp;
28511
+ searchEp;
28480
28512
  queryEp;
28481
28513
  http;
28482
28514
  tileAuth;
@@ -28497,6 +28529,7 @@ var Chrt = class {
28497
28529
  this.coverage = new CoverageEndpoint(this.http);
28498
28530
  this.weather = new WeatherEndpoint(this.http);
28499
28531
  this.featuresEp = new FeaturesEndpoint(this.http);
28532
+ this.searchEp = new SearchEndpoint(this.http);
28500
28533
  this.queryEp = new QueryEndpoint(this.http);
28501
28534
  this.offline = new OfflineEndpoint(this.http, config.deviceId, config.manifestPath);
28502
28535
  this.interact = new InteractClient(this.http);
@@ -28506,6 +28539,32 @@ var Chrt = class {
28506
28539
  async features(options) {
28507
28540
  return this.featuresEp.list(options);
28508
28541
  }
28542
+ /**
28543
+ * CHRTsearch — find charted places by name.
28544
+ *
28545
+ * The only CHRT surface addressed by NAME rather than by space or identifier.
28546
+ * Text in, a small ranked list of named charted places out.
28547
+ *
28548
+ * ```ts
28549
+ * const { results } = await chrt.search({ q: "cutty harbor", near: [-70.93, 41.42] });
28550
+ * // -> [{ name: "Cuttyhunk Harbor Channel", class: "Fairway", kind: "place", ... }]
28551
+ * ```
28552
+ *
28553
+ * Three things worth knowing before wiring it to a text field:
28554
+ *
28555
+ * 1. **Pass `near`.** It biases ranking and never filters. "Newport" is
28556
+ * Rhode Island, Oregon *and* California; without `near` the first row is
28557
+ * the wrong Newport most of the time.
28558
+ * 2. **It is metered separately** from `features()` — exhausting one does not
28559
+ * affect the other. Sized for a typeahead, and not gated by tier.
28560
+ * 3. **An empty `results` array is not proof a place does not exist.** If the
28561
+ * response carries a `coverage` block, CHRT holds no charts at that
28562
+ * position and the search could not run there. That is a different answer
28563
+ * from "nothing matched", and neither means the water is clear.
28564
+ */
28565
+ async search(options) {
28566
+ return this.searchEp.find(options);
28567
+ }
28509
28568
  /** Spatial proximity query around a point */
28510
28569
  async query(options) {
28511
28570
  return this.queryEp.nearby(options);