export interface Expression { /** * @return true if the given object is a literal expression. */ isConstant(): boolean; /** * @return true if the given object is a path expression. */ isPath(): boolean; } export interface ExpressionAccessor { setExpression(expression: Expression): any; } /** * Refers to a property of an object. */ export interface Path extends Expression { /** * @return string representation of this expression. */ toString(): string; /** * @return the value of this path if it is bound to an data object (see {@link BeanBinding}. */ getValue(): any; /** * Sets a new value for the given path. * * @param newValue */ setValue(value: any): any; /** * @return name to use for forFormElement elements to uniquely identity this path. This current corresponds * to toString, will later be extended to include resource$ identifiers to support complex forFormElement with * multiple editors (TODO). */ toFormName(): string; /** * Underlying resource holding the values. * * @returns {any} */ getResource(): any; /** * Pointer of this path from the resource. */ getSourcePointer(): String; /** * @returns {string} path used for sorting and filtering (excludes any 'relationships' and 'attributes' in the path) */ toQueryPath(): string; } export declare const OPERATION_EQ = "EQ"; export declare const OPERATION_NEQ = "NEQ"; export declare const OPERATION_LIKE = "LIKE"; export declare const OPERATION_GT = "GT"; export declare const OPERATION_LT = "LT"; export declare const OPERATION_GE = "GE"; export declare const OPERATION_LE = "LE"; /** * Base implementation for a {@link Expression} providing a EQ and NEQ operation. */ export declare class SimpleExpression implements Expression { eq(right: T): BooleanExpression; neq(right: T): BooleanExpression; isConstant(): boolean; isPath(): boolean; } /** * Base implementation for a {@link Expression} providing equals and compare operations. */ export declare abstract class ComparableExpression extends SimpleExpression { lt(right: T): BooleanExpression; le(right: T): BooleanExpression; gt(right: T): BooleanExpression; ge(right: T): BooleanExpression; } /** * Base implementation for {@link Expression} bound to a string. */ export declare abstract class StringExpression extends ComparableExpression { like(right: string): BooleanExpression; } /** * Base implementation for {@link Expression} bound to a number. */ export declare abstract class NumberExpression extends ComparableExpression { } /** * Base implementation for {@link Expression} bound to a boolean. */ export declare abstract class BooleanExpression extends ComparableExpression { } /** * Represents a boolean operation comparing two expressions with the provided operation. */ export declare class BooleanOperation extends BooleanExpression { operation: string; expressions: Expression[]; constructor(operation: string, left: Expression, right: Expression); } /** * Helper methods to create expressions. */ export declare class ExpressionFactory { static toBeanPath(object: any, attributeNames: Array): BeanPath; static toLiteral(value: any): Constant; static concat(parent: Expression, value1: string): string; } /** * Represents a constant expression. */ export interface Constant extends Expression { value: T; } export declare class BooleanConstant extends BooleanExpression implements Constant { value: boolean; constructor(value: boolean); isConstant(): boolean; toString(): string; } export declare class NumberConstant extends NumberExpression implements Constant { value: number; constructor(literal: number); isConstant(): boolean; toString(): string; } export declare class StringConstant extends StringExpression implements Constant { value: string; constructor(value: string); isConstant(): boolean; toString(): string; } /** * Represents a path accessing a object property. */ export declare class BeanPath extends SimpleExpression implements Path { parentPath: BeanPath; private property; constructor(parentPath: BeanPath, property?: string); protected add

>(path: P): P; protected createString(property: string): StringPath; protected createBoolean(property: string): BooleanPath; protected createNumber(property: string): NumberPath; toString(): string; isPath(): boolean; getValue(): any; setValue(newValue: any): any; getResource(): any; toFormName(): string; getSourcePointer(): string; toQueryPath(): string; } /** * Represents a path accessing a string property. */ export declare class StringPath extends StringExpression implements Path { private parent; private property; constructor(parent: BeanPath, property: string); toString(): string; isPath(): boolean; getValue(): any; setValue(newValue: any): Error; toFormName(): string; getResource(): any; getSourcePointer(): string; toQueryPath(): string; } export declare class ArrayPath, T> extends SimpleExpression> implements Path> { private parent; private property; private _referenceType; constructor(parent: BeanPath, property: string, _referenceType: new (...args: any[]) => Q); getElement(index: number): Q; toString(): string; isPath(): boolean; isConstant(): boolean; getValue(): any; setValue(newValue: any): Error; toFormName(): string; getResource(): any; getSourcePointer(): string; toQueryPath(): string; } export declare class MapPath, T> extends SimpleExpression> implements Path> { private parent; private property; private _referenceType; constructor(parent: BeanPath, property: string, _referenceType: new (...args: any[]) => Q); getElement(key: any): Q; toString(): string; isPath(): boolean; isConstant(): boolean; getValue(): any; setValue(newValue: any): Error; toFormName(): string; getResource(): any; getSourcePointer(): string; toQueryPath(): string; } /** * Represents a path accessing a number property. */ export declare class NumberPath extends NumberExpression implements Path { private parent; private property; constructor(parent: BeanPath, property: string); toString(): string; isPath(): boolean; getValue(): any; setValue(newValue: any): Error; toFormName(): string; getResource(): any; getSourcePointer(): string; toQueryPath(): string; } /** * Represents a path accessing a boolean property. */ export declare class BooleanPath extends BooleanExpression implements Path { private parent; private property; constructor(parent: BeanPath, property: string); toString(): string; isPath(): boolean; getValue(): any; setValue(newValue: any): Error; toFormName(): string; getResource(): any; getSourcePointer(): string; toQueryPath(): string; } /** * Represents a direct refresh to object. Sits at the root of an expression chain. */ export declare class BeanBinding extends BeanPath { bean: any; constructor(bean: any); toString(): string; getValue(): any; setValue(value: any): void; getResource(): any; }