amplify-js
amplify-js copied to clipboard
fix(auth): Missing type in configure function
Description of changes

Description of how you validated changes

In VSCode
Checklist
- [x] PR description included
- [x]
yarn test
passes - [x] Tests are changed or added
- [x] Relevant documentation is changed or added (and PR referenced)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Hi guys, can we have one more approver here? It's a simple change, won't take long to review.
@micksatana, Thanks for your contribution and also updating the docs at the same time.
@micksatana Looks like we need to fix one of the tests to account for the added type
● Test suite failed to run
@aws-amplify/auth: TypeScript diagnostics (customize using `[jest-config].globals.ts-jest.diagnostics` option):
@aws-amplify/auth: __tests__/auth-configure-test.ts:16:19 - error TS2345: Argument of type '{ userPoolId: string; userPoolWebClientId: string; region: string; identityPoolId: string; mandatorySignIn: boolean; storage: {}; }' is not assignable to parameter of type 'AuthOptions'.
@aws-amplify/auth: Types of property 'storage' are incompatible.
@aws-amplify/auth: Type '{}' is missing the following properties from type 'ICognitoStorage': setItem, getItem, removeItem, clear
@aws-amplify/auth: 16 auth.configure(opts);
Hi @micksatana - thank you for this contribution! We are currently working on improving our TS types, including adding support for typing the configure function. You can check out our RFC proposal here