import type { MglMap } from '@/components'; import type { SourceLayerRegistry } from '@/lib/sourceLayer.registry'; import type { Map, MapOptions, SourceSpecification, StyleSpecification } from 'maplibre-gl'; import type { Emitter } from 'mitt'; import type { InjectionKey, Ref, ShallowRef } from 'vue'; export const mapSymbol = Symbol('map') as InjectionKey>, isLoadedSymbol = Symbol('isLoaded') as InjectionKey>, isInitializedSymbol = Symbol('isInitialized') as InjectionKey>, componentIdSymbol = Symbol('componentId') as InjectionKey, sourceIdSymbol = Symbol('sourceId') as InjectionKey, sourceLayerRegistry = Symbol('sourceLayerRegistry') as InjectionKey, emitterSymbol = Symbol('emitter') as InjectionKey>, fitBoundsOptionsSymbol = Symbol('fitBoundsOptions') as InjectionKey; export type FitBoundsOptions = MapOptions['fitBoundsOptions'] & { useOnBoundsUpdate?: boolean }; export interface MglEvent { type: string; component: InstanceType; map: Map; event: T; } export type MglEvents = { styleSwitched: StyleSwitchItem; } export interface StyleSwitchItem { name: string; label: string; icon?: { path: string; }; style: StyleSpecification | string; } export type AllProps = { [K in keyof T]: undefined }; // only proper way to ensure all possible option to track option changes by type system export function AllOptions(obj: AllProps>) { return Object.keys(obj) as Array; } export function AllSourceOptions(obj: AllProps>>) { return Object.keys(obj) as Array; } export type ValidLanguages = 'sq' | 'am' | 'ar' | 'hy' | 'az' | 'eu' | 'be' | 'bs' | 'br' | 'bg' | 'ca' | 'zh' | 'co' | 'hr' | 'cs' | 'da' | 'nl' | 'en' | 'eo' | 'et' | 'fi' | 'fr' | 'fy' | 'ka' | 'de' | 'el' | 'he' | 'hi' | 'hu' | 'is' | 'id' | 'ga' | 'it' | 'ja' | 'ja-Hira' | 'ja_kana' | 'ja_rm' | 'ja-Latn' | 'kn' | 'kk' | 'ko' | 'ko-Latn' | 'ku' | 'la' | 'lv' | 'lt' | 'lb' | 'mk' | 'ml' | 'mt' | 'no' | 'oc' | 'pl' | 'pt' | 'ro' | 'rm' | 'ru' | 'gd' | 'sr' | 'sr-Latn' | 'sk' | 'sl' | 'es' | 'sv' | 'ta' | 'te' | 'th' | 'tr' | 'uk' | 'cy'