You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm i -D typescript
npm i flexsearch
npx tsc test-id.ts
Result (error):
test-id.ts:4:5 - error TS2322: Type '{ index: string[]; }' is not assignable to type 'DocumentOptions<unknown, false> | Descriptor<unknown, false>'.
Property 'id' is missing in type '{ index: string[]; }' but required in type 'DocumentOptions<unknown, false>'.
4 document: {
~~~~~~~~
node_modules/flexsearch/index.d.ts:285:9
285 id: string;
~~
'id' is declared here.
node_modules/flexsearch/index.d.ts:304:9
304 document?: DocumentOptions<T, Store> | Descriptor<T, Store>;
~~~~~~~~
The expected type comes from property 'document' which is declared here on type 'IndexOptionsForDocumentSearch<unknown, false>'
Found 1 error in test-id.ts:4
The text was updated successfully, but these errors were encountered:
The README.md says:
However, copy-and-pasting this code to a TypeScript code resulted in an error.
Environment:
Source file
test-id.ts
:Commands:
Result (error):
The text was updated successfully, but these errors were encountered: