xlsxrb 0.1.11 → 0.1.13

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 (186) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +86 -34
  3. data/README.md +26 -21
  4. data/lib/xlsxrb/chart_builder.rb +18 -18
  5. data/lib/xlsxrb/dsl_helpers.rb +175 -0
  6. data/lib/xlsxrb/elements/cell.rb +56 -22
  7. data/lib/xlsxrb/elements/column.rb +27 -3
  8. data/lib/xlsxrb/elements/row.rb +27 -8
  9. data/lib/xlsxrb/elements/workbook.rb +27 -14
  10. data/lib/xlsxrb/elements/worksheet.rb +17 -1
  11. data/lib/xlsxrb/ooxml/cfb.rb +9 -6
  12. data/lib/xlsxrb/ooxml/crypto/agile.rb +5 -5
  13. data/lib/xlsxrb/ooxml/reader/listeners/core_listeners.rb +784 -0
  14. data/lib/xlsxrb/ooxml/reader/listeners/drawing_listeners.rb +3478 -0
  15. data/lib/xlsxrb/ooxml/reader/listeners/feature_listeners.rb +1796 -0
  16. data/lib/xlsxrb/ooxml/reader/listeners/style_listeners.rb +428 -0
  17. data/lib/xlsxrb/ooxml/reader/listeners.rb +4 -6446
  18. data/lib/xlsxrb/ooxml/shared_strings_parser.rb +3 -5
  19. data/lib/xlsxrb/ooxml/utils.rb +5 -6
  20. data/lib/xlsxrb/ooxml/workbook_writer.rb +5 -7
  21. data/lib/xlsxrb/ooxml/worksheet_parser.rb +172 -9
  22. data/lib/xlsxrb/ooxml/writer/drawing_xml.rb +1602 -0
  23. data/lib/xlsxrb/ooxml/writer/features_xml.rb +731 -0
  24. data/lib/xlsxrb/ooxml/writer/styles_xml.rb +348 -0
  25. data/lib/xlsxrb/ooxml/writer.rb +9 -2646
  26. data/lib/xlsxrb/ooxml/xml_builder.rb +31 -2
  27. data/lib/xlsxrb/ooxml/zip_generator.rb +26 -5
  28. data/lib/xlsxrb/ooxml/zip_reader.rb +364 -78
  29. data/lib/xlsxrb/ooxml/zip_writer.rb +32 -5
  30. data/lib/xlsxrb/stream_sheet.rb +94 -6
  31. data/lib/xlsxrb/stream_writer.rb +48 -115
  32. data/lib/xlsxrb/style_builder.rb +10 -1
  33. data/lib/xlsxrb/version.rb +1 -1
  34. data/lib/xlsxrb/workbook_builder.rb +1 -1
  35. data/lib/xlsxrb/worksheet_builder.rb +19 -81
  36. data/lib/xlsxrb.rb +449 -171
  37. data/sig/generated/xlsxrb/chart_builder.rbs +36 -36
  38. data/sig/generated/xlsxrb/dsl_helpers.rbs +92 -0
  39. data/sig/generated/xlsxrb/elements/cell.rbs +29 -0
  40. data/sig/generated/xlsxrb/elements/column.rbs +32 -21
  41. data/sig/generated/xlsxrb/elements/row.rbs +94 -14
  42. data/sig/generated/xlsxrb/elements/workbook.rbs +102 -10
  43. data/sig/generated/xlsxrb/elements/worksheet.rbs +9 -0
  44. data/sig/generated/xlsxrb/ooxml/reader/listeners/core_listeners.rbs +173 -0
  45. data/sig/generated/xlsxrb/ooxml/reader/listeners/drawing_listeners.rbs +400 -0
  46. data/sig/generated/xlsxrb/ooxml/reader/listeners/feature_listeners.rbs +442 -0
  47. data/sig/generated/xlsxrb/ooxml/reader/listeners/style_listeners.rbs +80 -0
  48. data/sig/generated/xlsxrb/ooxml/reader/listeners.rbs +0 -1072
  49. data/sig/generated/xlsxrb/ooxml/shared_strings_parser.rbs +0 -2
  50. data/sig/generated/xlsxrb/ooxml/utils.rbs +2 -0
  51. data/sig/generated/xlsxrb/ooxml/worksheet_parser.rbs +5 -4
  52. data/sig/generated/xlsxrb/ooxml/writer/drawing_xml.rbs +79 -0
  53. data/sig/generated/xlsxrb/ooxml/writer/features_xml.rbs +83 -0
  54. data/sig/generated/xlsxrb/ooxml/writer/styles_xml.rbs +53 -0
  55. data/sig/generated/xlsxrb/ooxml/writer.rbs +6 -185
  56. data/sig/generated/xlsxrb/ooxml/xml_builder.rbs +18 -0
  57. data/sig/generated/xlsxrb/ooxml/zip_generator.rbs +15 -0
  58. data/sig/generated/xlsxrb/ooxml/zip_reader.rbs +96 -8
  59. data/sig/generated/xlsxrb/ooxml/zip_writer.rbs +5 -1
  60. data/sig/generated/xlsxrb/stream_sheet.rbs +43 -3
  61. data/sig/generated/xlsxrb/style_builder.rbs +7 -0
  62. data/sig/generated/xlsxrb.rbs +18 -11
  63. metadata +22 -144
  64. data/.devcontainer/Dockerfile +0 -65
  65. data/.devcontainer/devcontainer.json +0 -17
  66. data/.gem_rbs_collection/ast/2.4/.rbs_meta.yaml +0 -9
  67. data/.gem_rbs_collection/ast/2.4/ast.rbs +0 -73
  68. data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +0 -9
  69. data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +0 -4
  70. data/.gem_rbs_collection/concurrent-ruby/1.1/atomic_reference.rbs +0 -16
  71. data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +0 -96
  72. data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +0 -4
  73. data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +0 -68
  74. data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +0 -249
  75. data/.gem_rbs_collection/concurrent-ruby/1.1/set.rbs +0 -4
  76. data/.gem_rbs_collection/concurrent-ruby/1.1/timer_task.rbs +0 -47
  77. data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +0 -5
  78. data/.gem_rbs_collection/csv/3.3/.rbs_meta.yaml +0 -9
  79. data/.gem_rbs_collection/csv/3.3/csv.rbs +0 -3871
  80. data/.gem_rbs_collection/csv/3.3/manifest.yaml +0 -3
  81. data/.gem_rbs_collection/lint_roller/1.1/.rbs_meta.yaml +0 -9
  82. data/.gem_rbs_collection/lint_roller/1.1/lint_roller.rbs +0 -48
  83. data/.gem_rbs_collection/listen/3.9/.rbs_meta.yaml +0 -9
  84. data/.gem_rbs_collection/listen/3.9/listen.rbs +0 -25
  85. data/.gem_rbs_collection/listen/3.9/listener.rbs +0 -24
  86. data/.gem_rbs_collection/logger/1.7/.rbs_meta.yaml +0 -9
  87. data/.gem_rbs_collection/logger/1.7/formatter.rbs +0 -45
  88. data/.gem_rbs_collection/logger/1.7/log_device.rbs +0 -100
  89. data/.gem_rbs_collection/logger/1.7/logger.rbs +0 -796
  90. data/.gem_rbs_collection/logger/1.7/manifest.yaml +0 -2
  91. data/.gem_rbs_collection/logger/1.7/period.rbs +0 -17
  92. data/.gem_rbs_collection/logger/1.7/severity.rbs +0 -34
  93. data/.gem_rbs_collection/nokogiri/1.11/.rbs_meta.yaml +0 -9
  94. data/.gem_rbs_collection/nokogiri/1.11/nokogiri.rbs +0 -2332
  95. data/.gem_rbs_collection/nokogiri/1.11/patch.rbs +0 -4
  96. data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +0 -9
  97. data/.gem_rbs_collection/parallel/1.20/parallel.rbs +0 -86
  98. data/.gem_rbs_collection/parser/3.2/.rbs_meta.yaml +0 -9
  99. data/.gem_rbs_collection/parser/3.2/manifest.yaml +0 -7
  100. data/.gem_rbs_collection/parser/3.2/parser.rbs +0 -194
  101. data/.gem_rbs_collection/parser/3.2/polyfill.rbs +0 -4
  102. data/.gem_rbs_collection/rainbow/3.0/.rbs_meta.yaml +0 -9
  103. data/.gem_rbs_collection/rainbow/3.0/global.rbs +0 -7
  104. data/.gem_rbs_collection/rainbow/3.0/presenter.rbs +0 -209
  105. data/.gem_rbs_collection/rainbow/3.0/rainbow.rbs +0 -5
  106. data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +0 -9
  107. data/.gem_rbs_collection/rake/13.0/manifest.yaml +0 -2
  108. data/.gem_rbs_collection/rake/13.0/rake.rbs +0 -39
  109. data/.gem_rbs_collection/regexp_parser/2.8/.rbs_meta.yaml +0 -9
  110. data/.gem_rbs_collection/regexp_parser/2.8/regexp_parser.rbs +0 -17
  111. data/.gem_rbs_collection/rubocop/1.57/.rbs_meta.yaml +0 -9
  112. data/.gem_rbs_collection/rubocop/1.57/rubocop.rbs +0 -208
  113. data/.gem_rbs_collection/rubocop-ast/1.46/.rbs_meta.yaml +0 -9
  114. data/.gem_rbs_collection/rubocop-ast/1.46/rubocop-ast.rbs +0 -903
  115. data/.gem_rbs_collection/rubyzip/3.2/.rbs_meta.yaml +0 -9
  116. data/.gem_rbs_collection/rubyzip/3.2/manifest.yaml +0 -8
  117. data/.gem_rbs_collection/rubyzip/3.2/zip/central_directory.rbs +0 -42
  118. data/.gem_rbs_collection/rubyzip/3.2/zip/compressor.rbs +0 -5
  119. data/.gem_rbs_collection/rubyzip/3.2/zip/constants.rbs +0 -47
  120. data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/aes_encryption.rbs +0 -30
  121. data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/decrypted_io.rbs +0 -9
  122. data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/encryption.rbs +0 -7
  123. data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/null_encryption.rbs +0 -19
  124. data/.gem_rbs_collection/rubyzip/3.2/zip/crypto/traditional_encryption.rbs +0 -31
  125. data/.gem_rbs_collection/rubyzip/3.2/zip/decompressor.rbs +0 -18
  126. data/.gem_rbs_collection/rubyzip/3.2/zip/deflater.rbs +0 -12
  127. data/.gem_rbs_collection/rubyzip/3.2/zip/dirtyable.rbs +0 -11
  128. data/.gem_rbs_collection/rubyzip/3.2/zip/dos_time.rbs +0 -13
  129. data/.gem_rbs_collection/rubyzip/3.2/zip/entry.rbs +0 -95
  130. data/.gem_rbs_collection/rubyzip/3.2/zip/entry_set.rbs +0 -31
  131. data/.gem_rbs_collection/rubyzip/3.2/zip/errors.rbs +0 -58
  132. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/aes.rbs +0 -24
  133. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/generic.rbs +0 -17
  134. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/ntfs.rbs +0 -23
  135. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/old_unix.rbs +0 -22
  136. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/universal_time.rbs +0 -30
  137. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/unix.rbs +0 -20
  138. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/unknown.rbs +0 -15
  139. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field/zip64.rbs +0 -26
  140. data/.gem_rbs_collection/rubyzip/3.2/zip/extra_field.rbs +0 -21
  141. data/.gem_rbs_collection/rubyzip/3.2/zip/file.rbs +0 -131
  142. data/.gem_rbs_collection/rubyzip/3.2/zip/file_split.rbs +0 -14
  143. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/dir.rbs +0 -33
  144. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/directory_iterator.rbs +0 -21
  145. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/file.rbs +0 -63
  146. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/file_stat.rbs +0 -55
  147. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem/zip_file_name_mapper.rbs +0 -35
  148. data/.gem_rbs_collection/rubyzip/3.2/zip/filesystem.rbs +0 -7
  149. data/.gem_rbs_collection/rubyzip/3.2/zip/inflater.rbs +0 -10
  150. data/.gem_rbs_collection/rubyzip/3.2/zip/input_stream.rbs +0 -22
  151. data/.gem_rbs_collection/rubyzip/3.2/zip/ioextras/abstract_input_stream.rbs +0 -29
  152. data/.gem_rbs_collection/rubyzip/3.2/zip/ioextras/abstract_output_stream.rbs +0 -17
  153. data/.gem_rbs_collection/rubyzip/3.2/zip/ioextras.rbs +0 -13
  154. data/.gem_rbs_collection/rubyzip/3.2/zip/null_compressor.rbs +0 -10
  155. data/.gem_rbs_collection/rubyzip/3.2/zip/null_decompressor.rbs +0 -8
  156. data/.gem_rbs_collection/rubyzip/3.2/zip/null_input_stream.rbs +0 -6
  157. data/.gem_rbs_collection/rubyzip/3.2/zip/output_stream.rbs +0 -30
  158. data/.gem_rbs_collection/rubyzip/3.2/zip/pass_thru_compressor.rbs +0 -10
  159. data/.gem_rbs_collection/rubyzip/3.2/zip/pass_thru_decompressor.rbs +0 -10
  160. data/.gem_rbs_collection/rubyzip/3.2/zip/streamable_directory.rbs +0 -5
  161. data/.gem_rbs_collection/rubyzip/3.2/zip/streamable_stream.rbs +0 -15
  162. data/.gem_rbs_collection/rubyzip/3.2/zip/version.rbs +0 -3
  163. data/.gem_rbs_collection/rubyzip/3.2/zip.rbs +0 -40
  164. data/Rakefile +0 -567
  165. data/Steepfile +0 -18
  166. data/benchmark.rb +0 -406
  167. data/docs/ARCHITECTURE.md +0 -514
  168. data/docs/DEVELOPMENT.md +0 -133
  169. data/docs/PEER_LIBRARIES.md +0 -121
  170. data/docs/QUALITY_ASSURANCE.md +0 -25
  171. data/docs/SPEC_SOURCES.md +0 -48
  172. data/docs/assets/benchmark_results.svg +0 -144
  173. data/docs/assets/lsp_autocompletion.png +0 -0
  174. data/docs/assets/playground_preview.png +0 -0
  175. data/docs/coi-serviceworker.js +0 -82
  176. data/docs/office_thread.js +0 -77
  177. data/docs/preview.html +0 -719
  178. data/docs/visual/VisualGallery.md +0 -4672
  179. data/docs/wasm/ruby.wasm +0 -0
  180. data/docs/wasm/wasm_doc_helper.css +0 -351
  181. data/docs/wasm/wasm_doc_helper.js +0 -439
  182. data/docs/zeta.js +0 -1107
  183. data/rbs_collection.lock.yaml +0 -252
  184. data/rbs_collection.yaml +0 -19
  185. data/vendor/sdk_runner/Program.cs +0 -93
  186. data/vendor/sdk_runner/sdk_runner.csproj +0 -13
@@ -5,8 +5,6 @@ module Xlsxrb
5
5
  # SAX-based parser for xl/sharedStrings.xml.
6
6
  # Returns an Array of strings (index = SST index).
7
7
  class SharedStringsParser
8
- XML_ENTITIES: untyped
9
-
10
8
  # Parses all shared strings and returns an Array of strings.
11
9
  def self.parse: (untyped xml_string, ?_part_name: untyped) -> untyped
12
10
 
@@ -7,6 +7,8 @@ module Xlsxrb
7
7
  # Excel 1900 date system epoch.
8
8
  EPOCH_1900: untyped
9
9
 
10
+ EPOCH_1900_JD: untyped
11
+
10
12
  # Built-in number format codes defined by SpreadsheetML.
11
13
  BUILTIN_NUM_FMT_CODES: untyped
12
14
 
@@ -16,7 +16,7 @@ module Xlsxrb
16
16
  def self.parse: (untyped xml_string, ?shared_strings: untyped) -> untyped
17
17
 
18
18
  # Streaming parse: yields one raw row hash at a time.
19
- def self.each_row: (untyped xml_string, ?shared_strings: untyped, ?part_name: untyped) ?{ (?) -> untyped } -> untyped
19
+ def self.each_row: (untyped xml_source, ?shared_strings: untyped, ?part_name: untyped) ?{ (?) -> untyped } -> untyped
20
20
 
21
21
  # Parses column definitions (<cols>) from a worksheet.
22
22
  def self.parse_columns: (untyped xml_string, ?part_name: untyped) -> untyped
@@ -37,12 +37,11 @@ module Xlsxrb
37
37
 
38
38
  def self.resolve_fast_value: (untyped raw, untyped type, untyped shared_strings) -> untyped
39
39
 
40
- XML_ENTITIES: untyped
41
-
42
40
  # SECURITY NOTE: Decodes only standard predefined XML entities in a single pass.
43
41
  # This completely prevents "Billion Laughs" attacks (exponential entity expansion)
44
42
  # because it avoids recursive expansion and ignores custom entities entirely.
45
- def self.decode_xml_entities: (untyped str) -> untyped
43
+ # : (String str) -> String
44
+ def self.decode_xml_entities: (String str) -> String
46
45
 
47
46
  # Parses <cols> section for column definitions.
48
47
  class ColumnsListener
@@ -61,6 +60,8 @@ module Xlsxrb
61
60
 
62
61
  def self.fast_scan_rows_direct: (untyped xml_src, untyped shared_strings, untyped _part_name) ?{ (?) -> untyped } -> untyped
63
62
 
63
+ def self.scan_rows_stream: (untyped source, untyped shared_strings, untyped _part_name) ?{ (?) -> untyped } -> untyped
64
+
64
65
  COL_LETTERS: untyped
65
66
 
66
67
  COL_MAP: untyped
@@ -0,0 +1,79 @@
1
+ # Generated from lib/xlsxrb/ooxml/writer/drawing_xml.rb with RBS::Inline
2
+
3
+ module Xlsxrb
4
+ module Ooxml
5
+ class Writer
6
+ # Mixin containing DrawingML, Chart, Shape, Comment, and VML XML generation logic.
7
+ module DrawingXml
8
+ # : (untyped drawing_parts) -> untyped
9
+ def generate_drawing_xml: (untyped drawing_parts) -> untyped
10
+
11
+ # : (untyped para) -> ::String
12
+ def paragraph_xml: (untyped para) -> untyped
13
+
14
+ # : (untyped tag, untyped font) -> untyped
15
+ def text_char_props_xml: (untyped tag, untyped font) -> untyped
16
+
17
+ # : (untyped tag, untyped col, untyped row, ?col_off: ::Integer, ?row_off: ::Integer) -> ::String
18
+ def anchor_xml: (untyped tag, untyped col, untyped row, ?col_off: untyped, ?row_off: untyped) -> untyped
19
+
20
+ # : (untyped obj) -> ::String
21
+ def client_data_xml: (untyped obj) -> untyped
22
+
23
+ # : (untyped rels_data) -> untyped
24
+ def generate_drawing_rels: (untyped rels_data) -> untyped
25
+
26
+ # : (untyped title_spec, ?overlay: bool) -> untyped
27
+ def build_chart_title_xml: (untyped title_spec, ?overlay: untyped) -> untyped
28
+
29
+ # : (untyped title_spec, untyped chart, untyped prefix) -> untyped
30
+ def merge_flat_title_styling: (untyped title_spec, untyped chart, untyped prefix) -> untyped
31
+
32
+ # : (untyped spec) -> untyped
33
+ def build_title_sp_pr: (untyped spec) -> untyped
34
+
35
+ # : (untyped layout) -> ("" | untyped)
36
+ def build_title_layout_xml: (untyped layout) -> untyped
37
+
38
+ # : (untyped tag, untyped spec) -> ("" | untyped)
39
+ def gridlines_xml: (untyped tag, untyped spec) -> untyped
40
+
41
+ # Resolves a cell reference like "Sheet1!$A$1:$A$5" to an array of values from @sheets.
42
+ # : (untyped ref) -> (nil | untyped)
43
+ def resolve_sheet_ref: (untyped ref) -> untyped
44
+
45
+ # : (untyped start_cell, untyped end_cell) -> (::Array[untyped] | untyped)
46
+ def enumerate_cell_range: (untyped start_cell, untyped end_cell) -> untyped
47
+
48
+ # : (untyped ref) -> ("" | ::String)
49
+ def num_cache_xml: (untyped ref) -> untyped
50
+
51
+ # : (untyped ref) -> ("" | ::String)
52
+ def str_cache_xml: (untyped ref) -> untyped
53
+
54
+ # : (untyped color, ?alpha: untyped?, ?transforms: untyped?) -> untyped
55
+ def color_xml: (untyped color, ?alpha: untyped, ?transforms: untyped) -> untyped
56
+
57
+ # : (untyped color) -> untyped
58
+ def normalize_drawing_rgb: (untyped color) -> untyped
59
+
60
+ alias srgb_clr_xml color_xml
61
+
62
+ # : (untyped rotation, untyped font) -> ("" | ::String)
63
+ def build_axis_txpr: (untyped rotation, untyped font) -> untyped
64
+
65
+ # : (untyped chart) -> untyped
66
+ def generate_chart_xml: (untyped chart) -> untyped
67
+
68
+ # : (untyped sheet_comments) -> untyped
69
+ def generate_comments_xml: (untyped sheet_comments) -> untyped
70
+
71
+ # : (untyped sheet_comments) -> untyped
72
+ def generate_vml_drawing_xml: (untyped sheet_comments) -> untyped
73
+
74
+ # : (untyped cell_ref) -> (::Array[0] | ::Array[untyped])
75
+ def cell_to_col_row: (untyped cell_ref) -> untyped
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,83 @@
1
+ # Generated from lib/xlsxrb/ooxml/writer/features_xml.rb with RBS::Inline
2
+
3
+ module Xlsxrb
4
+ module Ooxml
5
+ class Writer
6
+ # Mixin containing Table, PivotTable, Document Properties, and External Link XML generation logic.
7
+ module FeaturesXml
8
+ # : (untyped pivot_table, untyped cache_id) -> untyped
9
+ def generate_pivot_table_xml: (untyped pivot_table, untyped cache_id) -> untyped
10
+
11
+ # : (untyped pivot_table, untyped _cache_id) -> untyped
12
+ def generate_pivot_cache_definition_xml: (untyped pivot_table, untyped _cache_id) -> untyped
13
+
14
+ # : (untyped pivot_table) -> untyped
15
+ def generate_pivot_cache_records_xml: (untyped pivot_table) -> untyped
16
+
17
+ # : (untyped cache_id) -> untyped
18
+ def generate_pivot_cache_rels: (untyped cache_id) -> untyped
19
+
20
+ # : (untyped cache_id) -> untyped
21
+ def generate_pivot_table_rels: (untyped cache_id) -> untyped
22
+
23
+ # : (untyped ext_link) -> untyped
24
+ def generate_external_link_xml: (untyped ext_link) -> untyped
25
+
26
+ # : (untyped ext_link) -> untyped
27
+ def generate_external_link_rels: (untyped ext_link) -> untyped
28
+
29
+ # : (untyped ct_xml) -> untyped
30
+ def parse_extra_content_types: (untyped ct_xml) -> untyped
31
+
32
+ # : (untyped element, untyped opts) -> ("" | ::String)
33
+ def build_line_end_xml: (untyped element, untyped opts) -> untyped
34
+
35
+ # : (untyped value) -> untyped
36
+ def xml_escape: (untyped value) -> untyped
37
+
38
+ # : (untyped rich_text) -> untyped
39
+ def rich_text_xml: (untyped rich_text) -> untyped
40
+
41
+ # : (untyped cell_ref, untyped value, untyped style_idx, ?untyped? sst, ?ph: untyped?) -> untyped
42
+ def cell_xml: (untyped cell_ref, untyped value, untyped style_idx, ?untyped sst, ?ph: untyped) -> untyped
43
+
44
+ # Returns the numFmtId for dates, registering it on first use.
45
+ # : () -> untyped
46
+ def date_num_fmt_id: () -> untyped
47
+
48
+ # Returns the numFmtId for datetime, registering it on first use.
49
+ # : () -> untyped
50
+ def datetime_num_fmt_id: () -> untyped
51
+
52
+ # Maps a numFmtId to a cellXfs index. Index 0 is the default (no format).
53
+ # : (untyped style_value) -> (nil | untyped)
54
+ def resolve_style_index: (untyped style_value) -> untyped
55
+
56
+ # : (untyped filter) -> untyped
57
+ def emit_filter_xml: (untyped filter) -> untyped
58
+
59
+ # : (untyped parts, untyped rule) -> untyped
60
+ def emit_cf_rule: (untyped parts, untyped rule) -> untyped
61
+
62
+ # Emits a <color> element for CF rules, accepting either a plain RGB string or a hash.
63
+ # : (untyped color) -> (untyped | ::String)
64
+ def emit_cf_color_xml: (untyped color) -> untyped
65
+
66
+ # : (untyped sheet_cells) -> ("A1" | ::String)
67
+ def compute_dimension: (untyped sheet_cells) -> untyped
68
+
69
+ # : (untyped index) -> untyped
70
+ def index_to_column_letter: (untyped index) -> untyped
71
+
72
+ # : () -> untyped
73
+ def generate_core_properties_xml: () -> untyped
74
+
75
+ # : () -> untyped
76
+ def generate_app_properties_xml: () -> untyped
77
+
78
+ # : () -> untyped
79
+ def generate_custom_properties_xml: () -> untyped
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,53 @@
1
+ # Generated from lib/xlsxrb/ooxml/writer/styles_xml.rb with RBS::Inline
2
+
3
+ module Xlsxrb
4
+ module Ooxml
5
+ class Writer
6
+ # Mixin containing Stylesheet XML generation logic.
7
+ module StylesXml
8
+ # : () -> untyped
9
+ def generate_styles_xml: () -> untyped
10
+
11
+ # : (untyped alignment) -> ::String
12
+ def emit_alignment_xml: (untyped alignment) -> untyped
13
+
14
+ # : (untyped protection) -> ::String
15
+ def emit_protection_xml: (untyped protection) -> untyped
16
+
17
+ # : (untyped source, ?tag: ::String) -> (::String | ::String | ::String | ::String | "")
18
+ def emit_color_xml: (untyped source, ?tag: untyped) -> untyped
19
+
20
+ # : (untyped font) -> untyped
21
+ def emit_font_xml: (untyped font) -> untyped
22
+
23
+ # : (untyped fill) -> (untyped | ::String)
24
+ def emit_fill_xml: (untyped fill) -> untyped
25
+
26
+ # : (untyped tag, untyped fill, untyped prefix) -> (::String | ::String | ::String | ::String | "")
27
+ def emit_fill_color_xml: (untyped tag, untyped fill, untyped prefix) -> untyped
28
+
29
+ # : (untyped gradient) -> untyped
30
+ def emit_gradient_fill_xml: (untyped gradient) -> untyped
31
+
32
+ # : (untyped brk, default_max: untyped) -> ::String
33
+ def emit_brk_xml: (untyped brk, default_max: untyped) -> untyped
34
+
35
+ # : (untyped bdr) -> untyped
36
+ def emit_border_xml: (untyped bdr) -> untyped
37
+
38
+ # : (untyped dxf) -> untyped
39
+ def emit_dxf_xml: (untyped dxf) -> untyped
40
+
41
+ # : (untyped cell_address) -> untyped
42
+ def validate_cell_address!: (untyped cell_address) -> untyped
43
+
44
+ # : (untyped letters) -> untyped
45
+ def column_letter_to_index: (untyped letters) -> untyped
46
+
47
+ # Extracts the column letter(s) from a cell address, e.g. "A" from "A1".
48
+ # : (untyped cell_address) -> untyped
49
+ def extract_column_letter: (untyped cell_address) -> untyped
50
+ end
51
+ end
52
+ end
53
+ end
@@ -4,6 +4,12 @@ module Xlsxrb
4
4
  module Ooxml
5
5
  # Writes spreadsheet data into an XLSX file.
6
6
  class Writer
7
+ include DrawingXml
8
+
9
+ include FeaturesXml
10
+
11
+ include StylesXml
12
+
7
13
  XML_HEADER: ::String
8
14
 
9
15
  CT_NS: ::String
@@ -679,191 +685,6 @@ module Xlsxrb
679
685
  # : (untyped rels_data) -> untyped
680
686
  def generate_generic_rels: (untyped rels_data) -> untyped
681
687
 
682
- # : (untyped drawing_parts) -> untyped
683
- def generate_drawing_xml: (untyped drawing_parts) -> untyped
684
-
685
- # : (untyped para) -> ::String
686
- def paragraph_xml: (untyped para) -> untyped
687
-
688
- # : (untyped tag, untyped font) -> untyped
689
- def text_char_props_xml: (untyped tag, untyped font) -> untyped
690
-
691
- # : (untyped tag, untyped col, untyped row, ?col_off: ::Integer, ?row_off: ::Integer) -> ::String
692
- def anchor_xml: (untyped tag, untyped col, untyped row, ?col_off: untyped, ?row_off: untyped) -> untyped
693
-
694
- # : (untyped obj) -> ::String
695
- def client_data_xml: (untyped obj) -> untyped
696
-
697
- # : (untyped rels_data) -> untyped
698
- def generate_drawing_rels: (untyped rels_data) -> untyped
699
-
700
- # : (untyped title_spec, ?overlay: bool) -> untyped
701
- def build_chart_title_xml: (untyped title_spec, ?overlay: untyped) -> untyped
702
-
703
- # : (untyped title_spec, untyped chart, untyped prefix) -> untyped
704
- def merge_flat_title_styling: (untyped title_spec, untyped chart, untyped prefix) -> untyped
705
-
706
- # : (untyped spec) -> untyped
707
- def build_title_sp_pr: (untyped spec) -> untyped
708
-
709
- # : (untyped layout) -> ("" | untyped)
710
- def build_title_layout_xml: (untyped layout) -> untyped
711
-
712
- # : (untyped tag, untyped spec) -> ("" | untyped)
713
- def gridlines_xml: (untyped tag, untyped spec) -> untyped
714
-
715
- # Resolves a cell reference like "Sheet1!$A$1:$A$5" to an array of values from @sheets.
716
- # : (untyped ref) -> (nil | untyped)
717
- def resolve_sheet_ref: (untyped ref) -> untyped
718
-
719
- # : (untyped start_cell, untyped end_cell) -> (::Array[untyped] | untyped)
720
- def enumerate_cell_range: (untyped start_cell, untyped end_cell) -> untyped
721
-
722
- # : (untyped ref) -> ("" | ::String)
723
- def num_cache_xml: (untyped ref) -> untyped
724
-
725
- # : (untyped ref) -> ("" | ::String)
726
- def str_cache_xml: (untyped ref) -> untyped
727
-
728
- # : (untyped color, ?alpha: untyped?, ?transforms: untyped?) -> untyped
729
- def color_xml: (untyped color, ?alpha: untyped, ?transforms: untyped) -> untyped
730
-
731
- # : (untyped color) -> untyped
732
- def normalize_drawing_rgb: (untyped color) -> untyped
733
-
734
- alias srgb_clr_xml color_xml
735
-
736
- # : (untyped rotation, untyped font) -> ("" | ::String)
737
- def build_axis_txpr: (untyped rotation, untyped font) -> untyped
738
-
739
- # : (untyped chart) -> untyped
740
- def generate_chart_xml: (untyped chart) -> untyped
741
-
742
- # : (untyped sheet_comments) -> untyped
743
- def generate_comments_xml: (untyped sheet_comments) -> untyped
744
-
745
- # : (untyped sheet_comments) -> untyped
746
- def generate_vml_drawing_xml: (untyped sheet_comments) -> untyped
747
-
748
- # : (untyped cell_ref) -> (::Array[0] | ::Array[untyped])
749
- def cell_to_col_row: (untyped cell_ref) -> untyped
750
-
751
- # : (untyped pivot_table, untyped cache_id) -> untyped
752
- def generate_pivot_table_xml: (untyped pivot_table, untyped cache_id) -> untyped
753
-
754
- # : (untyped pivot_table, untyped _cache_id) -> untyped
755
- def generate_pivot_cache_definition_xml: (untyped pivot_table, untyped _cache_id) -> untyped
756
-
757
- # : (untyped pivot_table) -> untyped
758
- def generate_pivot_cache_records_xml: (untyped pivot_table) -> untyped
759
-
760
- # : (untyped cache_id) -> untyped
761
- def generate_pivot_cache_rels: (untyped cache_id) -> untyped
762
-
763
- # : (untyped cache_id) -> untyped
764
- def generate_pivot_table_rels: (untyped cache_id) -> untyped
765
-
766
- # : (untyped ext_link) -> untyped
767
- def generate_external_link_xml: (untyped ext_link) -> untyped
768
-
769
- # : (untyped ext_link) -> untyped
770
- def generate_external_link_rels: (untyped ext_link) -> untyped
771
-
772
- # : (untyped ct_xml) -> untyped
773
- def parse_extra_content_types: (untyped ct_xml) -> untyped
774
-
775
- # : (untyped element, untyped opts) -> ("" | ::String)
776
- def build_line_end_xml: (untyped element, untyped opts) -> untyped
777
-
778
- # : (untyped value) -> untyped
779
- def xml_escape: (untyped value) -> untyped
780
-
781
- # : (untyped rich_text) -> untyped
782
- def rich_text_xml: (untyped rich_text) -> untyped
783
-
784
- # : (untyped cell_ref, untyped value, untyped style_idx, ?untyped? sst, ?ph: untyped?) -> untyped
785
- def cell_xml: (untyped cell_ref, untyped value, untyped style_idx, ?untyped sst, ?ph: untyped) -> untyped
786
-
787
- # Returns the numFmtId for dates, registering it on first use.
788
- # : () -> untyped
789
- def date_num_fmt_id: () -> untyped
790
-
791
- # Returns the numFmtId for datetime, registering it on first use.
792
- # : () -> untyped
793
- def datetime_num_fmt_id: () -> untyped
794
-
795
- # Maps a numFmtId to a cellXfs index. Index 0 is the default (no format).
796
- # : (untyped style_value) -> (nil | untyped)
797
- def resolve_style_index: (untyped style_value) -> untyped
798
-
799
- # : (untyped filter) -> untyped
800
- def emit_filter_xml: (untyped filter) -> untyped
801
-
802
- # : (untyped parts, untyped rule) -> untyped
803
- def emit_cf_rule: (untyped parts, untyped rule) -> untyped
804
-
805
- # Emits a <color> element for CF rules, accepting either a plain RGB string or a hash.
806
- # : (untyped color) -> (untyped | ::String)
807
- def emit_cf_color_xml: (untyped color) -> untyped
808
-
809
- # : (untyped sheet_cells) -> ("A1" | ::String)
810
- def compute_dimension: (untyped sheet_cells) -> untyped
811
-
812
- # : (untyped index) -> untyped
813
- def index_to_column_letter: (untyped index) -> untyped
814
-
815
- # : () -> untyped
816
- def generate_core_properties_xml: () -> untyped
817
-
818
- # : () -> untyped
819
- def generate_app_properties_xml: () -> untyped
820
-
821
- # : () -> untyped
822
- def generate_custom_properties_xml: () -> untyped
823
-
824
- # : () -> untyped
825
- def generate_styles_xml: () -> untyped
826
-
827
- # : (untyped alignment) -> ::String
828
- def emit_alignment_xml: (untyped alignment) -> untyped
829
-
830
- # : (untyped protection) -> ::String
831
- def emit_protection_xml: (untyped protection) -> untyped
832
-
833
- # : (untyped source, ?tag: ::String) -> (::String | ::String | ::String | ::String | "")
834
- def emit_color_xml: (untyped source, ?tag: untyped) -> untyped
835
-
836
- # : (untyped font) -> untyped
837
- def emit_font_xml: (untyped font) -> untyped
838
-
839
- # : (untyped fill) -> (untyped | ::String)
840
- def emit_fill_xml: (untyped fill) -> untyped
841
-
842
- # : (untyped tag, untyped fill, untyped prefix) -> (::String | ::String | ::String | ::String | "")
843
- def emit_fill_color_xml: (untyped tag, untyped fill, untyped prefix) -> untyped
844
-
845
- # : (untyped gradient) -> untyped
846
- def emit_gradient_fill_xml: (untyped gradient) -> untyped
847
-
848
- # : (untyped brk, default_max: untyped) -> ::String
849
- def emit_brk_xml: (untyped brk, default_max: untyped) -> untyped
850
-
851
- # : (untyped bdr) -> untyped
852
- def emit_border_xml: (untyped bdr) -> untyped
853
-
854
- # : (untyped dxf) -> untyped
855
- def emit_dxf_xml: (untyped dxf) -> untyped
856
-
857
- # : (untyped cell_address) -> untyped
858
- def validate_cell_address!: (untyped cell_address) -> untyped
859
-
860
- # : (untyped letters) -> untyped
861
- def column_letter_to_index: (untyped letters) -> untyped
862
-
863
- # Extracts the column letter(s) from a cell address, e.g. "A" from "A1".
864
- # : (untyped cell_address) -> untyped
865
- def extract_column_letter: (untyped cell_address) -> untyped
866
-
867
688
  # Extracts the row number from a cell address, e.g. 1 from "A1".
868
689
  # : (untyped cell_address) -> untyped
869
690
  def extract_row_number: (untyped cell_address) -> untyped
@@ -35,6 +35,24 @@ module Xlsxrb
35
35
 
36
36
  def to_s: () -> untyped
37
37
 
38
+ UNESCAPE_MAP: untyped
39
+
40
+ UNESCAPE_RE: ::Regexp
41
+
42
+ # Escapes XML special characters in a string.
43
+ #
44
+ # @param value [Object]
45
+ # @return [String]
46
+ # : (untyped value) -> String
47
+ def self.escape: (untyped value) -> String
48
+
49
+ # Unescapes predefined XML entities in a string in a single pass.
50
+ #
51
+ # @param value [Object]
52
+ # @return [String]
53
+ # : (untyped value) -> String
54
+ def self.unescape: (untyped value) -> String
55
+
38
56
  private
39
57
 
40
58
  def write_attrs: (untyped attrs) -> untyped
@@ -12,6 +12,21 @@ module Xlsxrb
12
12
  # Generates the ZIP file.
13
13
  def generate: () -> untyped
14
14
 
15
+ # Returns little-endian 16-bit unsigned integer as an Array of byte values.
16
+ # : (Integer value) -> Array[Integer]
17
+ def self.le16: (Integer value) -> Array[Integer]
18
+
19
+ # Returns little-endian 32-bit unsigned integer as an Array of byte values.
20
+ # : (Integer value) -> Array[Integer]
21
+ def self.le32: (Integer value) -> Array[Integer]
22
+
23
+ # Returns MS-DOS format datetime byte array (little-endian 16-bit time + date).
24
+ #
25
+ # @param time [Time]
26
+ # @return [Array<Integer>]
27
+ # : (Time time) -> Array[Integer]
28
+ def self.dos_datetime: (Time time) -> Array[Integer]
29
+
15
30
  private
16
31
 
17
32
  def write_entries: () -> untyped
@@ -3,7 +3,7 @@
3
3
  module Xlsxrb
4
4
  module Ooxml
5
5
  # Reads ZIP archives using only stdlib (zlib).
6
- # Scans local file headers sequentially — works with non-seekable IO.
6
+ # Supports streaming entry decompression with bounded memory consumption.
7
7
  class ZipReader
8
8
  LOCAL_HEADER_SIG: untyped
9
9
 
@@ -11,29 +11,117 @@ module Xlsxrb
11
11
 
12
12
  attr_accessor max_uncompressed_size: untyped
13
13
 
14
+ # Metadata record for a single archive entry.
15
+ class Entry
16
+ attr_reader name: untyped
17
+
18
+ attr_reader method: untyped
19
+
20
+ attr_reader compressed_size: untyped
21
+
22
+ attr_reader uncompressed_size: untyped
23
+
24
+ attr_reader crc32: untyped
25
+
26
+ attr_reader local_header_offset: untyped
27
+
28
+ attr_reader data_offset: untyped
29
+
30
+ # : (name: String, method: Integer, compressed_size: Integer, uncompressed_size: Integer, crc32: Integer, local_header_offset: Integer, data_offset: Integer) -> void
31
+ def initialize: (name: String, method: Integer, compressed_size: Integer, uncompressed_size: Integer, crc32: Integer, local_header_offset: Integer, data_offset: Integer) -> void
32
+ end
33
+
34
+ # IO-like stream wrapper that decompresses entry chunks on demand without full buffering.
35
+ class EntryStreamIO
36
+ DEFAULT_CHUNK_SIZE: ::Integer
37
+
38
+ attr_reader data_offset: untyped
39
+
40
+ attr_reader compressed_size: untyped
41
+
42
+ attr_reader compression_method: untyped
43
+
44
+ # : (untyped io, Integer data_offset, Integer compressed_size, Integer compression_method, ?max_uncompressed_size: Integer?) -> void
45
+ def initialize: (untyped io, Integer data_offset, Integer compressed_size, Integer compression_method, ?max_uncompressed_size: Integer?) -> void
46
+
47
+ # : (?Integer? length) -> String?
48
+ def read: (?Integer? length) -> String?
49
+
50
+ # : (?Integer chunk_size) ?{ (String) -> void } -> (void | Enumerator[String, void])
51
+ def each_chunk: (?untyped chunk_size) ?{ (?) -> untyped } -> untyped
52
+
53
+ # : () -> void
54
+ def close: () -> void
55
+
56
+ # : () -> bool
57
+ def closed?: () -> bool
58
+
59
+ # : () -> bool
60
+ def eof?: () -> bool
61
+
62
+ private
63
+
64
+ def fetch_chunk: (untyped chunk_size) -> untyped
65
+ end
66
+
14
67
  # Opens a ZIP from a file path or IO and yields the reader.
15
68
  # : (untyped source, ?max_uncompressed_size: Integer) ?{ (ZipReader) -> untyped } -> (ZipReader | untyped)
16
69
  def self.open: (untyped source, ?max_uncompressed_size: Integer) ?{ (ZipReader) -> untyped } -> (ZipReader | untyped)
17
70
 
18
- # : (untyped io, ?max_uncompressed_size: Integer) -> void
19
- def initialize: (untyped io, ?max_uncompressed_size: Integer) -> void
71
+ # : (untyped io, ?max_uncompressed_size: Integer, ?should_close_io: bool) -> void
72
+ def initialize: (untyped io, ?max_uncompressed_size: Integer, ?should_close_io: bool) -> void
20
73
 
21
74
  # Returns a Hash { entry_name => raw_bytes } for all entries.
22
- def read_all: () -> untyped
75
+ # : () -> Hash[String, String?]
76
+ def read_all: () -> Hash[String, String?]
23
77
 
24
78
  # Returns raw bytes for a single entry, or nil if not found.
25
- def read_entry: (untyped name) -> untyped
79
+ # : (String name) -> String?
80
+ def read_entry: (String name) -> String?
26
81
 
27
82
  # Yields (entry_name, data_string) for each file in the archive.
83
+ # : () ?{ (String, String?) -> void } -> (void | Enumerator[[String, String?], void])
28
84
  def each_entry: () ?{ (?) -> untyped } -> untyped
29
85
 
86
+ # Opens an EntryStreamIO for an entry by name.
87
+ # : (String entry_name) -> EntryStreamIO
88
+ def open_entry_io: (String entry_name) -> EntryStreamIO
89
+
90
+ # Yields inflated binary chunks directly from the compressed stream.
91
+ # : (String entry_name, ?chunk_size: Integer) ?{ (String) -> void } -> (void | Enumerator[String, void])
92
+ def each_entry_chunk: (untyped entry_name, ?chunk_size: untyped) ?{ (?) -> untyped } -> untyped
93
+
94
+ # Returns true if the archive contains the specified entry.
95
+ # : (String name) -> bool
96
+ def entry?: (String name) -> bool
97
+
98
+ # Returns entry metadata catalog.
99
+ # : () -> Hash[String, Entry]
100
+ def entry_catalog: () -> Hash[String, Entry]
101
+
102
+ # Returns array of all entry names.
103
+ # : () -> Array[String]
104
+ def entry_names: () -> Array[String]
105
+
106
+ # Copies the specified entry to a ZipWriter directly without decompression.
107
+ # : (String entry_name, ZipWriter writer, ?target_path: String?) -> void
108
+ def copy_to_writer: (String entry_name, ZipWriter writer, ?target_path: String?) -> void
109
+
110
+ # Closes the archive reader and cleans up any temporary resources.
111
+ # : () -> void
112
+ def close: () -> void
113
+
30
114
  private
31
115
 
32
- def entries: () -> untyped
116
+ def io: () -> untyped
117
+
118
+ def catalog: () -> untyped
119
+
120
+ def parse_catalog: () -> untyped
33
121
 
34
- def parse_entries: () -> untyped
122
+ def parse_catalog_from_central_directory: (untyped io) -> untyped
35
123
 
36
- def parse_from_central_directory: (untyped io) -> untyped
124
+ def parse_catalog_from_local_headers: (untyped io) -> untyped
37
125
 
38
126
  def find_data_descriptor_stream: (untyped io, untyped method) -> untyped
39
127
 
@@ -23,6 +23,10 @@ module Xlsxrb
23
23
 
24
24
  def finish_entry: () -> untyped
25
25
 
26
+ # Copies an entry from an existing archive IO without decompressing or recompressing.
27
+ # : (String path, untyped source_io, data_offset: Integer, compressed_size: Integer, uncompressed_size: Integer, crc32: Integer, ?method: Integer) -> void
28
+ def copy_raw_entry: (String path, untyped source_io, data_offset: Integer, compressed_size: Integer, uncompressed_size: Integer, crc32: Integer, ?method: Integer) -> void
29
+
26
30
  def close: () -> untyped
27
31
 
28
32
  private
@@ -35,7 +39,7 @@ module Xlsxrb
35
39
 
36
40
  def deflate: (untyped content) -> untyped
37
41
 
38
- def write_local_header: (untyped path, untyped crc, untyped compressed_size, untyped uncompressed_size, ?gp_flag: untyped, ?count_bytes: untyped) -> untyped
42
+ def write_local_header: (untyped path, untyped crc, untyped compressed_size, untyped uncompressed_size, ?gp_flag: untyped, ?count_bytes: untyped, ?method: untyped) -> untyped
39
43
 
40
44
  def write_central_directory: () -> untyped
41
45