@biomejs/wasm-nodejs 0.1.0-nightly.7b90623

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/rome_wasm.d.ts ADDED
@@ -0,0 +1,1529 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ */
5
+ export function main(): void;
6
+ interface SupportsFeatureParams {
7
+ feature: FeatureName[];
8
+ path: RomePath;
9
+ }
10
+ type FeatureName = "Format" | "Lint" | "OrganizeImports";
11
+ interface RomePath {
12
+ path: string;
13
+ }
14
+ interface SupportsFeatureResult {
15
+ reason?: SupportKind;
16
+ }
17
+ type SupportKind =
18
+ | "Supported"
19
+ | "Ignored"
20
+ | "FeatureNotEnabled"
21
+ | "FileNotSupported";
22
+ interface UpdateSettingsParams {
23
+ configuration: Configuration;
24
+ }
25
+ interface Configuration {
26
+ /**
27
+ * A field for the [JSON schema](https://json-schema.org/) specification
28
+ */
29
+ $schema?: string;
30
+ /**
31
+ * A list of paths to other JSON files, used to extends the current configuration.
32
+ */
33
+ extends?: StringSet;
34
+ /**
35
+ * The configuration of the filesystem
36
+ */
37
+ files?: FilesConfiguration;
38
+ /**
39
+ * The configuration of the formatter
40
+ */
41
+ formatter?: FormatterConfiguration;
42
+ /**
43
+ * Specific configuration for the JavaScript language
44
+ */
45
+ javascript?: JavascriptConfiguration;
46
+ /**
47
+ * Specific configuration for the Json language
48
+ */
49
+ json?: JsonConfiguration;
50
+ /**
51
+ * The configuration for the linter
52
+ */
53
+ linter?: LinterConfiguration;
54
+ /**
55
+ * The configuration of the import sorting
56
+ */
57
+ organizeImports?: OrganizeImports;
58
+ /**
59
+ * The configuration of the VCS integration
60
+ */
61
+ vcs?: VcsConfiguration;
62
+ }
63
+ type StringSet = string[];
64
+ interface FilesConfiguration {
65
+ /**
66
+ * A list of Unix shell style patterns. Biome tools will ignore files/folders that will match these patterns.
67
+ */
68
+ ignore?: StringSet;
69
+ /**
70
+ * Tells Biome to not emit diagnostics when handling files that doesn't know
71
+ */
72
+ ignoreUnknown?: boolean;
73
+ /**
74
+ * The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reason. Defaults to 1 MiB
75
+ */
76
+ maxSize?: number;
77
+ }
78
+ interface FormatterConfiguration {
79
+ enabled?: boolean;
80
+ /**
81
+ * Stores whether formatting should be allowed to proceed if a given file has syntax errors
82
+ */
83
+ formatWithErrors?: boolean;
84
+ /**
85
+ * A list of Unix shell style patterns. The formatter will ignore files/folders that will match these patterns.
86
+ */
87
+ ignore?: StringSet;
88
+ /**
89
+ * The size of the indentation, 2 by default
90
+ */
91
+ indentSize?: number;
92
+ /**
93
+ * The indent style.
94
+ */
95
+ indentStyle?: PlainIndentStyle;
96
+ /**
97
+ * What's the max width of a line. Defaults to 80.
98
+ */
99
+ lineWidth?: LineWidth;
100
+ }
101
+ interface JavascriptConfiguration {
102
+ /**
103
+ * Formatting options
104
+ */
105
+ formatter?: JavascriptFormatter;
106
+ /**
107
+ * A list of global bindings that should be ignored by the analyzers
108
+
109
+ If defined here, they should not emit diagnostics.
110
+ */
111
+ globals?: StringSet;
112
+ organize_imports?: JavascriptOrganizeImports;
113
+ /**
114
+ * Parsing options
115
+ */
116
+ parser?: JavascriptParser;
117
+ }
118
+ interface JsonConfiguration {
119
+ /**
120
+ * Parsing options
121
+ */
122
+ parser?: JsonParser;
123
+ }
124
+ interface LinterConfiguration {
125
+ /**
126
+ * if `false`, it disables the feature and the linter won't be executed. `true` by default
127
+ */
128
+ enabled?: boolean;
129
+ /**
130
+ * A list of Unix shell style patterns. The formatter will ignore files/folders that will match these patterns.
131
+ */
132
+ ignore?: StringSet;
133
+ /**
134
+ * List of rules
135
+ */
136
+ rules?: Rules;
137
+ }
138
+ interface OrganizeImports {
139
+ /**
140
+ * Enables the organization of imports
141
+ */
142
+ enabled?: boolean;
143
+ /**
144
+ * A list of Unix shell style patterns. The formatter will ignore files/folders that will match these patterns.
145
+ */
146
+ ignore?: StringSet;
147
+ }
148
+ interface VcsConfiguration {
149
+ /**
150
+ * The kind of client.
151
+ */
152
+ clientKind?: VcsClientKind;
153
+ /**
154
+ * Whether Biome should integrate itself with the VCS client
155
+ */
156
+ enabled?: boolean;
157
+ /**
158
+ * The folder where Biome should check for VCS files. By default, Biome will use the same folder where `rome.json` was found.
159
+
160
+ If Biome can't find the configuration, it will attempt to use the current working directory. If no current working directory can't be found, Biome won't use the VCS integration, and a diagnostic will be emitted
161
+ */
162
+ root?: string;
163
+ /**
164
+ * Whether Biome should use the VCS ignore file. When [true], Biome will ignore the files specified in the ignore file.
165
+ */
166
+ useIgnoreFile?: boolean;
167
+ }
168
+ type PlainIndentStyle = "tab" | "space";
169
+ type LineWidth = number;
170
+ interface JavascriptFormatter {
171
+ /**
172
+ * Whether to add non-necessary parentheses to arrow functions. Defaults to "always".
173
+ */
174
+ arrowParentheses?: ArrowParentheses;
175
+ /**
176
+ * The type of quotes used in JSX. Defaults to double.
177
+ */
178
+ jsxQuoteStyle?: QuoteStyle;
179
+ /**
180
+ * When properties in objects are quoted. Defaults to asNeeded.
181
+ */
182
+ quoteProperties?: QuoteProperties;
183
+ /**
184
+ * The type of quotes used in JavaScript code. Defaults to double.
185
+ */
186
+ quoteStyle?: QuoteStyle;
187
+ /**
188
+ * Whether the formatter prints semicolons for all statements or only in for statements where it is necessary because of ASI.
189
+ */
190
+ semicolons?: Semicolons;
191
+ /**
192
+ * Print trailing commas wherever possible in multi-line comma-separated syntactic structures. Defaults to "all".
193
+ */
194
+ trailingComma?: TrailingComma;
195
+ }
196
+ interface JavascriptOrganizeImports {}
197
+ interface JavascriptParser {
198
+ /**
199
+ * It enables the experimental and unsafe parsing of parameter decorators
200
+
201
+ These decorators belong to an old proposal, and they are subject to change.
202
+ */
203
+ unsafeParameterDecoratorsEnabled?: boolean;
204
+ }
205
+ interface JsonParser {
206
+ /**
207
+ * Allow parsing comments in `.json` files
208
+ */
209
+ allowComments?: boolean;
210
+ }
211
+ interface Rules {
212
+ a11y?: A11y;
213
+ /**
214
+ * It enables ALL rules. The rules that belong to `nursery` won't be enabled.
215
+ */
216
+ all?: boolean;
217
+ complexity?: Complexity;
218
+ correctness?: Correctness;
219
+ nursery?: Nursery;
220
+ performance?: Performance;
221
+ /**
222
+ * It enables the lint rules recommended by Biome. `true` by default.
223
+ */
224
+ recommended?: boolean;
225
+ security?: Security;
226
+ style?: Style;
227
+ suspicious?: Suspicious;
228
+ }
229
+ type VcsClientKind = "git";
230
+ type ArrowParentheses = "always" | "asNeeded";
231
+ type QuoteStyle = "double" | "single";
232
+ type QuoteProperties = "asNeeded" | "preserve";
233
+ type Semicolons = "always" | "asNeeded";
234
+ type TrailingComma = "all" | "es5" | "none";
235
+ interface A11y {
236
+ /**
237
+ * It enables ALL rules for this group.
238
+ */
239
+ all?: boolean;
240
+ /**
241
+ * Enforce that the accessKey attribute is not used on any HTML element.
242
+ */
243
+ noAccessKey?: RuleConfiguration;
244
+ /**
245
+ * Enforce that autoFocus prop is not used on elements.
246
+ */
247
+ noAutofocus?: RuleConfiguration;
248
+ /**
249
+ * Disallow target="_blank" attribute without rel="noreferrer"
250
+ */
251
+ noBlankTarget?: RuleConfiguration;
252
+ /**
253
+ * Enforces that no distracting elements are used.
254
+ */
255
+ noDistractingElements?: RuleConfiguration;
256
+ /**
257
+ * The scope prop should be used only on <th> elements.
258
+ */
259
+ noHeaderScope?: RuleConfiguration;
260
+ /**
261
+ * Enforce that interactive ARIA roles are not assigned to non-interactive HTML elements.
262
+ */
263
+ noNoninteractiveElementToInteractiveRole?: RuleConfiguration;
264
+ /**
265
+ * Prevent the usage of positive integers on tabIndex property
266
+ */
267
+ noPositiveTabindex?: RuleConfiguration;
268
+ /**
269
+ * Enforce img alt prop does not contain the word "image", "picture", or "photo".
270
+ */
271
+ noRedundantAlt?: RuleConfiguration;
272
+ /**
273
+ * Enforces the usage of the title element for the svg element.
274
+ */
275
+ noSvgWithoutTitle?: RuleConfiguration;
276
+ /**
277
+ * It enables the recommended rules for this group
278
+ */
279
+ recommended?: boolean;
280
+ /**
281
+ * Enforce that all elements that require alternative text have meaningful information to relay back to the end user.
282
+ */
283
+ useAltText?: RuleConfiguration;
284
+ /**
285
+ * Enforce that anchors have content and that the content is accessible to screen readers.
286
+ */
287
+ useAnchorContent?: RuleConfiguration;
288
+ /**
289
+ * Enforce that elements with ARIA roles must have all required ARIA attributes for that role.
290
+ */
291
+ useAriaPropsForRole?: RuleConfiguration;
292
+ /**
293
+ * Enforces the usage of the attribute type for the element button
294
+ */
295
+ useButtonType?: RuleConfiguration;
296
+ /**
297
+ * Enforce that heading elements (h1, h2, etc.) have content and that the content is accessible to screen readers. Accessible means that it is not hidden using the aria-hidden prop.
298
+ */
299
+ useHeadingContent?: RuleConfiguration;
300
+ /**
301
+ * Enforce that html element has lang attribute.
302
+ */
303
+ useHtmlLang?: RuleConfiguration;
304
+ /**
305
+ * Enforces the usage of the attribute title for the element iframe.
306
+ */
307
+ useIframeTitle?: RuleConfiguration;
308
+ /**
309
+ * Enforce onClick is accompanied by at least one of the following: onKeyUp, onKeyDown, onKeyPress.
310
+ */
311
+ useKeyWithClickEvents?: RuleConfiguration;
312
+ /**
313
+ * Enforce onMouseOver / onMouseOut are accompanied by onFocus / onBlur.
314
+ */
315
+ useKeyWithMouseEvents?: RuleConfiguration;
316
+ /**
317
+ * Enforces that audio and video elements must have a track for captions.
318
+ */
319
+ useMediaCaption?: RuleConfiguration;
320
+ /**
321
+ * Enforce that all anchors are valid, and they are navigable elements.
322
+ */
323
+ useValidAnchor?: RuleConfiguration;
324
+ /**
325
+ * Ensures that ARIA properties aria-* are all valid.
326
+ */
327
+ useValidAriaProps?: RuleConfiguration;
328
+ /**
329
+ * Ensure that the attribute passed to the lang attribute is a correct ISO language and/or country.
330
+ */
331
+ useValidLang?: RuleConfiguration;
332
+ }
333
+ interface Complexity {
334
+ /**
335
+ * It enables ALL rules for this group.
336
+ */
337
+ all?: boolean;
338
+ /**
339
+ * Disallow unnecessary boolean casts
340
+ */
341
+ noExtraBooleanCast?: RuleConfiguration;
342
+ /**
343
+ * Prefer for...of statement instead of Array.forEach.
344
+ */
345
+ noForEach?: RuleConfiguration;
346
+ /**
347
+ * Disallow unclear usage of multiple space characters in regular expression literals
348
+ */
349
+ noMultipleSpacesInRegularExpressionLiterals?: RuleConfiguration;
350
+ /**
351
+ * Disallow unnecessary catch clauses.
352
+ */
353
+ noUselessCatch?: RuleConfiguration;
354
+ /**
355
+ * Disallow unnecessary constructors.
356
+ */
357
+ noUselessConstructor?: RuleConfiguration;
358
+ /**
359
+ * Disallow unnecessary fragments
360
+ */
361
+ noUselessFragments?: RuleConfiguration;
362
+ /**
363
+ * Disallow unnecessary labels.
364
+ */
365
+ noUselessLabel?: RuleConfiguration;
366
+ /**
367
+ * Disallow renaming import, export, and destructured assignments to the same name.
368
+ */
369
+ noUselessRename?: RuleConfiguration;
370
+ /**
371
+ * Disallow useless case in switch statements.
372
+ */
373
+ noUselessSwitchCase?: RuleConfiguration;
374
+ /**
375
+ * Disallow using any or unknown as type constraint.
376
+ */
377
+ noUselessTypeConstraint?: RuleConfiguration;
378
+ /**
379
+ * Disallow with statements in non-strict contexts.
380
+ */
381
+ noWith?: RuleConfiguration;
382
+ /**
383
+ * It enables the recommended rules for this group
384
+ */
385
+ recommended?: boolean;
386
+ /**
387
+ * Promotes the use of .flatMap() when map().flat() are used together.
388
+ */
389
+ useFlatMap?: RuleConfiguration;
390
+ /**
391
+ * Enforce the usage of a literal access to properties over computed property access.
392
+ */
393
+ useLiteralKeys?: RuleConfiguration;
394
+ /**
395
+ * Enforce using concise optional chain instead of chained logical expressions.
396
+ */
397
+ useOptionalChain?: RuleConfiguration;
398
+ /**
399
+ * Disallow number literal object member names which are not base10 or uses underscore as separator
400
+ */
401
+ useSimpleNumberKeys?: RuleConfiguration;
402
+ /**
403
+ * Discard redundant terms from logical expressions.
404
+ */
405
+ useSimplifiedLogicExpression?: RuleConfiguration;
406
+ }
407
+ interface Correctness {
408
+ /**
409
+ * It enables ALL rules for this group.
410
+ */
411
+ all?: boolean;
412
+ /**
413
+ * Prevent passing of children as props.
414
+ */
415
+ noChildrenProp?: RuleConfiguration;
416
+ /**
417
+ * Prevents from having const variables being re-assigned.
418
+ */
419
+ noConstAssign?: RuleConfiguration;
420
+ /**
421
+ * Disallow returning a value from a constructor.
422
+ */
423
+ noConstructorReturn?: RuleConfiguration;
424
+ /**
425
+ * Disallows empty destructuring patterns.
426
+ */
427
+ noEmptyPattern?: RuleConfiguration;
428
+ /**
429
+ * Disallow calling global object properties as functions
430
+ */
431
+ noGlobalObjectCalls?: RuleConfiguration;
432
+ /**
433
+ * Disallow function and var declarations that are accessible outside their block.
434
+ */
435
+ noInnerDeclarations?: RuleConfiguration;
436
+ /**
437
+ * Prevents the incorrect use of super() inside classes. It also checks whether a call super() is missing from classes that extends other constructors.
438
+ */
439
+ noInvalidConstructorSuper?: RuleConfiguration;
440
+ /**
441
+ * Disallow new operators with the Symbol object.
442
+ */
443
+ noNewSymbol?: RuleConfiguration;
444
+ /**
445
+ * Disallow literal numbers that lose precision
446
+ */
447
+ noPrecisionLoss?: RuleConfiguration;
448
+ /**
449
+ * Prevent the usage of the return value of React.render.
450
+ */
451
+ noRenderReturnValue?: RuleConfiguration;
452
+ /**
453
+ * Disallow returning a value from a setter
454
+ */
455
+ noSetterReturn?: RuleConfiguration;
456
+ /**
457
+ * Disallow comparison of expressions modifying the string case with non-compliant value.
458
+ */
459
+ noStringCaseMismatch?: RuleConfiguration;
460
+ /**
461
+ * Disallow lexical declarations in switch clauses.
462
+ */
463
+ noSwitchDeclarations?: RuleConfiguration;
464
+ /**
465
+ * Prevents the usage of variables that haven't been declared inside the document.
466
+ */
467
+ noUndeclaredVariables?: RuleConfiguration;
468
+ /**
469
+ * Avoid using unnecessary continue.
470
+ */
471
+ noUnnecessaryContinue?: RuleConfiguration;
472
+ /**
473
+ * Disallow unreachable code
474
+ */
475
+ noUnreachable?: RuleConfiguration;
476
+ /**
477
+ * Ensures the super() constructor is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass
478
+ */
479
+ noUnreachableSuper?: RuleConfiguration;
480
+ /**
481
+ * Disallow control flow statements in finally blocks.
482
+ */
483
+ noUnsafeFinally?: RuleConfiguration;
484
+ /**
485
+ * Disallow the use of optional chaining in contexts where the undefined value is not allowed.
486
+ */
487
+ noUnsafeOptionalChaining?: RuleConfiguration;
488
+ /**
489
+ * Disallow unused labels.
490
+ */
491
+ noUnusedLabels?: RuleConfiguration;
492
+ /**
493
+ * Disallow unused variables.
494
+ */
495
+ noUnusedVariables?: RuleConfiguration;
496
+ /**
497
+ * This rules prevents void elements (AKA self-closing elements) from having children.
498
+ */
499
+ noVoidElementsWithChildren?: RuleConfiguration;
500
+ /**
501
+ * Disallow returning a value from a function with the return type 'void'
502
+ */
503
+ noVoidTypeReturn?: RuleConfiguration;
504
+ /**
505
+ * It enables the recommended rules for this group
506
+ */
507
+ recommended?: boolean;
508
+ /**
509
+ * Require calls to isNaN() when checking for NaN.
510
+ */
511
+ useIsNan?: RuleConfiguration;
512
+ /**
513
+ * Enforce "for" loop update clause moving the counter in the right direction.
514
+ */
515
+ useValidForDirection?: RuleConfiguration;
516
+ /**
517
+ * Require generator functions to contain yield.
518
+ */
519
+ useYield?: RuleConfiguration;
520
+ }
521
+ interface Nursery {
522
+ /**
523
+ * It enables ALL rules for this group.
524
+ */
525
+ all?: boolean;
526
+ /**
527
+ * Disallow the use of spread (...) syntax on accumulators.
528
+ */
529
+ noAccumulatingSpread?: RuleConfiguration;
530
+ /**
531
+ * Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes.
532
+ */
533
+ noAriaUnsupportedElements?: RuleConfiguration;
534
+ /**
535
+ * Disallow primitive type aliases and misleading types.
536
+ */
537
+ noBannedTypes?: RuleConfiguration;
538
+ /**
539
+ * Disallow arrow functions where they could be confused with comparisons.
540
+ */
541
+ noConfusingArrow?: RuleConfiguration;
542
+ /**
543
+ * Disallow constant expressions in conditions
544
+ */
545
+ noConstantCondition?: RuleConfiguration;
546
+ /**
547
+ * Prevents from having control characters and some escape sequences that match control characters in regular expressions.
548
+ */
549
+ noControlCharactersInRegex?: RuleConfiguration;
550
+ /**
551
+ * Disallow two keys with the same name inside a JSON object.
552
+ */
553
+ noDuplicateJsonKeys?: RuleConfiguration;
554
+ /**
555
+ * Disallow functions that exceed a given complexity score.
556
+ */
557
+ noExcessiveComplexity?: RuleConfiguration;
558
+ /**
559
+ * Disallow fallthrough of switch clauses.
560
+ */
561
+ noFallthroughSwitchClause?: RuleConfiguration;
562
+ /**
563
+ * Use Number.isFinite instead of global isFinite.
564
+ */
565
+ noGlobalIsFinite?: RuleConfiguration;
566
+ /**
567
+ * Use Number.isNaN instead of global isNaN.
568
+ */
569
+ noGlobalIsNan?: RuleConfiguration;
570
+ /**
571
+ * Enforce that tabIndex is not assigned to non-interactive HTML elements.
572
+ */
573
+ noNoninteractiveTabindex?: RuleConfiguration;
574
+ /**
575
+ * Disallow \8 and \9 escape sequences in string literals.
576
+ */
577
+ noNonoctalDecimalEscape?: RuleConfiguration;
578
+ /**
579
+ * Enforce explicit role property is not the same as implicit/default role property on an element.
580
+ */
581
+ noRedundantRoles?: RuleConfiguration;
582
+ /**
583
+ * Disallow assignments where both sides are exactly the same.
584
+ */
585
+ noSelfAssign?: RuleConfiguration;
586
+ /**
587
+ * This rule reports when a class has no non-static members, such as for a class used exclusively as a static namespace.
588
+ */
589
+ noStaticOnlyClass?: RuleConfiguration;
590
+ /**
591
+ * Disallow unsafe declaration merging between interfaces and classes.
592
+ */
593
+ noUnsafeDeclarationMerging?: RuleConfiguration;
594
+ /**
595
+ * Disallow empty exports that don't change anything in a module file.
596
+ */
597
+ noUselessEmptyExport?: RuleConfiguration;
598
+ /**
599
+ * Disallow the use of void operators, which is not a familiar operator.
600
+ */
601
+ noVoid?: RuleConfiguration;
602
+ /**
603
+ * It enables the recommended rules for this group
604
+ */
605
+ recommended?: boolean;
606
+ /**
607
+ * Enforce that ARIA state and property values are valid.
608
+ */
609
+ useAriaPropTypes?: RuleConfiguration;
610
+ /**
611
+ * Use arrow functions over function expressions.
612
+ */
613
+ useArrowFunction?: RuleConfiguration;
614
+ /**
615
+ * Enforce all dependencies are correctly specified.
616
+ */
617
+ useExhaustiveDependencies?: RuleConfiguration;
618
+ /**
619
+ * Enforce the use of import type when an import only has specifiers with type qualifier.
620
+ */
621
+ useGroupedTypeImport?: RuleConfiguration;
622
+ /**
623
+ * Enforce that all React hooks are being called from the Top Level component functions.
624
+ */
625
+ useHookAtTopLevel?: RuleConfiguration;
626
+ /**
627
+ * Disallows package private imports.
628
+ */
629
+ useImportRestrictions?: RuleConfiguration;
630
+ /**
631
+ * Use Array.isArray() instead of instanceof Array.
632
+ */
633
+ useIsArray?: RuleConfiguration;
634
+ /**
635
+ * Require all enum members to be literal values.
636
+ */
637
+ useLiteralEnumMembers?: RuleConfiguration;
638
+ /**
639
+ * Enforce naming conventions for everything across a codebase.
640
+ */
641
+ useNamingConvention?: RuleConfiguration;
642
+ }
643
+ interface Performance {
644
+ /**
645
+ * It enables ALL rules for this group.
646
+ */
647
+ all?: boolean;
648
+ /**
649
+ * Disallow the use of the delete operator.
650
+ */
651
+ noDelete?: RuleConfiguration;
652
+ /**
653
+ * It enables the recommended rules for this group
654
+ */
655
+ recommended?: boolean;
656
+ }
657
+ interface Security {
658
+ /**
659
+ * It enables ALL rules for this group.
660
+ */
661
+ all?: boolean;
662
+ /**
663
+ * Prevent the usage of dangerous JSX props
664
+ */
665
+ noDangerouslySetInnerHtml?: RuleConfiguration;
666
+ /**
667
+ * Report when a DOM element or a component uses both children and dangerouslySetInnerHTML prop.
668
+ */
669
+ noDangerouslySetInnerHtmlWithChildren?: RuleConfiguration;
670
+ /**
671
+ * It enables the recommended rules for this group
672
+ */
673
+ recommended?: boolean;
674
+ }
675
+ interface Style {
676
+ /**
677
+ * It enables ALL rules for this group.
678
+ */
679
+ all?: boolean;
680
+ /**
681
+ * Disallow the use of arguments
682
+ */
683
+ noArguments?: RuleConfiguration;
684
+ /**
685
+ * Disallow comma operator.
686
+ */
687
+ noCommaOperator?: RuleConfiguration;
688
+ /**
689
+ * Disallow implicit true values on JSX boolean attributes
690
+ */
691
+ noImplicitBoolean?: RuleConfiguration;
692
+ /**
693
+ * Disallow type annotations for variables, parameters, and class properties initialized with a literal expression.
694
+ */
695
+ noInferrableTypes?: RuleConfiguration;
696
+ /**
697
+ * Disallow the use of TypeScript's namespaces.
698
+ */
699
+ noNamespace?: RuleConfiguration;
700
+ /**
701
+ * Disallow negation in the condition of an if statement if it has an else clause
702
+ */
703
+ noNegationElse?: RuleConfiguration;
704
+ /**
705
+ * Disallow non-null assertions using the ! postfix operator.
706
+ */
707
+ noNonNullAssertion?: RuleConfiguration;
708
+ /**
709
+ * Disallow reassigning function parameters.
710
+ */
711
+ noParameterAssign?: RuleConfiguration;
712
+ /**
713
+ * Disallow the use of parameter properties in class constructors.
714
+ */
715
+ noParameterProperties?: RuleConfiguration;
716
+ /**
717
+ * This rule allows you to specify global variable names that you don’t want to use in your application.
718
+ */
719
+ noRestrictedGlobals?: RuleConfiguration;
720
+ /**
721
+ * Disallow the use of constants which its value is the upper-case version of its name.
722
+ */
723
+ noShoutyConstants?: RuleConfiguration;
724
+ /**
725
+ * Disallow template literals if interpolation and special-character handling are not needed
726
+ */
727
+ noUnusedTemplateLiteral?: RuleConfiguration;
728
+ /**
729
+ * Disallow the use of var
730
+ */
731
+ noVar?: RuleConfiguration;
732
+ /**
733
+ * It enables the recommended rules for this group
734
+ */
735
+ recommended?: boolean;
736
+ /**
737
+ * Requires following curly brace conventions. JavaScript allows the omission of curly braces when a block contains only one statement. However, it is considered by many to be best practice to never omit curly braces around blocks, even when they are optional, because it can lead to bugs and reduces code clarity.
738
+ */
739
+ useBlockStatements?: RuleConfiguration;
740
+ /**
741
+ * Require const declarations for variables that are never reassigned after declared.
742
+ */
743
+ useConst?: RuleConfiguration;
744
+ /**
745
+ * Enforce default function parameters and optional function parameters to be last.
746
+ */
747
+ useDefaultParameterLast?: RuleConfiguration;
748
+ /**
749
+ * Require that each enum member value be explicitly initialized.
750
+ */
751
+ useEnumInitializers?: RuleConfiguration;
752
+ /**
753
+ * Disallow the use of Math.pow in favor of the ** operator.
754
+ */
755
+ useExponentiationOperator?: RuleConfiguration;
756
+ /**
757
+ * This rule enforces the use of <>...</> over <Fragment>...</Fragment>.
758
+ */
759
+ useFragmentSyntax?: RuleConfiguration;
760
+ /**
761
+ * Disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals
762
+ */
763
+ useNumericLiterals?: RuleConfiguration;
764
+ /**
765
+ * Prevent extra closing tags for components without children
766
+ */
767
+ useSelfClosingElements?: RuleConfiguration;
768
+ /**
769
+ * When expressing array types, this rule promotes the usage of T[] shorthand instead of Array<T>.
770
+ */
771
+ useShorthandArrayType?: RuleConfiguration;
772
+ /**
773
+ * Enforces switch clauses have a single statement, emits a quick fix wrapping the statements in a block.
774
+ */
775
+ useSingleCaseStatement?: RuleConfiguration;
776
+ /**
777
+ * Disallow multiple variable declarations in the same variable statement
778
+ */
779
+ useSingleVarDeclarator?: RuleConfiguration;
780
+ /**
781
+ * Template literals are preferred over string concatenation.
782
+ */
783
+ useTemplate?: RuleConfiguration;
784
+ /**
785
+ * Enforce the use of while loops instead of for loops when the initializer and update expressions are not needed
786
+ */
787
+ useWhile?: RuleConfiguration;
788
+ }
789
+ interface Suspicious {
790
+ /**
791
+ * It enables ALL rules for this group.
792
+ */
793
+ all?: boolean;
794
+ /**
795
+ * Discourage the usage of Array index in keys.
796
+ */
797
+ noArrayIndexKey?: RuleConfiguration;
798
+ /**
799
+ * Disallow assignments in expressions.
800
+ */
801
+ noAssignInExpressions?: RuleConfiguration;
802
+ /**
803
+ * Disallows using an async function as a Promise executor.
804
+ */
805
+ noAsyncPromiseExecutor?: RuleConfiguration;
806
+ /**
807
+ * Disallow reassigning exceptions in catch clauses.
808
+ */
809
+ noCatchAssign?: RuleConfiguration;
810
+ /**
811
+ * Disallow reassigning class members.
812
+ */
813
+ noClassAssign?: RuleConfiguration;
814
+ /**
815
+ * Prevent comments from being inserted as text nodes
816
+ */
817
+ noCommentText?: RuleConfiguration;
818
+ /**
819
+ * Disallow comparing against -0
820
+ */
821
+ noCompareNegZero?: RuleConfiguration;
822
+ /**
823
+ * Disallow labeled statements that are not loops.
824
+ */
825
+ noConfusingLabels?: RuleConfiguration;
826
+ /**
827
+ * Disallow the use of console.log
828
+ */
829
+ noConsoleLog?: RuleConfiguration;
830
+ /**
831
+ * Disallow TypeScript const enum
832
+ */
833
+ noConstEnum?: RuleConfiguration;
834
+ /**
835
+ * Disallow the use of debugger
836
+ */
837
+ noDebugger?: RuleConfiguration;
838
+ /**
839
+ * Require the use of === and !==
840
+ */
841
+ noDoubleEquals?: RuleConfiguration;
842
+ /**
843
+ * Disallow duplicate case labels. If a switch statement has duplicate test expressions in case clauses, it is likely that a programmer copied a case clause but forgot to change the test expression.
844
+ */
845
+ noDuplicateCase?: RuleConfiguration;
846
+ /**
847
+ * Disallow duplicate class members.
848
+ */
849
+ noDuplicateClassMembers?: RuleConfiguration;
850
+ /**
851
+ * Prevents JSX properties to be assigned multiple times.
852
+ */
853
+ noDuplicateJsxProps?: RuleConfiguration;
854
+ /**
855
+ * Prevents object literals having more than one property declaration for the same name. If an object property with the same name is defined multiple times (except when combining a getter with a setter), only the last definition makes it into the object and previous definitions are ignored, which is likely a mistake.
856
+ */
857
+ noDuplicateObjectKeys?: RuleConfiguration;
858
+ /**
859
+ * Disallow duplicate function parameter name.
860
+ */
861
+ noDuplicateParameters?: RuleConfiguration;
862
+ /**
863
+ * Disallow the declaration of empty interfaces.
864
+ */
865
+ noEmptyInterface?: RuleConfiguration;
866
+ /**
867
+ * Disallow the any type usage.
868
+ */
869
+ noExplicitAny?: RuleConfiguration;
870
+ /**
871
+ * Prevents the wrong usage of the non-null assertion operator (!) in TypeScript files.
872
+ */
873
+ noExtraNonNullAssertion?: RuleConfiguration;
874
+ /**
875
+ * Disallow reassigning function declarations.
876
+ */
877
+ noFunctionAssign?: RuleConfiguration;
878
+ /**
879
+ * Disallow assigning to imported bindings
880
+ */
881
+ noImportAssign?: RuleConfiguration;
882
+ /**
883
+ * Disallow labels that share a name with a variable
884
+ */
885
+ noLabelVar?: RuleConfiguration;
886
+ /**
887
+ * Disallow direct use of Object.prototype builtins.
888
+ */
889
+ noPrototypeBuiltins?: RuleConfiguration;
890
+ /**
891
+ * Disallow variable, function, class, and type redeclarations in the same scope.
892
+ */
893
+ noRedeclare?: RuleConfiguration;
894
+ /**
895
+ * Prevents from having redundant "use strict".
896
+ */
897
+ noRedundantUseStrict?: RuleConfiguration;
898
+ /**
899
+ * Disallow comparisons where both sides are exactly the same.
900
+ */
901
+ noSelfCompare?: RuleConfiguration;
902
+ /**
903
+ * Disallow identifiers from shadowing restricted names.
904
+ */
905
+ noShadowRestrictedNames?: RuleConfiguration;
906
+ /**
907
+ * Disallow sparse arrays
908
+ */
909
+ noSparseArray?: RuleConfiguration;
910
+ /**
911
+ * Disallow using unsafe negation.
912
+ */
913
+ noUnsafeNegation?: RuleConfiguration;
914
+ /**
915
+ * It enables the recommended rules for this group
916
+ */
917
+ recommended?: boolean;
918
+ /**
919
+ * Enforce default clauses in switch statements to be last
920
+ */
921
+ useDefaultSwitchClauseLast?: RuleConfiguration;
922
+ /**
923
+ * Require using the namespace keyword over the module keyword to declare TypeScript namespaces.
924
+ */
925
+ useNamespaceKeyword?: RuleConfiguration;
926
+ /**
927
+ * This rule verifies the result of typeof $expr unary expressions is being compared to valid values, either string literals containing valid type names or other typeof expressions
928
+ */
929
+ useValidTypeof?: RuleConfiguration;
930
+ }
931
+ type RuleConfiguration = RulePlainConfiguration | RuleWithOptions;
932
+ type RulePlainConfiguration = "warn" | "error" | "off";
933
+ interface RuleWithOptions {
934
+ level: RulePlainConfiguration;
935
+ options?: PossibleOptions;
936
+ }
937
+ type PossibleOptions =
938
+ | ComplexityOptions
939
+ | HooksOptions
940
+ | NamingConventionOptions
941
+ | RestrictedGlobalsOptions
942
+ | null;
943
+ interface ComplexityOptions {
944
+ /**
945
+ * The maximum complexity score that we allow. Anything higher is considered excessive.
946
+ */
947
+ maxAllowedComplexity: number;
948
+ }
949
+ interface HooksOptions {
950
+ /**
951
+ * List of safe hooks
952
+ */
953
+ hooks: Hooks[];
954
+ }
955
+ interface NamingConventionOptions {
956
+ /**
957
+ * Allowed cases for _TypeScript_ `enum` member names.
958
+ */
959
+ enumMemberCase: EnumMemberCase;
960
+ /**
961
+ * If `false`, then consecutive uppercase are allowed in _camel_ and _pascal_ cases. This does not affect other [Case].
962
+ */
963
+ strictCase: boolean;
964
+ }
965
+ interface RestrictedGlobalsOptions {
966
+ /**
967
+ * A list of names that should trigger the rule
968
+ */
969
+ deniedGlobals?: string[];
970
+ }
971
+ interface Hooks {
972
+ /**
973
+ * The "position" of the closure function, starting from zero.
974
+
975
+ ### Example
976
+ */
977
+ closureIndex?: number;
978
+ /**
979
+ * The "position" of the array of dependencies, starting from zero.
980
+ */
981
+ dependenciesIndex?: number;
982
+ /**
983
+ * The name of the hook
984
+ */
985
+ name: string;
986
+ }
987
+ type EnumMemberCase = "PascalCase" | "CONSTANT_CASE" | "camelCase";
988
+ interface OpenFileParams {
989
+ content: string;
990
+ language_hint?: Language;
991
+ path: RomePath;
992
+ version: number;
993
+ }
994
+ type Language =
995
+ | "JavaScript"
996
+ | "JavaScriptReact"
997
+ | "TypeScript"
998
+ | "TypeScriptReact"
999
+ | "Json"
1000
+ | "Jsonc"
1001
+ | "Unknown";
1002
+ interface ChangeFileParams {
1003
+ content: string;
1004
+ path: RomePath;
1005
+ version: number;
1006
+ }
1007
+ interface CloseFileParams {
1008
+ path: RomePath;
1009
+ }
1010
+ interface GetSyntaxTreeParams {
1011
+ path: RomePath;
1012
+ }
1013
+ interface GetSyntaxTreeResult {
1014
+ ast: string;
1015
+ cst: string;
1016
+ }
1017
+ interface OrganizeImportsParams {
1018
+ path: RomePath;
1019
+ }
1020
+ interface OrganizeImportsResult {
1021
+ code: string;
1022
+ }
1023
+ interface GetFileContentParams {
1024
+ path: RomePath;
1025
+ }
1026
+ interface GetControlFlowGraphParams {
1027
+ cursor: TextSize;
1028
+ path: RomePath;
1029
+ }
1030
+ type TextSize = number;
1031
+ interface GetFormatterIRParams {
1032
+ path: RomePath;
1033
+ }
1034
+ interface PullDiagnosticsParams {
1035
+ categories: RuleCategories;
1036
+ max_diagnostics: number;
1037
+ path: RomePath;
1038
+ }
1039
+ type RuleCategories = RuleCategory[];
1040
+ type RuleCategory = "Syntax" | "Lint" | "Action" | "Transformation";
1041
+ interface PullDiagnosticsResult {
1042
+ diagnostics: Diagnostic[];
1043
+ errors: number;
1044
+ skipped_diagnostics: number;
1045
+ }
1046
+ interface Diagnostic {
1047
+ advices: Advices;
1048
+ category?: Category;
1049
+ description: string;
1050
+ location: Location;
1051
+ message: MarkupBuf;
1052
+ severity: Severity;
1053
+ source?: Diagnostic;
1054
+ tags: DiagnosticTags;
1055
+ verbose_advices: Advices;
1056
+ }
1057
+ interface Advices {
1058
+ advices: Advice[];
1059
+ }
1060
+ type Category =
1061
+ | "lint/a11y/noAccessKey"
1062
+ | "lint/a11y/noAutofocus"
1063
+ | "lint/a11y/noBlankTarget"
1064
+ | "lint/a11y/noDistractingElements"
1065
+ | "lint/a11y/noHeaderScope"
1066
+ | "lint/a11y/noNoninteractiveElementToInteractiveRole"
1067
+ | "lint/a11y/noPositiveTabindex"
1068
+ | "lint/a11y/noRedundantAlt"
1069
+ | "lint/a11y/noSvgWithoutTitle"
1070
+ | "lint/a11y/useAltText"
1071
+ | "lint/a11y/useAnchorContent"
1072
+ | "lint/a11y/useAriaPropsForRole"
1073
+ | "lint/a11y/useButtonType"
1074
+ | "lint/a11y/useHeadingContent"
1075
+ | "lint/a11y/useHtmlLang"
1076
+ | "lint/a11y/useIframeTitle"
1077
+ | "lint/a11y/useKeyWithClickEvents"
1078
+ | "lint/a11y/useKeyWithMouseEvents"
1079
+ | "lint/a11y/useMediaCaption"
1080
+ | "lint/a11y/useValidAnchor"
1081
+ | "lint/a11y/useValidAriaProps"
1082
+ | "lint/a11y/useValidLang"
1083
+ | "lint/complexity/noExtraBooleanCast"
1084
+ | "lint/complexity/noForEach"
1085
+ | "lint/complexity/noMultipleSpacesInRegularExpressionLiterals"
1086
+ | "lint/complexity/noUselessCatch"
1087
+ | "lint/complexity/noUselessConstructor"
1088
+ | "lint/complexity/noUselessFragments"
1089
+ | "lint/complexity/noUselessLabel"
1090
+ | "lint/complexity/noUselessRename"
1091
+ | "lint/complexity/noUselessSwitchCase"
1092
+ | "lint/complexity/noUselessTypeConstraint"
1093
+ | "lint/complexity/noWith"
1094
+ | "lint/complexity/useFlatMap"
1095
+ | "lint/complexity/useLiteralKeys"
1096
+ | "lint/complexity/useOptionalChain"
1097
+ | "lint/complexity/useSimpleNumberKeys"
1098
+ | "lint/complexity/useSimplifiedLogicExpression"
1099
+ | "lint/correctness/noChildrenProp"
1100
+ | "lint/correctness/noConstAssign"
1101
+ | "lint/correctness/noConstructorReturn"
1102
+ | "lint/correctness/noEmptyPattern"
1103
+ | "lint/correctness/noGlobalObjectCalls"
1104
+ | "lint/correctness/noInnerDeclarations"
1105
+ | "lint/correctness/noInvalidConstructorSuper"
1106
+ | "lint/correctness/useIsNan"
1107
+ | "lint/correctness/noNewSymbol"
1108
+ | "lint/correctness/noPrecisionLoss"
1109
+ | "lint/correctness/noRenderReturnValue"
1110
+ | "lint/correctness/noSetterReturn"
1111
+ | "lint/correctness/noStringCaseMismatch"
1112
+ | "lint/correctness/noSwitchDeclarations"
1113
+ | "lint/correctness/noUndeclaredVariables"
1114
+ | "lint/correctness/noUnnecessaryContinue"
1115
+ | "lint/correctness/noUnreachable"
1116
+ | "lint/correctness/noUnreachableSuper"
1117
+ | "lint/correctness/noUnsafeFinally"
1118
+ | "lint/correctness/noUnsafeOptionalChaining"
1119
+ | "lint/correctness/noUnusedLabels"
1120
+ | "lint/correctness/noUnusedVariables"
1121
+ | "lint/correctness/noVoidElementsWithChildren"
1122
+ | "lint/correctness/noVoidTypeReturn"
1123
+ | "lint/correctness/useValidForDirection"
1124
+ | "lint/correctness/useYield"
1125
+ | "lint/nursery/noAccumulatingSpread"
1126
+ | "lint/nursery/noAriaUnsupportedElements"
1127
+ | "lint/nursery/noBannedTypes"
1128
+ | "lint/nursery/noConfusingArrow"
1129
+ | "lint/nursery/noConstantCondition"
1130
+ | "lint/nursery/noControlCharactersInRegex"
1131
+ | "lint/nursery/noDuplicateJsonKeys"
1132
+ | "lint/nursery/noExcessiveComplexity"
1133
+ | "lint/nursery/noFallthroughSwitchClause"
1134
+ | "lint/nursery/noGlobalIsFinite"
1135
+ | "lint/nursery/noGlobalIsNan"
1136
+ | "lint/nursery/noNoninteractiveTabindex"
1137
+ | "lint/nursery/noNonoctalDecimalEscape"
1138
+ | "lint/nursery/noRedundantRoles"
1139
+ | "lint/nursery/noSelfAssign"
1140
+ | "lint/nursery/noStaticOnlyClass"
1141
+ | "lint/nursery/noUnsafeDeclarationMerging"
1142
+ | "lint/nursery/noUselessEmptyExport"
1143
+ | "lint/nursery/noVoid"
1144
+ | "lint/nursery/useAriaPropTypes"
1145
+ | "lint/nursery/useArrowFunction"
1146
+ | "lint/nursery/useExhaustiveDependencies"
1147
+ | "lint/nursery/useGroupedTypeImport"
1148
+ | "lint/nursery/useHookAtTopLevel"
1149
+ | "lint/nursery/useImportRestrictions"
1150
+ | "lint/nursery/useIsArray"
1151
+ | "lint/nursery/useLiteralEnumMembers"
1152
+ | "lint/nursery/useNamingConvention"
1153
+ | "lint/performance/noDelete"
1154
+ | "lint/security/noDangerouslySetInnerHtml"
1155
+ | "lint/security/noDangerouslySetInnerHtmlWithChildren"
1156
+ | "lint/style/noArguments"
1157
+ | "lint/style/noCommaOperator"
1158
+ | "lint/style/noImplicitBoolean"
1159
+ | "lint/style/noInferrableTypes"
1160
+ | "lint/style/noNamespace"
1161
+ | "lint/style/noNegationElse"
1162
+ | "lint/style/noNonNullAssertion"
1163
+ | "lint/style/noParameterAssign"
1164
+ | "lint/style/noParameterProperties"
1165
+ | "lint/style/noRestrictedGlobals"
1166
+ | "lint/style/noShoutyConstants"
1167
+ | "lint/style/noUnusedTemplateLiteral"
1168
+ | "lint/style/noVar"
1169
+ | "lint/style/useBlockStatements"
1170
+ | "lint/style/useConst"
1171
+ | "lint/style/useDefaultParameterLast"
1172
+ | "lint/style/useEnumInitializers"
1173
+ | "lint/style/useExponentiationOperator"
1174
+ | "lint/style/useFragmentSyntax"
1175
+ | "lint/style/useNumericLiterals"
1176
+ | "lint/style/useSelfClosingElements"
1177
+ | "lint/style/useShorthandArrayType"
1178
+ | "lint/style/useSingleCaseStatement"
1179
+ | "lint/style/useSingleVarDeclarator"
1180
+ | "lint/style/useTemplate"
1181
+ | "lint/style/useWhile"
1182
+ | "lint/suspicious/noArrayIndexKey"
1183
+ | "lint/suspicious/noAssignInExpressions"
1184
+ | "lint/suspicious/noAsyncPromiseExecutor"
1185
+ | "lint/suspicious/noCatchAssign"
1186
+ | "lint/suspicious/noClassAssign"
1187
+ | "lint/suspicious/noCommentText"
1188
+ | "lint/suspicious/noCompareNegZero"
1189
+ | "lint/suspicious/noConfusingLabels"
1190
+ | "lint/suspicious/noConsoleLog"
1191
+ | "lint/suspicious/noConstEnum"
1192
+ | "lint/suspicious/noDebugger"
1193
+ | "lint/suspicious/noDoubleEquals"
1194
+ | "lint/suspicious/noDuplicateCase"
1195
+ | "lint/suspicious/noDuplicateClassMembers"
1196
+ | "lint/suspicious/noDuplicateJsxProps"
1197
+ | "lint/suspicious/noDuplicateObjectKeys"
1198
+ | "lint/suspicious/noDuplicateParameters"
1199
+ | "lint/suspicious/noEmptyInterface"
1200
+ | "lint/suspicious/noExplicitAny"
1201
+ | "lint/suspicious/noExtraNonNullAssertion"
1202
+ | "lint/suspicious/noFunctionAssign"
1203
+ | "lint/suspicious/noImportAssign"
1204
+ | "lint/suspicious/noLabelVar"
1205
+ | "lint/suspicious/noPrototypeBuiltins"
1206
+ | "lint/suspicious/noRedeclare"
1207
+ | "lint/suspicious/noRedundantUseStrict"
1208
+ | "lint/suspicious/noSelfCompare"
1209
+ | "lint/suspicious/noShadowRestrictedNames"
1210
+ | "lint/suspicious/noSparseArray"
1211
+ | "lint/suspicious/noUnsafeNegation"
1212
+ | "lint/suspicious/useDefaultSwitchClauseLast"
1213
+ | "lint/suspicious/useNamespaceKeyword"
1214
+ | "lint/suspicious/useValidTypeof"
1215
+ | "files/missingHandler"
1216
+ | "format"
1217
+ | "check"
1218
+ | "ci"
1219
+ | "configuration"
1220
+ | "organizeImports"
1221
+ | "migrate"
1222
+ | "deserialize"
1223
+ | "internalError/io"
1224
+ | "internalError/fs"
1225
+ | "internalError/panic"
1226
+ | "parse"
1227
+ | "parse/noSuperWithoutExtends"
1228
+ | "parse/noDuplicatePrivateClassMembers"
1229
+ | "lint"
1230
+ | "lint/a11y"
1231
+ | "lint/complexity"
1232
+ | "lint/correctness"
1233
+ | "lint/nursery"
1234
+ | "lint/performance"
1235
+ | "lint/security"
1236
+ | "lint/style"
1237
+ | "lint/suspicious"
1238
+ | "suppressions/parse"
1239
+ | "suppressions/unknownGroup"
1240
+ | "suppressions/unknownRule"
1241
+ | "suppressions/unused"
1242
+ | "suppressions/deprecatedSyntax"
1243
+ | "args/fileNotFound"
1244
+ | "flags/invalid"
1245
+ | "semanticTests";
1246
+ interface Location {
1247
+ path?: Resource_for_String;
1248
+ source_code?: string;
1249
+ span?: TextRange;
1250
+ }
1251
+ type MarkupBuf = MarkupNodeBuf[];
1252
+ type Severity = "hint" | "information" | "warning" | "error" | "fatal";
1253
+ type DiagnosticTags = DiagnosticTag[];
1254
+ type Advice =
1255
+ | { Log: [LogCategory, MarkupBuf] }
1256
+ | { List: MarkupBuf[] }
1257
+ | { Frame: Location }
1258
+ | { Diff: TextEdit }
1259
+ | { Backtrace: [MarkupBuf, Backtrace] }
1260
+ | { Command: string }
1261
+ | { Group: [MarkupBuf, Advices] };
1262
+ type Resource_for_String = "argv" | "memory" | { file: string };
1263
+ type TextRange = [TextSize, TextSize];
1264
+ interface MarkupNodeBuf {
1265
+ content: string;
1266
+ elements: MarkupElement[];
1267
+ }
1268
+ type DiagnosticTag =
1269
+ | "fixable"
1270
+ | "internal"
1271
+ | "unnecessaryCode"
1272
+ | "deprecatedCode";
1273
+ type LogCategory = "None" | "Info" | "Warn" | "Error";
1274
+ interface TextEdit {
1275
+ dictionary: string;
1276
+ ops: CompressedOp[];
1277
+ }
1278
+ type Backtrace = BacktraceFrame[];
1279
+ type MarkupElement =
1280
+ | "Emphasis"
1281
+ | "Dim"
1282
+ | "Italic"
1283
+ | "Underline"
1284
+ | "Error"
1285
+ | "Success"
1286
+ | "Warn"
1287
+ | "Info"
1288
+ | "Inverse"
1289
+ | { Hyperlink: { href: string } };
1290
+ type CompressedOp = { DiffOp: DiffOp } | { EqualLines: { line_count: number } };
1291
+ interface BacktraceFrame {
1292
+ ip: number;
1293
+ symbols: BacktraceSymbol[];
1294
+ }
1295
+ type DiffOp =
1296
+ | { Equal: { range: TextRange } }
1297
+ | { Insert: { range: TextRange } }
1298
+ | { Delete: { range: TextRange } };
1299
+ interface BacktraceSymbol {
1300
+ colno?: number;
1301
+ filename?: string;
1302
+ lineno?: number;
1303
+ name?: string;
1304
+ }
1305
+ interface PullActionsParams {
1306
+ path: RomePath;
1307
+ range: TextRange;
1308
+ }
1309
+ interface PullActionsResult {
1310
+ actions: CodeAction[];
1311
+ }
1312
+ interface CodeAction {
1313
+ category: ActionCategory;
1314
+ rule_name?: [string, string];
1315
+ suggestion: CodeSuggestion;
1316
+ }
1317
+ type ActionCategory =
1318
+ | "QuickFix"
1319
+ | { Refactor: RefactorKind }
1320
+ | { Source: SourceActionKind }
1321
+ | { Other: string };
1322
+ interface CodeSuggestion {
1323
+ applicability: Applicability;
1324
+ labels: TextRange[];
1325
+ msg: MarkupBuf;
1326
+ span: TextRange;
1327
+ suggestion: TextEdit;
1328
+ }
1329
+ type RefactorKind =
1330
+ | "None"
1331
+ | "Extract"
1332
+ | "Inline"
1333
+ | "Rewrite"
1334
+ | { Other: string };
1335
+ type SourceActionKind =
1336
+ | "FixAll"
1337
+ | "None"
1338
+ | "OrganizeImports"
1339
+ | { Other: string };
1340
+ type Applicability = "Always" | "MaybeIncorrect";
1341
+ interface FormatFileParams {
1342
+ path: RomePath;
1343
+ }
1344
+ interface Printed {
1345
+ code: string;
1346
+ range?: TextRange;
1347
+ sourcemap: SourceMarker[];
1348
+ verbatim_ranges: TextRange[];
1349
+ }
1350
+ interface SourceMarker {
1351
+ /**
1352
+ * Position of the marker in the output code
1353
+ */
1354
+ dest: TextSize;
1355
+ /**
1356
+ * Position of the marker in the original source
1357
+ */
1358
+ source: TextSize;
1359
+ }
1360
+ interface FormatRangeParams {
1361
+ path: RomePath;
1362
+ range: TextRange;
1363
+ }
1364
+ interface FormatOnTypeParams {
1365
+ offset: TextSize;
1366
+ path: RomePath;
1367
+ }
1368
+ interface FixFileParams {
1369
+ fix_file_mode: FixFileMode;
1370
+ path: RomePath;
1371
+ should_format: boolean;
1372
+ }
1373
+ type FixFileMode = "SafeFixes" | "SafeAndUnsafeFixes";
1374
+ interface FixFileResult {
1375
+ /**
1376
+ * List of all the code actions applied to the file
1377
+ */
1378
+ actions: FixAction[];
1379
+ /**
1380
+ * New source code for the file with all fixes applied
1381
+ */
1382
+ code: string;
1383
+ /**
1384
+ * Number of errors
1385
+ */
1386
+ errors: number;
1387
+ /**
1388
+ * number of skipped suggested fixes
1389
+ */
1390
+ skipped_suggested_fixes: number;
1391
+ }
1392
+ interface FixAction {
1393
+ /**
1394
+ * Source range at which this action was applied
1395
+ */
1396
+ range: TextRange;
1397
+ /**
1398
+ * Name of the rule group and rule that emitted this code action
1399
+ */
1400
+ rule_name?: [string, string];
1401
+ }
1402
+ interface RenameParams {
1403
+ new_name: string;
1404
+ path: RomePath;
1405
+ symbol_at: TextSize;
1406
+ }
1407
+ interface RenameResult {
1408
+ /**
1409
+ * List of text edit operations to apply on the source code
1410
+ */
1411
+ indels: TextEdit;
1412
+ /**
1413
+ * Range of source code modified by this rename operation
1414
+ */
1415
+ range: TextRange;
1416
+ }
1417
+
1418
+
1419
+ /**
1420
+ */
1421
+ export class DiagnosticPrinter {
1422
+ free(): void;
1423
+ /**
1424
+ * @param {string} file_name
1425
+ * @param {string} file_source
1426
+ */
1427
+ constructor(file_name: string, file_source: string);
1428
+ /**
1429
+ * @param {Diagnostic} diagnostic
1430
+ */
1431
+ print_simple(diagnostic: Diagnostic): void;
1432
+ /**
1433
+ * @param {Diagnostic} diagnostic
1434
+ */
1435
+ print_verbose(diagnostic: Diagnostic): void;
1436
+ /**
1437
+ * @returns {string}
1438
+ */
1439
+ finish(): string;
1440
+ }
1441
+ /**
1442
+ */
1443
+ export class Workspace {
1444
+ free(): void;
1445
+ /**
1446
+ */
1447
+ constructor();
1448
+ /**
1449
+ * @param {SupportsFeatureParams} params
1450
+ * @returns {SupportsFeatureResult}
1451
+ */
1452
+ fileFeatures(params: SupportsFeatureParams): SupportsFeatureResult;
1453
+ /**
1454
+ * @param {UpdateSettingsParams} params
1455
+ */
1456
+ updateSettings(params: UpdateSettingsParams): void;
1457
+ /**
1458
+ * @param {OpenFileParams} params
1459
+ */
1460
+ openFile(params: OpenFileParams): void;
1461
+ /**
1462
+ * @param {GetFileContentParams} params
1463
+ * @returns {string}
1464
+ */
1465
+ getFileContent(params: GetFileContentParams): string;
1466
+ /**
1467
+ * @param {GetSyntaxTreeParams} params
1468
+ * @returns {GetSyntaxTreeResult}
1469
+ */
1470
+ getSyntaxTree(params: GetSyntaxTreeParams): GetSyntaxTreeResult;
1471
+ /**
1472
+ * @param {GetControlFlowGraphParams} params
1473
+ * @returns {string}
1474
+ */
1475
+ getControlFlowGraph(params: GetControlFlowGraphParams): string;
1476
+ /**
1477
+ * @param {GetFormatterIRParams} params
1478
+ * @returns {string}
1479
+ */
1480
+ getFormatterIr(params: GetFormatterIRParams): string;
1481
+ /**
1482
+ * @param {ChangeFileParams} params
1483
+ */
1484
+ changeFile(params: ChangeFileParams): void;
1485
+ /**
1486
+ * @param {CloseFileParams} params
1487
+ */
1488
+ closeFile(params: CloseFileParams): void;
1489
+ /**
1490
+ * @param {PullDiagnosticsParams} params
1491
+ * @returns {PullDiagnosticsResult}
1492
+ */
1493
+ pullDiagnostics(params: PullDiagnosticsParams): PullDiagnosticsResult;
1494
+ /**
1495
+ * @param {PullActionsParams} params
1496
+ * @returns {PullActionsResult}
1497
+ */
1498
+ pullActions(params: PullActionsParams): PullActionsResult;
1499
+ /**
1500
+ * @param {FormatFileParams} params
1501
+ * @returns {any}
1502
+ */
1503
+ formatFile(params: FormatFileParams): any;
1504
+ /**
1505
+ * @param {FormatRangeParams} params
1506
+ * @returns {any}
1507
+ */
1508
+ formatRange(params: FormatRangeParams): any;
1509
+ /**
1510
+ * @param {FormatOnTypeParams} params
1511
+ * @returns {any}
1512
+ */
1513
+ formatOnType(params: FormatOnTypeParams): any;
1514
+ /**
1515
+ * @param {FixFileParams} params
1516
+ * @returns {FixFileResult}
1517
+ */
1518
+ fixFile(params: FixFileParams): FixFileResult;
1519
+ /**
1520
+ * @param {OrganizeImportsParams} params
1521
+ * @returns {OrganizeImportsResult}
1522
+ */
1523
+ organizeImports(params: OrganizeImportsParams): OrganizeImportsResult;
1524
+ /**
1525
+ * @param {RenameParams} params
1526
+ * @returns {RenameResult}
1527
+ */
1528
+ rename(params: RenameParams): RenameResult;
1529
+ }