Skip to content
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

Prototype for moving internally used types to dedicated internal classes in Auth #928

Draft
wants to merge 8 commits into
base: minimal-rtdb-option-2-b
Choose a base branch
from

Conversation

MathBunny
Copy link
Contributor

@MathBunny MathBunny commented Jul 6, 2020

When using autogenerated typing, some types/classes are exported but not intended to be used publicly. Formerly this was implemented by not including the types in the d.ts file, but now since they're autogenerated we have the option of either:

  1. Denoting the type using the undocumented strip-internal @internal annotation
  2. Split it off into another file that is not exported via the barrel export

This PR explores the second option for the Auth module. While the typings are still generated, users will not be able to import them regularly via the firebase-admin/auth import.

Edit: I still have yet to do user-record and tenant

@MathBunny
Copy link
Contributor Author

Finished the entire auth service. I didn't run into any issues when doing the conversion, except functions with default parameters. For those I wasn't able to set the default value inside the interface, and instead overloaded the function. I'm going to look into alternatives now.

@MathBunny
Copy link
Contributor Author

MathBunny commented Jul 9, 2020

Okay, turns out in TypeScript you cannot have default parameter values for declared functions. Instead, I denoted the parameter as optional using ? which eliminates the need to overload.

Edit: On second thought, this is also consistent with the former d.ts file so I think this is the right approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant