import { SdkConstant as ApiConstant, SdkFunction as ApiFunction, SdkVariableType as ApiVariableType, SdkPredefinedProfile, BundleType, ProfileId, SdkCategory, ArcadeSdkPredefinedProfile, SqlSdkPredefinedProfile } from '@arcgis/languages-sdk-spec'; import { CompletionItem } from 'vscode-languageserver-types'; export type { ApiConstant, ApiFunction, BundleType }; /** * Represent items stored in the library */ export type ApiItem = ApiConstant | ApiFunction; /** * Represent a category of api items in the api library */ export interface ApiCategory extends SdkCategory { items: ApiItem[]; } export type { ProfileId, ApiVariableType, SdkPredefinedProfile, ArcadeSdkPredefinedProfile, SqlSdkPredefinedProfile }; /** * The editor can be extended with custom snippets */ export interface ApiSnippet { /** * The label for the snippet. The editor will use it to offer the snippet based on the text typed in the editor. * It's recommended to keep it short and as close as possible to what the user may be looking for. * For example: 'polyline' */ label: string; /** * A slightly longer description of what the snippet offers. */ detail: string; /** * A string that should be inserted into the script when selecting * this snippet. * * The `insertText` is subject to interpretation by the editor. * Use this rules: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#snippet_syntax */ insertText: string; } /** * Language service api options */ export interface ApiContext { /** * The profile (variables, additional api items, bundles, etc.) */ profile?: ApiProfile; /** * The locale for the Api */ locale?: string; /** * Allows to augment the language snippets with a collection of snippets */ snippets?: ApiSnippet[]; } /** * Language service profile */ export interface ApiProfile { /** * The wellknown profile id if applicable */ id?: ProfileId; /** * The set of profile variables */ variables: ApiVariable[]; /** * The api version to use */ apiVersion?: string; /** * The api bundles to use */ bundles?: BundleType[]; /** * A collection of api item names to hide. */ hiddenApiItems?: string[]; } /** * The type for value variable. */ export type ApiValueVariableType = Exclude; interface ApiVariableBase { /** * Name of the variable */ name: string; /** * Optional short description for the variable */ description?: string; /** * Completion item for the variable, leveraged bu the editor */ completion?: CompletionItem; } /** * Describes a dictionary type (feature, dictionary) */ export interface ApiDictionaryVariable extends ApiVariableBase { type: "dictionary"; /** * Dictionary properties */ properties?: ApiVariable[]; } /** * Describes a simple variable type (number, featureSet, etc.) */ export interface ApiValueVariable extends ApiVariableBase { type: ApiValueVariableType; } /** * The profile variable type */ export type ApiVariable = ApiDictionaryVariable | ApiValueVariable;