/** * Shared helpers for block renderers. * * Prop readers, attribute and element builders, and the media network gate * live here so every renderer module applies them identically. */ import type { DataRow } from '../data/dataset-types.js'; import type { IrNode, NetworkPolicy } from '../ir.js'; import { type JsonValue } from '../json.js'; import { type MediaCapability } from '../spec/network-policy.js'; import { type AttributeValue } from './escape.js'; export { blockedReason, capabilityAllowed, imageReferenceAllowed, isRemote, networkAllows, } from '../spec/network-policy.js'; export declare function stringProp(node: IrNode, key: string, fallback?: string): string; export declare function numberProp(node: IrNode, key: string, fallback?: number): number; export declare function listProp(node: IrNode, key: string): JsonValue[]; export declare function objectListProp(node: IrNode, key: string): Record[]; export declare function str(value: JsonValue | undefined, fallback?: string): string; export declare function numProp(value: JsonValue | undefined, fallback?: number): number; /** `data-ak-id` plus every non-click binding on the node. */ export declare function nodeAttributes(node: IrNode, extra?: AttributeValue): AttributeValue; export declare function element(tag: string, attributes: AttributeValue, inner: string): string; export declare function heading(level: number, text: string, className?: string): string; /** A section heading for blocks whose `title` is optional. */ export declare function titleHeader(node: IrNode, level?: number): string; /** A figure caption is prose, so backtick spans become inline code. */ export declare function figureCaption(value: string): string; /** * Resolve a media reference against the network policy. * * A relative path is local and always allowed; a remote reference needs the * matching capability and, when a provider allowlist exists, an allowlisted * host. Nothing here can produce an embed the spec did not ask for in a way the * policy did not allow. */ export declare function resolveMedia(reference: string, policy: NetworkPolicy, capability: MediaCapability, provider?: string): { allowed: boolean; src: string; }; /** * Attributes for one row of a filterable block: the filter runtime finds rows * by `data-ak-filter-item` and reads their raw values from the `data-ak-row` * JSON, which `renderAttributes` escapes. */ export declare function filterRowAttributes(row: DataRow): AttributeValue; //# sourceMappingURL=block-helpers.d.ts.map