@arcgis/arcade-languageservice 4.28.0-beta.11 → 4.28.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/esm/index.d.ts +199 -7
  2. package/package.json +3 -3
@@ -1,11 +1,152 @@
1
- import { ProfileId, BundleType, SdkVariableType, SdkConstant, SdkFunction, SdkCategory } from '@arcgis/arcade-sdk';
2
- export { SdkConstant as ApiConstant, SdkFunction as ApiFunction, SdkVariableType as ApiVariableType, BundleType, ProfileId, SdkPredefinedProfile } from '@arcgis/arcade-sdk';
3
1
  import { CompletionItem, Range, DiagnosticSeverity, Position, CompletionList, TextEdit } from 'vscode-languageserver-types';
4
2
  export { DiagnosticSeverity } from 'vscode-languageserver-types';
5
- import * as Parser from '@arcgis/arcade-parser';
6
- import { Keywords, Literals } from '@arcgis/arcade-parser';
7
3
  import { TextDocument } from 'vscode-languageserver-textdocument';
8
4
 
5
+ /**
6
+ * Supported function bundles
7
+ */
8
+ type BundleType = "core" | "data-access" | "database" | "geometry" | "portal-access" | "track";
9
+
10
+ /**
11
+ * The list of supported profiles
12
+ */
13
+ type ProfileId = "minimalist" | "alias" | "attribute-rule-calculation" | "attribute-rule-constraint" | "attribute-rule-validation" | "dashboard-indicator-formatting" | "dashboard-list-formatting" | "dashboard-table-formatting" | "dashboard-data" | "dictionary-renderer" | "feature-z" | "field-calculation" | "field-mapping" | "form-calculation" | "form-constraint" | "geoanalytics" | "geotrigger-notification" | "labeling" | "layout" | "location-update-constraint" | "measure-visualization" | "popup" | "popup-element" | "popup-feature-reduction" | "popup-element-feature-reduction" | "quick-capture" | "tasks" | "velocity" | "visualization";
14
+ /**
15
+ * Describes a profile
16
+ */
17
+ interface SdkPredefinedProfile {
18
+ /**
19
+ * Profile name for UI
20
+ */
21
+ name: string;
22
+ /**
23
+ * Profile id for docs
24
+ */
25
+ id: ProfileId;
26
+ /**
27
+ * Function bundles enabled for this profile
28
+ */
29
+ bundles: BundleType[];
30
+ /**
31
+ * Variable describing name, type, and providing description
32
+ */
33
+ variables: SdkVariable[];
34
+ }
35
+ /**
36
+ * Supported profile variable types
37
+ */
38
+ type SdkVariableType = "number" | "text" | "date" | "dateOnly" | "time" | "boolean" | "dictionary" | "array" | "geometry" | "feature" | "featureSet" | "featureSetCollection";
39
+ /**
40
+ * Describes variables
41
+ */
42
+ interface SdkVariableBase {
43
+ /**
44
+ * Name of the variable.
45
+ */
46
+ name: string;
47
+ /**
48
+ * Type of the variable.
49
+ */
50
+ type: SdkVariableType;
51
+ /**
52
+ * Description of the variable.
53
+ */
54
+ description?: string;
55
+ }
56
+ /**
57
+ * A variable that represents a simple type (boolean, number, feature, etc.)
58
+ */
59
+ interface SdkValueVariable extends SdkVariableBase {
60
+ type: Exclude<SdkVariableType, "dictionary">;
61
+ }
62
+ /**
63
+ * A dictionary variable
64
+ */
65
+ interface SdkDictionaryVariable extends SdkVariableBase {
66
+ type: "dictionary";
67
+ properties: SdkVariable[];
68
+ }
69
+ /**
70
+ * Profile variable
71
+ */
72
+ type SdkVariable = SdkValueVariable | SdkDictionaryVariable;
73
+
74
+ /**
75
+ * Represents an api category and its items
76
+ */
77
+ interface SdkCategory {
78
+ /**
79
+ * The unique ID for the category
80
+ */
81
+ id: string;
82
+ /**
83
+ * The title for the category
84
+ */
85
+ title: string;
86
+ /**
87
+ * The collection of api items for the category
88
+ */
89
+ items: SdkItem[];
90
+ }
91
+ interface SdkItemBase {
92
+ /**
93
+ * The name of the function or constant.
94
+ */
95
+ name: string;
96
+ /**
97
+ * The version string when the api item was introduced. If undefined then it was from the origin.
98
+ */
99
+ sinceVersion?: string;
100
+ /**
101
+ * The api bundle this item belongs to.
102
+ */
103
+ bundle: BundleType;
104
+ /**
105
+ * Markdown description of the item.
106
+ */
107
+ description: string;
108
+ /**
109
+ * Markdown containing examples.
110
+ */
111
+ examples: string;
112
+ /**
113
+ * Link for additional information about the item.
114
+ */
115
+ link: string;
116
+ /**
117
+ * Completion item directly leveraged by the editor.
118
+ */
119
+ completion: CompletionItem;
120
+ /**
121
+ * Indicates if the documentation for this item should be disabled.
122
+ */
123
+ disableDocumentation?: boolean;
124
+ }
125
+ /**
126
+ * Represents a constant in the arcade api.
127
+ */
128
+ interface SdkConstant extends SdkItemBase {
129
+ type: "constant";
130
+ }
131
+ /**
132
+ * Represents a function in the arcade api
133
+ */
134
+ interface SdkFunction extends SdkItemBase {
135
+ type: "function";
136
+ /**
137
+ * Information leveraged by the editor to validate function call.
138
+ * Indicates the minimum number of expected parameters and the maximum number of parameters expected.
139
+ */
140
+ parametersInfo: {
141
+ min: number;
142
+ max: number;
143
+ };
144
+ }
145
+ /**
146
+ * Represents an item in the arcade api.
147
+ */
148
+ type SdkItem = SdkConstant | SdkFunction | SdkFunction[];
149
+
9
150
  /**
10
151
  * Describes the formatting options
11
152
  */
@@ -150,6 +291,57 @@ declare function isValueVariable(variable: ApiVariable | null | undefined): vari
150
291
  */
151
292
  declare function isDictionaryVariable(variable: ApiVariable | null | undefined): variable is ApiDictionaryVariable;
152
293
 
294
+ declare enum Literals {
295
+ False = "false",
296
+ Null = "null",
297
+ True = "true"
298
+ }
299
+ declare enum Keywords {
300
+ Break = "break",
301
+ Continue = "continue",
302
+ Else = "else",
303
+ For = "for",
304
+ From = "from",
305
+ Function = "function",
306
+ If = "if",
307
+ Import = "import",
308
+ Export = "export",
309
+ In = "in",
310
+ Return = "return",
311
+ Var = "var",
312
+ While = "while"
313
+ }
314
+ declare enum DiagnosticCodes$1 {
315
+ InvalidModuleUri = "InvalidModuleUri",
316
+ ForInOfLoopInitializer = "ForInOfLoopInitializer",
317
+ IdentiferExpected = "IdentiferExpected",
318
+ InvalidEscapedReservedWord = "InvalidEscapedReservedWord",
319
+ InvalidExpression = "InvalidExpression",
320
+ InvalidFunctionIdentifier = "InvalidFunctionIdentifier",
321
+ InvalidHexEscapeSequence = "InvalidHexEscapeSequence",
322
+ InvalidLeftHandSideInAssignment = "InvalidLeftHandSideInAssignment",
323
+ InvalidLeftHandSideInForIn = "InvalidLeftHandSideInForIn",
324
+ InvalidTemplateHead = "InvalidTemplateHead",
325
+ InvalidVariableAssignment = "InvalidVariableAssignment",
326
+ KeyMustBeString = "KeyMustBeString",
327
+ NoFunctionInsideBlock = "NoFunctionInsideBlock",
328
+ NoFunctionInsideFunction = "NoFunctionInsideFunction",
329
+ ModuleExportRootOnly = "ModuleExportRootOnly",
330
+ ModuleImportRootOnly = "ModuleImportRootOnly",
331
+ PunctuatorExpected = "PunctuatorExpected",
332
+ TemplateOctalLiteral = "TemplateOctalLiteral",
333
+ UnexpectedBoolean = "UnexpectedBoolean",
334
+ UnexpectedEndOfScript = "UnexpectedEndOfScript",
335
+ UnexpectedIdentifier = "UnexpectedIdentifier",
336
+ UnexpectedKeyword = "UnexpectedKeyword",
337
+ UnexpectedNull = "UnexpectedNull",
338
+ UnexpectedNumber = "UnexpectedNumber",
339
+ UnexpectedPunctuator = "UnexpectedPunctuator",
340
+ UnexpectedString = "UnexpectedString",
341
+ UnexpectedTemplate = "UnexpectedTemplate",
342
+ UnexpectedToken = "UnexpectedToken"
343
+ }
344
+
153
345
  /**
154
346
  * Represents the data associated with a diagnostic.
155
347
  * For example in case of an error associated to an identifier,
@@ -159,7 +351,7 @@ type DiagnosticData = Record<string, number | string>;
159
351
  /**
160
352
  * The combined diagnostic codes
161
353
  */
162
- type DiagnosticCodes = Parser.DiagnosticCodes | ValidationDiagnosticCodes;
354
+ type DiagnosticCodes = DiagnosticCodes$1 | ValidationDiagnosticCodes;
163
355
  /**
164
356
  * Represents a diagnostic, such as a parsing error or warning.
165
357
  */
@@ -211,7 +403,7 @@ declare enum ValidationDiagnosticCodes {
211
403
  UnknownPropertyIdentifier = "UnknownPropertyIdentifier"
212
404
  }
213
405
  declare const DiagnosticMessages: {
214
- [key in ValidationDiagnosticCodes & Parser.DiagnosticCodes]: string;
406
+ [key in ValidationDiagnosticCodes & DiagnosticCodes$1]: string;
215
407
  };
216
408
 
217
409
  /**
@@ -283,4 +475,4 @@ type ProfileStrings = {
283
475
  domainvaluesbysubtypes: string;
284
476
  };
285
477
 
286
- export { ApiCategory, ApiContext, ApiDictionaryVariable, ApiItem, ApiProfile, ApiSnippet, ApiValueVariable, ApiValueVariableType, ApiVariable, ArcadeKeywords, ArcadeLanguageService, ArcadeLanguageServiceSettings, ArcadeLiterals, ArcadeReservedKeywords, Diagnostic, DiagnosticCodes, DiagnosticData, DiagnosticMessages, FormattingOptions, ProfileStrings, ValidationDiagnosticCodes, isDictionaryVariable, isValueVariable };
478
+ export { ApiCategory, SdkConstant as ApiConstant, ApiContext, ApiDictionaryVariable, SdkFunction as ApiFunction, ApiItem, ApiProfile, ApiSnippet, ApiValueVariable, ApiValueVariableType, ApiVariable, SdkVariableType as ApiVariableType, ArcadeKeywords, ArcadeLanguageService, ArcadeLanguageServiceSettings, ArcadeLiterals, ArcadeReservedKeywords, BundleType, Diagnostic, DiagnosticCodes, DiagnosticData, DiagnosticMessages, FormattingOptions, ProfileId, ProfileStrings, SdkPredefinedProfile, ValidationDiagnosticCodes, isDictionaryVariable, isValueVariable };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arcgis/arcade-languageservice",
3
3
  "description": "Arcade Language Service",
4
- "version": "4.28.0-beta.11",
4
+ "version": "4.28.0-beta.12",
5
5
  "type": "module",
6
6
  "module": "dist/esm/index.js",
7
7
  "main": "dist/esm/index.js",
@@ -33,7 +33,7 @@
33
33
  "@arcgis/arcade-parser": "1.20.5",
34
34
  "@arcgis/arcade-sdk": "1.24.0-next.5",
35
35
  "@arcgis/arcade-tests": "^1.20.0",
36
- "@arcgis/components-plugins": "4.28.0-beta.11",
36
+ "@arcgis/components-plugins": "4.28.0-beta.12",
37
37
  "@arcgis/eslint-config": "1.0.0",
38
38
  "@arcgis/typescript-config": "1.0.0",
39
39
  "@types/fs-extra": "^11.0.1",
@@ -53,5 +53,5 @@
53
53
  "tsup": "^7.2.0",
54
54
  "typescript": "4.9.5"
55
55
  },
56
- "gitHead": "4a899ae3940bdcf125ca40ea41a73d9ae0b159a6"
56
+ "gitHead": "0fc81414d18e1e8b9e1feb27b355c429e5f79024"
57
57
  }