aqandrew/fret-zone

add TypeScript

Opened this issue · 5 comments

custom objects like notes, measures, and durations are unwieldy

can u please explain what the issues is .

Sure. In reducers.js, there are some object definitions that represent tracks, measures, durations, and notes:

export const initialAppState = {
selectedTrackNumber: 0,
selectedMeasureNumber: 0,
selectedDurationId: undefined,
selectedStringNumber: 0,
// https://redux.js.org/recipes/structuring-reducers/normalizing-state-shape
tracks: {
byId: {},
allIds: [],
},
measures: {
byId: {},
allIds: [],
},
durations: {
byId: {},
allIds: [],
},
notes: {
byId: {},
allIds: [],
},
};
export const defaultMeasureOptions = {
timeSignature: {
beatsPerMeasure: 4,
beatUnit: 4,
},
keySignature: {
tonic: 'C',
isMajor: true,
},
durations: [],
};
export const defaultDurationOptions = {
isRest: false,
length: 1 / 4,
isDotted: false,
notes: [],
};

I'd like to add TypeScript to this project so that I can have more confidence in manipulating these object properties. I also find VS Code's Intellisense for TypeScript very helpful.

okay i will try to move this project to typescript

Please don't do that. For the time being this is just an educational project for myself, so I'm not accepting unsolicited PRs

okay