import type { EntityJSON } from "@uipath/entity-modeler/schema"; import { type UnifiedResourceFile } from "./unified-resource-file.js"; /** * Deterministic bytes for everything this library writes: 2-space indent, LF, * trailing newline, property order = construction order. One serializer shared * with the editor in the vsix, so a re-save can't produce phantom diffs. */ export declare function serialize(value: object): string; /** The inner document is stored compact (single line) inside `resourceJson`. */ export declare function serializeEntityJson(entity: EntityJSON): string; /** Why `unwrapResource` failed. The editor maps these onto its "definition is * corrupted" states; pack reports them as diagnostics. */ export type ResourceParseFailure = "NotAnObject" | "MissingResource" | "MissingSpec" | "NotAnEntityResource" | "ResourceJsonUnparsable"; export declare class EntityResourceError extends Error { readonly failure: ResourceParseFailure; constructor(failure: ResourceParseFailure, message: string); } /** * Wrap a schema into a brand-new resource file. For edits use * {@link updateResourceSchema}, which preserves the existing wrapper. */ export declare function wrapEntityJson(entity: EntityJSON): UnifiedResourceFile; /** * Read the schema back out of a parsed resource file. Throws * {@link EntityResourceError} with a stable failure kind. */ export declare function unwrapResource(file: unknown): EntityJSON; /** * Replace the schema inside an existing resource file. Returns a new object for * the caller to persist via {@link serialize}. Wrapper properties this function * doesn't own — including ones other tools added — are preserved, and `key` is * left alone since the entity Id is minted once at creation. */ export declare function updateResourceSchema(file: UnifiedResourceFile, entity: EntityJSON): UnifiedResourceFile;