Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Storage putString method

I'm trying to upload a base64 image with the new method putString. I already updated to 3.3 but TS says Property putString does not exist on type Reference (I'm using Angular 2 rc4)

firebase.storage().ref(storageUrl).putString(thumb64);
like image 577
cerealex Avatar asked Jul 18 '26 23:07

cerealex


1 Answers

Well, I came up with a solution by myself. The problem is that even if firebase is upgraded to 3.3, its typings isn't. So either you wait for an official typings update or update it yourself by editing index.d.ts inside the firebase typings dir. Then go to the namespace firebase.storage object and add the putString method:

putString(string: String, format?:String, metadata?: firebase.storage.UploadMetadata): firebase.storage.UploadTask;
like image 175
cerealex Avatar answered Jul 20 '26 12:07

cerealex