react-native-firebase
react-native-firebase copied to clipboard
chore: Allow type-safety for subcollections
trafficstars
Description
Root collections currently allow strong typing:
const allYourBase = firestore()
.collection<SetUsUp>("are-belong")
.get();
But subcollections cannot be typed:
const allYourBase = firestore()
.collection<SetUsUp>("are-belong")
.doc("8675309")
.collection<TheBomb>("to-us") // This is not accepted by index.d.ts
.get();
This PR attempts to make that possible.
Release Summary
Support strong typing for subcollections
Checklist
- I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [X] Yes
- My change supports the following platforms;
- [X]
Android - [X]
iOS - [X]
Other(macOS, web)
- [X]
- My change includes tests;
- [ ]
e2etests added or updated inpackages/\*\*/e2e - [ ]
jesttests added or updated inpackages/\*\*/__tests__
- [ ]
- [ ] I have updated TypeScript types that are affected by my change.
- This is a breaking change;
- [ ] Yes
- [X] No
Test Plan
Installed local version in my project, and verified that Typescript accepts a subcollection type.