View as Markdown

API reference: @salmonui/query-builder

QueryOperatorinterface

import type { QueryOperator } from '@salmonui/query-builder';
interface QueryOperator {
    readonly name: string;
    readonly label?: string | undefined;
    readonly types?: readonly QueryFieldType[] | undefined;
    readonly valueless?: boolean | undefined;
    readonly list?: boolean | undefined;
    readonly evaluate?: ((cellValue: unknown, filterValue: Json, ctx: {
        readonly matchCase: boolean;
        readonly ignoreAccents: boolean;
    }) => boolean) | undefined;
}

A custom operator: labels and types here; evaluation through filterRows / the Data Grid filter module, SQL / Mongo through the converter hooks.

QueryOperator members (6)
NameSignatureDescription
namereadonly name: string;
labeloptionalreadonly label?: string | undefined;
typesoptionalreadonly types?: readonly QueryFieldType[] | undefined;

Field types that offer it; default every type.

valuelessoptionalreadonly valueless?: boolean | undefined;

The operator takes no value.

listoptionalreadonly list?: boolean | undefined;

The value is a list (like in).

evaluateoptionalreadonly evaluate?: ((cellValue: unknown, filterValue: Json, ctx: { readonly matchCase: boolean; readonly ignoreAccents: boolean; }) => boolean) | undefined;

Row test for filterRows (the core custom operator signature).