windingwind / zotero-types

TypeScript definitions for Zotero.
https://www.npmjs.com/package/zotero-types
MIT License
56 stars 9 forks source link

Can't add `joinMode` condition to Zotero.Search object #45

Closed StevenGLee closed 3 months ago

StevenGLee commented 3 months ago

The following code

const s = new Zotero.Search({
  name: fullName,
  libraryID: Zotero.Libraries.userLibraryID,
});
s.addCondition("joinMode", "any");

provides the following output while building:

> error TS2345: Argument of type '"any"' is not assignable to parameter of type 'Operator'.
windingwind commented 3 months ago

I don't think this code is correct. any is not a valid operator, as the error message describes.

windingwind commented 3 months ago

It's nothing to do with joinMode. The error is from the second argument "any"

volatile-static commented 3 months ago

It seems that any do is a valid operator. https://github.com/zotero/zotero/blame/b7bfdd5f7ca3232bd861f8dfdf3a2f33da9aacc6/chrome/content/zotero/xpcom/data/searchConditions.js#L57

windingwind commented 3 months ago

Thanks. Please update the package.