Recently, I've been utilizing the Tonal package within a Vite/Vue/Typescript project.
My current task involves importing the type known as Scale
from the Scale
module.
You can find the type definition here:
export interface Scale extends ScaleType {
tonic: string | null;
type: string;
notes: NoteName[];
}
When it comes to exporting the module itself, it is done in this manner:
export default {
degrees,
detect,
extended,
get,
modeNames,
names,
rangeOf,
reduced,
scaleChords,
scaleNotes,
steps,
tokenize,
// deprecated
scale,
};
And the import statement for the module is:
import { Scale } from "tonal";
Could you guide me on how to correctly import the type?
Attempts like the following have been unsuccessful:
import type { Scale } from 'tonal'
import type { Scale.Scale } from 'tonal'
import type { Scale } from 'tonal/packages/scale'