Replies: 1 comment 1 reply
-
The solution is to install import { Scale, get } from "@tonaljs/scale";
const myScale: Scale = { ... }
console.log(myScale);
console.log(get("C major")); // <= just a reminder the function from packages can be imported and used without namespace I never realized those types were not exported from main |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm not super familiar with TypeScript but using it with Tonal in a Vue project.
I'm a bit confused how to access types such as Scale (ie, the return value of
Scale.get()
), because of the name collision with the module name.import { Scale } from 'tonal'
This gives us
Scale
, the whole module.There's also the type,
Scale
declared like this inpackages/scale.ts
:But I can't figure out how to import that
Scale
type in order to declare a variable of typeScale
.These don't seem to work:
Beta Was this translation helpful? Give feedback.
All reactions