import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__ from "../../../collection-manager/index.mjs";
const useOperatorList = ()=>{
    const schema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    const { name } = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
    const { getCollectionFields, getInterface } = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollectionManager_deprecated)();
    const res = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
        var _schema_xdesignerprops, _getInterface_filterable, _getInterface;
        const fieldInterface = null === (_schema_xdesignerprops = schema['x-designer-props']) || void 0 === _schema_xdesignerprops ? void 0 : _schema_xdesignerprops.interface;
        const collectionFields = getCollectionFields(name);
        if (fieldInterface) {
            var _getInterface_filterable1, _getInterface1;
            return (null === (_getInterface1 = getInterface(fieldInterface)) || void 0 === _getInterface1 ? void 0 : null === (_getInterface_filterable1 = _getInterface1.filterable) || void 0 === _getInterface_filterable1 ? void 0 : _getInterface_filterable1.operators) || [];
        }
        const field = collectionFields.find((item)=>item.name === schema.name);
        return (null === (_getInterface = getInterface(null == field ? void 0 : field.interface)) || void 0 === _getInterface ? void 0 : null === (_getInterface_filterable = _getInterface.filterable) || void 0 === _getInterface_filterable ? void 0 : _getInterface_filterable.operators) || [];
    }, [
        schema.name
    ]);
    return res;
};
export { useOperatorList };
