Search: {
    isReady: (() => boolean);
    query: ((text: string) => Set<string>);
    build: ((pois: any[]) => void);
    getEngine: (() => string);
    clear: (() => void);
} = ...

Public Search namespace. Available as GeoLeaf.Search after the lazy search module is loaded.

Type declaration

  • isReady: (() => boolean)

    Returns true when the FlexSearch index has been built and is ready. Returns false when engine is "native" (uses includes() fallback).

      • (): boolean
      • Returns boolean

  • query: ((text: string) => Set<string>)

    Queries the index and returns a Set of matching POI IDs. Returns an empty Set when not ready.

      • (text): Set<string>
      • Parameters

        • text: string

          User search input.

        Returns Set<string>

  • build: ((pois: any[]) => void)

    Manually builds (or rebuilds) the search index from a POI array. Normally called automatically on geoleaf:poi:loaded.

      • (pois): void
      • Parameters

        • pois: any[]

          Array of normalized POI objects.

        Returns void

  • getEngine: (() => string)

    Returns the name of the active engine: "flexsearch" or "native".

      • (): string
      • Returns string

  • clear: (() => void)

    Clears the index (e.g. on profile switch).

      • (): void
      • Returns void