import { Attribute } from "./thing/Attribute"; import { Entity } from "./thing/Entity"; import { Relation } from "./thing/Relation"; import { Thing } from "./thing/Thing"; import { AttributeType } from "./type/AttributeType"; import { EntityType } from "./type/EntityType"; import { RelationType } from "./type/RelationType"; import { RoleType } from "./type/RoleType"; import { ThingType } from "./type/ThingType"; import { Type } from "./type/Type"; import { TypeTransitivity as TransitivityProto, ValueType as ValueTypeProto } from "typedb-protocol/proto/concept"; import { Value } from "./value/Value"; export interface Concept { /** * Checks if the concept is a Type. * * ### Examples * * ```ts * concept.isType() * ``` */ isType(): boolean; /** * Checks if the concept is a RoleType. * * ### Examples * * ```ts * concept.isRoleType() * ``` */ isRoleType(): boolean; /** * Checks if the concept is a ThingType. * * ### Examples * * ```ts * concept.isThingType() * ``` */ isThingType(): boolean; /** * Checks if the concept is an EntityType. * * ### Examples * * ```ts * concept.isEntityType() * ``` */ isEntityType(): boolean; /** * Checks if the concept is a RelationType. * * ### Examples * * ```ts * concept.isRelationType() * ``` */ isRelationType(): boolean; /** * Checks if the concept is an AttributeType. * * ### Examples * * ```ts * concept.isAttributeType() * ``` */ isAttributeType(): boolean; /** * Checks if the concept is a Thing. * * ### Examples * * ```ts * concept.isThing() * ``` */ isThing(): boolean; /** * Checks if the concept is an Entity. * * ### Examples * * ```ts * concept.isEntity() * ``` */ isEntity(): boolean; /** * Checks if the concept is a Relation. * * ### Examples * * ```ts * concept.isRelation() * ``` */ isRelation(): boolean; /** * Checks if the concept is an Attribute. * * ### Examples * * ```ts * concept.isAttribute() * ``` */ isAttribute(): boolean; /** * Checks if the concept is a Value. * * ### Examples * * ```ts * concept.isValue() * ``` */ isValue(): boolean; /** * Casts the concept to Type. * * ### Examples * * ```ts * concept.asType() * ``` */ asType(): Type; /** * Casts the concept to ThingType. * * ### Examples * * ```ts * concept.asThingType() * ``` */ asThingType(): ThingType; /** * Casts the concept to RoleType. * * ### Examples * * ```ts * concept.asRoleType() * ``` */ asRoleType(): RoleType; /** * Casts the concept to EntityType. * * ### Examples * * ```ts * concept.asEntityType() * ``` */ asEntityType(): EntityType; /** * Casts the concept to RelationType. * * ### Examples * * ```ts * concept.asRelationType() * ``` */ asRelationType(): RelationType; /** * Casts the concept to AttributeType. * * ### Examples * * ```ts * concept.asAttributeType() * ``` */ asAttributeType(): AttributeType; /** * Casts the concept to Thing. * * ### Examples * * ```ts * concept.asThing() * ``` */ asThing(): Thing; /** * Casts the concept to Entity. * * ### Examples * * ```ts * concept.asEntity() * ``` */ asEntity(): Entity; /** * Casts the concept to Relation. * * ### Examples * * ```ts * concept.asRelation() * ``` */ asRelation(): Relation; /** * Casts the concept to Attribute. * * ### Examples * * ```ts * concept.asAttribute() * ``` */ asAttribute(): Attribute; /** * Casts the concept to Value. * * ### Examples * * ```ts * concept.asValue() * ``` */ asValue(): Value; /** * Checks if this concept is equal to the argument concept. * @param concept - The concept to compare to. */ equals(concept: Concept): boolean; } export declare namespace Concept { class ValueType { private readonly _proto; private readonly _name; constructor(type: ValueTypeProto, name: string); proto(): ValueTypeProto; name(): string; toString(): string; } /** TypeQL value types for attributes & value concepts. */ namespace ValueType { const OBJECT: ValueType; const BOOLEAN: ValueType; const LONG: ValueType; const DOUBLE: ValueType; const STRING: ValueType; const DATETIME: ValueType; function of(proto: ValueTypeProto): ValueType; } class Transitivity { private readonly _transitivity; constructor(transitivity: TransitivityProto); proto(): TransitivityProto; } namespace Transitivity { const TRANSITIVE: Transitivity; const EXPLICIT: Transitivity; } }