import { type Table } from '../table'; export type AttributeNames = Exclude, () => any>; 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', Type ] | // contains can be used on a list or a string attribute [ 'not contains', Type ] | // not contains can be used on a list or a string attribute [ 'null' ] | [ 'not null' ] | [ 'exists' ] | [ 'not exists' ]; export type Filters = { [A in AttributeNames]?: T[A] | Filter; }; export type ComplexFilters = Array | ComplexFilters | 'OR'>; export type UpdateConditions = Filters;