import type { ConfigurableItemKey } from "../ConfigurableItemKey"; import type { ListItemSettings, SettingsSchema } from "../SettingsSchema"; type ExtractListItemTypes = { [K in keyof T]: T[K] extends ListItemSettings[] ? U : never; }[keyof T]; type SettingsAndItemSettingsSchema = SettingsSchema | SettingsSchema>; /** * Template associated with a VertiGIS Studio product. If SettingsSchema * (returned by the getSettingsSchema() callback) is associated with the * template, the TSettingsData type refers to the interface of the data being * set by the settings schema form. */ export interface ProductTemplate { /** * Unique ID for the template. */ id: string; /** * The human-readable title for the template. */ title: string; /** * The template's category. */ category?: TemplateCategories; /** * The title for the template category. */ categoryTitle?: string; /** * The template's contents. */ content: () => unknown; /** * The default settings data with which to populate the settings schema * form. */ defaultSettings?: TSettingsData; /** * The settings schema that defines any input arguments used to create the * template content. The settings data that corresponds to the settings * schema form is passed in as an argument, if available. An optional item * argument can be passed which specifies the item to return the schema for, * which is used when leveraging list components within the root schema. */ getSettingsSchema?: (settings?: TSettingsData, item?: ConfigurableItemKey) => SettingsAndItemSettingsSchema; /** * The default arguments to be passed into the template. The settings data * that corresponds to the settings schema form is passed in as an argument, * if available. */ getDefaultArguments?: (settings?: TSettingsData) => object; } /** * Arguments for a VertiGIS Studio Reporting template. */ export interface ReportTemplateArgs { /** * The url of the data source service. */ layerServiceUrl?: string; /** * The objectIdField of the data source. */ objectIdField?: string; /** * The name of the table of layer within the service. */ layerOrTableName?: string; /** * The ID of the reporting template to build. */ templateId: string; } /** * VertiGIS Studio Reporting template. If SettingsSchema (returned by the * getSettingsSchema() callback) is associated with the template, the * TSettingsData type refers to the interface of the data being set by the * settings schema form. */ export interface ReportTemplate extends ProductTemplate { /** * The arguments for creating the report template. */ content: () => ReportTemplateArgs; /** * The workflow to use for a hybrid report/workflow template. The settings * data that corresponds to the settings schema form is passed in as an * argument, if available. */ workflow?: (reportDocumentUrl: string, reportDesignerUrl: string, settings?: TSettingsData) => object; } /** * VertiGIS Studio Workflow template. If SettingsSchema (returned by the * getSettingsSchema() callback) is associated with the template, the * TSettingsData type refers to the interface of the data being set by the * settings schema form. */ export interface WorkflowTemplate extends ProductTemplate { /** * The template's contents. The settings data that corresponds to the * settings schema form is passed in as an argument, if available. */ content: (data?: TSettingsData) => unknown; } /** * Categories for command templates. */ export declare enum TemplateCategories { BASIC = "Basic", FEATURE = "Feature", FEATURES = "Feature(s)", MAP = "Map", MENU = "Menu" } export declare const getTemplateCategoryLanguageKey: (category: TemplateCategories) => string; /** * Sorts the given templates. The ordering is: * * - Blank * - Basic (for Feature & Map Menu Context) * - The rest of the templates, alphabetized. * * @param templates The templates to sort. */ export declare function sortTemplates(templates: T[]): T[]; export {};