@scorelabs/core 1.0.7 → 1.0.10

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.
Files changed (78) hide show
  1. package/dist/importers/MusicXMLParser.d.ts +7 -2
  2. package/dist/importers/MusicXMLParser.js +261 -103
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.js +2 -2
  5. package/dist/models/Instrument.d.ts +8 -19
  6. package/dist/models/Instrument.js +77 -23
  7. package/dist/models/Measure.d.ts +5 -1
  8. package/dist/models/Measure.js +132 -19
  9. package/dist/models/Note.d.ts +7 -7
  10. package/dist/models/Note.js +2 -2
  11. package/dist/models/NoteSet.d.ts +44 -42
  12. package/dist/models/NoteSet.js +5 -2
  13. package/dist/models/Pitch.js +4 -0
  14. package/dist/models/PreMeasure.d.ts +24 -0
  15. package/dist/models/PreMeasure.js +30 -0
  16. package/dist/models/Score.d.ts +20 -5
  17. package/dist/models/Score.js +190 -5
  18. package/dist/models/index.d.ts +1 -0
  19. package/dist/models/index.js +1 -0
  20. package/dist/models/types.d.ts +2 -213
  21. package/dist/models/types.js +2 -213
  22. package/dist/types/Accidental.d.ts +7 -0
  23. package/dist/types/Accidental.js +8 -0
  24. package/dist/types/Arpeggio.d.ts +5 -0
  25. package/dist/types/Arpeggio.js +6 -0
  26. package/dist/types/Articulation.d.ts +10 -0
  27. package/dist/types/Articulation.js +11 -0
  28. package/dist/types/BarlineStyle.d.ts +9 -0
  29. package/dist/types/BarlineStyle.js +10 -0
  30. package/dist/types/Bowing.d.ts +4 -0
  31. package/dist/types/Bowing.js +5 -0
  32. package/dist/types/Clef.d.ts +10 -0
  33. package/dist/types/Clef.js +11 -0
  34. package/dist/types/Duration.d.ts +20 -0
  35. package/dist/types/Duration.js +60 -0
  36. package/dist/types/Dynamic.d.ts +12 -0
  37. package/dist/types/Dynamic.js +13 -0
  38. package/dist/types/Fretboard.d.ts +19 -0
  39. package/dist/types/Fretboard.js +1 -0
  40. package/dist/types/Genre.d.ts +27 -0
  41. package/dist/types/Genre.js +28 -0
  42. package/dist/types/Glissando.d.ts +8 -0
  43. package/dist/types/Glissando.js +5 -0
  44. package/dist/types/Hairpin.d.ts +10 -0
  45. package/dist/types/Hairpin.js +11 -0
  46. package/dist/types/InstrumentPreset.d.ts +11 -0
  47. package/dist/types/InstrumentPreset.js +12 -0
  48. package/dist/types/InstrumentType.d.ts +8 -0
  49. package/dist/types/InstrumentType.js +9 -0
  50. package/dist/types/KeySignature.d.ts +3 -0
  51. package/dist/types/KeySignature.js +1 -0
  52. package/dist/types/Lyric.d.ts +11 -0
  53. package/dist/types/Lyric.js +7 -0
  54. package/dist/types/NoteheadShape.d.ts +8 -0
  55. package/dist/types/NoteheadShape.js +9 -0
  56. package/dist/types/Ornament.d.ts +8 -0
  57. package/dist/types/Ornament.js +9 -0
  58. package/dist/types/Ottava.d.ts +10 -0
  59. package/dist/types/Ottava.js +7 -0
  60. package/dist/types/Pedal.d.ts +4 -0
  61. package/dist/types/Pedal.js +1 -0
  62. package/dist/types/Repeat.d.ts +8 -0
  63. package/dist/types/Repeat.js +1 -0
  64. package/dist/types/Slur.d.ts +4 -0
  65. package/dist/types/Slur.js +1 -0
  66. package/dist/types/StemDirection.d.ts +4 -0
  67. package/dist/types/StemDirection.js +5 -0
  68. package/dist/types/Tempo.d.ts +8 -0
  69. package/dist/types/Tempo.js +1 -0
  70. package/dist/types/TimeSignature.d.ts +6 -0
  71. package/dist/types/TimeSignature.js +3 -0
  72. package/dist/types/Tuplet.d.ts +5 -0
  73. package/dist/types/Tuplet.js +1 -0
  74. package/dist/types/User.d.ts +21 -0
  75. package/dist/types/User.js +7 -0
  76. package/dist/types/index.d.ts +27 -0
  77. package/dist/types/index.js +27 -0
  78. package/package.json +3 -1
@@ -0,0 +1,9 @@
1
+ export var NoteheadShape;
2
+ (function (NoteheadShape) {
3
+ NoteheadShape["Normal"] = "normal";
4
+ NoteheadShape["Cross"] = "cross";
5
+ NoteheadShape["Diamond"] = "diamond";
6
+ NoteheadShape["Slash"] = "slash";
7
+ NoteheadShape["Triangle"] = "triangle";
8
+ NoteheadShape["Square"] = "square";
9
+ })(NoteheadShape || (NoteheadShape = {}));
@@ -0,0 +1,8 @@
1
+ export declare enum Ornament {
2
+ Trill = "trill",
3
+ Mordent = "mordent",
4
+ InvertedMordent = "inverted-mordent",
5
+ Turn = "turn",
6
+ InvertedTurn = "inverted-turn",
7
+ Tremolo = "tremolo"
8
+ }
@@ -0,0 +1,9 @@
1
+ export var Ornament;
2
+ (function (Ornament) {
3
+ Ornament["Trill"] = "trill";
4
+ Ornament["Mordent"] = "mordent";
5
+ Ornament["InvertedMordent"] = "inverted-mordent";
6
+ Ornament["Turn"] = "turn";
7
+ Ornament["InvertedTurn"] = "inverted-turn";
8
+ Ornament["Tremolo"] = "tremolo";
9
+ })(Ornament || (Ornament = {}));
@@ -0,0 +1,10 @@
1
+ export declare enum OttavaType {
2
+ OttavaAlta = "8va",
3
+ OttavaBassa = "8vb",
4
+ QuindicesimaAlta = "15ma",
5
+ QuindicesimaBassa = "15mb"
6
+ }
7
+ export interface Ottava {
8
+ type: OttavaType;
9
+ placement: 'start' | 'stop';
10
+ }
@@ -0,0 +1,7 @@
1
+ export var OttavaType;
2
+ (function (OttavaType) {
3
+ OttavaType["OttavaAlta"] = "8va";
4
+ OttavaType["OttavaBassa"] = "8vb";
5
+ OttavaType["QuindicesimaAlta"] = "15ma";
6
+ OttavaType["QuindicesimaBassa"] = "15mb";
7
+ })(OttavaType || (OttavaType = {}));
@@ -0,0 +1,4 @@
1
+ export interface Pedal {
2
+ type: 'sustain' | 'una-corda';
3
+ placement: 'start' | 'stop';
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface Repeat {
2
+ type: 'start' | 'end';
3
+ times?: number;
4
+ }
5
+ export interface Volta {
6
+ type: 'start' | 'stop' | 'both';
7
+ numbers: number[];
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface Slur {
2
+ placement: 'start' | 'stop';
3
+ direction?: 'up' | 'down';
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare enum StemDirection {
2
+ Up = "up",
3
+ Down = "down"
4
+ }
@@ -0,0 +1,5 @@
1
+ export var StemDirection;
2
+ (function (StemDirection) {
3
+ StemDirection["Up"] = "up";
4
+ StemDirection["Down"] = "down";
5
+ })(StemDirection || (StemDirection = {}));
@@ -0,0 +1,8 @@
1
+ import { Duration } from './Duration.js';
2
+ export interface Tempo {
3
+ bpm: number;
4
+ duration: Duration;
5
+ isDotted: boolean;
6
+ text?: string;
7
+ gradual?: 'ritardando' | 'accelerando';
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface TimeSignature {
2
+ beats: number;
3
+ beatType: number;
4
+ symbol?: 'common' | 'cut' | 'normal';
5
+ }
6
+ export declare function isSymbolicTimeSignature(timeSignature: TimeSignature): boolean;
@@ -0,0 +1,3 @@
1
+ export function isSymbolicTimeSignature(timeSignature) {
2
+ return timeSignature.symbol === 'common' || timeSignature.symbol === 'cut';
3
+ }
@@ -0,0 +1,5 @@
1
+ export interface Tuplet {
2
+ actual: number;
3
+ normal: number;
4
+ type: 'start' | 'stop' | 'middle';
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ /**
2
+ * WARNING: DO NOT ADD SENSITIVE LOGIC OR PRIVATE CONSTANTS TO THIS FILE.
3
+ * This package (@scorelabs/core) is used in public-facing frontend applications
4
+ * and could be exposed. Keep all token generation, verification, and encryption
5
+ * logic in the 'backend' or 'website' utilities.
6
+ */
7
+ export type UserTier = 'free' | 'premium';
8
+ export interface UserData {
9
+ accessToken?: string;
10
+ access_token?: string;
11
+ uuid?: string | number;
12
+ name?: string;
13
+ first_name?: string;
14
+ last_name?: string;
15
+ username?: string;
16
+ email?: string;
17
+ is_admin?: number | boolean;
18
+ id?: string | number;
19
+ tier?: UserTier | string;
20
+ picture?: string;
21
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * WARNING: DO NOT ADD SENSITIVE LOGIC OR PRIVATE CONSTANTS TO THIS FILE.
3
+ * This package (@scorelabs/core) is used in public-facing frontend applications
4
+ * and could be exposed. Keep all token generation, verification, and encryption
5
+ * logic in the 'backend' or 'website' utilities.
6
+ */
7
+ export {};
@@ -0,0 +1,27 @@
1
+ export * from './InstrumentPreset.js';
2
+ export * from './InstrumentType.js';
3
+ export * from './StemDirection.js';
4
+ export * from './Clef.js';
5
+ export * from './Duration.js';
6
+ export * from './Accidental.js';
7
+ export * from './Articulation.js';
8
+ export * from './Dynamic.js';
9
+ export * from './Genre.js';
10
+ export * from './BarlineStyle.js';
11
+ export * from './Lyric.js';
12
+ export * from './Bowing.js';
13
+ export * from './NoteheadShape.js';
14
+ export * from './Ornament.js';
15
+ export * from './Fretboard.js';
16
+ export * from './TimeSignature.js';
17
+ export * from './KeySignature.js';
18
+ export * from './Tempo.js';
19
+ export * from './Hairpin.js';
20
+ export * from './Ottava.js';
21
+ export * from './Arpeggio.js';
22
+ export * from './Glissando.js';
23
+ export * from './Pedal.js';
24
+ export * from './Slur.js';
25
+ export * from './Tuplet.js';
26
+ export * from './Repeat.js';
27
+ export * from './User.js';
@@ -0,0 +1,27 @@
1
+ export * from './InstrumentPreset.js';
2
+ export * from './InstrumentType.js';
3
+ export * from './StemDirection.js';
4
+ export * from './Clef.js';
5
+ export * from './Duration.js';
6
+ export * from './Accidental.js';
7
+ export * from './Articulation.js';
8
+ export * from './Dynamic.js';
9
+ export * from './Genre.js';
10
+ export * from './BarlineStyle.js';
11
+ export * from './Lyric.js';
12
+ export * from './Bowing.js';
13
+ export * from './NoteheadShape.js';
14
+ export * from './Ornament.js';
15
+ export * from './Fretboard.js';
16
+ export * from './TimeSignature.js';
17
+ export * from './KeySignature.js';
18
+ export * from './Tempo.js';
19
+ export * from './Hairpin.js';
20
+ export * from './Ottava.js';
21
+ export * from './Arpeggio.js';
22
+ export * from './Glissando.js';
23
+ export * from './Pedal.js';
24
+ export * from './Slur.js';
25
+ export * from './Tuplet.js';
26
+ export * from './Repeat.js';
27
+ export * from './User.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scorelabs/core",
3
- "version": "1.0.7",
3
+ "version": "1.0.10",
4
4
  "description": "Core logic and models for ScoreLabs music notation",
5
5
  "type": "module",
6
6
  "files": [
@@ -24,6 +24,7 @@
24
24
  "release:major": "npm version major && npm publish --access public",
25
25
  "release": "npm run release:patch",
26
26
  "test": "vitest",
27
+ "test:coverage": "vitest run --coverage",
27
28
  "lint": "eslint ."
28
29
  },
29
30
  "dependencies": {
@@ -32,6 +33,7 @@
32
33
  "devDependencies": {
33
34
  "@types/jszip": "^3.4.0",
34
35
  "@types/node": "^25.2.3",
36
+ "@vitest/coverage-v8": "^4.0.18",
35
37
  "typescript": "^5.9.3",
36
38
  "vitest": "^4.0.18"
37
39
  }