import { Label } from "../../../common/Label"; import { Stream } from "../../../common/util/Stream"; import { TypeDBTransaction } from "../../connection/TypeDBTransaction"; import { Concept } from "../Concept"; import Transitivity = Concept.Transitivity; export interface Type extends Concept { /** The unique label of the type. */ readonly label: Label; /** Whether the type is a root type. */ readonly root: boolean; /** Whether the type is prevented from having data instances (i.e., abstract). */ readonly abstract: boolean; /** * Deletes this type from the database. * * ### Examples * * ```ts * type.delete(transaction) * ``` * * @param transaction - The current transaction */ delete(transaction: TypeDBTransaction): Promise; /** * Check if the concept has been deleted * * @param transaction The current transaction */ isDeleted(transaction: TypeDBTransaction): Promise; /** * Renames the label of the type. The new label must remain unique. * * ### Examples * * ```ts * type.setLabel(transaction, label) * ``` * * @param transaction - The current transaction * @param label - The new Label to be given to the type. */ setLabel(transaction: TypeDBTransaction, label: string): Promise; /** * Retrieves the most immediate supertype of the type. * * ### Examples * * ```ts * type.getSupertype(transaction) * ``` * * @param transaction - The current transaction */ getSupertype(transaction: TypeDBTransaction): Promise; /** * Retrieves all supertypes of the type. * * ### Examples * * ```ts * type.getSupertypes(transaction) * ``` * * @param transaction - The current transaction */ getSupertypes(transaction: TypeDBTransaction): Stream; /** {@inheritDoc Type#getSubtypes:(1)} */ getSubtypes(transaction: TypeDBTransaction): Stream; /** * Retrieves all direct and indirect (or direct only) subtypes of the type. * * ### Examples * * ```ts * type.getSubtypes(transaction) * type.getSubtypes(transaction, Transitivity.EXPLICIT) * ``` * * @param transaction - The current transaction * @param transitivity - Transitivity.TRANSITIVE for direct and indirect subtypes, Transitivity.EXPLICIT for direct subtypes only */ getSubtypes(transaction: TypeDBTransaction, transitivity: Transitivity): Stream; }