It sounds like you have over-worked something - muscles, tendons, joint cartilage, whatever...
I've noticed I'm more prone to these sorts of aches and pains as this middle-age thing settles in, but as I understand it, the key thing is acute vs chronic. Has it come on suddenly after a round of serious, heavy-duty typing, or a slower onset? A sudden reaction to over-doing things is probably not a concern (provided it settles down in a week or two), but if this is something that has built up over time I would suggest it's time to see a doctor.
The fact that you only get it when typing suggests you have inflamed something very specific, and if the problem is with soft/connective tissue it can take a while to heal. Acute ought to sort out on it's own (although it can still be slow), but chronic problems tend to need care and management.
Either way, you probably want to ease off on the typing for a while.
For the latter, I bought a trackball and it's slowly getting better.
I use a trackball and have done for twenty years plus. I also use it left-handed, even though I'm right handed, following some soft-tissue damage in my right shoulder. The trackball really cuts down on the shoulder/elbow movement, but more wear-and-tear on the thumb. I've tried a touchpad, but that never worked so well.