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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
// Generated by dts-bundle v0.7.3

declare module "@eslint-community/regexpp" {
  import * as AST from "@eslint-community/regexpp/ast";
  import { RegExpParser } from "@eslint-community/regexpp/parser";
  import { RegExpValidator } from "@eslint-community/regexpp/validator";
  import { RegExpVisitor } from "@eslint-community/regexpp/visitor";
  export { RegExpSyntaxError } from "@eslint-community/regexpp/regexp-syntax-error";
  export { AST, RegExpParser, RegExpValidator };
  /**
   * Parse a given regular expression literal then make AST object.
   * @param source The source code to parse.
   * @param options The options to parse.
   * @returns The AST of the regular expression.
   */
  export function parseRegExpLiteral(
    source: RegExp | string,
    options?: RegExpParser.Options
  ): AST.RegExpLiteral;
  /**
   * Validate a given regular expression literal.
   * @param source The source code to validate.
   * @param options The options to validate.
   */
  export function validateRegExpLiteral(
    source: string,
    options?: RegExpValidator.Options
  ): void;
  export function visitRegExpAST(
    node: AST.Node,
    handlers: RegExpVisitor.Handlers
  ): void;
}

declare module "@eslint-community/regexpp/ast" {
  /**
   * The type which includes all nodes.
   */
  export type Node = BranchNode | LeafNode;
  /**
   * The type which includes all branch nodes.
   */
  export type BranchNode =
    | Alternative
    | CapturingGroup
    | CharacterClass
    | CharacterClassRange
    | ClassIntersection
    | ClassStringDisjunction
    | ClassSubtraction
    | ExpressionCharacterClass
    | Group
    | LookaroundAssertion
    | Pattern
    | Quantifier
    | RegExpLiteral
    | StringAlternative;
  /**
   * The type which includes all leaf nodes.
   */
  export type LeafNode =
    | Backreference
    | BoundaryAssertion
    | Character
    | CharacterSet
    | Flags;
  /**
   * The type which includes all atom nodes.
   */
  export type Element = Assertion | QuantifiableElement | Quantifier;
  /**
   * The type which includes all atom nodes that Quantifier node can have as children.
   */
  export type QuantifiableElement =
    | Backreference
    | CapturingGroup
    | Character
    | CharacterClass
    | CharacterSet
    | ExpressionCharacterClass
    | Group
    | LookaheadAssertion;
  /**
   * The type which includes all character class atom nodes.
   */
  export type CharacterClassElement =
    | ClassRangesCharacterClassElement
    | UnicodeSetsCharacterClassElement;
  export type ClassRangesCharacterClassElement =
    | Character
    | CharacterClassRange
    | CharacterUnicodePropertyCharacterSet
    | EscapeCharacterSet;
  export type UnicodeSetsCharacterClassElement =
    | Character
    | CharacterClassRange
    | ClassStringDisjunction
    | EscapeCharacterSet
    | ExpressionCharacterClass
    | UnicodePropertyCharacterSet
    | UnicodeSetsCharacterClass;
  /**
   * The type which defines common properties for all node types.
   */
  export interface NodeBase {
    /** The node type. */
    type: Node["type"];
    /** The parent node. */
    parent: Node["parent"];
    /** The 0-based index that this node starts. */
    start: number;
    /** The 0-based index that this node ends. */
    end: number;
    /** The raw text of this node. */
    raw: string;
  }
  /**
   * The root node.
   */
  export interface RegExpLiteral extends NodeBase {
    type: "RegExpLiteral";
    parent: null;
    pattern: Pattern;
    flags: Flags;
  }
  /**
   * The pattern.
   */
  export interface Pattern extends NodeBase {
    type: "Pattern";
    parent: RegExpLiteral | null;
    alternatives: Alternative[];
  }
  /**
   * The alternative.
   * E.g. `a|b`
   */
  export interface Alternative extends NodeBase {
    type: "Alternative";
    parent: CapturingGroup | Group | LookaroundAssertion | Pattern;
    elements: Element[];
  }
  /**
   * The uncapturing group.
   * E.g. `(?:ab)`
   */
  export interface Group extends NodeBase {
    type: "Group";
    parent: Alternative | Quantifier;
    alternatives: Alternative[];
  }
  /**
   * The capturing group.
   * E.g. `(ab)`, `(?<name>ab)`
   */
  export interface CapturingGroup extends NodeBase {
    type: "CapturingGroup";
    parent: Alternative | Quantifier;
    name: string | null;
    alternatives: Alternative[];
    references: Backreference[];
  }
  /**
   * The lookaround assertion.
   */
  export type LookaroundAssertion = LookaheadAssertion | LookbehindAssertion;
  /**
   * The lookahead assertion.
   * E.g. `(?=ab)`, `(?!ab)`
   */
  export interface LookaheadAssertion extends NodeBase {
    type: "Assertion";
    parent: Alternative | Quantifier;
    kind: "lookahead";
    negate: boolean;
    alternatives: Alternative[];
  }
  /**
   * The lookbehind assertion.
   * E.g. `(?<=ab)`, `(?<!ab)`
   */
  export interface LookbehindAssertion extends NodeBase {
    type: "Assertion";
    parent: Alternative;
    kind: "lookbehind";
    negate: boolean;
    alternatives: Alternative[];
  }
  /**
   * The quantifier.
   * E.g. `a?`, `a*`, `a+`, `a{1,2}`, `a??`, `a*?`, `a+?`, `a{1,2}?`
   */
  export interface Quantifier extends NodeBase {
    type: "Quantifier";
    parent: Alternative;
    min: number;
    max: number;
    greedy: boolean;
    element: QuantifiableElement;
  }
  /**
   * The character class.
   * E.g. `[ab]`, `[^ab]`
   */
  export type CharacterClass =
    | ClassRangesCharacterClass
    | UnicodeSetsCharacterClass;
  interface BaseCharacterClass extends NodeBase {
    type: "CharacterClass";
    parent:
      | Alternative
      | ClassIntersection
      | ClassSubtraction
      | Quantifier
      | UnicodeSetsCharacterClass;
    unicodeSets: boolean;
    negate: boolean;
    elements: CharacterClassElement[];
  }
  /**
   * The character class used in legacy (neither `u` nor `v` flag) and Unicode mode (`u` flag).
   *
   * This character class is guaranteed to **not** contain strings.
   *
   * In Unicode sets mode (`v` flag), {@link UnicodeSetsCharacterClass} is used.
   */
  export interface ClassRangesCharacterClass extends BaseCharacterClass {
    parent: Alternative | Quantifier;
    unicodeSets: false;
    elements: ClassRangesCharacterClassElement[];
  }
  /**
   * The character class used in Unicode sets mode (`v` flag).
   *
   * This character class may contain strings.
   */
  export interface UnicodeSetsCharacterClass extends BaseCharacterClass {
    parent:
      | Alternative
      | ClassIntersection
      | ClassSubtraction
      | Quantifier
      | UnicodeSetsCharacterClass;
    unicodeSets: true;
    elements: UnicodeSetsCharacterClassElement[];
  }
  /**
   * The character class.
   * E.g. `[a-b]`
   */
  export interface CharacterClassRange extends NodeBase {
    type: "CharacterClassRange";
    parent: CharacterClass;
    min: Character;
    max: Character;
  }
  /**
   * The assertion.
   */
  export type Assertion = BoundaryAssertion | LookaroundAssertion;
  /**
   * The boundary assertion.
   */
  export type BoundaryAssertion = EdgeAssertion | WordBoundaryAssertion;
  /**
   * The edge boundary assertion.
   * E.g. `^`, `$`
   */
  export interface EdgeAssertion extends NodeBase {
    type: "Assertion";
    parent: Alternative | Quantifier;
    kind: "end" | "start";
  }
  /**
   * The word bondary assertion.
   * E.g. `\b`, `\B`
   */
  export interface WordBoundaryAssertion extends NodeBase {
    type: "Assertion";
    parent: Alternative | Quantifier;
    kind: "word";
    negate: boolean;
  }
  /**
   * The character set.
   */
  export type CharacterSet =
    | AnyCharacterSet
    | EscapeCharacterSet
    | UnicodePropertyCharacterSet;
  /**
   * The dot.
   * E.g. `.`
   */
  export interface AnyCharacterSet extends NodeBase {
    type: "CharacterSet";
    parent: Alternative | Quantifier;
    kind: "any";
  }
  /**
   * The character class escape.
   * E.g. `\d`, `\s`, `\w`, `\D`, `\S`, `\W`
   */
  export interface EscapeCharacterSet extends NodeBase {
    type: "CharacterSet";
    parent:
      | Alternative
      | CharacterClass
      | ClassIntersection
      | ClassSubtraction
      | Quantifier;
    kind: "digit" | "space" | "word";
    negate: boolean;
  }
  /**
   * The unicode property escape.
   * E.g. `\p{ASCII}`, `\P{ASCII}`, `\p{Script=Hiragana}`
   */
  export type UnicodePropertyCharacterSet =
    | CharacterUnicodePropertyCharacterSet
    | StringsUnicodePropertyCharacterSet;
  interface BaseUnicodePropertyCharacterSet extends NodeBase {
    type: "CharacterSet";
    parent:
      | Alternative
      | CharacterClass
      | ClassIntersection
      | ClassSubtraction
      | Quantifier;
    kind: "property";
    strings: boolean;
    key: string;
    value: string | null;
    negate: boolean;
  }
  export interface CharacterUnicodePropertyCharacterSet
    extends BaseUnicodePropertyCharacterSet {
    strings: false;
    value: string | null;
    negate: boolean;
  }
  /** StringsUnicodePropertyCharacterSet is Unicode property escape with property of strings. */
  export interface StringsUnicodePropertyCharacterSet
    extends BaseUnicodePropertyCharacterSet {
    parent:
      | Alternative
      | ClassIntersection
      | ClassSubtraction
      | Quantifier
      | UnicodeSetsCharacterClass;
    strings: true;
    value: null;
    negate: false;
  }
  /**
   * The expression character class.
   * E.g. `[a--b]`, `[a&&b]`,`[^a--b]`, `[^a&&b]`
   */
  export interface ExpressionCharacterClass extends NodeBase {
    type: "ExpressionCharacterClass";
    parent:
      | Alternative
      | ClassIntersection
      | ClassSubtraction
      | Quantifier
      | UnicodeSetsCharacterClass;
    negate: boolean;
    expression: ClassIntersection | ClassSubtraction;
  }
  export type ClassSetOperand =
    | Character
    | ClassStringDisjunction
    | EscapeCharacterSet
    | ExpressionCharacterClass
    | UnicodePropertyCharacterSet
    | UnicodeSetsCharacterClass;
  /**
   * The character class intersection.
   * E.g. `a&&b`
   */
  export interface ClassIntersection extends NodeBase {
    type: "ClassIntersection";
    parent: ClassIntersection | ExpressionCharacterClass;
    left: ClassIntersection | ClassSetOperand;
    right: ClassSetOperand;
  }
  /**
   * The character class subtraction.
   * E.g. `a--b`
   */
  export interface ClassSubtraction extends NodeBase {
    type: "ClassSubtraction";
    parent: ClassSubtraction | ExpressionCharacterClass;
    left: ClassSetOperand | ClassSubtraction;
    right: ClassSetOperand;
  }
  /**
   * The character class string disjunction.
   * E.g. `\q{a|b}`
   */
  export interface ClassStringDisjunction extends NodeBase {
    type: "ClassStringDisjunction";
    parent: ClassIntersection | ClassSubtraction | UnicodeSetsCharacterClass;
    alternatives: StringAlternative[];
  }
  /** StringAlternative is only used for `\q{alt}`({@link ClassStringDisjunction}). */
  export interface StringAlternative extends NodeBase {
    type: "StringAlternative";
    parent: ClassStringDisjunction;
    elements: Character[];
  }
  /**
   * The character.
   * This includes escape sequences which mean a character.
   * E.g. `a`, `あ`, `✿`, `\x65`, `\u0065`, `\u{65}`, `\/`
   */
  export interface Character extends NodeBase {
    type: "Character";
    parent:
      | Alternative
      | CharacterClass
      | CharacterClassRange
      | ClassIntersection
      | ClassSubtraction
      | Quantifier
      | StringAlternative;
    value: number;
  }
  /**
   * The backreference.
   * E.g. `\1`, `\k<name>`
   */
  export interface Backreference extends NodeBase {
    type: "Backreference";
    parent: Alternative | Quantifier;
    ref: number | string;
    resolved: CapturingGroup;
  }
  /**
   * The flags.
   */
  export interface Flags extends NodeBase {
    type: "Flags";
    parent: RegExpLiteral | null;
    dotAll: boolean;
    global: boolean;
    hasIndices: boolean;
    ignoreCase: boolean;
    multiline: boolean;
    sticky: boolean;
    unicode: boolean;
    unicodeSets: boolean;
  }
  export {};
}

declare module "@eslint-community/regexpp/parser" {
  import type {
    Flags,
    RegExpLiteral,
    Pattern,
  } from "@eslint-community/regexpp/ast";
  import type { EcmaVersion } from "@eslint-community/regexpp/ecma-versions";
  export namespace RegExpParser {
    /**
     * The options for RegExpParser construction.
     */
    interface Options {
      /**
       * The flag to disable Annex B syntax. Default is `false`.
       */
      strict?: boolean;
      /**
       * ECMAScript version. Default is `2024`.
       * - `2015` added `u` and `y` flags.
       * - `2018` added `s` flag, Named Capturing Group, Lookbehind Assertion,
       *   and Unicode Property Escape.
       * - `2019`, `2020`, and `2021` added more valid Unicode Property Escapes.
       * - `2022` added `d` flag.
       * - `2023` added more valid Unicode Property Escapes.
       * - `2024` added `v` flag.
       */
      ecmaVersion?: EcmaVersion;
    }
  }
  export class RegExpParser {
    /**
     * Initialize this parser.
     * @param options The options of parser.
     */
    constructor(options?: RegExpParser.Options);
    /**
     * Parse a regular expression literal. E.g. "/abc/g"
     * @param source The source code to parse.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @returns The AST of the given regular expression.
     */
    parseLiteral(source: string, start?: number, end?: number): RegExpLiteral;
    /**
     * Parse a regular expression flags. E.g. "gim"
     * @param source The source code to parse.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @returns The AST of the given flags.
     */
    parseFlags(source: string, start?: number, end?: number): Flags;
    /**
     * Parse a regular expression pattern. E.g. "abc"
     * @param source The source code to parse.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @param flags The flags.
     * @returns The AST of the given pattern.
     */
    parsePattern(
      source: string,
      start?: number,
      end?: number,
      flags?: {
        unicode?: boolean;
        unicodeSets?: boolean;
      }
    ): Pattern;
    /**
     * @deprecated Backward compatibility
     * Use object `flags` instead of boolean `uFlag`.
     *
     * @param source The source code to parse.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @param uFlag The flag to set unicode mode.
     * @returns The AST of the given pattern.
     */
    parsePattern(
      source: string,
      start?: number,
      end?: number,
      uFlag?: boolean
    ): Pattern;
  }
}

declare module "@eslint-community/regexpp/validator" {
  import type { EcmaVersion } from "@eslint-community/regexpp/ecma-versions";
  export type RegExpValidatorSourceContext = {
    readonly source: string;
    readonly start: number;
    readonly end: number;
    readonly kind: "flags" | "literal" | "pattern";
  };
  export namespace RegExpValidator {
    /**
     * The options for RegExpValidator construction.
     */
    interface Options {
      /**
       * The flag to disable Annex B syntax. Default is `false`.
       */
      strict?: boolean;
      /**
       * ECMAScript version. Default is `2024`.
       * - `2015` added `u` and `y` flags.
       * - `2018` added `s` flag, Named Capturing Group, Lookbehind Assertion,
       *   and Unicode Property Escape.
       * - `2019`, `2020`, and `2021` added more valid Unicode Property Escapes.
       * - `2022` added `d` flag.
       * - `2023` added more valid Unicode Property Escapes.
       * - `2024` added `v` flag.
       */
      ecmaVersion?: EcmaVersion;
      /**
       * A function that is called when the validator entered a RegExp literal.
       * @param start The 0-based index of the first character.
       */
      onLiteralEnter?: (start: number) => void;
      /**
       * A function that is called when the validator left a RegExp literal.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onLiteralLeave?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator found flags.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param flags.global `g` flag.
       * @param flags.ignoreCase `i` flag.
       * @param flags.multiline `m` flag.
       * @param flags.unicode `u` flag.
       * @param flags.sticky `y` flag.
       * @param flags.dotAll `s` flag.
       * @param flags.hasIndices `d` flag.
       * @param flags.unicodeSets `v` flag.
       */
      onRegExpFlags?: (
        start: number,
        end: number,
        flags: {
          global: boolean;
          ignoreCase: boolean;
          multiline: boolean;
          unicode: boolean;
          sticky: boolean;
          dotAll: boolean;
          hasIndices: boolean;
          unicodeSets: boolean;
        }
      ) => void;
      /**
       * A function that is called when the validator found flags.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param global `g` flag.
       * @param ignoreCase `i` flag.
       * @param multiline `m` flag.
       * @param unicode `u` flag.
       * @param sticky `y` flag.
       * @param dotAll `s` flag.
       * @param hasIndices `d` flag.
       *
       * @deprecated Use `onRegExpFlags` instead.
       */
      onFlags?: (
        start: number,
        end: number,
        global: boolean,
        ignoreCase: boolean,
        multiline: boolean,
        unicode: boolean,
        sticky: boolean,
        dotAll: boolean,
        hasIndices: boolean
      ) => void;
      /**
       * A function that is called when the validator entered a pattern.
       * @param start The 0-based index of the first character.
       */
      onPatternEnter?: (start: number) => void;
      /**
       * A function that is called when the validator left a pattern.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onPatternLeave?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator entered a disjunction.
       * @param start The 0-based index of the first character.
       */
      onDisjunctionEnter?: (start: number) => void;
      /**
       * A function that is called when the validator left a disjunction.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onDisjunctionLeave?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator entered an alternative.
       * @param start The 0-based index of the first character.
       * @param index The 0-based index of alternatives in a disjunction.
       */
      onAlternativeEnter?: (start: number, index: number) => void;
      /**
       * A function that is called when the validator left an alternative.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param index The 0-based index of alternatives in a disjunction.
       */
      onAlternativeLeave?: (start: number, end: number, index: number) => void;
      /**
       * A function that is called when the validator entered an uncapturing group.
       * @param start The 0-based index of the first character.
       */
      onGroupEnter?: (start: number) => void;
      /**
       * A function that is called when the validator left an uncapturing group.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onGroupLeave?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator entered a capturing group.
       * @param start The 0-based index of the first character.
       * @param name The group name.
       */
      onCapturingGroupEnter?: (start: number, name: string | null) => void;
      /**
       * A function that is called when the validator left a capturing group.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param name The group name.
       */
      onCapturingGroupLeave?: (
        start: number,
        end: number,
        name: string | null
      ) => void;
      /**
       * A function that is called when the validator found a quantifier.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param min The minimum number of repeating.
       * @param max The maximum number of repeating.
       * @param greedy The flag to choose the longest matching.
       */
      onQuantifier?: (
        start: number,
        end: number,
        min: number,
        max: number,
        greedy: boolean
      ) => void;
      /**
       * A function that is called when the validator entered a lookahead/lookbehind assertion.
       * @param start The 0-based index of the first character.
       * @param kind The kind of the assertion.
       * @param negate The flag which represents that the assertion is negative.
       */
      onLookaroundAssertionEnter?: (
        start: number,
        kind: "lookahead" | "lookbehind",
        negate: boolean
      ) => void;
      /**
       * A function that is called when the validator left a lookahead/lookbehind assertion.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the assertion.
       * @param negate The flag which represents that the assertion is negative.
       */
      onLookaroundAssertionLeave?: (
        start: number,
        end: number,
        kind: "lookahead" | "lookbehind",
        negate: boolean
      ) => void;
      /**
       * A function that is called when the validator found an edge boundary assertion.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the assertion.
       */
      onEdgeAssertion?: (
        start: number,
        end: number,
        kind: "end" | "start"
      ) => void;
      /**
       * A function that is called when the validator found a word boundary assertion.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the assertion.
       * @param negate The flag which represents that the assertion is negative.
       */
      onWordBoundaryAssertion?: (
        start: number,
        end: number,
        kind: "word",
        negate: boolean
      ) => void;
      /**
       * A function that is called when the validator found a dot.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the character set.
       */
      onAnyCharacterSet?: (start: number, end: number, kind: "any") => void;
      /**
       * A function that is called when the validator found a character set escape.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the character set.
       * @param negate The flag which represents that the character set is negative.
       */
      onEscapeCharacterSet?: (
        start: number,
        end: number,
        kind: "digit" | "space" | "word",
        negate: boolean
      ) => void;
      /**
       * A function that is called when the validator found a Unicode proerty escape.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the character set.
       * @param key The property name.
       * @param value The property value.
       * @param negate The flag which represents that the character set is negative.
       * @param strings If true, the given property is property of strings.
       */
      onUnicodePropertyCharacterSet?: (
        start: number,
        end: number,
        kind: "property",
        key: string,
        value: string | null,
        negate: boolean,
        strings: boolean
      ) => void;
      /**
       * A function that is called when the validator found a character.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param value The code point of the character.
       */
      onCharacter?: (start: number, end: number, value: number) => void;
      /**
       * A function that is called when the validator found a backreference.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param ref The key of the referred capturing group.
       */
      onBackreference?: (
        start: number,
        end: number,
        ref: number | string
      ) => void;
      /**
       * A function that is called when the validator entered a character class.
       * @param start The 0-based index of the first character.
       * @param negate The flag which represents that the character class is negative.
       * @param unicodeSets `true` if unicodeSets mode.
       */
      onCharacterClassEnter?: (
        start: number,
        negate: boolean,
        unicodeSets: boolean
      ) => void;
      /**
       * A function that is called when the validator left a character class.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param negate The flag which represents that the character class is negative.
       */
      onCharacterClassLeave?: (
        start: number,
        end: number,
        negate: boolean
      ) => void;
      /**
       * A function that is called when the validator found a character class range.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param min The minimum code point of the range.
       * @param max The maximum code point of the range.
       */
      onCharacterClassRange?: (
        start: number,
        end: number,
        min: number,
        max: number
      ) => void;
      /**
       * A function that is called when the validator found a class intersection.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onClassIntersection?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator found a class subtraction.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onClassSubtraction?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator entered a class string disjunction.
       * @param start The 0-based index of the first character.
       */
      onClassStringDisjunctionEnter?: (start: number) => void;
      /**
       * A function that is called when the validator left a class string disjunction.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onClassStringDisjunctionLeave?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator entered a string alternative.
       * @param start The 0-based index of the first character.
       * @param index The 0-based index of alternatives in a disjunction.
       */
      onStringAlternativeEnter?: (start: number, index: number) => void;
      /**
       * A function that is called when the validator left a string alternative.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param index The 0-based index of alternatives in a disjunction.
       */
      onStringAlternativeLeave?: (
        start: number,
        end: number,
        index: number
      ) => void;
    }
  }
  /**
   * The regular expression validator.
   */
  export class RegExpValidator {
    /**
     * Initialize this validator.
     * @param options The options of validator.
     */
    constructor(options?: RegExpValidator.Options);
    /**
     * Validate a regular expression literal. E.g. "/abc/g"
     * @param source The source code to validate.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     */
    validateLiteral(source: string, start?: number, end?: number): void;
    /**
     * Validate a regular expression flags. E.g. "gim"
     * @param source The source code to validate.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     */
    validateFlags(source: string, start?: number, end?: number): void;
    /**
     * Validate a regular expression pattern. E.g. "abc"
     * @param source The source code to validate.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @param flags The flags.
     */
    validatePattern(
      source: string,
      start?: number,
      end?: number,
      flags?: {
        unicode?: boolean;
        unicodeSets?: boolean;
      }
    ): void;
    /**
     * @deprecated Backward compatibility
     * Use object `flags` instead of boolean `uFlag`.
     * @param source The source code to validate.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @param uFlag The flag to set unicode mode.
     */
    validatePattern(
      source: string,
      start?: number,
      end?: number,
      uFlag?: boolean
    ): void;
  }
}

declare module "@eslint-community/regexpp/visitor" {
  import type {
    Alternative,
    Assertion,
    Backreference,
    CapturingGroup,
    Character,
    CharacterClass,
    CharacterClassRange,
    CharacterSet,
    ClassIntersection,
    ClassStringDisjunction,
    ClassSubtraction,
    ExpressionCharacterClass,
    Flags,
    Group,
    Node,
    Pattern,
    Quantifier,
    RegExpLiteral,
    StringAlternative,
  } from "@eslint-community/regexpp/ast";
  /**
   * The visitor to walk on AST.
   */
  export class RegExpVisitor {
    /**
     * Initialize this visitor.
     * @param handlers Callbacks for each node.
     */
    constructor(handlers: RegExpVisitor.Handlers);
    /**
     * Visit a given node and descendant nodes.
     * @param node The root node to visit tree.
     */
    visit(node: Node): void;
  }
  export namespace RegExpVisitor {
    interface Handlers {
      onAlternativeEnter?: (node: Alternative) => void;
      onAlternativeLeave?: (node: Alternative) => void;
      onAssertionEnter?: (node: Assertion) => void;
      onAssertionLeave?: (node: Assertion) => void;
      onBackreferenceEnter?: (node: Backreference) => void;
      onBackreferenceLeave?: (node: Backreference) => void;
      onCapturingGroupEnter?: (node: CapturingGroup) => void;
      onCapturingGroupLeave?: (node: CapturingGroup) => void;
      onCharacterEnter?: (node: Character) => void;
      onCharacterLeave?: (node: Character) => void;
      onCharacterClassEnter?: (node: CharacterClass) => void;
      onCharacterClassLeave?: (node: CharacterClass) => void;
      onCharacterClassRangeEnter?: (node: CharacterClassRange) => void;
      onCharacterClassRangeLeave?: (node: CharacterClassRange) => void;
      onCharacterSetEnter?: (node: CharacterSet) => void;
      onCharacterSetLeave?: (node: CharacterSet) => void;
      onClassIntersectionEnter?: (node: ClassIntersection) => void;
      onClassIntersectionLeave?: (node: ClassIntersection) => void;
      onClassStringDisjunctionEnter?: (node: ClassStringDisjunction) => void;
      onClassStringDisjunctionLeave?: (node: ClassStringDisjunction) => void;
      onClassSubtractionEnter?: (node: ClassSubtraction) => void;
      onClassSubtractionLeave?: (node: ClassSubtraction) => void;
      onExpressionCharacterClassEnter?: (
        node: ExpressionCharacterClass
      ) => void;
      onExpressionCharacterClassLeave?: (
        node: ExpressionCharacterClass
      ) => void;
      onFlagsEnter?: (node: Flags) => void;
      onFlagsLeave?: (node: Flags) => void;
      onGroupEnter?: (node: Group) => void;
      onGroupLeave?: (node: Group) => void;
      onPatternEnter?: (node: Pattern) => void;
      onPatternLeave?: (node: Pattern) => void;
      onQuantifierEnter?: (node: Quantifier) => void;
      onQuantifierLeave?: (node: Quantifier) => void;
      onRegExpLiteralEnter?: (node: RegExpLiteral) => void;
      onRegExpLiteralLeave?: (node: RegExpLiteral) => void;
      onStringAlternativeEnter?: (node: StringAlternative) => void;
      onStringAlternativeLeave?: (node: StringAlternative) => void;
    }
  }
}

declare module "@eslint-community/regexpp/regexp-syntax-error" {
  import type { RegExpValidatorSourceContext } from "@eslint-community/regexpp/validator";
  export class RegExpSyntaxError extends SyntaxError {
    index: number;
    constructor(message: string, index: number);
  }
  export function newRegExpSyntaxError(
    srcCtx: RegExpValidatorSourceContext,
    flags: {
      unicode: boolean;
      unicodeSets: boolean;
    },
    index: number,
    message: string
  ): RegExpSyntaxError;
}

declare module "@eslint-community/regexpp/ecma-versions" {
  export type EcmaVersion =
    | 5
    | 2015
    | 2016
    | 2017
    | 2018
    | 2019
    | 2020
    | 2021
    | 2022
    | 2023
    | 2024;
  export const latestEcmaVersion = 2024;
}