import type { DirectusTemplateConfig } from '../types.js'; export interface TemplateVariantOption { description?: string; id: string; name: string; requiresLicense: boolean; template: string; } export interface TemplateInfo { config: DirectusTemplateConfig; frontendOptions: Array<{ id: string; name: string; path: string; }>; variantOptions: TemplateVariantOption[]; } /** * Get the Directus template path for a variant, or the default template when no variant is given * @param config Template configuration from package.json * @param variant Variant key from directus:template.variants * @returns Template path relative to the starter root, or null for blank starters * @throws Error if the variant doesn't exist */ export declare function getTemplatePath(config: DirectusTemplateConfig, variant?: string): null | string; export type VariantDecision = { kind: 'ask-license'; licensedVariant: string; } | { kind: 'ask-variant'; } | { kind: 'error'; message: string; } | { kind: 'use'; variant?: string; }; /** * Decide which template variant to apply, or what to ask. A template whose only variant needs a license * becomes a yes/no license question; anything else falls back to picking from the list. Without a terminal * to ask in, the core template is used. * @param options Template variants and the related init flags * @param options.hasLicenseKey Whether --license-key was given * @param options.interactive Whether the user can be asked (stdin is a terminal) * @param options.license --license (true), --no-license (false), or not set * @param options.templateRequiresLicense Whether the template itself needs a license (cms-i18n) * @param options.variant --variant, if given * @param options.variantOptions Variants declared by the template * @returns The variant to use (undefined = core template), the question to ask, or an error */ export declare function decideVariant(options: { hasLicenseKey: boolean; interactive: boolean; license?: boolean; templateRequiresLicense?: boolean; variant?: string; variantOptions: TemplateVariantOption[]; }): VariantDecision; /** * Read and validate the template configuration from a directory * @param dir Directory containing the template * @returns Template configuration and frontend options * @throws Error if package.json is missing or invalid */ export declare function readTemplateConfig(dir: string): null | TemplateInfo;