0

I need to type cast some variables, but for some reason I am finding the types impossible to import via firebase-admin.

Here is an over-simplified example.

import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin'
import { Bucket } from 'where??'

admin.initializeApp()

exports.myFunc = functions.storage.object().onFinalize(async myFile => {
    const bucket = admin.storage().bucket() // this works
    const bucket: Bucket = admin.storage().bucket() // but I want to do this
})
Dharmaraj
  • 47,845
  • 8
  • 52
  • 84
Ryan Prentiss
  • 1,492
  • 2
  • 25
  • 46

1 Answers1

1

I was required to install and import the following package:

import { Bucket } from @google-cloud/storage

Ryan Prentiss
  • 1,492
  • 2
  • 25
  • 46