@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.
@@ -8,13 +8,23 @@ import { LilyletDoc } from './types';
8
8
  /**
9
9
  * Decode MusicXML string to LilyletDoc
10
10
  */
11
- export declare const decode: (xmlString: string) => LilyletDoc;
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: (xmlString: string) => LilyletDoc;
27
+ decode: (input: string | Uint8Array) => LilyletDoc;
18
28
  decodeFile: (filePath: string) => Promise<LilyletDoc>;
19
29
  };
20
30
  export default _default;