rbi 0.2.4 → 0.3.2

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.
data/rbi/rbi.rbi ADDED
@@ -0,0 +1,3673 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `rbi` gem.
5
+ # Please instead update this file by running `spoom srb sigs export`.
6
+
7
+ module RBI; end
8
+
9
+ class RBI::Arg < ::RBI::Node
10
+ sig { params(value: ::String, loc: T.nilable(::RBI::Loc)).void }
11
+ def initialize(value, loc: T.unsafe(nil)); end
12
+
13
+ sig { params(other: T.nilable(::Object)).returns(T::Boolean) }
14
+ def ==(other); end
15
+
16
+ sig { returns(::String) }
17
+ def to_s; end
18
+
19
+ sig { returns(::String) }
20
+ def value; end
21
+ end
22
+
23
+ # Attributes
24
+ #
25
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
26
+ class RBI::Attr < ::RBI::NodeWithComments
27
+ include ::RBI::Indexable
28
+
29
+ abstract!
30
+
31
+ sig do
32
+ params(
33
+ name: ::Symbol,
34
+ names: T::Array[::Symbol],
35
+ visibility: ::RBI::Visibility,
36
+ sigs: T::Array[::RBI::Sig],
37
+ loc: T.nilable(::RBI::Loc),
38
+ comments: T::Array[::RBI::Comment]
39
+ ).void
40
+ end
41
+ def initialize(name, names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end
42
+
43
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
44
+ def compatible_with?(other); end
45
+
46
+ # @abstract
47
+ sig { abstract.returns(T::Array[::RBI::Method]) }
48
+ def convert_to_methods; end
49
+
50
+ # @abstract
51
+ sig { abstract.returns(T::Array[::String]) }
52
+ def fully_qualified_names; end
53
+
54
+ sig { override.returns(T::Array[::String]) }
55
+ def index_ids; end
56
+
57
+ sig { override.params(other: ::RBI::Node).void }
58
+ def merge_with(other); end
59
+
60
+ sig { returns(T::Array[::Symbol]) }
61
+ def names; end
62
+
63
+ sig { returns(T::Array[::RBI::Sig]) }
64
+ def sigs; end
65
+
66
+ sig { returns(::RBI::Visibility) }
67
+ def visibility; end
68
+
69
+ # @return [Visibility]
70
+ def visibility=(_arg0); end
71
+
72
+ private
73
+
74
+ sig do
75
+ params(
76
+ name: ::String,
77
+ sig: T.nilable(::RBI::Sig),
78
+ visibility: ::RBI::Visibility,
79
+ loc: T.nilable(::RBI::Loc),
80
+ comments: T::Array[::RBI::Comment]
81
+ ).returns(::RBI::Method)
82
+ end
83
+ def create_getter_method(name, sig, visibility, loc, comments); end
84
+
85
+ sig do
86
+ params(
87
+ name: ::String,
88
+ sig: T.nilable(::RBI::Sig),
89
+ attribute_type: T.nilable(T.any(::RBI::Type, ::String)),
90
+ visibility: ::RBI::Visibility,
91
+ loc: T.nilable(::RBI::Loc),
92
+ comments: T::Array[::RBI::Comment]
93
+ ).returns(::RBI::Method)
94
+ end
95
+ def create_setter_method(name, sig, attribute_type, visibility, loc, comments); end
96
+
97
+ # @raise [UnexpectedMultipleSigsError]
98
+ sig(:final) { returns([T.nilable(::RBI::Sig), T.nilable(T.any(::RBI::Type, ::String))]) }
99
+ def parse_sig; end
100
+ end
101
+
102
+ class RBI::AttrAccessor < ::RBI::Attr
103
+ sig do
104
+ params(
105
+ name: ::Symbol,
106
+ names: ::Symbol,
107
+ visibility: ::RBI::Visibility,
108
+ sigs: T::Array[::RBI::Sig],
109
+ loc: T.nilable(::RBI::Loc),
110
+ comments: T::Array[::RBI::Comment],
111
+ block: T.nilable(T.proc.params(node: ::RBI::AttrAccessor).void)
112
+ ).void
113
+ end
114
+ def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
115
+
116
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
117
+ def compatible_with?(other); end
118
+
119
+ sig { override.returns(T::Array[::RBI::Method]) }
120
+ def convert_to_methods; end
121
+
122
+ sig { override.returns(T::Array[::String]) }
123
+ def fully_qualified_names; end
124
+
125
+ sig { override.returns(::String) }
126
+ def to_s; end
127
+ end
128
+
129
+ class RBI::AttrReader < ::RBI::Attr
130
+ sig do
131
+ params(
132
+ name: ::Symbol,
133
+ names: ::Symbol,
134
+ visibility: ::RBI::Visibility,
135
+ sigs: T::Array[::RBI::Sig],
136
+ loc: T.nilable(::RBI::Loc),
137
+ comments: T::Array[::RBI::Comment],
138
+ block: T.nilable(T.proc.params(node: ::RBI::AttrReader).void)
139
+ ).void
140
+ end
141
+ def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
142
+
143
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
144
+ def compatible_with?(other); end
145
+
146
+ sig { override.returns(T::Array[::RBI::Method]) }
147
+ def convert_to_methods; end
148
+
149
+ sig { override.returns(T::Array[::String]) }
150
+ def fully_qualified_names; end
151
+
152
+ sig { override.returns(::String) }
153
+ def to_s; end
154
+ end
155
+
156
+ class RBI::AttrWriter < ::RBI::Attr
157
+ sig do
158
+ params(
159
+ name: ::Symbol,
160
+ names: ::Symbol,
161
+ visibility: ::RBI::Visibility,
162
+ sigs: T::Array[::RBI::Sig],
163
+ loc: T.nilable(::RBI::Loc),
164
+ comments: T::Array[::RBI::Comment],
165
+ block: T.nilable(T.proc.params(node: ::RBI::AttrWriter).void)
166
+ ).void
167
+ end
168
+ def initialize(name, *names, visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
169
+
170
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
171
+ def compatible_with?(other); end
172
+
173
+ sig { override.returns(T::Array[::RBI::Method]) }
174
+ def convert_to_methods; end
175
+
176
+ sig { override.returns(T::Array[::String]) }
177
+ def fully_qualified_names; end
178
+
179
+ sig { override.returns(::String) }
180
+ def to_s; end
181
+ end
182
+
183
+ # An arbitrary blank line that can be added both in trees and comments
184
+ class RBI::BlankLine < ::RBI::Comment
185
+ sig { params(loc: T.nilable(::RBI::Loc)).void }
186
+ def initialize(loc: T.unsafe(nil)); end
187
+ end
188
+
189
+ class RBI::BlockParam < ::RBI::Param
190
+ sig do
191
+ params(
192
+ name: ::String,
193
+ loc: T.nilable(::RBI::Loc),
194
+ comments: T::Array[::RBI::Comment],
195
+ block: T.nilable(T.proc.params(node: ::RBI::BlockParam).void)
196
+ ).void
197
+ end
198
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
199
+
200
+ sig { params(other: T.nilable(::Object)).returns(T::Boolean) }
201
+ def ==(other); end
202
+
203
+ sig { override.returns(::String) }
204
+ def to_s; end
205
+ end
206
+
207
+ class RBI::Class < ::RBI::Scope
208
+ sig do
209
+ params(
210
+ name: ::String,
211
+ superclass_name: T.nilable(::String),
212
+ loc: T.nilable(::RBI::Loc),
213
+ comments: T::Array[::RBI::Comment],
214
+ block: T.nilable(T.proc.params(node: ::RBI::Class).void)
215
+ ).void
216
+ end
217
+ def initialize(name, superclass_name: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
218
+
219
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
220
+ def compatible_with?(other); end
221
+
222
+ sig { override.returns(::String) }
223
+ def fully_qualified_name; end
224
+
225
+ sig { returns(::String) }
226
+ def name; end
227
+
228
+ # @return [String]
229
+ def name=(_arg0); end
230
+
231
+ sig { returns(T.nilable(::String)) }
232
+ def superclass_name; end
233
+
234
+ # @return [String, nil]
235
+ def superclass_name=(_arg0); end
236
+ end
237
+
238
+ class RBI::Comment < ::RBI::Node
239
+ sig { params(text: ::String, loc: T.nilable(::RBI::Loc)).void }
240
+ def initialize(text, loc: T.unsafe(nil)); end
241
+
242
+ sig { params(other: ::Object).returns(T::Boolean) }
243
+ def ==(other); end
244
+
245
+ sig { returns(::String) }
246
+ def text; end
247
+
248
+ # @return [String]
249
+ def text=(_arg0); end
250
+ end
251
+
252
+ # A tree showing incompatibles nodes
253
+ #
254
+ # Is rendered as a merge conflict between `left` and` right`:
255
+ # ~~~rb
256
+ # class Foo
257
+ # <<<<<<< left
258
+ # def m1; end
259
+ # def m2(a); end
260
+ # =======
261
+ # def m1(a); end
262
+ # def m2; end
263
+ # >>>>>>> right
264
+ # end
265
+ # ~~~
266
+ class RBI::ConflictTree < ::RBI::Tree
267
+ sig { params(left_name: ::String, right_name: ::String).void }
268
+ def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end
269
+
270
+ sig { returns(::RBI::Tree) }
271
+ def left; end
272
+
273
+ sig { returns(::String) }
274
+ def left_name; end
275
+
276
+ # @return [Tree]
277
+ def right; end
278
+
279
+ # @return [String]
280
+ def right_name; end
281
+ end
282
+
283
+ # Consts
284
+ class RBI::Const < ::RBI::NodeWithComments
285
+ include ::RBI::Indexable
286
+
287
+ sig do
288
+ params(
289
+ name: ::String,
290
+ value: ::String,
291
+ loc: T.nilable(::RBI::Loc),
292
+ comments: T::Array[::RBI::Comment],
293
+ block: T.nilable(T.proc.params(node: ::RBI::Const).void)
294
+ ).void
295
+ end
296
+ def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
297
+
298
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
299
+ def compatible_with?(other); end
300
+
301
+ sig { returns(::String) }
302
+ def fully_qualified_name; end
303
+
304
+ sig { override.returns(T::Array[::String]) }
305
+ def index_ids; end
306
+
307
+ sig { returns(::String) }
308
+ def name; end
309
+
310
+ sig { override.returns(::String) }
311
+ def to_s; end
312
+
313
+ # @return [String]
314
+ def value; end
315
+ end
316
+
317
+ class RBI::DuplicateNodeError < ::RBI::Error; end
318
+ class RBI::Error < ::StandardError; end
319
+
320
+ class RBI::Extend < ::RBI::Mixin
321
+ include ::RBI::Indexable
322
+
323
+ sig do
324
+ params(
325
+ name: ::String,
326
+ names: ::String,
327
+ loc: T.nilable(::RBI::Loc),
328
+ comments: T::Array[::RBI::Comment],
329
+ block: T.nilable(T.proc.params(node: ::RBI::Extend).void)
330
+ ).void
331
+ end
332
+ def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
333
+
334
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
335
+ def compatible_with?(other); end
336
+
337
+ sig { override.returns(T::Array[::String]) }
338
+ def index_ids; end
339
+
340
+ sig { override.returns(::String) }
341
+ def to_s; end
342
+ end
343
+
344
+ class RBI::File
345
+ sig do
346
+ params(
347
+ strictness: T.nilable(::String),
348
+ comments: T::Array[::RBI::Comment],
349
+ block: T.nilable(T.proc.params(file: ::RBI::File).void)
350
+ ).void
351
+ end
352
+ def initialize(strictness: T.unsafe(nil), comments: T.unsafe(nil), &block); end
353
+
354
+ sig { params(node: ::RBI::Node).void }
355
+ def <<(node); end
356
+
357
+ sig { returns(T::Array[::RBI::Comment]) }
358
+ def comments; end
359
+
360
+ # @return [Array<Comment>]
361
+ def comments=(_arg0); end
362
+
363
+ sig { returns(T::Boolean) }
364
+ def empty?; end
365
+
366
+ sig do
367
+ params(
368
+ out: T.any(::IO, ::StringIO),
369
+ indent: ::Integer,
370
+ print_locs: T::Boolean,
371
+ max_line_length: T.nilable(::Integer)
372
+ ).void
373
+ end
374
+ def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end
375
+
376
+ sig { params(out: T.any(::IO, ::StringIO), indent: ::Integer, print_locs: T::Boolean).void }
377
+ def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end
378
+
379
+ sig { params(indent: ::Integer, print_locs: T::Boolean).returns(::String) }
380
+ def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end
381
+
382
+ sig { returns(::RBI::Tree) }
383
+ def root; end
384
+
385
+ # @return [Tree]
386
+ def root=(_arg0); end
387
+
388
+ sig { returns(T.nilable(::String)) }
389
+ def strictness; end
390
+
391
+ # @return [String, nil]
392
+ def strictness=(_arg0); end
393
+
394
+ sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) }
395
+ def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end
396
+ end
397
+
398
+ class RBI::Formatter
399
+ sig do
400
+ params(
401
+ add_sig_templates: T::Boolean,
402
+ group_nodes: T::Boolean,
403
+ max_line_length: T.nilable(::Integer),
404
+ nest_singleton_methods: T::Boolean,
405
+ nest_non_public_members: T::Boolean,
406
+ sort_nodes: T::Boolean,
407
+ replace_attributes_with_methods: T::Boolean
408
+ ).void
409
+ end
410
+ def initialize(add_sig_templates: T.unsafe(nil), group_nodes: T.unsafe(nil), max_line_length: T.unsafe(nil), nest_singleton_methods: T.unsafe(nil), nest_non_public_members: T.unsafe(nil), sort_nodes: T.unsafe(nil), replace_attributes_with_methods: T.unsafe(nil)); end
411
+
412
+ sig { params(file: ::RBI::File).void }
413
+ def format_file(file); end
414
+
415
+ sig { params(tree: ::RBI::Tree).void }
416
+ def format_tree(tree); end
417
+
418
+ sig { returns(T.nilable(::Integer)) }
419
+ def max_line_length; end
420
+
421
+ # @return [Integer, nil]
422
+ def max_line_length=(_arg0); end
423
+
424
+ sig { params(file: ::RBI::File).returns(::String) }
425
+ def print_file(file); end
426
+ end
427
+
428
+ class RBI::Group < ::RBI::Tree
429
+ sig { params(kind: ::RBI::Group::Kind).void }
430
+ def initialize(kind); end
431
+
432
+ sig { returns(::RBI::Group::Kind) }
433
+ def kind; end
434
+ end
435
+
436
+ class RBI::Group::Kind < ::T::Enum
437
+ enums do
438
+ Attrs = new
439
+ Consts = new
440
+ Helpers = new
441
+ Inits = new
442
+ Methods = new
443
+ MixesInClassMethods = new
444
+ Mixins = new
445
+ RequiredAncestors = new
446
+ Sends = new
447
+ SingletonClasses = new
448
+ TEnums = new
449
+ TStructFields = new
450
+ TypeMembers = new
451
+ end
452
+ end
453
+
454
+ class RBI::GroupNodesError < ::RBI::Error; end
455
+
456
+ # Sorbet's misc.
457
+ class RBI::Helper < ::RBI::NodeWithComments
458
+ include ::RBI::Indexable
459
+
460
+ sig do
461
+ params(
462
+ name: ::String,
463
+ loc: T.nilable(::RBI::Loc),
464
+ comments: T::Array[::RBI::Comment],
465
+ block: T.nilable(T.proc.params(node: ::RBI::Helper).void)
466
+ ).void
467
+ end
468
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
469
+
470
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
471
+ def compatible_with?(other); end
472
+
473
+ sig { override.returns(T::Array[::String]) }
474
+ def index_ids; end
475
+
476
+ sig { returns(::String) }
477
+ def name; end
478
+
479
+ sig { override.returns(::String) }
480
+ def to_s; end
481
+ end
482
+
483
+ class RBI::Include < ::RBI::Mixin
484
+ include ::RBI::Indexable
485
+
486
+ sig do
487
+ params(
488
+ name: ::String,
489
+ names: ::String,
490
+ loc: T.nilable(::RBI::Loc),
491
+ comments: T::Array[::RBI::Comment],
492
+ block: T.nilable(T.proc.params(node: ::RBI::Include).void)
493
+ ).void
494
+ end
495
+ def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
496
+
497
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
498
+ def compatible_with?(other); end
499
+
500
+ sig { override.returns(T::Array[::String]) }
501
+ def index_ids; end
502
+
503
+ sig { override.returns(::String) }
504
+ def to_s; end
505
+ end
506
+
507
+ class RBI::Index < ::RBI::Visitor
508
+ sig { void }
509
+ def initialize; end
510
+
511
+ sig { params(id: ::String).returns(T::Array[::RBI::Node]) }
512
+ def [](id); end
513
+
514
+ sig { params(nodes: ::RBI::Node).void }
515
+ def index(*nodes); end
516
+
517
+ sig { returns(T::Array[::String]) }
518
+ def keys; end
519
+
520
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
521
+ def visit(node); end
522
+
523
+ private
524
+
525
+ sig { params(node: T.all(::RBI::Indexable, ::RBI::Node)).void }
526
+ def index_node(node); end
527
+
528
+ class << self
529
+ sig { params(node: ::RBI::Node).returns(::RBI::Index) }
530
+ def index(*node); end
531
+ end
532
+ end
533
+
534
+ # A Node that can be referred to by a unique ID inside an index
535
+ #
536
+ # @abstract Subclasses must implement the `abstract` methods below.
537
+ module RBI::Indexable
538
+ interface!
539
+
540
+ # Unique IDs that refer to this node.
541
+ #
542
+ # Some nodes can have multiple ids, for example an attribute accessor matches the ID of the
543
+ # getter and the setter.
544
+ #
545
+ # @abstract
546
+ sig { abstract.returns(T::Array[::String]) }
547
+ def index_ids; end
548
+ end
549
+
550
+ class RBI::KwArg < ::RBI::Arg
551
+ sig { params(keyword: ::String, value: ::String, loc: T.nilable(::RBI::Loc)).void }
552
+ def initialize(keyword, value, loc: T.unsafe(nil)); end
553
+
554
+ sig { params(other: T.nilable(::Object)).returns(T::Boolean) }
555
+ def ==(other); end
556
+
557
+ sig { returns(::String) }
558
+ def keyword; end
559
+
560
+ sig { returns(::String) }
561
+ def to_s; end
562
+ end
563
+
564
+ class RBI::KwOptParam < ::RBI::Param
565
+ sig do
566
+ params(
567
+ name: ::String,
568
+ value: ::String,
569
+ loc: T.nilable(::RBI::Loc),
570
+ comments: T::Array[::RBI::Comment],
571
+ block: T.nilable(T.proc.params(node: ::RBI::KwOptParam).void)
572
+ ).void
573
+ end
574
+ def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
575
+
576
+ sig { params(other: T.nilable(::Object)).returns(T::Boolean) }
577
+ def ==(other); end
578
+
579
+ sig { override.returns(::String) }
580
+ def to_s; end
581
+
582
+ sig { returns(::String) }
583
+ def value; end
584
+ end
585
+
586
+ class RBI::KwParam < ::RBI::Param
587
+ sig do
588
+ params(
589
+ name: ::String,
590
+ loc: T.nilable(::RBI::Loc),
591
+ comments: T::Array[::RBI::Comment],
592
+ block: T.nilable(T.proc.params(node: ::RBI::KwParam).void)
593
+ ).void
594
+ end
595
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
596
+
597
+ sig { params(other: T.nilable(::Object)).returns(T::Boolean) }
598
+ def ==(other); end
599
+
600
+ sig { override.returns(::String) }
601
+ def to_s; end
602
+ end
603
+
604
+ class RBI::KwRestParam < ::RBI::Param
605
+ sig do
606
+ params(
607
+ name: ::String,
608
+ loc: T.nilable(::RBI::Loc),
609
+ comments: T::Array[::RBI::Comment],
610
+ block: T.nilable(T.proc.params(node: ::RBI::KwRestParam).void)
611
+ ).void
612
+ end
613
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
614
+
615
+ sig { params(other: T.nilable(::Object)).returns(T::Boolean) }
616
+ def ==(other); end
617
+
618
+ sig { override.returns(::String) }
619
+ def to_s; end
620
+ end
621
+
622
+ class RBI::Loc
623
+ sig do
624
+ params(
625
+ file: T.nilable(::String),
626
+ begin_line: T.nilable(::Integer),
627
+ end_line: T.nilable(::Integer),
628
+ begin_column: T.nilable(::Integer),
629
+ end_column: T.nilable(::Integer)
630
+ ).void
631
+ end
632
+ def initialize(file: T.unsafe(nil), begin_line: T.unsafe(nil), end_line: T.unsafe(nil), begin_column: T.unsafe(nil), end_column: T.unsafe(nil)); end
633
+
634
+ # @return [Integer, nil]
635
+ def begin_column; end
636
+
637
+ sig { returns(T.nilable(::Integer)) }
638
+ def begin_line; end
639
+
640
+ # @return [Integer, nil]
641
+ def end_column; end
642
+
643
+ # @return [Integer, nil]
644
+ def end_line; end
645
+
646
+ sig { returns(T.nilable(::String)) }
647
+ def file; end
648
+
649
+ sig { returns(T.nilable(::String)) }
650
+ def source; end
651
+
652
+ sig { returns(::String) }
653
+ def to_s; end
654
+
655
+ class << self
656
+ sig { params(file: ::String, prism_location: ::Prism::Location).returns(::RBI::Loc) }
657
+ def from_prism(file, prism_location); end
658
+ end
659
+ end
660
+
661
+ # A tree that _might_ contain conflicts
662
+ class RBI::MergeTree < ::RBI::Tree
663
+ sig do
664
+ params(
665
+ loc: T.nilable(::RBI::Loc),
666
+ comments: T::Array[::RBI::Comment],
667
+ conflicts: T::Array[::RBI::Rewriters::Merge::Conflict],
668
+ block: T.nilable(T.proc.params(node: ::RBI::Tree).void)
669
+ ).void
670
+ end
671
+ def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), conflicts: T.unsafe(nil), &block); end
672
+
673
+ sig { returns(T::Array[::RBI::Rewriters::Merge::Conflict]) }
674
+ def conflicts; end
675
+ end
676
+
677
+ # Methods and args
678
+ class RBI::Method < ::RBI::NodeWithComments
679
+ include ::RBI::Indexable
680
+
681
+ sig do
682
+ params(
683
+ name: ::String,
684
+ params: T::Array[::RBI::Param],
685
+ is_singleton: T::Boolean,
686
+ visibility: ::RBI::Visibility,
687
+ sigs: T::Array[::RBI::Sig],
688
+ loc: T.nilable(::RBI::Loc),
689
+ comments: T::Array[::RBI::Comment],
690
+ block: T.nilable(T.proc.params(node: ::RBI::Method).void)
691
+ ).void
692
+ end
693
+ def initialize(name, params: T.unsafe(nil), is_singleton: T.unsafe(nil), visibility: T.unsafe(nil), sigs: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
694
+
695
+ sig { params(param: ::RBI::Param).void }
696
+ def <<(param); end
697
+
698
+ sig { params(name: ::String).void }
699
+ def add_block_param(name); end
700
+
701
+ sig { params(name: ::String, default_value: ::String).void }
702
+ def add_kw_opt_param(name, default_value); end
703
+
704
+ sig { params(name: ::String).void }
705
+ def add_kw_param(name); end
706
+
707
+ sig { params(name: ::String).void }
708
+ def add_kw_rest_param(name); end
709
+
710
+ sig { params(name: ::String, default_value: ::String).void }
711
+ def add_opt_param(name, default_value); end
712
+
713
+ sig { params(name: ::String).void }
714
+ def add_param(name); end
715
+
716
+ sig { params(name: ::String).void }
717
+ def add_rest_param(name); end
718
+
719
+ sig do
720
+ params(
721
+ params: T::Array[::RBI::SigParam],
722
+ return_type: T.any(::RBI::Type, ::String),
723
+ is_abstract: T::Boolean,
724
+ is_override: T::Boolean,
725
+ is_overridable: T::Boolean,
726
+ is_final: T::Boolean,
727
+ type_params: T::Array[::String],
728
+ checked: T.nilable(::Symbol),
729
+ block: T.nilable(T.proc.params(node: ::RBI::Sig).void)
730
+ ).void
731
+ end
732
+ def add_sig(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), &block); end
733
+
734
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
735
+ def compatible_with?(other); end
736
+
737
+ sig { returns(::String) }
738
+ def fully_qualified_name; end
739
+
740
+ sig { override.returns(T::Array[::String]) }
741
+ def index_ids; end
742
+
743
+ sig { returns(T::Boolean) }
744
+ def is_singleton; end
745
+
746
+ # @return [Boolean]
747
+ def is_singleton=(_arg0); end
748
+
749
+ sig { override.params(other: ::RBI::Node).void }
750
+ def merge_with(other); end
751
+
752
+ sig { returns(::String) }
753
+ def name; end
754
+
755
+ # @return [String]
756
+ def name=(_arg0); end
757
+
758
+ sig { returns(T::Array[::RBI::Param]) }
759
+ def params; end
760
+
761
+ sig { returns(T::Array[::RBI::Sig]) }
762
+ def sigs; end
763
+
764
+ # @return [Array<Sig>]
765
+ def sigs=(_arg0); end
766
+
767
+ sig { override.returns(::String) }
768
+ def to_s; end
769
+
770
+ sig { returns(::RBI::Visibility) }
771
+ def visibility; end
772
+
773
+ # @return [Visibility]
774
+ def visibility=(_arg0); end
775
+ end
776
+
777
+ class RBI::MixesInClassMethods < ::RBI::Mixin
778
+ include ::RBI::Indexable
779
+
780
+ sig do
781
+ params(
782
+ name: ::String,
783
+ names: ::String,
784
+ loc: T.nilable(::RBI::Loc),
785
+ comments: T::Array[::RBI::Comment],
786
+ block: T.nilable(T.proc.params(node: ::RBI::MixesInClassMethods).void)
787
+ ).void
788
+ end
789
+ def initialize(name, *names, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
790
+
791
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
792
+ def compatible_with?(other); end
793
+
794
+ sig { override.returns(T::Array[::String]) }
795
+ def index_ids; end
796
+
797
+ sig { override.returns(::String) }
798
+ def to_s; end
799
+ end
800
+
801
+ # Mixins
802
+ #
803
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
804
+ class RBI::Mixin < ::RBI::NodeWithComments
805
+ abstract!
806
+
807
+ sig do
808
+ params(
809
+ name: ::String,
810
+ names: T::Array[::String],
811
+ loc: T.nilable(::RBI::Loc),
812
+ comments: T::Array[::RBI::Comment]
813
+ ).void
814
+ end
815
+ def initialize(name, names, loc: T.unsafe(nil), comments: T.unsafe(nil)); end
816
+
817
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
818
+ def compatible_with?(other); end
819
+
820
+ sig { returns(T::Array[::String]) }
821
+ def names; end
822
+ end
823
+
824
+ class RBI::Module < ::RBI::Scope
825
+ sig do
826
+ params(
827
+ name: ::String,
828
+ loc: T.nilable(::RBI::Loc),
829
+ comments: T::Array[::RBI::Comment],
830
+ block: T.nilable(T.proc.params(node: ::RBI::Module).void)
831
+ ).void
832
+ end
833
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
834
+
835
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
836
+ def compatible_with?(other); end
837
+
838
+ sig { override.returns(::String) }
839
+ def fully_qualified_name; end
840
+
841
+ sig { returns(::String) }
842
+ def name; end
843
+
844
+ # @return [String]
845
+ def name=(_arg0); end
846
+ end
847
+
848
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
849
+ class RBI::Node
850
+ abstract!
851
+
852
+ sig { params(loc: T.nilable(::RBI::Loc)).void }
853
+ def initialize(loc: T.unsafe(nil)); end
854
+
855
+ # Can `self` and `_other` be merged into a single definition?
856
+ sig { params(_other: ::RBI::Node).returns(T::Boolean) }
857
+ def compatible_with?(_other); end
858
+
859
+ sig { void }
860
+ def detach; end
861
+
862
+ sig { returns(T.nilable(::RBI::Loc)) }
863
+ def loc; end
864
+
865
+ # @return [Loc, nil]
866
+ def loc=(_arg0); end
867
+
868
+ # Merge `self` and `other` into a single definition
869
+ sig { params(other: ::RBI::Node).void }
870
+ def merge_with(other); end
871
+
872
+ sig { returns(T.nilable(::RBI::ConflictTree)) }
873
+ def parent_conflict_tree; end
874
+
875
+ sig { returns(T.nilable(::RBI::Scope)) }
876
+ def parent_scope; end
877
+
878
+ sig { returns(T.nilable(::RBI::Tree)) }
879
+ def parent_tree; end
880
+
881
+ # @return [Tree, nil]
882
+ def parent_tree=(_arg0); end
883
+
884
+ sig do
885
+ params(
886
+ out: T.any(::IO, ::StringIO),
887
+ indent: ::Integer,
888
+ print_locs: T::Boolean,
889
+ max_line_length: T.nilable(::Integer)
890
+ ).void
891
+ end
892
+ def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end
893
+
894
+ sig do
895
+ params(
896
+ out: T.any(::IO, ::StringIO),
897
+ indent: ::Integer,
898
+ print_locs: T::Boolean,
899
+ positional_names: T::Boolean
900
+ ).void
901
+ end
902
+ def rbs_print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil)); end
903
+
904
+ sig { params(indent: ::Integer, print_locs: T::Boolean, positional_names: T::Boolean).returns(::String) }
905
+ def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil)); end
906
+
907
+ # @raise [ReplaceNodeError]
908
+ sig { params(node: ::RBI::Node).void }
909
+ def replace(node); end
910
+
911
+ sig { params(version: ::Gem::Version).returns(T::Boolean) }
912
+ def satisfies_version?(version); end
913
+
914
+ sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) }
915
+ def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end
916
+ end
917
+
918
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
919
+ class RBI::NodeWithComments < ::RBI::Node
920
+ abstract!
921
+
922
+ sig { params(loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void }
923
+ def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil)); end
924
+
925
+ sig { returns(T::Array[::String]) }
926
+ def annotations; end
927
+
928
+ sig { returns(T::Array[::RBI::Comment]) }
929
+ def comments; end
930
+
931
+ # @return [Array<Comment>]
932
+ def comments=(_arg0); end
933
+
934
+ sig { override.params(other: ::RBI::Node).void }
935
+ def merge_with(other); end
936
+
937
+ sig { returns(T::Array[::Gem::Requirement]) }
938
+ def version_requirements; end
939
+ end
940
+
941
+ class RBI::OptParam < ::RBI::Param
942
+ sig do
943
+ params(
944
+ name: ::String,
945
+ value: ::String,
946
+ loc: T.nilable(::RBI::Loc),
947
+ comments: T::Array[::RBI::Comment],
948
+ block: T.nilable(T.proc.params(node: ::RBI::OptParam).void)
949
+ ).void
950
+ end
951
+ def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
952
+
953
+ sig { params(other: T.nilable(::Object)).returns(T::Boolean) }
954
+ def ==(other); end
955
+
956
+ sig { returns(::String) }
957
+ def value; end
958
+ end
959
+
960
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
961
+ class RBI::Param < ::RBI::NodeWithComments
962
+ abstract!
963
+
964
+ sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void }
965
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end
966
+
967
+ sig { returns(::String) }
968
+ def name; end
969
+
970
+ sig { override.returns(::String) }
971
+ def to_s; end
972
+ end
973
+
974
+ class RBI::ParseError < ::RBI::Error
975
+ sig { params(message: ::String, location: ::RBI::Loc).void }
976
+ def initialize(message, location); end
977
+
978
+ sig { returns(::RBI::Loc) }
979
+ def location; end
980
+ end
981
+
982
+ class RBI::Parser
983
+ sig { params(path: ::String).returns(::RBI::Tree) }
984
+ def parse_file(path); end
985
+
986
+ sig { params(string: ::String).returns(::RBI::Tree) }
987
+ def parse_string(string); end
988
+
989
+ private
990
+
991
+ sig { params(source: ::String, file: ::String).returns(::RBI::Tree) }
992
+ def parse(source, file:); end
993
+
994
+ class << self
995
+ sig { params(path: ::String).returns(::RBI::Tree) }
996
+ def parse_file(path); end
997
+
998
+ sig { params(paths: T::Array[::String]).returns(T::Array[::RBI::Tree]) }
999
+ def parse_files(paths); end
1000
+
1001
+ sig { params(string: ::String).returns(::RBI::Tree) }
1002
+ def parse_string(string); end
1003
+
1004
+ sig { params(strings: T::Array[::String]).returns(T::Array[::RBI::Tree]) }
1005
+ def parse_strings(strings); end
1006
+ end
1007
+ end
1008
+
1009
+ class RBI::Parser::HeredocLocationVisitor < ::Prism::Visitor
1010
+ sig { params(source: ::Prism::Source, begin_offset: ::Integer, end_offset: ::Integer).void }
1011
+ def initialize(source, begin_offset, end_offset); end
1012
+
1013
+ sig { returns(::Prism::Location) }
1014
+ def location; end
1015
+
1016
+ sig { params(node: ::Prism::InterpolatedStringNode).void }
1017
+ def visit_interpolated_string_node(node); end
1018
+
1019
+ sig { params(node: ::Prism::StringNode).void }
1020
+ def visit_string_node(node); end
1021
+
1022
+ private
1023
+
1024
+ sig { params(node: T.any(::Prism::InterpolatedStringNode, ::Prism::StringNode)).void }
1025
+ def handle_string_node(node); end
1026
+ end
1027
+
1028
+ class RBI::Parser::SigBuilder < ::RBI::Parser::Visitor
1029
+ sig { params(content: ::String, file: ::String).void }
1030
+ def initialize(content, file:); end
1031
+
1032
+ sig { returns(::RBI::Sig) }
1033
+ def current; end
1034
+
1035
+ sig { override.params(node: ::Prism::AssocNode).void }
1036
+ def visit_assoc_node(node); end
1037
+
1038
+ sig { override.params(node: ::Prism::CallNode).void }
1039
+ def visit_call_node(node); end
1040
+ end
1041
+
1042
+ class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor
1043
+ sig { params(source: ::String, comments: T::Array[::Prism::Comment], file: ::String).void }
1044
+ def initialize(source, comments:, file:); end
1045
+
1046
+ sig { returns(T.nilable(::Prism::Node)) }
1047
+ def last_node; end
1048
+
1049
+ sig { returns(::RBI::Tree) }
1050
+ def tree; end
1051
+
1052
+ sig { params(node: ::Prism::CallNode).void }
1053
+ def visit_call_node(node); end
1054
+
1055
+ sig { override.params(node: ::Prism::ClassNode).void }
1056
+ def visit_class_node(node); end
1057
+
1058
+ sig { params(node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode)).void }
1059
+ def visit_constant_assign(node); end
1060
+
1061
+ sig { override.params(node: ::Prism::ConstantPathWriteNode).void }
1062
+ def visit_constant_path_write_node(node); end
1063
+
1064
+ sig { override.params(node: ::Prism::ConstantWriteNode).void }
1065
+ def visit_constant_write_node(node); end
1066
+
1067
+ sig { override.params(node: ::Prism::DefNode).void }
1068
+ def visit_def_node(node); end
1069
+
1070
+ sig { override.params(node: ::Prism::ModuleNode).void }
1071
+ def visit_module_node(node); end
1072
+
1073
+ sig { override.params(node: ::Prism::ProgramNode).void }
1074
+ def visit_program_node(node); end
1075
+
1076
+ sig { override.params(node: ::Prism::SingletonClassNode).void }
1077
+ def visit_singleton_class_node(node); end
1078
+
1079
+ private
1080
+
1081
+ # Collect all the remaining comments within a node
1082
+ sig { params(node: ::Prism::Node).void }
1083
+ def collect_dangling_comments(node); end
1084
+
1085
+ # Collect all the remaining comments after visiting the tree
1086
+ sig { void }
1087
+ def collect_orphan_comments; end
1088
+
1089
+ sig { returns(::RBI::Tree) }
1090
+ def current_scope; end
1091
+
1092
+ sig { returns(T::Array[::RBI::Sig]) }
1093
+ def current_sigs; end
1094
+
1095
+ sig { params(sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Comment]) }
1096
+ def detach_comments_from_sigs(sigs); end
1097
+
1098
+ sig { params(node: ::Prism::Node).returns(T::Array[::RBI::Comment]) }
1099
+ def node_comments(node); end
1100
+
1101
+ sig { params(node: ::Prism::Comment).returns(::RBI::Comment) }
1102
+ def parse_comment(node); end
1103
+
1104
+ sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Param]) }
1105
+ def parse_params(node); end
1106
+
1107
+ sig { params(node: T.nilable(::Prism::Node)).returns(T::Array[::RBI::Arg]) }
1108
+ def parse_send_args(node); end
1109
+
1110
+ sig { params(node: ::Prism::CallNode).returns(::RBI::Sig) }
1111
+ def parse_sig(node); end
1112
+
1113
+ sig do
1114
+ params(
1115
+ node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode)
1116
+ ).returns(T.nilable(::RBI::Struct))
1117
+ end
1118
+ def parse_struct(node); end
1119
+
1120
+ sig { params(send: ::Prism::CallNode).void }
1121
+ def parse_tstruct_field(send); end
1122
+
1123
+ sig { params(name: ::String, node: ::Prism::Node).returns(::RBI::Visibility) }
1124
+ def parse_visibility(name, node); end
1125
+
1126
+ sig { void }
1127
+ def separate_header_comments; end
1128
+
1129
+ sig { void }
1130
+ def set_root_tree_loc; end
1131
+
1132
+ sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) }
1133
+ def t_enum_value?(node); end
1134
+
1135
+ sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) }
1136
+ def type_variable_definition?(node); end
1137
+ end
1138
+
1139
+ class RBI::Parser::Visitor < ::Prism::Visitor
1140
+ sig { params(source: ::String, file: ::String).void }
1141
+ def initialize(source, file:); end
1142
+
1143
+ private
1144
+
1145
+ sig { params(node: ::Prism::Node).returns(::Prism::Location) }
1146
+ def adjust_prism_location_for_heredoc(node); end
1147
+
1148
+ sig { params(node: ::Prism::Node).returns(::RBI::Loc) }
1149
+ def node_loc(node); end
1150
+
1151
+ sig { params(node: T.nilable(::Prism::Node)).returns(T.nilable(::String)) }
1152
+ def node_string(node); end
1153
+
1154
+ sig { params(node: ::Prism::Node).returns(::String) }
1155
+ def node_string!(node); end
1156
+ end
1157
+
1158
+ class RBI::Printer < ::RBI::Visitor
1159
+ sig do
1160
+ params(
1161
+ out: T.any(::IO, ::StringIO),
1162
+ indent: ::Integer,
1163
+ print_locs: T::Boolean,
1164
+ max_line_length: T.nilable(::Integer)
1165
+ ).void
1166
+ end
1167
+ def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end
1168
+
1169
+ sig { returns(::Integer) }
1170
+ def current_indent; end
1171
+
1172
+ sig { void }
1173
+ def dedent; end
1174
+
1175
+ # @return [Boolean]
1176
+ def in_visibility_group; end
1177
+
1178
+ # @return [Boolean]
1179
+ def in_visibility_group=(_arg0); end
1180
+
1181
+ # Printing
1182
+ sig { void }
1183
+ def indent; end
1184
+
1185
+ sig { returns(T.nilable(::Integer)) }
1186
+ def max_line_length; end
1187
+
1188
+ sig { returns(T.nilable(::RBI::Node)) }
1189
+ def previous_node; end
1190
+
1191
+ # Print a string without indentation nor `\n` at the end.
1192
+ sig { params(string: ::String).void }
1193
+ def print(string); end
1194
+
1195
+ sig { returns(T::Boolean) }
1196
+ def print_locs; end
1197
+
1198
+ # @return [Boolean]
1199
+ def print_locs=(_arg0); end
1200
+
1201
+ # Print a string with indentation and `\n` at the end.
1202
+ sig { params(string: ::String).void }
1203
+ def printl(string); end
1204
+
1205
+ # Print a string without indentation but with a `\n` at the end.
1206
+ sig { params(string: T.nilable(::String)).void }
1207
+ def printn(string = T.unsafe(nil)); end
1208
+
1209
+ # Print a string with indentation but without a `\n` at the end.
1210
+ sig { params(string: T.nilable(::String)).void }
1211
+ def printt(string = T.unsafe(nil)); end
1212
+
1213
+ sig { override.params(nodes: T::Array[::RBI::Node]).void }
1214
+ def visit_all(nodes); end
1215
+
1216
+ sig { override.params(file: ::RBI::File).void }
1217
+ def visit_file(file); end
1218
+
1219
+ private
1220
+
1221
+ sig { params(node: ::RBI::Node).returns(T::Boolean) }
1222
+ def oneline?(node); end
1223
+
1224
+ sig { params(node: ::RBI::Node).void }
1225
+ def print_blank_line_before(node); end
1226
+
1227
+ sig { params(node: ::RBI::Node).void }
1228
+ def print_loc(node); end
1229
+
1230
+ sig { params(node: ::RBI::Param, last: T::Boolean).void }
1231
+ def print_param_comment_leading_space(node, last:); end
1232
+
1233
+ sig { params(node: ::RBI::Sig).void }
1234
+ def print_sig_as_block(node); end
1235
+
1236
+ sig { params(node: ::RBI::Sig).void }
1237
+ def print_sig_as_line(node); end
1238
+
1239
+ sig { params(node: ::RBI::SigParam, last: T::Boolean).void }
1240
+ def print_sig_param_comment_leading_space(node, last:); end
1241
+
1242
+ sig { params(node: ::RBI::Sig).returns(T::Array[::String]) }
1243
+ def sig_modifiers(node); end
1244
+
1245
+ sig { override.params(node: ::RBI::Arg).void }
1246
+ def visit_arg(node); end
1247
+
1248
+ sig { params(node: ::RBI::Attr).void }
1249
+ def visit_attr(node); end
1250
+
1251
+ sig { override.params(node: ::RBI::AttrAccessor).void }
1252
+ def visit_attr_accessor(node); end
1253
+
1254
+ sig { override.params(node: ::RBI::AttrReader).void }
1255
+ def visit_attr_reader(node); end
1256
+
1257
+ sig { override.params(node: ::RBI::AttrWriter).void }
1258
+ def visit_attr_writer(node); end
1259
+
1260
+ sig { override.params(node: ::RBI::BlankLine).void }
1261
+ def visit_blank_line(node); end
1262
+
1263
+ sig { override.params(node: ::RBI::BlockParam).void }
1264
+ def visit_block_param(node); end
1265
+
1266
+ sig { override.params(node: ::RBI::Class).void }
1267
+ def visit_class(node); end
1268
+
1269
+ sig { override.params(node: ::RBI::Comment).void }
1270
+ def visit_comment(node); end
1271
+
1272
+ sig { override.params(node: ::RBI::ConflictTree).void }
1273
+ def visit_conflict_tree(node); end
1274
+
1275
+ sig { override.params(node: ::RBI::Const).void }
1276
+ def visit_const(node); end
1277
+
1278
+ sig { override.params(node: ::RBI::Extend).void }
1279
+ def visit_extend(node); end
1280
+
1281
+ sig { override.params(node: ::RBI::Group).void }
1282
+ def visit_group(node); end
1283
+
1284
+ sig { override.params(node: ::RBI::Helper).void }
1285
+ def visit_helper(node); end
1286
+
1287
+ sig { override.params(node: ::RBI::Include).void }
1288
+ def visit_include(node); end
1289
+
1290
+ sig { override.params(node: ::RBI::KwArg).void }
1291
+ def visit_kw_arg(node); end
1292
+
1293
+ sig { override.params(node: ::RBI::KwOptParam).void }
1294
+ def visit_kw_opt_param(node); end
1295
+
1296
+ sig { override.params(node: ::RBI::KwParam).void }
1297
+ def visit_kw_param(node); end
1298
+
1299
+ sig { override.params(node: ::RBI::KwRestParam).void }
1300
+ def visit_kw_rest_param(node); end
1301
+
1302
+ sig { override.params(node: ::RBI::Method).void }
1303
+ def visit_method(node); end
1304
+
1305
+ sig { override.params(node: ::RBI::MixesInClassMethods).void }
1306
+ def visit_mixes_in_class_methods(node); end
1307
+
1308
+ sig { params(node: ::RBI::Mixin).void }
1309
+ def visit_mixin(node); end
1310
+
1311
+ sig { override.params(node: ::RBI::Module).void }
1312
+ def visit_module(node); end
1313
+
1314
+ sig { override.params(node: ::RBI::OptParam).void }
1315
+ def visit_opt_param(node); end
1316
+
1317
+ sig { override.params(node: ::RBI::Private).void }
1318
+ def visit_private(node); end
1319
+
1320
+ sig { override.params(node: ::RBI::Protected).void }
1321
+ def visit_protected(node); end
1322
+
1323
+ sig { override.params(node: ::RBI::Public).void }
1324
+ def visit_public(node); end
1325
+
1326
+ sig { override.params(node: ::RBI::RBSComment).void }
1327
+ def visit_rbs_comment(node); end
1328
+
1329
+ sig { override.params(node: ::RBI::ReqParam).void }
1330
+ def visit_req_param(node); end
1331
+
1332
+ sig { override.params(node: ::RBI::RequiresAncestor).void }
1333
+ def visit_requires_ancestor(node); end
1334
+
1335
+ sig { override.params(node: ::RBI::RestParam).void }
1336
+ def visit_rest_param(node); end
1337
+
1338
+ sig { params(node: ::RBI::Scope).void }
1339
+ def visit_scope(node); end
1340
+
1341
+ sig { params(node: ::RBI::Scope).void }
1342
+ def visit_scope_body(node); end
1343
+
1344
+ sig { override.params(node: ::RBI::ScopeConflict).void }
1345
+ def visit_scope_conflict(node); end
1346
+
1347
+ sig { params(node: ::RBI::Scope).void }
1348
+ def visit_scope_header(node); end
1349
+
1350
+ sig { override.params(node: ::RBI::Send).void }
1351
+ def visit_send(node); end
1352
+
1353
+ sig { override.params(node: ::RBI::Sig).void }
1354
+ def visit_sig(node); end
1355
+
1356
+ sig { override.params(node: ::RBI::SigParam).void }
1357
+ def visit_sig_param(node); end
1358
+
1359
+ sig { override.params(node: ::RBI::SingletonClass).void }
1360
+ def visit_singleton_class(node); end
1361
+
1362
+ sig { override.params(node: ::RBI::Struct).void }
1363
+ def visit_struct(node); end
1364
+
1365
+ sig { params(node: ::RBI::TStructField).void }
1366
+ def visit_t_struct_field(node); end
1367
+
1368
+ sig { override.params(node: ::RBI::TEnum).void }
1369
+ def visit_tenum(node); end
1370
+
1371
+ sig { override.params(node: ::RBI::TEnumBlock).void }
1372
+ def visit_tenum_block(node); end
1373
+
1374
+ sig { override.params(node: ::RBI::TEnumValue).void }
1375
+ def visit_tenum_value(node); end
1376
+
1377
+ sig { override.params(node: ::RBI::Tree).void }
1378
+ def visit_tree(node); end
1379
+
1380
+ sig { override.params(node: ::RBI::TStruct).void }
1381
+ def visit_tstruct(node); end
1382
+
1383
+ sig { override.params(node: ::RBI::TStructConst).void }
1384
+ def visit_tstruct_const(node); end
1385
+
1386
+ sig { override.params(node: ::RBI::TStructProp).void }
1387
+ def visit_tstruct_prop(node); end
1388
+
1389
+ sig { override.params(node: ::RBI::TypeMember).void }
1390
+ def visit_type_member(node); end
1391
+
1392
+ sig { params(node: ::RBI::Visibility).void }
1393
+ def visit_visibility(node); end
1394
+
1395
+ sig { override.params(node: ::RBI::VisibilityGroup).void }
1396
+ def visit_visibility_group(node); end
1397
+ end
1398
+
1399
+ class RBI::PrinterError < ::RBI::Error; end
1400
+
1401
+ class RBI::Private < ::RBI::Visibility
1402
+ sig do
1403
+ params(
1404
+ loc: T.nilable(::RBI::Loc),
1405
+ comments: T::Array[::RBI::Comment],
1406
+ block: T.nilable(T.proc.params(node: ::RBI::Private).void)
1407
+ ).void
1408
+ end
1409
+ def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
1410
+ end
1411
+
1412
+ class RBI::Protected < ::RBI::Visibility
1413
+ sig do
1414
+ params(
1415
+ loc: T.nilable(::RBI::Loc),
1416
+ comments: T::Array[::RBI::Comment],
1417
+ block: T.nilable(T.proc.params(node: ::RBI::Protected).void)
1418
+ ).void
1419
+ end
1420
+ def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
1421
+ end
1422
+
1423
+ class RBI::Public < ::RBI::Visibility
1424
+ sig do
1425
+ params(
1426
+ loc: T.nilable(::RBI::Loc),
1427
+ comments: T::Array[::RBI::Comment],
1428
+ block: T.nilable(T.proc.params(node: ::RBI::Public).void)
1429
+ ).void
1430
+ end
1431
+ def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
1432
+ end
1433
+
1434
+ module RBI::RBS; end
1435
+
1436
+ class RBI::RBS::MethodTypeTranslator
1437
+ sig { params(method: ::RBI::Method).void }
1438
+ def initialize(method); end
1439
+
1440
+ sig { returns(::RBI::Sig) }
1441
+ def result; end
1442
+
1443
+ sig { params(type: ::RBS::MethodType).void }
1444
+ def visit(type); end
1445
+
1446
+ private
1447
+
1448
+ sig { params(param: ::RBS::Types::Function::Param, index: ::Integer).returns(::RBI::SigParam) }
1449
+ def translate_function_param(param, index); end
1450
+
1451
+ sig { params(type: T.untyped).returns(::RBI::Type) }
1452
+ def translate_type(type); end
1453
+
1454
+ # @raise [Error]
1455
+ sig { params(type: ::RBS::Types::Block).void }
1456
+ def visit_block_type(type); end
1457
+
1458
+ sig { params(type: ::RBS::Types::Function).void }
1459
+ def visit_function_type(type); end
1460
+
1461
+ class << self
1462
+ sig { params(method: ::RBI::Method, type: ::RBS::MethodType).returns(::RBI::Sig) }
1463
+ def translate(method, type); end
1464
+ end
1465
+ end
1466
+
1467
+ class RBI::RBS::MethodTypeTranslator::Error < ::RBI::Error; end
1468
+
1469
+ class RBI::RBS::TypeTranslator
1470
+ class << self
1471
+ sig do
1472
+ params(
1473
+ type: T.any(::RBS::Types::Alias, ::RBS::Types::Bases::Any, ::RBS::Types::Bases::Bool, ::RBS::Types::Bases::Bottom, ::RBS::Types::Bases::Class, ::RBS::Types::Bases::Instance, ::RBS::Types::Bases::Nil, ::RBS::Types::Bases::Self, ::RBS::Types::Bases::Top, ::RBS::Types::Bases::Void, ::RBS::Types::ClassInstance, ::RBS::Types::ClassSingleton, ::RBS::Types::Function, ::RBS::Types::Interface, ::RBS::Types::Intersection, ::RBS::Types::Literal, ::RBS::Types::Optional, ::RBS::Types::Proc, ::RBS::Types::Record, ::RBS::Types::Tuple, ::RBS::Types::Union, ::RBS::Types::UntypedFunction, ::RBS::Types::Variable)
1474
+ ).returns(::RBI::Type)
1475
+ end
1476
+ def translate(type); end
1477
+
1478
+ private
1479
+
1480
+ sig { params(type: ::RBS::Types::ClassInstance).returns(::RBI::Type) }
1481
+ def translate_class_instance(type); end
1482
+
1483
+ sig { params(type: ::RBS::Types::Function).returns(::RBI::Type) }
1484
+ def translate_function(type); end
1485
+
1486
+ sig { params(type_name: ::String).returns(::String) }
1487
+ def translate_t_generic_type(type_name); end
1488
+ end
1489
+ end
1490
+
1491
+ # A comment representing a RBS type prefixed with `#:`
1492
+ class RBI::RBSComment < ::RBI::Comment
1493
+ sig { params(other: ::Object).returns(T::Boolean) }
1494
+ def ==(other); end
1495
+ end
1496
+
1497
+ class RBI::RBSPrinter < ::RBI::Visitor
1498
+ sig do
1499
+ params(
1500
+ out: T.any(::IO, ::StringIO),
1501
+ indent: ::Integer,
1502
+ print_locs: T::Boolean,
1503
+ positional_names: T::Boolean
1504
+ ).void
1505
+ end
1506
+ def initialize(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil)); end
1507
+
1508
+ sig { returns(::Integer) }
1509
+ def current_indent; end
1510
+
1511
+ sig { void }
1512
+ def dedent; end
1513
+
1514
+ # @return [Boolean]
1515
+ def in_visibility_group; end
1516
+
1517
+ # @return [Boolean]
1518
+ def in_visibility_group=(_arg0); end
1519
+
1520
+ # Printing
1521
+ sig { void }
1522
+ def indent; end
1523
+
1524
+ sig { returns(T::Boolean) }
1525
+ def positional_names; end
1526
+
1527
+ # @return [Boolean]
1528
+ def positional_names=(_arg0); end
1529
+
1530
+ sig { returns(T.nilable(::RBI::Node)) }
1531
+ def previous_node; end
1532
+
1533
+ # Print a string without indentation nor `\n` at the end.
1534
+ sig { params(string: ::String).void }
1535
+ def print(string); end
1536
+
1537
+ sig { params(node: ::RBI::Attr, sig: ::RBI::Sig).void }
1538
+ def print_attr_sig(node, sig); end
1539
+
1540
+ sig { returns(T::Boolean) }
1541
+ def print_locs; end
1542
+
1543
+ # @return [Boolean]
1544
+ def print_locs=(_arg0); end
1545
+
1546
+ sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void }
1547
+ def print_method_sig(node, sig); end
1548
+
1549
+ # Print a string with indentation and `\n` at the end.
1550
+ sig { params(string: ::String).void }
1551
+ def printl(string); end
1552
+
1553
+ # Print a string without indentation but with a `\n` at the end.
1554
+ sig { params(string: T.nilable(::String)).void }
1555
+ def printn(string = T.unsafe(nil)); end
1556
+
1557
+ # Print a string with indentation but without a `\n` at the end.
1558
+ sig { params(string: T.nilable(::String)).void }
1559
+ def printt(string = T.unsafe(nil)); end
1560
+
1561
+ sig { override.params(nodes: T::Array[::RBI::Node]).void }
1562
+ def visit_all(nodes); end
1563
+
1564
+ sig { override.params(node: ::RBI::Arg).void }
1565
+ def visit_arg(node); end
1566
+
1567
+ sig { params(node: ::RBI::Attr).void }
1568
+ def visit_attr(node); end
1569
+
1570
+ sig { override.params(node: ::RBI::AttrAccessor).void }
1571
+ def visit_attr_accessor(node); end
1572
+
1573
+ sig { override.params(node: ::RBI::AttrReader).void }
1574
+ def visit_attr_reader(node); end
1575
+
1576
+ sig { override.params(node: ::RBI::AttrWriter).void }
1577
+ def visit_attr_writer(node); end
1578
+
1579
+ sig { override.params(node: ::RBI::BlankLine).void }
1580
+ def visit_blank_line(node); end
1581
+
1582
+ sig { override.params(node: ::RBI::BlockParam).void }
1583
+ def visit_block_param(node); end
1584
+
1585
+ sig { override.params(node: ::RBI::Class).void }
1586
+ def visit_class(node); end
1587
+
1588
+ sig { override.params(node: ::RBI::Comment).void }
1589
+ def visit_comment(node); end
1590
+
1591
+ sig { override.params(node: ::RBI::ConflictTree).void }
1592
+ def visit_conflict_tree(node); end
1593
+
1594
+ sig { override.params(node: ::RBI::Const).void }
1595
+ def visit_const(node); end
1596
+
1597
+ sig { override.params(node: ::RBI::Extend).void }
1598
+ def visit_extend(node); end
1599
+
1600
+ sig { override.params(file: ::RBI::File).void }
1601
+ def visit_file(file); end
1602
+
1603
+ sig { override.params(node: ::RBI::Group).void }
1604
+ def visit_group(node); end
1605
+
1606
+ sig { override.params(node: ::RBI::Helper).void }
1607
+ def visit_helper(node); end
1608
+
1609
+ sig { override.params(node: ::RBI::Include).void }
1610
+ def visit_include(node); end
1611
+
1612
+ sig { override.params(node: ::RBI::KwArg).void }
1613
+ def visit_kw_arg(node); end
1614
+
1615
+ sig { override.params(node: ::RBI::KwOptParam).void }
1616
+ def visit_kw_opt_param(node); end
1617
+
1618
+ sig { override.params(node: ::RBI::KwParam).void }
1619
+ def visit_kw_param(node); end
1620
+
1621
+ sig { override.params(node: ::RBI::KwRestParam).void }
1622
+ def visit_kw_rest_param(node); end
1623
+
1624
+ sig { override.params(node: ::RBI::Method).void }
1625
+ def visit_method(node); end
1626
+
1627
+ sig { override.params(node: ::RBI::MixesInClassMethods).void }
1628
+ def visit_mixes_in_class_methods(node); end
1629
+
1630
+ sig { params(node: ::RBI::Mixin).void }
1631
+ def visit_mixin(node); end
1632
+
1633
+ sig { override.params(node: ::RBI::Module).void }
1634
+ def visit_module(node); end
1635
+
1636
+ sig { override.params(node: ::RBI::OptParam).void }
1637
+ def visit_opt_param(node); end
1638
+
1639
+ sig { override.params(node: ::RBI::Private).void }
1640
+ def visit_private(node); end
1641
+
1642
+ sig { override.params(node: ::RBI::Protected).void }
1643
+ def visit_protected(node); end
1644
+
1645
+ sig { override.params(node: ::RBI::Public).void }
1646
+ def visit_public(node); end
1647
+
1648
+ sig { override.params(node: ::RBI::ReqParam).void }
1649
+ def visit_req_param(node); end
1650
+
1651
+ sig { override.params(node: ::RBI::RequiresAncestor).void }
1652
+ def visit_requires_ancestor(node); end
1653
+
1654
+ sig { override.params(node: ::RBI::RestParam).void }
1655
+ def visit_rest_param(node); end
1656
+
1657
+ sig { params(node: ::RBI::Scope).void }
1658
+ def visit_scope(node); end
1659
+
1660
+ sig { params(node: ::RBI::Scope).void }
1661
+ def visit_scope_body(node); end
1662
+
1663
+ sig { override.params(node: ::RBI::ScopeConflict).void }
1664
+ def visit_scope_conflict(node); end
1665
+
1666
+ sig { params(node: ::RBI::Scope).void }
1667
+ def visit_scope_header(node); end
1668
+
1669
+ sig { override.params(node: ::RBI::Send).void }
1670
+ def visit_send(node); end
1671
+
1672
+ sig { params(node: ::RBI::Sig).void }
1673
+ def visit_sig(node); end
1674
+
1675
+ sig { params(node: ::RBI::SigParam).void }
1676
+ def visit_sig_param(node); end
1677
+
1678
+ sig { override.params(node: ::RBI::SingletonClass).void }
1679
+ def visit_singleton_class(node); end
1680
+
1681
+ sig { override.params(node: ::RBI::Struct).void }
1682
+ def visit_struct(node); end
1683
+
1684
+ sig { override.params(node: ::RBI::TEnum).void }
1685
+ def visit_tenum(node); end
1686
+
1687
+ sig { override.params(node: ::RBI::TEnumBlock).void }
1688
+ def visit_tenum_block(node); end
1689
+
1690
+ sig { override.params(node: ::RBI::TEnumValue).void }
1691
+ def visit_tenum_value(node); end
1692
+
1693
+ sig { override.params(node: ::RBI::Tree).void }
1694
+ def visit_tree(node); end
1695
+
1696
+ sig { override.params(node: ::RBI::TStruct).void }
1697
+ def visit_tstruct(node); end
1698
+
1699
+ sig { override.params(node: ::RBI::TStructConst).void }
1700
+ def visit_tstruct_const(node); end
1701
+
1702
+ sig { override.params(node: ::RBI::TStructProp).void }
1703
+ def visit_tstruct_prop(node); end
1704
+
1705
+ sig { override.params(node: ::RBI::TypeMember).void }
1706
+ def visit_type_member(node); end
1707
+
1708
+ sig { params(node: ::RBI::Visibility).void }
1709
+ def visit_visibility(node); end
1710
+
1711
+ sig { override.params(node: ::RBI::VisibilityGroup).void }
1712
+ def visit_visibility_group(node); end
1713
+
1714
+ private
1715
+
1716
+ sig { params(node: ::RBI::Node).returns(T::Boolean) }
1717
+ def oneline?(node); end
1718
+
1719
+ # Parse a string containing a `T.let(x, X)` and extract the type
1720
+ #
1721
+ # Returns `nil` is the string is not a `T.let`.
1722
+ sig { params(code: T.nilable(::String)).returns(T.nilable(::String)) }
1723
+ def parse_t_let(code); end
1724
+
1725
+ sig { params(type: T.any(::RBI::Type, ::String)).returns(::RBI::Type) }
1726
+ def parse_type(type); end
1727
+
1728
+ sig { params(node: ::RBI::Node).void }
1729
+ def print_blank_line_before(node); end
1730
+
1731
+ sig { params(node: ::RBI::Node).void }
1732
+ def print_loc(node); end
1733
+
1734
+ sig { params(node: ::RBI::Param, last: T::Boolean).void }
1735
+ def print_param_comment_leading_space(node, last:); end
1736
+
1737
+ sig { params(node: ::RBI::Method, param: ::RBI::SigParam).void }
1738
+ def print_sig_param(node, param); end
1739
+
1740
+ sig { params(node: ::RBI::SigParam, last: T::Boolean).void }
1741
+ def print_sig_param_comment_leading_space(node, last:); end
1742
+ end
1743
+
1744
+ class RBI::RBSPrinter::Error < ::RBI::Error; end
1745
+ class RBI::ReplaceNodeError < ::RBI::Error; end
1746
+
1747
+ class RBI::ReqParam < ::RBI::Param
1748
+ sig do
1749
+ params(
1750
+ name: ::String,
1751
+ loc: T.nilable(::RBI::Loc),
1752
+ comments: T::Array[::RBI::Comment],
1753
+ block: T.nilable(T.proc.params(node: ::RBI::ReqParam).void)
1754
+ ).void
1755
+ end
1756
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
1757
+
1758
+ sig { params(other: T.nilable(::Object)).returns(T::Boolean) }
1759
+ def ==(other); end
1760
+ end
1761
+
1762
+ class RBI::RequiresAncestor < ::RBI::NodeWithComments
1763
+ include ::RBI::Indexable
1764
+
1765
+ sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void }
1766
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end
1767
+
1768
+ sig { override.returns(T::Array[::String]) }
1769
+ def index_ids; end
1770
+
1771
+ sig { returns(::String) }
1772
+ def name; end
1773
+
1774
+ sig { override.returns(::String) }
1775
+ def to_s; end
1776
+ end
1777
+
1778
+ class RBI::RestParam < ::RBI::Param
1779
+ sig do
1780
+ params(
1781
+ name: ::String,
1782
+ loc: T.nilable(::RBI::Loc),
1783
+ comments: T::Array[::RBI::Comment],
1784
+ block: T.nilable(T.proc.params(node: ::RBI::RestParam).void)
1785
+ ).void
1786
+ end
1787
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
1788
+
1789
+ sig { params(other: T.nilable(::Object)).returns(T::Boolean) }
1790
+ def ==(other); end
1791
+
1792
+ sig { override.returns(::String) }
1793
+ def to_s; end
1794
+ end
1795
+
1796
+ module RBI::Rewriters; end
1797
+
1798
+ class RBI::Rewriters::AddSigTemplates < ::RBI::Visitor
1799
+ sig { params(with_todo_comment: T::Boolean).void }
1800
+ def initialize(with_todo_comment: T.unsafe(nil)); end
1801
+
1802
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
1803
+ def visit(node); end
1804
+
1805
+ private
1806
+
1807
+ sig { params(attr: ::RBI::Attr).void }
1808
+ def add_attr_sig(attr); end
1809
+
1810
+ sig { params(method: ::RBI::Method).void }
1811
+ def add_method_sig(method); end
1812
+
1813
+ sig { params(node: ::RBI::NodeWithComments).void }
1814
+ def add_todo_comment(node); end
1815
+ end
1816
+
1817
+ class RBI::Rewriters::Annotate < ::RBI::Visitor
1818
+ sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void }
1819
+ def initialize(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end
1820
+
1821
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
1822
+ def visit(node); end
1823
+
1824
+ private
1825
+
1826
+ sig { params(node: ::RBI::NodeWithComments).void }
1827
+ def annotate_node(node); end
1828
+
1829
+ sig { params(node: ::RBI::Node).returns(T::Boolean) }
1830
+ def root?(node); end
1831
+ end
1832
+
1833
+ class RBI::Rewriters::AttrToMethods < ::RBI::Visitor
1834
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
1835
+ def visit(node); end
1836
+
1837
+ private
1838
+
1839
+ # @raise [ReplaceNodeError]
1840
+ sig { params(node: ::RBI::Node, with: T::Array[::RBI::Node]).void }
1841
+ def replace(node, with:); end
1842
+ end
1843
+
1844
+ class RBI::Rewriters::Deannotate < ::RBI::Visitor
1845
+ sig { params(annotation: ::String).void }
1846
+ def initialize(annotation); end
1847
+
1848
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
1849
+ def visit(node); end
1850
+
1851
+ private
1852
+
1853
+ sig { params(node: ::RBI::NodeWithComments).void }
1854
+ def deannotate_node(node); end
1855
+ end
1856
+
1857
+ # Take a gem version and filter out all RBI that is not relevant to that version based on @version annotations
1858
+ # in comments. As an example:
1859
+ #
1860
+ # ~~~rb
1861
+ # tree = Parser.parse_string(<<~RBI)
1862
+ # class Foo
1863
+ # # @version > 0.3.0
1864
+ # def bar
1865
+ # end
1866
+ #
1867
+ # # @version <= 0.3.0
1868
+ # def bar(arg1)
1869
+ # end
1870
+ # end
1871
+ # RBI
1872
+ #
1873
+ # Rewriters::FilterVersions.filter(tree, Gem::Version.new("0.3.1"))
1874
+ #
1875
+ # assert_equal(<<~RBI, tree.string)
1876
+ # class Foo
1877
+ # # @version > 0.3.0
1878
+ # def bar
1879
+ # end
1880
+ # end
1881
+ # RBI
1882
+ # ~~~
1883
+ #
1884
+ # Supported operators:
1885
+ # - equals `=`
1886
+ # - not equals `!=`
1887
+ # - greater than `>`
1888
+ # - greater than or equal to `>=`
1889
+ # - less than `<`
1890
+ # - less than or equal to `<=`
1891
+ # - pessimistic or twiddle-wakka`~>`
1892
+ #
1893
+ # And/or logic:
1894
+ # - "And" logic: put multiple versions on the same line
1895
+ # - e.g. `@version > 0.3.0, <1.0.0` means version must be greater than 0.3.0 AND less than 1.0.0
1896
+ # - "Or" logic: put multiple versions on subsequent lines
1897
+ # - e.g. the following means version must be less than 0.3.0 OR greater than 1.0.0
1898
+ # ```
1899
+ # # @version < 0.3.0
1900
+ # # @version > 1.0.0
1901
+ # ```
1902
+ # Prerelease versions:
1903
+ # - Prerelease versions are considered less than their non-prerelease counterparts
1904
+ # - e.g. `0.4.0-prerelease` is less than `0.4.0`
1905
+ #
1906
+ # RBI with no versions:
1907
+ # - RBI with no version annotations are automatically counted towards ALL versions
1908
+ class RBI::Rewriters::FilterVersions < ::RBI::Visitor
1909
+ sig { params(version: ::Gem::Version).void }
1910
+ def initialize(version); end
1911
+
1912
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
1913
+ def visit(node); end
1914
+
1915
+ class << self
1916
+ sig { params(tree: ::RBI::Tree, version: ::Gem::Version).void }
1917
+ def filter(tree, version); end
1918
+ end
1919
+ end
1920
+
1921
+ RBI::Rewriters::FilterVersions::VERSION_PREFIX = T.let(T.unsafe(nil), String)
1922
+
1923
+ # Rewrite non-singleton methods inside singleton classes to singleton methods
1924
+ #
1925
+ # Example:
1926
+ # ~~~rb
1927
+ # class << self
1928
+ # def m1; end
1929
+ # def self.m2; end
1930
+ #
1931
+ # class << self
1932
+ # def m3; end
1933
+ # end
1934
+ # end
1935
+ # ~~~
1936
+ #
1937
+ # will be rewritten to:
1938
+ #
1939
+ # ~~~rb
1940
+ # def self.m1; end
1941
+ #
1942
+ # class << self
1943
+ # def self.m2; end
1944
+ # def self.m3; end
1945
+ # end
1946
+ # ~~~
1947
+ class RBI::Rewriters::FlattenSingletonMethods < ::RBI::Visitor
1948
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
1949
+ def visit(node); end
1950
+ end
1951
+
1952
+ # Flattens visibility nodes into method nodes
1953
+ #
1954
+ # Example:
1955
+ # ~~~rb
1956
+ # class A
1957
+ # def m1; end
1958
+ # private
1959
+ # def m2; end
1960
+ # def m3; end
1961
+ # end
1962
+ # ~~~
1963
+ #
1964
+ # will be transformed into:
1965
+ #
1966
+ # ~~~rb
1967
+ # class A
1968
+ # def m1; end
1969
+ # private def m2; end
1970
+ # private def m3; end
1971
+ # end
1972
+ # ~~~
1973
+ class RBI::Rewriters::FlattenVisibilities < ::RBI::Visitor
1974
+ sig { void }
1975
+ def initialize; end
1976
+
1977
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
1978
+ def visit(node); end
1979
+ end
1980
+
1981
+ class RBI::Rewriters::GroupNodes < ::RBI::Visitor
1982
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
1983
+ def visit(node); end
1984
+
1985
+ private
1986
+
1987
+ sig { params(node: ::RBI::Node).returns(::RBI::Group::Kind) }
1988
+ def group_kind(node); end
1989
+ end
1990
+
1991
+ # Merge two RBI trees together
1992
+ #
1993
+ # Be this `Tree`:
1994
+ # ~~~rb
1995
+ # class Foo
1996
+ # attr_accessor :a
1997
+ # def m; end
1998
+ # C = 10
1999
+ # end
2000
+ # ~~~
2001
+ #
2002
+ # Merged with this one:
2003
+ # ~~~rb
2004
+ # class Foo
2005
+ # attr_reader :a
2006
+ # def m(x); end
2007
+ # C = 10
2008
+ # end
2009
+ # ~~~
2010
+ #
2011
+ # Compatible definitions are merged together while incompatible definitions are moved into a `ConflictTree`:
2012
+ # ~~~rb
2013
+ # class Foo
2014
+ # <<<<<<< left
2015
+ # attr_accessor :a
2016
+ # def m; end
2017
+ # =======
2018
+ # attr_reader :a
2019
+ # def m(x); end
2020
+ # >>>>>>> right
2021
+ # C = 10
2022
+ # end
2023
+ # ~~~
2024
+ class RBI::Rewriters::Merge
2025
+ sig { params(left_name: ::String, right_name: ::String, keep: ::RBI::Rewriters::Merge::Keep).void }
2026
+ def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end
2027
+
2028
+ sig { params(tree: ::RBI::Tree).void }
2029
+ def merge(tree); end
2030
+
2031
+ sig { returns(::RBI::MergeTree) }
2032
+ def tree; end
2033
+
2034
+ class << self
2035
+ sig do
2036
+ params(
2037
+ left: ::RBI::Tree,
2038
+ right: ::RBI::Tree,
2039
+ left_name: ::String,
2040
+ right_name: ::String,
2041
+ keep: ::RBI::Rewriters::Merge::Keep
2042
+ ).returns(::RBI::MergeTree)
2043
+ end
2044
+ def merge_trees(left, right, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end
2045
+ end
2046
+ end
2047
+
2048
+ # Used for logging / error displaying purpose
2049
+ class RBI::Rewriters::Merge::Conflict < ::T::Struct
2050
+ const :left, ::RBI::Node
2051
+ const :right, ::RBI::Node
2052
+ const :left_name, ::String
2053
+ const :right_name, ::String
2054
+
2055
+ sig { returns(::String) }
2056
+ def to_s; end
2057
+
2058
+ class << self
2059
+ def inherited(s); end
2060
+ end
2061
+ end
2062
+
2063
+ # Merge adjacent conflict trees
2064
+ #
2065
+ # Transform this:
2066
+ # ~~~rb
2067
+ # class Foo
2068
+ # <<<<<<< left
2069
+ # def m1; end
2070
+ # =======
2071
+ # def m1(a); end
2072
+ # >>>>>>> right
2073
+ # <<<<<<< left
2074
+ # def m2(a); end
2075
+ # =======
2076
+ # def m2; end
2077
+ # >>>>>>> right
2078
+ # end
2079
+ # ~~~
2080
+ #
2081
+ # Into this:
2082
+ # ~~~rb
2083
+ # class Foo
2084
+ # <<<<<<< left
2085
+ # def m1; end
2086
+ # def m2(a); end
2087
+ # =======
2088
+ # def m1(a); end
2089
+ # def m2; end
2090
+ # >>>>>>> right
2091
+ # end
2092
+ # ~~~
2093
+ class RBI::Rewriters::Merge::ConflictTreeMerger < ::RBI::Visitor
2094
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
2095
+ def visit(node); end
2096
+
2097
+ sig { override.params(nodes: T::Array[::RBI::Node]).void }
2098
+ def visit_all(nodes); end
2099
+
2100
+ private
2101
+
2102
+ sig { params(left: ::RBI::Tree, right: ::RBI::Tree).void }
2103
+ def merge_conflict_trees(left, right); end
2104
+ end
2105
+
2106
+ class RBI::Rewriters::Merge::Keep < ::T::Enum
2107
+ enums do
2108
+ LEFT = new
2109
+ NONE = new
2110
+ RIGHT = new
2111
+ end
2112
+ end
2113
+
2114
+ class RBI::Rewriters::Merge::TreeMerger < ::RBI::Visitor
2115
+ sig do
2116
+ params(
2117
+ output: ::RBI::Tree,
2118
+ left_name: ::String,
2119
+ right_name: ::String,
2120
+ keep: ::RBI::Rewriters::Merge::Keep
2121
+ ).void
2122
+ end
2123
+ def initialize(output, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end
2124
+
2125
+ sig { returns(T::Array[::RBI::Rewriters::Merge::Conflict]) }
2126
+ def conflicts; end
2127
+
2128
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
2129
+ def visit(node); end
2130
+
2131
+ private
2132
+
2133
+ sig { returns(::RBI::Tree) }
2134
+ def current_scope; end
2135
+
2136
+ sig { params(left: ::RBI::Scope, right: ::RBI::Scope).void }
2137
+ def make_conflict_scope(left, right); end
2138
+
2139
+ sig { params(left: ::RBI::Node, right: ::RBI::Node).void }
2140
+ def make_conflict_tree(left, right); end
2141
+
2142
+ sig { params(node: ::RBI::Node).returns(T.nilable(::RBI::Node)) }
2143
+ def previous_definition(node); end
2144
+
2145
+ sig { params(left: ::RBI::Scope, right: ::RBI::Scope).returns(::RBI::Scope) }
2146
+ def replace_scope_header(left, right); end
2147
+ end
2148
+
2149
+ class RBI::Rewriters::NestNonPublicMembers < ::RBI::Visitor
2150
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
2151
+ def visit(node); end
2152
+ end
2153
+
2154
+ class RBI::Rewriters::NestSingletonMethods < ::RBI::Visitor
2155
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
2156
+ def visit(node); end
2157
+ end
2158
+
2159
+ # This rewriter moves top-level members into a top-level Object class
2160
+ #
2161
+ # Example:
2162
+ # ~~~rb
2163
+ # def foo; end
2164
+ # attr_reader :bar
2165
+ # ~~~
2166
+ #
2167
+ # will be rewritten to:
2168
+ #
2169
+ # ~~~rb
2170
+ # class Object
2171
+ # def foo; end
2172
+ # attr_reader :bar
2173
+ # end
2174
+ # ~~~
2175
+ class RBI::Rewriters::NestTopLevelMembers < ::RBI::Visitor
2176
+ sig { void }
2177
+ def initialize; end
2178
+
2179
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
2180
+ def visit(node); end
2181
+ end
2182
+
2183
+ # Remove all definitions existing in the index from the current tree
2184
+ #
2185
+ # Let's create an `Index` from two different `Tree`s:
2186
+ # ~~~rb
2187
+ # tree1 = Parse.parse_string(<<~RBI)
2188
+ # class Foo
2189
+ # def foo; end
2190
+ # end
2191
+ # RBI
2192
+ #
2193
+ # tree2 = Parse.parse_string(<<~RBI)
2194
+ # FOO = 10
2195
+ # RBI
2196
+ #
2197
+ # index = Index.index(tree1, tree2)
2198
+ # ~~~
2199
+ #
2200
+ # We can use `RemoveKnownDefinitions` to remove the definitions found in the `index` from the `Tree` to clean:
2201
+ # ~~~rb
2202
+ # tree_to_clean = Parser.parse_string(<<~RBI)
2203
+ # class Foo
2204
+ # def foo; end
2205
+ # def bar; end
2206
+ # end
2207
+ # FOO = 10
2208
+ # BAR = 42
2209
+ # RBI
2210
+ #
2211
+ # cleaned_tree, operations = RemoveKnownDefinitions.remove(tree_to_clean, index)
2212
+ #
2213
+ # assert_equal(<<~RBI, cleaned_tree)
2214
+ # class Foo
2215
+ # def bar; end
2216
+ # end
2217
+ # BAR = 42
2218
+ # RBI
2219
+ #
2220
+ # assert_equal(<<~OPERATIONS, operations.join("\n"))
2221
+ # Deleted ::Foo#foo at -:2:2-2-16 (duplicate from -:2:2-2:16)
2222
+ # Deleted ::FOO at -:5:0-5:8 (duplicate from -:1:0-1:8)
2223
+ # OPERATIONS
2224
+ # ~~~
2225
+ class RBI::Rewriters::RemoveKnownDefinitions < ::RBI::Visitor
2226
+ sig { params(index: ::RBI::Index).void }
2227
+ def initialize(index); end
2228
+
2229
+ sig { returns(T::Array[::RBI::Rewriters::RemoveKnownDefinitions::Operation]) }
2230
+ def operations; end
2231
+
2232
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
2233
+ def visit(node); end
2234
+
2235
+ sig { params(nodes: T::Array[::RBI::Node]).void }
2236
+ def visit_all(nodes); end
2237
+
2238
+ private
2239
+
2240
+ sig { params(node: ::RBI::Node, previous: ::RBI::Node).returns(T::Boolean) }
2241
+ def can_delete_node?(node, previous); end
2242
+
2243
+ sig { params(node: ::RBI::Node, previous: ::RBI::Node).void }
2244
+ def delete_node(node, previous); end
2245
+
2246
+ sig { params(node: ::RBI::Indexable).returns(T.nilable(::RBI::Node)) }
2247
+ def previous_definition_for(node); end
2248
+
2249
+ class << self
2250
+ sig do
2251
+ params(
2252
+ tree: ::RBI::Tree,
2253
+ index: ::RBI::Index
2254
+ ).returns([::RBI::Tree, T::Array[::RBI::Rewriters::RemoveKnownDefinitions::Operation]])
2255
+ end
2256
+ def remove(tree, index); end
2257
+ end
2258
+ end
2259
+
2260
+ class RBI::Rewriters::RemoveKnownDefinitions::Operation < ::T::Struct
2261
+ const :deleted_node, ::RBI::Node
2262
+ const :duplicate_of, ::RBI::Node
2263
+
2264
+ sig { returns(::String) }
2265
+ def to_s; end
2266
+
2267
+ class << self
2268
+ def inherited(s); end
2269
+ end
2270
+ end
2271
+
2272
+ class RBI::Rewriters::SortNodes < ::RBI::Visitor
2273
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
2274
+ def visit(node); end
2275
+
2276
+ private
2277
+
2278
+ sig { params(kind: ::RBI::Group::Kind).returns(::Integer) }
2279
+ def group_rank(kind); end
2280
+
2281
+ sig { params(node: ::RBI::Node).returns(T.nilable(::String)) }
2282
+ def node_name(node); end
2283
+
2284
+ sig { params(node: ::RBI::Node).returns(::Integer) }
2285
+ def node_rank(node); end
2286
+
2287
+ sig { params(node: ::RBI::Node).void }
2288
+ def sort_node_names!(node); end
2289
+ end
2290
+
2291
+ # Translate all RBS signature comments to Sorbet RBI signatures
2292
+ class RBI::Rewriters::TranslateRBSSigs < ::RBI::Visitor
2293
+ sig { override.params(node: T.nilable(::RBI::Node)).void }
2294
+ def visit(node); end
2295
+
2296
+ private
2297
+
2298
+ sig { params(node: T.any(::RBI::Attr, ::RBI::Method)).returns(T::Array[::RBI::RBSComment]) }
2299
+ def extract_rbs_comments(node); end
2300
+
2301
+ sig { params(node: ::RBI::Attr, comment: ::RBI::RBSComment).returns(::RBI::Sig) }
2302
+ def translate_rbs_attr_type(node, comment); end
2303
+
2304
+ sig { params(node: ::RBI::Method, comment: ::RBI::RBSComment).returns(::RBI::Sig) }
2305
+ def translate_rbs_method_type(node, comment); end
2306
+ end
2307
+
2308
+ class RBI::Rewriters::TranslateRBSSigs::Error < ::RBI::Error; end
2309
+
2310
+ # Scopes
2311
+ #
2312
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
2313
+ class RBI::Scope < ::RBI::Tree
2314
+ include ::RBI::Indexable
2315
+
2316
+ abstract!
2317
+
2318
+ # Duplicate `self` scope without its body
2319
+ sig { returns(T.self_type) }
2320
+ def dup_empty; end
2321
+
2322
+ # @abstract
2323
+ sig { abstract.returns(::String) }
2324
+ def fully_qualified_name; end
2325
+
2326
+ sig { override.returns(T::Array[::String]) }
2327
+ def index_ids; end
2328
+
2329
+ sig { override.returns(::String) }
2330
+ def to_s; end
2331
+ end
2332
+
2333
+ # A conflict between two scope headers
2334
+ #
2335
+ # Is rendered as a merge conflict between `left` and` right` for scope definitions:
2336
+ # ~~~rb
2337
+ # <<<<<<< left
2338
+ # class Foo
2339
+ # =======
2340
+ # module Foo
2341
+ # >>>>>>> right
2342
+ # def m1; end
2343
+ # end
2344
+ # ~~~
2345
+ class RBI::ScopeConflict < ::RBI::Tree
2346
+ sig { params(left: ::RBI::Scope, right: ::RBI::Scope, left_name: ::String, right_name: ::String).void }
2347
+ def initialize(left:, right:, left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end
2348
+
2349
+ sig { returns(::RBI::Scope) }
2350
+ def left; end
2351
+
2352
+ sig { returns(::String) }
2353
+ def left_name; end
2354
+
2355
+ # @return [Scope]
2356
+ def right; end
2357
+
2358
+ # @return [String]
2359
+ def right_name; end
2360
+ end
2361
+
2362
+ # Sends
2363
+ class RBI::Send < ::RBI::NodeWithComments
2364
+ include ::RBI::Indexable
2365
+
2366
+ sig do
2367
+ params(
2368
+ method: ::String,
2369
+ args: T::Array[::RBI::Arg],
2370
+ loc: T.nilable(::RBI::Loc),
2371
+ comments: T::Array[::RBI::Comment],
2372
+ block: T.nilable(T.proc.params(node: ::RBI::Send).void)
2373
+ ).void
2374
+ end
2375
+ def initialize(method, args = T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2376
+
2377
+ sig { params(arg: ::RBI::Arg).void }
2378
+ def <<(arg); end
2379
+
2380
+ sig { params(other: T.nilable(::Object)).returns(T::Boolean) }
2381
+ def ==(other); end
2382
+
2383
+ sig { returns(T::Array[::RBI::Arg]) }
2384
+ def args; end
2385
+
2386
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
2387
+ def compatible_with?(other); end
2388
+
2389
+ sig { override.returns(T::Array[::String]) }
2390
+ def index_ids; end
2391
+
2392
+ sig { returns(::String) }
2393
+ def method; end
2394
+
2395
+ sig { returns(::String) }
2396
+ def to_s; end
2397
+ end
2398
+
2399
+ # Sorbet's sigs
2400
+ class RBI::Sig < ::RBI::NodeWithComments
2401
+ sig do
2402
+ params(
2403
+ params: T::Array[::RBI::SigParam],
2404
+ return_type: T.any(::RBI::Type, ::String),
2405
+ is_abstract: T::Boolean,
2406
+ is_override: T::Boolean,
2407
+ is_overridable: T::Boolean,
2408
+ is_final: T::Boolean,
2409
+ allow_incompatible_override: T::Boolean,
2410
+ type_params: T::Array[::String],
2411
+ checked: T.nilable(::Symbol),
2412
+ loc: T.nilable(::RBI::Loc),
2413
+ comments: T::Array[::RBI::Comment],
2414
+ block: T.nilable(T.proc.params(node: ::RBI::Sig).void)
2415
+ ).void
2416
+ end
2417
+ def initialize(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), allow_incompatible_override: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2418
+
2419
+ sig { params(param: ::RBI::SigParam).void }
2420
+ def <<(param); end
2421
+
2422
+ sig { params(other: ::Object).returns(T::Boolean) }
2423
+ def ==(other); end
2424
+
2425
+ sig { params(name: ::String, type: T.any(::RBI::Type, ::String)).void }
2426
+ def add_param(name, type); end
2427
+
2428
+ # @return [Boolean]
2429
+ def allow_incompatible_override; end
2430
+
2431
+ # @return [Boolean]
2432
+ def allow_incompatible_override=(_arg0); end
2433
+
2434
+ sig { returns(T.nilable(::Symbol)) }
2435
+ def checked; end
2436
+
2437
+ # @return [Symbol, nil]
2438
+ def checked=(_arg0); end
2439
+
2440
+ sig { returns(T::Boolean) }
2441
+ def is_abstract; end
2442
+
2443
+ # @return [Boolean]
2444
+ def is_abstract=(_arg0); end
2445
+
2446
+ # @return [Boolean]
2447
+ def is_final; end
2448
+
2449
+ # @return [Boolean]
2450
+ def is_final=(_arg0); end
2451
+
2452
+ # @return [Boolean]
2453
+ def is_overridable; end
2454
+
2455
+ # @return [Boolean]
2456
+ def is_overridable=(_arg0); end
2457
+
2458
+ # @return [Boolean]
2459
+ def is_override; end
2460
+
2461
+ # @return [Boolean]
2462
+ def is_override=(_arg0); end
2463
+
2464
+ sig { returns(T::Array[::RBI::SigParam]) }
2465
+ def params; end
2466
+
2467
+ sig { returns(T.any(::RBI::Type, ::String)) }
2468
+ def return_type; end
2469
+
2470
+ # @return [Type, String]
2471
+ def return_type=(_arg0); end
2472
+
2473
+ sig { returns(T::Array[::String]) }
2474
+ def type_params; end
2475
+ end
2476
+
2477
+ class RBI::SigParam < ::RBI::NodeWithComments
2478
+ sig do
2479
+ params(
2480
+ name: ::String,
2481
+ type: T.any(::RBI::Type, ::String),
2482
+ loc: T.nilable(::RBI::Loc),
2483
+ comments: T::Array[::RBI::Comment],
2484
+ block: T.nilable(T.proc.params(node: ::RBI::SigParam).void)
2485
+ ).void
2486
+ end
2487
+ def initialize(name, type, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2488
+
2489
+ sig { params(other: ::Object).returns(T::Boolean) }
2490
+ def ==(other); end
2491
+
2492
+ sig { returns(::String) }
2493
+ def name; end
2494
+
2495
+ sig { returns(T.any(::RBI::Type, ::String)) }
2496
+ def type; end
2497
+ end
2498
+
2499
+ class RBI::SingletonClass < ::RBI::Scope
2500
+ sig do
2501
+ params(
2502
+ loc: T.nilable(::RBI::Loc),
2503
+ comments: T::Array[::RBI::Comment],
2504
+ block: T.nilable(T.proc.params(node: ::RBI::SingletonClass).void)
2505
+ ).void
2506
+ end
2507
+ def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2508
+
2509
+ sig { override.returns(::String) }
2510
+ def fully_qualified_name; end
2511
+ end
2512
+
2513
+ class RBI::Struct < ::RBI::Scope
2514
+ sig do
2515
+ params(
2516
+ name: ::String,
2517
+ members: T::Array[::Symbol],
2518
+ keyword_init: T::Boolean,
2519
+ loc: T.nilable(::RBI::Loc),
2520
+ comments: T::Array[::RBI::Comment],
2521
+ block: T.nilable(T.proc.params(struct: ::RBI::Struct).void)
2522
+ ).void
2523
+ end
2524
+ def initialize(name, members: T.unsafe(nil), keyword_init: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2525
+
2526
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
2527
+ def compatible_with?(other); end
2528
+
2529
+ sig { override.returns(::String) }
2530
+ def fully_qualified_name; end
2531
+
2532
+ sig { returns(T::Boolean) }
2533
+ def keyword_init; end
2534
+
2535
+ # @return [Boolean]
2536
+ def keyword_init=(_arg0); end
2537
+
2538
+ sig { returns(T::Array[::Symbol]) }
2539
+ def members; end
2540
+
2541
+ # @return [Array<Symbol>]
2542
+ def members=(_arg0); end
2543
+
2544
+ sig { returns(::String) }
2545
+ def name; end
2546
+
2547
+ # @return [String]
2548
+ def name=(_arg0); end
2549
+ end
2550
+
2551
+ # Sorbet's T::Enum
2552
+ class RBI::TEnum < ::RBI::Class
2553
+ sig do
2554
+ params(
2555
+ name: ::String,
2556
+ loc: T.nilable(::RBI::Loc),
2557
+ comments: T::Array[::RBI::Comment],
2558
+ block: T.nilable(T.proc.params(klass: ::RBI::TEnum).void)
2559
+ ).void
2560
+ end
2561
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2562
+ end
2563
+
2564
+ class RBI::TEnumBlock < ::RBI::Scope
2565
+ sig do
2566
+ params(
2567
+ loc: T.nilable(::RBI::Loc),
2568
+ comments: T::Array[::RBI::Comment],
2569
+ block: T.nilable(T.proc.params(node: ::RBI::TEnumBlock).void)
2570
+ ).void
2571
+ end
2572
+ def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2573
+
2574
+ sig { override.returns(::String) }
2575
+ def fully_qualified_name; end
2576
+
2577
+ sig { override.returns(T::Array[::String]) }
2578
+ def index_ids; end
2579
+
2580
+ sig { override.returns(::String) }
2581
+ def to_s; end
2582
+ end
2583
+
2584
+ class RBI::TEnumValue < ::RBI::NodeWithComments
2585
+ include ::RBI::Indexable
2586
+
2587
+ sig do
2588
+ params(
2589
+ name: ::String,
2590
+ loc: T.nilable(::RBI::Loc),
2591
+ comments: T::Array[::RBI::Comment],
2592
+ block: T.nilable(T.proc.params(node: ::RBI::TEnumValue).void)
2593
+ ).void
2594
+ end
2595
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2596
+
2597
+ sig { returns(::String) }
2598
+ def fully_qualified_name; end
2599
+
2600
+ sig { override.returns(T::Array[::String]) }
2601
+ def index_ids; end
2602
+
2603
+ sig { returns(::String) }
2604
+ def name; end
2605
+
2606
+ sig { override.returns(::String) }
2607
+ def to_s; end
2608
+ end
2609
+
2610
+ # Sorbet's T::Struct
2611
+ class RBI::TStruct < ::RBI::Class
2612
+ sig do
2613
+ params(
2614
+ name: ::String,
2615
+ loc: T.nilable(::RBI::Loc),
2616
+ comments: T::Array[::RBI::Comment],
2617
+ block: T.nilable(T.proc.params(klass: ::RBI::TStruct).void)
2618
+ ).void
2619
+ end
2620
+ def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2621
+ end
2622
+
2623
+ class RBI::TStructConst < ::RBI::TStructField
2624
+ include ::RBI::Indexable
2625
+
2626
+ sig do
2627
+ params(
2628
+ name: ::String,
2629
+ type: T.any(::RBI::Type, ::String),
2630
+ default: T.nilable(::String),
2631
+ loc: T.nilable(::RBI::Loc),
2632
+ comments: T::Array[::RBI::Comment],
2633
+ block: T.nilable(T.proc.params(node: ::RBI::TStructConst).void)
2634
+ ).void
2635
+ end
2636
+ def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2637
+
2638
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
2639
+ def compatible_with?(other); end
2640
+
2641
+ sig { override.returns(T::Array[::String]) }
2642
+ def fully_qualified_names; end
2643
+
2644
+ sig { override.returns(T::Array[::String]) }
2645
+ def index_ids; end
2646
+
2647
+ sig { override.returns(::String) }
2648
+ def to_s; end
2649
+ end
2650
+
2651
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
2652
+ class RBI::TStructField < ::RBI::NodeWithComments
2653
+ abstract!
2654
+
2655
+ sig do
2656
+ params(
2657
+ name: ::String,
2658
+ type: T.any(::RBI::Type, ::String),
2659
+ default: T.nilable(::String),
2660
+ loc: T.nilable(::RBI::Loc),
2661
+ comments: T::Array[::RBI::Comment]
2662
+ ).void
2663
+ end
2664
+ def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil)); end
2665
+
2666
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
2667
+ def compatible_with?(other); end
2668
+
2669
+ sig { returns(T.nilable(::String)) }
2670
+ def default; end
2671
+
2672
+ # @return [String, nil]
2673
+ def default=(_arg0); end
2674
+
2675
+ # @abstract
2676
+ sig { abstract.returns(T::Array[::String]) }
2677
+ def fully_qualified_names; end
2678
+
2679
+ sig { returns(::String) }
2680
+ def name; end
2681
+
2682
+ # @return [String]
2683
+ def name=(_arg0); end
2684
+
2685
+ sig { returns(T.any(::RBI::Type, ::String)) }
2686
+ def type; end
2687
+
2688
+ # @return [Type, String]
2689
+ def type=(_arg0); end
2690
+ end
2691
+
2692
+ class RBI::TStructProp < ::RBI::TStructField
2693
+ include ::RBI::Indexable
2694
+
2695
+ sig do
2696
+ params(
2697
+ name: ::String,
2698
+ type: T.any(::RBI::Type, ::String),
2699
+ default: T.nilable(::String),
2700
+ loc: T.nilable(::RBI::Loc),
2701
+ comments: T::Array[::RBI::Comment],
2702
+ block: T.nilable(T.proc.params(node: ::RBI::TStructProp).void)
2703
+ ).void
2704
+ end
2705
+ def initialize(name, type, default: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2706
+
2707
+ sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
2708
+ def compatible_with?(other); end
2709
+
2710
+ sig { override.returns(T::Array[::String]) }
2711
+ def fully_qualified_names; end
2712
+
2713
+ sig { override.returns(T::Array[::String]) }
2714
+ def index_ids; end
2715
+
2716
+ sig { override.returns(::String) }
2717
+ def to_s; end
2718
+ end
2719
+
2720
+ class RBI::Tree < ::RBI::NodeWithComments
2721
+ sig do
2722
+ params(
2723
+ loc: T.nilable(::RBI::Loc),
2724
+ comments: T::Array[::RBI::Comment],
2725
+ block: T.nilable(T.proc.params(node: ::RBI::Tree).void)
2726
+ ).void
2727
+ end
2728
+ def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2729
+
2730
+ sig { params(node: ::RBI::Node).void }
2731
+ def <<(node); end
2732
+
2733
+ sig { params(with_todo_comment: T::Boolean).void }
2734
+ def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end
2735
+
2736
+ sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void }
2737
+ def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end
2738
+
2739
+ sig do
2740
+ params(
2741
+ name: ::String,
2742
+ superclass_name: T.nilable(::String),
2743
+ block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)
2744
+ ).returns(::RBI::Scope)
2745
+ end
2746
+ def create_class(name, superclass_name: T.unsafe(nil), &block); end
2747
+
2748
+ sig { params(name: ::String, value: ::String).void }
2749
+ def create_constant(name, value:); end
2750
+
2751
+ sig { params(name: ::String).void }
2752
+ def create_extend(name); end
2753
+
2754
+ sig { params(name: ::String).void }
2755
+ def create_include(name); end
2756
+
2757
+ sig do
2758
+ params(
2759
+ name: ::String,
2760
+ parameters: T::Array[::RBI::TypedParam],
2761
+ return_type: T.nilable(::String),
2762
+ class_method: T::Boolean,
2763
+ visibility: ::RBI::Visibility,
2764
+ comments: T::Array[::RBI::Comment],
2765
+ block: T.nilable(T.proc.params(node: ::RBI::Method).void)
2766
+ ).void
2767
+ end
2768
+ def create_method(name, parameters: T.unsafe(nil), return_type: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2769
+
2770
+ sig { params(name: ::String).void }
2771
+ def create_mixes_in_class_methods(name); end
2772
+
2773
+ sig { params(name: ::String, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) }
2774
+ def create_module(name, &block); end
2775
+
2776
+ sig { params(constant: ::Module, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) }
2777
+ def create_path(constant, &block); end
2778
+
2779
+ sig do
2780
+ params(
2781
+ name: ::String,
2782
+ type: ::String,
2783
+ variance: ::Symbol,
2784
+ fixed: T.nilable(::String),
2785
+ upper: T.nilable(::String),
2786
+ lower: T.nilable(::String)
2787
+ ).void
2788
+ end
2789
+ def create_type_variable(name, type:, variance: T.unsafe(nil), fixed: T.unsafe(nil), upper: T.unsafe(nil), lower: T.unsafe(nil)); end
2790
+
2791
+ sig { params(annotation: ::String).void }
2792
+ def deannotate!(annotation); end
2793
+
2794
+ sig { returns(T::Boolean) }
2795
+ def empty?; end
2796
+
2797
+ sig { params(version: ::Gem::Version).void }
2798
+ def filter_versions!(version); end
2799
+
2800
+ sig { void }
2801
+ def flatten_singleton_methods!; end
2802
+
2803
+ sig { void }
2804
+ def flatten_visibilities!; end
2805
+
2806
+ sig { void }
2807
+ def group_nodes!; end
2808
+
2809
+ sig { returns(::RBI::Index) }
2810
+ def index; end
2811
+
2812
+ sig do
2813
+ params(
2814
+ other: ::RBI::Tree,
2815
+ left_name: ::String,
2816
+ right_name: ::String,
2817
+ keep: ::RBI::Rewriters::Merge::Keep
2818
+ ).returns(::RBI::MergeTree)
2819
+ end
2820
+ def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end
2821
+
2822
+ sig { void }
2823
+ def nest_non_public_members!; end
2824
+
2825
+ sig { void }
2826
+ def nest_singleton_methods!; end
2827
+
2828
+ sig { void }
2829
+ def nest_top_level_members!; end
2830
+
2831
+ sig { returns(T::Array[::RBI::Node]) }
2832
+ def nodes; end
2833
+
2834
+ sig { void }
2835
+ def replace_attributes_with_methods!; end
2836
+
2837
+ sig { void }
2838
+ def sort_nodes!; end
2839
+
2840
+ sig { void }
2841
+ def translate_rbs_sigs!; end
2842
+
2843
+ private
2844
+
2845
+ sig { params(node: ::RBI::Node).returns(::RBI::Node) }
2846
+ def create_node(node); end
2847
+
2848
+ sig { returns(T::Hash[::String, ::RBI::Node]) }
2849
+ def nodes_cache; end
2850
+ end
2851
+
2852
+ # The base class for all RBI types.
2853
+ #
2854
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
2855
+ class RBI::Type
2856
+ abstract!
2857
+
2858
+ sig { void }
2859
+ def initialize; end
2860
+
2861
+ # @abstract
2862
+ sig { abstract.params(other: ::BasicObject).returns(T::Boolean) }
2863
+ def ==(other); end
2864
+
2865
+ sig { params(other: ::BasicObject).returns(T::Boolean) }
2866
+ def eql?(other); end
2867
+
2868
+ sig { override.returns(::Integer) }
2869
+ def hash; end
2870
+
2871
+ # Returns a new type that is `nilable` if it is not already.
2872
+ #
2873
+ # If the type is already nilable, it returns itself.
2874
+ # ```ruby
2875
+ # type = RBI::Type.simple("String")
2876
+ # type.to_rbi # => "String"
2877
+ # type.nilable.to_rbi # => "T.nilable(String)"
2878
+ # type.nilable.nilable.to_rbi # => "T.nilable(String)"
2879
+ # ```
2880
+ sig { returns(::RBI::Type) }
2881
+ def nilable; end
2882
+
2883
+ # Returns whether the type is nilable.
2884
+ sig { returns(T::Boolean) }
2885
+ def nilable?; end
2886
+
2887
+ # Returns the non-nilable version of the type.
2888
+ # If the type is already non-nilable, it returns itself.
2889
+ # If the type is nilable, it returns the inner type.
2890
+ #
2891
+ # ```ruby
2892
+ # type = RBI::Type.nilable(RBI::Type.simple("String"))
2893
+ # type.to_rbi # => "T.nilable(String)"
2894
+ # type.non_nilable.to_rbi # => "String"
2895
+ # type.non_nilable.non_nilable.to_rbi # => "String"
2896
+ # ```
2897
+ sig { returns(::RBI::Type) }
2898
+ def non_nilable; end
2899
+
2900
+ sig { returns(::String) }
2901
+ def rbs_string; end
2902
+
2903
+ # @abstract
2904
+ sig { abstract.returns(::String) }
2905
+ def to_rbi; end
2906
+
2907
+ sig { override.returns(::String) }
2908
+ def to_s; end
2909
+
2910
+ class << self
2911
+ # Builds a type that represents an intersection of multiple types like `T.all(String, Integer)`.
2912
+ #
2913
+ # Note that this method transforms types such as `T.all(String, String)` into `String`, so
2914
+ # it may return something other than a `All`.
2915
+ sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) }
2916
+ def all(type1, type2, *types); end
2917
+
2918
+ # Builds a type that represents a union of multiple types like `T.any(String, Integer)`.
2919
+ #
2920
+ # Note that this method transforms types such as `T.any(String, NilClass)` into `T.nilable(String)`, so
2921
+ # it may return something other than a `Any`.
2922
+ sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) }
2923
+ def any(type1, type2, *types); end
2924
+
2925
+ # Builds a type that represents `T.anything`.
2926
+ sig { returns(::RBI::Type::Anything) }
2927
+ def anything; end
2928
+
2929
+ # Builds a type that represents `T.attached_class`.
2930
+ sig { returns(::RBI::Type::AttachedClass) }
2931
+ def attached_class; end
2932
+
2933
+ # Builds a type that represents `T::Boolean`.
2934
+ sig { returns(::RBI::Type::Boolean) }
2935
+ def boolean; end
2936
+
2937
+ # Builds a type that represents the singleton class of another type like `T.class_of(Foo)`.
2938
+ sig { params(type: ::RBI::Type::Simple, type_parameter: T.nilable(::RBI::Type)).returns(::RBI::Type::ClassOf) }
2939
+ def class_of(type, type_parameter = T.unsafe(nil)); end
2940
+
2941
+ # Builds a type that represents a generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`.
2942
+ sig { params(name: ::String, params: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Generic) }
2943
+ def generic(name, *params); end
2944
+
2945
+ # Builds a type that represents a nilable of another type like `T.nilable(String)`.
2946
+ #
2947
+ # Note that this method transforms types such as `T.nilable(T.untyped)` into `T.untyped`, so
2948
+ # it may return something other than a `RBI::Type::Nilable`.
2949
+ sig { params(type: ::RBI::Type).returns(::RBI::Type) }
2950
+ def nilable(type); end
2951
+
2952
+ # Builds a type that represents `T.noreturn`.
2953
+ sig { returns(::RBI::Type::NoReturn) }
2954
+ def noreturn; end
2955
+
2956
+ sig { params(node: ::Prism::Node).returns(::RBI::Type) }
2957
+ def parse_node(node); end
2958
+
2959
+ # @raise [Error]
2960
+ sig { params(string: ::String).returns(::RBI::Type) }
2961
+ def parse_string(string); end
2962
+
2963
+ # Builds a type that represents a proc type like `T.proc.void`.
2964
+ sig { returns(::RBI::Type::Proc) }
2965
+ def proc; end
2966
+
2967
+ # Builds a type that represents `T.self_type`.
2968
+ sig { returns(::RBI::Type::SelfType) }
2969
+ def self_type; end
2970
+
2971
+ # Builds a type that represents a shape type like `{name: String, age: Integer}`.
2972
+ sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).returns(::RBI::Type::Shape) }
2973
+ def shape(types = T.unsafe(nil)); end
2974
+
2975
+ # Builds a simple type like `String` or `::Foo::Bar`.
2976
+ #
2977
+ # It raises a `NameError` if the name is not a valid Ruby class identifier.
2978
+ #
2979
+ # @raise [NameError]
2980
+ sig { params(name: ::String).returns(::RBI::Type::Simple) }
2981
+ def simple(name); end
2982
+
2983
+ # Builds a type that represents the class of another type like `T::Class[Foo]`.
2984
+ sig { params(type: ::RBI::Type).returns(::RBI::Type::Class) }
2985
+ def t_class(type); end
2986
+
2987
+ # Builds a type that represents a tuple type like `[String, Integer]`.
2988
+ sig { params(types: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Tuple) }
2989
+ def tuple(*types); end
2990
+
2991
+ # Builds a type that represents a type parameter like `T.type_parameter(:U)`.
2992
+ sig { params(name: ::Symbol).returns(::RBI::Type::TypeParameter) }
2993
+ def type_parameter(name); end
2994
+
2995
+ # Builds a type that represents `T.untyped`.
2996
+ sig { returns(::RBI::Type::Untyped) }
2997
+ def untyped; end
2998
+
2999
+ # Builds a type that represents `void`.
3000
+ sig { returns(::RBI::Type::Void) }
3001
+ def void; end
3002
+
3003
+ private
3004
+
3005
+ sig { params(node: ::Prism::CallNode).returns(T::Array[::Prism::Node]) }
3006
+ def call_chain(node); end
3007
+
3008
+ sig { params(node: ::Prism::CallNode, count: ::Integer).returns(T::Array[::Prism::Node]) }
3009
+ def check_arguments_at_least!(node, count); end
3010
+
3011
+ sig { params(node: ::Prism::CallNode, count: ::Integer).returns(T::Array[::Prism::Node]) }
3012
+ def check_arguments_exactly!(node, count); end
3013
+
3014
+ # @raise [Error]
3015
+ sig { params(node: ::Prism::CallNode).returns(::RBI::Type) }
3016
+ def parse_call(node); end
3017
+
3018
+ sig { params(node: T.any(::Prism::ConstantPathNode, ::Prism::ConstantReadNode)).returns(::RBI::Type) }
3019
+ def parse_constant(node); end
3020
+
3021
+ # @raise [Error]
3022
+ sig { params(node: ::Prism::CallNode).returns(::RBI::Type) }
3023
+ def parse_proc(node); end
3024
+
3025
+ sig { params(node: T.any(::Prism::HashNode, ::Prism::KeywordHashNode)).returns(::RBI::Type) }
3026
+ def parse_shape(node); end
3027
+
3028
+ sig { params(node: ::Prism::ArrayNode).returns(::RBI::Type) }
3029
+ def parse_tuple(node); end
3030
+
3031
+ sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) }
3032
+ def t?(node); end
3033
+
3034
+ sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) }
3035
+ def t_boolean?(node); end
3036
+
3037
+ sig { params(node: ::Prism::ConstantPathNode).returns(T::Boolean) }
3038
+ def t_class?(node); end
3039
+
3040
+ sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) }
3041
+ def t_class_of?(node); end
3042
+
3043
+ sig { params(node: ::Prism::CallNode).returns(T::Boolean) }
3044
+ def t_proc?(node); end
3045
+
3046
+ sig { params(name: ::String).returns(T::Boolean) }
3047
+ def valid_identifier?(name); end
3048
+ end
3049
+ end
3050
+
3051
+ # A type that is intersection of multiple types like `T.all(String, Integer)`.
3052
+ class RBI::Type::All < ::RBI::Type::Composite
3053
+ sig { override.returns(::String) }
3054
+ def to_rbi; end
3055
+ end
3056
+
3057
+ # A type that is union of multiple types like `T.any(String, Integer)`.
3058
+ class RBI::Type::Any < ::RBI::Type::Composite
3059
+ sig { returns(T::Boolean) }
3060
+ def nilable?; end
3061
+
3062
+ sig { override.returns(::String) }
3063
+ def to_rbi; end
3064
+ end
3065
+
3066
+ # `T.anything`.
3067
+ class RBI::Type::Anything < ::RBI::Type
3068
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3069
+ def ==(other); end
3070
+
3071
+ sig { override.returns(::String) }
3072
+ def to_rbi; end
3073
+ end
3074
+
3075
+ # `T.attached_class`.
3076
+ class RBI::Type::AttachedClass < ::RBI::Type
3077
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3078
+ def ==(other); end
3079
+
3080
+ sig { override.returns(::String) }
3081
+ def to_rbi; end
3082
+ end
3083
+
3084
+ # `T::Boolean`.
3085
+ class RBI::Type::Boolean < ::RBI::Type
3086
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3087
+ def ==(other); end
3088
+
3089
+ sig { override.returns(::String) }
3090
+ def to_rbi; end
3091
+ end
3092
+
3093
+ # The class of another type like `T::Class[Foo]`.
3094
+ class RBI::Type::Class < ::RBI::Type
3095
+ sig { params(type: ::RBI::Type).void }
3096
+ def initialize(type); end
3097
+
3098
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3099
+ def ==(other); end
3100
+
3101
+ sig { override.returns(::String) }
3102
+ def to_rbi; end
3103
+
3104
+ sig { returns(::RBI::Type) }
3105
+ def type; end
3106
+ end
3107
+
3108
+ # The singleton class of another type like `T.class_of(Foo)`.
3109
+ class RBI::Type::ClassOf < ::RBI::Type
3110
+ sig { params(type: ::RBI::Type::Simple, type_parameter: T.nilable(::RBI::Type)).void }
3111
+ def initialize(type, type_parameter = T.unsafe(nil)); end
3112
+
3113
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3114
+ def ==(other); end
3115
+
3116
+ sig { override.returns(::String) }
3117
+ def to_rbi; end
3118
+
3119
+ sig { returns(::RBI::Type::Simple) }
3120
+ def type; end
3121
+
3122
+ sig { returns(T.nilable(::RBI::Type)) }
3123
+ def type_parameter; end
3124
+ end
3125
+
3126
+ # A type that is composed of multiple types like `T.all(String, Integer)`.
3127
+ #
3128
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
3129
+ class RBI::Type::Composite < ::RBI::Type
3130
+ abstract!
3131
+
3132
+ sig { params(types: T::Array[::RBI::Type]).void }
3133
+ def initialize(types); end
3134
+
3135
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3136
+ def ==(other); end
3137
+
3138
+ sig { returns(T::Array[::RBI::Type]) }
3139
+ def types; end
3140
+ end
3141
+
3142
+ class RBI::Type::Error < ::RBI::Error; end
3143
+
3144
+ # A generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`.
3145
+ class RBI::Type::Generic < ::RBI::Type
3146
+ sig { params(name: ::String, params: ::RBI::Type).void }
3147
+ def initialize(name, *params); end
3148
+
3149
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3150
+ def ==(other); end
3151
+
3152
+ sig { returns(::String) }
3153
+ def name; end
3154
+
3155
+ sig { returns(T::Array[::RBI::Type]) }
3156
+ def params; end
3157
+
3158
+ sig { override.returns(::String) }
3159
+ def to_rbi; end
3160
+ end
3161
+
3162
+ # A type that can be `nil` like `T.nilable(String)`.
3163
+ class RBI::Type::Nilable < ::RBI::Type
3164
+ sig { params(type: ::RBI::Type).void }
3165
+ def initialize(type); end
3166
+
3167
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3168
+ def ==(other); end
3169
+
3170
+ sig { override.returns(::String) }
3171
+ def to_rbi; end
3172
+
3173
+ sig { returns(::RBI::Type) }
3174
+ def type; end
3175
+ end
3176
+
3177
+ # `T.noreturn`.
3178
+ class RBI::Type::NoReturn < ::RBI::Type
3179
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3180
+ def ==(other); end
3181
+
3182
+ sig { override.returns(::String) }
3183
+ def to_rbi; end
3184
+ end
3185
+
3186
+ # A proc type like `T.proc.void`.
3187
+ class RBI::Type::Proc < ::RBI::Type
3188
+ sig { void }
3189
+ def initialize; end
3190
+
3191
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3192
+ def ==(other); end
3193
+
3194
+ sig { params(type: T.untyped).returns(T.self_type) }
3195
+ def bind(type); end
3196
+
3197
+ sig { params(params: ::RBI::Type).returns(T.self_type) }
3198
+ def params(**params); end
3199
+
3200
+ sig { returns(T.nilable(::RBI::Type)) }
3201
+ def proc_bind; end
3202
+
3203
+ sig { returns(T::Hash[::Symbol, ::RBI::Type]) }
3204
+ def proc_params; end
3205
+
3206
+ sig { returns(::RBI::Type) }
3207
+ def proc_returns; end
3208
+
3209
+ sig { params(type: T.untyped).returns(T.self_type) }
3210
+ def returns(type); end
3211
+
3212
+ sig { override.returns(::String) }
3213
+ def to_rbi; end
3214
+
3215
+ sig { returns(T.self_type) }
3216
+ def void; end
3217
+ end
3218
+
3219
+ # `T.self_type`.
3220
+ class RBI::Type::SelfType < ::RBI::Type
3221
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3222
+ def ==(other); end
3223
+
3224
+ sig { override.returns(::String) }
3225
+ def to_rbi; end
3226
+ end
3227
+
3228
+ # A shape type like `{name: String, age: Integer}`.
3229
+ class RBI::Type::Shape < ::RBI::Type
3230
+ sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).void }
3231
+ def initialize(types); end
3232
+
3233
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3234
+ def ==(other); end
3235
+
3236
+ sig { override.returns(::String) }
3237
+ def to_rbi; end
3238
+
3239
+ sig { returns(T::Hash[T.any(::String, ::Symbol), ::RBI::Type]) }
3240
+ def types; end
3241
+ end
3242
+
3243
+ # A type that represents a simple class name like `String` or `Foo`.
3244
+ #
3245
+ # It can also be a qualified name like `::Foo` or `Foo::Bar`.
3246
+ class RBI::Type::Simple < ::RBI::Type
3247
+ sig { params(name: ::String).void }
3248
+ def initialize(name); end
3249
+
3250
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3251
+ def ==(other); end
3252
+
3253
+ sig { returns(::String) }
3254
+ def name; end
3255
+
3256
+ sig { override.returns(::String) }
3257
+ def to_rbi; end
3258
+ end
3259
+
3260
+ # A tuple type like `[String, Integer]`.
3261
+ class RBI::Type::Tuple < ::RBI::Type
3262
+ sig { params(types: T::Array[::RBI::Type]).void }
3263
+ def initialize(types); end
3264
+
3265
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3266
+ def ==(other); end
3267
+
3268
+ sig { override.returns(::String) }
3269
+ def to_rbi; end
3270
+
3271
+ sig { returns(T::Array[::RBI::Type]) }
3272
+ def types; end
3273
+ end
3274
+
3275
+ # A type parameter like `T.type_parameter(:U)`.
3276
+ class RBI::Type::TypeParameter < ::RBI::Type
3277
+ sig { params(name: ::Symbol).void }
3278
+ def initialize(name); end
3279
+
3280
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3281
+ def ==(other); end
3282
+
3283
+ sig { returns(::Symbol) }
3284
+ def name; end
3285
+
3286
+ sig { override.returns(::String) }
3287
+ def to_rbi; end
3288
+ end
3289
+
3290
+ # `T.untyped`.
3291
+ class RBI::Type::Untyped < ::RBI::Type
3292
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3293
+ def ==(other); end
3294
+
3295
+ sig { override.returns(::String) }
3296
+ def to_rbi; end
3297
+ end
3298
+
3299
+ class RBI::Type::Visitor
3300
+ sig { params(node: ::RBI::Type).void }
3301
+ def visit(node); end
3302
+
3303
+ private
3304
+
3305
+ sig { params(type: ::RBI::Type::All).void }
3306
+ def visit_all(type); end
3307
+
3308
+ sig { params(type: ::RBI::Type::Any).void }
3309
+ def visit_any(type); end
3310
+
3311
+ sig { params(type: ::RBI::Type::Anything).void }
3312
+ def visit_anything(type); end
3313
+
3314
+ sig { params(type: ::RBI::Type::AttachedClass).void }
3315
+ def visit_attached_class(type); end
3316
+
3317
+ sig { params(type: ::RBI::Type::Boolean).void }
3318
+ def visit_boolean(type); end
3319
+
3320
+ sig { params(type: ::RBI::Type::Class).void }
3321
+ def visit_class(type); end
3322
+
3323
+ sig { params(type: ::RBI::Type::ClassOf).void }
3324
+ def visit_class_of(type); end
3325
+
3326
+ sig { params(type: ::RBI::Type::Generic).void }
3327
+ def visit_generic(type); end
3328
+
3329
+ sig { params(type: ::RBI::Type::Nilable).void }
3330
+ def visit_nilable(type); end
3331
+
3332
+ sig { params(type: ::RBI::Type::NoReturn).void }
3333
+ def visit_no_return(type); end
3334
+
3335
+ sig { params(type: ::RBI::Type::Proc).void }
3336
+ def visit_proc(type); end
3337
+
3338
+ sig { params(type: ::RBI::Type::SelfType).void }
3339
+ def visit_self_type(type); end
3340
+
3341
+ sig { params(type: ::RBI::Type::Shape).void }
3342
+ def visit_shape(type); end
3343
+
3344
+ sig { params(type: ::RBI::Type::Simple).void }
3345
+ def visit_simple(type); end
3346
+
3347
+ sig { params(type: ::RBI::Type::Tuple).void }
3348
+ def visit_tuple(type); end
3349
+
3350
+ sig { params(type: ::RBI::Type::TypeParameter).void }
3351
+ def visit_type_parameter(type); end
3352
+
3353
+ sig { params(type: ::RBI::Type::Untyped).void }
3354
+ def visit_untyped(type); end
3355
+
3356
+ sig { params(type: ::RBI::Type::Void).void }
3357
+ def visit_void(type); end
3358
+ end
3359
+
3360
+ class RBI::Type::Visitor::Error < ::RBI::Error; end
3361
+
3362
+ # `void`.
3363
+ class RBI::Type::Void < ::RBI::Type
3364
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3365
+ def ==(other); end
3366
+
3367
+ sig { override.returns(::String) }
3368
+ def to_rbi; end
3369
+ end
3370
+
3371
+ class RBI::TypeMember < ::RBI::NodeWithComments
3372
+ include ::RBI::Indexable
3373
+
3374
+ sig do
3375
+ params(
3376
+ name: ::String,
3377
+ value: ::String,
3378
+ loc: T.nilable(::RBI::Loc),
3379
+ comments: T::Array[::RBI::Comment],
3380
+ block: T.nilable(T.proc.params(node: ::RBI::TypeMember).void)
3381
+ ).void
3382
+ end
3383
+ def initialize(name, value, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
3384
+
3385
+ sig { returns(::String) }
3386
+ def fully_qualified_name; end
3387
+
3388
+ sig { override.returns(T::Array[::String]) }
3389
+ def index_ids; end
3390
+
3391
+ sig { returns(::String) }
3392
+ def name; end
3393
+
3394
+ sig { override.returns(::String) }
3395
+ def to_s; end
3396
+
3397
+ # @return [String]
3398
+ def value; end
3399
+ end
3400
+
3401
+ class RBI::TypePrinter
3402
+ sig { void }
3403
+ def initialize; end
3404
+
3405
+ sig { returns(::String) }
3406
+ def string; end
3407
+
3408
+ sig { params(node: ::RBI::Type).void }
3409
+ def visit(node); end
3410
+
3411
+ sig { params(type: ::RBI::Type::All).void }
3412
+ def visit_all(type); end
3413
+
3414
+ sig { params(type: ::RBI::Type::Any).void }
3415
+ def visit_any(type); end
3416
+
3417
+ sig { params(type: ::RBI::Type::Anything).void }
3418
+ def visit_anything(type); end
3419
+
3420
+ sig { params(type: ::RBI::Type::AttachedClass).void }
3421
+ def visit_attached_class(type); end
3422
+
3423
+ sig { params(type: ::RBI::Type::Boolean).void }
3424
+ def visit_boolean(type); end
3425
+
3426
+ sig { params(type: ::RBI::Type::Class).void }
3427
+ def visit_class(type); end
3428
+
3429
+ sig { params(type: ::RBI::Type::ClassOf).void }
3430
+ def visit_class_of(type); end
3431
+
3432
+ sig { params(type: ::RBI::Type::Generic).void }
3433
+ def visit_generic(type); end
3434
+
3435
+ sig { params(type: ::RBI::Type::Nilable).void }
3436
+ def visit_nilable(type); end
3437
+
3438
+ sig { params(type: ::RBI::Type::NoReturn).void }
3439
+ def visit_no_return(type); end
3440
+
3441
+ sig { params(type: ::RBI::Type::Proc).void }
3442
+ def visit_proc(type); end
3443
+
3444
+ sig { params(type: ::RBI::Type::SelfType).void }
3445
+ def visit_self_type(type); end
3446
+
3447
+ sig { params(type: ::RBI::Type::Shape).void }
3448
+ def visit_shape(type); end
3449
+
3450
+ sig { params(type: ::RBI::Type::Simple).void }
3451
+ def visit_simple(type); end
3452
+
3453
+ sig { params(type: ::RBI::Type::Tuple).void }
3454
+ def visit_tuple(type); end
3455
+
3456
+ sig { params(type: ::RBI::Type::TypeParameter).void }
3457
+ def visit_type_parameter(type); end
3458
+
3459
+ sig { params(type: ::RBI::Type::Untyped).void }
3460
+ def visit_untyped(type); end
3461
+
3462
+ sig { params(type: ::RBI::Type::Void).void }
3463
+ def visit_void(type); end
3464
+
3465
+ private
3466
+
3467
+ sig { params(type_name: ::String).returns(::String) }
3468
+ def translate_t_type(type_name); end
3469
+ end
3470
+
3471
+ class RBI::UnexpectedMultipleSigsError < ::RBI::Error
3472
+ sig { params(node: ::RBI::Node).void }
3473
+ def initialize(node); end
3474
+
3475
+ sig { returns(::RBI::Node) }
3476
+ def node; end
3477
+ end
3478
+
3479
+ class RBI::UnexpectedParserError < ::RBI::Error
3480
+ sig { params(parent_exception: ::Exception, last_location: ::RBI::Loc).void }
3481
+ def initialize(parent_exception, last_location); end
3482
+
3483
+ sig { returns(::RBI::Loc) }
3484
+ def last_location; end
3485
+
3486
+ sig { params(io: T.any(::IO, ::StringIO)).void }
3487
+ def print_debug(io: T.unsafe(nil)); end
3488
+ end
3489
+
3490
+ RBI::VERSION = T.let(T.unsafe(nil), String)
3491
+
3492
+ # Visibility
3493
+ #
3494
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
3495
+ class RBI::Visibility < ::RBI::NodeWithComments
3496
+ abstract!
3497
+
3498
+ sig { params(visibility: ::Symbol, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void }
3499
+ def initialize(visibility, loc: T.unsafe(nil), comments: T.unsafe(nil)); end
3500
+
3501
+ sig { params(other: T.nilable(::Object)).returns(T::Boolean) }
3502
+ def ==(other); end
3503
+
3504
+ sig { returns(T::Boolean) }
3505
+ def private?; end
3506
+
3507
+ sig { returns(T::Boolean) }
3508
+ def protected?; end
3509
+
3510
+ sig { returns(T::Boolean) }
3511
+ def public?; end
3512
+
3513
+ sig { returns(::Symbol) }
3514
+ def visibility; end
3515
+ end
3516
+
3517
+ class RBI::VisibilityGroup < ::RBI::Tree
3518
+ sig { params(visibility: ::RBI::Visibility).void }
3519
+ def initialize(visibility); end
3520
+
3521
+ sig { returns(::RBI::Visibility) }
3522
+ def visibility; end
3523
+ end
3524
+
3525
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
3526
+ class RBI::Visitor
3527
+ abstract!
3528
+
3529
+ sig { params(node: T.nilable(::RBI::Node)).void }
3530
+ def visit(node); end
3531
+
3532
+ sig { params(nodes: T::Array[::RBI::Node]).void }
3533
+ def visit_all(nodes); end
3534
+
3535
+ sig { params(file: ::RBI::File).void }
3536
+ def visit_file(file); end
3537
+
3538
+ private
3539
+
3540
+ sig { params(node: ::RBI::Arg).void }
3541
+ def visit_arg(node); end
3542
+
3543
+ sig { params(node: ::RBI::AttrAccessor).void }
3544
+ def visit_attr_accessor(node); end
3545
+
3546
+ sig { params(node: ::RBI::AttrReader).void }
3547
+ def visit_attr_reader(node); end
3548
+
3549
+ sig { params(node: ::RBI::AttrWriter).void }
3550
+ def visit_attr_writer(node); end
3551
+
3552
+ sig { params(node: ::RBI::BlankLine).void }
3553
+ def visit_blank_line(node); end
3554
+
3555
+ sig { params(node: ::RBI::BlockParam).void }
3556
+ def visit_block_param(node); end
3557
+
3558
+ sig { params(node: ::RBI::Class).void }
3559
+ def visit_class(node); end
3560
+
3561
+ sig { params(node: ::RBI::Comment).void }
3562
+ def visit_comment(node); end
3563
+
3564
+ sig { params(node: ::RBI::ConflictTree).void }
3565
+ def visit_conflict_tree(node); end
3566
+
3567
+ sig { params(node: ::RBI::Const).void }
3568
+ def visit_const(node); end
3569
+
3570
+ sig { params(node: ::RBI::Extend).void }
3571
+ def visit_extend(node); end
3572
+
3573
+ sig { params(node: ::RBI::Group).void }
3574
+ def visit_group(node); end
3575
+
3576
+ sig { params(node: ::RBI::Helper).void }
3577
+ def visit_helper(node); end
3578
+
3579
+ sig { params(node: ::RBI::Include).void }
3580
+ def visit_include(node); end
3581
+
3582
+ sig { params(node: ::RBI::KwArg).void }
3583
+ def visit_kw_arg(node); end
3584
+
3585
+ sig { params(node: ::RBI::KwOptParam).void }
3586
+ def visit_kw_opt_param(node); end
3587
+
3588
+ sig { params(node: ::RBI::KwParam).void }
3589
+ def visit_kw_param(node); end
3590
+
3591
+ sig { params(node: ::RBI::KwRestParam).void }
3592
+ def visit_kw_rest_param(node); end
3593
+
3594
+ sig { params(node: ::RBI::Method).void }
3595
+ def visit_method(node); end
3596
+
3597
+ sig { params(node: ::RBI::MixesInClassMethods).void }
3598
+ def visit_mixes_in_class_methods(node); end
3599
+
3600
+ sig { params(node: ::RBI::Module).void }
3601
+ def visit_module(node); end
3602
+
3603
+ sig { params(node: ::RBI::OptParam).void }
3604
+ def visit_opt_param(node); end
3605
+
3606
+ sig { params(node: ::RBI::Private).void }
3607
+ def visit_private(node); end
3608
+
3609
+ sig { params(node: ::RBI::Protected).void }
3610
+ def visit_protected(node); end
3611
+
3612
+ sig { params(node: ::RBI::Public).void }
3613
+ def visit_public(node); end
3614
+
3615
+ sig { params(node: ::RBI::RBSComment).void }
3616
+ def visit_rbs_comment(node); end
3617
+
3618
+ sig { params(node: ::RBI::ReqParam).void }
3619
+ def visit_req_param(node); end
3620
+
3621
+ sig { params(node: ::RBI::RequiresAncestor).void }
3622
+ def visit_requires_ancestor(node); end
3623
+
3624
+ sig { params(node: ::RBI::RestParam).void }
3625
+ def visit_rest_param(node); end
3626
+
3627
+ sig { params(node: ::RBI::ScopeConflict).void }
3628
+ def visit_scope_conflict(node); end
3629
+
3630
+ sig { params(node: ::RBI::Send).void }
3631
+ def visit_send(node); end
3632
+
3633
+ sig { params(node: ::RBI::Sig).void }
3634
+ def visit_sig(node); end
3635
+
3636
+ sig { params(node: ::RBI::SigParam).void }
3637
+ def visit_sig_param(node); end
3638
+
3639
+ sig { params(node: ::RBI::SingletonClass).void }
3640
+ def visit_singleton_class(node); end
3641
+
3642
+ sig { params(node: ::RBI::Struct).void }
3643
+ def visit_struct(node); end
3644
+
3645
+ sig { params(node: ::RBI::TEnum).void }
3646
+ def visit_tenum(node); end
3647
+
3648
+ sig { params(node: ::RBI::TEnumBlock).void }
3649
+ def visit_tenum_block(node); end
3650
+
3651
+ sig { params(node: ::RBI::TEnumValue).void }
3652
+ def visit_tenum_value(node); end
3653
+
3654
+ sig { params(node: ::RBI::Tree).void }
3655
+ def visit_tree(node); end
3656
+
3657
+ sig { params(node: ::RBI::TStruct).void }
3658
+ def visit_tstruct(node); end
3659
+
3660
+ sig { params(node: ::RBI::TStructConst).void }
3661
+ def visit_tstruct_const(node); end
3662
+
3663
+ sig { params(node: ::RBI::TStructProp).void }
3664
+ def visit_tstruct_prop(node); end
3665
+
3666
+ sig { params(node: ::RBI::TypeMember).void }
3667
+ def visit_type_member(node); end
3668
+
3669
+ sig { params(node: ::RBI::VisibilityGroup).void }
3670
+ def visit_visibility_group(node); end
3671
+ end
3672
+
3673
+ class RBI::VisitorError < ::RBI::Error; end