import { EngineServicesClient } from './client'; import { Recipe, RecipeManifest } from './recipes'; import { OperationBuilder } from './op-builder'; import { readFrag } from './frag-items'; import { innerJson, levelNames, levelsOf, printOf, readPickedFrag, recordsOf, siteLocationOf, stylesOf, whatItMadeBefore } from './builtin-recipes/shared'; /** The wire shape of a project recipe's file. */ export interface ProjectRecipeFile { schema: typeof PROJECT_RECIPE_SCHEMA; manifest: RecipeManifest; /** An ES module: `export async function run(context) { … }`, with `context.kit` for its tools. */ code: string; /** Who saved this version, and what they said it changed. */ author?: string; note?: string; savedAt?: string; } export declare const PROJECT_RECIPE_SCHEMA = "thatopen/recipe@1"; /** One recipe of the catalog: where it comes from, and for a project one, its version. */ export interface CatalogEntry { manifest: RecipeManifest; /** Shipped with the platform, or made in this project. */ origin: 'builtin' | 'project'; /** A project recipe's latest storage version ('v3'). */ version?: string; author?: string; savedAt?: string; } /** One saved version of a project recipe. */ export interface RecipeVersion { version: string; author?: string; note?: string; savedAt?: string; } /** * What a recipe's code is given to work with (`context.kit`), the same tools the built-ins are written * with: reading the platform's records out of a model, building the changes, units, fingerprints. */ export declare const RecipeKit: { OperationBuilder: typeof OperationBuilder; OP_SCHEMA: string; readFrag: typeof readFrag; readPickedFrag: typeof readPickedFrag; recordsOf: typeof recordsOf; innerJson: typeof innerJson; levelsOf: typeof levelsOf; levelNames: typeof levelNames; stylesOf: typeof stylesOf; printOf: typeof printOf; siteLocationOf: typeof siteLocationOf; whatItMadeBefore: typeof whatItMadeBefore; ELEMENT_FIELD: string; CARRIED_FIELD: string; FEET_PER_METRE: number; }; export type RecipeKit = typeof RecipeKit; /** A recipe name a file and a catalog can both carry: lower case, digits and dashes. */ export declare const RECIPE_NAME: RegExp; /** * The project-recipe half of `client.recipes`: list, save, version and load. Kept apart from the registry * so the registry stays what the built-ins need and nothing more. */ export declare class ProjectRecipes { #private; private readonly client; private readonly builtinNames; constructor(client: EngineServicesClient, builtinNames: () => Set); /** The project's recipes, each its latest version. */ list(projectId: string): Promise; /** Every saved version of a project recipe, oldest first. */ versions(projectId: string, name: string): Promise; /** A project recipe's file as saved: its manifest and its code (the latest version unless one is named). */ source(projectId: string, name: string, version?: string): Promise; /** * Saves a recipe in the project: a new file the first time, a new version after. Checked before it is * written: a valid name that is not a built-in's, a manifest that says what it writes, and code that * compiles and exports `run`. Returns the version it was saved as. */ save(projectId: string, recipe: { manifest: RecipeManifest; code: string; }, options: { author: string; note?: string; }): Promise; /** A project recipe, ready to run: the latest version unless one is named. */ load(projectId: string, name: string, version?: string): Promise<{ recipe: Recipe; version: string; }>; } /** * Turns a recipe's code into a recipe: the module is loaded (a `data:` URL, which a page and node both * import) and its `run` is wrapped so it gets the kit. Throws, saying why, when it does not load or has * no `run`. */ export declare function compileRecipe(manifest: RecipeManifest, code: string): Promise>; /** * The changes a run asks for, as data a person (or an AI checking its recipe) can read: one entry per * change, in order, with its verb, the element it targets (for set and remove), the source it answers to, * and what it writes. No Revit needed: this is what the plugin would apply. */ export declare function describeChanges(payload: Blob | Uint8Array): Promise<{ envelope: Record; changes: { op: string; target?: string; source?: string; attrs: Record; }[]; }>;