-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing typings for event functions? #286
Comments
Adding types for Pub/Sub, Storage, and other events sounds useful. Thanks for opening the issue. |
Thanks I came across this stackoverflow thread which told me where the types were. It might be worth opening making these more readily available I'd open a PR for this but I'm not sure what the most correct way to do it would be |
Some more detail as to what you're looking for with some code would be helpful. For HTTP, we can use For events, we have The interfaces are here: https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/master/src/functions.ts I think we're talking about a more detailed interface for each type of event. |
Example wise... Well, at the moment I'm just defining declaring my functions as
Looking through the documentation it appears that the arguments would be different for each trigger type with little overlap, so there wouldn't be much point doing anything like
So while simple, I think just defining some types for the different kinds of triggers would be what I'd be looking for
|
From what I understand after reading through the docs (I think you can
I was looking through the storage trigger docs and I understand those typings would be a lot more in depth. I've never had to work with those triggers so I'm not sure what other properties there would be on the file parameter aside from the ones in the example, or if you could call it from the command line without any of them, so an empty object |
Hi there!
I'm trying to write a cloud functions project in typescript. The project has typings for http trigger functions available in the functions.ts under the HttpFunction type. These are very useful as they provide the necessary express types for the request and response objects
However when trying to write an event function triggered by a pub/sub message, for example, there is only the EventFunction type, however the data parameter is missing relevant properties for pub/sub triggers, storage triggers, etc
The text was updated successfully, but these errors were encountered: