import { MapModel } from "../../model/MapModel"; /** * Return value of {@link useMapModel}. * * @group UI Components and Hooks **/ export type UseMapModelResult = UseMapModelLoading | UseMapModelResolved | UseMapModelRejected; /** @group UI Components and Hooks */ export interface UseMapModelLoading { kind: "loading"; map?: undefined; error?: undefined; } /** @group UI Components and Hooks */ export interface UseMapModelResolved { kind: "resolved"; map: MapModel; error?: undefined; } /** @group UI Components and Hooks */ export interface UseMapModelRejected { kind: "rejected"; map?: undefined; error: Error; } /** * React hook that returns the default map model (if available, see {@link DefaultMapProvider}). * * @deprecated Use {@link useMapModelValue} instead. * * @group UI Components and Hooks */ export declare function useMapModel(): UseMapModelResult; /** * React hook that looks up the map with the given id in the `map.MapRegistry` service. * * Returns an object representing the progress, which will eventually represent either * the map model value or an initialization error. * * The map model cannot be returned directly because it may not have completed its initialization yet. * * An error message will be logged if the map model's creation has failed. * Use the option `quiet: true` to suppress this message. * * @group UI Components and Hooks */ export declare function useMapModel(mapId: string): UseMapModelResult; /** * React hook that resolves a map model specified by the given `props`. * * Returns an object representing the progress, which will eventually represent either * the map model value or an initialization error. * * The map model cannot be returned directly because it may not have completed its initialization yet. * * An error message will be logged if the map model's creation has failed. * Use the option `quiet: true` to suppress this message. * * @group UI Components and Hooks */ export declare function useMapModel(props: { mapId: string; quiet?: boolean; }): UseMapModelResult; /** * Options that specify which map to use. See {@link useMapModelValue}. * * When not setting any of these properties on a component, the default map (from the `DefaultMapProvider`) will be used. * If that is not available either, an error will be thrown. * * @see {@link DefaultMapProvider} * * @group UI Components and Hooks */ export interface MapModelProps { /** * The map model to use. */ map?: MapModel | undefined; } /** * Returns the configured map model. * * The map model is either directly configured or specified via a {@link DefaultMapProvider}. * If neither has been specified, an error will be thrown. * * This hook is preferable to {@link useMapModel} because it can return the map model directly, without waiting. * * @group UI Components and Hooks */ export declare function useMapModelValue(props?: MapModelProps): MapModel;