@arcgis/languages-sdk-spec 4.33.0-next.15 → 4.33.0-next.151
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.
- package/dist/index.d.ts +4 -415
- package/dist/index.js +1 -0
- package/dist/profile-types/arcade-profiles-types.d.ts +11 -0
- package/dist/profile-types/base.d.ts +59 -0
- package/dist/profile-types/index.d.ts +11 -0
- package/dist/profile-types/sql-profile-types.d.ts +11 -0
- package/dist/schema-types/arcade.d.ts +23 -0
- package/dist/schema-types/base.d.ts +163 -0
- package/dist/schema-types/common.d.ts +14 -0
- package/dist/schema-types/index.d.ts +21 -0
- package/dist/schema-types/sql.d.ts +55 -0
- package/dist/schemas/api-item.schema.json +158 -101
- package/dist/schemas/arcade-api-item.schema.json +32 -32
- package/dist/schemas/arcade-profiles.schema.json +1 -0
- package/dist/schemas/profiles.schema.json +6 -1
- package/dist/schemas/sql-api-item.schema.json +63 -160
- package/dist/schemas/sql-profiles.schema.json +5 -1
- package/dist/scripting/index.d.ts +1 -0
- package/dist/scripting/index.js +315 -0
- package/dist/scripting/utilities.d.ts +58 -0
- package/dist/t9n-types.d.ts +28 -0
- package/dist/types.d.ts +79 -0
- package/package.json +3 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ArcadeApiConstant, SchemaApiFunction, SchemaApiItem, SchemaCategory, SchemaExample, SchemaProperty, SchemaResourceLink, SchemaReturnDefinition, SchemaReturnValue, SingularApiItem } from '../schema-types';
|
|
2
|
+
import { SqlApiFunction } from '../schema-types/sql';
|
|
3
|
+
import { SdkDictionaryVariable, SdkVariable } from '../profile-types';
|
|
4
|
+
export type Paths = {
|
|
5
|
+
relativePath: string;
|
|
6
|
+
absolutePath: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function isSchemaDictionaryVariable(variable: SdkVariable): variable is SdkDictionaryVariable;
|
|
9
|
+
export declare function getDirectoryNames(path: string): Promise<string[]>;
|
|
10
|
+
export declare function getFileNames(path: string): Promise<string[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Structure used when reading the API Files
|
|
13
|
+
*/
|
|
14
|
+
export interface ApiDatabase {
|
|
15
|
+
categories: ApiCategories;
|
|
16
|
+
resources: ApiResources;
|
|
17
|
+
}
|
|
18
|
+
export type ApiCategories = Record<string, {
|
|
19
|
+
definition: SchemaCategory;
|
|
20
|
+
items: Map<string, SchemaApiItem>;
|
|
21
|
+
}>;
|
|
22
|
+
export type ApiResources = Record<string, string>;
|
|
23
|
+
export declare const DefaultApiResources: ApiResources;
|
|
24
|
+
export declare function isSchemaFunction(item: SchemaApiItem): item is SchemaApiFunction;
|
|
25
|
+
export declare function isSchemaConstant(item: SchemaApiItem): item is ArcadeApiConstant;
|
|
26
|
+
export declare function isSchemaReturnDefinition(item: SchemaReturnValue): item is SchemaReturnDefinition;
|
|
27
|
+
export declare function loadApiDatabase(languageFileName: string): Promise<ApiDatabase>;
|
|
28
|
+
export declare const toLocalConfig: {
|
|
29
|
+
minimumIntegerDigits: number;
|
|
30
|
+
useGrouping: boolean;
|
|
31
|
+
};
|
|
32
|
+
export declare function convertStringArrayToObject(array: string[] | string | undefined): Record<string, string>;
|
|
33
|
+
export declare function convertObjectToArray<T>(obj: Record<string, T> | undefined): T[] | undefined;
|
|
34
|
+
export declare function headingPattern(level: number): string;
|
|
35
|
+
export declare function isFunction(apiItem: SingularApiItem): apiItem is SchemaApiFunction;
|
|
36
|
+
export declare function assembleMarkdownString(value: string[] | string | undefined): string;
|
|
37
|
+
export declare function apiItemName(item: SchemaApiItem): string;
|
|
38
|
+
export declare function generateSinceVersionSection(resources: ApiResources, apiItem: SingularApiItem, paths: Paths, relative?: boolean): string[];
|
|
39
|
+
export declare function generateSignature(apiItem: SingularApiItem, paths: Paths, { relative, typeLink, needsHtmlEntity }?: {
|
|
40
|
+
relative?: boolean | undefined;
|
|
41
|
+
typeLink?: boolean | undefined;
|
|
42
|
+
needsHtmlEntity?: boolean | undefined;
|
|
43
|
+
}): string;
|
|
44
|
+
export declare function generateTypeLink(values: string[] | string, paths: Paths, relative?: boolean): string;
|
|
45
|
+
export declare function generateParametersSection(resources: ApiResources, parameters: SchemaProperty[] | undefined, paths: Paths, relative?: boolean, useTypeLinks?: boolean): string[];
|
|
46
|
+
export declare function generateReturnSection(resources: ApiResources, returnDefinition: SchemaReturnValue, paths: Paths, relative?: boolean, useTypeLinks?: boolean): string[];
|
|
47
|
+
export declare function generateExamplesSection(resources: ApiResources, examples: SchemaExample[] | undefined, headingPattern: "**" | "#####", language: string): string[];
|
|
48
|
+
export declare function generateAdditionalResourcesSection(resources: ApiResources, resourceLinks: SchemaResourceLink[] | undefined, headingPattern: "**" | "####"): string[];
|
|
49
|
+
export declare function fixUrl(description: string, paths: Paths, relative?: boolean): string;
|
|
50
|
+
/**
|
|
51
|
+
* Interlaces two arrays and joins them into a string with spaces.
|
|
52
|
+
* @param {string[]} array1 - The first array.
|
|
53
|
+
* @param {string[]} array2 - The second array.
|
|
54
|
+
* @param {number[]} [positions] - Optional positions for the second array elements.
|
|
55
|
+
* @returns {string[]} - The interlaced array.
|
|
56
|
+
*/
|
|
57
|
+
export declare function interlaceArrays(array1: string[], array2: string[], positions?: number[]): string;
|
|
58
|
+
export declare function isSqlApiFunction(apiItem: SchemaApiItem): apiItem is SqlApiFunction;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface T9NApiRoot {
|
|
2
|
+
resources: Record<string, string>;
|
|
3
|
+
categories: T9NCategories;
|
|
4
|
+
}
|
|
5
|
+
export type T9NCategories = Record<string, T9NCategory>;
|
|
6
|
+
export interface T9NCategory {
|
|
7
|
+
title: string;
|
|
8
|
+
description?: Record<string, string>;
|
|
9
|
+
items: T9NApiItems;
|
|
10
|
+
}
|
|
11
|
+
export type T9NResource = Record<string, string>;
|
|
12
|
+
export type T9NApiItems = Record<string, Record<string, T9NApiItem> | T9NApiItem>;
|
|
13
|
+
export interface T9NProperty {
|
|
14
|
+
description?: Record<string, string>;
|
|
15
|
+
properties?: Record<string, T9NProperty>;
|
|
16
|
+
}
|
|
17
|
+
export interface T9NApiItem {
|
|
18
|
+
description: Record<string, string>;
|
|
19
|
+
examples?: Record<string, Record<string, string>>;
|
|
20
|
+
parameters?: Record<string, T9NProperty>;
|
|
21
|
+
returnValue?: T9NProperty;
|
|
22
|
+
}
|
|
23
|
+
export type T9NProfiles = Record<string, T9NProfileVariables>;
|
|
24
|
+
export type T9NProfileVariables = Record<string, T9NProfileVariable>;
|
|
25
|
+
export interface T9NProfileVariable {
|
|
26
|
+
description?: string;
|
|
27
|
+
properties?: T9NProfileVariables;
|
|
28
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { BundleType } from './schema-types';
|
|
2
|
+
import { CompletionItem } from 'vscode-languageserver-types';
|
|
3
|
+
import { ProfileId, SdkPredefinedProfile, SdkVariable, SdkValueVariable, SdkDictionaryVariable, SdkVariableType } from './profile-types';
|
|
4
|
+
/**
|
|
5
|
+
* Represents an api category and its items
|
|
6
|
+
*/
|
|
7
|
+
interface SdkCategory {
|
|
8
|
+
/**
|
|
9
|
+
* The unique ID for the category
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* The title for the category
|
|
14
|
+
*/
|
|
15
|
+
title: string;
|
|
16
|
+
/**
|
|
17
|
+
* The collection of api items for the category
|
|
18
|
+
*/
|
|
19
|
+
items: SdkItem[];
|
|
20
|
+
}
|
|
21
|
+
interface SdkItemBase {
|
|
22
|
+
/**
|
|
23
|
+
* The name of the function or constant.
|
|
24
|
+
*/
|
|
25
|
+
name: string;
|
|
26
|
+
/**
|
|
27
|
+
* The version string when the api item was introduced. If undefined then it was from the origin.
|
|
28
|
+
*/
|
|
29
|
+
sinceVersion?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The api bundle this item belongs to.
|
|
32
|
+
*/
|
|
33
|
+
bundle: BundleType;
|
|
34
|
+
/**
|
|
35
|
+
* Markdown description of the item.
|
|
36
|
+
*/
|
|
37
|
+
description: string;
|
|
38
|
+
/**
|
|
39
|
+
* Markdown containing examples.
|
|
40
|
+
*/
|
|
41
|
+
examples: string;
|
|
42
|
+
/**
|
|
43
|
+
* Link for additional information about the item.
|
|
44
|
+
*/
|
|
45
|
+
link?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Completion item directly leveraged by the editor.
|
|
48
|
+
*/
|
|
49
|
+
completion: CompletionItem;
|
|
50
|
+
/**
|
|
51
|
+
* Indicates if the documentation for this item should be disabled.
|
|
52
|
+
*/
|
|
53
|
+
disableDocumentation?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Represents a constant in the arcade api.
|
|
57
|
+
*/
|
|
58
|
+
interface SdkConstant extends SdkItemBase {
|
|
59
|
+
type: "constant";
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Represents a function in the arcade api
|
|
63
|
+
*/
|
|
64
|
+
interface SdkFunction extends SdkItemBase {
|
|
65
|
+
type: "function";
|
|
66
|
+
/**
|
|
67
|
+
* Information leveraged by the editor to validate function call.
|
|
68
|
+
* Indicates the minimum number of expected parameters and the maximum number of parameters expected.
|
|
69
|
+
*/
|
|
70
|
+
parametersInfo: {
|
|
71
|
+
min: number;
|
|
72
|
+
max: number;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Represents an item in the arcade api.
|
|
77
|
+
*/
|
|
78
|
+
type SdkItem = SdkConstant | SdkFunction | SdkFunction[];
|
|
79
|
+
export type { CompletionItem, ProfileId, BundleType, SdkPredefinedProfile, SdkVariable, SdkValueVariable, SdkDictionaryVariable, SdkVariableType, SdkCategory, SdkItem, SdkItemBase, SdkConstant, SdkFunction, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/languages-sdk-spec",
|
|
3
|
-
"version": "4.33.0-next.
|
|
3
|
+
"version": "4.33.0-next.151",
|
|
4
4
|
"description": "ArcGIS languages types and schemas for design a language sdk",
|
|
5
5
|
"homepage": "https://developers.arcgis.com/javascript/latest/",
|
|
6
6
|
"type": "module",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": "./dist/index.js",
|
|
12
|
+
"./scripting": "./dist/scripting/index.js",
|
|
12
13
|
"./dist/schemas/*.schema.json": "./dist/schemas/*.schema.json"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
],
|
|
17
18
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"tslib": "^2.
|
|
20
|
+
"tslib": "^2.8.1",
|
|
20
21
|
"vscode-languageserver-types": "^3.17.5"
|
|
21
22
|
}
|
|
22
23
|
}
|