m2m_keygen 0.4.9 → 0.5.1

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.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/.overcommit.yml +4 -7
  3. data/.rubocop.yml +19 -16
  4. data/.ruby-version +1 -1
  5. data/.streerc +1 -0
  6. data/.tool-versions +1 -1
  7. data/CHANGELOG.md +70 -1
  8. data/Gemfile +2 -2
  9. data/Gemfile.lock +135 -158
  10. data/README.md +64 -78
  11. data/docs/MIGRATING.md +69 -0
  12. data/docs/SPEC.md +245 -0
  13. data/examples/nonce_store/postgres.rb +40 -0
  14. data/examples/nonce_store/redis.rb +23 -0
  15. data/gemfiles/rack_2.gemfile +5 -0
  16. data/gemfiles/rack_3.gemfile +5 -0
  17. data/lib/m2m_keygen/canonicalizer.rb +57 -0
  18. data/lib/m2m_keygen/nonce_store/disabled.rb +19 -0
  19. data/lib/m2m_keygen/nonce_store/memory.rb +64 -0
  20. data/lib/m2m_keygen/nonce_store.rb +18 -0
  21. data/lib/m2m_keygen/rack_validator.rb +86 -19
  22. data/lib/m2m_keygen/request_signer/signed_request.rb +10 -0
  23. data/lib/m2m_keygen/request_signer.rb +118 -0
  24. data/lib/m2m_keygen/signature.rb +41 -39
  25. data/lib/m2m_keygen/types/params_type.rb +6 -17
  26. data/lib/m2m_keygen/version.rb +1 -1
  27. data/lib/m2m_keygen.rb +6 -0
  28. data/m2m_keygen.gemspec +12 -14
  29. data/sorbet/config +1 -0
  30. data/sorbet/rbi/gems/.gitattributes +1 -0
  31. data/sorbet/rbi/gems/{ast@2.4.2.rbi → ast@2.4.3.rbi} +45 -79
  32. data/sorbet/rbi/gems/{benchmark@0.2.0.rbi → benchmark@0.5.0.rbi} +91 -58
  33. data/sorbet/rbi/gems/bundler-audit@0.9.3.rbi +397 -0
  34. data/sorbet/rbi/gems/byebug@13.0.0.rbi +3651 -0
  35. data/sorbet/rbi/gems/childprocess@5.1.0.rbi +336 -0
  36. data/sorbet/rbi/gems/concurrent-ruby@1.3.7.rbi +384 -0
  37. data/sorbet/rbi/gems/{diff-lcs@1.5.0.rbi → diff-lcs@1.6.2.rbi} +189 -199
  38. data/sorbet/rbi/gems/{docile@1.4.0.rbi → docile@1.4.1.rbi} +147 -147
  39. data/sorbet/rbi/gems/dotenv@3.2.0.rbi +267 -0
  40. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  41. data/sorbet/rbi/gems/{faker@2.22.0.rbi → faker@3.8.0.rbi} +8468 -3829
  42. data/sorbet/rbi/gems/{ffi@1.15.5.rbi → ffi@1.17.4.rbi} +1 -0
  43. data/sorbet/rbi/gems/{formatador@1.1.0.rbi → formatador@1.2.3.rbi} +1 -0
  44. data/sorbet/rbi/gems/{guard@2.18.0.rbi → guard@2.20.1.rbi} +1 -0
  45. data/sorbet/rbi/gems/{i18n@1.12.0.rbi → i18n@1.15.2.rbi} +687 -827
  46. data/sorbet/rbi/gems/io-console@0.8.2.rbi +9 -0
  47. data/sorbet/rbi/gems/{json@2.6.2.rbi → json@2.20.0.rbi} +994 -252
  48. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  49. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
  50. data/sorbet/rbi/gems/listen@3.10.0.rbi +9 -0
  51. data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
  52. data/sorbet/rbi/gems/{lumberjack@1.2.8.rbi → lumberjack@1.4.2.rbi} +1 -0
  53. data/sorbet/rbi/gems/{method_source@1.0.0.rbi → method_source@1.1.0.rbi} +111 -90
  54. data/sorbet/rbi/gems/{overcommit@0.59.1.rbi → overcommit@0.71.0.rbi} +503 -647
  55. data/sorbet/rbi/gems/parallel@2.1.0.rbi +321 -0
  56. data/sorbet/rbi/gems/parser@3.3.11.1.rbi +5229 -0
  57. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +878 -0
  58. data/sorbet/rbi/gems/prism@1.9.0.rbi +42224 -0
  59. data/sorbet/rbi/gems/pry-byebug@3.12.0.rbi +481 -0
  60. data/sorbet/rbi/gems/{pry@0.14.1.rbi → pry@0.16.0.rbi} +2567 -3550
  61. data/sorbet/rbi/gems/{racc@1.6.0.rbi → racc@1.8.1.rbi} +54 -40
  62. data/sorbet/rbi/gems/rack@3.2.6.rbi +4653 -0
  63. data/sorbet/rbi/gems/{rake@13.0.6.rbi → rake@13.4.2.rbi} +963 -732
  64. data/sorbet/rbi/gems/{rb-inotify@0.10.1.rbi → rb-inotify@0.11.1.rbi} +1 -0
  65. data/sorbet/rbi/gems/rbi@0.3.14.rbi +5519 -0
  66. data/sorbet/rbi/gems/rbs@4.0.3.rbi +6908 -0
  67. data/sorbet/rbi/gems/regexp_parser@2.12.0.rbi +3398 -0
  68. data/sorbet/rbi/gems/reline@0.6.3.rbi +2446 -0
  69. data/sorbet/rbi/gems/require-hooks@0.4.0.rbi +152 -0
  70. data/sorbet/rbi/gems/{rexml@3.2.5.rbi → rexml@3.4.4.rbi} +1085 -894
  71. data/sorbet/rbi/gems/rspec-core@3.13.6.rbi +9475 -0
  72. data/sorbet/rbi/gems/rspec-expectations@3.13.5.rbi +6108 -0
  73. data/sorbet/rbi/gems/rspec-mocks@3.13.8.rbi +4787 -0
  74. data/sorbet/rbi/gems/rspec-support@3.13.7.rbi +1274 -0
  75. data/sorbet/rbi/gems/rspec@3.13.2.rbi +15 -0
  76. data/sorbet/rbi/gems/rspec_in_context@1.2.2.rbi +294 -0
  77. data/sorbet/rbi/gems/rubocop-ast@1.49.1.rbi +7140 -0
  78. data/sorbet/rbi/gems/rubocop-faker@1.3.0.rbi +88 -0
  79. data/sorbet/rbi/gems/rubocop-performance@1.26.1.rbi +3403 -0
  80. data/sorbet/rbi/gems/rubocop-sorbet@0.12.0.rbi +2448 -0
  81. data/sorbet/rbi/gems/rubocop@1.88.1.rbi +63103 -0
  82. data/sorbet/rbi/gems/ruby-lsp@0.26.9.rbi +28 -0
  83. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
  84. data/sorbet/rbi/gems/rubydex@0.2.7.rbi +836 -0
  85. data/sorbet/rbi/gems/simplecov-html@0.13.2.rbi +90 -0
  86. data/sorbet/rbi/gems/{simplecov@0.21.2.rbi → simplecov@0.22.0.rbi} +438 -578
  87. data/sorbet/rbi/gems/spoom@1.8.2.rbi +6691 -0
  88. data/sorbet/rbi/gems/syntax_tree@6.3.0.rbi +22090 -0
  89. data/sorbet/rbi/gems/tapioca@0.19.2.rbi +3597 -0
  90. data/sorbet/rbi/gems/{thor@1.2.1.rbi → thor@1.5.0.rbi} +1085 -1171
  91. data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
  92. data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +130 -0
  93. data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +332 -0
  94. data/sorbet/rbi/gems/{yard-sorbet@0.7.0.rbi → yard-sorbet@0.9.0.rbi} +142 -99
  95. data/sorbet/rbi/gems/{yard@0.9.28.rbi → yard@0.9.44.rbi} +5350 -6316
  96. data/sorbet/rbi/gems/zeitwerk@2.8.2.rbi +1178 -0
  97. metadata +105 -111
  98. data/.prettierrc.js +0 -4
  99. data/docs/M2mKeygen/Error.html +0 -135
  100. data/docs/M2mKeygen/ParamsEncoder.html +0 -321
  101. data/docs/M2mKeygen/RackValidator.html +0 -533
  102. data/docs/M2mKeygen/Signature.html +0 -680
  103. data/docs/M2mKeygen/Types.html +0 -147
  104. data/docs/M2mKeygen.html +0 -157
  105. data/docs/_index.html +0 -182
  106. data/docs/class_list.html +0 -51
  107. data/docs/css/common.css +0 -1
  108. data/docs/css/full_list.css +0 -58
  109. data/docs/css/style.css +0 -497
  110. data/docs/file.README.html +0 -230
  111. data/docs/file_list.html +0 -56
  112. data/docs/frames.html +0 -17
  113. data/docs/index.html +0 -230
  114. data/docs/js/app.js +0 -314
  115. data/docs/js/full_list.js +0 -216
  116. data/docs/js/jquery.js +0 -4
  117. data/docs/method_list.html +0 -139
  118. data/docs/top-level-namespace.html +0 -110
  119. data/lib/m2m_keygen/params_encoder.rb +0 -56
  120. data/package.json +0 -12
  121. data/sig/m2m_keygen.rbs +0 -4
  122. data/sorbet/rbi/gems/activesupport@7.0.3.1.rbi +0 -18608
  123. data/sorbet/rbi/gems/backport@1.2.0.rbi +0 -522
  124. data/sorbet/rbi/gems/bundler-audit@0.9.1.rbi +0 -308
  125. data/sorbet/rbi/gems/byebug@11.1.3.rbi +0 -3603
  126. data/sorbet/rbi/gems/childprocess@4.1.0.rbi +0 -401
  127. data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +0 -11581
  128. data/sorbet/rbi/gems/dotenv@2.8.1.rbi +0 -234
  129. data/sorbet/rbi/gems/e2mmap@0.1.0.rbi +0 -8
  130. data/sorbet/rbi/gems/haml@5.2.2.rbi +0 -3190
  131. data/sorbet/rbi/gems/jaro_winkler@1.5.4.rbi +0 -19
  132. data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +0 -133
  133. data/sorbet/rbi/gems/kramdown@2.4.0.rbi +0 -3261
  134. data/sorbet/rbi/gems/listen@3.7.1.rbi +0 -1181
  135. data/sorbet/rbi/gems/minitest@5.16.3.rbi +0 -1459
  136. data/sorbet/rbi/gems/nokogiri@1.13.8.rbi +0 -6514
  137. data/sorbet/rbi/gems/parallel@1.22.1.rbi +0 -277
  138. data/sorbet/rbi/gems/parser@3.1.2.1.rbi +0 -6826
  139. data/sorbet/rbi/gems/prettier@3.2.0.rbi +0 -22
  140. data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +0 -8
  141. data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +0 -1222
  142. data/sorbet/rbi/gems/rack@2.2.4.rbi +0 -5630
  143. data/sorbet/rbi/gems/rbi@0.0.15.rbi +0 -3007
  144. data/sorbet/rbi/gems/rbs@2.6.0.rbi +0 -8
  145. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +0 -3366
  146. data/sorbet/rbi/gems/reverse_markdown@2.1.1.rbi +0 -389
  147. data/sorbet/rbi/gems/rspec-core@3.11.0.rbi +0 -10786
  148. data/sorbet/rbi/gems/rspec-expectations@3.11.0.rbi +0 -8170
  149. data/sorbet/rbi/gems/rspec-mocks@3.11.1.rbi +0 -5385
  150. data/sorbet/rbi/gems/rspec-support@3.11.0.rbi +0 -1746
  151. data/sorbet/rbi/gems/rspec@3.11.0.rbi +0 -187
  152. data/sorbet/rbi/gems/rspec_in_context@1.1.0.3.rbi +0 -1113
  153. data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +0 -7044
  154. data/sorbet/rbi/gems/rubocop-faker@1.1.0.rbi +0 -106
  155. data/sorbet/rbi/gems/rubocop-performance@1.14.3.rbi +0 -2982
  156. data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +0 -990
  157. data/sorbet/rbi/gems/rubocop@1.35.1.rbi +0 -52002
  158. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +0 -1239
  159. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +0 -219
  160. data/sorbet/rbi/gems/solargraph@0.46.0.rbi +0 -9075
  161. data/sorbet/rbi/gems/spoom@1.1.12.rbi +0 -2369
  162. data/sorbet/rbi/gems/syntax_tree-haml@1.3.1.rbi +0 -8
  163. data/sorbet/rbi/gems/syntax_tree-rbs@0.5.0.rbi +0 -8
  164. data/sorbet/rbi/gems/syntax_tree@3.5.0.rbi +0 -8
  165. data/sorbet/rbi/gems/tapioca@0.9.4.rbi +0 -2946
  166. data/sorbet/rbi/gems/temple@0.8.2.rbi +0 -1712
  167. data/sorbet/rbi/gems/tilt@2.0.11.rbi +0 -742
  168. data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +0 -5914
  169. data/sorbet/rbi/gems/unicode-display_width@2.2.0.rbi +0 -48
  170. data/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -4529
  171. data/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -2553
  172. data/sorbet/rbi/gems/zeitwerk@2.6.0.rbi +0 -867
  173. data/sorbet/rbi/manual.rbi +0 -7
  174. data/yarn.lock +0 -20
@@ -0,0 +1,878 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `prettier_print` gem.
5
+ # Please instead update this file by running `bin/tapioca gem prettier_print`.
6
+
7
+
8
+ # This class implements a pretty printing algorithm. It finds line breaks and
9
+ # nice indentations for grouped structure.
10
+ #
11
+ # By default, the class assumes that primitive elements are strings and each
12
+ # byte in the strings is a single column in width. But it can be used for other
13
+ # situations by giving suitable arguments for some methods:
14
+ #
15
+ # * newline object and space generation block for PrettierPrint.new
16
+ # * optional width argument for PrettierPrint#text
17
+ # * PrettierPrint#breakable
18
+ #
19
+ # There are several candidate uses:
20
+ # * text formatting using proportional fonts
21
+ # * multibyte characters which has columns different to number of bytes
22
+ # * non-string formatting
23
+ #
24
+ # == Usage
25
+ #
26
+ # To use this module, you will need to generate a tree of print nodes that
27
+ # represent indentation and newline behavior before it gets sent to the printer.
28
+ # Each node has different semantics, depending on the desired output.
29
+ #
30
+ # The most basic node is a Text node. This represents plain text content that
31
+ # cannot be broken up even if it doesn't fit on one line. You would create one
32
+ # of those with the text method, as in:
33
+ #
34
+ # PrettierPrint.format { |q| q.text('my content') }
35
+ #
36
+ # No matter what the desired output width is, the output for the snippet above
37
+ # will always be the same.
38
+ #
39
+ # If you want to allow the printer to break up the content on the space
40
+ # character when there isn't enough width for the full string on the same line,
41
+ # you can use the Breakable and Group nodes. For example:
42
+ #
43
+ # PrettierPrint.format do |q|
44
+ # q.group do
45
+ # q.text("my")
46
+ # q.breakable
47
+ # q.text("content")
48
+ # end
49
+ # end
50
+ #
51
+ # Now, if everything fits on one line (depending on the maximum width specified)
52
+ # then it will be the same output as the first example. If, however, there is
53
+ # not enough room on the line, then you will get two lines of output, one for
54
+ # the first string and one for the second.
55
+ #
56
+ # There are other nodes for the print tree as well, described in the
57
+ # documentation below. They control alignment, indentation, conditional
58
+ # formatting, and more.
59
+ #
60
+ # == References
61
+ # Christian Lindig, Strictly Pretty, March 2000
62
+ # https://lindig.github.io/papers/strictly-pretty-2000.pdf
63
+ #
64
+ # Philip Wadler, A prettier printer, March 1998
65
+ # https://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf
66
+ #
67
+ # pkg:gem/prettier_print#lib/prettier_print.rb:62
68
+ class PrettierPrint
69
+ # Creates a buffer for pretty printing.
70
+ #
71
+ # +output+ is an output target. If it is not specified, '' is assumed. It
72
+ # should have a << method which accepts the first argument +obj+ of
73
+ # PrettierPrint#text, the first argument +separator+ of PrettierPrint#breakable,
74
+ # the first argument +newline+ of PrettierPrint.new, and the result of a given
75
+ # block for PrettierPrint.new.
76
+ #
77
+ # +maxwidth+ specifies maximum line length. If it is not specified, 80 is
78
+ # assumed. However actual outputs may overflow +maxwidth+ if long
79
+ # non-breakable texts are provided.
80
+ #
81
+ # +newline+ is used for line breaks. "\n" is used if it is not specified.
82
+ #
83
+ # The block is used to generate spaces. ->(n) { ' ' * n } is used if it is not
84
+ # given.
85
+ #
86
+ # pkg:gem/prettier_print#lib/prettier_print.rb:441
87
+ def initialize(output = T.unsafe(nil), maxwidth = T.unsafe(nil), newline = T.unsafe(nil), &genspace); end
88
+
89
+ # This inserts a BreakParent node into the print tree which forces the
90
+ # surrounding and all parent group nodes to break.
91
+ #
92
+ # pkg:gem/prettier_print#lib/prettier_print.rb:814
93
+ def break_parent; end
94
+
95
+ # This says "you can break a line here if necessary", and a +width+\-column
96
+ # text +separator+ is inserted if a line is not broken at the point.
97
+ #
98
+ # If +separator+ is not specified, ' ' is used.
99
+ #
100
+ # If +width+ is not specified, +separator.length+ is used. You will have to
101
+ # specify this when +separator+ is a multibyte character, for example.
102
+ #
103
+ # By default, if the surrounding group is broken and a newline is inserted,
104
+ # the printer will indent the subsequent line up to the current level of
105
+ # indentation. You can disable this behavior with the +indent+ argument if
106
+ # that's not desired (rare).
107
+ #
108
+ # By default, when you insert a Breakable into the print tree, it only breaks
109
+ # the surrounding group when the group's contents cannot fit onto the
110
+ # remaining space of the current line. You can force it to break the
111
+ # surrounding group instead if you always want the newline with the +force+
112
+ # argument.
113
+ #
114
+ # There are a few circumstances where you'll want to force the newline into
115
+ # the output but no insert a break parent (because you don't want to
116
+ # necessarily force the groups to break unless they need to). In this case you
117
+ # can pass `force: :skip_break_parent` to this method and it will not insert
118
+ # a break parent.`
119
+ #
120
+ # pkg:gem/prettier_print#lib/prettier_print.rb:802
121
+ def breakable(separator = T.unsafe(nil), width = T.unsafe(nil), indent: T.unsafe(nil), force: T.unsafe(nil)); end
122
+
123
+ # Another very common breakable call you receive while formatting is an
124
+ # empty string in flat mode and a newline in break mode. Similar to
125
+ # breakable_space, this is here for avoid unnecessary calculation.
126
+ #
127
+ # pkg:gem/prettier_print#lib/prettier_print.rb:646
128
+ def breakable_empty; end
129
+
130
+ # The final of the very common breakable calls you receive while formatting
131
+ # is the normal breakable space but with the addition of the break_parent.
132
+ #
133
+ # pkg:gem/prettier_print#lib/prettier_print.rb:652
134
+ def breakable_force; end
135
+
136
+ # This is the same shortcut as breakable_force, except that it doesn't indent
137
+ # the next line. This is necessary if you're trying to preserve some custom
138
+ # formatting like a multi-line string.
139
+ #
140
+ # pkg:gem/prettier_print#lib/prettier_print.rb:660
141
+ def breakable_return; end
142
+
143
+ # The vast majority of breakable calls you receive while formatting are a
144
+ # space in flat mode and a newline in break mode. Since this is so common,
145
+ # we have a method here to skip past unnecessary calculation.
146
+ #
147
+ # pkg:gem/prettier_print#lib/prettier_print.rb:639
148
+ def breakable_space; end
149
+
150
+ # This is an output buffer that wraps the output object and provides
151
+ # additional functionality depending on its type.
152
+ #
153
+ # This defaults to Buffer::StringBuffer.new("".dup)
154
+ #
155
+ # pkg:gem/prettier_print#lib/prettier_print.rb:400
156
+ def buffer; end
157
+
158
+ # A convenience method which is same as follows:
159
+ #
160
+ # text(",")
161
+ # breakable
162
+ #
163
+ # pkg:gem/prettier_print#lib/prettier_print.rb:669
164
+ def comma_breakable; end
165
+
166
+ # Returns the group most recently added to the stack.
167
+ #
168
+ # Contrived example:
169
+ # out = ""
170
+ # => ""
171
+ # q = PrettierPrint.new(out)
172
+ # => #<PrettierPrint:0x0>
173
+ # q.group {
174
+ # q.text q.current_group.inspect
175
+ # q.text q.newline
176
+ # q.group(q.current_group.depth + 1) {
177
+ # q.text q.current_group.inspect
178
+ # q.text q.newline
179
+ # q.group(q.current_group.depth + 1) {
180
+ # q.text q.current_group.inspect
181
+ # q.text q.newline
182
+ # q.group(q.current_group.depth + 1) {
183
+ # q.text q.current_group.inspect
184
+ # q.text q.newline
185
+ # }
186
+ # }
187
+ # }
188
+ # }
189
+ # => 284
190
+ # puts out
191
+ # #<PrettierPrint::Group:0x0 @depth=1>
192
+ # #<PrettierPrint::Group:0x0 @depth=2>
193
+ # #<PrettierPrint::Group:0x0 @depth=3>
194
+ # #<PrettierPrint::Group:0x0 @depth=4>
195
+ #
196
+ # pkg:gem/prettier_print#lib/prettier_print.rb:484
197
+ def current_group; end
198
+
199
+ # This is similar to #breakable except the decision to break or not is
200
+ # determined individually.
201
+ #
202
+ # Two #fill_breakable under a group may cause 4 results:
203
+ # (break,break), (break,non-break), (non-break,break), (non-break,non-break).
204
+ # This is different to #breakable because two #breakable under a group
205
+ # may cause 2 results: (break,break), (non-break,non-break).
206
+ #
207
+ # The text +separator+ is inserted if a line is not broken at this point.
208
+ #
209
+ # If +separator+ is not specified, ' ' is used.
210
+ #
211
+ # If +width+ is not specified, +separator.length+ is used. You will have to
212
+ # specify this when +separator+ is a multibyte character, for example.
213
+ #
214
+ # pkg:gem/prettier_print#lib/prettier_print.rb:688
215
+ def fill_breakable(separator = T.unsafe(nil), width = T.unsafe(nil)); end
216
+
217
+ # Flushes all of the generated print tree onto the output buffer, then clears
218
+ # the generated tree from memory.
219
+ #
220
+ # pkg:gem/prettier_print#lib/prettier_print.rb:490
221
+ def flush(base_indentation = T.unsafe(nil)); end
222
+
223
+ # An object that responds to call that takes one argument, of an Integer, and
224
+ # returns the corresponding number of spaces.
225
+ #
226
+ # By default this is: ->(n) { ' ' * n }
227
+ #
228
+ # pkg:gem/prettier_print#lib/prettier_print.rb:416
229
+ def genspace; end
230
+
231
+ # Groups line break hints added in the block. The line break hints are all to
232
+ # be used or not.
233
+ #
234
+ # If +indent+ is specified, the method call is regarded as nested by
235
+ # nest(indent) { ... }.
236
+ #
237
+ # If +open_object+ is specified, <tt>text(open_object, open_width)</tt> is
238
+ # called before grouping. If +close_object+ is specified,
239
+ # <tt>text(close_object, close_width)</tt> is called after grouping.
240
+ #
241
+ # pkg:gem/prettier_print#lib/prettier_print.rb:845
242
+ def group(indent = T.unsafe(nil), open_object = T.unsafe(nil), close_object = T.unsafe(nil), open_width = T.unsafe(nil), close_width = T.unsafe(nil)); end
243
+
244
+ # The stack of groups that are being printed.
245
+ #
246
+ # pkg:gem/prettier_print#lib/prettier_print.rb:419
247
+ def groups; end
248
+
249
+ # Inserts an IfBreak node with the contents of the block being added to its
250
+ # list of nodes that should be printed if the surrounding node breaks. If it
251
+ # doesn't, then you can specify the contents to be printed with the #if_flat
252
+ # method used on the return object from this method. For example,
253
+ #
254
+ # q.if_break { q.text('do') }.if_flat { q.text('{') }
255
+ #
256
+ # In the example above, if the surrounding group is broken it will print 'do'
257
+ # and if it is not it will print '{'.
258
+ #
259
+ # pkg:gem/prettier_print#lib/prettier_print.rb:917
260
+ def if_break; end
261
+
262
+ # This is similar to if_break in that it also inserts an IfBreak node into the
263
+ # print tree, however it's starting from the flat contents, and cannot be used
264
+ # to build the break contents.
265
+ #
266
+ # pkg:gem/prettier_print#lib/prettier_print.rb:936
267
+ def if_flat; end
268
+
269
+ # Very similar to the #nest method, this indents the nested content by one
270
+ # level by inserting an Indent node into the print tree. The contents of the
271
+ # node are determined by the block.
272
+ #
273
+ # pkg:gem/prettier_print#lib/prettier_print.rb:956
274
+ def indent; end
275
+
276
+ # This method calculates the position of the text relative to the current
277
+ # indentation level when the doc has been printed. It's useful for
278
+ # determining how to align text to doc nodes that are already built into the
279
+ # tree.
280
+ #
281
+ # pkg:gem/prettier_print#lib/prettier_print.rb:696
282
+ def last_position(node); end
283
+
284
+ # Inserts a LineSuffix node into the print tree. The contents of the node are
285
+ # determined by the block.
286
+ #
287
+ # pkg:gem/prettier_print#lib/prettier_print.rb:967
288
+ def line_suffix(priority: T.unsafe(nil)); end
289
+
290
+ # The maximum width of a line, before it is separated in to a newline
291
+ #
292
+ # This defaults to 80, and should be an Integer
293
+ #
294
+ # pkg:gem/prettier_print#lib/prettier_print.rb:405
295
+ def maxwidth; end
296
+
297
+ # Increases left margin after newline with +indent+ for line breaks added in
298
+ # the block.
299
+ #
300
+ # pkg:gem/prettier_print#lib/prettier_print.rb:977
301
+ def nest(indent); end
302
+
303
+ # The value that is appended to +output+ to add a new line.
304
+ #
305
+ # This defaults to "\n", and should be String
306
+ #
307
+ # pkg:gem/prettier_print#lib/prettier_print.rb:410
308
+ def newline; end
309
+
310
+ # The output object. It represents the final destination of the contents of
311
+ # the print tree. It should respond to <<.
312
+ #
313
+ # This defaults to "".dup
314
+ #
315
+ # pkg:gem/prettier_print#lib/prettier_print.rb:394
316
+ def output; end
317
+
318
+ # This method will remove any breakables from the list of contents so that
319
+ # no newlines are present in the output. If a newline is being forced into
320
+ # the output, the replace value will be used.
321
+ #
322
+ # pkg:gem/prettier_print#lib/prettier_print.rb:721
323
+ def remove_breaks(node, replace = T.unsafe(nil)); end
324
+
325
+ # Adds a separated list.
326
+ # The list is separated by comma with breakable space, by default.
327
+ #
328
+ # #seplist iterates the +list+ using +iter_method+.
329
+ # It yields each object to the block given for #seplist.
330
+ # The procedure +separator_proc+ is called between each yields.
331
+ #
332
+ # If the iteration is zero times, +separator_proc+ is not called at all.
333
+ #
334
+ # If +separator_proc+ is nil or not given,
335
+ # +lambda { comma_breakable }+ is used.
336
+ # If +iter_method+ is not given, :each is used.
337
+ #
338
+ # For example, following 3 code fragments has similar effect.
339
+ #
340
+ # q.seplist([1,2,3]) {|v| xxx v }
341
+ #
342
+ # q.seplist([1,2,3], lambda { q.comma_breakable }, :each) {|v| xxx v }
343
+ #
344
+ # xxx 1
345
+ # q.comma_breakable
346
+ # xxx 2
347
+ # q.comma_breakable
348
+ # xxx 3
349
+ #
350
+ # pkg:gem/prettier_print#lib/prettier_print.rb:760
351
+ def seplist(list, sep = T.unsafe(nil), iter_method = T.unsafe(nil)); end
352
+
353
+ # The current array of contents that calls to methods that generate print tree
354
+ # nodes will append to.
355
+ #
356
+ # pkg:gem/prettier_print#lib/prettier_print.rb:423
357
+ def target; end
358
+
359
+ # This adds +object+ as a text of +width+ columns in width.
360
+ #
361
+ # If +width+ is not specified, object.length is used.
362
+ #
363
+ # pkg:gem/prettier_print#lib/prettier_print.rb:989
364
+ def text(object = T.unsafe(nil), width = T.unsafe(nil)); end
365
+
366
+ # This inserts a Trim node into the print tree which, when printed, will clear
367
+ # all whitespace at the end of the output buffer. This is useful for the rare
368
+ # case where you need to delete printed indentation and force the next node
369
+ # to start at the beginning of the line.
370
+ #
371
+ # pkg:gem/prettier_print#lib/prettier_print.rb:828
372
+ def trim; end
373
+
374
+ # A convenience method used by a lot of the print tree node builders that
375
+ # temporarily changes the target that the builders will append to.
376
+ #
377
+ # pkg:gem/prettier_print#lib/prettier_print.rb:1007
378
+ def with_target(target); end
379
+
380
+ private
381
+
382
+ # This method returns a boolean as to whether or not the remaining commands
383
+ # fit onto the remaining space on the current line. If we finish printing
384
+ # all of the commands or if we hit a newline, then we return true. Otherwise
385
+ # if we continue printing past the remaining space, we return false.
386
+ #
387
+ # pkg:gem/prettier_print#lib/prettier_print.rb:1019
388
+ def fits?(next_commands, rest_commands, remaining); end
389
+
390
+ # pkg:gem/prettier_print#lib/prettier_print.rb:1091
391
+ def remove_breaks_with(doc, replace); end
392
+
393
+ # Resets the group stack and target array so that this pretty printer object
394
+ # can continue to be used before calling flush again if desired.
395
+ #
396
+ # pkg:gem/prettier_print#lib/prettier_print.rb:1085
397
+ def reset; end
398
+
399
+ class << self
400
+ # This is a convenience method which is same as follows:
401
+ #
402
+ # begin
403
+ # q = PrettierPrint.new(output, maxwidth, newline, &genspace)
404
+ # ...
405
+ # q.flush
406
+ # output
407
+ # end
408
+ #
409
+ # pkg:gem/prettier_print#lib/prettier_print.rb:377
410
+ def format(output = T.unsafe(nil), maxwidth = T.unsafe(nil), newline = T.unsafe(nil), genspace = T.unsafe(nil), indentation = T.unsafe(nil)); end
411
+
412
+ # This is similar to PrettierPrint::format but the result has no breaks.
413
+ #
414
+ # +maxwidth+, +newline+ and +genspace+ are ignored.
415
+ #
416
+ # The invocation of +breakable+ in the block doesn't break a line and is
417
+ # treated as just an invocation of +text+.
418
+ #
419
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:156
420
+ def singleline_format(output = T.unsafe(nil), _maxwidth = T.unsafe(nil), _newline = T.unsafe(nil), _genspace = T.unsafe(nil)); end
421
+ end
422
+ end
423
+
424
+ # A node in the print tree that represents aligning nested nodes to a certain
425
+ # prefix width or string.
426
+ #
427
+ # pkg:gem/prettier_print#lib/prettier_print.rb:65
428
+ class PrettierPrint::Align
429
+ # pkg:gem/prettier_print#lib/prettier_print.rb:68
430
+ def initialize(indent:, contents: T.unsafe(nil)); end
431
+
432
+ # pkg:gem/prettier_print#lib/prettier_print.rb:66
433
+ def contents; end
434
+
435
+ # pkg:gem/prettier_print#lib/prettier_print.rb:66
436
+ def indent; end
437
+
438
+ # pkg:gem/prettier_print#lib/prettier_print.rb:73
439
+ def pretty_print(q); end
440
+ end
441
+
442
+ # pkg:gem/prettier_print#lib/prettier_print.rb:126
443
+ PrettierPrint::BREAKABLE_EMPTY = T.let(T.unsafe(nil), PrettierPrint::Breakable)
444
+
445
+ # pkg:gem/prettier_print#lib/prettier_print.rb:127
446
+ PrettierPrint::BREAKABLE_FORCE = T.let(T.unsafe(nil), PrettierPrint::Breakable)
447
+
448
+ # pkg:gem/prettier_print#lib/prettier_print.rb:128
449
+ PrettierPrint::BREAKABLE_RETURN = T.let(T.unsafe(nil), PrettierPrint::Breakable)
450
+
451
+ # Below here are the most common combination of options that are created when
452
+ # creating new breakables. They are here to cut down on some allocations.
453
+ #
454
+ # pkg:gem/prettier_print#lib/prettier_print.rb:125
455
+ PrettierPrint::BREAKABLE_SPACE = T.let(T.unsafe(nil), PrettierPrint::Breakable)
456
+
457
+ # Since there's really no difference in these instances, just using the same
458
+ # one saves on some allocations.
459
+ #
460
+ # pkg:gem/prettier_print#lib/prettier_print.rb:141
461
+ PrettierPrint::BREAK_PARENT = T.let(T.unsafe(nil), PrettierPrint::BreakParent)
462
+
463
+ # A node in the print tree that forces the surrounding group to print out in
464
+ # the "break" mode as opposed to the "flat" mode. Useful for when you need to
465
+ # force a newline into a group.
466
+ #
467
+ # pkg:gem/prettier_print#lib/prettier_print.rb:133
468
+ class PrettierPrint::BreakParent
469
+ # pkg:gem/prettier_print#lib/prettier_print.rb:134
470
+ def pretty_print(q); end
471
+ end
472
+
473
+ # A node in the print tree that represents a place in the buffer that the
474
+ # content can be broken onto multiple lines.
475
+ #
476
+ # pkg:gem/prettier_print#lib/prettier_print.rb:82
477
+ class PrettierPrint::Breakable
478
+ # pkg:gem/prettier_print#lib/prettier_print.rb:85
479
+ def initialize(separator = T.unsafe(nil), width = T.unsafe(nil), force: T.unsafe(nil), indent: T.unsafe(nil)); end
480
+
481
+ # pkg:gem/prettier_print#lib/prettier_print.rb:97
482
+ def force?; end
483
+
484
+ # pkg:gem/prettier_print#lib/prettier_print.rb:101
485
+ def indent?; end
486
+
487
+ # pkg:gem/prettier_print#lib/prettier_print.rb:105
488
+ def pretty_print(q); end
489
+
490
+ # pkg:gem/prettier_print#lib/prettier_print.rb:83
491
+ def separator; end
492
+
493
+ # pkg:gem/prettier_print#lib/prettier_print.rb:83
494
+ def width; end
495
+ end
496
+
497
+ # When building up the contents in the output buffer, it's convenient to be
498
+ # able to trim trailing whitespace before newlines. If the output object is a
499
+ # string or array or strings, then we can do this with some gsub calls. If
500
+ # not, then this effectively just wraps the output object and forwards on
501
+ # calls to <<.
502
+ #
503
+ # pkg:gem/prettier_print#lib/prettier_print.rb:277
504
+ module PrettierPrint::Buffer
505
+ class << self
506
+ # This is a switch for building the correct output buffer wrapper class for
507
+ # the given output object.
508
+ #
509
+ # pkg:gem/prettier_print#lib/prettier_print.rb:336
510
+ def for(output); end
511
+ end
512
+ end
513
+
514
+ # This is an output buffer that wraps an array output object. It provides a
515
+ # trim! method that trims off trailing whitespace from the last element in
516
+ # the array if it's an unfrozen string using the same method as the
517
+ # StringBuffer.
518
+ #
519
+ # pkg:gem/prettier_print#lib/prettier_print.rb:303
520
+ class PrettierPrint::Buffer::ArrayBuffer
521
+ # pkg:gem/prettier_print#lib/prettier_print.rb:306
522
+ def initialize(output = T.unsafe(nil)); end
523
+
524
+ # pkg:gem/prettier_print#lib/prettier_print.rb:310
525
+ def <<(object); end
526
+
527
+ # pkg:gem/prettier_print#lib/prettier_print.rb:304
528
+ def output; end
529
+
530
+ # pkg:gem/prettier_print#lib/prettier_print.rb:314
531
+ def trim!; end
532
+ end
533
+
534
+ # This is an output buffer that wraps a string output object. It provides a
535
+ # trim! method that trims off trailing whitespace from the string using
536
+ # gsub!.
537
+ #
538
+ # pkg:gem/prettier_print#lib/prettier_print.rb:281
539
+ class PrettierPrint::Buffer::StringBuffer
540
+ # pkg:gem/prettier_print#lib/prettier_print.rb:284
541
+ def initialize(output = T.unsafe(nil)); end
542
+
543
+ # pkg:gem/prettier_print#lib/prettier_print.rb:288
544
+ def <<(object); end
545
+
546
+ # pkg:gem/prettier_print#lib/prettier_print.rb:282
547
+ def output; end
548
+
549
+ # pkg:gem/prettier_print#lib/prettier_print.rb:292
550
+ def trim!; end
551
+ end
552
+
553
+ # When generating spaces after a newline for indentation, by default we
554
+ # generate one space per character needed for indentation. You can change this
555
+ # behavior (for instance to use tabs) by passing a different genspace
556
+ # procedure.
557
+ #
558
+ # pkg:gem/prettier_print#lib/prettier_print.rb:350
559
+ PrettierPrint::DEFAULT_GENSPACE = T.let(T.unsafe(nil), Proc)
560
+
561
+ # The default indentation for printing is zero, assuming that the code starts
562
+ # at the top level. That can be changed if desired to start from a different
563
+ # indentation level.
564
+ #
565
+ # pkg:gem/prettier_print#lib/prettier_print.rb:366
566
+ PrettierPrint::DEFAULT_INDENTATION = T.let(T.unsafe(nil), Integer)
567
+
568
+ # When printing, you can optionally specify the value that should be used
569
+ # whenever a group needs to be broken onto multiple lines. In this case the
570
+ # default is \n.
571
+ #
572
+ # pkg:gem/prettier_print#lib/prettier_print.rb:344
573
+ PrettierPrint::DEFAULT_NEWLINE = T.let(T.unsafe(nil), String)
574
+
575
+ # A node in the print tree that represents a group of items which the printer
576
+ # should try to fit onto one line. This is the basic command to tell the
577
+ # printer when to break. Groups are usually nested, and the printer will try
578
+ # to fit everything on one line, but if it doesn't fit it will break the
579
+ # outermost group first and try again. It will continue breaking groups until
580
+ # everything fits (or there are no more groups to break).
581
+ #
582
+ # pkg:gem/prettier_print#lib/prettier_print.rb:149
583
+ class PrettierPrint::Group
584
+ # pkg:gem/prettier_print#lib/prettier_print.rb:152
585
+ def initialize(depth, contents: T.unsafe(nil)); end
586
+
587
+ # pkg:gem/prettier_print#lib/prettier_print.rb:158
588
+ def break; end
589
+
590
+ # pkg:gem/prettier_print#lib/prettier_print.rb:162
591
+ def break?; end
592
+
593
+ # pkg:gem/prettier_print#lib/prettier_print.rb:150
594
+ def contents; end
595
+
596
+ # pkg:gem/prettier_print#lib/prettier_print.rb:150
597
+ def depth; end
598
+
599
+ # pkg:gem/prettier_print#lib/prettier_print.rb:166
600
+ def pretty_print(q); end
601
+ end
602
+
603
+ # A node in the print tree that represents printing one thing if the
604
+ # surrounding group node is broken and another thing if the surrounding group
605
+ # node is flat.
606
+ #
607
+ # pkg:gem/prettier_print#lib/prettier_print.rb:176
608
+ class PrettierPrint::IfBreak
609
+ # pkg:gem/prettier_print#lib/prettier_print.rb:179
610
+ def initialize(break_contents: T.unsafe(nil), flat_contents: T.unsafe(nil)); end
611
+
612
+ # pkg:gem/prettier_print#lib/prettier_print.rb:177
613
+ def break_contents; end
614
+
615
+ # pkg:gem/prettier_print#lib/prettier_print.rb:177
616
+ def flat_contents; end
617
+
618
+ # pkg:gem/prettier_print#lib/prettier_print.rb:184
619
+ def pretty_print(q); end
620
+ end
621
+
622
+ # A small DSL-like object used for specifying the alternative contents to be
623
+ # printed if the surrounding group doesn't break for an IfBreak node.
624
+ #
625
+ # pkg:gem/prettier_print#lib/prettier_print.rb:874
626
+ class PrettierPrint::IfBreakBuilder
627
+ # pkg:gem/prettier_print#lib/prettier_print.rb:877
628
+ def initialize(q, flat_contents); end
629
+
630
+ # pkg:gem/prettier_print#lib/prettier_print.rb:875
631
+ def flat_contents; end
632
+
633
+ # pkg:gem/prettier_print#lib/prettier_print.rb:882
634
+ def if_flat; end
635
+
636
+ # pkg:gem/prettier_print#lib/prettier_print.rb:875
637
+ def q; end
638
+ end
639
+
640
+ # When we already know that groups are broken, we don't actually need to track
641
+ # the flat versions of the contents. So this builder version is effectively a
642
+ # no-op, but we need it to maintain the same API. The only thing this can
643
+ # impact is that if there's a forced break in the flat contents, then we need
644
+ # to propagate that break up the whole tree.
645
+ #
646
+ # pkg:gem/prettier_print#lib/prettier_print.rb:892
647
+ class PrettierPrint::IfFlatIgnore
648
+ # pkg:gem/prettier_print#lib/prettier_print.rb:895
649
+ def initialize(q); end
650
+
651
+ # pkg:gem/prettier_print#lib/prettier_print.rb:899
652
+ def if_flat; end
653
+
654
+ # pkg:gem/prettier_print#lib/prettier_print.rb:893
655
+ def q; end
656
+ end
657
+
658
+ # A node in the print tree that is a variant of the Align node that indents
659
+ # its contents by one level.
660
+ #
661
+ # pkg:gem/prettier_print#lib/prettier_print.rb:200
662
+ class PrettierPrint::Indent
663
+ # pkg:gem/prettier_print#lib/prettier_print.rb:203
664
+ def initialize(contents: T.unsafe(nil)); end
665
+
666
+ # pkg:gem/prettier_print#lib/prettier_print.rb:201
667
+ def contents; end
668
+
669
+ # pkg:gem/prettier_print#lib/prettier_print.rb:207
670
+ def pretty_print(q); end
671
+ end
672
+
673
+ # A node in the print tree that has its own special buffer for implementing
674
+ # content that should flush before any newline.
675
+ #
676
+ # Useful for implementating trailing content, as it's not always practical to
677
+ # constantly check where the line ends to avoid accidentally printing some
678
+ # content after a line suffix node.
679
+ #
680
+ # pkg:gem/prettier_print#lib/prettier_print.rb:220
681
+ class PrettierPrint::LineSuffix
682
+ # pkg:gem/prettier_print#lib/prettier_print.rb:225
683
+ def initialize(priority: T.unsafe(nil), contents: T.unsafe(nil)); end
684
+
685
+ # pkg:gem/prettier_print#lib/prettier_print.rb:223
686
+ def contents; end
687
+
688
+ # pkg:gem/prettier_print#lib/prettier_print.rb:230
689
+ def pretty_print(q); end
690
+
691
+ # pkg:gem/prettier_print#lib/prettier_print.rb:223
692
+ def priority; end
693
+ end
694
+
695
+ # pkg:gem/prettier_print#lib/prettier_print.rb:221
696
+ PrettierPrint::LineSuffix::DEFAULT_PRIORITY = T.let(T.unsafe(nil), Integer)
697
+
698
+ # There are two modes in printing, break and flat. When we're in break mode,
699
+ # any lines will use their newline, any if-breaks will use their break
700
+ # contents, etc.
701
+ #
702
+ # pkg:gem/prettier_print#lib/prettier_print.rb:356
703
+ PrettierPrint::MODE_BREAK = T.let(T.unsafe(nil), Integer)
704
+
705
+ # This is another print mode much like MODE_BREAK. When we're in flat mode, we
706
+ # attempt to print everything on one line until we either hit a broken group,
707
+ # a forced line, or the maximum width.
708
+ #
709
+ # pkg:gem/prettier_print#lib/prettier_print.rb:361
710
+ PrettierPrint::MODE_FLAT = T.let(T.unsafe(nil), Integer)
711
+
712
+ # PrettierPrint::SingleLine is used by PrettierPrint.singleline_format
713
+ #
714
+ # It is passed to be similar to a PrettierPrint object itself, by responding to
715
+ # all of the same print tree node builder methods, as well as the #flush
716
+ # method.
717
+ #
718
+ # The significant difference here is that there are no line breaks in the
719
+ # output. If an IfBreak node is used, only the flat contents are printed.
720
+ # LineSuffix nodes are printed at the end of the buffer when #flush is called.
721
+ #
722
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:13
723
+ class PrettierPrint::SingleLine
724
+ # Create a PrettierPrint::SingleLine object
725
+ #
726
+ # Arguments:
727
+ # * +output+ - String (or similar) to store rendered text. Needs to respond
728
+ # to '<<'.
729
+ # * +maxwidth+ - Argument position expected to be here for compatibility.
730
+ # This argument is a noop.
731
+ # * +newline+ - Argument position expected to be here for compatibility.
732
+ # This argument is a noop.
733
+ #
734
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:34
735
+ def initialize(output, _maxwidth = T.unsafe(nil), _newline = T.unsafe(nil)); end
736
+
737
+ # Here for compatibility, does nothing.
738
+ #
739
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:64
740
+ def break_parent; end
741
+
742
+ # Appends +separator+ to the text to be output. By default +separator+ is
743
+ # ' '
744
+ #
745
+ # The +width+, +indent+, and +force+ arguments are here for compatibility.
746
+ # They are all noop arguments.
747
+ #
748
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:54
749
+ def breakable(separator = T.unsafe(nil), _width = T.unsafe(nil), indent: T.unsafe(nil), force: T.unsafe(nil)); end
750
+
751
+ # Appends +separator+ to the output buffer. +width+ is a noop here for
752
+ # compatibility.
753
+ #
754
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:69
755
+ def fill_breakable(separator = T.unsafe(nil), _width = T.unsafe(nil)); end
756
+
757
+ # Flushes the line suffixes onto the output buffer.
758
+ #
759
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:41
760
+ def flush; end
761
+
762
+ # Opens a block for grouping objects to be pretty printed.
763
+ #
764
+ # Arguments:
765
+ # * +indent+ - noop argument. Present for compatibility.
766
+ # * +open_obj+ - text appended before the &block. Default is ''
767
+ # * +close_obj+ - text appended after the &block. Default is ''
768
+ # * +open_width+ - noop argument. Present for compatibility.
769
+ # * +close_width+ - noop argument. Present for compatibility.
770
+ #
771
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:90
772
+ def group(_indent = T.unsafe(nil), open_object = T.unsafe(nil), close_object = T.unsafe(nil), _open_width = T.unsafe(nil), _close_width = T.unsafe(nil)); end
773
+
774
+ # Effectively unnecessary, but here for compatibility.
775
+ #
776
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:113
777
+ def if_break; end
778
+
779
+ # Also effectively unnecessary, but here for compatibility.
780
+ #
781
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:118
782
+ def if_flat; end
783
+
784
+ # A noop that immediately yields.
785
+ #
786
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:122
787
+ def indent; end
788
+
789
+ # Changes the target output buffer to the line suffix output buffer which
790
+ # will get flushed at the end of printing.
791
+ #
792
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:128
793
+ def line_suffix; end
794
+
795
+ # A buffer output that wraps any calls to line_suffix that will be flushed
796
+ # at the end of printing.
797
+ #
798
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:23
799
+ def line_suffixes; end
800
+
801
+ # Takes +indent+ arg, but does nothing with it.
802
+ #
803
+ # Yields to a block.
804
+ #
805
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:137
806
+ def nest(_indent); end
807
+
808
+ # The output object. It stores rendered text and should respond to <<.
809
+ #
810
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:15
811
+ def output; end
812
+
813
+ # The current array of contents that the print tree builder methods should
814
+ # append to.
815
+ #
816
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:19
817
+ def target; end
818
+
819
+ # Add +object+ to the text to be output.
820
+ #
821
+ # +width+ argument is here for compatibility. It is a noop argument.
822
+ #
823
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:144
824
+ def text(object = T.unsafe(nil), _width = T.unsafe(nil)); end
825
+
826
+ # Immediately trims the output buffer.
827
+ #
828
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:74
829
+ def trim; end
830
+ end
831
+
832
+ # A class that wraps the ability to call #if_flat. The contents of the
833
+ # #if_flat block are executed immediately, so effectively this class and the
834
+ # #if_break method that triggers it are unnecessary, but they're here to
835
+ # maintain compatibility.
836
+ #
837
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:106
838
+ class PrettierPrint::SingleLine::IfBreakBuilder
839
+ # pkg:gem/prettier_print#lib/prettier_print/single_line.rb:107
840
+ def if_flat; end
841
+ end
842
+
843
+ # Since all of the instances here are the same, we can reuse the same one to
844
+ # cut down on allocations.
845
+ #
846
+ # pkg:gem/prettier_print#lib/prettier_print.rb:270
847
+ PrettierPrint::TRIM = T.let(T.unsafe(nil), PrettierPrint::Trim)
848
+
849
+ # A node in the print tree that represents plain content that cannot be broken
850
+ # up (by default this assumes strings, but it can really be anything).
851
+ #
852
+ # pkg:gem/prettier_print#lib/prettier_print.rb:239
853
+ class PrettierPrint::Text
854
+ # pkg:gem/prettier_print#lib/prettier_print.rb:242
855
+ def initialize; end
856
+
857
+ # pkg:gem/prettier_print#lib/prettier_print.rb:247
858
+ def add(object: T.unsafe(nil), width: T.unsafe(nil)); end
859
+
860
+ # pkg:gem/prettier_print#lib/prettier_print.rb:240
861
+ def objects; end
862
+
863
+ # pkg:gem/prettier_print#lib/prettier_print.rb:252
864
+ def pretty_print(q); end
865
+
866
+ # pkg:gem/prettier_print#lib/prettier_print.rb:240
867
+ def width; end
868
+ end
869
+
870
+ # A node in the print tree that represents trimming all of the indentation of
871
+ # the current line, in the rare case that you need to ignore the indentation
872
+ # that you've already created. This node should be placed after a Breakable.
873
+ #
874
+ # pkg:gem/prettier_print#lib/prettier_print.rb:262
875
+ class PrettierPrint::Trim
876
+ # pkg:gem/prettier_print#lib/prettier_print.rb:263
877
+ def pretty_print(q); end
878
+ end