import type { UniversalPHP } from '@php-wasm/universal'; import type { RuntimeConfiguration } from '../types'; import type { ResolveRuntimeConfigurationOptions } from '../resolve-runtime-configuration'; import { type CompileBlueprintV1Options } from '../v1/compile'; import type { StepDefinition } from '../steps'; import type { BlueprintV2Declaration } from './blueprint-v2-declaration'; import { type BlueprintV2SiteMode } from './resolve-runtime-configuration'; export declare class UnsupportedBlueprintV2FeatureError extends Error { readonly featurePath: string; constructor(featurePath: string, message?: string); } type BlueprintV2ApplicationOptions = BlueprintV2Declaration['applicationOptions']; type BlueprintV2ContentBaseline = NonNullable; type BlueprintV2Constants = NonNullable; type BlueprintV2SiteOptions = NonNullable; type BlueprintV2MuPlugin = NonNullable[number]; type BlueprintV2Theme = NonNullable[number]; type BlueprintV2ActiveTheme = NonNullable; type BlueprintV2Plugin = NonNullable[number]; type BlueprintV2Fonts = NonNullable; type BlueprintV2Media = NonNullable[number]; type BlueprintV2Role = NonNullable[number]; type BlueprintV2User = NonNullable[number]; type BlueprintV2PostTypes = NonNullable; type BlueprintV2Content = NonNullable[number]; type BlueprintV2Step = NonNullable[number]; export type BlueprintV2ExecutionPlan = BlueprintV2ExecutionPlanItem[]; export type BlueprintV2StepPlan = StepDefinition[]; export type BlueprintV2StepPlanLoweringResult = { steps: BlueprintV2StepPlan; unsupportedPlan: BlueprintV2ExecutionPlan; }; export type BlueprintV2ExecutionPlanItem = { type: 'applyContentBaseline'; contentBaseline: BlueprintV2ContentBaseline; sourcePath: '/contentBaseline'; } | { type: 'applyUsersBaseline'; sourcePath: '/usersBaseline'; } | { type: 'defineWpConfigConsts'; consts: BlueprintV2Constants; } | { type: 'setSiteOptions'; options: BlueprintV2SiteOptions; } | { type: 'installMuPlugin'; muPlugin: BlueprintV2MuPlugin; sourcePath: string; } | { type: 'installTheme'; theme: BlueprintV2Theme; active: false; sourcePath: string; } | { type: 'installTheme'; theme: BlueprintV2ActiveTheme; active: true; sourcePath: string; } | { type: 'installPlugin'; plugin: BlueprintV2Plugin; sourcePath: string; } | { type: 'installFonts'; fonts: BlueprintV2Fonts; } | { type: 'importMedia'; media: BlueprintV2Media; sourcePath: string; } | { type: 'setSiteLanguage'; language: string; } | { type: 'defineRoles'; roles: BlueprintV2Role[]; } | { type: 'defineUsers'; users: BlueprintV2User[]; } | { type: 'definePostTypes'; postTypes: BlueprintV2PostTypes; } | { type: 'importContent'; content: BlueprintV2Content; sourcePath: string; } | { type: 'runStep'; step: BlueprintV2Step; sourcePath: string; }; export type CompiledBlueprintV2 = { runtime: RuntimeConfiguration; applicationOptions?: BlueprintV2ApplicationOptions; plan: BlueprintV2ExecutionPlan; steps: BlueprintV2StepPlan; unsupportedPlan: BlueprintV2ExecutionPlan; run: (playground: UniversalPHP) => Promise; }; export type CompileBlueprintV2Options = Pick & ResolveRuntimeConfigurationOptions & { onBlueprintValidated?: (blueprint: BlueprintV2Declaration) => void; }; export type ResolveBlueprintV2WordPressSourceOptions = Pick; /** * Compiles a Blueprint v2 declaration into the pieces the TypeScript runner can * understand today. * * It resolves runtime options, creates an ordered v2 execution plan, and lowers * supported plan items into v1 step records. Fully lowered plans run through the * existing v1 runner; unsupported items stay visible and block execution before * any partial work is applied. */ export declare function compileBlueprintV2(declaration: BlueprintV2Declaration, options?: CompileBlueprintV2Options): Promise; /** * Loads a custom WordPress source into the file expected by the boot API. * * Built-in versions and HTTP(S) ZIP URLs already use each consumer's normal * WordPress download path. Execution-context, inline, and Git references need * the Blueprint resource loader to turn them into a concrete archive first. */ export declare function resolveBlueprintV2WordPressSource(declaration: BlueprintV2Declaration, options?: ResolveBlueprintV2WordPressSourceOptions): Promise; /** * Converts the top-level Blueprint v2 fields into a simple ordered plan. * * The plan keeps the original v2 data intact. It only decides execution order * and records where each item came from, which makes unsupported items visible * instead of silently dropping them during lowering. */ export declare function createBlueprintV2ExecutionPlan(declaration: BlueprintV2Declaration, siteMode?: BlueprintV2SiteMode): BlueprintV2ExecutionPlan; /** * Converts the supported v2 plan items into v1-compatible step records. * * The v1 step runner already knows how to install plugins, install themes, set * options, and run several imperative steps. This function reuses those shapes * while keeping unsupported v2-only work in `unsupportedPlan` for future PRs. */ export declare function lowerBlueprintV2ExecutionPlan(plan: BlueprintV2ExecutionPlan): BlueprintV2StepPlanLoweringResult; export {};