import { CharacterArg, TextType } from '..' import { AnyExpression, Expression } from '../../expressions' import { ConstraintConfig } from '../../functions' import { sql } from '../../template' import { Type, type } from '../index' import { IntegerArg } from '../math' export const BIT = (n?: number) => type`BIT${n ? sql`(${n})` : sql``}` as BitType export type BitArg = BitType['argument'] export interface BitType extends Type<'BIT', R> { expression: BinaryExpression> argument: Expression | this['input'] | Expression required(conf?: ConstraintConfig): BitType } export const VARBIT = (n?: number) => type`VARBIT${n ? sql`(${n})` : sql``}` as VarbitType export type VarbitArg = VarbitType['argument'] export interface VarbitType extends Type<'VARBIT', R> { expression: BinaryExpression> argument: Expression | this['input'] | Expression required(conf?: ConstraintConfig): VarbitType } export type BinaryTypes = BitType | VarbitType export type BinaryArg = BinaryTypes['argument'] export interface BinaryExpression extends AnyExpression { concat(arg: BinaryArg): Expression> concat(arg: CharacterArg): Expression> and (arg: BinaryArg): Expression> or (arg: BinaryArg): Expression> xor (arg: BinaryArg): Expression> not (): Expression> lshift (arg: IntegerArg): Expression> rshift (arg: IntegerArg): Expression> }