import { type Table } from '../table' export type AttributeNames = Exclude, () => any> export type ContainsType = Type extends Array ? E : Type extends Set ? E : Type export type Filter = ['=', Type] | ['<>', Type] | // not equals ['<', Type] | ['<=', Type] | ['>', Type] | ['>=', Type] | ['beginsWith', Exclude] | // causes a type error when a number is used with beginsWith, which is unsupported by DynamoDB ['between', Type, Type] | ['includes', Type[]] | ['excludes', Type[]] | ['contains', ContainsType] | // contains can be used on a list, string, or set attributes ['not contains', ContainsType] | // not contains can be used on a list, string, or set attributes ['null'] | ['not null'] | ['exists'] | ['not exists'] export type Filters = { [A in AttributeNames]?: T[A] | Filter } // you have filter groups, which are joined as AND operators and separated by OR statements export type ComplexFilters = Array | ComplexFilters | 'OR'> export type UpdateConditions = Filters