import { Query } from 'queric'; import { SearchQuery, IfFullQuery, IfSearchQuery } from '../../main/databox/dbDefinitions'; import { setNotFunctionSymbol } from '../Not'; /** * @description * Util function for creating a value filter for databox transactions. * @example * db.content.insert('34',{name: 'Luca'},{if: $not($contains($value({name: 'Luca'})))}) * @param query */ export declare function $value(query: Query): SearchQuery; /** * @description * Util function for creating a key filter for databox transactions. * @example * db.content.insert('36','luca',{if: $contains($key('35'))}) * @param query */ export declare function $key(query: Query): SearchQuery; /** * @description * Util function for creating a pair (key and value) filter for databox transactions. * @example * db.content.insert('22',{type: 'Car'},{if: $contains($pair({$eq: '21'},{type: 'Bicycle'}))}) * @param keyQuery * @param valueQuery */ export declare function $pair(keyQuery: Query, valueQuery: Query): SearchQuery; /** * @description * Databox filter constant to select all values. */ export declare const $all: Readonly<{}>; /** * @description * Util function for creating an if condition for databox transactions. * It creates a condition that at least one item must match with the provided query. * It's possible to invert the condition using the $not function. (None of the items should match) * @example * db.content['34'].name.update('luca',{if: $contains($key('age'))}) * db.content['34'].name.update('luca',{if: $not($contains($key('age')))}) * @param query */ export declare function $contains(query: SearchQuery): IfSearchQuery & { [setNotFunctionSymbol]: () => void; }; /** * @description * Util constant for creating an if condition for databox transactions. * With this constant, you can check if any element or none element exists. * @example * db.content.insert('41',{name: 'Max',age: 10},{if: $notContains($any)}) */ export declare const $any: Readonly<{}>; /** * @description * Util function for creating an if condition for databox transactions. * It creates a condition that the complete object (all key-value pairs) * must match with the provided query. * It's possible to invert the condition using the $not function. * @example * db.content['34'].name.update('luca',{if: $matches({email: 'test1@test.de', age: {gte: 18}})}) * db.content['34'].name.update('luca',{if: $not($matches({email: 'test1@test.de', age: {gte: 18}}))}) * @param query */ export declare function $matches(query: Query): IfFullQuery & { [setNotFunctionSymbol]: () => void; };