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