-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Incorrect type definitions #342
Comments
I'm using patch-package so that I can continue to use |
Same problem here when I try to create a Document index with version
But it should point to something like this |
We have to downgrade until nextapps-de/flexsearch#342 is fixed. reverts: 0ab88d6
After updating from For now that feels like a breaking change |
had to fork it - https://www.npmjs.com/package/flexsearch-ts and swap types with @types/flexsearch |
I'm experiencing this issue after updating from v0.7.21 to v0.7.31 (I was using this lib with I had to rollback to |
Same issue after upgrading to In the meanwhile, @ts-thomas (author of Flexsearch) and @Losses (Author of de-facto the best typing in DefinitelyTyped project), would you consider bringing the DefinitelyTyped version into this repo? The typing files won't hurt performance and it's in theory a O(1) complexity change with huge improvement for developers who expect out-of-box typing. The competing library Lyra search, for example, already ships with full typescript support. |
I also saw #343 trying to overhaul the typing. There is probably conflict change. Would it help or make it worse if we break that into a separate typing update plus other bigger changes for later, just to unblock existing typescript users? Just throwing some ideas out there. |
Thanks for this report. The whole ts-type dilemma is pretty strange. This is the only part of code which wasn't contributed by me. I really would like to have some advice, which of the type definitions are the proper one and what needs to be changed. If someone could creating a pull request, that would be great. Thanks a lot. |
I'd like to if the developers of this library agree to merge the pull request... |
For all of those struggling with this using
|
Up |
Up. |
|
this fixes he issue for me (workarround only) npm i -D flexsearch
npm i -D @types/flexsearch
rm -rf node_modules/flexsearch/index.d.ts |
Just came here wondering if the library was dropped because of how broken the type definitions are. I believe it would be much better to ship without types (just delete index.d.ts) for the sake of not sending wrong signals about the status of the project. |
100% agree with @fgarcia here. If the official type definitions are not going to be actively maintained but the library is then at least remove them so |
@ts-thomas would be great if you could remove the index.d.ts from the package/release basically merging this PR: #366 |
As the author of |
Bump. Although, if I were in the shoes of @ts-thomas I would drop index.d.t.s and let the community manage the TS typings. As he has said in this thread (quoted below) he isn't sure about what should be done as the community has varying opinions on how the library should go forward in this regard, so I'd say his best bet is to drop index.d.ts
|
I am trying to use your fork and still doesn't work for me. Error below
The code for
package.json:
|
* fix(geo): do not upgrade flexsearch since it seem not compatible with TS nextapps-de/flexsearch#342
* feat: update Angular v17 * fix(geo): do not upgrade flexsearch since it seem not compatible with TS nextapps-de/flexsearch#342 * fix(core/language): TranslateModule call forRoot only once with provideRootTranslation - IgoLanguageModule only export the TranslateModule BREAKING CHANGE: IgoLanguageModule don't import TranslateModule.forRoot defaultLanguageLoader is not exported anymore - provideDefaultLanguageLoader and provideLanguageLoader are replaced by DEFAULT_LANGUAGE_LOADER and set directly inside the TranslationConfig * fix(auth): test
* feat: update Angular v17 * fix(geo): do not upgrade flexsearch since it seem not compatible with TS nextapps-de/flexsearch#342 * feat(demo): Convert all components, directives and pipes to standalone * feat(demo): Remove unnecessary NgModule classes * fix(core/language): TranslateModule call forRoot only once with provideRootTranslation - IgoLanguageModule only export the TranslateModule BREAKING CHANGE: IgoLanguageModule don't import TranslateModule.forRoot defaultLanguageLoader is not exported anymore - provideDefaultLanguageLoader and provideLanguageLoader are replaced by DEFAULT_LANGUAGE_LOADER and set directly inside the TranslationConfig * feat: remove extra module and rework navigation * fix(demo): main clean up * fix(test) * fix(workspace): code deleted by error
* fix(geo): do not upgrade flexsearch since it seem not compatible with TS nextapps-de/flexsearch#342 * fix(core): translatemodule forRoot is now called once (#1551) * feat: update Angular v17 (#1543) * feat(core/language): refact the language initialization (#1563) BREAKING CHANGE: IgoLanguageModule don't import TranslateModule.forRoot defaultLanguageLoader is not exported anymore - provideDefaultLanguageLoader and provideLanguageLoader are replaced by DEFAULT_LANGUAGE_LOADER and set directly inside the TranslationConfig * feat(demo): Convert all components, directives and pipes to standalone * refactor(demo): Remove unnecessary NgModule classes, visual adjustment and rework navigation (#1556) * fix(tsconfig): remove deprecated config and unnecessary (#1610) * fix(all): resolve template type checking BREAKING CHANGE ToolboxColor is now a type * fix(auth): remove unused module (#1619) BREAKING CHANGES * feat(ci): update pipeline * refact(auth): missing deps due to merge conflict * fix(demo): geo/simple-map missing optionnal chaining
* fix(geo): do not upgrade flexsearch since it seem not compatible with TS nextapps-de/flexsearch#342
* feat: update Angular v17 * fix(geo): do not upgrade flexsearch since it seem not compatible with TS nextapps-de/flexsearch#342 * feat(demo): Convert all components, directives and pipes to standalone * feat(demo): Remove unnecessary NgModule classes * fix(core/language): TranslateModule call forRoot only once with provideRootTranslation - IgoLanguageModule only export the TranslateModule BREAKING CHANGE: IgoLanguageModule don't import TranslateModule.forRoot defaultLanguageLoader is not exported anymore - provideDefaultLanguageLoader and provideLanguageLoader are replaced by DEFAULT_LANGUAGE_LOADER and set directly inside the TranslationConfig * feat: remove extra module and rework navigation * fix(demo): main clean up * fix(test) * fix(workspace): code deleted by error
The supplied type definitions are not correct importing the Index as such:
results in the error:
'Index' only refers to a type, but is being used as a value here
There exits working type definitions in https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/flexsearch but to use them one has to either downgrade to a version containing no type definitions (e.g. 0.7.11) or delete the supplied one.
It would be awesome if you can sort this out.
The text was updated successfully, but these errors were encountered: