@astral-sh/ruff-wasm-web 0.15.17 → 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.17",
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,11 @@
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[];
27
9
  subDiagnostics: SubDiagnostic[];
28
10
  start_location: {
29
11
  row: number;
@@ -49,10 +31,18 @@ export interface Diagnostic {
49
31
  } | null;
50
32
  }
51
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
+
52
42
  export interface SubDiagnostic {
53
43
  severity: SubDiagnosticSeverity;
54
44
  message: string;
55
- location: SubDiagnosticLocation | null;
45
+ location: DiagnosticLocation | null;
56
46
  }
57
47
 
58
48
  export enum SubDiagnosticSeverity {
@@ -63,7 +53,7 @@ export enum SubDiagnosticSeverity {
63
53
  Fatal = "fatal",
64
54
  }
65
55
 
66
- export interface SubDiagnosticLocation {
56
+ export interface DiagnosticLocation {
67
57
  path: string;
68
58
  start_location: {
69
59
  row: number;
@@ -76,66 +66,92 @@ export interface SubDiagnosticLocation {
76
66
  }
77
67
 
78
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
+ }
83
+
79
84
  export class Workspace {
80
- free(): void;
81
- [Symbol.dispose](): void;
82
- static defaultSettings(): any;
83
- constructor(options: any, position_encoding: PositionEncoding);
84
- check(contents: string): any;
85
- /**
86
- * Parses the content and returns its AST
87
- */
88
- parse(contents: string): string;
89
- format(contents: string): string;
90
- tokens(contents: string): string;
91
- static version(): string;
92
- comments(contents: string): string;
93
- 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;
94
99
  }
95
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
+
96
111
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
97
112
 
98
113
  export interface InitOutput {
99
- readonly memory: WebAssembly.Memory;
100
- readonly __wbg_workspace_free: (a: number, b: number) => void;
101
- readonly initLogging: (a: number) => void;
102
- readonly workspace_check: (a: number, b: number, c: number) => [number, number, number];
103
- readonly workspace_comments: (a: number, b: number, c: number) => [number, number, number, number];
104
- readonly workspace_defaultSettings: () => [number, number, number];
105
- readonly workspace_format: (a: number, b: number, c: number) => [number, number, number, number];
106
- readonly workspace_format_ir: (a: number, b: number, c: number) => [number, number, number, number];
107
- readonly workspace_new: (a: any, b: number) => [number, number, number];
108
- readonly workspace_parse: (a: number, b: number, c: number) => [number, number, number, number];
109
- readonly workspace_tokens: (a: number, b: number, c: number) => [number, number, number, number];
110
- readonly workspace_version: () => [number, number];
111
- readonly run: () => void;
112
- readonly __wbindgen_malloc: (a: number, b: number) => number;
113
- readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
114
- readonly __wbindgen_exn_store: (a: number) => void;
115
- readonly __externref_table_alloc: () => number;
116
- readonly __wbindgen_externrefs: WebAssembly.Table;
117
- readonly __wbindgen_free: (a: number, b: number, c: number) => void;
118
- readonly __externref_table_dealloc: (a: number) => void;
119
- 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;
120
135
  }
121
136
 
122
137
  export type SyncInitInput = BufferSource | WebAssembly.Module;
138
+
123
139
  /**
124
- * Instantiates the given `module`, which can either be bytes or
125
- * a precompiled `WebAssembly.Module`.
126
- *
127
- * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
128
- *
129
- * @returns {InitOutput}
130
- */
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
+ */
131
147
  export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
132
148
 
133
149
  /**
134
- * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
135
- * for everything else, calls `WebAssembly.instantiate` directly.
136
- *
137
- * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
138
- *
139
- * @returns {Promise<InitOutput>}
140
- */
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
+ */
141
157
  export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;