import { type Ref } from '#imports'; import type { BlockDefinition } from '#blokkli-build/definitions'; type UseBlokkliRuntimeBlocks = { /** * The block definitions registered at runtime. * * Backed by `useState('blokkli:runtime-blocks')`, so the value is shared * across the app and transferred from server to client. */ blocks: Ref; /** * Register block definitions. * * A definition replaces an already registered one with the same bundle. */ registerRuntimeBlocks: (definitions: BlockDefinition[]) => void; /** * Replace all registered block definitions. */ setRuntimeBlocks: (definitions: BlockDefinition[]) => void; }; /** * revenexx: register block definitions at runtime. * * Block definitions registered here are merged with the build-time * definitions collected from `defineBlokkli()` and show up in the editor * (block list, options form, icons) without a rebuild. Register them before * the editor mounts, e.g. in a Nuxt plugin. * * Blocks with an `ext__` bundle prefix (theme extensions) render through the * `extension_host` block component and share its icon. * * @example * ```ts * export default defineNuxtPlugin(() => { * const { setRuntimeBlocks } = useBlokkliRuntimeBlocks() * setRuntimeBlocks([ * { * bundle: 'ext__acme__demo__usp_bar', * options: { * headline: { type: 'text', label: 'Headline', default: '' }, * }, * }, * ]) * }) * ``` */ export declare function useBlokkliRuntimeBlocks(): UseBlokkliRuntimeBlocks; export {};