-
Notifications
You must be signed in to change notification settings - Fork 73
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
fix(types): use InstantSearch.js types #828
Conversation
✔️ Deploy Preview for angular-instantsearch ready! 🔨 Explore the source changes: 4e1180e 🔍 Inspect the deploy log: https://app.netlify.com/sites/angular-instantsearch/deploys/61168626d13b92000725db2c 😎 Browse the preview: https://deploy-preview-828--angular-instantsearch.netlify.app |
|
||
private differ: KeyValueDiffer<string, any>; // SearchParameters (I don't know how to get the values of the type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok with the removal of the comment. Did you try ConfigureConnectorParams['searchParameters'][keyof ConfigureConnectorParams['searchParameters']]
though? I think that's the same now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this but I started getting:
Overload 2 of 2, '(object: { [key: string]: string | number | boolean | string[] | readonly string[] | readonly (readonly string[])[] | readonly (readonly number[])[] | readonly ("exactPhrase" | "excludeWords")[] | readonly ("ignorePlurals" | "singleWordSynonym" | "multiWordsSynonym")[] | readonly { readonly from: number; readonly value: number; }[] | ... 6 more ... | { ...; }; }): KeyValueChanges<...>', gave the following error.
Argument of type 'PlainSearchParameters' is not assignable to parameter of type '{ [key: string]: string | number | boolean | string[] | readonly string[] | readonly (readonly string[])[] | readonly (readonly number[])[] | readonly ("exactPhrase" | "excludeWords")[] | readonly ("ignorePlurals" | "singleWordSynonym" | "multiWordsSynonym")[] | readonly { readonly from: number; readonly value: numb...'.
Index signature is missing in type 'PlainSearchParameters'.
Have you already encountered a similar use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's because the differ doesn't work with readonly I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better approach! LGTM!
Changes of this PR.
1. Introduces
TypedBaseWidget
, without removingBaseWidget
We could have replaced
BaseWidget
but that would:I'm choosing to keep
BaseWidget
and only deprecate it.2. Migrate all widgets to TypeBaseWidget and InstantSearch.js types.
We no longer expose types from the Angular Instantsearch themselves (users will need to get them from instantsearch.js)
3. updates IS.js to 4.26 to use the latest types.
4. Migrate storybook