import { CreateProjectResult, FxError, Inputs, UserInteraction } from "@microsoft/teamsfx-api"; import { Result } from "neverthrow"; import { Answers, BuildTarget, TemplateArtifactKind, TemplateArtifactSnapshot, resolveCreateTargetByTemplateId, runCreateInputs, runCreateSelector } from "../v4"; import type { ResolvedV4ChannelPackage } from "../component/generator/v4TemplateBridge"; /** * The create front door's injected seams. `createV3` is required — it is both the * flag-off pass-through and the engine=v3 hand-off, and injecting it (rather than * importing `FxCore`) keeps this seam free of an import cycle. `scaffoldV4`, * `runInputs`, and `applyV3PreFill` are the flag-on hand-offs the * composition root (`FxCore`) supplies. The remaining members default to the real * wiring, so a production caller passes only the four handlers. */ export interface CreateFrontDoorDeps { /** The flag-off pass-through + the engine=v3 hand-off: the unmodified `FxCore.createProject`. */ createV3: (inputs: Inputs) => Promise>; /** The engine=v4 hand-off: build the scaffold context + run the authored declarative package. */ scaffoldV4: (inputs: Inputs, target: BuildTarget, answers: Answers, flagReader: (name: string) => boolean, resolvedPackage?: ResolvedV4ChannelPackage) => Promise>; /** Legacy create-floor seam retained for existing composition wiring; v4 now appends floor questions inside `runInputs`. */ collectCreateFloor: (inputs: Inputs, ui: UserInteraction) => Promise>; /** The engine=v3 adapter: translate the Q1 dimension picks onto the v3 `QuestionNames.*` (INV-5). */ applyV3PreFill: (inputs: Inputs, target: BuildTarget) => void; /** The feature-flag reader (default: `featureFlagManager`-backed, so VS Code-settings flags apply). */ flagReader?: (name: string) => boolean; /** The bundled-floor channel-zip reader (default: the shipped `templates.zip`; injectable for tests, INV-6). */ readFloorBytes?: () => Buffer; /** Per-invocation staged artifact snapshot. When supplied, Q1/Q2/full staging read from this snapshot. */ artifactSnapshot?: TemplateArtifactSnapshot; /** Resolves a per-invocation staged artifact snapshot after the v4 flag is known to be on. */ resolveArtifactSnapshot?: (requiredKind: TemplateArtifactKind) => Promise>; /** Membership test supplied with selector-only artifacts. */ v4Registry?: (templateId: string) => boolean; /** The host surface (default: `TOOLS.ui`). */ ui?: UserInteraction; /** The Q1 selector walk (default: the real `runCreateSelector`). */ runSelector?: typeof runCreateSelector; /** Resolve a target directly from a preset `template-name`, bypassing Q1 (default: the real `resolveCreateTargetByTemplateId`). */ resolveByTemplateId?: typeof resolveCreateTargetByTemplateId; /** The Q2 inputs walk (default: the real `runCreateInputs`). */ runInputs?: typeof runCreateInputs; } /** * Run the create front door for `inputs`, dispatching the resolved engine. * * @param inputs the v3 create inputs (carries `platform`; mutated in place by the * engine=v3 pre-fill before the hand-off to `createV3`) * @param deps the injected seams (see `CreateFrontDoorDeps`) * @returns the created project (drop-in for `FxCore.createProject`), or a * `UserError` / `SystemError` (a surface cancellation or a route break) */ export declare function createProjectFrontDoor(inputs: Inputs, deps: CreateFrontDoorDeps): Promise>; //# sourceMappingURL=createProjectFrontDoor.d.ts.map