@teamkeel/wasm 0.46.0 → 0.47.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.
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ declare module '@teamkeel/wasm/build' {
4
4
  }
5
5
  declare module '@teamkeel/wasm/index' {
6
6
  import { KeelAPI } from '@teamkeel/wasm/typings';
7
- const keel: () => Promise<KeelAPI>;
7
+ const keel: () => KeelAPI;
8
8
  export default keel;
9
9
 
10
10
  }
@@ -26,22 +26,34 @@ declare module '@teamkeel/wasm/typings' {
26
26
  importObject: any;
27
27
  }
28
28
  export interface KeelAPI {
29
- format: (schemaString: string) => string;
30
- validate: (schemaString: string, options?: ValidateOptions) => ValidationResult;
29
+ format: (schemaString: string) => Promise<string>;
30
+ validate: (schemaString: string, options: ValidateOptions) => Promise<ValidationResult>;
31
+ completions: (schemaString: string, position: SimplePosition) => Promise<CompletionResult>;
31
32
  }
32
33
  export interface ValidateOptions {
33
34
  color: boolean;
34
35
  }
35
- export interface Pos {
36
+ export interface SimplePosition {
36
37
  column: number;
37
- filename: string;
38
38
  line: number;
39
+ }
40
+ export interface Position extends SimplePosition {
41
+ filename: string;
39
42
  offset: number;
40
43
  }
44
+ export interface CompletionItem {
45
+ description: string;
46
+ label: string;
47
+ node: Node;
48
+ }
49
+ export interface CompletionResult {
50
+ completions: CompletionItem[];
51
+ ast: any;
52
+ }
41
53
  export interface ValidationError {
42
54
  code: string;
43
- pos: Pos;
44
- endPos: Pos;
55
+ pos: Position;
56
+ endPos: Position;
45
57
  hint: string;
46
58
  shortMessage: string;
47
59
  message: string;