Files
evento/node_modules/kysely/dist/esm/parser/binary-operation-parser.d.ts
2026-03-18 14:55:56 -03:00

22 lines
2.2 KiB
TypeScript

import { BinaryOperationNode } from '../operation-node/binary-operation-node.js';
import { type OperationNodeSource } from '../operation-node/operation-node-source.js';
import { type ComparisonOperator, type BinaryOperator, type Operator } from '../operation-node/operator-node.js';
import { type ExtractTypeFromReferenceExpression, type ExtractTypeFromStringReference, type ReferenceExpression, type StringReference } from './reference-parser.js';
import { type ValueExpression, type ValueExpressionOrList } from './value-parser.js';
import type { OperationNode } from '../operation-node/operation-node.js';
import type { Expression } from '../expression/expression.js';
import type { SelectType } from '../util/column-type.js';
export type OperandValueExpression<DB, TB extends keyof DB, RE> = ValueExpression<DB, TB, ExtractTypeFromReferenceExpression<DB, TB, RE>>;
export type OperandValueExpressionOrList<DB, TB extends keyof DB, RE> = ValueExpressionOrList<DB, TB, ExtractTypeFromReferenceExpression<DB, TB, RE> | null>;
export type OperatorExpression = Operator | Expression<unknown>;
export type BinaryOperatorExpression = BinaryOperator | Expression<unknown>;
export type ComparisonOperatorExpression = ComparisonOperator | Expression<unknown>;
export type FilterObject<DB, TB extends keyof DB> = {
[R in StringReference<DB, TB>]?: ValueExpressionOrList<DB, TB, SelectType<ExtractTypeFromStringReference<DB, TB, R>>>;
};
export declare function parseValueBinaryOperationOrExpression(args: any[]): OperationNode;
export declare function parseValueBinaryOperation(left: ReferenceExpression<any, any>, operator: BinaryOperatorExpression, right: OperandValueExpressionOrList<any, any, any>): BinaryOperationNode;
export declare function parseReferentialBinaryOperation(left: ReferenceExpression<any, any>, operator: BinaryOperatorExpression, right: OperandValueExpressionOrList<any, any, any>): BinaryOperationNode;
export declare function parseFilterObject(obj: Readonly<FilterObject<any, any>>, combinator: 'and' | 'or'): OperationNode;
export declare function parseFilterList(list: ReadonlyArray<OperationNodeSource | OperationNode>, combinator: 'and' | 'or', withParens?: boolean): OperationNode;