/** * Cuts `text` to at most `maxLength` characters on a word boundary, ending in "…". Text that fits is * returned as is. */ export declare function truncateAtWord(text: string, maxLength: number): string; export type EntryOutputKey = 'title' | 'description' | 'tags'; /** A field an output can go to: one of the entry's top-level fields, or one of the video's own. */ export interface EntryFieldOption { name: string; /** The display name the edit view uses. */ label: string; /** The attribute type: `string`, `text`, `richtext`, `blocks`, `json`, … */ type: string; maxLength?: number; minLength?: number; /** Offered for this output only, instead of every output its type can hold. */ onlyFor?: EntryOutputKey; } export interface ApplyRow { key: EntryOutputKey; /** What Robots generated. */ value: string | string[]; compatible: EntryFieldOption[]; /** The convention's pick, else the first compatible field. */ suggested?: EntryFieldOption; } /** * One row per output the summary has a value for. There is no mapping to configure: the candidates * come from the content type, a naming convention only suggests one, and the person picks in the dialog. */ export declare function buildApplyRows(summary: { title?: string; description?: string; tags?: string[]; } | null | undefined, fields: EntryFieldOption[]): ApplyRow[]; export declare const blocksParagraph: (text: string) => { type: string; children: { type: string; text: string; }[]; }[]; /** The readable text of a field value: a string as is, blocks and rich structures as their text. */ export declare function plainTextOf(value: unknown): string; /** Whether a field holds nothing worth keeping. An empty blocks paragraph counts as empty. */ export declare function isEmptyFieldValue(value: unknown): boolean; /** The value as the field stores it: cut to fit on a word boundary, and blocks as one paragraph. */ export declare function valueForField(value: string | string[], field: EntryFieldOption): unknown; /** Why a row can't be applied to `field`, if it can't: a value shorter than the field allows. */ export declare function minLengthProblem(value: string | string[], field: EntryFieldOption): string | undefined; /** Whether the field already holds exactly what applying would write. */ export declare function matchesGeneratedValue(current: unknown, value: string | string[], field: EntryFieldOption): boolean; /** * The field each row opens on, or `''` for "Do not apply". A row is pre-selected only when its * suggested field is empty, and a field is the target of one row at most. */ export declare function defaultTargets(rows: ApplyRow[], currentValues: Record): Record; /** * The top-level relation attributes of a content type that point at Mux assets. Relations inside * components and dynamic zones aren't followed. */ export declare const muxAssetRelationFields: (attributes?: Record | undefined) => string[];