import { ModuleHandler } from "@blockprotocol/core"; import type { EntityRootType, GraphEmbedderMessageCallbacks, GraphEmbedderMessages, Subgraph } from "./main.js"; /** * Creates a handler for the graph module for the embedder. * Register callbacks in the constructor or afterwards using the 'on' method to react to messages from the block. * Call the relevant methods to send messages to the block. */ export declare class GraphEmbedderHandler extends ModuleHandler implements GraphEmbedderMessages { private _blockEntitySubgraph; private _readonly?; constructor({ blockEntitySubgraph, callbacks, element, readonly, }: { blockEntitySubgraph: Subgraph; callbacks?: Partial; element?: HTMLElement | null; readonly?: boolean; }); /** * Registers multiple callbacks at once. * Useful for bulk updates to callbacks after the module is first initialised. */ registerCallbacks(callbacks: Partial): void; /** * Removes multiple callbacks at once. * Useful when replacing previously registered callbacks */ removeCallbacks(callbacks: Partial): void; /** * Call the provided function when the named message is received, passing the data/errors object from the message. * If the named message expects a response, the callback should provide the expected data/errors object as the return. * @param messageName the message name to listen for * @param handlerFunction the function to call when the message is received, with the message data / errors */ on(this: GraphEmbedderHandler, messageName: K, handlerFunction: NonNullable): void; getInitPayload(this: GraphEmbedderHandler): Record; blockEntitySubgraph({ data }: { data?: Subgraph; }): void; readonly({ data }: { data?: boolean; }): void; }