/**
 * SDK-owned field definition types.
 *
 * These intentionally mirror the blocks manifest field schema input shape
 * (packages/blocks/src/system/manifest/schema.ts) so SDK config can be parsed
 * and executed by the blocks runtime without leaking blocks types into the SDK
 * public `.d.ts`.
 */
import type { LinkValue, Media, TipTapNode } from '../contracts';
export type VisibilityLevel = 'admin' | 'designer' | 'author';
export type ReferenceValueFrom = 'id' | 'identifier' | 'slug';
export type MediaDeliveryOptions = {
    sizes?: string;
    widthCandidates?: number[];
    maxCssWidth?: number;
    maxCssHeight?: number;
    strategy?: 'default' | 'columnsAuto' | 'imageGalleryVariant';
    strategyOptions?: Record<string, unknown>;
};
export type FieldUi = Partial<{
    widget: string;
    preset: 'disclosure';
    flattenInRepeater: boolean;
    hidden: boolean;
    hideLabel: boolean;
    hideDescription: boolean;
    showCharCount: number | {
        max: number;
    };
    showSlugPreview: boolean;
    variant: 'full' | 'inline' | 'limited' | 'media' | 'notes';
    richTextVariant: 'full' | 'inline' | 'limited' | 'media' | 'notes';
    cropEditorMode: 'dialog' | 'inline';
    cropEditorAutoOpen: boolean;
    mediaPickerAutoOpen: boolean;
    showMediaPreview: boolean;
    showMediaOverlayActions: boolean;
    mediaDelivery: MediaDeliveryOptions;
    mediaDeliveryByVariant: Record<string, MediaDeliveryOptions>;
    inputType: 'text' | 'email' | 'tel' | 'number';
    min: number;
    max: number;
    step: number;
    showValue: boolean;
    pattern: string;
    placeholder: string;
    visibleWhen: {
        field: string;
        equals?: unknown;
        notEquals?: unknown;
        oneOf?: unknown[];
        notIn?: unknown[];
    };
    modalConfig: {
        buttonLabel?: string;
        description?: string;
        buttonVariant?: 'default' | 'outline';
        showCustomizedIndicator?: boolean;
        maxWidth?: string;
    };
    allowedTypes: Array<'color' | 'gradient' | 'image'>;
    fullWidth: boolean;
    row: string;
    colSpan: number;
    layout: 'stack' | 'grid';
    columns: number;
    gridColsPreset: 'simple2' | 'simple3' | 'simple4' | 'buttonCtaRow';
    gridColumns: Partial<{
        base: number;
        sm: number;
        md: number;
        lg: number;
        xl: number;
    }>;
    gridColsClassName: string;
    repeaterPreset: 'thumbnailGrid' | 'layoutGrid';
    thumbnailField: string;
    thumbnailAltField: string;
    thumbnailLabelField: string;
    thumbnailCardDensity: 'compact' | 'comfortable';
    iconPickerPreset: 'cta';
    contentTypeField: string;
    fixedContentType: string;
    valueFrom: 'id' | 'identifier' | 'slug';
    renderInHeader: boolean;
    intent: 'content' | 'display' | 'behavior' | 'style';
}>;
export type FieldBase = {
    id: string;
    label: string;
    description?: string;
    visibleRoles?: VisibilityLevel[];
    defaultValue?: unknown;
    required?: boolean;
    ui?: FieldUi;
};
export type TextFieldDefinition = FieldBase & {
    type: 'text';
    multiline?: boolean;
    maxLength?: number;
};
export type RichTextFieldDefinition = FieldBase & {
    type: 'richText';
};
export type MediaFieldDefinition = FieldBase & {
    type: 'media';
    mediaKinds?: Array<'image' | 'video' | 'audio' | 'document' | 'spreadsheet' | 'archive'>;
    aspectRatio?: string;
};
export type BooleanFieldDefinition = FieldBase & {
    type: 'boolean';
};
export type NumberFieldDefinition = FieldBase & {
    type: 'number';
    min?: number;
    max?: number;
    step?: number;
};
export type DateFieldDefinition = FieldBase & {
    type: 'date';
};
export type TimeFieldDefinition = FieldBase & {
    type: 'time';
};
export type DateTimeFieldDefinition = FieldBase & {
    type: 'datetime';
};
export type SlugFieldDefinition = FieldBase & {
    type: 'slug';
    sourceFieldId?: string;
    statusFieldId?: string;
    maxLength?: number;
};
export type UrlFieldDefinition = FieldBase & {
    type: 'url';
    allowRelative?: boolean;
};
export type LinkFieldDefinition = FieldBase & {
    type: 'link';
};
export type SelectFieldOption = {
    value: string;
    label: string;
    description?: string;
    icon?: string;
};
export type SelectFieldDefinition = FieldBase & {
    type: 'select';
    options: SelectFieldOption[];
    multiple?: boolean;
};
export type ReferenceFieldDefinition = FieldBase & {
    type: 'reference';
    referenceKind: string;
    allowManualEntry?: boolean;
    valueFrom?: ReferenceValueFrom;
};
export type ItemTypeDefinition = {
    label: string;
    icon?: string;
    fields: FieldDefinition[];
};
export type RepeaterFieldDefinition = FieldBase & {
    type: 'repeater';
    itemLabel?: string;
    itemLabelSource?: string;
    minItems?: number;
    maxItems?: number;
    schema?: {
        fields: FieldDefinition[];
    };
    polymorphic?: boolean;
    itemTypes?: Record<string, ItemTypeDefinition>;
    allowConversion?: boolean;
};
export type GroupFieldDefinition = FieldBase & {
    type: 'group';
    schema: {
        fields: FieldDefinition[];
    };
};
export type ModalFieldDefinition = FieldBase & {
    type: 'modal';
    schema: {
        fields: FieldDefinition[];
    };
};
export type TabDefinition = {
    id: string;
    label: string;
    icon?: string;
    description?: string;
    fields: FieldDefinition[];
    sdkSectionOption?: 'backgroundColor' | 'backgroundGradient' | 'backgroundImage';
};
export type TabGroupFieldDefinition = FieldBase & {
    type: 'tabGroup';
    tabs: TabDefinition[];
    activeTabField?: string;
};
export type PresetOrCustomFieldDefinition = FieldBase & {
    type: 'presetOrCustom';
    presets: Array<{
        value: string;
        label: string;
    }>;
    customInput?: {
        placeholder?: string;
        pattern?: string;
        helpText?: string;
    };
};
export type ContentTypeSelectFieldDefinition = FieldBase & {
    type: 'contentTypeSelect';
    filter?: 'all' | 'routable' | 'nonRoutable';
};
export type EntryPickerFieldDefinition = FieldBase & {
    type: 'entryPicker';
    /** Restrict picker to a single content type (e.g. 'project'). */
    fixedContentType?: string;
    /** Which entry field to store as the value: 'id' (UUID), 'identifier', or 'slug'. */
    valueFrom?: 'id' | 'identifier' | 'slug';
};
export type FieldDefinition = TextFieldDefinition | RichTextFieldDefinition | MediaFieldDefinition | BooleanFieldDefinition | NumberFieldDefinition | DateFieldDefinition | TimeFieldDefinition | DateTimeFieldDefinition | SlugFieldDefinition | UrlFieldDefinition | LinkFieldDefinition | SelectFieldDefinition | ReferenceFieldDefinition | RepeaterFieldDefinition | GroupFieldDefinition | ModalFieldDefinition | TabGroupFieldDefinition | PresetOrCustomFieldDefinition | ContentTypeSelectFieldDefinition | EntryPickerFieldDefinition;
export type { TipTapNode, Media, LinkValue };
