xlsxrb 0.1.18 → 0.2.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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +200 -0
  3. data/README.md +35 -12
  4. data/lib/ruby_lsp/xlsxrb/completion_listener.rb +410 -80
  5. data/lib/xlsxrb/chart_builder.rb +251 -386
  6. data/lib/xlsxrb/dsl_helpers.rb +169 -68
  7. data/lib/xlsxrb/elements/cell.rb +37 -157
  8. data/lib/xlsxrb/elements/column.rb +11 -19
  9. data/lib/xlsxrb/elements/coordinate_access.rb +15 -86
  10. data/lib/xlsxrb/elements/image.rb +5 -72
  11. data/lib/xlsxrb/elements/metadata.rb +463 -817
  12. data/lib/xlsxrb/elements/row.rb +27 -145
  13. data/lib/xlsxrb/elements/styles.rb +30 -88
  14. data/lib/xlsxrb/elements/types.rb +6 -99
  15. data/lib/xlsxrb/elements/workbook.rb +19 -126
  16. data/lib/xlsxrb/elements/worksheet.rb +45 -316
  17. data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +4 -1
  18. data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +7 -7
  19. data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +32 -17
  20. data/lib/xlsxrb/ooxml/reader.rb +49 -51
  21. data/lib/xlsxrb/ooxml/styles_parser.rb +26 -2
  22. data/lib/xlsxrb/ooxml/utils.rb +15 -2
  23. data/lib/xlsxrb/ooxml/workbook_parser.rb +0 -1
  24. data/lib/xlsxrb/ooxml/workbook_writer.rb +184 -94
  25. data/lib/xlsxrb/ooxml/worksheet_parser.rb +61 -29
  26. data/lib/xlsxrb/ooxml/worksheet_writer.rb +353 -261
  27. data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +28 -11
  28. data/lib/xlsxrb/ooxml/writer/features_xml.rb +62 -16
  29. data/lib/xlsxrb/ooxml/writer/styles_xml.rb +1 -1
  30. data/lib/xlsxrb/ooxml/writer.rb +106 -42
  31. data/lib/xlsxrb/ooxml/xml_builder.rb +18 -0
  32. data/lib/xlsxrb/ooxml/xml_parser.rb +78 -5
  33. data/lib/xlsxrb/ooxml/zip_reader.rb +65 -15
  34. data/lib/xlsxrb/ooxml/zip_writer.rb +119 -30
  35. data/lib/xlsxrb/stream_row.rb +14 -118
  36. data/lib/xlsxrb/stream_sheet.rb +14 -261
  37. data/lib/xlsxrb/stream_writer.rb +807 -1537
  38. data/lib/xlsxrb/style_builder.rb +715 -593
  39. data/lib/xlsxrb/version.rb +1 -1
  40. data/lib/xlsxrb/workbook_builder.rb +403 -286
  41. data/lib/xlsxrb/worksheet_builder.rb +1297 -1458
  42. data/lib/xlsxrb.rb +281 -1079
  43. data/sig/generated/xlsxrb/chart_builder.rbs +202 -205
  44. data/sig/generated/xlsxrb/dsl_helpers.rbs +92 -16
  45. data/sig/generated/xlsxrb/elements/cell.rbs +12 -76
  46. data/sig/generated/xlsxrb/elements/column.rbs +0 -7
  47. data/sig/generated/xlsxrb/elements/coordinate_access.rbs +5 -41
  48. data/sig/generated/xlsxrb/elements/image.rbs +3 -29
  49. data/sig/generated/xlsxrb/elements/metadata.rbs +138 -151
  50. data/sig/generated/xlsxrb/elements/row.rbs +10 -53
  51. data/sig/generated/xlsxrb/elements/styles.rbs +1 -39
  52. data/sig/generated/xlsxrb/elements/workbook.rbs +14 -78
  53. data/sig/generated/xlsxrb/elements/worksheet.rbs +5 -121
  54. data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +0 -4
  55. data/sig/generated/xlsxrb/ooxml/reader.rbs +0 -3
  56. data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +1 -1
  57. data/sig/generated/xlsxrb/ooxml/utils.rbs +13 -3
  58. data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +17 -0
  59. data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +16 -0
  60. data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +58 -3
  61. data/sig/generated/xlsxrb/ooxml/writer/features_xml.rbs +10 -0
  62. data/sig/generated/xlsxrb/ooxml/writer.rbs +20 -14
  63. data/sig/generated/xlsxrb/ooxml/xml_builder.rbs +12 -0
  64. data/sig/generated/xlsxrb/ooxml/xml_parser.rbs +70 -0
  65. data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +22 -7
  66. data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +26 -1
  67. data/sig/generated/xlsxrb/stream_row.rbs +9 -44
  68. data/sig/generated/xlsxrb/stream_sheet.rbs +1 -158
  69. data/sig/generated/xlsxrb/stream_writer.rbs +491 -974
  70. data/sig/generated/xlsxrb/style_builder.rbs +464 -239
  71. data/sig/generated/xlsxrb/workbook_builder.rbs +124 -139
  72. data/sig/generated/xlsxrb/worksheet_builder.rbs +922 -686
  73. data/sig/generated/xlsxrb.rbs +56 -188
  74. data/sig/rexml.rbs +8 -0
  75. metadata +3 -5
  76. data/lib/xlsxrb/utils.rb +0 -251
  77. data/sig/generated/xlsxrb/utils.rbs +0 -200
@@ -9,27 +9,17 @@ module Xlsxrb
9
9
  # sheet.row(["Product", "Revenue"])
10
10
  # sheet.row(["Widget", 1000])
11
11
  # end
12
- # builder.core_property(:creator, "Reporting System")
12
+ # builder.core_properties(creator: "Reporting System")
13
13
  # end
14
14
  #
15
15
  # @api public
16
16
  class WorkbookBuilder
17
+ OMITTED: untyped
18
+
17
19
  # @param strict_excel_mode [Boolean] Whether to enforce Microsoft Excel specifications.
18
- # @param escape_formulas [Boolean] Whether to treat strings starting with formula prefixes as plain text.
19
20
  # @param default_font [Hash, nil] Optional default font options (e.g. `{ name: "Arial", size: 12 }`).
20
- # : (?strict_excel_mode: bool, ?escape_formulas: bool, ?default_font: untyped?) -> void
21
- def initialize: (?strict_excel_mode: bool, ?escape_formulas: bool, ?default_font: untyped?) -> void
22
-
23
- # @return [Boolean] Whether to treat strings starting with formula prefixes as plain text.
24
- # : bool
25
- attr_accessor escape_formulas: untyped
26
-
27
- # Returns whether formula escaping is enabled.
28
- #
29
- # @return [Boolean]
30
- # @api public
31
- # : () -> bool
32
- def escape_formulas?: () -> bool
21
+ # : (?strict_excel_mode: bool, ?default_font: untyped?) -> void
22
+ def initialize: (?strict_excel_mode: bool, ?default_font: untyped?) -> void
33
23
 
34
24
  # Sets or configures the workbook-wide default font.
35
25
  #
@@ -41,9 +31,6 @@ module Xlsxrb
41
31
  # : (?String | Hash[Symbol, untyped]? name, ?Float | Integer | nil size, **untyped opts) -> void
42
32
  def default_font: (?String | Hash[Symbol, untyped]? name, ?Float | Integer | nil size, **untyped opts) -> void
43
33
 
44
- # @deprecated Use {#default_font} instead. Will be removed in 0.2.0.
45
- alias set_default_font default_font
46
-
47
34
  # @return [Hash{String => StyleBuilder}]
48
35
  # : Hash[String, StyleBuilder]
49
36
  attr_reader styles: untyped
@@ -58,6 +45,8 @@ module Xlsxrb
58
45
  # @yield [style_builder]
59
46
  # @yieldparam style_builder [Xlsxrb::StyleBuilder]
60
47
  # @return [StyleBuilder]
48
+ # Using the returned value is deprecated and warns; in version 0.3.0, this method
49
+ # will return nil. Configure the style with options or in the block.
61
50
  # @api public
62
51
  # : (String | Symbol name, **untyped opts) ?{ (StyleBuilder) -> void } -> StyleBuilder
63
52
  def style: (String | Symbol name, **untyped opts) ?{ (StyleBuilder) -> void } -> StyleBuilder
@@ -111,86 +100,48 @@ module Xlsxrb
111
100
  # : (String | Symbol | Elements::CellError code) -> Elements::CellError
112
101
  def cell_error: (String | Symbol | Elements::CellError code) -> Elements::CellError
113
102
 
114
- OMITTED: untyped
115
-
116
103
  # Gets or sets the active worksheet tab in the workbook window.
117
104
  #
118
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#active_sheet=} instead.
119
- # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
120
105
  # @return [String, Symbol, Integer, nil]
121
106
  # @api public
122
- # : (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
123
- def active_sheet: (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
124
-
125
- # @deprecated Use {#active_sheet} instead. Will be removed in 0.2.0.
126
- alias active_tab active_sheet
127
-
128
- # Sets the active worksheet tab in the workbook window.
129
- #
130
- # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
131
- # @return [String, Symbol, Integer, nil]
132
- # @api public
133
- attr_writer active_sheet: String | Symbol | Integer | nil
134
-
135
- # @deprecated Use {#active_sheet=} instead. Will be removed in 0.2.0.
136
- alias active_tab= active_sheet=
107
+ # : (String | Symbol | Integer | nil)
108
+ attr_accessor active_sheet: untyped
137
109
 
138
110
  # Gets or sets the first sheet tab visible in the sheet tab scroll area.
139
111
  #
140
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#first_sheet=} instead.
141
- # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
142
- # @return [String, Symbol, Integer, nil]
143
- # @api public
144
- # : (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
145
- def first_sheet: (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
146
-
147
- # Sets the first sheet tab visible in the sheet tab scroll area.
148
- #
149
- # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
150
112
  # @return [String, Symbol, Integer, nil]
151
113
  # @api public
152
- attr_writer first_sheet: String | Symbol | Integer | nil
153
-
154
- # Gets or sets whether sheet tabs are visible in the workbook window.
155
- #
156
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#show_sheet_tabs=} instead.
157
- # @param visible [Boolean, nil]
158
- # @return [Boolean, nil]
159
- # @api public
160
- # : (?bool? visible) -> bool?
161
- def show_sheet_tabs: (?bool? visible) -> bool?
114
+ # : (String | Symbol | Integer | nil)
115
+ attr_accessor first_sheet: untyped
162
116
 
163
117
  # Sets whether sheet tabs are visible in the workbook window.
164
118
  #
165
119
  # @param visible [Boolean, nil]
166
120
  # @return [Boolean, nil]
167
121
  # @api public
168
- attr_writer show_sheet_tabs: bool?
122
+ # : (bool? visible) -> bool?
123
+ attr_writer show_sheet_tabs: untyped
169
124
 
170
- # Gets or sets the ratio between the sheet tabs bar and the horizontal scroll bar (0-1000).
125
+ # Returns whether sheet tabs are visible in the workbook window.
171
126
  #
172
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#tab_ratio=} instead.
173
- # @param ratio [Integer, nil]
174
- # @return [Integer, nil]
127
+ # @return [Boolean]
175
128
  # @api public
176
- # : (?Integer? ratio) -> Integer?
177
- def tab_ratio: (?Integer? ratio) -> Integer?
129
+ # : () -> bool
130
+ def show_sheet_tabs?: () -> bool
178
131
 
179
- # Sets the ratio between the sheet tabs bar and the horizontal scroll bar (0-1000).
132
+ # Gets or sets the ratio between the sheet tabs bar and the horizontal scroll bar (0-1000).
180
133
  #
181
- # @param ratio [Integer, nil]
182
134
  # @return [Integer, nil]
183
135
  # @api public
184
- attr_writer tab_ratio: Integer?
136
+ # : Integer?
137
+ attr_accessor tab_ratio: untyped
185
138
 
186
- # Gets or sets the internal code name of the workbook.
139
+ # Gets the internal code name of the workbook.
187
140
  #
188
- # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#code_name=} instead.
189
- # @param name [String, Symbol, nil] The code name.
190
141
  # @return [String, nil]
191
142
  # @api public
192
- # : (?String | Symbol | nil name) -> String?
193
- def code_name: (?String | Symbol | nil name) -> String?
143
+ # : () -> String?
144
+ def code_name: () -> String?
194
145
 
195
146
  # Sets the internal code name of the workbook.
196
147
  #
@@ -200,25 +151,22 @@ module Xlsxrb
200
151
  # : (String | Symbol | nil name) -> String?
201
152
  def code_name=: (String | Symbol | nil name) -> String?
202
153
 
203
- # Sets a workbook-level property.
154
+ # Configures or queries workbook-level properties.
155
+ #
156
+ # When called with no arguments, returns the {Elements::WorkbookProperties} value object.
157
+ # When called with keyword options, configures properties and returns nil.
204
158
  #
205
159
  # @note **SECURITY WARNING:** If you set `:update_links` to anything other than `"never"`,
206
160
  # you may expose end-users to malicious external reference vulnerabilities (e.g., CSV/DDE Injection)
207
161
  # when they open the generated Excel file. Ensure you fully trust the exported data.
208
162
  #
209
- # @param name [Symbol] Property name (e.g. :update_links).
210
- # @param value [String, Integer, Boolean] Property value.
211
- # @return [void]
212
- # @api public
213
- # : (Symbol name, String | Integer | bool value) -> void
214
- def workbook_property: (Symbol name, String | Integer | bool value) -> void
215
-
216
- # Returns workbook-level properties.
217
- #
218
- # @return [Elements::WorkbookProperties]
163
+ # @param opts [Hash] Workbook properties map.
164
+ # @return [Elements::WorkbookProperties, void]
219
165
  # @api public
220
166
  # : () -> Elements::WorkbookProperties
167
+ # : (**untyped opts) -> void
221
168
  def workbook_properties: () -> Elements::WorkbookProperties
169
+ | (**untyped opts) -> void
222
170
 
223
171
  # Sets workbook-level properties.
224
172
  #
@@ -239,26 +187,35 @@ module Xlsxrb
239
187
  #
240
188
  # @param name [String, nil] Sheet name (max 31 chars, no forbidden chars `[ ] * ? / \ :`).
241
189
  # @param state [Symbol, String, nil] Sheet visibility state (:visible, :hidden, :very_hidden).
242
- # @param tab_color [String, Hash, nil] Tab color hex string or color hash.
243
- # @param code_name [String, nil] VBA code name.
244
- # @param hidden [Boolean, nil] Deprecated alias for state: :hidden.
190
+ # @param tab_color [String, Hash, Symbol, nil] Tab color hex string (e.g. "FF0000") or hash options.
191
+ # @param code_name [String, Symbol, nil] Internal VBA code name of the sheet.
245
192
  # @param opts [Hash] Additional sheet properties.
246
193
  # @yield [sheet_builder]
247
194
  # @yieldparam sheet_builder [Xlsxrb::WorksheetBuilder]
248
- # @return [Elements::Worksheet]
195
+ # @return [DeferredWorksheet] The sheet as {WorksheetBuilder#build} returns it, with
196
+ # style names in its cells. It is built when first used.
249
197
  # @raise [ArgumentError] If sheet name violates Excel limits in strict mode.
250
198
  # @api public
251
- # : (?String? name, ?state: (Symbol | String)?, ?tab_color: untyped, ?code_name: String?, ?hidden: bool?, **untyped opts) ?{ (WorksheetBuilder) -> void } -> Elements::Worksheet
252
- def sheet: (?String? name, ?state: (Symbol | String)?, ?tab_color: untyped, ?code_name: String?, ?hidden: bool?, **untyped opts) ?{ (WorksheetBuilder) -> void } -> Elements::Worksheet
199
+ # : (?String? name, ?state: Symbol | String | nil, ?tab_color: String | Hash[Symbol, untyped] | Symbol | nil, ?code_name: String | Symbol | nil, **untyped opts) ?{ (WorksheetBuilder) -> void } -> DeferredWorksheet
200
+ def sheet: (?String? name, ?state: Symbol | String | nil, ?tab_color: String | Hash[Symbol, untyped] | Symbol | nil, ?code_name: String | Symbol | nil, **untyped opts) ?{ (WorksheetBuilder) -> void } -> DeferredWorksheet
253
201
 
254
- # Accesses or defines a worksheet by name.
202
+ # Adds a worksheet, as {#sheet} does.
203
+ #
204
+ # @deprecated Use {#sheet} to add a sheet. In version 0.3.0, this method will return the
205
+ # {WorksheetBuilder} of an existing sheet, or of the current sheet without an argument,
206
+ # and raise for a sheet that does not exist. Calling it with an argument, or without
207
+ # one after a sheet was added, warns.
255
208
  #
256
209
  # @param name_or_index [String, Symbol, Integer, nil]
257
210
  # @yield [sheet_builder]
258
- # @return [Elements::Worksheet]
211
+ # @return [DeferredWorksheet]
259
212
  # @api public
260
- # : (?String | Symbol | Integer | nil name_or_index) ?{ (WorksheetBuilder) -> void } -> Elements::Worksheet
261
- def []: (?String | Symbol | Integer | nil name_or_index) ?{ (WorksheetBuilder) -> void } -> Elements::Worksheet
213
+ # : (?String | Symbol | Integer | nil name_or_index) ?{ (WorksheetBuilder) -> void } -> DeferredWorksheet
214
+ def []: (?String | Symbol | Integer | nil name_or_index) ?{ (WorksheetBuilder) -> void } -> DeferredWorksheet
215
+
216
+ INDEX_CREATES_SHEET_MESSAGE: ::String
217
+
218
+ INDEX_ADDS_SHEET_MESSAGE: ::String
262
219
 
263
220
  # Adds a defined name (named range or formula) to the workbook.
264
221
  # Bare cell references and coordinate keywords are automatically formatted with sheet quotes and absolute $ references.
@@ -268,18 +225,13 @@ module Xlsxrb
268
225
  # @param sheet [String, nil] Reference sheet name for coordinates/formula.
269
226
  # @param scope [String, Symbol, nil] Optional sheet name or :workbook for scope (defaults to workbook).
270
227
  # @param hidden [Boolean] Whether the defined name is hidden from Excel's UI.
271
- # @param column [Integer, String, nil] Deprecated alias for columns.
272
228
  # @param columns [Integer, String, nil] Column index or letter for coordinate-based reference.
273
- # @param col [Integer, String, nil] Deprecated alias for column.
274
- # @param row [Integer, Range, nil] Deprecated alias for rows.
275
- # @param rows [Integer, Range, nil] Row or row range (1-based) for coordinate-based reference.
229
+ # @param rows [Integer, Range, nil] Row or row range (0-based) for coordinate-based reference.
276
230
  # @param range [String, nil] Cell range reference.
277
- # @param ref_sheet [String, nil] Deprecated alias for sheet.
278
- # @param local [Boolean] Deprecated alias for scope.
279
231
  # @return [void]
280
232
  # @api public
281
- # : (String name, ?untyped value, ?sheet: String?, ?scope: (String | Symbol)?, ?hidden: bool, ?column: untyped, ?columns: untyped, ?col: untyped, ?row: untyped, ?rows: untyped, ?range: untyped, ?ref_sheet: String?, ?local: bool) -> void
282
- def defined_name: (String name, ?untyped value, ?sheet: String?, ?scope: (String | Symbol)?, ?hidden: bool, ?column: untyped, ?columns: untyped, ?col: untyped, ?row: untyped, ?rows: untyped, ?range: untyped, ?ref_sheet: String?, ?local: bool) -> void
233
+ # : (String name, ?untyped value, ?sheet: String?, ?scope: (String | Symbol)?, ?hidden: bool, ?columns: untyped, ?rows: untyped, ?range: untyped) -> void
234
+ def defined_name: (String name, ?untyped value, ?sheet: String?, ?scope: (String | Symbol)?, ?hidden: bool, ?columns: untyped, ?rows: untyped, ?range: untyped) -> void
283
235
 
284
236
  # Returns workbook-level defined names.
285
237
  #
@@ -288,16 +240,15 @@ module Xlsxrb
288
240
  # : () -> Array[Elements::DefinedName]
289
241
  def defined_names: () -> Array[Elements::DefinedName]
290
242
 
291
- # Sets or gets the print area for a sheet.
243
+ # Returns the print area range for the sheet, or nil if none.
292
244
  #
293
- # @param range [String, Object, nil] Cell range (e.g. "A1:G50").
294
245
  # @param sheet [String, nil] Target sheet name (defaults to latest or "Sheet1").
295
- # @return [String, nil, void]
246
+ # @return [String, nil]
296
247
  # @api public
297
- # : (?untyped range, ?sheet: String?) -> (String | nil | void)
298
- def print_area: (?untyped range, ?sheet: untyped) -> untyped
248
+ # : (?sheet: String?) -> String?
249
+ def print_area: (?sheet: String?) -> String?
299
250
 
300
- # Sets the print area for the worksheet.
251
+ # Sets the print area for the current worksheet.
301
252
  #
302
253
  # @param range [String, nil] Cell range (e.g. "A1:G50").
303
254
  # @return [String, nil]
@@ -305,24 +256,28 @@ module Xlsxrb
305
256
  # : (String? range) -> String?
306
257
  def print_area=: (String? range) -> String?
307
258
 
308
- # Sets repeating print titles (rows and/or columns) for pagination.
259
+ # Sets or gets repeating print titles (rows and/or columns) for pagination.
260
+ #
261
+ # When called with no row/column arguments, returns the {Elements::PrintTitles} value object or nil.
262
+ # When called with row/column arguments, sets repeating print titles and returns nil.
309
263
  #
310
264
  # @param rows [String, nil] Repeating row range (e.g. "1:2").
311
265
  # @param columns [String, nil] Repeating column range (e.g. "A:B").
312
- # @param cols [String, nil] Deprecated alias for columns.
313
266
  # @param sheet [String, nil] Target sheet name.
314
- # @return [void]
267
+ # @return [Elements::PrintTitles, nil, void]
315
268
  # @api public
316
- # : (?rows: (String | Integer | Range[Integer])?, ?columns: (String | Integer | Symbol | Range[untyped])?, ?cols: (String | Integer | Symbol | Range[untyped])?, ?sheet: String?) -> void
317
- def print_titles: (?rows: (String | Integer | Range[Integer])?, ?columns: (String | Integer | Symbol | Range[untyped])?, ?cols: (String | Integer | Symbol | Range[untyped])?, ?sheet: String?) -> void
269
+ # : () -> Elements::PrintTitles?
270
+ # : (?rows: (String | Integer | Range[Integer])?, ?columns: (String | Integer | Symbol | Range[untyped])?, ?sheet: String?) -> void
271
+ def print_titles: () -> Elements::PrintTitles?
272
+ | (?rows: (String | Integer | Range[Integer])?, ?columns: (String | Integer | Symbol | Range[untyped])?, ?sheet: String?) -> void
318
273
 
319
274
  # Sets repeating print titles.
320
275
  #
321
- # @param opts [Elements::PrintTitles, Hash] Options with :rows and/or :columns.
322
- # @return [Elements::PrintTitles, Hash]
276
+ # @param opts [Elements::PrintTitles, Hash, nil] Options with :rows and/or :columns.
277
+ # @return [Elements::PrintTitles, Hash, nil]
323
278
  # @api public
324
- # : (Elements::PrintTitles | Hash[Symbol, untyped] opts) -> (Elements::PrintTitles | Hash[Symbol, untyped])
325
- def print_titles=: (Elements::PrintTitles | Hash[Symbol, untyped] opts) -> (Elements::PrintTitles | Hash[Symbol, untyped])
279
+ # : (Elements::PrintTitles | Hash[Symbol, untyped] | nil opts) -> (Elements::PrintTitles | Hash[Symbol, untyped] | nil)
280
+ def print_titles=: (Elements::PrintTitles | Hash[Symbol, untyped] | nil opts) -> (Elements::PrintTitles | Hash[Symbol, untyped] | nil)
326
281
 
327
282
  # Sets repeating title rows for pagination on the target or active sheet.
328
283
  #
@@ -366,41 +321,47 @@ module Xlsxrb
366
321
  # : (untyped opts) -> void
367
322
  def workbook_protection=: (untyped opts) -> void
368
323
 
369
- # @deprecated Use {#workbook_protection} instead.
370
- # : (**String | Integer | bool | nil opts) -> void
371
- def protect_workbook: (**String | Integer | bool | nil opts) -> void
372
-
373
- # Sets a Dublin Core document metadata property.
324
+ # Configures or queries Dublin Core document metadata properties.
374
325
  #
375
- # @param name [Symbol] Core property name (:creator, :title, :subject, :description, etc.).
376
- # @param value [String, Integer, Time] Property value.
377
- # @return [void]
378
- # @api public
379
- # : (Symbol name, String | Integer | Time value) -> void
380
- def core_property: (Symbol name, String | Integer | Time value) -> void
381
-
382
- # Returns core document properties.
326
+ # When called with no arguments, returns the {Elements::CoreProperties} value object.
327
+ # When called with keyword options, configures properties and returns nil.
383
328
  #
384
- # @return [Elements::CoreProperties]
329
+ # @param opts [Hash] Core properties map (:creator, :title, :subject, :description, etc.).
330
+ # @return [Elements::CoreProperties, void]
385
331
  # @api public
386
332
  # : () -> Elements::CoreProperties
333
+ # : (**untyped opts) -> void
387
334
  def core_properties: () -> Elements::CoreProperties
335
+ | (**untyped opts) -> void
388
336
 
389
- # Sets an extended application metadata property.
337
+ # Replaces core document properties.
390
338
  #
391
- # @param name [Symbol] Application property name (:company, :manager, :app_version, etc.).
392
- # @param value [String, Integer, Time] Property value.
339
+ # @param props [Hash, Elements::CoreProperties]
393
340
  # @return [void]
394
341
  # @api public
395
- # : (Symbol name, String | Integer | Time value) -> void
396
- def app_property: (Symbol name, String | Integer | Time value) -> void
342
+ # : (Hash[Symbol, untyped] | Elements::CoreProperties props) -> void
343
+ def core_properties=: (Hash[Symbol, untyped] | Elements::CoreProperties props) -> void
397
344
 
398
- # Returns application document properties.
345
+ # Configures or queries extended application metadata properties.
399
346
  #
400
- # @return [Elements::AppProperties]
347
+ # When called with no arguments, returns the {Elements::AppProperties} value object.
348
+ # When called with keyword options, configures properties and returns nil.
349
+ #
350
+ # @param opts [Hash] Application properties map (:company, :manager, :app_version, etc.).
351
+ # @return [Elements::AppProperties, void]
401
352
  # @api public
402
353
  # : () -> Elements::AppProperties
354
+ # : (**untyped opts) -> void
403
355
  def app_properties: () -> Elements::AppProperties
356
+ | (**untyped opts) -> void
357
+
358
+ # Replaces application document properties.
359
+ #
360
+ # @param props [Hash, Elements::AppProperties]
361
+ # @return [void]
362
+ # @api public
363
+ # : (Hash[Symbol, untyped] | Elements::AppProperties props) -> void
364
+ def app_properties=: (Hash[Symbol, untyped] | Elements::AppProperties props) -> void
404
365
 
405
366
  # Sets multiple core, app, and/or custom properties simultaneously.
406
367
  #
@@ -439,14 +400,38 @@ module Xlsxrb
439
400
 
440
401
  private
441
402
 
403
+ # : (String? range, ?sheet: String?) -> String?
404
+ def set_print_area: (String? range, ?sheet: String?) -> String?
405
+
442
406
  # : (untyped range) -> untyped
443
407
  def absolute_range: (untyped range) -> untyped
444
408
 
445
409
  # : (untyped names, untyped sheets) -> untyped
446
410
  def resolve_defined_names: (untyped names, untyped sheets) -> untyped
447
411
 
448
- # : (untyped sheets) -> (::Array[untyped | ::Hash[untyped, untyped]] | ::Array[untyped])
449
- def process_styles: (untyped sheets) -> (::Array[untyped | ::Hash[untyped, untyped]] | ::Array[untyped])
412
+ # Registers the styles of every sheet and builds the sheets' rows with their style
413
+ # names resolved to style indexes. Each cell is created once, here.
414
+ # : (Array[WorksheetBuilder::Snapshot] sheets) -> [Array[Elements::Worksheet], Hash[Symbol, untyped]]
415
+ def process_styles: (Array[WorksheetBuilder::Snapshot] sheets) -> [ Array[Elements::Worksheet], Hash[Symbol, untyped] ]
416
+
417
+ # Returns the key of the definition that the style +name+ stands for at style log
418
+ # +clock+: the last one made by then, or the first one if none was. A name defined
419
+ # once, or always with the same format, is its own key.
420
+ # : (String name, Integer? clock, Hash[String, Array[[Integer, String]]] versions) -> String
421
+ def style_version: (String name, Integer? clock, Hash[String, Array[[ Integer, String ]]] versions) -> String
422
+
423
+ # Marks the definition that the style +name+ stands for at style log +clock+ as used.
424
+ # : (untyped name, Integer? clock, Hash[String, Array[[Integer, String]]] versions, Hash[String, true] used_versions) -> void
425
+ def use_style_version: (untyped name, Integer? clock, Hash[String, Array[[ Integer, String ]]] versions, Hash[String, true] used_versions) -> void
426
+
427
+ # Records the date or time variant of the style named +style_key+ that a Date or
428
+ # Time +value+ in a row added at style log +clock+ needs, if any.
429
+ # : (untyped value, String style_key, Integer clock, Hash[String, Array[[Integer, String]]] versions, Hash[String, untyped] all_style_builders, Hash[String, StyleBuilder] version_builders, Hash[untyped, untyped] date_variants, Hash[String, untyped] variant_builders) -> void
430
+ def add_date_variant: (untyped value, String style_key, Integer clock, Hash[String, Array[[ Integer, String ]]] versions, Hash[String, untyped] all_style_builders, Hash[String, StyleBuilder] version_builders, Hash[untyped, untyped] date_variants, Hash[String, untyped] variant_builders) -> void
431
+
432
+ # Creates a cell whose style was resolved to +style+ (an index, or a name with no index).
433
+ # : (Integer row_index, Integer column_index, untyped value, untyped style, String? format_code, bool valid_coordinates) -> Elements::Cell
434
+ def resolved_cell: (Integer row_index, Integer column_index, untyped value, untyped style, String? format_code, bool valid_coordinates) -> Elements::Cell
450
435
 
451
436
  # : (untyped writer) -> Hash[Symbol, untyped]
452
437
  def extract_styles_from_writer: (untyped writer) -> Hash[Symbol, untyped]