@tspro/web-music-score 1.1.0 → 2.0.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.
- package/CHANGELOG.md +10 -0
- package/README.md +247 -195
- package/dist/audio/index.d.mts +22 -0
- package/dist/audio/index.d.ts +22 -0
- package/dist/audio/index.js +147 -0
- package/dist/audio/index.mjs +109 -0
- package/dist/audio-cg/index.d.mts +4 -0
- package/dist/audio-cg/index.d.ts +4 -0
- package/dist/audio-cg/index.js +124 -0
- package/dist/audio-cg/index.mjs +91 -0
- package/dist/chunk-2EPWQZKJ.mjs +9 -0
- package/dist/core/index.d.mts +21 -0
- package/dist/core/index.d.ts +21 -0
- package/dist/core/index.js +72 -0
- package/dist/core/index.mjs +45 -0
- package/dist/guitar-BIFwFT31.d.ts +24 -0
- package/dist/guitar-kbJYu3Am.d.mts +24 -0
- package/dist/iife/index.global.js +222 -0
- package/dist/note-B5ZtlHc8.d.ts +99 -0
- package/dist/note-CraqEy8x.d.mts +99 -0
- package/dist/pieces/index.d.mts +15 -0
- package/dist/pieces/index.d.ts +15 -0
- package/dist/pieces/index.js +104 -0
- package/dist/pieces/index.mjs +77 -0
- package/dist/react-ui/index.d.mts +169 -0
- package/dist/react-ui/index.d.ts +169 -0
- package/dist/react-ui/index.js +624 -0
- package/dist/react-ui/index.mjs +582 -0
- package/dist/score/index.d.mts +1558 -0
- package/dist/score/index.d.ts +1558 -0
- package/dist/score/index.js +6937 -0
- package/dist/score/index.mjs +6863 -0
- package/dist/tempo--588tdcv.d.ts +203 -0
- package/dist/tempo-BEJBHZ5I.d.mts +203 -0
- package/dist/theory/index.d.mts +47 -0
- package/dist/theory/index.d.ts +47 -0
- package/dist/theory/index.js +1783 -0
- package/dist/theory/index.mjs +1716 -0
- package/package.json +98 -55
- package/dist/index.cjs.js +0 -41053
- package/dist/index.d.ts +0 -1281
- package/dist/index.esm.mjs +0 -41044
- package/dist/index.umd.min.js +0 -9
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { c as Scale, S as ScaleType } from '../tempo--588tdcv.js';
|
|
4
|
+
import { b as PitchNotation, G as GuitarNoteLabel, N as Note } from '../note-B5ZtlHc8.js';
|
|
5
|
+
import { H as Handedness } from '../guitar-BIFwFT31.js';
|
|
6
|
+
import { DivRect, MDocument, ScoreEventListener, MRenderer, MPlaybackButtons } from '../score/index.js';
|
|
7
|
+
import '@tspro/ts-utils-lib';
|
|
8
|
+
|
|
9
|
+
/** @public */
|
|
10
|
+
interface CircleOfFifthsProps {
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
scale: Scale;
|
|
13
|
+
onScaleChange: (scale: Scale) => void;
|
|
14
|
+
}
|
|
15
|
+
/** @public */
|
|
16
|
+
declare class CircleOfFifths extends React.Component<CircleOfFifthsProps, {}> {
|
|
17
|
+
constructor(props: CircleOfFifthsProps);
|
|
18
|
+
onScaleChange(tonic: string, scaleType: ScaleType): void;
|
|
19
|
+
render(): react_jsx_runtime.JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** @public */
|
|
23
|
+
declare class FretPosition {
|
|
24
|
+
readonly guitarCtx: GuitarContext;
|
|
25
|
+
readonly stringId: number;
|
|
26
|
+
readonly fretId: number;
|
|
27
|
+
readonly chromaticId: number;
|
|
28
|
+
readonly note: Note;
|
|
29
|
+
readonly isScaleNote: boolean;
|
|
30
|
+
readonly isScaleRootNote: boolean;
|
|
31
|
+
isVisible: boolean;
|
|
32
|
+
text: string;
|
|
33
|
+
textColor: string;
|
|
34
|
+
fillColor: string | undefined;
|
|
35
|
+
borderColor: string | undefined;
|
|
36
|
+
isBarre: boolean;
|
|
37
|
+
constructor(guitarCtx: GuitarContext, stringId: number, fretId: number, chromaticId: number);
|
|
38
|
+
get chromaticClass(): number;
|
|
39
|
+
show(): void;
|
|
40
|
+
hide(): void;
|
|
41
|
+
setDefaultText(): void;
|
|
42
|
+
setDefaultFillColor(): void;
|
|
43
|
+
setDefaultBorderColor(showBorder?: boolean): void;
|
|
44
|
+
}
|
|
45
|
+
/** @public */
|
|
46
|
+
declare class GuitarContext {
|
|
47
|
+
readonly tuningName: string;
|
|
48
|
+
readonly scale: Scale;
|
|
49
|
+
readonly handedness: Handedness;
|
|
50
|
+
readonly pitchNotation: PitchNotation;
|
|
51
|
+
readonly guitarNoteLabel: GuitarNoteLabel;
|
|
52
|
+
readonly maxFretId: number;
|
|
53
|
+
private readonly fretPositionTable;
|
|
54
|
+
private readonly tuningStrings;
|
|
55
|
+
constructor(tuningName: string, scale: Scale, handedness: Handedness, pitchNotation: PitchNotation, guitarNoteLabel: GuitarNoteLabel);
|
|
56
|
+
getFretPosition(stringId: number, fretId: number): Readonly<FretPosition>;
|
|
57
|
+
getStringTuning(stringId: number): Note;
|
|
58
|
+
getTuningOverview(): string;
|
|
59
|
+
alterTuningName(tuningName: string): GuitarContext;
|
|
60
|
+
alterScale(scale: Scale): GuitarContext;
|
|
61
|
+
alterHandedness(handedness: Handedness): GuitarContext;
|
|
62
|
+
alterPitchNotation(pitchNotation: PitchNotation): GuitarContext;
|
|
63
|
+
alterGuitarNoteLabel(guitarNoteLabel: GuitarNoteLabel): GuitarContext;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** @public */
|
|
67
|
+
declare class FretPositionData {
|
|
68
|
+
readonly fretPosition: Readonly<FretPosition>;
|
|
69
|
+
readonly cellRect: DivRect;
|
|
70
|
+
readonly noteRect: DivRect;
|
|
71
|
+
constructor(fretPosition: Readonly<FretPosition>, cellRect: DivRect, noteRect: DivRect);
|
|
72
|
+
}
|
|
73
|
+
/** @public */
|
|
74
|
+
type UpdateFretPositionFunc = (fretPosition: FretPosition) => void;
|
|
75
|
+
/** @public */
|
|
76
|
+
type ClickFretPositionFunc = (fretPosition: FretPosition) => void;
|
|
77
|
+
/** @public */
|
|
78
|
+
interface GuitarViewProps {
|
|
79
|
+
style?: React.CSSProperties;
|
|
80
|
+
guitarContext: GuitarContext;
|
|
81
|
+
onUpdateFretPosition?: UpdateFretPositionFunc;
|
|
82
|
+
onClickFretPosition?: ClickFretPositionFunc;
|
|
83
|
+
}
|
|
84
|
+
/** @public */
|
|
85
|
+
interface GuitarViewState {
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
table: FretPositionData[][];
|
|
89
|
+
}
|
|
90
|
+
/** @public */
|
|
91
|
+
declare class GuitarView extends React.Component<GuitarViewProps, GuitarViewState> {
|
|
92
|
+
state: GuitarViewState;
|
|
93
|
+
constructor(props: GuitarViewProps);
|
|
94
|
+
componentDidUpdate(prevProps: GuitarViewProps): void;
|
|
95
|
+
getLayoutState(): {
|
|
96
|
+
table: FretPositionData[][];
|
|
97
|
+
width: number;
|
|
98
|
+
height: number;
|
|
99
|
+
};
|
|
100
|
+
onHover(fretPositionData?: FretPositionData): void;
|
|
101
|
+
onClick(fretPositionData?: FretPositionData): void;
|
|
102
|
+
render(): react_jsx_runtime.JSX.Element;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** @public */
|
|
106
|
+
interface MusicScoreViewProps {
|
|
107
|
+
doc: MDocument;
|
|
108
|
+
onScoreEvent?: ScoreEventListener;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @public
|
|
112
|
+
*
|
|
113
|
+
* Usage:
|
|
114
|
+
*
|
|
115
|
+
* import * as Score from "\@tspro/web-music-score";
|
|
116
|
+
*
|
|
117
|
+
* \<Score.MusicScoreView doc=\{doc\} /\>
|
|
118
|
+
*/
|
|
119
|
+
declare class MusicScoreView extends React.Component<MusicScoreViewProps, {}> {
|
|
120
|
+
renderer: MRenderer;
|
|
121
|
+
constructor(props: MusicScoreViewProps);
|
|
122
|
+
componentDidUpdate(prevProps: Readonly<MusicScoreViewProps>, prevState: Readonly<{}>): void;
|
|
123
|
+
render(): react_jsx_runtime.JSX.Element;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** @public */
|
|
127
|
+
declare enum PlaybackButtonsLayout {
|
|
128
|
+
PlayStopSingle = 0,
|
|
129
|
+
PlayStop = 1,
|
|
130
|
+
PlayPauseStop = 2
|
|
131
|
+
}
|
|
132
|
+
/** @public */
|
|
133
|
+
interface PlaybackButtonsProps {
|
|
134
|
+
doc: MDocument;
|
|
135
|
+
buttonLayout?: PlaybackButtonsLayout;
|
|
136
|
+
playLabel?: string;
|
|
137
|
+
pauseLabel?: string;
|
|
138
|
+
stopLabel?: string;
|
|
139
|
+
}
|
|
140
|
+
/** @public */
|
|
141
|
+
interface PlaybackButtonsState {
|
|
142
|
+
controller: MPlaybackButtons;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* @public
|
|
146
|
+
*
|
|
147
|
+
* Usage:
|
|
148
|
+
*
|
|
149
|
+
* import * as Score from "\@tspro/web-music-score";
|
|
150
|
+
*
|
|
151
|
+
* \<Score.PlaybackButtons doc=\{doc\} /\>
|
|
152
|
+
*
|
|
153
|
+
* To set custom play, pause and stop labels:
|
|
154
|
+
*
|
|
155
|
+
* \<Score.PlaybackButtons doc=\{doc\} playLabel="⏵" pauseLabel="⏸" stopLabel="⏹" /\>
|
|
156
|
+
*
|
|
157
|
+
* To use different button layout.
|
|
158
|
+
*
|
|
159
|
+
* \<Score.PlaybackButtons doc=\{doc\} buttonLayout=\{Score.PlaybackButtonsLayout.PlayStopSingle\} /\>
|
|
160
|
+
*
|
|
161
|
+
*/
|
|
162
|
+
declare class PlaybackButtons extends React.Component<PlaybackButtonsProps, PlaybackButtonsState> {
|
|
163
|
+
state: PlaybackButtonsState;
|
|
164
|
+
constructor(props: PlaybackButtonsProps);
|
|
165
|
+
componentDidUpdate(prevProps: Readonly<PlaybackButtonsProps>): void;
|
|
166
|
+
render(): react_jsx_runtime.JSX.Element;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export { CircleOfFifths, type CircleOfFifthsProps, type ClickFretPositionFunc, FretPosition, FretPositionData, GuitarContext, GuitarView, type GuitarViewProps, type GuitarViewState, MusicScoreView, type MusicScoreViewProps, PlaybackButtons, PlaybackButtonsLayout, type PlaybackButtonsProps, type PlaybackButtonsState, type UpdateFretPositionFunc };
|