@libraz/libcantus - v1.1.0
    Preparing search index...

    Type Alias KeyLike

    KeyLike:
        | string
        | KeyScale & { tonic?: NoteData; variant?: KeyVariant }
        | { scale: KeyScale; tonic?: NoteData; variant?: KeyVariant }
        | { toJSON(): { scale: KeyScale; tonic?: NoteData; variant?: KeyVariant } }

    Anything that names a key: a key name, a plain KeyScale, the plain data a key serializes to, or a value that serializes to one such as the Key class.

    The plain-data form is here because a project file holds a key that way, and reading one back has to be the same call as passing the class it came from.

    Deliberately wider than what a resolver hands back: a caller may hand in a bare scale, or data written before the spelling travelled with it, and the resolver fills in what is missing rather than refusing it. Narrowing this to the resolved shape would make the acceptance of every entry point shrink the day the resolved shape gained a field.

    A scale is accepted with the spelling and the form written beside it as well as without them, because a key region carries its key that way — asked positional questions wherever a plain scale would be. The resolver reads them when they are there, and this says so: a shape a resolver reads and a type denies is one refactoring away from being dropped silently.

    Type Declaration