import { ControlPosition } from 'maplibre-gl'; import { default as default_2 } from 'maplibre-gl'; import { MapOptions } from 'maplibre-gl'; /** * Drop-in replacement for `maplibregl.Map`. * * Use it exactly like plain MapLibre GL JS's `Map` — same options, same * methods, same events — plus one required addition, `apiKey`. See * {@link NeshanMapOptions} for all SDK-specific options. * * On construction it transparently: * - registers the `nsh://` tile protocol (once per page, shared by all maps * on that page) so encoded, gzip-compressed vector tiles are decoded and * the API key attached automatically on every tile request, * - enables RTL text shaping (Arabic/Persian/Hebrew) unless `rtl: false`, * - replaces MapLibre's default attribution with one that includes the * Neshan/OpenStreetMap brand entry, * - replaces MapLibre's default logo with the Neshan brand logo control. * * @example * ```ts * import maplibregl from '@neshan/maplibre-sdk'; * import '@neshan/maplibre-sdk/style.css'; * * const map = new maplibregl.Map({ * container: 'map', * style, * center: [51.389, 35.6892], * zoom: 12, * apiKey: 'YOUR_API_KEY', * }); * ``` * * @throws {Error} if `apiKey` is missing. */ declare class Map_2 extends default_2.Map { constructor(options: NeshanMapOptions); } export { Map_2 as Map } /** * Options for constructing a {@link Map}. * * Extends MapLibre's own `MapOptions` one-for-one — every option you'd pass * to `maplibregl.Map` still works here (`container`, `style`, `center`, * `zoom`, etc.) — plus a small set of SDK-specific additions below. * * @example * ```ts * const map = new maplibregl.Map({ * container: 'map', * style, * center: [51.389, 35.6892], * zoom: 12, * apiKey: 'YOUR_API_KEY', * }); * ``` */ export declare interface NeshanMapOptions extends MapOptions { /** * Your client-facing API key. Required. * * Sent as `?key=...` on every map tile request. Without it, tile requests * will be rejected by the tile server. */ apiKey?: string; /** * RTL text shaping for Arabic/Persian/Hebrew labels. Enabled by default. * * Pass `false` to disable it entirely, or an {@link RtlOptions} object to * customize how the plugin loads (e.g. eager vs. lazy). * * @default true */ rtl?: boolean | RtlOptions; /** * Where to place the attribution control (the "©Neshan ©OpenStreetMap" * text) on the map. * * @default 'bottom-left' */ logoPosition?: ControlPosition; /** * Where to place the Neshan brand logo control on the map. * * @default 'bottom-right' */ copyRightPosition?: ControlPosition; } /** * RTL (right-to-left) text shaping for Arabic/Persian/Hebrew labels. * * MapLibre needs the mapbox-gl-rtl-text plugin registered once, globally, * before it renders RTL glyphs. We inline the vendored plugin as a string and * hand MapLibre a Blob URL, so it's fully self-contained. * * The SDK's Map subclass calls ensureRtlTextPlugin() automatically, so RTL is * on by default. Exported for manual/advanced use as well. */ export declare interface RtlOptions { /** * Defer downloading/evaluating the plugin until RTL text is first * encountered. Default true. For a mostly-RTL basemap you can pass false to * evaluate eagerly. */ lazy?: boolean; /** * Override the plugin URL instead of using the inlined vendored file (e.g. * point at a self-hosted copy). When set, the inlined file is ignored. */ url?: string; } declare const sdk: Omit & { Map: typeof Map_2; }; export default sdk; export { }