xlsxrb 0.1.16 → 0.1.18

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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +157 -1
  3. data/README.md +81 -21
  4. data/lib/ruby_lsp/xlsxrb/completion_listener.rb +31 -61
  5. data/lib/xlsxrb/chart_builder.rb +619 -98
  6. data/lib/xlsxrb/dsl_helpers.rb +583 -15
  7. data/lib/xlsxrb/elements/cell.rb +265 -53
  8. data/lib/xlsxrb/elements/column.rb +95 -6
  9. data/lib/xlsxrb/elements/coordinate_access.rb +108 -10
  10. data/lib/xlsxrb/elements/image.rb +81 -15
  11. data/lib/xlsxrb/elements/metadata.rb +2733 -0
  12. data/lib/xlsxrb/elements/row.rb +130 -46
  13. data/lib/xlsxrb/elements/styles.rb +184 -76
  14. data/lib/xlsxrb/elements/types.rb +243 -7
  15. data/lib/xlsxrb/elements/workbook.rb +202 -65
  16. data/lib/xlsxrb/elements/worksheet.rb +728 -85
  17. data/lib/xlsxrb/elements.rb +1 -0
  18. data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +32 -3
  19. data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +194 -26
  20. data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +372 -18
  21. data/lib/xlsxrb/ooxml/reader/listeners/style_listeners.rb +33 -14
  22. data/lib/xlsxrb/ooxml/reader.rb +92 -0
  23. data/lib/xlsxrb/ooxml/styles_parser.rb +29 -14
  24. data/lib/xlsxrb/ooxml/workbook_parser.rb +18 -3
  25. data/lib/xlsxrb/ooxml/workbook_writer.rb +351 -77
  26. data/lib/xlsxrb/ooxml/worksheet_parser.rb +18 -4
  27. data/lib/xlsxrb/ooxml/worksheet_writer.rb +349 -103
  28. data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +584 -443
  29. data/lib/xlsxrb/ooxml/writer/features_xml.rb +52 -14
  30. data/lib/xlsxrb/ooxml/writer/styles_xml.rb +42 -18
  31. data/lib/xlsxrb/ooxml/writer.rb +288 -35
  32. data/lib/xlsxrb/ooxml/zip_generator.rb +2 -0
  33. data/lib/xlsxrb/ooxml/zip_reader.rb +47 -10
  34. data/lib/xlsxrb/ooxml/zip_writer.rb +15 -5
  35. data/lib/xlsxrb/stream_row.rb +97 -18
  36. data/lib/xlsxrb/stream_sheet.rb +827 -157
  37. data/lib/xlsxrb/stream_writer.rb +2766 -375
  38. data/lib/xlsxrb/style_builder.rb +821 -105
  39. data/lib/xlsxrb/utils.rb +82 -57
  40. data/lib/xlsxrb/version.rb +1 -1
  41. data/lib/xlsxrb/workbook_builder.rb +542 -62
  42. data/lib/xlsxrb/worksheet_builder.rb +2279 -209
  43. data/lib/xlsxrb.rb +1539 -344
  44. data/sig/generated/xlsxrb/chart_builder.rbs +336 -79
  45. data/sig/generated/xlsxrb/dsl_helpers.rbs +137 -4
  46. data/sig/generated/xlsxrb/elements/cell.rbs +104 -15
  47. data/sig/generated/xlsxrb/elements/column.rbs +62 -3
  48. data/sig/generated/xlsxrb/elements/coordinate_access.rbs +49 -7
  49. data/sig/generated/xlsxrb/elements/image.rbs +30 -8
  50. data/sig/generated/xlsxrb/elements/metadata.rbs +1587 -0
  51. data/sig/generated/xlsxrb/elements/row.rbs +61 -21
  52. data/sig/generated/xlsxrb/elements/styles.rbs +96 -58
  53. data/sig/generated/xlsxrb/elements/types.rbs +29 -0
  54. data/sig/generated/xlsxrb/elements/workbook.rbs +92 -44
  55. data/sig/generated/xlsxrb/elements/worksheet.rbs +259 -38
  56. data/sig/generated/xlsxrb/ooxml/reader/listeners/core_listeners.rbs +2 -0
  57. data/sig/generated/xlsxrb/ooxml/reader/listeners/drawing_listeners.rbs +74 -2
  58. data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +97 -0
  59. data/sig/generated/xlsxrb/ooxml/reader/listeners/style_listeners.rbs +3 -0
  60. data/sig/generated/xlsxrb/ooxml/reader.rbs +20 -0
  61. data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +3 -0
  62. data/sig/generated/xlsxrb/ooxml/workbook_parser.rbs +8 -0
  63. data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +8 -4
  64. data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +1 -1
  65. data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +12 -1
  66. data/sig/generated/xlsxrb/ooxml/writer/drawing_xml.rbs +16 -0
  67. data/sig/generated/xlsxrb/ooxml/writer.rbs +45 -8
  68. data/sig/generated/xlsxrb/ooxml/zip_generator.rbs +2 -0
  69. data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +2 -2
  70. data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +8 -2
  71. data/sig/generated/xlsxrb/stream_row.rbs +48 -14
  72. data/sig/generated/xlsxrb/stream_sheet.rbs +398 -89
  73. data/sig/generated/xlsxrb/stream_writer.rbs +1601 -219
  74. data/sig/generated/xlsxrb/style_builder.rbs +403 -75
  75. data/sig/generated/xlsxrb/utils.rbs +49 -13
  76. data/sig/generated/xlsxrb/workbook_builder.rbs +308 -26
  77. data/sig/generated/xlsxrb/worksheet_builder.rbs +1142 -96
  78. data/sig/generated/xlsxrb.rbs +321 -52
  79. metadata +3 -1
@@ -13,20 +13,133 @@ module Xlsxrb
13
13
  #
14
14
  # @api public
15
15
  class StreamWriter
16
+ OMITTED: untyped
17
+
16
18
  # @return [String, nil] Name of the currently active worksheet.
19
+ # @api private
17
20
  # : String?
18
21
  attr_reader current_sheet: untyped
19
22
 
20
23
  # @return [Boolean] Whether to treat strings starting with formula prefixes as plain text.
24
+ # : bool
21
25
  attr_accessor escape_formulas: untyped
22
26
 
27
+ # Returns whether formula escaping is enabled.
28
+ #
29
+ # @return [Boolean]
30
+ # @api public
31
+ # : () -> bool
32
+ def escape_formulas?: () -> bool
33
+
34
+ # Returns whether the shared strings table is enabled.
35
+ #
36
+ # @return [Boolean]
37
+ # @api public
38
+ # : () -> bool
39
+ def shared_strings?: () -> bool
40
+
41
+ # @deprecated Use {#shared_strings?} instead. Will be removed in 0.2.0.
42
+ # : () -> bool
43
+ def shared_strings: () -> bool
44
+
45
+ # @return [Integer] The ZIP deflate compression level (0..9).
46
+ # : Integer
47
+ attr_reader compression_level: untyped
48
+
49
+ # @return [Hash{String => StyleBuilder}]
50
+ # : Hash[String, StyleBuilder]
51
+ attr_reader styles: untyped
52
+
23
53
  # Initializes a streaming writer context.
24
54
  #
25
55
  # @param target [String, IO, StringIO] Destination file path or writable IO stream.
26
56
  # @param strict_excel_mode [Boolean] Whether to enforce Microsoft Excel specification limits.
27
57
  # @param escape_formulas [Boolean] Whether to treat strings starting with formula prefixes as plain text.
28
- # : (untyped target, ?strict_excel_mode: bool, ?escape_formulas: bool) -> void
29
- def initialize: (untyped target, ?strict_excel_mode: bool, ?escape_formulas: bool) -> void
58
+ # @param default_font [Hash, nil] Optional default font options (e.g. `{ name: "Arial", size: 12 }`).
59
+ # @param shared_strings [Boolean] Whether to intern strings into a shared strings table (`xl/sharedStrings.xml`).
60
+ # When set to `false`, strings are written directly as inline strings (`<c t="inlineStr">`), maintaining flat
61
+ # $O(1)$ constant memory regardless of row count or unique string cardinality. Note that disabling shared strings
62
+ # may slightly increase archive size (typically 3-5%) on datasets with high repetition.
63
+ # @param compression_level [Integer, nil] ZIP deflate compression level (0..9, or Zlib::DEFAULT_COMPRESSION).
64
+ # Level 6 is standard. Level 4 accelerates compression by 20-40% with an ~10% size tradeoff,
65
+ # recommended for high-throughput streaming exports. Level 0 disables compression (store only).
66
+ # : (untyped target, ?strict_excel_mode: bool, ?escape_formulas: bool, ?default_font: untyped?, ?shared_strings: bool, ?compression_level: Integer | nil) -> void
67
+ def initialize: (untyped target, ?strict_excel_mode: bool, ?escape_formulas: bool, ?default_font: untyped?, ?shared_strings: bool, ?compression_level: Integer | nil) -> void
68
+
69
+ # Gets or sets the active worksheet tab in the workbook window.
70
+ #
71
+ # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
72
+ # @return [String, Symbol, Integer, nil]
73
+ # @api public
74
+ # Gets or sets the active worksheet tab in the workbook window.
75
+ #
76
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#active_sheet=} instead.
77
+ # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
78
+ # @return [String, Symbol, Integer, nil]
79
+ # @api public
80
+ # : (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
81
+ def active_sheet: (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
82
+
83
+ # @deprecated Use {#active_sheet} instead. Will be removed in 0.2.0.
84
+ alias active_tab active_sheet
85
+
86
+ # Sets the active worksheet tab in the workbook window.
87
+ #
88
+ # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
89
+ # @return [String, Symbol, Integer, nil]
90
+ # @api public
91
+ attr_writer active_sheet: String | Symbol | Integer | nil
92
+
93
+ # @deprecated Use {#active_sheet=} instead. Will be removed in 0.2.0.
94
+ alias active_tab= active_sheet=
95
+
96
+ # Gets or sets the first sheet tab visible in the sheet tab scroll area.
97
+ #
98
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#first_sheet=} instead.
99
+ # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
100
+ # @return [String, Symbol, Integer, nil]
101
+ # @api public
102
+ # : (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
103
+ def first_sheet: (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
104
+
105
+ # Sets the first sheet tab visible in the sheet tab scroll area.
106
+ #
107
+ # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
108
+ # @return [String, Symbol, Integer, nil]
109
+ # @api public
110
+ attr_writer first_sheet: String | Symbol | Integer | nil
111
+
112
+ # Gets or sets whether sheet tabs are visible in the workbook window.
113
+ #
114
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#show_sheet_tabs=} instead.
115
+ # @param visible [Boolean, nil]
116
+ # @return [Boolean, nil]
117
+ # @api public
118
+ # : (?bool? visible) -> bool?
119
+ def show_sheet_tabs: (?bool? visible) -> bool?
120
+
121
+ # Sets whether sheet tabs are visible in the workbook window.
122
+ #
123
+ # @param visible [Boolean, nil]
124
+ # @return [Boolean, nil]
125
+ # @api public
126
+ attr_writer show_sheet_tabs: bool?
127
+
128
+ # Gets or sets the ratio between the sheet tabs bar and the horizontal scroll bar (0-1000).
129
+ #
130
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#tab_ratio=} instead.
131
+ # @param ratio [Integer, nil]
132
+ # @return [Integer, nil]
133
+ # @api public
134
+ # : (?Integer? ratio) -> Integer?
135
+ def tab_ratio: (?Integer? ratio) -> Integer?
136
+
137
+ # Sets the ratio between the sheet tabs bar and the horizontal scroll bar (0-1000).
138
+ #
139
+ # @param ratio [Integer, nil]
140
+ # @return [Integer, nil]
141
+ # @api public
142
+ attr_writer tab_ratio: Integer?
30
143
 
31
144
  # Sets a workbook property.
32
145
  #
@@ -40,6 +153,21 @@ module Xlsxrb
40
153
  # : (Symbol name, String | Integer | bool value) -> void
41
154
  def workbook_property: (Symbol name, String | Integer | bool value) -> void
42
155
 
156
+ # Returns workbook-level properties.
157
+ #
158
+ # @return [Elements::WorkbookProperties]
159
+ # @api public
160
+ # : () -> Elements::WorkbookProperties
161
+ def workbook_properties: () -> Elements::WorkbookProperties
162
+
163
+ # Sets workbook-level properties.
164
+ #
165
+ # @param props [Hash, Elements::MetadataRecord]
166
+ # @return [void]
167
+ # @api public
168
+ # : (untyped props) -> void
169
+ def workbook_properties=: (untyped props) -> void
170
+
43
171
  # Defines or configures a named cell style.
44
172
  #
45
173
  # @param name [String, Symbol] The name of the style.
@@ -50,6 +178,44 @@ module Xlsxrb
50
178
  # : (String | Symbol name, **untyped opts) ?{ (StyleBuilder) -> void } -> StyleBuilder
51
179
  def style: (String | Symbol name, **untyped opts) ?{ (StyleBuilder) -> void } -> StyleBuilder
52
180
 
181
+ # Sets or configures the workbook-wide default font.
182
+ #
183
+ # @param name [String, Hash, nil] Font name or font options Hash.
184
+ # @param size [Float, Integer, nil] Font size in points.
185
+ # @param opts [Hash] Additional font options (e.g. `bold:`, `italic:`, `family:`, `charset:`, `color:`).
186
+ # @return [void]
187
+ # @api public
188
+ # : (?String | Hash[Symbol, untyped]? name, ?Float | Integer | nil size, **untyped opts) -> void
189
+ def default_font: (?String | Hash[Symbol, untyped]? name, ?Float | Integer | nil size, **untyped opts) -> void
190
+
191
+ # @deprecated Use {#default_font} instead. Will be removed in 0.2.0.
192
+ alias set_default_font default_font
193
+
194
+ # Creates an {Elements::Formula} object.
195
+ # @api public
196
+ # : (String expression, ?cached_value: (String | Numeric | bool | Elements::CellError | nil), ?type: (Symbol | String)?, ?ref: String?, ?shared_index: Integer?) -> Elements::Formula
197
+ def formula: (String expression, ?cached_value: String | Numeric | bool | Elements::CellError | nil, ?type: (Symbol | String)?, ?ref: String?, ?shared_index: Integer?) -> Elements::Formula
198
+
199
+ # Creates an array or dynamic array {Elements::Formula} object.
200
+ # @api public
201
+ # : (String expression, ?ref: String?, ?cached_value: (String | Numeric | bool | Elements::CellError | nil), **untyped attrs) -> Elements::Formula
202
+ def array_formula: (String expression, ?ref: String?, ?cached_value: String | Numeric | bool | Elements::CellError | nil, **untyped attrs) -> Elements::Formula
203
+
204
+ # Creates a shared formula {Elements::Formula} object.
205
+ # @api public
206
+ # : (?String? expression, ?shared_index: Integer?, ?ref: String?, ?cached_value: (String | Numeric | bool | Elements::CellError | nil)) -> Elements::Formula
207
+ def shared_formula: (?String? expression, ?shared_index: Integer?, ?ref: String?, ?cached_value: String | Numeric | bool | Elements::CellError | nil) -> Elements::Formula
208
+
209
+ # Creates an {Elements::RichText} object.
210
+ # @api public
211
+ # : (*(Hash[Symbol, untyped] | Elements::RichTextRun | String | Array[untyped] | untyped) runs, ?text: String?, ?base_font: untyped, **untyped font_props) -> Elements::RichText
212
+ def rich_text: (*Hash[Symbol, untyped] | Elements::RichTextRun | String | Array[untyped] | untyped runs, ?text: String?, ?base_font: untyped, **untyped font_props) -> Elements::RichText
213
+
214
+ # Creates or returns an {Elements::CellError} object.
215
+ # @api public
216
+ # : (String | Symbol | Elements::CellError code) -> Elements::CellError
217
+ def cell_error: (String | Symbol | Elements::CellError code) -> Elements::CellError
218
+
53
219
  # Proxy object yielded by the `sheet` method to prevent writing to inactive sheets in streaming mode.
54
220
  #
55
221
  # @api public
@@ -58,6 +224,84 @@ module Xlsxrb
58
224
  # @param sheet_name [String]
59
225
  def initialize: (untyped writer, untyped sheet_name) -> untyped
60
226
 
227
+ # Sets or configures the workbook-wide default font.
228
+ #
229
+ # @param name [String, Hash, nil] Font name or font options Hash.
230
+ # @param size [Float, Integer, nil] Font size in points.
231
+ # @param opts [Hash] Additional font options.
232
+ # @return [void]
233
+ # @api public
234
+ # : (?String | Hash[Symbol, untyped]? name, ?Float | Integer | nil size, **untyped opts) -> void
235
+ def default_font: (?String | Hash[Symbol, untyped]? name, ?Float | Integer | nil size, **untyped opts) -> void
236
+
237
+ # @deprecated Use {#default_font} instead. Will be removed in 0.2.0.
238
+ alias set_default_font default_font
239
+
240
+ # Creates an {Elements::Formula} object.
241
+ # @api public
242
+ # : (String expression, ?cached_value: (String | Numeric | bool | Elements::CellError | nil), ?type: (Symbol | String)?, ?ref: String?, ?shared_index: Integer?) -> Elements::Formula
243
+ def formula: (String expression, ?cached_value: String | Numeric | bool | Elements::CellError | nil, ?type: (Symbol | String)?, ?ref: String?, ?shared_index: Integer?) -> Elements::Formula
244
+
245
+ # Creates an array or dynamic array {Elements::Formula} object.
246
+ # @api public
247
+ # : (String expression, ?ref: String?, ?cached_value: (String | Numeric | bool | Elements::CellError | nil), **untyped attrs) -> Elements::Formula
248
+ def array_formula: (String expression, ?ref: String?, ?cached_value: String | Numeric | bool | Elements::CellError | nil, **untyped attrs) -> Elements::Formula
249
+
250
+ # Creates a shared formula {Elements::Formula} object.
251
+ # @api public
252
+ # : (?String? expression, ?shared_index: Integer?, ?ref: String?, ?cached_value: (String | Numeric | bool | Elements::CellError | nil)) -> Elements::Formula
253
+ def shared_formula: (?String? expression, ?shared_index: Integer?, ?ref: String?, ?cached_value: String | Numeric | bool | Elements::CellError | nil) -> Elements::Formula
254
+
255
+ # Creates an {Elements::RichText} object.
256
+ # @api public
257
+ # : (*(Hash[Symbol, untyped] | Elements::RichTextRun | String | Array[untyped] | untyped) runs, ?text: String?, ?base_font: untyped, **untyped font_props) -> Elements::RichText
258
+ def rich_text: (*Hash[Symbol, untyped] | Elements::RichTextRun | String | Array[untyped] | untyped runs, ?text: String?, ?base_font: untyped, **untyped font_props) -> Elements::RichText
259
+
260
+ # Creates or returns an {Elements::CellError} object.
261
+ # @api public
262
+ # : (String | Symbol | Elements::CellError code) -> Elements::CellError
263
+ def cell_error: (String | Symbol | Elements::CellError code) -> Elements::CellError
264
+
265
+ # Returns the worksheet name.
266
+ #
267
+ # @return [String]
268
+ # @api public
269
+ # : () -> String
270
+ def name: () -> String
271
+
272
+ # Returns column configurations defined for this worksheet.
273
+ #
274
+ # @return [Array<Elements::Column>]
275
+ # @api public
276
+ # : () -> Array[Elements::Column]
277
+ def columns: () -> Array[Elements::Column]
278
+
279
+ # Returns the list of worksheet names created in this workbook so far.
280
+ #
281
+ # @return [Array<String>] Worksheet names.
282
+ # @api public
283
+ # : () -> Array[String]
284
+ def sheet_names: () -> Array[String]
285
+
286
+ # Returns whether formula escaping is enabled.
287
+ #
288
+ # @return [Boolean]
289
+ # @api public
290
+ # : () -> bool
291
+ def escape_formulas?: () -> bool
292
+
293
+ # @return [Boolean] Whether to treat strings starting with formula prefixes as plain text.
294
+ # : bool
295
+ def escape_formulas: () -> untyped
296
+
297
+ # Sets whether to treat strings starting with formula prefixes as plain text.
298
+ #
299
+ # @param val [Boolean]
300
+ # @return [Boolean]
301
+ # @api public
302
+ # : (bool val) -> bool
303
+ def escape_formulas=: (bool val) -> bool
304
+
61
305
  # Defines or configures a named cell style on the active sheet.
62
306
  #
63
307
  # @example
@@ -77,10 +321,8 @@ module Xlsxrb
77
321
  # @example Merge with cell reference string
78
322
  # s.merge("A1:C1")
79
323
  #
80
- # @example Merge with coordinates
81
- # s.merge(row: 0, col_start: 0, col_end: 2)
82
- #
83
- # @param range [String, nil] The cell range (e.g. "A1:B2").
324
+ # @deprecated Passing coordinate keyword arguments (row:, col_start:, col_end:, row_start:, row_end:) is deprecated and will be removed in 0.2.0. Use a range string (e.g. merge("A1:C1")) instead.
325
+ # @param range [String, Hash, nil] The cell range (e.g. "A1:B2").
84
326
  # @param row [Integer, nil] 0-based row index.
85
327
  # @param col_start [Integer, String, nil] 0-based start column index or letter.
86
328
  # @param col_end [Integer, String, nil] 0-based end column index or letter.
@@ -88,8 +330,8 @@ module Xlsxrb
88
330
  # @param row_end [Integer, nil] 0-based end row index.
89
331
  # @return [void]
90
332
  # @api public
91
- # : (?String? range, ?row: Integer | nil, ?col_start: (Integer | String)?, ?col_end: (Integer | String)?, ?row_start: Integer | nil, ?row_end: Integer | nil) -> void
92
- def merge: (?String? range, ?row: Integer | nil, ?col_start: (Integer | String)?, ?col_end: (Integer | String)?, ?row_start: Integer | nil, ?row_end: Integer | nil) -> void
333
+ # : (?(String | Hash[Symbol, Integer | String])? range, ?row: Integer | nil, ?col_start: (Integer | String)?, ?col_end: (Integer | String)?, ?row_start: Integer | nil, ?row_end: Integer | nil) -> void
334
+ def merge: (?(String | Hash[Symbol, Integer | String])? range, ?row: Integer | nil, ?col_start: (Integer | String)?, ?col_end: (Integer | String)?, ?row_start: Integer | nil, ?row_end: Integer | nil) -> void
93
335
 
94
336
  # Adds a drawing shape to the sheet.
95
337
  #
@@ -98,18 +340,21 @@ module Xlsxrb
98
340
  #
99
341
  # @param preset [String] Preset shape type (e.g. "rect", "ellipse").
100
342
  # @param text [String, nil] Shape label text.
101
- # @param from_col [Integer] Starting column index (0-based).
343
+ # @param from_column [Integer, nil] Starting column index (0-based).
344
+ # @param from_col [Integer, nil] Deprecated alias for from_column.
102
345
  # @param from_row [Integer] Starting row index (0-based).
103
- # @param to_col [Integer] Ending column index (0-based).
346
+ # @param to_column [Integer, nil] Ending column index (0-based).
347
+ # @param to_col [Integer, nil] Deprecated alias for to_column.
104
348
  # @param to_row [Integer] Ending row index (0-based).
105
349
  # @param opts [Hash] Additional shape formatting options.
106
350
  # @return [void]
107
351
  # @api public
108
- # : (?preset: String, ?text: String?, ?from_col: Integer, ?from_row: Integer, ?to_col: Integer, ?to_row: Integer, **untyped opts) -> void
109
- def shape: (?preset: String, ?text: String?, ?from_col: Integer, ?from_row: Integer, ?to_col: Integer, ?to_row: Integer, **untyped opts) -> void
352
+ # : (?preset: String, ?text: String?, ?from_column: Integer?, ?from_col: Integer?, ?from_row: Integer, ?to_column: Integer?, ?to_col: Integer?, ?to_row: Integer, **untyped opts) -> void
353
+ def shape: (?preset: String, ?text: String?, ?from_column: Integer?, ?from_col: Integer?, ?from_row: Integer, ?to_column: Integer?, ?to_col: Integer?, ?to_row: Integer, **untyped opts) -> void
110
354
 
111
355
  # simplecov:disable
112
356
  # Edge case / untested delegation block
357
+ # @api private
113
358
  # : (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
114
359
  def internal_sheet_setup: (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
115
360
 
@@ -119,21 +364,24 @@ module Xlsxrb
119
364
  # s.row(["Name", "Age", "City"])
120
365
  #
121
366
  # @example Write with explicit column keys and styles
122
- # s.row({ A: "Header", C: 100 }, styles: { A: :bold })
367
+ # s.row({ A: "Header", C: 100 }, cell_styles: { A: :bold })
123
368
  #
124
369
  # @param values [Array, Hash] The cell values (e.g. `[1, 2, 3]` or `{ A: 1, C: 3 }`).
125
- # @param styles [String, Symbol, Array, Hash, nil] Style names or hashes to apply.
370
+ # @param cell_styles [String, Symbol, Array, Hash, nil] Style names or hashes to apply to cells.
371
+ # @param row_style [Integer, Symbol, String, Hash, nil] Row style format or index.
126
372
  # @param height [Float, Integer, nil] The row height in points (0 - 409).
127
373
  # @param hidden [Boolean] Whether the row is hidden.
128
374
  # @param custom_height [Boolean] Whether to flag as custom height.
129
375
  # @param outline_level [Integer, nil] Grouping/outline level (0 - 7).
130
376
  # @param collapsed [Boolean] Whether the row is collapsed.
131
- # @param style [Integer, Symbol, String, Hash, nil] Row style format or index.
377
+ # @param styles [String, Symbol, Array, Hash, nil] Deprecated. Use cell_styles: instead.
378
+ # @param style [Integer, Symbol, String, Hash, nil] Deprecated. Use row_style: instead.
132
379
  # @return [void]
133
380
  # @api public
134
- # : (Array[untyped] | Hash[untyped, untyped] values, ?styles: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?collapsed: bool, ?outline_level: Integer | nil, ?style: untyped) -> void
135
- def row: (Array[untyped] | Hash[untyped, untyped] values, ?styles: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?collapsed: bool, ?outline_level: Integer | nil, ?style: untyped) -> void
381
+ # : (Array[untyped] | Hash[untyped, untyped] values, ?cell_styles: untyped, ?row_style: untyped, ?styles: untyped, ?style: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?collapsed: bool, ?outline_level: Integer | nil) -> void
382
+ def row: (Array[untyped] | Hash[untyped, untyped] values, ?cell_styles: untyped, ?row_style: untyped, ?styles: untyped, ?style: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?collapsed: bool, ?outline_level: Integer | nil) -> void
136
383
 
384
+ # @deprecated Use {#row} instead. Will be removed in 0.2.0.
137
385
  alias add_row row
138
386
 
139
387
  # Appends a row to the worksheet and returns self for chaining.
@@ -147,23 +395,103 @@ module Xlsxrb
147
395
  # : (Array[untyped] | Hash[untyped, untyped] values) -> self
148
396
  def <<: (Array[untyped] | Hash[untyped, untyped] values) -> self
149
397
 
398
+ # Advances the row cursor by count without writing empty row elements.
399
+ #
400
+ # @example Skip one row
401
+ # s.skip_row
402
+ #
403
+ # @example Skip multiple rows
404
+ # s.skip_rows(3)
405
+ #
406
+ # @param count [Integer] Number of rows to skip (must be >= 1).
407
+ # @return [void]
408
+ # @api public
409
+ # : (?Integer count) -> void
410
+ def skip_rows: (?Integer count) -> void
411
+
412
+ # @deprecated Use {#skip_rows} instead. Will be removed in 0.2.0.
413
+ alias skip_row skip_rows
414
+
150
415
  # Configures column width and properties.
151
416
  #
152
417
  # @example Set column A width
153
418
  # s.column(0, width: 25.0)
154
419
  #
155
- # @param col_index [Integer, String, Symbol] 0-based column index or letter (e.g. 0 or "A" or :A).
420
+ # @param index [Integer, String, Symbol, Range, Array] 0-based column index, letter ("A", :A), range, or array.
156
421
  # @param width [Float, Integer, nil] Column width in characters.
157
422
  # @param hidden [Boolean] Whether the column is hidden.
158
- # @param best_fit [Boolean] Whether the column automatically fits content.
159
423
  # @param custom_width [Boolean] Whether to flag as custom width.
160
424
  # @param outline_level [Integer, nil] Grouping/outline level (0 - 7).
161
425
  # @param collapsed [Boolean] Whether the outline group is collapsed.
162
426
  # @param style [Integer, Symbol, String, Hash, nil] Column style format or index.
427
+ # @param best_fit [Boolean] Whether the column automatically fits content.
428
+ # @return [void]
429
+ # @api public
430
+ # : (Integer | String | Symbol | Range[Integer | String | Symbol] | Array[Integer | String | Symbol] index, ?width: Float | Integer | nil, ?hidden: bool, ?custom_width: bool, ?outline_level: Integer | nil, ?collapsed: bool, ?style: (Integer | Symbol | String | Hash[Symbol, untyped])?, ?best_fit: bool) -> void
431
+ def column: (Integer | String | Symbol | Range[Integer | String | Symbol] | Array[Integer | String | Symbol] index, ?width: Float | Integer | nil, ?hidden: bool, ?custom_width: bool, ?outline_level: Integer | nil, ?collapsed: bool, ?style: (Integer | Symbol | String | Hash[Symbol, untyped])?, ?best_fit: bool) -> void
432
+
433
+ # Groups multiple columns together with outline hierarchy.
434
+ #
435
+ # @param index [Integer, String, Range, Array] Column index, letter, range, or array.
436
+ # @param level [Integer] Grouping outline level (1 to 7).
437
+ # @param collapsed [Boolean] Whether the group is collapsed.
438
+ # @param hidden [Boolean] Whether the columns are hidden.
439
+ # @param width [Float, Integer, nil] Optional column width.
440
+ # @param style [Integer, Symbol, String, nil] Optional column style.
441
+ # @return [void]
442
+ # @api public
443
+ # : (Integer | String | Range[Integer | String] | Array[Integer | String] index, ?level: Integer, ?collapsed: bool, ?hidden: bool, ?width: Float | Integer | nil, ?style: untyped) -> void
444
+ def group_columns: (Integer | String | Range[Integer | String] | Array[Integer | String] index, ?level: Integer, ?collapsed: bool, ?hidden: bool, ?width: Float | Integer | nil, ?style: untyped) -> void
445
+
446
+ # @deprecated Use {#group_columns} instead. Will be removed in 0.2.0.
447
+ alias group_column group_columns
448
+
449
+ # @deprecated Use {#group_columns} instead. Will be removed in 0.2.0.
450
+ alias group_cols group_columns
451
+
452
+ # @deprecated Use {#group_columns} instead. Will be removed in 0.2.0.
453
+ alias group_col group_columns
454
+
455
+ # Groups multiple rows with outline hierarchy with a block.
456
+ #
457
+ # @param rows [Range, Array, Integer, nil] Unused in streaming write.
458
+ # @param level [Integer] Grouping outline level (1 to 7).
459
+ # @param collapsed [Boolean] Whether the group is collapsed.
460
+ # @param hidden [Boolean] Whether the rows are hidden.
461
+ # @yield Optional block executed with active group outline settings.
462
+ # @return [void]
463
+ # @api public
464
+ # : (?untyped rows, ?level: Integer, ?collapsed: bool, ?hidden: bool) ?{ (self) -> void } -> void
465
+ def group_rows: (?untyped rows, ?level: Integer, ?collapsed: bool, ?hidden: bool) ?{ (self) -> void } -> void
466
+
467
+ # @deprecated Use {#group_rows} instead. Will be removed in 0.2.0.
468
+ alias group_row group_rows
469
+
470
+ # Configures worksheet-level outline and grouping view properties.
471
+ #
472
+ # @param summary_below [Boolean, nil] Summary rows below detail rows.
473
+ # @param summary_right [Boolean, nil] Summary columns to the right of detail columns.
474
+ # @param show_outline_symbols [Boolean, nil] Outline symbols visible.
475
+ # @param show_symbols [Boolean, nil] Deprecated alias for show_outline_symbols.
476
+ # @param apply_styles [Boolean, nil] Automatic styles applied.
477
+ # @param opts [Hash] Additional options.
478
+ # @return [void]
479
+ # @api public
480
+ # : (?summary_below: bool?, ?summary_right: bool?, ?show_outline_symbols: bool?, ?show_symbols: bool?, ?apply_styles: bool?, **untyped opts) -> void
481
+ def outline_properties: (?summary_below: bool?, ?summary_right: bool?, ?show_outline_symbols: bool?, ?show_symbols: bool?, ?apply_styles: bool?, **untyped opts) -> void
482
+
483
+ # @deprecated Use {#outline_properties} instead. Will be removed in 0.2.0.
484
+ alias outline_pr outline_properties
485
+
486
+ # Sets worksheet outline and grouping view properties.
487
+ #
488
+ # @param opts [Hash] Outline properties.
163
489
  # @return [void]
164
490
  # @api public
165
- # : (Integer | String | Symbol | Range[Integer | String] | Array[Integer | String] col_index, ?width: Float | Integer | nil, ?hidden: bool, ?best_fit: bool, ?custom_width: bool, ?outline_level: Integer | nil, ?collapsed: bool, ?style: (Integer | Symbol | String | Hash[Symbol, untyped])?) -> void
166
- def column: (Integer | String | Symbol | Range[Integer | String] | Array[Integer | String] col_index, ?width: Float | Integer | nil, ?hidden: bool, ?best_fit: bool, ?custom_width: bool, ?outline_level: Integer | nil, ?collapsed: bool, ?style: (Integer | Symbol | String | Hash[Symbol, untyped])?) -> void
491
+ # : (Hash[Symbol, untyped] opts) -> void
492
+ def outline_properties=: (Hash[Symbol, untyped] opts) -> void
493
+
494
+ alias outline_pr= outline_properties=
167
495
 
168
496
  # Adds a chart to the active sheet.
169
497
  #
@@ -174,13 +502,13 @@ module Xlsxrb
174
502
  # end
175
503
  #
176
504
  # @param type [Symbol, String, nil] The chart type (:bar, :col, :line, :pie, :scatter, :area, :doughnut, :radar).
177
- # @param opts [Hash] Additional chart options.
505
+ # @param options [Hash] Additional chart options.
178
506
  # @yield [chart_builder]
179
507
  # @yieldparam chart_builder [Xlsxrb::ChartBuilder]
180
508
  # @return [void]
181
509
  # @api public
182
- # : (?Symbol | String? type, **untyped opts) ?{ (Xlsxrb::ChartBuilder) -> void } -> void
183
- def chart: (?Symbol | String? type, **untyped opts) ?{ (Xlsxrb::ChartBuilder) -> void } -> void
510
+ # : (?Symbol | String? type, **untyped options) ?{ (ChartBuilder) -> void } -> void
511
+ def chart: (?Symbol | String? type, **untyped options) ?{ (ChartBuilder) -> void } -> void
184
512
 
185
513
  # Adds a hyperlink to a cell.
186
514
  #
@@ -205,23 +533,31 @@ module Xlsxrb
205
533
  # @example
206
534
  # s.auto_filter("A1:D100")
207
535
  #
208
- # @param ref [String] The cell range (e.g. "A1:D10").
536
+ # @param range [String, nil] The cell range (e.g. "A1:D10").
209
537
  # @return [void]
210
538
  # @api public
211
- # : (String ref) -> void
212
- def auto_filter: (String ref) -> void
539
+ # : (String? range) -> void
540
+ def auto_filter: (String? range) -> void
541
+
542
+ # Sets the auto-filter range on the active sheet.
543
+ #
544
+ # @param range [String, nil] The cell range (e.g. "A1:D10").
545
+ # @return [String, nil]
546
+ # @api public
547
+ # : (String? range) -> String?
548
+ def auto_filter=: (String? range) -> String?
213
549
 
214
550
  # Sets filter criteria for a column in the auto-filter.
215
551
  #
216
552
  # @example Simple values filter
217
553
  # s.filter_column(0, ["Active", "Pending"])
218
554
  #
219
- # @param col_id [Integer] 0-based column index relative to auto-filter range.
220
- # @param filter_values [Array<String>, Hash] Values or filter specification hash.
555
+ # @param col_id [Integer, String, Symbol] 0-based column index relative to auto-filter range or column letter.
556
+ # @param filter [Hash] Values or filter specification hash.
221
557
  # @return [void]
222
558
  # @api public
223
- # : (Integer col_id, Array[String] | Hash[Symbol, untyped] filter_values) -> void
224
- def filter_column: (Integer col_id, Array[String] | Hash[Symbol, untyped] filter_values) -> void
559
+ # : (Integer | String | Symbol col_id, Hash[untyped, untyped] filter) -> void
560
+ def filter_column: (Integer | String | Symbol col_id, Hash[untyped, untyped] filter) -> void
225
561
 
226
562
  # Configures sort state on a range.
227
563
  #
@@ -229,22 +565,28 @@ module Xlsxrb
229
565
  # s.sort_state("A1:A10", [{ ref: "A1:A10", descending: true }])
230
566
  #
231
567
  # @param ref [String] The range to sort.
232
- # @param sort_conditions [Array<Hash>, Hash] Sort conditions array or options hash.
568
+ # @param sort_conditions [Array<Hash>] Sort conditions array.
233
569
  # @param opts [Hash] Additional sort options.
234
570
  # @return [void]
235
571
  # @api public
236
- # : (String ref, Array[Hash[Symbol, untyped]] | Hash[Symbol, untyped] sort_conditions, **untyped opts) -> void
237
- def sort_state: (String ref, Array[Hash[Symbol, untyped]] | Hash[Symbol, untyped] sort_conditions, **untyped opts) -> void
572
+ # : (String ref, Array[Hash[untyped, untyped]] sort_conditions, **untyped opts) -> void
573
+ def sort_state: (String ref, Array[Hash[untyped, untyped]] sort_conditions, **untyped opts) -> void
238
574
 
239
- # Adds data validation rules to a range.
575
+ # Sets column sort state for the sheet.
240
576
  #
241
- # Adds data validation to a cell or range.
577
+ # @param opts [Elements::SortState, Hash, nil] Sort state options.
578
+ # @return [void]
579
+ # @api public
580
+ # : (untyped opts) -> void
581
+ def sort_state=: (untyped opts) -> void
582
+
583
+ # Adds data validation rules to a range.
242
584
  #
243
585
  # @example Dropdown list validation
244
- # s.validate_data("B2:B100", type: "list", formula1: '"High,Medium,Low"')
586
+ # s.data_validation("B2:B100", type: "list", formula1: '"High,Medium,Low"')
245
587
  #
246
588
  # @example Block syntax
247
- # s.validate_data("B2:B100") do |dv|
589
+ # s.data_validation("B2:B100") do |dv|
248
590
  # dv.type :list
249
591
  # dv.formula1 '"High,Medium,Low"'
250
592
  # end
@@ -256,6 +598,10 @@ module Xlsxrb
256
598
  # @return [void]
257
599
  # @api public
258
600
  # : (?String? range, ?type: (String | Symbol)?, **untyped opts) ?{ (DataValidationBuilder) -> void } -> void
601
+ def data_validation: (?String? range, ?type: (String | Symbol)?, **untyped opts) ?{ (DataValidationBuilder) -> void } -> void
602
+
603
+ # @deprecated Use {#data_validation} instead.
604
+ # : (?String? range, ?type: (String | Symbol)?, **untyped opts) ?{ (DataValidationBuilder) -> void } -> void
259
605
  def validate_data: (?String? range, ?type: (String | Symbol)?, **untyped opts) ?{ (DataValidationBuilder) -> void } -> void
260
606
 
261
607
  # Adds conditional formatting to a range.
@@ -263,13 +609,20 @@ module Xlsxrb
263
609
  # @example Highlight values greater than 100
264
610
  # s.conditional_format("A1:A10", type: "cellIs", operator: "greaterThan", formula: 100, style: :highlight)
265
611
  #
266
- # @param range [String] The cell range (e.g. "A1:A10").
267
- # @param type [String, Symbol] Rule type ("cellIs", "colorScale", "dataBar", "expression").
612
+ # @example Hierarchical differential format (dxf)
613
+ # s.conditional_format("B2:B20", type: :cell_is, operator: "equal", formula: "0",
614
+ # dxf: { font: { bold: false, color: { auto: true } }, fill: { pattern: "none", bg_color: "FFFF00" } })
615
+ #
616
+ # @param sqref [String, nil] The cell range (e.g. "A1:A10").
617
+ # @param type [String, Symbol, nil] Rule type ("cellIs", "colorScale", "dataBar", "expression").
268
618
  # @param opts [Hash] Rule options.
619
+ # @option opts [Hash] :dxf Hierarchical differential format specification.
620
+ # @option opts [Integer] :format_id Pre-registered differential format index (dxfId).
621
+ # @yield [conditional_format_builder] Optional block for configuration.
269
622
  # @return [void]
270
623
  # @api public
271
- # : (String range, ?type: String | Symbol, **untyped opts) -> void
272
- def conditional_format: (String range, ?type: String | Symbol, **untyped opts) -> void
624
+ # : (?String? sqref, ?type: String | Symbol, **untyped opts) ?{ (ConditionalFormatBuilder) -> void } -> void
625
+ def conditional_format: (?String? sqref, ?type: String | Symbol, **untyped opts) ?{ (ConditionalFormatBuilder) -> void } -> void
273
626
 
274
627
  # Adds a formatted Excel Table to the sheet.
275
628
  #
@@ -296,6 +649,7 @@ module Xlsxrb
296
649
 
297
650
  # simplecov:disable
298
651
  # Edge case / untested delegation block
652
+ # @api private
299
653
  # : () -> void
300
654
  def cleanup!: () -> void
301
655
 
@@ -312,21 +666,37 @@ module Xlsxrb
312
666
  # : (String | Integer cell, String text, ?author: String) -> void
313
667
  def comment: (String | Integer cell, String text, ?author: String) -> void
314
668
 
669
+ # Adds a threaded comment to a cell.
670
+ #
671
+ # @param cell [String, Integer] The cell reference (e.g. "A1").
672
+ # @param text [String] The comment text.
673
+ # @param author [String] The author name.
674
+ # @param opts [Hash] Options: timestamp, id, parent_id, done, user_id, provider_id.
675
+ # @return [void]
676
+ # @api public
677
+ # : (String | Integer cell, String text, ?author: untyped, ?timestamp: untyped, ?id: String?, ?parent_id: String?, ?done: bool?, ?user_id: String?, ?provider_id: String?) -> void
678
+ def threaded_comment: (String | Integer cell, String text, ?author: untyped, ?timestamp: untyped, ?id: String?, ?parent_id: String?, ?done: bool?, ?user_id: String?, ?provider_id: String?) -> void
679
+
680
+ # @deprecated Use {#threaded_comment} instead. Will be removed in 0.2.0.
681
+ alias add_threaded_comment threaded_comment
682
+
315
683
  # Adds a Pivot Table to the sheet.
316
684
  #
317
685
  # @param source_ref [String] Source data range reference (e.g. "Sheet1!A1:D100").
318
686
  # @param row_fields [Array<String>] Field names for rows.
319
687
  # @param data_fields [Array<String>] Field names for data values.
320
- # @param col_fields [Array<String>] Field names for columns.
321
- # @param dest_ref [String] Target top-left cell reference (default: "E1").
688
+ # @param column_fields [Array<String>] Field names for columns.
689
+ # @param col_fields [Array<String>] Deprecated alias for column_fields.
690
+ # @param ref [String] Target top-left cell reference (default: "E1").
691
+ # @param dest_ref [String] Deprecated alias for ref.
322
692
  # @param name [String, nil] Pivot table name.
323
693
  # @param field_names [Array<String>, nil] Override field names.
324
694
  # @param items [Array, nil] Items configuration.
325
695
  # @param opts [Hash] Additional options.
326
696
  # @return [void]
327
697
  # @api public
328
- # : (String source_ref, row_fields: untyped, data_fields: untyped, ?col_fields: untyped, ?dest_ref: String, ?name: String?, ?field_names: untyped, ?items: untyped, **untyped opts) -> void
329
- def pivot_table: (String source_ref, row_fields: untyped, data_fields: untyped, ?col_fields: untyped, ?dest_ref: String, ?name: String?, ?field_names: untyped, ?items: untyped, **untyped opts) -> void
698
+ # : (String source_ref, row_fields: untyped, data_fields: untyped, ?column_fields: untyped, ?col_fields: untyped, ?ref: String?, ?dest_ref: String?, ?name: String?, ?field_names: untyped, ?items: untyped, **untyped opts) -> void
699
+ def pivot_table: (String source_ref, row_fields: untyped, data_fields: untyped, ?column_fields: untyped, ?col_fields: untyped, ?ref: String?, ?dest_ref: String?, ?name: String?, ?field_names: untyped, ?items: untyped, **untyped opts) -> void
330
700
 
331
701
  # Adds sparklines to the sheet.
332
702
  #
@@ -356,6 +726,7 @@ module Xlsxrb
356
726
  # @param range [String, nil] Data range for the sparkline (e.g. "A1:E1").
357
727
  # @param type [Symbol, String, nil] Sparkline type (:line, :column, :win_loss / :stacked).
358
728
  # @param opts [Hash] Additional sparkline options.
729
+ # @deprecated Use {#sparkline_group} instead. Will be removed in 0.2.0.
359
730
  # @return [void]
360
731
  # @api public
361
732
  # : (?location: String?, ?range: String?, ?type: (String | Symbol)?, **untyped opts) -> void
@@ -363,37 +734,171 @@ module Xlsxrb
363
734
 
364
735
  # Sets workbook-level properties.
365
736
  #
366
- # @param opts [Hash] Workbook property options.
737
+ # @param name [Symbol] Workbook property name.
738
+ # @param value [String, Integer, Boolean] Property value.
367
739
  # @return [void]
368
740
  # @api public
369
- # : (**untyped opts) -> void
370
- def workbook_property: (**untyped opts) -> void
741
+ # : (Symbol name, String | Integer | bool value) -> void
742
+ def workbook_property: (Symbol name, String | Integer | bool value) -> void
371
743
 
372
- # Sets sheet properties (e.g. tab color, page setup flags).
744
+ # Sets or gets the active sheet in the workbook window.
745
+ # If called without arguments on the proxy, marks this sheet as the active sheet.
373
746
  #
374
- # @example
375
- # s.sheet_properties(:tab_color, "FF0000")
747
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#active_sheet=} instead.
748
+ # @param name_or_index [String, Symbol, Integer, nil]
749
+ # @return [String, Symbol, Integer, nil]
750
+ # @api public
751
+ # : (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
752
+ def active_sheet: (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
753
+
754
+ # @deprecated Use {#active_sheet} instead. Will be removed in 0.2.0.
755
+ alias active_tab active_sheet
756
+
757
+ # Sets the active worksheet tab in the workbook window.
758
+ #
759
+ # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
760
+ # @return [String, Symbol, Integer, nil]
761
+ # @api public
762
+ # : (String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
763
+ def active_sheet=: (String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
764
+
765
+ # @deprecated Use {#active_sheet=} instead. Will be removed in 0.2.0.
766
+ alias active_tab= active_sheet=
767
+
768
+ # Sets or gets the first visible sheet in the tab bar.
769
+ #
770
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#first_sheet=} instead.
771
+ # @param name_or_index [String, Symbol, Integer, nil]
772
+ # @return [String, Symbol, Integer, nil]
773
+ # @api public
774
+ # : (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
775
+ def first_sheet: (?String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
776
+
777
+ # Sets the first visible sheet in the tab bar.
778
+ #
779
+ # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
780
+ # @return [String, Symbol, Integer, nil]
781
+ # @api public
782
+ # : (String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
783
+ def first_sheet=: (String | Symbol | Integer | nil name_or_index) -> (String | Symbol | Integer | nil)
784
+
785
+ # Sets or gets whether sheet tabs are visible in the workbook window.
786
+ #
787
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#show_sheet_tabs=} instead.
788
+ # @param visible [Boolean, nil]
789
+ # @return [Boolean, nil]
790
+ # @api public
791
+ # : (?bool? visible) -> bool?
792
+ def show_sheet_tabs: (?bool? visible) -> bool?
793
+
794
+ # Sets whether sheet tabs are visible in the workbook window.
795
+ #
796
+ # @param visible [Boolean, nil]
797
+ # @return [Boolean, nil]
798
+ # @api public
799
+ # : (bool? visible) -> bool?
800
+ def show_sheet_tabs=: (bool? visible) -> bool?
801
+
802
+ # Sets or gets the tab ratio between tab bar and horizontal scrollbar (0-1000).
803
+ #
804
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#tab_ratio=} instead.
805
+ # @param ratio [Integer, nil]
806
+ # @return [Integer, nil]
807
+ # @api public
808
+ # : (?Integer? ratio) -> Integer?
809
+ def tab_ratio: (?Integer? ratio) -> Integer?
810
+
811
+ # Sets the tab ratio between tab bar and horizontal scrollbar (0-1000).
812
+ #
813
+ # @param ratio [Integer, nil]
814
+ # @return [Integer, nil]
815
+ # @api public
816
+ # : (Integer? ratio) -> Integer?
817
+ def tab_ratio=: (Integer? ratio) -> Integer?
818
+
819
+ # Gets or sets the sheet visibility state (:visible, :hidden, or :very_hidden).
820
+ #
821
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#state=} instead.
822
+ # @param new_state [Symbol, nil] The new state.
823
+ # @return [Symbol]
824
+ # @api public
825
+ # : (?Symbol? new_state) -> Symbol
826
+ def state: (?Symbol? new_state) -> Symbol
827
+
828
+ # Sets the sheet visibility state (:visible, :hidden, or :very_hidden).
829
+ #
830
+ # @param new_state [Symbol, String] The new state.
831
+ # @return [Symbol]
832
+ # @api public
833
+ # : (Symbol | String new_state) -> Symbol
834
+ def state=: (Symbol | String new_state) -> Symbol
835
+
836
+ # Gets or sets the tab color of this worksheet.
837
+ #
838
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#tab_color=} instead.
839
+ # @param spec [String, Hash, Symbol, nil] Tab color hex string or hash options.
840
+ # @param opts [Hash] Color keyword arguments (e.g. theme: 1, tint: 0.5).
841
+ # @return [String, Hash, nil]
842
+ # @api public
843
+ # : (?String | Symbol | Hash[Symbol, untyped] | nil spec, **untyped opts) -> (String | Hash[Symbol, untyped] | nil)
844
+ def tab_color: (?String | Symbol | Hash[Symbol, untyped] | nil spec, **untyped opts) -> (String | Hash[Symbol, untyped] | nil)
845
+
846
+ # Sets the tab color of this worksheet.
847
+ #
848
+ # @param spec [String, Hash, Symbol, nil] Tab color hex string or hash options.
849
+ # @return [String, Hash, nil]
850
+ # @api public
851
+ # : (String | Symbol | Hash[Symbol, untyped] | nil spec) -> (String | Hash[Symbol, untyped] | nil)
852
+ def tab_color=: (String | Symbol | Hash[Symbol, untyped] | nil spec) -> (String | Hash[Symbol, untyped] | nil)
853
+
854
+ # Sets a single sheet property.
376
855
  #
377
856
  # @param name [Symbol, String] Property name.
378
857
  # @param value [Object] Property value.
379
858
  # @return [void]
380
859
  # @api public
381
860
  # : (Symbol | String name, untyped value) -> void
382
- def sheet_properties: (Symbol | String name, untyped value) -> void
861
+ def sheet_property: (Symbol | String name, untyped value) -> void
383
862
 
384
- # Adds a defined named range or formula.
863
+ # Sets sheet properties (e.g. tab color, page setup flags). Accepts kwargs or name/value pair.
385
864
  #
386
865
  # @example
387
- # s.defined_name("TaxRate", "0.10")
866
+ # s.sheet_properties(tab_color: "FF0000")
388
867
  #
389
- # @param name [String] The name.
390
- # @param formula [String] The formula or range expression.
391
- # @param sheet_id [Integer, nil] Optional sheet scope.
392
- # @param hidden [Boolean] Whether the name is hidden.
868
+ # @param name [Symbol, String, Hash, nil] Property name or hash.
869
+ # @param value [Object, nil] Property value.
870
+ # @param opts [Hash] Additional options.
393
871
  # @return [void]
394
872
  # @api public
395
- # : (String name, String formula, ?sheet_id: Integer | nil, ?hidden: bool) -> void
396
- def defined_name: (String name, String formula, ?sheet_id: Integer | nil, ?hidden: bool) -> void
873
+ # : (?Symbol | String | Hash[Symbol, untyped] | nil name, ?untyped value, **untyped opts) -> void
874
+ def sheet_properties: (?Symbol | String | Hash[Symbol, untyped] | nil name, ?untyped value, **untyped opts) -> void
875
+
876
+ # Replaces worksheet properties.
877
+ # @param opts [Hash, Elements::SheetProperties]
878
+ # @return [void]
879
+ # @api public
880
+ # : (Hash[Symbol, untyped] | Elements::SheetProperties opts) -> void
881
+ def sheet_properties=: (Hash[Symbol, untyped] | Elements::SheetProperties opts) -> void
882
+
883
+ # Adds a defined name (named range or formula) scoped to this sheet or workbook.
884
+ # Bare cell references and coordinate keywords are automatically formatted with sheet quotes and absolute $ references.
885
+ #
886
+ # @param name [String] Defined name identifier.
887
+ # @param value [Object, nil] Value or formula expression.
888
+ # @param hidden [Boolean] Whether the defined name is hidden.
889
+ # @param column [Integer, String, nil] Deprecated alias for columns.
890
+ # @param columns [Integer, String, nil] Column index or letter for coordinate-based reference.
891
+ # @param col [Integer, String, nil] Deprecated alias for column.
892
+ # @param row [Integer, Range, nil] Deprecated alias for rows.
893
+ # @param rows [Integer, Range, nil] Row or row range (1-based) for coordinate-based reference.
894
+ # @param range [String, nil] Cell range reference.
895
+ # @param sheet [String, nil] Reference sheet name (defaults to current sheet).
896
+ # @param scope [String, Symbol, nil] Scope identifier (:workbook or sheet name).
897
+ # @param local [Boolean] Deprecated alias for scope: :current.
898
+ # @return [void]
899
+ # @api public
900
+ # : (String name, ?untyped value, ?hidden: bool, ?column: untyped, ?columns: untyped, ?col: untyped, ?row: untyped, ?rows: untyped, ?range: untyped, ?sheet: String?, ?scope: (String | Symbol)?, ?local: bool) -> void
901
+ def defined_name: (String name, ?untyped value, ?hidden: bool, ?column: untyped, ?columns: untyped, ?col: untyped, ?row: untyped, ?rows: untyped, ?range: untyped, ?sheet: String?, ?scope: (String | Symbol)?, ?local: bool) -> void
397
902
 
398
903
  # Freezes rows and/or columns for scrolling.
399
904
  #
@@ -401,35 +906,57 @@ module Xlsxrb
401
906
  # s.freeze_pane(row: 1)
402
907
  #
403
908
  # @example Freeze first column and top 2 rows
404
- # s.freeze_pane(row: 2, col: 1)
909
+ # s.freeze_pane(row: 2, column: 1)
405
910
  #
406
911
  # @param row [Integer, nil] Number of rows to freeze.
407
- # @param col [Integer, nil] Number of columns to freeze.
912
+ # @param column [Integer, String, nil] Number of columns to freeze.
913
+ # @param col [Integer, String, nil] Deprecated alias for column.
408
914
  # @return [void]
409
915
  # @api public
410
- # : (?row: Integer | nil, ?col: Integer | nil) -> void
411
- def freeze_pane: (?row: Integer | nil, ?col: Integer | nil) -> void
916
+ # : (?row: Integer | nil, ?column: (Integer | String)?, ?col: (Integer | String)?) -> void
917
+ def freeze_pane: (?row: Integer | nil, ?column: (Integer | String)?, ?col: (Integer | String)?) -> void
412
918
 
413
- # simplecov:disable
414
- # Edge case / untested delegation block
415
- # Sets the print area range for the sheet.
919
+ # Sets or clears freeze pane configuration.
416
920
  #
417
- # @param ref [String] Range reference.
921
+ # @param opts [Elements::FreezePane, Hash, nil] Freeze pane options.
418
922
  # @return [void]
419
923
  # @api public
420
- # : (String ref) -> void
421
- def print_area: (String ref) -> void
924
+ # : (untyped opts) -> void
925
+ def freeze_pane=: (untyped opts) -> void
422
926
 
423
- # simplecov:disable
424
- # Edge case / untested delegation block
425
- # Configures repeating title rows and columns for printing.
927
+ # Sets or gets the print area range for the sheet.
426
928
  #
427
- # @param rows [String, nil] Row range to repeat (e.g. "1:2").
428
- # @param cols [String, nil] Column range to repeat (e.g. "A:B").
429
- # @return [void]
929
+ # @param range [String, Object, nil] Range reference.
930
+ # @return [String, nil, void]
931
+ # @api public
932
+ # : (?untyped range) -> (String | nil | void)
933
+ def print_area: (?untyped range) -> untyped
934
+
935
+ # Sets the print area for this worksheet.
936
+ #
937
+ # @param range [String, nil] Cell range (e.g. "A1:G50").
938
+ # @return [String, nil]
939
+ # @api public
940
+ # : (String? range) -> String?
941
+ def print_area=: (String? range) -> String?
942
+
943
+ # Configures or gets repeating title rows and columns for printing.
944
+ #
945
+ # @param rows [String, Integer, Range, Object, nil] Row range to repeat (e.g. "1:2").
946
+ # @param columns [String, Integer, Symbol, Range, Object, nil] Column range to repeat (e.g. "A:B").
947
+ # @param cols [String, Integer, Symbol, Range, Object, nil] Deprecated alias for columns.
948
+ # @return [Elements::PrintTitles, nil, void]
949
+ # @api public
950
+ # : (?rows: untyped, ?columns: untyped, ?cols: untyped) -> (Elements::PrintTitles | nil | void)
951
+ def print_titles: (?rows: untyped, ?columns: untyped, ?cols: untyped) -> untyped
952
+
953
+ # Sets repeating print titles for this worksheet.
954
+ #
955
+ # @param opts [Elements::PrintTitles, Hash, nil] Options with :rows and/or :columns.
956
+ # @return [Elements::PrintTitles, Hash, nil]
430
957
  # @api public
431
- # : (?rows: String?, ?cols: String?) -> void
432
- def print_titles: (?rows: String?, ?cols: String?) -> void
958
+ # : (Elements::PrintTitles | Hash[Symbol, untyped] | nil opts) -> (Elements::PrintTitles | Hash[Symbol, untyped] | nil)
959
+ def print_titles=: (Elements::PrintTitles | Hash[Symbol, untyped] | nil opts) -> (Elements::PrintTitles | Hash[Symbol, untyped] | nil)
433
960
 
434
961
  # Sets repeating title rows to appear at the top of each printed page.
435
962
  #
@@ -451,45 +978,69 @@ module Xlsxrb
451
978
 
452
979
  # Splits sheet view into panes.
453
980
  #
454
- # @param x_split [Numeric, nil] Horizontal split position.
455
- # @param y_split [Numeric, nil] Vertical split position.
981
+ # @param x_split [Integer] Horizontal split position.
982
+ # @param y_split [Integer] Vertical split position.
456
983
  # @param top_left_cell [String, nil] Top-left visible cell in bottom-right pane.
457
- # @param active_pane [String, nil] Active pane identifier.
458
- # @param state [String, nil] Split state.
984
+ # @param active_pane [String, Symbol, nil] Active pane identifier.
985
+ # @param state [String, Symbol, nil] Split state.
986
+ # @return [void]
987
+ # @api public
988
+ # : (?x_split: Integer, ?y_split: Integer, ?top_left_cell: String?, ?active_pane: (String | Symbol)?, ?state: (String | Symbol)?) -> void
989
+ def split_pane: (?x_split: Integer, ?y_split: Integer, ?top_left_cell: String?, ?active_pane: (String | Symbol)?, ?state: (String | Symbol)?) -> void
990
+
991
+ # Sets or clears split pane configuration.
992
+ #
993
+ # @param opts [Elements::SplitPane, Hash, nil] Split pane options.
459
994
  # @return [void]
460
995
  # @api public
461
- # : (?x_split: Numeric | nil, ?y_split: Numeric | nil, ?top_left_cell: String?, ?active_pane: String?, ?state: String?) -> void
462
- def split_pane: (?x_split: Numeric | nil, ?y_split: Numeric | nil, ?top_left_cell: String?, ?active_pane: String?, ?state: String?) -> void
996
+ # : (untyped opts) -> void
997
+ def split_pane=: (untyped opts) -> void
463
998
 
464
999
  # simplecov:disable
465
1000
  # Edge case / untested delegation block
466
- # Protects the workbook structure.
1001
+ # Sets workbook structure and window protection.
467
1002
  #
468
1003
  # @param opts [Hash] Protection options.
469
1004
  # @return [void]
470
1005
  # @api public
471
1006
  # : (**untyped opts) -> void
1007
+ def workbook_protection: (**untyped opts) -> void
1008
+
1009
+ # @deprecated Use {#workbook_protection} instead.
1010
+ # : (**untyped opts) -> void
472
1011
  def protect_workbook: (**untyped opts) -> void
473
1012
 
474
1013
  # simplecov:disable
475
1014
  # Edge case / untested delegation block
476
1015
  # Sets core metadata property.
477
1016
  #
478
- # @param name [String, Symbol] Property name.
479
- # @param value [Object] Property value.
1017
+ # @param name [Symbol] Property name.
1018
+ # @param value [String, Integer, Time] Property value.
480
1019
  # @return [void]
481
1020
  # @api public
482
- # : (String | Symbol name, untyped value) -> void
483
- def core_property: (String | Symbol name, untyped value) -> void
1021
+ # : (Symbol name, String | Integer | Time value) -> void
1022
+ def core_property: (Symbol name, String | Integer | Time value) -> void
484
1023
 
485
1024
  # Sets the active/selected cell on the sheet.
486
1025
  #
487
- # @param active_cell [String] Cell reference (e.g. "A1").
1026
+ # @param active_cell [String] Cell reference (e.g. "A1") or range (e.g. "A1:D10").
488
1027
  # @param sqref [String, nil] Selection range.
489
1028
  # @param pane [String, Symbol, nil] Pane identifier.
490
1029
  # @return [void]
491
1030
  # @api public
492
1031
  # : (String active_cell, ?sqref: String?, ?pane: (String | Symbol)?) -> void
1032
+ def selection: (String active_cell, ?sqref: String?, ?pane: (String | Symbol)?) -> void
1033
+
1034
+ # Sets or clears the selection configuration.
1035
+ #
1036
+ # @param opts [Elements::Selection, Array<Elements::Selection, Hash>, Hash, nil]
1037
+ # @return [void]
1038
+ # @api public
1039
+ # : (untyped opts) -> void
1040
+ def selection=: (untyped opts) -> void
1041
+
1042
+ # @deprecated Use {#selection} instead.
1043
+ # : (String active_cell, ?sqref: String?, ?pane: (String | Symbol)?) -> void
493
1044
  def select_cell: (String active_cell, ?sqref: String?, ?pane: (String | Symbol)?) -> void
494
1045
 
495
1046
  # Configures page margins for printing.
@@ -505,6 +1056,14 @@ module Xlsxrb
505
1056
  # : (?left: Float | nil, ?right: Float | nil, ?top: Float | nil, ?bottom: Float | nil, ?header: Float | nil, ?footer: Float | nil) -> void
506
1057
  def page_margins: (?left: Float | nil, ?right: Float | nil, ?top: Float | nil, ?bottom: Float | nil, ?header: Float | nil, ?footer: Float | nil) -> void
507
1058
 
1059
+ # Sets page margins configuration.
1060
+ #
1061
+ # @param opts [Hash, Elements::PageMargins, nil]
1062
+ # @return [void]
1063
+ # @api public
1064
+ # : (untyped opts) -> void
1065
+ def page_margins=: (untyped opts) -> void
1066
+
508
1067
  # Configures page orientation, paper size, and print setup.
509
1068
  #
510
1069
  # @param orientation [String, Symbol, nil] "portrait" or "landscape" (or :portrait, :landscape).
@@ -515,6 +1074,14 @@ module Xlsxrb
515
1074
  # : (?orientation: (String | Symbol)?, ?paper_size: Integer | nil, **untyped opts) -> void
516
1075
  def page_setup: (?orientation: (String | Symbol)?, ?paper_size: Integer | nil, **untyped opts) -> void
517
1076
 
1077
+ # Sets page setup configuration.
1078
+ #
1079
+ # @param opts [Hash, Elements::PageSetup]
1080
+ # @return [void]
1081
+ # @api public
1082
+ # : (untyped opts) -> void
1083
+ def page_setup=: (untyped opts) -> void
1084
+
518
1085
  # Configures header and footer text for printing.
519
1086
  #
520
1087
  # @param opts [Hash] Header and footer specifications.
@@ -523,14 +1090,30 @@ module Xlsxrb
523
1090
  # : (**untyped opts) -> void
524
1091
  def header_footer: (**untyped opts) -> void
525
1092
 
1093
+ # Sets header and footer configuration.
1094
+ #
1095
+ # @param opts [Hash, Elements::HeaderFooter]
1096
+ # @return [void]
1097
+ # @api public
1098
+ # : (untyped opts) -> void
1099
+ def header_footer=: (untyped opts) -> void
1100
+
526
1101
  # Configures print options (e.g. gridlines, headings).
527
1102
  #
528
- # @param name [Symbol, String] Print option name.
529
- # @param value [Object] Print option value.
1103
+ # @param name [Symbol, String, Hash, nil] Print option name or hash.
1104
+ # @param value [Object, nil] Print option value.
1105
+ # @param opts [Hash] Additional options.
530
1106
  # @return [void]
531
1107
  # @api public
532
- # : (Symbol | String name, untyped value) -> void
533
- def print_options: (Symbol | String name, untyped value) -> void
1108
+ # : (?Symbol | String | Hash[Symbol, untyped] | nil name, ?untyped value, **untyped opts) -> void
1109
+ def print_options: (?Symbol | String | Hash[Symbol, untyped] | nil name, ?untyped value, **untyped opts) -> void
1110
+
1111
+ # Replaces print options.
1112
+ # @param opts [Hash, Elements::PrintOptions]
1113
+ # @return [void]
1114
+ # @api public
1115
+ # : (Hash[Symbol, untyped] | Elements::PrintOptions opts) -> void
1116
+ def print_options=: (Hash[Symbol, untyped] | Elements::PrintOptions opts) -> void
534
1117
 
535
1118
  # simplecov:disable
536
1119
  # Edge case / untested delegation block
@@ -548,54 +1131,106 @@ module Xlsxrb
548
1131
  # Edge case / untested delegation block
549
1132
  # Sets app metadata property.
550
1133
  #
551
- # @param name [String, Symbol] Property name.
552
- # @param value [Object] Property value.
1134
+ # @param name [Symbol] Property name.
1135
+ # @param value [String, Integer, Time] Property value.
553
1136
  # @return [void]
554
1137
  # @api public
555
- # : (String | Symbol name, untyped value) -> void
556
- def app_property: (String | Symbol name, untyped value) -> void
1138
+ # : (Symbol name, String | Integer | Time value) -> void
1139
+ def app_property: (Symbol name, String | Integer | Time value) -> void
557
1140
 
558
- # Protects the worksheet against modifications.
1141
+ # Sets sheet-level protection with optional password hashing.
559
1142
  #
560
1143
  # @param opts [Hash] Protection options.
561
1144
  # @return [void]
562
1145
  # @api public
563
1146
  # : (**untyped opts) -> void
1147
+ def sheet_protection: (**untyped opts) -> void
1148
+
1149
+ # Sets or clears sheet protection configuration.
1150
+ #
1151
+ # @param opts [Elements::SheetProtection, Hash, Boolean, nil]
1152
+ # @return [void]
1153
+ # @api public
1154
+ # : (untyped opts) -> void
1155
+ def sheet_protection=: (untyped opts) -> void
1156
+
1157
+ # @deprecated Use {#sheet_protection} instead.
1158
+ # : (**untyped opts) -> void
564
1159
  def protect_sheet: (**untyped opts) -> void
565
1160
 
566
1161
  # simplecov:disable
567
1162
  # Edge case / untested delegation block
568
1163
  # Sets custom metadata property.
569
1164
  #
570
- # @param name [String, Symbol] Property name.
571
- # @param value [Object] Property value.
1165
+ # @param name [String] Property name.
1166
+ # @param value [String, Integer, Float, Boolean, Time] Property value.
1167
+ # @param type [Symbol] Value type.
572
1168
  # @return [void]
573
1169
  # @api public
574
- # : (String | Symbol name, untyped value) -> void
575
- def custom_property: (String | Symbol name, untyped value) -> void
1170
+ # : (String name, String | Integer | Float | bool | Time value, ?type: ::Symbol) -> void
1171
+ def custom_property: (String name, String | Integer | Float | bool | Time value, ?type: ::Symbol) -> void
576
1172
 
577
1173
  # Inserts an image into the sheet.
578
1174
  #
579
1175
  # @param file_data [String] Binary image data or file content.
580
1176
  # @param ext [String] Image extension ("png", "jpeg", etc.).
581
- # @param from_col [Integer] Starting column index (0-based).
1177
+ # @param from_column [Integer, nil] Starting column index (0-based).
1178
+ # @param from_col [Integer, nil] Deprecated alias for from_column.
582
1179
  # @param from_row [Integer] Starting row index (0-based).
583
- # @param to_col [Integer] Ending column index (0-based).
1180
+ # @param to_column [Integer, nil] Ending column index (0-based).
1181
+ # @param to_col [Integer, nil] Deprecated alias for to_column.
584
1182
  # @param to_row [Integer] Ending row index (0-based).
585
1183
  # @param opts [Hash] Additional anchor and sizing options.
586
1184
  # @return [void]
587
1185
  # @api public
588
- # : (String file_data, ?ext: String, ?from_col: Integer, ?from_row: Integer, ?to_col: Integer, ?to_row: Integer, **untyped opts) -> void
589
- def image: (String file_data, ?ext: String, ?from_col: Integer, ?from_row: Integer, ?to_col: Integer, ?to_row: Integer, **untyped opts) -> void
1186
+ # : (String file_data, ?ext: String, ?from_column: Integer?, ?from_col: Integer?, ?from_row: Integer, ?to_column: Integer?, ?to_col: Integer?, ?to_row: Integer, **untyped opts) -> void
1187
+ def image: (String file_data, ?ext: String, ?from_column: Integer?, ?from_col: Integer?, ?from_row: Integer, ?to_column: Integer?, ?to_col: Integer?, ?to_row: Integer, **untyped opts) -> void
1188
+
1189
+ # Configures the worksheet background image (<picture>).
1190
+ #
1191
+ # @example Set background image from binary data
1192
+ # sheet.background_image(png_bytes, ext: "png")
1193
+ #
1194
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#background_image=} instead.
1195
+ # @param file_data [String, Hash, Elements::Image, nil] Image binary data, file path, or image options hash.
1196
+ # @param ext [String, nil] Image extension.
1197
+ # @param opts [Hash] Additional options.
1198
+ # @return [Hash, nil]
1199
+ # @api public
1200
+ # : (?untyped file_data, ?ext: String?, **untyped opts) -> Hash[Symbol, untyped]?
1201
+ def background_image: (?untyped file_data, ?ext: String?, **untyped opts) -> Hash[Symbol, untyped]?
1202
+
1203
+ # @deprecated Use {#background_image} instead. Will be removed in 0.2.0.
1204
+ alias background_picture background_image
1205
+
1206
+ # @deprecated Use {#background_image} instead. Will be removed in 0.2.0.
1207
+ alias picture background_image
1208
+
1209
+ # : (untyped val) -> untyped
1210
+ def background_image=: (untyped val) -> untyped
1211
+
1212
+ # @deprecated Use {#background_image=} instead. Will be removed in 0.2.0.
1213
+ alias background_picture= background_image=
1214
+
1215
+ # @deprecated Use {#background_image=} instead. Will be removed in 0.2.0.
1216
+ alias picture= background_image=
590
1217
 
591
1218
  # Configures sheet view settings (zoom scale, grid lines visibility).
592
1219
  #
593
- # @param name [Symbol, String] View setting name.
594
- # @param value [Object] View setting value.
1220
+ # @param name [Symbol, String, Hash, nil] View setting name or hash.
1221
+ # @param value [Object, nil] View setting value.
1222
+ # @param opts [Hash] Additional options.
595
1223
  # @return [void]
596
1224
  # @api public
597
- # : (Symbol | String name, untyped value) -> void
598
- def sheet_view: (Symbol | String name, untyped value) -> void
1225
+ # : (?Symbol | String | Hash[Symbol, untyped] | nil name, ?untyped value, **untyped opts) -> void
1226
+ def sheet_view: (?Symbol | String | Hash[Symbol, untyped] | nil name, ?untyped value, **untyped opts) -> void
1227
+
1228
+ # Replaces sheet view properties.
1229
+ # @param opts [Hash, Elements::SheetView]
1230
+ # @return [void]
1231
+ # @api public
1232
+ # : (Hash[Symbol, untyped] | Elements::SheetView opts) -> void
1233
+ def sheet_view=: (Hash[Symbol, untyped] | Elements::SheetView opts) -> void
599
1234
 
600
1235
  # Configures sheet format properties (e.g. default_row_height, default_col_width).
601
1236
  #
@@ -604,8 +1239,15 @@ module Xlsxrb
604
1239
  # @param opts [Hash] Keyword arguments for sheet format properties.
605
1240
  # @return [Hash[Symbol, untyped]]
606
1241
  # @api public
607
- # : (?Symbol | String | Hash[Symbol, untyped] | nil name, ?untyped value, **untyped opts) -> Hash[Symbol, untyped]
608
- def sheet_format: (?Symbol | String | Hash[Symbol, untyped] | nil name, ?untyped value, **untyped opts) -> Hash[Symbol, untyped]
1242
+ # : (?Symbol | String | Hash[Symbol, untyped] | Elements::MetadataRecord | nil name, ?untyped value, **untyped opts) -> (Elements::SheetFormat | void)
1243
+ def sheet_format: (?untyped name, ?untyped value, **untyped opts) -> untyped
1244
+
1245
+ # Replaces sheet format properties.
1246
+ # @param opts [Hash, Elements::SheetFormat]
1247
+ # @return [void]
1248
+ # @api public
1249
+ # : (Hash[Symbol, untyped] | Elements::SheetFormat opts) -> void
1250
+ def sheet_format=: (Hash[Symbol, untyped] | Elements::SheetFormat opts) -> void
609
1251
 
610
1252
  # simplecov:disable
611
1253
  # Edge case / untested delegation block
@@ -615,17 +1257,25 @@ module Xlsxrb
615
1257
  # @return [void]
616
1258
  # @api public
617
1259
  # : (Integer row_index) -> void
618
- def page_break_row: (Integer row_index) -> void
1260
+ def row_break: (Integer row_index) -> void
1261
+
1262
+ # @deprecated Use {#row_break} instead.
1263
+ # : (Integer row_num) -> void
1264
+ def page_break_row: (Integer row_num) -> void
619
1265
 
620
1266
  # simplecov:disable
621
1267
  # Edge case / untested delegation block
622
- # Adds a vertical page break after the given column index.
1268
+ # Adds a vertical page break after the given column.
623
1269
  #
624
- # @param col_index [Integer] 0-based column index.
1270
+ # @param col [Integer, String, Symbol] 0-based column index or column letter.
625
1271
  # @return [void]
626
1272
  # @api public
627
- # : (Integer col_index) -> void
628
- def page_break_col: (Integer col_index) -> void
1273
+ # : (Integer | String | Symbol col) -> void
1274
+ def column_break: (Integer | String | Symbol col) -> void
1275
+
1276
+ # @deprecated Use {#column_break} instead.
1277
+ # : (Integer | String | Symbol col_index) -> void
1278
+ def page_break_col: (Integer | String | Symbol col_index) -> void
629
1279
 
630
1280
  # Adds a protected range to the sheet.
631
1281
  #
@@ -638,6 +1288,7 @@ module Xlsxrb
638
1288
  # : (String name, String sqref, ?password: String?, **untyped opts) -> void
639
1289
  def protected_range: (String name, String sqref, ?password: String?, **untyped opts) -> void
640
1290
 
1291
+ # @deprecated Use {#protected_range} instead. Will be removed in 0.2.0.
641
1292
  alias add_protected_range protected_range
642
1293
 
643
1294
  # Adds a cell watch to the sheet.
@@ -648,40 +1299,191 @@ module Xlsxrb
648
1299
  # : (String ref) -> void
649
1300
  def cell_watch: (String ref) -> void
650
1301
 
1302
+ # @deprecated Use {#cell_watch} instead. Will be removed in 0.2.0.
651
1303
  alias add_cell_watch cell_watch
1304
+
1305
+ # Adds an ignored error entry to the sheet.
1306
+ #
1307
+ # @param sqref [String] Cell range reference (e.g. "A1" or "A1:B10").
1308
+ # @param opts [Hash] Error check flags to ignore.
1309
+ # @return [void]
1310
+ # @api public
1311
+ # : (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
1312
+ def ignored_error: (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
1313
+
1314
+ # @deprecated Use {#ignored_error} instead. Will be removed in 0.2.0.
1315
+ # : (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
1316
+ def ignore_error: (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
1317
+
1318
+ # @deprecated Use {#ignored_error} instead. Will be removed in 0.2.0.
1319
+ # : (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
1320
+ def add_ignored_error: (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
1321
+
1322
+ # Returns the ignored error entries configured for this sheet.
1323
+ #
1324
+ # @return [Array<Hash[Symbol, untyped]>]
1325
+ # @api public
1326
+ # : () -> Array[Hash[Symbol, untyped]]
1327
+ def ignored_errors: () -> Array[Hash[Symbol, untyped]]
1328
+
1329
+ # Gets or sets phonetic (furigana) guide properties for the sheet.
1330
+ #
1331
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#phonetic_properties=} instead.
1332
+ # @api public
1333
+ # : (?untyped spec, ?font_id: Integer?, ?type: (Symbol | String)?, ?alignment: (Symbol | String)?, **untyped opts) -> (Elements::PhoneticProperties | Hash[Symbol, untyped] | nil)
1334
+ def phonetic_properties: (?untyped spec, ?font_id: Integer?, ?type: (Symbol | String)?, ?alignment: (Symbol | String)?, **untyped opts) -> (Elements::PhoneticProperties | Hash[Symbol, untyped] | nil)
1335
+
1336
+ # @deprecated Use {#phonetic_properties} instead. Will be removed in 0.2.0.
1337
+ alias phonetic_pr phonetic_properties
1338
+
1339
+ # Sets phonetic (furigana) guide properties for the sheet.
1340
+ #
1341
+ # @param spec [Hash, Integer, nil] Options hash or font ID integer.
1342
+ # @return [Hash[Symbol, untyped], Integer, nil]
1343
+ # @api public
1344
+ # : (Hash[Symbol, untyped] | Integer | nil spec) -> (Hash[Symbol, untyped] | Integer | nil)
1345
+ def phonetic_properties=: (Hash[Symbol, untyped] | Integer | nil spec) -> (Hash[Symbol, untyped] | Integer | nil)
1346
+
1347
+ # @deprecated Use {#phonetic_properties=} instead. Will be removed in 0.2.0.
1348
+ alias phonetic_pr= phonetic_properties=
1349
+
1350
+ # Sets or gets the internal code name of the worksheet.
1351
+ #
1352
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#code_name=} instead.
1353
+ # @param val [String, Symbol, nil] The code name.
1354
+ # @return [String, nil]
1355
+ # @api public
1356
+ # : (?String | Symbol | nil val) -> String?
1357
+ def code_name: (?String | Symbol | nil val) -> String?
1358
+
1359
+ # Sets the internal code name of the worksheet.
1360
+ #
1361
+ # @param val [String, Symbol, nil] The code name.
1362
+ # @return [String, nil]
1363
+ # @api public
1364
+ # : (String | Symbol | nil val) -> String?
1365
+ def code_name=: (String | Symbol | nil val) -> String?
1366
+
1367
+ # Configures whether page setup fits content to page width/height.
1368
+ # When enabled, optionally sets fit_to_width and/or fit_to_height on page_setup.
1369
+ #
1370
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#fit_to_page=} or {#page_setup} with :fit_to_width/:fit_to_height instead.
1371
+ # @param enabled [Boolean, nil] Whether to fit to page.
1372
+ # @param width [Integer, nil] Pages wide to fit to.
1373
+ # @param height [Integer, nil] Pages tall to fit to.
1374
+ # @return [Boolean, void]
1375
+ # @api public
1376
+ # : (?bool? enabled, ?width: Integer?, ?height: Integer?) -> (bool | void)
1377
+ def fit_to_page: (?untyped enabled, ?width: untyped, ?height: untyped) -> untyped
1378
+
1379
+ # @deprecated Use {#fit_to_page} instead. Will be removed in 0.2.0.
1380
+ # @return [Boolean]
1381
+ # @api public
1382
+ # : () -> bool
1383
+ def fit_to_page?: () -> bool
1384
+
1385
+ # Sets whether page setup fits content to page width/height.
1386
+ #
1387
+ # @param enabled [Boolean, nil] Whether to fit to page.
1388
+ # @return [Boolean]
1389
+ # @api public
1390
+ # : (bool? enabled) -> bool?
1391
+ def fit_to_page=: (bool? enabled) -> bool?
1392
+
1393
+ # Configures worksheet calculation properties (<sheetCalcPr>).
1394
+ #
1395
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#sheet_calc_properties=} instead.
1396
+ # @param spec [Hash, nil] Calculation properties hash.
1397
+ # @param full_calc_on_load [Boolean, nil] Whether to recalculate when loading.
1398
+ # @return [Hash, nil]
1399
+ # @api public
1400
+ # : (?untyped spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
1401
+ def sheet_calc_properties: (?untyped spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
1402
+
1403
+ # Sets worksheet calculation properties (<sheetCalcPr>).
1404
+ #
1405
+ # @param spec [Hash, nil] Calculation properties hash.
1406
+ # @return [Hash, nil]
1407
+ # @api public
1408
+ # : (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
1409
+ def sheet_calc_properties=: (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
1410
+
1411
+ # @deprecated Use {#sheet_calc_properties} instead. Will be removed in 0.2.0.
1412
+ # : (?Hash[Symbol, untyped]? spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
1413
+ def sheet_calc_pr: (?Hash[Symbol, untyped]? spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
1414
+
1415
+ # @deprecated Use {#sheet_calc_properties} instead. Will be removed in 0.2.0.
1416
+ # : (?Hash[Symbol, untyped]? spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
1417
+ def calc_pr: (?Hash[Symbol, untyped]? spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
1418
+
1419
+ # @deprecated Use {#sheet_calc_properties=} instead. Will be removed in 0.2.0.
1420
+ # : (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
1421
+ def sheet_calc_pr=: (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
1422
+
1423
+ # @deprecated Use {#sheet_calc_properties=} instead. Will be removed in 0.2.0.
1424
+ # : (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
1425
+ def calc_pr=: (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
652
1426
  end
653
1427
 
1428
+ # Returns the list of worksheet names created in this workbook so far.
1429
+ #
1430
+ # @return [Array<String>] Worksheet names.
1431
+ # @api public
1432
+ # : () -> Array[String]
1433
+ def sheet_names: () -> Array[String]
1434
+
654
1435
  # Adds a new sheet to the workbook and starts streaming rows into it.
655
1436
  #
656
1437
  # @param name [String, nil] Sheet name (max 31 characters).
1438
+ # @param state [Symbol, String, nil] Sheet visibility state (:visible, :hidden, :very_hidden).
1439
+ # @param tab_color [String, Hash, nil] Tab color hex string or color hash.
1440
+ # @param code_name [String, nil] VBA code name.
1441
+ # @param hidden [Boolean, nil] Deprecated alias for state: :hidden.
657
1442
  # @param opts [Hash] Sheet-level configuration.
658
1443
  # @yield [sheet_proxy]
659
1444
  # @yieldparam sheet_proxy [WorksheetProxy] The streaming sheet proxy.
660
1445
  # @return [String] The sheet name.
661
1446
  # @api public
662
- # : (?String? name, **untyped opts) ?{ (WorksheetProxy) -> void } -> untyped
663
- def sheet: (?String? name, **untyped opts) ?{ (WorksheetProxy) -> void } -> untyped
1447
+ # : (?String? name, ?state: (Symbol | String)?, ?tab_color: untyped, ?code_name: String?, ?hidden: bool?, **untyped opts) ?{ (WorksheetProxy) -> void } -> String
1448
+ def sheet: (?String? name, ?state: (Symbol | String)?, ?tab_color: untyped, ?code_name: String?, ?hidden: bool?, **untyped opts) ?{ (WorksheetProxy) -> void } -> String
1449
+
1450
+ # Returns a WorksheetProxy for the current or named sheet.
1451
+ #
1452
+ # @param name_or_index [String, Symbol, Integer, nil] Sheet name or 0-based sheet index.
1453
+ # @yield [proxy]
1454
+ # @yieldparam proxy [WorksheetProxy]
1455
+ # @return [WorksheetProxy]
1456
+ # @api public
1457
+ # : (?String | Symbol | Integer | nil name_or_index) ?{ (WorksheetProxy) -> void } -> WorksheetProxy
1458
+ def []: (?String | Symbol | Integer | nil name_or_index) ?{ (WorksheetProxy) -> void } -> WorksheetProxy
664
1459
 
665
1460
  # Internal: Start or switch to a named sheet (internal helper).
666
- # : (?String? name) ?{ (WorksheetProxy) -> void } -> (WorksheetProxy | nil)
667
- def internal_sheet_setup: (?String? name) ?{ (WorksheetProxy) -> void } -> (WorksheetProxy | nil)
1461
+ # @api private
1462
+ # : (?String? name, ?state: Symbol) ?{ (WorksheetProxy) -> void } -> (WorksheetProxy | nil)
1463
+ def internal_sheet_setup: (?String? name, ?state: Symbol) ?{ (WorksheetProxy) -> void } -> (WorksheetProxy | nil)
668
1464
 
669
- def start_sheet_entry: () -> untyped
1465
+ # @api private
1466
+ # : () -> void
1467
+ def start_sheet_entry: () -> void
670
1468
 
671
1469
  # Appends a row of values to the active sheet.
672
1470
  #
673
1471
  # @param values [Array<Object>, Hash] The cell values.
674
- # @param styles [String, Symbol, Array, Hash, nil] Style names or inline style definitions.
1472
+ # @param cell_styles [String, Symbol, Array, Hash, nil] Style names or inline style definitions to apply to cells.
1473
+ # @param row_style [Integer, Symbol, String, Hash, nil] Row style format or index.
675
1474
  # @param height [Float, Integer, nil] The row height in points (0 - 409).
676
1475
  # @param hidden [Boolean] Whether the row is hidden.
677
1476
  # @param custom_height [Boolean] Whether custom row height is set.
678
1477
  # @param outline_level [Integer, nil] Grouping/outline level (0 - 7).
679
- # @param style [Integer, Symbol, String, Hash, nil] Row style format or index.
1478
+ # @param collapsed [Boolean] Whether the row is collapsed.
1479
+ # @param styles [String, Symbol, Array, Hash, nil] Deprecated. Use cell_styles: instead.
1480
+ # @param style [Integer, Symbol, String, Hash, nil] Deprecated. Use row_style: instead.
680
1481
  # @return [void]
681
1482
  # @api public
682
- # : (Array[untyped] | Hash[untyped, untyped] values, ?styles: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?collapsed: bool, ?outline_level: Integer | nil, ?style: untyped) -> void
683
- def row: (Array[untyped] | Hash[untyped, untyped] values, ?styles: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?collapsed: bool, ?outline_level: Integer | nil, ?style: untyped) -> void
1483
+ # : (Array[untyped] | Hash[untyped, untyped] values, ?cell_styles: untyped, ?row_style: untyped, ?styles: untyped, ?style: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?collapsed: bool, ?outline_level: Integer | nil) -> void
1484
+ def row: (Array[untyped] | Hash[untyped, untyped] values, ?cell_styles: untyped, ?row_style: untyped, ?styles: untyped, ?style: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?collapsed: bool, ?outline_level: Integer | nil) -> void
684
1485
 
1486
+ # @deprecated Use {#row} instead. Will be removed in 0.2.0.
685
1487
  alias add_row row
686
1488
 
687
1489
  # Appends a row to the worksheet and returns self for chaining.
@@ -695,26 +1497,133 @@ module Xlsxrb
695
1497
  # : (Array[untyped] | Hash[untyped, untyped] values) -> self
696
1498
  def <<: (Array[untyped] | Hash[untyped, untyped] values) -> self
697
1499
 
1500
+ # Advances the row cursor by count without writing empty row elements.
1501
+ #
1502
+ # @example Skip one row
1503
+ # w.skip_row
1504
+ #
1505
+ # @example Skip multiple rows
1506
+ # w.skip_rows(3)
1507
+ #
1508
+ # @param count [Integer] Number of rows to skip (must be >= 1).
1509
+ # @return [void]
1510
+ # @api public
1511
+ # : (?Integer count) -> void
1512
+ def skip_rows: (?Integer count) -> void
1513
+
1514
+ # @deprecated Use {#skip_rows} instead. Will be removed in 0.2.0.
1515
+ alias skip_row skip_rows
1516
+
698
1517
  # Sets column formatting and properties for one or multiple columns.
699
1518
  #
700
- # @param index [Integer, String, Range, Array] Column index (0-based) or letter ("A".."D").
1519
+ # @param index [Integer, String, Symbol, Range, Array] Column index (0-based), letter ("A", :A), range, or array.
701
1520
  # @param width [Float, Integer, nil] Column width in character units (0 - 255).
702
1521
  # @param hidden [Boolean] Whether the column is hidden.
1522
+ # @param custom_width [Boolean] Whether custom width flag is set.
1523
+ # @param outline_level [Integer, nil] Grouping/outline level.
1524
+ # @param collapsed [Boolean] Whether the column is collapsed.
703
1525
  # @param style [Integer, Symbol, String, Hash, nil] Column style format or index.
1526
+ # @param best_fit [Boolean] Whether the column automatically fits content.
1527
+ # @return [void]
1528
+ # @api public
1529
+ # : (Integer | String | Symbol | Range[Integer | String | Symbol] | Array[Integer | String | Symbol] index, ?width: Float | Integer | nil, ?hidden: bool, ?custom_width: bool, ?outline_level: Integer | nil, ?collapsed: bool, ?style: (Integer | Symbol | String | Hash[Symbol, untyped])?, ?best_fit: bool) -> void
1530
+ def column: (Integer | String | Symbol | Range[Integer | String | Symbol] | Array[Integer | String | Symbol] index, ?width: Float | Integer | nil, ?hidden: bool, ?custom_width: bool, ?outline_level: Integer | nil, ?collapsed: bool, ?style: (Integer | Symbol | String | Hash[Symbol, untyped])?, ?best_fit: bool) -> void
1531
+
1532
+ # Returns column configurations defined for the current worksheet.
1533
+ #
1534
+ # @return [Array<Elements::Column>]
1535
+ # @api public
1536
+ # : () -> Array[Elements::Column]
1537
+ def columns: () -> Array[Elements::Column]
1538
+
1539
+ # Groups multiple columns together with outline hierarchy.
1540
+ #
1541
+ # @example Group columns B through D
1542
+ # sheet.group_columns("B".."D", level: 1)
1543
+ #
1544
+ # @example Group columns 1 through 3 and collapse
1545
+ # sheet.group_columns(1..3, level: 1, collapsed: true)
1546
+ #
1547
+ # @param index [Integer, String, Range, Array] Column index (0-based), letter, range, or array.
1548
+ # @param level [Integer] Grouping outline level (1 to 7).
1549
+ # @param collapsed [Boolean] Whether the group is collapsed.
1550
+ # @param hidden [Boolean] Whether the columns are hidden.
1551
+ # @param width [Float, Integer, nil] Optional column width.
1552
+ # @param style [Integer, Symbol, String, nil] Optional column style.
1553
+ # @return [void]
1554
+ # @api public
1555
+ # : (Integer | String | Range[Integer | String] | Array[Integer | String] index, ?level: Integer, ?collapsed: bool, ?hidden: bool, ?width: Float | Integer | nil, ?style: untyped) -> void
1556
+ def group_columns: (Integer | String | Range[Integer | String] | Array[Integer | String] index, ?level: Integer, ?collapsed: bool, ?hidden: bool, ?width: Float | Integer | nil, ?style: untyped) -> void
1557
+
1558
+ # @deprecated Use {#group_columns} instead. Will be removed in 0.2.0.
1559
+ alias group_column group_columns
1560
+
1561
+ # @deprecated Use {#group_columns} instead. Will be removed in 0.2.0.
1562
+ alias group_cols group_columns
1563
+
1564
+ # @deprecated Use {#group_columns} instead. Will be removed in 0.2.0.
1565
+ alias group_col group_columns
1566
+
1567
+ # Groups multiple rows with outline hierarchy with a block.
1568
+ #
1569
+ # @example Group rows with a block
1570
+ # sheet.group_rows(level: 1, collapsed: true) do
1571
+ # sheet.row(["Subtotal Item 1"])
1572
+ # sheet.row(["Subtotal Item 2"])
1573
+ # end
1574
+ #
1575
+ # @param rows [Range, Array, Integer, nil] Unused in streaming write (streaming rows are written on the fly).
1576
+ # @param level [Integer] Grouping outline level (1 to 7).
1577
+ # @param collapsed [Boolean] Whether the group is collapsed.
1578
+ # @param hidden [Boolean] Whether the rows are hidden.
1579
+ # @yield Optional block executed with active group outline settings.
1580
+ # @return [void]
1581
+ # @api public
1582
+ # : (?untyped rows, ?level: Integer, ?collapsed: bool, ?hidden: bool) ?{ (self) -> void } -> void
1583
+ def group_rows: (?untyped rows, ?level: Integer, ?collapsed: bool, ?hidden: bool) ?{ (self) -> void } -> void
1584
+
1585
+ # @deprecated Use {#group_rows} instead. Will be removed in 0.2.0.
1586
+ alias group_row group_rows
1587
+
1588
+ # Configures worksheet-level outline and grouping view properties.
1589
+ #
1590
+ # @example Show summary row below detail rows
1591
+ # sheet.outline_properties(summary_below: true, summary_right: true)
1592
+ #
1593
+ # @param summary_below [Boolean, nil] Flag indicating if summary rows appear below detail rows.
1594
+ # @param summary_right [Boolean, nil] Flag indicating if summary columns appear to the right of detail columns.
1595
+ # @param show_outline_symbols [Boolean, nil] Flag indicating whether outline symbols are visible.
1596
+ # @param show_symbols [Boolean, nil] Deprecated alias for show_outline_symbols.
1597
+ # @param apply_styles [Boolean, nil] Flag indicating whether automatic styles apply to outlines.
1598
+ # @param opts [Hash] Additional options.
1599
+ # @return [Hash<Symbol, untyped>, void]
1600
+ # @api public
1601
+ # : (?summary_below: bool?, ?summary_right: bool?, ?show_outline_symbols: bool?, ?show_symbols: bool?, ?apply_styles: bool?, **untyped opts) -> (Hash[Symbol, untyped] | void)
1602
+ def outline_properties: (?summary_below: untyped, ?summary_right: untyped, ?show_outline_symbols: untyped, ?show_symbols: untyped, ?apply_styles: untyped, **untyped opts) -> untyped
1603
+
1604
+ # @deprecated Use {#outline_properties} instead. Will be removed in 0.2.0.
1605
+ alias outline_pr outline_properties
1606
+
1607
+ # Sets worksheet outline and grouping view properties.
1608
+ #
1609
+ # @param opts [Hash] Outline properties.
704
1610
  # @return [void]
705
1611
  # @api public
706
- # : (Integer | String | Range[Integer | String] | Array[Integer | String] index, ?width: Float | Integer | nil, ?hidden: bool, ?custom_width: bool, ?outline_level: Integer | nil, ?style: (Integer | Symbol | String | Hash[Symbol, untyped])?) -> void
707
- def column: (Integer | String | Range[Integer | String] | Array[Integer | String] index, ?width: Float | Integer | nil, ?hidden: bool, ?custom_width: bool, ?outline_level: Integer | nil, ?style: (Integer | Symbol | String | Hash[Symbol, untyped])?) -> void
1612
+ # : (Hash[Symbol, untyped] opts) -> void
1613
+ def outline_properties=: (Hash[Symbol, untyped] opts) -> void
1614
+
1615
+ alias outline_pr= outline_properties=
708
1616
 
709
1617
  # Adds a chart to the current worksheet.
710
1618
  #
1619
+ # @param type [Symbol, String, nil] Optional chart type (e.g. :bar, :line).
711
1620
  # @param options [Hash] Chart options.
712
1621
  # @yield [builder]
713
1622
  # @yieldparam builder [Xlsxrb::ChartBuilder]
714
1623
  # @return [void]
715
1624
  # @api public
716
- # : (**untyped options) ?{ (ChartBuilder) -> void } -> void
717
- def chart: (**untyped options) ?{ (ChartBuilder) -> void } -> void
1625
+ # : (?Symbol | String? type, **untyped options) ?{ (ChartBuilder) -> void } -> void
1626
+ def chart: (?Symbol | String? type, **untyped options) ?{ (ChartBuilder) -> void } -> void
718
1627
 
719
1628
  # Adds a hyperlink on a cell.
720
1629
  #
@@ -730,11 +1639,19 @@ module Xlsxrb
730
1639
 
731
1640
  # Sets the auto-filter range on the active sheet.
732
1641
  #
733
- # @param range [String] Cell range (e.g. "A1:E100").
1642
+ # @param range [String, nil] Cell range (e.g. "A1:E100").
734
1643
  # @return [void]
735
1644
  # @api public
736
- # : (String range) -> void
737
- def auto_filter: (String range) -> void
1645
+ # : (String? range) -> void
1646
+ def auto_filter: (String? range) -> void
1647
+
1648
+ # Sets the auto-filter range for the current worksheet.
1649
+ #
1650
+ # @param range [String, nil] Cell range (e.g. "A1:E100").
1651
+ # @return [String, nil]
1652
+ # @api public
1653
+ # : (String? range) -> String?
1654
+ def auto_filter=: (String? range) -> String?
738
1655
 
739
1656
  # Sets filter criteria on a column in the auto-filter.
740
1657
  #
@@ -742,37 +1659,59 @@ module Xlsxrb
742
1659
  # @param filter [Hash] Filter criteria.
743
1660
  # @return [void]
744
1661
  # @api public
745
- # : (untyped col_id, untyped filter) -> untyped
746
- def filter_column: (untyped col_id, untyped filter) -> untyped
1662
+ # Sets filter criteria on an auto-filter column.
1663
+ #
1664
+ # @param col_id [Integer, String, Symbol] 0-based column index relative to auto-filter or column letter ("A", :B).
1665
+ # @param filter [Hash] Filter definition.
1666
+ # @return [void]
1667
+ # @api public
1668
+ # : (Integer | String | Symbol col_id, Hash[untyped, untyped] filter) -> void
1669
+ def filter_column: (Integer | String | Symbol col_id, Hash[untyped, untyped] filter) -> void
747
1670
 
748
1671
  # Configures column sort state on the active sheet.
749
1672
  #
750
1673
  # @param ref [String] The sorted range.
751
1674
  # @param sort_conditions [Array<Hash>] Sort conditions.
752
1675
  # @param opts [Hash] Additional options.
1676
+ # @return [Elements::SortState, Hash<Symbol, untyped>, nil, void]
1677
+ # @api public
1678
+ # : (?String? ref, ?Array[Hash[untyped, untyped]]? sort_conditions, **untyped opts) -> (untyped | void)
1679
+ def sort_state: (?untyped ref, ?untyped sort_conditions, **untyped opts) -> untyped
1680
+
1681
+ # Sets column sort state for the sheet.
1682
+ #
1683
+ # @param opts [Elements::SortState, Hash, nil] Sort state options.
753
1684
  # @return [void]
754
1685
  # @api public
755
- # : (untyped ref, untyped sort_conditions, **untyped opts) -> untyped
756
- def sort_state: (untyped ref, untyped sort_conditions, **untyped opts) -> untyped
1686
+ # : (untyped opts) -> void
1687
+ def sort_state=: (untyped opts) -> void
757
1688
 
758
1689
  # Adds a data validation rule.
759
1690
  #
760
1691
  # @param sqref [String, nil] Cell range.
761
- # @param opts [Hash] Validation options.
1692
+ # @param opts [Hash] Validation options (or coordinate keywords: `columns:`, `rows:`, `except_rows:`, `list:`, `in:`).
762
1693
  # @yield [data_validation_builder] Optional configuration block.
763
1694
  # @return [void]
764
1695
  # @api public
765
1696
  # : (?String? sqref, **untyped opts) ?{ (DataValidationBuilder) -> void } -> void
1697
+ def data_validation: (?String? sqref, **untyped opts) ?{ (DataValidationBuilder) -> void } -> void
1698
+
1699
+ # @deprecated Use {#data_validation} instead.
1700
+ # : (?String? sqref, **untyped opts) ?{ (DataValidationBuilder) -> void } -> void
766
1701
  def validate_data: (?String? sqref, **untyped opts) ?{ (DataValidationBuilder) -> void } -> void
767
1702
 
768
1703
  # Adds a conditional formatting rule.
1704
+ # Supports block configuration via {ConditionalFormatBuilder} and coordinate targeting (:columns, :rows).
769
1705
  #
770
- # @param sqref [String] Cell range.
771
- # @param opts [Hash] Rule options.
1706
+ # @param sqref [String, nil] Cell range (e.g. "A1:A10").
1707
+ # @param opts [Hash] Rule options (e.g. `type:`, `operator:`, `formula:`, `dxf:`, `format_id:`, `font_color:`, `fill_color:`, `bold:`, `italic:`).
1708
+ # @option opts [Hash] :dxf Hierarchical differential format specification (e.g. `dxf: { font: { bold: false, color: { auto: true } }, fill: { pattern: "none", bg_color: "FFFF00" } }`).
1709
+ # @option opts [Integer] :format_id Pre-registered differential format index (dxfId).
1710
+ # @yield [conditional_format_builder] Optional block for configuration.
772
1711
  # @return [void]
773
1712
  # @api public
774
- # : (untyped sqref, **untyped opts) -> void
775
- def conditional_format: (untyped sqref, **untyped opts) -> void
1713
+ # : (?String? sqref, **untyped opts) ?{ (ConditionalFormatBuilder) -> void } -> void
1714
+ def conditional_format: (?String? sqref, **untyped opts) ?{ (ConditionalFormatBuilder) -> void } -> void
776
1715
 
777
1716
  # Adds an Excel Table (ListObject).
778
1717
  #
@@ -793,16 +1732,18 @@ module Xlsxrb
793
1732
  # @param source_ref [String] Source data range.
794
1733
  # @param row_fields [Array<Integer>] 0-based field indices for rows.
795
1734
  # @param data_fields [Array<Hash>] Data fields.
796
- # @param col_fields [Array<Integer>] 0-based field indices for columns.
797
- # @param dest_ref [String] Top-left destination cell (default: "E1").
1735
+ # @param column_fields [Array<Integer>] 0-based field indices for columns.
1736
+ # @param col_fields [Array<Integer>] Deprecated alias for column_fields.
1737
+ # @param ref [String] Top-left destination cell (default: "E1").
1738
+ # @param dest_ref [String] Deprecated alias for ref.
798
1739
  # @param name [String, nil] Pivot table name.
799
1740
  # @param field_names [Array<String>, nil] Override field names.
800
1741
  # @param items [Array, nil] Items configuration.
801
1742
  # @param opts [Hash] Additional options.
802
1743
  # @return [void]
803
1744
  # @api public
804
- # : (untyped source_ref, row_fields: untyped, data_fields: untyped, ?col_fields: untyped, ?dest_ref: untyped, ?name: untyped, ?field_names: untyped, ?items: untyped, **untyped opts) -> void
805
- def pivot_table: (untyped source_ref, row_fields: untyped, data_fields: untyped, ?col_fields: untyped, ?dest_ref: untyped, ?name: untyped, ?field_names: untyped, ?items: untyped, **untyped opts) -> void
1745
+ # : (untyped source_ref, row_fields: untyped, data_fields: untyped, ?column_fields: untyped, ?col_fields: untyped, ?ref: untyped, ?dest_ref: untyped, ?name: untyped, ?field_names: untyped, ?items: untyped, **untyped opts) -> void
1746
+ def pivot_table: (untyped source_ref, row_fields: untyped, data_fields: untyped, ?column_fields: untyped, ?col_fields: untyped, ?ref: untyped, ?dest_ref: untyped, ?name: untyped, ?field_names: untyped, ?items: untyped, **untyped opts) -> void
806
1747
 
807
1748
  # Adds a comment to a cell.
808
1749
  #
@@ -814,6 +1755,25 @@ module Xlsxrb
814
1755
  # : (String | Integer cell, String text, ?author: ::String) -> void
815
1756
  def comment: (String | Integer cell, String text, ?author: ::String) -> void
816
1757
 
1758
+ # Adds a threaded comment to a cell.
1759
+ #
1760
+ # @param cell [String, Integer] Cell coordinate (e.g. "A1").
1761
+ # @param text [String] Comment text.
1762
+ # @param author [String] Author name.
1763
+ # @param timestamp [String, Time, nil] Optional ISO 8601 timestamp.
1764
+ # @param id [String, nil] Optional GUID for this comment.
1765
+ # @param parent_id [String, nil] Optional parent comment GUID for replies.
1766
+ # @param done [Boolean, nil] Optional resolved flag.
1767
+ # @param user_id [String, nil] Optional user ID.
1768
+ # @param provider_id [String, nil] Optional provider ID.
1769
+ # @return [void]
1770
+ # @api public
1771
+ # : (String | Integer cell, String text, ?author: untyped, ?timestamp: untyped, ?id: String?, ?parent_id: String?, ?done: bool?, ?user_id: String?, ?provider_id: String?) -> void
1772
+ def threaded_comment: (String | Integer cell, String text, ?author: untyped, ?timestamp: untyped, ?id: String?, ?parent_id: String?, ?done: bool?, ?user_id: String?, ?provider_id: String?) -> void
1773
+
1774
+ # @deprecated Use {#threaded_comment} instead. Will be removed in 0.2.0.
1775
+ alias add_threaded_comment threaded_comment
1776
+
817
1777
  # Adds a sparkline group.
818
1778
  #
819
1779
  # @param sparklines [Array<Hash>] Sparkline definitions.
@@ -839,6 +1799,7 @@ module Xlsxrb
839
1799
  # @param range [String, nil] Data range for the sparkline (e.g. "A1:E1").
840
1800
  # @param type [Symbol, String, nil] Sparkline type (:line, :column, :win_loss / :stacked).
841
1801
  # @param opts [Hash] Additional sparkline options.
1802
+ # @deprecated Use {#sparkline_group} instead. Will be removed in 0.2.0.
842
1803
  # @return [void]
843
1804
  # @api public
844
1805
  # : (?location: String?, ?range: String?, ?type: (String | Symbol)?, **untyped opts) -> void
@@ -846,6 +1807,10 @@ module Xlsxrb
846
1807
 
847
1808
  # Merges a range of cells into a single cell.
848
1809
  #
1810
+ # @example
1811
+ # sheet.merge("A1:C1")
1812
+ #
1813
+ # @deprecated Passing coordinate keyword arguments (row:, col_start:, col_end:, row_start:, row_end:) is deprecated and will be removed in 0.2.0. Use a range string (e.g. merge("A1:C1")) instead.
849
1814
  # @param range [String, Hash, nil] Cell range (e.g. "A1:B2") or hash of coordinates.
850
1815
  # @param row [Integer, nil] Single row index.
851
1816
  # @param col_start [Integer, String, nil] Starting column.
@@ -857,36 +1822,70 @@ module Xlsxrb
857
1822
  # : (?(String | Hash[Symbol, Integer | String])? range, ?row: Integer?, ?col_start: (Integer | String)?, ?col_end: (Integer | String)?, ?row_start: Integer?, ?row_end: Integer?) -> void
858
1823
  def merge: (?(String | Hash[Symbol, Integer | String])? range, ?row: Integer?, ?col_start: (Integer | String)?, ?col_end: (Integer | String)?, ?row_start: Integer?, ?row_end: Integer?) -> void
859
1824
 
860
- # Freezes window panes at the given row and column.
1825
+ # Freezes window panes at the given row and column, or queries freeze pane settings.
1826
+ #
1827
+ # @param row [Integer, nil] Number of rows to freeze.
1828
+ # @param column [Integer, String, nil] Number of columns to freeze.
1829
+ # @param col [Integer, String, nil] Deprecated alias for column.
1830
+ # @return [Elements::FreezePane, Hash<Symbol, untyped>, nil, void]
1831
+ # @api public
1832
+ # : (?row: Integer | nil, ?column: (Integer | String)?, ?col: (Integer | String)?) -> (untyped | void)
1833
+ def freeze_pane: (?row: untyped, ?column: untyped, ?col: untyped) -> untyped
1834
+
1835
+ # Sets or clears freeze pane configuration.
861
1836
  #
862
- # @param row [Integer] Number of rows to freeze.
863
- # @param col [Integer, String] Number of columns to freeze.
1837
+ # @param opts [Elements::FreezePane, Hash, nil] Freeze pane options.
864
1838
  # @return [void]
865
1839
  # @api public
866
- # : (?row: Integer, ?col: (Integer | String)) -> void
867
- def freeze_pane: (?row: Integer, ?col: Integer | String) -> void
1840
+ # : (untyped opts) -> void
1841
+ def freeze_pane=: (untyped opts) -> void
868
1842
 
869
- # Splits window panes without freezing.
1843
+ # Splits window panes without freezing or queries split pane settings.
870
1844
  #
871
- # @param x_split [Integer] Horizontal split in points.
872
- # @param y_split [Integer] Vertical split in points.
1845
+ # @param x_split [Integer, nil] Horizontal split in points.
1846
+ # @param y_split [Integer, nil] Vertical split in points.
873
1847
  # @param top_left_cell [String, nil] Top-left cell reference in bottom-right pane.
1848
+ # @param active_pane [String, Symbol, nil] Active pane identifier.
1849
+ # @param state [String, Symbol, nil] Split state.
1850
+ # @return [Elements::SplitPane, Hash<Symbol, untyped>, nil, void]
1851
+ # @api public
1852
+ # : (?x_split: Integer | nil, ?y_split: Integer | nil, ?top_left_cell: String?, ?active_pane: (String | Symbol)?, ?state: (String | Symbol)?) -> (untyped | void)
1853
+ def split_pane: (?x_split: untyped, ?y_split: untyped, ?top_left_cell: untyped, ?active_pane: untyped, ?state: untyped) -> untyped
1854
+
1855
+ # Sets or clears split pane configuration.
1856
+ #
1857
+ # @param opts [Elements::SplitPane, Hash, nil] Split pane options.
874
1858
  # @return [void]
875
1859
  # @api public
876
- # : (?x_split: ::Integer, ?y_split: ::Integer, ?top_left_cell: String?) -> void
877
- def split_pane: (?x_split: ::Integer, ?y_split: ::Integer, ?top_left_cell: String?) -> void
1860
+ # : (untyped opts) -> void
1861
+ def split_pane=: (untyped opts) -> void
878
1862
 
879
- # Sets the active cell selection on the current sheet.
1863
+ # Sets or queries the active cell selection on the current sheet.
880
1864
  #
881
- # @param active_cell [String] Active cell reference (e.g. "A1").
1865
+ # @param active_cell [String, nil] Active cell reference (e.g. "A1") or range (e.g. "A1:D10").
882
1866
  # @param sqref [String, nil] Selection range.
883
1867
  # @param pane [String, Symbol, nil] Target pane.
1868
+ # @return [Elements::Selection, Array<Elements::Selection>, Hash<Symbol, untyped>, nil, void]
1869
+ # @api public
1870
+ # : (?String? active_cell, ?sqref: String?, ?pane: (String | Symbol)?) -> (untyped | void)
1871
+ def selection: (?untyped active_cell, ?sqref: untyped, ?pane: untyped) -> untyped
1872
+
1873
+ # Sets or clears the selection configuration.
1874
+ #
1875
+ # @param opts [Elements::Selection, Array<Elements::Selection, Hash>, Hash, nil]
884
1876
  # @return [void]
885
1877
  # @api public
1878
+ # : (untyped opts) -> void
1879
+ def selection=: (untyped opts) -> void
1880
+
1881
+ # @deprecated Use {#selection} instead.
886
1882
  # : (String active_cell, ?sqref: String?, ?pane: (String | Symbol)?) -> void
887
1883
  def select_cell: (String active_cell, ?sqref: String?, ?pane: (String | Symbol)?) -> void
888
1884
 
889
- # Sets page margins in inches for printing.
1885
+ # Configures page margins for printing (<pageMargins>).
1886
+ #
1887
+ # When called with no arguments, returns the page margins value object or hash.
1888
+ # When called with arguments, configures page margins and returns nil.
890
1889
  #
891
1890
  # @param left [Float, nil] Left margin.
892
1891
  # @param right [Float, nil] Right margin.
@@ -894,41 +1893,98 @@ module Xlsxrb
894
1893
  # @param bottom [Float, nil] Bottom margin.
895
1894
  # @param header [Float, nil] Header margin.
896
1895
  # @param footer [Float, nil] Footer margin.
1896
+ # @return [Elements::PageMargins, Hash<Symbol, untyped>, nil, void]
1897
+ # @api public
1898
+ # : (?left: Float?, ?right: Float?, ?top: Float?, ?bottom: Float?, ?header: Float?, ?footer: Float?) -> (untyped | void)
1899
+ def page_margins: (?left: untyped, ?right: untyped, ?top: untyped, ?bottom: untyped, ?header: untyped, ?footer: untyped) -> untyped
1900
+
1901
+ # Sets or clears page margins configuration.
1902
+ #
1903
+ # @param opts [Hash, Elements::PageMargins, nil]
897
1904
  # @return [void]
898
1905
  # @api public
899
- # : (?left: Float?, ?right: Float?, ?top: Float?, ?bottom: Float?, ?header: Float?, ?footer: Float?) -> void
900
- def page_margins: (?left: Float?, ?right: Float?, ?top: Float?, ?bottom: Float?, ?header: Float?, ?footer: Float?) -> void
1906
+ # : (untyped opts) -> void
1907
+ def page_margins=: (untyped opts) -> void
901
1908
 
902
- # Sets page setup configuration.
1909
+ # Configures or queries page setup configuration (<pageSetup>).
1910
+ #
1911
+ # When called with no arguments, returns the page setup value object or hash.
1912
+ # When called with keyword arguments, updates page setup and returns nil.
903
1913
  #
904
1914
  # @param opts [Hash] Page setup options (e.g. orientation: :landscape).
1915
+ # @return [Elements::PageSetup, Hash<Symbol, untyped>, void]
1916
+ # @api public
1917
+ # : (**untyped opts) -> (untyped | void)
1918
+ def page_setup: (**untyped opts) -> untyped
1919
+
1920
+ # Sets page setup configuration.
1921
+ #
1922
+ # @param opts [Hash, Elements::PageSetup]
905
1923
  # @return [void]
906
1924
  # @api public
907
- # : (**untyped opts) -> void
908
- def page_setup: (**untyped opts) -> void
1925
+ # : (untyped opts) -> void
1926
+ def page_setup=: (untyped opts) -> void
909
1927
 
910
- # Configures headers and footers for printing.
1928
+ # Configures or queries headers and footers for printing (<headerFooter>).
1929
+ #
1930
+ # When called with no arguments, returns the header/footer value object or hash.
1931
+ # When called with keyword arguments, updates headers and footers and returns nil.
911
1932
  #
912
1933
  # @param opts [Hash] Header/footer options.
1934
+ # @return [Elements::HeaderFooter, Hash<Symbol, untyped>, void]
1935
+ # @api public
1936
+ # : (**untyped opts) -> (untyped | void)
1937
+ def header_footer: (**untyped opts) -> untyped
1938
+
1939
+ # Sets header and footer configuration.
1940
+ #
1941
+ # @param opts [Hash, Elements::HeaderFooter]
913
1942
  # @return [void]
914
1943
  # @api public
915
- # : (**untyped opts) -> void
916
- def header_footer: (**untyped opts) -> void
1944
+ # : (untyped opts) -> void
1945
+ def header_footer=: (untyped opts) -> void
1946
+
1947
+ # Configures or queries print options (<printOptions>).
1948
+ #
1949
+ # When called with no arguments, returns the {Elements::PrintOptions} value object.
1950
+ # When called with arguments or keyword options, configures print options and returns nil.
1951
+ #
1952
+ # @param name [Symbol, String, Hash, Elements::MetadataRecord, nil] Option name or hash/record of options.
1953
+ # @param value [Object, nil] Option value.
1954
+ # @param opts [Hash] Additional print options.
1955
+ # @return [Elements::PrintOptions, void]
1956
+ # @api public
1957
+ # : (?Symbol | String | Hash[Symbol, untyped] | Elements::MetadataRecord | nil name, ?untyped value, **untyped opts) -> (Elements::PrintOptions | void)
1958
+ def print_options: (?untyped name, ?untyped value, **untyped opts) -> untyped
917
1959
 
918
- # Sets a print option (e.g. grid_lines: true).
1960
+ # Replaces print options with the given hash or {Elements::PrintOptions} object.
919
1961
  #
920
- # @param name [Symbol] Option name.
921
- # @param value [Object] Option value.
1962
+ # @param opts [Hash, Elements::PrintOptions]
922
1963
  # @return [void]
923
1964
  # @api public
924
- # : (Symbol name, untyped value) -> void
925
- def print_options: (Symbol name, untyped value) -> void
1965
+ # : (Hash[Symbol, untyped] | Elements::PrintOptions opts) -> void
1966
+ def print_options=: (Hash[Symbol, untyped] | Elements::PrintOptions opts) -> void
926
1967
 
927
- # Sets sheet-level protection with optional password hashing.
1968
+ # Configures or queries sheet-level protection with optional password hashing (<sheetProtection>).
1969
+ #
1970
+ # When called with no arguments, returns the sheet protection value object or hash.
1971
+ # When called with keyword arguments, sets sheet protection and returns nil.
928
1972
  #
929
1973
  # @param opts [Hash] Protection options.
1974
+ # @return [Elements::SheetProtection, Hash<Symbol, untyped>, nil, void]
1975
+ # @api public
1976
+ # : (**untyped opts) -> (untyped | void)
1977
+ def sheet_protection: (**untyped opts) -> untyped
1978
+
1979
+ # Sets or clears sheet protection configuration.
1980
+ #
1981
+ # @param opts [Elements::SheetProtection, Hash, Boolean, nil]
930
1982
  # @return [void]
931
1983
  # @api public
1984
+ # : (untyped opts) -> void
1985
+ def sheet_protection=: (untyped opts) -> void
1986
+
1987
+ # @deprecated Use {#sheet_protection} instead.
932
1988
  # : (**untyped opts) -> void
933
1989
  def protect_sheet: (**untyped opts) -> void
934
1990
 
@@ -936,23 +1992,59 @@ module Xlsxrb
936
1992
  #
937
1993
  # @param file_data [String] Binary image data.
938
1994
  # @param ext [String] File extension ("png", "jpeg", etc.).
939
- # @param from_col [Integer] Top-left starting column.
1995
+ # @param from_column [Integer, nil] Top-left starting column.
1996
+ # @param from_col [Integer, nil] Deprecated alias for from_column.
940
1997
  # @param from_row [Integer] Top-left starting row.
941
- # @param to_col [Integer] Bottom-right ending column.
1998
+ # @param to_column [Integer, nil] Bottom-right ending column.
1999
+ # @param to_col [Integer, nil] Deprecated alias for to_column.
942
2000
  # @param to_row [Integer] Bottom-right ending row.
943
2001
  # @param opts [Hash] Additional options.
944
2002
  # @return [void]
945
2003
  # @api public
946
- # : (String file_data, ?ext: ::String, ?from_col: ::Integer, ?from_row: ::Integer, ?to_col: ::Integer, ?to_row: ::Integer, **untyped opts) -> void
947
- def image: (String file_data, ?ext: ::String, ?from_col: ::Integer, ?from_row: ::Integer, ?to_col: ::Integer, ?to_row: ::Integer, **untyped opts) -> void
2004
+ # : (String file_data, ?ext: ::String, ?from_column: ::Integer?, ?from_col: ::Integer?, ?from_row: ::Integer, ?to_column: ::Integer?, ?to_col: ::Integer?, ?to_row: ::Integer, **untyped opts) -> void
2005
+ def image: (String file_data, ?ext: ::String, ?from_column: ::Integer?, ?from_col: ::Integer?, ?from_row: ::Integer, ?to_column: ::Integer?, ?to_col: ::Integer?, ?to_row: ::Integer, **untyped opts) -> void
2006
+
2007
+ # Configures the worksheet background image (<picture>).
2008
+ #
2009
+ # @example Set background image from binary data
2010
+ # sheet.background_image(png_bytes, ext: "png")
2011
+ #
2012
+ # @example Set background image from file path
2013
+ # sheet.background_image("path/to/background.png")
2014
+ #
2015
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#background_image=} instead.
2016
+ # @param file_data [String, Hash, Elements::Image, nil] Image binary data, file path, or image options hash.
2017
+ # @param ext [String, nil] Image extension ("png", "jpeg", "jpg", "gif", etc.).
2018
+ # @param opts [Hash] Additional image options.
2019
+ # @return [Hash, nil]
2020
+ # @api public
2021
+ # : (?untyped file_data, ?ext: ::String?, **untyped opts) -> Hash[Symbol, untyped]?
2022
+ def background_image: (?untyped file_data, ?ext: ::String?, **untyped opts) -> Hash[Symbol, untyped]?
2023
+
2024
+ # @deprecated Use {#background_image} instead. Will be removed in 0.2.0.
2025
+ alias background_picture background_image
2026
+
2027
+ # @deprecated Use {#background_image} instead. Will be removed in 0.2.0.
2028
+ alias picture background_image
2029
+
2030
+ # : (untyped val) -> untyped
2031
+ def background_image=: (untyped val) -> untyped
2032
+
2033
+ # @deprecated Use {#background_image=} instead. Will be removed in 0.2.0.
2034
+ alias background_picture= background_image=
2035
+
2036
+ # @deprecated Use {#background_image=} instead. Will be removed in 0.2.0.
2037
+ alias picture= background_image=
948
2038
 
949
2039
  # Inserts a drawing shape.
950
2040
  #
951
2041
  # @param preset [String] Preset shape name.
952
2042
  # @param text [String, nil] Label text.
953
- # @param from_col [Integer] Top-left column.
2043
+ # @param from_column [Integer, nil] Top-left column.
2044
+ # @param from_col [Integer, nil] Deprecated alias for from_column.
954
2045
  # @param from_row [Integer] Top-left row.
955
- # @param to_col [Integer] Bottom-right column.
2046
+ # @param to_column [Integer, nil] Bottom-right column.
2047
+ # @param to_col [Integer, nil] Deprecated alias for to_column.
956
2048
  # @param to_row [Integer] Bottom-right row.
957
2049
  # @param opts [Hash] Additional options.
958
2050
  # @return [void]
@@ -960,49 +2052,136 @@ module Xlsxrb
960
2052
  # : (**untyped opts) -> void
961
2053
  def shape: (**untyped opts) -> void
962
2054
 
963
- # Sets a sheet-level property (e.g. tab_color: "FF0000").
2055
+ # Gets or sets the sheet visibility state (:visible, :hidden, or :very_hidden).
964
2056
  #
965
- # @param name [Symbol] Property name.
2057
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#state=} instead.
2058
+ # @param new_state [Symbol, nil] The new state.
2059
+ # @return [Symbol]
2060
+ # @api public
2061
+ # : (?Symbol? new_state) -> Symbol
2062
+ def state: (?Symbol? new_state) -> Symbol
2063
+
2064
+ # Sets the sheet visibility state (:visible, :hidden, or :very_hidden).
2065
+ #
2066
+ # @param new_state [Symbol, String] The new state.
2067
+ # @return [Symbol]
2068
+ # @api public
2069
+ # : (Symbol | String new_state) -> Symbol
2070
+ def state=: (Symbol | String new_state) -> Symbol
2071
+
2072
+ # Gets or sets the tab color of the current worksheet.
2073
+ #
2074
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#tab_color=} instead.
2075
+ # @param spec [String, Hash, Symbol, nil] Tab color hex string or hash options.
2076
+ # @param opts [Hash] Color keyword arguments (e.g. theme: 1, tint: 0.5).
2077
+ # @return [String, Hash, nil]
2078
+ # @api public
2079
+ # : (?String | Symbol | Hash[Symbol, untyped] | nil spec, **untyped opts) -> (String | Hash[Symbol, untyped] | nil)
2080
+ def tab_color: (?String | Symbol | Hash[Symbol, untyped] | nil spec, **untyped opts) -> (String | Hash[Symbol, untyped] | nil)
2081
+
2082
+ # Sets the tab color of the current worksheet.
2083
+ #
2084
+ # @param spec [String, Hash, Symbol, nil] Tab color hex string or hash options.
2085
+ # @return [String, Hash, nil]
2086
+ # @api public
2087
+ # : (String | Symbol | Hash[Symbol, untyped] | nil spec) -> (String | Hash[Symbol, untyped] | nil)
2088
+ def tab_color=: (String | Symbol | Hash[Symbol, untyped] | nil spec) -> (String | Hash[Symbol, untyped] | nil)
2089
+
2090
+ # Sets a single sheet property.
2091
+ #
2092
+ # @param name [Symbol, String] Property name.
966
2093
  # @param value [Object] Property value.
967
2094
  # @return [void]
968
2095
  # @api public
969
- # : (Symbol name, untyped value) -> void
970
- def sheet_properties: (Symbol name, untyped value) -> void
2096
+ # : (Symbol | String name, untyped value) -> void
2097
+ def sheet_property: (Symbol | String name, untyped value) -> void
2098
+
2099
+ # Configures or queries sheet properties (<sheetPr>).
2100
+ #
2101
+ # When called with no arguments, returns the {Elements::SheetProperties} value object.
2102
+ # When called with arguments or keyword options, configures properties and returns nil.
2103
+ #
2104
+ # @param name [Symbol, String, Hash, Elements::MetadataRecord, nil] Property name or hash/record of properties.
2105
+ # @param value [Object, nil] Property value when name is provided.
2106
+ # @param opts [Hash] Additional sheet properties.
2107
+ # @return [Elements::SheetProperties, void]
2108
+ # @api public
2109
+ # : (?Symbol | String | Hash[Symbol, untyped] | Elements::MetadataRecord | nil name, ?untyped value, **untyped opts) -> (Elements::SheetProperties | void)
2110
+ def sheet_properties: (?untyped name, ?untyped value, **untyped opts) -> untyped
2111
+
2112
+ # Replaces worksheet properties with the given hash or {Elements::SheetProperties} object.
2113
+ #
2114
+ # @param opts [Hash, Elements::SheetProperties]
2115
+ # @return [void]
2116
+ # @api public
2117
+ # : (Hash[Symbol, untyped] | Elements::SheetProperties opts) -> void
2118
+ def sheet_properties=: (Hash[Symbol, untyped] | Elements::SheetProperties opts) -> void
2119
+
2120
+ # Configures or queries sheet view display properties (<sheetView>).
2121
+ #
2122
+ # When called with no arguments, returns the {Elements::SheetView} value object.
2123
+ # When called with arguments or keyword options, configures view properties and returns nil.
2124
+ #
2125
+ # @param name [Symbol, String, Hash, Elements::MetadataRecord, nil] View property name or hash/record of properties.
2126
+ # @param value [Object, nil] View property value when name is provided.
2127
+ # @param opts [Hash] Additional view properties.
2128
+ # @return [Elements::SheetView, void]
2129
+ # @api public
2130
+ # : (?Symbol | String | Hash[Symbol, untyped] | Elements::MetadataRecord | nil name, ?untyped value, **untyped opts) -> (Elements::SheetView | void)
2131
+ def sheet_view: (?untyped name, ?untyped value, **untyped opts) -> untyped
971
2132
 
972
- # Sets a sheet view property (e.g. zoom_scale: 120).
2133
+ # Replaces sheet view properties with the given hash or {Elements::SheetView} object.
973
2134
  #
974
- # @param name [Symbol] View property name.
975
- # @param value [Object] View property value.
2135
+ # @param opts [Hash, Elements::SheetView]
976
2136
  # @return [void]
977
2137
  # @api public
978
- # : (Symbol name, untyped value) -> void
979
- def sheet_view: (Symbol name, untyped value) -> void
2138
+ # : (Hash[Symbol, untyped] | Elements::SheetView opts) -> void
2139
+ def sheet_view=: (Hash[Symbol, untyped] | Elements::SheetView opts) -> void
980
2140
 
981
- # Configures sheet format properties (e.g. default_row_height, default_col_width).
2141
+ # Configures or queries sheet format properties (<sheetFormatPr>).
982
2142
  #
983
- # @param name [Symbol, String, Hash, nil] Property name or hash of properties.
2143
+ # When called with no arguments, returns the {Elements::SheetFormat} value object.
2144
+ # When called with arguments or keyword options, configures format properties and returns nil.
2145
+ #
2146
+ # @param name [Symbol, String, Hash, Elements::MetadataRecord, nil] Property name or hash/record of properties.
984
2147
  # @param value [Object, nil] Property value when name is provided.
985
2148
  # @param opts [Hash] Keyword arguments for sheet format properties.
986
- # @return [Hash[Symbol, untyped]]
2149
+ # @return [Elements::SheetFormat, void]
2150
+ # @api public
2151
+ # : (?Symbol | String | Hash[Symbol, untyped] | Elements::MetadataRecord | nil name, ?untyped value, **untyped opts) -> (Elements::SheetFormat | void)
2152
+ def sheet_format: (?untyped name, ?untyped value, **untyped opts) -> untyped
2153
+
2154
+ # Replaces sheet format properties with the given hash or {Elements::SheetFormat} object.
2155
+ #
2156
+ # @param opts [Hash, Elements::SheetFormat]
2157
+ # @return [void]
987
2158
  # @api public
988
- # : (?Symbol | String | Hash[Symbol, untyped] | nil name, ?untyped value, **untyped opts) -> Hash[Symbol, untyped]
989
- def sheet_format: (?Symbol | String | Hash[Symbol, untyped] | nil name, ?untyped value, **untyped opts) -> Hash[Symbol, untyped]
2159
+ # : (Hash[Symbol, untyped] | Elements::SheetFormat opts) -> void
2160
+ def sheet_format=: (Hash[Symbol, untyped] | Elements::SheetFormat opts) -> void
990
2161
 
991
- # Inserts a horizontal page break before a row.
2162
+ # Inserts a horizontal page break after the given 0-based row.
992
2163
  #
993
- # @param row_num [Integer] 1-based row number.
2164
+ # @param row_index [Integer] 0-based row index.
994
2165
  # @return [void]
995
2166
  # @api public
2167
+ # : (Integer row_index) -> void
2168
+ def row_break: (Integer row_index) -> void
2169
+
2170
+ # @deprecated Use {#row_break} instead.
996
2171
  # : (Integer row_num) -> void
997
2172
  def page_break_row: (Integer row_num) -> void
998
2173
 
999
- # Inserts a vertical page break before a column.
2174
+ # Inserts a vertical page break after the given column.
1000
2175
  #
1001
- # @param col_index [Integer, String] 0-based column index or letter ("B").
2176
+ # @param col [Integer, String, Symbol] 0-based column index or letter ("B", :B).
1002
2177
  # @return [void]
1003
2178
  # @api public
1004
- # : (Integer col_index) -> void
1005
- def page_break_col: (Integer col_index) -> void
2179
+ # : (Integer | String | Symbol col) -> void
2180
+ def column_break: (Integer | String | Symbol col) -> void
2181
+
2182
+ # @deprecated Use {#column_break} instead.
2183
+ # : (Integer | String | Symbol col_index) -> void
2184
+ def page_break_col: (Integer | String | Symbol col_index) -> void
1006
2185
 
1007
2186
  # Adds a protected range to the current sheet.
1008
2187
  #
@@ -1015,6 +2194,7 @@ module Xlsxrb
1015
2194
  # : (String name, String sqref, ?password: String?, **untyped opts) -> void
1016
2195
  def protected_range: (String name, String sqref, ?password: String?, **untyped opts) -> void
1017
2196
 
2197
+ # @deprecated Use {#protected_range} instead. Will be removed in 0.2.0.
1018
2198
  alias add_protected_range protected_range
1019
2199
 
1020
2200
  # Adds a cell watch to the current sheet.
@@ -1025,37 +2205,206 @@ module Xlsxrb
1025
2205
  # : (String ref) -> void
1026
2206
  def cell_watch: (String ref) -> void
1027
2207
 
2208
+ # @deprecated Use {#cell_watch} instead. Will be removed in 0.2.0.
1028
2209
  alias add_cell_watch cell_watch
1029
2210
 
2211
+ # Adds an ignored error entry to the current sheet.
2212
+ #
2213
+ # @param sqref [String] Cell range reference (e.g. "A1" or "A1:B10").
2214
+ # @param opts [Hash] Error check flags to ignore.
2215
+ # @return [void]
2216
+ # @api public
2217
+ # : (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
2218
+ def ignored_error: (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
2219
+
2220
+ # @deprecated Use {#ignored_error} instead. Will be removed in 0.2.0.
2221
+ # : (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
2222
+ def ignore_error: (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
2223
+
2224
+ # @deprecated Use {#ignored_error} instead. Will be removed in 0.2.0.
2225
+ # : (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
2226
+ def add_ignored_error: (String sqref, ?eval_error: bool, ?two_digit_text_year: bool, ?number_stored_as_text: bool, ?formula: bool, ?formula_range: bool, ?unlocked_formula: bool, ?empty_cell_reference: bool, ?list_data_validation: bool, ?calculated_column: bool) -> void
2227
+
2228
+ # Returns the ignored error entries configured for the current sheet.
2229
+ #
2230
+ # @return [Array<Hash[Symbol, untyped]>]
2231
+ # @api public
2232
+ # : () -> Array[Hash[Symbol, untyped]]
2233
+ def ignored_errors: () -> Array[Hash[Symbol, untyped]]
2234
+
2235
+ # Gets or sets phonetic (furigana) guide properties for the current sheet.
2236
+ #
2237
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#phonetic_properties=} instead.
2238
+ # @overload phonetic_properties()
2239
+ # Returns the current phonetic properties.
2240
+ # @return [Hash, nil]
2241
+ # @overload phonetic_properties(spec = nil, font_id: nil, type: nil, alignment: nil)
2242
+ # Sets phonetic properties for the current sheet.
2243
+ # @param spec [Hash, Integer, nil]
2244
+ # @param font_id [Integer, nil]
2245
+ # @param type [Symbol, String, nil]
2246
+ # @param alignment [Symbol, String, nil]
2247
+ # @return [Hash, nil]
2248
+ # @api public
2249
+ # : (?untyped spec, ?font_id: Integer?, ?type: (Symbol | String)?, ?alignment: (Symbol | String)?, **untyped opts) -> (Elements::PhoneticProperties | Hash[Symbol, untyped] | nil)
2250
+ def phonetic_properties: (?untyped spec, ?font_id: Integer?, ?type: (Symbol | String)?, ?alignment: (Symbol | String)?, **untyped opts) -> (Elements::PhoneticProperties | Hash[Symbol, untyped] | nil)
2251
+
2252
+ # @deprecated Use {#phonetic_properties} instead. Will be removed in 0.2.0.
2253
+ alias phonetic_pr phonetic_properties
2254
+
2255
+ # Sets phonetic (furigana) guide properties for the current sheet.
2256
+ #
2257
+ # @param spec [Hash, Integer, nil]
2258
+ # @return [Hash[Symbol, untyped], Integer, nil]
2259
+ # @api public
2260
+ # : (Hash[Symbol, untyped] | Integer | nil spec) -> (Hash[Symbol, untyped] | Integer | nil)
2261
+ def phonetic_properties=: (Hash[Symbol, untyped] | Integer | nil spec) -> (Hash[Symbol, untyped] | Integer | nil)
2262
+
2263
+ # @deprecated Use {#phonetic_properties=} instead. Will be removed in 0.2.0.
2264
+ alias phonetic_pr= phonetic_properties=
2265
+
2266
+ # Sets or gets the internal code name of the current worksheet (or workbook if no sheet is open).
2267
+ #
2268
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#code_name=} instead.
2269
+ # @param val [String, Symbol, nil] The code name.
2270
+ # @return [String, nil]
2271
+ # @api public
2272
+ # : (?String | Symbol | nil val) -> String?
2273
+ def code_name: (?String | Symbol | nil val) -> String?
2274
+
2275
+ # Sets the internal code name of the current worksheet (or workbook if no sheet is open).
2276
+ #
2277
+ # @param val [String, Symbol, nil] The code name.
2278
+ # @return [String, nil]
2279
+ # @api public
2280
+ # : (String | Symbol | nil val) -> String?
2281
+ def code_name=: (String | Symbol | nil val) -> String?
2282
+
2283
+ # Configures whether page setup fits content to page width/height for the current sheet.
2284
+ # When enabled, optionally sets fit_to_width and/or fit_to_height on page_setup.
2285
+ #
2286
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#fit_to_page=} or {#page_setup} with :fit_to_width/:fit_to_height instead.
2287
+ # @param enabled [Boolean, nil] Whether to fit to page.
2288
+ # @param width [Integer, nil] Pages wide to fit to.
2289
+ # @param height [Integer, nil] Pages tall to fit to.
2290
+ # @return [Boolean, void]
2291
+ # @api public
2292
+ # : (?bool? enabled, ?width: Integer?, ?height: Integer?) -> (bool | void)
2293
+ def fit_to_page: (?untyped enabled, ?width: untyped, ?height: untyped) -> untyped
2294
+
2295
+ # @deprecated Use {#fit_to_page} instead. Will be removed in 0.2.0.
2296
+ # @return [Boolean]
2297
+ # @api public
2298
+ # : () -> bool
2299
+ def fit_to_page?: () -> bool
2300
+
2301
+ # Sets whether page setup fits content to page width/height for the current sheet.
2302
+ #
2303
+ # @param enabled [Boolean, nil] Whether to fit to page.
2304
+ # @return [Boolean]
2305
+ # @api public
2306
+ # : (bool? enabled) -> bool?
2307
+ def fit_to_page=: (bool? enabled) -> bool?
2308
+
2309
+ # Configures worksheet calculation properties (<sheetCalcPr>) for the current sheet.
2310
+ #
2311
+ # @example Instruct Excel to recalculate formulas when loading sheet
2312
+ # w.sheet_calc_properties = { full_calc_on_load: true }
2313
+ #
2314
+ # @deprecated Calling with arguments is deprecated and will be removed in 0.2.0. Use {#sheet_calc_properties=} instead.
2315
+ # @param spec [Hash, nil] Calculation properties hash.
2316
+ # @param full_calc_on_load [Boolean, nil] Whether to recalculate when loading.
2317
+ # @return [Hash, nil]
2318
+ # @api public
2319
+ # : (?untyped spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
2320
+ def sheet_calc_properties: (?untyped spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
2321
+
2322
+ # Sets worksheet calculation properties (<sheetCalcPr>) for the current sheet.
2323
+ #
2324
+ # @param spec [Hash, nil] Calculation properties hash.
2325
+ # @return [Hash, nil]
2326
+ # @api public
2327
+ # : (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
2328
+ def sheet_calc_properties=: (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
2329
+
2330
+ # @deprecated Use {#sheet_calc_properties} instead. Will be removed in 0.2.0.
2331
+ # : (?Hash[Symbol, untyped]? spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
2332
+ def sheet_calc_pr: (?Hash[Symbol, untyped]? spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
2333
+
2334
+ # @deprecated Use {#sheet_calc_properties} instead. Will be removed in 0.2.0.
2335
+ # : (?Hash[Symbol, untyped]? spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
2336
+ def calc_pr: (?Hash[Symbol, untyped]? spec, ?full_calc_on_load: bool?, **untyped opts) -> (Elements::SheetCalcProperties | Hash[Symbol, untyped] | nil)
2337
+
2338
+ # @deprecated Use {#sheet_calc_properties=} instead. Will be removed in 0.2.0.
2339
+ # : (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
2340
+ def sheet_calc_pr=: (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
2341
+
2342
+ # @deprecated Use {#sheet_calc_properties=} instead. Will be removed in 0.2.0.
2343
+ # : (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
2344
+ def calc_pr=: (Hash[Symbol, untyped]? spec) -> Hash[Symbol, untyped]?
2345
+
1030
2346
  # Adds a defined name.
1031
2347
  #
1032
2348
  # @param name [String] The defined name.
1033
- # @param value [String] The formula or value expression.
1034
- # @param sheet [String, nil] Local sheet name.
2349
+ # @param value [Object, nil] The formula or value expression.
2350
+ # @param sheet [String, nil] Reference sheet name.
2351
+ # @param scope [String, Symbol, nil] Local scope sheet name or :workbook.
1035
2352
  # @param hidden [Boolean] Whether the defined name is hidden.
2353
+ # @param column [Integer, String, nil] Deprecated alias for columns.
2354
+ # @param columns [Integer, String, nil] Column index or letter for coordinate-based reference.
2355
+ # @param col [Integer, String, nil] Deprecated alias for column.
2356
+ # @param row [Integer, Range, nil] Deprecated alias for rows.
2357
+ # @param rows [Integer, Range, nil] Row or row range (1-based) for coordinate-based reference.
2358
+ # @param range [String, nil] Cell range reference.
2359
+ # @param ref_sheet [String, nil] Deprecated alias for sheet.
2360
+ # @param local [Boolean] Deprecated alias for scope.
1036
2361
  # @return [void]
1037
2362
  # @api public
1038
- # : (String name, String value, ?sheet: String?, ?hidden: bool) -> void
1039
- def defined_name: (String name, String value, ?sheet: String?, ?hidden: bool) -> void
2363
+ # : (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
2364
+ 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
2365
+
2366
+ # Returns workbook-level defined names.
2367
+ #
2368
+ # @return [Array<Elements::DefinedName>]
2369
+ # @api public
2370
+ # : () -> Array[Elements::DefinedName]
2371
+ def defined_names: () -> Array[Elements::DefinedName]
1040
2372
 
1041
- # Sets the print area for the current or named sheet.
2373
+ # Sets or gets the print area for the current or named sheet.
1042
2374
  #
1043
- # @param range [String] Cell range (e.g. "A1:G50").
2375
+ # @param range [String, Object, nil] Cell range (e.g. "A1:G50").
1044
2376
  # @param sheet [String, nil] Target sheet name.
1045
- # @return [void]
2377
+ # @return [String, nil, void]
2378
+ # @api public
2379
+ # : (?untyped range, ?sheet: String?) -> (String | nil | void)
2380
+ def print_area: (?untyped range, ?sheet: untyped) -> untyped
2381
+
2382
+ # Sets the print area for the current worksheet.
2383
+ #
2384
+ # @param range [String, nil] Cell range (e.g. "A1:G50").
2385
+ # @return [String, nil]
1046
2386
  # @api public
1047
- # : (String range, ?sheet: String?) -> void
1048
- def print_area: (String range, ?sheet: String?) -> void
2387
+ # : (String? range) -> String?
2388
+ def print_area=: (String? range) -> String?
1049
2389
 
1050
- # Sets print titles for the current or named sheet.
2390
+ # Sets or gets print titles for the current or named sheet.
1051
2391
  #
1052
- # @param rows [String, nil] Repeating row range (e.g. "1:2").
1053
- # @param cols [String, nil] Repeating column range (e.g. "A:B").
2392
+ # @param rows [String, Integer, Range, Object, nil] Repeating row range (e.g. "1:2" or 0-based 0..1).
2393
+ # @param columns [String, Integer, Symbol, Range, Object, nil] Repeating column range (e.g. "A:B" or 0..1).
2394
+ # @param cols [String, Integer, Symbol, Range, Object, nil] Deprecated alias for columns.
1054
2395
  # @param sheet [String, nil] Target sheet name.
1055
- # @return [void]
2396
+ # @return [Elements::PrintTitles, nil, void]
2397
+ # @api public
2398
+ # : (?rows: untyped, ?columns: untyped, ?cols: untyped, ?sheet: String?) -> (Elements::PrintTitles | nil | void)
2399
+ def print_titles: (?rows: untyped, ?columns: untyped, ?cols: untyped, ?sheet: untyped) -> untyped
2400
+
2401
+ # Sets repeating print titles for the current worksheet.
2402
+ #
2403
+ # @param opts [Elements::PrintTitles, Hash, nil] Options with :rows and/or :columns.
2404
+ # @return [Elements::PrintTitles, Hash, nil]
1056
2405
  # @api public
1057
- # : (?rows: String?, ?cols: String?, ?sheet: String?) -> void
1058
- def print_titles: (?rows: String?, ?cols: String?, ?sheet: String?) -> void
2406
+ # : (Elements::PrintTitles | Hash[Symbol, untyped] | nil opts) -> (Elements::PrintTitles | Hash[Symbol, untyped] | nil)
2407
+ def print_titles=: (Elements::PrintTitles | Hash[Symbol, untyped] | nil opts) -> (Elements::PrintTitles | Hash[Symbol, untyped] | nil)
1059
2408
 
1060
2409
  # Sets repeating title rows for pagination on the current or named sheet.
1061
2410
  #
@@ -1083,11 +2432,23 @@ module Xlsxrb
1083
2432
  # : (Integer | String first, ?(Integer | String)? last, ?sheet: String?) -> void
1084
2433
  def repeat_columns: (Integer | String first, ?(Integer | String)? last, ?sheet: String?) -> void
1085
2434
 
1086
- # Sets workbook protection.
2435
+ # Sets or returns workbook protection settings.
1087
2436
  #
1088
2437
  # @param opts [Hash] Protection options.
2438
+ # @return [Elements::WorkbookProtection, nil, void]
2439
+ # @api public
2440
+ # : (**String | Integer | bool | nil opts) -> (Elements::WorkbookProtection | nil)
2441
+ def workbook_protection: (**String | Integer | bool | nil opts) -> (Elements::WorkbookProtection | nil)
2442
+
2443
+ # Sets workbook protection settings.
2444
+ #
2445
+ # @param opts [Hash, Elements::MetadataRecord, nil]
1089
2446
  # @return [void]
1090
2447
  # @api public
2448
+ # : (untyped opts) -> void
2449
+ def workbook_protection=: (untyped opts) -> void
2450
+
2451
+ # @deprecated Use {#workbook_protection} instead.
1091
2452
  # : (**String | Integer | bool | nil opts) -> void
1092
2453
  def protect_workbook: (**String | Integer | bool | nil opts) -> void
1093
2454
 
@@ -1100,6 +2461,13 @@ module Xlsxrb
1100
2461
  # : (Symbol name, String | Integer | Time value) -> void
1101
2462
  def core_property: (Symbol name, String | Integer | Time value) -> void
1102
2463
 
2464
+ # Returns core document properties.
2465
+ #
2466
+ # @return [Elements::CoreProperties]
2467
+ # @api public
2468
+ # : () -> Elements::CoreProperties
2469
+ def core_properties: () -> Elements::CoreProperties
2470
+
1103
2471
  # Sets an app document property.
1104
2472
  #
1105
2473
  # @param name [Symbol] Property name.
@@ -1109,6 +2477,13 @@ module Xlsxrb
1109
2477
  # : (Symbol name, String | Integer | Time value) -> void
1110
2478
  def app_property: (Symbol name, String | Integer | Time value) -> void
1111
2479
 
2480
+ # Returns application document properties.
2481
+ #
2482
+ # @return [Elements::AppProperties]
2483
+ # @api public
2484
+ # : () -> Elements::AppProperties
2485
+ def app_properties: () -> Elements::AppProperties
2486
+
1112
2487
  # Sets multiple core and/or app properties.
1113
2488
  #
1114
2489
  # @param core [Hash, nil] Core properties.
@@ -1129,6 +2504,13 @@ module Xlsxrb
1129
2504
  # : (String name, String | Integer | Float | bool | Time value, ?type: ::Symbol) -> void
1130
2505
  def custom_property: (String name, String | Integer | Float | bool | Time value, ?type: ::Symbol) -> void
1131
2506
 
2507
+ # Returns custom document properties.
2508
+ #
2509
+ # @return [Hash<String, Elements::CustomProperty>]
2510
+ # @api public
2511
+ # : () -> Hash[String, Elements::CustomProperty]
2512
+ def custom_properties: () -> Hash[String, Elements::CustomProperty]
2513
+
1132
2514
  # Finalizes and writes all streaming sheet contents to the destination target.
1133
2515
  #
1134
2516
  # @return [void]
@@ -1139,7 +2521,7 @@ module Xlsxrb
1139
2521
  # Explicitly cleans up any resources if not already closed.
1140
2522
  #
1141
2523
  # @return [void]
1142
- # @api public
2524
+ # @api private
1143
2525
  # : () -> void
1144
2526
  def cleanup!: () -> void
1145
2527