chordsketch 0.2.2 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e17a8906bed629af46c3f5c6bb010dcee56db009cbe58b9fa4418d94b3b46cd3
4
- data.tar.gz: dfc27203b744ba2547d4e7eda6733fbb46194e80b49bdc9f9172f9fe608366d5
3
+ metadata.gz: 57dd3a5af6ad2e427b6dc592926fbe87db779ed6f71160a8df5b6ad04c3583cd
4
+ data.tar.gz: 390d6396b4a9ddb2510ef3ec0752b1c15d1e421b4039cd2074d98dfa4b409adc
5
5
  SHA512:
6
- metadata.gz: 32e5dbc06b499062344de155e0609a67f5c1b766ce8767172814662cc799efe88ffdceb262b0ac4c190a4e796790df2e465c6fbbb1b27599159aa871c6dceef8
7
- data.tar.gz: 886d871c8f3017546d5f97ebb01b5ff3215b4ab2a57e8e85418170b0a65c0bbe30fa575cda38ee692d264557dfee43ed4d9eef7590a523d46857fc896f42197f
6
+ metadata.gz: 33d74dcae87ab139d2be40d42ef4278a110d51f2365160ba68299058cc0c69eb6c0862c2c3267ca14af400d9ade10f704f29c5fcf46c1463e1def6eabb8b0a88
7
+ data.tar.gz: 4735ee9a957e532079698f5a6d238849f840fce0dab687bbd1f79caa5516ee8018ebcd3f26d70d5bd284dd4a5cfaf6ded00b6bb0f6f01e56521fcda0a9a54d9a
@@ -126,6 +126,87 @@ end
126
126
  end
127
127
  end
128
128
 
129
+ # The Record type ConversionWithWarnings.
130
+
131
+ def self.check_lower_TypeConversionWithWarnings(v)
132
+
133
+ RustBuffer.check_lower_Sequencestring(v.warnings)
134
+ end
135
+
136
+ def self.alloc_from_TypeConversionWithWarnings(v)
137
+ RustBuffer.allocWithBuilder do |builder|
138
+ builder.write_TypeConversionWithWarnings(v)
139
+ return builder.finalize
140
+ end
141
+ end
142
+
143
+ def consumeIntoTypeConversionWithWarnings
144
+ consumeWithStream do |stream|
145
+ return stream.readTypeConversionWithWarnings
146
+ end
147
+ end
148
+
149
+ # The Record type PdfRenderWithWarnings.
150
+
151
+ def self.check_lower_TypePdfRenderWithWarnings(v)
152
+
153
+ RustBuffer.check_lower_Sequencestring(v.warnings)
154
+ end
155
+
156
+ def self.alloc_from_TypePdfRenderWithWarnings(v)
157
+ RustBuffer.allocWithBuilder do |builder|
158
+ builder.write_TypePdfRenderWithWarnings(v)
159
+ return builder.finalize
160
+ end
161
+ end
162
+
163
+ def consumeIntoTypePdfRenderWithWarnings
164
+ consumeWithStream do |stream|
165
+ return stream.readTypePdfRenderWithWarnings
166
+ end
167
+ end
168
+
169
+ # The Record type TextRenderWithWarnings.
170
+
171
+ def self.check_lower_TypeTextRenderWithWarnings(v)
172
+
173
+ RustBuffer.check_lower_Sequencestring(v.warnings)
174
+ end
175
+
176
+ def self.alloc_from_TypeTextRenderWithWarnings(v)
177
+ RustBuffer.allocWithBuilder do |builder|
178
+ builder.write_TypeTextRenderWithWarnings(v)
179
+ return builder.finalize
180
+ end
181
+ end
182
+
183
+ def consumeIntoTypeTextRenderWithWarnings
184
+ consumeWithStream do |stream|
185
+ return stream.readTypeTextRenderWithWarnings
186
+ end
187
+ end
188
+
189
+ # The Record type ValidationError.
190
+
191
+ def self.check_lower_TypeValidationError(v)
192
+
193
+
194
+
195
+ end
196
+
197
+ def self.alloc_from_TypeValidationError(v)
198
+ RustBuffer.allocWithBuilder do |builder|
199
+ builder.write_TypeValidationError(v)
200
+ return builder.finalize
201
+ end
202
+ end
203
+
204
+ def consumeIntoTypeValidationError
205
+ consumeWithStream do |stream|
206
+ return stream.readTypeValidationError
207
+ end
208
+ end
209
+
129
210
 
130
211
 
131
212
  # The Optional<T> type for i8.
@@ -191,6 +272,27 @@ end
191
272
  end
192
273
  end
193
274
 
275
+ # The Sequence<T> type for TypeValidationError.
276
+
277
+ def self.check_lower_SequenceTypeValidationError(v)
278
+ v.each do |item|
279
+ RustBuffer.check_lower_TypeValidationError(item)
280
+ end
281
+ end
282
+
283
+ def self.alloc_from_SequenceTypeValidationError(v)
284
+ RustBuffer.allocWithBuilder do |builder|
285
+ builder.write_SequenceTypeValidationError(v)
286
+ return builder.finalize()
287
+ end
288
+ end
289
+
290
+ def consumeIntoSequenceTypeValidationError
291
+ consumeWithStream do |stream|
292
+ return stream.readSequenceTypeValidationError
293
+ end
294
+ end
295
+
194
296
 
195
297
  end
196
298
 
@@ -241,6 +343,10 @@ class RustBufferStream
241
343
  unpack_from 1, 'c'
242
344
  end
243
345
 
346
+ def readU32
347
+ unpack_from 4, 'L>'
348
+ end
349
+
244
350
  def readString
245
351
  size = unpack_from 4, 'l>'
246
352
 
@@ -257,6 +363,43 @@ class RustBufferStream
257
363
  read(size).force_encoding(Encoding::BINARY)
258
364
  end
259
365
 
366
+ # The Record type ConversionWithWarnings.
367
+
368
+ def readTypeConversionWithWarnings
369
+ ConversionWithWarnings.new(
370
+ output: readString,
371
+ warnings: readSequencestring
372
+ )
373
+ end
374
+
375
+ # The Record type PdfRenderWithWarnings.
376
+
377
+ def readTypePdfRenderWithWarnings
378
+ PdfRenderWithWarnings.new(
379
+ output: readBytes,
380
+ warnings: readSequencestring
381
+ )
382
+ end
383
+
384
+ # The Record type TextRenderWithWarnings.
385
+
386
+ def readTypeTextRenderWithWarnings
387
+ TextRenderWithWarnings.new(
388
+ output: readString,
389
+ warnings: readSequencestring
390
+ )
391
+ end
392
+
393
+ # The Record type ValidationError.
394
+
395
+ def readTypeValidationError
396
+ ValidationError.new(
397
+ line: readU32,
398
+ column: readU32,
399
+ message: readString
400
+ )
401
+ end
402
+
260
403
 
261
404
 
262
405
 
@@ -274,6 +417,11 @@ class RustBufferStream
274
417
  readString()
275
418
  )
276
419
  end
420
+ if variant == 3
421
+ return ChordSketchError::ConversionFailed.new(
422
+ readString()
423
+ )
424
+ end
277
425
 
278
426
  raise InternalError, 'Unexpected variant tag for TypeChordSketchError'
279
427
  end
@@ -323,6 +471,22 @@ class RustBufferStream
323
471
  items
324
472
  end
325
473
 
474
+ # The Sequence<T> type for TypeValidationError.
475
+
476
+ def readSequenceTypeValidationError
477
+ count = unpack_from 4, 'l>'
478
+
479
+ raise InternalError, 'Unexpected negative sequence length' if count.negative?
480
+
481
+ items = []
482
+
483
+ count.times do
484
+ items.append readTypeValidationError
485
+ end
486
+
487
+ items
488
+ end
489
+
326
490
 
327
491
 
328
492
  def unpack_from(size, format)
@@ -374,6 +538,11 @@ class RustBufferBuilder
374
538
  pack_into(1, 'c', v)
375
539
  end
376
540
 
541
+ def write_U32(v)
542
+ v = Chordsketch::uniffi_in_range(v, "u32", 0, 2**32)
543
+ pack_into(4, 'L>', v)
544
+ end
545
+
377
546
  def write_String(v)
378
547
  v = Chordsketch::uniffi_utf8(v)
379
548
  pack_into 4, 'l>', v.bytes.size
@@ -386,6 +555,35 @@ class RustBufferBuilder
386
555
  write v
387
556
  end
388
557
 
558
+ # The Record type ConversionWithWarnings.
559
+
560
+ def write_TypeConversionWithWarnings(v)
561
+ self.write_String(v.output)
562
+ self.write_Sequencestring(v.warnings)
563
+ end
564
+
565
+ # The Record type PdfRenderWithWarnings.
566
+
567
+ def write_TypePdfRenderWithWarnings(v)
568
+ self.write_Bytes(v.output)
569
+ self.write_Sequencestring(v.warnings)
570
+ end
571
+
572
+ # The Record type TextRenderWithWarnings.
573
+
574
+ def write_TypeTextRenderWithWarnings(v)
575
+ self.write_String(v.output)
576
+ self.write_Sequencestring(v.warnings)
577
+ end
578
+
579
+ # The Record type ValidationError.
580
+
581
+ def write_TypeValidationError(v)
582
+ self.write_U32(v.line)
583
+ self.write_U32(v.column)
584
+ self.write_String(v.message)
585
+ end
586
+
389
587
 
390
588
 
391
589
  # The Optional<T> type for i8.
@@ -420,6 +618,16 @@ class RustBufferBuilder
420
618
  end
421
619
  end
422
620
 
621
+ # The Sequence<T> type for TypeValidationError.
622
+
623
+ def write_SequenceTypeValidationError(items)
624
+ pack_into(4, 'l>', items.size)
625
+
626
+ items.each do |item|
627
+ self.write_TypeValidationError(item)
628
+ end
629
+ end
630
+
423
631
 
424
632
 
425
633
  private
@@ -486,6 +694,19 @@ module ChordSketchError
486
694
  attr_reader :reason
487
695
 
488
696
 
697
+ def to_s
698
+ "#{self.class.name}(reason=#{@reason.inspect})"
699
+ end
700
+ end
701
+ class ConversionFailed < StandardError
702
+ def initialize(reason)
703
+ @reason = reason
704
+ super()
705
+ end
706
+
707
+ attr_reader :reason
708
+
709
+
489
710
  def to_s
490
711
  "#{self.class.name}(reason=#{@reason.inspect})"
491
712
  end
@@ -568,15 +789,60 @@ module UniFFILib
568
789
  ffi_lib Chordsketch::NATIVE_LIB_PATH
569
790
 
570
791
 
792
+ attach_function :uniffi_chordsketch_ffi_fn_func_chord_diagram_svg,
793
+ [RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
794
+ RustBuffer.by_value
795
+ attach_function :uniffi_chordsketch_ffi_fn_func_convert_chordpro_to_irealb,
796
+ [RustBuffer.by_value, RustCallStatus.by_ref],
797
+ RustBuffer.by_value
798
+ attach_function :uniffi_chordsketch_ffi_fn_func_convert_irealb_to_chordpro_text,
799
+ [RustBuffer.by_value, RustCallStatus.by_ref],
800
+ RustBuffer.by_value
571
801
  attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_html,
572
802
  [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
573
803
  RustBuffer.by_value
804
+ attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_html_body,
805
+ [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
806
+ RustBuffer.by_value
807
+ attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_html_body_with_warnings,
808
+ [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
809
+ RustBuffer.by_value
810
+ attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_html_with_warnings,
811
+ [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
812
+ RustBuffer.by_value
574
813
  attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_pdf,
575
814
  [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
576
815
  RustBuffer.by_value
816
+ attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_pdf_with_warnings,
817
+ [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
818
+ RustBuffer.by_value
577
819
  attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_text,
578
820
  [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
579
821
  RustBuffer.by_value
822
+ attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_text_with_warnings,
823
+ [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
824
+ RustBuffer.by_value
825
+ attach_function :uniffi_chordsketch_ffi_fn_func_parse_irealb,
826
+ [RustBuffer.by_value, RustCallStatus.by_ref],
827
+ RustBuffer.by_value
828
+ attach_function :uniffi_chordsketch_ffi_fn_func_render_html_css,
829
+ [RustCallStatus.by_ref],
830
+ RustBuffer.by_value
831
+ attach_function :uniffi_chordsketch_ffi_fn_func_render_html_css_with_config_json,
832
+ [RustBuffer.by_value, RustCallStatus.by_ref],
833
+ RustBuffer.by_value
834
+ attach_function :uniffi_chordsketch_ffi_fn_func_render_ireal_pdf,
835
+ [RustBuffer.by_value, RustCallStatus.by_ref],
836
+ RustBuffer.by_value
837
+ attach_function :uniffi_chordsketch_ffi_fn_func_render_ireal_png,
838
+ [RustBuffer.by_value, RustCallStatus.by_ref],
839
+ RustBuffer.by_value
840
+ attach_function :uniffi_chordsketch_ffi_fn_func_render_ireal_svg,
841
+ [RustBuffer.by_value, RustCallStatus.by_ref],
842
+ RustBuffer.by_value
843
+ attach_function :uniffi_chordsketch_ffi_fn_func_serialize_irealb,
844
+ [RustBuffer.by_value, RustCallStatus.by_ref],
845
+ RustBuffer.by_value
580
846
  attach_function :uniffi_chordsketch_ffi_fn_func_validate,
581
847
  [RustBuffer.by_value, RustCallStatus.by_ref],
582
848
  RustBuffer.by_value
@@ -595,15 +861,60 @@ module UniFFILib
595
861
  attach_function :ffi_chordsketch_ffi_rustbuffer_reserve,
596
862
  [RustBuffer.by_value, :uint64, RustCallStatus.by_ref],
597
863
  RustBuffer.by_value
864
+ attach_function :uniffi_chordsketch_ffi_checksum_func_chord_diagram_svg,
865
+ [RustCallStatus.by_ref],
866
+ :uint16
867
+ attach_function :uniffi_chordsketch_ffi_checksum_func_convert_chordpro_to_irealb,
868
+ [RustCallStatus.by_ref],
869
+ :uint16
870
+ attach_function :uniffi_chordsketch_ffi_checksum_func_convert_irealb_to_chordpro_text,
871
+ [RustCallStatus.by_ref],
872
+ :uint16
598
873
  attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_html,
599
874
  [RustCallStatus.by_ref],
600
875
  :uint16
876
+ attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_html_body,
877
+ [RustCallStatus.by_ref],
878
+ :uint16
879
+ attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_html_body_with_warnings,
880
+ [RustCallStatus.by_ref],
881
+ :uint16
882
+ attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_html_with_warnings,
883
+ [RustCallStatus.by_ref],
884
+ :uint16
601
885
  attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_pdf,
602
886
  [RustCallStatus.by_ref],
603
887
  :uint16
888
+ attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_pdf_with_warnings,
889
+ [RustCallStatus.by_ref],
890
+ :uint16
604
891
  attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_text,
605
892
  [RustCallStatus.by_ref],
606
893
  :uint16
894
+ attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_text_with_warnings,
895
+ [RustCallStatus.by_ref],
896
+ :uint16
897
+ attach_function :uniffi_chordsketch_ffi_checksum_func_parse_irealb,
898
+ [RustCallStatus.by_ref],
899
+ :uint16
900
+ attach_function :uniffi_chordsketch_ffi_checksum_func_render_html_css,
901
+ [RustCallStatus.by_ref],
902
+ :uint16
903
+ attach_function :uniffi_chordsketch_ffi_checksum_func_render_html_css_with_config_json,
904
+ [RustCallStatus.by_ref],
905
+ :uint16
906
+ attach_function :uniffi_chordsketch_ffi_checksum_func_render_ireal_pdf,
907
+ [RustCallStatus.by_ref],
908
+ :uint16
909
+ attach_function :uniffi_chordsketch_ffi_checksum_func_render_ireal_png,
910
+ [RustCallStatus.by_ref],
911
+ :uint16
912
+ attach_function :uniffi_chordsketch_ffi_checksum_func_render_ireal_svg,
913
+ [RustCallStatus.by_ref],
914
+ :uint16
915
+ attach_function :uniffi_chordsketch_ffi_checksum_func_serialize_irealb,
916
+ [RustCallStatus.by_ref],
917
+ :uint16
607
918
  attach_function :uniffi_chordsketch_ffi_checksum_func_validate,
608
919
  [RustCallStatus.by_ref],
609
920
  :uint16
@@ -620,6 +931,133 @@ end
620
931
 
621
932
 
622
933
 
934
+ # Record type ConversionWithWarnings
935
+ class ConversionWithWarnings
936
+ attr_reader :output, :warnings
937
+
938
+ def initialize(output:, warnings:)
939
+ @output = output
940
+ @warnings = warnings
941
+ end
942
+
943
+ def ==(other)
944
+ if @output != other.output
945
+ return false
946
+ end
947
+ if @warnings != other.warnings
948
+ return false
949
+ end
950
+
951
+ true
952
+ end
953
+ end
954
+
955
+ # Record type PdfRenderWithWarnings
956
+ class PdfRenderWithWarnings
957
+ attr_reader :output, :warnings
958
+
959
+ def initialize(output:, warnings:)
960
+ @output = output
961
+ @warnings = warnings
962
+ end
963
+
964
+ def ==(other)
965
+ if @output != other.output
966
+ return false
967
+ end
968
+ if @warnings != other.warnings
969
+ return false
970
+ end
971
+
972
+ true
973
+ end
974
+ end
975
+
976
+ # Record type TextRenderWithWarnings
977
+ class TextRenderWithWarnings
978
+ attr_reader :output, :warnings
979
+
980
+ def initialize(output:, warnings:)
981
+ @output = output
982
+ @warnings = warnings
983
+ end
984
+
985
+ def ==(other)
986
+ if @output != other.output
987
+ return false
988
+ end
989
+ if @warnings != other.warnings
990
+ return false
991
+ end
992
+
993
+ true
994
+ end
995
+ end
996
+
997
+ # Record type ValidationError
998
+ class ValidationError
999
+ attr_reader :line, :column, :message
1000
+
1001
+ def initialize(line:, column:, message:)
1002
+ @line = line
1003
+ @column = column
1004
+ @message = message
1005
+ end
1006
+
1007
+ def ==(other)
1008
+ if @line != other.line
1009
+ return false
1010
+ end
1011
+ if @column != other.column
1012
+ return false
1013
+ end
1014
+ if @message != other.message
1015
+ return false
1016
+ end
1017
+
1018
+ true
1019
+ end
1020
+ end
1021
+
1022
+
1023
+
1024
+
1025
+
1026
+ def self.chord_diagram_svg(chord, instrument)
1027
+ chord = Chordsketch::uniffi_utf8(chord)
1028
+
1029
+
1030
+ instrument = Chordsketch::uniffi_utf8(instrument)
1031
+
1032
+
1033
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_chord_diagram_svg,RustBuffer.allocFromString(chord),RustBuffer.allocFromString(instrument))
1034
+ return result.consumeIntoOptionalstring
1035
+ end
1036
+
1037
+
1038
+
1039
+
1040
+
1041
+ def self.convert_chordpro_to_irealb(input)
1042
+ input = Chordsketch::uniffi_utf8(input)
1043
+
1044
+
1045
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_convert_chordpro_to_irealb,RustBuffer.allocFromString(input))
1046
+ return result.consumeIntoTypeConversionWithWarnings
1047
+ end
1048
+
1049
+
1050
+
1051
+
1052
+
1053
+ def self.convert_irealb_to_chordpro_text(input)
1054
+ input = Chordsketch::uniffi_utf8(input)
1055
+
1056
+
1057
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_convert_irealb_to_chordpro_text,RustBuffer.allocFromString(input))
1058
+ return result.consumeIntoTypeConversionWithWarnings
1059
+ end
1060
+
623
1061
 
624
1062
 
625
1063
 
@@ -642,6 +1080,60 @@ end
642
1080
 
643
1081
 
644
1082
 
1083
+ def self.parse_and_render_html_body(input, config_json, transpose)
1084
+ input = Chordsketch::uniffi_utf8(input)
1085
+
1086
+
1087
+ config_json = (config_json ? Chordsketch::uniffi_utf8(config_json) : nil)
1088
+ RustBuffer.check_lower_Optionalstring(config_json)
1089
+
1090
+ transpose = (transpose ? Chordsketch::uniffi_in_range(transpose, "i8", -2**7, 2**7) : nil)
1091
+ RustBuffer.check_lower_Optionali8(transpose)
1092
+
1093
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_parse_and_render_html_body,RustBuffer.allocFromString(input),RustBuffer.alloc_from_Optionalstring(config_json),RustBuffer.alloc_from_Optionali8(transpose))
1094
+ return result.consumeIntoString
1095
+ end
1096
+
1097
+
1098
+
1099
+
1100
+
1101
+ def self.parse_and_render_html_body_with_warnings(input, config_json, transpose)
1102
+ input = Chordsketch::uniffi_utf8(input)
1103
+
1104
+
1105
+ config_json = (config_json ? Chordsketch::uniffi_utf8(config_json) : nil)
1106
+ RustBuffer.check_lower_Optionalstring(config_json)
1107
+
1108
+ transpose = (transpose ? Chordsketch::uniffi_in_range(transpose, "i8", -2**7, 2**7) : nil)
1109
+ RustBuffer.check_lower_Optionali8(transpose)
1110
+
1111
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_parse_and_render_html_body_with_warnings,RustBuffer.allocFromString(input),RustBuffer.alloc_from_Optionalstring(config_json),RustBuffer.alloc_from_Optionali8(transpose))
1112
+ return result.consumeIntoTypeTextRenderWithWarnings
1113
+ end
1114
+
1115
+
1116
+
1117
+
1118
+
1119
+ def self.parse_and_render_html_with_warnings(input, config_json, transpose)
1120
+ input = Chordsketch::uniffi_utf8(input)
1121
+
1122
+
1123
+ config_json = (config_json ? Chordsketch::uniffi_utf8(config_json) : nil)
1124
+ RustBuffer.check_lower_Optionalstring(config_json)
1125
+
1126
+ transpose = (transpose ? Chordsketch::uniffi_in_range(transpose, "i8", -2**7, 2**7) : nil)
1127
+ RustBuffer.check_lower_Optionali8(transpose)
1128
+
1129
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_parse_and_render_html_with_warnings,RustBuffer.allocFromString(input),RustBuffer.alloc_from_Optionalstring(config_json),RustBuffer.alloc_from_Optionali8(transpose))
1130
+ return result.consumeIntoTypeTextRenderWithWarnings
1131
+ end
1132
+
1133
+
1134
+
1135
+
1136
+
645
1137
  def self.parse_and_render_pdf(input, config_json, transpose)
646
1138
  input = Chordsketch::uniffi_utf8(input)
647
1139
 
@@ -660,6 +1152,24 @@ end
660
1152
 
661
1153
 
662
1154
 
1155
+ def self.parse_and_render_pdf_with_warnings(input, config_json, transpose)
1156
+ input = Chordsketch::uniffi_utf8(input)
1157
+
1158
+
1159
+ config_json = (config_json ? Chordsketch::uniffi_utf8(config_json) : nil)
1160
+ RustBuffer.check_lower_Optionalstring(config_json)
1161
+
1162
+ transpose = (transpose ? Chordsketch::uniffi_in_range(transpose, "i8", -2**7, 2**7) : nil)
1163
+ RustBuffer.check_lower_Optionali8(transpose)
1164
+
1165
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_parse_and_render_pdf_with_warnings,RustBuffer.allocFromString(input),RustBuffer.alloc_from_Optionalstring(config_json),RustBuffer.alloc_from_Optionali8(transpose))
1166
+ return result.consumeIntoTypePdfRenderWithWarnings
1167
+ end
1168
+
1169
+
1170
+
1171
+
1172
+
663
1173
  def self.parse_and_render_text(input, config_json, transpose)
664
1174
  input = Chordsketch::uniffi_utf8(input)
665
1175
 
@@ -678,12 +1188,111 @@ end
678
1188
 
679
1189
 
680
1190
 
1191
+ def self.parse_and_render_text_with_warnings(input, config_json, transpose)
1192
+ input = Chordsketch::uniffi_utf8(input)
1193
+
1194
+
1195
+ config_json = (config_json ? Chordsketch::uniffi_utf8(config_json) : nil)
1196
+ RustBuffer.check_lower_Optionalstring(config_json)
1197
+
1198
+ transpose = (transpose ? Chordsketch::uniffi_in_range(transpose, "i8", -2**7, 2**7) : nil)
1199
+ RustBuffer.check_lower_Optionali8(transpose)
1200
+
1201
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_parse_and_render_text_with_warnings,RustBuffer.allocFromString(input),RustBuffer.alloc_from_Optionalstring(config_json),RustBuffer.alloc_from_Optionali8(transpose))
1202
+ return result.consumeIntoTypeTextRenderWithWarnings
1203
+ end
1204
+
1205
+
1206
+
1207
+
1208
+
1209
+ def self.parse_irealb(input)
1210
+ input = Chordsketch::uniffi_utf8(input)
1211
+
1212
+
1213
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_parse_irealb,RustBuffer.allocFromString(input))
1214
+ return result.consumeIntoString
1215
+ end
1216
+
1217
+
1218
+
1219
+
1220
+
1221
+ def self.render_html_css()
1222
+ result = Chordsketch.rust_call(:uniffi_chordsketch_ffi_fn_func_render_html_css,)
1223
+ return result.consumeIntoString
1224
+ end
1225
+
1226
+
1227
+
1228
+
1229
+
1230
+ def self.render_html_css_with_config_json(config_json)
1231
+ config_json = (config_json ? Chordsketch::uniffi_utf8(config_json) : nil)
1232
+ RustBuffer.check_lower_Optionalstring(config_json)
1233
+
1234
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_render_html_css_with_config_json,RustBuffer.alloc_from_Optionalstring(config_json))
1235
+ return result.consumeIntoString
1236
+ end
1237
+
1238
+
1239
+
1240
+
1241
+
1242
+ def self.render_ireal_pdf(input)
1243
+ input = Chordsketch::uniffi_utf8(input)
1244
+
1245
+
1246
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_render_ireal_pdf,RustBuffer.allocFromString(input))
1247
+ return result.consumeIntoBytes
1248
+ end
1249
+
1250
+
1251
+
1252
+
1253
+
1254
+ def self.render_ireal_png(input)
1255
+ input = Chordsketch::uniffi_utf8(input)
1256
+
1257
+
1258
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_render_ireal_png,RustBuffer.allocFromString(input))
1259
+ return result.consumeIntoBytes
1260
+ end
1261
+
1262
+
1263
+
1264
+
1265
+
1266
+ def self.render_ireal_svg(input)
1267
+ input = Chordsketch::uniffi_utf8(input)
1268
+
1269
+
1270
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_render_ireal_svg,RustBuffer.allocFromString(input))
1271
+ return result.consumeIntoString
1272
+ end
1273
+
1274
+
1275
+
1276
+
1277
+
1278
+ def self.serialize_irealb(input)
1279
+ input = Chordsketch::uniffi_utf8(input)
1280
+
1281
+
1282
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_serialize_irealb,RustBuffer.allocFromString(input))
1283
+ return result.consumeIntoString
1284
+ end
1285
+
1286
+
1287
+
1288
+
1289
+
681
1290
  def self.validate(input)
682
1291
  input = Chordsketch::uniffi_utf8(input)
683
1292
 
684
1293
 
685
1294
  result = Chordsketch.rust_call(:uniffi_chordsketch_ffi_fn_func_validate,RustBuffer.allocFromString(input))
686
- return result.consumeIntoSequencestring
1295
+ return result.consumeIntoSequenceTypeValidationError
687
1296
  end
688
1297
 
689
1298
 
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chordsketch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - koedame
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-18 00:00:00.000000000 Z
11
+ date: 2026-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi