pepperscore 0.4.0 → 0.4.1

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.
@@ -3,3 +3,7 @@
3
3
  * base instead of hardcoded CSS. Font family names are page-global, so the first instance's base wins.
4
4
  */
5
5
  export declare function ensureMusicFonts(base: string, onError?: (failed: string) => void): void;
6
+ /** Start downloading a notation font's faces now (after ensureMusicFonts declared them), rather than on first use. */
7
+ export declare function preloadMusicFont(font: string | undefined): void;
8
+ /** Resolves when a notation font's faces have loaded (or failed), or after `timeoutMs`, whichever is first; never rejects. */
9
+ export declare function musicFontsReady(font: string | undefined, timeoutMs: number): Promise<void>;
@@ -60,7 +60,7 @@ export type VerovioFiles = {
60
60
  module: string;
61
61
  toolkit: string;
62
62
  };
63
- /** Sent once by the runtime right after it starts a worker, before any request. */
63
+ /** Sent once by the runtime right after it starts a worker, before any request; the worker then starts loading Verovio. */
64
64
  export type VerovioConfigure = {
65
65
  kind: 'configure';
66
66
  files: VerovioFiles;
@@ -32,6 +32,18 @@ export declare function verovioFilesAt(base: string, page?: string): VerovioFile
32
32
  * a restart); a blank `base` changes nothing.
33
33
  */
34
34
  export declare function setVerovioBaseUrl(base: string | undefined): void;
35
+ /**
36
+ * Start the shared Verovio worker now and have it fetch, compile and instantiate Verovio, so the first engraving does
37
+ * not wait for that after the score's import. Readers call it on mount when they have a score to show; the worker
38
+ * still goes when the last reader channel closes. Uses the current `setVerovioBaseUrl` (set it first).
39
+ */
40
+ export declare function warmVerovio(): void;
41
+ /**
42
+ * Start loading Verovio before any reader mounts (for example from a page script, before React hydrates), so the
43
+ * first score engraves sooner. `base` is the same directory as PepperScoreProps.verovioBaseUrl (pass the same value);
44
+ * omitted, the copy shipped with pepperscore loads. Safe to call more than once and on the server (it does nothing).
45
+ */
46
+ export declare function preloadVerovio(base?: string): void;
35
47
  export declare function verovioRevision(document: SourceDocument): number;
36
48
  /** A reader mounted: a channel of its own, so its imports and renders never supersede another reader's. */
37
49
  export declare function openVerovioChannel(): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pepperscore",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "An embeddable, browser-only music score reader for React: MusicXML, MXL, MIDI, MEI and ABC, engraved by Verovio, with playback.",
5
5
  "license": "MIT AND LGPL-3.0-or-later",
6
6
  "type": "module",