Corrects flow return type (#1703)

<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request properly. -->
<!-- If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. -->
<!-- Please esure you've also read the `/CONTRIBUTING.md` guide. -->

### Summary
Using `firebase.links().createShortLink()` returns a promise with a string wrapper object. As far as I can tell, there is no reason it can not be a string literal, witch (to me) seems more logical (it is also the return type of the underlying function call).
### Checklist

- [x] Supports `Android`
- [x] Supports `iOS`
- [ ] `e2e` tests added or updated in [/tests/e2e/\*](/tests/e2e)
- [ ] Updated the documentation in the [docs repo](https://github.com/invertase/react-native-firebase-docs)
  - **LINK TO DOCS PR HERE**
- [x] Flow types updated
- [ ] Typescript types updated

### Test Plan
Tested locally, works for me. 
<!-- Demonstrate the code is solid. -->
<!-- Example: The exact testing commands you ran and their final output (e.g. screenshot of test summary). -->
<!-- Example: Screenshots / videos if the pull request changes UI related code such as Notifications or Admob -->

### Release Plan

<!-- Help reviewers and the release process by writing your own release notes. See below for examples. -->

[TYPES][ENHANCEMENT] [LINKS] - Corrects flow return type to string literal instead of string wrapper

<!--
  **INTERNAL tagged notes will not be included in the next version's release notes.**

    CATEGORY
  [----------]      TYPE
  [ TYPES    ] [-------------]       LOCATION
  [ JS       ] [ BREAKING    ] [------------------]
  [ GENERAL  ] [ BUGFIX      ] [ {FirebaseModule} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}       ]
  [ IOS      ] [ FEATURE     ] [ {Directory}      ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework}      ] - | {Message} |
  [----------] [-------------] [------------------]   |-----------|

 EXAMPLES:

 [IOS] [ANDROID] [BREAKING] [AUTHENTICATION] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [FIRESTORE] - Did a thing to fix a thing with a Firestore thing
 [JS] [BREAKING] - Remove a deprecated thing
 [TYPES] [ENHANCEMENT] [NOTIFICATIONS] - Update flow types for a thing in notifications
 [JS] [ENHANCEMENT] - Expose export of a internal thing utility for public usage
 [INTERNAL] [FEATURE] [./utils] - Added an internal util to make doing a thing easier
-->

---

Think `react-native-firebase` is great? Please consider supporting the project with any of the below:

- 👉 Donate via [Open Collective](https://opencollective.com/react-native-firebase/donate)
- 👉 Follow [`React Native Firebase`](https://twitter.com/rnfirebase) and [`Invertase`](https://twitter.com/invertaseio) on Twitter
- 👉 Star this repo on GitHub ️
- 👉 Contribute; see our [contributing guide](/CONTRIBUTING.md)

🔥
This commit is contained in:
Erik Haider Forsén
2018-11-23 14:56:50 +01:00
committed by Elliot Hesp
parent a735d271be
commit 04fba7900a

View File

@@ -47,7 +47,7 @@ export default class Links extends ModuleBase {
/**
* Create long Dynamic Link from parameters
* @param parameters
* @returns {Promise.<String>}
* @returns {Promise.<string>}
*/
createDynamicLink(link: DynamicLink): Promise<string> {
if (!(link instanceof DynamicLink)) {
@@ -67,12 +67,12 @@ export default class Links extends ModuleBase {
/**
* Create short Dynamic Link from parameters
* @param parameters
* @returns {Promise.<String>}
* @returns {Promise.<string>}
*/
createShortDynamicLink(
link: DynamicLink,
type?: 'SHORT' | 'UNGUESSABLE'
): Promise<String> {
): Promise<string> {
if (!(link instanceof DynamicLink)) {
return Promise.reject(
new Error(
@@ -89,7 +89,7 @@ export default class Links extends ModuleBase {
/**
* Returns the link that triggered application open
* @returns {Promise.<String>}
* @returns {Promise.<string>}
*/
getInitialLink(): Promise<?string> {
return getNativeModule(this).getInitialLink();