import type { ModelProperties } from "../models"; import type { DesignerCallbacks } from "./DesignerCallbacks"; /** * A factory function for creating service instances. Note that only one * instance of any given service will be created per application. */ export type ServiceFactory = (properties?: ModelProperties) => Promise | object; /** * Describes a service, which provides supporting functionality that is not * associated with any particular component. */ export interface ServiceManifest extends DesignerCallbacks { /** * A description of what the service does. */ description?: string; /** * Gets a factory function to invoke for creating the service. */ getService: ServiceFactory; /** * A url that provides more information for the service. */ helpUrl?: string; /** * The ID of the icon. This must correspond to the ID of an image defined in * viewer-level config (see {@link IconManifest}). */ iconId?: string; /** * The unique ID of the service, e.g. "search". */ id: string; /** * Whether the service is configurable in VertiGIS Studio App Designer. * Defaults to `true`. */ isDesignerConfigurable?: boolean; /** * An optional item type in a VertiGIS Studio App that can be used to load * the service. If present, the appropriate item will be fetched from the * App (or created if it doesn't exist) and will be passed to the service's * constructor. * * To find a match, the framework will look for a single item of the given * type in the App. If there is more than one, it will look for one whose ID * matches the service ID. */ itemType?: string; /** * A comma-separated list of keywords associated with the service. */ keywords?: string; /** * Whether or not the service will be forcibly loaded when the application * starts. Normally, a service is initialized lazily the first time that * it's needed (to satisfy a dependency or when one of the commands or * operations it implements is first invoked). The default is `false`. */ loadOnStartup?: boolean; /** * The display name of the service. This property is required if the service * is designer configurable and itemType is defined. */ title?: string; }