import { z } from 'zod';
import { type FieldDefinition, type FieldDefinitionInput } from '../manifest/schema';
import { type NodeDefinition } from '../node';
declare const fragmentDataSchema: z.ZodObject<{
    key: z.ZodString;
    loader: z.ZodOptional<z.ZodObject<{
        endpoint: z.ZodString;
        params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        mode: z.ZodDefault<z.ZodEnum<{
            server: "server";
            client: "client";
        }>>;
    }, z.core.$strip>>;
}, z.core.$strip>;
export type FragmentDataConfigInput = z.input<typeof fragmentDataSchema>;
export type FragmentDataConfig = z.output<typeof fragmentDataSchema>;
export type FragmentFieldConfigInput = FieldDefinitionInput;
export type FragmentConfig = {
    id: string;
    title?: string;
    description?: string;
    category?: 'content' | 'media' | 'interactive' | 'layout';
    icon?: string;
    fields?: readonly FragmentFieldConfigInput[];
    layout: NodeDefinition | readonly NodeDefinition[];
    data?: FragmentDataConfigInput;
};
export type FragmentDefinition = Omit<FragmentConfig, 'fields' | 'layout' | 'data'> & {
    fields: FieldDefinition[];
    layout: NodeDefinition[];
    data?: FragmentDataConfig;
};
declare const FragmentInput: unique symbol;
type PickFragmentProperty<C, K extends keyof FragmentConfig> = K extends keyof C ? {
    readonly [P in K]: C[P];
} : {};
/**
 * Content derivation needs only a fragment's declared fields. Layout and data
 * loader details stay runtime-only, keeping block manifest phantoms compact.
 */
export type FragmentContentShapeInput<C extends FragmentConfig> = PickFragmentProperty<C, 'fields'>;
export type DefinedFragment<C> = FragmentDefinition & {
    readonly [FragmentInput]: C;
};
export type FragmentConfigInputOf<F> = F extends {
    readonly [FragmentInput]: infer C;
} ? C : never;
export declare class FragmentConfigError extends Error {
    constructor(message: string);
}
export declare function defineFragment<const C extends FragmentConfig>(config: C): DefinedFragment<FragmentContentShapeInput<C>>;
export declare function scopeFragmentFields(fragment: FragmentDefinition, scope: string): FieldDefinition[];
export declare function scopeFragmentLayout(fragment: FragmentDefinition, scope: string): NodeDefinition[];
export {};
