firebaseui-web icon indicating copy to clipboard operation
firebaseui-web copied to clipboard

Types: Add firebase type ref

Open ShaMan123 opened this issue 3 years ago • 7 comments

https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-

Did my best to infer types from code.

ShaMan123 avatar Jun 20 '21 08:06 ShaMan123

Hey @ShaMan123, thanks for the contribution! Can you get this to work without the default namespace in firebase.default? The public types are defined as firebase.auth.UserCredential instead of firebase.default.auth.UserCredential.

bojeil-google avatar Jun 29 '21 23:06 bojeil-google

That's what I thought but the compiler throws an error without .default It seems a firebase issue

ShaMan123 avatar Jun 30 '21 05:06 ShaMan123

That's what I thought but the compiler throws an error without .default It seems a firebase issue

The problem is if we accept this, it could be a breaking change as it may not match the existing public types.

bojeil-google avatar Jun 30 '21 06:06 bojeil-google

I disagree. Why would it be breaking? And why would it mismatch?

ShaMan123 avatar Jun 30 '21 07:06 ShaMan123

I disagree. Why would it be breaking? And why would it mismatch?

Hmm, I take that back as the underlying types should match, but we'd want to test this to confirm nothing unexpected surfaces. Regardless, can you open an issue in the firebase-js-sdk repo about the.default types?

bojeil-google avatar Jun 30 '21 07:06 bojeil-google

Opened issue

ShaMan123 avatar Jun 30 '21 08:06 ShaMan123

What you think about defining local types at the top of the file so it can be easily maintained, so you can merge and fix later on?

type Auth = firebase.default.auth.Auth;

ShaMan123 avatar Jun 30 '21 08:06 ShaMan123