I cannot help you with the build-in JS and TS support, but I can tell you how to do it with the protobuf-ts plugin (I am the author).
// this creates an empty new message
let msg = ShardKvMap.create();
// this packs the empty new message into an Any message,
// and adds it to map under the key "foo":
msg.data["foo"] = Any.pack(msg, ShardKvMap);
As far as I know, protobuf-ts is the only library out there for JavaScript / TypeScript that fully supports google.protobuf.Any, including JSON format. Here is the section about Any support in the manual.