@neo4j/cypher-builder
Version:
A programmatic API for building Cypher queries for Neo4j
46 lines (45 loc) • 1.79 kB
TypeScript
import type { CypherEnvironment } from "../../Environment";
import type { CypherCompilable, Expr } from "../../types";
/** @inline */
type LabelSource = string | LabelExpr | Expr;
/** @group Patterns */
export type LabelOperator = "&" | "|" | "!" | "%";
/**
* Label Expression to be used as part of a Pattern
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/expressions/#label-expressions | Cypher Documentation}
* @group Patterns
*/
export declare abstract class LabelExpr implements CypherCompilable {
protected operator: LabelOperator;
constructor(operator: LabelOperator);
/**
* @internal
*/
abstract getCypher(env: CypherEnvironment): string;
protected compileLabel(expr: LabelSource, env: CypherEnvironment): string;
}
/** Generates an `&` operator between labels or types
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/expressions/#label-expressions | Cypher Documentation}
* @group Expressions
* @category Operators
*/
declare function labelAnd(...labels: Array<LabelSource>): LabelExpr;
/** Generates an `|` operator between labels or types
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/expressions/#label-expressions | Cypher Documentation}
* @group Expressions
* @category Operators
*/
declare function labelOr(...labels: Array<LabelSource>): LabelExpr;
/** Generates an `!` operator for a label or type
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/expressions/#label-expressions | Cypher Documentation}
* @group Expressions
* @category Operators
*/
declare function labelNot(label: LabelSource): LabelExpr;
export declare const labelExpr: {
and: typeof labelAnd;
or: typeof labelOr;
not: typeof labelNot;
wildcard: LabelExpr;
};
export {};