xlsxrb 0.1.18 → 0.2.0

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 (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +163 -0
  3. data/README.md +34 -11
  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 +120 -67
  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 +43 -314
  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 +2 -2
  23. data/lib/xlsxrb/ooxml/workbook_parser.rb +0 -1
  24. data/lib/xlsxrb/ooxml/workbook_writer.rb +172 -93
  25. data/lib/xlsxrb/ooxml/worksheet_parser.rb +61 -29
  26. data/lib/xlsxrb/ooxml/worksheet_writer.rb +65 -47
  27. data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +28 -11
  28. data/lib/xlsxrb/ooxml/writer/features_xml.rb +53 -14
  29. data/lib/xlsxrb/ooxml/writer/styles_xml.rb +1 -1
  30. data/lib/xlsxrb/ooxml/writer.rb +105 -41
  31. data/lib/xlsxrb/ooxml/xml_parser.rb +78 -5
  32. data/lib/xlsxrb/ooxml/zip_reader.rb +65 -15
  33. data/lib/xlsxrb/ooxml/zip_writer.rb +119 -30
  34. data/lib/xlsxrb/stream_row.rb +12 -116
  35. data/lib/xlsxrb/stream_sheet.rb +14 -261
  36. data/lib/xlsxrb/stream_writer.rb +623 -1476
  37. data/lib/xlsxrb/style_builder.rb +376 -593
  38. data/lib/xlsxrb/version.rb +1 -1
  39. data/lib/xlsxrb/workbook_builder.rb +192 -226
  40. data/lib/xlsxrb/worksheet_builder.rb +456 -1324
  41. data/lib/xlsxrb.rb +266 -1083
  42. data/sig/generated/xlsxrb/chart_builder.rbs +202 -205
  43. data/sig/generated/xlsxrb/dsl_helpers.rbs +64 -16
  44. data/sig/generated/xlsxrb/elements/cell.rbs +12 -76
  45. data/sig/generated/xlsxrb/elements/column.rbs +0 -7
  46. data/sig/generated/xlsxrb/elements/coordinate_access.rbs +5 -41
  47. data/sig/generated/xlsxrb/elements/image.rbs +3 -29
  48. data/sig/generated/xlsxrb/elements/metadata.rbs +138 -151
  49. data/sig/generated/xlsxrb/elements/row.rbs +10 -53
  50. data/sig/generated/xlsxrb/elements/styles.rbs +1 -39
  51. data/sig/generated/xlsxrb/elements/workbook.rbs +14 -78
  52. data/sig/generated/xlsxrb/elements/worksheet.rbs +5 -121
  53. data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +0 -4
  54. data/sig/generated/xlsxrb/ooxml/reader.rbs +0 -3
  55. data/sig/generated/xlsxrb/ooxml/styles_parser.rbs +1 -1
  56. data/sig/generated/xlsxrb/ooxml/utils.rbs +3 -3
  57. data/sig/generated/xlsxrb/ooxml/workbook_writer.rbs +12 -0
  58. data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +16 -0
  59. data/sig/generated/xlsxrb/ooxml/worksheet_writer.rbs +5 -3
  60. data/sig/generated/xlsxrb/ooxml/writer/features_xml.rbs +7 -0
  61. data/sig/generated/xlsxrb/ooxml/writer.rbs +20 -14
  62. data/sig/generated/xlsxrb/ooxml/xml_parser.rbs +70 -0
  63. data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +22 -7
  64. data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +26 -1
  65. data/sig/generated/xlsxrb/stream_row.rbs +7 -42
  66. data/sig/generated/xlsxrb/stream_sheet.rbs +1 -158
  67. data/sig/generated/xlsxrb/stream_writer.rbs +457 -976
  68. data/sig/generated/xlsxrb/style_builder.rbs +206 -242
  69. data/sig/generated/xlsxrb/workbook_builder.rbs +84 -132
  70. data/sig/generated/xlsxrb/worksheet_builder.rbs +309 -685
  71. data/sig/generated/xlsxrb.rbs +43 -190
  72. data/sig/rexml.rbs +8 -0
  73. metadata +3 -5
  74. data/lib/xlsxrb/utils.rb +0 -251
  75. data/sig/generated/xlsxrb/utils.rbs +0 -200
@@ -222,9 +222,6 @@ module Xlsxrb
222
222
  # : (?String | Hash[Symbol, untyped]? name, ?Float | Integer | nil size, **untyped opts) -> void
223
223
  def default_font: (?String | Hash[Symbol, untyped]? name, ?Float | Integer | nil size, **untyped opts) -> void
224
224
 
225
- # @deprecated Use {#default_font} instead. Will be removed in 0.2.0.
226
- alias set_default_font default_font
227
-
228
225
  # Sets the indexed colors palette (array of ARGB hex strings, e.g. ["FF000000", "FFFFFFFF"]).
229
226
  # rubocop:disable Naming/AccessorMethodName
230
227
  # : (untyped colors) -> untyped
@@ -312,9 +309,9 @@ module Xlsxrb
312
309
  # : (?sheet: untyped?) -> untyped
313
310
  def sheet_view: (?sheet: untyped) -> untyped
314
311
 
315
- # Sets a freeze pane. row: rows to freeze from top, col: columns to freeze from left.
316
- # : (?row: ::Integer, ?col: ::Integer, ?sheet: untyped?) -> untyped
317
- def set_freeze_pane: (?row: untyped, ?col: untyped, ?sheet: untyped) -> untyped
312
+ # Sets a freeze pane. row: rows to freeze from top, column: columns to freeze from left.
313
+ # : (?row: ::Integer, ?col: ::Integer?, ?column: ::Integer?, ?sheet: untyped?) -> untyped
314
+ def set_freeze_pane: (?row: untyped, ?col: untyped, ?column: untyped, ?sheet: untyped) -> untyped
318
315
 
319
316
  # Sets a split pane (non-frozen). x_split/y_split are in 1/20th of a point (twips).
320
317
  # top_left_cell: the cell at top-left of the bottom-right pane.
@@ -607,8 +604,8 @@ module Xlsxrb
607
604
  def shapes: (?sheet: untyped) -> untyped
608
605
 
609
606
  # Adds a comment on a cell.
610
- # : (untyped cell_address, untyped text, ?author: ::String, ?sheet: untyped?, ?guid: untyped?, ?shape_id: untyped?) -> untyped
611
- def add_comment: (untyped cell_address, untyped text, ?author: untyped, ?sheet: untyped, ?guid: untyped, ?shape_id: untyped) -> untyped
607
+ # : (untyped cell_address, untyped text, ?author: ::String, ?sheet: untyped?, ?guid: untyped?, ?shape_id: untyped?, ?visible: bool, ?anchor: Array[Integer]?) -> untyped
608
+ def add_comment: (untyped cell_address, untyped text, ?author: untyped, ?sheet: untyped, ?guid: untyped, ?shape_id: untyped, ?visible: untyped, ?anchor: untyped) -> untyped
612
609
 
613
610
  # Returns comment definitions for the first (or given) sheet.
614
611
  # : (?sheet: untyped?) -> untyped
@@ -635,14 +632,23 @@ module Xlsxrb
635
632
  alias person_list persons
636
633
 
637
634
  # Adds a pivot table to the given sheet.
638
- # source_ref: data source range (e.g. "Sheet1!A1:C4").
639
- # row_fields: array of 0-based field indices for row axis.
640
- # data_fields: array of { fld:, name:, subtotal: } hashes.
641
- # col_fields: array of 0-based field indices for column axis.
635
+ # source_ref: data source range (e.g. "Sheet1!A1:C4"), or nil with source_name: for a table source.
636
+ # row_fields: array of 0-based field indices, or field names listed in field_names, for row axis.
637
+ # data_fields: array of { fld:, name:, subtotal: } hashes ({ field: } takes a field name or index
638
+ # in place of fld:), or field names.
639
+ # col_fields: array of 0-based field indices, or field names, for column axis.
642
640
  # field_names: array of field name strings (for cache definition).
643
641
  # items: hash mapping field index to array of item values.
644
- # : (untyped source_ref, row_fields: untyped, data_fields: untyped, ?col_fields: untyped, ?dest_ref: ::String, ?name: untyped?, ?field_names: untyped?, ?items: untyped?, ?sheet: untyped?, **untyped opts) -> untyped
645
- def add_pivot_table: (untyped source_ref, row_fields: untyped, data_fields: untyped, ?col_fields: untyped, ?dest_ref: untyped, ?name: untyped, ?field_names: untyped, ?items: untyped, ?sheet: untyped, **untyped opts) -> untyped
642
+ # : (untyped source_ref, row_fields: untyped, data_fields: untyped, ?col_fields: untyped, ?column_fields: untyped, ?dest_ref: untyped, ?destination: untyped, ?name: untyped?, ?field_names: untyped?, ?items: untyped?, ?sheet: untyped?, **untyped opts) -> untyped
643
+ def add_pivot_table: (untyped source_ref, row_fields: untyped, data_fields: untyped, ?col_fields: untyped, ?column_fields: untyped, ?dest_ref: untyped, ?destination: untyped, ?name: untyped, ?field_names: untyped, ?items: untyped, ?sheet: untyped, **untyped opts) -> untyped
644
+
645
+ # Resolves a pivot table field given as a 0-based index or as a name in field_names.
646
+ # : (untyped field, untyped field_names) -> Integer
647
+ def resolve_pivot_field: (untyped field, untyped field_names) -> untyped
648
+
649
+ # Normalizes a pivot table data field to a Hash with an Integer fld.
650
+ # : (untyped data_field, untyped field_names) -> Hash[Symbol, untyped]
651
+ def resolve_pivot_data_field: (untyped data_field, untyped field_names) -> untyped
646
652
 
647
653
  # Returns pivot table definitions for the first (or given) sheet.
648
654
  # : (?sheet: untyped?) -> untyped
@@ -8,6 +8,76 @@ module Xlsxrb
8
8
  # Parses XML string using SAX2, calling the given listener.
9
9
  def self.parse: (untyped xml_string, untyped listener) -> untyped
10
10
 
11
+ # Returns a SAX2 parser whose listeners receive attribute values with XML entities
12
+ # decoded. REXML's SAX2 parser decodes text but passes attribute values as written, so
13
+ # formatCode=""$"0" would otherwise arrive with the " references.
14
+ # : (String xml_string) -> REXML::Parsers::SAX2Parser
15
+ def self.sax2_parser: (String xml_string) -> REXML::Parsers::SAX2Parser
16
+
17
+ # SAX2 parser that wraps each listener in an AttributeDecoder.
18
+ class DecodingSAX2Parser < REXML::Parsers::SAX2Parser
19
+ # : (*untyped args) ?{ (*untyped) -> untyped } -> untyped
20
+ def listen: (*untyped args) ?{ (*untyped) -> untyped } -> untyped
21
+ end
22
+
23
+ # Forwards SAX2 events to a listener, decoding entity references in attribute values.
24
+ class AttributeDecoder
25
+ # : (untyped listener) -> void
26
+ def initialize: (untyped listener) -> void
27
+
28
+ # Plain methods rather than define_method blocks, which Ractors cannot share.
29
+ # : (*untyped args) -> untyped
30
+ def start_document: (*untyped args) -> untyped
31
+
32
+ # : (*untyped args) -> untyped
33
+ def end_document: (*untyped args) -> untyped
34
+
35
+ # : (*untyped args) -> untyped
36
+ def start_prefix_mapping: (*untyped args) -> untyped
37
+
38
+ # : (*untyped args) -> untyped
39
+ def end_prefix_mapping: (*untyped args) -> untyped
40
+
41
+ # : (*untyped args) -> untyped
42
+ def end_element: (*untyped args) -> untyped
43
+
44
+ # : (*untyped args) -> untyped
45
+ def characters: (*untyped args) -> untyped
46
+
47
+ # : (*untyped args) -> untyped
48
+ def processing_instruction: (*untyped args) -> untyped
49
+
50
+ # : (*untyped args) -> untyped
51
+ def doctype: (*untyped args) -> untyped
52
+
53
+ # : (*untyped args) -> untyped
54
+ def attlistdecl: (*untyped args) -> untyped
55
+
56
+ # : (*untyped args) -> untyped
57
+ def elementdecl: (*untyped args) -> untyped
58
+
59
+ # : (*untyped args) -> untyped
60
+ def entitydecl: (*untyped args) -> untyped
61
+
62
+ # : (*untyped args) -> untyped
63
+ def notationdecl: (*untyped args) -> untyped
64
+
65
+ # : (*untyped args) -> untyped
66
+ def cdata: (*untyped args) -> untyped
67
+
68
+ # : (*untyped args) -> untyped
69
+ def xmldecl: (*untyped args) -> untyped
70
+
71
+ # : (*untyped args) -> untyped
72
+ def comment: (*untyped args) -> untyped
73
+
74
+ # : (*untyped args) -> untyped
75
+ def progress: (*untyped args) -> untyped
76
+
77
+ # : (String? uri, String local_name, String qname, Hash[String, String] attributes) -> untyped
78
+ def start_element: (String? uri, String local_name, String qname, Hash[String, String] attributes) -> untyped
79
+ end
80
+
11
81
  # Base listener with unmapped-data collection support.
12
82
  class BaseListener
13
83
  include REXML::SAX2Listener
@@ -47,8 +47,10 @@ module Xlsxrb
47
47
  # : (?Integer? length) -> String?
48
48
  def read: (?Integer? length) -> String?
49
49
 
50
- # : (?Integer chunk_size) ?{ (String) -> void } -> (void | Enumerator[String, void])
51
- def each_chunk: (?untyped chunk_size) ?{ (?) -> untyped } -> untyped
50
+ # : (?Integer chunk_size) { (String) -> void } -> void
51
+ # : (?Integer chunk_size) -> Enumerator[String, void]
52
+ def each_chunk: (?Integer chunk_size) { (String) -> void } -> void
53
+ | (?Integer chunk_size) -> Enumerator[String, void]
52
54
 
53
55
  # : () -> void
54
56
  def close: () -> void
@@ -61,6 +63,9 @@ module Xlsxrb
61
63
 
62
64
  private
63
65
 
66
+ # Drops the consumed prefix of @buffer.
67
+ def compact_buffer: () -> untyped
68
+
64
69
  def fetch_chunk: (untyped chunk_size) -> untyped
65
70
 
66
71
  def check_bom_encoding!: () -> untyped
@@ -82,16 +87,20 @@ module Xlsxrb
82
87
  def read_entry: (String name) -> String?
83
88
 
84
89
  # Yields (entry_name, data_string) for each file in the archive.
85
- # : () ?{ (String, String?) -> void } -> (void | Enumerator[[String, String?], void])
86
- def each_entry: () ?{ (?) -> untyped } -> untyped
90
+ # : () { (String, String?) -> void } -> void
91
+ # : () -> Enumerator[[String, String?], void]
92
+ def each_entry: () { (String, String?) -> void } -> void
93
+ | () -> Enumerator[[ String, String? ], void]
87
94
 
88
95
  # Opens an EntryStreamIO for an entry by name.
89
96
  # : (String entry_name, ?encoding: (Encoding | String | false | nil)) -> EntryStreamIO
90
97
  def open_entry_io: (String entry_name, ?encoding: Encoding | String | false | nil) -> EntryStreamIO
91
98
 
92
99
  # Yields inflated binary chunks directly from the compressed stream.
93
- # : (String entry_name, ?chunk_size: Integer, ?encoding: (Encoding | String | false | nil)) ?{ (String) -> void } -> (void | Enumerator[String, void])
94
- def each_entry_chunk: (untyped entry_name, ?chunk_size: untyped, ?encoding: untyped) ?{ (?) -> untyped } -> untyped
100
+ # : (String entry_name, ?chunk_size: Integer, ?encoding: (Encoding | String | false | nil)) { (String) -> void } -> void
101
+ # : (String entry_name, ?chunk_size: Integer, ?encoding: (Encoding | String | false | nil)) -> Enumerator[String, void]
102
+ def each_entry_chunk: (String entry_name, ?chunk_size: Integer, ?encoding: Encoding | String | false | nil) { (String) -> void } -> void
103
+ | (String entry_name, ?chunk_size: Integer, ?encoding: Encoding | String | false | nil) -> Enumerator[String, void]
95
104
 
96
105
  # Returns true if the archive contains the specified entry.
97
106
  # : (String name) -> bool
@@ -125,7 +134,7 @@ module Xlsxrb
125
134
 
126
135
  def parse_catalog_from_local_headers: (untyped io) -> untyped
127
136
 
128
- def find_data_descriptor_stream: (untyped io, untyped method) -> untyped
137
+ def find_data_descriptor_stream: (untyped io, untyped method, ?zip64: untyped) -> untyped
129
138
 
130
139
  def decompress: (untyped raw, untyped method) -> untyped
131
140
 
@@ -139,6 +148,12 @@ module Xlsxrb
139
148
 
140
149
  def normalize_text_encoding: (untyped data) -> untyped
141
150
 
151
+ # Reads the entry count and central directory offset from the ZIP64 end of central
152
+ # directory record, located through the locator just before the end of central directory.
153
+ # Returns the given values unchanged when the archive has no ZIP64 record.
154
+ # : (untyped io, Integer eocd_pos, Integer total_entries, Integer cd_offset) -> [Integer, Integer]
155
+ def read_zip64_end_of_central_directory: (untyped io, Integer eocd_pos, Integer total_entries, Integer cd_offset) -> [ Integer, Integer ]
156
+
142
157
  # : (String extra_data, Integer usize, Integer csize, Integer offset) -> [Integer, Integer, Integer]
143
158
  def parse_zip64_extra: (String extra_data, Integer usize, Integer csize, Integer offset) -> [ Integer, Integer, Integer ]
144
159
  end
@@ -4,7 +4,21 @@ module Xlsxrb
4
4
  module Ooxml
5
5
  # Writes ZIP archives using only stdlib (zlib).
6
6
  # Supports streaming: entries are written sequentially, central directory at close.
7
+ #
8
+ # Sizes, offsets, and entry counts that do not fit the 32-bit (16-bit for counts)
9
+ # fields switch to ZIP64 records for that value only, so archives below those
10
+ # limits are written exactly as plain ZIP.
7
11
  class ZipWriter
12
+ MAX_UINT32: ::Integer
13
+
14
+ MAX_UINT16: ::Integer
15
+
16
+ VERSION_DEFAULT: ::Integer
17
+
18
+ VERSION_ZIP64: ::Integer
19
+
20
+ DATA_DESCRIPTOR_FLAG: ::Integer
21
+
8
22
  def self.open: (untyped target, ?compression_level: untyped) ?{ (?) -> untyped } -> untyped
9
23
 
10
24
  # @return [Integer] Deflate compression level (0..9).
@@ -12,6 +26,7 @@ module Xlsxrb
12
26
 
13
27
  # @param io [IO, StringIO] Destination IO stream.
14
28
  # @param compression_level [Integer, nil] ZIP deflate compression level (0..9, or Zlib::DEFAULT_COMPRESSION).
29
+ # nil selects {Xlsxrb::DEFAULT_COMPRESSION_LEVEL}.
15
30
  # : (untyped io, ?compression_level: Integer | nil) -> void
16
31
  def initialize: (untyped io, ?compression_level: Integer | nil) -> void
17
32
 
@@ -39,13 +54,23 @@ module Xlsxrb
39
54
 
40
55
  def determine_seekable: () -> untyped
41
56
 
57
+ # : (Integer value) -> bool
58
+ def zip64?: (Integer value) -> bool
59
+
60
+ # : () { () -> void } -> void
61
+ def patch_local_header: () { () -> void } -> void
62
+
63
+ # Data descriptor: signature + crc32 + compressed size + uncompressed size.
64
+ # ZIP64 entries store both sizes as 8-byte values (APPNOTE 4.3.9.1).
65
+ def write_data_descriptor: (untyped crc, untyped compressed_size, untyped uncompressed_size, zip64: untyped) -> untyped
66
+
42
67
  def write_bytes: (untyped data) -> untyped
43
68
 
44
69
  def write_raw_entry: (untyped path, untyped content_bytes) -> untyped
45
70
 
46
71
  def deflate: (untyped content) -> untyped
47
72
 
48
- def write_local_header: (untyped path, untyped crc, untyped compressed_size, untyped uncompressed_size, ?gp_flag: untyped, ?count_bytes: untyped, ?method: untyped) -> untyped
73
+ def write_local_header: (untyped path, untyped crc, untyped compressed_size, untyped uncompressed_size, ?gp_flag: untyped, ?count_bytes: untyped, ?method: untyped, ?version: untyped) -> untyped
49
74
 
50
75
  def write_central_directory: () -> untyped
51
76
 
@@ -27,22 +27,6 @@ module Xlsxrb
27
27
  # : Integer?
28
28
  attr_reader style_index: untyped
29
29
 
30
- # @deprecated Use {#hidden?} instead. Will be removed in 0.2.0.
31
- # : () -> bool
32
- def hidden: () -> bool
33
-
34
- # @deprecated Use {#collapsed?} instead. Will be removed in 0.2.0.
35
- # : () -> bool
36
- def collapsed: () -> bool
37
-
38
- # @deprecated Use {#custom_height?} instead. Will be removed in 0.2.0.
39
- # : () -> bool
40
- def custom_height: () -> bool
41
-
42
- # @deprecated Use {#pad_empty_cells?} instead. Will be removed in 0.2.0.
43
- # : () -> bool
44
- def pad_empty_cells: () -> bool
45
-
46
30
  # @param index [Integer] 0-based row index.
47
31
  # @param xml_bytes [String] Raw ASCII-8BIT XML bytes.
48
32
  # @param from [Integer] Byte offset where cells start.
@@ -151,13 +135,15 @@ module Xlsxrb
151
135
  # : () -> Array[Elements::Cell]
152
136
  def cells: () -> Array[Elements::Cell]
153
137
 
154
- # Access a cell by 0-based column index, column letter, or access row attributes via Symbol.
138
+ # Access a cell by 0-based column index, column letter/Symbol, or column range.
155
139
  #
156
- # @param col_index [Integer, String, Symbol] Column index, column letter, or attribute symbol.
157
- # @return [Elements::Cell, Object, nil]
140
+ # @param col_index_or_range [Integer, String, Symbol, Range<Integer>] Column index, column letter/Symbol, or column index range.
141
+ # @return [Elements::Cell, Array<Elements::Cell>, nil]
158
142
  # @api public
159
- # : (Integer | String | Symbol col_index) -> untyped
160
- def []: (Integer | String | Symbol col_index) -> untyped
143
+ # : (Integer | String | Symbol col_index_or_range) -> Elements::Cell?
144
+ # : (Range[Integer] col_index_or_range) -> Array[Elements::Cell]
145
+ def []: (Integer | String | Symbol col_index_or_range) -> Elements::Cell?
146
+ | (Range[Integer] col_index_or_range) -> Array[Elements::Cell]
161
147
 
162
148
  # Access a cell by 0-based column index or column letter/Symbol.
163
149
  #
@@ -167,23 +153,6 @@ module Xlsxrb
167
153
  # : (Integer | String | Symbol col_index) -> Elements::Cell?
168
154
  def cell_at: (Integer | String | Symbol col_index) -> Elements::Cell?
169
155
 
170
- # Convert row cells to a coordinate-keyed Hash (e.g. {"A1" => "value", "B1" => 123}).
171
- #
172
- # @deprecated Use {#values} or {#cells} instead. Will be removed in 0.2.0.
173
- # @param type_cast [Boolean] Whether to coerce date/time serial numbers into Date/Time instances.
174
- # @return [Hash{String => Object}]
175
- # @api public
176
- # : (?type_cast: bool) -> Hash[String, untyped]
177
- def to_h: (?type_cast: bool) -> Hash[String, untyped]
178
-
179
- # Convert row cells to an Array of raw values (sparse columns get nil).
180
- #
181
- # @deprecated Use {#values} to get an Array of cell values, or {#cells} for Cell objects. In 0.2.0, {#to_a} will conform to Enumerable#to_a and return Array<Cell>.
182
- # @return [Array<Object>]
183
- # @api public
184
- # : () -> Array[untyped]
185
- def to_a: () -> Array[untyped]
186
-
187
156
  # Returns cell values as an Array (sparse columns get nil).
188
157
  #
189
158
  # @param type_cast [Boolean] Whether to coerce date/time serial numbers into Date/Time instances.
@@ -213,10 +182,6 @@ module Xlsxrb
213
182
  # : () -> Array[String?]
214
183
  def formula_expressions: () -> Array[String?]
215
184
 
216
- # @deprecated Use {#formula_expressions} instead. Will be removed in 0.2.0.
217
- # : () -> Array[String?]
218
- def formulas: () -> Array[String?]
219
-
220
185
  # Returns whether the row is valid according to OOXML specifications.
221
186
  #
222
187
  # @return [Boolean]
@@ -70,10 +70,6 @@ module Xlsxrb
70
70
  # : () -> bool
71
71
  def trim_empty_rows?: () -> bool
72
72
 
73
- # @deprecated Use {#trim_empty_rows?} instead. Will be removed in 0.2.0.
74
- # : () -> bool
75
- def trim_empty_rows: () -> bool
76
-
77
73
  # Returns whether skipped rows are padded during iteration.
78
74
  #
79
75
  # @return [Boolean]
@@ -81,10 +77,6 @@ module Xlsxrb
81
77
  # : () -> bool
82
78
  def pad_empty_rows?: () -> bool
83
79
 
84
- # @deprecated Use {#pad_empty_rows?} instead. Will be removed in 0.2.0.
85
- # : () -> bool
86
- def pad_empty_rows: () -> bool
87
-
88
80
  # Returns whether missing cells within rows are padded during iteration.
89
81
  #
90
82
  # @return [Boolean]
@@ -92,10 +84,6 @@ module Xlsxrb
92
84
  # : () -> bool
93
85
  def pad_empty_cells?: () -> bool
94
86
 
95
- # @deprecated Use {#pad_empty_cells?} instead. Will be removed in 0.2.0.
96
- # : () -> bool
97
- def pad_empty_cells: () -> bool
98
-
99
87
  # Returns the dimension reference string (e.g. "A1:Z50000"), or nil if not present.
100
88
  #
101
89
  # @return [String, nil]
@@ -103,58 +91,6 @@ module Xlsxrb
103
91
  # : () -> String?
104
92
  def dimension: () -> String?
105
93
 
106
- # Returns the 1-based index of the first row defined in the sheet dimension, or nil.
107
- #
108
- # @deprecated Returning an Integer row number is deprecated and will be removed in 0.2.0. Use {#row_range} or {#dimension_bounds} for row boundaries.
109
- # @return [Integer, nil]
110
- # @api public
111
- # : () -> Integer?
112
- def first_row: () -> Integer?
113
-
114
- # Returns the 0-based index of the first column defined in the sheet dimension, or nil.
115
- #
116
- # @return [Integer, nil]
117
- # @api public
118
- # : () -> Integer?
119
- def first_column_index: () -> Integer?
120
-
121
- # Returns the 1-based index of the first column defined in the sheet dimension, or nil.
122
- #
123
- # @deprecated Use 0-based {#first_column_index} instead. Will be removed in 0.2.0.
124
- # @return [Integer, nil]
125
- # @api public
126
- # : () -> Integer?
127
- def first_column: () -> Integer?
128
-
129
- # @deprecated Use {#first_column_index} instead. Will be removed in 0.2.0.
130
- alias first_col first_column
131
-
132
- # Returns the 1-based index of the last row defined in the sheet dimension, or nil.
133
- #
134
- # @deprecated Returning an Integer row number is deprecated and will be removed in 0.2.0. Use {#row_range} or {#dimension_bounds} for row boundaries.
135
- # @return [Integer, nil]
136
- # @api public
137
- # : () -> Integer?
138
- def last_row: () -> Integer?
139
-
140
- # Returns the 0-based index of the last column defined in the sheet dimension, or nil.
141
- #
142
- # @return [Integer, nil]
143
- # @api public
144
- # : () -> Integer?
145
- def last_column_index: () -> Integer?
146
-
147
- # Returns the 1-based index of the last column defined in the sheet dimension, or nil.
148
- #
149
- # @deprecated Use 0-based {#last_column_index} instead. Will be removed in 0.2.0.
150
- # @return [Integer, nil]
151
- # @api public
152
- # : () -> Integer?
153
- def last_column: () -> Integer?
154
-
155
- # @deprecated Use {#last_column_index} instead. Will be removed in 0.2.0.
156
- alias last_col last_column
157
-
158
94
  # Returns the 0-based range of rows defined in the sheet dimension, or nil.
159
95
  #
160
96
  # @example
@@ -291,18 +227,13 @@ module Xlsxrb
291
227
  | (?trim_empty_rows: bool?, ?pad_empty_rows: bool?, ?pad_empty_cells: bool?) -> Enumerator[StreamRow | Elements::Row, void]
292
228
 
293
229
  # Loads this sheet completely into an in-memory {Elements::Worksheet},
294
- # enabling coordinate random access (`sheet["A1"]`), row lookups (`row_at`),
295
- # and immutable cell updates (`update_cell`).
230
+ # enabling coordinate random access (`sheet["A1"]`) and row lookups (`row_at`).
296
231
  #
297
232
  # @return [Elements::Worksheet] The fully parsed in-memory worksheet.
298
233
  # @api public
299
234
  # : () -> Elements::Worksheet
300
235
  def load: () -> Elements::Worksheet
301
236
 
302
- # @deprecated Use {Xlsxrb.load} instead. Will be removed in 0.2.0.
303
- # : () -> Elements::Worksheet
304
- def to_worksheet: () -> Elements::Worksheet
305
-
306
237
  # Returns hyperlinks configured for this worksheet as a Hash of cell references to {Elements::Hyperlink} objects.
307
238
  #
308
239
  # @return [Hash<String, Elements::Hyperlink>]
@@ -390,38 +321,6 @@ module Xlsxrb
390
321
  # : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Array[Elements::Image]
391
322
  def images_at: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Array[Elements::Image]
392
323
 
393
- # Loads and returns images for this worksheet, optionally yielding self for block syntax.
394
- #
395
- # @deprecated Access {#images} directly. Lazy-loading is automatic. Will be removed in 0.2.0.
396
- # @yield [sheet]
397
- # @yieldparam sheet [StreamSheet]
398
- # @return [StreamSheet, void]
399
- # @api public
400
- # : () { (StreamSheet) -> void } -> void
401
- # : () -> StreamSheet
402
- def with_images: () { (StreamSheet) -> void } -> void
403
- | () -> StreamSheet
404
-
405
- # Access a cell by reference or 0-based coordinates.
406
- #
407
- # @deprecated Use `ws = Xlsxrb.load(source)` to materialize an {Elements::Worksheet} and use {Elements::CoordinateAccess#[]} (e.g. ws["A1"] or ws[0, 0]). Will be removed in 0.2.0.
408
- # @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
409
- # @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter.
410
- # @return [Elements::Cell, nil]
411
- # @api public
412
- # : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Cell?
413
- def cell: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> Elements::Cell?
414
-
415
- # Returns the formatted string representation of a cell's value.
416
- #
417
- # @deprecated Use `ws = Xlsxrb.load(source)` to materialize an {Elements::Worksheet} and access `ws["A1"].formatted_value`. Will be removed in 0.2.0.
418
- # @param ref_or_row [String, Symbol, Integer] Cell reference (e.g. "A1") or 0-based row index.
419
- # @param col [Integer, String, Symbol, nil] Optional 0-based column index or column letter.
420
- # @return [String, nil]
421
- # @api public
422
- # : (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> String?
423
- def formatted_value: (String | Symbol | Integer ref_or_row, ?Integer | String | Symbol | nil col) -> String?
424
-
425
324
  # Returns merged cell ranges (e.g. ["A1:B2"]) for this worksheet.
426
325
  #
427
326
  # @return [Array<String>]
@@ -459,9 +358,6 @@ module Xlsxrb
459
358
  # : () -> Array[Elements::ConditionalFormat]
460
359
  def conditional_formats: () -> Array[Elements::ConditionalFormat]
461
360
 
462
- # @deprecated Use {#conditional_formats} instead. Matches the ECMA-376 XML element name (<conditionalFormatting>), but {#conditional_formats} is canonical in xlsxrb. Will be removed in version 0.2.0.
463
- alias conditional_formatting conditional_formats
464
-
465
361
  # Returns tables defined in this worksheet.
466
362
  #
467
363
  # @return [Array<Elements::Table>]
@@ -504,13 +400,6 @@ module Xlsxrb
504
400
  # : () -> Elements::SheetView
505
401
  def sheet_view: () -> Elements::SheetView
506
402
 
507
- # Returns sheet views for this worksheet.
508
- #
509
- # @return [Array<Elements::SheetView>]
510
- # @api public
511
- # : () -> Array[Elements::SheetView]
512
- def sheet_views: () -> Array[Elements::SheetView]
513
-
514
403
  # Returns sort state configuration for this worksheet, or nil if none.
515
404
  #
516
405
  # @return [Elements::SortState, nil]
@@ -553,10 +442,6 @@ module Xlsxrb
553
442
  # : () -> bool
554
443
  def fit_to_page?: () -> bool
555
444
 
556
- # @deprecated Use {#fit_to_page?} instead. Will be removed in 0.2.0.
557
- # : () -> bool
558
- def fit_to_page: () -> bool
559
-
560
445
  # Returns whether full calculation on load is enabled on this worksheet.
561
446
  #
562
447
  # @return [Boolean]
@@ -564,10 +449,6 @@ module Xlsxrb
564
449
  # : () -> bool
565
450
  def full_calc_on_load?: () -> bool
566
451
 
567
- # @deprecated Use {#full_calc_on_load?} instead. Will be removed in 0.2.0.
568
- # : () -> bool
569
- def full_calc_on_load: () -> bool
570
-
571
452
  # Returns sheet calculation properties (<sheetCalcPr>), or nil if not present.
572
453
  #
573
454
  # @return [Elements::SheetCalcProperties, nil]
@@ -575,14 +456,6 @@ module Xlsxrb
575
456
  # : () -> Elements::SheetCalcProperties?
576
457
  def sheet_calc_properties: () -> Elements::SheetCalcProperties?
577
458
 
578
- # @deprecated Use {#sheet_calc_properties} instead. Will be removed in 0.2.0.
579
- # : () -> Elements::SheetCalcProperties?
580
- def sheet_calc_pr: () -> Elements::SheetCalcProperties?
581
-
582
- # @deprecated Use {#sheet_calc_properties} instead. Will be removed in 0.2.0.
583
- # : () -> Elements::SheetCalcProperties?
584
- def calc_pr: () -> Elements::SheetCalcProperties?
585
-
586
459
  # Returns the worksheet tab color specification, or nil if not set.
587
460
  #
588
461
  # @return [String, Hash, nil] RGB hex string (e.g. "FFFF0000") or color hash (e.g. { theme: 3, tint: -0.5 }).
@@ -597,9 +470,6 @@ module Xlsxrb
597
470
  # : () -> Hash[Symbol, untyped]
598
471
  def outline_properties: () -> Hash[Symbol, untyped]
599
472
 
600
- # @deprecated Use {#outline_properties} instead. Will be removed in 0.2.0.
601
- alias outline_pr outline_properties
602
-
603
473
  # Returns sheet format properties (defaultRowHeight, defaultColWidth, baseColWidth) for this worksheet.
604
474
  #
605
475
  # @return [Elements::SheetFormat]
@@ -649,10 +519,6 @@ module Xlsxrb
649
519
  # : () -> Array[Elements::PageBreak]
650
520
  def column_breaks: () -> Array[Elements::PageBreak]
651
521
 
652
- # @deprecated Use {#column_breaks} instead.
653
- # : () -> Array[Elements::PageBreak]
654
- def col_breaks: () -> Array[Elements::PageBreak]
655
-
656
522
  # Returns protected ranges defined for this worksheet.
657
523
  #
658
524
  # @return [Array<Elements::ProtectedRange>]
@@ -681,9 +547,6 @@ module Xlsxrb
681
547
  # : () -> Elements::PhoneticProperties?
682
548
  def phonetic_properties: () -> Elements::PhoneticProperties?
683
549
 
684
- # @deprecated Use {#phonetic_properties} instead. Will be removed in 0.2.0.
685
- alias phonetic_pr phonetic_properties
686
-
687
550
  # Returns the background image configured for this worksheet, or nil.
688
551
  #
689
552
  # @return [Elements::BackgroundImage, nil]
@@ -691,12 +554,6 @@ module Xlsxrb
691
554
  # : () -> Elements::BackgroundImage?
692
555
  def background_image: () -> Elements::BackgroundImage?
693
556
 
694
- # @deprecated Use {#background_image} instead. Will be removed in 0.2.0.
695
- alias background_picture background_image
696
-
697
- # @deprecated Use {#background_image} instead. Will be removed in 0.2.0.
698
- alias picture background_image
699
-
700
557
  # Closes any underlying reader resources.
701
558
  # : () -> void
702
559
  def close: () -> void
@@ -767,20 +624,6 @@ module Xlsxrb
767
624
  # : () -> Hash[Symbol, untyped]
768
625
  def unmapped_data: () -> Hash[Symbol, untyped]
769
626
 
770
- # Returns legacy drawing relationship info, or nil.
771
- #
772
- # @return [Hash[Symbol, untyped], nil]
773
- # @api public
774
- # : () -> Hash[Symbol, untyped]?
775
- def legacy_drawing: () -> Hash[Symbol, untyped]?
776
-
777
- # Returns extension list elements, or nil.
778
- #
779
- # @return [Array[untyped], nil]
780
- # @api public
781
- # : () -> Array[untyped]?
782
- def ext_lst: () -> Array[untyped]?
783
-
784
627
  # Returns header/footer images configured for this worksheet.
785
628
  #
786
629
  # @return [Array<Elements::HeaderFooterImage>]