@astral-sh/ruff-wasm-web 0.15.16 → 0.15.18

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Charlie Marsh <charlie.r.marsh@gmail.com>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for Ruff",
8
- "version": "0.15.16",
8
+ "version": "0.15.18",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/ruff_wasm.d.ts CHANGED
@@ -1,29 +1,12 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Initializes the logger with the given log level.
5
- *
6
- * ## Panics
7
- * If this function is called more than once.
8
- */
9
- export function initLogging(level: LogLevel): void;
10
- export function run(): void;
11
- export enum LogLevel {
12
- Trace = 0,
13
- Debug = 1,
14
- Info = 2,
15
- Warn = 3,
16
- Error = 4,
17
- }
18
- export enum PositionEncoding {
19
- Utf8 = 0,
20
- Utf16 = 1,
21
- Utf32 = 2,
22
- }
23
3
 
24
4
  export interface Diagnostic {
25
5
  code: string | null;
26
6
  message: string;
7
+ tags: DiagnosticTag[];
8
+ annotations: DiagnosticAnnotation[];
9
+ subDiagnostics: SubDiagnostic[];
27
10
  start_location: {
28
11
  row: number;
29
12
  column: number;
@@ -48,67 +31,127 @@ export interface Diagnostic {
48
31
  } | null;
49
32
  }
50
33
 
34
+ export type DiagnosticTag = "unnecessary" | "deprecated";
35
+
36
+ export interface DiagnosticAnnotation {
37
+ primary: boolean;
38
+ message: string | null;
39
+ location: DiagnosticLocation | null;
40
+ }
41
+
42
+ export interface SubDiagnostic {
43
+ severity: SubDiagnosticSeverity;
44
+ message: string;
45
+ location: DiagnosticLocation | null;
46
+ }
47
+
48
+ export enum SubDiagnosticSeverity {
49
+ Help = "help",
50
+ Info = "info",
51
+ Warning = "warning",
52
+ Error = "error",
53
+ Fatal = "fatal",
54
+ }
55
+
56
+ export interface DiagnosticLocation {
57
+ path: string;
58
+ start_location: {
59
+ row: number;
60
+ column: number;
61
+ };
62
+ end_location: {
63
+ row: number;
64
+ column: number;
65
+ };
66
+ }
67
+
68
+
69
+
70
+ export enum LogLevel {
71
+ Trace = 0,
72
+ Debug = 1,
73
+ Info = 2,
74
+ Warn = 3,
75
+ Error = 4,
76
+ }
77
+
78
+ export enum PositionEncoding {
79
+ Utf8 = 0,
80
+ Utf16 = 1,
81
+ Utf32 = 2,
82
+ }
51
83
 
52
84
  export class Workspace {
53
- free(): void;
54
- [Symbol.dispose](): void;
55
- static defaultSettings(): any;
56
- constructor(options: any, position_encoding: PositionEncoding);
57
- check(contents: string): any;
58
- /**
59
- * Parses the content and returns its AST
60
- */
61
- parse(contents: string): string;
62
- format(contents: string): string;
63
- tokens(contents: string): string;
64
- static version(): string;
65
- comments(contents: string): string;
66
- format_ir(contents: string): string;
85
+ free(): void;
86
+ [Symbol.dispose](): void;
87
+ check(contents: string): any;
88
+ comments(contents: string): string;
89
+ static defaultSettings(): any;
90
+ format(contents: string): string;
91
+ format_ir(contents: string): string;
92
+ constructor(options: any, position_encoding: PositionEncoding);
93
+ /**
94
+ * Parses the content and returns its AST
95
+ */
96
+ parse(contents: string): string;
97
+ tokens(contents: string): string;
98
+ static version(): string;
67
99
  }
68
100
 
101
+ /**
102
+ * Initializes the logger with the given log level.
103
+ *
104
+ * ## Panics
105
+ * If this function is called more than once.
106
+ */
107
+ export function initLogging(level: LogLevel): void;
108
+
109
+ export function run(): void;
110
+
69
111
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
70
112
 
71
113
  export interface InitOutput {
72
- readonly memory: WebAssembly.Memory;
73
- readonly __wbg_workspace_free: (a: number, b: number) => void;
74
- readonly initLogging: (a: number) => void;
75
- readonly workspace_check: (a: number, b: number, c: number) => [number, number, number];
76
- readonly workspace_comments: (a: number, b: number, c: number) => [number, number, number, number];
77
- readonly workspace_defaultSettings: () => [number, number, number];
78
- readonly workspace_format: (a: number, b: number, c: number) => [number, number, number, number];
79
- readonly workspace_format_ir: (a: number, b: number, c: number) => [number, number, number, number];
80
- readonly workspace_new: (a: any, b: number) => [number, number, number];
81
- readonly workspace_parse: (a: number, b: number, c: number) => [number, number, number, number];
82
- readonly workspace_tokens: (a: number, b: number, c: number) => [number, number, number, number];
83
- readonly workspace_version: () => [number, number];
84
- readonly run: () => void;
85
- readonly __wbindgen_malloc: (a: number, b: number) => number;
86
- readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
87
- readonly __wbindgen_exn_store: (a: number) => void;
88
- readonly __externref_table_alloc: () => number;
89
- readonly __wbindgen_externrefs: WebAssembly.Table;
90
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
91
- readonly __externref_table_dealloc: (a: number) => void;
92
- readonly __wbindgen_start: () => void;
114
+ readonly memory: WebAssembly.Memory;
115
+ readonly __wbg_workspace_free: (a: number, b: number) => void;
116
+ readonly initLogging: (a: number) => void;
117
+ readonly workspace_check: (a: number, b: number, c: number) => [number, number, number];
118
+ readonly workspace_comments: (a: number, b: number, c: number) => [number, number, number, number];
119
+ readonly workspace_defaultSettings: () => [number, number, number];
120
+ readonly workspace_format: (a: number, b: number, c: number) => [number, number, number, number];
121
+ readonly workspace_format_ir: (a: number, b: number, c: number) => [number, number, number, number];
122
+ readonly workspace_new: (a: any, b: number) => [number, number, number];
123
+ readonly workspace_parse: (a: number, b: number, c: number) => [number, number, number, number];
124
+ readonly workspace_tokens: (a: number, b: number, c: number) => [number, number, number, number];
125
+ readonly workspace_version: () => [number, number];
126
+ readonly run: () => void;
127
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
128
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
129
+ readonly __wbindgen_exn_store: (a: number) => void;
130
+ readonly __externref_table_alloc: () => number;
131
+ readonly __wbindgen_externrefs: WebAssembly.Table;
132
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
133
+ readonly __externref_table_dealloc: (a: number) => void;
134
+ readonly __wbindgen_start: () => void;
93
135
  }
94
136
 
95
137
  export type SyncInitInput = BufferSource | WebAssembly.Module;
138
+
96
139
  /**
97
- * Instantiates the given `module`, which can either be bytes or
98
- * a precompiled `WebAssembly.Module`.
99
- *
100
- * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
101
- *
102
- * @returns {InitOutput}
103
- */
140
+ * Instantiates the given `module`, which can either be bytes or
141
+ * a precompiled `WebAssembly.Module`.
142
+ *
143
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
144
+ *
145
+ * @returns {InitOutput}
146
+ */
104
147
  export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
105
148
 
106
149
  /**
107
- * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
108
- * for everything else, calls `WebAssembly.instantiate` directly.
109
- *
110
- * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
111
- *
112
- * @returns {Promise<InitOutput>}
113
- */
150
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
151
+ * for everything else, calls `WebAssembly.instantiate` directly.
152
+ *
153
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
154
+ *
155
+ * @returns {Promise<InitOutput>}
156
+ */
114
157
  export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;