import { FxError } from "@microsoft/teamsfx-api"; import { Result } from "neverthrow"; /** Package namespace. */ export type PackageKind = "create" | "modify"; /** Validation mode; only `load` compares this engine against `minEngineVersion`. */ export type ValidateMode = "build" | "load"; /** One content file's path plus extracted `{{token}}` names. */ export interface ContentFile { path: string; placeholders: string[]; } /** JSON-schema validator face; `undefined` means valid. */ export type SchemaValidator = (data: unknown) => string | undefined; /** Narrow validation port; schema, package, and engine-context data stay injected. */ export interface TemplatePackagePort { /** The package's parsed `descriptor.json`, or `undefined` when absent. */ descriptor(): unknown | undefined; /** The package's parsed `questions.json`, or `undefined` when absent. */ questions(): unknown | undefined; /** The package's parsed `pipeline.json`, or `undefined` when absent. */ pipeline(): unknown | undefined; /** Each content file's path + `{{token}}` set, or `undefined` when `content/` is absent. */ content(): ContentFile[] | undefined; /** The per-kind `selector.json` (parsed). */ selector(kind: PackageKind): unknown; /** The JSON-schema validators under `templates/v4/schema/`. */ schemas: { descriptor: SchemaValidator; question: SchemaValidator; selector: SchemaValidator; }; /** The consuming engine's SemVer (the `load`-mode reverse gate). */ engineVersion(): string; /** The closed caller-injected identifier names (`appName`, the `language` axis, …). */ callerFloor(): string[]; /** The `templateId`s whose `descriptor.json` is present in the artifact, per kind. */ presentTemplateIds(kind: PackageKind): string[]; } /** The validated package outcome. */ export interface ValidatedPackage { /** The parsed, schema-valid descriptor. */ descriptor: Record; /** The resolved reverse-gate floor (recorded on outcome / telemetry). */ minEngineVersion: string; /** The validated content-file list (empty when `content/` is absent). */ contentFiles: ContentFile[]; } /** `UserError` name: a required package file (`descriptor`/`questions`/`pipeline`) is absent. */ export declare const VALIDATE_REQUIRED_FILE = "TemplatePackageRequiredFile"; /** `UserError` name: a package file failed its JSON schema. */ export declare const VALIDATE_SCHEMA = "TemplatePackageSchema"; /** `UserError` name: a content token has no producer, or a required var has no consumer. */ export declare const VALIDATE_PLACEHOLDER_DRIFT = "TemplatePackagePlaceholderDrift"; /** `UserError` name: a v4 selector route names a `templateId` with no present descriptor. */ export declare const VALIDATE_DANGLING_ROUTE = "TemplatePackageDanglingRoute"; /** `UserError` name: the same `templateId` is routed in both the create and modify selectors. */ export declare const VALIDATE_KIND_OVERLAP = "TemplatePackageKindOverlap"; /** `UserError` name: `descriptor.minEngineVersion` is missing (it is mandatory). */ export declare const VALIDATE_MIN_ENGINE_MISSING = "TemplatePackageMinEngineVersionMissing"; /** `UserError` name: `engineVersion < minEngineVersion` — the engine is too old. */ export declare const VALIDATE_ENGINE_TOO_OLD = "TemplatePackageEngineTooOld"; /** Validate one `/` package before any content is rendered. */ export declare function validateTemplatePackage(kind: PackageKind, id: string, mode: ValidateMode, port: TemplatePackagePort): Result; //# sourceMappingURL=validateTemplatePackage.d.ts.map