-
-
Notifications
You must be signed in to change notification settings - Fork 508
Open
Description
When trying to build a project that is using v0.8.205, there's errors due to the types in index.d.ts
not meeting constraints.
node_modules/flexsearch/index.d.ts:208:20 - error TS2344: Type 'undefined' does not satisfy the constraint 'DocumentData'.
208 ? Resolver<undefined, W, S>
~~~~~~~~~
node_modules/flexsearch/index.d.ts:943:34 - error TS2344: Type 'undefined' does not satisfy the constraint 'DocumentData'.
943 D extends DocumentData = undefined,
~~~~~~~~~
node_modules/flexsearch/index.d.ts:961:34 - error TS2344: Type 'undefined' does not satisfy the constraint 'DocumentData'.
961 D extends DocumentData = undefined,
~~~~~~~~~
node_modules/flexsearch/index.d.ts:1023:34 - error TS2344: Type 'undefined' does not satisfy the constraint 'DocumentData'.
1023 D extends DocumentData = undefined,
~~~~~~~~~
This appears to be due to specifying undefined
with the intent of making the document data type a required generic type parameter, but is invalid - rather, these generics should be either left undefined so that they are required, or the default concrete type DocumentData
should be used instead (if it is desirable to make it an optional generic parameter).
While this can be circumvented by specifying "skipLibCheck": true
in the tsconfig.json
, that's not really a great solution long term and weakens the type safety that can be provided.
Let me know what you folks would prefer and I'm happy to open a PR for it.
Metadata
Metadata
Assignees
Labels
No labels