I am trying out google cloud functions using typescript. I would like the function to be triggered by message from PubSub. The general format of the function is as follows
exports.readMessage = async (event, context): Promise<void> => {
const message = event.data
? Buffer.from(event.data, "base64").toString()
: "No Message";
console.log(message);}
I have error as typescript complains about any type for event and context. package @google-cloud/PubSub mentions that it exports its types but I don't see any types related to event or context.
Any pointers to what am I missing and from which package I can import the types?