sus-io
Version:
A SUS (Sliding Universal Score) converter (parser and stringifier).
55 lines (54 loc) • 1.18 kB
TypeScript
type Note = {
tick: number;
lane: number;
width: number;
type: number;
};
type ScoreData = {
taps: Note[];
directionals: Note[];
slides: Note[][];
bpms: [
tick: number,
value: number
][];
barLengths: [
measure: number,
value: number
][];
};
type Score = {
metadata: Metadata;
} & ScoreData;
type Metadata = {
title?: string;
subtitle?: string;
artist?: string;
genre?: string;
designer?: string;
difficulty?: string;
playlevel?: string;
songid?: string;
wave?: string;
waveoffset?: number;
jacket?: string;
background?: string;
movie?: string;
movieoffset?: number;
basebpm?: number;
requests?: string[];
};
/**
* Parse SUS data into a Score object
*
* @param sus The content of sus file as a string.
* @returns A Score object.
*/
declare function parse(sus: string): Score;
declare function stringify(score: Score, comment?: string): string;
declare const _default: {
parse: typeof parse;
stringify: typeof stringify;
};
export type { Note, ScoreData, Score, Metadata };
export { _default as default, parse, stringify };