xlsxrb 0.1.18 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +200 -0
  3. data/README.md +35 -12
  4. data/lib/ruby_lsp/xlsxrb/completion_listener.rb +410 -80
  5. data/lib/xlsxrb/chart_builder.rb +251 -386
  6. data/lib/xlsxrb/dsl_helpers.rb +169 -68
  7. data/lib/xlsxrb/elements/cell.rb +37 -157
  8. data/lib/xlsxrb/elements/column.rb +11 -19
  9. data/lib/xlsxrb/elements/coordinate_access.rb +15 -86
  10. data/lib/xlsxrb/elements/image.rb +5 -72
  11. data/lib/xlsxrb/elements/metadata.rb +463 -817
  12. data/lib/xlsxrb/elements/row.rb +27 -145
  13. data/lib/xlsxrb/elements/styles.rb +30 -88
  14. data/lib/xlsxrb/elements/types.rb +6 -99
  15. data/lib/xlsxrb/elements/workbook.rb +19 -126
  16. data/lib/xlsxrb/elements/worksheet.rb +45 -316
  17. data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +4 -1
  18. data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +7 -7
  19. data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +32 -17
  20. data/lib/xlsxrb/ooxml/reader.rb +49 -51
  21. data/lib/xlsxrb/ooxml/styles_parser.rb +26 -2
  22. data/lib/xlsxrb/ooxml/utils.rb +15 -2
  23. data/lib/xlsxrb/ooxml/workbook_parser.rb +0 -1
  24. data/lib/xlsxrb/ooxml/workbook_writer.rb +184 -94
  25. data/lib/xlsxrb/ooxml/worksheet_parser.rb +61 -29
  26. data/lib/xlsxrb/ooxml/worksheet_writer.rb +353 -261
  27. data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +28 -11
  28. data/lib/xlsxrb/ooxml/writer/features_xml.rb +62 -16
  29. data/lib/xlsxrb/ooxml/writer/styles_xml.rb +1 -1
  30. data/lib/xlsxrb/ooxml/writer.rb +106 -42
  31. data/lib/xlsxrb/ooxml/xml_builder.rb +18 -0
  32. data/lib/xlsxrb/ooxml/xml_parser.rb +78 -5
  33. data/lib/xlsxrb/ooxml/zip_reader.rb +65 -15
  34. data/lib/xlsxrb/ooxml/zip_writer.rb +119 -30
  35. data/lib/xlsxrb/stream_row.rb +14 -118
  36. data/lib/xlsxrb/stream_sheet.rb +14 -261
  37. data/lib/xlsxrb/stream_writer.rb +807 -1537
  38. data/lib/xlsxrb/style_builder.rb +715 -593
  39. data/lib/xlsxrb/version.rb +1 -1
  40. data/lib/xlsxrb/workbook_builder.rb +403 -286
  41. data/lib/xlsxrb/worksheet_builder.rb +1297 -1458
  42. data/lib/xlsxrb.rb +281 -1079
  43. data/sig/generated/xlsxrb/chart_builder.rbs +202 -205
  44. data/sig/generated/xlsxrb/dsl_helpers.rbs +92 -16
  45. data/sig/generated/xlsxrb/elements/cell.rbs +12 -76
  46. data/sig/generated/xlsxrb/elements/column.rbs +0 -7
  47. data/sig/generated/xlsxrb/elements/coordinate_access.rbs +5 -41
  48. data/sig/generated/xlsxrb/elements/image.rbs +3 -29
  49. data/sig/generated/xlsxrb/elements/metadata.rbs +138 -151
  50. data/sig/generated/xlsxrb/elements/row.rbs +10 -53
  51. data/sig/generated/xlsxrb/elements/styles.rbs +1 -39
  52. data/sig/generated/xlsxrb/elements/workbook.rbs +14 -78
  53. data/sig/generated/xlsxrb/elements/worksheet.rbs +5 -121
  54. data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +0 -4
  55. data/sig/generated/xlsxrb/ooxml/reader.rbs +0 -3
  56. data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +1 -1
  57. data/sig/generated/xlsxrb/ooxml/utils.rbs +13 -3
  58. data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +17 -0
  59. data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +16 -0
  60. data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +58 -3
  61. data/sig/generated/xlsxrb/ooxml/writer/features_xml.rbs +10 -0
  62. data/sig/generated/xlsxrb/ooxml/writer.rbs +20 -14
  63. data/sig/generated/xlsxrb/ooxml/xml_builder.rbs +12 -0
  64. data/sig/generated/xlsxrb/ooxml/xml_parser.rbs +70 -0
  65. data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +22 -7
  66. data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +26 -1
  67. data/sig/generated/xlsxrb/stream_row.rbs +9 -44
  68. data/sig/generated/xlsxrb/stream_sheet.rbs +1 -158
  69. data/sig/generated/xlsxrb/stream_writer.rbs +491 -974
  70. data/sig/generated/xlsxrb/style_builder.rbs +464 -239
  71. data/sig/generated/xlsxrb/workbook_builder.rbs +124 -139
  72. data/sig/generated/xlsxrb/worksheet_builder.rbs +922 -686
  73. data/sig/generated/xlsxrb.rbs +56 -188
  74. data/sig/rexml.rbs +8 -0
  75. metadata +3 -5
  76. data/lib/xlsxrb/utils.rb +0 -251
  77. data/sig/generated/xlsxrb/utils.rbs +0 -200
@@ -17,8 +17,6 @@ module Xlsxrb
17
17
 
18
18
  VERT_ALIGN_MAP: untyped
19
19
 
20
- OMITTED: untyped
21
-
22
20
  # Normalizes a color definition (CSS color name, hex code, or RGB integer) to an OpenXML hex color string.
23
21
  #
24
22
  # @example
@@ -50,6 +48,15 @@ module Xlsxrb
50
48
  # : (Symbol | String | Integer | nil style) -> Symbol?
51
49
  def self.normalize_border_style: (Symbol | String | Integer | nil style) -> Symbol?
52
50
 
51
+ # Normalizes a border style like normalize_border_style, raising ArgumentError for a style
52
+ # that is not one of the ST_BorderStyle values or their snake_case spellings.
53
+ #
54
+ # @param style [Symbol, String, Integer]
55
+ # @return [String]
56
+ # @api private
57
+ # : (Symbol | String | Integer style) -> String
58
+ def self.border_style!: (Symbol | String | Integer style) -> String
59
+
53
60
  # Resolves a color symbol, string, or prefix to an aRGB hex string.
54
61
  #
55
62
  # @param color [Symbol, String, Object, nil]
@@ -75,6 +82,28 @@ module Xlsxrb
75
82
  # : Hash[Symbol, untyped]
76
83
  attr_reader border_props: untyped
77
84
 
85
+ # Top-level keys accepted by #apply_options!.
86
+ OPTION_KEYS: untyped
87
+
88
+ # Keys accepted inside the nested option hashes.
89
+ NESTED_OPTION_KEYS: untyped
90
+
91
+ # Flat keys that the nested form of each group replaces; giving both is ambiguous.
92
+ FLAT_KEYS_BY_GROUP: untyped
93
+
94
+ # Copies the option hashes, so a copy can change without affecting the original.
95
+ # : (StyleBuilder source) -> void
96
+ def initialize_copy: (StyleBuilder source) -> void
97
+
98
+ # Returns a copy of this style named +name+ that uses +number_format+.
99
+ #
100
+ # @param name [String] Name of the copy.
101
+ # @param number_format [String, Integer] Number format of the copy.
102
+ # @return [StyleBuilder]
103
+ # @api private
104
+ # : (String name, String | Integer number_format) -> StyleBuilder
105
+ def with_number_format: (String name, String | Integer number_format) -> StyleBuilder
106
+
78
107
  # Applies option-style definitions so callers can use add_style(name, **opts)
79
108
  # as an alternative to block-based fluent chaining.
80
109
  # Applies option-style definitions so callers can use add_style(name, **opts)
@@ -85,21 +114,21 @@ module Xlsxrb
85
114
  # : (**untyped) -> self
86
115
  def apply_options!: (**untyped) -> self
87
116
 
88
- # Configures multiple font properties at once.
117
+ # Configures multiple font properties at once or returns font properties.
89
118
  # @param opts [Hash] The font properties.
90
- # @return [self]
119
+ # @return [Hash, void]
91
120
  # @api public
92
- # : (**untyped) -> (self | Hash[Symbol, untyped])
93
- def font: (**untyped) -> (self | Hash[Symbol, untyped])
94
-
95
- def font=: (untyped opts) -> untyped
121
+ # : () -> Hash[Symbol, untyped]
122
+ # : (**untyped) -> void
123
+ def font: () -> Hash[Symbol, untyped]
124
+ | (**untyped) -> void
96
125
 
97
- # Sets the font to bold.
98
- # @param value [Boolean] Whether to apply bold.
99
- # @return [self]
126
+ # Sets font options.
127
+ # @param opts [Hash]
128
+ # @return [Hash]
100
129
  # @api public
101
- # : (?untyped) -> (self | bool)
102
- def bold: (?untyped) -> (self | bool)
130
+ # : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
131
+ def font=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
103
132
 
104
133
  # Sets the font to bold.
105
134
  # @param value [Boolean]
@@ -114,13 +143,6 @@ module Xlsxrb
114
143
  # : () -> bool
115
144
  def bold?: () -> bool
116
145
 
117
- # Sets the font to italic.
118
- # @param value [Boolean] Whether to apply italic.
119
- # @return [self]
120
- # @api public
121
- # : (?untyped) -> (self | bool)
122
- def italic: (?untyped) -> (self | bool)
123
-
124
146
  # Sets the font to italic.
125
147
  # @param value [Boolean]
126
148
  # @return [Boolean]
@@ -134,12 +156,11 @@ module Xlsxrb
134
156
  # : () -> bool
135
157
  def italic?: () -> bool
136
158
 
137
- # Sets or gets the font size in points.
138
- # @param size_value [Integer, Float, nil] The size in points (supports fractional sizes such as 10.5).
139
- # @return [Integer, Float, self, nil]
159
+ # Gets the font size in points.
160
+ # @return [Integer, Float, nil]
140
161
  # @api public
141
- # : (?Numeric? size_value) -> (Numeric | self | nil)
142
- def font_size: (?Numeric? size_value) -> (Numeric | self | nil)
162
+ # : () -> (Integer | Float | nil)
163
+ def font_size: () -> (Integer | Float | nil)
143
164
 
144
165
  # Sets the font size in points.
145
166
  # @param size_value [Integer, Float] The size in points (supports fractional sizes such as 10.5).
@@ -148,29 +169,11 @@ module Xlsxrb
148
169
  # : (Numeric size_value) -> Numeric
149
170
  def font_size=: (Numeric size_value) -> Numeric
150
171
 
151
- # @deprecated Use {#font_size} instead. Will be removed in 0.2.0.
152
- # : (?Numeric? size_value) -> (Numeric | self | nil)
153
- def size: (?Numeric? size_value) -> (Numeric | self | nil)
154
-
155
- # @deprecated Use {#font_size=} instead. Will be removed in 0.2.0.
156
- # : (Numeric size_value) -> Numeric
157
- def size=: (Numeric size_value) -> Numeric
158
-
159
- # @deprecated Use {#font_size} instead. Will be removed in 0.2.0.
160
- # : (?Numeric? size_value) -> (Numeric | self | nil)
161
- def sz: (?Numeric? size_value) -> (Numeric | self | nil)
162
-
163
- # @deprecated Use {#font_size=} instead. Will be removed in 0.2.0.
164
- # : (Numeric size_value) -> Numeric
165
- def sz=: (Numeric size_value) -> Numeric
166
-
167
- # Sets the font name.
168
- # Gets or sets the font name.
169
- # @param name [String, Object] The font name.
170
- # @return [String, self, nil]
172
+ # Gets the font name.
173
+ # @return [String, nil]
171
174
  # @api public
172
- # : (?untyped name) -> (String | self | nil)
173
- def font_name: (?untyped name) -> (String | self | nil)
175
+ # : () -> String?
176
+ def font_name: () -> String?
174
177
 
175
178
  # Sets the font name.
176
179
  # @param name [String]
@@ -179,12 +182,11 @@ module Xlsxrb
179
182
  # : (String name) -> String
180
183
  def font_name=: (String name) -> String
181
184
 
182
- # Gets or sets the font color.
183
- # @param color [String, Symbol, Object] The color.
184
- # @return [String, Symbol, self, nil]
185
+ # Gets the font color.
186
+ # @return [String, nil]
185
187
  # @api public
186
- # : (?untyped color) -> (String | Symbol | self | nil)
187
- def font_color: (?untyped color) -> (String | Symbol | self | nil)
188
+ # : () -> String?
189
+ def font_color: () -> String?
188
190
 
189
191
  # Sets the font color.
190
192
  # @param color [String, Symbol]
@@ -193,12 +195,11 @@ module Xlsxrb
193
195
  # : (String | Symbol color) -> (String | Symbol)
194
196
  def font_color=: (String | Symbol color) -> (String | Symbol)
195
197
 
196
- # Sets the font underline style.
197
- # @param val [String, Symbol, Boolean] The underline style (e.g., 'single', :double, :single_accounting, :double_accounting).
198
- # @return [self]
198
+ # Gets the font underline style.
199
+ # @return [String, Symbol, Boolean, nil]
199
200
  # @api public
200
- # : (?untyped) -> (self | String | Symbol | bool | nil)
201
- def underline: (?untyped) -> (self | String | Symbol | bool | nil)
201
+ # : () -> (String | Symbol | bool | nil)
202
+ def underline: () -> (String | Symbol | bool | nil)
202
203
 
203
204
  # Sets the font underline style.
204
205
  # @param val [String, Symbol, Boolean]
@@ -213,13 +214,6 @@ module Xlsxrb
213
214
  # : () -> bool
214
215
  def underline?: () -> bool
215
216
 
216
- # Sets the font strikethrough.
217
- # @param value [Boolean] Whether to apply strike.
218
- # @return [self]
219
- # @api public
220
- # : (?untyped) -> (self | bool)
221
- def strike: (?untyped) -> (self | bool)
222
-
223
217
  # Sets the font strikethrough.
224
218
  # @param value [Boolean]
225
219
  # @return [Boolean]
@@ -233,51 +227,55 @@ module Xlsxrb
233
227
  # : () -> bool
234
228
  def strike?: () -> bool
235
229
 
236
- # Gets or sets the vertical alignment of the font.
237
- # @param value [String, Symbol, Object] The alignment value ('superscript', 'subscript', 'baseline', :superscript, :subscript).
238
- # @return [String, self, nil]
230
+ # Gets the vertical alignment of the font.
231
+ # @return [String, nil]
239
232
  # @api public
240
- # : (?untyped value) -> (String | self | nil)
241
- def vert_align: (?untyped value) -> (String | self | nil)
233
+ # : () -> String?
234
+ def vert_align: () -> String?
242
235
 
243
- def vert_align=: (untyped value) -> untyped
236
+ # Sets the vertical alignment of the font.
237
+ # @param val [String, Symbol]
238
+ # @return [Object]
239
+ # @api public
240
+ # : (untyped val) -> untyped
241
+ def vert_align=: (untyped val) -> untyped
244
242
 
245
243
  # Sets the font to superscript.
246
- # @param value [Boolean] Whether to apply superscript.
247
- # @return [self]
244
+ # @param val [Boolean]
245
+ # @return [Boolean]
248
246
  # @api public
249
- # : (?untyped) -> (self | bool)
250
- def superscript: (?untyped) -> (self | bool)
251
-
252
- def superscript=: (untyped value) -> untyped
247
+ # : (untyped val) -> untyped
248
+ def superscript=: (untyped val) -> untyped
253
249
 
254
- def superscript?: () -> untyped
250
+ # Returns whether superscript is enabled.
251
+ # @return [Boolean]
252
+ # @api public
253
+ # : () -> bool
254
+ def superscript?: () -> bool
255
255
 
256
256
  # Sets the font to subscript.
257
- # @param value [Boolean] Whether to apply subscript.
258
- # @return [self]
257
+ # @param val [Boolean]
258
+ # @return [Boolean]
259
259
  # @api public
260
- # : (?untyped) -> (self | bool)
261
- def subscript: (?untyped) -> (self | bool)
262
-
263
- def subscript=: (untyped value) -> untyped
260
+ # : (untyped val) -> untyped
261
+ def subscript=: (untyped val) -> untyped
264
262
 
265
- def subscript?: () -> untyped
266
-
267
- # Sets the fill pattern.
268
- # @param pattern [String, Symbol] The pattern type.
269
- # @param fg_color [String, Symbol, nil] The foreground color.
270
- # @param bg_color [String, Symbol, nil] The background color.
271
- # @return [self]
263
+ # Returns whether subscript is enabled.
264
+ # @return [Boolean]
272
265
  # @api public
273
- # Configures fill properties.
274
- # @param pattern [String, Symbol] The pattern type.
266
+ # : () -> bool
267
+ def subscript?: () -> bool
268
+
269
+ # Sets or gets the fill pattern.
270
+ # @param pattern [String, Symbol, nil] The pattern type.
275
271
  # @param fg_color [String, Symbol, nil] The foreground color.
276
272
  # @param bg_color [String, Symbol, nil] The background color.
277
- # @return [self]
273
+ # @return [String, Symbol, void, nil]
278
274
  # @api public
279
- # : (?untyped pattern, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> untyped
280
- def fill_pattern: (?untyped pattern, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> untyped
275
+ # : () -> (String | Symbol | untyped)
276
+ # : (?untyped pattern, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
277
+ def fill_pattern: () -> (String | Symbol | untyped)
278
+ | (?untyped pattern, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
281
279
 
282
280
  # Sets the fill pattern.
283
281
  # @param pattern [String, Symbol, Hash]
@@ -286,12 +284,11 @@ module Xlsxrb
286
284
  # : (untyped pattern) -> untyped
287
285
  def fill_pattern=: (untyped pattern) -> untyped
288
286
 
289
- # Gets or sets a solid fill color.
290
- # @param color [String, Symbol, Object] The color.
291
- # @return [String, Symbol, self, nil]
287
+ # Gets a solid fill color.
288
+ # @return [String, nil]
292
289
  # @api public
293
- # : (?untyped color) -> (String | Symbol | self | nil)
294
- def fill_color: (?untyped color) -> (String | Symbol | self | nil)
290
+ # : () -> String?
291
+ def fill_color: () -> String?
295
292
 
296
293
  # Sets a solid fill color.
297
294
  # @param color [String, Symbol]
@@ -300,73 +297,96 @@ module Xlsxrb
300
297
  # : (String | Symbol color) -> (String | Symbol)
301
298
  def fill_color=: (String | Symbol color) -> (String | Symbol)
302
299
 
303
- # : (?pattern: untyped, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> (self | Hash[Symbol, untyped])
304
- def fill: (?pattern: untyped, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> (self | Hash[Symbol, untyped])
300
+ # Configures fill properties or returns current fill properties.
301
+ # @param pattern [String, Symbol, nil]
302
+ # @param fg_color [String, Symbol, nil]
303
+ # @param bg_color [String, Symbol, nil]
304
+ # @return [Hash, void]
305
+ # @api public
306
+ # : () -> Hash[Symbol, untyped]
307
+ # : (?pattern: untyped, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
308
+ def fill: () -> Hash[Symbol, untyped]
309
+ | (?pattern: untyped, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
305
310
 
311
+ # Sets fill options.
312
+ # @param opts [Hash, Object]
313
+ # @return [Object]
314
+ # @api public
315
+ # : (untyped opts) -> untyped
306
316
  def fill=: (untyped opts) -> untyped
307
317
 
308
- # Sets a gradient fill.
309
- # @param type [String] The gradient type.
318
+ # Sets or gets a gradient fill.
319
+ # @param type [String, nil] The gradient type.
310
320
  # @param degree [Numeric, nil] The degree.
311
321
  # @param stops [Array] The gradient stops.
312
- # @return [self]
322
+ # @return [Hash, void, nil]
313
323
  # @api public
314
- # : (?type: untyped, ?degree: Numeric | nil, ?stops: Array[untyped]) -> (self | Hash[Symbol, untyped] | nil)
315
- def fill_gradient: (?type: untyped, ?degree: Numeric | nil, ?stops: Array[untyped]) -> (self | Hash[Symbol, untyped] | nil)
324
+ # : () -> Hash[Symbol, untyped]?
325
+ # : (?type: untyped, ?degree: Numeric | nil, ?stops: Array[untyped]) -> void
326
+ def fill_gradient: () -> Hash[Symbol, untyped]?
327
+ | (?type: untyped, ?degree: Numeric | nil, ?stops: Array[untyped]) -> void
316
328
 
317
- # Configures multiple border properties.
318
- # @param all [Hash, nil]
319
- # @param left [Hash, nil]
320
- # @param right [Hash, nil]
321
- # @param top [Hash, nil]
322
- # @param bottom [Hash, nil]
323
- # @param diagonal [Hash, nil]
324
- # @return [self]
329
+ # Configures multiple border properties or returns current border properties.
330
+ #
331
+ # @param all [Hash, nil] Border options for all sides.
332
+ # @param left [Hash, nil] Options for left border.
333
+ # @param right [Hash, nil] Options for right border.
334
+ # @param top [Hash, nil] Options for top border.
335
+ # @param bottom [Hash, nil] Options for bottom border.
336
+ # @param diagonal [Hash, nil] Options for diagonal border.
337
+ # @return [Hash, void]
338
+ # @api public
339
+ # : () -> Hash[Symbol, untyped]
340
+ # : (?all: Hash[Symbol, untyped]?, ?left: Hash[Symbol, untyped]?, ?right: Hash[Symbol, untyped]?, ?top: Hash[Symbol, untyped]?, ?bottom: Hash[Symbol, untyped]?, ?diagonal: Hash[Symbol, untyped]?) -> void
341
+ def border: () -> Hash[Symbol, untyped]
342
+ | (?all: Hash[Symbol, untyped]?, ?left: Hash[Symbol, untyped]?, ?right: Hash[Symbol, untyped]?, ?top: Hash[Symbol, untyped]?, ?bottom: Hash[Symbol, untyped]?, ?diagonal: Hash[Symbol, untyped]?) -> void
343
+
344
+ # Sets border options.
345
+ # @param opts [Hash]
346
+ # @return [Hash]
325
347
  # @api public
326
- # : (?all: Hash[Symbol, untyped]?, ?left: Hash[Symbol, untyped]?, ?right: Hash[Symbol, untyped]?, ?top: Hash[Symbol, untyped]?, ?bottom: Hash[Symbol, untyped]?, ?diagonal: Hash[Symbol, untyped]?) -> (self | Hash[Symbol, untyped])
327
- def border: (?all: Hash[Symbol, untyped]?, ?left: Hash[Symbol, untyped]?, ?right: Hash[Symbol, untyped]?, ?top: Hash[Symbol, untyped]?, ?bottom: Hash[Symbol, untyped]?, ?diagonal: Hash[Symbol, untyped]?) -> (self | Hash[Symbol, untyped])
328
-
329
- def border=: (untyped opts) -> untyped
348
+ # : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
349
+ def border=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
330
350
 
331
351
  # Sets all borders.
332
352
  # @param style [String, Symbol, Integer] The border style.
333
353
  # @param color [String, Symbol, nil] The color.
334
- # @return [self]
354
+ # @return [void]
335
355
  # @api public
336
- # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> self
337
- def border_all: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> self
356
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
357
+ def border_all: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
338
358
 
339
359
  # Sets the left border.
340
360
  # @param style [String, Symbol, Integer] The border style.
341
361
  # @param color [String, Symbol, nil] The color.
342
- # @return [self]
362
+ # @return [void]
343
363
  # @api public
344
- # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> self
345
- def border_left: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> self
364
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
365
+ def border_left: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
346
366
 
347
367
  # Sets the right border.
348
368
  # @param style [String, Symbol, Integer] The border style.
349
369
  # @param color [String, Symbol, nil] The color.
350
- # @return [self]
370
+ # @return [void]
351
371
  # @api public
352
- # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> self
353
- def border_right: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> self
372
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
373
+ def border_right: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
354
374
 
355
375
  # Sets the top border.
356
376
  # @param style [String, Symbol, Integer] The border style.
357
377
  # @param color [String, Symbol, nil] The color.
358
- # @return [self]
378
+ # @return [void]
359
379
  # @api public
360
- # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> self
361
- def border_top: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> self
380
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
381
+ def border_top: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
362
382
 
363
383
  # Sets the bottom border.
364
384
  # @param style [String, Symbol, Integer] The border style.
365
385
  # @param color [String, Symbol, nil] The color.
366
- # @return [self]
386
+ # @return [void]
367
387
  # @api public
368
- # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> self
369
- def border_bottom: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> self
388
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
389
+ def border_bottom: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
370
390
 
371
391
  # rubocop:disable Naming/MethodParameterName
372
392
  # Sets diagonal borders.
@@ -374,28 +394,30 @@ module Xlsxrb
374
394
  # @param color [String, Symbol, nil] The color.
375
395
  # @param up [Boolean] Diagonal up.
376
396
  # @param down [Boolean] Diagonal down.
377
- # @return [self]
397
+ # @return [void]
378
398
  # @api public
379
- # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil, ?up: bool, ?down: bool) -> self
380
- def border_diagonal: (?style: String | Symbol | Integer, ?color: String | Symbol | nil, ?up: bool, ?down: bool) -> self
399
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil, ?up: bool, ?down: bool) -> void
400
+ def border_diagonal: (?style: String | Symbol | Integer, ?color: String | Symbol | nil, ?up: bool, ?down: bool) -> void
381
401
 
382
402
  # Configures or returns alignment properties.
383
403
  # When called with 0 arguments/keywords, returns the current alignment Hash.
384
- # When called with keyword arguments, merges the properties and returns self.
404
+ # When called with keyword arguments, merges the properties and returns nil.
385
405
  #
386
- # @param horizontal [String, Symbol, nil]
387
- # @param vertical [String, Symbol, nil]
388
- # @param wrap_text [Boolean, nil]
389
- # @param text_rotation [Integer, nil]
390
- # @param indent [Integer, nil]
391
- # @param shrink_to_fit [Boolean, nil]
392
- # @param reading_order [Integer, nil]
393
- # @param justify_last_line [Boolean, nil]
394
- # @param relative_indent [Integer, nil]
395
- # @return [Hash, self]
396
- # @api public
397
- # : (?horizontal: (String | Symbol)?, ?vertical: (String | Symbol)?, ?wrap_text: bool?, ?text_rotation: Integer?, ?indent: Integer?, ?shrink_to_fit: bool?, ?reading_order: Integer?, ?justify_last_line: bool?, ?relative_indent: Integer?) -> (Hash[Symbol, untyped] | self)
398
- def alignment: (?horizontal: (String | Symbol)?, ?vertical: (String | Symbol)?, ?wrap_text: bool?, ?text_rotation: Integer?, ?indent: Integer?, ?shrink_to_fit: bool?, ?reading_order: Integer?, ?justify_last_line: bool?, ?relative_indent: Integer?) -> (Hash[Symbol, untyped] | self)
406
+ # @param horizontal [String, Symbol, nil] Horizontal alignment (:left, :center, :right, :fill, :justify, etc.).
407
+ # @param vertical [String, Symbol, nil] Vertical alignment (:top, :center, :bottom, :justify, :distributed).
408
+ # @param wrap_text [Boolean, nil] Whether to wrap text within the cell.
409
+ # @param text_rotation [Integer, nil] Text rotation in degrees (0-180 or 255 for vertical).
410
+ # @param indent [Integer, nil] Indentation level (0-250).
411
+ # @param shrink_to_fit [Boolean, nil] Whether to shrink text to fit cell width.
412
+ # @param reading_order [Integer, nil] Reading order (0: context, 1: left-to-right, 2: right-to-left).
413
+ # @param justify_last_line [Boolean, nil] Whether to justify the last line of text.
414
+ # @param relative_indent [Integer, nil] Relative indentation level.
415
+ # @return [Hash, void]
416
+ # @api public
417
+ # : () -> Hash[Symbol, untyped]
418
+ # : (?horizontal: (String | Symbol)?, ?vertical: (String | Symbol)?, ?wrap_text: bool?, ?text_rotation: Integer?, ?indent: Integer?, ?shrink_to_fit: bool?, ?reading_order: Integer?, ?justify_last_line: bool?, ?relative_indent: Integer?) -> void
419
+ def alignment: () -> Hash[Symbol, untyped]
420
+ | (?horizontal: (String | Symbol)?, ?vertical: (String | Symbol)?, ?wrap_text: bool?, ?text_rotation: Integer?, ?indent: Integer?, ?shrink_to_fit: bool?, ?reading_order: Integer?, ?justify_last_line: bool?, ?relative_indent: Integer?) -> void
399
421
 
400
422
  # Sets alignment options.
401
423
  #
@@ -405,12 +427,11 @@ module Xlsxrb
405
427
  # : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
406
428
  def alignment=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
407
429
 
408
- # Gets or sets horizontal alignment.
409
- # @param value [String, Symbol, Object] The alignment.
410
- # @return [String, Symbol, self, nil]
430
+ # Gets horizontal alignment.
431
+ # @return [String, Symbol, nil]
411
432
  # @api public
412
- # : (?untyped value) -> (String | Symbol | self | nil)
413
- def align_horizontal: (?untyped value) -> (String | Symbol | self | nil)
433
+ # : () -> (String | Symbol | nil)
434
+ def align_horizontal: () -> (String | Symbol | nil)
414
435
 
415
436
  # Sets horizontal alignment.
416
437
  # @param value [String, Symbol]
@@ -419,12 +440,11 @@ module Xlsxrb
419
440
  # : (String | Symbol value) -> (String | Symbol)
420
441
  def align_horizontal=: (String | Symbol value) -> (String | Symbol)
421
442
 
422
- # Gets or sets vertical alignment.
423
- # @param value [String, Symbol, Object] The alignment.
424
- # @return [String, Symbol, self, nil]
443
+ # Gets vertical alignment.
444
+ # @return [String, Symbol, nil]
425
445
  # @api public
426
- # : (?untyped value) -> (String | Symbol | self | nil)
427
- def align_vertical: (?untyped value) -> (String | Symbol | self | nil)
446
+ # : () -> (String | Symbol | nil)
447
+ def align_vertical: () -> (String | Symbol | nil)
428
448
 
429
449
  # Sets vertical alignment.
430
450
  # @param value [String, Symbol]
@@ -433,13 +453,6 @@ module Xlsxrb
433
453
  # : (String | Symbol value) -> (String | Symbol)
434
454
  def align_vertical=: (String | Symbol value) -> (String | Symbol)
435
455
 
436
- # Sets text wrapping.
437
- # @param value [Boolean] Whether to wrap text.
438
- # @return [self]
439
- # @api public
440
- # : (?untyped) -> (self | bool)
441
- def wrap_text: (?untyped) -> (self | bool)
442
-
443
456
  # Sets text wrapping.
444
457
  # @param value [Boolean]
445
458
  # @return [Boolean]
@@ -453,13 +466,6 @@ module Xlsxrb
453
466
  # : () -> bool
454
467
  def wrap_text?: () -> bool
455
468
 
456
- # Sets shrink to fit.
457
- # @param value [Boolean] Whether to shrink text.
458
- # @return [self]
459
- # @api public
460
- # : (?untyped) -> (self | bool)
461
- def shrink_to_fit: (?untyped) -> (self | bool)
462
-
463
469
  # Sets shrink to fit.
464
470
  # @param value [Boolean]
465
471
  # @return [Boolean]
@@ -473,12 +479,11 @@ module Xlsxrb
473
479
  # : () -> bool
474
480
  def shrink_to_fit?: () -> bool
475
481
 
476
- # Gets or sets text rotation.
477
- # @param value [Numeric, Object] The rotation angle.
478
- # @return [Numeric, self, nil]
482
+ # Gets text rotation.
483
+ # @return [Numeric, nil]
479
484
  # @api public
480
- # : (?untyped value) -> (Numeric | self | nil)
481
- def text_rotation: (?untyped value) -> (Numeric | self | nil)
485
+ # : () -> (Numeric | nil)
486
+ def text_rotation: () -> (Numeric | nil)
482
487
 
483
488
  # Sets text rotation.
484
489
  # @param value [Numeric]
@@ -487,12 +492,11 @@ module Xlsxrb
487
492
  # : (Numeric value) -> Numeric
488
493
  def text_rotation=: (Numeric value) -> Numeric
489
494
 
490
- # Gets or sets text indent.
491
- # @param value [Numeric, Object] The indent level.
492
- # @return [Numeric, self, nil]
495
+ # Gets text indent.
496
+ # @return [Integer, nil]
493
497
  # @api public
494
- # : (?untyped value) -> (Numeric | self | nil)
495
- def indent: (?untyped value) -> (Numeric | self | nil)
498
+ # : () -> (Integer | nil)
499
+ def indent: () -> (Integer | nil)
496
500
 
497
501
  # Sets text indent.
498
502
  # @param value [Numeric]
@@ -503,14 +507,16 @@ module Xlsxrb
503
507
 
504
508
  # Configures or returns cell protection properties.
505
509
  # When called with 0 arguments/keywords, returns the current protection Hash.
506
- # When called with keyword arguments, merges the properties and returns self.
510
+ # When called with keyword arguments, merges the properties and returns nil.
507
511
  #
508
512
  # @param locked [Boolean, nil]
509
513
  # @param hidden [Boolean, nil]
510
- # @return [Hash, self]
514
+ # @return [Hash, void]
511
515
  # @api public
512
- # : (?locked: bool?, ?hidden: bool?) -> (Hash[Symbol, untyped] | self)
513
- def protection: (?locked: bool?, ?hidden: bool?) -> (Hash[Symbol, untyped] | self)
516
+ # : () -> Hash[Symbol, untyped]
517
+ # : (?locked: bool?, ?hidden: bool?) -> void
518
+ def protection: () -> Hash[Symbol, untyped]
519
+ | (?locked: bool?, ?hidden: bool?) -> void
514
520
 
515
521
  # Sets protection options.
516
522
  #
@@ -520,14 +526,6 @@ module Xlsxrb
520
526
  # : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
521
527
  def protection=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
522
528
 
523
- # Sets whether the cell is locked.
524
- #
525
- # @param value [Boolean]
526
- # @return [self]
527
- # @api public
528
- # : (?untyped value) -> (self | bool)
529
- def locked: (?untyped value) -> (self | bool)
530
-
531
529
  # Sets whether the cell is locked.
532
530
  #
533
531
  # @param value [Boolean]
@@ -542,14 +540,6 @@ module Xlsxrb
542
540
  # : () -> bool
543
541
  def locked?: () -> bool
544
542
 
545
- # Sets whether the cell formula is hidden.
546
- #
547
- # @param value [Boolean]
548
- # @return [self]
549
- # @api public
550
- # : (?untyped value) -> (self | bool)
551
- def hidden: (?untyped value) -> (self | bool)
552
-
553
543
  # Sets whether the cell formula is hidden.
554
544
  #
555
545
  # @param value [Boolean]
@@ -564,12 +554,11 @@ module Xlsxrb
564
554
  # : () -> bool
565
555
  def hidden?: () -> bool
566
556
 
567
- # Sets or gets the number format.
568
- # @param num_fmt_id [String, Integer, nil] The format id or format string.
569
- # @return [String, Integer, self, nil]
557
+ # Gets the number format.
558
+ # @return [String, Integer, nil]
570
559
  # @api public
571
- # : (?String | Integer | nil num_fmt_id) -> (String | Integer | self | nil)
572
- def number_format: (?String | Integer | nil num_fmt_id) -> (String | Integer | self | nil)
560
+ # : () -> (String | Integer | nil)
561
+ def number_format: () -> (String | Integer | nil)
573
562
 
574
563
  # Sets the number format.
575
564
  # @param num_fmt_id [String, Integer]
@@ -578,45 +567,281 @@ module Xlsxrb
578
567
  # : (String | Integer num_fmt_id) -> (String | Integer)
579
568
  def number_format=: (String | Integer num_fmt_id) -> (String | Integer)
580
569
 
581
- # Sets or gets the number format ID.
582
- # @deprecated Use {#number_format} instead. Will be removed in 0.2.0.
583
- # @param id [String, Integer, nil]
584
- # @return [String, Integer, self, nil]
585
- # @api public
586
- # : (?String | Integer | nil id) -> (String | Integer | self | nil)
587
- def number_format_id: (?String | Integer | nil id) -> (String | Integer | self | nil)
570
+ # Register this style with the given Writer, returning the style_id.
571
+ # writer:: Xlsxrb::Ooxml::Writer instance
572
+ # : (untyped writer) -> Integer
573
+ def register_with: (untyped writer) -> Integer
588
574
 
589
- # Sets the number format ID.
590
- # @deprecated Use {#number_format=} instead. Will be removed in 0.2.0.
591
- # @param id [String, Integer]
592
- # @return [String, Integer]
593
- # @api public
594
- # : (String | Integer id) -> (String | Integer)
595
- def number_format_id=: (String | Integer id) -> (String | Integer)
575
+ # Returns whether +other+ describes the same cell format, whatever the names.
576
+ #
577
+ # @param other [StyleBuilder]
578
+ # @return [Boolean]
579
+ # @api private
580
+ # : (StyleBuilder other) -> bool
581
+ def same_format?: (StyleBuilder other) -> bool
596
582
 
597
- # @deprecated Use {#number_format} instead. Will be removed in 0.2.0.
598
- # : (?String | Integer | nil num_fmt_id) -> (String | Integer | self | nil)
599
- def num_fmt: (?String | Integer | nil num_fmt_id) -> (String | Integer | self | nil)
583
+ # : () -> Array[untyped]
584
+ def format_signature: () -> Array[untyped]
600
585
 
601
- # @deprecated Use {#number_format=} instead. Will be removed in 0.2.0.
602
- # : (String | Integer num_fmt_id) -> (String | Integer)
603
- def num_fmt=: (String | Integer num_fmt_id) -> (String | Integer)
586
+ private
604
587
 
605
- # @deprecated Use {#number_format_id} instead. Will be removed in 0.2.0.
606
- # : (?String | Integer | nil id) -> (String | Integer | self | nil)
607
- def num_fmt_id: (?String | Integer | nil id) -> (String | Integer | self | nil)
588
+ # Raises ArgumentError for option keys #apply_options! does not know, and for a nested
589
+ # group (font:, fill:, ...) given together with its flat keys, which would be ignored.
590
+ # : (Hash[Symbol, untyped] opts) -> void
591
+ def check_options!: (Hash[Symbol, untyped] opts) -> void
608
592
 
609
- # @deprecated Use {#number_format_id=} instead. Will be removed in 0.2.0.
610
- # : (String | Integer id) -> (String | Integer)
611
- def num_fmt_id=: (String | Integer id) -> (String | Integer)
593
+ def unknown_option_message: (untyped key, untyped allowed, untyped kind) -> untyped
594
+
595
+ def resolve_color: (untyped color) -> untyped
596
+ end
597
+
598
+ # What +style+ returns in the 0.2 series, in place of the definition it records. It
599
+ # forwards every public method to that definition, so changes still reach it, and warns
600
+ # on first use at the caller's line.
601
+ #
602
+ # @deprecated Configure a style with options or in the block given to +style+. In version
603
+ # 0.3.0, +style+ will return nil (ADR 0010).
604
+ # @api public
605
+ class ReturnedStyleBuilder < StyleBuilder
606
+ DEPRECATION_MESSAGE: ::String
607
+
608
+ # @api private
609
+ # : (StyleBuilder definition) -> void
610
+ def initialize: (StyleBuilder definition) -> void
611
+
612
+ # : () -> (String | Symbol)?
613
+ def name: () -> (String | Symbol)?
614
+
615
+ # : () -> Hash[Symbol, untyped]
616
+ def font_props: () -> Hash[Symbol, untyped]
617
+
618
+ # : () -> Hash[Symbol, untyped]
619
+ def fill_props: () -> Hash[Symbol, untyped]
620
+
621
+ # : () -> Hash[Symbol, untyped]
622
+ def border_props: () -> Hash[Symbol, untyped]
623
+
624
+ # : (String name, String | Integer number_format) -> StyleBuilder
625
+ def with_number_format: (String name, String | Integer number_format) -> StyleBuilder
626
+
627
+ # : (**untyped) -> self
628
+ def apply_options!: (**untyped) -> self
629
+
630
+ # : (**untyped) -> void
631
+ def font: (**untyped) -> void
632
+
633
+ # : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
634
+ def font=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
635
+
636
+ # : (bool value) -> bool
637
+ def bold=: (bool value) -> bool
638
+
639
+ # : () -> bool
640
+ def bold?: () -> bool
641
+
642
+ # : (bool value) -> bool
643
+ def italic=: (bool value) -> bool
644
+
645
+ # : () -> bool
646
+ def italic?: () -> bool
647
+
648
+ # : () -> (Integer | Float | nil)
649
+ def font_size: () -> (Integer | Float | nil)
650
+
651
+ # : (Numeric size_value) -> Numeric
652
+ def font_size=: (Numeric size_value) -> Numeric
653
+
654
+ # : () -> String?
655
+ def font_name: () -> String?
656
+
657
+ # : (String name) -> String
658
+ def font_name=: (String name) -> String
659
+
660
+ # : () -> String?
661
+ def font_color: () -> String?
662
+
663
+ # : (String | Symbol color) -> (String | Symbol)
664
+ def font_color=: (String | Symbol color) -> (String | Symbol)
665
+
666
+ # : () -> (String | Symbol | bool | nil)
667
+ def underline: () -> (String | Symbol | bool | nil)
668
+
669
+ # : (String | Symbol | bool val) -> (String | Symbol | bool)
670
+ def underline=: (String | Symbol | bool val) -> (String | Symbol | bool)
671
+
672
+ # : () -> bool
673
+ def underline?: () -> bool
674
+
675
+ # : (bool value) -> bool
676
+ def strike=: (bool value) -> bool
677
+
678
+ # : () -> bool
679
+ def strike?: () -> bool
680
+
681
+ # : () -> String?
682
+ def vert_align: () -> String?
683
+
684
+ # : (untyped val) -> untyped
685
+ def vert_align=: (untyped val) -> untyped
686
+
687
+ # : (untyped val) -> untyped
688
+ def superscript=: (untyped val) -> untyped
689
+
690
+ # : () -> bool
691
+ def superscript?: () -> bool
692
+
693
+ # : (untyped val) -> untyped
694
+ def subscript=: (untyped val) -> untyped
695
+
696
+ # : () -> bool
697
+ def subscript?: () -> bool
698
+
699
+ # : (?untyped pattern, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
700
+ def fill_pattern: (?untyped pattern, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
701
+
702
+ # : (untyped pattern) -> untyped
703
+ def fill_pattern=: (untyped pattern) -> untyped
704
+
705
+ # : () -> String?
706
+ def fill_color: () -> String?
707
+
708
+ # : (String | Symbol color) -> (String | Symbol)
709
+ def fill_color=: (String | Symbol color) -> (String | Symbol)
710
+
711
+ # : (?pattern: untyped, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
712
+ def fill: (?pattern: untyped, ?fg_color: String | Symbol | nil, ?bg_color: String | Symbol | nil) -> void
713
+
714
+ # : (untyped opts) -> untyped
715
+ def fill=: (untyped opts) -> untyped
716
+
717
+ # : (?type: untyped, ?degree: Numeric | nil, ?stops: Array[untyped]) -> void
718
+ def fill_gradient: (?type: untyped, ?degree: Numeric | nil, ?stops: Array[untyped]) -> void
719
+
720
+ # : (?all: Hash[Symbol, untyped]?, ?left: Hash[Symbol, untyped]?, ?right: Hash[Symbol, untyped]?, ?top: Hash[Symbol, untyped]?, ?bottom: Hash[Symbol, untyped]?, ?diagonal: Hash[Symbol, untyped]?) -> void
721
+ def border: (?all: Hash[Symbol, untyped]?, ?left: Hash[Symbol, untyped]?, ?right: Hash[Symbol, untyped]?, ?top: Hash[Symbol, untyped]?, ?bottom: Hash[Symbol, untyped]?, ?diagonal: Hash[Symbol, untyped]?) -> void
722
+
723
+ # : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
724
+ def border=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
725
+
726
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
727
+ def border_all: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
728
+
729
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
730
+ def border_left: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
731
+
732
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
733
+ def border_right: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
734
+
735
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
736
+ def border_top: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
737
+
738
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
739
+ def border_bottom: (?style: String | Symbol | Integer, ?color: String | Symbol | nil) -> void
740
+
741
+ # : (?style: String | Symbol | Integer, ?color: String | Symbol | nil, ?up: bool, ?down: bool) -> void
742
+ def border_diagonal: (?style: String | Symbol | Integer, ?color: String | Symbol | nil, ?up: bool, ?down: bool) -> void
743
+
744
+ # : (?horizontal: (String | Symbol)?, ?vertical: (String | Symbol)?, ?wrap_text: bool?, ?text_rotation: Integer?, ?indent: Integer?, ?shrink_to_fit: bool?, ?reading_order: Integer?, ?justify_last_line: bool?, ?relative_indent: Integer?) -> void
745
+ def alignment: (?horizontal: (String | Symbol)?, ?vertical: (String | Symbol)?, ?wrap_text: bool?, ?text_rotation: Integer?, ?indent: Integer?, ?shrink_to_fit: bool?, ?reading_order: Integer?, ?justify_last_line: bool?, ?relative_indent: Integer?) -> void
746
+
747
+ # : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
748
+ def alignment=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
749
+
750
+ # : () -> (String | Symbol | nil)
751
+ def align_horizontal: () -> (String | Symbol | nil)
752
+
753
+ # : (String | Symbol value) -> (String | Symbol)
754
+ def align_horizontal=: (String | Symbol value) -> (String | Symbol)
755
+
756
+ # : () -> (String | Symbol | nil)
757
+ def align_vertical: () -> (String | Symbol | nil)
758
+
759
+ # : (String | Symbol value) -> (String | Symbol)
760
+ def align_vertical=: (String | Symbol value) -> (String | Symbol)
761
+
762
+ # : (bool value) -> bool
763
+ def wrap_text=: (bool value) -> bool
764
+
765
+ # : () -> bool
766
+ def wrap_text?: () -> bool
767
+
768
+ # : (bool value) -> bool
769
+ def shrink_to_fit=: (bool value) -> bool
770
+
771
+ # : () -> bool
772
+ def shrink_to_fit?: () -> bool
773
+
774
+ # : () -> (Numeric | nil)
775
+ def text_rotation: () -> (Numeric | nil)
776
+
777
+ # : (Numeric value) -> Numeric
778
+ def text_rotation=: (Numeric value) -> Numeric
779
+
780
+ # : () -> (Integer | nil)
781
+ def indent: () -> (Integer | nil)
782
+
783
+ # : (Numeric value) -> Numeric
784
+ def indent=: (Numeric value) -> Numeric
785
+
786
+ # : (?locked: bool?, ?hidden: bool?) -> void
787
+ def protection: (?locked: bool?, ?hidden: bool?) -> void
788
+
789
+ # : (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
790
+ def protection=: (Hash[Symbol, untyped] opts) -> Hash[Symbol, untyped]
791
+
792
+ # : (bool value) -> bool
793
+ def locked=: (bool value) -> bool
794
+
795
+ # : () -> bool
796
+ def locked?: () -> bool
797
+
798
+ # : (bool value) -> bool
799
+ def hidden=: (bool value) -> bool
800
+
801
+ # : () -> bool
802
+ def hidden?: () -> bool
803
+
804
+ # : () -> (String | Integer | nil)
805
+ def number_format: () -> (String | Integer | nil)
806
+
807
+ # : (String | Integer num_fmt_id) -> (String | Integer)
808
+ def number_format=: (String | Integer num_fmt_id) -> (String | Integer)
612
809
 
613
- # Register this style with the given Writer, returning the style_id.
614
- # writer:: Xlsxrb::Ooxml::Writer instance
615
810
  # : (untyped writer) -> Integer
616
811
  def register_with: (untyped writer) -> Integer
617
812
 
813
+ # : (StyleBuilder other) -> bool
814
+ def same_format?: (StyleBuilder other) -> bool
815
+
816
+ # Lets StyleBuilder#same_format? compare with the definition without a warning.
817
+ # : () -> Array[untyped]
818
+ def format_signature: () -> Array[untyped]
819
+
618
820
  private
619
821
 
620
- def resolve_color: (untyped color) -> untyped
822
+ # : () -> StyleBuilder
823
+ def definition_for_use: () -> StyleBuilder
824
+ end
825
+
826
+ # The order in which the styles of an {Xlsxrb.build} workbook are defined, shared by
827
+ # the workbook builder and its sheet builders. A row records the clock when it is
828
+ # added, so that it uses the definitions made before it, as a row written by
829
+ # {StreamWriter} does.
830
+ #
831
+ # @api private
832
+ class StyleLog
833
+ # Number of definitions so far.
834
+ # : Integer
835
+ attr_reader clock: untyped
836
+
837
+ # Each name's definitions, as [clock, builder] pairs in the order they were made.
838
+ # : Hash[String, Array[[Integer, StyleBuilder]]]
839
+ attr_reader definitions: untyped
840
+
841
+ # : () -> void
842
+ def initialize: () -> void
843
+
844
+ # : (String name, StyleBuilder builder) -> void
845
+ def record: (String name, StyleBuilder builder) -> void
621
846
  end
622
847
  end