@neo4j/cypher-builder
Version:
A programmatic API for building Cypher queries for Neo4j
119 lines (118 loc) • 3.77 kB
TypeScript
import { CypherASTNode } from "../CypherASTNode";
import type { CypherEnvironment } from "../Environment";
import type { Expr } from "../types";
import type { ValueOf } from "../utils/type-helpers";
declare const BaseTypes: {
readonly ANY: "ANY";
readonly BOOLEAN: "BOOLEAN";
readonly DATE: "DATE";
readonly DURATION: "DURATION";
readonly FLOAT: "FLOAT";
readonly INTEGER: "INTEGER";
readonly LOCAL_DATETIME: "LOCAL DATETIME";
readonly LOCAL_TIME: "LOCAL_TIME";
readonly MAP: "MAP";
readonly NODE: "NODE";
readonly NOTHING: "NOTHING";
readonly NULL: "NULL";
readonly PATH: "PATH";
readonly POINT: "POINT";
readonly PROPERTY_VALUE: "PROPERTY VALUE";
readonly RELATIONSHIP: "RELATIONSHIP";
readonly STRING: "STRING";
readonly ZONED_DATETIME: "ZONED DATETIME";
readonly ZONED_TIME: "ZONED TIME";
readonly TIMESTAMP_WITHOUT_TIME_ZONE: "TIMESTAMP WITHOUT TIME ZONE";
readonly TIME_WITHOUT_TIME_ZONE: "TIME WITHOUT TIME ZONE";
readonly TIMESTAMP_WITH_TIME_ZONE: "TIMESTAMP WITH TIME ZONE";
readonly TIME_WITH_TIME_ZONE: "TIME WITH TIME ZONE";
};
/**
* @inline
*/
type Type = ValueOf<typeof BaseTypes> | ListType;
/**
* Generates a cypher `LIST<...>` type
* @example
* ```cypher
* LIST<STRING>
* ```
*/
declare function list(type: Type | Type[]): ListType;
/**
* Types supported by Neo4j
* @see {@link https://neo4j.com/docs/cypher-manual/current/values-and-types/property-structural-constructed/#types-synonyms | Cypher Documentation}
*/
export declare const CypherTypes: {
readonly list: typeof list;
readonly ANY: "ANY";
readonly BOOLEAN: "BOOLEAN";
readonly DATE: "DATE";
readonly DURATION: "DURATION";
readonly FLOAT: "FLOAT";
readonly INTEGER: "INTEGER";
readonly LOCAL_DATETIME: "LOCAL DATETIME";
readonly LOCAL_TIME: "LOCAL_TIME";
readonly MAP: "MAP";
readonly NODE: "NODE";
readonly NOTHING: "NOTHING";
readonly NULL: "NULL";
readonly PATH: "PATH";
readonly POINT: "POINT";
readonly PROPERTY_VALUE: "PROPERTY VALUE";
readonly RELATIONSHIP: "RELATIONSHIP";
readonly STRING: "STRING";
readonly ZONED_DATETIME: "ZONED DATETIME";
readonly ZONED_TIME: "ZONED TIME";
readonly TIMESTAMP_WITHOUT_TIME_ZONE: "TIMESTAMP WITHOUT TIME ZONE";
readonly TIME_WITHOUT_TIME_ZONE: "TIME WITHOUT TIME ZONE";
readonly TIMESTAMP_WITH_TIME_ZONE: "TIMESTAMP WITH TIME ZONE";
readonly TIME_WITH_TIME_ZONE: "TIME WITH TIME ZONE";
};
/**
* Type predicate expression
* @group Expressions
* @see {@link https://neo4j.com/docs/cypher-manual/current/values-and-types/type-predicate/ | Cypher Documentation}
* @example
* ```cypher
* val IS :: INTEGER
* ```
*/
export declare function isType(expr: Expr, type: Type | Type[]): IsType;
/**
* Type predicate expression with NOT
* @group Expressions
* @see {@link https://neo4j.com/docs/cypher-manual/current/values-and-types/type-predicate/#type-predicate-not | Cypher Documentation}
* @example
* ```cypher
* val IS NOT :: INTEGER
* ```
*/
export declare function isNotType(expr: Expr, type: Type | Type[]): IsType;
/**
* @group Expressions
*/
export declare class ListType {
private readonly types;
private _notNull;
/** @internal */
constructor(type: Type[]);
notNull(): this;
/** @internal */
getCypher(env: CypherEnvironment): string;
}
/**
* @group Expressions
*/
export declare class IsType extends CypherASTNode {
private readonly expr;
private readonly types;
private readonly not;
private _notNull;
/** @internal */
constructor(expr: Expr, type: Type[], not?: boolean);
notNull(): this;
/** @internal */
getCypher(env: CypherEnvironment): string;
}
export {};