import { BooleanType, IntegerArg, CharacterArg, TextType, ArrayArg } from '../' import { AnyExpression, Expression } from '../../expressions' import { ConstraintConfig } from '../../functions' import { Type, type } from '../index' export const JSONB = () => type`JSONB` as JSONBType export type JSONBArg = JSONBType['argument'] export interface JSONBType extends Type<'JSONB', R, T> { expression: JSONBExpression argument: Expression> | this['input'] required(conf?: ConstraintConfig): JSONBType } export interface JSONBExpression = Record, R extends boolean = boolean> extends AnyExpression> { concat(arg: CharacterArg): Expression> concat(arg: JSONBExpression): Expression> get (item: K): Expression> get (item: IntegerArg | CharacterArg): Expression> getText (item: IntegerArg | CharacterArg): Expression> getByPath (path: ArrayArg): Expression> getTextByPath (path: ArrayArg): Expression> contain (arg: any): Expression> contained (arg: any): Expression> includes (text: CharacterArg): Expression> includesAny (text: ArrayArg): Expression> includesAll (text: ArrayArg): Expression> unset (item: IntegerArg | CharacterArg): Expression> unsetAll (item: ArrayArg): Expression> unsetByPath (path: ArrayArg): Expression> jsonPathExist (path: CharacterArg): Expression> jsonPathCheck (path: CharacterArg): Expression> }