Type issues in Search Builder
Type issues in Search Builder
Link to test case: https://github.com/DataTables/SearchBuilder/blob/master/src/interface.ts#L104
Description of problem: According to the doc, searchBuilder.rebuild() has two arguments, but the typing is missing the newly added boolean type redraw and the doc might also need be updated too. It says: searchBuilder.rebuild() takes one argument...
If I use:
dt.searchBuilder.rebuild()
I got: TS2554: Expected 1 arguments, but got 0
Same issue for the typing of searchBuilder.getDetails().
or
If I use:
dt.searchBuilder.rebuild(stored)
I got:
TS2345: Argument of type
Required<Pick<SearchBuilderDetails, "criteria">> & SearchBuilderDetails
is not assignable to parameter of type IDetails
Types of property criteria are incompatible.
Type SearchBuilderCriterion[] is not assignable to type Group[]
Type SearchBuilderCriterion is missing the following properties from type Group: classes, dom, c, s, and 23 more
If I use:
dt.searchBuilder.getDetails(false)
I got: TS2554: Expected 0 arguments, but got 1
This question has an accepted answers - jump to answer
Answers
Hi,
Many thanks for letting me know about that error. I've committed a correction.
With that change, the following will work correctly:
Regards,
Allan