@dsebastien/music-notation 0.20.0 → 0.21.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.
@@ -0,0 +1,18 @@
1
+ /**
2
+ * A score in full screen (#113) uses the screen: its last line is stretched to the full width, and
3
+ * a short score is drawn larger, step by step, while it still fits the screen. A long score keeps
4
+ * its own size, so a wide screen still shows more bars a line. Nothing here knows alphaTab:
5
+ * `apply` sets the scale and the last line and draws again; `fits` says whether the drawing fits
6
+ * its area after a draw.
7
+ */
8
+ /** The scales tried in full screen, from the score's own size up. */
9
+ export declare const SCORE_SCALES: readonly [1, 1.25, 1.5, 1.75, 2, 2.5, 3];
10
+ export interface ScoreFit {
11
+ /** The score entered full screen: drawn again at its own size, its last line stretched. */
12
+ enter(): void;
13
+ /** The score left full screen: drawn again as in the page. */
14
+ leave(): void;
15
+ /** The score was drawn: one step larger while it fits, one step back when it no longer does. */
16
+ drawn(): void;
17
+ }
18
+ export declare function scoreFit(apply: (scale: number, stretch: boolean) => void, fits: () => boolean): ScoreFit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsebastien/music-notation",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "Chord diagrams, piano keyboards, fretboards and ChordPro charts rendered as SVG and HTML, with no framework. Works in Obsidian, on Obsidian Publish and on any web page.",
5
5
  "author": {
6
6
  "name": "Sébastien Dubois",
@@ -1,19 +0,0 @@
1
- export interface FullScreen {
2
- /** The bar's button. */
3
- button: HTMLButtonElement;
4
- /** Whether the block fills the screen. */
5
- active(): boolean;
6
- /** Tells the control that the music plays: the score follows it again in full screen. */
7
- playing(): void;
8
- /** Tells the control that the score was drawn (again): out of full screen, at its own size. */
9
- drawn(): void;
10
- /** Leaves full screen and stops listening to the page. */
11
- destroy(): void;
12
- }
13
- /**
14
- * The full screen control of a tab block. `block` fills the screen and `surface` (the score)
15
- * becomes its scroll area. `follow(true)` is called when the score may follow the music (in full
16
- * screen, where only its own area scrolls), `follow(false)` when it must not: out of full screen
17
- * (the page never moves, #89), and after a scroll by hand, until the music plays again.
18
- */
19
- export declare function fullScreenControl(doc: Document, block: HTMLElement, surface: HTMLElement, follow: (on: boolean) => void): FullScreen;