UNPKG

ifc-expressions

Version:

Parsing and evaluation of IFC expressions

43 lines (42 loc) 2 kB
import { ExpressionTypeError } from "../error/ExpressionTypeError.js"; import { SimpleType } from "./SimpleType.js"; import { ExprType } from "./ExprType.js"; import { ArrayType } from "./ArrayType.js"; import { TupleType } from "./TupleType.js"; export declare class Type { static readonly ANY: SimpleType; static readonly NUMERIC: SimpleType; static readonly STRING: SimpleType; static readonly LOGICAL: SimpleType; static readonly BOOLEAN: SimpleType; static readonly IFC_OBJECT_REF: SimpleType; static readonly IFC_ELEMENT_REF: SimpleType; static readonly IFC_PROPERTY_REF: SimpleType; static readonly IFC_PROPERTY_SET_REF: SimpleType; static readonly IFC_TYPE_OBJECT_REF: SimpleType; static readonly ARRAY: SimpleType; } export declare class Types { static or(...types: Array<ExprType>): ExprType; static array(elementType: ExprType): ArrayType; static tuple(...types: Array<ExprType>): TupleType; static isNumeric(actualType: ExprType): boolean; static isBoolean(actualType: ExprType): boolean; static isLogical(actualType: ExprType): boolean; static isString(actualType: ExprType): boolean; static isType(actualType: ExprType, type: ExprType): boolean; static boolean(): SimpleType; static logical(): SimpleType; static string(): SimpleType; static numeric(): SimpleType; static ifcObjectRef(): SimpleType; static requireIsAssignableFrom(expectedType: ExprType, actualType: ExprType, exceptionProducer: () => ExpressionTypeError): void; /** * Requires overlap if actual is a disjunction, assignable from if it is a type * @param expectedType * @param actualType * @param exceptionProducer */ static requireWeakIsAssignableFrom(expectedType: ExprType, actualType: ExprType, exceptionProducer: () => ExpressionTypeError): void; static requireTypesOverlap(actualType: ExprType, actualType2: ExprType, exceptionProducer: () => ExpressionTypeError): void; }