import { LitElement } from "lit"; import { GraphBlockHandler } from "./main.js"; import type { BlockGraphProperties, LinkEntityAndRightEntity } from "./main.js"; import type { Entity, PropertyObject } from "@blockprotocol/type-system"; export interface BlockElementBase extends LitElement, BlockGraphProperties { } /** * A class to use as a base for implementing Block Protocol blocks as custom elements. * This class handles establishing communication with the embedding application. */ export declare abstract class BlockElementBase extends LitElement { /** * The 'graphModule' is a handler for sending messages to the embedding application, e.g. 'graphModule.updateEntity' * It starts off undefined and will be available once the initial exchange of messages has taken place (handled internally) * @see https://blockprotocol.org/spec/graph#message-definitions for a full list of available messages */ protected graphModule?: GraphBlockHandler; protected blockEntity?: RootEntity; protected linkedEntities?: LinkEntityAndRightEntity[]; /** * The properties sent to the block represent the messages sent automatically from the application to the block. * All block <> application messages are split into modules, and so is this property object. */ static properties: { /** * The 'graph' object contains messages sent under the graph module from the app to the block. * They are sent on initialization and again when the application has new values to send. * One such message is 'graph.blockEntitySubgraph', which is a graph rooted at the block entity. * @see https://blockprotocol.org/spec/graph#message-definitions for a full list */ graph: { type: ObjectConstructor; }; }; connectedCallback(): void; disconnectedCallback(): void; /** * A helper method that returns the root entity from blockEntitySubgraph, * i.e. the 'block entity' */ getBlockEntity(): RootEntity; /** * A helper method that returns the entities linked from the root entity * of blockEntitySubgraph, i.e. the 'block entity' */ getLinkedEntities(): RootEntityLinkedEntities; /** * A helper method to update the properties of the entity loaded into the block, i.e. this.graph.blockEntity * @param properties the properties object to assign to the entity, which will overwrite the existing object */ protected updateSelfProperties(properties: PropertyObject): Promise, import("./main.js").ReadOrModifyResourceError>>; }