@r2o3/rgchart-browser 0.0.11 → 0.0.12

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.
package/README.md CHANGED
@@ -27,7 +27,7 @@ A library for parsing and writing charts for various rhythm games. It supports c
27
27
  Add this to your `Cargo.toml`:
28
28
  ```toml
29
29
  [dependencies]
30
- rgchart = "0.0.11"
30
+ rgchart = "0.0.12"
31
31
  ```
32
32
 
33
33
  Or run:
@@ -98,18 +98,18 @@ use rgchart::OsuFile;
98
98
  use rgchart::QuaFile;
99
99
 
100
100
  // Write from OsuFile to to osu! format
101
- let osu_string = osu_chart.to_osu_format_mania(soundbank);
101
+ let osu_string = osu_chart.to_str_mania(soundbank);
102
102
 
103
103
  // assuming you don't have a soundbank
104
- let osu_string = osu_chart.to_osu_format_mania_no_soundbank();
104
+ let osu_string = osu_chart.to_str_mania_no_soundbank();
105
105
 
106
106
  // other modes for osu!, it will interprete the hit objects values as is for the mode you're writing to.
107
- let osu_string = osu_chart.to_osu_format();
107
+ let osu_string = osu_chart.to_str();
108
108
  // or
109
- let osu_string = osu_chart.to_osu_format_standard(soundbank);
109
+ let osu_string = osu_chart.to_str_standard(soundbank);
110
110
 
111
- let osu_string = osu_chart.to_osu_format_taiko(soundbank);
112
- let osu_string = osu_chart.to_osu_format_catch(soundbank);
111
+ let osu_string = osu_chart.to_str_taiko(soundbank);
112
+ let osu_string = osu_chart.to_str_catch(soundbank);
113
113
 
114
114
  // Write from QuaFile to Quaver format
115
115
  let qua_string = qua_chart.to_str().expect("Failed to write Quaver chart");
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "menvae <menvaedev@gmail.com>"
6
6
  ],
7
7
  "description": "A library for parsing and writing rhythm game charts.",
8
- "version": "0.0.11",
8
+ "version": "0.0.12",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/rgchart.d.ts CHANGED
@@ -210,23 +210,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
210
210
 
211
211
  export interface InitOutput {
212
212
  readonly memory: WebAssembly.Memory;
213
- readonly __wbg_metadata_free: (a: number, b: number) => void;
214
- readonly __wbg_get_metadata_title: (a: number) => [number, number];
215
- readonly __wbg_set_metadata_title: (a: number, b: number, c: number) => void;
216
- readonly __wbg_get_metadata_alt_title: (a: number) => [number, number];
217
- readonly __wbg_set_metadata_alt_title: (a: number, b: number, c: number) => void;
218
- readonly __wbg_get_metadata_artist: (a: number) => [number, number];
219
- readonly __wbg_set_metadata_artist: (a: number, b: number, c: number) => void;
220
- readonly __wbg_get_metadata_alt_artist: (a: number) => [number, number];
221
- readonly __wbg_set_metadata_alt_artist: (a: number, b: number, c: number) => void;
222
- readonly __wbg_get_metadata_creator: (a: number) => [number, number];
223
- readonly __wbg_set_metadata_creator: (a: number, b: number, c: number) => void;
224
- readonly __wbg_get_metadata_genre: (a: number) => [number, number];
225
- readonly __wbg_set_metadata_genre: (a: number, b: number, c: number) => void;
226
- readonly __wbg_get_metadata_tags: (a: number) => [number, number];
227
- readonly __wbg_set_metadata_tags: (a: number, b: number, c: number) => void;
228
- readonly __wbg_get_metadata_source: (a: number) => [number, number];
229
- readonly __wbg_set_metadata_source: (a: number, b: number, c: number) => void;
213
+ readonly __wbg_hitobjects_free: (a: number, b: number) => void;
230
214
  readonly __wbg_key_free: (a: number, b: number) => void;
231
215
  readonly __wbg_get_key_key_type: (a: number) => number;
232
216
  readonly __wbg_set_key_key_type: (a: number, b: number) => void;
@@ -296,7 +280,17 @@ export interface InitOutput {
296
280
  readonly __wbg_set_key_slider_end_time: (a: number, b: number) => void;
297
281
  readonly __wbg_set_osuhitobject_end_time: (a: number, b: number) => void;
298
282
  readonly __wbg_get_osuhitobject_x: (a: number) => number;
299
- readonly __wbg_hitobjects_free: (a: number, b: number) => void;
283
+ readonly __wbg_genericmaniachart_free: (a: number, b: number) => void;
284
+ readonly __wbg_get_genericmaniachart_metadata: (a: number) => number;
285
+ readonly __wbg_set_genericmaniachart_metadata: (a: number, b: number) => void;
286
+ readonly __wbg_get_genericmaniachart_chartinfo: (a: number) => number;
287
+ readonly __wbg_set_genericmaniachart_chartinfo: (a: number, b: number) => void;
288
+ readonly __wbg_get_genericmaniachart_timing_points: (a: number) => number;
289
+ readonly __wbg_set_genericmaniachart_timing_points: (a: number, b: number) => void;
290
+ readonly __wbg_get_genericmaniachart_hitobjects: (a: number) => number;
291
+ readonly __wbg_set_genericmaniachart_hitobjects: (a: number, b: number) => void;
292
+ readonly __wbg_get_genericmaniachart_soundbank: (a: number) => number;
293
+ readonly __wbg_set_genericmaniachart_soundbank: (a: number, b: number) => void;
300
294
  readonly writeToOsuGeneric: (a: number) => [number, number, number, number];
301
295
  readonly writeToSmGeneric: (a: number) => [number, number, number, number];
302
296
  readonly writeToQuaGeneric: (a: number) => [number, number, number, number];
@@ -357,28 +351,34 @@ export interface InitOutput {
357
351
  readonly __wbg_set_chartinfo_key_count: (a: number, b: number) => void;
358
352
  readonly chartinfo_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => number;
359
353
  readonly chartinfo_empty: () => number;
360
- readonly __wbg_genericmaniachart_free: (a: number, b: number) => void;
361
- readonly __wbg_get_genericmaniachart_metadata: (a: number) => number;
362
- readonly __wbg_set_genericmaniachart_metadata: (a: number, b: number) => void;
363
- readonly __wbg_get_genericmaniachart_chartinfo: (a: number) => number;
364
- readonly __wbg_set_genericmaniachart_chartinfo: (a: number, b: number) => void;
365
- readonly __wbg_get_genericmaniachart_timing_points: (a: number) => number;
366
- readonly __wbg_set_genericmaniachart_timing_points: (a: number, b: number) => void;
367
- readonly __wbg_get_genericmaniachart_hitobjects: (a: number) => number;
368
- readonly __wbg_set_genericmaniachart_hitobjects: (a: number, b: number) => void;
369
- readonly __wbg_get_genericmaniachart_soundbank: (a: number) => number;
370
- readonly __wbg_set_genericmaniachart_soundbank: (a: number, b: number) => void;
371
354
  readonly parseFromOsuGeneric: (a: number, b: number) => [number, number, number];
372
355
  readonly parseFromSmGeneric: (a: number, b: number) => [number, number, number];
373
356
  readonly parseFromQuaGeneric: (a: number, b: number) => [number, number, number];
374
357
  readonly parseFromFscGeneric: (a: number, b: number) => [number, number, number];
358
+ readonly __wbg_metadata_free: (a: number, b: number) => void;
359
+ readonly __wbg_get_metadata_title: (a: number) => [number, number];
360
+ readonly __wbg_set_metadata_title: (a: number, b: number, c: number) => void;
361
+ readonly __wbg_get_metadata_alt_title: (a: number) => [number, number];
362
+ readonly __wbg_set_metadata_alt_title: (a: number, b: number, c: number) => void;
363
+ readonly __wbg_get_metadata_artist: (a: number) => [number, number];
364
+ readonly __wbg_set_metadata_artist: (a: number, b: number, c: number) => void;
365
+ readonly __wbg_get_metadata_alt_artist: (a: number) => [number, number];
366
+ readonly __wbg_set_metadata_alt_artist: (a: number, b: number, c: number) => void;
367
+ readonly __wbg_get_metadata_creator: (a: number) => [number, number];
368
+ readonly __wbg_set_metadata_creator: (a: number, b: number, c: number) => void;
369
+ readonly __wbg_get_metadata_genre: (a: number) => [number, number];
370
+ readonly __wbg_set_metadata_genre: (a: number, b: number, c: number) => void;
371
+ readonly __wbg_get_metadata_tags: (a: number) => [number, number];
372
+ readonly __wbg_set_metadata_tags: (a: number, b: number, c: number) => void;
373
+ readonly __wbg_get_metadata_source: (a: number) => [number, number];
374
+ readonly __wbg_set_metadata_source: (a: number, b: number, c: number) => void;
375
375
  readonly __wbindgen_export_0: WebAssembly.Table;
376
376
  readonly __wbindgen_malloc: (a: number, b: number) => number;
377
377
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
378
+ readonly __externref_table_dealloc: (a: number) => void;
378
379
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
379
380
  readonly __externref_drop_slice: (a: number, b: number) => void;
380
381
  readonly __externref_table_alloc: () => number;
381
- readonly __externref_table_dealloc: (a: number) => void;
382
382
  readonly __wbindgen_start: () => void;
383
383
  }
384
384
 
package/rgchart.js CHANGED
@@ -87,33 +87,6 @@ function getDataViewMemory0() {
87
87
  return cachedDataViewMemory0;
88
88
  }
89
89
 
90
- function getArrayJsValueFromWasm0(ptr, len) {
91
- ptr = ptr >>> 0;
92
- const mem = getDataViewMemory0();
93
- const result = [];
94
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
95
- result.push(wasm.__wbindgen_export_0.get(mem.getUint32(i, true)));
96
- }
97
- wasm.__externref_drop_slice(ptr, len);
98
- return result;
99
- }
100
-
101
- function addToExternrefTable0(obj) {
102
- const idx = wasm.__externref_table_alloc();
103
- wasm.__wbindgen_export_0.set(idx, obj);
104
- return idx;
105
- }
106
-
107
- function passArrayJsValueToWasm0(array, malloc) {
108
- const ptr = malloc(array.length * 4, 4) >>> 0;
109
- for (let i = 0; i < array.length; i++) {
110
- const add = addToExternrefTable0(array[i]);
111
- getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
112
- }
113
- WASM_VECTOR_LEN = array.length;
114
- return ptr;
115
- }
116
-
117
90
  function _assertClass(instance, klass) {
118
91
  if (!(instance instanceof klass)) {
119
92
  throw new Error(`expected instance of ${klass.name}`);
@@ -221,6 +194,32 @@ export function writeToFscGeneric(chart) {
221
194
  }
222
195
  }
223
196
 
197
+ function getArrayJsValueFromWasm0(ptr, len) {
198
+ ptr = ptr >>> 0;
199
+ const mem = getDataViewMemory0();
200
+ const result = [];
201
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
202
+ result.push(wasm.__wbindgen_export_0.get(mem.getUint32(i, true)));
203
+ }
204
+ wasm.__externref_drop_slice(ptr, len);
205
+ return result;
206
+ }
207
+
208
+ function addToExternrefTable0(obj) {
209
+ const idx = wasm.__externref_table_alloc();
210
+ wasm.__wbindgen_export_0.set(idx, obj);
211
+ return idx;
212
+ }
213
+
214
+ function passArrayJsValueToWasm0(array, malloc) {
215
+ const ptr = malloc(array.length * 4, 4) >>> 0;
216
+ for (let i = 0; i < array.length; i++) {
217
+ const add = addToExternrefTable0(array[i]);
218
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
219
+ }
220
+ WASM_VECTOR_LEN = array.length;
221
+ return ptr;
222
+ }
224
223
  /**
225
224
  * @param {string} raw_chart
226
225
  * @returns {GenericManiaChart}
package/rgchart_bg.wasm CHANGED
Binary file