@rel-packages/osu-beatmap-parser 1.0.7 → 1.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.
- package/README.md +4 -12
- package/dist/index.d.ts +12 -2
- package/dist/index.js +32 -1
- package/dist/lib/bindings.d.ts +1 -1
- package/dist/lib/wasm-browser.d.ts +2 -0
- package/dist/lib/wasm-browser.js +23 -0
- package/dist/lib/wasm-wrapper.d.ts +14 -1
- package/dist/lib/wasm-wrapper.js +87 -25
- package/dist/types/types.d.ts +135 -0
- package/package.json +53 -47
- package/prebuilds/linux-x64/osu-beatmap-parser.node +0 -0
- package/prebuilds/win32-x64/osu-beatmap-parser.node +0 -0
- package/dist/types.d.ts +0 -9
- /package/dist/{types.js → types/types.js} +0 -0
package/README.md
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
## osu-beatmap-parser
|
|
2
2
|
|
|
3
|
-
.osu parser
|
|
3
|
+
native .osu beatmap parser used on [osu-stuff](https://github.com/mezleca/osu-stuff)
|
|
4
4
|
|
|
5
5
|
## installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install osu-beatmap-parser
|
|
8
|
+
npm install @rel-packages/osu-beatmap-parser
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## usage
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
npm install
|
|
15
|
-
npm run compile
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## TODO
|
|
19
|
-
- [ ] native: handle "Storyboard" key
|
|
20
|
-
- [ ] native: handle beatmap file version
|
|
21
|
-
- [ ] native: handle lazer files (like, if we're trying to get AudioLocation from a lazer file, we will need to follow the hashed lazer path)
|
|
13
|
+
check [examples](https://github.com/mezleca/osu-beatmap-parser/tree/main/examples) for wasm / nodejs usage examples.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { OsuKey, OsuInput } from "./types";
|
|
1
|
+
import { OsuKey, OsuInput, OsuFileFormat } from "./types/types";
|
|
2
2
|
export declare const get_property: (data: Uint8Array, key: OsuKey) => string;
|
|
3
3
|
export declare const get_properties: (input: Uint8Array | OsuInput, keys: OsuKey[]) => Record<string, string>;
|
|
4
|
-
export
|
|
4
|
+
export declare const get_section: (data: Uint8Array, section: string) => string[];
|
|
5
|
+
export declare const parse: (input: Uint8Array | OsuInput) => OsuFileFormat;
|
|
6
|
+
declare const parser: {
|
|
7
|
+
get_property: (data: Uint8Array, key: OsuKey) => string;
|
|
8
|
+
get_properties: (input: Uint8Array | OsuInput, keys: OsuKey[]) => Record<string, string>;
|
|
9
|
+
get_section: (data: Uint8Array, section: string) => string[];
|
|
10
|
+
parse: (input: Uint8Array | OsuInput) => OsuFileFormat;
|
|
11
|
+
};
|
|
12
|
+
export type { OsuKey, OsuInput, OsuFileFormat };
|
|
13
|
+
export * from "./types/types";
|
|
14
|
+
export default parser;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.get_properties = exports.get_property = void 0;
|
|
17
|
+
exports.parse = exports.get_section = exports.get_properties = exports.get_property = void 0;
|
|
4
18
|
const bindings_1 = require("./lib/bindings");
|
|
5
19
|
const get_property = (data, key) => {
|
|
6
20
|
return bindings_1.native.get_property(data, key);
|
|
@@ -15,3 +29,20 @@ const get_properties = (input, keys) => {
|
|
|
15
29
|
return result;
|
|
16
30
|
};
|
|
17
31
|
exports.get_properties = get_properties;
|
|
32
|
+
const get_section = (data, section) => {
|
|
33
|
+
return bindings_1.native.get_section(data, section);
|
|
34
|
+
};
|
|
35
|
+
exports.get_section = get_section;
|
|
36
|
+
const parse = (input) => {
|
|
37
|
+
const data = input instanceof Uint8Array ? input : input.data;
|
|
38
|
+
return bindings_1.native.parse(data);
|
|
39
|
+
};
|
|
40
|
+
exports.parse = parse;
|
|
41
|
+
const parser = {
|
|
42
|
+
get_property: exports.get_property,
|
|
43
|
+
get_properties: exports.get_properties,
|
|
44
|
+
get_section: exports.get_section,
|
|
45
|
+
parse: exports.parse
|
|
46
|
+
};
|
|
47
|
+
__exportStar(require("./types/types"), exports);
|
|
48
|
+
exports.default = parser;
|
package/dist/lib/bindings.d.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.init_wasm_from_url = exports.is_wasm_ready = exports.set_wasm_factory = exports.parse = exports.get_section = exports.get_properties = exports.get_property = exports.init_wasm = void 0;
|
|
4
|
+
const wasm_wrapper_1 = require("./wasm-wrapper");
|
|
5
|
+
Object.defineProperty(exports, "init_wasm", { enumerable: true, get: function () { return wasm_wrapper_1.init_wasm; } });
|
|
6
|
+
Object.defineProperty(exports, "get_property", { enumerable: true, get: function () { return wasm_wrapper_1.get_property; } });
|
|
7
|
+
Object.defineProperty(exports, "get_properties", { enumerable: true, get: function () { return wasm_wrapper_1.get_properties; } });
|
|
8
|
+
Object.defineProperty(exports, "get_section", { enumerable: true, get: function () { return wasm_wrapper_1.get_section; } });
|
|
9
|
+
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return wasm_wrapper_1.parse; } });
|
|
10
|
+
Object.defineProperty(exports, "set_wasm_factory", { enumerable: true, get: function () { return wasm_wrapper_1.set_wasm_factory; } });
|
|
11
|
+
Object.defineProperty(exports, "is_wasm_ready", { enumerable: true, get: function () { return wasm_wrapper_1.is_wasm_ready; } });
|
|
12
|
+
Object.defineProperty(exports, "init_wasm_from_url", { enumerable: true, get: function () { return wasm_wrapper_1.init_wasm_from_url; } });
|
|
13
|
+
const api = {
|
|
14
|
+
init_wasm: wasm_wrapper_1.init_wasm,
|
|
15
|
+
get_property: wasm_wrapper_1.get_property,
|
|
16
|
+
get_properties: wasm_wrapper_1.get_properties,
|
|
17
|
+
get_section: wasm_wrapper_1.get_section,
|
|
18
|
+
parse: wasm_wrapper_1.parse,
|
|
19
|
+
set_wasm_factory: wasm_wrapper_1.set_wasm_factory,
|
|
20
|
+
is_wasm_ready: wasm_wrapper_1.is_wasm_ready,
|
|
21
|
+
init_wasm_from_url: wasm_wrapper_1.init_wasm_from_url,
|
|
22
|
+
};
|
|
23
|
+
globalThis.beatmap_parser = api;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import type { OsuFileFormat } from "../types/types";
|
|
2
|
+
type wasm_init_options = {
|
|
3
|
+
factory?: (module_config?: Record<string, unknown>) => any;
|
|
4
|
+
script_url?: string;
|
|
5
|
+
global_name?: string;
|
|
6
|
+
module_config?: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
export declare const set_wasm_factory: (factory: (module_config?: Record<string, unknown>) => any, global_name?: string) => void;
|
|
9
|
+
export declare const is_wasm_ready: () => boolean;
|
|
10
|
+
export declare const init_wasm: (options?: wasm_init_options) => Promise<void>;
|
|
11
|
+
export declare const init_wasm_from_url: (script_url: string, module_config?: Record<string, unknown>, global_name?: string) => Promise<void>;
|
|
2
12
|
export declare const get_property: (data: Uint8Array, key: string) => string;
|
|
3
13
|
export declare const get_properties: (data: Uint8Array, keys: string[]) => Record<string, string>;
|
|
14
|
+
export declare const get_section: (data: Uint8Array, section: string) => string[];
|
|
15
|
+
export declare const parse: (data: Uint8Array) => OsuFileFormat;
|
|
16
|
+
export {};
|
package/dist/lib/wasm-wrapper.js
CHANGED
|
@@ -1,33 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.get_properties = exports.get_property = exports.init_wasm = void 0;
|
|
4
|
-
console.log("[parser] wrapper loaded");
|
|
3
|
+
exports.parse = exports.get_section = exports.get_properties = exports.get_property = exports.init_wasm_from_url = exports.init_wasm = exports.is_wasm_ready = exports.set_wasm_factory = void 0;
|
|
5
4
|
let wasm_instance = null;
|
|
6
5
|
let init_promise = null;
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
let wasm_factory = null;
|
|
7
|
+
let wasm_global_name = "create_osu_parser";
|
|
8
|
+
const script_loaders = new Map();
|
|
9
|
+
const get_global_name = (options) => {
|
|
10
|
+
return options.global_name || wasm_global_name;
|
|
9
11
|
};
|
|
10
|
-
const
|
|
12
|
+
const load_script = (script_url) => {
|
|
13
|
+
const existing = script_loaders.get(script_url);
|
|
14
|
+
if (existing)
|
|
15
|
+
return existing;
|
|
16
|
+
const loader = new Promise((resolve, reject) => {
|
|
17
|
+
if (typeof document == "undefined") {
|
|
18
|
+
reject(new Error("script loading requires a browser environment"));
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const script = document.createElement("script");
|
|
22
|
+
script.src = script_url;
|
|
23
|
+
script.async = true;
|
|
24
|
+
script.onload = () => resolve();
|
|
25
|
+
script.onerror = () => reject(new Error(`failed to load wasm script: ${script_url}`));
|
|
26
|
+
document.head.appendChild(script);
|
|
27
|
+
});
|
|
28
|
+
script_loaders.set(script_url, loader);
|
|
29
|
+
return loader;
|
|
30
|
+
};
|
|
31
|
+
const resolve_factory = async (options) => {
|
|
32
|
+
if (options.factory)
|
|
33
|
+
return options.factory;
|
|
34
|
+
if (wasm_factory)
|
|
35
|
+
return wasm_factory;
|
|
36
|
+
if (options.script_url) {
|
|
37
|
+
await load_script(options.script_url);
|
|
38
|
+
}
|
|
39
|
+
const global_name = get_global_name(options);
|
|
40
|
+
return globalThis[global_name];
|
|
41
|
+
};
|
|
42
|
+
const set_wasm_factory = (factory, global_name) => {
|
|
43
|
+
wasm_factory = factory;
|
|
44
|
+
if (global_name) {
|
|
45
|
+
wasm_global_name = global_name;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.set_wasm_factory = set_wasm_factory;
|
|
49
|
+
const is_wasm_ready = () => {
|
|
50
|
+
return wasm_instance != null;
|
|
51
|
+
};
|
|
52
|
+
exports.is_wasm_ready = is_wasm_ready;
|
|
53
|
+
const init_wasm = async (options = {}) => {
|
|
11
54
|
if (wasm_instance)
|
|
12
55
|
return;
|
|
13
56
|
if (init_promise)
|
|
14
57
|
return init_promise;
|
|
15
58
|
init_promise = (async () => {
|
|
16
|
-
const factory =
|
|
17
|
-
if (typeof factory
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
try {
|
|
21
|
-
wasm_instance = await factory();
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
console.error(e);
|
|
25
|
-
throw e;
|
|
59
|
+
const factory = await resolve_factory(options);
|
|
60
|
+
if (typeof factory != "function") {
|
|
61
|
+
const global_name = get_global_name(options);
|
|
62
|
+
throw new Error(`wasm factory not found: ${global_name}`);
|
|
26
63
|
}
|
|
64
|
+
wasm_instance = await factory(options.module_config);
|
|
27
65
|
})();
|
|
28
|
-
return init_promise
|
|
66
|
+
return init_promise.catch((err) => {
|
|
67
|
+
init_promise = null;
|
|
68
|
+
throw err;
|
|
69
|
+
});
|
|
29
70
|
};
|
|
30
71
|
exports.init_wasm = init_wasm;
|
|
72
|
+
const init_wasm_from_url = async (script_url, module_config = {}, global_name) => {
|
|
73
|
+
return (0, exports.init_wasm)({ script_url, module_config, global_name });
|
|
74
|
+
};
|
|
75
|
+
exports.init_wasm_from_url = init_wasm_from_url;
|
|
31
76
|
const get_property = (data, key) => {
|
|
32
77
|
if (wasm_instance == null)
|
|
33
78
|
throw new Error("wasm not initialized");
|
|
@@ -54,12 +99,29 @@ const get_properties = (data, keys) => {
|
|
|
54
99
|
}
|
|
55
100
|
};
|
|
56
101
|
exports.get_properties = get_properties;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
102
|
+
const get_section = (data, section) => {
|
|
103
|
+
if (wasm_instance == null)
|
|
104
|
+
throw new Error("wasm not initialized");
|
|
105
|
+
const buffer_ptr = wasm_instance._malloc(data.length);
|
|
106
|
+
wasm_instance.HEAPU8.set(data, buffer_ptr);
|
|
107
|
+
try {
|
|
108
|
+
return wasm_instance.get_section(buffer_ptr, data.length, section);
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
wasm_instance._free(buffer_ptr);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
exports.get_section = get_section;
|
|
115
|
+
const parse = (data) => {
|
|
116
|
+
if (wasm_instance == null)
|
|
117
|
+
throw new Error("wasm not initialized");
|
|
118
|
+
const buffer_ptr = wasm_instance._malloc(data.length);
|
|
119
|
+
wasm_instance.HEAPU8.set(data, buffer_ptr);
|
|
120
|
+
try {
|
|
121
|
+
return wasm_instance.parse(buffer_ptr, data.length);
|
|
122
|
+
}
|
|
123
|
+
finally {
|
|
124
|
+
wasm_instance._free(buffer_ptr);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
exports.parse = parse;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export type OsuKey = "AudioFilename" | "AudioLeadIn" | "AudioHash" | "PreviewTime" | "Countdown" | "SampleSet" | "StackLeniency" | "Mode" | "LetterboxInBreaks" | "StoryFireInFront" | "UseSkinSprites" | "AlwaysShowPlayfield" | "OverlayPosition" | "SkinPreference" | "EpilepsyWarning" | "CountdownOffset" | "SpecialStyle" | "WidescreenStoryboard" | "SamplesMatchPlaybackRate" | "Bookmarks" | "DistanceSpacing" | "BeatDivisor" | "GridSize" | "TimelineZoom" | "Title" | "TitleUnicode" | "Artist" | "ArtistUnicode" | "Creator" | "Version" | "Source" | "Tags" | "BeatmapID" | "BeatmapSetID" | "HPDrainRate" | "CircleSize" | "OverallDifficulty" | "ApproachRate" | "SliderMultiplier" | "SliderTickRate" | "Background" | "Video" | "Storyboard";
|
|
2
|
+
export interface OsuInput {
|
|
3
|
+
data: Uint8Array;
|
|
4
|
+
id?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GeneralSection {
|
|
7
|
+
AudioFilename: string;
|
|
8
|
+
AudioLeadIn: number;
|
|
9
|
+
AudioHash: string;
|
|
10
|
+
PreviewTime: number;
|
|
11
|
+
Countdown: number;
|
|
12
|
+
SampleSet: string;
|
|
13
|
+
StackLeniency: number;
|
|
14
|
+
Mode: number;
|
|
15
|
+
LetterboxInBreaks: number;
|
|
16
|
+
StoryFireInFront: number;
|
|
17
|
+
UseSkinSprites: number;
|
|
18
|
+
AlwaysShowPlayfield: number;
|
|
19
|
+
OverlayPosition: string;
|
|
20
|
+
SkinPreference: string;
|
|
21
|
+
EpilepsyWarning: number;
|
|
22
|
+
CountdownOffset: number;
|
|
23
|
+
SpecialStyle: number;
|
|
24
|
+
WidescreenStoryboard: number;
|
|
25
|
+
SamplesMatchPlaybackRate: number;
|
|
26
|
+
}
|
|
27
|
+
export interface EditorSection {
|
|
28
|
+
Bookmarks: number[];
|
|
29
|
+
DistanceSpacing: number;
|
|
30
|
+
BeatDivisor: number;
|
|
31
|
+
GridSize: number;
|
|
32
|
+
TimelineZoom: number;
|
|
33
|
+
}
|
|
34
|
+
export interface MetadataSection {
|
|
35
|
+
Title: string;
|
|
36
|
+
TitleUnicode: string;
|
|
37
|
+
Artist: string;
|
|
38
|
+
ArtistUnicode: string;
|
|
39
|
+
Creator: string;
|
|
40
|
+
Version: string;
|
|
41
|
+
Source: string;
|
|
42
|
+
Tags: string;
|
|
43
|
+
BeatmapID: number;
|
|
44
|
+
BeatmapSetID: number;
|
|
45
|
+
}
|
|
46
|
+
export interface DifficultySection {
|
|
47
|
+
HPDrainRate: number;
|
|
48
|
+
CircleSize: number;
|
|
49
|
+
OverallDifficulty: number;
|
|
50
|
+
ApproachRate: number;
|
|
51
|
+
SliderMultiplier: number;
|
|
52
|
+
SliderTickRate: number;
|
|
53
|
+
}
|
|
54
|
+
export interface EventBackground {
|
|
55
|
+
filename: string;
|
|
56
|
+
xOffset: number;
|
|
57
|
+
yOffset: number;
|
|
58
|
+
}
|
|
59
|
+
export interface EventVideo {
|
|
60
|
+
filename: string;
|
|
61
|
+
startTime: number;
|
|
62
|
+
xOffset: number;
|
|
63
|
+
yOffset: number;
|
|
64
|
+
}
|
|
65
|
+
export interface EventBreak {
|
|
66
|
+
startTime: number;
|
|
67
|
+
endTime: number;
|
|
68
|
+
}
|
|
69
|
+
export interface EventsSection {
|
|
70
|
+
background: EventBackground | null;
|
|
71
|
+
video: EventVideo | null;
|
|
72
|
+
breaks: EventBreak[];
|
|
73
|
+
}
|
|
74
|
+
export interface TimingPoint {
|
|
75
|
+
time: number;
|
|
76
|
+
beatLength: number;
|
|
77
|
+
meter: number;
|
|
78
|
+
sampleSet: number;
|
|
79
|
+
sampleIndex: number;
|
|
80
|
+
volume: number;
|
|
81
|
+
uninherited: number;
|
|
82
|
+
effects: number;
|
|
83
|
+
}
|
|
84
|
+
export interface ColourSection {
|
|
85
|
+
Combos: [number, number, number][];
|
|
86
|
+
SliderTrackOverride: [number, number, number] | null;
|
|
87
|
+
SliderBorder: [number, number, number] | null;
|
|
88
|
+
}
|
|
89
|
+
export interface HitSample {
|
|
90
|
+
normalSet: number;
|
|
91
|
+
additionSet: number;
|
|
92
|
+
index: number;
|
|
93
|
+
volume: number;
|
|
94
|
+
filename: string;
|
|
95
|
+
}
|
|
96
|
+
export interface CurvePoint {
|
|
97
|
+
x: number;
|
|
98
|
+
y: number;
|
|
99
|
+
}
|
|
100
|
+
export interface EdgeSet {
|
|
101
|
+
normalSet: number;
|
|
102
|
+
additionSet: number;
|
|
103
|
+
}
|
|
104
|
+
export interface HitObject {
|
|
105
|
+
x: number;
|
|
106
|
+
y: number;
|
|
107
|
+
time: number;
|
|
108
|
+
type: number;
|
|
109
|
+
hitSound: number;
|
|
110
|
+
hitSample: HitSample;
|
|
111
|
+
curveType: string;
|
|
112
|
+
curvePoints: CurvePoint[];
|
|
113
|
+
slides: number;
|
|
114
|
+
length: number;
|
|
115
|
+
edgeSounds: number[];
|
|
116
|
+
edgeSets: EdgeSet[];
|
|
117
|
+
endTime: number;
|
|
118
|
+
}
|
|
119
|
+
export interface OsuFileFormat {
|
|
120
|
+
version: number;
|
|
121
|
+
General: GeneralSection;
|
|
122
|
+
Editor: EditorSection;
|
|
123
|
+
Metadata: MetadataSection;
|
|
124
|
+
Difficulty: DifficultySection;
|
|
125
|
+
Events: EventsSection;
|
|
126
|
+
TimingPoints: TimingPoint[];
|
|
127
|
+
Colours: ColourSection;
|
|
128
|
+
HitObjects: HitObject[];
|
|
129
|
+
}
|
|
130
|
+
export interface INativeExporter {
|
|
131
|
+
get_property(data: Uint8Array, key: string): string;
|
|
132
|
+
get_properties(data: Uint8Array, keys: string[]): Record<string, string>;
|
|
133
|
+
get_section(data: Uint8Array, section: string): string[];
|
|
134
|
+
parse(data: Uint8Array): OsuFileFormat;
|
|
135
|
+
}
|
package/package.json
CHANGED
|
@@ -1,49 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
2
|
+
"name": "@rel-packages/osu-beatmap-parser",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": ".osu parser for nodejs",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"homepage": "https://github.com/mezleca/osu-beatmap-parser",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"update:patch": "npm version patch && git push --follow-tags",
|
|
10
|
+
"update:minor": "npm version minor && git push --follow-tags",
|
|
11
|
+
"update:major": "npm version major && git push --follow-tags",
|
|
12
|
+
"prepublishOnly": "npm run compile:tsc && mkdir -p lib",
|
|
13
|
+
"compile:native": "bun scripts/build.ts native",
|
|
14
|
+
"compile:wasm": "bun scripts/build.ts wasm",
|
|
15
|
+
"compile:tsc": "tsc",
|
|
16
|
+
"format": "prettier --write . --ignore-unknown",
|
|
17
|
+
"pretest": "bun run format",
|
|
18
|
+
"test": "bun test",
|
|
19
|
+
"prebuild": "bun run format",
|
|
20
|
+
"build": "bun scripts/build.ts all && npm run compile:tsc",
|
|
21
|
+
"example:wasm": "bun run compile:wasm && bun x http-server . -p 8080 -c-1 -o /examples/wasm/",
|
|
22
|
+
"example:node": "bun run compile:native && bun run examples/node/index.ts"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"osu",
|
|
26
|
+
"beatmap",
|
|
27
|
+
"parser",
|
|
28
|
+
"native"
|
|
29
|
+
],
|
|
30
|
+
"author": "",
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"repository": {
|
|
33
|
+
"url": "https://github.com/mezleca/osu-beatmap-parser.git"
|
|
34
|
+
},
|
|
35
|
+
"type": "commonjs",
|
|
36
|
+
"files": [
|
|
37
|
+
"dist/",
|
|
38
|
+
"prebuilds/",
|
|
39
|
+
"README.md"
|
|
40
|
+
],
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@rel-packages/osu-beatmap-parser": "^1.1.2",
|
|
43
|
+
"@types/bindings": "^1.5.5",
|
|
44
|
+
"@types/node": "^24.10.4",
|
|
45
|
+
"cmake-js": "^7.4.0",
|
|
46
|
+
"node-addon-api": "^8.5.0",
|
|
47
|
+
"prettier": "^3.6.2",
|
|
48
|
+
"prettier-plugin-svelte": "^3.4.1",
|
|
49
|
+
"tsx": "^4.21.0",
|
|
50
|
+
"typescript": "^5.9.3"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"node-gyp-build": "^4.8.4"
|
|
54
|
+
}
|
|
49
55
|
}
|
|
Binary file
|
|
Binary file
|
package/dist/types.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type OsuKey = "AudioFilename" | "AudioLeadIn" | "PreviewTime" | "Countdown" | "SampleSet" | "StackLeniency" | "Mode" | "LetterboxInBreaks" | "WidescreenStoryboard" | "Bookmarks" | "DistanceSpacing" | "BeatDivisor" | "GridSize" | "TimelineZoom" | "Title" | "TitleUnicode" | "Artist" | "ArtistUnicode" | "Creator" | "Version" | "Source" | "Tags" | "BeatmapID" | "BeatmapSetID" | "HPDrainRate" | "CircleSize" | "OverallDifficulty" | "ApproachRate" | "SliderMultiplier" | "SliderTickRate" | "Background" | "Video" | "Storyboard" | "Duration";
|
|
2
|
-
export interface OsuInput {
|
|
3
|
-
data: Uint8Array;
|
|
4
|
-
id?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface INativeExporter {
|
|
7
|
-
get_property(data: Uint8Array, key: string): string;
|
|
8
|
-
get_properties(data: Uint8Array, keys: string[]): Record<string, string>;
|
|
9
|
-
}
|
|
File without changes
|