import { Schema } from 'effect';
import { Expression } from './expression.js';
import type { Environment } from '../vendor/cel-js/lib/index.js';
export declare const Corner: Schema.Tuple2<Schema.filter<Schema.filter<typeof Schema.Number>>, Schema.filter<Schema.filter<typeof Schema.Number>>>;
export declare const Area: Schema.refine<readonly [readonly [number, number], readonly [number, number]], Schema.Tuple2<Schema.Tuple2<Schema.filter<Schema.filter<typeof Schema.Number>>, Schema.filter<Schema.filter<typeof Schema.Number>>>, Schema.Tuple2<Schema.filter<Schema.filter<typeof Schema.Number>>, Schema.filter<Schema.filter<typeof Schema.Number>>>>>;
export declare const Align: Schema.Literal<["start", "center", "end", "stretch"]>;
export declare const Placement: Schema.Struct<{
    area: Schema.refine<readonly [readonly [number, number], readonly [number, number]], Schema.Tuple2<Schema.Tuple2<Schema.filter<Schema.filter<typeof Schema.Number>>, Schema.filter<Schema.filter<typeof Schema.Number>>>, Schema.Tuple2<Schema.filter<Schema.filter<typeof Schema.Number>>, Schema.filter<Schema.filter<typeof Schema.Number>>>>>;
    h: Schema.optional<Schema.Literal<["start", "center", "end", "stretch"]>>;
    v: Schema.optional<Schema.Literal<["start", "center", "end", "stretch"]>>;
}>;
export declare const DEFAULT_GAP = 4;
export declare const Layout: Schema.Struct<{
    columns: Schema.refine<number, Schema.filter<typeof Schema.Number>>;
    rows: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
    gap: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
    style: Schema.optional<Schema.SchemaClass<string, string, never>>;
    placements: Schema.Record$<typeof Schema.String, Schema.Struct<{
        area: Schema.refine<readonly [readonly [number, number], readonly [number, number]], Schema.Tuple2<Schema.Tuple2<Schema.filter<Schema.filter<typeof Schema.Number>>, Schema.filter<Schema.filter<typeof Schema.Number>>>, Schema.Tuple2<Schema.filter<Schema.filter<typeof Schema.Number>>, Schema.filter<Schema.filter<typeof Schema.Number>>>>>;
        h: Schema.optional<Schema.Literal<["start", "center", "end", "stretch"]>>;
        v: Schema.optional<Schema.Literal<["start", "center", "end", "stretch"]>>;
    }>>;
}>;
export declare function LayoutSet(configure: (env: Environment) => void): Schema.Struct<{
    name: Schema.SchemaClass<string, string, never>;
    media: Schema.optional<Schema.Schema<string, string, never>>;
    layout: Schema.Struct<{
        columns: Schema.refine<number, Schema.filter<typeof Schema.Number>>;
        rows: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
        gap: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
        style: Schema.optional<Schema.SchemaClass<string, string, never>>;
        placements: Schema.Record$<typeof Schema.String, Schema.Struct<{
            area: Schema.refine<readonly [readonly [number, number], readonly [number, number]], Schema.Tuple2<Schema.Tuple2<Schema.filter<Schema.filter<typeof Schema.Number>>, Schema.filter<Schema.filter<typeof Schema.Number>>>, Schema.Tuple2<Schema.filter<Schema.filter<typeof Schema.Number>>, Schema.filter<Schema.filter<typeof Schema.Number>>>>>;
            h: Schema.optional<Schema.Literal<["start", "center", "end", "stretch"]>>;
            v: Schema.optional<Schema.Literal<["start", "center", "end", "stretch"]>>;
        }>>;
    }>;
}>;
export type AlignValue = Schema.Schema.Type<typeof Align>;
export type PlacementValue = Schema.Schema.Type<typeof Placement>;
export type LayoutValue = Schema.Schema.Type<typeof Layout>;
export type LayoutSetValue = Readonly<{
    name: string;
    media?: string;
    layout: LayoutValue;
}>;
export type IdentifiableItem = Readonly<{
    id: string;
}>;
export declare function validatePlacements(items: ReadonlyArray<IdentifiableItem>, layouts: ReadonlyArray<LayoutSetValue>, label: string): string | true;
export declare function normalizeLayoutSet(ls: LayoutSetValue): LayoutSetValue;
export declare function findFreePlacement(placements: Readonly<Record<string, PlacementValue>>, w: number, h: number): PlacementValue;
export declare function placeGroupAt(existing: Readonly<Record<string, PlacementValue>>, group: Readonly<Record<string, PlacementValue>>, target: {
    x: number;
    y: number;
}): Record<string, PlacementValue>;
type AnySchema = Schema.Schema<any, any, never>;
export declare function Slot(BlockSchemaUnion: AnySchema, configure: (env: Environment) => void): Schema.refine<{
    readonly blocks: readonly any[];
    readonly layouts: readonly {
        readonly name: string;
        readonly layout: {
            readonly style?: string | undefined;
            readonly columns: number;
            readonly gap?: number | undefined;
            readonly rows?: number | undefined;
            readonly placements: {
                readonly [x: string]: {
                    readonly area: readonly [readonly [number, number], readonly [number, number]];
                    readonly v?: "stretch" | "center" | "end" | "start" | undefined;
                    readonly h?: "stretch" | "center" | "end" | "start" | undefined;
                };
            };
        };
        readonly media?: string | undefined;
    }[];
}, Schema.Struct<{
    blocks: Schema.Array$<AnySchema>;
    layouts: Schema.refine<readonly {
        readonly name: string;
        readonly layout: {
            readonly style?: string | undefined;
            readonly columns: number;
            readonly gap?: number | undefined;
            readonly rows?: number | undefined;
            readonly placements: {
                readonly [x: string]: {
                    readonly area: readonly [readonly [number, number], readonly [number, number]];
                    readonly v?: "stretch" | "center" | "end" | "start" | undefined;
                    readonly h?: "stretch" | "center" | "end" | "start" | undefined;
                };
            };
        };
        readonly media?: string | undefined;
    }[], Schema.Array$<Schema.Struct<{
        name: Schema.SchemaClass<string, string, never>;
        media: Schema.optional<Schema.Schema<string, string, never>>;
        layout: Schema.Struct<{
            columns: Schema.refine<number, Schema.filter<typeof Schema.Number>>;
            rows: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
            gap: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
            style: Schema.optional<Schema.SchemaClass<string, string, never>>;
            placements: Schema.Record$<typeof Schema.String, Schema.Struct<{
                area: Schema.refine<readonly [readonly [number, number], readonly [number, number]], Schema.Tuple2<Schema.Tuple2<Schema.filter<Schema.filter<typeof Schema.Number>>, Schema.filter<Schema.filter<typeof Schema.Number>>>, Schema.Tuple2<Schema.filter<Schema.filter<typeof Schema.Number>>, Schema.filter<Schema.filter<typeof Schema.Number>>>>>;
                h: Schema.optional<Schema.Literal<["start", "center", "end", "stretch"]>>;
                v: Schema.optional<Schema.Literal<["start", "center", "end", "stretch"]>>;
            }>>;
        }>;
    }>>>;
}>>;
export { Expression };
export type SlotValue = Readonly<{
    blocks: ReadonlyArray<Readonly<{
        id: string;
    } & Record<string, unknown>>>;
    layouts: ReadonlyArray<LayoutSetValue>;
}>;
/**
 * Returns a fresh empty slot with one `默认` layout — enough to satisfy the
 * schema's `minItems(1)` invariant. `blocks: never[]` keeps the result
 * assignable to slots whose block union is narrower than `SlotValue`.
 */
export declare function defaultSlot(): {
    blocks: never[];
    layouts: LayoutSetValue[];
};
export declare function regenSlotIds(slot: SlotValue): SlotValue;
