import { AssertSortList, SortList } from './SortList.js'; export type StamhoofdAndFilter = { $and: StamhoofdFilter; }; export type StamhoofdOrFilter = { $or: StamhoofdFilter; }; export type StamhoofdNotFilter = { $not: StamhoofdFilter; }; /** * Magic values help with storage of filters and maintaining their meaning */ export type StamhoofdMagicValues = '$now'; export type StamhoofdCompareValue = string | number | Date | null | boolean | { $: StamhoofdMagicValues; }; export declare const FilterWrapperMarker: unique symbol; export type WrapperFilter = StamhoofdFilter; export type StamhoofdKeyFilterValue = { $eq: T; } | { $in: T[]; } | { $neq: T; } | { $gt: T; } | { $lt: T; } | { $contains: string; } | { $length: StamhoofdFilter; } | { $elemMatch: StamhoofdFilter; } | T; export type StamhoofdKeyFilter = { [k in string]: StamhoofdFilter; }; export type StamhoofdFilter = StamhoofdAndFilter | StamhoofdOrFilter | StamhoofdNotFilter | StamhoofdKeyFilterValue | StamhoofdKeyFilter | StamhoofdFilter[]; export declare function isEmptyFilter(filter: StamhoofdFilter): boolean; export declare function mergeFilters(filters: (StamhoofdFilter | null)[], type?: '$and' | '$or'): StamhoofdFilter | null; export declare function assertSort(list: SortList, assert: AssertSortList): SortList; export declare function isEqualFilter(a: StamhoofdFilter | null, b: StamhoofdFilter | null): boolean; export declare function wrapFilter(filter: StamhoofdFilter, wrap: WrapperFilter): StamhoofdFilter; /** * Essentially, this checks if filter and wrap are the same, but ignoring comparison if wrap is FilterWrapperMarker * If multiple FilterWrapperMarker are used, their value should be the same - otherwise undefined is returned * Returns the filter at FilterWrapperMarker if it is found * If no FilterWrapperMarker is found, the filter is returned if it is the same as wrap */ export declare function unwrapFilter(filter: StamhoofdFilter, wrap: WrapperFilter): { match: boolean; markerValue?: StamhoofdFilter | undefined; leftOver?: StamhoofdFilter; }; export declare function unwrapFilterByPath(filter: StamhoofdFilter, keyPath: (string | number)[]): StamhoofdFilter | null; //# sourceMappingURL=StamhoofdFilter.d.ts.map