import QueryTable from "../query-table";
import QueryCondition from "./query-condition";
import GenericsHelper from "../helpers/generics-helper";
import {ConditionChainType} from "../helpers/internal-types";
export default class QueryConditionChain
> extends QueryCondition {
protected _$type: GenericsHelper;
protected _sibling: QueryCondition;
protected _child: QueryCondition;
protected _chainType: ConditionChainType;
protected _parenthesis = false;
protected _negation = false;
constructor(sibling: QueryCondition, child: QueryCondition, chainType: ConditionChainType) {
super();
this._sibling = sibling;
this._child = child;
this._chainType = chainType;
}
// TODO how to call this
$() {
this._parenthesis = true;
return this;
}
not() {
this._negation = true;
return this;
}
and>(condition: QueryCondition): QueryConditionChain {
return new QueryConditionChain(this, condition, 'and');
}
or>(condition: QueryCondition): QueryConditionChain {
return new QueryConditionChain(this, condition, 'or');
}
}