@k-l-lambda/lilylet 0.1.73 → 0.1.75
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/lib/lilylet/grammar.jison.js +180 -175
- package/lib/lilylet/highlight.js +1 -0
- package/lib/lilylet/index.d.ts +1 -0
- package/lib/lilylet/index.js +1 -0
- package/lib/lilylet/measureLayout.d.ts +68 -0
- package/lib/lilylet/measureLayout.js +412 -0
- package/lib/lilylet/measureLayoutFromXml.d.ts +48 -0
- package/lib/lilylet/measureLayoutFromXml.js +423 -0
- package/lib/lilylet/meiEncoder.js +292 -86
- package/lib/lilylet/musicXmlDecoder.d.ts +12 -2
- package/lib/lilylet/musicXmlDecoder.js +498 -67
- package/lib/lilylet/musicXmlTypes.d.ts +11 -1
- package/lib/lilylet/serializer.js +124 -10
- package/lib/lilylet/types.d.ts +3 -0
- package/lib/measureLayout.d.ts +1 -0
- package/lib/measureLayout.js +1 -0
- package/lib/measureLayoutFromXml.d.ts +1 -0
- package/lib/measureLayoutFromXml.js +1 -0
- package/package.json +6 -2
- package/source/lilylet/grammar.jison.js +180 -175
- package/source/lilylet/highlight.ts +1 -0
- package/source/lilylet/index.ts +1 -0
- package/source/lilylet/lilylet.jison +2 -0
- package/source/lilylet/measureLayout.ts +460 -0
- package/source/lilylet/measureLayoutFromXml.ts +417 -0
- package/source/lilylet/meiEncoder.ts +280 -87
- package/source/lilylet/musicXmlDecoder.ts +494 -67
- package/source/lilylet/musicXmlTypes.ts +14 -1
- package/source/lilylet/serializer.ts +118 -10
- package/source/lilylet/types.ts +6 -0
|
@@ -8,13 +8,23 @@ import { LilyletDoc } from './types';
|
|
|
8
8
|
/**
|
|
9
9
|
* Decode MusicXML string to LilyletDoc
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Decode raw MusicXML bytes (or a string) into a clean UTF-8/UTF-16-correct
|
|
13
|
+
* JS string. MuseScore/Finale/Sibelius frequently export `.xml` as UTF-16 LE
|
|
14
|
+
* with a BOM; reading those as UTF-8 yields mojibake and a failed parse.
|
|
15
|
+
*
|
|
16
|
+
* Detection order: byte-order mark → declared `encoding="..."` in the XML
|
|
17
|
+
* prolog → default UTF-8. A leading BOM is always stripped (xmldom chokes on a
|
|
18
|
+
* U+FEFF before `<?xml`).
|
|
19
|
+
*/
|
|
20
|
+
export declare const readXmlString: (input: string | Uint8Array) => string;
|
|
21
|
+
export declare const decode: (input: string | Uint8Array) => LilyletDoc;
|
|
12
22
|
/**
|
|
13
23
|
* Decode MusicXML file to LilyletDoc
|
|
14
24
|
*/
|
|
15
25
|
export declare const decodeFile: (filePath: string) => Promise<LilyletDoc>;
|
|
16
26
|
declare const _default: {
|
|
17
|
-
decode: (
|
|
27
|
+
decode: (input: string | Uint8Array) => LilyletDoc;
|
|
18
28
|
decodeFile: (filePath: string) => Promise<LilyletDoc>;
|
|
19
29
|
};
|
|
20
30
|
export default _default;
|