import type { SerializedSchema, Source } from "@valbuild/core"; import { type EmptyOfContext } from "../emptyOf.js"; import { type BuildResult } from "./aiImageToolPatches.js"; export declare function buildDuplicatePatch(args: { sourcePath: string[]; destinationPath: string[]; }, moduleSchema: SerializedSchema, moduleSource: Source | undefined): BuildResult; export declare function buildEmptyAtPathPatch(args: { destinationPath: string[]; }, moduleSchema: SerializedSchema, moduleSource: Source | undefined, context?: EmptyOfContext): BuildResult; /** * What kind of container a path points at. * * `gallery` and `richtext` are called out separately from `record`/`array` * because the two callers disagree about them: `count_entries` can count either, * `get_record_keys` documents that it refuses both. */ export type ContainerKind = "array" | "record" | "object" | "gallery" | "richtext"; export type DescribeContainerResult = { kind: "ok"; container: ContainerKind; value: Source; } | { kind: "error"; /** * Whether the path is not there at all, or is there but holds something * that has no entries. * * The distinction is not cosmetic: a caller that maps these onto its own * error codes has to tell "go and look for this path" apart from "the * path is right, its type is not", and only the second is worth a retry * with a different tool. */ reason: "missing" | "not-a-container"; message: string; }; /** * Classifies the value at `path` using the SCHEMA, not just its runtime shape. * * The runtime shape is not enough: an `s.image()`/`s.file()` source, a richtext * node and a union variant are all plain objects at runtime, so classifying by * `typeof` alone let `get_record_keys` list a file ref's `_ref`/`_type` internals * or a richtext node's `tag`/`children` as if they were record keys. */ export declare function describeContainerAtPath(moduleSchema: SerializedSchema, moduleSource: Source | undefined, path: string[]): DescribeContainerResult;