import { type Table } from '../dyngoose'; import { type MagicSearch } from './search'; export declare class Condition { private readonly search; private readonly key; private _not; private filter; constructor(search: MagicSearch, attributeName: Attr); not(): this; /** * Equal * * Works for all data types, including lists and maps. * Will look for 100% equality, when performing a search on a list, the docum * * - If the target attribute of the comparison is of type String, Number, or Binary, then the operator checks for * a absolute match (similar to === in javascript). * - If the target attribute of the comparison is a set ("SS", "NS", or "BS"), then the operator evaluates to true if * it finds every item specified and only the items specified (similar to _.isEqual in javascript). * - If the target attribute of the comparison is a Map, then the operator evaluates to true if the two objects map * recursively (similar to _.isEqual in javascript). */ eq(value: NonNullable): MagicSearch; /** * Less than * * Works for String, Number, or Binary (not a set type) attribute. * Does not work on sets. */ lt(value: AttributeValueType extends any[] ? never : NonNullable): MagicSearch; /** * Less than or equal * * Works for String, Number, or Binary (not a set type) attribute. * Does not work on sets. */ lte(value: AttributeValueType extends any[] ? never : NonNullable): MagicSearch; /** * Greater than * * Works for String, Number, or Binary (not a set type) attribute. * Does not work on sets. */ gt(value: AttributeValueType extends any[] ? never : NonNullable): MagicSearch; /** * Greater than or equal * * Works for String, Number, or Binary (not a set type) attribute. * Does not work on sets. */ gte(value: AttributeValueType extends any[] ? never : NonNullable): MagicSearch; /** * Checks for a prefix. * * Only works for String or Binary fields. * Does not work for numbers or sets. */ beginsWith(value: AttributeValueType extends any[] ? never : Exclude): MagicSearch; /** * Checks for a subsequence, or value in a set. * * Condition value can contain only be a String, Number, or Binary (not a set type). * * - If the target attribute of the comparison is of type String, then the operator checks for a substring match. * - If the target attribute of the comparison is of type Binary, then the operator looks for a subsequence of the * target that matches the input. * - If the target attribute of the comparison is a set ("SS", "NS", or "BS"), then the operator evaluates to true if * it finds an exact match with any member of the set. * * When using `.not().contains(value)` this checks for the absence of a subsequence, or absence of a value in a set. */ contains(value: AttributeValueType extends Array ? E : AttributeValueType): MagicSearch; exists(): MagicSearch; /** * Checks for matching elements in a list. * * If any of the values specified are equal to the item attribute, the expression evaluates to true. * * This is a rather complicated method, so here is a simple example. * * **Example documents:** * [ { "name": "Bob "}, { "name": "Robert" }, { "name": "Robby" } ] * * **Example condition:** * `filter('name').includes(['Bob', 'Robert'])` * * **Example result:** * [ { "name": "Bob "}, { "name": "Robert" } ] * * Works for String, Number, or Binary (not a set type) attribute. * Does not work on sets. */ includes(...values: AttributeValueType extends any[] ? never : AttributeValueType[]): MagicSearch; /** * A utility method, identical as if you did `.not().includes(…)` */ excludes(...values: AttributeValueType extends any[] ? never : AttributeValueType[]): MagicSearch; /** * Greater than or equal to the first (lower) value, and less than or equal to the second (upper) value. * * Works for String, Number, or Binary (not a set type) attribute. * Does not work on sets. */ between(lower: AttributeValueType extends any[] ? never : NonNullable, upper: AttributeValueType extends any[] ? never : NonNullable): MagicSearch; /** * The attribute does not exist. * * NULL is supported for all data types, including lists and maps. */ null(): MagicSearch; private finalize; }