import { DataTableCollection } from '../__internal__/BGEg3fBn.js'; import { EventSource } from 'apprt-core/Types'; import '@arcgis/core/geometry'; import '@arcgis/core/geometry/SpatialReference'; import 'store-api/api'; /** * Well known API config given to the create UI options. */ interface DataTableUiConfig { "maximal-item-count": number; "remove-empty-tables": boolean; [key: string]: any; } /** * Interface implemented by ui providers. * Implementing components must provide the `result-api.UiFactory` service name. */ interface DataTableUiFactory { /** * Creates a new ui instance. */ createUi(config: DataTableUiConfig): DataTableUi; } interface DataTableUiEvents { /** * The open state of the ui has changed. */ "open-changed": boolean; /** * The ui is destroyed */ "destroyed": void; } /** * Displays the data tables. * * It is possible to watch for the events `open-changed` and `destroyed` on the ui. * ```ts * const ui = ...; * ui.on("open-changed",(open)=> { ... }); * ui.on("destroyed",()=> { ... }); * ``` */ interface DataTableUi extends EventSource { /** * Destroys the instance. */ destroy(): void; /** * Displays the content of the given tables. * Existing content for previous tables are replaced. */ show(dataTables: DataTableCollection): void; /** * Stops displaying the current content (if any). * * The ui should stop referencing the current content and release * all model-related resources and watchers. */ hide(): void; /** * Provides access to the current open state * true ui is shown * false ui is hidden */ readonly open: boolean; } export type { DataTableUi, DataTableUiConfig, DataTableUiEvents, DataTableUiFactory };