import { z } from "zod";
import { fieldSchema, type FieldDefinition } 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 FragmentConfig = {
    id: string;
    title?: string;
    description?: string;
    category?: "content" | "media" | "interactive" | "layout";
    icon?: string;
    fields?: readonly z.input<typeof fieldSchema>[];
    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;
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<C>;
export declare function scopeFragmentFields(fragment: FragmentDefinition, scope: string): FieldDefinition[];
export declare function scopeFragmentLayout(fragment: FragmentDefinition, scope: string): NodeDefinition[];
export {};
