import type { ComponentType } from "react"; import type { LayoutElementProperties } from "../components"; import type { ApplyLayoutDesignerSettingsCallback, GetLayoutDesignerSettingsCallback, GetLayoutDesignerSettingsSchemaCallback, LayoutSlotInfo } from "../designer"; import type { ChildActivationType } from "../layout"; import type { DesignerCallbacks } from "./DesignerCallbacks"; /** * Metadata for a component that can be referenced in a layout. */ export interface ComponentManifest extends LayoutSlotInfo, DesignerCallbacks { /** * Whether the component should activate on initializing, true by default. */ autoActivate?: boolean; /** * Applies layout settings that were modified in VertiGIS Studio App * Designer back to the layout node. * * @param args Contains the updated settings to apply, and the layout node * to update. */ applyLayoutDesignerSettings?: ApplyLayoutDesignerSettingsCallback; /** * A category for the component for display purposes. Default is * `"default"`. Set to `"hidden"` to not display this component at all. */ category?: "container" | "default" | "map" | "hidden" | string; /** * Whether the component supports children. Default is `false`. */ canHaveChildren?: boolean; /** * Whether to allow explicit sizing of the component's children in VertiGIS * Studio App Designer. The default is `false`. */ canResizeChildren?: boolean; /** * Determines which children get activated when the component is activated * for the first time. */ defaultChildActivation?: ChildActivationType; /** * A user-friendly description of the component. */ description?: string; /** * If `true`, the component will activate and render immediately after its * model is created but before the model is initialized. The default is * `false` (the component will not render until the model is fully * initialized). By setting this to `true`, a component can render sooner * and provide visual feedback as its model is asynchronously initializing, * e.g. by showing a loading indicator. * * Regardless of this setting, other components that depend on this * component's model (via `@importModel`) will not activate until the * imported model is fully initialized. */ earlyActivation?: boolean; /** * A reference to the React component type. Either a function or class * reference. */ getComponentType: () => ComponentType | Promise>; /** * Gets a component's layout settings, so that they can be configured by * VertiGIS Studio App Designer. * * @param args Information about the settings being requested such as the * layout node. */ getLayoutDesignerSettings?: GetLayoutDesignerSettingsCallback; /** * Returns the VertiGIS Studio App Designer settings schema for a given * component's layout attributes. If no callback is supplied, a default * settings schema will be used. * * @param args Information about the settings schema being requested. */ getLayoutDesignerSettingsSchema?: GetLayoutDesignerSettingsSchemaCallback; /** * A url that provides more information for the component. */ helpUrl?: string; /** * If true, the component will be hidden automatically if it has no visible * children. Useful for container components like tabs, panels, etc. The * default is `false`. */ hideWhenEmpty?: boolean; /** * The ID of the icon. This must correspond to the ID of an image defined in * viewer-level config (see {@link IconManifest}). */ iconId?: string; /** * Whether the component can be resized in VertiGIS Studio App Designer. The * default is `false`. */ isFixedSize?: boolean; /** * The App item type for the component's model. The framework will use this * information to load the component's model from the App, looking for an * item of the appropriate type with an ID matching the component's "config" * attribute in the layout. If none is found, then a new model will be * created and added to the App. */ itemType: string; /** * A comma-separated list of keywords associated with the component. */ keywords?: string; /** * Whether or not the component should be registered as a landmark. Defaults * to `true`. */ landmark?: boolean; /** * The name of the component, i.e. the element name in layouts. */ name: string; /** * The XML namespace of the component in layouts. */ namespace: string; /** * Whether the component supports the horizontal or vertical alignment of * its content. Used by VertiGIS Studio App Designer. */ supportsAlignment?: boolean; /** * Whether the component supports padding of its content. Used by VertiGIS * Studio App Designer. */ supportsPadding?: boolean; /** * Whether the component supports adding a margin around its content. Used * by VertiGIS Studio App Designer. */ supportsMargin?: boolean; /** * Whether the component supports the specifying the gap of its children. * Used by VertiGIS Studio App Designer. The defaults is 'false'. */ supportsGap?: boolean; /** * A user-friendly title for the component. */ title: string; }