import type { AnalyticsContext } from "@vertigis/viewer-spec/analytics/AnalyticsContext"; import type { ComponentType, ReactNode } from "react"; import type { PreloadableComponent } from "react-lazy-with-preload"; import type { BrandingService } from "../branding/BrandingService"; import type { Action, Command, Commands, Event, Events, Operation, Operations, SimpleAction } from "../messaging"; import type { TranslatableText } from "../region"; import type { ButtonStyle } from "./Button"; import type { SvgIconProps } from "./SvgIcon"; /** * Properties provided by the UIContext React context. */ export interface UIContextProps extends AnalyticsContext { /** * The root HTML element where the application is rendered. */ readonly hostElement: HTMLElement; /** * Well-known VertiGIS Studio Web commands. */ readonly commands: Commands; /** * Well-known VertiGIS Studio Web events. */ readonly events: Events; /** * Well-known VertiGIS Studio Web operations. */ readonly operations: Operations; /** * The UI branding service. */ readonly brandingService: BrandingService; /** * Determines whether the current locale uses a right-to-left script * (`true`), or else left-to-right (`false`). */ readonly isRtl: boolean; /** * The button style to apply. */ buttonStyle?: ButtonStyle; /** * The current locale. */ locale?: string; /** * The function to translate a language string to a human readable string in * the set locale. */ translate: (options: TranslatableText, ...args: unknown[]) => string; /** * The function to translate language strings to a human readable string in * the set locale . */ translateChildren: (children: ReactNode | TranslatableText) => ReactNode; /** * Retrieves a command. * * @param action The command specification. Either the name of a command, or * a list of commands and/or operations to run in sequence. */ command: (action: Action) => Command; /** * Retrieves an event. * * @param name Name of the event. */ event: (name: string) => Event; /** * Retrieves an operation. * * @param name Name of the operation. */ operation: (action: SimpleAction) => Operation; /** * Gets the registered component for the icon with the given ID, or * `undefined` if no such icon is registered. * * @param id The icon ID. */ getIcon: (id: string) => PreloadableComponent> | undefined; } /** * A React context for components that gives access to application-wide * functionality like sending messages and loading images. */ export declare const UIContext: import("react").Context;