import type { OntologyTypeVertexId, Subgraph } from "../../../types/subgraph.js"; import type { BaseUrl, EntityType, PropertyType, PropertyTypeWithMetadata, VersionedUrl } from "@blockprotocol/type-system"; /** * Returns all `PropertyTypeWithMetadata`s within the vertices of the subgraph * * @param subgraph */ export declare const getPropertyTypes: (subgraph: Subgraph) => PropertyTypeWithMetadata[]; /** * Gets a `PropertyTypeWithMetadata` by its `VersionedUrl` from within the vertices of the subgraph. Returns `undefined` * if the property type couldn't be found. * * @param subgraph * @param propertyTypeId * @throws if the vertex isn't a `PropertyTypeVertex` */ export declare const getPropertyTypeById: (subgraph: Subgraph, propertyTypeId: VersionedUrl) => PropertyTypeWithMetadata | undefined; /** * Gets a `PropertyTypeWithMetadata` by its `OntologyTypeVertexId` from within the vertices of the subgraph. Returns * `undefined` if the property type couldn't be found. * * @param subgraph * @param vertexId * @throws if the vertex isn't a `PropertyTypeVertex` */ export declare const getPropertyTypeByVertexId: (subgraph: Subgraph, vertexId: OntologyTypeVertexId) => PropertyTypeWithMetadata | undefined; /** * Returns all `PropertyTypeWithMetadata`s within the vertices of the subgraph that match a given `BaseUrl` * * @param subgraph * @param baseUrl */ export declare const getPropertyTypesByBaseUrl: (subgraph: Subgraph, baseUrl: BaseUrl) => PropertyTypeWithMetadata[]; export declare const getPropertyTypeForEntity: (subgraph: Subgraph, entityTypeIds: [VersionedUrl, ...VersionedUrl[]], propertyBaseUrl: BaseUrl) => { propertyType: PropertyType; refSchema: EntityType["properties"][BaseUrl]; }; /** * Gets a map of all propertyTypeIds referenced by the entity type to the full property type, * including from any parents in its inheritance chain and nested property objects, * * The subgraph must be a result of having queried for an entity type with sufficiently high depth * for constrainsPropertiesOn and inheritsFrom to contain all parent entity types and property types they reference. * * @param entityType The entity type to provide properties for * @param subgraph a subgraph which is assumed to contain all relevant property types * * @throws Error if the subgraph does not contain a property type or parent entity type relied on by the entity type * * @todo this is a good candidate for moving to somewhere shared, possibly @blockprotocol/graph's stdlib */ export declare const getPropertyTypesForEntityType: (entityType: EntityType, subgraph: Subgraph, propertyTypesMap?: Map) => Map;