qsharp-lang 0.1.0-dev.1 → 1.0.5-dev

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.
@@ -1,43 +1,48 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * @param {any} callback
5
- * @param {number} level
6
- */
7
- export function initLogging(callback: any, level: number): void;
8
- /**
9
- * @param {number} level
4
+ * @returns {string}
10
5
  */
11
- export function setLogLevel(level: number): void;
6
+ export function git_hash(): string;
12
7
  /**
13
- * @returns {any}
8
+ * @param {string} code
9
+ * @returns {string}
14
10
  */
15
- export function git_hash(): any;
11
+ export function get_qir(code: string): string;
16
12
  /**
17
13
  * @param {string} name
18
- * @returns {any}
14
+ * @returns {string | undefined}
19
15
  */
20
- export function get_library_source_content(name: string): any;
16
+ export function get_library_source_content(name: string): string | undefined;
21
17
  /**
22
18
  * @param {string} code
23
- * @returns {any}
19
+ * @returns {string}
24
20
  */
25
- export function get_hir(code: string): any;
21
+ export function get_hir(code: string): string;
26
22
  /**
27
23
  * @param {string} code
28
24
  * @param {string} expr
29
25
  * @param {Function} event_cb
30
26
  * @param {number} shots
31
- * @returns {any}
27
+ * @returns {boolean}
32
28
  */
33
- export function run(code: string, expr: string, event_cb: Function, shots: number): any;
29
+ export function run(code: string, expr: string, event_cb: Function, shots: number): boolean;
34
30
  /**
35
31
  * @param {string} solution_code
36
32
  * @param {any} exercise_sources_js
37
33
  * @param {Function} event_cb
38
- * @returns {any}
34
+ * @returns {boolean}
35
+ */
36
+ export function check_exercise_solution(solution_code: string, exercise_sources_js: any, event_cb: Function): boolean;
37
+ /**
38
+ * @param {any} callback
39
+ * @param {number} level
39
40
  */
40
- export function check_exercise_solution(solution_code: string, exercise_sources_js: any, event_cb: Function): any;
41
+ export function initLogging(callback: any, level: number): void;
42
+ /**
43
+ * @param {number} level
44
+ */
45
+ export function setLogLevel(level: number): void;
41
46
  /**
42
47
  */
43
48
  export enum StepResultId {
@@ -47,117 +52,129 @@ export enum StepResultId {
47
52
  StepOut = 3,
48
53
  Return = 4,
49
54
  }
55
+ export interface IWorkspaceConfiguration {
56
+ targetProfile?: "full" | "base";
57
+ packageType?: "exe" | "lib";
58
+ }
50
59
 
51
- export interface IStructStepResult {
52
- id: number;
53
- value: number;
54
- }
55
-
56
-
57
-
58
- export interface IBreakpointSpan {
59
- id: number;
60
- lo: number;
61
- hi: number;
62
- }
63
-
64
- export interface IBreakpointSpanList {
65
- spans: Array<IBreakpointSpan>
66
- }
67
-
68
-
69
-
70
- export interface IStackFrame {
71
- name: string;
72
- path: string;
73
- lo: number;
74
- hi: number;
75
- }
76
-
77
- export interface IStackFrameList {
78
- frames: Array<IStackFrame>
79
- }
80
-
81
-
82
-
83
- export interface IVariable {
84
- name: string;
85
- value: string;
86
- var_type: "Array"
87
- | "BigInt"
88
- | "Bool"
89
- | "Closure"
90
- | "Double"
91
- | "Global"
92
- | "Int"
93
- | "Pauli"
94
- | "Qubit"
95
- | "Range"
96
- | "Result"
97
- | "String"
98
- | "Tuple";
99
- }
100
-
101
- export interface IVariableList {
102
- variables: Array<IVariable>
103
- }
60
+ export interface ICompletionList {
61
+ items: ICompletionItem[]
62
+ }
104
63
 
64
+ export interface ICompletionItem {
65
+ label: string;
66
+ kind: "function" | "interface" | "keyword" | "module";
67
+ sortText?: string;
68
+ detail?: string;
69
+ additionalTextEdits?: ITextEdit[];
70
+ }
105
71
 
72
+ export interface ITextEdit {
73
+ range: ISpan;
74
+ newText: string;
75
+ }
106
76
 
107
- export interface IQuantumState {
108
- name: string;
109
- value: string;
110
- }
111
- export interface IQuantumStateList {
112
- entries: Array<IQuantumState>
113
- }
77
+ export interface IHover {
78
+ contents: string;
79
+ span: ISpan
80
+ }
114
81
 
82
+ export interface IDefinition {
83
+ source: string;
84
+ offset: number;
85
+ }
115
86
 
87
+ export interface ISignatureHelp {
88
+ signatures: ISignatureInformation[];
89
+ activeSignature: number;
90
+ activeParameter: number;
91
+ }
116
92
 
117
- export interface ICompletionList {
118
- items: Array<{
93
+ export interface ISignatureInformation {
119
94
  label: string;
120
- kind: "function" | "interface" | "keyword" | "module";
121
- sortText?: string;
122
- detail?: string;
123
- additionalTextEdits?: TextEdit[];
124
- }>
125
- }
95
+ documentation?: string;
96
+ parameters: IParameterInformation[];
97
+ }
126
98
 
99
+ export interface IParameterInformation {
100
+ label: ISpan;
101
+ documentation?: string;
102
+ }
127
103
 
104
+ export interface ISpan {
105
+ start: number;
106
+ end: number;
107
+ }
128
108
 
129
- export interface ITextEdit {
130
- range: { start: number; end: number; };
131
- newText: string;
132
- }
109
+ export interface IDiagnostic {
110
+ start_pos: number;
111
+ end_pos: number;
112
+ message: string;
113
+ severity: "error" | "warning" | "info"
114
+ code?: {
115
+ value: string;
116
+ target: string;
117
+ }
118
+ }
133
119
 
120
+ export interface IStructStepResult {
121
+ id: number;
122
+ value: number;
123
+ }
134
124
 
125
+ export interface IBreakpointSpanList {
126
+ spans: Array<IBreakpointSpan>
127
+ }
128
+
135
129
 
136
- export interface IHover {
137
- contents: string;
138
- span: { start: number; end: number }
139
- }
130
+ export interface IBreakpointSpan {
131
+ id: number;
132
+ lo: number;
133
+ hi: number;
134
+ }
140
135
 
136
+ export interface IStackFrameList {
137
+ frames: Array<IStackFrame>
138
+ }
139
+
141
140
 
141
+ export interface IStackFrame {
142
+ name: string;
143
+ path: string;
144
+ lo: number;
145
+ hi: number;
146
+ }
142
147
 
143
- export interface IDefinition {
144
- source: string;
145
- offset: number;
146
- }
148
+ export interface IVariableList {
149
+ variables: Array<IVariable>
150
+ }
147
151
 
152
+ export interface IVariable {
153
+ name: string;
154
+ value: string;
155
+ var_type: "Array"
156
+ | "BigInt"
157
+ | "Bool"
158
+ | "Closure"
159
+ | "Double"
160
+ | "Global"
161
+ | "Int"
162
+ | "Pauli"
163
+ | "Qubit"
164
+ | "Range"
165
+ | "Result"
166
+ | "String"
167
+ | "Tuple";
168
+ }
148
169
 
170
+ export interface IQuantumStateList {
171
+ entries: Array<IQuantumState>
172
+ }
149
173
 
150
- export interface IDiagnostic {
151
- start_pos: number;
152
- end_pos: number;
153
- message: string;
154
- severity: "error" | "warning" | "info"
155
- code?: {
174
+ export interface IQuantumState {
175
+ name: string;
156
176
  value: string;
157
- target: string;
158
177
  }
159
- }
160
-
161
178
 
162
179
  /**
163
180
  */
@@ -174,46 +191,46 @@ export class DebugService {
174
191
  */
175
192
  load_source(path: string, source: string, entry?: string): string;
176
193
  /**
177
- * @returns {any}
194
+ * @returns {IQuantumStateList}
178
195
  */
179
- capture_quantum_state(): any;
196
+ capture_quantum_state(): IQuantumStateList;
180
197
  /**
181
- * @returns {any}
198
+ * @returns {IStackFrameList}
182
199
  */
183
- get_stack_frames(): any;
200
+ get_stack_frames(): IStackFrameList;
184
201
  /**
185
202
  * @param {Function} event_cb
186
203
  * @param {Uint32Array} ids
187
- * @returns {any}
204
+ * @returns {IStructStepResult}
188
205
  */
189
- eval_next(event_cb: Function, ids: Uint32Array): any;
206
+ eval_next(event_cb: Function, ids: Uint32Array): IStructStepResult;
190
207
  /**
191
208
  * @param {Function} event_cb
192
209
  * @param {Uint32Array} ids
193
- * @returns {any}
210
+ * @returns {IStructStepResult}
194
211
  */
195
- eval_continue(event_cb: Function, ids: Uint32Array): any;
212
+ eval_continue(event_cb: Function, ids: Uint32Array): IStructStepResult;
196
213
  /**
197
214
  * @param {Function} event_cb
198
215
  * @param {Uint32Array} ids
199
- * @returns {any}
216
+ * @returns {IStructStepResult}
200
217
  */
201
- eval_step_in(event_cb: Function, ids: Uint32Array): any;
218
+ eval_step_in(event_cb: Function, ids: Uint32Array): IStructStepResult;
202
219
  /**
203
220
  * @param {Function} event_cb
204
221
  * @param {Uint32Array} ids
205
- * @returns {any}
222
+ * @returns {IStructStepResult}
206
223
  */
207
- eval_step_out(event_cb: Function, ids: Uint32Array): any;
224
+ eval_step_out(event_cb: Function, ids: Uint32Array): IStructStepResult;
208
225
  /**
209
226
  * @param {string} path
210
- * @returns {any}
227
+ * @returns {IBreakpointSpanList}
211
228
  */
212
- get_breakpoints(path: string): any;
229
+ get_breakpoints(path: string): IBreakpointSpanList;
213
230
  /**
214
- * @returns {any}
231
+ * @returns {IVariableList}
215
232
  */
216
- get_locals(): any;
233
+ get_locals(): IVariableList;
217
234
  }
218
235
  /**
219
236
  */
@@ -224,12 +241,15 @@ export class LanguageService {
224
241
  */
225
242
  constructor(diagnostics_callback: Function);
226
243
  /**
244
+ * @param {IWorkspaceConfiguration} config
245
+ */
246
+ update_configuration(config: IWorkspaceConfiguration): void;
247
+ /**
227
248
  * @param {string} uri
228
249
  * @param {number} version
229
250
  * @param {string} text
230
- * @param {boolean} is_exe
231
251
  */
232
- update_document(uri: string, version: number, text: string, is_exe: boolean): void;
252
+ update_document(uri: string, version: number, text: string): void;
233
253
  /**
234
254
  * @param {string} uri
235
255
  */
@@ -237,30 +257,25 @@ export class LanguageService {
237
257
  /**
238
258
  * @param {string} uri
239
259
  * @param {number} offset
240
- * @returns {any}
260
+ * @returns {ICompletionList}
241
261
  */
242
- get_completions(uri: string, offset: number): any;
262
+ get_completions(uri: string, offset: number): ICompletionList;
243
263
  /**
244
264
  * @param {string} uri
245
265
  * @param {number} offset
246
- * @returns {any}
266
+ * @returns {IDefinition | undefined}
247
267
  */
248
- get_definition(uri: string, offset: number): any;
268
+ get_definition(uri: string, offset: number): IDefinition | undefined;
249
269
  /**
250
270
  * @param {string} uri
251
271
  * @param {number} offset
252
- * @returns {any}
253
- */
254
- get_hover(uri: string, offset: number): any;
255
- }
256
- /**
272
+ * @returns {IHover | undefined}
257
273
  */
258
- export class StructStepResult {
259
- free(): void;
260
- /**
261
- */
262
- id: number;
274
+ get_hover(uri: string, offset: number): IHover | undefined;
263
275
  /**
276
+ * @param {string} uri
277
+ * @param {number} offset
278
+ * @returns {ISignatureHelp | undefined}
264
279
  */
265
- value: number;
280
+ get_signature_help(uri: string, offset: number): ISignatureHelp | undefined;
266
281
  }
Binary file