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

    Type Alias SpelledKeyLike

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

    A key that says how it is written, for the entry points whose answer depends on it.

    The shapes KeyLike accepts, minus the one that cannot carry a spelling: a bare KeyScale. An A flat minor and a G sharp minor are one set of pitch classes and two keys, so an entry point whose answer differs between them cannot be handed the shape that does not distinguish them and still be right. Declaring this makes that a compile error rather than a defect found later — and Key, ResolvedKey, a key name and stored key data all satisfy it, so the narrowing costs a caller nothing it was doing correctly.

    Which entry points declare this is measured rather than chosen: an entry point belongs here exactly when varying its key argument alone — between the two spellings of one sound — changes its answer. A scale a caller genuinely wants to hand in is spelled first, at the place it happens, which is the same rule the reduction in the other direction already follows.

    Type Declaration