PeerId's may or may not have a private key and we may need to detect this in other code.
The type of privKey is: public privKey: Uint8Array; , however currently the only way to workout if the peer id has a private key is to query peerId.privKey === undefined.
Alternatively we could document that checking whether peerId.privKey === undefined is a stable part of the API and update the types.