import type { OntologyTypeVertexId, Subgraph } from "../../../types/subgraph.js"; import type { BaseUrl, EntityTypeWithMetadata, VersionedUrl } from "@blockprotocol/type-system"; /** * Returns all `EntityTypeWithMetadata`s within the vertices of the subgraph * * @param subgraph */ export declare const getEntityTypes: (subgraph: Subgraph) => EntityTypeWithMetadata[]; /** * Gets an `EntityTypeWithMetadata` by its `VersionedUrl` from within the vertices of the subgraph. Returns `undefined` * if the entity type couldn't be found. * * @param subgraph * @param entityTypeId * @throws if the vertex isn't a `EntityTypeVertex` */ export declare const getEntityTypeById: (subgraph: Subgraph, entityTypeId: VersionedUrl) => EntityTypeWithMetadata | undefined; /** * Gets a `EntityTypeWithMetadata` by its `OntologyTypeVertexId` from within the vertices of the subgraph. Returns * `undefined` if the entity type couldn't be found. * * @param subgraph * @param vertexId * @throws if the vertex isn't a `EntityTypeVertex` */ export declare const getEntityTypeByVertexId: (subgraph: Subgraph, vertexId: OntologyTypeVertexId) => EntityTypeWithMetadata | undefined; /** * Returns all `EntityTypeWithMetadata`s within the vertices of the subgraph that match a given `BaseUrl` * * @param subgraph * @param baseUrl */ export declare const getEntityTypesByBaseUrl: (subgraph: Subgraph, baseUrl: BaseUrl) => EntityTypeWithMetadata[]; /** * Gets an array of `EntityTypeWithMetadata` containing the requested entity type and all its ancestors * i.e. entity types it inherits from, whether directly or indirectly. * * @param subgraph a subgraph containing the entity type and its ancestors * @param entityTypeId the `VersionedUrl` of the entity type * @throws Error if the entity type or any of its ancestors aren't present in the subgraph * @returns EntityTypeWithMetadata[] an array of `EntityTypeWithMetadata`, where the first element is the entity type */ export declare const getEntityTypeAndParentsById: (subgraph: Subgraph, entityTypeId: VersionedUrl) => EntityTypeWithMetadata[]; /** * Gets an array of `EntityTypeWithMetadata` containing the requested entity types and all their ancestors * i.e. entity types they inherit from, whether directly or indirectly, ordered for breadth-first traversal. * * Note that each EntityType will only appear once in the result. If an EntityType appears multiple times in the * inheritance chains of different requested EntityTypes, it will only appear in the position it is first encountered. * * @param subgraph a subgraph containing the entity types and their ancestors * @param entityTypeIds the `VersionedUrl`s of the entity types * @throws Error if any requested entity type or any of its ancestors aren't present in the subgraph * @returns EntityTypeWithMetadata[] an array containing the requested entity types and their ancestors, breadth-first. */ export declare const getBreadthFirstEntityTypesAndParents: (subgraph: Subgraph, entityTypeIds: VersionedUrl[]) => EntityTypeWithMetadata[]; /** * Gets an array of `EntityTypeWithMetadata` containing the requested entity type and all its descendants * i.e. entity types which inherit from it, whether directly or indirectly. * * @param subgraph a subgraph containing the entity type and its descendants * @param entityTypeId the `VersionedUrl` of the entity type * @throws Error if the entity type or any of its descendants aren't present in the subgraph * @returns EntityTypeWithMetadata[] an array of `EntityTypeWithMetadata`, where the first element is the entity type */ export declare const getEntityTypeAndDescendantsById: (subgraph: Subgraph, entityTypeId: VersionedUrl) => EntityTypeWithMetadata[];