/** * Several block contracts in one call, optionally in compact form. * * `describe(type)` returns the full contract: every prop with its bounds, * defaults and description, plus sizing, accessibility and migration notes. * That is what an agent needs to get one tricky block right, but it is too much * to load for every block on a page. The compact form keeps what authoring * needs (prop names, kinds, requiredness, enums, slots, data and actions) as * one short line each, and drops the prose. */ import type { BlockCategory } from './block-module.js'; import type { BlockDefinition } from './roster.js'; /** The authoring essentials of one block, one line per prop. */ export interface CompactBlockDescription { type: string; kind: 'semantic' | 'primitive'; version: number; category: BlockCategory; summary: string; /** * `name: kind[, required][, enum a|b|c]`. Fields of list items read * `items[].field`, fields of an object read `prop.field`. A long enum * printed earlier reads `enum as `, and an object whose fields match * one printed earlier reads `, like ` with its fields left out. */ props: string[]; /** `name: accepts[, min..max]`, when the block takes child blocks. */ slots?: string[]; /** Allowed direct parents, when the block may only sit inside some types. */ parents?: string[]; /** Present when the block reads rows from `dataRef` or inline `data`. */ data?: { required: boolean; description: string; }; /** Actions the block can trigger, when it has any. */ actions?: string[]; } export type BlockDescription = BlockDefinition | CompactBlockDescription; export interface DescribeManyOptions { compact?: boolean; } /** At most this many distinct types per call. */ export declare const DESCRIBE_MANY_LIMIT = 12; /** The compact form of one full contract. */ export declare function compactDescription(definition: BlockDefinition): CompactBlockDescription; /** * Contracts for several block types, in the order given, with duplicates * dropped. `compact: true` returns the one-line-per-prop form. */ export declare function describeMany(types: readonly string[], options: DescribeManyOptions & { compact: true; }): CompactBlockDescription[]; export declare function describeMany(types: readonly string[], options?: DescribeManyOptions & { compact?: false; }): BlockDefinition[]; export declare function describeMany(types: readonly string[], options?: DescribeManyOptions): BlockDescription[]; //# sourceMappingURL=describe-many.d.ts.map