## Description
Currently type and return_type have rather strict restrictions:
* only one value per request
* they are combined using OR operator
https://www.mediawiki.org/wiki/Extension:WikiLambda/API#wikilambdasearch_labels
However, with persisted Function Calls we have more complex requirements for this API.
These are the use cases which we should be requiring different search patterns:
| use case | expect | allowed return types | what to do with result | query by | manually exclude |
| --- | --- | --- | --- | --- | --- |
| function input or function output | anything that resolves to a Z4 (strict) | Z4, Z8, Z7 | Z4 and Z7: create reference, Z8: create function call | (type = Z4 OR return_type = Z4) | Z6884 |
| function call function (Z7K1) parent type open | any function | Z8 | create reference | (type = Z8) | Z6884 (unless top level) |
| function call function (Z7K1) parent type bound | any function that returns parentType (not strict) | Z8 | create reference | (type = Z8) AND (return_type = parentType OR return_type = Z1) | Z6884 (unless top level) |
| type reference | anything that can be used as a Z4 | Z4, Z7 | create reference | (type = Z4) OR (return_type = Z4 AND type = Z7) | |
**Desired behavior/Acceptance criteria**
* [ ] The filter API is sufficiently flexible to adjust to all our use cases without needing multiple calls
* [ ] The UI requests objects according to the requirements, this includes:
* [ ] `TypeSelector` component
* [ ] `ZReference` component
**Options**
?
**An example of current labels table**
| wlzl_zobject_zid | wlzl_type | wlzl_return_type | wlzl_label | etc... |
| --- | --- | --- | --- | --- |
| Z11 | Z4 | NULL | a normal type | |
| Z12 | Z4 | NULL | another normal type | |
| Z801 | Z8 | Z1 | a function that returns anything | |
| Z881 | Z8 | Z4 | a function that returns type | |
| Z866 | Z8 | Z40 | a function that returns boolean | |
| Z6884 | Z8 | Z4 | enum function, returns type | |
| Z10000 | Z7 | Z4 | one persisted enum | |
| Z10002 | Z7 | Z4 | another persisted enum | |
* If I want to select a type for function input or output: Z11, Z12, Z881, Z10000, Z10001, Z6884*
* If I want to select a function for a function call Z7K1, and parent type can be anything: Z801, Z881, Z866, Z6884*
* If I want to select a function for a function call Z7K1, and parent type is bound to Z4: Z881, Z6884*
* If I want to select a type for Z1K1 or for Z3K1: Z11, Z12, Z10000, Z10002
(zids marked with * will be manually excluded from results, but the query is expected to return them)
---
## Completion checklist
* [ ] Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Front-end_Task/Bug_Completion_Checklist