qsharp-lang 1.0.27-dev → 1.0.29-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.
@@ -14,16 +14,16 @@ export function setLogLevel(level: number): void;
14
14
  */
15
15
  export function git_hash(): string;
16
16
  /**
17
- * @param {string} code
17
+ * @param {(Array<any>)[]} sources
18
18
  * @returns {string}
19
19
  */
20
- export function get_qir(code: string): string;
20
+ export function get_qir(sources: (Array<any>)[]): string;
21
21
  /**
22
- * @param {string} code
22
+ * @param {(Array<any>)[]} sources
23
23
  * @param {string} params
24
24
  * @returns {string}
25
25
  */
26
- export function get_estimates(code: string, params: string): string;
26
+ export function get_estimates(sources: (Array<any>)[], params: string): string;
27
27
  /**
28
28
  * @param {string} name
29
29
  * @returns {string | undefined}
@@ -35,13 +35,13 @@ export function get_library_source_content(name: string): string | undefined;
35
35
  */
36
36
  export function get_hir(code: string): string;
37
37
  /**
38
- * @param {string} code
38
+ * @param {(Array<any>)[]} sources
39
39
  * @param {string} expr
40
40
  * @param {Function} event_cb
41
41
  * @param {number} shots
42
42
  * @returns {boolean}
43
43
  */
44
- export function run(code: string, expr: string, event_cb: Function, shots: number): boolean;
44
+ export function run(sources: (Array<any>)[], expr: string, event_cb: Function, shots: number): boolean;
45
45
  /**
46
46
  * @param {string} solution_code
47
47
  * @param {any} exercise_sources_js
@@ -173,13 +173,13 @@ export interface ISignatureHelp {
173
173
 
174
174
  export interface ISignatureInformation {
175
175
  label: string;
176
- documentation?: string;
176
+ documentation: string;
177
177
  parameters: IParameterInformation[];
178
178
  }
179
179
 
180
180
  export interface IParameterInformation {
181
181
  label: ISpan;
182
- documentation?: string;
182
+ documentation: string;
183
183
  }
184
184
 
185
185
  export interface IWorkspaceEdit {
@@ -213,13 +213,12 @@ export class DebugService {
213
213
  */
214
214
  constructor();
215
215
  /**
216
- * @param {string} path
217
- * @param {string} source
216
+ * @param {(Array<any>)[]} sources
218
217
  * @param {string} target_profile
219
218
  * @param {string | undefined} entry
220
219
  * @returns {string}
221
220
  */
222
- load_source(path: string, source: string, target_profile: string, entry?: string): string;
221
+ load_source(sources: (Array<any>)[], target_profile: string, entry?: string): string;
223
222
  /**
224
223
  * @returns {IQuantumStateList}
225
224
  */
@@ -267,9 +266,19 @@ export class DebugService {
267
266
  export class LanguageService {
268
267
  free(): void;
269
268
  /**
269
+ */
270
+ constructor();
271
+ /**
270
272
  * @param {(uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void} diagnostics_callback
273
+ * @param {(uri: string) => Promise<string | null>} read_file
274
+ * @param {(uri: string) => Promise<[string, number][]>} list_directory
275
+ * @param {(uri: string) => Promise<{ manifestDirectory: string }| null>} get_manifest
276
+ * @returns {Promise<any>}
277
+ */
278
+ start_background_work(diagnostics_callback: (uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void, read_file: (uri: string) => Promise<string | null>, list_directory: (uri: string) => Promise<[string, number][]>, get_manifest: (uri: string) => Promise<{ manifestDirectory: string }| null>): Promise<any>;
279
+ /**
271
280
  */
272
- constructor(diagnostics_callback: (uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void);
281
+ stop_background_work(): void;
273
282
  /**
274
283
  * @param {IWorkspaceConfiguration} config
275
284
  */
@@ -340,3 +349,21 @@ export class LanguageService {
340
349
  */
341
350
  prepare_rename(uri: string, offset: number): ITextEdit | undefined;
342
351
  }
352
+ /**
353
+ * a minimal implementation for interacting with async JS filesystem callbacks to
354
+ * load project files
355
+ */
356
+ export class ProjectLoader {
357
+ free(): void;
358
+ /**
359
+ * @param {(uri: string) => Promise<string | null>} read_file
360
+ * @param {(uri: string) => Promise<[string, number][]>} list_directory
361
+ * @param {(uri: string) => Promise<{ manifestDirectory: string }| null>} get_manifest
362
+ */
363
+ constructor(read_file: (uri: string) => Promise<string | null>, list_directory: (uri: string) => Promise<[string, number][]>, get_manifest: (uri: string) => Promise<{ manifestDirectory: string }| null>);
364
+ /**
365
+ * @param {{ manifestDirectory: string }} manifest
366
+ * @returns {Promise<[string, string][]>}
367
+ */
368
+ load_project(manifest: { manifestDirectory: string }): Promise<[string, string][]>;
369
+ }
Binary file
@@ -14,16 +14,16 @@ export function setLogLevel(level: number): void;
14
14
  */
15
15
  export function git_hash(): string;
16
16
  /**
17
- * @param {string} code
17
+ * @param {(Array<any>)[]} sources
18
18
  * @returns {string}
19
19
  */
20
- export function get_qir(code: string): string;
20
+ export function get_qir(sources: (Array<any>)[]): string;
21
21
  /**
22
- * @param {string} code
22
+ * @param {(Array<any>)[]} sources
23
23
  * @param {string} params
24
24
  * @returns {string}
25
25
  */
26
- export function get_estimates(code: string, params: string): string;
26
+ export function get_estimates(sources: (Array<any>)[], params: string): string;
27
27
  /**
28
28
  * @param {string} name
29
29
  * @returns {string | undefined}
@@ -35,13 +35,13 @@ export function get_library_source_content(name: string): string | undefined;
35
35
  */
36
36
  export function get_hir(code: string): string;
37
37
  /**
38
- * @param {string} code
38
+ * @param {(Array<any>)[]} sources
39
39
  * @param {string} expr
40
40
  * @param {Function} event_cb
41
41
  * @param {number} shots
42
42
  * @returns {boolean}
43
43
  */
44
- export function run(code: string, expr: string, event_cb: Function, shots: number): boolean;
44
+ export function run(sources: (Array<any>)[], expr: string, event_cb: Function, shots: number): boolean;
45
45
  /**
46
46
  * @param {string} solution_code
47
47
  * @param {any} exercise_sources_js
@@ -173,13 +173,13 @@ export interface ISignatureHelp {
173
173
 
174
174
  export interface ISignatureInformation {
175
175
  label: string;
176
- documentation?: string;
176
+ documentation: string;
177
177
  parameters: IParameterInformation[];
178
178
  }
179
179
 
180
180
  export interface IParameterInformation {
181
181
  label: ISpan;
182
- documentation?: string;
182
+ documentation: string;
183
183
  }
184
184
 
185
185
  export interface IWorkspaceEdit {
@@ -213,13 +213,12 @@ export class DebugService {
213
213
  */
214
214
  constructor();
215
215
  /**
216
- * @param {string} path
217
- * @param {string} source
216
+ * @param {(Array<any>)[]} sources
218
217
  * @param {string} target_profile
219
218
  * @param {string | undefined} entry
220
219
  * @returns {string}
221
220
  */
222
- load_source(path: string, source: string, target_profile: string, entry?: string): string;
221
+ load_source(sources: (Array<any>)[], target_profile: string, entry?: string): string;
223
222
  /**
224
223
  * @returns {IQuantumStateList}
225
224
  */
@@ -267,9 +266,19 @@ export class DebugService {
267
266
  export class LanguageService {
268
267
  free(): void;
269
268
  /**
269
+ */
270
+ constructor();
271
+ /**
270
272
  * @param {(uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void} diagnostics_callback
273
+ * @param {(uri: string) => Promise<string | null>} read_file
274
+ * @param {(uri: string) => Promise<[string, number][]>} list_directory
275
+ * @param {(uri: string) => Promise<{ manifestDirectory: string }| null>} get_manifest
276
+ * @returns {Promise<any>}
277
+ */
278
+ start_background_work(diagnostics_callback: (uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void, read_file: (uri: string) => Promise<string | null>, list_directory: (uri: string) => Promise<[string, number][]>, get_manifest: (uri: string) => Promise<{ manifestDirectory: string }| null>): Promise<any>;
279
+ /**
271
280
  */
272
- constructor(diagnostics_callback: (uri: string, version: number | undefined, diagnostics: VSDiagnostic[]) => void);
281
+ stop_background_work(): void;
273
282
  /**
274
283
  * @param {IWorkspaceConfiguration} config
275
284
  */
@@ -340,6 +349,24 @@ export class LanguageService {
340
349
  */
341
350
  prepare_rename(uri: string, offset: number): ITextEdit | undefined;
342
351
  }
352
+ /**
353
+ * a minimal implementation for interacting with async JS filesystem callbacks to
354
+ * load project files
355
+ */
356
+ export class ProjectLoader {
357
+ free(): void;
358
+ /**
359
+ * @param {(uri: string) => Promise<string | null>} read_file
360
+ * @param {(uri: string) => Promise<[string, number][]>} list_directory
361
+ * @param {(uri: string) => Promise<{ manifestDirectory: string }| null>} get_manifest
362
+ */
363
+ constructor(read_file: (uri: string) => Promise<string | null>, list_directory: (uri: string) => Promise<[string, number][]>, get_manifest: (uri: string) => Promise<{ manifestDirectory: string }| null>);
364
+ /**
365
+ * @param {{ manifestDirectory: string }} manifest
366
+ * @returns {Promise<[string, string][]>}
367
+ */
368
+ load_project(manifest: { manifestDirectory: string }): Promise<[string, string][]>;
369
+ }
343
370
 
344
371
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
345
372
 
@@ -347,7 +374,7 @@ export interface InitOutput {
347
374
  readonly memory: WebAssembly.Memory;
348
375
  readonly __wbg_debugservice_free: (a: number) => void;
349
376
  readonly debugservice_new: () => number;
350
- readonly debugservice_load_source: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
377
+ readonly debugservice_load_source: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
351
378
  readonly debugservice_capture_quantum_state: (a: number) => number;
352
379
  readonly debugservice_get_stack_frames: (a: number) => number;
353
380
  readonly debugservice_eval_next: (a: number, b: number, c: number, d: number, e: number) => void;
@@ -357,7 +384,9 @@ export interface InitOutput {
357
384
  readonly debugservice_get_breakpoints: (a: number, b: number, c: number) => number;
358
385
  readonly debugservice_get_locals: (a: number) => number;
359
386
  readonly __wbg_languageservice_free: (a: number) => void;
360
- readonly languageservice_new: (a: number) => number;
387
+ readonly languageservice_new: () => number;
388
+ readonly languageservice_start_background_work: (a: number, b: number, c: number, d: number, e: number) => number;
389
+ readonly languageservice_stop_background_work: (a: number) => void;
361
390
  readonly languageservice_update_configuration: (a: number, b: number) => void;
362
391
  readonly languageservice_update_document: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
363
392
  readonly languageservice_close_document: (a: number, b: number, c: number) => void;
@@ -372,6 +401,9 @@ export interface InitOutput {
372
401
  readonly languageservice_prepare_rename: (a: number, b: number, c: number, d: number) => number;
373
402
  readonly initLogging: (a: number, b: number, c: number) => void;
374
403
  readonly setLogLevel: (a: number) => void;
404
+ readonly __wbg_projectloader_free: (a: number) => void;
405
+ readonly projectloader_new: (a: number, b: number, c: number) => number;
406
+ readonly projectloader_load_project: (a: number, b: number) => number;
375
407
  readonly git_hash: (a: number) => void;
376
408
  readonly get_qir: (a: number, b: number, c: number) => void;
377
409
  readonly get_estimates: (a: number, b: number, c: number, d: number, e: number) => void;
@@ -381,9 +413,12 @@ export interface InitOutput {
381
413
  readonly check_exercise_solution: (a: number, b: number, c: number, d: number) => number;
382
414
  readonly __wbindgen_export_0: (a: number, b: number) => number;
383
415
  readonly __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
416
+ readonly __wbindgen_export_2: WebAssembly.Table;
417
+ readonly __wbindgen_export_3: (a: number, b: number, c: number) => void;
384
418
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
385
- readonly __wbindgen_export_2: (a: number, b: number, c: number) => void;
386
- readonly __wbindgen_export_3: (a: number) => void;
419
+ readonly __wbindgen_export_4: (a: number, b: number, c: number) => void;
420
+ readonly __wbindgen_export_5: (a: number) => void;
421
+ readonly __wbindgen_export_6: (a: number, b: number, c: number, d: number) => void;
387
422
  }
388
423
 
389
424
  export type SyncInitInput = BufferSource | WebAssembly.Module;