@intersystems-community/ascot 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,210 @@
1
+ /** @module Interface iris:ascot/common **/
2
+ export interface Position {
3
+ line: number,
4
+ character: number,
5
+ }
6
+ export interface NameInfo {
7
+ before: Position,
8
+ content: string,
9
+ after: Position,
10
+ }
11
+ export interface ParameterInfo {
12
+ t?: string,
13
+ v?: string,
14
+ }
15
+ /**
16
+ * # Variants
17
+ *
18
+ * ## `"list"`
19
+ *
20
+ * ## `"array"`
21
+ */
22
+ export type CollectionKind = 'list' | 'array';
23
+ export interface PropertyInfo {
24
+ t?: string,
25
+ collection?: CollectionKind,
26
+ multidimensional: boolean,
27
+ }
28
+ /**
29
+ * # Variants
30
+ *
31
+ * ## `"default"`
32
+ *
33
+ * ## `"output"`
34
+ *
35
+ * ## `"by-ref"`
36
+ */
37
+ export type ArgMode = 'default' | 'output' | 'by-ref';
38
+ export interface Range {
39
+ start: Position,
40
+ end: Position,
41
+ }
42
+ export interface NormalArg {
43
+ mode: ArgMode,
44
+ name: string,
45
+ t?: string,
46
+ 'default'?: string,
47
+ declaredAt?: Range,
48
+ }
49
+ export interface VariadicArg {
50
+ mode: ArgMode,
51
+ name: string,
52
+ t?: string,
53
+ declaredAt?: Range,
54
+ }
55
+ export interface MethodInfo {
56
+ normal: Array<NormalArg>,
57
+ variadic?: VariadicArg,
58
+ t?: string,
59
+ procedureBlock?: Array<string>,
60
+ body: Range,
61
+ }
62
+ export type MemberKind = MemberKindParameter | MemberKindProperty | MemberKindRelationship | MemberKindForeignKey | MemberKindIndex | MemberKindProjection | MemberKindTrigger | MemberKindXData | MemberKindStorage | MemberKindQuery | MemberKindMethod | MemberKindClassMethod | MemberKindClientMethod;
63
+ export interface MemberKindParameter {
64
+ tag: 'parameter',
65
+ val: ParameterInfo,
66
+ }
67
+ export interface MemberKindProperty {
68
+ tag: 'property',
69
+ val: PropertyInfo,
70
+ }
71
+ export interface MemberKindRelationship {
72
+ tag: 'relationship',
73
+ val: string | undefined,
74
+ }
75
+ export interface MemberKindForeignKey {
76
+ tag: 'foreign-key',
77
+ }
78
+ export interface MemberKindIndex {
79
+ tag: 'index',
80
+ }
81
+ export interface MemberKindProjection {
82
+ tag: 'projection',
83
+ }
84
+ export interface MemberKindTrigger {
85
+ tag: 'trigger',
86
+ }
87
+ export interface MemberKindXData {
88
+ tag: 'x-data',
89
+ }
90
+ export interface MemberKindStorage {
91
+ tag: 'storage',
92
+ }
93
+ export interface MemberKindQuery {
94
+ tag: 'query',
95
+ }
96
+ export interface MemberKindMethod {
97
+ tag: 'method',
98
+ val: MethodInfo,
99
+ }
100
+ export interface MemberKindClassMethod {
101
+ tag: 'class-method',
102
+ val: MethodInfo,
103
+ }
104
+ export interface MemberKindClientMethod {
105
+ tag: 'client-method',
106
+ val: MethodInfo,
107
+ }
108
+ export interface MemberInfo {
109
+ doc: string,
110
+ before: Position,
111
+ name: NameInfo,
112
+ aliases: Array<string>,
113
+ deprecated: boolean,
114
+ kind: MemberKind,
115
+ after: Position,
116
+ uri?: string,
117
+ origin?: string,
118
+ }
119
+ export interface ClassInfo {
120
+ doc: string,
121
+ name: NameInfo,
122
+ 'extends': Array<string>,
123
+ deprecated: boolean,
124
+ members: Array<MemberInfo>,
125
+ propertyClassNames: Array<string>,
126
+ includes: Array<string>,
127
+ isDatatype?: boolean,
128
+ uri?: string,
129
+ }
130
+ export interface RoutineSource {
131
+ text: string,
132
+ uri?: string,
133
+ }
134
+ export interface Location {
135
+ uri: string,
136
+ range: Range,
137
+ }
138
+ export interface DiagnosticRelatedInformation {
139
+ location: Location,
140
+ message: string,
141
+ }
142
+ /**
143
+ * # Variants
144
+ *
145
+ * ## `"error"`
146
+ *
147
+ * ## `"warning"`
148
+ *
149
+ * ## `"information"`
150
+ *
151
+ * ## `"hint"`
152
+ */
153
+ export type DiagnosticSeverity = 'error' | 'warning' | 'information' | 'hint';
154
+ export interface Diagnostic {
155
+ message: string,
156
+ range: Range,
157
+ relatedInformation: Array<DiagnosticRelatedInformation>,
158
+ severity: DiagnosticSeverity,
159
+ }
160
+ export interface InlayHint {
161
+ position: Position,
162
+ label: string,
163
+ paddingLeft: boolean,
164
+ paddingRight: boolean,
165
+ }
166
+ /**
167
+ * # Variants
168
+ *
169
+ * ## `"class"`
170
+ *
171
+ * ## `"module"`
172
+ *
173
+ * ## `"method"`
174
+ *
175
+ * ## `"property"`
176
+ *
177
+ * ## `"interface"`
178
+ *
179
+ * ## `"function"`
180
+ *
181
+ * ## `"constant"`
182
+ *
183
+ * ## `"array"`
184
+ *
185
+ * ## `"object"`
186
+ *
187
+ * ## `"key"`
188
+ *
189
+ * ## `"struct"`
190
+ *
191
+ * ## `"event"`
192
+ */
193
+ export type SymbolKind = 'class' | 'module' | 'method' | 'property' | 'interface' | 'function' | 'constant' | 'array' | 'object' | 'key' | 'struct' | 'event';
194
+ export interface SymbolInfo {
195
+ name: string,
196
+ kind: SymbolKind,
197
+ deprecated: boolean,
198
+ range: Range,
199
+ selectionRange: Range,
200
+ }
201
+ export interface DocumentSymbol {
202
+ root: SymbolInfo,
203
+ members: Array<SymbolInfo>,
204
+ }
205
+ export interface WorkspaceSymbol {
206
+ name: string,
207
+ kind: SymbolKind,
208
+ deprecated: boolean,
209
+ location: Location,
210
+ }
@@ -0,0 +1,26 @@
1
+ /** @module Interface iris:ascot/exported **/
2
+ export type MemberInfo = import('./iris-ascot-common.js').MemberInfo;
3
+ export type ClassInfo = import('./iris-ascot-common.js').ClassInfo;
4
+ export type Position = import('./iris-ascot-common.js').Position;
5
+ export type Diagnostic = import('./iris-ascot-common.js').Diagnostic;
6
+ export type InlayHint = import('./iris-ascot-common.js').InlayHint;
7
+ export type Range = import('./iris-ascot-common.js').Range;
8
+ export type Location = import('./iris-ascot-common.js').Location;
9
+ export type DocumentSymbol = import('./iris-ascot-common.js').DocumentSymbol;
10
+ export type WorkspaceSymbol = import('./iris-ascot-common.js').WorkspaceSymbol;
11
+ export type IrisConnection = import('./iris-ascot-imported.js').IrisConnection;
12
+
13
+ export class Workspace {
14
+ constructor(env: IrisConnection | undefined)
15
+ open(uri: string, text: string): Array<string>;
16
+ close(uri: string): Array<string>;
17
+ diagnostics(uri: string): Promise<Array<Diagnostic>>;
18
+ inlayHint(uri: string, range: Range): Promise<Array<InlayHint>>;
19
+ definition(uri: string, position: Position): Promise<Location | undefined>;
20
+ references(uri: string, position: Position, includeDeclaration: boolean): Promise<Array<Location>>;
21
+ hover(uri: string, position: Position): Promise<string | undefined>;
22
+ queryCls(query: string): Promise<Array<[string, ClassInfo]>>;
23
+ queryMem(cls: string, query: string): Promise<Array<[string, MemberInfo]>>;
24
+ documentSymbol(uri: string): Promise<DocumentSymbol | undefined>;
25
+ workspaceSymbol(query: string): Promise<Array<WorkspaceSymbol>>;
26
+ }
@@ -0,0 +1,13 @@
1
+ /** @module Interface iris:ascot/imported **/
2
+ export type ClassInfo = import('./iris-ascot-common.js').ClassInfo;
3
+ export type RoutineSource = import('./iris-ascot-common.js').RoutineSource;
4
+
5
+ export class IrisConnection {
6
+ /**
7
+ * This type does not have a public constructor.
8
+ */
9
+ private constructor();
10
+ getCls(cls: string): Promise<ClassInfo | undefined>;
11
+ getInc(name: string): Promise<RoutineSource | undefined>;
12
+ getIntOrMac(name: string): Promise<RoutineSource | undefined>;
13
+ }
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,29 @@
1
1
  {
2
2
  "name": "@intersystems-community/ascot",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "ascot, a type checker and code intelligence engine for InterSystems ObjectScript, for Node and other JS consumers.",
5
+ "license": "MIT OR Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/intersystems-community/ascot.git",
9
+ "directory": "bindings/js"
10
+ },
11
+ "main": "dist/index.js",
12
+ "types": "dist/index.d.ts",
13
+ "files": [
14
+ "dist",
15
+ "generated",
16
+ "lib/*.core*.wasm"
17
+ ],
18
+ "engines": {
19
+ "node": ">=18"
20
+ },
21
+ "scripts": {
22
+ "build": "bash scripts/build.sh"
23
+ },
24
+ "devDependencies": {
25
+ "@bytecodealliance/jco": "^1.37.0",
26
+ "@types/node": "^26.6.5",
27
+ "typescript": "^7.0.2"
28
+ }
29
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.