import type { GraphQLEnumValue, GraphQLInputField } from 'graphql'; /** * Describes what a field of a filter input type (filter or flexSearchFilter) filters on * * Field names refer to the model fields of the type the filter input type is generated for. */ export type FilterFieldInfo = /** * Compares the value of a scalar or enum field, e.g. createdAt_gt */ { readonly kind: 'field'; readonly fieldName: string; /** * The operator, e.g. "equal", "gt", "in" or "starts_with" */ readonly operator: string; /** * Only for flexSearch: true if the field is a list, and the filter checks if any item matches */ readonly aggregation?: boolean; } /** * Applies a nested filter on an object, reference or entity extension field, e.g. customer */ | { readonly kind: 'object'; readonly fieldName: string; /** * Only for flexSearch: true if the field is a list, and the filter checks if any item matches */ readonly aggregation?: boolean; } /** * Applies a nested filter on the items of a list field, e.g. deliveries_some */ | { readonly kind: 'quantifier'; readonly fieldName: string; readonly quantifier: 'some' | 'every' | 'none'; } /** * Checks if a list field is empty, e.g. deliveries_empty */ | { readonly kind: 'empty'; readonly fieldName: string; } /** * Only for flexSearch: applies a nested filter on the value of an I18nString field in a given * language, e.g. description_localized */ | { readonly kind: 'localized'; readonly fieldName: string; } /** * Compares the value that is filtered by the containing filter type itself, e.g. the items of a * list of strings (tags_some: { starts_with: "a" }) */ | { readonly kind: 'value'; readonly operator: string; } /** * Compares the key or the value of a StringMap entry */ | { readonly kind: 'stringMapEntry'; readonly part: 'key' | 'value'; readonly operator: string; } /** * Combines a list of filters of the containing filter type (AND or OR) */ | { readonly kind: 'and' | 'or'; }; /** * Describes what a value of an orderBy enum sorts by */ export interface OrderByValueInfo { /** * The names of the model fields from the ordered type to the sorted value, e.g. * ['customer', 'name'] for customer_name_ASC */ readonly fieldPath: ReadonlyArray; readonly direction: 'ASCENDING' | 'DESCENDING'; } export declare function createFilterFieldExtensions(info: FilterFieldInfo): { cruddl: { filterField: FilterFieldInfo; }; }; export declare function createOrderByValueExtensions(info: OrderByValueInfo): { cruddl: { orderByValue: OrderByValueInfo; }; }; /** * Gets what a field of a generated filter input type (filter or flexSearchFilter) filters on * * The information is only available on the schema objects created by cruddl. It is neither part of * the SDL nor of the introspection result. * * @return the filter field info, or undefined if the field is not a filter field generated by * cruddl, or does not filter on anything (e.g. the language field of a _localized filter) */ export declare function getFilterFieldInfo(field: GraphQLInputField): FilterFieldInfo | undefined; /** * Gets what a value of a generated orderBy enum sorts by * * The information is only available on the schema objects created by cruddl. It is neither part of * the SDL nor of the introspection result. * * @return the info, or undefined if the value is not an orderBy value generated by cruddl */ export declare function getOrderByValueInfo(value: GraphQLEnumValue): OrderByValueInfo | undefined;