UNPKG

ifc-expressions

Version:

Parsing and evaluation of IFC expressions

58 lines (57 loc) 2.68 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_DATE: SimpleType; static readonly IFC_DATE_TIME: SimpleType; static readonly IFC_TIME: SimpleType; static readonly IFC_DURATION: SimpleType; static readonly IFC_TIME_STAMP: 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 isIfcDate(actualType: ExprType): boolean; static isIfcDateTime(actualType: ExprType): boolean; static isIfcTime(actualType: ExprType): boolean; static isIfcDuration(actualType: ExprType): boolean; static isIfcTimeStamp(actualType: ExprType): boolean; static isType(actualType: ExprType, type: ExprType): boolean; static boolean(): SimpleType; static logical(): SimpleType; static string(): SimpleType; static ifcDate(): SimpleType; static ifcDateTime(): SimpleType; static ifcTime(): SimpleType; static ifcDuration(): SimpleType; static ifcTimeStamp(): 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; }